@heybejs/core 1.5.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,7 +10,7 @@ Error generating stack: `+e.message+`
|
|
|
10
10
|
`+e.stack}}var Ue=Object.prototype.hasOwnProperty,We=t.unstable_scheduleCallback,Ge=t.unstable_cancelCallback,Ke=t.unstable_shouldYield,qe=t.unstable_requestPaint,Je=t.unstable_now,Ye=t.unstable_getCurrentPriorityLevel,Xe=t.unstable_ImmediatePriority,Ze=t.unstable_UserBlockingPriority,Qe=t.unstable_NormalPriority,$e=t.unstable_LowPriority,et=t.unstable_IdlePriority,tt=t.log,nt=t.unstable_setDisableYieldValue,rt=null,it=null;function at(e){if(typeof tt==`function`&&nt(e),it&&typeof it.setStrictMode==`function`)try{it.setStrictMode(rt,e)}catch{}}var ot=Math.clz32?Math.clz32:lt,st=Math.log,ct=Math.LN2;function lt(e){return e>>>=0,e===0?32:31-(st(e)/ct|0)|0}var ut=256,dt=262144,ft=4194304;function pt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function mt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=pt(n))):i=pt(o):i=pt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=pt(n))):i=pt(o)):i=pt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ht(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function gt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-ot(n),i=1<<r;t|=e[r],n&=~i}return t}function _t(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 vt(){var e=ft;return ft<<=1,!(ft&62914560)&&(ft=4194304),e}function yt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function bt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function xt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-ot(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&St(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function St(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ot(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ct(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ot(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function wt(e,t){var n=t&-t;return n=n&42?1:Tt(n),(n&(e.suspendedLanes|t))===0?n:0}function Tt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Et(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Dt(){var e=O.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function Ot(e,t){var n=O.p;try{return O.p=e,t()}finally{O.p=n}}var kt=Math.random().toString(36).slice(2),At=`__reactFiber$`+kt,jt=`__reactProps$`+kt,Mt=`__reactContainer$`+kt,Nt=`__reactEvents$`+kt,Pt=`__reactListeners$`+kt,Ft=`__reactHandles$`+kt,It=`__reactResources$`+kt,Lt=`__reactMarker$`+kt,Rt=`__reactLoad$`+kt;function zt(e){delete e[At],delete e[jt],delete e[Pt],delete e[Ft]}function Bt(e){var t;if(t=e[At])return t;for(var n=e.parentNode;n;){if(t=n[Mt]||n[At]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[At])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Vt(e){if(e=e[At]||e[Mt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ht(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Ut(e){var t=e[It];return t||=e[It]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Wt(e){e[Lt]=!0}function Gt(e){e[Rt]=void 0}var Kt=new Set,qt={};function Jt(e,t){Yt(e,t),Yt(e+`Capture`,t)}function Yt(e,t){for(qt[e]=t,e=0;e<t.length;e++)Kt.add(t[e])}var Xt=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]*$`),Zt={},Qt={};function $t(e){return Ue.call(Qt,e)?!0:Ue.call(Zt,e)?!1:Xt.test(e)?Qt[e]=!0:(Zt[e]=!0,!1)}var A=!1;function en(){var e=A;return A=!1,e}function tn(e,t,n){if($t(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function nn(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function rn(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function an(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function on(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function sn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function cn(e){if(!e._valueTracker){var t=on(e)?`checked`:`value`;e._valueTracker=sn(e,t,``+e[t])}}function ln(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=on(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var un=/[\n"\\]/g;function dn(e){return e.replace(un,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function fn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+an(t)):e.value!==``+an(t)&&(e.value=``+an(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):mn(e,an(n)):o===`number`&&e.value==t?mn(e,an(e.value)):mn(e,an(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+an(s):e.removeAttribute(`name`)}function pn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){cn(e);return}n=n==null?``:``+an(n),t=t==null?n:``+an(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),cn(e)}function mn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function hn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+an(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function gn(e,t,n){t!=null&&(t=``+an(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+an(n)}function _n(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(o(92));if(Se(r)){if(1<r.length)throw Error(o(93));r=r[0]}n=r}n??=``,t=n}n=an(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),cn(e)}function vn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var yn=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 bn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||yn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function xn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(o(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,A=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(bn(e,i,r),A=!0)}else for(var a in t)t.hasOwnProperty(a)&&bn(e,a,t[a])}function Sn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Cn=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`],[`maskType`,`mask-type`],[`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`]]),wn=/^[\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 Tn(e){return wn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function En(){}var Dn=null;function On(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var kn=null,An=null;function jn(e){var t=Vt(e);if(t&&(e=t.stateNode)){var n=e[jt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(fn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+dn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[jt]||null;if(!i)throw Error(o(90));fn(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&ln(r)}break a;case`textarea`:gn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&hn(e,!!n.multiple,t,!1)}}}var Mn=!1;function Nn(e,t,n){if(Mn)return e(t,n);Mn=!0;try{return e(t)}finally{if(Mn=!1,(kn!==null||An!==null)&&(zd(),kn&&(t=kn,e=An,An=kn=null,jn(t),e)))for(t=0;t<e.length;t++)jn(e[t])}}function Pn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[jt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(o(231,t,typeof n));return n}var Fn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,In=!1;if(Fn)try{var Ln={};Object.defineProperty(Ln,"passive",{get:function(){In=!0}}),window.addEventListener(`test`,Ln,Ln),window.removeEventListener(`test`,Ln,Ln)}catch{In=!1}var Rn=null,zn=null,Bn=null;function Vn(){if(Bn)return Bn;var e,t=zn,n=t.length,r,i=`value`in Rn?Rn.value:Rn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Bn=i.slice(e,1<r?1-r:void 0)}function Hn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Un(){return!0}function Wn(){return!1}function Gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Un:Wn,this.isPropagationStopped=Wn,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Un)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Un)},persist:function(){},isPersistent:Un}),t}var Kn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qn=Gn(Kn),Jn=T({},Kn,{view:0,detail:0}),Yn=Gn(Jn),Xn,j,Zn,Qn=T({},Jn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Zn&&(Zn&&e.type===`mousemove`?(Xn=e.screenX-Zn.screenX,j=e.screenY-Zn.screenY):j=Xn=0,Zn=e),Xn)},movementY:function(e){return`movementY`in e?e.movementY:j}}),$n=Gn(Qn),er=Gn(T({},Qn,{dataTransfer:0})),tr=Gn(T({},Jn,{relatedTarget:0})),nr=Gn(T({},Kn,{animationName:0,elapsedTime:0,pseudoElement:0})),rr=Gn(T({},Kn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),ir=Gn(T({},Kn,{data:0})),ar={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},or={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`},sr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function cr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sr[e])?!!t[e]:!1}function lr(){return cr}var ur=Gn(T({},Jn,{key:function(e){if(e.key){var t=ar[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Hn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?or[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lr,charCode:function(e){return e.type===`keypress`?Hn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Hn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),dr=Gn(T({},Qn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),fr=Gn(T({},Kn,{submitter:0})),pr=Gn(T({},Jn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lr})),mr=Gn(T({},Kn,{propertyName:0,elapsedTime:0,pseudoElement:0})),hr=Gn(T({},Qn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),gr=Gn(T({},Kn,{newState:0,oldState:0,source:0})),_r=[9,13,27,32],vr=Fn&&`CompositionEvent`in window,yr=null;Fn&&`documentMode`in document&&(yr=document.documentMode);var br=Fn&&`TextEvent`in window&&!yr,xr=Fn&&(!vr||yr&&8<yr&&11>=yr),Sr=` `,Cr=!1;function wr(e,t){switch(e){case`keyup`:return _r.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Tr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Er=!1;function Dr(e,t){switch(e){case`compositionend`:return Tr(t);case`keypress`:return t.which===32?(Cr=!0,Sr):null;case`textInput`:return e=t.data,e===Sr&&Cr?null:e;default:return null}}function Or(e,t){if(Er)return e===`compositionend`||!vr&&wr(e,t)?(e=Vn(),Bn=zn=Rn=null,Er=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return xr&&t.locale!==`ko`?null:t.data;default:return null}}var kr={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 Ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!kr[e.type]:t===`textarea`}function jr(e,t,n,r){kn?An?An.push(r):An=[r]:kn=r,t=Jf(t,`onChange`),0<t.length&&(n=new qn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var M=null,Mr=null;function Nr(e){Vf(e,0)}function Pr(e){if(ln(Ht(e)))return e}function Fr(e,t){if(e===`change`)return t}var Ir=!1;if(Fn){var Lr;if(Fn){var Rr=`oninput`in document;if(!Rr){var zr=document.createElement(`div`);zr.setAttribute(`oninput`,`return;`),Rr=typeof zr.oninput==`function`}Lr=Rr}else Lr=!1;Ir=Lr&&(!document.documentMode||9<document.documentMode)}function Br(){M&&(M.detachEvent(`onpropertychange`,Vr),Mr=M=null)}function Vr(e){if(e.propertyName===`value`&&Pr(Mr)){var t=[];jr(t,Mr,e,On(e)),Nn(Nr,t)}}function Hr(e,t,n){e===`focusin`?(Br(),M=t,Mr=n,M.attachEvent(`onpropertychange`,Vr)):e===`focusout`&&Br()}function Ur(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Pr(Mr)}function Wr(e,t){if(e===`click`)return Pr(t)}function Gr(e,t){if(e===`input`||e===`change`)return Pr(t)}function Kr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var qr=typeof Object.is==`function`?Object.is:Kr;function Jr(e,t){if(qr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ue.call(t,i)||!qr(e[i],t[i]))return!1}return!0}function Yr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Xr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zr(e,t){var n=Xr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Xr(n)}}function Qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $r(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Yr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Yr(e.document)}return t}function ei(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var ti=Fn&&`documentMode`in document&&11>=document.documentMode,ni=null,ri=null,ii=null,ai=!1;function oi(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ai||ni==null||ni!==Yr(r)||(r=ni,`selectionStart`in r&&ei(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ii&&Jr(ii,r)||(ii=r,r=Jf(ri,`onSelect`),0<r.length&&(t=new qn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ni)))}function si(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ci={animationend:si(`Animation`,`AnimationEnd`),animationiteration:si(`Animation`,`AnimationIteration`),animationstart:si(`Animation`,`AnimationStart`),transitionrun:si(`Transition`,`TransitionRun`),transitionstart:si(`Transition`,`TransitionStart`),transitioncancel:si(`Transition`,`TransitionCancel`),transitionend:si(`Transition`,`TransitionEnd`)},li={},ui={};Fn&&(ui=document.createElement(`div`).style,`AnimationEvent`in window||(delete ci.animationend.animation,delete ci.animationiteration.animation,delete ci.animationstart.animation),`TransitionEvent`in window||delete ci.transitionend.transition);function di(e){if(li[e])return li[e];if(!ci[e])return e;var t=ci[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ui)return li[e]=t[n];return e}var fi=di(`animationend`),pi=di(`animationiteration`),mi=di(`animationstart`),hi=di(`transitionrun`),gi=di(`transitionstart`),_i=di(`transitioncancel`),vi=di(`transitionend`),yi=new Map,bi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);bi.push(`scrollEnd`);function xi(e,t){yi.set(e,t),Jt(t,[e])}var Si=0;function Ci(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Cd.identifierPrefix;var n=Si++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function wi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ad;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function Ti(e,t){return e=wi(e),t=wi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Ei=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Di=[],Oi=0,ki=0;function Ai(){for(var e=Oi,t=ki=Oi=0;t<e;){var n=Di[t];Di[t++]=null;var r=Di[t];Di[t++]=null;var i=Di[t];Di[t++]=null;var a=Di[t];if(Di[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Fi(n,i,a)}}function ji(e,t,n,r){Di[Oi++]=e,Di[Oi++]=t,Di[Oi++]=n,Di[Oi++]=r,ki|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ni(e,t,n,r){return ji(e,t,n,r),Ii(e)}function Pi(e,t){return ji(e,null,null,t),Ii(e)}function Fi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-ot(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ii(e){if(50<jd)throw jd=0,Y=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Li={};function Ri(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zi(e,t,n,r){return new Ri(e,t,n,r)}function Bi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vi(e,t){var n=e.alternate;return n===null?(n=zi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Hi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ui(e,t,n,r,i,a){var s=0;if(r=e,typeof r==`function`)Bi(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,Oe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case pe:return e=zi(31,n,t,i),e.elementType=pe,e.lanes=a,e;case ie:return Wi(n.children,i,a,t);case ae:s=8,i|=24;break;case E:return e=zi(12,n,t,i|2),e.elementType=E,e.lanes=a,e;case le:return e=zi(13,n,t,i),e.elementType=le,e.lanes=a,e;case ue:return e=zi(19,n,t,i),e.elementType=ue,e.lanes=a,e;case me:case ge:return e=i|32,e=zi(30,n,t,e),e.elementType=ge,e.lanes=a,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case se:s=10;break a;case oe:s=9;break a;case ce:s=11;break a;case de:s=14;break a;case fe:s=16,r=null;break a}s=29,n=Error(o(130,e===null?`null`:typeof e,``)),r=null}return t=zi(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Wi(e,t,n,r){return e=zi(7,e,r,t),e.lanes=n,e}function Gi(e,t,n){return e=zi(6,e,null,t),e.lanes=n,e}function Ki(e){var t=zi(18,null,null,0);return t.stateNode=e,t}function qi(e,t,n){return t=zi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ji=new WeakMap;function Yi(e,t){if(typeof e==`object`&&e){var n=Ji.get(e);return n===void 0?(t={value:e,source:t,stack:He(t)},Ji.set(e,t),t):n}return{value:e,source:t,stack:He(t)}}var Xi=[],Zi=0,Qi=null,$i=0,ea=[],ta=0,na=null,ra=1,ia=``;function aa(e,t){Xi[Zi++]=$i,Xi[Zi++]=Qi,Qi=e,$i=t}function oa(e,t,n){ea[ta++]=ra,ea[ta++]=ia,ea[ta++]=na,na=e;var r=ra;e=ia;var i=32-ot(r)-1;r&=~(1<<i),n+=1;var a=32-ot(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ra=1<<32-ot(t)+i|n<<i|r,ia=a+e}else ra=1<<a|n<<i|r,ia=e}function sa(e){e.return!==null&&(aa(e,1),oa(e,1,0))}function ca(e){for(;e===Qi;)Qi=Xi[--Zi],Xi[Zi]=null,$i=Xi[--Zi],Xi[Zi]=null;for(;e===na;)na=ea[--ta],ea[ta]=null,ia=ea[--ta],ea[ta]=null,ra=ea[--ta],ea[ta]=null}function la(e,t){ea[ta++]=ra,ea[ta++]=ia,ea[ta++]=na,ra=t.id,ia=t.overflow,na=e}var ua=null,N=null,P=!1,da=null,fa=!1,pa=Error(o(519));function ma(e){throw ba(Yi(Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),pa}function ha(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[At]=e,t[jt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Q(zf[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),pn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),_n(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||ep(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=En),t=!0):t=!1,t||ma(e,!0)}function ga(e){for(ua=e.return;ua;)switch(ua.tag){case 5:case 31:case 13:fa=!1;return;case 27:case 3:fa=!0;return;default:ua=ua.return}}function _a(e){if(e!==ua)return!1;if(!P)return ga(e),P=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&N&&ma(e),ga(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));N=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));N=dm(e)}else t===27?(t=N,Sp(e.type)?(e=um,um=null,N=e):N=t):N=ua?lm(e.stateNode.nextSibling):null;return!0}function va(){N=ua=null,P=!1}function ya(){var e=da;return e!==null&&(hd===null?hd=e:hd.push.apply(hd,e),da=null),e}function ba(e){da===null?da=[e]:da.push(e)}var xa=Ee(null),Sa=null,Ca=null;function wa(e,t,n){k(xa,t._currentValue),t._currentValue=n}function Ta(e){e._currentValue=xa.current,De(xa)}function Ea(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Da(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var s=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Ea(a.return,n,e),r||(s=null);break a}a=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(o(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Ea(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),Ea(i.return,n,e),s=i.child,s=s===null?null:s.sibling):s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Oa(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(o(387));if(s=s.memoizedProps,s!==null){var c=i.type;qr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===je.current){if(s=i.alternate,s===null)throw Error(o(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}i=i.return}return e!==null&&Da(t,e,n,r),t.flags|=262144,e!==null}function ka(e){for(e=e.firstContext;e!==null;){if(!qr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Aa(e){Sa=e,Ca=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ja(e){return Na(Sa,e)}function Ma(e,t){return Sa===null&&Aa(e),Na(e,t)}function Na(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ca===null){if(e===null)throw Error(o(308));Ca=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ca=Ca.next=t;return n}var Pa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Fa=t.unstable_scheduleCallback,Ia=t.unstable_NormalPriority,La={$$typeof:se,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ra(){return{controller:new Pa,data:new Map,refCount:0}}function za(e){e.refCount--,e.refCount===0&&Fa(Ia,function(){e.controller.abort()})}function Ba(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Va=null;function Ha(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ua=null,Wa=0,Ga=0,Ka=null;function qa(e,t){if(Ua===null){var n=Ua=[];Wa=0,Ga=Pf(),Ka={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Wa++,t.then(Ja,Ja),t}function Ja(){if(--Wa===0&&(Va=null,Ua!==null)){Ka!==null&&(Ka.status=`fulfilled`);var e=Ua;Ua=null,Ga=0,Ka=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ya(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Xa=D.S;D.S=function(e,t){if(vd=Je(),typeof t==`object`&&t&&typeof t.then==`function`&&qa(e,t),Va!==null)for(var n=bf;n!==null;)Ba(n,Va),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)Ba(r,n),r=r.next;if(Ga!==0){r=Va,r===null&&(r=Va=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Xa!==null&&Xa(e,t)};var Za=Ee(null);function Qa(){var e=Za.current;return e===null?U.pooledCache:e}function $a(e,t){t===null?k(Za,Za.current):k(Za,t.pool)}function eo(){var e=Qa();return e===null?null:{parent:La._currentValue,pool:e}}var to=Error(o(460)),no=Error(o(474)),ro=Error(o(542)),io={then:function(){}};function ao(e){return e=e.status,e===`fulfilled`||e===`rejected`}function oo(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(En,En),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,uo(e),e===void 0&&!(`reason`in t)?Error(o(600)):e;default:if(typeof t.status==`string`)t.then(En,En);else{if(e=U,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,uo(e),e}throw co=t,to}}function so(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(co=e,to):e}}var co=null;function lo(){if(co===null)throw Error(o(459));var e=co;return co=null,e}function uo(e){if(e===to||e===ro)throw Error(o(483))}var fo=null,po=0;function mo(e){var t=po;return po+=1,fo===null&&(fo=[]),oo(fo,e,t)}function ho(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function go(e,t){throw t.$$typeof===te?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function _o(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=Vi(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Gi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===ie?(e=d(e,t,n.props.children,r,n.key),ho(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===fe&&so(a)===t.type)?(t=i(t,n.props),ho(t,n),t.return=e,t):(t=Ui(n.type,n.key,n.props,null,e.mode,r),ho(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=qi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Wi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Gi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case ne:return n=Ui(t.type,t.key,t.props,null,e.mode,n),ho(n,t),n.return=e,n;case re:return t=qi(t,e.mode,n),t.return=e,t;case fe:return t=so(t),f(e,t,n)}if(Se(t)||ye(t))return t=Wi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,mo(t),n);if(t.$$typeof===se)return f(e,Ma(e,t),n);go(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case ne:return n.key===i?l(e,t,n,r):null;case re:return n.key===i?u(e,t,n,r):null;case fe:return n=so(n),p(e,t,n,r)}if(Se(n)||ye(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,mo(n),r);if(n.$$typeof===se)return p(e,t,Ma(e,n),r);go(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case ne:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case re:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case fe:return r=so(r),m(e,t,n,r,i)}if(Se(r)||ye(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,mo(r),i);if(r.$$typeof===se)return m(e,t,n,Ma(t,r),i);go(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),P&&aa(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return P&&aa(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),P&&aa(i,h),l}function g(i,s,c,l){if(c==null)throw Error(o(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=a(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),P&&aa(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return P&&aa(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),P&&aa(i,g),u}function _(e,r,a,c){if(typeof a==`object`&&a&&a.type===ie&&a.key===null&&a.props.ref===void 0&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case ne:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===ie){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),ho(c,a),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===fe&&so(l)===r.type){n(e,r.sibling),c=i(r,a.props),ho(c,a),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}a.type===ie?(c=Wi(a.props.children,e.mode,c,a.key),ho(c,a),c.return=e,e=c):(c=Ui(a.type,a.key,a.props,null,e.mode,c),ho(c,a),c.return=e,e=c)}return s(e);case re:a:{for(l=a.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=qi(a,e.mode,c),c.return=e,e=c}return s(e);case fe:return a=so(a),_(e,r,a,c)}if(Se(a))return h(e,r,a,c);if(ye(a)){if(l=ye(a),typeof l!=`function`)throw Error(o(150));return a=l.call(a),g(e,r,a,c)}if(typeof a.then==`function`)return _(e,r,mo(a),c);if(a.$$typeof===se)return _(e,r,Ma(e,a),c);go(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=Gi(a,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{po=0;var i=_(e,t,n,r);return fo=null,i}catch(t){if(t===to||t===ro)throw t;var a=zi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var vo=_o(!0),yo=_o(!1),bo=!1;function xo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function So(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Co(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function wo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,H&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ii(e),Fi(e,null,n),t}return ji(e,r,t,n),Ii(e)}function To(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ct(e,n)}}function Eo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Do=!1;function Oo(){if(Do){var e=Ka;if(e!==null)throw e}}function ko(e,t,n,r){Do=!1;var i=e.updateQueue;bo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(G&f)===f:(r&f)===f){f!==0&&f===Ga&&(Do=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:bo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ld|=o,e.lanes=o,e.memoizedState=d}}function Ao(e,t){if(typeof e!=`function`)throw Error(o(191,e));e.call(t)}function jo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ao(n[e],t)}var Mo=Ee(null),No=Ee(0);function Po(e,t){e=cd,k(No,e),k(Mo,t),cd=e|t.baseLanes}function Fo(){k(No,cd),k(Mo,Mo.current)}function Io(){cd=No.current,De(Mo),De(No)}var Lo=Ee(null),Ro=null;function zo(e){var t=e.alternate;k(F,F.current&1),k(Lo,e),Ro===null&&(t===null||Mo.current!==null||t.memoizedState!==null)&&(Ro=e)}function Bo(e){k(F,F.current),k(Lo,e),Ro===null&&(Ro=e)}function Vo(e){e.tag===22?(k(F,F.current),k(Lo,e),Ro===null&&(Ro=e)):Ho()}function Ho(){k(F,F.current),k(Lo,Lo.current)}function Uo(e){De(Lo),Ro===e&&(Ro=null),De(F)}var F=Ee(0);function Wo(e,t){k(Lo,Lo.current),k(F,t)}function Go(e){De(F),De(Lo),Ro===e&&(Ro=null)}function Ko(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var qo=0,I=null,L=null,Jo=null,Yo=!1,Xo=!1,Zo=!1,Qo=0,$o=0,es=null,ts=0;function ns(){throw Error(o(321))}function rs(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!qr(e[n],t[n]))return!1;return!0}function is(e,t,n,r,i,a){return qo=a,I=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=e===null||e.memoizedState===null?xc:Sc,Zo=!1,a=n(r,i),Zo=!1,Xo&&(a=os(t,n,r,i)),as(e),a}function as(e){D.H=bc;var t=L!==null&&L.next!==null;if(qo=0,Jo=L=I=null,Yo=!1,$o=0,es=null,t)throw Error(o(300));e===null||zc||(e=e.dependencies,e!==null&&ka(e)&&(zc=!0))}function os(e,t,n,r){I=e;var i=0;do{if(Xo&&(es=null),$o=0,Xo=!1,25<=i)throw Error(o(301));if(i+=1,Jo=L=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}D.H=Cc,a=t(n,r)}while(Xo);return a}function ss(){var e=D.H,t=e.useState()[0];return t=typeof t.then==`function`?ms(t):t,e=e.useState()[0],(L===null?null:L.memoizedState)!==e&&(I.flags|=1024),t}function cs(){var e=Qo!==0;return Qo=0,e}function ls(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function us(e){if(Yo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Yo=!1}qo=0,Jo=L=I=null,Xo=!1,$o=Qo=0,es=null}function ds(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jo===null?I.memoizedState=Jo=e:Jo=Jo.next=e,Jo}function fs(){if(L===null){var e=I.alternate;e=e===null?null:e.memoizedState}else e=L.next;var t=Jo===null?I.memoizedState:Jo.next;if(t!==null)Jo=t,L=e;else{if(e===null)throw I.alternate===null?Error(o(467)):Error(o(310));L=e,e={memoizedState:L.memoizedState,baseState:L.baseState,baseQueue:L.baseQueue,queue:L.queue,next:null},Jo===null?I.memoizedState=Jo=e:Jo=Jo.next=e}return Jo}function ps(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ms(e){var t=$o;return $o+=1,es===null&&(es=[]),e=oo(es,e,t),t=I,(Jo===null?t.memoizedState:Jo.next)===null&&(t=t.alternate,D.H=t===null||t.memoizedState===null?xc:Sc),e}function hs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ms(e);if(e.$$typeof===_e)return;if(e.$$typeof===se)return ja(e)}throw Error(o(438,String(e)))}function gs(e){var t=null,n=I.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=I.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ps(),I.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=he;return t.index++,n}function _s(e,t){return typeof t==`function`?t(e):t}function vs(e){return ys(fs(),L,e)}function ys(e,t,n){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(qo&f)===f:(G&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ga&&(d=!0);else if((qo&p)===p){u=u.next,p===Ga&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=a):l=l.next=f,I.lanes|=p,ld|=p;f=u.action,Zo&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=a):l=l.next=p,I.lanes|=f,ld|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=a:l.next=c,!qr(a,e.memoizedState)&&(zc=!0,d&&(n=Ka,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function bs(e){var t=fs(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);qr(a,t.memoizedState)||(zc=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function xs(e,t,n){var r=I,i=fs(),a=P;if(a){if(n===void 0)throw Error(o(407));n=n()}else n=t();var s=!qr((L||i).memoizedState,n);if(s&&(i.memoizedState=n,zc=!0),i=i.queue,Ks(ws.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||Jo!==null&&!!(Jo.memoizedState.tag&1),Vs(e?9:8,{destroy:void 0},Cs.bind(null,r,i,n,t),null),e){if(r.flags|=2048,U===null)throw Error(o(349));a||qo&127||Ss(r,t,n)}return n}function Ss(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=I.updateQueue,t===null?(t=ps(),I.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Cs(e,t,n,r){t.value=n,t.getSnapshot=r,Ts(t)&&Es(e)}function ws(e,t,n){return n(function(){Ts(t)&&Es(e)})}function Ts(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qr(e,n)}catch{return!0}}function Es(e){var t=Pi(e,2);t!==null&&Pd(t,e,2)}function Ds(e){var t=ds();if(typeof e==`function`){var n=e;if(e=n(),Zo){at(!0);try{n()}finally{at(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:e},t}function Os(e,t,n,r){return e.baseState=n,ys(e,L,typeof r==`function`?r:_s)}function ks(e,t,n,r,i){if(_c(e))throw Error(o(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};D.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,As(t,a)):(a.next=n.next,t.pending=n.next=a)}}function As(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=D.T,o={};o.types=a===null?null:a.types,D.T=o;try{var s=n(i,r),c=D.S;c!==null&&c(o,s),js(e,t,s)}catch(n){Ns(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),D.T=a}}else try{a=n(i,r),js(e,t,a)}catch(n){Ns(e,t,n)}}function js(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ms(e,t,n)},function(n){return Ns(e,t,n)}):Ms(e,t,n)}function Ms(e,t,n){t.status=`fulfilled`,t.value=n,Ps(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,As(e,n)))}function Ns(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ps(t),t=t.next;while(t!==r)}e.action=null}function Ps(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Fs(e,t){return t}function Is(e,t){if(P){var n=U.formState;if(n!==null){a:{var r=I;if(P){if(N){b:{for(var i=N,a=fa;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){N=lm(i.nextSibling),r=i.data===`F!`;break a}}ma(r)}r=!1}r&&(t=n[0])}}return n=ds(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fs,lastRenderedState:t},n.queue=r,n=mc.bind(null,I,r),r.dispatch=n,r=Ds(!1),a=gc.bind(null,I,!1,r.queue),r=ds(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ks.bind(null,I,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ls(e){return Rs(fs(),L,e)}function Rs(e,t,n){if(t=ys(e,t,Fs)[0],e=vs(_s)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ms(t)}catch(e){throw e===to?ro:e}else r=t;t=fs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(I.flags|=2048,Vs(9,{destroy:void 0},zs.bind(null,i,n),null)),[r,a,e]}function zs(e,t){e.action=t}function Bs(e){var t=fs(),n=L;if(n!==null)return Rs(t,n,e);fs(),t=t.memoizedState,n=fs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Vs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=I.updateQueue,t===null&&(t=ps(),I.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Hs(){return fs().memoizedState}function Us(e,t,n,r){var i=ds();I.flags|=e,i.memoizedState=Vs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ws(e,t,n,r){var i=fs();r=r===void 0?null:r;var a=i.memoizedState.inst;L!==null&&r!==null&&rs(r,L.memoizedState.deps)?i.memoizedState=Vs(t,a,n,r):(I.flags|=e,i.memoizedState=Vs(1|t,a,n,r))}function Gs(e,t){Us(8390656,8,e,t)}function Ks(e,t){Ws(2048,8,e,t)}function qs(e){I.flags|=4;var t=I.updateQueue;if(t===null)t=ps(),I.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Js(e){var t=fs().memoizedState;return qs({ref:t,nextImpl:e}),function(){if(H&2)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Ys(e,t){return Ws(4,2,e,t)}function Xs(e,t){return Ws(4,4,e,t)}function Zs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Qs(e,t,n){n=n==null?null:n.concat([e]),Ws(4,4,Zs.bind(null,t,e),n)}function $s(){}function ec(e,t){var n=fs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&rs(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function tc(e,t){var n=fs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&rs(t,r[1]))return r[0];if(r=e(),Zo){at(!0);try{e()}finally{at(!1)}}return n.memoizedState=[r,t],r}function nc(e,t,n){return n===void 0||qo&1073741824&&!(G&261930)?e.memoizedState=t:(e.memoizedState=n,e=Md(),I.lanes|=e,ld|=e,n)}function rc(e,t,n,r){return qr(n,t)?n:Mo.current===null?!(qo&106)||qo&1073741824&&!(G&261930)?(zc=!0,e.memoizedState=n):(e=Md(),I.lanes|=e,ld|=e,t):(e=nc(e,n,r),qr(e,t)||(zc=!0),e)}function ic(e,t,n,r,i){var a=O.p;O.p=a!==0&&8>a?a:8;var o=D.T,s={};s.types=o===null?null:o.types,D.T=s,gc(e,!1,t,n);try{var c=i(),l=D.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?hc(e,t,Ya(c,r),X(e)):hc(e,t,r,X(e))}catch(n){hc(e,t,{then:function(){},status:`rejected`,reason:n},X())}finally{O.p=a,o!==null&&s.types!==null&&(o.types=s.types),D.T=o}}function ac(){}function oc(e,t,n,r){if(e.tag!==5)throw Error(o(476));var i=sc(e).queue;ic(e,i,t,Ce,n===null?ac:function(){return cc(e),n(r)})}function sc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ce,baseState:Ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:Ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function cc(e){var t=sc(e);t.next===null&&(t=e.alternate.memoizedState),hc(e,t.next.queue,{},X())}function lc(){return ja(sh)}function uc(){return fs().memoizedState}function dc(){return fs().memoizedState}function fc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=X();e=Co(n);var r=wo(t,e,n);r!==null&&(Pd(r,t,n),To(r,t,n)),t={cache:Ra()},e.payload=t;return}t=t.return}}function pc(e,t,n){var r=X();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},_c(e)?vc(t,n):(n=Ni(e,t,n,r),n!==null&&(Pd(n,e,r),yc(n,t,r)))}function mc(e,t,n){hc(e,t,n,X())}function hc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(_c(e))vc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,qr(s,o))return ji(e,t,i,0),U===null&&Ai(),!1}catch{}if(n=Ni(e,t,i,r),n!==null)return Pd(n,e,r),yc(n,t,r),!0}return!1}function gc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},_c(e)){if(t)throw Error(o(479))}else t=Ni(e,n,r,2),t!==null&&Pd(t,e,2)}function _c(e){var t=e.alternate;return e===I||t!==null&&t===I}function vc(e,t){Xo=Yo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function yc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ct(e,n)}}var bc={readContext:ja,use:hs,useCallback:ns,useContext:ns,useEffect:ns,useImperativeHandle:ns,useLayoutEffect:ns,useInsertionEffect:ns,useMemo:ns,useReducer:ns,useRef:ns,useState:ns,useDebugValue:ns,useDeferredValue:ns,useTransition:ns,useSyncExternalStore:ns,useId:ns,useHostTransitionStatus:ns,useFormState:ns,useActionState:ns,useOptimistic:ns,useMemoCache:ns,useCacheRefresh:ns,useEffectEvent:ns},xc={readContext:ja,use:hs,useCallback:function(e,t){return ds().memoizedState=[e,t===void 0?null:t],e},useContext:ja,useEffect:Gs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Us(4194308,4,Zs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Us(4194308,4,e,t)},useInsertionEffect:function(e,t){Us(4,2,e,t)},useMemo:function(e,t){var n=ds();t=t===void 0?null:t;var r=e();if(Zo){at(!0);try{e()}finally{at(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ds();if(n!==void 0){var i=n(t);if(Zo){at(!0);try{n(t)}finally{at(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=pc.bind(null,I,e),[r.memoizedState,e]},useRef:function(e){var t=ds();return e={current:e},t.memoizedState=e},useState:function(e){e=Ds(e);var t=e.queue,n=mc.bind(null,I,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:$s,useDeferredValue:function(e,t){return nc(ds(),e,t)},useTransition:function(){var e=Ds(!1);return e=ic.bind(null,I,e.queue,!0,!1),ds().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=I,i=ds();if(P){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),U===null)throw Error(o(349));G&127||Ss(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Gs(ws.bind(null,r,a,e),[e]),r.flags|=2048,Vs(9,{destroy:void 0},Cs.bind(null,r,a,n,t),null),n},useId:function(){var e=ds(),t=U.identifierPrefix;if(P){var n=ia,r=ra;n=(r&~(1<<32-ot(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Qo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=ts++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:lc,useFormState:Is,useActionState:Is,useOptimistic:function(e){var t=ds();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=gc.bind(null,I,!0,n),n.dispatch=t,[e,t]},useMemoCache:gs,useCacheRefresh:function(){return ds().memoizedState=fc.bind(null,I)},useEffectEvent:function(e){var t=ds(),n={impl:e};return t.memoizedState=n,function(){if(H&2)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Sc={readContext:ja,use:hs,useCallback:ec,useContext:ja,useEffect:Ks,useImperativeHandle:Qs,useInsertionEffect:Ys,useLayoutEffect:Xs,useMemo:tc,useReducer:vs,useRef:Hs,useState:function(){return vs(_s)},useDebugValue:$s,useDeferredValue:function(e,t){return rc(fs(),L.memoizedState,e,t)},useTransition:function(){var e=vs(_s)[0],t=fs().memoizedState;return[typeof e==`boolean`?e:ms(e),t]},useSyncExternalStore:xs,useId:uc,useHostTransitionStatus:lc,useFormState:Ls,useActionState:Ls,useOptimistic:function(e,t){return Os(fs(),L,e,t)},useMemoCache:gs,useCacheRefresh:dc,useEffectEvent:Js},Cc={readContext:ja,use:hs,useCallback:ec,useContext:ja,useEffect:Ks,useImperativeHandle:Qs,useInsertionEffect:Ys,useLayoutEffect:Xs,useMemo:tc,useReducer:bs,useRef:Hs,useState:function(){return bs(_s)},useDebugValue:$s,useDeferredValue:function(e,t){var n=fs();return L===null?nc(n,e,t):rc(n,L.memoizedState,e,t)},useTransition:function(){var e=bs(_s)[0],t=fs().memoizedState;return[typeof e==`boolean`?e:ms(e),t]},useSyncExternalStore:xs,useId:uc,useHostTransitionStatus:lc,useFormState:Bs,useActionState:Bs,useOptimistic:function(e,t){var n=fs();return L===null?(n.baseState=e,[e,n.queue.dispatch]):Os(n,L,e,t)},useMemoCache:gs,useCacheRefresh:dc,useEffectEvent:Js};function wc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Tc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=X(),i=Co(r);i.payload=t,n!=null&&(i.callback=n),t=wo(e,i,r),t!==null&&(Pd(t,e,r),To(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=X(),i=Co(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=wo(e,i,r),t!==null&&(Pd(t,e,r),To(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=X(),r=Co(n);r.tag=2,t!=null&&(r.callback=t),t=wo(e,r,n),t!==null&&(Pd(t,e,n),To(t,e,n))}};function Ec(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Jr(n,r)||!Jr(i,a):!0}function Dc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Tc.enqueueReplaceState(t,t.state,null)}function Oc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function kc(e){Ei(e)}function Ac(e){console.error(e)}function jc(e){Ei(e)}function Mc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Nc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Pc(e,t,n){return n=Co(n),n.tag=3,n.payload={element:null},n.callback=function(){Mc(e,t)},n}function Fc(e){return e=Co(e),e.tag=3,e}function Ic(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Nc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Nc(t,n,r),typeof i!=`function`&&(xd===null?xd=new Set([this]):xd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Lc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Oa(t,n,i,!0),n=Lo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Ro===null?Kd():n.alternate===null&&q===0&&(q=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===io?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,i)),!1;case 22:return n.flags|=65536,r===io?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),mf(e,r,i)),!1}throw Error(o(435,n.tag))}return mf(e,r,i),Kd(),!1}if(P)return t=Lo.current,t===null?(r!==pa&&(t=Error(o(423),{cause:r}),ba(Yi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Yi(r,n),i=Pc(e.stateNode,r,i),Eo(e,i),q!==4&&(q=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==pa&&(e=Error(o(422),{cause:r}),ba(Yi(e,n)))),!1;var a=Error(o(520),{cause:r});if(a=Yi(a,n),md===null?md=[a]:md.push(a),q!==4&&(q=2),t===null)return!0;r=Yi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Pc(n.stateNode,r,e),Eo(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(xd===null||!xd.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Fc(i),Ic(i,e,n,r),Eo(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Rc=Error(o(461)),zc=!1;function Bc(e,t,n,r){t.child=e===null?yo(t,null,n,r):vo(t,e.child,n,r)}function Vc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Aa(t),r=is(e,t,n,o,a,i),s=cs(),e!==null&&!zc?(ls(e,t,i),hl(e,t,i)):(P&&s&&sa(t),t.flags|=1,Bc(e,t,r,i),t.child)}function Hc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Bi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Uc(e,t,a,r,i)):(e=Ui(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!gl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Jr:n,n(o,r)&&e.ref===t.ref)return hl(e,t,i)}return t.flags|=1,e=Vi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Uc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Jr(a,r)&&e.ref===t.ref){if(zc=!1,t.pendingProps=r=a,gl(e,i))e.flags&131072&&(zc=!0);else return t.lanes=e.lanes,hl(e,t,i)}}return Zc(e,t,n,r,i)}function Wc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Kc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&$a(t,a===null?null:a.cachePool),a===null?Fo():Po(t,a),Vo(t);else return r=t.lanes=536870912,Kc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&$a(t,null),Fo(),Ho()):($a(t,a.cachePool),Po(t,a),Ho(),t.memoizedState=null);return Bc(e,t,i,n),t.child}function Gc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Kc(e,t,n,r,i){var a=Qa();return a=a===null?null:{parent:La._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&$a(t,null),Fo(),Vo(t),e!==null&&Oa(e,t,r,!0),t.childLanes=i,null}function qc(e,t){return t=ol({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Jc(e,t,n){return vo(t,e.child,null,n),e=qc(t,t.pendingProps),e.flags|=2,Uo(t),t.memoizedState=null,e}function Yc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(P){if(r.mode===`hidden`)return e=qc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Gc(null,e);if(Bo(t),(e=N)?(e=am(e,fa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:na===null?null:{id:ra,overflow:ia},retryLane:536870912,hydrationErrors:null},n=Ki(e),n.return=t,t.child=n,ua=t,N=null)):e=null,e===null)throw ma(t);return t.lanes=536870912,null}return qc(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(Bo(t),i){if(t.flags&256)t.flags&=-257,t=Jc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558))}else if(zc||Oa(e,t,n,!1),i=(n&e.childLanes)!==0,zc||i){if(Mo.current===null){if(r=U,r!==null&&(s=wt(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,Pi(e,s),Pd(r,e,s),Rc;Kd()}t=Jc(e,t,n)}else e=a.treeContext,N=lm(s.nextSibling),ua=t,P=!0,da=null,fa=!1,e!==null&&la(t,e),t=qc(t,r),t.flags|=134221824;return t}return e=Vi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Xc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Zc(e,t,n,r,i){return Aa(t),n=is(e,t,n,r,void 0,i),r=cs(),e!==null&&!zc?(ls(e,t,i),hl(e,t,i)):(P&&r&&sa(t),t.flags|=1,Bc(e,t,n,i),t.child)}function Qc(e,t,n,r,i,a){return Aa(t),t.updateQueue=null,n=os(t,r,n,i),as(e),r=cs(),e!==null&&!zc?(ls(e,t,a),hl(e,t,a)):(P&&r&&sa(t),t.flags|=1,Bc(e,t,n,a),t.child)}function $c(e,t,n,r,i){if(Aa(t),t.stateNode===null){var a=Li,o=n.contextType;typeof o==`object`&&o&&(a=ja(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Tc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},xo(t),o=n.contextType,a.context=typeof o==`object`&&o?ja(o):Li,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(wc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Tc.enqueueReplaceState(a,a.state,null),ko(t,r,a,i),Oo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Oc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Li,typeof u==`object`&&u&&(o=ja(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Dc(t,a,r,o),bo=!1;var f=t.memoizedState;a.state=f,ko(t,r,a,i),Oo(),l=t.memoizedState,s||f!==l||bo?(typeof d==`function`&&(wc(t,n,d,r),l=t.memoizedState),(c=bo||Ec(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,So(e,t),o=t.memoizedProps,u=Oc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Li,typeof l==`object`&&l&&(c=ja(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Dc(t,a,r,c),bo=!1,f=t.memoizedState,a.state=f,ko(t,r,a,i),Oo();var p=t.memoizedState;o!==d||f!==p||bo||e!==null&&e.dependencies!==null&&ka(e.dependencies)?(typeof s==`function`&&(wc(t,n,s,r),p=t.memoizedState),(u=bo||Ec(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ka(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Xc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=vo(t,e.child,null,i),t.child=vo(t,null,n,i)):Bc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=hl(e,t,i),e}function el(e,t,n,r){return va(),t.flags|=256,Bc(e,t,n,r),t.child}var tl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nl(e){return{baseLanes:e,cachePool:eo()}}function rl(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=fd),e}function il(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(F.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(P){if(i?zo(t):Ho(),(e=N)?(e=am(e,fa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:na===null?null:{id:ra,overflow:ia},retryLane:536870912,hydrationErrors:null},n=Ki(e),n.return=t,t.child=n,ua=t,N=null)):e=null,e===null)throw ma(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Ho(),i=t.mode,a=ol({mode:`hidden`,children:a},i),r=Wi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=nl(n),r.childLanes=rl(e,o,n),t.memoizedState=tl,Gc(null,r)):(zo(t),al(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return cl(e,t,a,o,r,c,s,n)}return i?(Ho(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Vi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Wi(i,a,n,null),i.flags|=2):i=Vi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Gc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=nl(n):(a=i.cachePool,a===null?a=eo():(s=La._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=rl(e,o,n),t.memoizedState=tl,Gc(e.child,r)):(zo(t),n=e.child,e=n.sibling,n=Vi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function al(e,t){return t=ol({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function ol(e,t){return e=zi(22,e,null,t),e.lanes=0,e}function sl(e,t,n){return vo(t,e.child,null,n),e=al(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cl(e,t,n,r,i,a,s,c){if(n)return t.flags&256?(zo(t),t.flags&=-257,sl(e,t,c)):t.memoizedState===null?(Ho(),a=i.fallback,s=t.mode,i=ol({mode:`visible`,children:i.children},s),a=Wi(a,s,c,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,vo(t,e.child,null,c),i=t.child,i.memoizedState=nl(c),i.childLanes=rl(e,r,c),t.memoizedState=tl,Gc(null,i)):(Ho(),t.child=e.child,t.flags|=128,null);if(zo(t),sm(a)){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(o(419)),i.stack=``,i.digest=r,ba({value:i,source:null,stack:null})),sl(e,t,c)}if(zc||Oa(e,t,c,!1),r=(c&e.childLanes)!==0,zc||r){if(Mo.current!==null)return sl(e,t,c);if(r=U,r!==null&&(i=wt(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,Pi(e,i),Pd(r,e,i),Rc;return om(a)||Kd(),sl(e,t,c)}return om(a)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,N=lm(a.nextSibling),ua=t,P=!0,da=null,fa=!1,e!==null&&la(t,e),t=al(t,i.children),t.flags|=134221824,t)}function ll(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ea(e.return,t,n)}function ul(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ko(n)===null&&(t=e),e=e.sibling}return t}function dl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function fl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function pl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=F.current;if(t.flags&128)return Wo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Wo(t,o),i===`backwards`&&e!==null?(fl(e),Bc(e,t,r,n),fl(e)):Bc(e,t,r,n),r=P?$i:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ll(e,n,t);else if(e.tag===19)ll(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=ul(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,fl(t)),dl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ko(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}dl(t,!0,n,null,a,r);break;case`together`:dl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ul(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),dl(t,!1,i,n,a,r)}return t.child}function ml(e,t,n){var r=t.pendingProps;return wa(t,t.type,r.value),Bc(e,t,r.children,n),t.child}function hl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ld|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Oa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=Vi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Vi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function gl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ka(e)))}function _l(e,t,n){switch(t.tag){case 3:Me(t,t.stateNode.containerInfo),wa(t,La,e.memoizedState.cache),va();break;case 27:case 5:Pe(t);break;case 4:Me(t,t.stateNode.containerInfo);break;case 10:wa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Bo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return zo(t),t.flags|=128,null;r=Oa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?il(e,t,n):(zo(t),e=hl(e,t,n),e===null?null:e.sibling)}zo(t);break;case 19:if(t.flags&128)return pl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Oa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return pl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Wo(t,F.current),r)break;return null;case 22:return t.lanes=0,Wc(e,t,n,t.pendingProps);case 24:wa(t,La,e.memoizedState.cache)}return hl(e,t,n)}function vl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)zc=!0;else{if(!gl(e,n)&&!(t.flags&128))return zc=!1,_l(e,t,n);zc=!!(e.flags&131072)}}else zc=!1,P&&t.flags&1048576&&oa(t,$i,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=so(t.elementType),t.type=e,typeof e==`function`)Bi(e)?(r=Oc(e,r),t.tag=1,t=$c(null,t,e,r,n)):(t.tag=0,t=Zc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===ce){t.tag=11,t=Vc(null,t,e,r,n);break a}if(i===de){t.tag=14,t=Hc(null,t,e,r,n);break a}if(i===se){t.tag=10,t.type=e,t=ml(null,t,n);break a}}throw t=xe(e)||e,Error(o(306,t,``))}}return t;case 0:return Zc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Oc(r,t.pendingProps),$c(e,t,r,i,n);case 3:a:{if(Me(t,t.stateNode.containerInfo),e===null)throw Error(o(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,So(e,t),ko(t,r,null,n);var s=t.memoizedState;if(r=s.cache,wa(t,La,r),r!==a.cache&&Da(t,[La],n,!0),Oo(),r=s.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=el(e,t,r,n);break a}if(r!==i){i=Yi(Error(o(424)),t),ba(i),t=el(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(N=lm(e.firstChild),ua=t,P=!0,da=null,fa=!0,n=yo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(va(),r===i){t=hl(e,t,n);break a}Bc(e,t,r,n)}t=t.child}return t;case 26:return Xc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:P||(t.stateNode=fp(t.type,t.pendingProps,Ae.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Pe(t),e===null&&P&&(r=t.stateNode=hm(t.type,t.pendingProps,Ae.current),ua=t,fa=!0,i=N,Sp(t.type)?(um=i,N=lm(r.firstChild)):N=i),Bc(e,t,t.pendingProps.children,n),Xc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&P&&((i=r=N)&&(r=rm(r,t.type,t.pendingProps,fa),r===null?i=!1:(t.stateNode=r,ua=t,N=lm(r.firstChild),fa=!1,i=!0)),i||ma(t)),Pe(t),i=t.type,a=t.pendingProps,s=e===null?null:e.memoizedProps,r=a.children,pp(i,a)?r=null:s!==null&&pp(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=is(e,t,ss,null,null,n),sh._currentValue=i),Xc(e,t),Bc(e,t,r,n),t.child;case 6:return e===null&&P&&((e=n=N)&&(n=im(n,t.pendingProps,fa),n===null?e=!1:(t.stateNode=n,ua=t,N=null,e=!0)),e||ma(t)),null;case 13:return il(e,t,n);case 4:return Me(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=vo(t,null,r,n):Bc(e,t,r,n),t.child;case 11:return Vc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Xc(e,t),Bc(e,t,r,n),t.child;case 8:return Bc(e,t,t.pendingProps.children,n),t.child;case 12:return Bc(e,t,t.pendingProps.children,n),t.child;case 10:return ml(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,Aa(t),i=ja(i),r=r(i),t.flags|=1,Bc(e,t,r,n),t.child;case 14:return Hc(e,t,t.type,t.pendingProps,n);case 15:return Uc(e,t,t.type,t.pendingProps,n);case 19:return pl(e,t,n);case 31:return Yc(e,t,n);case 22:return Wc(e,t,n,t.pendingProps);case 24:return Aa(t),r=ja(La),e===null?(i=Qa(),i===null&&(i=U,a=Ra(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},xo(t),wa(t,La,i)):((e.lanes&n)!==0&&(So(e,t),ko(t,null,null,n),Oo()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,wa(t,La,r),r!==i.cache&&Da(t,[La],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),wa(t,La,r))),Bc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:P&&sa(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Xc(e,t),Bc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function yl(e){e.flags|=4}function bl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Ud())e.flags|=8192;else throw co=io,no}}else e.flags&=-16777217}function xl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Ud())e.flags|=8192;else throw co=io,no}}function Sl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:vt(),e.lanes|=t,pd|=t)}function Cl(e,t){if(!P)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function R(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function wl(e,t,n){var r=t.pendingProps;switch(ca(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return R(t),null;case 1:return R(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ta(La),Ne(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(_a(t)?yl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ya())),R(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(yl(t),a===null?(R(t),bl(t,i,null,r,n)):(R(t),xl(t,a))):a?a===e.memoizedState?(R(t),t.flags&=-16777217):(yl(t),R(t),xl(t,a)):(e=e.memoizedProps,e!==r&&yl(t),R(t),bl(t,i,e,r,n)),null;case 27:if(Fe(t),n=Ae.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&yl(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return R(t),t.subtreeFlags&=-33554433,null}e=Oe.current,_a(t)?ha(t,e):(e=hm(i,r,n),t.stateNode=e,yl(t))}return R(t),t.subtreeFlags&=-33554433,null;case 5:if(Fe(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&yl(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return R(t),t.subtreeFlags&=-33554433,null}if(a=Oe.current,_a(t))ha(t,a);else{var s=lp(Ae.current);switch(a){case 1:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=s.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}a[At]=t,a[jt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;a:switch(np(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&yl(t)}}return R(t),t.subtreeFlags&=-33554433,bl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&yl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(o(166));if(e=Ae.current,_a(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ua,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[At]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||ma(t,!0)}else e=lp(e).createTextNode(r),e[At]=t,t.stateNode=e}return R(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=_a(t),n!==null){if(e===null){if(!r)throw Error(o(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(557));e[At]=t}else va(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;R(t),e=!1}else n=ya(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Uo(t),t):(Uo(t),null);if(t.flags&128)throw Error(o(558))}return R(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=_a(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(o(317));i[At]=t}else va(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;R(t),i=!1}else i=ya(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Uo(t),t):(Uo(t),null)}return Uo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Sl(t,t.updateQueue),R(t),null);case 4:return Ne(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,R(t),null;case 10:return Ta(t.type),R(t),null;case 19:if(Go(t),r=t.memoizedState,r===null)return R(t),null;if(i=!!(t.flags&128),a=r.rendering,a===null){if(i)Cl(r,!1);else{if(q!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Ko(e),a!==null){for(t.flags|=128,Cl(r,!1),e=a.updateQueue,t.updateQueue=e,Sl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Hi(n,e),n=n.sibling;return Wo(t,F.current&1|2),P&&aa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Je()>yd&&(t.flags|=128,i=!0,Cl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Ko(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Sl(t,e),Cl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!a.alternate&&!P)return R(t),null}else 2*Je()-r.renderingStartTime>yd&&n!==536870912&&(t.flags|=128,i=!0,Cl(r,!1),t.lanes=4194304)}r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Je(),e.sibling=null,a=F.current,a=i?a&1|2:a&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||P?Wo(t,a):(n=a,k(Lo,t),k(F,n),Ro===null&&(Ro=t)),P&&aa(t,r.treeForkCount),e}return R(t),null;case 22:case 23:return Uo(t),Io(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(R(t),t.subtreeFlags&6&&(t.flags|=8192)):R(t),n=t.updateQueue,n!==null&&Sl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&De(Za),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ta(La),R(t),null;case 25:return null;case 30:return t.flags|=33554432,R(t),null}throw Error(o(156,t.tag))}function Tl(e,t){switch(ca(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ta(La),Ne(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Fe(t),null;case 31:if(t.memoizedState!==null){if(Uo(t),t.alternate===null)throw Error(o(340));va()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Uo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));va()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Go(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ne(),null;case 10:return Ta(t.type),null;case 22:case 23:return Uo(t),Io(),e!==null&&De(Za),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ta(La),null;case 25:return null;default:return null}}function El(e,t){switch(ca(t),t.tag){case 3:Ta(La),Ne();break;case 26:case 27:case 5:Fe(t);break;case 4:Ne();break;case 31:t.memoizedState!==null&&Uo(t);break;case 13:Uo(t);break;case 19:Go(t);break;case 10:Ta(t.type);break;case 22:case 23:Uo(t),Io(),e!==null&&De(Za);break;case 24:Ta(La)}}function Dl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Ol(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function kl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{jo(t,n)}catch(t){Z(e,e.return,t)}}}function Al(e,t,n){n.props=Oc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function jl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=Ci(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);m(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Ml(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}}function Nl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function Pl(e){for(var t=e.return;t!==null&&(Ll(t)&&em(e.stateNode,t.stateNode),!Il(t));)t=t.return}function Fl(e){for(var t=e.return;t!==null&&(Ll(t)&&tm(e.stateNode,t.stateNode),!Il(t));)t=t.return}function Il(e){return e.tag===5||e.tag===3||e.tag===27}function Ll(e){return e&&e.tag===7&&e.stateNode!==null}function Rl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function zl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[jt]=t}catch(t){Z(e,e.return,t)}}function Bl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Vl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Bl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=En)),Nl(e,r),A=!0;else if(i!==4&&(i===27&&(Nl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Hl(e,t,n,r),e=e.sibling;e!==null;)Hl(e,t,n,r),e=e.sibling}function Ul(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Nl(e,r),A=!0;else if(i!==4&&(i===27&&(Nl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ul(e,t,n,r),e=e.sibling;e!==null;)Ul(e,t,n,r),e=e.sibling}function Wl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[At]=e,t[jt]=n}catch(t){Z(e,e.return,t)}}var Gl=!1,Kl=null;function ql(e){(e.tag===30||e.subtreeFlags&33554432)&&(Gl=!0)}var Jl=null;function Yl(){var e=Jl;return Jl=null,e}var Xl=0;function Zl(e,t,n,r,i){return Xl=0,Ql(e.child,t,n,r,i)}function Ql(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Gl=!0,Tp(o,Xl===0?t:t+`_`+Xl,n),Xl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Ql(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function $l(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||$l(e.child,t),e=e.sibling}function eu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(eu(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(o(544));var n=t.name;t=Ti(t.default,t.share),t!==`none`&&(Zl(e,n,t,null,!1)||$l(e.child,!1))}e=e.sibling}}function tu(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=Ci(r,n),a=Ti(r.default,n.paired?r.share:r.enter);a===`none`?eu(e):Zl(e,i,a,null,!1)?(eu(e),n.paired||t||Nd(e,r.onEnter)):$l(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)tu(e,t),e=e.sibling;else eu(e)}function nu(e){if(Kl!==null&&Kl.size!==0){var t=Kl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=Ti(n.default,n.share);if(a!==`none`&&(Zl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Nd(e,n.onShare)):$l(e.child,!1)),t.delete(r),t.size===0)break}}}nu(e)}e=e.sibling}}}function ru(e){if(e.tag===30){var t=e.memoizedProps,n=Ci(t,e.stateNode),r=Kl===null?void 0:Kl.get(n),i=Ti(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Zl(e,n,i,null,!1)?r===void 0?Nd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Kl.delete(n),Nd(e,t.onShare)):$l(e.child,!1)),Kl!==null&&nu(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ru(e),e=e.sibling;else Kl!==null&&nu(e)}function iu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Ci(t,e.stateNode);t=Ti(t.default,t.update),e.flags&=-5,t!==`none`&&Zl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&iu(e);e=e.sibling}}function au(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,$l(e.child,!1))}au(e)}e=e.sibling}}function ou(e){if(e.tag===30)e.stateNode.paired=null,$l(e.child,!1),au(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ou(e),e=e.sibling;else au(e)}function su(e){for(e=e.child;e!==null;)e.tag===30?$l(e.child,!1):e.subtreeFlags&33554432&&su(e),e=e.sibling}function cu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Xl<a.length){var l=a[Xl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Xl===0?n:n+`_`+Xl,i),s&&e.flags&4||(Jl===null&&(Jl=[]),Jl.push(c,Xl===0?r:r+`_`+Xl,t.memoizedProps)),Xl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:cu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function z(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=Ci(n,r),a=Ti(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Xl=0,i=cu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Nd(e,n.onUpdate))}else e.subtreeFlags&33554432&&z(e,t);e=e.sibling}}var lu=!1,B=!1,uu=!1,du=!1,fu=typeof WeakSet==`function`?WeakSet:Set,pu=null,mu=!1,hu=!1,gu=!1,_u=!1;function vu(e,t,n){if(e=e.containerInfo,sp=gh,e=$r(e),ei(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,pu=t,t=n?9270:1024;pu!==null;){if(e=pu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ru(r[a]);if(e.alternate===null&&e.flags&2)n&&ql(e),yu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ru(r),yu(n);continue}if(r!==null&&r.memoizedState!==null){n&&ql(e),yu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,pu=r):(n&&iu(e),yu(n))}}Kl=null}function yu(e){for(;pu!==null;){var t=pu,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var a=t.stateNode;try{var s=Oc(t.type,i);n=a.getSnapshotBeforeUpdate(s,r),a.__reactInternalSnapshotBeforeUpdate=n}catch(e){Z(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=Ci(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=Ti(i.default,i.update),i!==`none`&&Zl(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(o(163))}if(r=t.sibling,r!==null){r.return=t.return,pu=r;break}pu=t.return}}function bu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:zu(e,n),r&4&&Dl(5,n);break;case 1:if(zu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Oc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}}r&64&&kl(n),r&512&&jl(n,n.return);break;case 3:if(zu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{jo(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Wl(n);case 26:case 5:zu(e,n),t===null&&r&4&&Rl(n),r&512&&jl(n,n.return);break;case 12:zu(e,n);break;case 31:zu(e,n),r&4&&Ou(e,n);break;case 13:zu(e,n),r&4&&ku(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||lu,!r){var a=t!==null&&t.memoizedState!==null||B;t=lu,i=B,lu=r,(B=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Vu(e,n,r)):zu(e,n),lu=t,B=i}break;case 30:zu(e,n),r&512&&jl(n,n.return);break;case 7:r&512&&jl(n,n.return);default:zu(e,n)}}function xu(e,t){for(e=e.child;e!==null;)Su(e,t),e=e.sibling}function Su(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Z(e,e.return,t)}Cu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,A=!0}catch(t){Z(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){Z(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&xu(e,t);break;default:xu(e,t)}}function Cu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:Su(n,r);break a;case 22:n.memoizedState===null&&Cu(n,r);break a;default:Cu(n,r)}}e=e.sibling}}function wu(e){var t=e.alternate;t!==null&&(e.alternate=null,wu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&zt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var V=null,Tu=!1;function Eu(e,t,n){for(n=n.child;n!==null;)Du(e,t,n),n=n.sibling}function Du(e,t,n){if(it&&typeof it.onCommitFiberUnmount==`function`)try{it.onCommitFiberUnmount(rt,n)}catch{}switch(n.tag){case 26:B||Ml(n,t),Eu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!B&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:B||Ml(n,t),Fl(n);var r=V,i=Tu;Sp(n.type)&&(V=n.stateNode,Tu=!1),Eu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),V=r,Tu=i;break;case 5:B||Ml(n,t),Fl(n);case 6:if(n.tag===6&&Fl(n),r=V,i=Tu,V=null,Eu(e,t,n),V=r,Tu=i,V!==null){if(Tu)try{(V.nodeType===9?V.body:V.nodeName===`HTML`?V.ownerDocument.body:V).removeChild(n.stateNode),A=!0}catch(e){Z(n,t,e)}else try{V.removeChild(n.stateNode),A=!0}catch(e){Z(n,t,e)}}break;case 18:V!==null&&(Tu?(e=V,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(V,n.stateNode));break;case 4:r=V,i=Tu,V=n.stateNode.containerInfo,Tu=!0,Eu(e,t,n),V=r,Tu=i;break;case 0:case 11:case 14:case 15:Ol(2,n,t),B||Ol(4,n,t),Eu(e,t,n);break;case 1:B||(Ml(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Al(n,t,r)),Eu(e,t,n);break;case 21:Eu(e,t,n);break;case 22:B=(r=B)||n.memoizedState!==null,Eu(e,t,n),B=r;break;case 30:Ml(n,t),Eu(e,t,n);break;case 7:B||Ml(n,t),Eu(e,t,n);break;default:Eu(e,t,n)}}function Ou(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){Z(t,t.return,e)}}}function ku(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){Z(t,t.return,e)}}function Au(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new fu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new fu),t;default:throw Error(o(435,e.tag))}}function ju(e,t){var n=Au(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Mu(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){V=l.stateNode,Tu=!1;break a}break;case 5:V=l.stateNode,Tu=!1;break a;case 3:case 4:V=l.stateNode.containerInfo,Tu=!0;break a}l=l.return}if(V===null)throw Error(o(160));Du(s,c,a),V=null,Tu=!1,s=a.alternate,s!==null&&(s.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Pu(t,e,n),t=t.sibling}var Nu=null;function Pu(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var a=0;a<r.length;a++){var s=r[a];s.ref.impl=s.nextImpl}Mu(t,e,n),Fu(e),i&4&&(Ol(3,e,e.return),Dl(3,e),Ol(5,e,e.return));break;case 1:Mu(t,e,n),Fu(e),i&512&&(B||r===null||Ml(r,r.return)),i&64&&lu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(a=Nu,Mu(t,e,n),Fu(e),i&512&&(B||r===null||Ml(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(lu)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=a.ownerDocument||a;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[Lt]||r[At]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),np(r,t,n),r[At]=e,Wt(r),t=r;break a;case`link`:if(a=Gm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;case`meta`:if(a=Gm(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){a.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;default:throw Error(o(468,t))}r[At]=e,Wt(r),t=r}e.stateNode=t}}else lu||Km(a,e.type,e.stateNode)}else e.stateNode=Bm(a,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&zl(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||B||t.parentNode.removeChild(t)):i.count--,n===null?lu||Km(a,e.type,e.stateNode):Bm(a,n,e.memoizedProps))}break;case 27:Mu(t,e,n),Fu(e),i&512&&(B||r===null||Ml(r,r.return)),r!==null&&i&4&&zl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(a=uu,uu=!1,Mu(t,e,n),uu=a,Fu(e),i&512&&(B||r===null||Ml(r,r.return)),e.flags&32){t=e.stateNode;try{vn(t,``),A=!0}catch(t){Z(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,zl(e,t,r===null?t:r.memoizedProps)),i&1024&&(du=!0);break;case 6:if(Mu(t,e,n),Fu(e),i&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,A=!0}catch(t){Z(e,e.return,t)}}break;case 3:if(A=!1,Wm=null,a=Nu,Nu=bm(t.containerInfo),Mu(t,e,n),Nu=a,Fu(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){Z(e,e.return,t)}du&&(du=!1,Iu(e)),A=!1;break;case 4:i=uu,uu=lu,r=en(),a=Nu,Nu=bm(e.stateNode.containerInfo),Mu(t,e,n),Fu(e),Nu=a,A&&hu&&(gu=!0),A=r,uu=i;break;case 12:Mu(t,e,n),Fu(e);break;case 31:Mu(t,e,n),Fu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 13:Mu(t,e,n),Fu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(_d=Je()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 22:a=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=lu,l=B,u=uu;lu=c||a,uu=u||a,B=l||s,Mu(t,e,n),B=l,uu=u,lu=c,Fu(e),i&8192&&(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,!a||r===null||s||lu||B||(t=s||B,n=lu,r=B,lu=a||lu,B=t,Bu(e,2),lu=n,B=r),!a&&uu||xu(e,a)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ju(e,n))));break;case 19:Mu(t,e,n),Fu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 30:i&512&&(B||r===null||Ml(r,r.return)),i=en(),a=hu,s=(n&335544064)===n,c=e.memoizedProps,hu=s&&Ti(c.default,c.update)!==`none`,Mu(t,e,n),Fu(e),s&&r!==null&&A&&(e.flags|=4),hu=a,A=i;break;case 21:break;case 7:i&512&&(B||r===null||Ml(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Mu(t,e,n),Fu(e)}}function Fu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Bl(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Ll(i)){var a=i.stateNode;r===null?r=[a]:r.push(a)}if(Il(i))break;i=i.return}var s=r;if(n==null)throw Error(o(160));switch(n.tag){case 27:var c=n.stateNode;Ul(e,Vl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(vn(l,``),n.flags&=-33),Ul(e,Vl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Hl(e,Vl(e),u,s);break;default:throw Error(o(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Iu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Iu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Lu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Ru(t,e),t=t.sibling;else z(t,!1)}function Ru(e,t){var n=e.alternate;if(n===null)tu(e,!1);else switch(e.tag){case 3:if(_u=mu=!1,Yl(),Lu(t,e),!mu&&!gu){if(e=Jl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),_u=!0}Jl=null;break;case 5:Lu(t,e);break;case 4:r=mu,mu=!1,Lu(t,e),mu&&(gu=!0),mu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Lu(t,e):tu(e,!1));break;case 30:r=mu,i=Yl(),mu=!1,Lu(t,e),mu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=Ci(a,o),o=Ci(n.memoizedProps,o);var s=Ti(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Xl=0,t=cu(e,n,t,o,s,a,!0),Xl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Nd(e,e.memoizedProps.onUpdate),Jl=i):i!==null&&(i.push.apply(i,Jl),Jl=i),mu=e.flags&32?!0:r;break;default:Lu(t,e)}}function zu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)bu(e,t.alternate,t),t=t.sibling}function Bu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Ol(4,n,n.return),Bu(n,r);break;case 1:Ml(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Al(n,n.return,i),Bu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:Ml(n,n.return),n.tag!==5&&n.tag!==27||Fl(n),Bu(n,r);break;case 6:Fl(n);break;case 26:Ml(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||B||i.parentNode.removeChild(i),Bu(n,r);break;case 22:n.memoizedState===null&&Bu(n,r);break;case 30:Ml(n,n.return),Bu(n,r);break;case 7:Ml(n,n.return);default:Bu(n,r)}e=e.sibling}}function Vu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Vu(i,a,n),Dl(4,a);break;case 1:if(Vu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Ao(l[i],c)}catch(e){Z(r,r.return,e)}}s&&o&64&&kl(a),jl(a,a.return);break;case 27:n&2&&Wl(a);case 5:a.tag!==5&&a.tag!==27||Pl(a),Vu(i,a,n),s&&r===null&&o&4&&Rl(a),jl(a,a.return);break;case 6:Pl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||lu||Km(bm(c.ownerDocument),a.type,c),Vu(i,a,n),s&&r===null&&o&4&&Rl(a),jl(a,a.return);break;case 12:Vu(i,a,n);break;case 31:Vu(i,a,n),s&&o&4&&Ou(i,a);break;case 13:Vu(i,a,n),s&&o&4&&ku(i,a);break;case 22:a.memoizedState===null&&Vu(i,a,n),jl(a,a.return);break;case 30:Vu(i,a,n),jl(a,a.return);break;case 7:jl(a,a.return);default:Vu(i,a,n)}t=t.sibling}}function Hu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&za(n))}function Uu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&za(e))}function Wu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Gu(e,t,n,r),t=t.sibling;else i&&su(t)}function Gu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ou(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Wu(e,t,n,r),a&2048&&Dl(9,t);break;case 1:Wu(e,t,n,r);break;case 3:Wu(e,t,n,r),i&&_u&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&za(a)));break;case 12:if(a&2048){Wu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Wu(e,t,n,r);break;case 31:Wu(e,t,n,r);break;case 13:Wu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&ou(t),o._visibility&2?Wu(e,t,n,r):(o._visibility|=2,Ku(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&ou(s),o._visibility&2?Wu(e,t,n,r):qu(e,t)),a&2048&&Hu(s,t);break;case 24:Wu(e,t,n,r),a&2048&&Uu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&($l(a.child,!0),$l(t.child,!0))),Wu(e,t,n,r);break;default:Wu(e,t,n,r)}}function Ku(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ku(a,o,s,c,i),Dl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ku(a,o,s,c,i)):u._visibility&2?Ku(a,o,s,c,i):qu(a,o),i&&l&2048&&Hu(o.alternate,o);break;case 24:Ku(a,o,s,c,i),i&&l&2048&&Uu(o.alternate,o);break;default:Ku(a,o,s,c,i)}t=t.sibling}}function qu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:qu(n,r),i&2048&&Hu(r.alternate,r);break;case 24:qu(n,r),i&2048&&Uu(r.alternate,r);break;default:qu(n,r)}t=t.sibling}}var Ju=8192;function Yu(e,t,n){if(e.subtreeFlags&Ju)for(e=e.child;e!==null;)Xu(e,t,n),e=e.sibling}function Xu(e,t,n){switch(e.tag){case 26:Yu(e,t,n),e.flags&Ju&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Nu,e.memoizedState,e.memoizedProps));break;case 5:Yu(e,t,n),e.flags&Ju&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Nu;Nu=bm(e.stateNode.containerInfo),Yu(e,t,n),Nu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ju,Ju=16777216,Yu(e,t,n),Ju=r):Yu(e,t,n));break;case 30:if((e.flags&Ju)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Kl===null&&(Kl=new Map),Kl.set(r,i)}Yu(e,t,n);break;default:Yu(e,t,n)}}function Zu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];pu=r,td(r,e)}Zu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)$u(e),e=e.sibling}function $u(e){switch(e.tag){case 0:case 11:case 15:Qu(e),e.flags&2048&&Ol(9,e,e.return);break;case 3:Qu(e);break;case 12:Qu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ed(e)):Qu(e);break;default:Qu(e)}}function ed(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];pu=r,td(r,e)}Zu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ol(8,t,t.return),ed(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ed(t));break;default:ed(t)}e=e.sibling}}function td(e,t){for(;pu!==null;){var n=pu;switch(n.tag){case 0:case 11:case 15:Ol(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:za(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,pu=r;else a:for(n=e;pu!==null;){r=pu;var i=r.sibling,a=r.return;if(wu(r),r===n){pu=null;break a}if(i!==null){i.return=a,pu=i;break a}pu=a}}}var nd={getCacheForType:function(e){var t=ja(La),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ja(La).controller.signal}},rd=typeof WeakMap==`function`?WeakMap:Map,H=0,U=null,W=null,G=0,K=0,id=null,ad=!1,od=!1,sd=!1,cd=0,q=0,ld=0,ud=0,dd=0,fd=0,pd=0,md=null,hd=null,gd=!1,_d=0,vd=0,yd=1/0,bd=null,xd=null,Sd=0,Cd=null,wd=null,Td=0,Ed=0,J=null,Dd=null,Od=null,kd=null,Ad=null,jd=0,Y=null;function X(){return H&2&&G!==0?G&-G:D.T===null?Dt():Pf()}function Md(){if(fd===0){if(!(G&536870912)||P){var e=dt;dt<<=1,!(dt&3932160)&&(dt=262144),fd=e}else fd=536870912}return e=Lo.current,e!==null&&(e.flags|=32),fd}function Nd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(Ci(e.memoizedProps,n))),kd===null&&(kd=[]),kd.push(t.bind(null,r))}}function Pd(e,t,n){(e===U&&(K===2||K===9)||e.cancelPendingCommit!==null)&&(Vd(e,0),Rd(e,G,fd,!1)),bt(e,n),H&2&&e===U||(e===U&&(!(H&2)&&(ud|=n),q===4&&Rd(e,G,fd,!1)),Ef(e))}function Fd(e,t,n){if(H&6)throw Error(o(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ht(e,t),i=r?Yd(e,t):qd(e,t,!0),a=r;do{if(i===0){od&&!r&&Rd(e,t,0,!1);break}if(n=e.current.alternate,a&&!Ld(n))i=qd(e,t,!1),a=!1;else{if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=md;var l=c.current.memoizedState.isDehydrated;if(l&&(Vd(c,s).flags|=256),s=qd(c,s,!1),s!==2&&s!==6){if(sd&&!l){c.errorRecoveryDisabledLanes|=a,ud|=a,i=4;break a}a=hd,hd=i,a!==null&&(hd===null?hd=a:hd.push.apply(hd,a))}i=s}if(a=!1,i!==2)continue}}if(i===1){Vd(e,0),Rd(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Rd(r,t,fd,!ad);break a;case 2:hd=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=_d+300-Je(),10<i)){if(Rd(r,t,fd,!ad),mt(r,0,!0)!==0)break a;Td=t,r.timeoutHandle=gp(Id.bind(null,r,n,hd,bd,gd,t,fd,ud,pd,ad,a,`Throttled`,-0,0),i);break a}Id(r,n,hd,bd,gd,t,fd,ud,pd,ad,a,null,-0,0)}break}}while(1);Ef(e)}function Id(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:En},Kl=null,Xu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?_d-Je():(a&4194048)===a?vd-Je():0,m=eh(d,m),m!==null)?(Td=a,e.cancelPendingCommit=m(nf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Rd(e,a,o,!l)):nf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ld(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!qr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Rd(e,t,n,r){t=gt(e,t),t&=~dd,t&=~ud,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-ot(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&St(e,n,t)}function zd(){return H&6?!0:(Df(0,!1),!1)}function Bd(){if(W!==null){if(K===0)var e=W.return;else e=W,Ca=Sa=null,us(e),fo=null,po=0,e=W;for(;e!==null;)El(e.alternate,e),e=e.return;W=null}}function Vd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Td=0,Bd(),U=e,W=n=Vi(e.current,null),G=t,K=0,id=null,ad=!1,od=ht(e,t),sd=!1,pd=fd=dd=ud=ld=q=0,hd=md=null,gd=!1,cd=gt(e,t),Ai(),n}function Hd(e,t){I=null,D.H=bc,t===to||t===ro?(t=lo(),K=3):t===no?(t=lo(),K=4):K=t===Rc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,id=t,W===null&&(q=1,Mc(e,Yi(t,e.current)))}function Ud(){var e=Lo.current;return e===null?!0:(G&4194048)===G?Ro===null:(G&62914560)===G||G&536870912?e===Ro:!1}function Wd(){var e=D.H;return D.H=bc,e===null?bc:e}function Gd(){var e=D.A;return D.A=nd,e}function Kd(){q=4,ad||(G&4194048)!==G&&Lo.current!==null||(od=!0),!(ld&134217727)&&!(ud&134217727)||U===null||Rd(U,G,fd,!1)}function qd(e,t,n){var r=H;H|=2;var i=Wd(),a=Gd();(U!==e||G!==t)&&(bd=null,Vd(e,t)),t=!1;var o=q;a:do try{if(K!==0&&W!==null){var s=W,c=id;switch(K){case 8:Bd(),o=6;break a;case 3:case 2:case 9:case 6:Lo.current===null&&(t=!0);var l=K;if(K=0,id=null,$d(e,s,c,l),n&&od){o=0;break a}break;default:l=K,K=0,id=null,$d(e,s,c,l)}}Jd(),o=q;break}catch(t){Hd(e,t)}while(1);return t&&e.shellSuspendCounter++,Ca=Sa=null,H=r,D.H=i,D.A=a,W===null&&(U=null,G=0,Ai()),o}function Jd(){for(;W!==null;)Zd(W)}function Yd(e,t){var n=H;H|=2;var r=Wd(),i=Gd();U!==e||G!==t?(bd=null,yd=Je()+500,Vd(e,t)):od=ht(e,t);a:do try{if(K!==0&&W!==null){t=W;var a=id;b:switch(K){case 1:K=0,id=null,$d(e,t,a,1);break;case 2:case 9:if(ao(a)){K=0,id=null,Qd(t);break}t=function(){K!==2&&K!==9||U!==e||(K=7),Ef(e)},a.then(t,t);break a;case 3:K=7;break a;case 4:K=5;break a;case 7:ao(a)?(K=0,id=null,Qd(t)):(K=0,id=null,$d(e,t,a,7));break;case 5:var s=null;switch(W.tag){case 26:s=W.memoizedState;case 5:case 27:var c=W;if(s?Ym(s):c.stateNode.complete){K=0,id=null;var l=c.sibling;if(l!==null)W=l;else{var u=c.return;u===null?W=null:(W=u,ef(u))}break b}}K=0,id=null,$d(e,t,a,5);break;case 6:K=0,id=null,$d(e,t,a,6);break;case 8:Bd(),q=6;break a;default:throw Error(o(462))}}Xd();break}catch(t){Hd(e,t)}while(1);return Ca=Sa=null,D.H=r,D.A=i,H=n,W===null?(U=null,G=0,Ai(),q):0}function Xd(){for(;W!==null&&!Ke();)Zd(W)}function Zd(e){var t=vl(e.alternate,e,cd);e.memoizedProps=e.pendingProps,t===null?ef(e):W=t}function Qd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Qc(n,t,t.pendingProps,t.type,void 0,G);break;case 11:t=Qc(n,t,t.pendingProps,t.type.render,t.ref,G);break;case 5:us(t);var r=t;r===ua&&(P?(ga(r),r.tag===5&&r.stateNode!=null&&(N=r.stateNode)):(ga(r),P=!0));default:El(n,t),t=W=Hi(t,cd),t=vl(n,t,cd)}e.memoizedProps=e.pendingProps,t===null?ef(e):W=t}function $d(e,t,n,r){Ca=Sa=null,us(t),fo=null,po=0;var i=t.return;try{if(Lc(e,i,t,n,G)){q=1,Mc(e,Yi(n,e.current)),W=null;return}}catch(t){if(i!==null)throw W=i,t;q=1,Mc(e,Yi(n,e.current)),W=null;return}t.flags&32768?(P||r===1?e=!0:od||G&536870912?e=!1:(ad=e=!0,(r===2||r===9||r===3||r===6)&&(r=Lo.current,r!==null&&r.tag===13&&(r.flags|=16384))),tf(t,e)):ef(t)}function ef(e){var t=e;do{if(t.flags&32768){tf(t,ad);return}e=t.return;var n=wl(t.alternate,t,cd);if(n!==null){W=n;return}if(t=t.sibling,t!==null){W=t;return}W=t=e}while(t!==null);q===0&&(q=5)}function tf(e,t){do{var n=Tl(e.alternate,e);if(n!==null){n.flags&=32767,W=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){W=e;return}W=e=n}while(e!==null);q=6,W=null}function nf(e,t,n,r,i,a,s,c,l,u,d,f){e.cancelPendingCommit=null;do df();while(Sd!==0);if(H&6)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===U&&(W=U=null,G=0),wd=t,Cd=e,Td=n,J=i,Dd=r,rf(e,t,n,s,c,l,f)}}function rf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Ed=s,s|=ki,xt(e,n,s,r,i,a),kd=null,(n&335544064)===n?(Ad=Ha(e),r=10262):(Ad=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(Qe,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Gl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=D.T,D.T=null,i=O.p,O.p=2,a=H,H|=4;try{vu(e,t,n)}finally{H=a,O.p=i,D.T=r}}Sd=1,Gl?Od=Mp(o,e.containerInfo,Ad,sf,cf,of,lf,ff,af,null,null):(sf(),cf(),lf())}function af(e){if(Sd!==0){var t=Cd.onRecoverableError;t(e,{componentStack:null})}}function of(){Sd===3&&(Sd=0,Ru(wd,Cd),Sd=4)}function sf(){if(Sd===1){Sd=0;var e=Cd,t=wd,n=Td,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=D.T,D.T=null;var i=O.p;O.p=2;var a=H;H|=4;try{hu=gu=!1,Pu(t,e,n),n=cp;var o=$r(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Qr(s.ownerDocument.documentElement,s)){if(c!==null&&ei(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Zr(s,h),v=Zr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{H=a,O.p=i,D.T=r}}e.current=t,Sd=2}}function cf(){if(Sd===2){Sd=0;var e=Cd,t=wd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=D.T,D.T=null;var r=O.p;O.p=2;var i=H;H|=4;try{bu(e,t.alternate,t)}finally{H=i,O.p=r,D.T=n}}Sd=3}}function lf(){if(Sd===4||Sd===3){Sd=0;var e=Od;Od=null,qe();var t=Cd,n=wd,r=Td,i=Dd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Sd=5:(Sd=0,wd=Cd=null,uf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(xd=null),Et(r),n=n.stateNode,it&&typeof it.onCommitFiberRoot==`function`)try{it.onCommitFiberRoot(rt,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=D.T,a=O.p,O.p=2,D.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{D.T=n,O.p=a}}if(i=kd,o=Ad,Ad=null,i!==null&&(kd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Td&3&&df(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===Y?jd++:(jd=0,Y=t):(jd=0,Y=null),Df(0,!1)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,za(t)))}function df(){return Od!==null&&(Od.skipTransition(),Od=null),sf(),cf(),lf(),ff()}function ff(){if(Sd!==5)return!1;var e=Cd,t=Ed;Ed=0;var n=Et(Td),r=D.T,i=O.p;try{O.p=32>n?32:n,D.T=null,n=J,J=null;var a=Cd,s=Td;if(Sd=0,wd=Cd=null,Td=0,H&6)throw Error(o(331));var c=H;if(H|=4,$u(a.current),Gu(a,a.current,s,n),H=c,Df(0,!1),it&&typeof it.onPostCommitFiberRoot==`function`)try{it.onPostCommitFiberRoot(rt,a)}catch{}return!0}finally{O.p=i,D.T=r,uf(e,t)}}function pf(e,t,n){t=Yi(n,t),t=Pc(e.stateNode,t,2),e=wo(e,t,2),e!==null&&(bt(e,2),Ef(e))}function Z(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(xd===null||!xd.has(r))){e=Yi(n,e),n=Fc(2),r=wo(t,n,2),r!==null&&(Ic(n,r,t,e),bt(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new rd;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(sd=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,U===e&&(G&n)===n&&(q===4||q===3&&(G&62914560)===G&&300>Je()-_d?H&2?dd|=n:Vd(e,0):dd|=n,pd===G&&(pd=0)),Ef(e)}function gf(e,t){t===0&&(t=vt()),e=Pi(e,t),e!==null&&(bt(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),gf(e,n)}function yf(e,t){return We(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-ot(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=G,a=mt(r,r===U?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ht(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&hp()&&(e=Tf);for(var t=Je(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}Sd!==0&&Sd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-ot(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=_t(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=U,n=G,n=mt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(K===2||K===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ge(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ht(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ge(r),Et(n)){case 2:case 8:n=Ze;break;case 32:n=Qe;break;case 268435456:n=et;break;default:n=Qe}return r=jf.bind(null,e),n=We(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ge(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(Sd!==0&&Sd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(df()&&e.callbackNode!==n)return null;var r=G;return r=mt(e,e===U?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Fd(e,r,t),Af(e,Je()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(df())return null;Fd(e,t,!0)}function Nf(){bp(function(){H&6?We(Xe,Of):kf()})}function Pf(){if(Tf===0){var e=Ga;e===0&&(e=ut,ut<<=1,!(ut&261888)&&(ut=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Tn(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[jt]||null).action),o=r.submitter;o&&(t=(t=o[jt]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new qn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);oc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),oc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<bi.length;Lf++){var Rf=bi[Lf];xi(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}xi(fi,`onAnimationEnd`),xi(pi,`onAnimationIteration`),xi(mi,`onAnimationStart`),xi(`dblclick`,`onDoubleClick`),xi(`focusin`,`onFocus`),xi(`focusout`,`onBlur`),xi(hi,`onTransitionRun`),xi(gi,`onTransitionStart`),xi(_i,`onTransitionCancel`),xi(vi,`onTransitionEnd`),Yt(`onMouseEnter`,[`mouseout`,`mouseover`]),Yt(`onMouseLeave`,[`mouseout`,`mouseover`]),Yt(`onPointerEnter`,[`pointerout`,`pointerover`]),Yt(`onPointerLeave`,[`pointerout`,`pointerover`]),Jt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Jt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Jt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Jt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Jt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Jt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`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(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ei(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ei(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[Nt];n===void 0&&(n=t[Nt]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,Kt.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!In||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Kf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=Bt(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}Nn(function(){var r=a,i=On(n),o=[];a:{var s=yi.get(e);if(s!==void 0){var l=qn,u=e;switch(e){case`keypress`:if(Hn(n)===0)break a;case`keydown`:case`keyup`:l=ur;break;case`focusin`:u=`focus`,l=tr;break;case`focusout`:u=`blur`,l=tr;break;case`beforeblur`:case`afterblur`:l=tr;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=$n;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=er;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=pr;break;case fi:case pi:case mi:l=nr;break;case vi:l=mr;break;case`scroll`:case`scrollend`:l=Yn;break;case`wheel`:l=hr;break;case`copy`:case`cut`:case`paste`:l=rr;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=dr;break;case`submit`:l=fr;break;case`toggle`:case`beforetoggle`:l=gr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Pn(m,p),g!=null&&d.push(qf(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,s=e===`mouseout`||e===`pointerout`,l&&n!==Dn&&(u=n.relatedTarget||n.fromElement)&&(Bt(u)||u[Mt]))break a;(s||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,s?(l=n.relatedTarget||n.toElement,s=r,l=l?Bt(l):null,l!==null&&(f=c(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(s=null,l=r),s!==l&&(d=$n,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=dr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:Ht(s),h=l==null?u:Ht(l),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,Bt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=s&&l?ee(s,l,Yf):null,s!==null&&Xf(o,u,s,d,!1),l!==null&&f!==null&&Xf(o,f,l,d,!0)))}a:{if(s=r?Ht(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var _=Fr;else if(Ar(s)){if(Ir)_=Gr;else{_=Ur;var v=Hr}}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&Sn(r.elementType)&&(_=Fr):_=Wr;if(_&&=_(e,r)){jr(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?Ht(r):window,e){case`focusin`:(Ar(v)||v.contentEditable===`true`)&&(ni=v,ri=r,ii=null);break;case`focusout`:ii=ri=ni=null;break;case`mousedown`:ai=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ai=!1,oi(o,n,i);break;case`selectionchange`:if(ti)break;case`keydown`:case`keyup`:oi(o,n,i)}var y;if(vr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else Er?wr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(xr&&n.locale!==`ko`&&(Er||b!==`onCompositionStart`?b===`onCompositionEnd`&&Er&&(y=Vn()):(Rn=i,zn=`value`in Rn?Rn.value:Rn.textContent,Er=!0)),v=Jf(r,b),0<v.length&&(b=new ir(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=Tr(n),y!==null&&(b.data=y)))),(y=br?Dr(e,n):Or(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new ir(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),If(o,e,r,n,i)}Vf(o,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Pn(e,n),i!=null&&r.unshift(qf(e,i,a)),i=Pn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Pn(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=Pn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
|
|
11
11
|
`).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function $(e,t,n,r,i,a){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||vn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&vn(e,``+r);else return;break;case`className`:nn(e,`class`,r);break;case`tabIndex`:nn(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:nn(e,n,r);break;case`style`:xn(e,r,a);return;case`data`:if(t!==`object`){nn(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Tn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof a==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Tn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=En);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Tn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`: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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),tn(e,`popover`,r);break;case`xlinkActuate`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:rn(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:rn(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:rn(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:tn(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=Cn.get(n)||n,tn(e,n,r);else return}A=!0}function tp(e,t,n,r,i,a){switch(n){case`style`:xn(e,r,a);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)vn(e,r);else if(typeof r==`number`||typeof r==`bigint`)vn(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=En);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!qt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),a=n.slice(2,i?n.length-7:void 0),t=e[jt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(a,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(a,r,i);break a}A=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):tn(e,n,r)}return}A=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:$(e,t,a,s,n,null)}}i&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=a=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(o(137,t));break;default:$(e,t,r,d,n,null)}}pn(e,a,c,l,u,s,i,!1);return;case`select`:for(i in Q(`invalid`,e),r=s=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,i,c,n,null)}t=a,n=s,e.multiple=!!r,t==null?n!=null&&hn(e,!!r,n,!0):hn(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(o(91));break;default:$(e,t,s,c,n,null)}_n(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:$(e,t,u,r,n,null)}return;default:if(Sn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(A=!0),a=m;break;case`name`:m!==f&&(A=!0),i=m;break;case`checked`:m!==f&&(A=!0),u=m;break;case`defaultChecked`:m!==f&&(A=!0),d=m;break;case`value`:m!==f&&(A=!0),s=m;break;case`defaultValue`:m!==f&&(A=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(o(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}fn(e,s,c,l,u,d,a,i);return;case`select`:for(a in m=s=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||$(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:a!==l&&(A=!0),p=a;break;case`defaultValue`:a!==l&&(A=!0),c=a;break;case`multiple`:a!==l&&(A=!0),s=a;default:a!==l&&$(e,t,i,a,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?hn(e,!!n,n?[]:``,!1):hn(e,!!n,t,!0)):hn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,i)}for(s in r)if(i=r[s],a=n[s],r.hasOwnProperty(s)&&(i!=null||a!=null))switch(s){case`value`:i!==a&&(A=!0),p=i;break;case`defaultValue`:i!==a&&(A=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(o(91));break;default:i!==a&&$(e,t,s,i,r,a)}gn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(A=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(o(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(Sn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[At]=r,n[jt]=t,np(n,e,t),Wt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Lt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return y(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return y(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=h(this._fragmentFiber);if(t===null)return!0;t=y(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=y(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=h(this._fragmentFiber);e!==null&&(e=y(e),e=lp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=y(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=y(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=y(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=y(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=h(this._fragmentFiber);return t===null?this:y(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=h(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=y(t);if(n.length===0){if(n=r,g(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=_(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=y(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=y(n[0]),i=y(n[n.length-1]);var a=g(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Bt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=h(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=ee(n,a,w),t===null?t=!1:(m(t,!0,S,a,n),a=b,b=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=ee(r,a,w),t===null?t=!1:(m(t,!0,C,a,r),a=b,x=b=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(o(566));var t=[];m(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=_(this._fragmentFiber);if(r=n?r[1]||r[0]||h(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=y(r),Zp(e,n);return}if(r=y(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=y(i),Zp(i,n)):y(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=y(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),zt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Lt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(o(452));return e;case`head`:if(e=t.head,!e)throw Error(o(453));return e;case`body`:if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&$(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===En&&(e.onclick=null),zt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);zt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=O.d;O.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=zd();return e||t}function Cm(e){var t=Vt(e);t!==null&&t.tag===5&&t.type===`form`?cc(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=dn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Wt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+dn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+dn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+dn(n.imageSizes)+`"]`)):i+=`[href="`+dn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Rt]=!0,o.onload=o.onerror=function(){Gt(o)}),Wt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+dn(r)+`"][href="`+dn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Wt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Ut(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Wt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Ut(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Wt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Ut(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Wt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=Ae.current)?bm(i):null;if(!i)throw Error(o(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Ut(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var a=Ut(i).hoistableStyles,s=a.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=i.querySelector(Fm(e)))?a._p||(s.instance=a,s.state.loading=5):(a=vm.get(e),a||(a={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,a)),Lm(i,e,a,s.state))),t&&r===null)throw Error(o(528,``));return s}if(t&&r!==null)throw Error(o(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Ut(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Pm(e){return`href="`+dn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Rt]){r.loading=1;return}}else t=e.createElement(`link`),t[Rt]=!0,t.onload=t.onerror=Gt.bind(null,t),np(t,`link`,n),Wt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+dn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+dn(n.href)+`"]`);if(r)return t.instance=r,Wt(r),r;var i=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Wt(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var a=e.querySelector(Fm(i));if(a)return t.state.loading|=4,t.instance=a,Wt(a),a;r=Im(n),(i=vm.get(i))&&Hm(r,i),a=(e.ownerDocument||e).createElement(`link`),Wt(a);var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(a,`link`,r),t.state.loading|=4,Vm(a,n.precedence,e),t.instance=a;case`script`:return a=Rm(n.src),(i=e.querySelector(zm(a)))?(t.instance=i,Wt(i),i):(r=n,(i=vm.get(a))&&(r=T({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Wt(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(o(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Lt]||a[At]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Wt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Wt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:se,Provider:null,Consumer:null,_currentValue:Ce,_currentValue2:Ce,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=yt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yt(0),this.hiddenUpdates=yt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=zi(3,null,null,t),e.current=a,a.stateNode=e,t=Ra(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},xo(a),e}function uh(e){return e?(e=Li,e):Li}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=Co(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=wo(e,r,t),n!==null&&(Pd(n,e,t),To(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=Pi(e,67108864);t!==null&&Pd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=X();t=Tt(t);var n=Pi(e,t);n!==null&&Pd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=D.T;D.T=null;var a=O.p;try{O.p=2,yh(e,t,n,r)}finally{O.p=a,D.T=i}}function vh(e,t,n,r){var i=D.T;D.T=null;var a=O.p;try{O.p=8,yh(e,t,n,r)}finally{O.p=a,D.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Kf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=pt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-ot(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(H&6)&&(yd=Je()+500,Df(0,!1))}}break;case 31:case 13:s=Pi(a,2),s!==null&&Pd(s,a,2),zd(),ph(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=On(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Bt(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l(t),e!==null)return e;e=null}else if(n===31){if(e=u(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ye()){case Xe:return 2;case Ze:return 8;case Qe:case $e:return 32;case et:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Vt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Bt(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=l(n),t!==null){e.blockedOn=t,Ot(e.priority,function(){hh(n)});return}}else if(t===31){if(t=u(n),t!==null){e.blockedOn=t,Ot(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Dn=r,n.target.dispatchEvent(r),Dn=null}else return t=Vt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Vt(n);a!==null&&(e.splice(t,3),t-=3,oc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[jt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[jt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current;dh(n,X(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),zd(),t[Mt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=Dt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=i.version;if(Kh!==`19.3.1`)throw Error(o(527,Kh,`19.3.1`));O.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(o(188)):(e=Object.keys(e).join(`,`),Error(o(268,e)));return e=f(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:D,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{rt=Jh.inject(qh),it=Jh}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(o(299));var n=!1,r=``,i=kc,a=Ac,c=jc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,a,c,Uh),e[Mt]=t.current,Wf(e),new Wh(t)}})),Pi=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ni()}));function Fi(e){try{let t=(e.split(`.`)[1]??``).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t.padEnd(Math.ceil(t.length/4)*4,`=`)),r=Uint8Array.from(n,e=>e.charCodeAt(0)),i=JSON.parse(new TextDecoder().decode(r));return i&&typeof i==`object`?i:{}}catch{return{}}}function Ii(e,t,n=0){let r=Fi(e);if(Object.keys(r).length===0)return!0;let i=r.exp;return!(i==null||typeof i==`number`&&i-n>t/1e3)}var Li=`hbc_3142635823`;function Ri(e,t,n){let r=t.token,i=t.record,a=[],o=(e,t,o)=>{r=e,i=t,o&&n?.(e,t);for(let n of[...a])n(e,t)};return{store:{get token(){return r},get record(){return i},get isValid(){return!Ii(r,e())},get isSuperuser(){let e=Fi(r);return e.type===`auth`&&(i?.collectionName===`_superusers`||e.collectionId===`hbc_3142635823`)},save:(e,t)=>o(e,t,!0),clear:()=>o(``,null,!0),onChange(e,t=!1){return a.push(e),t&&e(r,i),()=>{let t=a.indexOf(e);t>=0&&a.splice(t,1)}}},replace:(e,t)=>o(e,t,!1)}}function zi(e=Date.now){return Ri(e,{token:``,record:null}).store}function Bi(e){try{let t=e?JSON.parse(e):null;if(t&&typeof t==`object`){let{token:e,record:n}=t;return{token:typeof e==`string`?e:``,record:n&&typeof n==`object`?n:null}}}catch{}return{token:``,record:null}}function Vi(e){let t=(t,n)=>{try{let r=e();return r?t(r):n}catch{return n}};return{getItem:e=>t(t=>t.getItem(e),null),setItem:(e,n)=>t(t=>t.setItem(e,n),void 0),removeItem:e=>t(t=>t.removeItem(e),void 0)}}function Hi(e=`hb_auth`,t,n=Date.now){let r=Vi(()=>t??globalThis.localStorage),{store:i,replace:a}=Ri(n,Bi(r.getItem(e)),(t,n)=>{t||n?r.setItem(e,JSON.stringify({token:t,record:n})):r.removeItem(e)});return globalThis.addEventListener?.(`storage`,t=>{if(t.key!==e)return;let n=Bi(t.newValue);a(n.token,n.record)}),i}var Ui={fetch:(e,t)=>globalThis.fetch(e,t),setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e),now:()=>Date.now()},Wi=new Set([`@now`,`@second`,`@minute`,`@hour`,`@weekday`,`@day`,`@month`,`@year`,`@yesterday`,`@tomorrow`,`@todayStart`,`@todayEnd`,`@monthStart`,`@monthEnd`,`@yearStart`,`@yearEnd`]),Gi=[[`eq`,`=`],[`neq`,`!=`],[`gt`,`>`],[`gte`,`>=`],[`lt`,`<`],[`lte`,`<=`],[`like`,`~`],[`notLike`,`!~`],[`anyEq`,`?=`],[`anyNeq`,`?!=`],[`anyGt`,`?>`],[`anyGte`,`?>=`],[`anyLt`,`?<`],[`anyLte`,`?<=`],[`anyLike`,`?~`],[`anyNotLike`,`?!~`]],Ki=new Set([...Gi.map(([e])=>e),`insensitive`,`length`,`each`,`empty`]),qi=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof Date),Ji=e=>!(typeof e==`string`&&e!==``||typeof e==`number`&&Number.isFinite(e)||typeof e==`boolean`||e instanceof Date&&!Number.isNaN(e.getTime())),Yi=e=>({kind:`field`,path:e});function Xi(e,t){return e instanceof Date?{kind:`value`,value:e.toISOString().replace(`T`,` `)}:typeof e==`string`?Wi.has(e)?{kind:`macro`,name:e}:{kind:`value`,value:t?e.toLowerCase():e}:{kind:`value`,value:e}}function Zi(e,t,n){let r=n||t.insensitive===!0,i=[];for(let[n,a]of Gi){let o=t[n];if(Ji(o))continue;let s=r&&typeof o==`string`;i.push({kind:`cmp`,op:a,left:Yi(s?`${e}:lower`:e),right:Xi(o,s)})}typeof t.empty==`boolean`&&i.push({kind:`cmp`,op:t.empty?`=`:`!=`,left:Yi(e),right:{kind:`value`,value:``}});for(let n of[`length`,`each`])qi(t[n])&&i.push(...Zi(`${e}:${n}`,t[n],n===`each`&&r));return i}function Qi(e,t){return t.length===0?null:t.length===1?t[0]:{kind:e,items:t.flatMap(t=>t.kind===e?t.items:[t])}}function $i(e,t){let n=[];for(let[r,i]of Object.entries(e)){if(r===`AND`||r===`OR`){if(!Array.isArray(i))continue;let e=i.flatMap(e=>{if(!qi(e))return[];let n=Qi(`and`,$i(e,t));return n?[n]:[]}),a=Qi(r===`AND`?`and`:`or`,e);a&&n.push(a);continue}let e=t?`${t}.${r}`:r;if(qi(i)){let t=Object.keys(i).some(e=>Ki.has(e));n.push(...t?Zi(e,i,!1):$i(i,e))}else Ji(i)||n.push({kind:`cmp`,op:`=`,left:Yi(e),right:Xi(i,!1)})}return n}function ea(e){return Qi(`and`,$i(e,``))}function ta(e){let t=(e,n)=>Object.entries(e).flatMap(([e,r])=>{if(r===!0)return[n+e];if(typeof r!=`object`||!r)return[];let i=t(r,`${n}${e}.`);return i.length>0?i:[n+e]});return e?t(e,``).join(`,`):``}var na={"\\":`\\\\`,'"':`\\"`,"\n":`\\n`," ":`\\t`,"\r":`\\r`},ra=e=>`"${e.replace(/[\\"\n\t\r]/g,e=>na[e])}"`;function ia(e){switch(e.kind){case`field`:return e.path;case`macro`:return e.name;case`call`:return`${e.name}(${e.args.map(ia).join(`,`)})`;case`value`:return typeof e.value==`string`?ra(e.value):String(e.value)}}function aa(e){if(e.kind===`cmp`)return`${ia(e.left)}${e.op}${ia(e.right)}`;let t=e.kind===`and`?` && `:` || `;return e.items.flatMap(t=>{let n=aa(t);return n===``?[]:[t.kind!==`cmp`&&t.kind!==e.kind?`(${n})`:n]}).join(t)}function oa(e){return e?aa(e):``}function sa(e){return e?(Array.isArray(e)?e:[e]).flatMap(e=>Object.entries(e)).map(([e,t])=>t===`desc`?`-${e}`:e).join(`,`):``}function ca(e,t){return!e||!t?e||t||``:`(${e}) && (${t})`}function la(e,t){return[e,t].filter(Boolean).join(`,`)}var ua=encodeURIComponent;function N(e){let t=e=>`/api/collections/${ua(e)}`;return{findMany(t,n){let r=ca(t?.where?oa(ea(t.where)):``,t?.filter),i=la(sa(t?.orderBy),t?.sort);return e.send(`/api/collections`,{...n,query:{page:t?.page,perPage:t?.perPage,skipTotal:t?.count===!1?1:void 0,filter:r||void 0,sort:i||void 0}})},findOne:(n,r)=>e.send(t(n),r),create:(t,n)=>e.send(`/api/collections`,{...n,method:`POST`,body:t}),update:(n,r,i)=>e.send(t(n),{...i,method:`PATCH`,body:r}),delete:(n,r)=>e.send(t(n),{...r,method:`DELETE`}),truncate:(n,r)=>e.send(`${t(n)}/truncate`,{...r,method:`DELETE`}),import:(t,n=!1,r)=>e.send(`/api/collections/import`,{...r,method:`PUT`,body:{collections:t,deleteMissing:n}}),scaffolds:t=>e.send(`/api/collections/meta/scaffolds`,t)}}function P(e){return{get:t=>e.send(`/api/settings`,t),update:(t,n)=>e.send(`/api/settings`,{...n,method:`PATCH`,body:t}),testEmail:(t,n,r,i)=>e.send(`/api/settings/test/email`,{...i,method:`POST`,body:{email:n,template:r,collection:t}}),generateAppleClientSecret:(t,n,r,i,a,o)=>e.send(`/api/settings/apple/generate-client-secret`,{...o,method:`POST`,body:{clientId:t,teamId:n,keyId:r,privateKey:i,duration:a}}),testS3:(t,n)=>e.send(`/api/settings/test/s3`,{...n,method:`POST`,body:{filesystem:t}})}}function da(e){return{list:t=>e.send(`/api/crons`,t),run:(t,n)=>e.send(`/api/crons/${ua(t)}`,{...n,method:`POST`})}}function fa(e){return{check:t=>e.send(`/api/health`,t)}}var pa=`The request was aborted (most likely autocancelled).`,ma=class extends Error{constructor(e={}){let t=e.response!==null&&typeof e.response==`object`?e.response:{},n=!!e.isAbort,r=typeof t.message==`string`&&t.message?t.message:n?pa:`Something went wrong.`;super(r),this.name=`HeybeError`,this.url=e.url??``,this.status=e.status??0,this.response=t,this.isAbort=n,this.cause=e.cause}};function ha(e,t=!1){let n=new ma({isAbort:t,cause:Error(e)});return n.message=e,n}function ga(e){let t=globalThis.window;if(!t?.open)throw ha(`Not in a browser context - please pass a custom urlCallback function.`);let n=Math.min(1024,t.innerWidth),r=Math.min(768,t.innerHeight),i=t.innerWidth/2-n/2,a=t.innerHeight/2-r/2;return t.open(e,`popup_window`,`width=${n},height=${r},top=${a},left=${i},resizable,menubar=no`)}function _a(e,t){let n=e.indexOf(`?`),r=n<0?e:e.slice(0,n),i=e=>decodeURIComponent(e.replace(/\+/g,` `)),a=new Map;for(let t of n<0?[]:e.slice(n+1).split(`&`)){if(!t)continue;let[e,n=``]=t.split(`=`);a.set(i(e),i(n))}for(let[e,n]of Object.entries(t))a.set(e,n);let o=[...a].map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join(`&`);return o?`${r}?${o}`:r}async function va(e,t){let{provider:n,scopes:r,createData:i,urlCallback:a,...o}=t,s=a?null:ga(),c=e.realtime(),l=()=>{},u,d=``,f,p=!1;try{if(u=(await e.auth.methods({requestKey:o.requestKey,signal:o.signal})).oauth2.providers.find(e=>e.name===n),!u)throw ha(`Missing or invalid provider "${n}".`);let{authURL:t}=u;d=e.buildURL(`/api/oauth2-redirect`),f=await new Promise((e,n)=>{if(l=()=>n(ha(`manually cancelled`,!0)),o.signal?.aborted)return l();o.signal?.addEventListener(`abort`,l,{once:!0}),c.onDisconnect=e=>{e.length&&n(ha(`realtime connection interrupted`))},(async()=>{if(await c.subscribe(`@oauth2`,t=>{!t.state||t.state!==c.clientId?n(ha(`State parameters don't match.`)):t.error||!t.code?n(ha(`OAuth2 redirect error or missing code: `+t.error)):e(t.code)}),p)return;let i={state:c.clientId};r?.length&&(i.scope=r.join(` `));let o=_a(t+d,i);a?await a(o):s?s.location.href=o:s=ga(o)})().catch(n)})}catch(e){throw e instanceof ma?e:new ma({cause:e})}finally{p=!0,c.onDisconnect=void 0,o.signal?.removeEventListener(`abort`,l),s?.close(),c.unsubscribe().catch(()=>{})}return e.auth.withOAuth2Code(u.name,f,u.codeVerifier,d,i,o)}function ya(e,t){let n=e,r=globalThis.location;return r&&!/^https?:\/\//.test(e)&&(n=r.origin.replace(/\/$/,``),e.startsWith(`/`)||(n+=r.pathname||`/`,n.endsWith(`/`)||(n+=`/`)),n+=e),t&&(n.endsWith(`/`)||(n+=`/`),n+=t.startsWith(`/`)?t.slice(1):t),n}function ba(e){return e==null?null:e instanceof Date?encodeURIComponent(e.toISOString().replace(`T`,` `)):encodeURIComponent(typeof e==`object`?JSON.stringify(e):String(e))}function xa(e){let t=[];for(let[n,r]of Object.entries(e))for(let e of Array.isArray(r)?r:[r]){let r=ba(e);r!==null&&t.push(`${encodeURIComponent(n)}=${r}`)}return t.join(`&`)}function Sa(e){return typeof Blob<`u`&&e instanceof Blob}function Ca(e){return(Array.isArray(e)?e:[e]).some(Sa)}function wa(e){return typeof e==`string`||e instanceof FormData||e instanceof URLSearchParams||Sa(e)}function Ta(e){if(e==null)return;if(wa(e))return e;if(typeof e!=`object`||!Object.values(e).some(Ca))return JSON.stringify(e);let t=new FormData;for(let[n,r]of Object.entries(e))if(r!==void 0){if(typeof r==`object`&&!Ca(r))t.append(`@jsonPayload`,JSON.stringify({[n]:r}));else for(let e of Array.isArray(r)?r:[r])t.append(n,Sa(e)?e:String(e))}return t}function Ea(e){return Object.keys(e??{}).some(e=>e.toLowerCase()===`authorization`)}function Da(e){return e instanceof Error&&(e.name===`AbortError`||e.message===`Aborted`)}function Oa(e){let t=new Map;function n(e){t.get(e)?.abort(),t.delete(e)}function r(){for(let e of t.values())e.abort();t.clear()}async function i(r,i={}){let a=e.beforeSend?.(r,i.headers);a&&await a;let o=i.method??`GET`,s=ya(e.url,r),c=i.query?xa(i.query):``;c&&(s+=(s.includes(`?`)?`&`:`?`)+c);let l=Ta(i.body),u=new Headers(i.headers);u.has(`Content-Type`)||wa(i.body)||l instanceof FormData||u.set(`Content-Type`,`application/json`),u.has(`Accept-Language`)||u.set(`Accept-Language`,e.lang);let d=e.token();d&&!u.has(`Authorization`)&&u.set(`Authorization`,d);let f=i.signal,p=``,m,h=()=>m?.abort();e.autoCancel()&&i.requestKey!==null&&(p=i.requestKey||o+r.split(`?`)[0],n(p),m=new AbortController,t.set(p,m),f?.aborted?m.abort():f?.addEventListener(`abort`,h,{once:!0}),f=m.signal);let g=e.env.fetch;try{let e=await g(s,{method:o,headers:u,body:l,signal:f}),t=await e.text(),n;try{n=t?JSON.parse(t):void 0}catch{}if(e.status>=400)throw new ma({url:e.url||s,status:e.status,response:n});return n}catch(e){throw e instanceof ma?e:new ma({url:s,isAbort:!!f?.aborted||Da(e),cause:e})}finally{i.signal?.removeEventListener(`abort`,h),m&&t.get(p)===m&&t.delete(p)}}return{send:i,cancelRequest:n,cancelAllRequests:r}}var ka=[`_superusers`,Li];function Aa(e,t,n){let r=`/api/collections/${encodeURIComponent(t)}`,i=e.authStore,a=async(t,n,i)=>{await e.send(r+t,{...i,method:`POST`,body:n})};async function o(t,n,a={}){let{mfaId:o,expand:s,autoRefreshThreshold:c,...l}=a,u=ta(s),d=await e.send(r+t,{...l,method:`POST`,body:o?{...n,mfaId:o}:n,query:u?{expand:u}:void 0});return i.save(d.token,d.record),d}async function s(e,r,a={},c=!1){let l=ka.includes(t);l&&!c&&n.autoRefresh.reset();let u=await o(`/auth-with-password`,{identity:e,password:r},a),{autoRefreshThreshold:d,expand:f}=a;return d!==void 0&&l&&n.autoRefresh.register({threshold:d,record:i.record,run:()=>s(e,r,{autoRefreshThreshold:d,expand:f},!0)}),u}let c=e=>{let t=Fi(e),n=i.record;return!!n&&n.id===t.id&&n.collectionId===t.collectionId},l={methods(t){return e.send(r+`/auth-methods`,{...t,query:{fields:`mfa,otp,password,oauth2`}})},withPassword:(e,t,n)=>s(e,t,n),requestOTP(t,n){return e.send(r+`/request-otp`,{...n,method:`POST`,body:{email:t}})},withOTP(e,t,n){return o(`/auth-with-otp`,{otpId:e,password:t},n)},withOAuth2Code(e,t,n,r,i,a){return o(`/auth-with-oauth2`,{provider:e,code:t,codeVerifier:n,redirectURL:r,createData:i},a)},withOAuth2:t=>va({auth:l,realtime:n.realtime,buildURL:e.buildURL},t),refresh(e){return o(`/auth-refresh`,void 0,e)},async logout(e){let t=i.token;try{t&&await a(`/logout`,void 0,{...e,headers:Ea(e?.headers)?e?.headers:{...e?.headers,Authorization:t}})}finally{i.clear()}},async logoutAll({recordId:t,...n}={}){await e.send(r+`/logout-all`,{...n,method:`POST`,query:t?{recordId:t}:void 0}),t&&t!==i.record?.id||i.clear()},sessions({recordId:t,...n}={}){return e.send(r+`/sessions`,{...n,query:t?{recordId:t}:void 0})},async revokeSession(t,n){await e.send(`${r}/sessions/${encodeURIComponent(t)}`,{...n,method:`DELETE`})},async impersonate(e,t,a){let o=n.fork(),s=await o.send(`${r}/impersonate/${encodeURIComponent(e)}`,{...a,method:`POST`,body:{duration:t},headers:i.token&&!Ea(a?.headers)?{...a?.headers,Authorization:i.token}:a?.headers});return o.authStore.save(s.token,s.record),o},requestVerification:(e,t)=>a(`/request-verification`,{email:e},t),async confirmVerification(e,t){await a(`/confirm-verification`,{token:e},t),c(e)&&!i.record.verified&&i.save(i.token,{...i.record,verified:!0})},requestPasswordReset:(e,t)=>a(`/request-password-reset`,{email:e},t),confirmPasswordReset:(e,t,n,r)=>a(`/confirm-password-reset`,{token:e,password:t,passwordConfirm:n},r),requestEmailChange:(e,t)=>a(`/request-email-change`,{newEmail:e},t),async confirmEmailChange(e,t,n){await a(`/confirm-email-change`,{token:e,password:t},n),c(e)&&i.clear()}};return l}var ja=encodeURIComponent;function Ma(e){return{list:t=>e.send(`/api/backups`,t),create:(t,n)=>e.send(`/api/backups`,{...n,method:`POST`,body:{name:t}}),upload(t,n){let r=new FormData;return r.append(`file`,t),e.send(`/api/backups/upload`,{...n,method:`POST`,body:r})},delete:(t,n)=>e.send(`/api/backups/${ja(t)}`,{...n,method:`DELETE`}),restore:(t,n)=>e.send(`/api/backups/${ja(t)}/restore`,{...n,method:`POST`}),downloadURL:(t,n)=>`${e.buildURL(`/api/backups/${ja(n)}`)}?token=${ja(t)}`}}var Na=e=>e instanceof Blob;function Pa(e){let t={},n={};for(let[r,i]of Object.entries(e)){if(!Array.isArray(i)){Na(i)?n[r]=[i]:t[r]=i;continue}let e=i.filter(Na);if(e.length===0){t[r]=i;continue}let a=i.filter(e=>!Na(e));a.length===0?n[r]=e:(t[r]=a,n[r.endsWith(`+`)?r:`${r}+`]=e)}return{body:t,files:n}}function Fa(e){let t=[],n=[];function r(e,r,i={},a){let o=Pa(i),s=xa({expand:ta(a)||void 0});t.push({method:e,url:s?`${r}?${s}`:r,headers:{},body:o.body});for(let[e,r]of Object.entries(o.files))for(let i of r)n.push([t.length-1,e,i])}return{records:e=>{let t=`/api/collections/${encodeURIComponent(e)}/records`,n=e=>`${t}/${encodeURIComponent(e)}`;return{create:(e,n)=>r(`POST`,t,e,n?.expand),update:(e,t,i)=>r(`PATCH`,n(e),t,i?.expand),upsert:(e,n)=>r(`PUT`,t,e,n?.expand),delete:e=>r(`DELETE`,n(e))}},async send(r){let i=new FormData;i.append(`@jsonPayload`,JSON.stringify({requests:t}));for(let[e,t,r]of n)i.append(`requests.${e}.${t}`,r);return e.send(`/api/batch`,{...r,method:`POST`,body:i})}}}function Ia(e){return{url(t,n,r={}){let i=t.collectionId||t.collectionName;if(!n||!t.id||!i)return``;let a=encodeURIComponent,o=e.buildURL(`api/files/${a(i)}/${a(t.id)}/${a(n)}`),s=xa({...r,download:r.download||void 0});return s?`${o}?${s}`:o},async token(t){return(await e.send(`/api/files/token`,{...t,method:`POST`}))?.token||``}}}var La=e=>ca(e?.where?oa(ea(e.where)):``,e?.filter)||void 0;function Ra(e){return{findMany(t,n){return e.send(`/api/logs`,{...n,query:{page:t?.page,perPage:t?.perPage,skipTotal:t?.count===!1?1:void 0,filter:La(t),sort:la(sa(t?.orderBy),t?.sort)||void 0}})},findOne:(t,n)=>e.send(`/api/logs/${encodeURIComponent(t)}`,n),stats:(t,n)=>e.send(`/api/logs/stats`,{...n,query:{filter:La(t)}}),truncate:t=>e.send(`/api/logs`,{...t,method:`DELETE`})}}async function za(e,t,n){let r=e.getReader(),i=()=>void r.cancel().catch(()=>{});n?.aborted&&i(),n?.addEventListener(`abort`,i,{once:!0});let a=new TextDecoder,o=``,s=``,c=``,l=[],u=!1,d=e=>{if(e.endsWith(`\r`)&&(e=e.slice(0,-1)),!e){u&&t({id:s,event:c||`message`,data:l.join(`
|
|
12
12
|
`)}),s=``,c=``,l=[],u=!1;return}let n=e.indexOf(`:`);if(n===0)return;let r=n<0?e:e.slice(0,n),i=n<0?``:e.slice(n+1);if(i.startsWith(` `)&&(i=i.slice(1)),r===`id`)s=i;else if(r===`event`)c=i;else if(r===`data`)l.push(i);else return;u=!0};try{for(;;){let{done:e,value:t}=await r.read();o+=e?a.decode():a.decode(t,{stream:!0});let n;for(;(n=o.indexOf(`
|
|
13
|
-
`))>=0;)d(o.slice(0,n)),o=o.slice(n+1);if(e)return}}finally{n?.removeEventListener(`abort`,i),r.releaseLock()}}var Ba=15e3,Va=[200,300,500,1e3,1200,1500,2e3];function Ha(e,t){if(!e)return``;let n=Fi(e);return`${n.collectionId??t?.collectionId}/${n.id??t?.id}`}function Ua(e){try{return JSON.parse(e)||{}}catch{return{}}}function Wa(e){let{env:t}=e,n=new Map,r=``,i=null,a=[],o,s,c=0,l=!1,u=[],d=[],f=!1,p=e.authStore.token,m=Ha(p,e.authStore.record),h=``,g=()=>`realtime_${r}`,_=()=>[...n.keys()].filter(e=>n.get(e).length),v=()=>{let e=_();return e.length!==a.length||e.some(e=>!a.includes(e))},y=e=>[...n.keys()].filter(t=>(t+`?`).startsWith(e)),b=e=>y(e.includes(`?`)?e:e+`?`),x=e=>{let t=u;u=[];for(let n of t)e?n.reject(e):n.resolve()};async function S(){if(!_().length)return ie();if(r&&(v()||h!==e.authStore.token)){a=_();try{await e.send(`/api/realtime`,{method:`POST`,body:{clientId:r,subscriptions:a},requestKey:g()}),h=e.authStore.token}catch(e){if(!e?.isAbort)throw e}}}async function C(){if(f||!d.length)return;let e=d;d=[],f=!0;try{await S();for(let t of e)t.resolve()}catch(t){for(let n of e)n.reject(t)}finally{f=!1,d.length&&await C()}}function w(){return new Promise((e,t)=>{d.push({resolve:e,reject:t}),d.length===1&&Promise.resolve().then(C)})}function ee(){return c>0?Promise.resolve():new Promise((e,t)=>{u.push({resolve:e,reject:t}),u.length===1&&!i&&Promise.resolve().then(T)})}function T(){ie(!0),o=t.setTimeout(()=>re(Error(`Realtime connect took too long.`)),Ba);let n=new AbortController;i=n;let r=()=>i===n;t.fetch(e.buildURL(`/api/realtime`),{headers:{Accept:`text/event-stream`},signal:n.signal}).then(e=>{if(!e.ok||!e.body)throw e.body?.cancel().catch(()=>{}),Error(`Failed to establish realtime connection.`);return za(e.body,e=>r()&&te(e),n.signal)}).then(()=>r()&&re(Error(`Realtime stream ended.`)),e=>r()&&re(e))}function te(e){if(e.event===`HB_CONNECT`)return ne(e);for(let t of[...n.get(e.event)??[]])t(Ua(e.data))}function ne(e){let u=i;r=e.id,a=[],w().then(async()=>{if(i===u){for(let e=3;v()&&e>0;e--)await w();x(),c=0,l=!1,t.clearTimeout(s),t.clearTimeout(o);for(let t of b(`HB_CONNECT`))for(let r of[...n.get(t)])r(Ua(e.data));v()&&await w()}}).catch(e=>{i===u&&(r=``,a=[],re(e))})}function re(e){if(t.clearTimeout(o),t.clearTimeout(s),!r&&!c&&!l){x(e instanceof ma?e:new ma({cause:e})),ie();return}ie(!0);let n=Va[Math.min(c,Va.length-1)];c++,s=t.setTimeout(T,n)}function ie(u=!1){r&&E.onDisconnect?.([...n.keys()]),t.clearTimeout(o),t.clearTimeout(s),e.cancelRequest(g()),i?.abort(),i=null,r=``,a=[],u||(c=0,l=!1,x())}function ae(e,t){for(let r of e){let e=n.get(r);if(!e)continue;let i=t?e.filter(e=>e!==t):[];i.length?n.set(r,i):n.delete(r)}}e.authStore.onChange((e,t)=>{if(e===p)return;let n=Ha(e,t)===m;if(p=e,m=Ha(e,t),r){if(n)return void w().catch(()=>{});l=!0,T()}});let E={get clientId(){return r},get isConnected(){return!!i&&!!r&&!u.length},async subscribe(e,t,r){if(!e)throw Error(`topic must be set.`);let i=e;r&&(i+=(e.includes(`?`)?`&`:`?`)+`options=`+encodeURIComponent(JSON.stringify({query:r.query,headers:r.headers})));let a=e=>t(e),o=n.get(i)??[];return o.push(a),n.set(i,o),E.isConnected?o.length===1&&await w():await ee(),()=>(ae(b(e),a),w())},async unsubscribe(e){ae(e?b(e):[...n.keys()]),await w()},async unsubscribeByPrefix(e){let t=y(e);t.length&&(ae(t),await w())}};return E}function Ga(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==``&&e!=null))}function Ka(e,t){return Ga({page:t?1:e?.page,perPage:t?1:e?.perPage,skipTotal:t||e?.count===!1?1:void 0,filter:ca(e?.where?oa(ea(e.where)):``,e?.filter),sort:la(sa(e?.orderBy),e?.sort),expand:ta(e?.expand)})}var qa=(e,t={})=>new ma({status:404,response:{code:404,message:e,data:t}});function Ja(e,t){let n=`/api/collections/${encodeURIComponent(t)}/records`,r=e=>`${n}/${encodeURIComponent(e)}`,i=e=>Ga({expand:ta(e?.expand)});function a(n){let r=e.authStore.record;return r?.id===n&&(r.collectionId===t||r.collectionName===t)}return{collection:t,findMany(t,r){return e.send(n,{...r,query:Ka(t,!1)})},async findOne(t,n,a){if(!t)throw qa(`Missing required record id.`);return e.send(r(t),{...a,query:i(n)})},async findFirst(t,r){let i=Ka(t,!0),a=await e.send(n,{...r,requestKey:r?.requestKey===void 0?`one_by_filter_${n}_${i.filter??``}`:r.requestKey,query:i});if(!a?.items?.length)throw qa(`The requested resource wasn't found.`);return a.items[0]},create(t,r,a){return e.send(n,{...a,method:`POST`,body:t,query:i(r)})},async update(t,n,o,s){let c=await e.send(r(t),{...s,method:`PATCH`,body:n,query:i(o)});if(a(c.id)){let t=e.authStore.record,n={...t,...c};(t.expand||c.expand)&&(n.expand={...t.expand,...c.expand}),e.authStore.save(e.authStore.token,n)}return c},async delete(t,n){await e.send(r(t),{...n,method:`DELETE`}),a(t)&&e.authStore.clear()},subscribe(n,r,i){let a=Ga({filter:i?.where?oa(ea(i.where)):``,expand:ta(i?.expand)}),o=Object.keys(a).length>0,s=o||i?.headers?{query:o?a:void 0,headers:i?.headers}:void 0;return e.realtime.subscribe(`${t}/${n}`,r,s)},unsubscribe(n){return n?e.realtime.unsubscribe(`${t}/${n}`):e.realtime.unsubscribeByPrefix(`${t}/`)}}}var Ya=[`/auth-refresh`,`/auth-with-password`];function Xa(e){let{store:t}=e,n=null,r=null;t.onChange((e,t)=>{n&&(!e||t?.id!==n.record.id||t?.collectionId!==n.record.collectionId)&&(n=null)});let i=n=>t.isValid&&!!t.record&&Ii(t.token,e.now(),n);async function a(n,r){let a=t.isValid;if(i(r)){let{token:n,record:r}=t;try{let i=await e.refresh(r.collectionName||r.collectionId);t.token===n&&t.save(i.token,i.record)}catch{a=!1}}!a&&n&&await n.run()}return{register(e){n=e},reset(){n=null},before(o,s){if(Ya.some(e=>o.endsWith(e))||Ea(s))return;if(r)return r;let c=n,l=c?.threshold??e.threshold;if(l!==void 0&&(i(l)||c&&!t.isValid))return r=a(c,l).finally(()=>{r=null}),r}}}function Za(e){return{run:(t,n)=>e.send(`/api/sql`,{...n,method:`POST`,body:{query:t}})}}function Qa(e,t={}){return $a(e,t,{...Ui,fetch:t.fetch??Ui.fetch})}function $a(e,t,n){let r=t.lang??`en-US`,i=t.authStore??eo(n.now),a=Xa({store:i,now:n.now,threshold:t.autoRefreshThreshold,refresh:e=>l.send(`/api/collections/${encodeURIComponent(e)}/auth-refresh`,{method:`POST`,requestKey:null})}),o=Oa({url:e,lang:r,env:n,token:()=>i.token,autoCancel:()=>l.autoCancel,beforeSend:a.before}),s=()=>$a(e,{lang:r,autoCancel:l.autoCancel,authStore:zi(n.now)},n),c=(t=i)=>Wa({env:n,authStore:t,buildURL:t=>ya(e,t),send:o.send,cancelRequest:o.cancelRequest}),l={url:e,lang:r,authStore:i,autoCancel:t.autoCancel??!0,buildURL:t=>ya(e,t),...o,realtime:c(),files:Ia({send:o.send,buildURL:t=>ya(e,t)}),collections:N(o),settings:P(o),crons:da(o),health:fa(o),logs:Ra(o),backups:Ma({send:o.send,buildURL:t=>ya(e,t)}),sql:Za(o),batch:()=>Fa(l),records:e=>Ja(l,e),auth:e=>Aa(l,e,{autoRefresh:a,fork:s,realtime:()=>c(zi(n.now))})};return l}function eo(e){try{if(typeof window<`u`&&window.localStorage)return Hi(void 0,void 0,e)}catch{}return zi(e)}var to=Pi(),no=new WeakMap;function ro(e,t){no.set(e,t)}function io(e={}){let t=e.fetch??((e,t)=>globalThis.fetch(e,t)),n=Qa(e.url??`/`,{fetch:async(e,r)=>{let i=await t(e,r),a=n.authStore.token;return i.status===401&&a&&new Headers(r?.headers).get(`Authorization`)===a&&no.get(n)?.(),i},authStore:e.authStore??Hi(`hb_superuser_auth`),autoCancel:!1});return n}var ao=T.createContext(void 0),oo=e=>{let t=T.useContext(ao);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},so=({client:e,children:t})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,j.jsx)(ao.Provider,{value:e,children:t})),co={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},lo=new class{#e=co;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function uo(e){setTimeout(e,0)}var fo=typeof window>`u`||`Deno`in globalThis;function po(){}function mo(e,t){return typeof e==`function`?e(t):e}function ho(e){return typeof e==`number`&&e>=0&&e!==1/0}function go(e,t){return Math.max(e+(t||0)-Date.now(),0)}function _o(e,t){return typeof e==`function`?e(t):e}function vo(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==bo(o,t.options))return!1}else if(!So(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function yo(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(xo(t.options.mutationKey)!==xo(a))return!1}else if(!So(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function bo(e,t){return(t?.queryKeyHashFn||xo)(e)}function xo(e){return JSON.stringify(e,(e,t)=>Do(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function So(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!So(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!So(e[r],t[r]))return!1;return!0}return!1}var Co=Object.prototype.hasOwnProperty;function wo(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Eo(e)&&Eo(t);if(!r&&!(Do(e)&&Do(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Co.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=wo(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function To(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n of Object.keys(e))if(!Co.call(t,n)||e[n]!==t[n])return!1;return!0}function Eo(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Do(e){if(!Oo(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!Oo(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function Oo(e){return Object.prototype.toString.call(e)===`[object Object]`}function ko(e){return new Promise(t=>{lo.setTimeout(t,e)})}function Ao(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:wo(e,t)}function jo(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(-n):r}function Mo(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,n):r}var No=Symbol();function Po(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===No?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Fo(e,t){return typeof e==`function`?e(...t):!!e}var Io=Symbol();function Lo(e,t,n,r){let i=!1,a;return Object.defineProperties(e,{[Io]:{value:r},signal:{enumerable:!0,get:()=>(a??=t(),i||(i=!0,a.aborted?n():a.addEventListener(`abort`,n,{once:!0})),a)}}),e}var Ro=()=>fo,zo=()=>Ro(),Bo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Vo=new class extends Bo{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Ho=uo;function Uo(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Ho,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var F=Uo(),Wo=new class extends Bo{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Go(e){return Math.min(1e3*2**e,3e4)}function Ko(e){return(e??`online`)!==`online`||Wo.isOnline()}var qo=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function I(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(po);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new qo(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Vo.isFocused()&&(e.networkMode===`always`||Wo.isOnline())&&e.canRun(),p=()=>Ko(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(zo()?0:3),a=e.retryDelay??Go,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),ko(o).then(()=>c()||f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var L=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ho(this.gcTime)&&(this.#e=lo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(zo()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(lo.clearTimeout(this.#e),this.#e=void 0)}};function Jo(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=t,u=e=>{Lo(e,()=>t.signal,()=>n=!0,l[Io])},d=Po(t.options,t.fetchOptions),f=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return u(e),e})(),o=await d(a),{maxPages:s}=t.options,c=i?Mo:jo;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Xo:Yo,n={pages:a,pageParams:o};s=await f(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:Yo(r,s);if(c>0&&e==null)break;s=await f(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Yo(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Xo(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Zo(e,t){return t?Yo(e,t)!=null:!1}function Qo(e,t){return!t||!e.getPreviousPageParam?!1:Xo(e,t)!=null}var $o=class extends L{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){super(),this.#c=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ns(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ns(this.options);e.data!==void 0&&(this.setState(ts(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Ao(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(po).catch(po):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>_o(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===No||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data!==void 0&&this.getObserversCount()>0&&this.observers.some(e=>_o(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!go(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#c||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a&&this.#o)return this.#a.continueRetry(),this.#o}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperties(e,{[Io]:{value:n.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#c=!0,n.signal)}})},i=()=>{let e=Po(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#c=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Jo(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=I({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof qo&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),s=(async()=>{try{let e=await o.promise;if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof qo){if(e.silent){if(this.#a!==o&&this.#o)return this.#o;throw e}if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0,this.#o=void 0),this.scheduleGc()}})();return this.#o=s,o.start(),s}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...es(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ts(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),F.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function es(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ko(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ts(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ns(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var rs=class extends Bo{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),as(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return os(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return os(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof _o(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!To(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&ss(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||_o(this.options.enabled,this.#t)!==_o(t.enabled,this.#t)||_o(this.options.staleTime,this.#t)!==_o(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||_o(this.options.enabled,this.#t)!==_o(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return To(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(po)),t}#h(e){return!zo()&&_o(this.options.enabled,this.#t)!==!1&&ho(e)}#g(){this.#b();let e=_o(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=go(this.#r.dataUpdatedAt,e)+1;this.#u=lo.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return _o(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=lo.setInterval(()=>{(this.options.refetchIntervalInBackground||Vo.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(lo.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(lo.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&as(e,t),o=i&&ss(e,n,t,r);(a||o)&&(l={...l,...es(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=Ao(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=Ao(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=i?.error===f?i.errorUpdatedAt:Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:cs(e,t),refetch:this.refetch,isEnabled:_o(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),To(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size||this.options.throwOnError&&this.#r.error!==e.error)return!0;for(let t of n??this.#p)if(this.#r[t]!==e[t])return!0;return!1})();F.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function is(e,t){return _o(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||_o(t.retryOnMount,e)!==!1)}function as(e,t){return is(e,t)||e.state.data!==void 0&&os(e,t,t.refetchOnMount)}function os(e,t,n){if(_o(t.enabled,e)!==!1&&_o(t.staleTime,e)!==`static`){let r=_o(n,e);return r===`always`||r!==!1&&cs(e,t)}return!1}function ss(e,t,n,r){return(e!==t||_o(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&cs(e,n)}function cs(e,t){return _o(t.enabled,e)!==!1&&e.isStaleByTime(_o(t.staleTime,e))}var ls=class extends rs{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Zo(t,n.data),hasPreviousPage:Qo(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},us=class extends L{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ds(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=I({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}this.state.isPaused&&r.canStart()&&t();let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),F.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function ds(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var fs=class extends Bo{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new us({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=ps(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=ps(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=ps(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=ps(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){F.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>yo(t,e))}findAll(e={}){return this.getAll().filter(t=>yo(e,t))}notify(e){F.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return F.batch(()=>Promise.all(e.map(e=>e.continue().catch(po))))}};function ps(e){return e.options.scope?.id}var ms=class extends Bo{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),To(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&xo(t.mutationKey)!==xo(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??ds();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){F.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},hs=class extends Bo{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??bo(r,t),a=this.get(i);return a||(a=new $o({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){F.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>vo(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>vo(e,t)):t}notify(e){F.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){F.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){F.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},gs=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new hs,this.#t=e.mutationCache||new fs,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Vo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Wo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(_o(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=mo(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return F.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;F.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return F.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=F.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(po).catch(po)}invalidateQueries(e,t={}){return F.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=F.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n),r=e.state.fetchStatus===`paused`;return(!n.throwOnError||r)&&(t=t.catch(po)),r?Promise.resolve():t}));return Promise.all(r).then(po)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(_o(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(_o(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(po).catch(po)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(po).catch(po)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Wo.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(xo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{So(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(xo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{So(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=bo(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===No&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},_s=T.createContext(!1),vs=()=>T.useContext(_s);_s.Provider;function ys(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var bs=T.createContext(ys()),xs=()=>T.useContext(bs),Ss=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?Fo(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Cs=e=>{T.useEffect(()=>{e.clearReset()},[e])},ws=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Fo(n,[e.error,r])),Ts=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Es=(e,t)=>e?.suspense&&t.isPending,Ds=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Os(e,t,n){let r=vs(),i=xs(),a=oo(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Ts(o),Ss(o,i,s),Cs(i);let[l]=T.useState(()=>new t(a,o)),u=l.getOptimisticResult(o);T.useEffect(()=>{l.setOptions(o)},[o,l]);let d=!r&&c;if(T.useSyncExternalStore(T.useCallback(e=>{let t=d?l.subscribe(F.batchCalls(e)):po;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Es(o,u))throw Ds(o,l,i);if(ws({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function ks(e,t){return Os(e,rs,t)}function As(e,t){let n=oo(t),[r]=T.useState(()=>new ms(n,e));T.useEffect(()=>{r.setOptions(e)},[r,e]);let i=T.useSyncExternalStore(T.useCallback(e=>r.subscribe(F.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=T.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(po)},[r]);if(i.error&&Fo(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function js(e,t){return Os(e,ls,t)}var Ms={neutral:`bg-hover text-muted`,success:`bg-success/15 text-success-text`,danger:`bg-danger/15 text-danger-text`,warning:`border border-warning-line bg-warning-bg text-warning-text`};function Ns({tone:e,children:t}){return(0,j.jsx)(`span`,{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${Ms[e]}`,children:t})}function Ps({label:e,error:t,hint:n,hideLabel:r,...i}){let{id:a,errorId:o,hintId:s,aria:c}=S({error:t,hint:n});return(0,j.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`input`,{type:`checkbox`,...i,...c,className:`size-4 shrink-0 appearance-none rounded-[4px] border border-field-line bg-field bg-center bg-no-repeat checked:border-accent checked:bg-accent checked:bg-[url(data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2016%2016%27%20fill=%27none%27%20stroke=%27white%27%20stroke-width=%272%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpath%20d=%27M3.5%208.5l3%203%206-7%27/%3E%3C/svg%3E)] forced-colors:appearance-auto disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus aria-[invalid=true]:outline-2 aria-[invalid=true]:outline-danger`}),(0,j.jsx)(`label`,{htmlFor:a,className:r?`sr-only`:`text-sm text-text`,children:e})]}),(0,j.jsx)(ee,{errorId:o,hintId:s,error:t,hint:n})]})}var Fs={name:`archive`,size:24,node:[[`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`}]]};Fs.node;var Is=_(Fs),Ls={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};Ls.node;var Rs=_(Ls),zs={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};zs.node;var Bs=_(zs),Vs={name:`at-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]};Vs.node;var Hs=_(Vs),Us={name:`braces`,size:24,node:[[`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`}]],aliases:[`curly-braces`]};Us.node;var Ws=_(Us),Gs={name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Gs.node;var Ks=_(Gs),qs={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};qs.node;var Js=_(qs),Ys={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Ys.node;var Xs=_(Ys),Zs={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Zs.node;var Qs=_(Zs),$s={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};$s.node;var ec=_($s),tc={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};tc.node;var nc=_(tc),rc={name:`circle-exclamation-point`,size:24,node:[[`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`}]],aliases:[`alert-circle`,`circle-alert`]};rc.node;var ic=_(rc),ac={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};ac.node;var oc=_(ac),sc={name:`copy`,size:24,node:[[`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`}]]};sc.node;var cc=_(sc),lc={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};lc.node;var uc=_(lc),dc={name:`ellipsis`,size:24,node:[[`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`}]],aliases:[`more-horizontal`]};dc.node;var fc=_(dc),pc={name:`eye`,size:24,node:[[`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`}]]};pc.node;var mc=_(pc),hc={name:`file-down`,size:24,node:[[`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:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`m9 15 3 3 3-3`,key:`1npd3o`}]]};hc.node;var gc=_(hc),_c={name:`file-text`,size:24,node:[[`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`}]]};_c.node;var vc=_(_c),yc={name:`file-up`,size:24,node:[[`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:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]};yc.node;var bc=_(yc),xc={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};xc.node;var Sc=_(xc),Cc={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};Cc.node;var wc=_(Cc),Tc={name:`hash`,size:24,node:[[`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`}]]};Tc.node;var Ec=_(Tc),Dc={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};Dc.node;var Oc=_(Dc),kc={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};kc.node;var Ac=_(kc),jc={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};jc.node;var Mc=_(jc),Nc={name:`link-2`,size:24,node:[[`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`}]]};Nc.node;var Pc=_(Nc),Fc={name:`lock`,size:24,node:[[`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`}]]};Fc.node;var Ic=_(Fc),Lc={name:`log-out`,size:24,node:[[`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`}]]};Lc.node;var Rc=_(Lc),zc={name:`mail`,size:24,node:[[`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`}]]};zc.node;var Bc=_(zc),Vc={name:`map-pin`,size:24,node:[[`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`}]]};Vc.node;var Hc=_(Vc),Uc={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};Uc.node;var Wc=_(Uc),Gc={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};Gc.node;var Kc=_(Gc),qc={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};qc.node;var Jc=_(qc),Yc={name:`power-off`,size:24,node:[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Yc.node;var Xc=_(Yc),Zc={name:`puzzle`,size:24,node:[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]};Zc.node;var Qc=_(Zc),$c={name:`scroll-text`,size:24,node:[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]};$c.node;var el=_($c),tl={name:`search-x`,size:24,node:[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]};tl.node;var nl=_(tl),rl={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};rl.node;var il=_(rl),al={name:`settings`,size:24,node:[[`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`}]]};al.node;var ol=_(al),sl={name:`shield`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]};sl.node;var cl=_(sl),ll={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};ll.node;var ul=_(ll),dl={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};dl.node;var fl=_(dl),pl={name:`toggle-left`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]};pl.node;var ml=_(pl),hl={name:`trash`,size:24,node:[[`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`}]],aliases:[`trash-2`]};hl.node;var gl=_(hl),_l={name:`triangle-exclamation-point`,size:24,node:[[`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`}]],aliases:[`alert-triangle`,`triangle-alert`]};_l.node;var vl=_(_l),yl={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};yl.node;var bl=_(yl),xl={name:`users`,size:24,node:[[`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`}]]};xl.node;var Sl=_(xl),Cl={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Cl.node;var R=_(Cl),wl=e(n(),1),Tl=[`body`,`footer`].flatMap(e=>[`input`,`select`,`textarea`,`button`].map(t=>`[data-part=${e}] ${t}:not([disabled])`)).join(`, `);function El(e){let t=(0,T.useRef)(null),n=(0,T.useRef)(null),r=(0,T.useId)(),i=()=>{n.current?.focus?.(),n.current=null};return(0,T.useEffect)(()=>{let r=t.current;r&&(e.open&&!r.open&&(n.current=document.activeElement,r.showModal(),r.contains(document.activeElement)||([...r.querySelectorAll(Tl)].find(e=>!e.closest(`[hidden]`))??r.querySelector(`[data-part=close]`))?.focus()),!e.open&&r.open&&(r.close(),i()))},[e.open]),(0,T.useEffect)(()=>i,[]),(0,wl.createPortal)((0,j.jsx)(`dialog`,{ref:t,"aria-labelledby":r,className:e.className,onSubmit:e=>e.stopPropagation(),onKeyDown:t=>{t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),e.onClose())},onClose:t=>{t.target===t.currentTarget&&(i(),e.open&&e.onClose())},children:e.open&&(0,j.jsxs)(`div`,{"data-part":`content`,children:[(0,j.jsxs)(`div`,{"data-part":`header`,children:[(0,j.jsx)(`h2`,{id:r,"data-part":`title`,children:e.title}),(0,j.jsx)(`button`,{type:`button`,"data-part":`close`,"aria-label":`Close`,onClick:e.onClose,children:e.closeIcon??`×`})]}),(0,j.jsx)(`div`,{"data-part":`body`,children:e.children}),e.footer&&(0,j.jsx)(`div`,{"data-part":`footer`,children:e.footer})]})}),document.body)}var Dl=a({base:[`border border-line bg-raised p-0 text-text shadow-overlay backdrop:bg-scrim`,`[&_[data-part=content]]:flex [&_[data-part=content]]:max-h-dvh [&_[data-part=content]]:flex-col`,`[&_[data-part=header]]:flex [&_[data-part=header]]:items-center [&_[data-part=header]]:justify-between [&_[data-part=header]]:gap-2 [&_[data-part=header]]:border-b [&_[data-part=header]]:border-line [&_[data-part=header]]:py-3 [&_[data-part=header]]:pl-4 [&_[data-part=header]]:pr-3`,`[&_[data-part=title]]:text-base [&_[data-part=title]]:font-semibold`,`[&_[data-part=close]]:inline-flex [&_[data-part=close]]:size-8 [&_[data-part=close]]:items-center [&_[data-part=close]]:justify-center [&_[data-part=close]]:rounded-control [&_[data-part=close]]:text-muted [&_[data-part=close]:hover]:bg-hover [&_[data-part=close]:hover]:text-text [&_[data-part=close]:focus-visible]:outline-2 [&_[data-part=close]:focus-visible]:outline-focus`,`[&_[data-part=body]]:flex-1 [&_[data-part=body]]:overflow-auto [&_[data-part=body]]:p-4`,`[&_[data-part=footer]]:flex [&_[data-part=footer]]:flex-wrap [&_[data-part=footer]]:justify-end [&_[data-part=footer]]:gap-2 [&_[data-part=footer]]:border-t [&_[data-part=footer]]:border-line [&_[data-part=footer]]:p-4`],variants:{variant:{center:`m-auto w-full max-w-lg rounded-base`,side:`ml-auto h-dvh max-h-dvh w-full max-w-xl [&_[data-part=content]]:h-full`},size:{md:``,lg:``}},compoundVariants:[{variant:`center`,size:`lg`,class:`max-w-3xl`}],defaultVariants:{variant:`center`,size:`md`}});function Ol({variant:e,size:t,...n}){return(0,j.jsx)(El,{...n,closeIcon:(0,j.jsx)(R,{size:15,strokeWidth:1.75,"aria-hidden":!0}),className:Dl({variant:e,size:t})})}function kl({label:e,error:t,hint:n,className:r,...i}){let a=S({error:t,hint:n});return(0,j.jsx)(c,{...a,label:e,error:t,hint:n,children:(0,j.jsx)(`input`,{type:`text`,...i,...a.aria,className:`${o} ${r??``}`})})}var Al=(0,T.createContext)(null);function jl({children:e}){let[t,n]=(0,T.useState)(null),[r,i]=(0,T.useState)(``),a=(0,T.useRef)(()=>{}),o=(0,T.useCallback)(e=>new Promise(t=>{a.current(!1),a.current=t,i(``),n(e)}),[]),s=e=>{a.current(e),n(null)},c=!!t?.typeToConfirm&&r!==t.typeToConfirm;return(0,j.jsxs)(Al.Provider,{value:o,children:[e,(0,j.jsxs)(Ol,{open:!!t,onClose:()=>s(!1),title:t?.title??``,footer:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(w,{onClick:()=>s(!1),children:t?.cancelLabel??`Cancel`}),(0,j.jsx)(w,{variant:t?.danger?`danger`:`primary`,disabled:c,onClick:()=>s(!0),children:t?.confirmLabel})]}),children:[(0,j.jsx)(`p`,{className:`text-sm text-text`,children:t?.message}),t?.typeToConfirm&&(0,j.jsx)(`div`,{className:`mt-3`,children:(0,j.jsx)(kl,{label:`Type "${t.typeToConfirm}" to confirm`,value:r,onChange:e=>i(e.target.value)})})]})]})}function Ml(){let e=(0,T.useContext)(Al);if(!e)throw Error(`ConfirmProvider is missing`);return e}var Nl={idle:`Copy`,copied:`Copied`,failed:`Could not copy`},Pl={idle:cc,copied:Js,failed:vl};function Fl({text:e,label:t=`Copy`,showLabel:n=!1}){let[r,i]=(0,T.useState)(`idle`),a=(0,T.useRef)(void 0);(0,T.useEffect)(()=>()=>clearTimeout(a.current),[]);let o=async()=>{let t=`copied`;try{await navigator.clipboard.writeText(e)}catch{t=`failed`}i(t),clearTimeout(a.current),a.current=setTimeout(()=>i(`idle`),2e3)},s=Pl[r];return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(f,{content:Nl[r],children:(0,j.jsx)(w,{variant:n?void 0:`ghost`,size:n?void 0:`sm`,"aria-label":n?void 0:t,onClick:o,icon:(0,j.jsx)(s,{size:15,strokeWidth:1.75,className:r===`failed`?`text-danger-text`:void 0}),children:n&&t})}),(0,j.jsx)(`span`,{role:`status`,className:`sr-only`,children:r===`idle`?``:Nl[r]})]})}function Il({title:e,icon:t,badge:n,defaultOpen:r=!1,open:i,onOpenChange:a,children:o}){let[s,c]=(0,T.useState)(r),l=i??s,u=()=>{c(!l),a?.(!l)},d=(0,T.useId)();return(0,j.jsxs)(`div`,{className:`rounded-base border border-line`,children:[(0,j.jsxs)(`button`,{type:`button`,"aria-expanded":l,"aria-controls":d,onClick:u,className:`flex w-full items-center gap-2 rounded-base px-3 py-2 text-left text-sm font-medium text-text hover:bg-hover focus-visible:outline-2 focus-visible:outline-focus`,children:[(0,j.jsx)(Qs,{size:15,strokeWidth:1.75,"aria-hidden":!0,className:`text-muted transition-transform duration-(--hb-duration) motion-reduce:transition-none ${l?`rotate-90`:``}`}),t,(0,j.jsx)(`span`,{children:e}),n!=null&&(0,j.jsx)(`span`,{className:`ml-auto`,children:n})]}),(0,j.jsx)(`div`,{id:d,hidden:!l,className:`border-t border-line p-3`,children:o})]})}function Ll({title:e,icon:t,children:n}){return(0,j.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-8 py-12 text-center text-sm text-muted`,children:[t&&(0,j.jsx)(`span`,{className:`mb-1 flex size-9 items-center justify-center rounded-full bg-hover text-muted`,children:t}),(0,j.jsx)(`p`,{className:`font-medium text-text`,children:e}),n]})}function Rl({label:e,error:t,hint:n,accept:r,multiple:i,disabled:a,name:o,onChange:s}){let l=S({error:t,hint:n}),u=(0,T.useRef)(null),[d,f]=(0,T.useState)([]),[p,m]=(0,T.useState)(!1),h=e=>{e.length!==0&&(f(e.map(e=>e.name)),s(e))};return(0,j.jsx)(c,{...l,label:e,error:t,hint:n,children:(0,j.jsxs)(`div`,{"data-testid":`file-drop`,onDragOver:e=>{e.preventDefault(),a||m(!0)},onDragLeave:()=>m(!1),onDrop:e=>{if(e.preventDefault(),m(!1),a)return;let t=[...e.dataTransfer.files];h(i?t:t.slice(0,1))},className:`flex items-center gap-3 rounded-control border border-dashed bg-surface p-3 text-sm has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-focus ${p?`border-accent`:`border-field-line`} ${a?`opacity-50`:``}`,children:[(0,j.jsx)(`input`,{ref:u,type:`file`,name:o,accept:r,multiple:i,disabled:a,...l.aria,className:`sr-only`,onChange:e=>{h([...e.target.files??[]]),e.target.value=``}}),(0,j.jsx)(w,{tabIndex:-1,disabled:a,onClick:()=>u.current?.click(),children:i?`Choose files`:`Choose file`}),(0,j.jsx)(`span`,{className:`min-w-0 truncate text-muted`,children:d.length>0?d.join(`, `):`or drop here`})]})})}function zl({label:e,error:t,hint:n,...r}){let i=S({error:t,hint:n}),a=[i.aria[`aria-describedby`],r[`aria-describedby`]].filter(Boolean).join(` `)||void 0;return(0,j.jsx)(c,{...i,label:e,error:t,hint:n,children:(0,j.jsx)(`input`,{type:`number`,...r,...i.aria,"aria-invalid":i.aria[`aria-invalid`]??r[`aria-invalid`],"aria-describedby":a,className:o})})}function Bl({title:e,children:t}){let n=(0,T.useId)();return(0,j.jsxs)(`section`,{"aria-labelledby":n,className:`flex flex-col gap-3`,children:[(0,j.jsx)(`h3`,{id:n,className:`text-sm font-semibold text-text`,children:e}),t]})}function Vl({label:e,error:t,hint:n,children:r,...i}){let a=S({error:t,hint:n});return(0,j.jsx)(c,{...a,label:e,error:t,hint:n,children:(0,j.jsxs)(`div`,{className:`relative`,children:[(0,j.jsx)(`select`,{...i,...a.aria,className:`${o} appearance-none pr-8`,children:r}),(0,j.jsx)(Xs,{size:15,strokeWidth:1.75,"aria-hidden":!0,className:`pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-muted`})]})})}function Hl({caption:e,stickyHeader:t,children:n}){return(0,j.jsx)(`div`,{className:`overflow-auto${t?` max-h-[calc(100dvh-12rem)]`:``}`,children:(0,j.jsxs)(`table`,{"data-sticky-header":t||void 0,className:`w-full border-collapse text-left text-sm${t?` [&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-surface`:``}`,children:[e&&(0,j.jsx)(`caption`,{className:`sr-only`,children:e}),n]})})}var Ul={asc:Bs,desc:Rs};function Wl({children:e,sort:t,onSort:n,align:r}){let i=t===`asc`?`ascending`:t===`desc`?`descending`:`none`,a=t?Ul[t]:ec;return(0,j.jsx)(`th`,{scope:`col`,"aria-sort":n?i:void 0,className:`border-b border-line px-3 py-2 text-xs font-medium text-muted${r===`right`?` text-right`:``}`,children:n?(0,j.jsxs)(`button`,{type:`button`,onClick:n,className:`inline-flex items-center gap-1 rounded font-medium hover:text-text focus-visible:outline-2 focus-visible:outline-focus`,children:[e,(0,j.jsx)(a,{size:13,strokeWidth:1.75,"aria-hidden":!0,className:t?`text-text`:`text-faint`})]}):e})}function Gl({children:e,wrap:t,fill:n,align:r}){let i=!t&&typeof e==`string`;return(0,j.jsx)(`td`,{title:i?e:void 0,className:`border-b border-line px-3 py-2 text-text${r===`right`?` text-right`:``}${n?` w-full max-w-0`:t?``:` max-w-xs whitespace-nowrap`}${i?` truncate`:``}`,children:e})}function Kl(e,t){return{tab:`${e}-tab-${t}`,panel:`${e}-panel-${t}`}}function ql(e){let t=(0,T.useId)(),n=e.id??t,r=(0,T.useRef)(null),i=e.tabs.filter(e=>!e.disabled),a=i.some(t=>t.value===e.value)?e.value:i[0]?.value,o=t=>{e.onChange(t),r.current?.querySelector(`[data-key="${CSS.escape(t)}"]`)?.focus()};return(0,j.jsx)(`div`,{ref:r,role:`tablist`,"aria-label":e.label,className:e.className,onKeyDown:t=>{if(!i.length)return;let n=i.findIndex(t=>t.value===e.value),r=n<=0?i.length-1:n-1,a=t.key===`ArrowRight`?i[(n+1)%i.length]:t.key===`ArrowLeft`?i[r]:t.key===`Home`?i[0]:t.key===`End`?i[i.length-1]:void 0;a&&(t.preventDefault(),o(a.value))},children:e.tabs.map(t=>{let r=t.value===e.value,i=Kl(n,t.value);return(0,j.jsx)(`button`,{id:i.tab,role:`tab`,type:`button`,"data-key":t.value,"aria-selected":r,"aria-controls":i.panel,"data-selected":r?``:void 0,disabled:t.disabled,tabIndex:t.value===a?0:-1,onClick:()=>e.onChange(t.value),children:t.label},t.value)})})}function Jl(e){return(0,j.jsx)(ql,{...e,className:`flex gap-1 border-b border-line [&_[role=tab]]:-mb-px [&_[role=tab]]:border-b-2 [&_[role=tab]]:border-transparent [&_[role=tab]]:px-3 [&_[role=tab]]:py-2 [&_[role=tab]]:text-sm [&_[role=tab]]:text-muted [&_[role=tab]]:transition-colors [&_[role=tab]]:duration-[var(--hb-duration)] motion-reduce:[&_[role=tab]]:transition-none [&_[role=tab]:disabled]:cursor-not-allowed [&_[role=tab]:disabled]:opacity-50 [&_[role=tab]:hover:not(:disabled)]:text-text [&_[role=tab]:focus-visible]:outline-2 [&_[role=tab]:focus-visible]:outline-focus [&_[role=tab][data-selected]]:border-accent [&_[role=tab][data-selected]]:font-medium [&_[role=tab][data-selected]]:text-text`})}var Yl=(0,T.createContext)(null);function Xl(e){let t=e.kind===`error`?ic:nc;return(0,j.jsxs)(`div`,{role:e.kind===`error`?`alert`:void 0,className:`${s} flex items-center gap-2 rounded-base px-3 py-2 text-sm text-text`,children:[(0,j.jsx)(t,{size:15,strokeWidth:1.75,className:e.kind===`error`?`text-danger-text`:`text-accent-text`}),e.message]},e.id)}function Zl({children:e}){let[t,n]=(0,T.useState)([]),r=(0,T.useRef)(1),i=(0,T.useCallback)((e,t)=>{let i=r.current++;n(n=>[...n,{id:i,kind:e,message:t}]),setTimeout(()=>n(e=>e.filter(e=>e.id!==i)),4e3)},[]),a=(0,T.useMemo)(()=>({success:e=>i(`success`,e),error:e=>i(`error`,e)}),[i]);return(0,j.jsxs)(Yl.Provider,{value:a,children:[e,(0,j.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`fixed right-4 bottom-4 z-50 flex flex-col gap-2`,children:t.map(Xl)})]})}function Ql(){let e=(0,T.useContext)(Yl);if(!e)throw Error(`ToastProvider is missing`);return e}function $l(e){let[t,n]=v(e.checked,e.defaultChecked??!1,e.onChange);return(0,j.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"aria-label":e.label,"aria-describedby":e[`aria-describedby`],"aria-invalid":e[`aria-invalid`],disabled:e.disabled,className:e.className,"data-checked":t?``:void 0,"data-disabled":e.disabled?``:void 0,onClick:()=>n(!t),children:(0,j.jsx)(`span`,{"data-thumb":``})})}function eu({label:e,error:t,hint:n,...r}){let{errorId:i,hintId:a,aria:o}=S({error:t,hint:n});return(0,j.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,j.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,j.jsx)($l,{...r,label:e,"aria-describedby":o[`aria-describedby`],"aria-invalid":o[`aria-invalid`],className:`relative h-5 w-9 shrink-0 rounded-full bg-control transition-colors duration-[var(--hb-duration)] motion-reduce:transition-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus aria-[invalid=true]:outline-2 aria-[invalid=true]:outline-danger disabled:opacity-50 data-[checked]:bg-accent [&>span]:absolute [&>span]:top-0.5 [&>span]:left-0.5 [&>span]:size-4 [&>span]:rounded-full [&>span]:bg-thumb [&>span]:transition-transform [&>span]:duration-[var(--hb-duration)] motion-reduce:[&>span]:transition-none data-[checked]:[&>span]:translate-x-4`}),(0,j.jsx)(`span`,{className:`text-sm text-text`,children:e})]}),(0,j.jsx)(ee,{errorId:i,hintId:a,error:t,hint:n})]})}function tu(e,t){let n=(0,T.useRef)(``),r=(0,T.useRef)(void 0),i=(0,T.useCallback)(i=>{let a=t.orientation===`horizontal`;if(!a&&i.key===`ArrowDown`||a&&i.key===`ArrowRight`){i.preventDefault(),e.next();return}if(!a&&i.key===`ArrowUp`||a&&i.key===`ArrowLeft`){i.preventDefault(),e.previous();return}if(i.key===`Home`){i.preventDefault(),e.first();return}if(i.key===`End`){i.preventDefault(),e.last();return}if((i.key===`Enter`||i.key===` `)&&e.activeKey){i.preventDefault(),t.onSelect?.(e.activeKey);return}if(i.key.length!==1||i.ctrlKey||i.metaKey||i.altKey)return;n.current+=i.key.toLocaleLowerCase(),clearTimeout(r.current),r.current=setTimeout(()=>{n.current=``},500);let o=e.enabledKeys,s=e.activeKey?o.indexOf(e.activeKey):-1;for(let r=1;r<=o.length;r++){let i=o[(s+r)%o.length];if(t.labels[i]?.toLocaleLowerCase().startsWith(n.current)){e.setActiveKey(i);break}}},[e,t]);return(0,T.useEffect)(()=>()=>clearTimeout(r.current),[]),{onKeyDown:i}}function nu(e){let[t,n]=(0,T.useState)(null),r=e.keys.filter(t=>!e.disabledKeys?.includes(t)),i=(0,T.useCallback)(()=>n(r[0]??null),[r.join(`\0`)]),a=(0,T.useCallback)(()=>n(r[r.length-1]??null),[r.join(`\0`)]),o=(0,T.useCallback)(e=>{if(!r.length){n(null);return}let i=r.indexOf(t);n(i===-1?e>0?r[0]:r[r.length-1]:r[(i+e+r.length)%r.length])},[t,r.join(`\0`)]);return{activeKey:t,enabledKeys:r,setActiveKey:n,first:i,last:a,next:(0,T.useCallback)(()=>o(1),[o]),previous:(0,T.useCallback)(()=>o(-1),[o])}}function ru(e){let t=h({}),n=(0,T.useId)(),r=e.trigger.props.id??`${n}-trigger`,i=(0,T.useRef)(null),a=x(i,e.trigger.props.ref),o=(0,T.useRef)(null),s=(0,T.useRef)(!1),c=e.items.filter(e=>`key`in e),u=nu({keys:c.map(e=>e.key),disabledKeys:c.filter(e=>e.disabled).map(e=>e.key)}),d=g(i,o,t.open),f=y(i,o,{open:t.open,placement:e.placement??`bottom-start`});p(o,{open:t.open,onDismiss:t.close,triggerRef:i});let m=n=>{t.close(),e.onAction(n)},_=tu(u,{orientation:`vertical`,labels:Object.fromEntries(c.map(e=>[e.key,e.label])),onSelect:m}),v=()=>{document.activeElement&&document.activeElement!==document.body||i.current?.focus()};(0,T.useEffect)(()=>{t.open&&u.activeKey&&o.current?.querySelector(`[data-key="${CSS.escape(u.activeKey)}"]`)?.focus()},[t.open,u.activeKey]),(0,T.useEffect)(()=>{!t.open&&s.current&&queueMicrotask(v),s.current=t.open},[t.open]);let b=c.find(e=>e.checked)?.key,S=e=>{b?u.setActiveKey(b):u[e](),t.setOpen(!0)},C=e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),S(e.key===`ArrowDown`?`first`:`last`))},w=e=>{e.key===`Tab`?t.close():_.onKeyDown(e)},ee=(0,T.cloneElement)(e.trigger,l(e.trigger.props,{ref:a,id:r,"aria-expanded":t.open,"aria-controls":t.open?n:void 0,"aria-haspopup":`menu`,onClick:()=>{t.open||(b?u.setActiveKey(b):u.first()),t.toggle()},onKeyDown:C}));return(0,j.jsxs)(j.Fragment,{children:[ee,d&&(0,wl.createPortal)((0,j.jsx)(`div`,{ref:o,id:n,role:`menu`,popover:`manual`,"aria-labelledby":r,className:e.className,style:f.style,onKeyDown:w,"data-open":``,"data-placement":f.placement,children:e.items.map((e,t)=>`separator`in e?(0,j.jsx)(`div`,{role:`separator`},`separator-${t}`):`heading`in e?(0,j.jsx)(`div`,{role:`presentation`,"data-heading":``,children:e.heading},`heading-${t}`):(0,j.jsxs)(`div`,{role:e.checked===void 0?`menuitem`:`menuitemradio`,"aria-checked":e.checked,"data-key":e.key,tabIndex:u.activeKey===e.key?0:-1,"aria-disabled":e.disabled||void 0,"data-disabled":e.disabled?``:void 0,"data-active":u.activeKey===e.key?``:void 0,"data-danger":e.danger?``:void 0,onClick:()=>!e.disabled&&m(e.key),onPointerMove:()=>!e.disabled&&u.setActiveKey(e.key),children:[e.icon,(0,j.jsx)(`span`,{children:e.label}),e.shortcut&&(0,j.jsx)(`kbd`,{children:e.shortcut})]},e.key))}),d)]})}var iu=a({base:[s,`z-50 min-w-44 rounded-base p-1 text-sm text-text outline-none`,`[&_[role^=menuitem]]:flex [&_[role^=menuitem]]:cursor-default [&_[role^=menuitem]]:items-center [&_[role^=menuitem]]:gap-2 [&_[role^=menuitem]]:rounded-control [&_[role^=menuitem]]:px-2.5 [&_[role^=menuitem]]:py-1.5 [&_[role^=menuitem]]:outline-none`,`[&_[role^=menuitem]>span]:flex-1 [&_kbd]:font-sans [&_kbd]:text-xs [&_kbd]:text-faint`,`[&_[data-active]]:bg-hover [&_[data-disabled]]:opacity-50`,`[&_[data-danger]]:text-danger-text [&_[data-danger][data-active]]:bg-danger/10`,`[&_[data-heading]]:px-2.5 [&_[data-heading]]:py-1 [&_[data-heading]]:text-xs [&_[data-heading]]:font-medium [&_[data-heading]]:text-faint`,`[&_[role=separator]]:my-1 [&_[role=separator]]:h-px [&_[role=separator]]:bg-line`]});function au({className:e,...t}){return(0,j.jsx)(ru,{...t,className:iu({className:e})})}var ou=(0,T.createContext)(null),su=(0,T.createContext)(null);function cu(){let e=(0,T.useContext)(su);if(!e)throw Error(`ExtensionsContext is missing`);return e}function z(){let e=(0,T.useContext)(ou);if(!e)throw Error(`ClientContext is missing`);return e}function lu(){return new gs({defaultOptions:{queries:{retry:!1},mutations:{retry:!1}}})}function B({client:e,queryClient:t,extensions:n,children:r}){return(0,j.jsx)(ou.Provider,{value:e,children:(0,j.jsx)(su.Provider,{value:n,children:(0,j.jsx)(so,{client:t,children:(0,j.jsx)(Zl,{children:(0,j.jsx)(jl,{children:r})})})})})}var uu=/^[a-z0-9-]+(\/[a-z0-9-]+)*$/;function du(){let e=[],t=[],n=!1,r=()=>{if(n)throw Error(`Dashboard extensions must be registered while extensions.js loads.`)};return{pages:e,links:t,api:n=>({client:n,addPage(t){if(r(),!uu.test(t.path))throw Error(`Invalid extension page path "${t.path}".`);if(e.some(e=>e.path===t.path))throw Error(`Extension page "${t.path}" is already registered.`);e.push(t)},addLink(e){r(),t.push(e)}}),freeze(){n=!0}}}function fu(e,t,n){return window.heybe={dashboard:e.api(t)},new Promise(e=>{let r=document.createElement(`script`);r.type=`module`,r.src=n??t.buildURL(`/_/extensions.js`),r.addEventListener(`load`,()=>e()),r.addEventListener(`error`,()=>{console.warn(`Failed to load dashboard extensions`),e()}),document.head.append(r)}).then(()=>e.freeze())}function pu(e){let{token:t,record:n}=e.authStore;return!!t&&!Ii(t,Date.now())&&n?.collectionName===`_superusers`}async function mu(e){try{return await e.auth(`_superusers`).refresh(),!0}catch(t){return t instanceof ma&&[401,403,404].includes(t.status)?(e.authStore.clear(),!1):!0}}function hu(e){e.client.authStore.clear(),e.queryClient.clear()}async function gu(e){try{let{data:t}=await e.health.check();return t.needsSetup===!0}catch{return}}var _u=async({context:e,location:t})=>{if(!pu(e.client))throw hu(e),await gu(e.client)?Ze({to:`/hbinstall`}):Ze({to:`/login`,search:{redirect:t.href}})},vu=({context:e})=>{if(pu(e.client))throw Ze({to:`/`});e.client.authStore.clear()},yu=async e=>{if(vu(e),await gu(e.context.client))throw Ze({to:`/hbinstall`})},bu=async e=>{if(vu(e),await gu(e.context.client)===!1)throw Ze({to:`/login`})};function xu(e){let t=e.trim(),n=t.match(/\/hbinstall\/([^/?#\s]+)/);return n?n[1]:t}function Su(e){return e&&/^\/(?![/\\])/.test(e)?e:`/collections`}function Cu(e,t){ro(e.client,()=>{let n=t.state.location.href;hu(e),t.navigate({to:`/login`,search:{redirect:n}})})}var wu=`https://github.com/emresandikci/heybe#readme`;function V({crumbs:e,actions:t,width:n=`form`,footer:r,children:i}){let a=`mx-auto w-full ${n===`form`?`max-w-240`:``}`;return(0,j.jsxs)(`div`,{className:`flex flex-1 flex-col gap-4`,children:[(0,j.jsxs)(`div`,{className:`${a} flex flex-1 flex-col gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,j.jsx)(`h1`,{className:`flex min-w-0 items-center text-lg font-semibold`,children:e.map((t,n)=>{let r=n===e.length-1;return(0,j.jsxs)(T.Fragment,{children:[n>0&&(0,j.jsx)(`span`,{className:`shrink-0 whitespace-pre text-faint`,children:` / `}),t.to&&!r?(0,j.jsx)(ni,{to:t.to,params:t.params,className:`shrink-0 rounded-control text-muted hover:text-text`,children:t.label}):(0,j.jsx)(`span`,{"aria-current":r?`page`:void 0,title:r?t.label:void 0,className:r?`min-w-0 truncate`:`shrink-0 text-muted`,children:t.label})]},n)})}),t&&(0,j.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:t})]}),i]}),(0,j.jsxs)(`footer`,{className:`${a} flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-t border-line pt-3 text-xs text-faint`,children:[(0,j.jsx)(`div`,{children:r}),(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(`a`,{href:wu,target:`_blank`,rel:`noreferrer`,className:`hover:text-text`,children:`Docs`}),(0,j.jsxs)(`span`,{children:[`Heybe v`,`1.5.1`]})]})]})]})}function Tu(){return(0,j.jsx)(V,{crumbs:[{label:`Page not found`}],children:(0,j.jsx)(Ll,{title:`This page does not exist.`,children:(0,j.jsx)(ni,{to:`/collections`,className:`text-accent-text hover:underline`,children:`Collections`})})})}var Eu=class{constructor(e,t){this.fn=e,this.options=t,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{let t=Date.now()-this.lastExecutionTime;if(this.options.leading&&t>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){let e=this.options.wait-t;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},e)}},this.execute=(...e)=>{this.fn(...e),this.options.onExecute?.(e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&=(clearTimeout(this.timeoutId),void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function Du(e,t){return new Eu(e,t).maybeExecute}var Ou=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{this.#c<this.#l?(this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{})):(this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop())};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e)this.debugLog(`Event bus client is disabled, not emitting event`,e,t);else if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d)this.debugLog(`Previously failed to connect, not emitting to bus`);else if(!this.#a)this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());else return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},ku=new class extends Ou{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}};function Au(e,t){return typeof e==`function`?e(t):e}function ju(e,t){return zu(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function Mu(e,t,n){let r=zu(t);function i(e){if(!r.length)return Au(n,e);let t=r.shift();if(typeof t==`string`||typeof t==`number`&&!Array.isArray(e))return typeof e==`object`?(e===null&&(e={}),{...e,[t]:i(e[t])}):{[t]:i()};if(Array.isArray(e)&&typeof t==`number`){let n=e.slice(0,t);return[...n.length?n:Array(t),i(e[t]),...e.slice(t+1)]}return[...Array(t),i()]}return i(e)}function Nu(e,t){let n=zu(t);function r(e){if(!e)return;if(n.length===1){let t=n[0];if(Array.isArray(e)&&typeof t==`number`)return e.filter((e,n)=>n!==t);let{[t]:r,...i}=e;return i}let t=n.shift();if((typeof t==`string`||typeof t==`number`&&!Array.isArray(e))&&typeof e==`object`)return{...e,[t]:r(e[t])};if(typeof t==`number`&&Array.isArray(e)){if(t>=e.length)return e;let n=e.slice(0,t);return[...n.length?n:Array(t),r(e[t]),...e.slice(t+1)]}throw Error(`It seems we have created an infinite loop in deleteBy. `)}return r(e)}var Pu=46,Fu=91,Iu=93,Lu=48,Ru=57;function zu(e){if(Array.isArray(e))return[...e];if(typeof e!=`string`)throw Error(`Path must be a string.`);let t=e.length,n=[],r=+(t>0&&e.charCodeAt(0)===Fu),i=!0,a=-1;for(let o=r;o<=t;o++){let s=o<t?e.charCodeAt(o):-1;if(o===t||s===Pu||s===Fu||s===Iu){let t=o-r;if(t>0){let a=i&&(t===1||e.charCodeAt(r)!==Lu),s=e.slice(r,o);if(a){let e=parseInt(s,10);t<=15||String(e)===s?n.push(e):n.push(s)}else n.push(s)}else a!==Iu&&(a!==-1||s!==Iu)&&(a!==s||s!==Pu&&s!==Fu)&&n.push(``);r=o+1,i=!0}else(s<Lu||s>Ru)&&(i=!1);a=s}return n.length||n.push(``),n}function Bu(e){return!(Array.isArray(e)&&e.length===0)}function Vu(e,t){return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!1},runValidation:e=>e.validators.filter(Boolean).map(e=>({cause:e.cause,validate:e.fn}))})}function Hu(e,t){let{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:r,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},o=n??0;return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!0},runValidation:t=>t.validators.filter(Boolean).map(t=>{let n=t?.cause||e,s=o;switch(n){case`change`:s=i??o;break;case`blur`:s=r??o;break;case`dynamic`:s=a??o;break;case`submit`:s=0}return e===`submit`&&(s=0),{cause:n,validate:t.fn,debounceMs:s}})})}var Uu=e=>!!e&&typeof e==`object`&&`fields`in e;function Wu(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||n.length===0&&!Array.isArray(e)&&!Array.isArray(t)&&(Object.getPrototypeOf(e)!==Object.prototype||Object.getPrototypeOf(t)!==Object.prototype))return!1;for(let i of n)if(!r.includes(i)||!Wu(e[i],t[i]))return!1;return!0}var Gu=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:`form`}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:`field`}:{newErrorValue:void 0,newSource:void 0},Ku=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function qu(e,t){return e==null?t:{...e,...t}}for(var Ju=256,Yu=[],Xu;Ju--;)Yu[Ju]=(Ju+256).toString(16).substring(1);function Zu(){let e=0,t,n=``;if(!Xu||Ju+16>256){for(Xu=Array(256),e=256;e--;)Xu[e]=256*Math.random()|0;e=0,Ju=0}for(;e<16;e++)t=Xu[Ju+e],n+=e===6?Yu[t&15|64]:e===8?Yu[t&63|128]:Yu[t],e&1&&e>1&&e<11&&(n+=`-`);return Ju++,n}var Qu=Du(e=>ku.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300});function $u(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++)t[n]=$u(e[n]);return t}if(e instanceof Map){let t=new Map;return e.forEach((e,n)=>{t.set(n,$u(e))}),t}if(e instanceof Set){let t=new Set;return e.forEach(e=>{t.add($u(e))}),t}let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=$u(e[n]));return t}function ed(e,t){return t===e||t.startsWith(`${e}.`)||t.startsWith(`${e}[`)}var td=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});let t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:`mount`},r={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:`change`},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:`blur`},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:`submit`},o=t?void 0:{fn:()=>void 0,cause:`server`};switch(e.event.type){case`mount`:return e.runValidation({validators:[n],form:e.form});case`submit`:return e.runValidation({validators:[r,i,a,o],form:e.form});case`server`:return e.runValidation({validators:[],form:e.form});case`blur`:return e.runValidation({validators:[i,o],form:e.form});case`change`:return e.runValidation({validators:[r,o],form:e.form});default:throw Error(`Unknown validation event type: ${e.event.type}`)}};function nd(e,t){let n=new Map;for(let r of e){let e=r.path??[],i=t,a=``;for(let t=0;t<e.length;t++){let n=e[t];if(n===void 0)continue;let r=typeof n==`object`?n.key:n,o=Number(r);a+=Array.isArray(i)&&!Number.isNaN(o)?`[${o}]`:(t>0?`.`:``)+String(r),i=typeof i==`object`&&i?i[r]:void 0}n.set(a,(n.get(a)??[]).concat(r))}return Object.fromEntries(n)}var rd=(e,t)=>{let n=nd(e,t);return{form:n,fields:n}},H={validate({value:e,validationSource:t},n){let r=n[`~standard`].validate(e);if(r instanceof Promise)throw Error(`async function passed to sync validator`);if(r.issues)return t===`field`?r.issues:rd(r.issues,e)},async validateAsync({value:e,validationSource:t},n){let r=await n[`~standard`].validate(e);if(r.issues)return t===`field`?r.issues:rd(r.issues,e)}},U=e=>!!e&&`~standard`in e,W={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{},_arrayVersion:0,_pendingValidationsCount:0};function G(e){function t(t){let n=e.getFieldMeta(t)??W;e.setFieldMeta(t,{...n,_arrayVersion:(n._arrayVersion||0)+1})}function n(n,r,i){t(n);let a=s(n,r,`move`,i),c=Math.min(r,i),u=Math.max(r,i);for(let e=c;e<=u;e++)a.push(o(n,e));let d=Object.keys(e.fieldInfo).reduce((t,i)=>(i.startsWith(o(n,r))&&t.set(i,e.getFieldMeta(i)),t),new Map);l(a,r<i?`up`:`down`),Object.keys(e.fieldInfo).filter(e=>e.startsWith(o(n,i))).forEach(t=>{let a=t.replace(o(n,i),o(n,r)),s=d.get(a);s&&e.setFieldMeta(t,s)})}function r(e,n){t(e),l(s(e,n,`remove`),`up`)}function i(n,r,i){t(n),s(n,r,`swap`,i).forEach(t=>{if(!t.toString().startsWith(o(n,r)))return;let a=t.toString().replace(o(n,r),o(n,i)),[s,c]=[e.getFieldMeta(t),e.getFieldMeta(a)];s&&e.setFieldMeta(a,s),c&&e.setFieldMeta(t,c)})}function a(n,r){t(n);let i=s(n,r,`insert`);l(i,`down`),i.forEach(t=>{t.toString().startsWith(o(n,r))&&e.setFieldMeta(t,u())})}function o(e,t){return`${e}[${t}]`}function s(t,n,r,i){let a=[o(t,n)];switch(r){case`swap`:a.push(o(t,i));break;case`move`:{let[e,r]=[Math.min(n,i),Math.max(n,i)];for(let n=e;n<=r;n++)a.push(o(t,n));break}default:{let r=e.getFieldValue(t),i=Array.isArray(r)?r.length:0;for(let e=n+1;e<i;e++)a.push(o(t,e));break}}return Object.keys(e.fieldInfo).filter(e=>a.some(t=>e.startsWith(t)))}function c(e,t){return e.replace(/\[(\d+)\]/,(e,n)=>{let r=parseInt(n,10);return`[${t===`up`?r+1:Math.max(0,r-1)}]`})}function l(t,n){(n===`up`?t:[...t].reverse()).forEach(t=>{let r=c(t.toString(),n),i=e.getFieldMeta(r);i?e.setFieldMeta(t,i):e.setFieldMeta(t,u())})}let u=()=>W;return{bumpArrayVersion:t,handleArrayMove:n,handleArrayRemove:r,handleArraySwap:i,handleArrayInsert:a}}function K(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},formGroupStateBase:e.formGroupStateBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}var id=class{constructor(e){this.options={},this.fieldInfo={},this.formGroupApis=new Set,this.mount=()=>{let e=this.store.subscribe(()=>{Qu(this)}),t=ku.on(`request-form-state`,e=>{e.payload.id===this._formId&&ku.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),n=ku.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),r=ku.on(`request-form-force-submit`,e=>{e.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),i=()=>{r(),n(),t(),e.unsubscribe(),ku.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:a}=this.options.validators||{};return ku.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}),a&&this.validateSync(`mount`),i},this.update=e=>{if(!e)return;let t=this.options;this.options=e;let n=e.defaultValues&&!Wu(e.defaultValues,t.defaultValues)&&!this.state.isTouched,r=!Wu(e.defaultState,t.defaultState)&&!this.state.isTouched;if(n||r){if(Sr(()=>{this.baseStore.setState(()=>K(Object.assign({},this.state,r?e.defaultState:{},n?{values:e.defaultValues}:{})))}),n){let e=G(this);for(let t of Object.keys(this.fieldInfo))Array.isArray(this.getFieldValue(t))&&e.bumpArrayVersion(t)}ku.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}},this.reset=(e,t)=>{let{fieldMeta:n}=this.state,r=this.resetFieldMeta(n);e&&!t?.keepDefaultValues&&(this.options={...this.options,defaultValues:e}),this.baseStore.setState(()=>{let t=e??this.options.defaultValues??this.options.defaultState?.values;return e||Object.values(this.fieldInfo).forEach(e=>{e.instance&&e.instance.options.defaultValue!==void 0&&(t=Mu(t,e.instance.name,e.instance.options.defaultValue))}),K({...this.options.defaultState,values:t,fieldMetaBase:r})})},this.validateAllFields=async e=>{let t=[];return Sr(()=>{Object.values(this.fieldInfo).forEach(n=>{if(!n.instance)return;let r=n.instance;t.push(Promise.resolve().then(()=>r.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.instance.store.state.meta.isTouched||n.instance.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null,a=[`${e}[${t}]`];for(let n=t+1;n<=(i??0);n++)a.push(`${e}[${n}]`);let o=Object.keys(this.fieldInfo).filter(e=>a.some(t=>e.startsWith(t))),s=[];return Sr(()=>{o.forEach(e=>{s.push(Promise.resolve().then(()=>this.validateField(e,n)))})}),(await Promise.all(s)).flat()},this.validateField=(e,t)=>{let n=this.fieldInfo[e]?.instance;if(!n){let{hasErrored:n}=this.validateSync(t);return n&&!this.options.asyncAlways?this.getFieldMeta(e)?.errors??[]:this.validateAsync(t).then(()=>this.getFieldMeta(e)?.errors??[])}return n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0})),n.validate(t)},this.validateSync=(e,t)=>{let n=Vu(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||td}),r=!1,i={};return Sr(()=>{for(let e of n){if(!e.validate)continue;let{formError:n,fieldErrors:a}=ad(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),o=od(e.cause),s=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(a||{})]);t?.filterFieldNames&&(s=new Set([...s].filter(t.filterFieldNames)));for(let e of s){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!a?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??W,r=a?.[e],{newErrorValue:s,newSource:c}=Gu({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[o]===`form`,previousErrorValue:t?.[o]});c===`form`&&(i[e]={...i[e],[o]:r}),t?.[o]!==s&&this.setFieldMeta(e,(e=W)=>({...e,errorMap:{...e.errorMap,[o]:s},errorSourceMap:{...e.errorSourceMap,[o]:c}}))}t?.dontUpdateFormErrorMap||this.state.errorMap?.[o]!==n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:n}})),(n||a)&&(r=!0)}if(t?.dontUpdateFormErrorMap)return;let a=od(`submit`);this.state.errorMap?.[a]&&e!==`submit`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:void 0}}));let o=od(`server`);this.state.errorMap?.[o]&&e!==`server`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:void 0}}))}),{hasErrored:r,fieldsErrorMap:i}},this.validateAsync=async(e,t)=>{let n=Hu(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||td});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let r=[],i;for(let e of n){if(!e.validate)continue;let n=od(e.cause);this.state.validationMetaMap[n]?.lastAbortController.abort();let a=new AbortController;this.state.validationMetaMap[n]={lastAbortController:a},r.push(new Promise(async n=>{let r;try{r=await new Promise((t,n)=>{setTimeout(async()=>{if(a.signal.aborted)return t(void 0);try{t(await this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`,signal:a.signal},type:`validateAsync`}))}catch(e){n(e)}},e.debounceMs)})}catch(e){r=e}let{formError:o,fieldErrors:s}=ad(r);s&&(i=i?{...i,...s}:s);let c=od(e.cause),l=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(i||{})]),u=Array.from(l);t?.filterFieldNames&&(u=u.filter(t.filterFieldNames));for(let e of u){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!i?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??W,r=i?.[e],{newErrorValue:a,newSource:o}=Gu({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[c]===`form`,previousErrorValue:t?.[c]});t?.[c]!==a&&this.setFieldMeta(e,(e=W)=>({...e,errorMap:{...e.errorMap,[c]:a},errorSourceMap:{...e.errorSourceMap,[c]:o}}))}t?.dontUpdateFormErrorMap||this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[c]:o}})),n(i?{fieldErrors:i,errorMapKey:c}:void 0)}))}let a=[],o={};if(r.length){a=await Promise.all(r);for(let e of a)if(e?.fieldErrors){let{errorMapKey:t}=e;for(let[n,r]of Object.entries(e.fieldErrors))o[n]={...o[n]||{},[t]:r}}}return this.baseStore.setState(e=>({...e,isFormValidating:!1})),o},this.validate=(e,t)=>{let{hasErrored:n,fieldsErrorMap:r}=this.validateSync(e,t);return n&&!this.options.asyncAlways?r:this.validateAsync(e,t)},this._handleSubmit=async e=>{this.baseStore.setState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),Sr(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance&&(e.instance.store.state.meta.isTouched||e.instance.setMeta(e=>({...e,isTouched:!0})))})});let t=e??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride&&this.baseStore.state.submissionAttempts<=1){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t});return}this.baseStore.setState(e=>({...e,isSubmitting:!0}));let n=()=>{this.baseStore.setState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.state.isFieldsValid)n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),ku.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validateAllFields`,errors:Object.values(this.state.fieldMeta).map(e=>e.errors).flat()});else if(await this.validate(`submit`),!this.state.isValid)n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),ku.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});else{Sr(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance?.triggerOnSubmitListener()})}),this.options.listeners?.onSubmit?.({formApi:this,meta:t});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:t}),Sr(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),ku.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),ku.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}}},this.getFieldValue=e=>ju(this.state.values,e),this.getFieldMeta=e=>this.state.fieldMeta[e],this.getFormGroupMeta=e=>this.formGroupMetaDerived.state[e],this.getFieldInfo=e=>this.fieldInfo[e]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(e,t)=>{this.baseStore.setState(n=>({...n,fieldMetaBase:{...n.fieldMetaBase,[e]:Au(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=W,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;Sr(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:Mu(n.values,e,t)}))}),i||this.getFieldInfo(e).instance?.triggerOnChangeListener(),a||this.validateField(e,`change`)},this.deleteField=e=>{let t=[...Object.keys(this.fieldInfo).filter(t=>{let n=e.toString();return t.startsWith(`${n}.`)||t.startsWith(`${n}[`)}),e];this.baseStore.setState(e=>{let n={...e};return t.forEach(e=>{n.values=Nu(n.values,e),delete this.fieldInfo[e],delete n.fieldMetaBase[e]}),n})},this.pushFieldValue=(e,t,n)=>{this.setFieldValue(e,e=>[...Array.isArray(e)?e:[],t],n),G(this).bumpArrayVersion(e)},this.insertFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>[...e.slice(0,t),n,...e.slice(t)],qu(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),G(this).handleArrayInsert(e,t),i||await this.validateArrayFieldsStartingFrom(e,t,`change`)},this.replaceFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>e.map((e,r)=>r===t?n:e),qu(r,{dontValidate:!0})),G(this).bumpArrayVersion(e),(r?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.removeFieldValue=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(e,e=>e.filter((e,n)=>n!==t),qu(n,{dontValidate:!0})),G(this).handleArrayRemove(e,t),i!==null){let t=`${e}[${i}]`;this.deleteField(t)}(n?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.swapFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=e[t],i=e[n];return Mu(Mu(e,`${t}`,i),`${n}`,r)},qu(r,{dontValidate:!0})),G(this).handleArraySwap(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.moveFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=[...e];return r.splice(n,0,r.splice(t,1)[0]),r},qu(r,{dontValidate:!0})),G(this).handleArrayMove(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.clearFieldValues=(e,t)=>{let n=this.getFieldValue(e),r=Array.isArray(n)?Math.max(n.length-1,0):null;if(this.setFieldValue(e,[],qu(t,{dontValidate:!0})),G(this).bumpArrayVersion(e),r!==null)for(let t=0;t<=r;t++){let n=`${e}[${t}]`;this.deleteField(n)}(t?.dontValidate??!1)||this.validateField(e,`change`)},this.resetField=e=>{this.baseStore.setState(t=>{let n=this.getFieldInfo(e).instance?.options.defaultValue,r=ju(this.options.defaultValues,e),i=n??r;return{...t,fieldMetaBase:{...t.fieldMetaBase,[e]:W},values:i===void 0?t.values:Mu(t.values,e,i)}})},this.setErrorMap=e=>{Sr(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(Uu(t)){let{formError:e,fieldErrors:r}=ad(t);for(let e of Object.keys(this.fieldInfo))this.getFieldMeta(e)&&this.setFieldMeta(e,t=>({...t,errorMap:{...t.errorMap,[n]:r?.[e]},errorSourceMap:{...t.errorSourceMap,[n]:`form`}}));this.baseStore.setState(t=>({...t,errorMap:{...t.errorMap,[n]:e}}))}else this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[n]:t}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((e,[t,n])=>(Object.keys(n).length&&n.errors.length&&(e[t]={errors:n.errors,errorMap:n.errorMap}),e),{})}),this.parseValuesWithSchema=e=>H.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>H.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??Zu(),this._devtoolsSubmissionOverride=!1;let t=K({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values});if(e?.transform){t=e.transform({state:t}).state;for(let e of Object.keys(t.errorMap)){let n=t.errorMap[e];if(n!==void 0&&Uu(n))for(let r of Object.keys(n.fields)){let i=n.fields[r];if(i===void 0)continue;let a=t.fieldMetaBase[r];t.fieldMetaBase[r]={isTouched:!1,isValidating:!1,isBlurred:!1,isDirty:!1,_arrayVersion:0,_pendingValidationsCount:0,...a??{},errorSourceMap:{...a?.errorSourceMap??{},onChange:`form`},errorMap:{...a?.errorMap??{},[e]:i}}}}}this.baseStore=kr(t);let n;this.fieldMetaDerived=kr(e=>{let t=this.baseStore.get(),r=0,i={};for(let a of Object.keys(t.fieldMetaBase)){let o=t.fieldMetaBase[a],s=n?.fieldMetaBase[a],c=e?.[a],l=ju(t.values,a),u=c?.errors;if(!s||o.errorMap!==s.errorMap){u=Object.values(o.errorMap??{}).filter(e=>e!==void 0);let e=this.getFieldInfo(a)?.instance;e&&e.options.disableErrorFlat||(u=u.flat(1))}let d=!Bu(u),f=!o.isDirty,p=Wu(l,this.getFieldInfo(a)?.instance?.options.defaultValue??ju(this.options.defaultValues,a));c&&c.isPristine===f&&c.isValid===d&&c.isDefaultValue===p&&c.errors===u&&o===s?(i[a]=c,r++):i[a]={...o,errors:u??[],isPristine:f,isValid:d,isDefaultValue:p}}return Object.keys(t.fieldMetaBase).length?e&&r===Object.keys(t.fieldMetaBase).length?e:(n=this.baseStore.get(),i):i}),this.formGroupMetaDerived=kr(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),r={};for(let i of this.formGroupApis){let a=i.name,o=t.formGroupStateBase[a]??{isSubmitted:!1,isSubmitting:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1},s=n[a],c=!1,l=!0,u=!1,d=!1,f=!0,p=!1;for(let e in n){if(e===a||!ed(a,e))continue;let t=n[e];t&&(t.isValidating&&(c=!0),t.isValid||(l=!1),t.isTouched&&(u=!0),t.isBlurred&&(d=!0),t.isDefaultValue||(f=!1),t.isDirty&&(p=!0))}let m=!p,h=!!c||o.isValidating,g=s?.errorMap??{},_=s?.errorSourceMap??{},v=!!(g.onMount||Object.entries(n).some(([e,t])=>t&&e!==a&&ed(a,e)&&t.errorMap.onMount)),y=e?.[a],b=y?.errors??[];y&&y.__srcErrorMap===g||(b=Object.values(g).reduce((e,t)=>{if(t===void 0)return e;if(t&&typeof t==`object`&&`fields`in t){let n=t.group;return n!==void 0&&e.push(n),e}return e.push(t),e},[]));let x=b.length===0,S=l&&x,C=i.options.canSubmitWhenInvalid??!1,w=o.submissionAttempts===0&&!u&&!v||!h&&!o.isSubmitting&&S||C;if(y&&y.errorMap===g&&y.errorSourceMap===_&&y.errors===b&&y.isFieldsValidating===c&&y.isFieldsValid===l&&y.isGroupValid===x&&y.isValid===S&&y.canSubmit===w&&y.isTouched===u&&y.isBlurred===d&&y.isPristine===m&&y.isDefaultValue===f&&y.isDirty===p&&y.isValidating===h&&y.isSubmitting===o.isSubmitting&&y.isSubmitted===o.isSubmitted&&y.submissionAttempts===o.submissionAttempts&&y.isSubmitSuccessful===o.isSubmitSuccessful){r[a]=y;continue}let ee={...o,errorMap:g,errorSourceMap:_,_arrayVersion:s?._arrayVersion??0,isTouched:u,isBlurred:d,isDirty:p,isPristine:m,isDefaultValue:f,isValid:S,errors:b,isValidating:h,isFieldsValidating:c,isFieldsValid:l,isGroupValid:x,canSubmit:w};Object.defineProperty(ee,"__srcErrorMap",{value:g,enumerable:!1,configurable:!0}),r[a]=ee}return r});let r;this.store=kr(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),i=Object.values(n).filter(Boolean),a=i.some(e=>e.isValidating),o=i.every(e=>e.isValid),s=i.some(e=>e.isTouched),c=i.some(e=>e.isBlurred),l=i.every(e=>e.isDefaultValue),u=s&&t.errorMap?.onMount,d=i.some(e=>e.isDirty),f=!d,p=!!(t.errorMap?.onMount||i.some(e=>e?.errorMap?.onMount)),m=!!a,h=e?.errors??[];r&&t.errorMap===r.errorMap||(h=Object.values(t.errorMap).reduce((e,t)=>t===void 0?e:t&&Uu(t)?(e.push(t.form),e):(e.push(t),e),[]));let g=h.length===0,_=o&&g,v=this.options.canSubmitWhenInvalid??!1,y=t.submissionAttempts===0&&!s&&!p||!m&&!t.isSubmitting&&_||v,b=t.errorMap;if(u&&(h=h.filter(e=>e!==t.errorMap.onMount),b=Object.assign(b,{onMount:void 0})),e&&r&&e.errorMap===b&&e.fieldMeta===this.fieldMetaDerived.state&&e.errors===h&&e.isFieldsValidating===a&&e.isFieldsValid===o&&e.isFormValid===g&&e.isValid===_&&e.canSubmit===y&&e.isTouched===s&&e.isBlurred===c&&e.isPristine===f&&e.isDefaultValue===l&&e.isDirty===d&&Wu(r,t))return e;let x={...t,errorMap:b,fieldMeta:this.fieldMetaDerived.state,errors:h,isFieldsValidating:a,isFieldsValid:o,isFormValid:g,isValid:_,canSubmit:y,isTouched:s,isBlurred:c,isPristine:f,isDefaultValue:l,isDirty:d};return r=this.baseStore.get(),x}),this.handleSubmit=this.handleSubmit.bind(this),this.update(e||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(e){return U(e.validate)?H[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function ad(e){return e?Uu(e)?{formError:ad(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function od(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}var sd=class e{constructor(t){this.options={},this.mount=()=>{this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});let e=this.getInfo();e.instance=this,this.update(this.options);let{onMount:t}=this.options.validators||{};if(t){let e=this.runValidator({validate:t,value:{value:this.state.value,fieldApi:this,validationSource:`field`},type:`validate`});e&&this.setMeta(t=>({...t,errorMap:{...t?.errorMap,onMount:e},errorSourceMap:{...t?.errorSourceMap,onMount:`field`}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);let e=this.form.fieldInfo[this.name];if(e&&e.instance===this){for(let[t,n]of Object.entries(e.validationMetaMap))n?.lastAbortController.abort(),e.validationMetaMap[t]=void 0;this.form.baseStore.setState(e=>({...e,fieldMetaBase:{...e.fieldMetaBase,[this.name]:{...W,isTouched:e.fieldMetaBase[this.name]?.isTouched??W.isTouched,isBlurred:e.fieldMetaBase[this.name]?.isBlurred??W.isBlurred,isDirty:e.fieldMetaBase[this.name]?.isDirty??W.isDirty}}})),e.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,fieldApi:this}),this.form.options.listeners?.onFieldUnmount?.({formApi:this.form,fieldApi:this})}}},this.update=e=>{this.options=e,this.name=e.name,this.state.meta.isTouched||this.options.defaultValue===void 0||Wu(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0}),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,qu(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,t)=>{this.form.pushFieldValue(this.name,e,qu(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,qu(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,qu(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,qu(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,qu(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,qu(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,qu(e,{dontRunListeners:!0})),e?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=t=>{let n=Object.values(this.form.fieldInfo),r=[];for(let i of n){if(!i.instance||!(i.instance instanceof e))continue;let{onChangeListenTo:n,onBlurListenTo:a}=i.instance.options.validators||{};t===`change`&&n?.includes(this.name)&&r.push(i.instance),t===`blur`&&a?.includes(this.name)&&r.push(i.instance)}return r},this.validateSync=(e,t)=>{let n=Vu(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||td}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=Vu(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||td});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;Sr(()=>{let e=(e,n)=>{let r=q(n.cause),a=n.validate?cd(e.runValidator({validate:n.validate,value:{value:e.store.state.value,validationSource:`field`,fieldApi:e},type:`validate`})):void 0,o=t[r],{newErrorValue:s,newSource:c}=Ku({formLevelError:o,fieldLevelError:a});e.state.meta.errorMap?.[r]!==s&&e.setMeta(e=>({...e,errorMap:{...e.errorMap,[r]:s},errorSourceMap:{...e.errorSourceMap,[r]:c}})),s&&(i=!0)};for(let t of n)e(this,t);for(let t of r)t.validate&&e(t.field,t)});let a=q(`submit`);return this.state.meta.errorMap?.[a]&&e!==`submit`&&!i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[a]:void 0},errorSourceMap:{...e.errorSourceMap,[a]:void 0}})),{hasErrored:i}},this.validateAsync=async(e,t)=>{let n=Hu(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||td}),r=await t,i=this.getLinkedFields(e).reduce((t,n)=>{let r=Hu(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||td});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),a=[],o=[],s=n.some(e=>e.validate),c=Array.from(new Set(i.filter(e=>e.validate).map(e=>e.field)));Sr(()=>{s&&this.startValidation();for(let e of c)e.startValidation()});let l=(e,t,n)=>{let i=q(t.cause),a=e.getInfo();a.validationMetaMap[i]?.lastAbortController.abort();let o=new AbortController;a.validationMetaMap[i]={lastAbortController:o},n.push(new Promise(async n=>{let a;try{a=await new Promise((n,r)=>{e.timeoutIds.validations[t.cause]&&(clearTimeout(e.timeoutIds.validations[t.cause]),e.endValidation()),e.timeoutIds.validations[t.cause]=setTimeout(async()=>{if(o.signal.aborted)return n(void 0);try{n(await this.runValidator({validate:t.validate,value:{value:e.store.state.value,fieldApi:e,signal:o.signal,validationSource:`field`},type:`validateAsync`}))}catch(e){r(e)}},t.debounceMs)})}catch(e){a=e}if(o.signal.aborted)return n(void 0);let s=cd(a),c=r[e.name]?.[i],{newErrorValue:l,newSource:u}=Ku({formLevelError:c,fieldLevelError:s});if(e.getInfo().instance!==e)return n(void 0);e.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:l},errorSourceMap:{...e.errorSourceMap,[i]:u}})),n(l)}))};for(let e of n)e.validate&&l(this,e,a);for(let e of i)e.validate&&l(e.field,e,o);let u=[];return(a.length||o.length)&&(u=await Promise.all(a),await Promise.all(o)),Sr(()=>{s&&this.endValidation();for(let e of c)e.endValidation()}),u.filter(Boolean)},this.validate=(e,t)=>{if(!this.state.meta.isTouched)return[];let n=t?.skipGroupValidation?[]:Array.from(this.form.formGroupApis).filter(e=>this.name.startsWith(e.name)),r=(t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e)).fieldsErrorMap[this.name]??{};if(!t?.skipFormValidation)for(let t of n){if(t.state.meta.submissionAttempts===0)continue;let{fieldsErrorMap:n}=this.form.validateSync(e,{group:t,dontUpdateFormErrorMap:!0,filterFieldNames:e=>ed(t.name,e)});r={...r,...n[this.name]??{}}}let{hasErrored:i}=this.validateSync(e,r),a=new WeakMap;for(let t of n){let{hasErrored:n}=t.validateSync(e,{},{skipRelatedFieldValidation:!0});a.set(t,n)}if(i&&!this.options.asyncAlways){this.getInfo().validationMetaMap[q(e)]?.lastAbortController.abort();let t=[];for(let r of n)r.getInfo().validationMetaMap[q(e)]?.lastAbortController.abort(),t.push(r.state.meta.errors);return[...this.state.meta.errors,...t.flat()]}let o=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e),s=this.validateAsync(e,o),c=[];for(let t of n)(!a.get(t)||t.options.asyncAlways)&&c.push(t.validateAsync(e,o,{skipRelatedFieldValidation:!0}));return c.length===0?s:Promise.all([s,...c]).then(e=>e.flat())},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(e=>({...e,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(e=>({...e,isBlurred:!0})),this.validate(`blur`),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(t=>({...t,errorMap:{...t.errorMap,...e}}))},this.parseValueWithSchema=e=>H.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>H.validateAsync({value:this.state.value,validationSource:`field`},e),this.triggerOnBlurListener=()=>{let e=this.form.options.listeners?.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this});for(let e of this.form.formGroupApis)ed(e.name,this.name)&&e.triggerOnChangeListener()},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,fieldApi:this})},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=kr(e=>{this.form.store.get();let n=this.form.getFieldMeta(this.name)??{...W,...t.defaultMeta},r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Wu(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}})}get state(){return this.store.state}runValidator(e){return U(e.validate)?H[e.type](e.value,e.validate):e.validate(e.value)}startValidation(){this.setMeta(e=>{let t=e._pendingValidationsCount+1;return{...e,_pendingValidationsCount:t,isValidating:t>0&&!e.isValidating||e.isValidating}})}endValidation(){this.setMeta(e=>{let t=Math.max(0,e._pendingValidationsCount-1);return{...e,_pendingValidationsCount:t,isValidating:t===0&&e.isValidating?!1:e.isValidating}})}};function cd(e){if(e)return e}function q(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function ld(e){return{isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1}}function ud(e){return{...W,...e,errors:[],isPristine:!0,isValid:!0,isDefaultValue:!0,isFieldsValidating:!1,isFieldsValid:!0,isGroupValid:!0,canSubmit:!0,isSubmitting:!1,isSubmitted:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1}}var dd=class e{constructor(t){this.options={},this.setFormGroupState=e=>{this.form.baseStore.setState(t=>{let n=t.formGroupStateBase[this.name]??ld({});return{...t,formGroupStateBase:{...t.formGroupStateBase,[this.name]:e(n)}}})},this._lastDistributedFieldNames={},this.update=e=>{this.options=e,this.name=e.name,this.state.meta.isTouched||this.options.defaultValue===void 0||Wu(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0}),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,{...W,...this.options.defaultMeta})},this.mount=()=>{this.update(this.options),this.form.formGroupApis.add(this),this.fieldInfo.instance=this,this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:e.formGroupStateBase[this.name]??ld({...this.options.defaultState})}}));let{onMount:e}=this.options.validators||{};if(e){let t=this.runValidator({validate:e,value:{value:this.state.value,groupApi:this,validationSource:`form`},type:`validate`}),n=t,r;pd(t)&&(n=t.group,r=t.fields);let i=fd(n);i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,onMount:i},errorSourceMap:{...e.errorSourceMap,onMount:`field`}})),this.distributeFieldErrors(`onMount`,r)}return this.options.listeners?.onMount?.({value:this.state.value,groupApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);if(this.fieldInfo.instance===this){for(let[e,t]of Object.entries(this.fieldInfo.validationMetaMap))t?.lastAbortController.abort(),this.fieldInfo.validationMetaMap[e]=void 0;this.form.formGroupApis.delete(this),this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:ld({})}})),this.fieldInfo.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,groupApi:this})}}},this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,qu(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.fieldInfo,this.getRelatedFields=()=>{let e=Object.values(this.form.fieldInfo),t=[];for(let n of e)n.instance&&n.instance instanceof sd&&n.instance.name.startsWith(this.name)&&t.push(n.instance);return t},this.getRelatedFieldMetasDerived=()=>{let e=Object.entries(this.form.fieldMetaDerived.state),t=[];for(let[n,r]of e)n!==this.name&&ed(this.name,n)&&t.push({...r,name:n});return t},this.buildChildFieldName=e=>e===``?this.name:e.startsWith(`[`)?`${this.name}${e}`:`${this.name}.${e}`,this.distributeFieldErrors=(e,t)=>{let n=this._lastDistributedFieldNames[e]??new Set,r=new Set;if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&r.add(this.buildChildFieldName(e));let i=new Set([...n,...r]),a=!1;for(let n of i){let r=n.startsWith(this.name+`[`)?n.slice(this.name.length):n.slice(this.name.length+1),i=t?.[r],o=this.form.getFieldMeta(n);if(!o&&!i)continue;let s=o?.errorMap[e],{newErrorValue:c,newSource:l}=Gu({newFormValidatorError:i,isPreviousErrorFromFormValidator:o?.errorSourceMap[e]===`form`,previousErrorValue:s});c&&(a=!0),(s!==c||o?.errorSourceMap[e]!==l)&&this.form.setFieldMeta(n,(t=W)=>({...t,errorMap:{...t.errorMap,[e]:c},errorSourceMap:{...t.errorSourceMap,[e]:l}}))}return this._lastDistributedFieldNames[e]=r,a},this.validateSync=(t,n,r={})=>{let i=Vu(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||td}),a=(r.skipRelatedFieldValidation?[]:this.getRelatedFields()).reduce((e,n)=>{let r=Vu(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||td});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),o=!1;Sr(()=>{let t=(t,r)=>{let i=hd(r.cause),a=t===this,s;r.validate&&(s=t.runValidator({validate:r.validate,value:{value:t.store.state.value,validationSource:a?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validate`}));let c=s,l;a&&pd(s)&&(c=s.group,l=s.fields);let u=fd(c),d=n[i],{newErrorValue:f,newSource:p}=Ku({formLevelError:d,fieldLevelError:u});t.state.meta.errorMap?.[i]!==f&&t.setMeta(e=>({...e,errorMap:{...e.errorMap,[i]:f},errorSourceMap:{...e.errorSourceMap,[i]:p}})),f&&(o=!0),a&&this.distributeFieldErrors(i,l)&&(o=!0)};for(let e of i)t(this,e);for(let e of a)e.validate&&t(e.field,e)});let s=hd(`submit`);return this.state.meta.errorMap?.[s]&&t!==`submit`&&!o&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[s]:void 0},errorSourceMap:{...e.errorSourceMap,[s]:void 0}})),{hasErrored:o}},this.validateAsync=async(t,n,r={})=>{let i=Hu(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||td}),a=await n,o=r.skipRelatedFieldValidation?[]:this.getRelatedFields(),s=o.reduce((e,n)=>{let r=Hu(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||td});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),c=[],l=[],u=i.some(e=>e.validate)||s.some(e=>e.validate);if(u){this.state.meta.isValidating||this.setMeta(e=>({...e,isValidating:!0}));for(let e of o)e.setMeta(e=>({...e,isValidating:!0}))}let d=(t,n,r)=>{let i=hd(n.cause),o=t.getInfo();o.validationMetaMap[i]?.lastAbortController.abort();let s=new AbortController;o.validationMetaMap[i]={lastAbortController:s};let c=t===this;r.push(new Promise(async r=>{let o;try{o=await new Promise((r,i)=>{t.timeoutIds.validations[n.cause]&&clearTimeout(t.timeoutIds.validations[n.cause]),t.timeoutIds.validations[n.cause]=setTimeout(async()=>{if(s.signal.aborted)return r(void 0);try{r(await this.runValidator({validate:n.validate,value:{value:t.store.state.value,signal:s.signal,validationSource:c?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validateAsync`}))}catch(e){i(e)}},n.debounceMs)})}catch(e){o=e}if(s.signal.aborted)return r(void 0);let l=o,u;c&&pd(o)&&(l=o.group,u=o.fields);let d=fd(l),f=a[t.name]?.[i],{newErrorValue:p,newSource:m}=Ku({formLevelError:f,fieldLevelError:d});if(t.getInfo().instance!==t)return r(void 0);t.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:p},errorSourceMap:{...e.errorSourceMap,[i]:m}})),c&&this.distributeFieldErrors(i,u),r(p)}))};for(let e of i)e.validate&&d(this,e,c);for(let e of s)e.validate&&d(e.field,e,l);let f=[];if((c.length||l.length)&&(f=await Promise.all(c),await Promise.all(l)),u){this.setMeta(e=>({...e,isValidating:!1}));for(let e of o)e.setMeta(e=>({...e,isValidating:!1}))}return f.filter(Boolean)},this.validateAllFields=async e=>{let t=[];return Sr(()=>{Object.values(this.getRelatedFields()).forEach(n=>{t.push(Promise.resolve().then(()=>n.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=(e,t,n)=>this.form.validateArrayFieldsStartingFrom(e,t,n),this.validateField=(e,t)=>this.form.validateField(e,t),this.getFieldValue=e=>this.form.getFieldValue(e),this.getFieldMeta=e=>this.form.getFieldMeta(e),this.setFieldMeta=(e,t)=>this.form.setFieldMeta(e,t),this.setFieldValue=(e,t)=>this.form.setFieldValue(e,t),this.deleteField=e=>this.form.deleteField(e),this.pushFieldValue=(e,t)=>this.form.pushFieldValue(e,t),this.insertFieldValue=(e,t,n)=>this.form.insertFieldValue(e,t,n),this.replaceFieldValue=(e,t,n)=>this.form.replaceFieldValue(e,t,n),this.swapFieldValues=(e,t,n)=>this.form.swapFieldValues(e,t,n),this.moveFieldValues=(e,t,n)=>this.form.moveFieldValues(e,t,n),this.clearFieldValues=e=>this.form.clearFieldValues(e),this.resetField=e=>this.form.resetField(e),this.removeFieldValue=(e,t)=>this.form.removeFieldValue(e,t),this.areRelatedFieldsValid=()=>Object.values(this.getRelatedFields()).every(e=>e.state.meta.isValid),this.validate=(e,t)=>{let{fieldsErrorMap:n}=t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>ed(this.name,e)}),{hasErrored:r}=this.validateSync(e,n[this.name]??{},{skipRelatedFieldValidation:t?.skipRelatedFieldValidation});if(r&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[hd(e)]?.lastAbortController.abort(),this.state.meta.errors;let i=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>ed(this.name,e)});return this.validateAsync(e,i,{skipRelatedFieldValidation:t?.skipRelatedFieldValidation})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeGroupDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this})},e)):this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,groupApi:this})},this._handleSubmit=async e=>{this.setFormGroupState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),Sr(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.state.meta.isTouched||e.setMeta(e=>({...e,isTouched:!0}))})});let t=e??this.options.onSubmitMeta;this.setFormGroupState(e=>({...e,isSubmitting:!0}));let n=()=>{this.setFormGroupState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.areRelatedFieldsValid())n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});else if(await this.validate(`submit`,{skipRelatedFieldValidation:!0}),!this.areRelatedFieldsValid()||!this.state.meta.isValid)n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});else{Sr(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.options.listeners?.onGroupSubmit?.({value:e.state.value,fieldApi:e})})}),this.options.listeners?.onSubmit?.({groupApi:this,value:this.state.value});try{await this.options.onGroupSubmit?.({value:this.state.value,groupApi:this,meta:t}),Sr(()=>{this.setFormGroupState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),n()})}catch(e){throw this.setFormGroupState(e=>({...e,isSubmitSuccessful:!1})),n(),e}}},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.fieldInfo={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.store=kr(e=>{this.form.formGroupMetaDerived.get(),this.form.baseStore.get();let n=this.form.getFormGroupMeta(this.name)??ud(t.defaultMeta),r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Wu(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}}),this.handleSubmit=this.handleSubmit.bind(this)}get state(){return this.store.state}runValidator(e){if(U(e.validate)){let t=H[e.type](e.value,e.validate);return e.type===`validate`?md(t):t.then(md)}return e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function fd(e){if(e)return e}function pd(e){return!!e&&typeof e==`object`&&`fields`in e}function md(e){if(!e||typeof e!=`object`||!(`form`in e)&&!(`fields`in e))return e;let{form:t,fields:n,...r}=e;return{...r,group:t,fields:n}}function hd(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function gd(e,t){if(!t)return;let n=Object.assign({},e,{state:$u(e.state)});t(n),n.fieldInfo!==e.fieldInfo&&(e.fieldInfo=n.fieldInfo),n.options!==e.options&&(e.options=n.options);let r=Object.keys({values:null,validationMetaMap:null,fieldMetaBase:null,formGroupStateBase:null,isSubmitting:null,isSubmitted:null,isValidating:null,submissionAttempts:null,isSubmitSuccessful:null,_force_re_eval:null}).reduce((t,r)=>(e.state[r]!==n.state[r]&&(t[r]=n.state[r]),t),{});return Sr(()=>{Object.keys(r).length&&e.baseStore.setState(e=>({...e,...r})),n.state.errorMap!==e.state.errorMap&&e.setErrorMap(n.state.errorMap)}),n}var _d=typeof window<`u`?T.useLayoutEffect:T.useEffect;function vd(e){let[t,n]=(0,T.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,T.useState)(()=>new sd({...e})),a=r;(t.form!==e.form||t.name!==e.name)&&(a=new sd({...e}),i(a),n({form:e.form,name:e.name}));let o=M(a.store,e.mode===`array`?e=>e.meta._arrayVersion||0:e=>e.value),s=M(a.store,e=>e.meta.isTouched),c=M(a.store,e=>e.meta.isBlurred),l=M(a.store,e=>e.meta.isDirty),u=M(a.store,e=>e.meta.errorMap),d=M(a.store,e=>e.meta.errorSourceMap),f=M(a.store,e=>e.meta.isValidating),p=(0,T.useMemo)(()=>({...a,get state(){return{value:e.mode===`array`?a.state.value:o,get meta(){return{...a.state.meta,isTouched:s,isBlurred:c,isDirty:l,errorMap:u,errorSourceMap:d,isValidating:f}}}}}),[a,e.mode,o,s,c,l,u,d,f]);return _d(a.mount,[a]),_d(()=>{a.update(e)}),p}var yd=(({children:e,...t})=>{let n=vd(t),r=(0,T.useMemo)(()=>Au(e,n),[e,n]);return(0,j.jsx)(j.Fragment,{children:r})});function bd(){return(0,T.useState)(()=>Zu())[0]}var xd=T,Sd=`19.3.1`.split(`.`)[0]===`17`?bd:xd.useId;function Cd(e){let[t,n]=(0,T.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,T.useState)(()=>new dd({...e}));(t.form!==e.form||t.name!==e.name)&&(i(new dd({...e})),n({form:e.form,name:e.name}));let a=M(r.store,e=>e.value),o=M(r.store,e=>e.meta.isTouched),s=M(r.store,e=>e.meta.isBlurred),c=M(r.store,e=>e.meta.isDirty),l=M(r.store,e=>e.meta.errorMap),u=M(r.store,e=>e.meta.errorSourceMap),d=M(r.store,e=>e.meta.isValidating),f=M(r.store,e=>e.meta.isSubmitting),p=M(r.store,e=>e.meta.isSubmitted),m=M(r.store,e=>e.meta.submissionAttempts),h=M(r.store,e=>e.meta.isSubmitSuccessful),g=M(r.store,e=>e.meta.canSubmit),_=M(r.store,e=>e.meta.isValid),v=M(r.store,e=>e.meta.isFieldsValid),y=M(r.store,e=>e.meta.isFieldsValidating),b=M(r.store,e=>e.meta.isGroupValid),x=(0,T.useMemo)(()=>({...r,handleSubmit:((...e)=>r._handleSubmit(...e)),get state(){return{...r.state,value:a,get meta(){return{...r.state.meta,isTouched:o,isBlurred:s,isDirty:c,errorMap:l,errorSourceMap:u,isValidating:d,isSubmitting:f,isSubmitted:p,submissionAttempts:m,isSubmitSuccessful:h,canSubmit:g,isValid:_,isFieldsValid:v,isFieldsValidating:y,isGroupValid:b}}}}}),[r,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b]);return _d(r.mount,[r]),_d(()=>{r.update(e)}),x}var wd=(({children:e,...t})=>{let n=Cd(t),r=(0,T.useMemo)(()=>Au(e,n),[e,n]);return(0,j.jsx)(j.Fragment,{children:r})});function Td({form:e,selector:t=e=>e,children:n}){let r=M(e.store,t);return(0,j.jsx)(j.Fragment,{children:Au(n,r)})}function Ed(e){let t=Sd(),[n,r]=(0,T.useState)(e?.formId),[i,a]=(0,T.useState)(()=>new id({...e,formId:e?.formId??t}));if(n!==e?.formId){let n=e?.formId??t;a(new id({...e,formId:n})),r(n)}let o=(0,T.useMemo)(()=>{let e={...i,handleSubmit:((...e)=>i._handleSubmit(...e)),get formId(){return i._formId},get state(){return i.store.state}};return e.Field=function(e){return(0,j.jsx)(yd,{...e,form:i})},e.FormGroup=function(e){return(0,j.jsx)(wd,{...e,form:i})},e.Subscribe=function(e){return(0,j.jsx)(Td,{form:i,selector:e.selector,children:e.children})},e},[i]);_d(i.mount,[]),_d(()=>{i.update(e)});let s=(0,T.useRef)(!1);return _d(()=>{s.current&&e?.transform&&gd(i,e.transform)},[i,e?.transform]),_d(()=>{s.current=!0}),o}function J(e){let t=e?.response;return typeof t?.message==`string`&&t.message?t.message:e instanceof Error&&e.message?e.message:`Something went wrong.`}function Dd(e){return e?.status===400?`Invalid filter. Check the syntax and field names.`:J(e)}function Od(e,t=``){let n={};if(typeof e!=`object`||!e)return n;let r=e;if(typeof r.message==`string`&&t)return n[t]=r.message,n;for(let[e,i]of Object.entries(r))Object.assign(n,Od(i,t?`${t}.${e}`:e));return n}var kd=(0,T.createContext)(null),Ad=e=>e?.response?.data;function jd({error:e,children:t}){let n=(0,T.useRef)(new Set),r=(0,T.useRef)(new Map),i=(0,T.useMemo)(()=>{let t=()=>n.current.forEach(e=>e());return{errors:e?Od(Ad(e)):{},message:e?J(e):``,claimed:()=>new Set(r.current.keys()),subscribe(e){return n.current.add(e),()=>n.current.delete(e)},claim(e){r.current.set(e,(r.current.get(e)??0)+1),t()},release(e){let n=(r.current.get(e)??1)-1;n<=0?r.current.delete(e):r.current.set(e,n),t()}}},[e]);return(0,j.jsx)(kd.Provider,{value:i,children:t})}function Y(e){let t=(0,T.useContext)(kd);return(0,T.useLayoutEffect)(()=>(t?.claim(e),()=>t?.release(e)),[t,e]),t?.errors[e]}function X(){let e=(0,T.useContext)(kd),[,t]=(0,T.useState)(0),n=!!e?.message;if((0,T.useLayoutEffect)(()=>{if(!e||!n)return;let r=()=>t(e=>e+1);return r(),e.subscribe(r)},[e,n]),!e||!e.message)return null;let r=e.claimed(),i=Object.entries(e.errors).filter(([e])=>!r.has(e));return i.length===0&&Object.keys(e.errors).length>0?null:(0,j.jsxs)(`div`,{role:`alert`,className:`rounded border border-danger/40 bg-danger/10 p-3 text-sm text-danger-text`,children:[(0,j.jsx)(`p`,{children:e.message}),i.length>0&&(0,j.jsx)(`ul`,{className:`mt-1 list-disc pl-5`,children:i.map(([e,t])=>(0,j.jsxs)(`li`,{children:[e,`: `,t]},e))})]})}function Md(e,t=!0){let n=(0,T.useContext)(kd),r=Object.entries(n?.errors??{}).filter(([t])=>t.startsWith(e)),i=t?r.map(([e])=>e).join(`
|
|
13
|
+
`))>=0;)d(o.slice(0,n)),o=o.slice(n+1);if(e)return}}finally{n?.removeEventListener(`abort`,i),r.releaseLock()}}var Ba=15e3,Va=[200,300,500,1e3,1200,1500,2e3];function Ha(e,t){if(!e)return``;let n=Fi(e);return`${n.collectionId??t?.collectionId}/${n.id??t?.id}`}function Ua(e){try{return JSON.parse(e)||{}}catch{return{}}}function Wa(e){let{env:t}=e,n=new Map,r=``,i=null,a=[],o,s,c=0,l=!1,u=[],d=[],f=!1,p=e.authStore.token,m=Ha(p,e.authStore.record),h=``,g=()=>`realtime_${r}`,_=()=>[...n.keys()].filter(e=>n.get(e).length),v=()=>{let e=_();return e.length!==a.length||e.some(e=>!a.includes(e))},y=e=>[...n.keys()].filter(t=>(t+`?`).startsWith(e)),b=e=>y(e.includes(`?`)?e:e+`?`),x=e=>{let t=u;u=[];for(let n of t)e?n.reject(e):n.resolve()};async function S(){if(!_().length)return ie();if(r&&(v()||h!==e.authStore.token)){a=_();try{await e.send(`/api/realtime`,{method:`POST`,body:{clientId:r,subscriptions:a},requestKey:g()}),h=e.authStore.token}catch(e){if(!e?.isAbort)throw e}}}async function C(){if(f||!d.length)return;let e=d;d=[],f=!0;try{await S();for(let t of e)t.resolve()}catch(t){for(let n of e)n.reject(t)}finally{f=!1,d.length&&await C()}}function w(){return new Promise((e,t)=>{d.push({resolve:e,reject:t}),d.length===1&&Promise.resolve().then(C)})}function ee(){return c>0?Promise.resolve():new Promise((e,t)=>{u.push({resolve:e,reject:t}),u.length===1&&!i&&Promise.resolve().then(T)})}function T(){ie(!0),o=t.setTimeout(()=>re(Error(`Realtime connect took too long.`)),Ba);let n=new AbortController;i=n;let r=()=>i===n;t.fetch(e.buildURL(`/api/realtime`),{headers:{Accept:`text/event-stream`},signal:n.signal}).then(e=>{if(!e.ok||!e.body)throw e.body?.cancel().catch(()=>{}),Error(`Failed to establish realtime connection.`);return za(e.body,e=>r()&&te(e),n.signal)}).then(()=>r()&&re(Error(`Realtime stream ended.`)),e=>r()&&re(e))}function te(e){if(e.event===`HB_CONNECT`)return ne(e);for(let t of[...n.get(e.event)??[]])t(Ua(e.data))}function ne(e){let u=i;r=e.id,a=[],w().then(async()=>{if(i===u){for(let e=3;v()&&e>0;e--)await w();x(),c=0,l=!1,t.clearTimeout(s),t.clearTimeout(o);for(let t of b(`HB_CONNECT`))for(let r of[...n.get(t)])r(Ua(e.data));v()&&await w()}}).catch(e=>{i===u&&(r=``,a=[],re(e))})}function re(e){if(t.clearTimeout(o),t.clearTimeout(s),!r&&!c&&!l){x(e instanceof ma?e:new ma({cause:e})),ie();return}ie(!0);let n=Va[Math.min(c,Va.length-1)];c++,s=t.setTimeout(T,n)}function ie(u=!1){r&&E.onDisconnect?.([...n.keys()]),t.clearTimeout(o),t.clearTimeout(s),e.cancelRequest(g()),i?.abort(),i=null,r=``,a=[],u||(c=0,l=!1,x())}function ae(e,t){for(let r of e){let e=n.get(r);if(!e)continue;let i=t?e.filter(e=>e!==t):[];i.length?n.set(r,i):n.delete(r)}}e.authStore.onChange((e,t)=>{if(e===p)return;let n=Ha(e,t)===m;if(p=e,m=Ha(e,t),r){if(n)return void w().catch(()=>{});l=!0,T()}});let E={get clientId(){return r},get isConnected(){return!!i&&!!r&&!u.length},async subscribe(e,t,r){if(!e)throw Error(`topic must be set.`);let i=e;r&&(i+=(e.includes(`?`)?`&`:`?`)+`options=`+encodeURIComponent(JSON.stringify({query:r.query,headers:r.headers})));let a=e=>t(e),o=n.get(i)??[];return o.push(a),n.set(i,o),E.isConnected?o.length===1&&await w():await ee(),()=>(ae(b(e),a),w())},async unsubscribe(e){ae(e?b(e):[...n.keys()]),await w()},async unsubscribeByPrefix(e){let t=y(e);t.length&&(ae(t),await w())}};return E}function Ga(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==``&&e!=null))}function Ka(e,t){return Ga({page:t?1:e?.page,perPage:t?1:e?.perPage,skipTotal:t||e?.count===!1?1:void 0,filter:ca(e?.where?oa(ea(e.where)):``,e?.filter),sort:la(sa(e?.orderBy),e?.sort),expand:ta(e?.expand)})}var qa=(e,t={})=>new ma({status:404,response:{code:404,message:e,data:t}});function Ja(e,t){let n=`/api/collections/${encodeURIComponent(t)}/records`,r=e=>`${n}/${encodeURIComponent(e)}`,i=e=>Ga({expand:ta(e?.expand)});function a(n){let r=e.authStore.record;return r?.id===n&&(r.collectionId===t||r.collectionName===t)}return{collection:t,findMany(t,r){return e.send(n,{...r,query:Ka(t,!1)})},async findOne(t,n,a){if(!t)throw qa(`Missing required record id.`);return e.send(r(t),{...a,query:i(n)})},async findFirst(t,r){let i=Ka(t,!0),a=await e.send(n,{...r,requestKey:r?.requestKey===void 0?`one_by_filter_${n}_${i.filter??``}`:r.requestKey,query:i});if(!a?.items?.length)throw qa(`The requested resource wasn't found.`);return a.items[0]},create(t,r,a){return e.send(n,{...a,method:`POST`,body:t,query:i(r)})},async update(t,n,o,s){let c=await e.send(r(t),{...s,method:`PATCH`,body:n,query:i(o)});if(a(c.id)){let t=e.authStore.record,n={...t,...c};(t.expand||c.expand)&&(n.expand={...t.expand,...c.expand}),e.authStore.save(e.authStore.token,n)}return c},async delete(t,n){await e.send(r(t),{...n,method:`DELETE`}),a(t)&&e.authStore.clear()},subscribe(n,r,i){let a=Ga({filter:i?.where?oa(ea(i.where)):``,expand:ta(i?.expand)}),o=Object.keys(a).length>0,s=o||i?.headers?{query:o?a:void 0,headers:i?.headers}:void 0;return e.realtime.subscribe(`${t}/${n}`,r,s)},unsubscribe(n){return n?e.realtime.unsubscribe(`${t}/${n}`):e.realtime.unsubscribeByPrefix(`${t}/`)}}}var Ya=[`/auth-refresh`,`/auth-with-password`];function Xa(e){let{store:t}=e,n=null,r=null;t.onChange((e,t)=>{n&&(!e||t?.id!==n.record.id||t?.collectionId!==n.record.collectionId)&&(n=null)});let i=n=>t.isValid&&!!t.record&&Ii(t.token,e.now(),n);async function a(n,r){let a=t.isValid;if(i(r)){let{token:n,record:r}=t;try{let i=await e.refresh(r.collectionName||r.collectionId);t.token===n&&t.save(i.token,i.record)}catch{a=!1}}!a&&n&&await n.run()}return{register(e){n=e},reset(){n=null},before(o,s){if(Ya.some(e=>o.endsWith(e))||Ea(s))return;if(r)return r;let c=n,l=c?.threshold??e.threshold;if(l!==void 0&&(i(l)||c&&!t.isValid))return r=a(c,l).finally(()=>{r=null}),r}}}function Za(e){return{run:(t,n)=>e.send(`/api/sql`,{...n,method:`POST`,body:{query:t}})}}function Qa(e,t={}){return $a(e,t,{...Ui,fetch:t.fetch??Ui.fetch})}function $a(e,t,n){let r=t.lang??`en-US`,i=t.authStore??eo(n.now),a=Xa({store:i,now:n.now,threshold:t.autoRefreshThreshold,refresh:e=>l.send(`/api/collections/${encodeURIComponent(e)}/auth-refresh`,{method:`POST`,requestKey:null})}),o=Oa({url:e,lang:r,env:n,token:()=>i.token,autoCancel:()=>l.autoCancel,beforeSend:a.before}),s=()=>$a(e,{lang:r,autoCancel:l.autoCancel,authStore:zi(n.now)},n),c=(t=i)=>Wa({env:n,authStore:t,buildURL:t=>ya(e,t),send:o.send,cancelRequest:o.cancelRequest}),l={url:e,lang:r,authStore:i,autoCancel:t.autoCancel??!0,buildURL:t=>ya(e,t),...o,realtime:c(),files:Ia({send:o.send,buildURL:t=>ya(e,t)}),collections:N(o),settings:P(o),crons:da(o),health:fa(o),logs:Ra(o),backups:Ma({send:o.send,buildURL:t=>ya(e,t)}),sql:Za(o),batch:()=>Fa(l),records:e=>Ja(l,e),auth:e=>Aa(l,e,{autoRefresh:a,fork:s,realtime:()=>c(zi(n.now))})};return l}function eo(e){try{if(typeof window<`u`&&window.localStorage)return Hi(void 0,void 0,e)}catch{}return zi(e)}var to=Pi(),no=new WeakMap;function ro(e,t){no.set(e,t)}function io(e={}){let t=e.fetch??((e,t)=>globalThis.fetch(e,t)),n=Qa(e.url??`/`,{fetch:async(e,r)=>{let i=await t(e,r),a=n.authStore.token;return i.status===401&&a&&new Headers(r?.headers).get(`Authorization`)===a&&no.get(n)?.(),i},authStore:e.authStore??Hi(`hb_superuser_auth`),autoCancel:!1});return n}var ao=T.createContext(void 0),oo=e=>{let t=T.useContext(ao);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},so=({client:e,children:t})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,j.jsx)(ao.Provider,{value:e,children:t})),co={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},lo=new class{#e=co;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function uo(e){setTimeout(e,0)}var fo=typeof window>`u`||`Deno`in globalThis;function po(){}function mo(e,t){return typeof e==`function`?e(t):e}function ho(e){return typeof e==`number`&&e>=0&&e!==1/0}function go(e,t){return Math.max(e+(t||0)-Date.now(),0)}function _o(e,t){return typeof e==`function`?e(t):e}function vo(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==bo(o,t.options))return!1}else if(!So(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function yo(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(xo(t.options.mutationKey)!==xo(a))return!1}else if(!So(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function bo(e,t){return(t?.queryKeyHashFn||xo)(e)}function xo(e){return JSON.stringify(e,(e,t)=>Do(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function So(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!So(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!So(e[r],t[r]))return!1;return!0}return!1}var Co=Object.prototype.hasOwnProperty;function wo(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Eo(e)&&Eo(t);if(!r&&!(Do(e)&&Do(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Co.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=wo(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function To(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n of Object.keys(e))if(!Co.call(t,n)||e[n]!==t[n])return!1;return!0}function Eo(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Do(e){if(!Oo(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!Oo(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function Oo(e){return Object.prototype.toString.call(e)===`[object Object]`}function ko(e){return new Promise(t=>{lo.setTimeout(t,e)})}function Ao(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:wo(e,t)}function jo(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(-n):r}function Mo(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,n):r}var No=Symbol();function Po(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===No?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Fo(e,t){return typeof e==`function`?e(...t):!!e}var Io=Symbol();function Lo(e,t,n,r){let i=!1,a;return Object.defineProperties(e,{[Io]:{value:r},signal:{enumerable:!0,get:()=>(a??=t(),i||(i=!0,a.aborted?n():a.addEventListener(`abort`,n,{once:!0})),a)}}),e}var Ro=()=>fo,zo=()=>Ro(),Bo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Vo=new class extends Bo{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Ho=uo;function Uo(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Ho,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var F=Uo(),Wo=new class extends Bo{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Go(e){return Math.min(1e3*2**e,3e4)}function Ko(e){return(e??`online`)!==`online`||Wo.isOnline()}var qo=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function I(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(po);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new qo(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Vo.isFocused()&&(e.networkMode===`always`||Wo.isOnline())&&e.canRun(),p=()=>Ko(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(zo()?0:3),a=e.retryDelay??Go,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),ko(o).then(()=>c()||f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var L=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ho(this.gcTime)&&(this.#e=lo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(zo()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(lo.clearTimeout(this.#e),this.#e=void 0)}};function Jo(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=t,u=e=>{Lo(e,()=>t.signal,()=>n=!0,l[Io])},d=Po(t.options,t.fetchOptions),f=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return u(e),e})(),o=await d(a),{maxPages:s}=t.options,c=i?Mo:jo;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Xo:Yo,n={pages:a,pageParams:o};s=await f(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:Yo(r,s);if(c>0&&e==null)break;s=await f(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Yo(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Xo(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Zo(e,t){return t?Yo(e,t)!=null:!1}function Qo(e,t){return!t||!e.getPreviousPageParam?!1:Xo(e,t)!=null}var $o=class extends L{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){super(),this.#c=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ns(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ns(this.options);e.data!==void 0&&(this.setState(ts(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Ao(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(po).catch(po):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>_o(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===No||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data!==void 0&&this.getObserversCount()>0&&this.observers.some(e=>_o(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!go(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#c||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a&&this.#o)return this.#a.continueRetry(),this.#o}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperties(e,{[Io]:{value:n.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#c=!0,n.signal)}})},i=()=>{let e=Po(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#c=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Jo(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=I({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof qo&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),s=(async()=>{try{let e=await o.promise;if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof qo){if(e.silent){if(this.#a!==o&&this.#o)return this.#o;throw e}if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0,this.#o=void 0),this.scheduleGc()}})();return this.#o=s,o.start(),s}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...es(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ts(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),F.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function es(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ko(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ts(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ns(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var rs=class extends Bo{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),as(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return os(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return os(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof _o(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!To(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&ss(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||_o(this.options.enabled,this.#t)!==_o(t.enabled,this.#t)||_o(this.options.staleTime,this.#t)!==_o(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||_o(this.options.enabled,this.#t)!==_o(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return To(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(po)),t}#h(e){return!zo()&&_o(this.options.enabled,this.#t)!==!1&&ho(e)}#g(){this.#b();let e=_o(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=go(this.#r.dataUpdatedAt,e)+1;this.#u=lo.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return _o(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=lo.setInterval(()=>{(this.options.refetchIntervalInBackground||Vo.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(lo.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(lo.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&as(e,t),o=i&&ss(e,n,t,r);(a||o)&&(l={...l,...es(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=Ao(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=Ao(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=i?.error===f?i.errorUpdatedAt:Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:cs(e,t),refetch:this.refetch,isEnabled:_o(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),To(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size||this.options.throwOnError&&this.#r.error!==e.error)return!0;for(let t of n??this.#p)if(this.#r[t]!==e[t])return!0;return!1})();F.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function is(e,t){return _o(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||_o(t.retryOnMount,e)!==!1)}function as(e,t){return is(e,t)||e.state.data!==void 0&&os(e,t,t.refetchOnMount)}function os(e,t,n){if(_o(t.enabled,e)!==!1&&_o(t.staleTime,e)!==`static`){let r=_o(n,e);return r===`always`||r!==!1&&cs(e,t)}return!1}function ss(e,t,n,r){return(e!==t||_o(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&cs(e,n)}function cs(e,t){return _o(t.enabled,e)!==!1&&e.isStaleByTime(_o(t.staleTime,e))}var ls=class extends rs{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Zo(t,n.data),hasPreviousPage:Qo(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},us=class extends L{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ds(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=I({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}this.state.isPaused&&r.canStart()&&t();let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),F.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function ds(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var fs=class extends Bo{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new us({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=ps(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=ps(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=ps(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=ps(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){F.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>yo(t,e))}findAll(e={}){return this.getAll().filter(t=>yo(e,t))}notify(e){F.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return F.batch(()=>Promise.all(e.map(e=>e.continue().catch(po))))}};function ps(e){return e.options.scope?.id}var ms=class extends Bo{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),To(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&xo(t.mutationKey)!==xo(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??ds();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){F.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},hs=class extends Bo{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??bo(r,t),a=this.get(i);return a||(a=new $o({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){F.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>vo(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>vo(e,t)):t}notify(e){F.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){F.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){F.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},gs=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new hs,this.#t=e.mutationCache||new fs,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Vo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Wo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(_o(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=mo(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return F.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;F.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return F.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=F.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(po).catch(po)}invalidateQueries(e,t={}){return F.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=F.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n),r=e.state.fetchStatus===`paused`;return(!n.throwOnError||r)&&(t=t.catch(po)),r?Promise.resolve():t}));return Promise.all(r).then(po)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(_o(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(_o(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(po).catch(po)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(po).catch(po)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Wo.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(xo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{So(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(xo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{So(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=bo(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===No&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},_s=T.createContext(!1),vs=()=>T.useContext(_s);_s.Provider;function ys(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var bs=T.createContext(ys()),xs=()=>T.useContext(bs),Ss=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?Fo(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Cs=e=>{T.useEffect(()=>{e.clearReset()},[e])},ws=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Fo(n,[e.error,r])),Ts=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Es=(e,t)=>e?.suspense&&t.isPending,Ds=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Os(e,t,n){let r=vs(),i=xs(),a=oo(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Ts(o),Ss(o,i,s),Cs(i);let[l]=T.useState(()=>new t(a,o)),u=l.getOptimisticResult(o);T.useEffect(()=>{l.setOptions(o)},[o,l]);let d=!r&&c;if(T.useSyncExternalStore(T.useCallback(e=>{let t=d?l.subscribe(F.batchCalls(e)):po;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Es(o,u))throw Ds(o,l,i);if(ws({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function ks(e,t){return Os(e,rs,t)}function As(e,t){let n=oo(t),[r]=T.useState(()=>new ms(n,e));T.useEffect(()=>{r.setOptions(e)},[r,e]);let i=T.useSyncExternalStore(T.useCallback(e=>r.subscribe(F.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=T.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(po)},[r]);if(i.error&&Fo(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function js(e,t){return Os(e,ls,t)}var Ms={neutral:`bg-hover text-muted`,success:`bg-success/15 text-success-text`,danger:`bg-danger/15 text-danger-text`,warning:`border border-warning-line bg-warning-bg text-warning-text`};function Ns({tone:e,children:t}){return(0,j.jsx)(`span`,{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${Ms[e]}`,children:t})}function Ps({label:e,error:t,hint:n,hideLabel:r,...i}){let{id:a,errorId:o,hintId:s,aria:c}=S({error:t,hint:n});return(0,j.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`input`,{type:`checkbox`,...i,...c,className:`size-4 shrink-0 appearance-none rounded-[4px] border border-field-line bg-field bg-center bg-no-repeat checked:border-accent checked:bg-accent checked:bg-[url(data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2016%2016%27%20fill=%27none%27%20stroke=%27white%27%20stroke-width=%272%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpath%20d=%27M3.5%208.5l3%203%206-7%27/%3E%3C/svg%3E)] forced-colors:appearance-auto disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus aria-[invalid=true]:outline-2 aria-[invalid=true]:outline-danger`}),(0,j.jsx)(`label`,{htmlFor:a,className:r?`sr-only`:`text-sm text-text`,children:e})]}),(0,j.jsx)(ee,{errorId:o,hintId:s,error:t,hint:n})]})}var Fs={name:`archive`,size:24,node:[[`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`}]]};Fs.node;var Is=_(Fs),Ls={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};Ls.node;var Rs=_(Ls),zs={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};zs.node;var Bs=_(zs),Vs={name:`at-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]};Vs.node;var Hs=_(Vs),Us={name:`braces`,size:24,node:[[`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`}]],aliases:[`curly-braces`]};Us.node;var Ws=_(Us),Gs={name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Gs.node;var Ks=_(Gs),qs={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};qs.node;var Js=_(qs),Ys={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Ys.node;var Xs=_(Ys),Zs={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Zs.node;var Qs=_(Zs),$s={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};$s.node;var ec=_($s),tc={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};tc.node;var nc=_(tc),rc={name:`circle-exclamation-point`,size:24,node:[[`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`}]],aliases:[`alert-circle`,`circle-alert`]};rc.node;var ic=_(rc),ac={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};ac.node;var oc=_(ac),sc={name:`copy`,size:24,node:[[`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`}]]};sc.node;var cc=_(sc),lc={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};lc.node;var uc=_(lc),dc={name:`ellipsis`,size:24,node:[[`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`}]],aliases:[`more-horizontal`]};dc.node;var fc=_(dc),pc={name:`eye`,size:24,node:[[`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`}]]};pc.node;var mc=_(pc),hc={name:`file-down`,size:24,node:[[`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:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`m9 15 3 3 3-3`,key:`1npd3o`}]]};hc.node;var gc=_(hc),_c={name:`file-text`,size:24,node:[[`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`}]]};_c.node;var vc=_(_c),yc={name:`file-up`,size:24,node:[[`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:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]};yc.node;var bc=_(yc),xc={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};xc.node;var Sc=_(xc),Cc={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};Cc.node;var wc=_(Cc),Tc={name:`hash`,size:24,node:[[`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`}]]};Tc.node;var Ec=_(Tc),Dc={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};Dc.node;var Oc=_(Dc),kc={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};kc.node;var Ac=_(kc),jc={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};jc.node;var Mc=_(jc),Nc={name:`link-2`,size:24,node:[[`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`}]]};Nc.node;var Pc=_(Nc),Fc={name:`lock`,size:24,node:[[`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`}]]};Fc.node;var Ic=_(Fc),Lc={name:`log-out`,size:24,node:[[`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`}]]};Lc.node;var Rc=_(Lc),zc={name:`mail`,size:24,node:[[`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`}]]};zc.node;var Bc=_(zc),Vc={name:`map-pin`,size:24,node:[[`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`}]]};Vc.node;var Hc=_(Vc),Uc={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};Uc.node;var Wc=_(Uc),Gc={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};Gc.node;var Kc=_(Gc),qc={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};qc.node;var Jc=_(qc),Yc={name:`power-off`,size:24,node:[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Yc.node;var Xc=_(Yc),Zc={name:`puzzle`,size:24,node:[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]};Zc.node;var Qc=_(Zc),$c={name:`scroll-text`,size:24,node:[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]};$c.node;var el=_($c),tl={name:`search-x`,size:24,node:[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]};tl.node;var nl=_(tl),rl={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};rl.node;var il=_(rl),al={name:`settings`,size:24,node:[[`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`}]]};al.node;var ol=_(al),sl={name:`shield`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]};sl.node;var cl=_(sl),ll={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};ll.node;var ul=_(ll),dl={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};dl.node;var fl=_(dl),pl={name:`toggle-left`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]};pl.node;var ml=_(pl),hl={name:`trash`,size:24,node:[[`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`}]],aliases:[`trash-2`]};hl.node;var gl=_(hl),_l={name:`triangle-exclamation-point`,size:24,node:[[`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`}]],aliases:[`alert-triangle`,`triangle-alert`]};_l.node;var vl=_(_l),yl={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};yl.node;var bl=_(yl),xl={name:`users`,size:24,node:[[`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`}]]};xl.node;var Sl=_(xl),Cl={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Cl.node;var R=_(Cl),wl=e(n(),1),Tl=[`body`,`footer`].flatMap(e=>[`input`,`select`,`textarea`,`button`].map(t=>`[data-part=${e}] ${t}:not([disabled])`)).join(`, `);function El(e){let t=(0,T.useRef)(null),n=(0,T.useRef)(null),r=(0,T.useId)(),i=()=>{n.current?.focus?.(),n.current=null};return(0,T.useEffect)(()=>{let r=t.current;r&&(e.open&&!r.open&&(n.current=document.activeElement,r.showModal(),r.contains(document.activeElement)||([...r.querySelectorAll(Tl)].find(e=>!e.closest(`[hidden]`))??r.querySelector(`[data-part=close]`))?.focus()),!e.open&&r.open&&(r.close(),i()))},[e.open]),(0,T.useEffect)(()=>i,[]),(0,wl.createPortal)((0,j.jsx)(`dialog`,{ref:t,"aria-labelledby":r,className:e.className,onSubmit:e=>e.stopPropagation(),onKeyDown:t=>{t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),e.onClose())},onClose:t=>{t.target===t.currentTarget&&(i(),e.open&&e.onClose())},children:e.open&&(0,j.jsxs)(`div`,{"data-part":`content`,children:[(0,j.jsxs)(`div`,{"data-part":`header`,children:[(0,j.jsx)(`h2`,{id:r,"data-part":`title`,children:e.title}),(0,j.jsx)(`button`,{type:`button`,"data-part":`close`,"aria-label":`Close`,onClick:e.onClose,children:e.closeIcon??`×`})]}),(0,j.jsx)(`div`,{"data-part":`body`,children:e.children}),e.footer&&(0,j.jsx)(`div`,{"data-part":`footer`,children:e.footer})]})}),document.body)}var Dl=a({base:[`border border-line bg-raised p-0 text-text shadow-overlay backdrop:bg-scrim`,`[&_[data-part=content]]:flex [&_[data-part=content]]:max-h-dvh [&_[data-part=content]]:flex-col`,`[&_[data-part=header]]:flex [&_[data-part=header]]:items-center [&_[data-part=header]]:justify-between [&_[data-part=header]]:gap-2 [&_[data-part=header]]:border-b [&_[data-part=header]]:border-line [&_[data-part=header]]:py-3 [&_[data-part=header]]:pl-4 [&_[data-part=header]]:pr-3`,`[&_[data-part=title]]:text-base [&_[data-part=title]]:font-semibold`,`[&_[data-part=close]]:inline-flex [&_[data-part=close]]:size-8 [&_[data-part=close]]:items-center [&_[data-part=close]]:justify-center [&_[data-part=close]]:rounded-control [&_[data-part=close]]:text-muted [&_[data-part=close]:hover]:bg-hover [&_[data-part=close]:hover]:text-text [&_[data-part=close]:focus-visible]:outline-2 [&_[data-part=close]:focus-visible]:outline-focus`,`[&_[data-part=body]]:flex-1 [&_[data-part=body]]:overflow-auto [&_[data-part=body]]:p-4`,`[&_[data-part=footer]]:flex [&_[data-part=footer]]:flex-wrap [&_[data-part=footer]]:justify-end [&_[data-part=footer]]:gap-2 [&_[data-part=footer]]:border-t [&_[data-part=footer]]:border-line [&_[data-part=footer]]:p-4`],variants:{variant:{center:`m-auto w-full max-w-lg rounded-base`,side:`ml-auto h-dvh max-h-dvh w-full max-w-xl [&_[data-part=content]]:h-full`},size:{md:``,lg:``}},compoundVariants:[{variant:`center`,size:`lg`,class:`max-w-3xl`}],defaultVariants:{variant:`center`,size:`md`}});function Ol({variant:e,size:t,...n}){return(0,j.jsx)(El,{...n,closeIcon:(0,j.jsx)(R,{size:15,strokeWidth:1.75,"aria-hidden":!0}),className:Dl({variant:e,size:t})})}function kl({label:e,error:t,hint:n,className:r,...i}){let a=S({error:t,hint:n});return(0,j.jsx)(c,{...a,label:e,error:t,hint:n,children:(0,j.jsx)(`input`,{type:`text`,...i,...a.aria,className:`${o} ${r??``}`})})}var Al=(0,T.createContext)(null);function jl({children:e}){let[t,n]=(0,T.useState)(null),[r,i]=(0,T.useState)(``),a=(0,T.useRef)(()=>{}),o=(0,T.useCallback)(e=>new Promise(t=>{a.current(!1),a.current=t,i(``),n(e)}),[]),s=e=>{a.current(e),n(null)},c=!!t?.typeToConfirm&&r!==t.typeToConfirm;return(0,j.jsxs)(Al.Provider,{value:o,children:[e,(0,j.jsxs)(Ol,{open:!!t,onClose:()=>s(!1),title:t?.title??``,footer:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(w,{onClick:()=>s(!1),children:t?.cancelLabel??`Cancel`}),(0,j.jsx)(w,{variant:t?.danger?`danger`:`primary`,disabled:c,onClick:()=>s(!0),children:t?.confirmLabel})]}),children:[(0,j.jsx)(`p`,{className:`text-sm text-text`,children:t?.message}),t?.typeToConfirm&&(0,j.jsx)(`div`,{className:`mt-3`,children:(0,j.jsx)(kl,{label:`Type "${t.typeToConfirm}" to confirm`,value:r,onChange:e=>i(e.target.value)})})]})]})}function Ml(){let e=(0,T.useContext)(Al);if(!e)throw Error(`ConfirmProvider is missing`);return e}var Nl={idle:`Copy`,copied:`Copied`,failed:`Could not copy`},Pl={idle:cc,copied:Js,failed:vl};function Fl({text:e,label:t=`Copy`,showLabel:n=!1}){let[r,i]=(0,T.useState)(`idle`),a=(0,T.useRef)(void 0);(0,T.useEffect)(()=>()=>clearTimeout(a.current),[]);let o=async()=>{let t=`copied`;try{await navigator.clipboard.writeText(e)}catch{t=`failed`}i(t),clearTimeout(a.current),a.current=setTimeout(()=>i(`idle`),2e3)},s=Pl[r];return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(f,{content:Nl[r],children:(0,j.jsx)(w,{variant:n?void 0:`ghost`,size:n?void 0:`sm`,"aria-label":n?void 0:t,onClick:o,icon:(0,j.jsx)(s,{size:15,strokeWidth:1.75,className:r===`failed`?`text-danger-text`:void 0}),children:n&&t})}),(0,j.jsx)(`span`,{role:`status`,className:`sr-only`,children:r===`idle`?``:Nl[r]})]})}function Il({title:e,icon:t,badge:n,defaultOpen:r=!1,open:i,onOpenChange:a,children:o}){let[s,c]=(0,T.useState)(r),l=i??s,u=()=>{c(!l),a?.(!l)},d=(0,T.useId)();return(0,j.jsxs)(`div`,{className:`rounded-base border border-line`,children:[(0,j.jsxs)(`button`,{type:`button`,"aria-expanded":l,"aria-controls":d,onClick:u,className:`flex w-full items-center gap-2 rounded-base px-3 py-2 text-left text-sm font-medium text-text hover:bg-hover focus-visible:outline-2 focus-visible:outline-focus`,children:[(0,j.jsx)(Qs,{size:15,strokeWidth:1.75,"aria-hidden":!0,className:`text-muted transition-transform duration-(--hb-duration) motion-reduce:transition-none ${l?`rotate-90`:``}`}),t,(0,j.jsx)(`span`,{children:e}),n!=null&&(0,j.jsx)(`span`,{className:`ml-auto`,children:n})]}),(0,j.jsx)(`div`,{id:d,hidden:!l,className:`border-t border-line p-3`,children:o})]})}function Ll({title:e,icon:t,children:n}){return(0,j.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-8 py-12 text-center text-sm text-muted`,children:[t&&(0,j.jsx)(`span`,{className:`mb-1 flex size-9 items-center justify-center rounded-full bg-hover text-muted`,children:t}),(0,j.jsx)(`p`,{className:`font-medium text-text`,children:e}),n]})}function Rl({label:e,error:t,hint:n,accept:r,multiple:i,disabled:a,name:o,onChange:s}){let l=S({error:t,hint:n}),u=(0,T.useRef)(null),[d,f]=(0,T.useState)([]),[p,m]=(0,T.useState)(!1),h=e=>{e.length!==0&&(f(e.map(e=>e.name)),s(e))};return(0,j.jsx)(c,{...l,label:e,error:t,hint:n,children:(0,j.jsxs)(`div`,{"data-testid":`file-drop`,onDragOver:e=>{e.preventDefault(),a||m(!0)},onDragLeave:()=>m(!1),onDrop:e=>{if(e.preventDefault(),m(!1),a)return;let t=[...e.dataTransfer.files];h(i?t:t.slice(0,1))},className:`flex items-center gap-3 rounded-control border border-dashed bg-surface p-3 text-sm has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-focus ${p?`border-accent`:`border-field-line`} ${a?`opacity-50`:``}`,children:[(0,j.jsx)(`input`,{ref:u,type:`file`,name:o,accept:r,multiple:i,disabled:a,...l.aria,className:`sr-only`,onChange:e=>{h([...e.target.files??[]]),e.target.value=``}}),(0,j.jsx)(w,{tabIndex:-1,disabled:a,onClick:()=>u.current?.click(),children:i?`Choose files`:`Choose file`}),(0,j.jsx)(`span`,{className:`min-w-0 truncate text-muted`,children:d.length>0?d.join(`, `):`or drop here`})]})})}function zl({label:e,error:t,hint:n,...r}){let i=S({error:t,hint:n}),a=[i.aria[`aria-describedby`],r[`aria-describedby`]].filter(Boolean).join(` `)||void 0;return(0,j.jsx)(c,{...i,label:e,error:t,hint:n,children:(0,j.jsx)(`input`,{type:`number`,...r,...i.aria,"aria-invalid":i.aria[`aria-invalid`]??r[`aria-invalid`],"aria-describedby":a,className:o})})}function Bl({title:e,children:t}){let n=(0,T.useId)();return(0,j.jsxs)(`section`,{"aria-labelledby":n,className:`flex flex-col gap-3`,children:[(0,j.jsx)(`h3`,{id:n,className:`text-sm font-semibold text-text`,children:e}),t]})}function Vl({label:e,error:t,hint:n,children:r,...i}){let a=S({error:t,hint:n});return(0,j.jsx)(c,{...a,label:e,error:t,hint:n,children:(0,j.jsxs)(`div`,{className:`relative`,children:[(0,j.jsx)(`select`,{...i,...a.aria,className:`${o} appearance-none pr-8`,children:r}),(0,j.jsx)(Xs,{size:15,strokeWidth:1.75,"aria-hidden":!0,className:`pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-muted`})]})})}function Hl({caption:e,stickyHeader:t,children:n}){return(0,j.jsx)(`div`,{className:`overflow-auto${t?` max-h-[calc(100dvh-12rem)]`:``}`,children:(0,j.jsxs)(`table`,{"data-sticky-header":t||void 0,className:`w-full border-collapse text-left text-sm${t?` [&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-surface`:``}`,children:[e&&(0,j.jsx)(`caption`,{className:`sr-only`,children:e}),n]})})}var Ul={asc:Bs,desc:Rs};function Wl({children:e,sort:t,onSort:n,align:r}){let i=t===`asc`?`ascending`:t===`desc`?`descending`:`none`,a=t?Ul[t]:ec;return(0,j.jsx)(`th`,{scope:`col`,"aria-sort":n?i:void 0,className:`border-b border-line px-3 py-2 text-xs font-medium text-muted${r===`right`?` text-right`:``}`,children:n?(0,j.jsxs)(`button`,{type:`button`,onClick:n,className:`inline-flex items-center gap-1 rounded font-medium hover:text-text focus-visible:outline-2 focus-visible:outline-focus`,children:[e,(0,j.jsx)(a,{size:13,strokeWidth:1.75,"aria-hidden":!0,className:t?`text-text`:`text-faint`})]}):e})}function Gl({children:e,wrap:t,fill:n,align:r}){let i=!t&&typeof e==`string`;return(0,j.jsx)(`td`,{title:i?e:void 0,className:`border-b border-line px-3 py-2 text-text${r===`right`?` text-right`:``}${n?` w-full max-w-0`:t?``:` max-w-xs whitespace-nowrap`}${i?` truncate`:``}`,children:e})}function Kl(e,t){return{tab:`${e}-tab-${t}`,panel:`${e}-panel-${t}`}}function ql(e){let t=(0,T.useId)(),n=e.id??t,r=(0,T.useRef)(null),i=e.tabs.filter(e=>!e.disabled),a=i.some(t=>t.value===e.value)?e.value:i[0]?.value,o=t=>{e.onChange(t),r.current?.querySelector(`[data-key="${CSS.escape(t)}"]`)?.focus()};return(0,j.jsx)(`div`,{ref:r,role:`tablist`,"aria-label":e.label,className:e.className,onKeyDown:t=>{if(!i.length)return;let n=i.findIndex(t=>t.value===e.value),r=n<=0?i.length-1:n-1,a=t.key===`ArrowRight`?i[(n+1)%i.length]:t.key===`ArrowLeft`?i[r]:t.key===`Home`?i[0]:t.key===`End`?i[i.length-1]:void 0;a&&(t.preventDefault(),o(a.value))},children:e.tabs.map(t=>{let r=t.value===e.value,i=Kl(n,t.value);return(0,j.jsx)(`button`,{id:i.tab,role:`tab`,type:`button`,"data-key":t.value,"aria-selected":r,"aria-controls":i.panel,"data-selected":r?``:void 0,disabled:t.disabled,tabIndex:t.value===a?0:-1,onClick:()=>e.onChange(t.value),children:t.label},t.value)})})}function Jl(e){return(0,j.jsx)(ql,{...e,className:`flex gap-1 border-b border-line [&_[role=tab]]:-mb-px [&_[role=tab]]:border-b-2 [&_[role=tab]]:border-transparent [&_[role=tab]]:px-3 [&_[role=tab]]:py-2 [&_[role=tab]]:text-sm [&_[role=tab]]:text-muted [&_[role=tab]]:transition-colors [&_[role=tab]]:duration-[var(--hb-duration)] motion-reduce:[&_[role=tab]]:transition-none [&_[role=tab]:disabled]:cursor-not-allowed [&_[role=tab]:disabled]:opacity-50 [&_[role=tab]:hover:not(:disabled)]:text-text [&_[role=tab]:focus-visible]:outline-2 [&_[role=tab]:focus-visible]:outline-focus [&_[role=tab][data-selected]]:border-accent [&_[role=tab][data-selected]]:font-medium [&_[role=tab][data-selected]]:text-text`})}var Yl=(0,T.createContext)(null);function Xl(e){let t=e.kind===`error`?ic:nc;return(0,j.jsxs)(`div`,{role:e.kind===`error`?`alert`:void 0,className:`${s} flex items-center gap-2 rounded-base px-3 py-2 text-sm text-text`,children:[(0,j.jsx)(t,{size:15,strokeWidth:1.75,className:e.kind===`error`?`text-danger-text`:`text-accent-text`}),e.message]},e.id)}function Zl({children:e}){let[t,n]=(0,T.useState)([]),r=(0,T.useRef)(1),i=(0,T.useCallback)((e,t)=>{let i=r.current++;n(n=>[...n,{id:i,kind:e,message:t}]),setTimeout(()=>n(e=>e.filter(e=>e.id!==i)),4e3)},[]),a=(0,T.useMemo)(()=>({success:e=>i(`success`,e),error:e=>i(`error`,e)}),[i]);return(0,j.jsxs)(Yl.Provider,{value:a,children:[e,(0,j.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`fixed right-4 bottom-4 z-50 flex flex-col gap-2`,children:t.map(Xl)})]})}function Ql(){let e=(0,T.useContext)(Yl);if(!e)throw Error(`ToastProvider is missing`);return e}function $l(e){let[t,n]=v(e.checked,e.defaultChecked??!1,e.onChange);return(0,j.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"aria-label":e.label,"aria-describedby":e[`aria-describedby`],"aria-invalid":e[`aria-invalid`],disabled:e.disabled,className:e.className,"data-checked":t?``:void 0,"data-disabled":e.disabled?``:void 0,onClick:()=>n(!t),children:(0,j.jsx)(`span`,{"data-thumb":``})})}function eu({label:e,error:t,hint:n,...r}){let{errorId:i,hintId:a,aria:o}=S({error:t,hint:n});return(0,j.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,j.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,j.jsx)($l,{...r,label:e,"aria-describedby":o[`aria-describedby`],"aria-invalid":o[`aria-invalid`],className:`relative h-5 w-9 shrink-0 rounded-full bg-control transition-colors duration-[var(--hb-duration)] motion-reduce:transition-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus aria-[invalid=true]:outline-2 aria-[invalid=true]:outline-danger disabled:opacity-50 data-[checked]:bg-accent [&>span]:absolute [&>span]:top-0.5 [&>span]:left-0.5 [&>span]:size-4 [&>span]:rounded-full [&>span]:bg-thumb [&>span]:transition-transform [&>span]:duration-[var(--hb-duration)] motion-reduce:[&>span]:transition-none data-[checked]:[&>span]:translate-x-4`}),(0,j.jsx)(`span`,{className:`text-sm text-text`,children:e})]}),(0,j.jsx)(ee,{errorId:i,hintId:a,error:t,hint:n})]})}function tu(e,t){let n=(0,T.useRef)(``),r=(0,T.useRef)(void 0),i=(0,T.useCallback)(i=>{let a=t.orientation===`horizontal`;if(!a&&i.key===`ArrowDown`||a&&i.key===`ArrowRight`){i.preventDefault(),e.next();return}if(!a&&i.key===`ArrowUp`||a&&i.key===`ArrowLeft`){i.preventDefault(),e.previous();return}if(i.key===`Home`){i.preventDefault(),e.first();return}if(i.key===`End`){i.preventDefault(),e.last();return}if((i.key===`Enter`||i.key===` `)&&e.activeKey){i.preventDefault(),t.onSelect?.(e.activeKey);return}if(i.key.length!==1||i.ctrlKey||i.metaKey||i.altKey)return;n.current+=i.key.toLocaleLowerCase(),clearTimeout(r.current),r.current=setTimeout(()=>{n.current=``},500);let o=e.enabledKeys,s=e.activeKey?o.indexOf(e.activeKey):-1;for(let r=1;r<=o.length;r++){let i=o[(s+r)%o.length];if(t.labels[i]?.toLocaleLowerCase().startsWith(n.current)){e.setActiveKey(i);break}}},[e,t]);return(0,T.useEffect)(()=>()=>clearTimeout(r.current),[]),{onKeyDown:i}}function nu(e){let[t,n]=(0,T.useState)(null),r=e.keys.filter(t=>!e.disabledKeys?.includes(t)),i=(0,T.useCallback)(()=>n(r[0]??null),[r.join(`\0`)]),a=(0,T.useCallback)(()=>n(r[r.length-1]??null),[r.join(`\0`)]),o=(0,T.useCallback)(e=>{if(!r.length){n(null);return}let i=r.indexOf(t);n(i===-1?e>0?r[0]:r[r.length-1]:r[(i+e+r.length)%r.length])},[t,r.join(`\0`)]);return{activeKey:t,enabledKeys:r,setActiveKey:n,first:i,last:a,next:(0,T.useCallback)(()=>o(1),[o]),previous:(0,T.useCallback)(()=>o(-1),[o])}}function ru(e){let t=h({}),n=(0,T.useId)(),r=e.trigger.props.id??`${n}-trigger`,i=(0,T.useRef)(null),a=x(i,e.trigger.props.ref),o=(0,T.useRef)(null),s=(0,T.useRef)(!1),c=e.items.filter(e=>`key`in e),u=nu({keys:c.map(e=>e.key),disabledKeys:c.filter(e=>e.disabled).map(e=>e.key)}),d=g(i,o,t.open),f=y(i,o,{open:t.open,placement:e.placement??`bottom-start`});p(o,{open:t.open,onDismiss:t.close,triggerRef:i});let m=n=>{t.close(),e.onAction(n)},_=tu(u,{orientation:`vertical`,labels:Object.fromEntries(c.map(e=>[e.key,e.label])),onSelect:m}),v=()=>{document.activeElement&&document.activeElement!==document.body||i.current?.focus()};(0,T.useEffect)(()=>{t.open&&u.activeKey&&o.current?.querySelector(`[data-key="${CSS.escape(u.activeKey)}"]`)?.focus()},[t.open,u.activeKey]),(0,T.useEffect)(()=>{!t.open&&s.current&&queueMicrotask(v),s.current=t.open},[t.open]);let b=c.find(e=>e.checked)?.key,S=e=>{b?u.setActiveKey(b):u[e](),t.setOpen(!0)},C=e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),S(e.key===`ArrowDown`?`first`:`last`))},w=e=>{e.key===`Tab`?t.close():_.onKeyDown(e)},ee=(0,T.cloneElement)(e.trigger,l(e.trigger.props,{ref:a,id:r,"aria-expanded":t.open,"aria-controls":t.open?n:void 0,"aria-haspopup":`menu`,onClick:()=>{t.open||(b?u.setActiveKey(b):u.first()),t.toggle()},onKeyDown:C}));return(0,j.jsxs)(j.Fragment,{children:[ee,d&&(0,wl.createPortal)((0,j.jsx)(`div`,{ref:o,id:n,role:`menu`,popover:`manual`,"aria-labelledby":r,className:e.className,style:f.style,onKeyDown:w,"data-open":``,"data-placement":f.placement,children:e.items.map((e,t)=>`separator`in e?(0,j.jsx)(`div`,{role:`separator`},`separator-${t}`):`heading`in e?(0,j.jsx)(`div`,{role:`presentation`,"data-heading":``,children:e.heading},`heading-${t}`):(0,j.jsxs)(`div`,{role:e.checked===void 0?`menuitem`:`menuitemradio`,"aria-checked":e.checked,"data-key":e.key,tabIndex:u.activeKey===e.key?0:-1,"aria-disabled":e.disabled||void 0,"data-disabled":e.disabled?``:void 0,"data-active":u.activeKey===e.key?``:void 0,"data-danger":e.danger?``:void 0,onClick:()=>!e.disabled&&m(e.key),onPointerMove:()=>!e.disabled&&u.setActiveKey(e.key),children:[e.icon,(0,j.jsx)(`span`,{children:e.label}),e.shortcut&&(0,j.jsx)(`kbd`,{children:e.shortcut})]},e.key))}),d)]})}var iu=a({base:[s,`z-50 min-w-44 rounded-base p-1 text-sm text-text outline-none`,`[&_[role^=menuitem]]:flex [&_[role^=menuitem]]:cursor-default [&_[role^=menuitem]]:items-center [&_[role^=menuitem]]:gap-2 [&_[role^=menuitem]]:rounded-control [&_[role^=menuitem]]:px-2.5 [&_[role^=menuitem]]:py-1.5 [&_[role^=menuitem]]:outline-none`,`[&_[role^=menuitem]>span]:flex-1 [&_kbd]:font-sans [&_kbd]:text-xs [&_kbd]:text-faint`,`[&_[data-active]]:bg-hover [&_[data-disabled]]:opacity-50`,`[&_[data-danger]]:text-danger-text [&_[data-danger][data-active]]:bg-danger/10`,`[&_[data-heading]]:px-2.5 [&_[data-heading]]:py-1 [&_[data-heading]]:text-xs [&_[data-heading]]:font-medium [&_[data-heading]]:text-faint`,`[&_[role=separator]]:my-1 [&_[role=separator]]:h-px [&_[role=separator]]:bg-line`]});function au({className:e,...t}){return(0,j.jsx)(ru,{...t,className:iu({className:e})})}var ou=(0,T.createContext)(null),su=(0,T.createContext)(null);function cu(){let e=(0,T.useContext)(su);if(!e)throw Error(`ExtensionsContext is missing`);return e}function z(){let e=(0,T.useContext)(ou);if(!e)throw Error(`ClientContext is missing`);return e}function lu(){return new gs({defaultOptions:{queries:{retry:!1},mutations:{retry:!1}}})}function B({client:e,queryClient:t,extensions:n,children:r}){return(0,j.jsx)(ou.Provider,{value:e,children:(0,j.jsx)(su.Provider,{value:n,children:(0,j.jsx)(so,{client:t,children:(0,j.jsx)(Zl,{children:(0,j.jsx)(jl,{children:r})})})})})}var uu=/^[a-z0-9-]+(\/[a-z0-9-]+)*$/;function du(){let e=[],t=[],n=!1,r=()=>{if(n)throw Error(`Dashboard extensions must be registered while extensions.js loads.`)};return{pages:e,links:t,api:n=>({client:n,addPage(t){if(r(),!uu.test(t.path))throw Error(`Invalid extension page path "${t.path}".`);if(e.some(e=>e.path===t.path))throw Error(`Extension page "${t.path}" is already registered.`);e.push(t)},addLink(e){r(),t.push(e)}}),freeze(){n=!0}}}function fu(e,t,n){return window.heybe={dashboard:e.api(t)},new Promise(e=>{let r=document.createElement(`script`);r.type=`module`,r.src=n??t.buildURL(`/_/extensions.js`),r.addEventListener(`load`,()=>e()),r.addEventListener(`error`,()=>{console.warn(`Failed to load dashboard extensions`),e()}),document.head.append(r)}).then(()=>e.freeze())}function pu(e){let{token:t,record:n}=e.authStore;return!!t&&!Ii(t,Date.now())&&n?.collectionName===`_superusers`}async function mu(e){try{return await e.auth(`_superusers`).refresh(),!0}catch(t){return t instanceof ma&&[401,403,404].includes(t.status)?(e.authStore.clear(),!1):!0}}function hu(e){e.client.authStore.clear(),e.queryClient.clear()}async function gu(e){try{let{data:t}=await e.health.check();return t.needsSetup===!0}catch{return}}var _u=async({context:e,location:t})=>{if(!pu(e.client))throw hu(e),await gu(e.client)?Ze({to:`/hbinstall`}):Ze({to:`/login`,search:{redirect:t.href}})},vu=({context:e})=>{if(pu(e.client))throw Ze({to:`/`});e.client.authStore.clear()},yu=async e=>{if(vu(e),await gu(e.context.client))throw Ze({to:`/hbinstall`})},bu=async e=>{if(vu(e),await gu(e.context.client)===!1)throw Ze({to:`/login`})};function xu(e){let t=e.trim(),n=t.match(/\/hbinstall\/([^/?#\s]+)/);return n?n[1]:t}function Su(e){return e&&/^\/(?![/\\])/.test(e)?e:`/collections`}function Cu(e,t){ro(e.client,()=>{let n=t.state.location.href;hu(e),t.navigate({to:`/login`,search:{redirect:n}})})}var wu=`https://github.com/emresandikci/heybe#readme`;function V({crumbs:e,actions:t,width:n=`form`,footer:r,children:i}){let a=`mx-auto w-full ${n===`form`?`max-w-240`:``}`;return(0,j.jsxs)(`div`,{className:`flex flex-1 flex-col gap-4`,children:[(0,j.jsxs)(`div`,{className:`${a} flex flex-1 flex-col gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,j.jsx)(`h1`,{className:`flex min-w-0 items-center text-lg font-semibold`,children:e.map((t,n)=>{let r=n===e.length-1;return(0,j.jsxs)(T.Fragment,{children:[n>0&&(0,j.jsx)(`span`,{className:`shrink-0 whitespace-pre text-faint`,children:` / `}),t.to&&!r?(0,j.jsx)(ni,{to:t.to,params:t.params,className:`shrink-0 rounded-control text-muted hover:text-text`,children:t.label}):(0,j.jsx)(`span`,{"aria-current":r?`page`:void 0,title:r?t.label:void 0,className:r?`min-w-0 truncate`:`shrink-0 text-muted`,children:t.label})]},n)})}),t&&(0,j.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:t})]}),i]}),(0,j.jsxs)(`footer`,{className:`${a} flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-t border-line pt-3 text-xs text-faint`,children:[(0,j.jsx)(`div`,{children:r}),(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(`a`,{href:wu,target:`_blank`,rel:`noreferrer`,className:`hover:text-text`,children:`Docs`}),(0,j.jsxs)(`span`,{children:[`Heybe v`,`1.6.0`]})]})]})]})}function Tu(){return(0,j.jsx)(V,{crumbs:[{label:`Page not found`}],children:(0,j.jsx)(Ll,{title:`This page does not exist.`,children:(0,j.jsx)(ni,{to:`/collections`,className:`text-accent-text hover:underline`,children:`Collections`})})})}var Eu=class{constructor(e,t){this.fn=e,this.options=t,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{let t=Date.now()-this.lastExecutionTime;if(this.options.leading&&t>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){let e=this.options.wait-t;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},e)}},this.execute=(...e)=>{this.fn(...e),this.options.onExecute?.(e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&=(clearTimeout(this.timeoutId),void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function Du(e,t){return new Eu(e,t).maybeExecute}var Ou=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{this.#c<this.#l?(this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{})):(this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop())};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e)this.debugLog(`Event bus client is disabled, not emitting event`,e,t);else if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d)this.debugLog(`Previously failed to connect, not emitting to bus`);else if(!this.#a)this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());else return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},ku=new class extends Ou{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}};function Au(e,t){return typeof e==`function`?e(t):e}function ju(e,t){return zu(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function Mu(e,t,n){let r=zu(t);function i(e){if(!r.length)return Au(n,e);let t=r.shift();if(typeof t==`string`||typeof t==`number`&&!Array.isArray(e))return typeof e==`object`?(e===null&&(e={}),{...e,[t]:i(e[t])}):{[t]:i()};if(Array.isArray(e)&&typeof t==`number`){let n=e.slice(0,t);return[...n.length?n:Array(t),i(e[t]),...e.slice(t+1)]}return[...Array(t),i()]}return i(e)}function Nu(e,t){let n=zu(t);function r(e){if(!e)return;if(n.length===1){let t=n[0];if(Array.isArray(e)&&typeof t==`number`)return e.filter((e,n)=>n!==t);let{[t]:r,...i}=e;return i}let t=n.shift();if((typeof t==`string`||typeof t==`number`&&!Array.isArray(e))&&typeof e==`object`)return{...e,[t]:r(e[t])};if(typeof t==`number`&&Array.isArray(e)){if(t>=e.length)return e;let n=e.slice(0,t);return[...n.length?n:Array(t),r(e[t]),...e.slice(t+1)]}throw Error(`It seems we have created an infinite loop in deleteBy. `)}return r(e)}var Pu=46,Fu=91,Iu=93,Lu=48,Ru=57;function zu(e){if(Array.isArray(e))return[...e];if(typeof e!=`string`)throw Error(`Path must be a string.`);let t=e.length,n=[],r=+(t>0&&e.charCodeAt(0)===Fu),i=!0,a=-1;for(let o=r;o<=t;o++){let s=o<t?e.charCodeAt(o):-1;if(o===t||s===Pu||s===Fu||s===Iu){let t=o-r;if(t>0){let a=i&&(t===1||e.charCodeAt(r)!==Lu),s=e.slice(r,o);if(a){let e=parseInt(s,10);t<=15||String(e)===s?n.push(e):n.push(s)}else n.push(s)}else a!==Iu&&(a!==-1||s!==Iu)&&(a!==s||s!==Pu&&s!==Fu)&&n.push(``);r=o+1,i=!0}else(s<Lu||s>Ru)&&(i=!1);a=s}return n.length||n.push(``),n}function Bu(e){return!(Array.isArray(e)&&e.length===0)}function Vu(e,t){return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!1},runValidation:e=>e.validators.filter(Boolean).map(e=>({cause:e.cause,validate:e.fn}))})}function Hu(e,t){let{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:r,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},o=n??0;return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!0},runValidation:t=>t.validators.filter(Boolean).map(t=>{let n=t?.cause||e,s=o;switch(n){case`change`:s=i??o;break;case`blur`:s=r??o;break;case`dynamic`:s=a??o;break;case`submit`:s=0}return e===`submit`&&(s=0),{cause:n,validate:t.fn,debounceMs:s}})})}var Uu=e=>!!e&&typeof e==`object`&&`fields`in e;function Wu(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||n.length===0&&!Array.isArray(e)&&!Array.isArray(t)&&(Object.getPrototypeOf(e)!==Object.prototype||Object.getPrototypeOf(t)!==Object.prototype))return!1;for(let i of n)if(!r.includes(i)||!Wu(e[i],t[i]))return!1;return!0}var Gu=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:`form`}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:`field`}:{newErrorValue:void 0,newSource:void 0},Ku=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function qu(e,t){return e==null?t:{...e,...t}}for(var Ju=256,Yu=[],Xu;Ju--;)Yu[Ju]=(Ju+256).toString(16).substring(1);function Zu(){let e=0,t,n=``;if(!Xu||Ju+16>256){for(Xu=Array(256),e=256;e--;)Xu[e]=256*Math.random()|0;e=0,Ju=0}for(;e<16;e++)t=Xu[Ju+e],n+=e===6?Yu[t&15|64]:e===8?Yu[t&63|128]:Yu[t],e&1&&e>1&&e<11&&(n+=`-`);return Ju++,n}var Qu=Du(e=>ku.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300});function $u(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++)t[n]=$u(e[n]);return t}if(e instanceof Map){let t=new Map;return e.forEach((e,n)=>{t.set(n,$u(e))}),t}if(e instanceof Set){let t=new Set;return e.forEach(e=>{t.add($u(e))}),t}let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=$u(e[n]));return t}function ed(e,t){return t===e||t.startsWith(`${e}.`)||t.startsWith(`${e}[`)}var td=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});let t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:`mount`},r={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:`change`},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:`blur`},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:`submit`},o=t?void 0:{fn:()=>void 0,cause:`server`};switch(e.event.type){case`mount`:return e.runValidation({validators:[n],form:e.form});case`submit`:return e.runValidation({validators:[r,i,a,o],form:e.form});case`server`:return e.runValidation({validators:[],form:e.form});case`blur`:return e.runValidation({validators:[i,o],form:e.form});case`change`:return e.runValidation({validators:[r,o],form:e.form});default:throw Error(`Unknown validation event type: ${e.event.type}`)}};function nd(e,t){let n=new Map;for(let r of e){let e=r.path??[],i=t,a=``;for(let t=0;t<e.length;t++){let n=e[t];if(n===void 0)continue;let r=typeof n==`object`?n.key:n,o=Number(r);a+=Array.isArray(i)&&!Number.isNaN(o)?`[${o}]`:(t>0?`.`:``)+String(r),i=typeof i==`object`&&i?i[r]:void 0}n.set(a,(n.get(a)??[]).concat(r))}return Object.fromEntries(n)}var rd=(e,t)=>{let n=nd(e,t);return{form:n,fields:n}},H={validate({value:e,validationSource:t},n){let r=n[`~standard`].validate(e);if(r instanceof Promise)throw Error(`async function passed to sync validator`);if(r.issues)return t===`field`?r.issues:rd(r.issues,e)},async validateAsync({value:e,validationSource:t},n){let r=await n[`~standard`].validate(e);if(r.issues)return t===`field`?r.issues:rd(r.issues,e)}},U=e=>!!e&&`~standard`in e,W={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{},_arrayVersion:0,_pendingValidationsCount:0};function G(e){function t(t){let n=e.getFieldMeta(t)??W;e.setFieldMeta(t,{...n,_arrayVersion:(n._arrayVersion||0)+1})}function n(n,r,i){t(n);let a=s(n,r,`move`,i),c=Math.min(r,i),u=Math.max(r,i);for(let e=c;e<=u;e++)a.push(o(n,e));let d=Object.keys(e.fieldInfo).reduce((t,i)=>(i.startsWith(o(n,r))&&t.set(i,e.getFieldMeta(i)),t),new Map);l(a,r<i?`up`:`down`),Object.keys(e.fieldInfo).filter(e=>e.startsWith(o(n,i))).forEach(t=>{let a=t.replace(o(n,i),o(n,r)),s=d.get(a);s&&e.setFieldMeta(t,s)})}function r(e,n){t(e),l(s(e,n,`remove`),`up`)}function i(n,r,i){t(n),s(n,r,`swap`,i).forEach(t=>{if(!t.toString().startsWith(o(n,r)))return;let a=t.toString().replace(o(n,r),o(n,i)),[s,c]=[e.getFieldMeta(t),e.getFieldMeta(a)];s&&e.setFieldMeta(a,s),c&&e.setFieldMeta(t,c)})}function a(n,r){t(n);let i=s(n,r,`insert`);l(i,`down`),i.forEach(t=>{t.toString().startsWith(o(n,r))&&e.setFieldMeta(t,u())})}function o(e,t){return`${e}[${t}]`}function s(t,n,r,i){let a=[o(t,n)];switch(r){case`swap`:a.push(o(t,i));break;case`move`:{let[e,r]=[Math.min(n,i),Math.max(n,i)];for(let n=e;n<=r;n++)a.push(o(t,n));break}default:{let r=e.getFieldValue(t),i=Array.isArray(r)?r.length:0;for(let e=n+1;e<i;e++)a.push(o(t,e));break}}return Object.keys(e.fieldInfo).filter(e=>a.some(t=>e.startsWith(t)))}function c(e,t){return e.replace(/\[(\d+)\]/,(e,n)=>{let r=parseInt(n,10);return`[${t===`up`?r+1:Math.max(0,r-1)}]`})}function l(t,n){(n===`up`?t:[...t].reverse()).forEach(t=>{let r=c(t.toString(),n),i=e.getFieldMeta(r);i?e.setFieldMeta(t,i):e.setFieldMeta(t,u())})}let u=()=>W;return{bumpArrayVersion:t,handleArrayMove:n,handleArrayRemove:r,handleArraySwap:i,handleArrayInsert:a}}function K(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},formGroupStateBase:e.formGroupStateBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}var id=class{constructor(e){this.options={},this.fieldInfo={},this.formGroupApis=new Set,this.mount=()=>{let e=this.store.subscribe(()=>{Qu(this)}),t=ku.on(`request-form-state`,e=>{e.payload.id===this._formId&&ku.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),n=ku.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),r=ku.on(`request-form-force-submit`,e=>{e.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),i=()=>{r(),n(),t(),e.unsubscribe(),ku.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:a}=this.options.validators||{};return ku.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}),a&&this.validateSync(`mount`),i},this.update=e=>{if(!e)return;let t=this.options;this.options=e;let n=e.defaultValues&&!Wu(e.defaultValues,t.defaultValues)&&!this.state.isTouched,r=!Wu(e.defaultState,t.defaultState)&&!this.state.isTouched;if(n||r){if(Sr(()=>{this.baseStore.setState(()=>K(Object.assign({},this.state,r?e.defaultState:{},n?{values:e.defaultValues}:{})))}),n){let e=G(this);for(let t of Object.keys(this.fieldInfo))Array.isArray(this.getFieldValue(t))&&e.bumpArrayVersion(t)}ku.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}},this.reset=(e,t)=>{let{fieldMeta:n}=this.state,r=this.resetFieldMeta(n);e&&!t?.keepDefaultValues&&(this.options={...this.options,defaultValues:e}),this.baseStore.setState(()=>{let t=e??this.options.defaultValues??this.options.defaultState?.values;return e||Object.values(this.fieldInfo).forEach(e=>{e.instance&&e.instance.options.defaultValue!==void 0&&(t=Mu(t,e.instance.name,e.instance.options.defaultValue))}),K({...this.options.defaultState,values:t,fieldMetaBase:r})})},this.validateAllFields=async e=>{let t=[];return Sr(()=>{Object.values(this.fieldInfo).forEach(n=>{if(!n.instance)return;let r=n.instance;t.push(Promise.resolve().then(()=>r.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.instance.store.state.meta.isTouched||n.instance.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null,a=[`${e}[${t}]`];for(let n=t+1;n<=(i??0);n++)a.push(`${e}[${n}]`);let o=Object.keys(this.fieldInfo).filter(e=>a.some(t=>e.startsWith(t))),s=[];return Sr(()=>{o.forEach(e=>{s.push(Promise.resolve().then(()=>this.validateField(e,n)))})}),(await Promise.all(s)).flat()},this.validateField=(e,t)=>{let n=this.fieldInfo[e]?.instance;if(!n){let{hasErrored:n}=this.validateSync(t);return n&&!this.options.asyncAlways?this.getFieldMeta(e)?.errors??[]:this.validateAsync(t).then(()=>this.getFieldMeta(e)?.errors??[])}return n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0})),n.validate(t)},this.validateSync=(e,t)=>{let n=Vu(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||td}),r=!1,i={};return Sr(()=>{for(let e of n){if(!e.validate)continue;let{formError:n,fieldErrors:a}=ad(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),o=od(e.cause),s=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(a||{})]);t?.filterFieldNames&&(s=new Set([...s].filter(t.filterFieldNames)));for(let e of s){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!a?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??W,r=a?.[e],{newErrorValue:s,newSource:c}=Gu({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[o]===`form`,previousErrorValue:t?.[o]});c===`form`&&(i[e]={...i[e],[o]:r}),t?.[o]!==s&&this.setFieldMeta(e,(e=W)=>({...e,errorMap:{...e.errorMap,[o]:s},errorSourceMap:{...e.errorSourceMap,[o]:c}}))}t?.dontUpdateFormErrorMap||this.state.errorMap?.[o]!==n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:n}})),(n||a)&&(r=!0)}if(t?.dontUpdateFormErrorMap)return;let a=od(`submit`);this.state.errorMap?.[a]&&e!==`submit`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:void 0}}));let o=od(`server`);this.state.errorMap?.[o]&&e!==`server`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:void 0}}))}),{hasErrored:r,fieldsErrorMap:i}},this.validateAsync=async(e,t)=>{let n=Hu(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||td});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let r=[],i;for(let e of n){if(!e.validate)continue;let n=od(e.cause);this.state.validationMetaMap[n]?.lastAbortController.abort();let a=new AbortController;this.state.validationMetaMap[n]={lastAbortController:a},r.push(new Promise(async n=>{let r;try{r=await new Promise((t,n)=>{setTimeout(async()=>{if(a.signal.aborted)return t(void 0);try{t(await this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`,signal:a.signal},type:`validateAsync`}))}catch(e){n(e)}},e.debounceMs)})}catch(e){r=e}let{formError:o,fieldErrors:s}=ad(r);s&&(i=i?{...i,...s}:s);let c=od(e.cause),l=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(i||{})]),u=Array.from(l);t?.filterFieldNames&&(u=u.filter(t.filterFieldNames));for(let e of u){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!i?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??W,r=i?.[e],{newErrorValue:a,newSource:o}=Gu({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[c]===`form`,previousErrorValue:t?.[c]});t?.[c]!==a&&this.setFieldMeta(e,(e=W)=>({...e,errorMap:{...e.errorMap,[c]:a},errorSourceMap:{...e.errorSourceMap,[c]:o}}))}t?.dontUpdateFormErrorMap||this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[c]:o}})),n(i?{fieldErrors:i,errorMapKey:c}:void 0)}))}let a=[],o={};if(r.length){a=await Promise.all(r);for(let e of a)if(e?.fieldErrors){let{errorMapKey:t}=e;for(let[n,r]of Object.entries(e.fieldErrors))o[n]={...o[n]||{},[t]:r}}}return this.baseStore.setState(e=>({...e,isFormValidating:!1})),o},this.validate=(e,t)=>{let{hasErrored:n,fieldsErrorMap:r}=this.validateSync(e,t);return n&&!this.options.asyncAlways?r:this.validateAsync(e,t)},this._handleSubmit=async e=>{this.baseStore.setState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),Sr(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance&&(e.instance.store.state.meta.isTouched||e.instance.setMeta(e=>({...e,isTouched:!0})))})});let t=e??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride&&this.baseStore.state.submissionAttempts<=1){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t});return}this.baseStore.setState(e=>({...e,isSubmitting:!0}));let n=()=>{this.baseStore.setState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.state.isFieldsValid)n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),ku.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validateAllFields`,errors:Object.values(this.state.fieldMeta).map(e=>e.errors).flat()});else if(await this.validate(`submit`),!this.state.isValid)n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),ku.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});else{Sr(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance?.triggerOnSubmitListener()})}),this.options.listeners?.onSubmit?.({formApi:this,meta:t});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:t}),Sr(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),ku.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),ku.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}}},this.getFieldValue=e=>ju(this.state.values,e),this.getFieldMeta=e=>this.state.fieldMeta[e],this.getFormGroupMeta=e=>this.formGroupMetaDerived.state[e],this.getFieldInfo=e=>this.fieldInfo[e]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(e,t)=>{this.baseStore.setState(n=>({...n,fieldMetaBase:{...n.fieldMetaBase,[e]:Au(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=W,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;Sr(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:Mu(n.values,e,t)}))}),i||this.getFieldInfo(e).instance?.triggerOnChangeListener(),a||this.validateField(e,`change`)},this.deleteField=e=>{let t=[...Object.keys(this.fieldInfo).filter(t=>{let n=e.toString();return t.startsWith(`${n}.`)||t.startsWith(`${n}[`)}),e];this.baseStore.setState(e=>{let n={...e};return t.forEach(e=>{n.values=Nu(n.values,e),delete this.fieldInfo[e],delete n.fieldMetaBase[e]}),n})},this.pushFieldValue=(e,t,n)=>{this.setFieldValue(e,e=>[...Array.isArray(e)?e:[],t],n),G(this).bumpArrayVersion(e)},this.insertFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>[...e.slice(0,t),n,...e.slice(t)],qu(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),G(this).handleArrayInsert(e,t),i||await this.validateArrayFieldsStartingFrom(e,t,`change`)},this.replaceFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>e.map((e,r)=>r===t?n:e),qu(r,{dontValidate:!0})),G(this).bumpArrayVersion(e),(r?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.removeFieldValue=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(e,e=>e.filter((e,n)=>n!==t),qu(n,{dontValidate:!0})),G(this).handleArrayRemove(e,t),i!==null){let t=`${e}[${i}]`;this.deleteField(t)}(n?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.swapFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=e[t],i=e[n];return Mu(Mu(e,`${t}`,i),`${n}`,r)},qu(r,{dontValidate:!0})),G(this).handleArraySwap(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.moveFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=[...e];return r.splice(n,0,r.splice(t,1)[0]),r},qu(r,{dontValidate:!0})),G(this).handleArrayMove(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.clearFieldValues=(e,t)=>{let n=this.getFieldValue(e),r=Array.isArray(n)?Math.max(n.length-1,0):null;if(this.setFieldValue(e,[],qu(t,{dontValidate:!0})),G(this).bumpArrayVersion(e),r!==null)for(let t=0;t<=r;t++){let n=`${e}[${t}]`;this.deleteField(n)}(t?.dontValidate??!1)||this.validateField(e,`change`)},this.resetField=e=>{this.baseStore.setState(t=>{let n=this.getFieldInfo(e).instance?.options.defaultValue,r=ju(this.options.defaultValues,e),i=n??r;return{...t,fieldMetaBase:{...t.fieldMetaBase,[e]:W},values:i===void 0?t.values:Mu(t.values,e,i)}})},this.setErrorMap=e=>{Sr(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(Uu(t)){let{formError:e,fieldErrors:r}=ad(t);for(let e of Object.keys(this.fieldInfo))this.getFieldMeta(e)&&this.setFieldMeta(e,t=>({...t,errorMap:{...t.errorMap,[n]:r?.[e]},errorSourceMap:{...t.errorSourceMap,[n]:`form`}}));this.baseStore.setState(t=>({...t,errorMap:{...t.errorMap,[n]:e}}))}else this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[n]:t}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((e,[t,n])=>(Object.keys(n).length&&n.errors.length&&(e[t]={errors:n.errors,errorMap:n.errorMap}),e),{})}),this.parseValuesWithSchema=e=>H.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>H.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??Zu(),this._devtoolsSubmissionOverride=!1;let t=K({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values});if(e?.transform){t=e.transform({state:t}).state;for(let e of Object.keys(t.errorMap)){let n=t.errorMap[e];if(n!==void 0&&Uu(n))for(let r of Object.keys(n.fields)){let i=n.fields[r];if(i===void 0)continue;let a=t.fieldMetaBase[r];t.fieldMetaBase[r]={isTouched:!1,isValidating:!1,isBlurred:!1,isDirty:!1,_arrayVersion:0,_pendingValidationsCount:0,...a??{},errorSourceMap:{...a?.errorSourceMap??{},onChange:`form`},errorMap:{...a?.errorMap??{},[e]:i}}}}}this.baseStore=kr(t);let n;this.fieldMetaDerived=kr(e=>{let t=this.baseStore.get(),r=0,i={};for(let a of Object.keys(t.fieldMetaBase)){let o=t.fieldMetaBase[a],s=n?.fieldMetaBase[a],c=e?.[a],l=ju(t.values,a),u=c?.errors;if(!s||o.errorMap!==s.errorMap){u=Object.values(o.errorMap??{}).filter(e=>e!==void 0);let e=this.getFieldInfo(a)?.instance;e&&e.options.disableErrorFlat||(u=u.flat(1))}let d=!Bu(u),f=!o.isDirty,p=Wu(l,this.getFieldInfo(a)?.instance?.options.defaultValue??ju(this.options.defaultValues,a));c&&c.isPristine===f&&c.isValid===d&&c.isDefaultValue===p&&c.errors===u&&o===s?(i[a]=c,r++):i[a]={...o,errors:u??[],isPristine:f,isValid:d,isDefaultValue:p}}return Object.keys(t.fieldMetaBase).length?e&&r===Object.keys(t.fieldMetaBase).length?e:(n=this.baseStore.get(),i):i}),this.formGroupMetaDerived=kr(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),r={};for(let i of this.formGroupApis){let a=i.name,o=t.formGroupStateBase[a]??{isSubmitted:!1,isSubmitting:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1},s=n[a],c=!1,l=!0,u=!1,d=!1,f=!0,p=!1;for(let e in n){if(e===a||!ed(a,e))continue;let t=n[e];t&&(t.isValidating&&(c=!0),t.isValid||(l=!1),t.isTouched&&(u=!0),t.isBlurred&&(d=!0),t.isDefaultValue||(f=!1),t.isDirty&&(p=!0))}let m=!p,h=!!c||o.isValidating,g=s?.errorMap??{},_=s?.errorSourceMap??{},v=!!(g.onMount||Object.entries(n).some(([e,t])=>t&&e!==a&&ed(a,e)&&t.errorMap.onMount)),y=e?.[a],b=y?.errors??[];y&&y.__srcErrorMap===g||(b=Object.values(g).reduce((e,t)=>{if(t===void 0)return e;if(t&&typeof t==`object`&&`fields`in t){let n=t.group;return n!==void 0&&e.push(n),e}return e.push(t),e},[]));let x=b.length===0,S=l&&x,C=i.options.canSubmitWhenInvalid??!1,w=o.submissionAttempts===0&&!u&&!v||!h&&!o.isSubmitting&&S||C;if(y&&y.errorMap===g&&y.errorSourceMap===_&&y.errors===b&&y.isFieldsValidating===c&&y.isFieldsValid===l&&y.isGroupValid===x&&y.isValid===S&&y.canSubmit===w&&y.isTouched===u&&y.isBlurred===d&&y.isPristine===m&&y.isDefaultValue===f&&y.isDirty===p&&y.isValidating===h&&y.isSubmitting===o.isSubmitting&&y.isSubmitted===o.isSubmitted&&y.submissionAttempts===o.submissionAttempts&&y.isSubmitSuccessful===o.isSubmitSuccessful){r[a]=y;continue}let ee={...o,errorMap:g,errorSourceMap:_,_arrayVersion:s?._arrayVersion??0,isTouched:u,isBlurred:d,isDirty:p,isPristine:m,isDefaultValue:f,isValid:S,errors:b,isValidating:h,isFieldsValidating:c,isFieldsValid:l,isGroupValid:x,canSubmit:w};Object.defineProperty(ee,"__srcErrorMap",{value:g,enumerable:!1,configurable:!0}),r[a]=ee}return r});let r;this.store=kr(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),i=Object.values(n).filter(Boolean),a=i.some(e=>e.isValidating),o=i.every(e=>e.isValid),s=i.some(e=>e.isTouched),c=i.some(e=>e.isBlurred),l=i.every(e=>e.isDefaultValue),u=s&&t.errorMap?.onMount,d=i.some(e=>e.isDirty),f=!d,p=!!(t.errorMap?.onMount||i.some(e=>e?.errorMap?.onMount)),m=!!a,h=e?.errors??[];r&&t.errorMap===r.errorMap||(h=Object.values(t.errorMap).reduce((e,t)=>t===void 0?e:t&&Uu(t)?(e.push(t.form),e):(e.push(t),e),[]));let g=h.length===0,_=o&&g,v=this.options.canSubmitWhenInvalid??!1,y=t.submissionAttempts===0&&!s&&!p||!m&&!t.isSubmitting&&_||v,b=t.errorMap;if(u&&(h=h.filter(e=>e!==t.errorMap.onMount),b=Object.assign(b,{onMount:void 0})),e&&r&&e.errorMap===b&&e.fieldMeta===this.fieldMetaDerived.state&&e.errors===h&&e.isFieldsValidating===a&&e.isFieldsValid===o&&e.isFormValid===g&&e.isValid===_&&e.canSubmit===y&&e.isTouched===s&&e.isBlurred===c&&e.isPristine===f&&e.isDefaultValue===l&&e.isDirty===d&&Wu(r,t))return e;let x={...t,errorMap:b,fieldMeta:this.fieldMetaDerived.state,errors:h,isFieldsValidating:a,isFieldsValid:o,isFormValid:g,isValid:_,canSubmit:y,isTouched:s,isBlurred:c,isPristine:f,isDefaultValue:l,isDirty:d};return r=this.baseStore.get(),x}),this.handleSubmit=this.handleSubmit.bind(this),this.update(e||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(e){return U(e.validate)?H[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function ad(e){return e?Uu(e)?{formError:ad(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function od(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}var sd=class e{constructor(t){this.options={},this.mount=()=>{this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});let e=this.getInfo();e.instance=this,this.update(this.options);let{onMount:t}=this.options.validators||{};if(t){let e=this.runValidator({validate:t,value:{value:this.state.value,fieldApi:this,validationSource:`field`},type:`validate`});e&&this.setMeta(t=>({...t,errorMap:{...t?.errorMap,onMount:e},errorSourceMap:{...t?.errorSourceMap,onMount:`field`}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);let e=this.form.fieldInfo[this.name];if(e&&e.instance===this){for(let[t,n]of Object.entries(e.validationMetaMap))n?.lastAbortController.abort(),e.validationMetaMap[t]=void 0;this.form.baseStore.setState(e=>({...e,fieldMetaBase:{...e.fieldMetaBase,[this.name]:{...W,isTouched:e.fieldMetaBase[this.name]?.isTouched??W.isTouched,isBlurred:e.fieldMetaBase[this.name]?.isBlurred??W.isBlurred,isDirty:e.fieldMetaBase[this.name]?.isDirty??W.isDirty}}})),e.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,fieldApi:this}),this.form.options.listeners?.onFieldUnmount?.({formApi:this.form,fieldApi:this})}}},this.update=e=>{this.options=e,this.name=e.name,this.state.meta.isTouched||this.options.defaultValue===void 0||Wu(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0}),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,qu(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,t)=>{this.form.pushFieldValue(this.name,e,qu(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,qu(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,qu(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,qu(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,qu(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,qu(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,qu(e,{dontRunListeners:!0})),e?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=t=>{let n=Object.values(this.form.fieldInfo),r=[];for(let i of n){if(!i.instance||!(i.instance instanceof e))continue;let{onChangeListenTo:n,onBlurListenTo:a}=i.instance.options.validators||{};t===`change`&&n?.includes(this.name)&&r.push(i.instance),t===`blur`&&a?.includes(this.name)&&r.push(i.instance)}return r},this.validateSync=(e,t)=>{let n=Vu(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||td}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=Vu(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||td});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;Sr(()=>{let e=(e,n)=>{let r=q(n.cause),a=n.validate?cd(e.runValidator({validate:n.validate,value:{value:e.store.state.value,validationSource:`field`,fieldApi:e},type:`validate`})):void 0,o=t[r],{newErrorValue:s,newSource:c}=Ku({formLevelError:o,fieldLevelError:a});e.state.meta.errorMap?.[r]!==s&&e.setMeta(e=>({...e,errorMap:{...e.errorMap,[r]:s},errorSourceMap:{...e.errorSourceMap,[r]:c}})),s&&(i=!0)};for(let t of n)e(this,t);for(let t of r)t.validate&&e(t.field,t)});let a=q(`submit`);return this.state.meta.errorMap?.[a]&&e!==`submit`&&!i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[a]:void 0},errorSourceMap:{...e.errorSourceMap,[a]:void 0}})),{hasErrored:i}},this.validateAsync=async(e,t)=>{let n=Hu(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||td}),r=await t,i=this.getLinkedFields(e).reduce((t,n)=>{let r=Hu(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||td});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),a=[],o=[],s=n.some(e=>e.validate),c=Array.from(new Set(i.filter(e=>e.validate).map(e=>e.field)));Sr(()=>{s&&this.startValidation();for(let e of c)e.startValidation()});let l=(e,t,n)=>{let i=q(t.cause),a=e.getInfo();a.validationMetaMap[i]?.lastAbortController.abort();let o=new AbortController;a.validationMetaMap[i]={lastAbortController:o},n.push(new Promise(async n=>{let a;try{a=await new Promise((n,r)=>{e.timeoutIds.validations[t.cause]&&(clearTimeout(e.timeoutIds.validations[t.cause]),e.endValidation()),e.timeoutIds.validations[t.cause]=setTimeout(async()=>{if(o.signal.aborted)return n(void 0);try{n(await this.runValidator({validate:t.validate,value:{value:e.store.state.value,fieldApi:e,signal:o.signal,validationSource:`field`},type:`validateAsync`}))}catch(e){r(e)}},t.debounceMs)})}catch(e){a=e}if(o.signal.aborted)return n(void 0);let s=cd(a),c=r[e.name]?.[i],{newErrorValue:l,newSource:u}=Ku({formLevelError:c,fieldLevelError:s});if(e.getInfo().instance!==e)return n(void 0);e.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:l},errorSourceMap:{...e.errorSourceMap,[i]:u}})),n(l)}))};for(let e of n)e.validate&&l(this,e,a);for(let e of i)e.validate&&l(e.field,e,o);let u=[];return(a.length||o.length)&&(u=await Promise.all(a),await Promise.all(o)),Sr(()=>{s&&this.endValidation();for(let e of c)e.endValidation()}),u.filter(Boolean)},this.validate=(e,t)=>{if(!this.state.meta.isTouched)return[];let n=t?.skipGroupValidation?[]:Array.from(this.form.formGroupApis).filter(e=>this.name.startsWith(e.name)),r=(t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e)).fieldsErrorMap[this.name]??{};if(!t?.skipFormValidation)for(let t of n){if(t.state.meta.submissionAttempts===0)continue;let{fieldsErrorMap:n}=this.form.validateSync(e,{group:t,dontUpdateFormErrorMap:!0,filterFieldNames:e=>ed(t.name,e)});r={...r,...n[this.name]??{}}}let{hasErrored:i}=this.validateSync(e,r),a=new WeakMap;for(let t of n){let{hasErrored:n}=t.validateSync(e,{},{skipRelatedFieldValidation:!0});a.set(t,n)}if(i&&!this.options.asyncAlways){this.getInfo().validationMetaMap[q(e)]?.lastAbortController.abort();let t=[];for(let r of n)r.getInfo().validationMetaMap[q(e)]?.lastAbortController.abort(),t.push(r.state.meta.errors);return[...this.state.meta.errors,...t.flat()]}let o=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e),s=this.validateAsync(e,o),c=[];for(let t of n)(!a.get(t)||t.options.asyncAlways)&&c.push(t.validateAsync(e,o,{skipRelatedFieldValidation:!0}));return c.length===0?s:Promise.all([s,...c]).then(e=>e.flat())},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(e=>({...e,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(e=>({...e,isBlurred:!0})),this.validate(`blur`),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(t=>({...t,errorMap:{...t.errorMap,...e}}))},this.parseValueWithSchema=e=>H.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>H.validateAsync({value:this.state.value,validationSource:`field`},e),this.triggerOnBlurListener=()=>{let e=this.form.options.listeners?.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this});for(let e of this.form.formGroupApis)ed(e.name,this.name)&&e.triggerOnChangeListener()},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,fieldApi:this})},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=kr(e=>{this.form.store.get();let n=this.form.getFieldMeta(this.name)??{...W,...t.defaultMeta},r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Wu(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}})}get state(){return this.store.state}runValidator(e){return U(e.validate)?H[e.type](e.value,e.validate):e.validate(e.value)}startValidation(){this.setMeta(e=>{let t=e._pendingValidationsCount+1;return{...e,_pendingValidationsCount:t,isValidating:t>0&&!e.isValidating||e.isValidating}})}endValidation(){this.setMeta(e=>{let t=Math.max(0,e._pendingValidationsCount-1);return{...e,_pendingValidationsCount:t,isValidating:t===0&&e.isValidating?!1:e.isValidating}})}};function cd(e){if(e)return e}function q(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function ld(e){return{isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1}}function ud(e){return{...W,...e,errors:[],isPristine:!0,isValid:!0,isDefaultValue:!0,isFieldsValidating:!1,isFieldsValid:!0,isGroupValid:!0,canSubmit:!0,isSubmitting:!1,isSubmitted:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1}}var dd=class e{constructor(t){this.options={},this.setFormGroupState=e=>{this.form.baseStore.setState(t=>{let n=t.formGroupStateBase[this.name]??ld({});return{...t,formGroupStateBase:{...t.formGroupStateBase,[this.name]:e(n)}}})},this._lastDistributedFieldNames={},this.update=e=>{this.options=e,this.name=e.name,this.state.meta.isTouched||this.options.defaultValue===void 0||Wu(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0}),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,{...W,...this.options.defaultMeta})},this.mount=()=>{this.update(this.options),this.form.formGroupApis.add(this),this.fieldInfo.instance=this,this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:e.formGroupStateBase[this.name]??ld({...this.options.defaultState})}}));let{onMount:e}=this.options.validators||{};if(e){let t=this.runValidator({validate:e,value:{value:this.state.value,groupApi:this,validationSource:`form`},type:`validate`}),n=t,r;pd(t)&&(n=t.group,r=t.fields);let i=fd(n);i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,onMount:i},errorSourceMap:{...e.errorSourceMap,onMount:`field`}})),this.distributeFieldErrors(`onMount`,r)}return this.options.listeners?.onMount?.({value:this.state.value,groupApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);if(this.fieldInfo.instance===this){for(let[e,t]of Object.entries(this.fieldInfo.validationMetaMap))t?.lastAbortController.abort(),this.fieldInfo.validationMetaMap[e]=void 0;this.form.formGroupApis.delete(this),this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:ld({})}})),this.fieldInfo.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,groupApi:this})}}},this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,qu(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.fieldInfo,this.getRelatedFields=()=>{let e=Object.values(this.form.fieldInfo),t=[];for(let n of e)n.instance&&n.instance instanceof sd&&n.instance.name.startsWith(this.name)&&t.push(n.instance);return t},this.getRelatedFieldMetasDerived=()=>{let e=Object.entries(this.form.fieldMetaDerived.state),t=[];for(let[n,r]of e)n!==this.name&&ed(this.name,n)&&t.push({...r,name:n});return t},this.buildChildFieldName=e=>e===``?this.name:e.startsWith(`[`)?`${this.name}${e}`:`${this.name}.${e}`,this.distributeFieldErrors=(e,t)=>{let n=this._lastDistributedFieldNames[e]??new Set,r=new Set;if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&r.add(this.buildChildFieldName(e));let i=new Set([...n,...r]),a=!1;for(let n of i){let r=n.startsWith(this.name+`[`)?n.slice(this.name.length):n.slice(this.name.length+1),i=t?.[r],o=this.form.getFieldMeta(n);if(!o&&!i)continue;let s=o?.errorMap[e],{newErrorValue:c,newSource:l}=Gu({newFormValidatorError:i,isPreviousErrorFromFormValidator:o?.errorSourceMap[e]===`form`,previousErrorValue:s});c&&(a=!0),(s!==c||o?.errorSourceMap[e]!==l)&&this.form.setFieldMeta(n,(t=W)=>({...t,errorMap:{...t.errorMap,[e]:c},errorSourceMap:{...t.errorSourceMap,[e]:l}}))}return this._lastDistributedFieldNames[e]=r,a},this.validateSync=(t,n,r={})=>{let i=Vu(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||td}),a=(r.skipRelatedFieldValidation?[]:this.getRelatedFields()).reduce((e,n)=>{let r=Vu(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||td});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),o=!1;Sr(()=>{let t=(t,r)=>{let i=hd(r.cause),a=t===this,s;r.validate&&(s=t.runValidator({validate:r.validate,value:{value:t.store.state.value,validationSource:a?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validate`}));let c=s,l;a&&pd(s)&&(c=s.group,l=s.fields);let u=fd(c),d=n[i],{newErrorValue:f,newSource:p}=Ku({formLevelError:d,fieldLevelError:u});t.state.meta.errorMap?.[i]!==f&&t.setMeta(e=>({...e,errorMap:{...e.errorMap,[i]:f},errorSourceMap:{...e.errorSourceMap,[i]:p}})),f&&(o=!0),a&&this.distributeFieldErrors(i,l)&&(o=!0)};for(let e of i)t(this,e);for(let e of a)e.validate&&t(e.field,e)});let s=hd(`submit`);return this.state.meta.errorMap?.[s]&&t!==`submit`&&!o&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[s]:void 0},errorSourceMap:{...e.errorSourceMap,[s]:void 0}})),{hasErrored:o}},this.validateAsync=async(t,n,r={})=>{let i=Hu(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||td}),a=await n,o=r.skipRelatedFieldValidation?[]:this.getRelatedFields(),s=o.reduce((e,n)=>{let r=Hu(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||td});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),c=[],l=[],u=i.some(e=>e.validate)||s.some(e=>e.validate);if(u){this.state.meta.isValidating||this.setMeta(e=>({...e,isValidating:!0}));for(let e of o)e.setMeta(e=>({...e,isValidating:!0}))}let d=(t,n,r)=>{let i=hd(n.cause),o=t.getInfo();o.validationMetaMap[i]?.lastAbortController.abort();let s=new AbortController;o.validationMetaMap[i]={lastAbortController:s};let c=t===this;r.push(new Promise(async r=>{let o;try{o=await new Promise((r,i)=>{t.timeoutIds.validations[n.cause]&&clearTimeout(t.timeoutIds.validations[n.cause]),t.timeoutIds.validations[n.cause]=setTimeout(async()=>{if(s.signal.aborted)return r(void 0);try{r(await this.runValidator({validate:n.validate,value:{value:t.store.state.value,signal:s.signal,validationSource:c?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validateAsync`}))}catch(e){i(e)}},n.debounceMs)})}catch(e){o=e}if(s.signal.aborted)return r(void 0);let l=o,u;c&&pd(o)&&(l=o.group,u=o.fields);let d=fd(l),f=a[t.name]?.[i],{newErrorValue:p,newSource:m}=Ku({formLevelError:f,fieldLevelError:d});if(t.getInfo().instance!==t)return r(void 0);t.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:p},errorSourceMap:{...e.errorSourceMap,[i]:m}})),c&&this.distributeFieldErrors(i,u),r(p)}))};for(let e of i)e.validate&&d(this,e,c);for(let e of s)e.validate&&d(e.field,e,l);let f=[];if((c.length||l.length)&&(f=await Promise.all(c),await Promise.all(l)),u){this.setMeta(e=>({...e,isValidating:!1}));for(let e of o)e.setMeta(e=>({...e,isValidating:!1}))}return f.filter(Boolean)},this.validateAllFields=async e=>{let t=[];return Sr(()=>{Object.values(this.getRelatedFields()).forEach(n=>{t.push(Promise.resolve().then(()=>n.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=(e,t,n)=>this.form.validateArrayFieldsStartingFrom(e,t,n),this.validateField=(e,t)=>this.form.validateField(e,t),this.getFieldValue=e=>this.form.getFieldValue(e),this.getFieldMeta=e=>this.form.getFieldMeta(e),this.setFieldMeta=(e,t)=>this.form.setFieldMeta(e,t),this.setFieldValue=(e,t)=>this.form.setFieldValue(e,t),this.deleteField=e=>this.form.deleteField(e),this.pushFieldValue=(e,t)=>this.form.pushFieldValue(e,t),this.insertFieldValue=(e,t,n)=>this.form.insertFieldValue(e,t,n),this.replaceFieldValue=(e,t,n)=>this.form.replaceFieldValue(e,t,n),this.swapFieldValues=(e,t,n)=>this.form.swapFieldValues(e,t,n),this.moveFieldValues=(e,t,n)=>this.form.moveFieldValues(e,t,n),this.clearFieldValues=e=>this.form.clearFieldValues(e),this.resetField=e=>this.form.resetField(e),this.removeFieldValue=(e,t)=>this.form.removeFieldValue(e,t),this.areRelatedFieldsValid=()=>Object.values(this.getRelatedFields()).every(e=>e.state.meta.isValid),this.validate=(e,t)=>{let{fieldsErrorMap:n}=t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>ed(this.name,e)}),{hasErrored:r}=this.validateSync(e,n[this.name]??{},{skipRelatedFieldValidation:t?.skipRelatedFieldValidation});if(r&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[hd(e)]?.lastAbortController.abort(),this.state.meta.errors;let i=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>ed(this.name,e)});return this.validateAsync(e,i,{skipRelatedFieldValidation:t?.skipRelatedFieldValidation})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeGroupDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this})},e)):this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,groupApi:this})},this._handleSubmit=async e=>{this.setFormGroupState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),Sr(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.state.meta.isTouched||e.setMeta(e=>({...e,isTouched:!0}))})});let t=e??this.options.onSubmitMeta;this.setFormGroupState(e=>({...e,isSubmitting:!0}));let n=()=>{this.setFormGroupState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.areRelatedFieldsValid())n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});else if(await this.validate(`submit`,{skipRelatedFieldValidation:!0}),!this.areRelatedFieldsValid()||!this.state.meta.isValid)n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});else{Sr(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.options.listeners?.onGroupSubmit?.({value:e.state.value,fieldApi:e})})}),this.options.listeners?.onSubmit?.({groupApi:this,value:this.state.value});try{await this.options.onGroupSubmit?.({value:this.state.value,groupApi:this,meta:t}),Sr(()=>{this.setFormGroupState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),n()})}catch(e){throw this.setFormGroupState(e=>({...e,isSubmitSuccessful:!1})),n(),e}}},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.fieldInfo={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.store=kr(e=>{this.form.formGroupMetaDerived.get(),this.form.baseStore.get();let n=this.form.getFormGroupMeta(this.name)??ud(t.defaultMeta),r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Wu(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}}),this.handleSubmit=this.handleSubmit.bind(this)}get state(){return this.store.state}runValidator(e){if(U(e.validate)){let t=H[e.type](e.value,e.validate);return e.type===`validate`?md(t):t.then(md)}return e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function fd(e){if(e)return e}function pd(e){return!!e&&typeof e==`object`&&`fields`in e}function md(e){if(!e||typeof e!=`object`||!(`form`in e)&&!(`fields`in e))return e;let{form:t,fields:n,...r}=e;return{...r,group:t,fields:n}}function hd(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function gd(e,t){if(!t)return;let n=Object.assign({},e,{state:$u(e.state)});t(n),n.fieldInfo!==e.fieldInfo&&(e.fieldInfo=n.fieldInfo),n.options!==e.options&&(e.options=n.options);let r=Object.keys({values:null,validationMetaMap:null,fieldMetaBase:null,formGroupStateBase:null,isSubmitting:null,isSubmitted:null,isValidating:null,submissionAttempts:null,isSubmitSuccessful:null,_force_re_eval:null}).reduce((t,r)=>(e.state[r]!==n.state[r]&&(t[r]=n.state[r]),t),{});return Sr(()=>{Object.keys(r).length&&e.baseStore.setState(e=>({...e,...r})),n.state.errorMap!==e.state.errorMap&&e.setErrorMap(n.state.errorMap)}),n}var _d=typeof window<`u`?T.useLayoutEffect:T.useEffect;function vd(e){let[t,n]=(0,T.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,T.useState)(()=>new sd({...e})),a=r;(t.form!==e.form||t.name!==e.name)&&(a=new sd({...e}),i(a),n({form:e.form,name:e.name}));let o=M(a.store,e.mode===`array`?e=>e.meta._arrayVersion||0:e=>e.value),s=M(a.store,e=>e.meta.isTouched),c=M(a.store,e=>e.meta.isBlurred),l=M(a.store,e=>e.meta.isDirty),u=M(a.store,e=>e.meta.errorMap),d=M(a.store,e=>e.meta.errorSourceMap),f=M(a.store,e=>e.meta.isValidating),p=(0,T.useMemo)(()=>({...a,get state(){return{value:e.mode===`array`?a.state.value:o,get meta(){return{...a.state.meta,isTouched:s,isBlurred:c,isDirty:l,errorMap:u,errorSourceMap:d,isValidating:f}}}}}),[a,e.mode,o,s,c,l,u,d,f]);return _d(a.mount,[a]),_d(()=>{a.update(e)}),p}var yd=(({children:e,...t})=>{let n=vd(t),r=(0,T.useMemo)(()=>Au(e,n),[e,n]);return(0,j.jsx)(j.Fragment,{children:r})});function bd(){return(0,T.useState)(()=>Zu())[0]}var xd=T,Sd=`19.3.1`.split(`.`)[0]===`17`?bd:xd.useId;function Cd(e){let[t,n]=(0,T.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,T.useState)(()=>new dd({...e}));(t.form!==e.form||t.name!==e.name)&&(i(new dd({...e})),n({form:e.form,name:e.name}));let a=M(r.store,e=>e.value),o=M(r.store,e=>e.meta.isTouched),s=M(r.store,e=>e.meta.isBlurred),c=M(r.store,e=>e.meta.isDirty),l=M(r.store,e=>e.meta.errorMap),u=M(r.store,e=>e.meta.errorSourceMap),d=M(r.store,e=>e.meta.isValidating),f=M(r.store,e=>e.meta.isSubmitting),p=M(r.store,e=>e.meta.isSubmitted),m=M(r.store,e=>e.meta.submissionAttempts),h=M(r.store,e=>e.meta.isSubmitSuccessful),g=M(r.store,e=>e.meta.canSubmit),_=M(r.store,e=>e.meta.isValid),v=M(r.store,e=>e.meta.isFieldsValid),y=M(r.store,e=>e.meta.isFieldsValidating),b=M(r.store,e=>e.meta.isGroupValid),x=(0,T.useMemo)(()=>({...r,handleSubmit:((...e)=>r._handleSubmit(...e)),get state(){return{...r.state,value:a,get meta(){return{...r.state.meta,isTouched:o,isBlurred:s,isDirty:c,errorMap:l,errorSourceMap:u,isValidating:d,isSubmitting:f,isSubmitted:p,submissionAttempts:m,isSubmitSuccessful:h,canSubmit:g,isValid:_,isFieldsValid:v,isFieldsValidating:y,isGroupValid:b}}}}}),[r,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b]);return _d(r.mount,[r]),_d(()=>{r.update(e)}),x}var wd=(({children:e,...t})=>{let n=Cd(t),r=(0,T.useMemo)(()=>Au(e,n),[e,n]);return(0,j.jsx)(j.Fragment,{children:r})});function Td({form:e,selector:t=e=>e,children:n}){let r=M(e.store,t);return(0,j.jsx)(j.Fragment,{children:Au(n,r)})}function Ed(e){let t=Sd(),[n,r]=(0,T.useState)(e?.formId),[i,a]=(0,T.useState)(()=>new id({...e,formId:e?.formId??t}));if(n!==e?.formId){let n=e?.formId??t;a(new id({...e,formId:n})),r(n)}let o=(0,T.useMemo)(()=>{let e={...i,handleSubmit:((...e)=>i._handleSubmit(...e)),get formId(){return i._formId},get state(){return i.store.state}};return e.Field=function(e){return(0,j.jsx)(yd,{...e,form:i})},e.FormGroup=function(e){return(0,j.jsx)(wd,{...e,form:i})},e.Subscribe=function(e){return(0,j.jsx)(Td,{form:i,selector:e.selector,children:e.children})},e},[i]);_d(i.mount,[]),_d(()=>{i.update(e)});let s=(0,T.useRef)(!1);return _d(()=>{s.current&&e?.transform&&gd(i,e.transform)},[i,e?.transform]),_d(()=>{s.current=!0}),o}function J(e){let t=e?.response;return typeof t?.message==`string`&&t.message?t.message:e instanceof Error&&e.message?e.message:`Something went wrong.`}function Dd(e){return e?.status===400?`Invalid filter. Check the syntax and field names.`:J(e)}function Od(e,t=``){let n={};if(typeof e!=`object`||!e)return n;let r=e;if(typeof r.message==`string`&&t)return n[t]=r.message,n;for(let[e,i]of Object.entries(r))Object.assign(n,Od(i,t?`${t}.${e}`:e));return n}var kd=(0,T.createContext)(null),Ad=e=>e?.response?.data;function jd({error:e,children:t}){let n=(0,T.useRef)(new Set),r=(0,T.useRef)(new Map),i=(0,T.useMemo)(()=>{let t=()=>n.current.forEach(e=>e());return{errors:e?Od(Ad(e)):{},message:e?J(e):``,claimed:()=>new Set(r.current.keys()),subscribe(e){return n.current.add(e),()=>n.current.delete(e)},claim(e){r.current.set(e,(r.current.get(e)??0)+1),t()},release(e){let n=(r.current.get(e)??1)-1;n<=0?r.current.delete(e):r.current.set(e,n),t()}}},[e]);return(0,j.jsx)(kd.Provider,{value:i,children:t})}function Y(e){let t=(0,T.useContext)(kd);return(0,T.useLayoutEffect)(()=>(t?.claim(e),()=>t?.release(e)),[t,e]),t?.errors[e]}function X(){let e=(0,T.useContext)(kd),[,t]=(0,T.useState)(0),n=!!e?.message;if((0,T.useLayoutEffect)(()=>{if(!e||!n)return;let r=()=>t(e=>e+1);return r(),e.subscribe(r)},[e,n]),!e||!e.message)return null;let r=e.claimed(),i=Object.entries(e.errors).filter(([e])=>!r.has(e));return i.length===0&&Object.keys(e.errors).length>0?null:(0,j.jsxs)(`div`,{role:`alert`,className:`rounded border border-danger/40 bg-danger/10 p-3 text-sm text-danger-text`,children:[(0,j.jsx)(`p`,{children:e.message}),i.length>0&&(0,j.jsx)(`ul`,{className:`mt-1 list-disc pl-5`,children:i.map(([e,t])=>(0,j.jsxs)(`li`,{children:[e,`: `,t]},e))})]})}function Md(e,t=!0){let n=(0,T.useContext)(kd),r=Object.entries(n?.errors??{}).filter(([t])=>t.startsWith(e)),i=t?r.map(([e])=>e).join(`
|
|
14
14
|
`):``;return(0,T.useLayoutEffect)(()=>{if(!n||!i)return;let e=i.split(`
|
|
15
15
|
`);return e.forEach(e=>n.claim(e)),()=>e.forEach(e=>n.release(e))},[n,i]),r}function Nd({size:e=22}){return(0,j.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 64 64`,"aria-hidden":`true`,children:[(0,j.jsx)(`rect`,{width:`64`,height:`64`,rx:`14`,fill:`#1b7b9b`}),(0,j.jsxs)(`g`,{fill:`none`,stroke:`#fff`,strokeWidth:`2.8`,children:[(0,j.jsx)(`path`,{d:`M29 7H35V14H42V22H50V29H57V35H50V42H42V50H35V57H29V50H22V42H14V35H7V29H14V22H22V14H29Z`}),(0,j.jsx)(`path`,{d:`M32 19 45 32 32 45 19 32Z`})]}),(0,j.jsx)(`path`,{d:`M32 27 37 32 32 37 27 32Z`,fill:`#fff`})]})}function Pd({title:e,children:t}){return(0,j.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center bg-bg p-4`,children:(0,j.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col gap-4 rounded-base border border-line bg-raised p-6`,children:[(0,j.jsx)(Nd,{size:40}),(0,j.jsx)(`h1`,{className:`text-xl font-semibold`,children:e}),t]})})}function Fd({path:e,...t}){return(0,j.jsx)(kl,{...t,error:Y(e)})}function Id(){let{token:e}=Rr({from:`/hbinstall/$token`});return Ii(e,Date.now())?(0,j.jsxs)(Pd,{title:`Installer link expired`,children:[(0,j.jsx)(`p`,{role:`alert`,children:`This installer link has expired. Restart the server to print a new one.`}),(0,j.jsx)(ni,{to:`/login`,className:`text-accent-text hover:underline`,children:`Sign in`})]}):(0,j.jsx)(Rd,{token:e})}function Ld(){let e=Br(),[t,n]=(0,T.useState)(``),r=xu(t);return(0,j.jsxs)(Pd,{title:`Set up Heybe`,children:[(0,j.jsxs)(`p`,{className:`text-sm`,children:[`This server has no superuser yet. Open the setup link printed where Heybe runs: the terminal, `,(0,j.jsx)(`code`,{children:`journalctl -u heybe`}),` or`,` `,(0,j.jsx)(`code`,{children:`docker logs`}),`. Paste it here to continue.`]}),(0,j.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),e({to:`/hbinstall/$token`,params:{token:r}})},className:`flex flex-col gap-3`,children:[(0,j.jsx)(kl,{label:`Setup link or token`,autoFocus:!0,required:!0,value:t,onChange:e=>n(e.target.value)}),(0,j.jsx)(w,{type:`submit`,variant:`primary`,disabled:!r,children:`Continue`})]}),(0,j.jsxs)(`p`,{className:`text-sm text-muted`,children:[`You can also create one on the server with`,` `,(0,j.jsx)(`code`,{children:`heybe superuser upsert EMAIL PASS`}),`.`]})]})}function Rd({token:e}){let t=z(),n=Br(),r={headers:{Authorization:e}},[i,a]=(0,T.useState)(null),[o,s]=(0,T.useState)(null),[c,l]=(0,T.useState)(!1),u=Ed({defaultValues:{email:``,password:``,passwordConfirm:``},onSubmit:async({value:e})=>{a(null);try{await t.records(`_superusers`).create(e,void 0,r),await t.auth(`_superusers`).withPassword(e.email,e.password),await n({to:`/collections`})}catch(e){a(e)}}}),d=Ed({defaultValues:{file:null},onSubmit:async({value:{file:e}})=>{if(e){s(null);try{await t.backups.upload(e,r),await t.backups.restore(e.name,r),l(!0)}catch(e){s(e)}}}});return c?(0,j.jsxs)(Pd,{title:`Restoring backup`,children:[(0,j.jsx)(`p`,{role:`status`,children:`Restore started. The server restarts with the restored data; reload this page in a few seconds.`}),(0,j.jsx)(w,{variant:`primary`,onClick:async()=>{await n({to:`/login`}),location.reload()},children:`Reload`})]}):(0,j.jsxs)(Pd,{title:`Create your first superuser`,children:[(0,j.jsx)(jd,{error:i,children:(0,j.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),u.handleSubmit()},className:`flex flex-col gap-3`,children:[(0,j.jsx)(u.Field,{name:`email`,children:e=>(0,j.jsx)(Fd,{path:`email`,label:`Email`,type:`email`,autoFocus:!0,autoComplete:`username`,required:!0,value:e.state.value,onChange:t=>e.handleChange(t.target.value)})}),(0,j.jsx)(u.Field,{name:`password`,children:e=>(0,j.jsx)(Fd,{path:`password`,label:`Password`,type:`password`,autoComplete:`new-password`,required:!0,value:e.state.value,onChange:t=>e.handleChange(t.target.value)})}),(0,j.jsx)(u.Field,{name:`passwordConfirm`,children:e=>(0,j.jsx)(Fd,{path:`passwordConfirm`,label:`Confirm password`,type:`password`,autoComplete:`new-password`,required:!0,value:e.state.value,onChange:t=>e.handleChange(t.target.value)})}),(0,j.jsx)(X,{}),(0,j.jsx)(u.Subscribe,{selector:e=>e.isSubmitting,children:e=>(0,j.jsx)(d.Subscribe,{selector:e=>e.isSubmitting,children:t=>(0,j.jsx)(w,{type:`submit`,variant:`primary`,loading:e,disabled:t,children:`Create superuser`})})})]})}),(0,j.jsx)(jd,{error:o,children:(0,j.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),d.handleSubmit()},className:`flex flex-col gap-3 border-t border-line pt-4`,children:[(0,j.jsx)(`h2`,{className:`font-medium`,children:`Restore from a backup`}),(0,j.jsx)(`p`,{className:`text-sm text-muted`,children:`The backup is not validated. Only use files you trust.`}),(0,j.jsx)(d.Field,{name:`file`,children:e=>(0,j.jsx)(Rl,{label:`Backup file`,accept:`.zip,application/zip`,onChange:t=>e.handleChange(t[0]??null)})}),(0,j.jsx)(X,{}),(0,j.jsx)(d.Subscribe,{selector:e=>[e.isSubmitting,e.values.file],children:([e,t])=>(0,j.jsx)(u.Subscribe,{selector:e=>e.isSubmitting,children:n=>(0,j.jsx)(w,{type:`submit`,loading:e,disabled:!t||n,children:`Upload and restore`})})})]})})]})}var zd=/^[^@\s]+@[^@\s]+$/;function Bd(){let e=z(),t=Br(),n=zr({from:`/login`}),r=e.auth(`_superusers`),i=ks({queryKey:[`superuserAuthMethods`],queryFn:({signal:e})=>r.methods({signal:e})}),[a,o]=(0,T.useState)(``),[s,c]=(0,T.useState)(``),[l,u]=(0,T.useState)(``),[d,f]=(0,T.useState)(null),p=()=>t({href:Su(n.redirect)}),m=async e=>{try{let t=await r.requestOTP(e);c(t.otpId),u(t.otpId)}catch(e){throw e instanceof ma&&e.status===429&&c(l),e}},h=async({identity:e,password:t})=>{try{await r.withPassword(e,t)}catch(t){let n=t instanceof ma&&t.response.mfaId;if(t instanceof ma&&t.status===401&&n){o(String(n)),zd.test(e)&&(g.setFieldValue(`otpEmail`,e),await m(e));return}throw t}await p()},g=Ed({defaultValues:{identity:``,password:``,otpEmail:``,otpPassword:``},onSubmitMeta:{step:`password`},onSubmit:async({value:e,meta:t})=>{f(null);try{t.step===`password`?await h(e):t.step===`sendCode`?await m(e.otpEmail):(await r.withOTP(s,e.otpPassword,a?{mfaId:a}:{}),await p())}catch(e){f(e)}}}),_;return _=i.isPending?(0,j.jsx)(`p`,{children:`Loading...`}):i.isError?(0,j.jsx)(`p`,{role:`alert`,children:J(i.error)}):i.data.password.enabled&&!a?(0,j.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),g.handleSubmit({step:`password`})},className:`flex flex-col gap-3`,children:[(0,j.jsx)(g.Field,{name:`identity`,children:e=>(0,j.jsx)(Fd,{path:`identity`,label:`Email`,type:`email`,autoFocus:!0,autoComplete:`username`,required:!0,value:e.state.value,onChange:t=>e.handleChange(t.target.value)})}),(0,j.jsx)(g.Field,{name:`password`,children:e=>(0,j.jsx)(Fd,{path:`password`,label:`Password`,type:`password`,autoComplete:`current-password`,required:!0,value:e.state.value,onChange:t=>e.handleChange(t.target.value)})}),(0,j.jsx)(X,{}),(0,j.jsx)(g.Subscribe,{selector:e=>e.isSubmitting,children:e=>(0,j.jsx)(w,{type:`submit`,variant:`primary`,loading:e,children:`Sign in`})}),(0,j.jsx)(ni,{to:`/request-password-reset`,className:`text-sm underline`,children:`Forgot password?`})]},`password`):(i.data.otp.enabled||a)&&!s?(0,j.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),g.handleSubmit({step:`sendCode`})},className:`flex flex-col gap-3`,children:[a&&(0,j.jsx)(`p`,{className:`text-sm`,children:`Finish signing in with a code.`}),(0,j.jsx)(g.Field,{name:`otpEmail`,children:e=>(0,j.jsx)(Fd,{path:`email`,label:`Email`,type:`email`,autoFocus:!0,autoComplete:`username`,required:!0,value:e.state.value,onChange:t=>e.handleChange(t.target.value)})}),(0,j.jsx)(X,{}),(0,j.jsx)(g.Subscribe,{selector:e=>e.isSubmitting,children:e=>(0,j.jsx)(w,{type:`submit`,variant:`primary`,loading:e,children:`Send code`})})]},`request-otp`):s?(0,j.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),g.handleSubmit({step:`verify`})},className:`flex flex-col gap-3`,children:[(0,j.jsx)(g.Subscribe,{selector:e=>e.values.otpEmail,children:e=>(0,j.jsxs)(`p`,{className:`text-sm`,children:[`Check `,e,` for the code.`]})}),(0,j.jsx)(g.Field,{name:`otpPassword`,children:e=>(0,j.jsx)(Fd,{path:`password`,label:`One-time password`,autoFocus:!0,autoComplete:`one-time-code`,required:!0,value:e.state.value,onChange:t=>e.handleChange(t.target.value)})}),(0,j.jsx)(X,{}),(0,j.jsx)(g.Subscribe,{selector:e=>e.isSubmitting,children:e=>(0,j.jsx)(w,{type:`submit`,variant:`primary`,loading:e,children:`Verify`})}),(0,j.jsx)(w,{variant:`ghost`,onClick:()=>c(``),children:`Send a new code`})]},`verify-otp`):(0,j.jsx)(`p`,{children:`No sign-in method is enabled for superusers.`}),(0,j.jsx)(Pd,{title:`Superuser sign in`,children:(0,j.jsx)(jd,{error:d,children:_})})}function Vd(){let e=z(),[t,n]=(0,T.useState)(!1),[r,i]=(0,T.useState)(null),a=Ed({defaultValues:{email:``},onSubmit:async({value:t})=>{i(null);try{await e.auth(`_superusers`).requestPasswordReset(t.email)}catch(e){let t=e.status??0;if(t===0||t>=500)return i(e)}n(!0)}});return(0,j.jsxs)(Pd,{title:`Reset password`,children:[t?(0,j.jsx)(`p`,{role:`status`,children:`If the email exists, a reset link was sent.`}):(0,j.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),a.handleSubmit()},className:`flex flex-col gap-3`,children:[(0,j.jsx)(a.Field,{name:`email`,children:e=>(0,j.jsx)(kl,{label:`Email`,type:`email`,autoComplete:`username`,required:!0,value:e.state.value,onChange:t=>e.handleChange(t.target.value)})}),r!==null&&(0,j.jsx)(`p`,{role:`alert`,children:J(r)}),(0,j.jsx)(a.Subscribe,{selector:e=>e.isSubmitting,children:e=>(0,j.jsx)(w,{type:`submit`,variant:`primary`,loading:e,children:`Send reset link`})})]}),(0,j.jsx)(ni,{to:`/login`,className:`text-sm underline`,children:`Back to sign in`})]})}function Hd(e){let t=Fi(e).collectionId;return typeof t==`string`&&t?t:null}function Ud({title:e}){return(0,j.jsx)(Pd,{title:e,children:(0,j.jsx)(`p`,{role:`alert`,children:`Invalid or expired link.`})})}var Wd=`Confirm new email`;function Gd(){let{token:e}=Rr({from:`/auth/confirm-email-change/$token`}),t=Hd(e);return t?(0,j.jsx)(Kd,{token:e,collectionId:t}):(0,j.jsx)(Ud,{title:Wd})}function Kd({token:e,collectionId:t}){let n=z(),[r,i]=(0,T.useState)(!1),[a,o]=(0,T.useState)(null),s=Ed({defaultValues:{password:``},onSubmit:async({value:r})=>{o(null);try{await n.auth(t).confirmEmailChange(e,r.password),i(!0)}catch(e){o(e)}}});return r?(0,j.jsx)(Pd,{title:Wd,children:(0,j.jsx)(`p`,{role:`status`,children:`Your email address was changed.`})}):(0,j.jsx)(Pd,{title:Wd,children:(0,j.jsx)(jd,{error:a,children:(0,j.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),s.handleSubmit()},className:`flex flex-col gap-3`,children:[(0,j.jsx)(s.Field,{name:`password`,children:e=>(0,j.jsx)(Fd,{path:`password`,label:`Password`,type:`password`,autoFocus:!0,autoComplete:`current-password`,required:!0,value:e.state.value,onChange:t=>e.handleChange(t.target.value)})}),(0,j.jsx)(X,{}),(0,j.jsx)(s.Subscribe,{selector:e=>e.isSubmitting,children:e=>(0,j.jsx)(w,{type:`submit`,variant:`primary`,loading:e,children:`Confirm new email`})})]})})})}var qd=`Reset password`,Jd=`hbc_3142635823`;function Yd(){let{token:e}=Rr({from:`/auth/confirm-password-reset/$token`}),t=Hd(e);return t?(0,j.jsx)(Xd,{token:e,collectionId:t}):(0,j.jsx)(Ud,{title:qd})}function Xd({token:e,collectionId:t}){let n=z(),[r,i]=(0,T.useState)(!1),[a,o]=(0,T.useState)(null),s=Ed({defaultValues:{password:``,passwordConfirm:``},onSubmit:async({value:r})=>{o(null);try{await n.auth(t).confirmPasswordReset(e,r.password,r.passwordConfirm),i(!0)}catch(e){o(e)}}});return r?(0,j.jsxs)(Pd,{title:qd,children:[(0,j.jsx)(`p`,{role:`status`,children:`Your password was changed.`}),t===Jd&&(0,j.jsx)(ni,{to:`/login`,className:`text-sm underline`,children:`Sign in`})]}):(0,j.jsx)(Pd,{title:qd,children:(0,j.jsx)(jd,{error:a,children:(0,j.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),s.handleSubmit()},className:`flex flex-col gap-3`,children:[(0,j.jsx)(s.Field,{name:`password`,children:e=>(0,j.jsx)(Fd,{path:`password`,label:`New password`,type:`password`,autoFocus:!0,autoComplete:`new-password`,required:!0,value:e.state.value,onChange:t=>e.handleChange(t.target.value)})}),(0,j.jsx)(s.Field,{name:`passwordConfirm`,children:e=>(0,j.jsx)(Fd,{path:`passwordConfirm`,label:`Confirm new password`,type:`password`,autoComplete:`new-password`,required:!0,value:e.state.value,onChange:t=>e.handleChange(t.target.value)})}),(0,j.jsx)(X,{}),(0,j.jsx)(s.Subscribe,{selector:e=>e.isSubmitting,children:e=>(0,j.jsx)(w,{type:`submit`,variant:`primary`,loading:e,children:`Set new password`})})]})})})}var Zd=`Verify email`;function Qd(){let{token:e}=Rr({from:`/auth/confirm-verification/$token`}),t=Hd(e);return t?(0,j.jsx)($d,{token:e,collectionId:t}):(0,j.jsx)(Ud,{title:Zd})}function $d({token:e,collectionId:t}){let n=z(),[r,i]=(0,T.useState)(null);return(0,T.useEffect)(()=>{let r=new AbortController;return n.auth(t).confirmVerification(e,{signal:r.signal}).then(()=>i({}),e=>{r.signal.aborted||i({error:J(e)})}),()=>r.abort()},[n,t,e]),(0,j.jsx)(Pd,{title:Zd,children:r===null?(0,j.jsx)(`p`,{role:`status`,children:`Verifying...`}):r.error?(0,j.jsx)(`p`,{role:`alert`,children:r.error}):(0,j.jsx)(`p`,{role:`status`,children:`Your email address is verified.`})})}function ef({success:e}){return(0,T.useEffect)(()=>{window.close()},[]),(0,j.jsx)(Pd,{title:`Sign in`,children:(0,j.jsx)(`p`,{role:e?`status`:`alert`,children:e?`Sign-in completed. You can close this window.`:`Sign-in failed. Close this window and try again.`})})}var tf={collections:[`collections`],settings:[`settings`],records:(e,t)=>[`records`,e,t],logs:e=>[`logs`,e],backups:[`backups`],crons:[`crons`],health:[`health`],fileToken:[`fileToken`]};function nf(){let{data:e}=af();return Object.fromEntries((e??[]).map(e=>[e.name,e.fields.map(e=>String(e.name))]))}async function rf(e){let t=[],n=1;for(;;){let r=await e(n);if(t.push(...r.items),r.page>=r.totalPages)return t;n=r.page+1}}function af(){let e=z();return ks({queryKey:tf.collections,queryFn:({signal:t})=>rf(n=>e.collections.findMany({perPage:1e3,page:n,orderBy:{name:`asc`}},{signal:t}))})}function of(){let e=z();return ks({queryKey:tf.settings,queryFn:async({signal:t})=>await e.settings.get({signal:t})})}function sf(){let e=of();return!e.data||e.data.meta.hideControls}function cf(){let e=z(),t=oo();return As({mutationFn:async t=>await e.settings.update(t),onSuccess:e=>t.setQueryData(tf.settings,e)})}function lf(e,t){let n={};for(let r of Object.keys(t))JSON.stringify(e[r])!==JSON.stringify(t[r])&&(n[r]=t[r]);return n}function uf(e){return e==null?`Superusers only`:e===``?`Everyone`:String(e)}function df({collection:e,onClose:t}){let n=`/api/collections/${encodeURIComponent(e.name)}`,r=[[`List/Search`,`GET`,`${n}/records`,e.listRule],[`View`,`GET`,`${n}/records/{id}`,e.viewRule]];e.type!==`view`&&r.push([`Create`,`POST`,`${n}/records`,e.createRule],[`Update`,`PATCH`,`${n}/records/{id}`,e.updateRule],[`Delete`,`DELETE`,`${n}/records/{id}`,e.deleteRule]),e.type===`auth`&&r.push([`Auth with password`,`POST`,`${n}/auth-with-password`,e.authRule]);let i=[`import { createClient } from "@heybejs/client";`,``,`const heybe = createClient(${JSON.stringify(location.origin)});`,`const page = await heybe.records(${JSON.stringify(e.name)}).findMany({ page: 1, perPage: 20 });`].join(`
|
|
16
16
|
`);return(0,j.jsxs)(Ol,{open:!0,size:`lg`,onClose:t,title:`API preview`,children:[(0,j.jsxs)(Hl,{caption:`${e.name} endpoints`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(Wl,{children:`Action`}),(0,j.jsx)(Wl,{children:`Method`}),(0,j.jsx)(Wl,{children:`Path`}),(0,j.jsx)(Wl,{children:`Rule`})]})}),(0,j.jsx)(`tbody`,{children:r.map(([e,t,n,r])=>(0,j.jsxs)(`tr`,{className:`h-11`,children:[(0,j.jsx)(Gl,{children:e}),(0,j.jsx)(Gl,{children:(0,j.jsx)(Ns,{tone:`neutral`,children:t})}),(0,j.jsx)(Gl,{wrap:!0,children:(0,j.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,j.jsx)(`code`,{className:`min-w-0 max-w-md truncate`,title:n,children:n}),(0,j.jsx)(Fl,{text:n,label:`Copy ${e} path`})]})}),(0,j.jsx)(Gl,{children:uf(r)})]},e))})]}),(0,j.jsxs)(`div`,{className:`mt-4 flex items-center justify-between`,children:[(0,j.jsx)(`h3`,{className:`text-sm font-medium`,children:`Client`}),(0,j.jsx)(Fl,{text:i,label:`Copy snippet`})]}),(0,j.jsx)(`div`,{className:`mt-1`,children:(0,j.jsx)(m,{label:`Client snippet`,hideLabel:!0,language:`javascript`,readOnly:!0,value:i})})]})}function ff({collections:e,onClose:t}){let n=t=>e.find(e=>e.id===t)?.name??String(t);return(0,j.jsx)(Ol,{open:!0,onClose:t,title:`Collections overview`,children:(0,j.jsxs)(Hl,{caption:`Collections and their relations`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(Wl,{children:`Collection`}),(0,j.jsx)(Wl,{children:`Type`}),(0,j.jsx)(Wl,{children:`Relations`})]})}),(0,j.jsx)(`tbody`,{children:e.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(Gl,{children:e.name}),(0,j.jsx)(Gl,{children:e.type}),(0,j.jsx)(Gl,{children:e.fields.filter(e=>e.type===`relation`).map(e=>`${String(e.name)}: ${n(e.collectionId)}`).join(`, `)})]},e.id))})]})})}var pf=(0,T.createContext)(()=>{}),Z=()=>(0,T.useContext)(pf);function mf(){let e=af(),t=sf(),[n,r]=(0,T.useState)(``),[i,a]=(0,T.useState)(!1),[s,c]=(0,T.useState)(!1),l=Z(),u=n.trim().toLowerCase(),d=(e.data??[]).filter(e=>e.name.toLowerCase().includes(u)),f=d.filter(e=>e.system),{collectionId:p}=Rr({strict:!1}),m=(e.data??[]).some(e=>e.system&&(e.id===p||e.name===p)),h=u!==``||m,g=i||h,_=(0,T.useId)(),[v,y]=(0,T.useState)(!1),b=(0,T.useId)();return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`nav`,{"aria-label":`Collections`,className:`flex w-full flex-col gap-3 overflow-y-auto p-1 md:sticky md:-m-1 md:top-14 md:max-h-[calc(100dvh-4.5rem)] md:w-56 md:shrink-0 md:self-start`,children:[(0,j.jsxs)(`button`,{type:`button`,"aria-expanded":v,"aria-controls":b,onClick:()=>y(!v),className:`${gf} font-medium hover:bg-hover md:hidden`,children:[v?(0,j.jsx)(Xs,{...hf}):(0,j.jsx)(Qs,{...hf}),`Collections`]}),(0,j.jsxs)(`div`,{id:b,className:`${v?`flex`:`hidden`} flex-col gap-3 md:flex`,children:[(0,j.jsxs)(`div`,{className:`relative`,children:[(0,j.jsx)(il,{...hf,className:`pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-faint`}),(0,j.jsx)(`input`,{type:`text`,"aria-label":`Search collections`,placeholder:`Search collections`,value:n,onChange:e=>r(e.target.value),className:`${o} pr-8 pl-8`}),n&&(0,j.jsx)(`button`,{type:`button`,"aria-label":`Clear search`,onClick:()=>r(``),className:`absolute top-1/2 right-1.5 flex size-6 -translate-y-1/2 items-center justify-center rounded-control text-faint hover:bg-hover hover:text-text focus-visible:outline-2 focus-visible:outline-focus`,children:(0,j.jsx)(R,{...hf})})]}),(0,j.jsxs)(`button`,{type:`button`,onClick:()=>c(!0),className:`${gf} text-left hover:bg-hover`,children:[(0,j.jsx)(Mc,{...hf,className:`text-muted`}),`Overview`]}),(0,j.jsx)(yf,{items:d.filter(e=>!e.system),editable:!t,onNavigate:()=>y(!1)}),f.length>0&&(0,j.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,j.jsxs)(`button`,{type:`button`,"aria-expanded":g,"aria-controls":_,disabled:h,onClick:()=>a(!i),className:`flex items-center gap-1 rounded-control px-1 text-left text-xs font-medium text-muted uppercase focus-visible:outline-2 focus-visible:outline-focus disabled:cursor-default`,children:[g?(0,j.jsx)(Xs,{size:13,strokeWidth:1.75,"aria-hidden":!0}):(0,j.jsx)(Qs,{size:13,strokeWidth:1.75,"aria-hidden":!0}),`System`]}),(0,j.jsx)(`div`,{id:_,hidden:!g,children:g&&(0,j.jsx)(yf,{items:f,editable:!t,onNavigate:()=>y(!1)})})]}),u!==``&&d.length===0&&(0,j.jsx)(`p`,{className:`px-2 text-sm text-muted`,children:`No collections match`}),!t&&(0,j.jsx)(w,{variant:`ghost`,onClick:()=>l(),icon:(0,j.jsx)(Jc,{...hf}),className:`justify-start`,children:`New collection`})]})]}),s&&(0,j.jsx)(ff,{collections:e.data??[],onClose:()=>c(!1)})]})}var hf={size:15,strokeWidth:1.75,"aria-hidden":!0},gf=`flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-sm focus-visible:outline-2 focus-visible:outline-focus`,_f={base:uc,auth:Sl,view:mc};function vf(){let e=Z();return(0,j.jsx)(w,{variant:`primary`,onClick:()=>e(),children:`New collection`})}function yf({items:e,editable:t,onNavigate:n}){let r=Z();return(0,j.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.map(e=>{let i=_f[e.type];return(0,j.jsxs)(`li`,{className:`group relative flex items-center`,children:[(0,j.jsxs)(ni,{to:`/collections/$collectionId`,params:{collectionId:e.id},onClick:n,className:`${gf} min-w-0 hover:bg-hover`,activeProps:{"aria-current":`page`,className:`bg-hover font-medium`},children:[(0,j.jsx)(i,{...hf,className:`shrink-0 text-muted`}),(0,j.jsx)(`span`,{className:`truncate`,children:e.name})]}),t&&(0,j.jsx)(w,{variant:`ghost`,size:`sm`,"aria-label":`Edit collection ${e.name}`,onClick:()=>r(e),icon:(0,j.jsx)(ol,{size:14,strokeWidth:1.75}),className:`absolute right-1 w-7 px-0 opacity-0 focus-visible:opacity-100 group-hover:opacity-100`})]},e.id)})})}function bf({names:e,hidden:t,onToggle:n}){return(0,j.jsx)(b,{trigger:(0,j.jsx)(w,{children:`Columns`}),placement:`bottom-end`,children:(0,j.jsx)(`div`,{className:`flex flex-col gap-1`,children:e.map(e=>(0,j.jsx)(Ps,{label:e,checked:!t.includes(e),onChange:()=>n(e)},e))})})}function xf({page:e,totalPages:t,onPage:n}){return t<=1?null:(0,j.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2 text-sm`,children:(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(w,{disabled:e<=1,onClick:()=>n(e-1),children:`Previous`}),(0,j.jsxs)(`span`,{children:[`Page `,e,` of `,Math.max(t,1)]}),(0,j.jsx)(w,{disabled:e>=t,onClick:()=>n(e+1),children:`Next`})]})})}var Sf=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}),Cf=new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,minute:`2-digit`}),wf=new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,minute:`2-digit`,second:`2-digit`,timeZoneName:`shortOffset`});function Tf(e,t=`short`){let n=new Date(typeof e==`string`?e.replace(` `,`T`):e);return Number.isNaN(n.getTime())?String(e):`${Sf.format(n)}, ${(t===`full`?wf:Cf).format(n)}`}function Ef({collection:e,recordId:t,label:n,onClose:r}){let i=z(),a=As({mutationFn:async n=>(await i.auth(e.name).impersonate(t,n)).authStore.token}),o=Ed({defaultValues:{duration:`0`},onSubmit:({value:e})=>a.mutateAsync(Number(e.duration)).catch(()=>void 0)});return(0,j.jsx)(Ol,{open:!0,title:`Impersonate ${n}`,onClose:r,footer:(0,j.jsx)(w,{onClick:r,children:`Close`}),children:(0,j.jsxs)(`form`,{noValidate:!0,onSubmit:e=>{e.preventDefault(),o.handleSubmit()},className:`flex flex-col gap-4`,children:[(0,j.jsx)(o.Field,{name:`duration`,validators:{onSubmit:({value:e})=>/^\d+$/.test(e)?void 0:`Enter a whole number of seconds, 0 or more.`},children:e=>(0,j.jsx)(zl,{label:`Token duration (seconds)`,hint:`0 uses the collection's auth token duration.`,min:0,step:1,error:e.state.meta.errors[0],value:e.state.value,onChange:t=>e.handleChange(t.target.value)})}),(0,j.jsx)(o.Subscribe,{selector:e=>e.isSubmitting,children:e=>(0,j.jsx)(w,{type:`submit`,variant:`primary`,loading:e,children:`Generate token`})}),a.isError&&(0,j.jsx)(`p`,{role:`alert`,className:`text-sm text-danger-text`,children:J(a.error)}),a.data&&(0,j.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,j.jsx)(`div`,{className:`flex-1`,children:(0,j.jsx)(kl,{label:`Token`,readOnly:!0,value:a.data,className:`font-mono`})}),(0,j.jsx)(Fl,{label:`Copy token`,text:a.data})]}),(0,j.jsx)(`p`,{className:`text-sm text-muted`,children:`This token is not refreshable.`})]})]})})}function Df(e,t){let n=z(),r=Ql(),[i,a]=(0,T.useState)(!1),o=n.auth(e.name),s=String(t.email??``),c=e.passwordAuth,l=As({mutationFn:e=>e===`verification`?o.requestVerification(s):o.requestPasswordReset(s),onSuccess:(e,t)=>r.success(t===`verification`?`Verification email sent.`:`Password reset email sent.`),onError:e=>r.error(J(e))}),u=[];return s&&!t.verified&&u.push({key:`verification`,label:`Send verification email`}),s&&c?.enabled!==!1&&u.push({key:`reset`,label:`Send password reset email`}),u.push({key:`impersonate`,label:`Impersonate`}),{items:u,run:e=>{e===`verification`||e===`reset`?l.mutate(e):e===`impersonate`&&a(!0)},dialog:i?(0,j.jsx)(Ef,{collection:e,recordId:t.id,label:s||t.id,onClose:()=>a(!1)}):null}}var Of=class extends Error{constructor(e){super(`Invalid JSON in ${e}.`),this.field=e}},kf=[`autodate`,`password`],Af=e=>e.fields,jf=e=>Number(e.maxSelect)>1;function Mf(e){return Object.fromEntries(Af(e).filter(e=>!e.hidden&&e.type===`relation`).map(e=>[e.name,!0]))}function Nf(e){let t=/^(\d{4}-\d\d-\d\d)T(\d\d:\d\d)(?::(\d\d))?/.exec(e);return t?`${t[1]} ${t[2]}:${t[3]??`00`}.000Z`:``}function Pf(e){let t=/^(\d{4}-\d\d-\d\d)[ T](\d\d:\d\d:\d\d)/.exec(e);return t?`${t[1]}T${t[2]}`:``}function Ff(e,t){switch(e.type){case`number`:return t==null?``:String(t);case`bool`:return!!t;case`date`:return Pf(String(t??``));case`select`:case`relation`:return jf(e)?Array.isArray(t)?t:t?[t]:[]:String(Array.isArray(t)?t[0]??``:t??``);case`file`:return{removed:[],added:[]};case`json`:return t==null||t===``?``:JSON.stringify(t,null,2);case`geoPoint`:{let e=t;return{lon:e?String(e.lon??0):``,lat:e?String(e.lat??0):``}}default:return String(t??``)}}function If(e,t){let n={};for(let r of Af(e))r.type===`password`?(n.password=``,n.passwordConfirm=``):r.hidden||(n[r.name]=Ff(r,t?.[r.name]));return n}function Lf(e,t){switch(e.type){case`number`:return t===``?null:Number(t);case`date`:return Nf(String(t));case`json`:{let n=String(t).trim();if(!n)return null;try{JSON.parse(n)}catch{throw new Of(e.name)}return n}case`geoPoint`:{let{lon:e,lat:n}=t;return{lon:Number(e||0),lat:Number(n||0)}}default:return t}}function Rf(e,{removed:t,added:n},r){let i=jf(e);return r?n.length?{[e.name]:i?n:n[0]}:{}:i?{...n.length&&{[`${e.name}+`]:n},...t.length&&{[`${e.name}-`]:t}}:n.length?{[e.name]:n[0]}:t.length?{[`${e.name}-`]:t}:{}}var zf=(e,t)=>{if(e.type===`bool`)return t===!1;if(e.type===`geoPoint`){let{lon:e,lat:n}=t;return e===``&&n===``}return Array.isArray(t)?t.length===0:String(t).trim()===``};function Bf(e,t,n){let r=n?If(e,n):void 0,i={};for(let n of Af(e)){if(n.hidden||kf.includes(n.type)||!(n.name in t))continue;let e=t[n.name];n.type===`file`?Object.assign(i,Rf(n,e,!r)):(r?JSON.stringify(e)!==JSON.stringify(r[n.name]):!zf(n,e))&&(i[n.name]=Lf(n,e))}return e.type===`auth`&&t.password&&(i.password=t.password,i.passwordConfirm=t.passwordConfirm),i}function Vf({name:e,value:t,error:n,disabled:r,onChange:i}){let a=S({error:n});return(0,j.jsx)(c,{...a,label:`${e} (UTC)`,error:n,children:(0,j.jsxs)(`div`,{className:`flex h-9 items-center rounded-control border bg-field pr-1 focus-within:outline-2 focus-within:outline-focus ${n?`border-danger`:`border-field-line`} ${r?`opacity-50`:``}`,children:[(0,j.jsx)(`input`,{...a.aria,type:`datetime-local`,step:1,value:t,disabled:r,onChange:e=>i(e.target.value),className:`h-full min-w-0 flex-1 bg-transparent px-2.5 text-sm text-text outline-none`}),t&&(0,j.jsx)(`button`,{type:`button`,"aria-label":`Clear ${e}`,disabled:r,onClick:()=>i(``),className:`inline-flex size-7 items-center justify-center rounded-control text-muted hover:bg-hover hover:text-text focus-visible:outline-2 focus-visible:outline-focus`,children:(0,j.jsx)(R,{size:15,strokeWidth:1.75,"aria-hidden":!0})})]})})}var Q=`modulepreload`,Hf=function(e){return`/_/`+e},Uf={},Wf=function(e){return e.pathname.endsWith(`.css`)},Gf=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Kf=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Hf(t,n);let r=s(t),i=Wf(r);return Gf(Uf,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Q,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},qf=(0,T.lazy)(()=>Kf(()=>import(`./RichTextEditor-1oGZgu61.js`),__vite__mapDeps([0,1,2])));function Jf({name:e,error:t}){let n=S({error:t});return(0,j.jsx)(c,{...n,label:e,error:t,children:(0,j.jsx)(`div`,{role:`status`,"aria-label":`Loading ${e} editor`,className:`h-52 animate-pulse rounded-control border border-field-line bg-field motion-reduce:animate-none`})})}function Yf(e){return(0,j.jsx)(T.Suspense,{fallback:(0,j.jsx)(Jf,{name:e.name,error:e.error}),children:(0,j.jsx)(qf,{...e})})}var Xf=100,Zf=/\.(jpe?g|png|gif|webp)$/i,Qf=e=>e.slice(0,Xf),$f=e=>Array.isArray(e)?e:e?[e]:[];function ep(e){let{body:t}=new DOMParser().parseFromString(e,`text/html`);return t.querySelectorAll(`script, style`).forEach(e=>e.remove()),t.textContent??``}function $({value:e}){let t=Tf(e);return t===e?(0,j.jsx)(`span`,{children:e}):(0,j.jsx)(f,{content:e,children:(0,j.jsx)(`span`,{tabIndex:0,children:t})})}function tp(e){let t=z();return ks({queryKey:tf.fileToken,queryFn:({signal:e})=>t.files.token({signal:e}),staleTime:12e4,enabled:!!e.protected}).data}function np({field:e,names:t,record:n}){let r=z(),i=tp(e);return e.protected&&i===void 0?null:(0,j.jsx)(`span`,{className:`flex gap-1`,children:t.map(e=>Zf.test(e)?(0,j.jsx)(`img`,{alt:e,width:32,height:32,src:r.files.url(n,e,{thumb:`100x100`,token:i})},e):(0,j.jsx)(`span`,{children:e},e))})}function rp(e,t,n){return(e?.fields??[]).filter(e=>e.presentable).map(e=>t?.[e.name]).filter(e=>e!=null&&e!==``).join(` `)||n}function ip(e,t){let n=e.expand?.[t];return new Map($f(n).map(e=>[e.id,e]))}function ap({field:e,value:t,record:n}){let r=af().data?.find(t=>t.id===e.collectionId),i=ip(n,e.name),a=Qf($f(t).map(e=>rp(r,i.get(e),String(e))).join(`, `));return(0,j.jsx)(`span`,{className:`block truncate`,title:a,children:a})}function op({field:e,value:t,record:n}){if(t==null||t===``)return null;switch(e.type){case`bool`:return t?`Yes`:`No`;case`date`:case`autodate`:return(0,j.jsx)($,{value:String(t)});case`editor`:return Qf(ep(String(t)));case`json`:return Qf(JSON.stringify(t)??``);case`select`:return Qf($f(t).join(`, `));case`geoPoint`:{let{lon:e,lat:n}=t;return`${e}, ${n}`}case`password`:return`******`;case`relation`:return(0,j.jsx)(ap,{field:e,value:t,record:n});case`file`:return(0,j.jsx)(np,{field:e,names:$f(t).map(String),record:n});default:return Qf(String(t))}}function sp({name:e,url:t,onClose:n}){return(0,j.jsx)(Ol,{open:!0,title:e,onClose:n,children:(0,j.jsx)(`img`,{src:t,alt:e,className:`mx-auto max-h-[70vh]`})})}function cp({field:e,name:t,value:n,record:r,error:i,disabled:a,onChange:o}){let s=z(),c=tp(e),[l,u]=(0,T.useState)(null),[d,f]=(0,T.useState)(0),p=jf(e),m=r?$f(r[e.name]).map(String):[],h=m.filter(e=>!n.removed.includes(e)).length+n.added.length,g=p&&h>=Number(e.maxSelect),_=!!e.protected&&c===void 0,v=(e,t)=>s.files.url(r??{},e,{thumb:t,token:c}),y=e=>o({...n,removed:n.removed.includes(e)?n.removed.filter(t=>t!==e):[...n.removed,e]});return(0,j.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,j.jsx)(`legend`,{className:`text-sm font-medium`,children:t}),(0,j.jsxs)(`ul`,{className:`flex flex-col gap-2`,children:[m.map(e=>{let t=n.removed.includes(e);return(0,j.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2 ${t?`line-through opacity-50`:``}`,children:[!_&&Zf.test(e)&&(0,j.jsx)(`button`,{type:`button`,"aria-label":`Preview ${e}`,onClick:()=>u(e),children:(0,j.jsx)(`img`,{src:v(e,`100x100`),alt:e,width:48,height:48})}),_||Zf.test(e)?(0,j.jsx)(`span`,{className:`min-w-0 truncate`,title:e,children:e}):(0,j.jsx)(`a`,{href:v(e),target:`_blank`,rel:`noopener noreferrer`,className:`min-w-0 truncate`,title:e,children:e})]}),(0,j.jsx)(w,{"aria-label":`${t?`Restore`:`Remove`} ${e}`,disabled:a,onClick:()=>y(e),children:t?`Restore`:`Remove`})]},e)}),n.added.map((e,t)=>(0,j.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.name,children:e.name}),(0,j.jsx)(w,{"aria-label":`Remove new ${e.name}`,disabled:a,onClick:()=>o({...n,added:n.added.filter((e,n)=>n!==t)}),children:`Remove`})]},`${e.name}-${t}`))]}),(0,j.jsx)(`div`,{className:`[&_label]:sr-only`,children:(0,j.jsx)(Rl,{label:`Add files`,multiple:p,disabled:a||g,error:i,onChange:e=>{e.length!==0&&(o({...n,added:p?[...n.added,...e]:[e[0]]}),f(e=>e+1))}},d)}),l&&(0,j.jsx)(sp,{name:l,url:v(l),onClose:()=>u(null)})]})}var lp=[`=`,`~`,`>`,`<`,`(`,`)`,`&`,`|`];function up(e,t){let n=e.trim();if(!n||t.length===0||lp.some(e=>n.includes(e)))return n;let r=`"${(Number.isNaN(Number(n))&&n!==`true`&&n!==`false`?n.replace(/^["'`]|["'`]$/g,``):n).replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"`;return t.map(e=>`${e}?~${r}`).join(`||`)}function dp({title:e,target:t,selected:n,known:r,maxSelect:i,onClose:a,onSelect:o}){let s=z(),[c,l]=(0,T.useState)(``),[u,d]=(0,T.useState)(``),[f,p]=(0,T.useState)(()=>new Map(n.map(e=>[e,r.get(e)??{id:e}]))),m=t.fields.filter(e=>!e.hidden&&e.type!==`password`).map(e=>e.name),h=js({queryKey:[`records`,t.id,`picker`,u],initialPageParam:1,queryFn:({pageParam:e,signal:n})=>s.records(t.name).findMany({page:e,perPage:40,filter:up(u,m),sort:`-@rowid`},{signal:n}),getNextPageParam:e=>e.page<e.totalPages?e.page+1:void 0}),g=(h.data?.pages??[]).flatMap(e=>e.items),_=i<=1,v=f.size>=i,y=e=>p(t=>{if(_)return new Map([[e.id,e]]);let n=new Map(t);return n.delete(e.id)||n.set(e.id,e),n});return(0,j.jsx)(Ol,{open:!0,title:e,onClose:a,footer:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(w,{onClick:a,children:`Cancel`}),(0,j.jsx)(w,{variant:`primary`,onClick:()=>o([...f.values()]),children:`Select`})]}),children:(0,j.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,j.jsx)(kl,{label:`Search`,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),d(c.trim()))}}),h.isError&&(0,j.jsx)(`p`,{role:`alert`,children:J(h.error)}),h.isPending&&(0,j.jsx)(`p`,{role:`status`,className:`text-sm text-muted`,children:`Loading...`}),h.isSuccess&&g.length===0&&(0,j.jsx)(`p`,{className:`text-sm text-muted`,children:u?`No records match the search.`:`No records yet.`}),(0,j.jsx)(`ul`,{className:`flex flex-col gap-1`,children:g.map(e=>{let n=e.id,r=rp(t,e,n),i=f.has(n);return(0,j.jsx)(`li`,{children:(0,j.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,j.jsx)(`input`,{type:_?`radio`:`checkbox`,name:`picker`,checked:i,disabled:!_&&v&&!i,onChange:()=>y(e)}),r]})},n)})}),h.hasNextPage&&(0,j.jsx)(w,{loading:h.isFetchingNextPage,onClick:()=>void h.fetchNextPage(),children:`Load more`})]})})}function fp({field:e,name:t,value:n,record:r,error:i,disabled:a,onChange:o}){let s=af().data?.find(t=>t.id===e.collectionId),c=jf(e),l=Array.isArray(n)?n:n?[n]:[],[u,d]=(0,T.useState)(()=>r?ip(r,e.name):new Map),[f,p]=(0,T.useState)(!1),m=(0,T.useId)(),h=e=>o(c?e:e[0]??``);return(0,j.jsxs)(`fieldset`,{"aria-invalid":i?!0:void 0,"aria-describedby":i?m:void 0,className:`flex flex-col gap-2`,children:[(0,j.jsx)(`legend`,{className:`text-sm font-medium`,children:t}),(0,j.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:l.map(e=>{let t=rp(s,u.get(e),e);return(0,j.jsxs)(`li`,{className:`flex items-center gap-1 rounded-control border border-line bg-field py-0.5 pl-2.5 pr-1 text-sm`,children:[(0,j.jsx)(`span`,{children:t}),(0,j.jsx)(`button`,{type:`button`,disabled:a,"aria-label":`Remove ${t}`,onClick:()=>h(l.filter(t=>t!==e)),className:`inline-flex size-5 items-center justify-center rounded-control text-muted hover:bg-hover hover:text-text focus-visible:outline-2 focus-visible:outline-focus`,children:(0,j.jsx)(R,{size:13,strokeWidth:1.75,"aria-hidden":!0})})]},e)})}),(0,j.jsx)(w,{className:`self-start`,disabled:a||!s,onClick:()=>p(!0),children:`Choose records`}),i&&(0,j.jsx)(`p`,{id:m,className:`text-xs text-danger-text`,children:i}),f&&s&&(0,j.jsx)(dp,{title:`Choose ${t}`,target:s,selected:l,known:u,maxSelect:c?Number(e.maxSelect):1,onClose:()=>p(!1),onSelect:e=>{d(t=>{let n=new Map(t);return e.forEach(e=>n.set(e.id,e)),n}),h(e.map(e=>e.id)),p(!1)}})]})}function pp({name:e,value:t,error:n,disabled:r,onChange:i}){let a=(0,T.useId)(),o={"aria-invalid":n?!0:void 0,"aria-describedby":n?a:void 0};return(0,j.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,j.jsx)(`legend`,{className:`text-sm font-medium`,children:e}),(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,j.jsx)(zl,{label:`Longitude`,min:-180,max:180,step:`any`,value:t.lon,disabled:r,...o,onChange:e=>i({...t,lon:e.target.value})}),(0,j.jsx)(zl,{label:`Latitude`,min:-90,max:90,step:`any`,value:t.lat,disabled:r,...o,onChange:e=>i({...t,lat:e.target.value})})]}),n&&(0,j.jsx)(`p`,{id:a,className:`text-xs text-danger-text`,children:n})]})}function mp({name:e,value:t,error:n,disabled:r,onChange:i}){return(0,j.jsx)(m,{label:e,language:`json`,value:t,error:n,disabled:r,onChange:i})}function hp({name:e,options:t,multiple:n,value:r,error:i,disabled:a,onChange:o}){let s=(0,T.useId)();if(!n)return(0,j.jsxs)(Vl,{label:e,value:r,error:i,disabled:a,onChange:e=>o(e.target.value),children:[(0,j.jsx)(`option`,{value:``}),t.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))]});let c=r;return(0,j.jsxs)(`fieldset`,{"aria-invalid":i?!0:void 0,"aria-describedby":i?s:void 0,className:`flex flex-col gap-1`,children:[(0,j.jsx)(`legend`,{className:`text-sm font-medium`,children:e}),t.map(e=>(0,j.jsx)(Ps,{label:e,checked:c.includes(e),disabled:a,onChange:n=>o(n.target.checked?t.filter(t=>t===e||c.includes(t)):c.filter(t=>t!==e))},e)),i&&(0,j.jsx)(`p`,{id:s,className:`text-xs text-danger-text`,children:i})]})}function gp({field:e,value:t,record:n,disabled:r,localError:i,onChange:a}){let o=Y(e.name)??i,s=e.name,c=t;switch(e.type){case`text`:case`email`:case`url`:return(0,j.jsx)(kl,{label:s,type:e.type===`text`?`text`:e.type,hint:e.name===`id`&&e.primaryKey?`Leave empty to generate`:void 0,value:c,error:o,disabled:r,onChange:e=>a(e.target.value)});case`number`:return(0,j.jsx)(zl,{label:s,step:e.onlyInt?1:`any`,value:c,error:o,disabled:r,onChange:e=>a(e.target.value)});case`bool`:return(0,j.jsx)(Ps,{label:s,checked:t,error:o,disabled:r,onChange:e=>a(e.target.checked)});case`date`:return(0,j.jsx)(Vf,{name:s,value:c,error:o,disabled:r,onChange:a});case`select`:return(0,j.jsx)(hp,{name:s,options:e.values??[],multiple:jf(e),value:t,error:o,disabled:r,onChange:a});case`json`:return(0,j.jsx)(mp,{name:s,value:c,error:o,disabled:r,onChange:a});case`editor`:return(0,j.jsx)(Yf,{name:s,value:c,error:o,disabled:r,onChange:a});case`geoPoint`:return(0,j.jsx)(pp,{name:s,value:t,error:o,disabled:r,onChange:a});case`file`:return(0,j.jsx)(cp,{field:e,name:s,value:t,record:n,error:o,disabled:r,onChange:a});case`relation`:return(0,j.jsx)(fp,{field:e,name:s,value:t,record:n,error:o,disabled:r,onChange:a});default:return null}}var _p=e=>e.type!==`password`;function vp({isNew:e,password:t,confirm:n,onChange:r}){let[i,a]=(0,T.useState)(e),o=Y(`password`),s=Y(`passwordConfirm`);return(0,j.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[!e&&(0,j.jsx)(Ps,{label:`Change password`,checked:i,onChange:e=>{a(e.target.checked),e.target.checked||r(``,``)}}),i&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(kl,{label:`Password`,type:`password`,autoComplete:`new-password`,value:t,error:o,onChange:e=>r(e.target.value,n)}),(0,j.jsx)(kl,{label:`Confirm password`,type:`password`,autoComplete:`new-password`,value:n,error:s,onChange:e=>r(t,e.target.value)})]})]})}var yp=[`autodate`,`file`,`password`];function bp(e,t){let n={...t,id:``};for(let t of Af(e))yp.includes(t.type)&&delete n[t.name];return n}function xp({collection:e,recordId:t,prefill:n,onClose:r,onDuplicate:i}){let a=z(),o=t===`new`,s=a.records(e.name),c=ks({queryKey:[`records`,e.id,{id:t}],queryFn:({signal:n})=>s.findOne(t,{expand:Mf(e)},{signal:n}),enabled:!o}),l=e.type===`view`,u=o?`New record`:l?`Record`:`Edit record`,d=null;return!o&&c.isError?d=(0,j.jsx)(`p`,{role:`alert`,children:J(c.error)}):!o&&!c.data&&(d=(0,j.jsx)(`p`,{children:`Loading...`})),d?(0,j.jsx)(Ol,{open:!0,variant:`side`,title:u,onClose:r,children:d}):(0,j.jsx)(Sp,{collection:e,title:u,isNew:o,readOnly:l,record:o?n:c.data,onClose:r,onDuplicate:i})}function Sp({collection:e,title:t,isNew:n,readOnly:r,record:i,onClose:a,onDuplicate:o}){let s=z(),c=oo(),l=Br(),u=Ml(),d=Ql(),f=(0,T.useId)(),p=If(e,i),[m,h]=(0,T.useState)(null),[g,_]=(0,T.useState)({}),v=e.type===`auth`,y=s.records(e.name),b=e.name===`_superusers`&&!!i&&i.id===s.authStore.record?.id,x=()=>{hu({client:s,queryClient:c}),l({to:`/login`})},S=async t=>{let r;try{r=Bf(e,t,n?void 0:i)}catch(e){if(!(e instanceof Of))throw e;h(null),_({[e.field]:`Invalid JSON.`});return}_({}),h(null);try{if(n?await y.create(r):await y.update(i.id,r),b&&t.password){d.success(`Record saved.`),x();return}await c.invalidateQueries({queryKey:[`records`,e.id]}),d.success(`Record saved.`),a()}catch(e){h(e)}},C=Df(e,i??{id:``});(0,T.useEffect)(()=>{if(!m&&Object.keys(g).length===0)return;let e=document.getElementById(f)?.querySelector(`[aria-invalid="true"]`);(e?.matches(`input, select, textarea, button`)?e:e?.querySelector(`input, select, textarea, button`))?.focus()},[m,g,f]);let ee=Ed({defaultValues:p,onSubmit:({value:e})=>S(e)}),te=async()=>JSON.stringify(ee.state.values)===JSON.stringify(p)||await u({title:`Discard unsaved changes?`,message:`Your edits to this record will be lost.`,confirmLabel:`Discard`,cancelLabel:`Keep editing`,danger:!0}),ne=async()=>{await te()&&a()},re=async()=>{if(await u({title:`Delete record`,message:`Delete record ${i.id}? This cannot be undone.`,confirmLabel:`Delete`,danger:!0}))try{if(await y.delete(i.id),b){d.success(`Record deleted.`),x();return}a(),d.success(`Record deleted.`),await c.invalidateQueries({queryKey:[`records`,e.id],predicate:e=>e.queryKey[2]?.id!==i.id})}catch(e){d.error(J(e))}},ie=Af(e).filter(e=>e.type===`password`?!r:!e.hidden&&e.type!==`autodate`&&_p(e)&&(n||e.name!==`id`)),ae=[];i&&!n&&(r||ae.push({key:`duplicate`,label:`Duplicate`}),ae.push({key:`copy`,label:`Copy JSON`}),v&&ae.push(...C.items),r||ae.push({separator:!0},{key:`delete`,label:`Delete`,danger:!0}));let E=t=>{t===`duplicate`?te().then(t=>t&&o(bp(e,i))):t===`copy`?navigator.clipboard.writeText(JSON.stringify(i,null,2)).then(()=>d.success(`Copied.`),()=>d.error(`Could not copy.`)):t===`delete`?re():C.run(t)},oe=n?[]:Af(e).filter(e=>e.type===`autodate`&&!e.hidden&&i?.[e.name]);return(0,j.jsx)(jd,{error:m,children:(0,j.jsxs)(Ol,{open:!0,variant:`side`,title:t,onClose:()=>void ne(),footer:(0,j.jsxs)(j.Fragment,{children:[i&&!n&&(0,j.jsx)(`div`,{className:`mr-auto`,children:(0,j.jsx)(au,{trigger:(0,j.jsx)(w,{icon:(0,j.jsx)(fc,{size:15,"aria-hidden":!0}),children:`More actions`}),placement:`top-start`,items:ae,onAction:E})}),(0,j.jsx)(w,{onClick:()=>void ne(),children:r?`Close`:`Cancel`}),!r&&(0,j.jsx)(ee.Subscribe,{selector:e=>e.isSubmitting,children:e=>(0,j.jsx)(w,{type:`submit`,form:f,variant:`primary`,loading:e,children:n?`Create`:`Save changes`})})]}),children:[(0,j.jsxs)(`form`,{id:f,noValidate:!0,onSubmit:e=>{e.preventDefault(),ee.handleSubmit()},className:`flex flex-col gap-4`,children:[(0,j.jsx)(`div`,{className:`flex flex-col gap-4`,children:ie.map(e=>e.type===`password`?v&&(0,j.jsx)(ee.Subscribe,{selector:e=>[e.values.password,e.values.passwordConfirm],children:([e,t])=>(0,j.jsx)(vp,{isNew:n,password:e,confirm:t,onChange:(e,t)=>{ee.setFieldValue(`password`,e),ee.setFieldValue(`passwordConfirm`,t)}})},e.name):(0,j.jsx)(ee.Field,{name:e.name,children:t=>(0,j.jsx)(gp,{field:e,value:t.state.value,record:i,disabled:r,localError:g[e.name],onChange:t.handleChange})},e.name))}),!n&&(0,j.jsxs)(`dl`,{className:`flex flex-col gap-1 border-t border-line pt-3 text-xs text-muted`,children:[(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`dt`,{children:`id`}),(0,j.jsx)(`dd`,{className:`font-mono`,children:i.id})]}),oe.map(e=>(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`dt`,{children:e.name}),(0,j.jsx)(`dd`,{children:Tf(String(i[e.name]))})]},e.name))]}),(0,j.jsx)(X,{})]}),C.dialog]})})}var Cp=`[&_tr>:nth-child(1)]:sticky [&_tr>:nth-child(1)]:left-0 [&_tr>:nth-child(1)]:z-[5] [&_thead_tr>:nth-child(1)]:z-20`,wp=`[&_tr>:nth-child(2)]:sticky [&_tr>:nth-child(2)]:left-10 [&_tr>:nth-child(2)]:z-[5] [&_thead_tr>:nth-child(2)]:z-20`,Tp=`cursor-pointer bg-surface [&>td]:bg-surface [&:not([data-selected]):hover>td]:shadow-[inset_0_0_0_100vmax_var(--hb-hover)] data-[selected]:[&>td]:shadow-[inset_0_0_0_100vmax_var(--hb-accent-soft)]`;function Ep(e,t){return e===t?`asc`:e===`-${t}`?`desc`:null}function Dp({caption:e,fields:t,rows:n,sort:r,selected:i,onSort:a,onSelect:o,onSelectAll:s,onOpen:c,selectable:l=!0}){let[u,d]=(0,T.useState)({left:!1,right:!1}),f=(0,T.useRef)(null),p=e=>{let t=e.scrollLeft>0,n=e.scrollLeft+e.clientWidth<e.scrollWidth-1;d(e=>e.left===t&&e.right===n?e:{left:t,right:n})};(0,T.useLayoutEffect)(()=>{let e=f.current?.querySelector(`.overflow-auto`);if(!e||(p(e),typeof ResizeObserver>`u`))return;let t=new ResizeObserver(()=>p(e));return t.observe(e),e.firstElementChild&&t.observe(e.firstElementChild),()=>t.disconnect()},[t.length,n.length]);let m=t[0]?.name===`id`,h=[l?Cp:``,m?l?wp:Cp:``].join(` `),g=e=>{let t=Ep(r,e);return t===null?e:t===`asc`?`-${e}`:``},_=n.length>0&&n.every(e=>i.has(e.id)),v=e=>String(e.title??e.name??e.id);return(0,j.jsxs)(`div`,{ref:f,onScrollCapture:e=>p(e.target),className:`relative ${h}`,children:[(0,j.jsx)(Op,{side:`left`,show:u.left}),(0,j.jsx)(Op,{side:`right`,show:u.right}),(0,j.jsxs)(Hl,{caption:e,stickyHeader:!0,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[l&&(0,j.jsx)(`th`,{scope:`col`,className:`w-10 border-b border-line px-3 py-2`,children:(0,j.jsx)(Ps,{hideLabel:!0,label:`Select all`,checked:_,onChange:e=>s(e.target.checked)})}),t.map(e=>(0,j.jsx)(Wl,{sort:Ep(r,e.name),onSort:()=>a(g(e.name)),children:e.name},e.name))]})}),(0,j.jsx)(`tbody`,{children:n.map(e=>(0,j.jsxs)(`tr`,{tabIndex:0,"data-selected":i.has(e.id)||void 0,className:Tp,onClick:()=>c(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&t.target===t.currentTarget&&(t.preventDefault(),c(e.id))},children:[l&&(0,j.jsx)(Gl,{children:(0,j.jsx)(Ps,{hideLabel:!0,label:`Select ${v(e)}`,checked:i.has(e.id),onClick:e=>e.stopPropagation(),onChange:()=>o(e.id)})}),t.map(t=>(0,j.jsx)(Gl,{children:op({field:t,value:e[t.name],record:e})},t.name))]},e.id))})]})]})}function Op({side:e,show:t}){return(0,j.jsx)(`div`,{"aria-hidden":!0,"data-edge":e,className:`pointer-events-none absolute inset-y-0 z-30 w-3 transition-opacity motion-reduce:transition-none ${e===`left`?`left-0 bg-gradient-to-r`:`right-0 bg-gradient-to-l`} from-black/15 to-transparent ${t?`opacity-100`:`opacity-0`}`})}var kp=[`=`,`!=`,`>`,`>=`,`<`,`<=`,`~`,`!~`],Ap=[`@now`,`@yesterday`,`@tomorrow`,`@second`,`@minute`,`@hour`,`@day`,`@month`,`@weekday`,`@year`,`@todayStart`,`@todayEnd`,`@monthStart`,`@monthEnd`,`@yearStart`,`@yearEnd`],jp=[`id`,`collectionId`,`collectionName`],Mp=/[\w@.:+-]+$/,Np=/[?!=<>~]+$/,Pp=/[&|]+$/,Fp=/\s+|(["'`])(?:\\.|(?!\1)[^\\])*(?:\1|$)|&&|\|\||\??(?:!=|!~|>=|<=|=|>|<|~)|[\w@.:+-]+|[(),]|[^]/y,Ip={fields:[{name:`id`,type:`text`},{name:`created`,type:`autodate`},{name:`level`,type:`number`},{name:`message`,type:`text`},{name:`data.status`,type:`number`},{name:`data.method`,type:`text`},{name:`data.url`,type:`text`},{name:`data.auth`,type:`text`},{name:`data.userIP`,type:`text`},{name:`data.execTime`,type:`number`}]},Lp=(e,t,n=`variable`)=>({label:e,detail:t,type:n});function Rp(e){let t=[];Fp.lastIndex=0;let n;for(;Fp.lastIndex<e.length&&(n=Fp.exec(e));){let e=n[0];if(!/^\s/.test(e)){if(n[1]){if(e.length<2||!e.endsWith(n[1]))return null;t.push({kind:`word`})}else e===`&&`||e===`||`?t.push({kind:`logic`}):e===`(`?t.push({kind:`open`}):e===`)`?t.push({kind:`close`}):e===`,`?t.push({kind:`comma`}):/^\??[!=<>~]/.test(e)?t.push({kind:`op`}):/^[\w@.:+-]/.test(e)&&t.push({kind:`word`})}}return t}function zp(e){let t=[],n=`operand`,r=!1,i=e=>{n=t.at(-1)?.fn?`arg`:e?`logic`:`operator`};return e.forEach((a,o)=>{if(a.kind===`word`)e[o+1]?.kind!==`open`&&i(r);else if(a.kind===`op`)n=`operand`,r=!0;else if(a.kind===`logic`)n=`operand`,r=!1;else if(a.kind===`open`){let i=e[o-1]?.kind===`word`;t.push({fn:i,right:r}),n=`operand`,r=i}else if(a.kind===`close`){let e=t.pop();e?.fn?(r=e.right,i(e.right)):n=`logic`}else n=`operand`,r=!0}),{state:n,depth:t.length}}var Bp=(e,t)=>e.type!==`password`&&(t||!e.hidden);function Vp(e,t){let n=!!e.request,r=e.collections??[],i=(e,t)=>t.fields.filter(e=>Bp(e,!1)).map(t=>Lp(`${e}.${t.name}`,t.type)),a=[];for(let t of e.fields){if(!Bp(t,n)||(a.push(Lp(t.name,t.type)),t.type!==`relation`))continue;let e=r.find(e=>e.id===t.collectionId);e&&a.push(...i(t.name,e))}for(let t of r)for(let n of t.fields){if(n.type!==`relation`||n.collectionId!==e.collectionId)continue;let r=`${t.name}_via_${n.name}`;a.push(Lp(r,`back-relation`),...i(r,t))}if(n){a.push(Lp(`@request.method`,`request`),Lp(`@request.context`,`request`),Lp(`@request.query.`,`request`),Lp(`@request.headers.`,`request`));for(let[e,t]of Hp(r))a.push(Lp(`@request.auth.${e}`,t));if(e.request.body)for(let t of e.fields)a.push(Lp(`@request.body.${t.name}`,t.type));let n=/^@collection\.(\w+)(?::\w+)?\./.exec(t),o=n&&r.find(e=>e.name===n[1]);if(n&&o)a.push(...i(n[0].slice(0,-1),o));else for(let e of r)a.push(Lp(`@collection.${e.name}.`,`collection`))}return a.push(...Ap.map(e=>Lp(e,`macro`)),Lp(`geoDistance(`,`function`,`function`),Lp(`strftime(`,`function`,`function`),Lp(`true`,`literal`,`keyword`),Lp(`false`,`literal`,`keyword`),Lp(`null`,`literal`,`keyword`),Lp(`""`,`literal`,`keyword`)),a}function Hp(e){let t=new Map(jp.map(e=>[e,`text`]));for(let n of e)if(n.type===`auth`)for(let e of n.fields)Bp(e,!1)&&t.set(e.name,e.type);return t}var Up=(e,t)=>e.find(e=>e.name===t)?.type;function Wp(e,t){let n=e.collections??[],r=e=>n.find(t=>t.name===e),i=Up(e.fields,t);if(i)return i;if(t.startsWith(`@request.body.`))return Up(e.fields,t.slice(14));if(t.startsWith(`@request.auth.`))return Hp(n).get(t.slice(14));let a=/^@collection\.(\w+)(?::\w+)?\.(.+)$/.exec(t),o=e.fields,s=t;if(a){let e=r(a[1]);if(!e)return;o=e.fields,s=a[2]}let c=s.split(`.`);for(let[e,t]of c.entries()){if(e===c.length-1)return Up(o,t);let i=/^(\w+)_via_\w+$/.exec(t),a=o.find(e=>e.name===t),s=i?r(i[1]):n.find(e=>e.id===a?.collectionId);if(!s)return;o=s.fields}}var Gp=[`select`,`relation`,`file`],Kp=[...jp,`email`,`emailVisibility`,`verified`];function qp(e,t){let n=t.slice(0,t.lastIndexOf(`:`)),r=Wp(e,n),i=r!==void 0&&Gp.includes(r)?[`length`,`each`,`lower`]:[`lower`],a=i;return n.startsWith(`@request.body.`)?a=[`isset`,`changed`,...i]:n.startsWith(`@request.auth.`)?Kp.includes(n.slice(14))&&(a=[`isset`,`lower`]):n.startsWith(`@request.`)&&(a=[`isset`,`lower`]),a.map(e=>Lp(e,`modifier`,`keyword`))}var Jp=()=>[...kp.map(e=>Lp(e,`operator`,`keyword`)),...kp.map(e=>Lp(`?${e}`,`operator`,`keyword`))],Yp=()=>[Lp(`&&`,`logic`,`keyword`),Lp(`||`,`logic`,`keyword`)];function Xp(e){return(t,n)=>{let r=t.slice(0,n);if(!Rp(r))return null;let i=Mp.exec(r)??Np.exec(r)??Pp.exec(r),a=i?.index??n,{state:o,depth:s}=zp(Rp(r.slice(0,a))),c=(e,t)=>({from:e,options:t}),l=i&&Mp.test(i[0])?i[0]:``;if(l)return o===`operand`?l.replace(/^@collection\.\w+(?::\w+)?\./,``).includes(`:`)&&!/^@collection\.\w+:\w*$/.test(l)?c(a+l.lastIndexOf(`:`)+1,qp(e,l)):c(a,Vp(e,l)):null;if(i&&Np.test(i[0]))return o===`operator`?c(a,Jp()):null;if(i&&Pp.test(i[0]))return o===`logic`?c(a,Yp()):null;if(o===`operand`)return c(n,Vp(e,``));if(o===`operator`)return c(n,Jp());let u=Lp(`)`,`logic`,`keyword`);return o===`arg`?c(n,[Lp(`,`,`separator`,`keyword`),u]):c(n,[...Yp(),...s?[u]:[]])}}function Zp(e){try{let t=JSON.parse(localStorage.getItem(e)??`[]`);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function Qp(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}var $p=`hb_filter_history`;function em({filter:e,error:t,label:n=`Filter records`,placeholder:r=`e.g. title ~ "hello" && created > "2026-01-01"`,suggest:i,onSearch:a}){let[o,s]=(0,T.useState)(e),[c,l]=(0,T.useState)(e),[u,d]=(0,T.useState)(()=>Zp($p));e!==c&&(l(e),s(e));let f=e=>{if(e){let t=[e,...u.filter(t=>t!==e)].slice(0,10);d(t),Qp($p,t)}a(e)};return(0,j.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,j.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,j.jsx)(m,{label:n,hideLabel:!0,singleLine:!0,placeholder:r,suggest:i,value:o,error:t,onChange:s,onRun:()=>f(o.trim())})}),(0,j.jsx)(w,{disabled:!o&&!e,onClick:()=>{s(``),a(``)},children:`Clear`}),(0,j.jsx)(au,{trigger:(0,j.jsx)(w,{disabled:u.length===0,children:`Recent filters`}),items:u.map(e=>({key:e,label:e})),placement:`bottom-end`,onAction:e=>{s(e),f(e)}})]})}function tm(e){let t={};typeof e.filter==`string`&&e.filter&&(t.filter=e.filter),typeof e.sort==`string`&&e.sort&&(t.sort=e.sort),typeof e.record==`string`&&e.record&&(t.record=e.record);let n=Number(e.page);return Number.isInteger(n)&&n>=1&&(t.page=n),t}function nm({collection:e}){let t=z(),n=oo(),r=Ml(),i=Ql(),a=Z(),o=sf(),[s,c]=(0,T.useState)(!1),l=Br(),u=zr({strict:!1}),d=e.type===`view`,p=`hb_columns_${e.id}`,[m,h]=(0,T.useState)(()=>Zp(p)),[g,_]=(0,T.useState)(new Set),[v,y]=(0,T.useState)(),b=u.page??1,x=u.filter??``,S=u.sort??``,C=e.fields.filter(e=>!e.hidden),ee=C.filter(e=>!m.includes(e.name)),te=Mf(e),ne=C.filter(e=>e.type!==`password`).map(e=>e.name),re=af(),ie=Xp({collectionId:e.id,fields:C,collections:re.data}),ae={page:b,filter:x,sort:S},E=ks({queryKey:tf.records(e.id,ae),queryFn:({signal:n})=>t.records(e.name).findMany({page:b,perPage:40,filter:up(x,ne),sort:S||(d?``:`-@rowid`),expand:te},{signal:n}),placeholderData:e=>e}),oe=e=>l({to:`.`,search:t=>tm({...t,...e})}),se=e=>{let t=m.includes(e)?m.filter(t=>t!==e):[...m,e];h(t),Qp(p,t)},ce=e=>_(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),le=async()=>{let a=[...g];if(!await r({title:`Delete records`,message:`Delete ${a.length} selected record${a.length===1?``:`s`}? This cannot be undone.`,confirmLabel:`Delete`,danger:!0}))return;let o=await Promise.allSettled(a.map(n=>t.records(e.name).delete(n))),s=new Set(a.filter((e,t)=>o[t].status===`rejected`));if(s.size===0)i.success(`Records deleted.`);else{let e=a.length-s.size;i.error(`Deleted ${e} of ${a.length} records, ${s.size} failed.`)}_(s),await n.invalidateQueries({queryKey:[`records`,e.id]})},ue=()=>{y(void 0),oe({record:`new`})},de=E.data?.items??[];return(0,j.jsxs)(V,{width:`full`,crumbs:[{label:`Collections`,to:`/collections`},{label:e.name}],footer:E.data&&!E.isError?`Total: ${E.data.totalItems}`:void 0,actions:(0,j.jsxs)(j.Fragment,{children:[g.size>0&&(0,j.jsxs)(w,{variant:`danger`,onClick:le,children:[`Delete selected (`,g.size,`)`]}),(0,j.jsx)(w,{onClick:()=>c(!0),children:`API preview`}),(0,j.jsx)(bf,{names:C.map(e=>e.name),hidden:m,onToggle:se}),!d&&(0,j.jsx)(w,{variant:`primary`,onClick:ue,children:`New record`}),!o&&(0,j.jsx)(f,{content:`Edit ${e.name}`,children:(0,j.jsx)(w,{"aria-label":`Edit ${e.name}`,onClick:()=>a(e),icon:(0,j.jsx)(ol,{"aria-hidden":!0,size:15,strokeWidth:1.75})})})]}),children:[(0,j.jsx)(em,{filter:x,suggest:ie,error:E.error?Dd(E.error):void 0,onSearch:e=>{_(new Set),oe({filter:e,page:1})}}),E.isError?(0,j.jsx)(Ll,{title:`Could not load records`,children:x&&(0,j.jsx)(w,{onClick:()=>oe({filter:``,page:1}),children:`Clear filter`})}):E.data?de.length===0?x?(0,j.jsx)(Ll,{title:`No records match this filter`,icon:(0,j.jsx)(nl,{size:15,strokeWidth:1.75,"aria-hidden":!0})}):(0,j.jsx)(Ll,{title:`No records yet`,icon:(0,j.jsx)(Oc,{size:15,strokeWidth:1.75,"aria-hidden":!0}),children:!d&&(0,j.jsx)(w,{variant:`primary`,onClick:ue,children:`New record`})}):(0,j.jsx)(Dp,{caption:`${e.name} records`,fields:ee,rows:de,sort:S,selected:g,onSort:e=>{_(new Set),oe({sort:e,page:1})},selectable:!d,onSelect:ce,onSelectAll:e=>_(new Set(e?de.map(e=>e.id):[])),onOpen:e=>oe({record:e})}):(0,j.jsx)(`p`,{role:`status`,className:`text-sm text-muted`,children:`Loading...`}),s&&(0,j.jsx)(df,{collection:e,onClose:()=>c(!1)}),E.data&&!E.isError&&(0,j.jsx)(xf,{page:E.data.page,totalPages:E.data.totalPages,onPage:e=>{_(new Set),oe({page:e})}}),u.record&&(0,j.jsx)(xp,{collection:e,recordId:u.record,prefill:v,onClose:()=>oe({record:void 0}),onDuplicate:e=>{y(e),oe({record:`new`})}},u.record)]})}function rm({query:e}){return e.isError?(0,j.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-3 rounded-control border border-danger/40 bg-danger/10 p-3 text-sm text-danger-text`,children:[(0,j.jsx)(`p`,{children:J(e.error)}),(0,j.jsx)(w,{onClick:()=>void e.refetch(),children:`Retry`})]}):(0,j.jsx)(`p`,{role:`status`,className:`text-sm text-muted`,children:`Loading...`})}function im({changes:e,onConfirm:t,onCancel:n}){let{renamedCollection:r,deletedFields:i,renamedFields:a,changedRules:o}=e;return(0,j.jsxs)(Ol,{open:!0,onClose:n,title:`Confirm changes`,footer:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(w,{onClick:n,children:`Cancel`}),(0,j.jsx)(w,{variant:`primary`,onClick:t,children:`Confirm`})]}),children:[(0,j.jsx)(`p`,{className:`text-sm`,children:`Review these changes before saving.`}),(0,j.jsxs)(`ul`,{className:`mt-2 list-disc pl-5 text-sm`,children:[r&&(0,j.jsxs)(`li`,{children:[`Rename collection `,r[0],` to `,r[1]]}),i.map(e=>(0,j.jsxs)(`li`,{children:[`Delete field `,e]},`delete-${e}`)),a.map(([e,t])=>(0,j.jsxs)(`li`,{children:[`Rename field `,e,` to `,t]},`rename-${e}`)),o.length>0&&(0,j.jsxs)(`li`,{children:[`Change API rules: `,o.join(`, `)]})]}),i.length>0&&(0,j.jsx)(`p`,{className:`mt-2 text-sm text-danger-text`,children:`Deleted fields lose all their data.`})]})}var am=0,om=()=>`f${++am}`,sm=[{type:`text`,label:`Plain text`},{type:`editor`,label:`Rich editor`},{type:`number`,label:`Number`},{type:`bool`,label:`Bool`},{type:`email`,label:`Email`},{type:`url`,label:`URL`},{type:`date`,label:`Date`},{type:`autodate`,label:`Autodate`},{type:`select`,label:`Select`},{type:`file`,label:`File`},{type:`relation`,label:`Relation`},{type:`json`,label:`JSON`},{type:`geoPoint`,label:`Geo point`},{type:`password`,label:`Password`}],cm=()=>({exceptDomains:[],onlyDomains:[]}),lm={text:()=>({autogeneratePattern:``,max:0,min:0,pattern:``,primaryKey:!1}),number:()=>({max:null,min:null,onlyInt:!1}),bool:()=>({}),email:cm,url:cm,date:()=>({max:``,min:``}),autodate:()=>({onCreate:!1,onUpdate:!1}),select:()=>({maxSelect:0,values:[]}),json:()=>({maxSize:0}),relation:()=>({cascadeDelete:!1,collectionId:``,maxSelect:0,minSelect:0}),file:()=>({maxSelect:0,maxSize:0,mimeTypes:[],protected:!1,thumbs:[]}),editor:()=>({maxSize:0,convertURLs:!1}),geoPoint:()=>({}),password:()=>({cost:0,max:0,min:0,pattern:``})};function um(e){return sm.find(t=>t.type===e)?.label??e}function dm(e){return{_key:om(),name:``,type:e,system:!1,hidden:!1,presentable:!1,...e===`autodate`?{}:{help:``,required:!1},...lm[e]()}}var fm='`[^`]*`|"[^"]*"|\\[[^\\]]*\\]|\\w+',pm=RegExp(`^\\s*CREATE\\s+(UNIQUE\\s+)?INDEX\\s+(?:IF\\s+NOT\\s+EXISTS\\s+)?(?:(?:${fm})\\.)?(${fm})\\s+ON\\s+(${fm})\\s*\\(`,`i`),mm=RegExp(`^\\s*(${fm})`),hm=RegExp(`^\\s*(?:${fm})\\s*$`),gm=e=>"`"+e.replaceAll("`","``")+"`",_m=e=>/^[`"[]/.test(e)?e.slice(1,-1):e;function vm(){let e=crypto.getRandomValues(new Uint8Array(10));return`idx_`+Array.from(e,e=>`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`[e%62]).join(``)}function ym(e){let t=gm(e.name??vm()),n=e.columns.map(gm).join(`, `);return`CREATE ${e.unique?`UNIQUE `:``}INDEX ${t} ON ${gm(e.table)} (${n})`}function bm(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];if(a===`(`)n++;else if(a===`)`){if(n===0)return t.push(e.slice(r,i)),{parts:t,end:i+1};n--}else a===`,`&&n===0&&(t.push(e.slice(r,i)),r=i+1)}return null}function xm(e){let t=pm.exec(e);if(!t)return null;let n=e.slice(t[0].length),r=bm(n),i=r?.parts.map(e=>mm.exec(e)?.[1]);return!r||!i||i.some(e=>!e)?null:{name:_m(t[2]),unique:!!t[1],table:_m(t[3]),columns:i.map(e=>_m(e)),simple:r.parts.every(e=>hm.test(e))&&/^\s*;?\s*$/.test(n.slice(r.end))}}var Sm=[`listRule`,`viewRule`,`createRule`,`updateRule`,`deleteRule`,`authRule`,`manageRule`],Cm=RegExp(`\\bON\\s+(${fm})`,`i`),wm=RegExp(`(\\bINDEX\\s+(?:IF\\s+NOT\\s+EXISTS\\s+)?)(${fm})`,`i`),Tm=RegExp(`'(?:[^']|'')*'|${fm}`,`g`);function Em(e,t,n){let r=Cm.exec(e);if(!r)return e;let i=r.index+r[0].length,[a,o]=t;return(a!==o&&_m(r[1]).toLowerCase()===a.toLowerCase()?e.slice(0,i-r[1].length)+gm(o):e.slice(0,i))+e.slice(i).replace(Tm,(e,t,r)=>{if(e.startsWith(`'`))return e;let i=n.get(_m(e).toLowerCase()),a=/^\s*\(/.test(r.slice(t+e.length));return i===void 0||a?e:gm(i)})}var Dm={select:{maxSelect:1},relation:{maxSelect:1},file:{maxSelect:1},autodate:{onCreate:!0}};function Om(e){let t=structuredClone(e);return{...t,_originalName:e.name,fields:t.fields.map(e=>({...e,_key:om(),_original:e.name}))}}function km(e,t){return Om(t[e])}function Am(e){let t=Om(e);return{...t,id:``,name:`${e.name}_duplicate`,system:!1,fields:t.fields.map(({id:e,...t})=>t),indexes:t.indexes.map(e=>e.replace(wm,(e,t)=>t+gm(vm())))}}function jm(e,t){let n=new Set(e.map(e=>e.name.toLowerCase())),r=`field`;for(let e=2;n.has(r);e++)r=`field${e}`;return{...dm(t),...Dm[t],name:r}}function Mm(e,t){return{...e,name:t}}function Nm(e){return e.fields.filter(e=>!e._removed)}function Pm(e){let t=new Map;for(let n of e.fields)n._original!==void 0&&n._original!==n.name&&t.set(n._original.toLowerCase(),n.name);return e.indexes.map(n=>Em(n,[e._originalName,e.name],t))}function Fm(e,t){return{...e,_originalName:e.name,fields:e.fields.map(e=>({...e,_original:e.name})),indexes:t}}function Im(e){let{id:t,_originalName:n,created:r,updated:i,fields:a,...o}=e;return{...t?{id:t}:{},...o,indexes:Pm(e),...e.type===`view`?{}:{fields:Nm(e).map(({_key:e,_removed:t,_original:n,...r})=>r)}}}function Lm(e,t){let n=Nm(t),r=[],i=[];for(let t of e.fields){let e=n.find(e=>e.id&&e.id===t.id);e?e.name!==t.name&&r.push([String(t.name),e.name]):i.push(String(t.name))}return{renamedCollection:e.name===t.name?null:[e.name,t.name],deletedFields:i,renamedFields:r,changedRules:Sm.filter(n=>(e[n]??null)!==(t[n]??null))}}function Rm(e){return!!e.renamedCollection||e.deletedFields.length>0||e.renamedFields.length>0||e.changedRules.length>0}function zm(e,t){return Ed({defaultValues:e,onSubmitMeta:{confirmed:!1},onSubmit:({value:e,meta:n})=>t(e,n.confirmed)})}var Bm=`rounded-full border border-line bg-hover px-2.5 py-0.5 text-xs text-text hover:border-accent hover:text-accent-text focus-visible:outline-2 focus-visible:outline-focus`,Vm={Images:[`image/jpeg`,`image/png`,`image/svg+xml`,`image/gif`,`image/webp`],Documents:[`application/pdf`,`application/msword`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,`application/vnd.ms-excel`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,`text/plain`,`text/csv`],Videos:[`video/mp4`,`video/webm`,`video/quicktime`,`video/x-ms-wmv`],Archives:[`application/zip`,`application/x-7z-compressed`,`application/x-rar-compressed`,`application/gzip`]},Hm=(e,t)=>Y(`${e.errorPath}.${t}`);function Um({p:e,k:t,label:n,hint:r}){return(0,j.jsx)(kl,{label:n,hint:r,value:String(e.field[t]??``),error:Hm(e,t),onChange:n=>e.onChange({[t]:n.target.value})})}function Wm({p:e,k:t,label:n,nullable:r}){let i=e.field[t];return(0,j.jsx)(zl,{label:n,step:r?`any`:void 0,value:typeof i==`number`?i:``,error:Hm(e,t),onChange:n=>e.onChange({[t]:n.target.value===``?r?null:0:Number(n.target.value)})})}function Gm({p:e,k:t,label:n,disabled:r}){return(0,j.jsx)(Ps,{label:n,checked:!!e.field[t],disabled:r,error:Hm(e,t),onChange:n=>e.onChange({[t]:n.target.checked})})}function Km({p:e,k:t,label:n,hint:r,disabled:i,lines:a}){let o=e.field[t]??[],s=a?`
|