var xd=e=>{throw TypeError(e)};var ku=(e,t,n)=>t.has(e)||xd("Cannot "+n);var S=(e,t,n)=>(ku(e,t,"read from private field"),n?n.call(e):t.get(e)),Q=(e,t,n)=>t.has(e)?xd("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),j=(e,t,n,r)=>(ku(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),X=(e,t,n)=>(ku(e,t,"access private method"),n);var fo=(e,t,n,r)=>({set _(i){j(e,t,i,n)},get _(){return S(e,t,r)}});function W0(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();var ts=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cm={exports:{}},Us={},Pm={exports:{}},J={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var to=Symbol.for("react.element"),q0=Symbol.for("react.portal"),K0=Symbol.for("react.fragment"),G0=Symbol.for("react.strict_mode"),X0=Symbol.for("react.profiler"),J0=Symbol.for("react.provider"),Y0=Symbol.for("react.context"),Z0=Symbol.for("react.forward_ref"),e1=Symbol.for("react.suspense"),t1=Symbol.for("react.memo"),n1=Symbol.for("react.lazy"),Sd=Symbol.iterator;function r1(e){return e===null||typeof e!="object"?null:(e=Sd&&e[Sd]||e["@@iterator"],typeof e=="function"?e:null)}var _m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Tm=Object.assign,Rm={};function Ui(e,t,n){this.props=e,this.context=t,this.refs=Rm,this.updater=n||_m}Ui.prototype.isReactComponent={};Ui.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ui.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Om(){}Om.prototype=Ui.prototype;function Xc(e,t,n){this.props=e,this.context=t,this.refs=Rm,this.updater=n||_m}var Jc=Xc.prototype=new Om;Jc.constructor=Xc;Tm(Jc,Ui.prototype);Jc.isPureReactComponent=!0;var kd=Array.isArray,bm=Object.prototype.hasOwnProperty,Yc={current:null},Nm={key:!0,ref:!0,__self:!0,__source:!0};function Im(e,t,n){var r,i={},l=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(l=""+t.key),t)bm.call(t,r)&&!Nm.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,re=D[Z];if(0>>1;Zi(qe,x))uei(ce,qe)?(D[Z]=ce,D[ue]=x,Z=ue):(D[Z]=qe,D[Ce]=x,Z=Ce);else if(uei(ce,x))D[Z]=ce,D[ue]=x,Z=ue;else break e}}return V}function i(D,V){var x=D.sortIndex-V.sortIndex;return x!==0?x:D.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var u=[],a=[],c=1,f=null,d=3,h=!1,g=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(D){for(var V=n(a);V!==null;){if(V.callback===null)r(a);else if(V.startTime<=D)r(a),V.sortIndex=V.expirationTime,t(u,V);else break;V=n(a)}}function C(D){if(v=!1,y(D),!g)if(n(u)!==null)g=!0,Y(P);else{var V=n(a);V!==null&&le(C,V.startTime-D)}}function P(D,V){g=!1,v&&(v=!1,p(R),R=-1),h=!0;var x=d;try{for(y(V),f=n(u);f!==null&&(!(f.expirationTime>V)||D&&!M());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,d=f.priorityLevel;var re=Z(f.expirationTime<=V);V=e.unstable_now(),typeof re=="function"?f.callback=re:f===n(u)&&r(u),y(V)}else r(u);f=n(u)}if(f!==null)var k=!0;else{var Ce=n(a);Ce!==null&&le(C,Ce.startTime-V),k=!1}return k}finally{f=null,d=x,h=!1}}var E=!1,T=null,R=-1,L=5,z=-1;function M(){return!(e.unstable_now()-zD||125Z?(D.sortIndex=x,t(a,D),n(u)===null&&D===n(a)&&(v?(p(R),R=-1):v=!0,le(C,x-Z))):(D.sortIndex=re,t(u,D),g||h||(g=!0,Y(P))),D},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(D){var V=d;return function(){var x=d;d=V;try{return D.apply(this,arguments)}finally{d=x}}}})(zm);Fm.exports=zm;var m1=Fm.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var y1=b,vt=m1;function N(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),va=Object.prototype.hasOwnProperty,g1=/^[: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]*$/,Cd={},Pd={};function v1(e){return va.call(Pd,e)?!0:va.call(Cd,e)?!1:g1.test(e)?Pd[e]=!0:(Cd[e]=!0,!1)}function w1(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function x1(e,t,n,r){if(t===null||typeof t>"u"||w1(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ze(e,t,n,r,i,l,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=o}var je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){je[e]=new Ze(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];je[t]=new Ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){je[e]=new Ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){je[e]=new Ze(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){je[e]=new Ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){je[e]=new Ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){je[e]=new Ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){je[e]=new Ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){je[e]=new Ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var ef=/[\-:]([a-z])/g;function tf(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ef,tf);je[t]=new Ze(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ef,tf);je[t]=new Ze(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ef,tf);je[t]=new Ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){je[e]=new Ze(e,1,!1,e.toLowerCase(),null,!1,!1)});je.xlinkHref=new Ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){je[e]=new Ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function nf(e,t,n,r){var i=je.hasOwnProperty(t)?je[t]:null;(i!==null?i.type!==0:r||!(2s||i[o]!==l[s]){var u=` `+i[o].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=o&&0<=s);break}}}finally{Pu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?al(e):""}function S1(e){switch(e.tag){case 5:return al(e.type);case 16:return al("Lazy");case 13:return al("Suspense");case 19:return al("SuspenseList");case 0:case 2:case 15:return e=_u(e.type,!1),e;case 11:return e=_u(e.type.render,!1),e;case 1:return e=_u(e.type,!0),e;default:return""}}function ka(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Zr:return"Fragment";case Yr:return"Portal";case wa:return"Profiler";case rf:return"StrictMode";case xa:return"Suspense";case Sa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Um:return(e.displayName||"Context")+".Consumer";case jm:return(e._context.displayName||"Context")+".Provider";case lf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case of:return t=e.displayName||null,t!==null?t:ka(e.type)||"Memo";case Ln:t=e._payload,e=e._init;try{return ka(e(t))}catch{}}return null}function k1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ka(t);case 8:return t===rf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ir(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $m(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function E1(e){var t=$m(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,l.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function mo(e){e._valueTracker||(e._valueTracker=E1(e))}function Hm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$m(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ns(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ea(e,t){var n=t.checked;return xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Td(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ir(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Vm(e,t){t=t.checked,t!=null&&nf(e,"checked",t,!1)}function Ca(e,t){Vm(e,t);var n=ir(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Pa(e,t.type,n):t.hasOwnProperty("defaultValue")&&Pa(e,t.type,ir(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Rd(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Pa(e,t,n){(t!=="number"||ns(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var cl=Array.isArray;function ci(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=yo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Rl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ml={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},C1=["Webkit","ms","Moz","O"];Object.keys(ml).forEach(function(e){C1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ml[t]=ml[e]})});function Km(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ml.hasOwnProperty(e)&&ml[e]?(""+t).trim():t+"px"}function Gm(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Km(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var P1=xe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ra(e,t){if(t){if(P1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(N(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(N(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(N(61))}if(t.style!=null&&typeof t.style!="object")throw Error(N(62))}}function Oa(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ba=null;function sf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Na=null,fi=null,di=null;function Nd(e){if(e=io(e)){if(typeof Na!="function")throw Error(N(280));var t=e.stateNode;t&&(t=Qs(t),Na(e.stateNode,e.type,t))}}function Xm(e){fi?di?di.push(e):di=[e]:fi=e}function Jm(){if(fi){var e=fi,t=di;if(di=fi=null,Nd(e),t)for(e=0;e>>=0,e===0?32:31-(F1(e)/z1|0)|0}var go=64,vo=4194304;function fl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function os(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,l=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s!==0?r=fl(s):(l&=o,l!==0&&(r=fl(l)))}else o=n&~i,o!==0?r=fl(o):l!==0&&(r=fl(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,l=t&-t,i>=l||i===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function no(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ht(t),e[t]=n}function B1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=gl),Ud=" ",Bd=!1;function gy(e,t){switch(e){case"keyup":return mw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ei=!1;function gw(e,t){switch(e){case"compositionend":return vy(t);case"keypress":return t.which!==32?null:(Bd=!0,Ud);case"textInput":return e=t.data,e===Ud&&Bd?null:e;default:return null}}function vw(e,t){if(ei)return e==="compositionend"||!mf&&gy(e,t)?(e=my(),Uo=df=qn=null,ei=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Qd(n)}}function ky(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ky(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ey(){for(var e=window,t=ns();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ns(e.document)}return t}function yf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Tw(e){var t=Ey(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ky(n.ownerDocument.documentElement,n)){if(r!==null&&yf(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,l=Math.min(r.start,i);r=r.end===void 0?l:Math.min(r.end,i),!e.extend&&l>r&&(i=r,r=l,l=i),i=Wd(n,l);var o=Wd(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ti=null,za=null,wl=null,Ma=!1;function qd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ma||ti==null||ti!==ns(r)||(r=ti,"selectionStart"in r&&yf(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}),wl&&Ll(wl,r)||(wl=r,r=as(za,"onSelect"),0ii||(e.current=Va[ii],Va[ii]=null,ii--)}function he(e,t){ii++,Va[ii]=e.current,e.current=t}var lr={},Qe=ur(lr),lt=ur(!1),Dr=lr;function Ai(e,t){var n=e.type.contextTypes;if(!n)return lr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},l;for(l in n)i[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ot(e){return e=e.childContextTypes,e!=null}function fs(){ye(lt),ye(Qe)}function eh(e,t,n){if(Qe.current!==lr)throw Error(N(168));he(Qe,t),he(lt,n)}function Iy(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(N(108,k1(e)||"Unknown",i));return xe({},n,r)}function ds(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||lr,Dr=Qe.current,he(Qe,e),he(lt,lt.current),!0}function th(e,t,n){var r=e.stateNode;if(!r)throw Error(N(169));n?(e=Iy(e,t,Dr),r.__reactInternalMemoizedMergedChildContext=e,ye(lt),ye(Qe),he(Qe,e)):ye(lt),he(lt,n)}var hn=null,Ws=!1,Uu=!1;function Ay(e){hn===null?hn=[e]:hn.push(e)}function jw(e){Ws=!0,Ay(e)}function ar(){if(!Uu&&hn!==null){Uu=!0;var e=0,t=ae;try{var n=hn;for(ae=1;e>=o,i-=o,yn=1<<32-Ht(t)+i|n<R?(L=T,T=null):L=T.sibling;var z=d(p,T,y[R],C);if(z===null){T===null&&(T=L);break}e&&T&&z.alternate===null&&t(p,T),m=l(z,m,R),E===null?P=z:E.sibling=z,E=z,T=L}if(R===y.length)return n(p,T),ge&&mr(p,R),P;if(T===null){for(;RR?(L=T,T=null):L=T.sibling;var M=d(p,T,z.value,C);if(M===null){T===null&&(T=L);break}e&&T&&M.alternate===null&&t(p,T),m=l(M,m,R),E===null?P=M:E.sibling=M,E=M,T=L}if(z.done)return n(p,T),ge&&mr(p,R),P;if(T===null){for(;!z.done;R++,z=y.next())z=f(p,z.value,C),z!==null&&(m=l(z,m,R),E===null?P=z:E.sibling=z,E=z);return ge&&mr(p,R),P}for(T=r(p,T);!z.done;R++,z=y.next())z=h(T,p,R,z.value,C),z!==null&&(e&&z.alternate!==null&&T.delete(z.key===null?R:z.key),m=l(z,m,R),E===null?P=z:E.sibling=z,E=z);return e&&T.forEach(function($){return t(p,$)}),ge&&mr(p,R),P}function w(p,m,y,C){if(typeof y=="object"&&y!==null&&y.type===Zr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case po:e:{for(var P=y.key,E=m;E!==null;){if(E.key===P){if(P=y.type,P===Zr){if(E.tag===7){n(p,E.sibling),m=i(E,y.props.children),m.return=p,p=m;break e}}else if(E.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Ln&&ih(P)===E.type){n(p,E.sibling),m=i(E,y.props),m.ref=rl(p,E,y),m.return=p,p=m;break e}n(p,E);break}else t(p,E);E=E.sibling}y.type===Zr?(m=Ir(y.props.children,p.mode,C,y.key),m.return=p,p=m):(C=Ko(y.type,y.key,y.props,null,p.mode,C),C.ref=rl(p,m,y),C.return=p,p=C)}return o(p);case Yr:e:{for(E=y.key;m!==null;){if(m.key===E)if(m.tag===4&&m.stateNode.containerInfo===y.containerInfo&&m.stateNode.implementation===y.implementation){n(p,m.sibling),m=i(m,y.children||[]),m.return=p,p=m;break e}else{n(p,m);break}else t(p,m);m=m.sibling}m=Ku(y,p.mode,C),m.return=p,p=m}return o(p);case Ln:return E=y._init,w(p,m,E(y._payload),C)}if(cl(y))return g(p,m,y,C);if(Yi(y))return v(p,m,y,C);Po(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,m!==null&&m.tag===6?(n(p,m.sibling),m=i(m,y),m.return=p,p=m):(n(p,m),m=qu(y,p.mode,C),m.return=p,p=m),o(p)):n(p,m)}return w}var Di=zy(!0),My=zy(!1),ms=ur(null),ys=null,si=null,xf=null;function Sf(){xf=si=ys=null}function kf(e){var t=ms.current;ye(ms),e._currentValue=t}function qa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function pi(e,t){ys=e,xf=si=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(it=!0),e.firstContext=null)}function Nt(e){var t=e._currentValue;if(xf!==e)if(e={context:e,memoizedValue:t,next:null},si===null){if(ys===null)throw Error(N(308));si=e,ys.dependencies={lanes:0,firstContext:e}}else si=si.next=e;return t}var xr=null;function Ef(e){xr===null?xr=[e]:xr.push(e)}function jy(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ef(t)):(n.next=i.next,i.next=n),t.interleaved=n,Cn(e,r)}function Cn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Dn=!1;function Cf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Uy(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function wn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function er(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ie&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Cn(e,n)}return i=r.interleaved,i===null?(t.next=t,Ef(r)):(t.next=i.next,i.next=t),r.interleaved=t,Cn(e,n)}function $o(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,af(e,n)}}function lh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?i=l=o:l=l.next=o,n=n.next}while(n!==null);l===null?i=l=t:l=l.next=t}else i=l=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function gs(e,t,n,r){var i=e.updateQueue;Dn=!1;var l=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var u=s,a=u.next;u.next=null,o===null?l=a:o.next=a,o=u;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==o&&(s===null?c.firstBaseUpdate=a:s.next=a,c.lastBaseUpdate=u))}if(l!==null){var f=i.baseState;o=0,c=a=u=null,s=l;do{var d=s.lane,h=s.eventTime;if((r&d)===d){c!==null&&(c=c.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=e,v=s;switch(d=t,h=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){f=g.call(h,f,d);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,d=typeof g=="function"?g.call(h,f,d):g,d==null)break e;f=xe({},f,d);break e;case 2:Dn=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,d=i.effects,d===null?i.effects=[s]:d.push(s))}else h={eventTime:h,lane:d,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(a=c=h,u=f):c=c.next=h,o|=d;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;d=s,s=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(c===null&&(u=f),i.baseState=u,i.firstBaseUpdate=a,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else l===null&&(i.shared.lanes=0);Mr|=o,e.lanes=o,e.memoizedState=f}}function oh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=$u.transition;$u.transition={};try{e(!1),t()}finally{ae=n,$u.transition=r}}function rg(){return It().memoizedState}function Hw(e,t,n){var r=nr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ig(e))lg(t,n);else if(n=jy(e,t,n,r),n!==null){var i=Je();Vt(n,e,r,i),og(n,t,r)}}function Vw(e,t,n){var r=nr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ig(e))lg(t,i);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var o=t.lastRenderedState,s=l(o,n);if(i.hasEagerState=!0,i.eagerState=s,Qt(s,o)){var u=t.interleaved;u===null?(i.next=i,Ef(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=jy(e,t,i,r),n!==null&&(i=Je(),Vt(n,e,r,i),og(n,t,r))}}function ig(e){var t=e.alternate;return e===we||t!==null&&t===we}function lg(e,t){xl=ws=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function og(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,af(e,n)}}var xs={readContext:Nt,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},Qw={readContext:Nt,useCallback:function(e,t){return Xt().memoizedState=[e,t===void 0?null:t],e},useContext:Nt,useEffect:uh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Vo(4194308,4,Yy.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Vo(4,2,e,t)},useMemo:function(e,t){var n=Xt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Xt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Hw.bind(null,we,e),[r.memoizedState,e]},useRef:function(e){var t=Xt();return e={current:e},t.memoizedState=e},useState:sh,useDebugValue:If,useDeferredValue:function(e){return Xt().memoizedState=e},useTransition:function(){var e=sh(!1),t=e[0];return e=$w.bind(null,e[1]),Xt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=we,i=Xt();if(ge){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),Ae===null)throw Error(N(349));zr&30||Vy(r,t,n)}i.memoizedState=n;var l={value:n,getSnapshot:t};return i.queue=l,uh(Wy.bind(null,r,l,e),[e]),r.flags|=2048,$l(9,Qy.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=Xt(),t=Ae.identifierPrefix;if(ge){var n=gn,r=yn;n=(r&~(1<<32-Ht(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ul++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[nn]=t,e[zl]=r,yg(e,t,!1,!1),t.stateNode=e;e:{switch(o=Oa(n,r),n){case"dialog":me("cancel",e),me("close",e),i=r;break;case"iframe":case"object":case"embed":me("load",e),i=r;break;case"video":case"audio":for(i=0;iMi&&(t.flags|=128,r=!0,il(l,!1),t.lanes=4194304)}else{if(!r)if(e=vs(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),il(l,!0),l.tail===null&&l.tailMode==="hidden"&&!o.alternate&&!ge)return Be(t),null}else 2*Pe()-l.renderingStartTime>Mi&&n!==1073741824&&(t.flags|=128,r=!0,il(l,!1),t.lanes=4194304);l.isBackwards?(o.sibling=t.child,t.child=o):(n=l.last,n!==null?n.sibling=o:t.child=o,l.last=o)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Pe(),t.sibling=null,n=ve.current,he(ve,r?n&1|2:n&1),t):(Be(t),null);case 22:case 23:return Mf(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ht&1073741824&&(Be(t),t.subtreeFlags&6&&(t.flags|=8192)):Be(t),null;case 24:return null;case 25:return null}throw Error(N(156,t.tag))}function Zw(e,t){switch(vf(t),t.tag){case 1:return ot(t.type)&&fs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fi(),ye(lt),ye(Qe),Tf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return _f(t),null;case 13:if(ye(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ye(ve),null;case 4:return Fi(),null;case 10:return kf(t.type._context),null;case 22:case 23:return Mf(),null;case 24:return null;default:return null}}var To=!1,He=!1,ex=typeof WeakSet=="function"?WeakSet:Set,B=null;function ui(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ee(e,t,r)}else n.current=null}function nc(e,t,n){try{n()}catch(r){Ee(e,t,r)}}var wh=!1;function tx(e,t){if(ja=ss,e=Ey(),yf(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var o=0,s=-1,u=-1,a=0,c=0,f=e,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(s=o+i),f!==l||r!==0&&f.nodeType!==3||(u=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===e)break t;if(d===n&&++a===i&&(s=o),d===l&&++c===r&&(u=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ua={focusedElem:e,selectionRange:n},ss=!1,B=t;B!==null;)if(t=B,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,B=e;else for(;B!==null;){t=B;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,w=g.memoizedState,p=t.stateNode,m=p.getSnapshotBeforeUpdate(t.elementType===t.type?v:Ft(t.type,v),w);p.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(N(163))}}catch(C){Ee(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,B=e;break}B=t.return}return g=wh,wh=!1,g}function Sl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var l=i.destroy;i.destroy=void 0,l!==void 0&&nc(t,n,l)}i=i.next}while(i!==r)}}function Gs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function rc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function wg(e){var t=e.alternate;t!==null&&(e.alternate=null,wg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[nn],delete t[zl],delete t[Ha],delete t[zw],delete t[Mw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function xg(e){return e.tag===5||e.tag===3||e.tag===4}function xh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ic(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=cs));else if(r!==4&&(e=e.child,e!==null))for(ic(e,t,n),e=e.sibling;e!==null;)ic(e,t,n),e=e.sibling}function lc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(lc(e,t,n),e=e.sibling;e!==null;)lc(e,t,n),e=e.sibling}var ze=null,jt=!1;function Nn(e,t,n){for(n=n.child;n!==null;)Sg(e,t,n),n=n.sibling}function Sg(e,t,n){if(ln&&typeof ln.onCommitFiberUnmount=="function")try{ln.onCommitFiberUnmount(Bs,n)}catch{}switch(n.tag){case 5:He||ui(n,t);case 6:var r=ze,i=jt;ze=null,Nn(e,t,n),ze=r,jt=i,ze!==null&&(jt?(e=ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ze.removeChild(n.stateNode));break;case 18:ze!==null&&(jt?(e=ze,n=n.stateNode,e.nodeType===8?ju(e.parentNode,n):e.nodeType===1&&ju(e,n),Il(e)):ju(ze,n.stateNode));break;case 4:r=ze,i=jt,ze=n.stateNode.containerInfo,jt=!0,Nn(e,t,n),ze=r,jt=i;break;case 0:case 11:case 14:case 15:if(!He&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var l=i,o=l.destroy;l=l.tag,o!==void 0&&(l&2||l&4)&&nc(n,t,o),i=i.next}while(i!==r)}Nn(e,t,n);break;case 1:if(!He&&(ui(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Ee(n,t,s)}Nn(e,t,n);break;case 21:Nn(e,t,n);break;case 22:n.mode&1?(He=(r=He)||n.memoizedState!==null,Nn(e,t,n),He=r):Nn(e,t,n);break;default:Nn(e,t,n)}}function Sh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ex),t.forEach(function(r){var i=cx.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Dt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~l}if(r=i,r=Pe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*rx(r/1960))-r,10e?16:e,Kn===null)var r=!1;else{if(e=Kn,Kn=null,Es=0,ie&6)throw Error(N(331));var i=ie;for(ie|=4,B=e.current;B!==null;){var l=B,o=l.child;if(B.flags&16){var s=l.deletions;if(s!==null){for(var u=0;uPe()-Ff?Nr(e,0):Df|=n),st(e,t)}function Og(e,t){t===0&&(e.mode&1?(t=vo,vo<<=1,!(vo&130023424)&&(vo=4194304)):t=1);var n=Je();e=Cn(e,t),e!==null&&(no(e,t,n),st(e,n))}function ax(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Og(e,n)}function cx(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(N(314))}r!==null&&r.delete(t),Og(e,n)}var bg;bg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||lt.current)it=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return it=!1,Jw(e,t,n);it=!!(e.flags&131072)}else it=!1,ge&&t.flags&1048576&&Ly(t,ps,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Qo(e,t),e=t.pendingProps;var i=Ai(t,Qe.current);pi(t,n),i=Of(null,t,r,e,i,n);var l=bf();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ot(r)?(l=!0,ds(t)):l=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Cf(t),i.updater=Ks,t.stateNode=i,i._reactInternals=t,Ga(t,r,e,n),t=Ya(null,t,r,!0,l,n)):(t.tag=0,ge&&l&&gf(t),Xe(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Qo(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=dx(r),e=Ft(r,e),i){case 0:t=Ja(null,t,r,e,n);break e;case 1:t=yh(null,t,r,e,n);break e;case 11:t=ph(null,t,r,e,n);break e;case 14:t=mh(null,t,r,Ft(r.type,e),n);break e}throw Error(N(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),Ja(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),yh(e,t,r,i,n);case 3:e:{if(hg(t),e===null)throw Error(N(387));r=t.pendingProps,l=t.memoizedState,i=l.element,Uy(e,t),gs(t,r,null,n);var o=t.memoizedState;if(r=o.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){i=zi(Error(N(423)),t),t=gh(e,t,r,n,i);break e}else if(r!==i){i=zi(Error(N(424)),t),t=gh(e,t,r,n,i);break e}else for(pt=Zn(t.stateNode.containerInfo.firstChild),yt=t,ge=!0,Ut=null,n=My(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Li(),r===i){t=Pn(e,t,n);break e}Xe(e,t,r,n)}t=t.child}return t;case 5:return By(t),e===null&&Wa(t),r=t.type,i=t.pendingProps,l=e!==null?e.memoizedProps:null,o=i.children,Ba(r,i)?o=null:l!==null&&Ba(r,l)&&(t.flags|=32),dg(e,t),Xe(e,t,o,n),t.child;case 6:return e===null&&Wa(t),null;case 13:return pg(e,t,n);case 4:return Pf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Di(t,null,r,n):Xe(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),ph(e,t,r,i,n);case 7:return Xe(e,t,t.pendingProps,n),t.child;case 8:return Xe(e,t,t.pendingProps.children,n),t.child;case 12:return Xe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,l=t.memoizedProps,o=i.value,he(ms,r._currentValue),r._currentValue=o,l!==null)if(Qt(l.value,o)){if(l.children===i.children&&!lt.current){t=Pn(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var s=l.dependencies;if(s!==null){o=l.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(l.tag===1){u=wn(-1,n&-n),u.tag=2;var a=l.updateQueue;if(a!==null){a=a.shared;var c=a.pending;c===null?u.next=u:(u.next=c.next,c.next=u),a.pending=u}}l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),qa(l.return,n,t),s.lanes|=n;break}u=u.next}}else if(l.tag===10)o=l.type===t.type?null:l.child;else if(l.tag===18){if(o=l.return,o===null)throw Error(N(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),qa(o,n,t),o=l.sibling}else o=l.child;if(o!==null)o.return=l;else for(o=l;o!==null;){if(o===t){o=null;break}if(l=o.sibling,l!==null){l.return=o.return,o=l;break}o=o.return}l=o}Xe(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,pi(t,n),i=Nt(i),r=r(i),t.flags|=1,Xe(e,t,r,n),t.child;case 14:return r=t.type,i=Ft(r,t.pendingProps),i=Ft(r.type,i),mh(e,t,r,i,n);case 15:return cg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),Qo(e,t),t.tag=1,ot(r)?(e=!0,ds(t)):e=!1,pi(t,n),sg(t,r,i),Ga(t,r,i,n),Ya(null,t,r,!0,e,n);case 19:return mg(e,t,n);case 22:return fg(e,t,n)}throw Error(N(156,t.tag))};function Ng(e,t){return iy(e,t)}function fx(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ot(e,t,n,r){return new fx(e,t,n,r)}function Uf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function dx(e){if(typeof e=="function")return Uf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===lf)return 11;if(e===of)return 14}return 2}function rr(e,t){var n=e.alternate;return n===null?(n=Ot(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ko(e,t,n,r,i,l){var o=2;if(r=e,typeof e=="function")Uf(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Zr:return Ir(n.children,i,l,t);case rf:o=8,i|=8;break;case wa:return e=Ot(12,n,t,i|2),e.elementType=wa,e.lanes=l,e;case xa:return e=Ot(13,n,t,i),e.elementType=xa,e.lanes=l,e;case Sa:return e=Ot(19,n,t,i),e.elementType=Sa,e.lanes=l,e;case Bm:return Js(n,i,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case jm:o=10;break e;case Um:o=9;break e;case lf:o=11;break e;case of:o=14;break e;case Ln:o=16,r=null;break e}throw Error(N(130,e==null?e:typeof e,""))}return t=Ot(o,n,t,i),t.elementType=e,t.type=r,t.lanes=l,t}function Ir(e,t,n,r){return e=Ot(7,e,r,t),e.lanes=n,e}function Js(e,t,n,r){return e=Ot(22,e,r,t),e.elementType=Bm,e.lanes=n,e.stateNode={isHidden:!1},e}function qu(e,t,n){return e=Ot(6,e,null,t),e.lanes=n,e}function Ku(e,t,n){return t=Ot(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function hx(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ru(0),this.expirationTimes=Ru(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ru(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Bf(e,t,n,r,i,l,o,s,u){return e=new hx(e,t,n,s,u),t===1?(t=1,l===!0&&(t|=8)):t=0,l=Ot(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Cf(l),e}function px(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Dg)}catch(e){console.error(e)}}Dg(),Dm.exports=St;var wx=Dm.exports,Oh=wx;ga.createRoot=Oh.createRoot,ga.hydrateRoot=Oh.hydrateRoot;/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Vl(){return Vl=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Fg(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Sx(){return Math.random().toString(36).substr(2,8)}function Nh(e,t){return{usr:e.state,key:e.key,idx:t}}function cc(e,t,n,r){return n===void 0&&(n=null),Vl({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Hi(t):t,{state:n,key:t&&t.key||r||Sx()})}function zg(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Hi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function kx(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:l=!1}=r,o=i.history,s=Gn.Pop,u=null,a=c();a==null&&(a=0,o.replaceState(Vl({},o.state,{idx:a}),""));function c(){return(o.state||{idx:null}).idx}function f(){s=Gn.Pop;let w=c(),p=w==null?null:w-a;a=w,u&&u({action:s,location:v.location,delta:p})}function d(w,p){s=Gn.Push;let m=cc(v.location,w,p);a=c()+1;let y=Nh(m,a),C=v.createHref(m);try{o.pushState(y,"",C)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(C)}l&&u&&u({action:s,location:v.location,delta:1})}function h(w,p){s=Gn.Replace;let m=cc(v.location,w,p);a=c();let y=Nh(m,a),C=v.createHref(m);o.replaceState(y,"",C),l&&u&&u({action:s,location:v.location,delta:0})}function g(w){let p=i.location.origin!=="null"?i.location.origin:i.location.href,m=typeof w=="string"?w:zg(w);return m=m.replace(/ $/,"%20"),Ne(p,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,p)}let v={get action(){return s},get location(){return e(i,o)},listen(w){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(bh,f),u=w,()=>{i.removeEventListener(bh,f),u=null}},createHref(w){return t(i,w)},createURL:g,encodeLocation(w){let p=g(w);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:d,replace:h,go(w){return o.go(w)}};return v}var Ih;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ih||(Ih={}));function Ex(e,t,n){return n===void 0&&(n="/"),Cx(e,t,n)}function Cx(e,t,n,r){let i=typeof t=="string"?Hi(t):t,l=Ug(i.pathname||"/",n);if(l==null)return null;let o=Mg(e);Px(o);let s=null;for(let u=0;s==null&&u{let u={relativePath:s===void 0?l.path||"":s,caseSensitive:l.caseSensitive===!0,childrenIndex:o,route:l};u.relativePath.startsWith("/")&&(Ne(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let a=Ar([r,u.relativePath]),c=n.concat(u);l.children&&l.children.length>0&&(Ne(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+a+'".')),Mg(l.children,t,c,a)),!(l.path==null&&!l.index)&&t.push({path:a,score:Ix(a,l.index),routesMeta:c})};return e.forEach((l,o)=>{var s;if(l.path===""||!((s=l.path)!=null&&s.includes("?")))i(l,o);else for(let u of jg(l.path))i(l,o,u)}),t}function jg(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return i?[l,""]:[l];let o=jg(r.join("/")),s=[];return s.push(...o.map(u=>u===""?l:[l,u].join("/"))),i&&s.push(...o),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function Px(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Ax(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const _x=/^:[\w-]+$/,Tx=3,Rx=2,Ox=1,bx=10,Nx=-2,Ah=e=>e==="*";function Ix(e,t){let n=e.split("/"),r=n.length;return n.some(Ah)&&(r+=Nx),t&&(r+=Rx),n.filter(i=>!Ah(i)).reduce((i,l)=>i+(_x.test(l)?Tx:l===""?Ox:bx),r)}function Ax(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Lx(e,t,n){let{routesMeta:r}=e,i={},l="/",o=[];for(let s=0;s{let{paramName:d,isOptional:h}=c;if(d==="*"){let v=s[f]||"";o=l.slice(0,l.length-v.length).replace(/(.)\/+$/,"$1")}const g=s[f];return h&&!g?a[d]=void 0:a[d]=(g||"").replace(/%2F/g,"/"),a},{}),pathname:l,pathnameBase:o,pattern:e}}function Fx(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Fg(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,u)=>(r.push({paramName:s,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function zx(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Fg(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ug(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Mx(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Hi(e):e;return{pathname:n?n.startsWith("/")?n:jx(n,t):t,search:Vx(r),hash:Qx(i)}}function jx(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Gu(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Ux(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Bx(e,t){let n=Ux(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function $x(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Hi(e):(i=Vl({},e),Ne(!i.pathname||!i.pathname.includes("?"),Gu("?","pathname","search",i)),Ne(!i.pathname||!i.pathname.includes("#"),Gu("#","pathname","hash",i)),Ne(!i.search||!i.search.includes("#"),Gu("#","search","hash",i)));let l=e===""||i.pathname==="",o=l?"/":i.pathname,s;if(o==null)s=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let d=o.split("/");for(;d[0]==="..";)d.shift(),f-=1;i.pathname=d.join("/")}s=f>=0?t[f]:"/"}let u=Mx(i,s),a=o&&o!=="/"&&o.endsWith("/"),c=(l||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(a||c)&&(u.pathname+="/"),u}const Ar=e=>e.join("/").replace(/\/\/+/g,"/"),Hx=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Vx=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Qx=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Wx(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Bg=["post","put","patch","delete"];new Set(Bg);const qx=["get",...Bg];new Set(qx);/** * React Router v6.30.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Ql(){return Ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),b.useCallback(function(a,c){if(c===void 0&&(c={}),!s.current)return;if(typeof a=="number"){r.go(a);return}let f=$x(a,JSON.parse(o),l,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ar([t,f.pathname])),(c.replace?r.replace:r.push)(f,c.state,c)},[t,r,o,l,e])}function Xx(e,t){return Jx(e,t)}function Jx(e,t,n,r){iu()||Ne(!1);let{navigator:i,static:l}=b.useContext(nu),{matches:o}=b.useContext(Vi),s=o[o.length-1],u=s?s.params:{};s&&s.pathname;let a=s?s.pathnameBase:"/";s&&s.route;let c=Hg(),f;if(t){var d;let p=typeof t=="string"?Hi(t):t;a==="/"||(d=p.pathname)!=null&&d.startsWith(a)||Ne(!1),f=p}else f=c;let h=f.pathname||"/",g=h;if(a!=="/"){let p=a.replace(/^\//,"").split("/");g="/"+h.replace(/^\//,"").split("/").slice(p.length).join("/")}let v=Ex(e,{pathname:g}),w=nS(v&&v.map(p=>Object.assign({},p,{params:Object.assign({},u,p.params),pathname:Ar([a,i.encodeLocation?i.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?a:Ar([a,i.encodeLocation?i.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),o,n,r);return t&&w?b.createElement(ru.Provider,{value:{location:Ql({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Gn.Pop}},w):w}function Yx(){let e=oS(),t=Wx(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:i},n):null,null)}const Zx=b.createElement(Yx,null);class eS extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?b.createElement(Vi.Provider,{value:this.props.routeContext},b.createElement($g.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function tS(e){let{routeContext:t,match:n,children:r}=e,i=b.useContext(Qf);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(Vi.Provider,{value:t},r)}function nS(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var l;if(!n)return null;if(n.errors)e=n.matches;else if((l=r)!=null&&l.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let c=o.findIndex(f=>f.route.id&&(s==null?void 0:s[f.route.id])!==void 0);c>=0||Ne(!1),o=o.slice(0,Math.min(o.length,c+1))}let u=!1,a=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?o=o.slice(0,a+1):o=[o[0]];break}}}return o.reduceRight((c,f,d)=>{let h,g=!1,v=null,w=null;n&&(h=s&&f.route.id?s[f.route.id]:void 0,v=f.route.errorElement||Zx,u&&(a<0&&d===0?(uS("route-fallback"),g=!0,w=null):a===d&&(g=!0,w=f.route.hydrateFallbackElement||null)));let p=t.concat(o.slice(0,d+1)),m=()=>{let y;return h?y=v:g?y=w:f.route.Component?y=b.createElement(f.route.Component,null):f.route.element?y=f.route.element:y=c,b.createElement(tS,{match:f,routeContext:{outlet:c,matches:p,isDataRoute:n!=null},children:y})};return n&&(f.route.ErrorBoundary||f.route.errorElement||d===0)?b.createElement(eS,{location:n.location,revalidation:n.revalidation,component:v,error:h,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()},null)}var Qg=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Qg||{}),Wg=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Wg||{});function rS(e){let t=b.useContext(Qf);return t||Ne(!1),t}function iS(e){let t=b.useContext(Kx);return t||Ne(!1),t}function lS(e){let t=b.useContext(Vi);return t||Ne(!1),t}function qg(e){let t=lS(),n=t.matches[t.matches.length-1];return n.route.id||Ne(!1),n.route.id}function oS(){var e;let t=b.useContext($g),n=iS(),r=qg();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function sS(){let{router:e}=rS(Qg.UseNavigateStable),t=qg(Wg.UseNavigateStable),n=b.useRef(!1);return Vg(()=>{n.current=!0}),b.useCallback(function(i,l){l===void 0&&(l={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Ql({fromRouteId:t},l)))},[e,t])}const Lh={};function uS(e,t,n){Lh[e]||(Lh[e]=!0)}function aS(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function fc(e){Ne(!1)}function cS(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Gn.Pop,navigator:l,static:o=!1,future:s}=e;iu()&&Ne(!1);let u=t.replace(/^\/*/,"/"),a=b.useMemo(()=>({basename:u,navigator:l,static:o,future:Ql({v7_relativeSplatPath:!1},s)}),[u,s,l,o]);typeof r=="string"&&(r=Hi(r));let{pathname:c="/",search:f="",hash:d="",state:h=null,key:g="default"}=r,v=b.useMemo(()=>{let w=Ug(c,u);return w==null?null:{location:{pathname:w,search:f,hash:d,state:h,key:g},navigationType:i}},[u,c,f,d,h,g,i]);return v==null?null:b.createElement(nu.Provider,{value:a},b.createElement(ru.Provider,{children:n,value:v}))}function fS(e){let{children:t,location:n}=e;return Xx(dc(t),n)}new Promise(()=>{});function dc(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(r,i)=>{if(!b.isValidElement(r))return;let l=[...t,i];if(r.type===b.Fragment){n.push.apply(n,dc(r.props.children,l));return}r.type!==fc&&Ne(!1),!r.props.index||!r.props.children||Ne(!1);let o={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=dc(r.props.children,l)),n.push(o)}),n}/** * React Router DOM v6.30.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */const dS="6";try{window.__reactRouterVersion=dS}catch{}const hS="startTransition",Dh=u1[hS];function pS(e){let{basename:t,children:n,future:r,window:i}=e,l=b.useRef();l.current==null&&(l.current=xx({window:i,v5Compat:!0}));let o=l.current,[s,u]=b.useState({action:o.action,location:o.location}),{v7_startTransition:a}=r||{},c=b.useCallback(f=>{a&&Dh?Dh(()=>u(f)):u(f)},[u,a]);return b.useLayoutEffect(()=>o.listen(c),[o,c]),b.useEffect(()=>aS(r),[r]),b.createElement(cS,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}var Fh;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Fh||(Fh={}));var zh;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(zh||(zh={}));var Kg={exports:{}},Gg={};/** * @license React * use-sync-external-store-with-selector.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var oo=b;function mS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yS=typeof Object.is=="function"?Object.is:mS,gS=oo.useSyncExternalStore,vS=oo.useRef,wS=oo.useEffect,xS=oo.useMemo,SS=oo.useDebugValue;Gg.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var l=vS(null);if(l.current===null){var o={hasValue:!1,value:null};l.current=o}else o=l.current;l=xS(function(){function u(h){if(!a){if(a=!0,c=h,h=r(h),i!==void 0&&o.hasValue){var g=o.value;if(i(g,h))return f=g}return f=h}if(g=f,yS(c,h))return g;var v=r(h);return i!==void 0&&i(g,v)?(c=h,g):(c=h,f=v)}var a=!1,c,f,d=n===void 0?null:n;return[function(){return u(t())},d===null?void 0:function(){return u(d())}]},[t,n,r,i]);var s=gS(e,l[0],l[1]);return wS(function(){o.hasValue=!0,o.value=s},[s]),SS(s),s};Kg.exports=Gg;var kS=Kg.exports;function ES(e){e()}function CS(){let e=null,t=null;return{clear(){e=null,t=null},notify(){ES(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Mh={notify(){},get:()=>[]};function PS(e,t){let n,r=Mh,i=0,l=!1;function o(v){c();const w=r.subscribe(v);let p=!1;return()=>{p||(p=!0,w(),f())}}function s(){r.notify()}function u(){g.onStateChange&&g.onStateChange()}function a(){return l}function c(){i++,n||(n=e.subscribe(u),r=CS())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Mh)}function d(){l||(l=!0,c())}function h(){l&&(l=!1,f())}const g={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:u,isSubscribed:a,trySubscribe:d,tryUnsubscribe:h,getListeners:()=>r};return g}var _S=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",TS=_S(),RS=()=>typeof navigator<"u"&&navigator.product==="ReactNative",OS=RS(),bS=()=>TS||OS?b.useLayoutEffect:b.useEffect,NS=bS(),Xu=Symbol.for("react-redux-context"),Ju=typeof globalThis<"u"?globalThis:{};function IS(){if(!b.createContext)return{};const e=Ju[Xu]??(Ju[Xu]=new Map);let t=e.get(b.createContext);return t||(t=b.createContext(null),e.set(b.createContext,t)),t}var or=IS();function AS(e){const{children:t,context:n,serverState:r,store:i}=e,l=b.useMemo(()=>{const u=PS(i);return{store:i,subscription:u,getServerState:r?()=>r:void 0}},[i,r]),o=b.useMemo(()=>i.getState(),[i]);NS(()=>{const{subscription:u}=l;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),o!==i.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[l,o]);const s=n||or;return b.createElement(s.Provider,{value:l},t)}var LS=AS;function qf(e=or){return function(){return b.useContext(e)}}var Xg=qf();function Jg(e=or){const t=e===or?Xg:qf(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var DS=Jg();function FS(e=or){const t=e===or?DS:Jg(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var Yg=FS(),zS=(e,t)=>e===t;function MS(e=or){const t=e===or?Xg:qf(e),n=(r,i={})=>{const{equalityFn:l=zS}=typeof i=="function"?{equalityFn:i}:i,o=t(),{store:s,subscription:u,getServerState:a}=o;b.useRef(!0);const c=b.useCallback({[r.name](d){return r(d)}}[r.name],[r]),f=kS.useSyncExternalStoreWithSelector(u.addNestedSub,s.getState,a||s.getState,c,l);return b.useDebugValue(f),f};return Object.assign(n,{withTypes:()=>n}),n}var _s=MS();function jS(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const US=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,BS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$S={};function jh(e,t){return($S.jsx?BS:US).test(e)}const HS=/[ \t\n\f\r]/g;function VS(e){return typeof e=="object"?e.type==="text"?Uh(e.value):!1:Uh(e)}function Uh(e){return e.replace(HS,"")===""}class so{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}so.prototype.normal={};so.prototype.property={};so.prototype.space=void 0;function Zg(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new so(n,r,t)}function hc(e){return e.toLowerCase()}class ct{constructor(t,n){this.attribute=n,this.property=t}}ct.prototype.attribute="";ct.prototype.booleanish=!1;ct.prototype.boolean=!1;ct.prototype.commaOrSpaceSeparated=!1;ct.prototype.commaSeparated=!1;ct.prototype.defined=!1;ct.prototype.mustUseProperty=!1;ct.prototype.number=!1;ct.prototype.overloadedBoolean=!1;ct.prototype.property="";ct.prototype.spaceSeparated=!1;ct.prototype.space=void 0;let QS=0;const K=qr(),_e=qr(),ev=qr(),I=qr(),de=qr(),yi=qr(),dt=qr();function qr(){return 2**++QS}const pc=Object.freeze(Object.defineProperty({__proto__:null,boolean:K,booleanish:_e,commaOrSpaceSeparated:dt,commaSeparated:yi,number:I,overloadedBoolean:ev,spaceSeparated:de},Symbol.toStringTag,{value:"Module"})),Yu=Object.keys(pc);class Kf extends ct{constructor(t,n,r,i){let l=-1;if(super(t,n),Bh(this,"space",i),typeof r=="number")for(;++l4&&n.slice(0,4)==="data"&&XS.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace($h,ZS);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!$h.test(l)){let o=l.replace(GS,YS);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Kf}return new i(r,t)}function YS(e){return"-"+e.toLowerCase()}function ZS(e){return e.charAt(1).toUpperCase()}const ek=Zg([tv,WS,iv,lv,ov],"html"),Gf=Zg([tv,qS,iv,lv,ov],"svg");function tk(e){return e.join(" ").trim()}var Xf={},Hh=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,nk=/\n/g,rk=/^\s*/,ik=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,lk=/^:\s*/,ok=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,sk=/^[;\s]*/,uk=/^\s+|\s+$/g,ak=` `,Vh="/",Qh="*",vr="",ck="comment",fk="declaration",dk=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var v=g.match(nk);v&&(n+=v.length);var w=g.lastIndexOf(ak);r=~w?g.length-w:r+g.length}function l(){var g={line:n,column:r};return function(v){return v.position=new o(g),a(),v}}function o(g){this.start=g,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(g){var v=new Error(t.source+":"+n+":"+r+": "+g);if(v.reason=g,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function u(g){var v=g.exec(e);if(v){var w=v[0];return i(w),e=e.slice(w.length),v}}function a(){u(rk)}function c(g){var v;for(g=g||[];v=f();)v!==!1&&g.push(v);return g}function f(){var g=l();if(!(Vh!=e.charAt(0)||Qh!=e.charAt(1))){for(var v=2;vr!=e.charAt(v)&&(Qh!=e.charAt(v)||Vh!=e.charAt(v+1));)++v;if(v+=2,vr===e.charAt(v-1))return s("End of comment missing");var w=e.slice(2,v-2);return r+=2,i(w),e=e.slice(v),r+=2,g({type:ck,comment:w})}}function d(){var g=l(),v=u(ik);if(v){if(f(),!u(lk))return s("property missing ':'");var w=u(ok),p=g({type:fk,property:Wh(v[0].replace(Hh,vr)),value:w?Wh(w[0].replace(Hh,vr)):vr});return u(sk),p}}function h(){var g=[];c(g);for(var v;v=d();)v!==!1&&(g.push(v),c(g));return g}return a(),h()};function Wh(e){return e?e.replace(uk,vr):vr}var hk=ts&&ts.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xf,"__esModule",{value:!0});Xf.default=mk;var pk=hk(dk);function mk(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,pk.default)(e),i=typeof t=="function";return r.forEach(function(l){if(l.type==="declaration"){var o=l.property,s=l.value;i?t(o,s,l):s&&(n=n||{},n[o]=s)}}),n}var lu={};Object.defineProperty(lu,"__esModule",{value:!0});lu.camelCase=void 0;var yk=/^--[a-zA-Z0-9_-]+$/,gk=/-([a-z])/g,vk=/^[^-]+$/,wk=/^-(webkit|moz|ms|o|khtml)-/,xk=/^-(ms)-/,Sk=function(e){return!e||vk.test(e)||yk.test(e)},kk=function(e,t){return t.toUpperCase()},qh=function(e,t){return"".concat(t,"-")},Ek=function(e,t){return t===void 0&&(t={}),Sk(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(xk,qh):e=e.replace(wk,qh),e.replace(gk,kk))};lu.camelCase=Ek;var Ck=ts&&ts.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Pk=Ck(Xf),_k=lu;function mc(e,t){var n={};return!e||typeof e!="string"||(0,Pk.default)(e,function(r,i){r&&i&&(n[(0,_k.camelCase)(r,t)]=i)}),n}mc.default=mc;var Tk=mc;const Rk=Gc(Tk),sv=uv("end"),Jf=uv("start");function uv(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Ok(e){const t=Jf(e),n=sv(e);if(t&&n)return{start:t,end:n}}function Cl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Kh(e.position):"start"in e||"end"in e?Kh(e):"line"in e||"column"in e?yc(e):""}function yc(e){return Gh(e&&e.line)+":"+Gh(e&&e.column)}function Kh(e){return yc(e&&e.start)+"-"+yc(e&&e.end)}function Gh(e){return e&&typeof e=="number"?e:1}class We extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},o=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(o=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const s=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=s?s.line:void 0,this.name=Cl(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual,this.expected,this.note,this.url}}We.prototype.file="";We.prototype.name="";We.prototype.reason="";We.prototype.message="";We.prototype.stack="";We.prototype.column=void 0;We.prototype.line=void 0;We.prototype.ancestors=void 0;We.prototype.cause=void 0;We.prototype.fatal=void 0;We.prototype.place=void 0;We.prototype.ruleId=void 0;We.prototype.source=void 0;const Yf={}.hasOwnProperty,bk=new Map,Nk=/[A-Z]/g,Ik=new Set(["table","tbody","thead","tfoot","tr"]),Ak=new Set(["td","th"]),av="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Lk(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=$k(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Bk(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Gf:ek,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=cv(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function cv(e,t,n){if(t.type==="element")return Dk(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Fk(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Mk(e,t,n);if(t.type==="mdxjsEsm")return zk(e,t);if(t.type==="root")return jk(e,t,n);if(t.type==="text")return Uk(e,t)}function Dk(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Gf,e.schema=i),e.ancestors.push(t);const l=dv(e,t.tagName,!1),o=Hk(e,t);let s=ed(e,t);return Ik.has(t.tagName)&&(s=s.filter(function(u){return typeof u=="string"?!VS(u):!0})),fv(e,o,l,t),Zf(o,s),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function Fk(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Wl(e,t.position)}function zk(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Wl(e,t.position)}function Mk(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Gf,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:dv(e,t.name,!0),o=Vk(e,t),s=ed(e,t);return fv(e,o,l,t),Zf(o,s),e.ancestors.pop(),e.schema=r,e.create(t,l,o,n)}function jk(e,t,n){const r={};return Zf(r,ed(e,t)),e.create(t,e.Fragment,r,n)}function Uk(e,t){return t.value}function fv(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Zf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Bk(e,t,n){return r;function r(i,l,o,s){const a=Array.isArray(o.children)?n:t;return s?a(l,o,s):a(l,o)}}function $k(e,t){return n;function n(r,i,l,o){const s=Array.isArray(l.children),u=Jf(r);return t(i,l,o,s,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Hk(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Yf.call(t.properties,i)){const l=Qk(e,i,t.properties[i]);if(l){const[o,s]=l;e.tableCellAlignToStyle&&o==="align"&&typeof s=="string"&&Ak.has(t.tagName)?r=s:n[o]=s}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Vk(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const s=o.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Wl(e,t.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,l=e.evaluater.evaluateExpression(s.expression)}else Wl(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function ed(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:bk;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);l0?(sn(e,e.length,0,t),e):t}const Yh={}.hasOwnProperty;function Zk(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function gi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const rn=cr(/[A-Za-z]/),mt=cr(/[\dA-Za-z]/),nE=cr(/[#-'*+\--9=?A-Z^-~]/);function gc(e){return e!==null&&(e<32||e===127)}const vc=cr(/\d/),rE=cr(/[\dA-Fa-f]/),iE=cr(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function ut(e){return e!==null&&(e<0||e===32)}function oe(e){return e===-2||e===-1||e===32}const lE=cr(new RegExp("\\p{P}|\\p{S}","u")),oE=cr(/\s/);function cr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wi(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&l<57344){const s=e.charCodeAt(n+1);l<56320&&s>56319&&s<57344?(o=String.fromCharCode(l,s),i=1):o="�"}else o=String.fromCharCode(l);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function pe(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(u){return oe(u)?(e.enter(n),s(u)):t(u)}function s(u){return oe(u)&&l++o))return;const T=t.events.length;let R=T,L,z;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(L){z=t.events[R][1].end;break}L=!0}for(p(r),E=T;Ey;){const P=n[C];t.containerState=P[1],P[0].exit.call(t,e)}n.length=y}function m(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function fE(e,t,n){return pe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ep(e){if(e===null||ut(e)||oE(e))return 1;if(lE(e))return 2}function nd(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},d={...e[n][1].start};tp(f,-u),tp(d,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},s={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:d},l={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},a=[],e[r][1].end.offset-e[r][1].start.offset&&(a=Rt(a,[["enter",e[r][1],t],["exit",e[r][1],t]])),a=Rt(a,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",l,t]]),a=Rt(a,nd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),a=Rt(a,[["exit",l,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,a=Rt(a,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,sn(e,r-1,n-r+3,a),n=r+a.length-c-2;break}}for(n=-1;++n0&&oe(E)?pe(e,m,"linePrefix",l+1)(E):m(E)}function m(E){return E===null||W(E)?e.check(np,v,C)(E):(e.enter("codeFlowValue"),y(E))}function y(E){return E===null||W(E)?(e.exit("codeFlowValue"),m(E)):(e.consume(E),y)}function C(E){return e.exit("codeFenced"),t(E)}function P(E,T,R){let L=0;return z;function z(U){return E.enter("lineEnding"),E.consume(U),E.exit("lineEnding"),M}function M(U){return E.enter("codeFencedFence"),oe(U)?pe(E,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):$(U)}function $(U){return U===s?(E.enter("codeFencedFenceSequence"),ne(U)):R(U)}function ne(U){return U===s?(L++,E.consume(U),ne):L>=o?(E.exit("codeFencedFenceSequence"),oe(U)?pe(E,H,"whitespace")(U):H(U)):R(U)}function H(U){return U===null||W(U)?(E.exit("codeFencedFence"),T(U)):R(U)}}}function EE(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const ea={name:"codeIndented",tokenize:PE},CE={partial:!0,tokenize:_E};function PE(e,t,n){const r=this;return i;function i(a){return e.enter("codeIndented"),pe(e,l,"linePrefix",5)(a)}function l(a){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(a):n(a)}function o(a){return a===null?u(a):W(a)?e.attempt(CE,o,u)(a):(e.enter("codeFlowValue"),s(a))}function s(a){return a===null||W(a)?(e.exit("codeFlowValue"),o(a)):(e.consume(a),s)}function u(a){return e.exit("codeIndented"),t(a)}}function _E(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):W(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):pe(e,l,"linePrefix",5)(o)}function l(o){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):W(o)?i(o):n(o)}}const TE={name:"codeText",previous:OE,resolve:RE,tokenize:bE};function RE(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&ol(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ol(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ol(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function wv(e,t,n,r,i,l,o,s,u){const a=u||Number.POSITIVE_INFINITY;let c=0;return f;function f(p){return p===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(p),e.exit(l),d):p===null||p===32||p===41||gc(p)?n(p):(e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),v(p))}function d(p){return p===62?(e.enter(l),e.consume(p),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===62?(e.exit("chunkString"),e.exit(s),d(p)):p===null||p===60||W(p)?n(p):(e.consume(p),p===92?g:h)}function g(p){return p===60||p===62||p===92?(e.consume(p),h):h(p)}function v(p){return!c&&(p===null||p===41||ut(p))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(r),t(p)):c999||h===null||h===91||h===93&&!u||h===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(h):h===93?(e.exit(l),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):W(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||W(h)||s++>999?(e.exit("chunkString"),c(h)):(e.consume(h),u||(u=!oe(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(e.consume(h),s++,f):f(h)}}function Sv(e,t,n,r,i,l){let o;return s;function s(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),o=d===40?41:d,u):n(d)}function u(d){return d===o?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):(e.enter(l),a(d))}function a(d){return d===o?(e.exit(l),u(o)):d===null?n(d):W(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),pe(e,a,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===o||d===null||W(d)?(e.exit("chunkString"),a(d)):(e.consume(d),d===92?f:c)}function f(d){return d===o||d===92?(e.consume(d),c):c(d)}}function Pl(e,t){let n;return r;function r(i){return W(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):oe(i)?pe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ME={name:"definition",tokenize:UE},jE={partial:!0,tokenize:BE};function UE(e,t,n){const r=this;let i;return l;function l(h){return e.enter("definition"),o(h)}function o(h){return xv.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return i=gi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):n(h)}function u(h){return ut(h)?Pl(e,a)(h):a(h)}function a(h){return wv(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(jE,f,f)(h)}function f(h){return oe(h)?pe(e,d,"whitespace")(h):d(h)}function d(h){return h===null||W(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function BE(e,t,n){return r;function r(s){return ut(s)?Pl(e,i)(s):n(s)}function i(s){return Sv(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function l(s){return oe(s)?pe(e,o,"whitespace")(s):o(s)}function o(s){return s===null||W(s)?t(s):n(s)}}const $E={name:"hardBreakEscape",tokenize:HE};function HE(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return W(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const VE={name:"headingAtx",resolve:QE,tokenize:WE};function QE(e,t){let n=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},sn(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])),e}function WE(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),l(c)}function l(c){return e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(e.consume(c),o):c===null||ut(c)?(e.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||W(c)?(e.exit("atxHeading"),t(c)):oe(c)?pe(e,s,"whitespace")(c):(e.enter("atxHeadingText"),a(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),s(c))}function a(c){return c===null||c===35||ut(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),a)}}const qE=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ip=["pre","script","style","textarea"],KE={concrete:!0,name:"htmlFlow",resolveTo:JE,tokenize:YE},GE={partial:!0,tokenize:eC},XE={partial:!0,tokenize:ZE};function JE(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function YE(e,t,n){const r=this;let i,l,o,s,u;return a;function a(k){return c(k)}function c(k){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(k),f}function f(k){return k===33?(e.consume(k),d):k===47?(e.consume(k),l=!0,v):k===63?(e.consume(k),i=3,r.interrupt?t:x):rn(k)?(e.consume(k),o=String.fromCharCode(k),w):n(k)}function d(k){return k===45?(e.consume(k),i=2,h):k===91?(e.consume(k),i=5,s=0,g):rn(k)?(e.consume(k),i=4,r.interrupt?t:x):n(k)}function h(k){return k===45?(e.consume(k),r.interrupt?t:x):n(k)}function g(k){const Ce="CDATA[";return k===Ce.charCodeAt(s++)?(e.consume(k),s===Ce.length?r.interrupt?t:$:g):n(k)}function v(k){return rn(k)?(e.consume(k),o=String.fromCharCode(k),w):n(k)}function w(k){if(k===null||k===47||k===62||ut(k)){const Ce=k===47,qe=o.toLowerCase();return!Ce&&!l&&ip.includes(qe)?(i=1,r.interrupt?t(k):$(k)):qE.includes(o.toLowerCase())?(i=6,Ce?(e.consume(k),p):r.interrupt?t(k):$(k)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(k):l?m(k):y(k))}return k===45||mt(k)?(e.consume(k),o+=String.fromCharCode(k),w):n(k)}function p(k){return k===62?(e.consume(k),r.interrupt?t:$):n(k)}function m(k){return oe(k)?(e.consume(k),m):z(k)}function y(k){return k===47?(e.consume(k),z):k===58||k===95||rn(k)?(e.consume(k),C):oe(k)?(e.consume(k),y):z(k)}function C(k){return k===45||k===46||k===58||k===95||mt(k)?(e.consume(k),C):P(k)}function P(k){return k===61?(e.consume(k),E):oe(k)?(e.consume(k),P):y(k)}function E(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),u=k,T):oe(k)?(e.consume(k),E):R(k)}function T(k){return k===u?(e.consume(k),u=null,L):k===null||W(k)?n(k):(e.consume(k),T)}function R(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||ut(k)?P(k):(e.consume(k),R)}function L(k){return k===47||k===62||oe(k)?y(k):n(k)}function z(k){return k===62?(e.consume(k),M):n(k)}function M(k){return k===null||W(k)?$(k):oe(k)?(e.consume(k),M):n(k)}function $(k){return k===45&&i===2?(e.consume(k),Y):k===60&&i===1?(e.consume(k),le):k===62&&i===4?(e.consume(k),Z):k===63&&i===3?(e.consume(k),x):k===93&&i===5?(e.consume(k),V):W(k)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(GE,re,ne)(k)):k===null||W(k)?(e.exit("htmlFlowData"),ne(k)):(e.consume(k),$)}function ne(k){return e.check(XE,H,re)(k)}function H(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),U}function U(k){return k===null||W(k)?ne(k):(e.enter("htmlFlowData"),$(k))}function Y(k){return k===45?(e.consume(k),x):$(k)}function le(k){return k===47?(e.consume(k),o="",D):$(k)}function D(k){if(k===62){const Ce=o.toLowerCase();return ip.includes(Ce)?(e.consume(k),Z):$(k)}return rn(k)&&o.length<8?(e.consume(k),o+=String.fromCharCode(k),D):$(k)}function V(k){return k===93?(e.consume(k),x):$(k)}function x(k){return k===62?(e.consume(k),Z):k===45&&i===2?(e.consume(k),x):$(k)}function Z(k){return k===null||W(k)?(e.exit("htmlFlowData"),re(k)):(e.consume(k),Z)}function re(k){return e.exit("htmlFlow"),t(k)}}function ZE(e,t,n){const r=this;return i;function i(o){return W(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):n(o)}function l(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function eC(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ou,t,n)}}const tC={name:"htmlText",tokenize:nC};function nC(e,t,n){const r=this;let i,l,o;return s;function s(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),u}function u(x){return x===33?(e.consume(x),a):x===47?(e.consume(x),P):x===63?(e.consume(x),y):rn(x)?(e.consume(x),R):n(x)}function a(x){return x===45?(e.consume(x),c):x===91?(e.consume(x),l=0,g):rn(x)?(e.consume(x),m):n(x)}function c(x){return x===45?(e.consume(x),h):n(x)}function f(x){return x===null?n(x):x===45?(e.consume(x),d):W(x)?(o=f,le(x)):(e.consume(x),f)}function d(x){return x===45?(e.consume(x),h):f(x)}function h(x){return x===62?Y(x):x===45?d(x):f(x)}function g(x){const Z="CDATA[";return x===Z.charCodeAt(l++)?(e.consume(x),l===Z.length?v:g):n(x)}function v(x){return x===null?n(x):x===93?(e.consume(x),w):W(x)?(o=v,le(x)):(e.consume(x),v)}function w(x){return x===93?(e.consume(x),p):v(x)}function p(x){return x===62?Y(x):x===93?(e.consume(x),p):v(x)}function m(x){return x===null||x===62?Y(x):W(x)?(o=m,le(x)):(e.consume(x),m)}function y(x){return x===null?n(x):x===63?(e.consume(x),C):W(x)?(o=y,le(x)):(e.consume(x),y)}function C(x){return x===62?Y(x):y(x)}function P(x){return rn(x)?(e.consume(x),E):n(x)}function E(x){return x===45||mt(x)?(e.consume(x),E):T(x)}function T(x){return W(x)?(o=T,le(x)):oe(x)?(e.consume(x),T):Y(x)}function R(x){return x===45||mt(x)?(e.consume(x),R):x===47||x===62||ut(x)?L(x):n(x)}function L(x){return x===47?(e.consume(x),Y):x===58||x===95||rn(x)?(e.consume(x),z):W(x)?(o=L,le(x)):oe(x)?(e.consume(x),L):Y(x)}function z(x){return x===45||x===46||x===58||x===95||mt(x)?(e.consume(x),z):M(x)}function M(x){return x===61?(e.consume(x),$):W(x)?(o=M,le(x)):oe(x)?(e.consume(x),M):L(x)}function $(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),i=x,ne):W(x)?(o=$,le(x)):oe(x)?(e.consume(x),$):(e.consume(x),H)}function ne(x){return x===i?(e.consume(x),i=void 0,U):x===null?n(x):W(x)?(o=ne,le(x)):(e.consume(x),ne)}function H(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||ut(x)?L(x):(e.consume(x),H)}function U(x){return x===47||x===62||ut(x)?L(x):n(x)}function Y(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}function le(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),D}function D(x){return oe(x)?pe(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):V(x)}function V(x){return e.enter("htmlTextData"),o(x)}}const rd={name:"labelEnd",resolveAll:oC,resolveTo:sC,tokenize:uC},rC={tokenize:aC},iC={tokenize:cC},lC={tokenize:fC};function oC(e){let t=-1;const n=[];for(;++t=3&&(a===null||W(a))?(e.exit("thematicBreak"),t(a)):n(a)}function u(a){return a===i?(e.consume(a),r++,u):(e.exit("thematicBreakSequence"),oe(a)?pe(e,s,"whitespace")(a):s(a))}}const et={continuation:{tokenize:SC},exit:EC,name:"list",tokenize:xC},vC={partial:!0,tokenize:CC},wC={partial:!0,tokenize:kC};function xC(e,t,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:vc(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Go,n,a)(h):a(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return n(h)}function u(h){return vc(h)&&++o<10?(e.consume(h),u):(!r.interrupt||o<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),a(h)):n(h)}function a(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(ou,r.interrupt?n:c,e.attempt(vC,d,f))}function c(h){return r.containerState.initialBlankLine=!0,l++,d(h)}function f(h){return oe(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),d):n(h)}function d(h){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function SC(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ou,i,l);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,pe(e,t,"listItemIndent",r.containerState.size+1)(s)}function l(s){return r.containerState.furtherBlankLines||!oe(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(wC,t,o)(s))}function o(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,pe(e,e.attempt(et,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function kC(e,t,n){const r=this;return pe(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(l):n(l)}}function EC(e){e.exit(this.containerState.type)}function CC(e,t,n){const r=this;return pe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!oe(l)&&o&&o[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const lp={name:"setextUnderline",resolveTo:PC,tokenize:_C};function PC(e,t){let n=e.length,r,i,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function _C(e,t,n){const r=this;let i;return l;function l(a){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=a,o(a)):n(a)}function o(a){return e.enter("setextHeadingLineSequence"),s(a)}function s(a){return a===i?(e.consume(a),s):(e.exit("setextHeadingLineSequence"),oe(a)?pe(e,u,"lineSuffix")(a):u(a))}function u(a){return a===null||W(a)?(e.exit("setextHeadingLine"),t(a)):n(a)}}const TC={tokenize:RC};function RC(e){const t=this,n=e.attempt(ou,r,e.attempt(this.parser.constructs.flowInitial,i,pe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(AE,i)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const OC={resolveAll:Ev()},bC=kv("string"),NC=kv("text");function kv(e){return{resolveAll:Ev(e==="text"?IC:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],l=n.attempt(i,o,s);return o;function o(c){return a(c)?l(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),u}function u(c){return a(c)?(n.exit("data"),l(c)):(n.consume(c),u)}function a(c){if(c===null)return!0;const f=i[c];let d=-1;if(f)for(;++d-1){const s=o[0];typeof s=="string"?o[0]=s.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function QC(e,t){let n=-1;const r=[];let i;for(;++n0){const Lt=q.tokenStack[q.tokenStack.length-1];(Lt[1]||sp).call(q,void 0,Lt[0])}for(F.position={start:In(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:In(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},fe=-1;++fe1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const a={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,a),e.applyData(t,a)}function uP(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aP(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function _v(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function cP(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _v(e,t);const i={src:Wi(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function fP(e,t){const n={src:Wi(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function dP(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function hP(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _v(e,t);const i={href:Wi(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function pP(e,t){const n={href:Wi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function mP(e,t,n){const r=e.all(t),i=n?yP(n):Tv(t),l={},o=[];if(typeof t.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let s=-1;for(;++s1}function gP(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=Jf(t.children[1]),u=sv(t.children[t.children.length-1]);s&&u&&(o.position={start:s,end:u}),i.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function kP(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,s=o?o.length:t.children.length;let u=-1;const a=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(cp(t.slice(i),i>0,!1)),l.join("")}function cp(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===up||l===ap;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===up||l===ap;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function PP(e,t){const n={type:"text",value:CP(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function _P(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const TP={blockquote:nP,break:rP,code:iP,delete:lP,emphasis:oP,footnoteReference:sP,heading:uP,html:aP,imageReference:cP,image:fP,inlineCode:dP,linkReference:hP,link:pP,listItem:mP,list:gP,paragraph:vP,root:wP,strong:xP,table:SP,tableCell:EP,tableRow:kP,text:PP,thematicBreak:_P,toml:bo,yaml:bo,definition:bo,footnoteDefinition:bo};function bo(){}const Rv=-1,su=0,_l=1,Ts=2,id=3,ld=4,od=5,sd=6,Ov=7,bv=8,fp=typeof self=="object"?self:globalThis,RP=(e,t)=>{const n=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,o]=t[i];switch(l){case su:case Rv:return n(o,i);case _l:{const s=n([],i);for(const u of o)s.push(r(u));return s}case Ts:{const s=n({},i);for(const[u,a]of o)s[r(u)]=r(a);return s}case id:return n(new Date(o),i);case ld:{const{source:s,flags:u}=o;return n(new RegExp(s,u),i)}case od:{const s=n(new Map,i);for(const[u,a]of o)s.set(r(u),r(a));return s}case sd:{const s=n(new Set,i);for(const u of o)s.add(r(u));return s}case Ov:{const{name:s,message:u}=o;return n(new fp[s](u),i)}case bv:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:s}=new Uint8Array(o);return n(new DataView(s),o)}}return n(new fp[l](o),i)};return r},dp=e=>RP(new Map,e)(0),Jr="",{toString:OP}={},{keys:bP}=Object,sl=e=>{const t=typeof e;if(t!=="object"||!e)return[su,t];const n=OP.call(e).slice(8,-1);switch(n){case"Array":return[_l,Jr];case"Object":return[Ts,Jr];case"Date":return[id,Jr];case"RegExp":return[ld,Jr];case"Map":return[od,Jr];case"Set":return[sd,Jr];case"DataView":return[_l,n]}return n.includes("Array")?[_l,n]:n.includes("Error")?[Ov,n]:[Ts,n]},No=([e,t])=>e===su&&(t==="function"||t==="symbol"),NP=(e,t,n,r)=>{const i=(o,s)=>{const u=r.push(o)-1;return n.set(s,u),u},l=o=>{if(n.has(o))return n.get(o);let[s,u]=sl(o);switch(s){case su:{let c=o;switch(u){case"bigint":s=bv,c=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([Rv],o)}return i([s,c],o)}case _l:{if(u){let d=o;return u==="DataView"?d=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(d=new Uint8Array(o)),i([u,[...d]],o)}const c=[],f=i([s,c],o);for(const d of o)c.push(l(d));return f}case Ts:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(t&&"toJSON"in o)return l(o.toJSON());const c=[],f=i([s,c],o);for(const d of bP(o))(e||!No(sl(o[d])))&&c.push([l(d),l(o[d])]);return f}case id:return i([s,o.toISOString()],o);case ld:{const{source:c,flags:f}=o;return i([s,{source:c,flags:f}],o)}case od:{const c=[],f=i([s,c],o);for(const[d,h]of o)(e||!(No(sl(d))||No(sl(h))))&&c.push([l(d),l(h)]);return f}case sd:{const c=[],f=i([s,c],o);for(const d of o)(e||!No(sl(d)))&&c.push(l(d));return f}}const{message:a}=o;return i([s,{name:u,message:a}],o)};return l},hp=(e,{json:t,lossy:n}={})=>{const r=[];return NP(!(t||n),!!t,new Map,r)(e),r},Rs=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?dp(hp(e,t)):structuredClone(e):(e,t)=>dp(hp(e,t));function IP(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function AP(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function LP(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||IP,r=e.options.footnoteBackLabel||AP,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let u=-1;for(;++u0&&g.push({type:"text",value:" "});let m=typeof n=="string"?n:n(u,h);typeof m=="string"&&(m={type:"text",value:m}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+d+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,h),className:["data-footnote-backref"]},children:Array.isArray(m)?m:[m]})}const w=c[c.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const m=w.children[w.children.length-1];m&&m.type==="text"?m.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...g)}else c.push(...g);const p={type:"element",tagName:"li",properties:{id:t+"fn-"+d},children:e.wrap(c,!0)};e.patch(a,p),s.push(p)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Rs(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` `}]}}const Nv=function(e){if(e==null)return MP;if(typeof e=="function")return uu(e);if(typeof e=="object")return Array.isArray(e)?DP(e):FP(e);if(typeof e=="string")return zP(e);throw new Error("Expected function, string, or object as test")};function DP(e){const t=[];let n=-1;for(;++n":""))+")"})}return d;function d(){let h=Iv,g,v,w;if((!t||l(u,a,c[c.length-1]||void 0))&&(h=HP(n(u,c)),h[0]===pp))return h;if("children"in u&&u.children){const p=u;if(p.children&&h[0]!==BP)for(v=(r?p.children.length:-1)+o,w=c.concat(p);v>-1&&v0&&n.push({type:"text",value:` `}),n}function mp(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function yp(e,t){const n=QP(e,t),r=n.one(e,void 0),i=LP(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:` `},i),l}function XP(e,t){return e&&"run"in e?async function(n,r){const i=yp(n,{file:r,...t});await e.run(i,r)}:function(n,r){return yp(n,{file:r,...e||t})}}function gp(e){if(e)throw e}var Xo=Object.prototype.hasOwnProperty,Lv=Object.prototype.toString,vp=Object.defineProperty,wp=Object.getOwnPropertyDescriptor,xp=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Lv.call(t)==="[object Array]"},Sp=function(t){if(!t||Lv.call(t)!=="[object Object]")return!1;var n=Xo.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Xo.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Xo.call(t,i)},kp=function(t,n){vp&&n.name==="__proto__"?vp(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Ep=function(t,n){if(n==="__proto__")if(Xo.call(t,n)){if(wp)return wp(t,n).value}else return;return t[n]},JP=function e(){var t,n,r,i,l,o,s=arguments[0],u=1,a=arguments.length,c=!1;for(typeof s=="boolean"&&(c=s,s=arguments[1]||{},u=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});uo.length;let u;s&&o.push(i);try{u=e.apply(this,o)}catch(a){const c=a;if(s&&n)throw c;return i(c)}s||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(o,...s){n||(n=!0,t(o,...s))}function l(o){i(null,o)}}const Jt={basename:e_,dirname:t_,extname:n_,join:r_,sep:"/"};function e_(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');uo(e);let n=0,r=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else o<0&&(l=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function t_(e){if(uo(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function n_(e){uo(e);let t=e.length,n=-1,r=0,i=-1,l=0,o;for(;t--;){const s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function r_(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function l_(e,t){let n="",r=0,i=-1,l=0,o=-1,s,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,l=0;continue}}else if(n.length>0){n="",r=0,i=o,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,l=0}else s===46&&l>-1?l++:l=-1}return n}function uo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const o_={cwd:s_};function s_(){return"/"}function kc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function u_(e){if(typeof e=="string")e=new URL(e);else if(!kc(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return a_(e)}function a_(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[h,...g]=c;const v=r[d][1];Sc(v)&&Sc(h)&&(h=na(!0,v,h)),r[d]=[a,h,...g]}}}}const h_=new ud().freeze();function oa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function sa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ua(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Pp(e){if(!Sc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function _p(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Io(e){return p_(e)?e:new Dv(e)}function p_(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function m_(e){return typeof e=="string"||y_(e)}function y_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const g_="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Tp=[],Rp={allowDangerousHtml:!0},v_=/^(https?|ircs?|mailto|xmpp)$/i,w_=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Fv(e){const t=x_(e),n=S_(e);return k_(t.runSync(t.parse(n),n),e)}function x_(e){const t=e.rehypePlugins||Tp,n=e.remarkPlugins||Tp,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Rp}:Rp;return h_().use(tP).use(n).use(XP,r).use(t)}function S_(e){const t=e.children||"",n=new Dv;return typeof t=="string"&&(n.value=t),n}function k_(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,l=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,u=t.urlTransform||E_;for(const c of w_)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+g_+c.id,void 0);return Av(e,a),Lk(e,{Fragment:A.Fragment,components:i,ignoreInvalidStyle:!0,jsx:A.jsx,jsxs:A.jsxs,passKeys:!0,passNode:!0});function a(c,f,d){if(c.type==="raw"&&d&&typeof f=="number")return o?d.children.splice(f,1):d.children[f]={type:"text",value:c.value},f;if(c.type==="element"){let h;for(h in Zu)if(Object.hasOwn(Zu,h)&&Object.hasOwn(c.properties,h)){const g=c.properties[h],v=Zu[h];(v===null||v.includes(c.tagName))&&(c.properties[h]=u(String(g||""),h,c))}}if(c.type==="element"){let h=n?!n.includes(c.tagName):l?l.includes(c.tagName):!1;if(!h&&r&&typeof f=="number"&&(h=!r(c,f,d)),h&&d&&typeof f=="number")return s&&c.children?d.children.splice(f,1,...c.children):d.children.splice(f,1),f}}}function E_(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||v_.test(e.slice(0,t))?e:""}const C_=(e,t,n=7)=>{const r=new Date;r.setTime(r.getTime()+n*24*60*60*1e3),document.cookie=`${e}=${t};expires=${r.toUTCString()};path=/`},zv=e=>{const t=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},P_=e=>{document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/;`},Op=({content:e,expandTitle:t="Показать результаты поиска",collapseTitle:n="Скрыть результаты поиска"})=>{const[r,i]=b.useState(!1);return A.jsxs("div",{className:"spoiler",children:[A.jsx("button",{className:"spoiler-toggle",onClick:()=>i(!r),children:r?n:t}),r&&A.jsx("div",{className:"spoiler-content",children:A.jsx(Fv,{children:e})})]})},bp=({role:e,content:t,searchResults:n="",isLoading:r,reasoning:i=""})=>{const l=zv("expert_mode")==="true";return A.jsx("div",{className:`message ${e} ${r?"loading":""}`,children:r?A.jsxs("div",{className:"loading-dots",children:[A.jsx("span",{className:"loading-dot"}),A.jsx("span",{className:"loading-dot"}),A.jsx("span",{className:"loading-dot"})]}):A.jsxs("div",{className:"message-content",children:[A.jsx(Fv,{children:t}),n&&A.jsx(Op,{content:n}),l&&i&&A.jsx(Op,{content:i,collapseTitle:"Скрыть рассуждения",expandTitle:"Показать рассуждения"})]})})},__=({onSend:e,text:t,setText:n})=>{const r=i=>{i.key==="Enter"&&i.ctrlKey&&(i.preventDefault(),t.trim()&&e(t))};return A.jsx("div",{className:"input-wrapper",children:A.jsx("textarea",{value:t,onChange:i=>n(i.target.value),onKeyDown:r,placeholder:"Введите сообщение... (Ctrl+Enter для отправки)"})})};function Fe(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var T_=typeof Symbol=="function"&&Symbol.observable||"@@observable",Np=T_,aa=()=>Math.random().toString(36).substring(7).split("").join("."),R_={INIT:`@@redux/INIT${aa()}`,REPLACE:`@@redux/REPLACE${aa()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${aa()}`},Os=R_;function ad(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Mv(e,t,n){if(typeof e!="function")throw new Error(Fe(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Fe(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Fe(1));return n(Mv)(e,t)}let r=e,i=t,l=new Map,o=l,s=0,u=!1;function a(){o===l&&(o=new Map,l.forEach((w,p)=>{o.set(p,w)}))}function c(){if(u)throw new Error(Fe(3));return i}function f(w){if(typeof w!="function")throw new Error(Fe(4));if(u)throw new Error(Fe(5));let p=!0;a();const m=s++;return o.set(m,w),function(){if(p){if(u)throw new Error(Fe(6));p=!1,a(),o.delete(m),l=null}}}function d(w){if(!ad(w))throw new Error(Fe(7));if(typeof w.type>"u")throw new Error(Fe(8));if(typeof w.type!="string")throw new Error(Fe(17));if(u)throw new Error(Fe(9));try{u=!0,i=r(i,w)}finally{u=!1}return(l=o).forEach(m=>{m()}),w}function h(w){if(typeof w!="function")throw new Error(Fe(10));r=w,d({type:Os.REPLACE})}function g(){const w=f;return{subscribe(p){if(typeof p!="object"||p===null)throw new Error(Fe(11));function m(){const C=p;C.next&&C.next(c())}return m(),{unsubscribe:w(m)}},[Np](){return this}}}return d({type:Os.INIT}),{dispatch:d,subscribe:f,getState:c,replaceReducer:h,[Np]:g}}function O_(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Os.INIT})>"u")throw new Error(Fe(12));if(typeof n(void 0,{type:Os.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Fe(13))})}function b_(e){const t=Object.keys(e),n={};for(let l=0;l"u")throw s&&s.type,new Error(Fe(14));a[f]=g,u=u||g!==h}return u=u||r.length!==Object.keys(o).length,u?a:o}}function bs(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function N_(...e){return t=>(n,r)=>{const i=t(n,r);let l=()=>{throw new Error(Fe(15))};const o={getState:i.getState,dispatch:(u,...a)=>l(u,...a)},s=e.map(u=>u(o));return l=bs(...s)(i.dispatch),{...i,dispatch:l}}}function I_(e){return ad(e)&&"type"in e&&typeof e.type=="string"}var jv=Symbol.for("immer-nothing"),Ip=Symbol.for("immer-draftable"),wt=Symbol.for("immer-state");function $t(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ji=Object.getPrototypeOf;function Ur(e){return!!e&&!!e[wt]}function _n(e){var t;return e?Uv(e)||Array.isArray(e)||!!e[Ip]||!!((t=e.constructor)!=null&&t[Ip])||cu(e)||fu(e):!1}var A_=Object.prototype.constructor.toString();function Uv(e){if(!e||typeof e!="object")return!1;const t=ji(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===A_}function Ns(e,t){au(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function au(e){const t=e[wt];return t?t.type_:Array.isArray(e)?1:cu(e)?2:fu(e)?3:0}function Ec(e,t){return au(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Bv(e,t,n){const r=au(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function L_(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function cu(e){return e instanceof Map}function fu(e){return e instanceof Set}function gr(e){return e.copy_||e.base_}function Cc(e,t){if(cu(e))return new Map(e);if(fu(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Uv(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[wt];let i=Reflect.ownKeys(r);for(let l=0;l1&&(e.set=e.add=e.clear=e.delete=D_),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>cd(r,!0))),e}function D_(){$t(2)}function du(e){return Object.isFrozen(e)}var F_={};function Br(e){const t=F_[e];return t||$t(0,e),t}var ql;function $v(){return ql}function z_(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ap(e,t){t&&(Br("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Pc(e){_c(e),e.drafts_.forEach(M_),e.drafts_=null}function _c(e){e===ql&&(ql=e.parent_)}function Lp(e){return ql=z_(ql,e)}function M_(e){const t=e[wt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Dp(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[wt].modified_&&(Pc(t),$t(4)),_n(e)&&(e=Is(t,e),t.parent_||As(t,e)),t.patches_&&Br("Patches").generateReplacementPatches_(n[wt].base_,e,t.patches_,t.inversePatches_)):e=Is(t,n,[]),Pc(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==jv?e:void 0}function Is(e,t,n){if(du(t))return t;const r=t[wt];if(!r)return Ns(t,(i,l)=>Fp(e,r,t,i,l,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return As(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let l=i,o=!1;r.type_===3&&(l=new Set(i),i.clear(),o=!0),Ns(l,(s,u)=>Fp(e,r,i,s,u,n,o)),As(e,i,!1),n&&e.patches_&&Br("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Fp(e,t,n,r,i,l,o){if(Ur(i)){const s=l&&t&&t.type_!==3&&!Ec(t.assigned_,r)?l.concat(r):void 0,u=Is(e,i,s);if(Bv(n,r,u),Ur(u))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(_n(i)&&!du(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Is(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&As(e,i)}}function As(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&cd(t,n)}function j_(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:$v(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,l=fd;n&&(i=[r],l=Kl);const{revoke:o,proxy:s}=Proxy.revocable(i,l);return r.draft_=s,r.revoke_=o,s}var fd={get(e,t){if(t===wt)return e;const n=gr(e);if(!Ec(n,t))return U_(e,n,t);const r=n[t];return e.finalized_||!_n(r)?r:r===ca(e.base_,t)?(fa(e),e.copy_[t]=Rc(r,e)):r},has(e,t){return t in gr(e)},ownKeys(e){return Reflect.ownKeys(gr(e))},set(e,t,n){const r=Hv(gr(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=ca(gr(e),t),l=i==null?void 0:i[wt];if(l&&l.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(L_(n,i)&&(n!==void 0||Ec(e.base_,t)))return!0;fa(e),Tc(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return ca(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,fa(e),Tc(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=gr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){$t(11)},getPrototypeOf(e){return ji(e.base_)},setPrototypeOf(){$t(12)}},Kl={};Ns(fd,(e,t)=>{Kl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Kl.deleteProperty=function(e,t){return Kl.set.call(this,e,t,void 0)};Kl.set=function(e,t,n){return fd.set.call(this,e[0],t,n,e[0])};function ca(e,t){const n=e[wt];return(n?gr(n):e)[t]}function U_(e,t,n){var i;const r=Hv(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Hv(e,t){if(!(t in e))return;let n=ji(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=ji(n)}}function Tc(e){e.modified_||(e.modified_=!0,e.parent_&&Tc(e.parent_))}function fa(e){e.copy_||(e.copy_=Cc(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var B_=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const l=n;n=t;const o=this;return function(u=l,...a){return o.produce(u,c=>n.call(this,c,...a))}}typeof n!="function"&&$t(6),r!==void 0&&typeof r!="function"&&$t(7);let i;if(_n(t)){const l=Lp(this),o=Rc(t,void 0);let s=!0;try{i=n(o),s=!1}finally{s?Pc(l):_c(l)}return Ap(l,r),Dp(i,l)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===jv&&(i=void 0),this.autoFreeze_&&cd(i,!0),r){const l=[],o=[];Br("Patches").generateReplacementPatches_(t,i,l,o),r(l,o)}return i}else $t(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...s)=>this.produceWithPatches(o,u=>t(u,...s));let r,i;return[this.produce(t,n,(o,s)=>{r=o,i=s}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){_n(e)||$t(8),Ur(e)&&(e=$_(e));const t=Lp(this),n=Rc(e,void 0);return n[wt].isManual_=!0,_c(t),n}finishDraft(e,t){const n=e&&e[wt];(!n||!n.isManual_)&&$t(9);const{scope_:r}=n;return Ap(r,t),Dp(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Br("Patches").applyPatches_;return Ur(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Rc(e,t){const n=cu(e)?Br("MapSet").proxyMap_(e,t):fu(e)?Br("MapSet").proxySet_(e,t):j_(e,t);return(t?t.scope_:$v()).drafts_.push(n),n}function $_(e){return Ur(e)||$t(10,e),Vv(e)}function Vv(e){if(!_n(e)||du(e))return e;const t=e[wt];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Cc(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Cc(e,!0);return Ns(n,(r,i)=>{Bv(n,r,Vv(i))}),t&&(t.finalized_=!1),n}var xt=new B_,Qv=xt.produce;xt.produceWithPatches.bind(xt);xt.setAutoFreeze.bind(xt);xt.setUseStrictShallowCopy.bind(xt);xt.applyPatches.bind(xt);xt.createDraft.bind(xt);xt.finishDraft.bind(xt);function Wv(e){return({dispatch:n,getState:r})=>i=>l=>typeof l=="function"?l(n,r,e):i(l)}var H_=Wv(),V_=Wv,Q_=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?bs:bs.apply(null,arguments)};function zp(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(xn(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>I_(r)&&r.type===e,n}var qv=class hl extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,hl.prototype)}static get[Symbol.species](){return hl}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new hl(...t[0].concat(this)):new hl(...t.concat(this))}};function Mp(e){return _n(e)?Qv(e,()=>{}):e}function jp(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function W_(e){return typeof e=="boolean"}var q_=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:l=!0}=t??{};let o=new qv;return n&&(W_(n)?o.push(H_):o.push(V_(n.extraArgument))),o},K_="RTK_autoBatch",Up=e=>t=>{setTimeout(t,e)},G_=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,l=!1,o=!1;const s=new Set,u=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Up(10):e.type==="callback"?e.queueNotification:Up(e.timeout),a=()=>{o=!1,l&&(l=!1,s.forEach(c=>c()))};return Object.assign({},r,{subscribe(c){const f=()=>i&&c(),d=r.subscribe(f);return s.add(c),()=>{d(),s.delete(c)}},dispatch(c){var f;try{return i=!((f=c==null?void 0:c.meta)!=null&&f[K_]),l=!i,l&&(o||(o=!0,u(a))),r.dispatch(c)}finally{i=!0}}})},X_=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new qv(e);return r&&i.push(G_(typeof r=="object"?r:void 0)),i};function J_(e){const t=q_(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:l=void 0,enhancers:o=void 0}=e||{};let s;if(typeof n=="function")s=n;else if(ad(n))s=b_(n);else throw new Error(xn(1));let u;typeof r=="function"?u=r(t):u=t();let a=bs;i&&(a=Q_({trace:!1,...typeof i=="object"&&i}));const c=N_(...u),f=X_(c);let d=typeof o=="function"?o(f):f();const h=a(...d);return Mv(s,l,h)}function Kv(e){const t={},n=[];let r;const i={addCase(l,o){const s=typeof l=="string"?l:l.type;if(!s)throw new Error(xn(28));if(s in t)throw new Error(xn(29));return t[s]=o,i},addMatcher(l,o){return n.push({matcher:l,reducer:o}),i},addDefaultCase(l){return r=l,i}};return e(i),[t,n,r]}function Y_(e){return typeof e=="function"}function Z_(e,t){let[n,r,i]=Kv(t),l;if(Y_(e))l=()=>Mp(e());else{const s=Mp(e);l=()=>s}function o(s=l(),u){let a=[n[u.type],...r.filter(({matcher:c})=>c(u)).map(({reducer:c})=>c)];return a.filter(c=>!!c).length===0&&(a=[i]),a.reduce((c,f)=>{if(f)if(Ur(c)){const h=f(c,u);return h===void 0?c:h}else{if(_n(c))return Qv(c,d=>f(d,u));{const d=f(c,u);if(d===void 0){if(c===null)return c;throw Error("A case reducer on a non-draftable value must not return undefined")}return d}}return c},s)}return o.getInitialState=l,o}var eT=Symbol.for("rtk-slice-createasyncthunk");function tT(e,t){return`${e}/${t}`}function nT({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[eT];return function(i){const{name:l,reducerPath:o=l}=i;if(!l)throw new Error(xn(11));const s=(typeof i.reducers=="function"?i.reducers(lT()):i.reducers)||{},u=Object.keys(s),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(y,C){const P=typeof y=="string"?y:y.type;if(!P)throw new Error(xn(12));if(P in a.sliceCaseReducersByType)throw new Error(xn(13));return a.sliceCaseReducersByType[P]=C,c},addMatcher(y,C){return a.sliceMatchers.push({matcher:y,reducer:C}),c},exposeAction(y,C){return a.actionCreators[y]=C,c},exposeCaseReducer(y,C){return a.sliceCaseReducersByName[y]=C,c}};u.forEach(y=>{const C=s[y],P={reducerName:y,type:tT(l,y),createNotation:typeof i.reducers=="function"};sT(C)?aT(P,C,c,t):oT(P,C,c)});function f(){const[y={},C=[],P=void 0]=typeof i.extraReducers=="function"?Kv(i.extraReducers):[i.extraReducers],E={...y,...a.sliceCaseReducersByType};return Z_(i.initialState,T=>{for(let R in E)T.addCase(R,E[R]);for(let R of a.sliceMatchers)T.addMatcher(R.matcher,R.reducer);for(let R of C)T.addMatcher(R.matcher,R.reducer);P&&T.addDefaultCase(P)})}const d=y=>y,h=new Map;let g;function v(y,C){return g||(g=f()),g(y,C)}function w(){return g||(g=f()),g.getInitialState()}function p(y,C=!1){function P(T){let R=T[y];return typeof R>"u"&&C&&(R=w()),R}function E(T=d){const R=jp(h,C,()=>new WeakMap);return jp(R,T,()=>{const L={};for(const[z,M]of Object.entries(i.selectors??{}))L[z]=rT(M,T,w,C);return L})}return{reducerPath:y,getSelectors:E,get selectors(){return E(P)},selectSlice:P}}const m={name:l,reducer:v,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:w,...p(o),injectInto(y,{reducerPath:C,...P}={}){const E=C??o;return y.inject({reducerPath:E,reducer:v},P),{...m,...p(E,!0)}}};return m}}function rT(e,t,n,r){function i(l,...o){let s=t(l);return typeof s>"u"&&r&&(s=n()),e(s,...o)}return i.unwrapped=e,i}var iT=nT();function lT(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function oT({type:e,reducerName:t,createNotation:n},r,i){let l,o;if("reducer"in r){if(n&&!uT(r))throw new Error(xn(17));l=r.reducer,o=r.prepare}else l=r;i.addCase(e,l).exposeCaseReducer(t,l).exposeAction(t,o?zp(e,o):zp(e))}function sT(e){return e._reducerDefinitionType==="asyncThunk"}function uT(e){return e._reducerDefinitionType==="reducerWithPrepare"}function aT({type:e,reducerName:t},n,r,i){if(!i)throw new Error(xn(18));const{payloadCreator:l,fulfilled:o,pending:s,rejected:u,settled:a,options:c}=n,f=i(e,l,c);r.exposeAction(t,f),o&&r.addCase(f.fulfilled,o),s&&r.addCase(f.pending,s),u&&r.addCase(f.rejected,u),a&&r.addMatcher(f.settled,a),r.exposeCaseReducer(t,{fulfilled:o||Ao,pending:s||Ao,rejected:u||Ao,settled:a||Ao})}function Ao(){}function xn(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const cT={chats:[],activeChatId:null},Gv=iT({name:"chat",initialState:cT,reducers:{setChats:(e,t)=>{e.chats=t.payload,!e.activeChatId&&t.payload.length>0&&(e.activeChatId=t.payload[0].id)},addMessage:(e,t)=>{const n=e.chats.find(r=>r.id===t.payload.chatId);n&&n.history.push(t.payload.message)},setHistory:(e,t)=>{const n=e.chats.find(r=>r.id===t.payload.chatId);n&&(n.history=t.payload.history)},removeLastMessage:(e,t)=>{const n=e.chats.find(r=>r.id===t.payload);n&&n.history.pop()},clearHistory:(e,t)=>{const n=e.chats.find(r=>r.id===t.payload);n&&(n.history=[])},setActiveChat:(e,t)=>{e.activeChatId=t.payload},addChat:(e,t)=>{e.chats.push(t.payload),e.activeChatId=t.payload.id},deleteChat:(e,t)=>{e.chats=e.chats.filter(n=>n.id!==t.payload),e.activeChatId===t.payload&&e.chats.length>0?e.activeChatId=e.chats[0].id:e.chats.length===0&&(e.activeChatId=null)},renameChat:(e,t)=>{const n=e.chats.find(r=>r.id===t.payload.chatId);n&&(n.name=t.payload.newName)}}}),{setChats:fT,addMessage:dT,setHistory:Lo,removeLastMessage:hT,clearHistory:pT,setActiveChat:Xv,addChat:Bp,deleteChat:$p,renameChat:mT}=Gv.actions,yT=Gv.reducer;var Jv={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Hp=vn.createContext&&vn.createContext(Jv),gT=["attr","size","title"];function vT(e,t){if(e==null)return{};var n=wT(e,t),r,i;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wT(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ls(){return Ls=Object.assign?Object.assign.bind():function(e){for(var t=1;tvn.createElement(t.tag,Ds({key:n},t.attr),Yv(t.child)))}function hu(e){return t=>vn.createElement(ET,Ls({attr:Ds({},e.attr)},t),Yv(e.child))}function ET(e){var t=n=>{var{attr:r,size:i,title:l}=e,o=vT(e,gT),s=i||n.size||"1em",u;return n.className&&(u=n.className),e.className&&(u=(u?u+" ":"")+e.className),vn.createElement("svg",Ls({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:u,style:Ds(Ds({color:e.color||n.color},n.style),e.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),l&&vn.createElement("title",null,l),e.children)};return Hp!==void 0?vn.createElement(Hp.Consumer,null,n=>t(n)):t(Jv)}function CT(e){return hu({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"},child:[]}]})(e)}function PT(e){return hu({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"},child:[]}]})(e)}function _T(e){return hu({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function TT(e){return hu({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"},child:[]}]})(e)}var qi=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(){}},$r=typeof window>"u"||"Deno"in globalThis;function Pt(){}function RT(e,t){return typeof e=="function"?e(t):e}function Oc(e){return typeof e=="number"&&e>=0&&e!==1/0}function Zv(e,t){return Math.max(e+(t||0)-Date.now(),0)}function vi(e,t){return typeof e=="function"?e(t):e}function Bt(e,t){return typeof e=="function"?e(t):e}function Qp(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:l,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==dd(o,t.options))return!1}else if(!Gl(t.queryKey,o))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||l&&!l(t))}function Wp(e,t){const{exact:n,status:r,predicate:i,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(n){if(Hr(t.options.mutationKey)!==Hr(l))return!1}else if(!Gl(t.options.mutationKey,l))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function dd(e,t){return((t==null?void 0:t.queryKeyHashFn)||Hr)(e)}function Hr(e){return JSON.stringify(e,(t,n)=>bc(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Gl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Gl(e[n],t[n])):!1}function e0(e,t){if(e===t)return e;const n=qp(e)&&qp(t);if(n||bc(e)&&bc(t)){const r=n?e:Object.keys(e),i=r.length,l=n?t:Object.keys(t),o=l.length,s=n?[]:{};let u=0;for(let a=0;a{setTimeout(t,e)})}function Nc(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?e0(e,t):t}function bT(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function NT(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var hd=Symbol();function t0(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===hd?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Er,Mn,wi,pm,IT=(pm=class extends qi{constructor(){super();Q(this,Er);Q(this,Mn);Q(this,wi);j(this,wi,t=>{if(!$r&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){S(this,Mn)||this.setEventListener(S(this,wi))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,Mn))==null||t.call(this),j(this,Mn,void 0))}setEventListener(t){var n;j(this,wi,t),(n=S(this,Mn))==null||n.call(this),j(this,Mn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){S(this,Er)!==t&&(j(this,Er,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof S(this,Er)=="boolean"?S(this,Er):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Er=new WeakMap,Mn=new WeakMap,wi=new WeakMap,pm),pd=new IT,xi,jn,Si,mm,AT=(mm=class extends qi{constructor(){super();Q(this,xi,!0);Q(this,jn);Q(this,Si);j(this,Si,t=>{if(!$r&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){S(this,jn)||this.setEventListener(S(this,Si))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,jn))==null||t.call(this),j(this,jn,void 0))}setEventListener(t){var n;j(this,Si,t),(n=S(this,jn))==null||n.call(this),j(this,jn,t(this.setOnline.bind(this)))}setOnline(t){S(this,xi)!==t&&(j(this,xi,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return S(this,xi)}},xi=new WeakMap,jn=new WeakMap,Si=new WeakMap,mm),zs=new AT;function Ic(){let e,t;const n=new Promise((i,l)=>{e=i,t=l});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function LT(e){return Math.min(1e3*2**e,3e4)}function n0(e){return(e??"online")==="online"?zs.isOnline():!0}var r0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function da(e){return e instanceof r0}function i0(e){let t=!1,n=0,r=!1,i;const l=Ic(),o=v=>{var w;r||(d(new r0(v)),(w=e.abort)==null||w.call(e))},s=()=>{t=!0},u=()=>{t=!1},a=()=>pd.isFocused()&&(e.networkMode==="always"||zs.isOnline())&&e.canRun(),c=()=>n0(e.networkMode)&&e.canRun(),f=v=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,v),i==null||i(),l.resolve(v))},d=v=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,v),i==null||i(),l.reject(v))},h=()=>new Promise(v=>{var w;i=p=>{(r||a())&&v(p)},(w=e.onPause)==null||w.call(e)}).then(()=>{var v;i=void 0,r||(v=e.onContinue)==null||v.call(e)}),g=()=>{if(r)return;let v;const w=n===0?e.initialPromise:void 0;try{v=w??e.fn()}catch(p){v=Promise.reject(p)}Promise.resolve(v).then(f).catch(p=>{var E;if(r)return;const m=e.retry??($r?0:3),y=e.retryDelay??LT,C=typeof y=="function"?y(n,p):y,P=m===!0||typeof m=="number"&&na()?void 0:h()).then(()=>{t?d(p):g()})})};return{promise:l,cancel:o,continue:()=>(i==null||i(),l),cancelRetry:s,continueRetry:u,canStart:c,start:()=>(c()?g():h().then(g),l)}}function DT(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=s=>setTimeout(s,0);const l=s=>{t?e.push(s):i(()=>{n(s)})},o=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(u=>{n(u)})})})};return{batch:s=>{let u;t++;try{u=s()}finally{t--,t||o()}return u},batchCalls:s=>(...u)=>{l(()=>{s(...u)})},schedule:l,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var Oe=DT(),Cr,ym,l0=(ym=class{constructor(){Q(this,Cr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Oc(this.gcTime)&&j(this,Cr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??($r?1/0:5*60*1e3))}clearGcTimeout(){S(this,Cr)&&(clearTimeout(S(this,Cr)),j(this,Cr,void 0))}},Cr=new WeakMap,ym),ki,Ei,Ct,Pr,$e,Jl,_r,zt,fn,gm,FT=(gm=class extends l0{constructor(t){super();Q(this,zt);Q(this,ki);Q(this,Ei);Q(this,Ct);Q(this,Pr);Q(this,$e);Q(this,Jl);Q(this,_r);j(this,_r,!1),j(this,Jl,t.defaultOptions),this.setOptions(t.options),this.observers=[],j(this,Pr,t.client),j(this,Ct,S(this,Pr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,j(this,ki,zT(this.options)),this.state=t.state??S(this,ki),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=S(this,$e))==null?void 0:t.promise}setOptions(t){this.options={...S(this,Jl),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&S(this,Ct).remove(this)}setData(t,n){const r=Nc(this.state.data,t,this.options);return X(this,zt,fn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){X(this,zt,fn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=S(this,$e))==null?void 0:r.promise;return(i=S(this,$e))==null||i.cancel(t),n?n.then(Pt).catch(Pt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(S(this,ki))}isActive(){return this.observers.some(t=>Bt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hd||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Zv(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=S(this,$e))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=S(this,$e))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),S(this,Ct).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(S(this,$e)&&(S(this,_r)?S(this,$e).cancel({revert:!0}):S(this,$e).cancelRetry()),this.scheduleGc()),S(this,Ct).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||X(this,zt,fn).call(this,{type:"invalidate"})}fetch(t,n){var u,a,c;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(S(this,$e))return S(this,$e).continueRetry(),S(this,$e).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(d=>d.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(j(this,_r,!0),r.signal)})},l=()=>{const f=t0(this.options,n),d={client:S(this,Pr),queryKey:this.queryKey,meta:this.meta};return i(d),j(this,_r,!1),this.options.persister?this.options.persister(f,d,this):f(d)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:S(this,Pr),state:this.state,fetchFn:l};i(o),(u=this.options.behavior)==null||u.onFetch(o,this),j(this,Ei,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((a=o.fetchOptions)==null?void 0:a.meta))&&X(this,zt,fn).call(this,{type:"fetch",meta:(c=o.fetchOptions)==null?void 0:c.meta});const s=f=>{var d,h,g,v;da(f)&&f.silent||X(this,zt,fn).call(this,{type:"error",error:f}),da(f)||((h=(d=S(this,Ct).config).onError)==null||h.call(d,f,this),(v=(g=S(this,Ct).config).onSettled)==null||v.call(g,this.state.data,f,this)),this.scheduleGc()};return j(this,$e,i0({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var d,h,g,v;if(f===void 0){s(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(w){s(w);return}(h=(d=S(this,Ct).config).onSuccess)==null||h.call(d,f,this),(v=(g=S(this,Ct).config).onSettled)==null||v.call(g,f,this.state.error,this),this.scheduleGc()},onError:s,onFail:(f,d)=>{X(this,zt,fn).call(this,{type:"failed",failureCount:f,error:d})},onPause:()=>{X(this,zt,fn).call(this,{type:"pause"})},onContinue:()=>{X(this,zt,fn).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),S(this,$e).start()}},ki=new WeakMap,Ei=new WeakMap,Ct=new WeakMap,Pr=new WeakMap,$e=new WeakMap,Jl=new WeakMap,_r=new WeakMap,zt=new WeakSet,fn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...o0(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return da(i)&&i.revert&&S(this,Ei)?{...S(this,Ei),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Oe.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),S(this,Ct).notify({query:this,type:"updated",action:t})})},gm);function o0(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:n0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function zT(e){const 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 Yt,vm,MT=(vm=class extends qi{constructor(t={}){super();Q(this,Yt);this.config=t,j(this,Yt,new Map)}build(t,n,r){const i=n.queryKey,l=n.queryHash??dd(i,n);let o=this.get(l);return o||(o=new FT({client:t,queryKey:i,queryHash:l,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){S(this,Yt).has(t.queryHash)||(S(this,Yt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=S(this,Yt).get(t.queryHash);n&&(t.destroy(),n===t&&S(this,Yt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Oe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return S(this,Yt).get(t)}getAll(){return[...S(this,Yt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Qp(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Qp(t,r)):n}notify(t){Oe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Oe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Oe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Yt=new WeakMap,vm),Zt,Ke,Tr,en,An,wm,jT=(wm=class extends l0{constructor(t){super();Q(this,en);Q(this,Zt);Q(this,Ke);Q(this,Tr);this.mutationId=t.mutationId,j(this,Ke,t.mutationCache),j(this,Zt,[]),this.state=t.state||s0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){S(this,Zt).includes(t)||(S(this,Zt).push(t),this.clearGcTimeout(),S(this,Ke).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){j(this,Zt,S(this,Zt).filter(n=>n!==t)),this.scheduleGc(),S(this,Ke).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){S(this,Zt).length||(this.state.status==="pending"?this.scheduleGc():S(this,Ke).remove(this))}continue(){var t;return((t=S(this,Tr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,l,o,s,u,a,c,f,d,h,g,v,w,p,m,y,C,P,E,T;j(this,Tr,i0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(R,L)=>{X(this,en,An).call(this,{type:"failed",failureCount:R,error:L})},onPause:()=>{X(this,en,An).call(this,{type:"pause"})},onContinue:()=>{X(this,en,An).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,Ke).canRun(this)}));const n=this.state.status==="pending",r=!S(this,Tr).canStart();try{if(!n){X(this,en,An).call(this,{type:"pending",variables:t,isPaused:r}),await((l=(i=S(this,Ke).config).onMutate)==null?void 0:l.call(i,t,this));const L=await((s=(o=this.options).onMutate)==null?void 0:s.call(o,t));L!==this.state.context&&X(this,en,An).call(this,{type:"pending",context:L,variables:t,isPaused:r})}const R=await S(this,Tr).start();return await((a=(u=S(this,Ke).config).onSuccess)==null?void 0:a.call(u,R,t,this.state.context,this)),await((f=(c=this.options).onSuccess)==null?void 0:f.call(c,R,t,this.state.context)),await((h=(d=S(this,Ke).config).onSettled)==null?void 0:h.call(d,R,null,this.state.variables,this.state.context,this)),await((v=(g=this.options).onSettled)==null?void 0:v.call(g,R,null,t,this.state.context)),X(this,en,An).call(this,{type:"success",data:R}),R}catch(R){try{throw await((p=(w=S(this,Ke).config).onError)==null?void 0:p.call(w,R,t,this.state.context,this)),await((y=(m=this.options).onError)==null?void 0:y.call(m,R,t,this.state.context)),await((P=(C=S(this,Ke).config).onSettled)==null?void 0:P.call(C,void 0,R,this.state.variables,this.state.context,this)),await((T=(E=this.options).onSettled)==null?void 0:T.call(E,void 0,R,t,this.state.context)),R}finally{X(this,en,An).call(this,{type:"error",error:R})}}finally{S(this,Ke).runNext(this)}}},Zt=new WeakMap,Ke=new WeakMap,Tr=new WeakMap,en=new WeakSet,An=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Oe.batch(()=>{S(this,Zt).forEach(r=>{r.onMutationUpdate(t)}),S(this,Ke).notify({mutation:this,type:"updated",action:t})})},wm);function s0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pn,Mt,Yl,xm,UT=(xm=class extends qi{constructor(t={}){super();Q(this,pn);Q(this,Mt);Q(this,Yl);this.config=t,j(this,pn,new Set),j(this,Mt,new Map),j(this,Yl,0)}build(t,n,r){const i=new jT({mutationCache:this,mutationId:++fo(this,Yl)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){S(this,pn).add(t);const n=Do(t);if(typeof n=="string"){const r=S(this,Mt).get(n);r?r.push(t):S(this,Mt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(S(this,pn).delete(t)){const n=Do(t);if(typeof n=="string"){const r=S(this,Mt).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&S(this,Mt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Do(t);if(typeof n=="string"){const r=S(this,Mt).get(n),i=r==null?void 0:r.find(l=>l.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Do(t);if(typeof n=="string"){const i=(r=S(this,Mt).get(n))==null?void 0:r.find(l=>l!==t&&l.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Oe.batch(()=>{S(this,pn).forEach(t=>{this.notify({type:"removed",mutation:t})}),S(this,pn).clear(),S(this,Mt).clear()})}getAll(){return Array.from(S(this,pn))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Wp(n,r))}findAll(t={}){return this.getAll().filter(n=>Wp(t,n))}notify(t){Oe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Oe.batch(()=>Promise.all(t.map(n=>n.continue().catch(Pt))))}},pn=new WeakMap,Mt=new WeakMap,Yl=new WeakMap,xm);function Do(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Gp(e){return{onFetch:(t,n)=>{var c,f,d,h,g;const r=t.options,i=(d=(f=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:f.fetchMore)==null?void 0:d.direction,l=((h=t.state.data)==null?void 0:h.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let s={pages:[],pageParams:[]},u=0;const a=async()=>{let v=!1;const w=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},p=t0(t.options,t.fetchOptions),m=async(y,C,P)=>{if(v)return Promise.reject();if(C==null&&y.pages.length)return Promise.resolve(y);const E={client:t.client,queryKey:t.queryKey,pageParam:C,direction:P?"backward":"forward",meta:t.options.meta};w(E);const T=await p(E),{maxPages:R}=t.options,L=P?NT:bT;return{pages:L(y.pages,T,R),pageParams:L(y.pageParams,C,R)}};if(i&&l.length){const y=i==="backward",C=y?BT:Xp,P={pages:l,pageParams:o},E=C(r,P);s=await m(P,E,y)}else{const y=e??l.length;do{const C=u===0?o[0]??r.initialPageParam:Xp(r,s);if(u>0&&C==null)break;s=await m(s,C),u++}while(u{var v,w;return(w=(v=t.options).persister)==null?void 0:w.call(v,a,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=a}}}function Xp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function BT(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ke,Un,Bn,Ci,Pi,$n,_i,Ti,Sm,$T=(Sm=class{constructor(e={}){Q(this,ke);Q(this,Un);Q(this,Bn);Q(this,Ci);Q(this,Pi);Q(this,$n);Q(this,_i);Q(this,Ti);j(this,ke,e.queryCache||new MT),j(this,Un,e.mutationCache||new UT),j(this,Bn,e.defaultOptions||{}),j(this,Ci,new Map),j(this,Pi,new Map),j(this,$n,0)}mount(){fo(this,$n)._++,S(this,$n)===1&&(j(this,_i,pd.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,ke).onFocus())})),j(this,Ti,zs.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,ke).onOnline())})))}unmount(){var e,t;fo(this,$n)._--,S(this,$n)===0&&((e=S(this,_i))==null||e.call(this),j(this,_i,void 0),(t=S(this,Ti))==null||t.call(this),j(this,Ti,void 0))}isFetching(e){return S(this,ke).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return S(this,Un).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,ke).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=S(this,ke).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(vi(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return S(this,ke).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=S(this,ke).get(r.queryHash),l=i==null?void 0:i.state.data,o=RT(t,l);if(o!==void 0)return S(this,ke).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Oe.batch(()=>S(this,ke).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,ke).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=S(this,ke);Oe.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=S(this,ke);return Oe.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Oe.batch(()=>S(this,ke).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Pt).catch(Pt)}invalidateQueries(e,t={}){return Oe.batch(()=>(S(this,ke).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Oe.batch(()=>S(this,ke).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let l=i.fetch(void 0,n);return n.throwOnError||(l=l.catch(Pt)),i.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(r).then(Pt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=S(this,ke).build(this,t);return n.isStaleByTime(vi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Pt).catch(Pt)}fetchInfiniteQuery(e){return e.behavior=Gp(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pt).catch(Pt)}ensureInfiniteQueryData(e){return e.behavior=Gp(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return zs.isOnline()?S(this,Un).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,ke)}getMutationCache(){return S(this,Un)}getDefaultOptions(){return S(this,Bn)}setDefaultOptions(e){j(this,Bn,e)}setQueryDefaults(e,t){S(this,Ci).set(Hr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...S(this,Ci).values()],n={};return t.forEach(r=>{Gl(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){S(this,Pi).set(Hr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...S(this,Pi).values()],n={};return t.forEach(r=>{Gl(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...S(this,Bn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=dd(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===hd&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...S(this,Bn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){S(this,ke).clear(),S(this,Un).clear()}},ke=new WeakMap,Un=new WeakMap,Bn=new WeakMap,Ci=new WeakMap,Pi=new WeakMap,$n=new WeakMap,_i=new WeakMap,Ti=new WeakMap,Sm),tt,te,Zl,Ge,Rr,Ri,Hn,tn,eo,Oi,bi,Or,br,Vn,Ni,se,pl,Ac,Lc,Dc,Fc,zc,Mc,jc,u0,km,HT=(km=class extends qi{constructor(t,n){super();Q(this,se);Q(this,tt);Q(this,te);Q(this,Zl);Q(this,Ge);Q(this,Rr);Q(this,Ri);Q(this,Hn);Q(this,tn);Q(this,eo);Q(this,Oi);Q(this,bi);Q(this,Or);Q(this,br);Q(this,Vn);Q(this,Ni,new Set);this.options=n,j(this,tt,t),j(this,tn,null),j(this,Hn,Ic()),this.options.experimental_prefetchInRender||S(this,Hn).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(S(this,te).addObserver(this),Jp(S(this,te),this.options)?X(this,se,pl).call(this):this.updateResult(),X(this,se,Fc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Uc(S(this,te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Uc(S(this,te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,X(this,se,zc).call(this),X(this,se,Mc).call(this),S(this,te).removeObserver(this)}setOptions(t,n){const r=this.options,i=S(this,te);if(this.options=S(this,tt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Bt(this.options.enabled,S(this,te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");X(this,se,jc).call(this),S(this,te).setOptions(this.options),r._defaulted&&!Fs(this.options,r)&&S(this,tt).getQueryCache().notify({type:"observerOptionsUpdated",query:S(this,te),observer:this});const l=this.hasListeners();l&&Yp(S(this,te),i,this.options,r)&&X(this,se,pl).call(this),this.updateResult(n),l&&(S(this,te)!==i||Bt(this.options.enabled,S(this,te))!==Bt(r.enabled,S(this,te))||vi(this.options.staleTime,S(this,te))!==vi(r.staleTime,S(this,te)))&&X(this,se,Ac).call(this);const o=X(this,se,Lc).call(this);l&&(S(this,te)!==i||Bt(this.options.enabled,S(this,te))!==Bt(r.enabled,S(this,te))||o!==S(this,Vn))&&X(this,se,Dc).call(this,o)}getOptimisticResult(t){const n=S(this,tt).getQueryCache().build(S(this,tt),t),r=this.createResult(n,t);return QT(this,r)&&(j(this,Ge,r),j(this,Ri,this.options),j(this,Rr,S(this,te).state)),r}getCurrentResult(){return S(this,Ge)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){S(this,Ni).add(t)}getCurrentQuery(){return S(this,te)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=S(this,tt).defaultQueryOptions(t),r=S(this,tt).getQueryCache().build(S(this,tt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return X(this,se,pl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),S(this,Ge)))}createResult(t,n){var R;const r=S(this,te),i=this.options,l=S(this,Ge),o=S(this,Rr),s=S(this,Ri),a=t!==r?t.state:S(this,Zl),{state:c}=t;let f={...c},d=!1,h;if(n._optimisticResults){const L=this.hasListeners(),z=!L&&Jp(t,n),M=L&&Yp(t,r,n,i);(z||M)&&(f={...f,...o0(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:g,errorUpdatedAt:v,status:w}=f;if(n.select&&f.data!==void 0)if(l&&f.data===(o==null?void 0:o.data)&&n.select===S(this,eo))h=S(this,Oi);else try{j(this,eo,n.select),h=n.select(f.data),h=Nc(l==null?void 0:l.data,h,n),j(this,Oi,h),j(this,tn,null)}catch(L){j(this,tn,L)}else h=f.data;if(n.placeholderData!==void 0&&h===void 0&&w==="pending"){let L;if(l!=null&&l.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData))L=l.data;else if(L=typeof n.placeholderData=="function"?n.placeholderData((R=S(this,bi))==null?void 0:R.state.data,S(this,bi)):n.placeholderData,n.select&&L!==void 0)try{L=n.select(L),j(this,tn,null)}catch(z){j(this,tn,z)}L!==void 0&&(w="success",h=Nc(l==null?void 0:l.data,L,n),d=!0)}S(this,tn)&&(g=S(this,tn),h=S(this,Oi),v=Date.now(),w="error");const p=f.fetchStatus==="fetching",m=w==="pending",y=w==="error",C=m&&p,P=h!==void 0,T={status:w,fetchStatus:f.fetchStatus,isPending:m,isSuccess:w==="success",isError:y,isInitialLoading:C,isLoading:C,data:h,dataUpdatedAt:f.dataUpdatedAt,error:g,errorUpdatedAt:v,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>a.dataUpdateCount||f.errorUpdateCount>a.errorUpdateCount,isFetching:p,isRefetching:p&&!m,isLoadingError:y&&!P,isPaused:f.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:y&&P,isStale:md(t,n),refetch:this.refetch,promise:S(this,Hn)};if(this.options.experimental_prefetchInRender){const L=$=>{T.status==="error"?$.reject(T.error):T.data!==void 0&&$.resolve(T.data)},z=()=>{const $=j(this,Hn,T.promise=Ic());L($)},M=S(this,Hn);switch(M.status){case"pending":t.queryHash===r.queryHash&&L(M);break;case"fulfilled":(T.status==="error"||T.data!==M.value)&&z();break;case"rejected":(T.status!=="error"||T.error!==M.reason)&&z();break}}return T}updateResult(t){const n=S(this,Ge),r=this.createResult(S(this,te),this.options);if(j(this,Rr,S(this,te).state),j(this,Ri,this.options),S(this,Rr).data!==void 0&&j(this,bi,S(this,te)),Fs(r,n))return;j(this,Ge,r);const i={},l=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!S(this,Ni).size)return!0;const u=new Set(s??S(this,Ni));return this.options.throwOnError&&u.add("error"),Object.keys(S(this,Ge)).some(a=>{const c=a;return S(this,Ge)[c]!==n[c]&&u.has(c)})};(t==null?void 0:t.listeners)!==!1&&l()&&(i.listeners=!0),X(this,se,u0).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&X(this,se,Fc).call(this)}},tt=new WeakMap,te=new WeakMap,Zl=new WeakMap,Ge=new WeakMap,Rr=new WeakMap,Ri=new WeakMap,Hn=new WeakMap,tn=new WeakMap,eo=new WeakMap,Oi=new WeakMap,bi=new WeakMap,Or=new WeakMap,br=new WeakMap,Vn=new WeakMap,Ni=new WeakMap,se=new WeakSet,pl=function(t){X(this,se,jc).call(this);let n=S(this,te).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Pt)),n},Ac=function(){X(this,se,zc).call(this);const t=vi(this.options.staleTime,S(this,te));if($r||S(this,Ge).isStale||!Oc(t))return;const r=Zv(S(this,Ge).dataUpdatedAt,t)+1;j(this,Or,setTimeout(()=>{S(this,Ge).isStale||this.updateResult()},r))},Lc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(S(this,te)):this.options.refetchInterval)??!1},Dc=function(t){X(this,se,Mc).call(this),j(this,Vn,t),!($r||Bt(this.options.enabled,S(this,te))===!1||!Oc(S(this,Vn))||S(this,Vn)===0)&&j(this,br,setInterval(()=>{(this.options.refetchIntervalInBackground||pd.isFocused())&&X(this,se,pl).call(this)},S(this,Vn)))},Fc=function(){X(this,se,Ac).call(this),X(this,se,Dc).call(this,X(this,se,Lc).call(this))},zc=function(){S(this,Or)&&(clearTimeout(S(this,Or)),j(this,Or,void 0))},Mc=function(){S(this,br)&&(clearInterval(S(this,br)),j(this,br,void 0))},jc=function(){const t=S(this,tt).getQueryCache().build(S(this,tt),this.options);if(t===S(this,te))return;const n=S(this,te);j(this,te,t),j(this,Zl,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},u0=function(t){Oe.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(S(this,Ge))}),S(this,tt).getQueryCache().notify({query:S(this,te),type:"observerResultsUpdated"})})},km);function VT(e,t){return Bt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Jp(e,t){return VT(e,t)||e.state.data!==void 0&&Uc(e,t,t.refetchOnMount)}function Uc(e,t,n){if(Bt(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&md(e,t)}return!1}function Yp(e,t,n,r){return(e!==t||Bt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&md(e,n)}function md(e,t){return Bt(t.enabled,e)!==!1&&e.isStaleByTime(vi(t.staleTime,e))}function QT(e,t){return!Fs(e.getCurrentResult(),t)}var Qn,Wn,nt,mn,Sn,Jo,Bc,Em,WT=(Em=class extends qi{constructor(n,r){super();Q(this,Sn);Q(this,Qn);Q(this,Wn);Q(this,nt);Q(this,mn);j(this,Qn,n),this.setOptions(r),this.bindMethods(),X(this,Sn,Jo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=S(this,Qn).defaultMutationOptions(n),Fs(this.options,r)||S(this,Qn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:S(this,nt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Hr(r.mutationKey)!==Hr(this.options.mutationKey)?this.reset():((i=S(this,nt))==null?void 0:i.state.status)==="pending"&&S(this,nt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=S(this,nt))==null||n.removeObserver(this)}onMutationUpdate(n){X(this,Sn,Jo).call(this),X(this,Sn,Bc).call(this,n)}getCurrentResult(){return S(this,Wn)}reset(){var n;(n=S(this,nt))==null||n.removeObserver(this),j(this,nt,void 0),X(this,Sn,Jo).call(this),X(this,Sn,Bc).call(this)}mutate(n,r){var i;return j(this,mn,r),(i=S(this,nt))==null||i.removeObserver(this),j(this,nt,S(this,Qn).getMutationCache().build(S(this,Qn),this.options)),S(this,nt).addObserver(this),S(this,nt).execute(n)}},Qn=new WeakMap,Wn=new WeakMap,nt=new WeakMap,mn=new WeakMap,Sn=new WeakSet,Jo=function(){var r;const n=((r=S(this,nt))==null?void 0:r.state)??s0();j(this,Wn,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Bc=function(n){Oe.batch(()=>{var r,i,l,o,s,u,a,c;if(S(this,mn)&&this.hasListeners()){const f=S(this,Wn).variables,d=S(this,Wn).context;(n==null?void 0:n.type)==="success"?((i=(r=S(this,mn)).onSuccess)==null||i.call(r,n.data,f,d),(o=(l=S(this,mn)).onSettled)==null||o.call(l,n.data,null,f,d)):(n==null?void 0:n.type)==="error"&&((u=(s=S(this,mn)).onError)==null||u.call(s,n.error,f,d),(c=(a=S(this,mn)).onSettled)==null||c.call(a,void 0,n.error,f,d))}this.listeners.forEach(f=>{f(S(this,Wn))})})},Em),a0=b.createContext(void 0),c0=e=>{const t=b.useContext(a0);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},qT=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),A.jsx(a0.Provider,{value:e,children:t})),f0=b.createContext(!1),KT=()=>b.useContext(f0);f0.Provider;function GT(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var XT=b.createContext(GT()),JT=()=>b.useContext(XT);function d0(e,t){return typeof e=="function"?e(...t):!!e}function $c(){}var YT=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},ZT=e=>{b.useEffect(()=>{e.clearReset()},[e])},eR=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||d0(n,[e.error,r])),tR=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},nR=(e,t)=>e.isLoading&&e.isFetching&&!t,rR=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Zp=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function iR(e,t,n){var f,d,h,g,v;const r=c0(),i=KT(),l=JT(),o=r.defaultQueryOptions(e);(d=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||d.call(f,o),o._optimisticResults=i?"isRestoring":"optimistic",tR(o),YT(o,l),ZT(l);const s=!r.getQueryCache().get(o.queryHash),[u]=b.useState(()=>new t(r,o)),a=u.getOptimisticResult(o),c=!i&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(w=>{const p=c?u.subscribe(Oe.batchCalls(w)):$c;return u.updateResult(),p},[u,c]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setOptions(o,{listeners:!1})},[o,u]),rR(o,a))throw Zp(o,u,l);if(eR({result:a,errorResetBoundary:l,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw a.error;if((g=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||g.call(h,o,a),o.experimental_prefetchInRender&&!$r&&nR(a,i)){const w=s?Zp(o,u,l):(v=r.getQueryCache().get(o.queryHash))==null?void 0:v.promise;w==null||w.catch($c).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?a:u.trackResult(a)}function lR(e,t){return iR(e,HT)}function oR(e,t){const n=c0(),[r]=b.useState(()=>new WT(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const i=b.useSyncExternalStore(b.useCallback(o=>r.subscribe(Oe.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=b.useCallback((o,s)=>{r.mutate(o,s).catch($c)},[r]);if(i.error&&d0(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:l,mutateAsync:i.mutate}}function h0(e,t){return function(){return e.apply(t,arguments)}}const{toString:sR}=Object.prototype,{getPrototypeOf:yd}=Object,pu=(e=>t=>{const n=sR.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Wt=e=>(e=e.toLowerCase(),t=>pu(t)===e),mu=e=>t=>typeof t===e,{isArray:Ki}=Array,Xl=mu("undefined");function uR(e){return e!==null&&!Xl(e)&&e.constructor!==null&&!Xl(e.constructor)&>(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const p0=Wt("ArrayBuffer");function aR(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&p0(e.buffer),t}const cR=mu("string"),gt=mu("function"),m0=mu("number"),yu=e=>e!==null&&typeof e=="object",fR=e=>e===!0||e===!1,Yo=e=>{if(pu(e)!=="object")return!1;const t=yd(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},dR=Wt("Date"),hR=Wt("File"),pR=Wt("Blob"),mR=Wt("FileList"),yR=e=>yu(e)&>(e.pipe),gR=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||gt(e.append)&&((t=pu(e))==="formdata"||t==="object"&>(e.toString)&&e.toString()==="[object FormData]"))},vR=Wt("URLSearchParams"),[wR,xR,SR,kR]=["ReadableStream","Request","Response","Headers"].map(Wt),ER=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ao(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Ki(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const kr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,g0=e=>!Xl(e)&&e!==kr;function Hc(){const{caseless:e}=g0(this)&&this||{},t={},n=(r,i)=>{const l=e&&y0(t,i)||i;Yo(t[l])&&Yo(r)?t[l]=Hc(t[l],r):Yo(r)?t[l]=Hc({},r):Ki(r)?t[l]=r.slice():t[l]=r};for(let r=0,i=arguments.length;r(ao(t,(i,l)=>{n&>(i)?e[l]=h0(i,n):e[l]=i},{allOwnKeys:r}),e),PR=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),_R=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},TR=(e,t,n,r)=>{let i,l,o;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),l=i.length;l-- >0;)o=i[l],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&yd(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},RR=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},OR=e=>{if(!e)return null;if(Ki(e))return e;let t=e.length;if(!m0(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},bR=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&yd(Uint8Array)),NR=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const l=i.value;t.call(e,l[0],l[1])}},IR=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},AR=Wt("HTMLFormElement"),LR=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),em=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),DR=Wt("RegExp"),v0=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ao(n,(i,l)=>{let o;(o=t(i,l,e))!==!1&&(r[l]=o||i)}),Object.defineProperties(e,r)},FR=e=>{v0(e,(t,n)=>{if(gt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(gt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},zR=(e,t)=>{const n={},r=i=>{i.forEach(l=>{n[l]=!0})};return Ki(e)?r(e):r(String(e).split(t)),n},MR=()=>{},jR=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function UR(e){return!!(e&>(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const BR=e=>{const t=new Array(10),n=(r,i)=>{if(yu(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const l=Ki(r)?[]:{};return ao(r,(o,s)=>{const u=n(o,i+1);!Xl(u)&&(l[s]=u)}),t[i]=void 0,l}}return r};return n(e,0)},$R=Wt("AsyncFunction"),HR=e=>e&&(yu(e)||gt(e))&>(e.then)&>(e.catch),w0=((e,t)=>e?setImmediate:t?((n,r)=>(kr.addEventListener("message",({source:i,data:l})=>{i===kr&&l===n&&r.length&&r.shift()()},!1),i=>{r.push(i),kr.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",gt(kr.postMessage)),VR=typeof queueMicrotask<"u"?queueMicrotask.bind(kr):typeof process<"u"&&process.nextTick||w0,_={isArray:Ki,isArrayBuffer:p0,isBuffer:uR,isFormData:gR,isArrayBufferView:aR,isString:cR,isNumber:m0,isBoolean:fR,isObject:yu,isPlainObject:Yo,isReadableStream:wR,isRequest:xR,isResponse:SR,isHeaders:kR,isUndefined:Xl,isDate:dR,isFile:hR,isBlob:pR,isRegExp:DR,isFunction:gt,isStream:yR,isURLSearchParams:vR,isTypedArray:bR,isFileList:mR,forEach:ao,merge:Hc,extend:CR,trim:ER,stripBOM:PR,inherits:_R,toFlatObject:TR,kindOf:pu,kindOfTest:Wt,endsWith:RR,toArray:OR,forEachEntry:NR,matchAll:IR,isHTMLForm:AR,hasOwnProperty:em,hasOwnProp:em,reduceDescriptors:v0,freezeMethods:FR,toObjectSet:zR,toCamelCase:LR,noop:MR,toFiniteNumber:jR,findKey:y0,global:kr,isContextDefined:g0,isSpecCompliantForm:UR,toJSONObject:BR,isAsyncFn:$R,isThenable:HR,setImmediate:w0,asap:VR};function G(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}_.inherits(G,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:_.toJSONObject(this.config),code:this.code,status:this.status}}});const x0=G.prototype,S0={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{S0[e]={value:e}});Object.defineProperties(G,S0);Object.defineProperty(x0,"isAxiosError",{value:!0});G.from=(e,t,n,r,i,l)=>{const o=Object.create(x0);return _.toFlatObject(e,o,function(u){return u!==Error.prototype},s=>s!=="isAxiosError"),G.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,l&&Object.assign(o,l),o};const QR=null;function Vc(e){return _.isPlainObject(e)||_.isArray(e)}function k0(e){return _.endsWith(e,"[]")?e.slice(0,-2):e}function tm(e,t,n){return e?e.concat(t).map(function(i,l){return i=k0(i),!n&&l?"["+i+"]":i}).join(n?".":""):t}function WR(e){return _.isArray(e)&&!e.some(Vc)}const qR=_.toFlatObject(_,{},null,function(t){return/^is[A-Z]/.test(t)});function gu(e,t,n){if(!_.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=_.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,w){return!_.isUndefined(w[v])});const r=n.metaTokens,i=n.visitor||c,l=n.dots,o=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&_.isSpecCompliantForm(t);if(!_.isFunction(i))throw new TypeError("visitor must be a function");function a(g){if(g===null)return"";if(_.isDate(g))return g.toISOString();if(!u&&_.isBlob(g))throw new G("Blob is not supported. Use a Buffer instead.");return _.isArrayBuffer(g)||_.isTypedArray(g)?u&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function c(g,v,w){let p=g;if(g&&!w&&typeof g=="object"){if(_.endsWith(v,"{}"))v=r?v:v.slice(0,-2),g=JSON.stringify(g);else if(_.isArray(g)&&WR(g)||(_.isFileList(g)||_.endsWith(v,"[]"))&&(p=_.toArray(g)))return v=k0(v),p.forEach(function(y,C){!(_.isUndefined(y)||y===null)&&t.append(o===!0?tm([v],C,l):o===null?v:v+"[]",a(y))}),!1}return Vc(g)?!0:(t.append(tm(w,v,l),a(g)),!1)}const f=[],d=Object.assign(qR,{defaultVisitor:c,convertValue:a,isVisitable:Vc});function h(g,v){if(!_.isUndefined(g)){if(f.indexOf(g)!==-1)throw Error("Circular reference detected in "+v.join("."));f.push(g),_.forEach(g,function(p,m){(!(_.isUndefined(p)||p===null)&&i.call(t,p,_.isString(m)?m.trim():m,v,d))===!0&&h(p,v?v.concat(m):[m])}),f.pop()}}if(!_.isObject(e))throw new TypeError("data must be an object");return h(e),t}function nm(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function gd(e,t){this._pairs=[],e&&gu(e,this,t)}const E0=gd.prototype;E0.append=function(t,n){this._pairs.push([t,n])};E0.toString=function(t){const n=t?function(r){return t.call(this,r,nm)}:nm;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function KR(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function C0(e,t,n){if(!t)return e;const r=n&&n.encode||KR;_.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let l;if(i?l=i(t,n):l=_.isURLSearchParams(t)?t.toString():new gd(t,n).toString(r),l){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class rm{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){_.forEach(this.handlers,function(r){r!==null&&t(r)})}}const P0={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},GR=typeof URLSearchParams<"u"?URLSearchParams:gd,XR=typeof FormData<"u"?FormData:null,JR=typeof Blob<"u"?Blob:null,YR={isBrowser:!0,classes:{URLSearchParams:GR,FormData:XR,Blob:JR},protocols:["http","https","file","blob","url","data"]},vd=typeof window<"u"&&typeof document<"u",Qc=typeof navigator=="object"&&navigator||void 0,ZR=vd&&(!Qc||["ReactNative","NativeScript","NS"].indexOf(Qc.product)<0),eO=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",tO=vd&&window.location.href||"http://localhost",nO=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:vd,hasStandardBrowserEnv:ZR,hasStandardBrowserWebWorkerEnv:eO,navigator:Qc,origin:tO},Symbol.toStringTag,{value:"Module"})),Ve={...nO,...YR};function rO(e,t){return gu(e,new Ve.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,l){return Ve.isNode&&_.isBuffer(n)?(this.append(r,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)}},t))}function iO(e){return _.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function lO(e){const t={},n=Object.keys(e);let r;const i=n.length;let l;for(r=0;r=n.length;return o=!o&&_.isArray(i)?i.length:o,u?(_.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!s):((!i[o]||!_.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],l)&&_.isArray(i[o])&&(i[o]=lO(i[o])),!s)}if(_.isFormData(e)&&_.isFunction(e.entries)){const n={};return _.forEachEntry(e,(r,i)=>{t(iO(r),i,n,0)}),n}return null}function oO(e,t,n){if(_.isString(e))try{return(t||JSON.parse)(e),_.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const co={transitional:P0,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,l=_.isObject(t);if(l&&_.isHTMLForm(t)&&(t=new FormData(t)),_.isFormData(t))return i?JSON.stringify(_0(t)):t;if(_.isArrayBuffer(t)||_.isBuffer(t)||_.isStream(t)||_.isFile(t)||_.isBlob(t)||_.isReadableStream(t))return t;if(_.isArrayBufferView(t))return t.buffer;if(_.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(l){if(r.indexOf("application/x-www-form-urlencoded")>-1)return rO(t,this.formSerializer).toString();if((s=_.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return gu(s?{"files[]":t}:t,u&&new u,this.formSerializer)}}return l||i?(n.setContentType("application/json",!1),oO(t)):t}],transformResponse:[function(t){const n=this.transitional||co.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(_.isResponse(t)||_.isReadableStream(t))return t;if(t&&_.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(s){if(o)throw s.name==="SyntaxError"?G.from(s,G.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ve.classes.FormData,Blob:Ve.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_.forEach(["delete","get","head","post","put","patch"],e=>{co.headers[e]={}});const sO=_.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),uO=e=>{const t={};let n,r,i;return e&&e.split(` `).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&sO[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},im=Symbol("internals");function ul(e){return e&&String(e).trim().toLowerCase()}function Zo(e){return e===!1||e==null?e:_.isArray(e)?e.map(Zo):String(e)}function aO(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const cO=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ha(e,t,n,r,i){if(_.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!_.isString(t)){if(_.isString(r))return t.indexOf(r)!==-1;if(_.isRegExp(r))return r.test(t)}}function fO(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function dO(e,t){const n=_.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,l,o){return this[r].call(this,t,i,l,o)},configurable:!0})})}let at=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function l(s,u,a){const c=ul(u);if(!c)throw new Error("header name must be a non-empty string");const f=_.findKey(i,c);(!f||i[f]===void 0||a===!0||a===void 0&&i[f]!==!1)&&(i[f||u]=Zo(s))}const o=(s,u)=>_.forEach(s,(a,c)=>l(a,c,u));if(_.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(_.isString(t)&&(t=t.trim())&&!cO(t))o(uO(t),n);else if(_.isHeaders(t))for(const[s,u]of t.entries())l(u,s,r);else t!=null&&l(n,t,r);return this}get(t,n){if(t=ul(t),t){const r=_.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return aO(i);if(_.isFunction(n))return n.call(this,i,r);if(_.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ul(t),t){const r=_.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ha(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function l(o){if(o=ul(o),o){const s=_.findKey(r,o);s&&(!n||ha(r,r[s],s,n))&&(delete r[s],i=!0)}}return _.isArray(t)?t.forEach(l):l(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const l=n[r];(!t||ha(this,this[l],l,t,!0))&&(delete this[l],i=!0)}return i}normalize(t){const n=this,r={};return _.forEach(this,(i,l)=>{const o=_.findKey(r,l);if(o){n[o]=Zo(i),delete n[l];return}const s=t?fO(l):String(l).trim();s!==l&&delete n[l],n[s]=Zo(i),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return _.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&_.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[im]=this[im]={accessors:{}}).accessors,i=this.prototype;function l(o){const s=ul(o);r[s]||(dO(i,o),r[s]=!0)}return _.isArray(t)?t.forEach(l):l(t),this}};at.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);_.reduceDescriptors(at.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});_.freezeMethods(at);function pa(e,t){const n=this||co,r=t||n,i=at.from(r.headers);let l=r.data;return _.forEach(e,function(s){l=s.call(n,l,i.normalize(),t?t.status:void 0)}),i.normalize(),l}function T0(e){return!!(e&&e.__CANCEL__)}function Gi(e,t,n){G.call(this,e??"canceled",G.ERR_CANCELED,t,n),this.name="CanceledError"}_.inherits(Gi,G,{__CANCEL__:!0});function R0(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new G("Request failed with status code "+n.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function hO(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function pO(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,l=0,o;return t=t!==void 0?t:1e3,function(u){const a=Date.now(),c=r[l];o||(o=a),n[i]=u,r[i]=a;let f=l,d=0;for(;f!==i;)d+=n[f++],f=f%e;if(i=(i+1)%e,i===l&&(l=(l+1)%e),a-o{n=c,i=null,l&&(clearTimeout(l),l=null),e.apply(null,a)};return[(...a)=>{const c=Date.now(),f=c-n;f>=r?o(a,c):(i=a,l||(l=setTimeout(()=>{l=null,o(i)},r-f)))},()=>i&&o(i)]}const Ms=(e,t,n=3)=>{let r=0;const i=pO(50,250);return mO(l=>{const o=l.loaded,s=l.lengthComputable?l.total:void 0,u=o-r,a=i(u),c=o<=s;r=o;const f={loaded:o,total:s,progress:s?o/s:void 0,bytes:u,rate:a||void 0,estimated:a&&s&&c?(s-o)/a:void 0,event:l,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(f)},n)},lm=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},om=e=>(...t)=>_.asap(()=>e(...t)),yO=Ve.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ve.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ve.origin),Ve.navigator&&/(msie|trident)/i.test(Ve.navigator.userAgent)):()=>!0,gO=Ve.hasStandardBrowserEnv?{write(e,t,n,r,i,l){const o=[e+"="+encodeURIComponent(t)];_.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),_.isString(r)&&o.push("path="+r),_.isString(i)&&o.push("domain="+i),l===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function vO(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function wO(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function O0(e,t,n){let r=!vO(t);return e&&(r||n==!1)?wO(e,t):t}const sm=e=>e instanceof at?{...e}:e;function Vr(e,t){t=t||{};const n={};function r(a,c,f,d){return _.isPlainObject(a)&&_.isPlainObject(c)?_.merge.call({caseless:d},a,c):_.isPlainObject(c)?_.merge({},c):_.isArray(c)?c.slice():c}function i(a,c,f,d){if(_.isUndefined(c)){if(!_.isUndefined(a))return r(void 0,a,f,d)}else return r(a,c,f,d)}function l(a,c){if(!_.isUndefined(c))return r(void 0,c)}function o(a,c){if(_.isUndefined(c)){if(!_.isUndefined(a))return r(void 0,a)}else return r(void 0,c)}function s(a,c,f){if(f in t)return r(a,c);if(f in e)return r(void 0,a)}const u={url:l,method:l,data:l,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(a,c,f)=>i(sm(a),sm(c),f,!0)};return _.forEach(Object.keys(Object.assign({},e,t)),function(c){const f=u[c]||i,d=f(e[c],t[c],c);_.isUndefined(d)&&f!==s||(n[c]=d)}),n}const b0=e=>{const t=Vr({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:l,headers:o,auth:s}=t;t.headers=o=at.from(o),t.url=C0(O0(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let u;if(_.isFormData(n)){if(Ve.hasStandardBrowserEnv||Ve.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((u=o.getContentType())!==!1){const[a,...c]=u?u.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([a||"multipart/form-data",...c].join("; "))}}if(Ve.hasStandardBrowserEnv&&(r&&_.isFunction(r)&&(r=r(t)),r||r!==!1&&yO(t.url))){const a=i&&l&&gO.read(l);a&&o.set(i,a)}return t},xO=typeof XMLHttpRequest<"u",SO=xO&&function(e){return new Promise(function(n,r){const i=b0(e);let l=i.data;const o=at.from(i.headers).normalize();let{responseType:s,onUploadProgress:u,onDownloadProgress:a}=i,c,f,d,h,g;function v(){h&&h(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let w=new XMLHttpRequest;w.open(i.method.toUpperCase(),i.url,!0),w.timeout=i.timeout;function p(){if(!w)return;const y=at.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),P={data:!s||s==="text"||s==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:y,config:e,request:w};R0(function(T){n(T),v()},function(T){r(T),v()},P),w=null}"onloadend"in w?w.onloadend=p:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(p)},w.onabort=function(){w&&(r(new G("Request aborted",G.ECONNABORTED,e,w)),w=null)},w.onerror=function(){r(new G("Network Error",G.ERR_NETWORK,e,w)),w=null},w.ontimeout=function(){let C=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const P=i.transitional||P0;i.timeoutErrorMessage&&(C=i.timeoutErrorMessage),r(new G(C,P.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,e,w)),w=null},l===void 0&&o.setContentType(null),"setRequestHeader"in w&&_.forEach(o.toJSON(),function(C,P){w.setRequestHeader(P,C)}),_.isUndefined(i.withCredentials)||(w.withCredentials=!!i.withCredentials),s&&s!=="json"&&(w.responseType=i.responseType),a&&([d,g]=Ms(a,!0),w.addEventListener("progress",d)),u&&w.upload&&([f,h]=Ms(u),w.upload.addEventListener("progress",f),w.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(c=y=>{w&&(r(!y||y.type?new Gi(null,e,w):y),w.abort(),w=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const m=hO(i.url);if(m&&Ve.protocols.indexOf(m)===-1){r(new G("Unsupported protocol "+m+":",G.ERR_BAD_REQUEST,e));return}w.send(l||null)})},kO=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const l=function(a){if(!i){i=!0,s();const c=a instanceof Error?a:this.reason;r.abort(c instanceof G?c:new Gi(c instanceof Error?c.message:c))}};let o=t&&setTimeout(()=>{o=null,l(new G(`timeout ${t} of ms exceeded`,G.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(a=>{a.unsubscribe?a.unsubscribe(l):a.removeEventListener("abort",l)}),e=null)};e.forEach(a=>a.addEventListener("abort",l));const{signal:u}=r;return u.unsubscribe=()=>_.asap(s),u}},EO=function*(e,t){let n=e.byteLength;if(n{const i=CO(e,t);let l=0,o,s=u=>{o||(o=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:a,value:c}=await i.next();if(a){s(),u.close();return}let f=c.byteLength;if(n){let d=l+=f;n(d)}u.enqueue(new Uint8Array(c))}catch(a){throw s(a),a}},cancel(u){return s(u),i.return()}},{highWaterMark:2})},vu=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",N0=vu&&typeof ReadableStream=="function",_O=vu&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),I0=(e,...t)=>{try{return!!e(...t)}catch{return!1}},TO=N0&&I0(()=>{let e=!1;const t=new Request(Ve.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),am=64*1024,Wc=N0&&I0(()=>_.isReadableStream(new Response("").body)),js={stream:Wc&&(e=>e.body)};vu&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!js[t]&&(js[t]=_.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new G(`Response type '${t}' is not supported`,G.ERR_NOT_SUPPORT,r)})})})(new Response);const RO=async e=>{if(e==null)return 0;if(_.isBlob(e))return e.size;if(_.isSpecCompliantForm(e))return(await new Request(Ve.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(_.isArrayBufferView(e)||_.isArrayBuffer(e))return e.byteLength;if(_.isURLSearchParams(e)&&(e=e+""),_.isString(e))return(await _O(e)).byteLength},OO=async(e,t)=>{const n=_.toFiniteNumber(e.getContentLength());return n??RO(t)},bO=vu&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:l,timeout:o,onDownloadProgress:s,onUploadProgress:u,responseType:a,headers:c,withCredentials:f="same-origin",fetchOptions:d}=b0(e);a=a?(a+"").toLowerCase():"text";let h=kO([i,l&&l.toAbortSignal()],o),g;const v=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let w;try{if(u&&TO&&n!=="get"&&n!=="head"&&(w=await OO(c,r))!==0){let P=new Request(t,{method:"POST",body:r,duplex:"half"}),E;if(_.isFormData(r)&&(E=P.headers.get("content-type"))&&c.setContentType(E),P.body){const[T,R]=lm(w,Ms(om(u)));r=um(P.body,am,T,R)}}_.isString(f)||(f=f?"include":"omit");const p="credentials"in Request.prototype;g=new Request(t,{...d,signal:h,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:p?f:void 0});let m=await fetch(g);const y=Wc&&(a==="stream"||a==="response");if(Wc&&(s||y&&v)){const P={};["status","statusText","headers"].forEach(L=>{P[L]=m[L]});const E=_.toFiniteNumber(m.headers.get("content-length")),[T,R]=s&&lm(E,Ms(om(s),!0))||[];m=new Response(um(m.body,am,T,()=>{R&&R(),v&&v()}),P)}a=a||"text";let C=await js[_.findKey(js,a)||"text"](m,e);return!y&&v&&v(),await new Promise((P,E)=>{R0(P,E,{data:C,headers:at.from(m.headers),status:m.status,statusText:m.statusText,config:e,request:g})})}catch(p){throw v&&v(),p&&p.name==="TypeError"&&/fetch/i.test(p.message)?Object.assign(new G("Network Error",G.ERR_NETWORK,e,g),{cause:p.cause||p}):G.from(p,p&&p.code,e,g)}}),qc={http:QR,xhr:SO,fetch:bO};_.forEach(qc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const cm=e=>`- ${e}`,NO=e=>_.isFunction(e)||e===null||e===!1,A0={getAdapter:e=>{e=_.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let l=0;l`adapter ${s} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=t?l.length>1?`since : `+l.map(cm).join(` `):" "+cm(l[0]):"as no adapter specified";throw new G("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:qc};function ma(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Gi(null,e)}function fm(e){return ma(e),e.headers=at.from(e.headers),e.data=pa.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),A0.getAdapter(e.adapter||co.adapter)(e).then(function(r){return ma(e),r.data=pa.call(e,e.transformResponse,r),r.headers=at.from(r.headers),r},function(r){return T0(r)||(ma(e),r&&r.response&&(r.response.data=pa.call(e,e.transformResponse,r.response),r.response.headers=at.from(r.response.headers))),Promise.reject(r)})}const L0="1.8.4",wu={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{wu[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const dm={};wu.transitional=function(t,n,r){function i(l,o){return"[Axios v"+L0+"] Transitional option '"+l+"'"+o+(r?". "+r:"")}return(l,o,s)=>{if(t===!1)throw new G(i(o," has been removed"+(n?" in "+n:"")),G.ERR_DEPRECATED);return n&&!dm[o]&&(dm[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(l,o,s):!0}};wu.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function IO(e,t,n){if(typeof e!="object")throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const l=r[i],o=t[l];if(o){const s=e[l],u=s===void 0||o(s,l,e);if(u!==!0)throw new G("option "+l+" must be "+u,G.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new G("Unknown option "+l,G.ERR_BAD_OPTION)}}const es={assertOptions:IO,validators:wu},Gt=es.validators;let Lr=class{constructor(t){this.defaults=t,this.interceptors={request:new rm,response:new rm}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const l=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?l&&!String(r.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+l):r.stack=l}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Vr(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:l}=n;r!==void 0&&es.assertOptions(r,{silentJSONParsing:Gt.transitional(Gt.boolean),forcedJSONParsing:Gt.transitional(Gt.boolean),clarifyTimeoutError:Gt.transitional(Gt.boolean)},!1),i!=null&&(_.isFunction(i)?n.paramsSerializer={serialize:i}:es.assertOptions(i,{encode:Gt.function,serialize:Gt.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),es.assertOptions(n,{baseUrl:Gt.spelling("baseURL"),withXsrfToken:Gt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=l&&_.merge(l.common,l[n.method]);l&&_.forEach(["delete","get","head","post","put","patch","common"],g=>{delete l[g]}),n.headers=at.concat(o,l);const s=[];let u=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(u=u&&v.synchronous,s.unshift(v.fulfilled,v.rejected))});const a=[];this.interceptors.response.forEach(function(v){a.push(v.fulfilled,v.rejected)});let c,f=0,d;if(!u){const g=[fm.bind(this),void 0];for(g.unshift.apply(g,s),g.push.apply(g,a),d=g.length,c=Promise.resolve(n);f{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](i);r._listeners=null}),this.promise.then=i=>{let l;const o=new Promise(s=>{r.subscribe(s),l=s}).then(i);return o.cancel=function(){r.unsubscribe(l)},o},t(function(l,o,s){r.reason||(r.reason=new Gi(l,o,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new D0(function(i){t=i}),cancel:t}}};function LO(e){return function(n){return e.apply(null,n)}}function DO(e){return _.isObject(e)&&e.isAxiosError===!0}const Kc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Kc).forEach(([e,t])=>{Kc[t]=e});function F0(e){const t=new Lr(e),n=h0(Lr.prototype.request,t);return _.extend(n,Lr.prototype,t,{allOwnKeys:!0}),_.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return F0(Vr(e,i))},n}const Se=F0(co);Se.Axios=Lr;Se.CanceledError=Gi;Se.CancelToken=AO;Se.isCancel=T0;Se.VERSION=L0;Se.toFormData=gu;Se.AxiosError=G;Se.Cancel=Se.CanceledError;Se.all=function(t){return Promise.all(t)};Se.spread=LO;Se.isAxiosError=DO;Se.mergeConfig=Vr;Se.AxiosHeaders=at;Se.formToJSON=e=>_0(_.isHTMLForm(e)?new FormData(e):e);Se.getAdapter=A0.getAdapter;Se.HttpStatusCode=Kc;Se.default=Se;const{Axios:ob,AxiosError:sb,CanceledError:ub,isCancel:ab,CancelToken:cb,VERSION:fb,all:db,Cancel:hb,isAxiosError:pb,spread:mb,toFormData:yb,AxiosHeaders:gb,HttpStatusCode:vb,formToJSON:wb,getAdapter:xb,mergeConfig:Sb}=Se,z0="https://muryshev-generic-chatbot-backend.hf.space",wd=Se.create({baseURL:`${z0}`,timeout:6e5}),FO=e=>{const t=localStorage.getItem("authToken");return t&&(e.headers.Authorization=`Bearer ${t}`),e},zO=e=>e,MO=async e=>{var n;const t=e.message;return t.includes("409")&&(console.log("409"),U0.invalidateQueries({queryKey:["processing"]})),((n=e.response)==null?void 0:n.status)===401?(localStorage.removeItem("authToken"),window.location.href="/login"):!Se.isCancel(e)&&!t.includes("409")&&alert(`${t} Произошла ошибка`),Promise.reject(e)};wd.interceptors.request.use(FO);wd.interceptors.response.use(zO,MO);const M0=async({url:e,signal:t,...n},r=z0)=>{var o,s,u;const i=new AbortController,l=t||i.signal;try{console.log("Попытка отправки запроса");const a=await wd({url:`${r}${e}`,signal:l,...n});return console.log("Запрос отправлен, результат:",a),{data:a.data,headers:a.headers}}catch(a){if(Se.isCancel(a))return console.log("Запрос отменен"),{error:{status:"Cancelled",data:"Request was cancelled",notCauseError:!0}};const c=a;return console.log("Ошибка при отправке запроса"),{error:{status:(o=c.response)==null?void 0:o.status,data:(s=c.response)==null?void 0:s.data,headers:(u=c.response)==null?void 0:u.headers}}}finally{t||i.abort()}},jO=async e=>{const t=await M0({url:"/auth/login",method:"post",data:e});if("error"in t)throw new Error(`Ошибка авторизации: ${t.error.status}`);return t.data},UO=async()=>{const e=localStorage.getItem("authToken");return"current_user"in(await M0({url:"/auth/checktoken",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},method:"post"})).data},j0=b.createContext(void 0),BO=({children:e})=>{const[t,n]=b.useState(()=>!!localStorage.getItem("authToken")),r=oR({mutationFn:o=>jO(o),onSuccess:o=>{localStorage.setItem("authToken",o.access_token),n(!0)},onError:o=>{console.error("Login Error:",o)}}),i=async o=>{await r.mutateAsync(o)},l=()=>{localStorage.removeItem("authToken"),n(!1)};return A.jsx(j0.Provider,{value:{isAuthenticated:t,login:i,logout:l,isLoading:r.isPending,error:r.error},children:e})},xu=()=>{const e=b.useContext(j0);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},$O=()=>{const{logout:e}=xu();return A.jsx("button",{className:"logout-button",onClick:e,children:"Выйти"})},HO=({isVisible:e,toggleSidebar:t,sidebarRef:n})=>{const r=Yg(),i=_s(w=>w.chat.chats),l=_s(w=>w.chat.activeChatId),[o,s]=b.useState(null),[u,a]=b.useState(""),[c,f]=b.useState(!1),d=w=>{var p;o===w&&u.trim()?(r(mT({chatId:w,newName:u})),s(null),a("")):(s(w),a(((p=i.find(m=>m.id===w))==null?void 0:p.name)||""))},h=w=>{r($p(w))},g=()=>{f(!0)},v=()=>{i.forEach(w=>r($p(w.id))),f(!1)};return A.jsxs("div",{ref:n,className:`chat-sidebar ${e?"visible":""}`,children:[A.jsx("div",{className:"sidebar-header",children:A.jsx("h3",{children:"Чаты"})}),A.jsx("ul",{children:i.map(w=>A.jsxs("li",{className:w.id===l?"active":"",onClick:()=>r(Xv(w.id)),children:[o===w.id?A.jsx("input",{value:u,onChange:p=>a(p.target.value),onBlur:()=>d(w.id),onKeyDown:p=>p.key==="Enter"&&d(w.id),autoFocus:!0,className:"chat-input"}):A.jsx("span",{className:"chat-name",title:w.name,children:w.name}),A.jsxs("div",{className:"chat-actions",children:[A.jsx("button",{className:"icon-button rename",onClick:p=>{p.stopPropagation(),d(w.id)},title:"Переименовать",children:A.jsx(PT,{})}),A.jsx("button",{className:"icon-button delete",onClick:p=>{p.stopPropagation(),h(w.id)},title:"Удалить",children:A.jsx(TT,{})})]})]},w.id))}),A.jsxs("div",{className:"sidebar-footer",children:[A.jsx("button",{onClick:g,className:"delete-all-button",children:"Удалить все чаты"}),c&&A.jsxs("div",{className:"confirm-dialog",children:[A.jsx("p",{children:"Вы уверены? Мы не сможем их восстановить."}),A.jsxs("div",{className:"buttons",children:[A.jsx("button",{onClick:v,children:"Да"}),A.jsx("button",{onClick:()=>f(!1),children:"Нет"})]})]}),A.jsx($O,{})]})]})};class VO{constructor(){this.dbName="ChatDB",this.storeName="chats",this.db=null}async initDB(){return this.db?this.db:new Promise((t,n)=>{const r=indexedDB.open(this.dbName,1);r.onupgradeneeded=()=>{r.result.createObjectStore(this.storeName,{keyPath:"id"})},r.onsuccess=()=>{this.db=r.result,t(this.db)},r.onerror=()=>n(r.error)})}async getChats(){const t=await this.initDB();return new Promise((n,r)=>{const o=t.transaction(this.storeName,"readonly").objectStore(this.storeName).getAll();o.onsuccess=()=>n(o.result),o.onerror=()=>r(o.error)})}async saveChat(t){const n=await this.initDB();return new Promise((r,i)=>{const s=n.transaction(this.storeName,"readwrite").objectStore(this.storeName).put(t);s.onsuccess=()=>r(),s.onerror=()=>i(s.error)})}async deleteChat(t){const n=await this.initDB();return new Promise((r,i)=>{const s=n.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete(t);s.onsuccess=()=>r(),s.onerror=()=>i(s.error)})}async renameChat(t,n){const i=(await this.getChats()).find(l=>l.id===t);i&&(i.name=n,await this.saveChat(i))}}const De=[];for(let e=0;e<256;++e)De.push((e+256).toString(16).slice(1));function QO(e,t=0){return(De[e[t+0]]+De[e[t+1]]+De[e[t+2]]+De[e[t+3]]+"-"+De[e[t+4]]+De[e[t+5]]+"-"+De[e[t+6]]+De[e[t+7]]+"-"+De[e[t+8]]+De[e[t+9]]+"-"+De[e[t+10]]+De[e[t+11]]+De[e[t+12]]+De[e[t+13]]+De[e[t+14]]+De[e[t+15]]).toLowerCase()}let ya;const WO=new Uint8Array(16);function qO(){if(!ya){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ya=crypto.getRandomValues.bind(crypto)}return ya(WO)}const KO=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),hm={randomUUID:KO};function GO(e,t,n){var i;if(hm.randomUUID&&!e)return hm.randomUUID();e=e||{};const r=e.random??((i=e.rng)==null?void 0:i.call(e))??qO();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,QO(r)}const Fo=new VO,XO=()=>{const[e,t]=b.useState(""),[n,r]=b.useState(null),[i,l]=b.useState(!1),[o,s]=b.useState(!1),[u,a]=b.useState(window.innerWidth>1800),[c,f]=b.useState(!1),d=_s(H=>H.chat.chats),h=_s(H=>H.chat.activeChatId),g=d.find(H=>H.id===h),v=(g==null?void 0:g.history)||[],w=Yg(),p=b.useRef(null),m=b.useRef(null),{logout:y,isAuthenticated:C}=xu(),P=Wf(),E=b.useRef(!1),T=b.useRef(null),R=()=>{console.log("Toggling sidebar, current state:",u),a(H=>!H)},L=H=>({id:GO(),name:H??"Чат 1",history:[]}),z=()=>{const H=L(`Чат ${d.length+1}`);w(Bp(H))},M=()=>{const H=document.querySelector(".messages");if(H){const U=H.getBoundingClientRect(),Y=window.innerHeight;return U.bottom<=Y+10}return!0},$=()=>{p.current&&(p.current.abort(),l(!1),s(!1),m.current=null,console.log("Generation stopped by user"))};b.useEffect(()=>{(async()=>{try{console.log("Loading chats from storage...");const U=await Fo.getChats(),Y=U.length>0?U:[L()];w(fT(Y)),f(!0),console.log("Chats loaded:",Y)}catch(U){console.error("Failed to load chats:",U),r("Не удалось загрузить чаты"),f(!0)}})()},[w]),b.useEffect(()=>{(async()=>{if(c)try{const Y=(await Fo.getChats()).filter(le=>!d.some(D=>D.id===le.id));for(const le of Y)await Fo.deleteChat(le.id),console.log("Deleted chat from storage:",le.id);for(const le of d)await Fo.saveChat(le)}catch(U){console.error("Failed to sync chats with storage:",U),r("Ошибка синхронизации чатов")}})()},[d,c]),b.useEffect(()=>{if(!C||!c||E.current){console.log("Waiting for initialization or already attempted resend...",{isAuthenticated:C,isChatsLoaded:c,hasAttemptedResend:E.current});return}const H=localStorage.getItem("pendingMessage");if(H)try{const{text:U,chatId:Y}=JSON.parse(H);console.log("Pending message found:",{text:U,chatId:Y}),d.some(le=>le.id===Y)?(console.log("Resending pending message to chat:",Y),w(Xv(Y)),ne(U),localStorage.removeItem("pendingMessage")):(console.log("Chat not found, discarding pending message"),localStorage.removeItem("pendingMessage"),r("Чат для отложенного сообщения не найден"))}catch(U){console.error("Failed to parse pending message:",U),localStorage.removeItem("pendingMessage"),r("Ошибка обработки отложенного сообщения")}finally{E.current=!0}else console.log("No pending message found"),E.current=!0},[C,c,d]),b.useEffect(()=>{if(n){const H=setTimeout(()=>r(null),5e3);return()=>clearTimeout(H)}},[n]);const ne=async H=>{var V;if(!H.trim()||i||!C)return;let U=h;if(!d.length){const x=L(`Чат ${d.length+1}`);w(Bp(x)),U=x.id}if(!U)return;t(""),l(!0),s(!1),console.log("Start request - isLoading:",i,"isGeneratingTokens:",o);const Y="https://muryshev-generic-chatbot-backend.hf.space/llm/chat/stream",le=localStorage.getItem("authToken"),D={role:"user",content:H,searchResults:"",searchEntities:[]};w(dT({chatId:U,message:D})),m.current=U;try{const x=new AbortController;p.current=x;const Z=setTimeout(()=>{x.abort(),r("Сервер временно недоступен")},6e4),re=await fetch(Y,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${le}`},body:JSON.stringify({history:[...v,D],chat_id:U}),signal:x.signal});if(clearTimeout(Z),!re.ok){if(re.status===401){console.log("Saving pending message:",H,"for chat:",U),localStorage.setItem("pendingMessage",JSON.stringify({text:H,chatId:U})),w(hT(U)),r("Сессия истекла. Пожалуйста, войдите заново."),y(),P("/login"),l(!1),m.current=null;return}throw new Error(`HTTP error! status: ${re.status}`)}const k=(V=re.body)==null?void 0:V.getReader();if(!k)throw new Error("Response body is not readable");const Ce=new TextDecoder;let qe="",ue="",ce=[...v,D];for(;;){const{done:qt,value:Rn}=await k.read();if(qt)break;qe+=Ce.decode(Rn,{stream:!0});const At=qe.split(` `);for(let On=0;Onbn===ce.length-1&&Et.role==="user"?{...Et,searchResults:Le.data.text,searchEntities:Le.data.ids}:Et),w(Lo({chatId:hr,history:ce})),console.log("After search_results - isLoading:",i,"isGeneratingTokens:",o);else if(Le.event==="reasoning")console.log("reasoning"),l(!0),ce=ce.map((Et,bn)=>bn===ce.length-1&&Et.role==="user"?{...Et,reasoning:Le.data.text}:Et),w(Lo({chatId:hr,history:ce}));else if(Le.event==="token"){o||(s(!0),console.log("Before first token - isLoading:",i,"isGeneratingTokens:",o)),ue+=Le.data;const Et=ce.findLastIndex(un=>un.role==="user"),bn=ce.findIndex((un,Kr)=>un.role==="assistant"&&Kr>Et);bn>=0?ce=ce.map((un,Kr)=>Kr===bn?{...un,content:ue}:un):ce=[...ce,{role:"assistant",content:ue,searchResults:"",searchEntities:[]}],w(Lo({chatId:hr,history:ce}))}}catch(Le){console.error("Failed to parse SSE data:",Le),r("Ошибка обработки данных от сервера"),l(!1)}}}qe=At[At.length-1];const fr=document.querySelector(".messages");if(fr&&m.current===U){const On=fr.querySelectorAll("div"),dr=On[On.length-1];dr&&M()&&setTimeout(()=>{dr.scrollIntoView({behavior:"smooth",block:"start"})},0)}}}catch(x){console.error("Stream error:",x),l(!1),s(!1),m.current=null,x instanceof DOMException&&x.name==="AbortError"&&!p.current?r("Сервер временно недоступен"):x instanceof DOMException&&x.name==="AbortError"||r("Произошла ошибка при запросе")}finally{p.current=null}};return b.useEffect(()=>{const H=U=>{U.ctrlKey&&U.shiftKey&&U.key==="F8"&&(U.preventDefault(),zv("expert_mode")==="true"?(P_("expert_mode"),console.log("Expert mode disabled")):(C_("expert_mode","true"),console.log("Expert mode enabled")))};return window.addEventListener("keydown",H),()=>{window.removeEventListener("keydown",H)}},[]),A.jsx("div",{className:"app-container",children:A.jsxs("div",{className:"chat-layout",children:[A.jsx(HO,{isVisible:u,toggleSidebar:R,sidebarRef:T}),A.jsxs("div",{className:"fixed-buttons",children:[A.jsx("button",{className:"sidebar-toggle-open",onClick:R,title:"Показать меню",children:A.jsx(CT,{})}),A.jsx("button",{className:"new-chat-button",onClick:z,title:"Новый чат",children:A.jsx(_T,{})})]}),A.jsxs("div",{className:`chat-content ${u?"sidebar-open":""}`,children:[n&&A.jsx("div",{className:"error-toast",children:n}),A.jsxs("div",{className:"messages",children:[v.map((H,U)=>A.jsx(bp,{role:H.role,content:H.content,searchResults:H.searchResults,reasoning:H.reasoning},U)),i&&!o&&m.current===h&&A.jsx(bp,{role:"assistant",content:"",isLoading:!0,searchResults:""},"loading")]}),A.jsxs("div",{className:`input-area ${u?"sidebar-open":""}`,children:[A.jsx(__,{onSend:ne,text:e,setText:t}),A.jsxs("div",{className:"buttons",children:[i?A.jsx("button",{className:"stop-button",onClick:$,children:"Остановить"}):A.jsx("button",{className:"send-button",onClick:()=>ne(e),children:"Отправить"}),A.jsx("a",{href:"#",className:"clear-link",onClick:H=>{H.preventDefault(),w(pT(h))},children:"Очистить"})]})]})]})]})})},JO=J_({reducer:{chat:yT}}),YO=()=>A.jsx(LS,{store:JO,children:A.jsx(XO,{})}),ZO=()=>{const[e,t]=b.useState(""),[n,r]=b.useState(""),{login:i,isLoading:l,error:o}=xu(),s=Wf(),u=async a=>{a.preventDefault();try{await i({username:e,password:n}),s("/",{replace:!0})}catch{}};return A.jsx("div",{className:"login-page",children:A.jsxs("form",{onSubmit:u,children:[A.jsxs("div",{children:[A.jsx("label",{children:"Логин:"}),A.jsx("input",{type:"text",value:e,onChange:a=>t(a.target.value)})]}),A.jsxs("div",{children:[A.jsx("label",{children:"Пароль:"}),A.jsx("input",{type:"password",value:n,onChange:a=>r(a.target.value)})]}),o&&A.jsx("p",{className:"error",children:"Неверный логин или пароль"}),A.jsx("button",{type:"submit",disabled:l,children:l?"Вход...":"Войти"})]})})},eb=!1,tb=({children:e,checkInterval:t=eb})=>{const{isAuthenticated:n,logout:r}=xu(),i=Wf(),{isLoading:l,data:o,error:s}=lR({queryKey:["tokenValid"],queryFn:UO,enabled:n,refetchInterval:t,refetchOnWindowFocus:!1});return b.useEffect(()=>{(s||!n||o===!1)&&(console.error("Token validation error:",s),r(),i("/login",{replace:!0}))},[n,o,s,r,i]),l?A.jsx("div",{children:"Loading..."}):s||!n||o===!1?null:A.jsx(A.Fragment,{children:e})},U0=new $T;ga.createRoot(document.getElementById("root")).render(A.jsx(vn.StrictMode,{children:A.jsx(qT,{client:U0,children:A.jsx(BO,{children:A.jsx(pS,{children:A.jsxs(fS,{children:[A.jsx(fc,{path:"/login",element:A.jsx(ZO,{})}),A.jsx(fc,{path:"/",element:A.jsx(tb,{children:A.jsx(YO,{})})})]})})})})}));