diff --git a/dist/assets/chatbot-bot-avatar-Bbf-v3Pj.png b/dist/assets/chatbot-bot-avatar-Bbf-v3Pj.png new file mode 100644 index 0000000..f658089 Binary files /dev/null and b/dist/assets/chatbot-bot-avatar-Bbf-v3Pj.png differ diff --git a/dist/assets/index-B28_Ysnv.js b/dist/assets/index-B28_Ysnv.js new file mode 100644 index 0000000..2804adc --- /dev/null +++ b/dist/assets/index-B28_Ysnv.js @@ -0,0 +1,398 @@ +function jv(e,n){for(var a=0;as[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const d of l.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function a(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(o){if(o.ep)return;o.ep=!0;const l=a(o);fetch(o.href,l)}})();function Og(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lu={exports:{}},bi={},Au={exports:{}},et={};/** + * @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 g0;function Cv(){if(g0)return et;g0=1;var e=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),h=Symbol.iterator;function b(T){return T===null||typeof T!="object"?null:(T=h&&T[h]||T["@@iterator"],typeof T=="function"?T:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,N={};function j(T,O,ne){this.props=T,this.context=O,this.refs=N,this.updater=ne||k}j.prototype.isReactComponent={},j.prototype.setState=function(T,O){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,O,"setState")},j.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function M(){}M.prototype=j.prototype;function P(T,O,ne){this.props=T,this.context=O,this.refs=N,this.updater=ne||k}var F=P.prototype=new M;F.constructor=P,C(F,j.prototype),F.isPureReactComponent=!0;var U=Array.isArray,W=Object.prototype.hasOwnProperty,J={current:null},A={key:!0,ref:!0,__self:!0,__source:!0};function w(T,O,ne){var ie,oe={},ae=null,ue=null;if(O!=null)for(ie in O.ref!==void 0&&(ue=O.ref),O.key!==void 0&&(ae=""+O.key),O)W.call(O,ie)&&!A.hasOwnProperty(ie)&&(oe[ie]=O[ie]);var xe=arguments.length-2;if(xe===1)oe.children=ne;else if(1>>1,O=D[T];if(0>>1;To(oe,q))aeo(ue,oe)?(D[T]=ue,D[ae]=q,T=ae):(D[T]=oe,D[ie]=q,T=ie);else if(aeo(ue,q))D[T]=ue,D[ae]=q,T=ae;else break e}}return X}function o(D,X){var q=D.sortIndex-X.sortIndex;return q!==0?q:D.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var m=[],g=[],y=1,h=null,b=3,k=!1,C=!1,N=!1,j=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function F(D){for(var X=a(g);X!==null;){if(X.callback===null)s(g);else if(X.startTime<=D)s(g),X.sortIndex=X.expirationTime,n(m,X);else break;X=a(g)}}function U(D){if(N=!1,F(D),!C)if(a(m)!==null)C=!0,G(W);else{var X=a(g);X!==null&&z(U,X.startTime-D)}}function W(D,X){C=!1,N&&(N=!1,M(w),w=-1),k=!0;var q=b;try{for(F(X),h=a(m);h!==null&&(!(h.expirationTime>X)||D&&!Y());){var T=h.callback;if(typeof T=="function"){h.callback=null,b=h.priorityLevel;var O=T(h.expirationTime<=X);X=e.unstable_now(),typeof O=="function"?h.callback=O:h===a(m)&&s(m),F(X)}else s(m);h=a(m)}if(h!==null)var ne=!0;else{var ie=a(g);ie!==null&&z(U,ie.startTime-X),ne=!1}return ne}finally{h=null,b=q,k=!1}}var J=!1,A=null,w=-1,R=5,E=-1;function Y(){return!(e.unstable_now()-ED||125T?(D.sortIndex=q,n(g,D),a(m)===null&&D===a(g)&&(N?(M(w),w=-1):N=!0,z(U,q-T))):(D.sortIndex=O,n(m,D),C||k||(C=!0,G(W))),D},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(D){var X=b;return function(){var q=b;b=X;try{return D.apply(this,arguments)}finally{b=q}}}})(zu)),zu}var w0;function Pv(){return w0||(w0=1,Bu.exports=Tv()),Bu.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 k0;function Rv(){if(k0)return Pn;k0=1;var e=Hl(),n=Pv();function a(t){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+t,i=1;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,g=/^[: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]*$/,y={},h={};function b(t){return m.call(h,t)?!0:m.call(y,t)?!1:g.test(t)?h[t]=!0:(y[t]=!0,!1)}function k(t,r,i,c){if(i!==null&&i.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return c?!1:i!==null?!i.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function C(t,r,i,c){if(r===null||typeof r>"u"||k(t,r,i,c))return!0;if(c)return!1;if(i!==null)switch(i.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function N(t,r,i,c,p,x,S){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=c,this.attributeNamespace=p,this.mustUseProperty=i,this.propertyName=t,this.type=r,this.sanitizeURL=x,this.removeEmptyString=S}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){j[t]=new N(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var r=t[0];j[r]=new N(r,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){j[t]=new N(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){j[t]=new N(t,2,!1,t,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(t){j[t]=new N(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){j[t]=new N(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){j[t]=new N(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){j[t]=new N(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){j[t]=new N(t,5,!1,t.toLowerCase(),null,!1,!1)});var M=/[\-:]([a-z])/g;function P(t){return t[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(t){var r=t.replace(M,P);j[r]=new N(r,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var r=t.replace(M,P);j[r]=new N(r,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var r=t.replace(M,P);j[r]=new N(r,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){j[t]=new N(t,1,!1,t.toLowerCase(),null,!1,!1)}),j.xlinkHref=new N("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){j[t]=new N(t,1,!1,t.toLowerCase(),null,!0,!0)});function F(t,r,i,c){var p=j.hasOwnProperty(r)?j[r]:null;(p!==null?p.type!==0:c||!(2_||p[S]!==x[_]){var B=` +`+p[S].replace(" at new "," at ");return t.displayName&&B.includes("")&&(B=B.replace("",t.displayName)),B}while(1<=S&&0<=_);break}}}finally{ne=!1,Error.prepareStackTrace=i}return(t=t?t.displayName||t.name:"")?O(t):""}function oe(t){switch(t.tag){case 5:return O(t.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return t=ie(t.type,!1),t;case 11:return t=ie(t.type.render,!1),t;case 1:return t=ie(t.type,!0),t;default:return""}}function ae(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case A:return"Fragment";case J:return"Portal";case R:return"Profiler";case w:return"StrictMode";case I:return"Suspense";case $:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Y:return(t.displayName||"Context")+".Consumer";case E:return(t._context.displayName||"Context")+".Provider";case K:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ee:return r=t.displayName||null,r!==null?r:ae(t.type)||"Memo";case G:r=t._payload,t=t._init;try{return ae(t(r))}catch{}}return null}function ue(t){var r=t.type;switch(t.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=r.render,t=t.displayName||t.name||"",r.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ae(r);case 8:return r===w?"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 r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function xe(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ve(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Ve(t){var r=ve(t)?"checked":"value",i=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),c=""+t[r];if(!t.hasOwnProperty(r)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var p=i.get,x=i.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return p.call(this)},set:function(S){c=""+S,x.call(this,S)}}),Object.defineProperty(t,r,{enumerable:i.enumerable}),{getValue:function(){return c},setValue:function(S){c=""+S},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Ce(t){t._valueTracker||(t._valueTracker=Ve(t))}function Ue(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var i=r.getValue(),c="";return t&&(c=ve(t)?t.checked?"true":"false":t.value),t=c,t!==i?(r.setValue(t),!0):!1}function Oe(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function dt(t,r){var i=r.checked;return q({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??t._wrapperState.initialChecked})}function xt(t,r){var i=r.defaultValue==null?"":r.defaultValue,c=r.checked!=null?r.checked:r.defaultChecked;i=xe(r.value!=null?r.value:i),t._wrapperState={initialChecked:c,initialValue:i,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function vt(t,r){r=r.checked,r!=null&&F(t,"checked",r,!1)}function Se(t,r){vt(t,r);var i=xe(r.value),c=r.type;if(i!=null)c==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+i):t.value!==""+i&&(t.value=""+i);else if(c==="submit"||c==="reset"){t.removeAttribute("value");return}r.hasOwnProperty("value")?we(t,r.type,i):r.hasOwnProperty("defaultValue")&&we(t,r.type,xe(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(t.defaultChecked=!!r.defaultChecked)}function Re(t,r,i){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var c=r.type;if(!(c!=="submit"&&c!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+t._wrapperState.initialValue,i||r===t.value||(t.value=r),t.defaultValue=r}i=t.name,i!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,i!==""&&(t.name=i)}function we(t,r,i){(r!=="number"||Oe(t.ownerDocument)!==t)&&(i==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+i&&(t.defaultValue=""+i))}var me=Array.isArray;function Ie(t,r,i,c){if(t=t.options,r){r={};for(var p=0;p"+r.valueOf().toString()+"",r=Qt.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;r.firstChild;)t.appendChild(r.firstChild)}});function qe(t,r){if(r){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=r;return}}t.textContent=r}var kn={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},ft=["Webkit","ms","Moz","O"];Object.keys(kn).forEach(function(t){ft.forEach(function(r){r=r+t.charAt(0).toUpperCase()+t.substring(1),kn[r]=kn[t]})});function Mn(t,r,i){return r==null||typeof r=="boolean"||r===""?"":i||typeof r!="number"||r===0||kn.hasOwnProperty(t)&&kn[t]?(""+r).trim():r+"px"}function Te(t,r){t=t.style;for(var i in r)if(r.hasOwnProperty(i)){var c=i.indexOf("--")===0,p=Mn(i,r[i],c);i==="float"&&(i="cssFloat"),c?t.setProperty(i,p):t[i]=p}}var Ze=q({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 ot(t,r){if(r){if(Ze[t]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(a(137,t));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(a(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(a(61))}if(r.style!=null&&typeof r.style!="object")throw Error(a(62))}}function it(t,r){if(t.indexOf("-")===-1)return typeof r.is=="string";switch(t){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 Zt=null;function gt(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var yr=null,an=null,Vn=null;function Fr(t){if(t=si(t)){if(typeof yr!="function")throw Error(a(280));var r=t.stateNode;r&&(r=yo(r),yr(t.stateNode,t.type,r))}}function Ye(t){an?Vn?Vn.push(t):Vn=[t]:an=t}function Et(){if(an){var t=an,r=Vn;if(Vn=an=null,Fr(t),r)for(t=0;t>>=0,t===0?32:31-(Ja(t)/st|0)|0}var gn=64,Sn=4194304;function Kr(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Yr(t,r){var i=t.pendingLanes;if(i===0)return 0;var c=0,p=t.suspendedLanes,x=t.pingedLanes,S=i&268435455;if(S!==0){var _=S&~p;_!==0?c=Kr(_):(x&=S,x!==0&&(c=Kr(x)))}else S=i&~p,S!==0?c=Kr(S):x!==0&&(c=Kr(x));if(c===0)return 0;if(r!==0&&r!==c&&(r&p)===0&&(p=c&-c,x=r&-r,p>=x||p===16&&(x&4194240)!==0))return r;if((c&4)!==0&&(c|=i&16),r=t.entangledLanes,r!==0)for(t=t.entanglements,r&=c;0i;i++)r.push(t);return r}function Us(t,r,i){t.pendingLanes|=r,r!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,r=31-on(r),t[r]=i}function Wx(t,r){var i=t.pendingLanes&~r;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=r,t.mutableReadLanes&=r,t.entangledLanes&=r,r=t.entanglements;var c=t.eventTimes;for(t=t.expirationTimes;0=Js),ch=" ",uh=!1;function dh(t,r){switch(t){case"keyup":return v2.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var es=!1;function w2(t,r){switch(t){case"compositionend":return fh(r);case"keypress":return r.which!==32?null:(uh=!0,ch);case"textInput":return t=r.data,t===ch&&uh?null:t;default:return null}}function k2(t,r){if(es)return t==="compositionend"||!gc&&dh(t,r)?(t=rh(),so=uc=Qr=null,es=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1=r)return{node:i,offset:r-t};t=c}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=vh(i)}}function wh(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?wh(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function kh(){for(var t=window,r=Oe();r instanceof t.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)t=r.contentWindow;else break;r=Oe(t.document)}return r}function vc(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}function M2(t){var r=kh(),i=t.focusedElem,c=t.selectionRange;if(r!==i&&i&&i.ownerDocument&&wh(i.ownerDocument.documentElement,i)){if(c!==null&&vc(i)){if(r=c.start,t=c.end,t===void 0&&(t=r),"selectionStart"in i)i.selectionStart=r,i.selectionEnd=Math.min(t,i.value.length);else if(t=(r=i.ownerDocument||document)&&r.defaultView||window,t.getSelection){t=t.getSelection();var p=i.textContent.length,x=Math.min(c.start,p);c=c.end===void 0?x:Math.min(c.end,p),!t.extend&&x>c&&(p=c,c=x,x=p),p=bh(i,x);var S=bh(i,c);p&&S&&(t.rangeCount!==1||t.anchorNode!==p.node||t.anchorOffset!==p.offset||t.focusNode!==S.node||t.focusOffset!==S.offset)&&(r=r.createRange(),r.setStart(p.node,p.offset),t.removeAllRanges(),x>c?(t.addRange(r),t.extend(S.node,S.offset)):(r.setEnd(S.node,S.offset),t.addRange(r)))}}for(r=[],t=i;t=t.parentNode;)t.nodeType===1&&r.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i=document.documentMode,ts=null,bc=null,ei=null,wc=!1;function Sh(t,r,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;wc||ts==null||ts!==Oe(c)||(c=ts,"selectionStart"in c&&vc(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),ei&&Zs(ei,c)||(ei=c,c=po(bc,"onSelect"),0is||(t.current=_c[is],_c[is]=null,is--)}function wt(t,r){is++,_c[is]=t.current,t.current=r}var na={},cn=ta(na),jn=ta(!1),Ea=na;function os(t,r){var i=t.type.contextTypes;if(!i)return na;var c=t.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===r)return c.__reactInternalMemoizedMaskedChildContext;var p={},x;for(x in i)p[x]=r[x];return c&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=p),p}function Cn(t){return t=t.childContextTypes,t!=null}function xo(){Ct(jn),Ct(cn)}function Oh(t,r,i){if(cn.current!==na)throw Error(a(168));wt(cn,r),wt(jn,i)}function Bh(t,r,i){var c=t.stateNode;if(r=r.childContextTypes,typeof c.getChildContext!="function")return i;c=c.getChildContext();for(var p in c)if(!(p in r))throw Error(a(108,ue(t)||"Unknown",p));return q({},i,c)}function vo(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||na,Ea=cn.current,wt(cn,t),wt(jn,jn.current),!0}function zh(t,r,i){var c=t.stateNode;if(!c)throw Error(a(169));i?(t=Bh(t,r,Ea),c.__reactInternalMemoizedMergedChildContext=t,Ct(jn),Ct(cn),wt(cn,t)):Ct(jn),wt(jn,i)}var Or=null,bo=!1,Fc=!1;function Vh(t){Or===null?Or=[t]:Or.push(t)}function $2(t){bo=!0,Vh(t)}function ra(){if(!Fc&&Or!==null){Fc=!0;var t=0,r=mt;try{var i=Or;for(mt=1;t>=S,p-=S,Br=1<<32-on(r)+p|i<We?(qt=ze,ze=null):qt=ze.sibling;var ct=de(Z,ze,te[We],pe);if(ct===null){ze===null&&(ze=qt);break}t&&ze&&ct.alternate===null&&r(Z,ze),H=x(ct,H,We),Be===null?Me=ct:Be.sibling=ct,Be=ct,ze=qt}if(We===te.length)return i(Z,ze),Tt&&Pa(Z,We),Me;if(ze===null){for(;WeWe?(qt=ze,ze=null):qt=ze.sibling;var fa=de(Z,ze,ct.value,pe);if(fa===null){ze===null&&(ze=qt);break}t&&ze&&fa.alternate===null&&r(Z,ze),H=x(fa,H,We),Be===null?Me=fa:Be.sibling=fa,Be=fa,ze=qt}if(ct.done)return i(Z,ze),Tt&&Pa(Z,We),Me;if(ze===null){for(;!ct.done;We++,ct=te.next())ct=he(Z,ct.value,pe),ct!==null&&(H=x(ct,H,We),Be===null?Me=ct:Be.sibling=ct,Be=ct);return Tt&&Pa(Z,We),Me}for(ze=c(Z,ze);!ct.done;We++,ct=te.next())ct=ke(ze,Z,We,ct.value,pe),ct!==null&&(t&&ct.alternate!==null&&ze.delete(ct.key===null?We:ct.key),H=x(ct,H,We),Be===null?Me=ct:Be.sibling=ct,Be=ct);return t&&ze.forEach(function(Sv){return r(Z,Sv)}),Tt&&Pa(Z,We),Me}function Bt(Z,H,te,pe){if(typeof te=="object"&&te!==null&&te.type===A&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case W:e:{for(var Me=te.key,Be=H;Be!==null;){if(Be.key===Me){if(Me=te.type,Me===A){if(Be.tag===7){i(Z,Be.sibling),H=p(Be,te.props.children),H.return=Z,Z=H;break e}}else if(Be.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===G&&Yh(Me)===Be.type){i(Z,Be.sibling),H=p(Be,te.props),H.ref=ii(Z,Be,te),H.return=Z,Z=H;break e}i(Z,Be);break}else r(Z,Be);Be=Be.sibling}te.type===A?(H=Aa(te.props.children,Z.mode,pe,te.key),H.return=Z,Z=H):(pe=Go(te.type,te.key,te.props,null,Z.mode,pe),pe.ref=ii(Z,H,te),pe.return=Z,Z=pe)}return S(Z);case J:e:{for(Be=te.key;H!==null;){if(H.key===Be)if(H.tag===4&&H.stateNode.containerInfo===te.containerInfo&&H.stateNode.implementation===te.implementation){i(Z,H.sibling),H=p(H,te.children||[]),H.return=Z,Z=H;break e}else{i(Z,H);break}else r(Z,H);H=H.sibling}H=Mu(te,Z.mode,pe),H.return=Z,Z=H}return S(Z);case G:return Be=te._init,Bt(Z,H,Be(te._payload),pe)}if(me(te))return Ne(Z,H,te,pe);if(X(te))return Pe(Z,H,te,pe);jo(Z,te)}return typeof te=="string"&&te!==""||typeof te=="number"?(te=""+te,H!==null&&H.tag===6?(i(Z,H.sibling),H=p(H,te),H.return=Z,Z=H):(i(Z,H),H=Ru(te,Z.mode,pe),H.return=Z,Z=H),S(Z)):i(Z,H)}return Bt}var ds=Gh(!0),Xh=Gh(!1),Co=ta(null),No=null,fs=null,zc=null;function Vc(){zc=fs=No=null}function Uc(t){var r=Co.current;Ct(Co),t._currentValue=r}function $c(t,r,i){for(;t!==null;){var c=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),t===i)break;t=t.return}}function hs(t,r){No=t,zc=fs=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&r)!==0&&(Nn=!0),t.firstContext=null)}function Hn(t){var r=t._currentValue;if(zc!==t)if(t={context:t,memoizedValue:r,next:null},fs===null){if(No===null)throw Error(a(308));fs=t,No.dependencies={lanes:0,firstContext:t}}else fs=fs.next=t;return r}var Ra=null;function Hc(t){Ra===null?Ra=[t]:Ra.push(t)}function Jh(t,r,i,c){var p=r.interleaved;return p===null?(i.next=i,Hc(r)):(i.next=p.next,p.next=i),r.interleaved=i,Vr(t,c)}function Vr(t,r){t.lanes|=r;var i=t.alternate;for(i!==null&&(i.lanes|=r),i=t,t=t.return;t!==null;)t.childLanes|=r,i=t.alternate,i!==null&&(i.childLanes|=r),i=t,t=t.return;return i.tag===3?i.stateNode:null}var aa=!1;function Wc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qh(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ur(t,r){return{eventTime:t,lane:r,tag:0,payload:null,callback:null,next:null}}function sa(t,r,i){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(lt&2)!==0){var p=c.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),c.pending=r,Vr(t,i)}return p=c.interleaved,p===null?(r.next=r,Hc(c)):(r.next=p.next,p.next=r),c.interleaved=r,Vr(t,i)}function Eo(t,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194240)!==0)){var c=r.lanes;c&=t.pendingLanes,i|=c,r.lanes=i,sc(t,i)}}function Qh(t,r){var i=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,i===c)){var p=null,x=null;if(i=i.firstBaseUpdate,i!==null){do{var S={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};x===null?p=x=S:x=x.next=S,i=i.next}while(i!==null);x===null?p=x=r:x=x.next=r}else p=x=r;i={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:x,shared:c.shared,effects:c.effects},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=r:t.next=r,i.lastBaseUpdate=r}function To(t,r,i,c){var p=t.updateQueue;aa=!1;var x=p.firstBaseUpdate,S=p.lastBaseUpdate,_=p.shared.pending;if(_!==null){p.shared.pending=null;var B=_,re=B.next;B.next=null,S===null?x=re:S.next=re,S=B;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,_=fe.lastBaseUpdate,_!==S&&(_===null?fe.firstBaseUpdate=re:_.next=re,fe.lastBaseUpdate=B))}if(x!==null){var he=p.baseState;S=0,fe=re=B=null,_=x;do{var de=_.lane,ke=_.eventTime;if((c&de)===de){fe!==null&&(fe=fe.next={eventTime:ke,lane:0,tag:_.tag,payload:_.payload,callback:_.callback,next:null});e:{var Ne=t,Pe=_;switch(de=r,ke=i,Pe.tag){case 1:if(Ne=Pe.payload,typeof Ne=="function"){he=Ne.call(ke,he,de);break e}he=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Pe.payload,de=typeof Ne=="function"?Ne.call(ke,he,de):Ne,de==null)break e;he=q({},he,de);break e;case 2:aa=!0}}_.callback!==null&&_.lane!==0&&(t.flags|=64,de=p.effects,de===null?p.effects=[_]:de.push(_))}else ke={eventTime:ke,lane:de,tag:_.tag,payload:_.payload,callback:_.callback,next:null},fe===null?(re=fe=ke,B=he):fe=fe.next=ke,S|=de;if(_=_.next,_===null){if(_=p.shared.pending,_===null)break;de=_,_=de.next,de.next=null,p.lastBaseUpdate=de,p.shared.pending=null}}while(!0);if(fe===null&&(B=he),p.baseState=B,p.firstBaseUpdate=re,p.lastBaseUpdate=fe,r=p.shared.interleaved,r!==null){p=r;do S|=p.lane,p=p.next;while(p!==r)}else x===null&&(p.shared.lanes=0);_a|=S,t.lanes=S,t.memoizedState=he}}function Zh(t,r,i){if(t=r.effects,r.effects=null,t!==null)for(r=0;ri?i:4,t(!0);var c=Jc.transition;Jc.transition={};try{t(!1),r()}finally{mt=i,Jc.transition=c}}function xp(){return Wn().memoizedState}function Y2(t,r,i){var c=ca(t);if(i={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null},vp(t))bp(r,i);else if(i=Jh(t,r,i,c),i!==null){var p=xn();cr(i,t,c,p),wp(i,r,c)}}function G2(t,r,i){var c=ca(t),p={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null};if(vp(t))bp(r,p);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=r.lastRenderedReducer,x!==null))try{var S=r.lastRenderedState,_=x(S,i);if(p.hasEagerState=!0,p.eagerState=_,ar(_,S)){var B=r.interleaved;B===null?(p.next=p,Hc(r)):(p.next=B.next,B.next=p),r.interleaved=p;return}}catch{}finally{}i=Jh(t,r,p,c),i!==null&&(p=xn(),cr(i,t,c,p),wp(i,r,c))}}function vp(t){var r=t.alternate;return t===Mt||r!==null&&r===Mt}function bp(t,r){ui=Mo=!0;var i=t.pending;i===null?r.next=r:(r.next=i.next,i.next=r),t.pending=r}function wp(t,r,i){if((i&4194240)!==0){var c=r.lanes;c&=t.pendingLanes,i|=c,r.lanes=i,sc(t,i)}}var Fo={readContext:Hn,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useInsertionEffect:un,useLayoutEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useMutableSource:un,useSyncExternalStore:un,useId:un,unstable_isNewReconciler:!1},X2={readContext:Hn,useCallback:function(t,r){return kr().memoizedState=[t,r===void 0?null:r],t},useContext:Hn,useEffect:up,useImperativeHandle:function(t,r,i){return i=i!=null?i.concat([t]):null,Io(4194308,4,hp.bind(null,r,t),i)},useLayoutEffect:function(t,r){return Io(4194308,4,t,r)},useInsertionEffect:function(t,r){return Io(4,2,t,r)},useMemo:function(t,r){var i=kr();return r=r===void 0?null:r,t=t(),i.memoizedState=[t,r],t},useReducer:function(t,r,i){var c=kr();return r=i!==void 0?i(r):r,c.memoizedState=c.baseState=r,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},c.queue=t,t=t.dispatch=Y2.bind(null,Mt,t),[c.memoizedState,t]},useRef:function(t){var r=kr();return t={current:t},r.memoizedState=t},useState:lp,useDebugValue:ru,useDeferredValue:function(t){return kr().memoizedState=t},useTransition:function(){var t=lp(!1),r=t[0];return t=K2.bind(null,t[1]),kr().memoizedState=t,[r,t]},useMutableSource:function(){},useSyncExternalStore:function(t,r,i){var c=Mt,p=kr();if(Tt){if(i===void 0)throw Error(a(407));i=i()}else{if(i=r(),Jt===null)throw Error(a(349));(Ia&30)!==0||rp(c,r,i)}p.memoizedState=i;var x={value:i,getSnapshot:r};return p.queue=x,up(sp.bind(null,c,x,t),[t]),c.flags|=2048,hi(9,ap.bind(null,c,x,i,r),void 0,null),i},useId:function(){var t=kr(),r=Jt.identifierPrefix;if(Tt){var i=zr,c=Br;i=(c&~(1<<32-on(c)-1)).toString(32)+i,r=":"+r+"R"+i,i=di++,0<\/script>",t=t.removeChild(t.firstChild)):typeof c.is=="string"?t=S.createElement(i,{is:c.is}):(t=S.createElement(i),i==="select"&&(S=t,c.multiple?S.multiple=!0:c.size&&(S.size=c.size))):t=S.createElementNS(t,i),t[br]=r,t[ai]=c,Vp(t,r,!1,!1),r.stateNode=t;e:{switch(S=it(i,c),i){case"dialog":jt("cancel",t),jt("close",t),p=c;break;case"iframe":case"object":case"embed":jt("load",t),p=c;break;case"video":case"audio":for(p=0;pxs&&(r.flags|=128,c=!0,pi(x,!1),r.lanes=4194304)}else{if(!c)if(t=Po(S),t!==null){if(r.flags|=128,c=!0,i=t.updateQueue,i!==null&&(r.updateQueue=i,r.flags|=4),pi(x,!0),x.tail===null&&x.tailMode==="hidden"&&!S.alternate&&!Tt)return dn(r),null}else 2*at()-x.renderingStartTime>xs&&i!==1073741824&&(r.flags|=128,c=!0,pi(x,!1),r.lanes=4194304);x.isBackwards?(S.sibling=r.child,r.child=S):(i=x.last,i!==null?i.sibling=S:r.child=S,x.last=S)}return x.tail!==null?(r=x.tail,x.rendering=r,x.tail=r.sibling,x.renderingStartTime=at(),r.sibling=null,i=Rt.current,wt(Rt,c?i&1|2:i&1),r):(dn(r),null);case 22:case 23:return Eu(),c=r.memoizedState!==null,t!==null&&t.memoizedState!==null!==c&&(r.flags|=8192),c&&(r.mode&1)!==0?(An&1073741824)!==0&&(dn(r),r.subtreeFlags&6&&(r.flags|=8192)):dn(r),null;case 24:return null;case 25:return null}throw Error(a(156,r.tag))}function rv(t,r){switch(Lc(r),r.tag){case 1:return Cn(r.type)&&xo(),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return ps(),Ct(jn),Ct(cn),Xc(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 5:return Yc(r),null;case 13:if(Ct(Rt),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(a(340));us()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return Ct(Rt),null;case 4:return ps(),null;case 10:return Uc(r.type._context),null;case 22:case 23:return Eu(),null;case 24:return null;default:return null}}var Oo=!1,fn=!1,av=typeof WeakSet=="function"?WeakSet:Set,je=null;function gs(t,r){var i=t.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(c){It(t,r,c)}else i.current=null}function mu(t,r,i){try{i()}catch(c){It(t,r,c)}}var Hp=!1;function sv(t,r){if(Ec=ro,t=kh(),vc(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var c=i.getSelection&&i.getSelection();if(c&&c.rangeCount!==0){i=c.anchorNode;var p=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{i.nodeType,x.nodeType}catch{i=null;break e}var S=0,_=-1,B=-1,re=0,fe=0,he=t,de=null;t:for(;;){for(var ke;he!==i||p!==0&&he.nodeType!==3||(_=S+p),he!==x||c!==0&&he.nodeType!==3||(B=S+c),he.nodeType===3&&(S+=he.nodeValue.length),(ke=he.firstChild)!==null;)de=he,he=ke;for(;;){if(he===t)break t;if(de===i&&++re===p&&(_=S),de===x&&++fe===c&&(B=S),(ke=he.nextSibling)!==null)break;he=de,de=he.parentNode}he=ke}i=_===-1||B===-1?null:{start:_,end:B}}else i=null}i=i||{start:0,end:0}}else i=null;for(Tc={focusedElem:t,selectionRange:i},ro=!1,je=r;je!==null;)if(r=je,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,je=t;else for(;je!==null;){r=je;try{var Ne=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var Pe=Ne.memoizedProps,Bt=Ne.memoizedState,Z=r.stateNode,H=Z.getSnapshotBeforeUpdate(r.elementType===r.type?Pe:ir(r.type,Pe),Bt);Z.__reactInternalSnapshotBeforeUpdate=H}break;case 3:var te=r.stateNode.containerInfo;te.nodeType===1?te.textContent="":te.nodeType===9&&te.documentElement&&te.removeChild(te.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(pe){It(r,r.return,pe)}if(t=r.sibling,t!==null){t.return=r.return,je=t;break}je=r.return}return Ne=Hp,Hp=!1,Ne}function mi(t,r,i){var c=r.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var p=c=c.next;do{if((p.tag&t)===t){var x=p.destroy;p.destroy=void 0,x!==void 0&&mu(r,i,x)}p=p.next}while(p!==c)}}function Bo(t,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var c=i.create;i.destroy=c()}i=i.next}while(i!==r)}}function gu(t){var r=t.ref;if(r!==null){var i=t.stateNode;switch(t.tag){case 5:t=i;break;default:t=i}typeof r=="function"?r(t):r.current=t}}function Wp(t){var r=t.alternate;r!==null&&(t.alternate=null,Wp(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&(delete r[br],delete r[ai],delete r[Ic],delete r[V2],delete r[U2])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Kp(t){return t.tag===5||t.tag===3||t.tag===4}function Yp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Kp(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function yu(t,r,i){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?i.nodeType===8?i.parentNode.insertBefore(t,r):i.insertBefore(t,r):(i.nodeType===8?(r=i.parentNode,r.insertBefore(t,i)):(r=i,r.appendChild(t)),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=go));else if(c!==4&&(t=t.child,t!==null))for(yu(t,r,i),t=t.sibling;t!==null;)yu(t,r,i),t=t.sibling}function xu(t,r,i){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?i.insertBefore(t,r):i.appendChild(t);else if(c!==4&&(t=t.child,t!==null))for(xu(t,r,i),t=t.sibling;t!==null;)xu(t,r,i),t=t.sibling}var en=null,or=!1;function ia(t,r,i){for(i=i.child;i!==null;)Gp(t,r,i),i=i.sibling}function Gp(t,r,i){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(Wr,i)}catch{}switch(i.tag){case 5:fn||gs(i,r);case 6:var c=en,p=or;en=null,ia(t,r,i),en=c,or=p,en!==null&&(or?(t=en,i=i.stateNode,t.nodeType===8?t.parentNode.removeChild(i):t.removeChild(i)):en.removeChild(i.stateNode));break;case 18:en!==null&&(or?(t=en,i=i.stateNode,t.nodeType===8?Mc(t.parentNode,i):t.nodeType===1&&Mc(t,i),Ys(t)):Mc(en,i.stateNode));break;case 4:c=en,p=or,en=i.stateNode.containerInfo,or=!0,ia(t,r,i),en=c,or=p;break;case 0:case 11:case 14:case 15:if(!fn&&(c=i.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){p=c=c.next;do{var x=p,S=x.destroy;x=x.tag,S!==void 0&&((x&2)!==0||(x&4)!==0)&&mu(i,r,S),p=p.next}while(p!==c)}ia(t,r,i);break;case 1:if(!fn&&(gs(i,r),c=i.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=i.memoizedProps,c.state=i.memoizedState,c.componentWillUnmount()}catch(_){It(i,r,_)}ia(t,r,i);break;case 21:ia(t,r,i);break;case 22:i.mode&1?(fn=(c=fn)||i.memoizedState!==null,ia(t,r,i),fn=c):ia(t,r,i);break;default:ia(t,r,i)}}function Xp(t){var r=t.updateQueue;if(r!==null){t.updateQueue=null;var i=t.stateNode;i===null&&(i=t.stateNode=new av),r.forEach(function(c){var p=pv.bind(null,t,c);i.has(c)||(i.add(c),c.then(p,p))})}}function lr(t,r){var i=r.deletions;if(i!==null)for(var c=0;cp&&(p=S),c&=~x}if(c=p,c=at()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*ov(c/1960))-c,10t?16:t,la===null)var c=!1;else{if(t=la,la=null,Ho=0,(lt&6)!==0)throw Error(a(331));var p=lt;for(lt|=4,je=t.current;je!==null;){var x=je,S=x.child;if((je.flags&16)!==0){var _=x.deletions;if(_!==null){for(var B=0;B<_.length;B++){var re=_[B];for(je=re;je!==null;){var fe=je;switch(fe.tag){case 0:case 11:case 15:mi(8,fe,x)}var he=fe.child;if(he!==null)he.return=fe,je=he;else for(;je!==null;){fe=je;var de=fe.sibling,ke=fe.return;if(Wp(fe),fe===re){je=null;break}if(de!==null){de.return=ke,je=de;break}je=ke}}}var Ne=x.alternate;if(Ne!==null){var Pe=Ne.child;if(Pe!==null){Ne.child=null;do{var Bt=Pe.sibling;Pe.sibling=null,Pe=Bt}while(Pe!==null)}}je=x}}if((x.subtreeFlags&2064)!==0&&S!==null)S.return=x,je=S;else e:for(;je!==null;){if(x=je,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:mi(9,x,x.return)}var Z=x.sibling;if(Z!==null){Z.return=x.return,je=Z;break e}je=x.return}}var H=t.current;for(je=H;je!==null;){S=je;var te=S.child;if((S.subtreeFlags&2064)!==0&&te!==null)te.return=S,je=te;else e:for(S=H;je!==null;){if(_=je,(_.flags&2048)!==0)try{switch(_.tag){case 0:case 11:case 15:Bo(9,_)}}catch(Me){It(_,_.return,Me)}if(_===S){je=null;break e}var pe=_.sibling;if(pe!==null){pe.return=_.return,je=pe;break e}je=_.return}}if(lt=p,ra(),Wt&&typeof Wt.onPostCommitFiberRoot=="function")try{Wt.onPostCommitFiberRoot(Wr,t)}catch{}c=!0}return c}finally{mt=i,Kn.transition=r}}return!1}function o0(t,r,i){r=ms(i,r),r=Cp(t,r,1),t=sa(t,r,1),r=xn(),t!==null&&(Us(t,1,r),Tn(t,r))}function It(t,r,i){if(t.tag===3)o0(t,t,i);else for(;r!==null;){if(r.tag===3){o0(r,t,i);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(oa===null||!oa.has(c))){t=ms(i,t),t=Np(r,t,1),r=sa(r,t,1),t=xn(),r!==null&&(Us(r,1,t),Tn(r,t));break}}r=r.return}}function fv(t,r,i){var c=t.pingCache;c!==null&&c.delete(r),r=xn(),t.pingedLanes|=t.suspendedLanes&i,Jt===t&&(tn&i)===i&&(Yt===4||Yt===3&&(tn&130023424)===tn&&500>at()-wu?Da(t,0):bu|=i),Tn(t,r)}function l0(t,r){r===0&&((t.mode&1)===0?r=1:(r=Sn,Sn<<=1,(Sn&130023424)===0&&(Sn=4194304)));var i=xn();t=Vr(t,r),t!==null&&(Us(t,r,i),Tn(t,i))}function hv(t){var r=t.memoizedState,i=0;r!==null&&(i=r.retryLane),l0(t,i)}function pv(t,r){var i=0;switch(t.tag){case 13:var c=t.stateNode,p=t.memoizedState;p!==null&&(i=p.retryLane);break;case 19:c=t.stateNode;break;default:throw Error(a(314))}c!==null&&c.delete(r),l0(t,i)}var c0;c0=function(t,r,i){if(t!==null)if(t.memoizedProps!==r.pendingProps||jn.current)Nn=!0;else{if((t.lanes&i)===0&&(r.flags&128)===0)return Nn=!1,tv(t,r,i);Nn=(t.flags&131072)!==0}else Nn=!1,Tt&&(r.flags&1048576)!==0&&Uh(r,ko,r.index);switch(r.lanes=0,r.tag){case 2:var c=r.type;Ao(t,r),t=r.pendingProps;var p=os(r,cn.current);hs(r,i),p=Qc(null,r,c,t,p,i);var x=Zc();return r.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,Cn(c)?(x=!0,vo(r)):x=!1,r.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,Wc(r),p.updater=Do,r.stateNode=p,p._reactInternals=r,su(r,c,t,i),r=cu(null,r,c,!0,x,i)):(r.tag=0,Tt&&x&&Dc(r),yn(null,r,p,i),r=r.child),r;case 16:c=r.elementType;e:{switch(Ao(t,r),t=r.pendingProps,p=c._init,c=p(c._payload),r.type=c,p=r.tag=gv(c),t=ir(c,t),p){case 0:r=lu(null,r,c,t,i);break e;case 1:r=Dp(null,r,c,t,i);break e;case 11:r=Rp(null,r,c,t,i);break e;case 14:r=Mp(null,r,c,ir(c.type,t),i);break e}throw Error(a(306,c,""))}return r;case 0:return c=r.type,p=r.pendingProps,p=r.elementType===c?p:ir(c,p),lu(t,r,c,p,i);case 1:return c=r.type,p=r.pendingProps,p=r.elementType===c?p:ir(c,p),Dp(t,r,c,p,i);case 3:e:{if(Lp(r),t===null)throw Error(a(387));c=r.pendingProps,x=r.memoizedState,p=x.element,qh(t,r),To(r,c,null,i);var S=r.memoizedState;if(c=S.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},r.updateQueue.baseState=x,r.memoizedState=x,r.flags&256){p=ms(Error(a(423)),r),r=Ap(t,r,c,i,p);break e}else if(c!==p){p=ms(Error(a(424)),r),r=Ap(t,r,c,i,p);break e}else for(Ln=ea(r.stateNode.containerInfo.firstChild),Dn=r,Tt=!0,sr=null,i=Xh(r,null,c,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(us(),c===p){r=$r(t,r,i);break e}yn(t,r,c,i)}r=r.child}return r;case 5:return ep(r),t===null&&Oc(r),c=r.type,p=r.pendingProps,x=t!==null?t.memoizedProps:null,S=p.children,Pc(c,p)?S=null:x!==null&&Pc(c,x)&&(r.flags|=32),Fp(t,r),yn(t,r,S,i),r.child;case 6:return t===null&&Oc(r),null;case 13:return Op(t,r,i);case 4:return Kc(r,r.stateNode.containerInfo),c=r.pendingProps,t===null?r.child=ds(r,null,c,i):yn(t,r,c,i),r.child;case 11:return c=r.type,p=r.pendingProps,p=r.elementType===c?p:ir(c,p),Rp(t,r,c,p,i);case 7:return yn(t,r,r.pendingProps,i),r.child;case 8:return yn(t,r,r.pendingProps.children,i),r.child;case 12:return yn(t,r,r.pendingProps.children,i),r.child;case 10:e:{if(c=r.type._context,p=r.pendingProps,x=r.memoizedProps,S=p.value,wt(Co,c._currentValue),c._currentValue=S,x!==null)if(ar(x.value,S)){if(x.children===p.children&&!jn.current){r=$r(t,r,i);break e}}else for(x=r.child,x!==null&&(x.return=r);x!==null;){var _=x.dependencies;if(_!==null){S=x.child;for(var B=_.firstContext;B!==null;){if(B.context===c){if(x.tag===1){B=Ur(-1,i&-i),B.tag=2;var re=x.updateQueue;if(re!==null){re=re.shared;var fe=re.pending;fe===null?B.next=B:(B.next=fe.next,fe.next=B),re.pending=B}}x.lanes|=i,B=x.alternate,B!==null&&(B.lanes|=i),$c(x.return,i,r),_.lanes|=i;break}B=B.next}}else if(x.tag===10)S=x.type===r.type?null:x.child;else if(x.tag===18){if(S=x.return,S===null)throw Error(a(341));S.lanes|=i,_=S.alternate,_!==null&&(_.lanes|=i),$c(S,i,r),S=x.sibling}else S=x.child;if(S!==null)S.return=x;else for(S=x;S!==null;){if(S===r){S=null;break}if(x=S.sibling,x!==null){x.return=S.return,S=x;break}S=S.return}x=S}yn(t,r,p.children,i),r=r.child}return r;case 9:return p=r.type,c=r.pendingProps.children,hs(r,i),p=Hn(p),c=c(p),r.flags|=1,yn(t,r,c,i),r.child;case 14:return c=r.type,p=ir(c,r.pendingProps),p=ir(c.type,p),Mp(t,r,c,p,i);case 15:return Ip(t,r,r.type,r.pendingProps,i);case 17:return c=r.type,p=r.pendingProps,p=r.elementType===c?p:ir(c,p),Ao(t,r),r.tag=1,Cn(c)?(t=!0,vo(r)):t=!1,hs(r,i),Sp(r,c,p),su(r,c,p,i),cu(null,r,c,!0,t,i);case 19:return zp(t,r,i);case 22:return _p(t,r,i)}throw Error(a(156,r.tag))};function u0(t,r){return ut(t,r)}function mv(t,r,i,c){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yn(t,r,i,c){return new mv(t,r,i,c)}function Pu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function gv(t){if(typeof t=="function")return Pu(t)?1:0;if(t!=null){if(t=t.$$typeof,t===K)return 11;if(t===ee)return 14}return 2}function da(t,r){var i=t.alternate;return i===null?(i=Yn(t.tag,r,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=r,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&14680064,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,r=t.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i}function Go(t,r,i,c,p,x){var S=2;if(c=t,typeof t=="function")Pu(t)&&(S=1);else if(typeof t=="string")S=5;else e:switch(t){case A:return Aa(i.children,p,x,r);case w:S=8,p|=8;break;case R:return t=Yn(12,i,r,p|2),t.elementType=R,t.lanes=x,t;case I:return t=Yn(13,i,r,p),t.elementType=I,t.lanes=x,t;case $:return t=Yn(19,i,r,p),t.elementType=$,t.lanes=x,t;case z:return Xo(i,p,x,r);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case E:S=10;break e;case Y:S=9;break e;case K:S=11;break e;case ee:S=14;break e;case G:S=16,c=null;break e}throw Error(a(130,t==null?t:typeof t,""))}return r=Yn(S,i,r,p),r.elementType=t,r.type=c,r.lanes=x,r}function Aa(t,r,i,c){return t=Yn(7,t,c,r),t.lanes=i,t}function Xo(t,r,i,c){return t=Yn(22,t,c,r),t.elementType=z,t.lanes=i,t.stateNode={isHidden:!1},t}function Ru(t,r,i){return t=Yn(6,t,null,r),t.lanes=i,t}function Mu(t,r,i){return r=Yn(4,t.children!==null?t.children:[],t.key,r),r.lanes=i,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}function yv(t,r,i,c,p){this.tag=r,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ac(0),this.expirationTimes=ac(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ac(0),this.identifierPrefix=c,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Iu(t,r,i,c,p,x,S,_,B){return t=new yv(t,r,i,_,B),r===1?(r=1,x===!0&&(r|=8)):r=0,x=Yn(3,null,null,r),t.current=x,x.stateNode=t,x.memoizedState={element:c,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wc(x),t}function xv(t,r,i){var c=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Ou.exports=Rv(),Ou.exports}var j0;function Mv(){if(j0)return nl;j0=1;var e=Bg();return nl.createRoot=e.createRoot,nl.hydrateRoot=e.hydrateRoot,nl}var Iv=Mv(),v=Hl();const ge=Og(v),_v=jv({__proto__:null,default:ge},[v]);/** + * react-router v7.15.1 + * + * 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 + */var zg=e=>{throw TypeError(e)},Vg=(e,n,a)=>n.has(e)||zg("Cannot "+a),Gn=(e,n,a)=>(Vg(e,n,"read from private field"),a?a.call(e):n.get(e)),Ni=(e,n,a)=>n.has(e)?zg("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,a),jr=(e,n,a,s)=>(Vg(e,n,"write to private field"),n.set(e,a),a),C0="popstate";function N0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Fv(e={}){function n(s,o){var g;let l=(g=o.state)==null?void 0:g.masked,{pathname:d,search:f,hash:m}=l||s.location;return Fi("",{pathname:d,search:f,hash:m},o.state&&o.state.usr||null,o.state&&o.state.key||"default",l?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function a(s,o){return typeof o=="string"?o:Mr(o)}return Lv(n,a,null,e)}function Je(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Ft(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function Dv(){return Math.random().toString(36).substring(2,10)}function E0(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Fi(e,n,a=null,s,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?_r(n):n,state:a,key:n&&n.key||s||Dv(),mask:o}}function Mr({pathname:e="/",search:n="",hash:a=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function _r(e){let n={};if(e){let a=e.indexOf("#");a>=0&&(n.hash=e.substring(a),e=e.substring(0,a));let s=e.indexOf("?");s>=0&&(n.search=e.substring(s),e=e.substring(0,s)),e&&(n.pathname=e)}return n}function Lv(e,n,a,s={}){let{window:o=document.defaultView,v5Compat:l=!1}=s,d=o.history,f="POP",m=null,g=y();g==null&&(g=0,d.replaceState({...d.state,idx:g},""));function y(){return(d.state||{idx:null}).idx}function h(){f="POP";let j=y(),M=j==null?null:j-g;g=j,m&&m({action:f,location:N.location,delta:M})}function b(j,M){f="PUSH";let P=N0(j)?j:Fi(N.location,j,M);g=y()+1;let F=E0(P,g),U=N.createHref(P.mask||P);try{d.pushState(F,"",U)}catch(W){if(W instanceof DOMException&&W.name==="DataCloneError")throw W;o.location.assign(U)}l&&m&&m({action:f,location:N.location,delta:1})}function k(j,M){f="REPLACE";let P=N0(j)?j:Fi(N.location,j,M);g=y();let F=E0(P,g),U=N.createHref(P.mask||P);d.replaceState(F,"",U),l&&m&&m({action:f,location:N.location,delta:0})}function C(j){return Ug(j)}let N={get action(){return f},get location(){return e(o,d)},listen(j){if(m)throw new Error("A history only accepts one active listener");return o.addEventListener(C0,h),m=j,()=>{o.removeEventListener(C0,h),m=null}},createHref(j){return n(o,j)},createURL:C,encodeLocation(j){let M=C(j);return{pathname:M.pathname,search:M.search,hash:M.hash}},push:b,replace:k,go(j){return d.go(j)}};return N}function Ug(e,n=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),Je(a,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Mr(e);return s=s.replace(/ $/,"%20"),!n&&s.startsWith("//")&&(s=a+s),new URL(s,a)}var Ei,T0=class{constructor(e){if(Ni(this,Ei,new Map),e)for(let[n,a]of e)this.set(n,a)}get(e){if(Gn(this,Ei).has(e))return Gn(this,Ei).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,n){Gn(this,Ei).set(e,n)}};Ei=new WeakMap;var Av=new Set(["lazy","caseSensitive","path","id","index","children"]);function Ov(e){return Av.has(e)}var Bv=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function zv(e){return Bv.has(e)}function Vv(e){return e.index===!0}function Di(e,n,a=[],s={},o=!1){return e.map((l,d)=>{let f=[...a,String(d)],m=typeof l.id=="string"?l.id:f.join("-");if(Je(l.index!==!0||!l.children,"Cannot specify children on an index route"),Je(o||!s[m],`Found a route id collision on id "${m}". Route id's must be globally unique within Data Router usages`),Vv(l)){let g={...l,id:m};return s[m]=P0(g,n(g)),g}else{let g={...l,id:m,children:void 0};return s[m]=P0(g,n(g)),l.children&&(g.children=Di(l.children,n,f,s,o)),g}})}function P0(e,n){return Object.assign(e,{...n,...typeof n.lazy=="object"&&n.lazy!=null?{lazy:{...e.lazy,...n.lazy}}:{}})}function $g(e,n,a="/"){return dr(e,n,a,!1)}function dr(e,n,a,s,o){let l=typeof n=="string"?_r(n):n,d=er(l.pathname||"/",a);if(d==null)return null;let f=o??gl(e),m=null,g=Zv(d);for(let y=0;m==null&&y{let y={relativePath:g===void 0?d.path||"":g,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(s)&&m)return;Je(y.relativePath.startsWith(s),`Absolute route path "${y.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(s.length)}let h=Qn([s,y.relativePath]),b=a.concat(y);d.children&&d.children.length>0&&(Je(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),Wg(d.children,n,b,h,m)),!(d.path==null&&!d.index)&&n.push({path:h,score:Xv(h,d.index),routesMeta:b})};return e.forEach((d,f)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))l(d,f);else for(let g of Kg(d.path))l(d,f,!0,g)}),n}function Kg(e){let n=e.split("/");if(n.length===0)return[];let[a,...s]=n,o=a.endsWith("?"),l=a.replace(/\?$/,"");if(s.length===0)return o?[l,""]:[l];let d=Kg(s.join("/")),f=[];return f.push(...d.map(m=>m===""?l:[l,m].join("/"))),o&&f.push(...d),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function Uv(e){e.sort((n,a)=>n.score!==a.score?a.score-n.score:Jv(n.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var $v=/^:[\w-]+$/,Hv=3,Wv=2,Kv=1,Yv=10,Gv=-2,R0=e=>e==="*";function Xv(e,n){let a=e.split("/"),s=a.length;return a.some(R0)&&(s+=Gv),n&&(s+=Wv),a.filter(o=>!R0(o)).reduce((o,l)=>o+($v.test(l)?Hv:l===""?Kv:Yv),s)}function Jv(e,n){return e.length===n.length&&e.slice(0,-1).every((s,o)=>s===n[o])?e[e.length-1]-n[n.length-1]:0}function qv(e,n,a=!1){let{routesMeta:s}=e,o={},l="/",d=[];for(let f=0;f{if(y==="*"){let C=f[b]||"";d=l.slice(0,l.length-C.length).replace(/(.)\/+$/,"$1")}const k=f[b];return h&&!k?g[y]=void 0:g[y]=(k||"").replace(/%2F/g,"/"),g},{}),pathname:l,pathnameBase:d,pattern:e}}function Qv(e,n=!1,a=!0){Ft(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 s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,f,m,g,y)=>{if(s.push({paramName:f,isOptional:m!=null}),m){let h=y.charAt(g+d.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),s]}function Zv(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Ft(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function er(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let a=n.endsWith("/")?n.length-1:n.length,s=e.charAt(a);return s&&s!=="/"?null:e.slice(a)||"/"}function eb({basename:e,pathname:n}){return n==="/"?e:Qn([e,n])}var Yg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qd=e=>Yg.test(e);function tb(e,n="/"){let{pathname:a,search:s="",hash:o=""}=typeof e=="string"?_r(e):e,l;return a?(a=Qd(a),a.startsWith("/")?l=M0(a.substring(1),"/"):l=M0(a,n)):l=n,{pathname:l,search:rb(s),hash:ab(o)}}function M0(e,n){let a=Ml(n).split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function Vu(e,n,a,s){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Gg(e){return e.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function Wl(e){let n=Gg(e);return n.map((a,s)=>s===n.length-1?a.pathname:a.pathnameBase)}function Ui(e,n,a,s=!1){let o;typeof e=="string"?o=_r(e):(o={...e},Je(!o.pathname||!o.pathname.includes("?"),Vu("?","pathname","search",o)),Je(!o.pathname||!o.pathname.includes("#"),Vu("#","pathname","hash",o)),Je(!o.search||!o.search.includes("#"),Vu("#","search","hash",o)));let l=e===""||o.pathname==="",d=l?"/":o.pathname,f;if(d==null)f=a;else{let h=n.length-1;if(!s&&d.startsWith("..")){let b=d.split("/");for(;b[0]==="..";)b.shift(),h-=1;o.pathname=b.join("/")}f=h>=0?n[h]:"/"}let m=tb(o,f),g=d&&d!=="/"&&d.endsWith("/"),y=(l||d===".")&&a.endsWith("/");return!m.pathname.endsWith("/")&&(g||y)&&(m.pathname+="/"),m}var Qd=e=>e.replace(/\/\/+/g,"/"),Qn=e=>Qd(e.join("/")),Ml=e=>e.replace(/\/+$/,""),nb=e=>Ml(e).replace(/^\/*/,"/"),rb=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ab=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,$i=class{constructor(e,n,a,s=!1){this.status=e,this.statusText=n||"",this.internal=s,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function Li(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Hi(e){let n=e.map(a=>a.route.path).filter(Boolean);return Qn(n)||"/"}var Xg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Jg(e,n){let a=e;if(typeof a!="string"||!Yg.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let s=a,o=!1;if(Xg)try{let l=new URL(window.location.href),d=a.startsWith("//")?new URL(l.protocol+a):new URL(a),f=er(d.pathname,n);d.origin===l.origin&&f!=null?a=f+d.search+d.hash:o=!0}catch{Ft(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:a}}var xa=Symbol("Uninstrumented");function sb(e,n){let a={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:n.id,index:n.index,path:n.path,instrument(l){let d=Object.keys(a);for(let f of d)l[f]&&a[f].push(l[f])}}));let s={};if(typeof n.lazy=="function"&&a.lazy.length>0){let o=Cs(a.lazy,n.lazy,()=>{});o&&(s.lazy=o)}if(typeof n.lazy=="object"){let o=n.lazy;["middleware","loader","action"].forEach(l=>{let d=o[l],f=a[`lazy.${l}`];if(typeof d=="function"&&f.length>0){let m=Cs(f,d,()=>{});m&&(s.lazy=Object.assign(s.lazy||{},{[l]:m}))}})}return["loader","action"].forEach(o=>{let l=n[o];if(typeof l=="function"&&a[o].length>0){let d=l[xa]??l,f=Cs(a[o],d,(...m)=>I0(m[0]));f&&(o==="loader"&&d.hydrate===!0&&(f.hydrate=!0),f[xa]=d,s[o]=f)}}),n.middleware&&n.middleware.length>0&&a.middleware.length>0&&(s.middleware=n.middleware.map(o=>{let l=o[xa]??o,d=Cs(a.middleware,l,(...f)=>I0(f[0]));return d?(d[xa]=l,d):o})),s}function ib(e,n){let a={navigate:[],fetch:[]};if(n.forEach(s=>s({instrument(o){let l=Object.keys(o);for(let d of l)o[d]&&a[d].push(o[d])}})),a.navigate.length>0){let s=e.navigate[xa]??e.navigate,o=Cs(a.navigate,s,(...l)=>{let[d,f]=l;return{to:typeof d=="number"||typeof d=="string"?d:d?Mr(d):".",..._0(e,f??{})}});o&&(o[xa]=s,e.navigate=o)}if(a.fetch.length>0){let s=e.fetch[xa]??e.fetch,o=Cs(a.fetch,s,(...l)=>{let[d,,f,m]=l;return{href:f??".",fetcherKey:d,..._0(e,m??{})}});o&&(o[xa]=s,e.fetch=o)}return e}function Cs(e,n,a){return e.length===0?null:async(...s)=>{let o=await qg(e,a(...s),()=>n(...s),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function qg(e,n,a,s){let o=e[s],l;if(o){let d,f=async()=>(d?console.error("You cannot call instrumented handlers more than once"):d=qg(e,n,a,s-1),l=await d,Je(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.value}:{status:"success",error:void 0});try{await o(f,n)}catch(m){console.error("An instrumentation function threw an error:",m)}d||await f(),await d}else try{l={type:"success",value:await a()}}catch(d){l={type:"error",value:d}}return l||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function I0(e){let{request:n,context:a,params:s,pattern:o}=e;return{request:ob(n),params:{...s},pattern:o,context:lb(a)}}function _0(e,n){return{currentUrl:Mr(e.state.location),..."formMethod"in n?{formMethod:n.formMethod}:{},..."formEncType"in n?{formEncType:n.formEncType}:{},..."formData"in n?{formData:n.formData}:{},..."body"in n?{body:n.body}:{}}}function ob(e){return{method:e.method,url:e.url,headers:{get:(...n)=>e.headers.get(...n)}}}function lb(e){if(ub(e)){let n={...e};return Object.freeze(n),n}else return{get:n=>e.get(n)}}var cb=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ub(e){if(e===null||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);return n===Object.prototype||n===null||Object.getOwnPropertyNames(n).sort().join("\0")===cb}var Qg=["POST","PUT","PATCH","DELETE"],db=new Set(Qg),fb=["GET",...Qg],hb=new Set(fb),Zg=new Set([301,302,303,307,308]),pb=new Set([307,308]),Uu={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mb={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},wi={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},gb=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),e1="remix-router-transitions",t1=Symbol("ResetLoaderData"),za,bs,ha,ws,yb=class{constructor(e){Ni(this,za),Ni(this,bs),Ni(this,ha),Ni(this,ws),jr(this,za,e),jr(this,bs,gl(e))}get stableRoutes(){return Gn(this,za)}get activeRoutes(){return Gn(this,ha)??Gn(this,za)}get branches(){return Gn(this,ws)??Gn(this,bs)}get hasHMRRoutes(){return Gn(this,ha)!=null}setRoutes(e){jr(this,za,e),jr(this,bs,gl(e))}setHmrRoutes(e){jr(this,ha,e),jr(this,ws,gl(e))}commitHmrRoutes(){Gn(this,ha)&&(jr(this,za,Gn(this,ha)),jr(this,bs,Gn(this,ws)),jr(this,ha,void 0),jr(this,ws,void 0))}};za=new WeakMap;bs=new WeakMap;ha=new WeakMap;ws=new WeakMap;function xb(e){const n=e.window?e.window:typeof window<"u"?window:void 0,a=typeof n<"u"&&typeof n.document<"u"&&typeof n.document.createElement<"u";Je(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=e.hydrationRouteProperties||[],o=e.mapRouteProperties||gb,l=o;if(e.instrumentations){let L=e.instrumentations;l=V=>({...o(V),...sb(L.map(Q=>Q.route).filter(Boolean),V)})}let d={},f=new yb(Di(e.routes,l,void 0,d)),m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let g=e.dataStrategy||Sb,y={...e.future},h=null,b=new Set,k=null,C=null,N=null,j=null,M=e.hydrationData!=null,P=dr(f.activeRoutes,e.history.location,m,!1,f.branches),F=!1,U=null,W,J;if(P==null&&!e.patchRoutesOnNavigation){let L=Xn(404,{pathname:e.history.location.pathname}),{matches:V,route:Q}=rl(f.activeRoutes);W=!0,J=!W,P=V,U={[Q.id]:L}}else if(P&&!e.hydrationData&&In(P,f.activeRoutes,e.history.location.pathname).active&&(P=null),P)if(P.some(L=>L.route.lazy))W=!1,J=!W;else if(!P.some(L=>Zd(L.route)))W=!0,J=!W;else{let L=e.hydrationData?e.hydrationData.loaderData:null,V=e.hydrationData?e.hydrationData.errors:null,Q=P;if(V){let le=P.findIndex(ce=>V[ce.route.id]!==void 0);Q=Q.slice(0,le+1)}J=!1,W=!0,Q.forEach(le=>{let ce=n1(le.route,L,V);J=J||ce.renderFallback,W=W&&!ce.shouldLoad})}else{W=!1,J=!W,P=[];let L=In(null,f.activeRoutes,e.history.location.pathname);L.active&&L.matches&&(F=!0,P=L.matches)}let A,w={historyAction:e.history.action,location:e.history.location,matches:P,initialized:W,renderFallback:J,navigation:Uu,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||U,fetchers:new Map,blockers:new Map},R="POP",E=null,Y=!1,K,I=!1,$=new Map,ee=null,G=!1,z=!1,D=new Set,X=new Map,q=0,T=-1,O=new Map,ne=new Set,ie=new Map,oe=new Map,ae=new Set,ue=new Map,xe,ve=null;function Ve(){if(h=e.history.listen(({action:L,location:V,delta:Q})=>{if(xe){xe(),xe=void 0;return}Ft(ue.size===0||Q!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let le=Vn({currentLocation:w.location,nextLocation:V,historyAction:L});if(le&&Q!=null){let ce=new Promise(_e=>{xe=_e});e.history.go(Q*-1),an(le,{state:"blocked",location:V,proceed(){an(le,{state:"proceeding",proceed:void 0,reset:void 0,location:V}),ce.then(()=>e.history.go(Q))},reset(){let _e=new Map(w.blockers);_e.set(le,wi),Oe({blockers:_e})}}),E==null||E.resolve(),E=null;return}return Se(L,V)}),a){Vb(n,$);let L=()=>Ub(n,$);n.addEventListener("pagehide",L),ee=()=>n.removeEventListener("pagehide",L)}return w.initialized||Se("POP",w.location,{initialHydration:!0}),A}function Ce(){h&&h(),ee&&ee(),b.clear(),K&&K.abort(),w.fetchers.forEach((L,V)=>Mn(w.fetchers,V)),w.blockers.forEach((L,V)=>yr(V))}function Ue(L){if(b.add(L),k){let{newErrors:V}=k;k=null,L(w,{deletedFetchers:[],newErrors:V,viewTransitionOpts:void 0,flushSync:!1})}return()=>b.delete(L)}function Oe(L,V={}){L.matches&&(L.matches=L.matches.map(ce=>{let _e=d[ce.route.id],Fe=ce.route;return Fe.element!==_e.element||Fe.errorElement!==_e.errorElement||Fe.hydrateFallbackElement!==_e.hydrateFallbackElement?{...ce,route:_e}:ce})),w={...w,...L};let Q=[],le=[];w.fetchers.forEach((ce,_e)=>{ce.state==="idle"&&(ae.has(_e)?Q.push(_e):le.push(_e))}),ae.forEach(ce=>{!w.fetchers.has(ce)&&!X.has(ce)&&Q.push(ce)}),b.size===0&&(k={newErrors:L.errors??null}),[...b].forEach(ce=>ce(w,{deletedFetchers:Q,newErrors:L.errors??null,viewTransitionOpts:V.viewTransitionOpts,flushSync:V.flushSync===!0})),Q.forEach(ce=>Mn(w.fetchers,ce)),le.forEach(ce=>w.fetchers.delete(ce))}function dt(L,V,{flushSync:Q}={}){var $e,Xe;let le=w.actionData!=null&&w.navigation.formMethod!=null&&hn(w.navigation.formMethod)&&w.navigation.state==="loading"&&(($e=L.state)==null?void 0:$e._isRedirect)!==!0,ce;V.actionData?Object.keys(V.actionData).length>0?ce=V.actionData:ce=null:le?ce=w.actionData:ce=null;let _e=V.loaderData?H0(w.loaderData,V.loaderData,V.matches||[],V.errors):w.loaderData,Fe=w.blockers;Fe.size>0&&(Fe=new Map(Fe),Fe.forEach((Le,tt)=>Fe.set(tt,wi)));let Ke=G?!1:$t(L,V.matches||w.matches),ye=Y===!0||w.navigation.formMethod!=null&&hn(w.navigation.formMethod)&&((Xe=L.state)==null?void 0:Xe._isRedirect)!==!0;f.commitHmrRoutes(),G||R==="POP"||(R==="PUSH"?e.history.push(L,L.state):R==="REPLACE"&&e.history.replace(L,L.state));let De;if(R==="POP"){let Le=$.get(w.location.pathname);Le&&Le.has(L.pathname)?De={currentLocation:w.location,nextLocation:L}:$.has(L.pathname)&&(De={currentLocation:L,nextLocation:w.location})}else if(I){let Le=$.get(w.location.pathname);Le?Le.add(L.pathname):(Le=new Set([L.pathname]),$.set(w.location.pathname,Le)),De={currentLocation:w.location,nextLocation:L}}Oe({...V,actionData:ce,loaderData:_e,historyAction:R,location:L,initialized:!0,renderFallback:!1,navigation:Uu,revalidation:"idle",restoreScrollPosition:Ke,preventScrollReset:ye,blockers:Fe},{viewTransitionOpts:De,flushSync:Q===!0}),R="POP",Y=!1,I=!1,G=!1,z=!1,E==null||E.resolve(),E=null,ve==null||ve.resolve(),ve=null}async function xt(L,V){if(E==null||E.resolve(),E=null,typeof L=="number"){E||(E=G0());let ut=E.promise;return e.history.go(L),ut}let Q=bd(w.location,w.matches,m,L,V==null?void 0:V.fromRouteId,V==null?void 0:V.relative),{path:le,submission:ce,error:_e}=F0(!1,Q,V),Fe;V!=null&&V.mask&&(Fe={pathname:"",search:"",hash:"",...typeof V.mask=="string"?_r(V.mask):{...w.location.mask,...V.mask}});let Ke=w.location,ye=Fi(Ke,le,V&&V.state,void 0,Fe);ye={...ye,...e.history.encodeLocation(ye)};let De=V&&V.replace!=null?V.replace:void 0,$e="PUSH";De===!0?$e="REPLACE":De===!1||ce!=null&&hn(ce.formMethod)&&ce.formAction===w.location.pathname+w.location.search&&($e="REPLACE");let Xe=V&&"preventScrollReset"in V?V.preventScrollReset===!0:void 0,Le=(V&&V.flushSync)===!0,tt=Vn({currentLocation:Ke,nextLocation:ye,historyAction:$e});if(tt){an(tt,{state:"blocked",location:ye,proceed(){an(tt,{state:"proceeding",proceed:void 0,reset:void 0,location:ye}),xt(L,V)},reset(){let ut=new Map(w.blockers);ut.set(tt,wi),Oe({blockers:ut})}});return}await Se($e,ye,{submission:ce,pendingError:_e,preventScrollReset:Xe,replace:V&&V.replace,enableViewTransition:V&&V.viewTransition,flushSync:Le,callSiteDefaultShouldRevalidate:V&&V.defaultShouldRevalidate})}function vt(){ve||(ve=G0()),Qt(),Oe({revalidation:"loading"});let L=ve.promise;return w.navigation.state==="submitting"?L:w.navigation.state==="idle"?(Se(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),L):(Se(R||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:I===!0}),L)}async function Se(L,V,Q){K&&K.abort(),K=null,R=L,G=(Q&&Q.startUninterruptedRevalidation)===!0,Lt(w.location,w.matches),Y=(Q&&Q.preventScrollReset)===!0,I=(Q&&Q.enableViewTransition)===!0;let le=f.activeRoutes,ce=Q!=null&&Q.initialHydration&&w.matches&&w.matches.length>0&&!F?w.matches:dr(le,V,m,!1,f.branches),_e=(Q&&Q.flushSync)===!0;if(ce&&w.initialized&&!z&&Mb(w.location,V)&&!(Q&&Q.submission&&hn(Q.submission.formMethod))){dt(V,{matches:ce},{flushSync:_e});return}let Fe=In(ce,le,V.pathname);if(Fe.active&&Fe.matches&&(ce=Fe.matches),!ce){let{error:St,notFoundMatches:pt,route:at}=Fr(V.pathname);dt(V,{matches:pt,loaderData:{},errors:{[at.id]:St}},{flushSync:_e});return}let Ke=Q&&Q.overrideNavigation?{...Q.overrideNavigation,matches:ce,historyAction:L}:void 0;K=new AbortController;let ye=ks(e.history,V,K.signal,Q&&Q.submission),De=e.getContext?await e.getContext():new T0,$e;if(Q&&Q.pendingError)$e=[ga(ce).route.id,{type:"error",error:Q.pendingError}];else if(Q&&Q.submission&&hn(Q.submission.formMethod)){let St=await Re(ye,V,Q.submission,ce,L,De,Fe.active,Q&&Q.initialHydration===!0,{replace:Q.replace,flushSync:_e});if(St.shortCircuited)return;if(St.pendingActionResult){let[pt,at]=St.pendingActionResult;if(On(at)&&Li(at.error)&&at.error.status===404){K=null,dt(V,{matches:St.matches,loaderData:{},errors:{[pt]:at.error}});return}}ce=St.matches||ce,$e=St.pendingActionResult,Ke=$u(V,ce,L,Q.submission),_e=!1,Fe.active=!1,ye=ks(e.history,ye.url,ye.signal)}let{shortCircuited:Xe,matches:Le,loaderData:tt,errors:ut,workingFetchers:Ot}=await we(ye,V,ce,L,De,Fe.active,Ke,Q&&Q.submission,Q&&Q.fetcherSubmission,Q&&Q.replace,Q&&Q.initialHydration===!0,_e,$e,Q&&Q.callSiteDefaultShouldRevalidate);Xe||(K=null,dt(V,{matches:Le||ce,...W0($e),loaderData:tt,errors:ut,...Ot?{fetchers:Ot}:{}}))}async function Re(L,V,Q,le,ce,_e,Fe,Ke,ye={}){Qt();let De=Bb(V,le,ce,Q);if(Oe({navigation:De},{flushSync:ye.flushSync===!0}),Fe){let Le=await kt(le,V.pathname,L.signal);if(Le.type==="aborted")return{shortCircuited:!0};if(Le.type==="error"){if(Le.partialMatches.length===0){let{matches:ut,route:Ot}=rl(f.activeRoutes);return{matches:ut,pendingActionResult:[Ot.id,{type:"error",error:Le.error}]}}let tt=ga(Le.partialMatches).route.id;return{matches:Le.partialMatches,pendingActionResult:[tt,{type:"error",error:Le.error}]}}else if(Le.matches)le=Le.matches;else{let{notFoundMatches:tt,error:ut,route:Ot}=Fr(V.pathname);return{matches:tt,pendingActionResult:[Ot.id,{type:"error",error:ut}]}}}let $e,Xe=yl(le,V);if(!Xe.route.action&&!Xe.route.lazy)$e={type:"error",error:Xn(405,{method:L.method,pathname:V.pathname,routeId:Xe.route.id})};else{let Le=Rs(l,d,L,V,le,Xe,Ke?[]:s,_e),tt=await rt(L,V,Le,_e,null);if($e=tt[Xe.route.id],!$e){for(let ut of le)if(tt[ut.route.id]){$e=tt[ut.route.id];break}}if(L.signal.aborted)return{shortCircuited:!0}}if(Ua($e)){let Le;return ye&&ye.replace!=null?Le=ye.replace:Le=V0($e.response.headers.get("Location"),new URL(L.url),m,e.history)===w.location.pathname+w.location.search,await Ge(L,$e,!0,{submission:Q,replace:Le}),{shortCircuited:!0}}if(On($e)){let Le=ga(le,Xe.route.id);return(ye&&ye.replace)!==!0&&(R="PUSH"),{matches:le,pendingActionResult:[Le.route.id,$e,Xe.route.id]}}return{matches:le,pendingActionResult:[Xe.route.id,$e]}}async function we(L,V,Q,le,ce,_e,Fe,Ke,ye,De,$e,Xe,Le,tt){let ut=Fe||$u(V,Q,le,Ke),Ot=Ke||ye||Y0(ut),St=!G&&!$e;if(_e){if(St){let ln=me(Le);Oe({navigation:ut,...ln!==void 0?{actionData:ln}:{}},{flushSync:Xe})}let st=await kt(Q,V.pathname,L.signal);if(st.type==="aborted")return{shortCircuited:!0};if(st.type==="error"){if(st.partialMatches.length===0){let{matches:gn,route:Sn}=rl(f.activeRoutes);return{matches:gn,loaderData:{},errors:{[Sn.id]:st.error}}}let ln=ga(st.partialMatches).route.id;return{matches:st.partialMatches,loaderData:{},errors:{[ln]:st.error}}}else if(st.matches)Q=st.matches;else{let{error:ln,notFoundMatches:gn,route:Sn}=Fr(V.pathname);return{matches:gn,loaderData:{},errors:{[Sn.id]:ln}}}}let pt=f.activeRoutes,{dsMatches:at,revalidatingFetchers:sn}=D0(L,ce,l,d,e.history,w,Q,Ot,V,$e?[]:s,$e===!0,z,D,ae,ie,ne,pt,m,e.patchRoutesOnNavigation!=null,f.branches,Le,tt);if(T=++q,!e.dataStrategy&&!at.some(st=>st.shouldLoad)&&!at.some(st=>st.route.middleware&&st.route.middleware.length>0)&&sn.length===0){let st=new Map(w.fetchers),ln=it(st);return dt(V,{matches:Q,loaderData:{},errors:Le&&On(Le[1])?{[Le[0]]:Le[1].error}:null,...W0(Le),...ln?{fetchers:st}:{}},{flushSync:Xe}),{shortCircuited:!0}}if(St){let st={};if(!_e){st.navigation=ut;let ln=me(Le);ln!==void 0&&(st.actionData=ln)}sn.length>0&&(st.fetchers=Ie(sn)),Oe(st,{flushSync:Xe})}sn.forEach(st=>{Ze(st.key),st.controller&&X.set(st.key,st.controller)});let Dr=()=>sn.forEach(st=>Ze(st.key));K&&K.signal.addEventListener("abort",Dr);let{loaderResults:nr,fetcherResults:rr}=await ht(at,sn,L,V,ce);if(L.signal.aborted)return{shortCircuited:!0};K&&K.signal.removeEventListener("abort",Dr),sn.forEach(st=>X.delete(st.key));let vr=al(nr);if(vr)return await Ge(L,vr.result,!0,{replace:De}),{shortCircuited:!0};if(vr=al(rr),vr)return ne.add(vr.key),await Ge(L,vr.result,!0,{replace:De}),{shortCircuited:!0};let _n=new Map(w.fetchers),{loaderData:Wr,errors:Wt}=$0(w,Q,nr,Le,sn,rr,_n);$e&&w.errors&&(Wt={...w.errors,...Wt});let Xa=it(_n),on=Zt(T,_n),Ja=Xa||on||sn.length>0;return{matches:Q,loaderData:Wr,errors:Wt,...Ja?{workingFetchers:_n}:{}}}function me(L){if(L&&!On(L[1]))return{[L[0]]:L[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function Ie(L){let V=new Map(w.fetchers);return L.forEach(Q=>{let le=V.get(Q.key),ce=ki(void 0,le?le.data:void 0);V.set(Q.key,ce)}),V}async function be(L,V,Q,le){Ze(L);let ce=(le&&le.flushSync)===!0,_e=f.activeRoutes,Fe=bd(w.location,w.matches,m,Q,V,le==null?void 0:le.relative),Ke=dr(_e,Fe,m,!1,f.branches),ye=In(Ke,_e,Fe);if(ye.active&&ye.matches&&(Ke=ye.matches),!Ke){qe(L,V,Xn(404,{pathname:Fe}),{flushSync:ce});return}let{path:De,submission:$e,error:Xe}=F0(!0,Fe,le);if(Xe){qe(L,V,Xe,{flushSync:ce});return}let Le=e.getContext?await e.getContext():new T0,tt=(le&&le.preventScrollReset)===!0;if($e&&hn($e.formMethod)){await Ae(L,V,De,Ke,Le,ye.active,ce,tt,$e,le&&le.defaultShouldRevalidate);return}ie.set(L,{routeId:V,path:De}),await Qe(L,V,De,Ke,Le,ye.active,ce,tt,$e)}async function Ae(L,V,Q,le,ce,_e,Fe,Ke,ye,De){Qt(),ie.delete(L);let $e=w.fetchers.get(L);Pt(L,zb(ye,$e),{flushSync:Fe});let Xe=new AbortController,Le=ks(e.history,Q,Xe.signal,ye);if(_e){let bt=await kt(le,new URL(Le.url).pathname,Le.signal,L);if(bt.type==="aborted")return;if(bt.type==="error"){qe(L,V,bt.error,{flushSync:Fe});return}else if(bt.matches)le=bt.matches;else{qe(L,V,Xn(404,{pathname:Q}),{flushSync:Fe});return}}let tt=yl(le,Q);if(!tt.route.action&&!tt.route.lazy){let bt=Xn(405,{method:ye.formMethod,pathname:Q,routeId:V});qe(L,V,bt,{flushSync:Fe});return}X.set(L,Xe);let ut=q,Ot=Rs(l,d,Le,Q,le,tt,s,ce),St=await rt(Le,Q,Ot,ce,L),pt=St[tt.route.id];if(!pt){for(let bt of Ot)if(St[bt.route.id]){pt=St[bt.route.id];break}}if(Le.signal.aborted){X.get(L)===Xe&&X.delete(L);return}if(ae.has(L)){if(Ua(pt)||On(pt)){Pt(L,Nr(void 0));return}}else{if(Ua(pt))if(X.delete(L),T>ut){Pt(L,Nr(void 0));return}else return ne.add(L),Pt(L,ki(ye)),Ge(Le,pt,!1,{fetcherSubmission:ye,preventScrollReset:Ke});if(On(pt)){qe(L,V,pt.error);return}}let at=w.navigation.location||w.location,sn=ks(e.history,at,Xe.signal),Dr=f.activeRoutes,nr=w.navigation.state!=="idle"?dr(Dr,w.navigation.location,m,!1,f.branches):w.matches;Je(nr,"Didn't find any matches after fetcher action");let rr=++q;O.set(L,rr);let{dsMatches:vr,revalidatingFetchers:_n}=D0(sn,ce,l,d,e.history,w,nr,ye,at,s,!1,z,D,ae,ie,ne,Dr,m,e.patchRoutesOnNavigation!=null,f.branches,[tt.route.id,pt],De),Wr=ki(ye,pt.data),Wt=new Map(w.fetchers);Wt.set(L,Wr),_n.filter(bt=>bt.key!==L).forEach(bt=>{let Lr=bt.key,qa=Wt.get(Lr),eo=ki(void 0,qa?qa.data:void 0);Wt.set(Lr,eo),Ze(Lr),bt.controller&&X.set(Lr,bt.controller)}),Oe({fetchers:Wt});let Xa=()=>_n.forEach(bt=>Ze(bt.key));Xe.signal.addEventListener("abort",Xa);let{loaderResults:on,fetcherResults:Ja}=await ht(vr,_n,sn,at,ce);if(Xe.signal.aborted)return;Xe.signal.removeEventListener("abort",Xa),O.delete(L),X.delete(L),_n.forEach(bt=>X.delete(bt.key));let st=w.fetchers.has(L),ln=bt=>{if(!st)return bt;let Lr=new Map(bt.fetchers);return Lr.set(L,Nr(pt.data)),{...bt,fetchers:Lr}},gn=al(on);if(gn)return w=ln(w),Ge(sn,gn.result,!1,{preventScrollReset:Ke});if(gn=al(Ja),gn)return ne.add(gn.key),w=ln(w),Ge(sn,gn.result,!1,{preventScrollReset:Ke});let Sn=new Map(w.fetchers);st&&Sn.set(L,Nr(pt.data));let{loaderData:Kr,errors:Yr}=$0(w,nr,on,void 0,_n,Ja,Sn);Zt(rr,Sn),w.navigation.state==="loading"&&rr>T?(Je(R,"Expected pending action"),K&&K.abort(),dt(w.navigation.location,{matches:nr,loaderData:Kr,errors:Yr,fetchers:Sn})):(Oe({errors:Yr,loaderData:H0(w.loaderData,Kr,nr,Yr),fetchers:Sn}),z=!1)}async function Qe(L,V,Q,le,ce,_e,Fe,Ke,ye){let De=w.fetchers.get(L);Pt(L,ki(ye,De?De.data:void 0),{flushSync:Fe});let $e=new AbortController,Xe=ks(e.history,Q,$e.signal);if(_e){let pt=await kt(le,new URL(Xe.url).pathname,Xe.signal,L);if(pt.type==="aborted")return;if(pt.type==="error"){qe(L,V,pt.error,{flushSync:Fe});return}else if(pt.matches)le=pt.matches;else{qe(L,V,Xn(404,{pathname:Q}),{flushSync:Fe});return}}let Le=yl(le,Q);X.set(L,$e);let tt=q,ut=Rs(l,d,Xe,Q,le,Le,s,ce),Ot=await rt(Xe,Q,ut,ce,L),St=Ot[Le.route.id];if(!St){for(let pt of le)if(Ot[pt.route.id]){St=Ot[pt.route.id];break}}if(X.get(L)===$e&&X.delete(L),!Xe.signal.aborted){if(ae.has(L)){Pt(L,Nr(void 0));return}if(Ua(St))if(T>tt){Pt(L,Nr(void 0));return}else{ne.add(L),await Ge(Xe,St,!1,{preventScrollReset:Ke});return}if(On(St)){qe(L,V,St.error);return}Pt(L,Nr(St.data))}}async function Ge(L,V,Q,{submission:le,fetcherSubmission:ce,preventScrollReset:_e,replace:Fe}={}){Q||(E==null||E.resolve(),E=null),V.response.headers.has("X-Remix-Revalidate")&&(z=!0);let Ke=V.response.headers.get("Location");Je(Ke,"Expected a Location header on the redirect Response"),Ke=V0(Ke,new URL(L.url),m,e.history);let ye=Fi(w.location,Ke,{_isRedirect:!0});if(a){let ut=!1;if(V.response.headers.has("X-Remix-Reload-Document"))ut=!0;else if(qd(Ke)){const Ot=Ug(Ke,!0);ut=Ot.origin!==n.location.origin||er(Ot.pathname,m)==null}if(ut){Fe?n.location.replace(Ke):n.location.assign(Ke);return}}K=null;let De=Fe===!0||V.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:$e,formAction:Xe,formEncType:Le}=w.navigation;!le&&!ce&&$e&&Xe&&Le&&(le=Y0(w.navigation));let tt=le||ce;if(pb.has(V.response.status)&&tt&&hn(tt.formMethod))await Se(De,ye,{submission:{...tt,formAction:Ke},preventScrollReset:_e||Y,enableViewTransition:Q?I:void 0});else{let ut=$u(ye,[],De,le);await Se(De,ye,{overrideNavigation:ut,fetcherSubmission:ce,preventScrollReset:_e||Y,enableViewTransition:Q?I:void 0})}}async function rt(L,V,Q,le,ce){var Ke;let _e,Fe={};try{_e=await Cb(g,L,V,Q,ce,le,!1)}catch(ye){return Q.filter(De=>De.shouldLoad).forEach(De=>{Fe[De.route.id]={type:"error",error:ye}}),Fe}if(L.signal.aborted)return Fe;if(!hn(L.method))for(let ye of Q){if(((Ke=_e[ye.route.id])==null?void 0:Ke.type)==="error")break;!_e.hasOwnProperty(ye.route.id)&&!w.loaderData.hasOwnProperty(ye.route.id)&&(!w.errors||!w.errors.hasOwnProperty(ye.route.id))&&ye.shouldCallHandler()&&(_e[ye.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ye.route.id}`)})}for(let[ye,De]of Object.entries(_e))if(Db(De)){let $e=De.result;Fe[ye]={type:"redirect",response:Pb($e,L,ye,Q,m)}}else Fe[ye]=await Tb(De);return Fe}async function ht(L,V,Q,le,ce){let _e=rt(Q,le,L,ce,null),Fe=Promise.all(V.map(async De=>{if(De.matches&&De.match&&De.request&&De.controller){let Xe=(await rt(De.request,De.path,De.matches,ce,De.key))[De.match.route.id];return{[De.key]:Xe}}else return Promise.resolve({[De.key]:{type:"error",error:Xn(404,{pathname:De.path})}})})),Ke=await _e,ye=(await Fe).reduce((De,$e)=>Object.assign(De,$e),{});return{loaderResults:Ke,fetcherResults:ye}}function Qt(){z=!0,ie.forEach((L,V)=>{X.has(V)&&D.add(V),Ze(V)})}function Pt(L,V,Q={}){let le=new Map(w.fetchers);le.set(L,V),Oe({fetchers:le},{flushSync:(Q&&Q.flushSync)===!0})}function qe(L,V,Q,le={}){let ce=ga(w.matches,V),_e=new Map(w.fetchers);Mn(_e,L),Oe({errors:{[ce.route.id]:Q},fetchers:_e},{flushSync:(le&&le.flushSync)===!0})}function kn(L){return oe.set(L,(oe.get(L)||0)+1),ae.has(L)&&ae.delete(L),w.fetchers.get(L)||mb}function ft(L,V){Ze(L,V==null?void 0:V.reason),Pt(L,Nr(null))}function Mn(L,V){let Q=w.fetchers.get(V);X.has(V)&&!(Q&&Q.state==="loading"&&O.has(V))&&Ze(V),ie.delete(V),O.delete(V),ne.delete(V),ae.delete(V),D.delete(V),L.delete(V)}function Te(L){let V=(oe.get(L)||0)-1;V<=0?(oe.delete(L),ae.add(L)):oe.set(L,V),Oe({fetchers:new Map(w.fetchers)})}function Ze(L,V){let Q=X.get(L);Q&&(Q.abort(V),X.delete(L))}function ot(L,V){for(let Q of L){let le=V.get(Q);Je(le,`Expected fetcher: ${Q}`);let ce=Nr(le.data);V.set(Q,ce)}}function it(L){let V=[],Q=!1;for(let le of ne){let ce=L.get(le);Je(ce,`Expected fetcher: ${le}`),ce.state==="loading"&&(ne.delete(le),V.push(le),Q=!0)}return ot(V,L),Q}function Zt(L,V){let Q=[];for(let[le,ce]of O)if(ce0}function gt(L,V){let Q=w.blockers.get(L)||wi;return ue.get(L)!==V&&ue.set(L,V),Q}function yr(L){w.blockers.delete(L),ue.delete(L)}function an(L,V){let Q=w.blockers.get(L)||wi;Je(Q.state==="unblocked"&&V.state==="blocked"||Q.state==="blocked"&&V.state==="blocked"||Q.state==="blocked"&&V.state==="proceeding"||Q.state==="blocked"&&V.state==="unblocked"||Q.state==="proceeding"&&V.state==="unblocked",`Invalid blocker state transition: ${Q.state} -> ${V.state}`);let le=new Map(w.blockers);le.set(L,V),Oe({blockers:le})}function Vn({currentLocation:L,nextLocation:V,historyAction:Q}){if(ue.size===0)return;ue.size>1&&Ft(!1,"A router only supports one blocker at a time");let le=Array.from(ue.entries()),[ce,_e]=le[le.length-1],Fe=w.blockers.get(ce);if(!(Fe&&Fe.state==="proceeding")&&_e({currentLocation:L,nextLocation:V,historyAction:Q}))return ce}function Fr(L){let V=Xn(404,{pathname:L}),Q=f.activeRoutes,{matches:le,route:ce}=rl(Q);return{notFoundMatches:le,route:ce,error:V}}function Ye(L,V,Q){if(C=L,j=V,N=Q||null,!M&&w.navigation===Uu){M=!0;let le=$t(w.location,w.matches);le!=null&&Oe({restoreScrollPosition:le})}return()=>{C=null,j=null,N=null}}function Et(L,V){return N&&N(L,V.map(le=>Hg(le,w.loaderData)))||L.key}function Lt(L,V){if(C&&j){let Q=Et(L,V);C[Q]=j()}}function $t(L,V){if(C){let Q=Et(L,V),le=C[Q];if(typeof le=="number")return le}return null}function In(L,V,Q){if(e.patchRoutesOnNavigation){let le=f.branches;if(L){if(Object.keys(L[0].params).length>0)return{active:!0,matches:dr(V,Q,m,!0,le)}}else return{active:!0,matches:dr(V,Q,m,!0,le)||[]}}return{active:!1,matches:null}}async function kt(L,V,Q,le){if(!e.patchRoutesOnNavigation)return{type:"success",matches:L};let ce=L;for(;;){let _e=d;try{await e.patchRoutesOnNavigation({signal:Q,path:V,matches:ce,fetcherKey:le,patch:(De,$e)=>{Q.aborted||L0(De,$e,f,_e,l,!1)}})}catch(De){return{type:"error",error:De,partialMatches:ce}}if(Q.aborted)return{type:"aborted"};let Fe=f.branches,Ke=dr(f.activeRoutes,V,m,!1,Fe),ye=null;if(Ke){if(Object.keys(Ke[0].params).length===0)return{type:"success",matches:Ke};if(ye=dr(f.activeRoutes,V,m,!0,Fe),!(ye&&ce.lengthQ.route.id===V[le].route.id)}function xr(L){d={},f.setHmrRoutes(Di(L,l,void 0,d))}function Ht(L,V,Q=!1){L0(L,V,f,d,l,Q),f.hasHMRRoutes||Oe({})}return A={get basename(){return m},get future(){return y},get state(){return w},get routes(){return f.stableRoutes},get branches(){return f.branches},get manifest(){return d},get window(){return n},initialize:Ve,subscribe:Ue,enableScrollRestoration:Ye,navigate:xt,fetch:be,revalidate:vt,createHref:L=>e.history.createHref(L),encodeLocation:L=>e.history.encodeLocation(L),getFetcher:kn,resetFetcher:ft,deleteFetcher:Te,dispose:Ce,getBlocker:gt,deleteBlocker:yr,patchRoutes:Ht,_internalFetchControllers:X,_internalSetRoutes:xr,_internalSetStateDoNotUseOrYouWillBreakYourApp(L){Oe(L)}},e.instrumentations&&(A=ib(A,e.instrumentations.map(L=>L.router).filter(Boolean))),A}function vb(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function bd(e,n,a,s,o,l){let d,f;if(o){d=[];for(let g of n)if(d.push(g),g.route.id===o){f=g;break}}else d=n,f=n[n.length-1];let m=Ui(s||".",Wl(d),er(e.pathname,a)||e.pathname,l==="path");if(s==null&&(m.search=e.search,m.hash=e.hash),(s==null||s===""||s===".")&&f){let g=tf(m.search);if(f.route.index&&!g)m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index";else if(!f.route.index&&g){let y=new URLSearchParams(m.search),h=y.getAll("index");y.delete("index"),h.filter(k=>k).forEach(k=>y.append("index",k));let b=y.toString();m.search=b?`?${b}`:""}}return a!=="/"&&(m.pathname=eb({basename:a,pathname:m.pathname})),Mr(m)}function F0(e,n,a){if(!a||!vb(a))return{path:n};if(a.formMethod&&!Ob(a.formMethod))return{path:n,error:Xn(405,{method:a.formMethod})};let s=()=>({path:n,error:Xn(400,{type:"invalid-body"})}),l=(a.formMethod||"get").toUpperCase(),d=c1(n);if(a.body!==void 0){if(a.formEncType==="text/plain"){if(!hn(l))return s();let h=typeof a.body=="string"?a.body:a.body instanceof FormData||a.body instanceof URLSearchParams?Array.from(a.body.entries()).reduce((b,[k,C])=>`${b}${k}=${C} +`,""):String(a.body);return{path:n,submission:{formMethod:l,formAction:d,formEncType:a.formEncType,formData:void 0,json:void 0,text:h}}}else if(a.formEncType==="application/json"){if(!hn(l))return s();try{let h=typeof a.body=="string"?JSON.parse(a.body):a.body;return{path:n,submission:{formMethod:l,formAction:d,formEncType:a.formEncType,formData:void 0,json:h,text:void 0}}}catch{return s()}}}Je(typeof FormData=="function","FormData is not available in this environment");let f,m;if(a.formData)f=kd(a.formData),m=a.formData;else if(a.body instanceof FormData)f=kd(a.body),m=a.body;else if(a.body instanceof URLSearchParams)f=a.body,m=U0(f);else if(a.body==null)f=new URLSearchParams,m=new FormData;else try{f=new URLSearchParams(a.body),m=U0(f)}catch{return s()}let g={formMethod:l,formAction:d,formEncType:a&&a.formEncType||"application/x-www-form-urlencoded",formData:m,json:void 0,text:void 0};if(hn(g.formMethod))return{path:n,submission:g};let y=_r(n);return e&&y.search&&tf(y.search)&&f.append("index",""),y.search=`?${f}`,{path:Mr(y),submission:g}}function D0(e,n,a,s,o,l,d,f,m,g,y,h,b,k,C,N,j,M,P,F,U,W){var G;let J=U?On(U[1])?U[1].error:U[1].data:void 0,A=o.createURL(l.location),w=o.createURL(m),R;if(y&&l.errors){let z=Object.keys(l.errors)[0];R=d.findIndex(D=>D.route.id===z)}else if(U&&On(U[1])){let z=U[0];R=d.findIndex(D=>D.route.id===z)-1}let E=U?U[1].statusCode:void 0,Y=E&&E>=400,K={currentUrl:A,currentParams:((G=l.matches[0])==null?void 0:G.params)||{},nextUrl:w,nextParams:d[0].params,...f,actionResult:J,actionStatus:E},I=Hi(d),$=d.map((z,D)=>{let{route:X}=z,q=null;if(R!=null&&D>R)q=!1;else if(X.lazy)q=!0;else if(!Zd(X))q=!1;else if(y){let{shouldLoad:ie}=n1(X,l.loaderData,l.errors);q=ie}else bb(l.loaderData,l.matches[D],z)&&(q=!0);if(q!==null)return wd(a,s,e,m,I,z,g,n,q);let T=!1;typeof W=="boolean"?T=W:Y?T=!1:(h||A.pathname+A.search===w.pathname+w.search||A.search!==w.search||wb(l.matches[D],z))&&(T=!0);let O={...K,defaultShouldRevalidate:T},ne=Pi(z,O);return wd(a,s,e,m,I,z,g,n,ne,O,W)}),ee=[];return C.forEach((z,D)=>{if(y||!d.some(ae=>ae.route.id===z.routeId)||k.has(D))return;let X=l.fetchers.get(D),q=X&&X.state!=="idle"&&X.data===void 0,T=dr(j,z.path,M??"/",!1,F);if(!T){if(P&&q)return;ee.push({key:D,routeId:z.routeId,path:z.path,matches:null,match:null,request:null,controller:null});return}if(N.has(D))return;let O=yl(T,z.path),ne=new AbortController,ie=ks(o,z.path,ne.signal),oe=null;if(b.has(D))b.delete(D),oe=Rs(a,s,ie,z.path,T,O,g,n);else if(q)h&&(oe=Rs(a,s,ie,z.path,T,O,g,n));else{let ae;typeof W=="boolean"?ae=W:Y?ae=!1:ae=h;let ue={...K,defaultShouldRevalidate:ae};Pi(O,ue)&&(oe=Rs(a,s,ie,z.path,T,O,g,n,ue))}oe&&ee.push({key:D,routeId:z.routeId,path:z.path,matches:oe,match:O,request:ie,controller:ne})}),{dsMatches:$,revalidatingFetchers:ee}}function Zd(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function n1(e,n,a){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Zd(e))return{shouldLoad:!1,renderFallback:!1};let s=n!=null&&e.id in n,o=a!=null&&a[e.id]!==void 0;if(!s&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!s};let l=!s&&!o;return{shouldLoad:l,renderFallback:l}}function bb(e,n,a){let s=!n||a.route.id!==n.route.id,o=!e.hasOwnProperty(a.route.id);return s||o}function wb(e,n){let a=e.route.path;return e.pathname!==n.pathname||a!=null&&a.endsWith("*")&&e.params["*"]!==n.params["*"]}function Pi(e,n){if(e.route.shouldRevalidate){let a=e.route.shouldRevalidate(n);if(typeof a=="boolean")return a}return n.defaultShouldRevalidate}function L0(e,n,a,s,o,l){let d;if(e){let g=s[e];Je(g,`No route found to patch children into: routeId = ${e}`),g.children||(g.children=[]),d=g.children}else d=a.activeRoutes;let f=[],m=[];if(n.forEach(g=>{let y=d.find(h=>r1(g,h));y?m.push({existingRoute:y,newRoute:g}):f.push(g)}),f.length>0){let g=Di(f,o,[e||"_","patch",String((d==null?void 0:d.length)||"0")],s);d.push(...g)}if(l&&m.length>0)for(let g=0;g{var l;return(l=n.children)==null?void 0:l.some(d=>r1(s,d))}))??!1:!1}var A0=new WeakMap,a1=({key:e,route:n,manifest:a,mapRouteProperties:s})=>{let o=a[n.id];if(Je(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let l=o.lazy[e];if(!l)return;let d=A0.get(o);d||(d={},A0.set(o,d));let f=d[e];if(f)return f;let m=(async()=>{let g=Ov(e),h=o[e]!==void 0&&e!=="hasErrorBoundary";if(g)Ft(!g,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),d[e]=Promise.resolve();else if(h)Ft(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let b=await l();b!=null&&(Object.assign(o,{[e]:b}),Object.assign(o,s(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(b=>b===void 0)&&(o.lazy=void 0))})();return d[e]=m,m},O0=new WeakMap;function kb(e,n,a,s,o){let l=a[e.id];if(Je(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let y=O0.get(l);if(y)return{lazyRoutePromise:y,lazyHandlerPromise:y};let h=(async()=>{Je(typeof e.lazy=="function","No lazy route function found");let b=await e.lazy(),k={};for(let C in b){let N=b[C];if(N===void 0)continue;let j=zv(C),P=l[C]!==void 0&&C!=="hasErrorBoundary";j?Ft(!j,"Route property "+C+" is not a supported property to be returned from a lazy route function. This property will be ignored."):P?Ft(!P,`Route "${l.id}" has a static property "${C}" defined but its lazy function is also returning a value for this property. The lazy route property "${C}" will be ignored.`):k[C]=N}Object.assign(l,k),Object.assign(l,{...s(l),lazy:void 0})})();return O0.set(l,h),h.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:h}}let d=Object.keys(e.lazy),f=[],m;for(let y of d){if(o&&o.includes(y))continue;let h=a1({key:y,route:e,manifest:a,mapRouteProperties:s});h&&(f.push(h),y===n&&(m=h))}let g=f.length>0?Promise.all(f).then(()=>{}):void 0;return g==null||g.catch(()=>{}),m==null||m.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:m}}async function B0(e){let n=e.matches.filter(o=>o.shouldLoad),a={};return(await Promise.all(n.map(o=>o.resolve()))).forEach((o,l)=>{a[n[l].route.id]=o}),a}async function Sb(e){return e.matches.some(n=>n.route.middleware)?s1(e,()=>B0(e)):B0(e)}function s1(e,n){return jb(e,n,s=>{if(Ab(s))throw s;return s},_b,a);function a(s,o,l){if(l)return Promise.resolve(Object.assign(l.value,{[o]:{type:"error",result:s}}));{let{matches:d}=e,f=Math.min(Math.max(d.findIndex(g=>g.route.id===o),0),Math.max(d.findIndex(g=>g.shouldCallHandler()),0)),m=ga(d,d[f].route.id).route.id;return Promise.resolve({[m]:{type:"error",result:s}})}}}async function jb(e,n,a,s,o){let{matches:l,...d}=e,f=l.flatMap(g=>g.route.middleware?g.route.middleware.map(y=>[g.route.id,y]):[]);return await i1(d,f,n,a,s,o)}async function i1(e,n,a,s,o,l,d=0){let{request:f}=e;if(f.signal.aborted)throw f.signal.reason??new Error(`Request aborted: ${f.method} ${f.url}`);let m=n[d];if(!m)return await a();let[g,y]=m,h,b=async()=>{if(h)throw new Error("You may only call `next()` once per middleware");try{return h={value:await i1(e,n,a,s,o,l,d+1)},h.value}catch(k){return h={value:await l(k,g,h)},h.value}};try{let k=await y(e,b),C=k!=null?s(k):void 0;return o(C)?C:h?C??h.value:(h={value:await b()},h.value)}catch(k){return await l(k,g,h)}}function o1(e,n,a,s,o){let l=a1({key:"middleware",route:s.route,manifest:n,mapRouteProperties:e}),d=kb(s.route,hn(a.method)?"action":"loader",n,e,o);return{middleware:l,route:d.lazyRoutePromise,handler:d.lazyHandlerPromise}}function wd(e,n,a,s,o,l,d,f,m,g=null,y){let h=!1,b=o1(e,n,a,l,d);return{...l,_lazyPromises:b,shouldLoad:m,shouldRevalidateArgs:g,shouldCallHandler(k){return h=!0,g?typeof y=="boolean"?Pi(l,{...g,defaultShouldRevalidate:y}):typeof k=="boolean"?Pi(l,{...g,defaultShouldRevalidate:k}):Pi(l,g):m},resolve(k){let{lazy:C,loader:N,middleware:j}=l.route,M=h||m||k&&!hn(a.method)&&(C||N),P=j&&j.length>0&&!N&&!C;return M&&(hn(a.method)||!P)?Nb({request:a,path:s,pattern:o,match:l,lazyHandlerPromise:b==null?void 0:b.handler,lazyRoutePromise:b==null?void 0:b.route,handlerOverride:k,scopedContext:f}):Promise.resolve({type:"data",result:void 0})}}}function Rs(e,n,a,s,o,l,d,f,m=null){return o.map(g=>g.route.id!==l.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:m,shouldCallHandler:()=>!1,_lazyPromises:o1(e,n,a,g,d),resolve:()=>Promise.resolve({type:"data",result:void 0})}:wd(e,n,a,s,Hi(o),g,d,f,!0,m))}async function Cb(e,n,a,s,o,l,d){s.some(y=>{var h;return(h=y._lazyPromises)==null?void 0:h.middleware})&&await Promise.all(s.map(y=>{var h;return(h=y._lazyPromises)==null?void 0:h.middleware}));let f={request:n,url:l1(n,a),pattern:Hi(s),params:s[0].params,context:l,matches:s},g=await e({...f,fetcherKey:o,runClientMiddleware:y=>{let h=f;return s1(h,()=>y({...h,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(y=>{var h,b;return[(h=y._lazyPromises)==null?void 0:h.handler,(b=y._lazyPromises)==null?void 0:b.route]}))}catch{}return g}async function Nb({request:e,path:n,pattern:a,match:s,lazyHandlerPromise:o,lazyRoutePromise:l,handlerOverride:d,scopedContext:f}){let m,g,y=hn(e.method),h=y?"action":"loader",b=k=>{let C,N=new Promise((P,F)=>C=F);g=()=>C(),e.signal.addEventListener("abort",g);let j=P=>typeof k!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${s.route.id}]`)):k({request:e,url:l1(e,n),pattern:a,params:s.params,context:f},...P!==void 0?[P]:[]),M=(async()=>{try{return{type:"data",result:await(d?d(F=>j(F)):j())}}catch(P){return{type:"error",result:P}}})();return Promise.race([M,N])};try{let k=y?s.route.action:s.route.loader;if(o||l)if(k){let C,[N]=await Promise.all([b(k).catch(j=>{C=j}),o,l]);if(C!==void 0)throw C;m=N}else{await o;let C=y?s.route.action:s.route.loader;if(C)[m]=await Promise.all([b(C),l]);else if(h==="action"){let N=new URL(e.url),j=N.pathname+N.search;throw Xn(405,{method:e.method,pathname:j,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(k)m=await b(k);else{let C=new URL(e.url),N=C.pathname+C.search;throw Xn(404,{pathname:N})}}catch(k){return{type:"error",result:k}}finally{g&&e.signal.removeEventListener("abort",g)}return m}async function Eb(e){let n=e.headers.get("Content-Type");return n&&/\bapplication\/json\b/.test(n)?e.body==null?null:e.json():e.text()}async function Tb(e){var s,o,l,d,f;let{result:n,type:a}=e;if(ef(n)){let m;try{m=await Eb(n)}catch(g){return{type:"error",error:g}}return a==="error"?{type:"error",error:new $i(n.status,n.statusText,m),statusCode:n.status,headers:n.headers}:{type:"data",data:m,statusCode:n.status,headers:n.headers}}return a==="error"?K0(n)?n.data instanceof Error?{type:"error",error:n.data,statusCode:(s=n.init)==null?void 0:s.status,headers:(o=n.init)!=null&&o.headers?new Headers(n.init.headers):void 0}:{type:"error",error:Ib(n),statusCode:Li(n)?n.status:void 0,headers:(l=n.init)!=null&&l.headers?new Headers(n.init.headers):void 0}:{type:"error",error:n,statusCode:Li(n)?n.status:void 0}:K0(n)?{type:"data",data:n.data,statusCode:(d=n.init)==null?void 0:d.status,headers:(f=n.init)!=null&&f.headers?new Headers(n.init.headers):void 0}:{type:"data",data:n}}function Pb(e,n,a,s,o){let l=e.headers.get("Location");if(Je(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!qd(l)){let d=s.slice(0,s.findIndex(f=>f.route.id===a)+1);l=bd(new URL(n.url),d,o,l),e.headers.set("Location",l)}return e}var z0=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function V0(e,n,a,s){if(qd(e)){let o=e,l=o.startsWith("//")?new URL(n.protocol+o):new URL(o);if(z0.includes(l.protocol))throw new Error("Invalid redirect location");let d=er(l.pathname,a)!=null;if(l.origin===n.origin&&d)return Qd(l.pathname)+l.search+l.hash}try{let o=s.createURL(e);if(z0.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function ks(e,n,a,s){let o=e.createURL(c1(n)).toString(),l={signal:a};if(s&&hn(s.formMethod)){let{formMethod:d,formEncType:f}=s;l.method=d.toUpperCase(),f==="application/json"?(l.headers=new Headers({"Content-Type":f}),l.body=JSON.stringify(s.json)):f==="text/plain"?l.body=s.text:f==="application/x-www-form-urlencoded"&&s.formData?l.body=kd(s.formData):l.body=s.formData}return new Request(o,l)}function l1(e,n){let a=new URL(e.url),s=typeof n=="string"?_r(n):n;if(a.pathname=s.pathname||"/",s.search){let o=new URLSearchParams(s.search),l=o.getAll("index");o.delete("index");for(let d of l.filter(Boolean))o.append("index",d);a.search=o.size?`?${o.toString()}`:""}else a.search="";return a.hash=s.hash||"",a}function kd(e){let n=new URLSearchParams;for(let[a,s]of e.entries())n.append(a,typeof s=="string"?s:s.name);return n}function U0(e){let n=new FormData;for(let[a,s]of e.entries())n.append(a,s);return n}function Rb(e,n,a,s=!1,o=!1){let l={},d=null,f,m=!1,g={},y=a&&On(a[1])?a[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in n))return;let b=h.route.id,k=n[b];if(Je(!Ua(k),"Cannot handle redirect results in processLoaderData"),On(k)){let C=k.error;if(y!==void 0&&(C=y,y=void 0),d=d||{},o)d[b]=C;else{let N=ga(e,b);d[N.route.id]==null&&(d[N.route.id]=C)}s||(l[b]=t1),m||(m=!0,f=Li(k.error)?k.error.status:500),k.headers&&(g[b]=k.headers)}else l[b]=k.data,k.statusCode&&k.statusCode!==200&&!m&&(f=k.statusCode),k.headers&&(g[b]=k.headers)}),y!==void 0&&a&&(d={[a[0]]:y},a[2]&&(l[a[2]]=void 0)),{loaderData:l,errors:d,statusCode:f||200,loaderHeaders:g}}function $0(e,n,a,s,o,l,d){let{loaderData:f,errors:m}=Rb(n,a,s);return o.filter(g=>!g.matches||g.matches.some(y=>y.shouldLoad)).forEach(g=>{let{key:y,match:h,controller:b}=g;if(b&&b.signal.aborted)return;let k=l[y];if(Je(k,"Did not find corresponding fetcher result"),On(k)){let C=ga(e.matches,h==null?void 0:h.route.id);m&&m[C.route.id]||(m={...m,[C.route.id]:k.error}),d.delete(y)}else if(Ua(k))Je(!1,"Unhandled fetcher revalidation redirect");else{let C=Nr(k.data);d.set(y,C)}}),{loaderData:f,errors:m}}function H0(e,n,a,s){let o=Object.entries(n).filter(([,l])=>l!==t1).reduce((l,[d,f])=>(l[d]=f,l),{});for(let l of a){let d=l.route.id;if(!n.hasOwnProperty(d)&&e.hasOwnProperty(d)&&l.route.loader&&(o[d]=e[d]),s&&s.hasOwnProperty(d))break}return o}function W0(e){return e?On(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ga(e,n){return(n?e.slice(0,e.findIndex(s=>s.route.id===n)+1):[...e]).reverse().find(s=>s.route.hasErrorBoundary===!0)||e[0]}function rl(e){let n=e.length===1?e[0]:e.find(a=>a.index||!a.path||a.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:n}],route:n}}function Xn(e,{pathname:n,routeId:a,method:s,type:o,message:l}={}){let d="Unknown Server Error",f="Unknown @remix-run/router error";return e===400?(d="Bad Request",s&&n&&a?f=`You made a ${s} request to "${n}" but did not provide a \`loader\` for route "${a}", so there is no way to handle the request.`:o==="invalid-body"&&(f="Unable to encode submission body")):e===403?(d="Forbidden",f=`Route "${a}" does not match URL "${n}"`):e===404?(d="Not Found",f=`No route matches URL "${n}"`):e===405&&(d="Method Not Allowed",s&&n&&a?f=`You made a ${s.toUpperCase()} request to "${n}" but did not provide an \`action\` for route "${a}", so there is no way to handle the request.`:s&&(f=`Invalid request method "${s.toUpperCase()}"`)),new $i(e||500,d,new Error(f),!0)}function al(e){let n=Object.entries(e);for(let a=n.length-1;a>=0;a--){let[s,o]=n[a];if(Ua(o))return{key:s,result:o}}}function c1(e){let n=typeof e=="string"?_r(e):e;return Mr({...n,hash:""})}function Mb(e,n){return e.pathname!==n.pathname||e.search!==n.search?!1:e.hash===""?n.hash!=="":e.hash===n.hash?!0:n.hash!==""}function Ib(e){var n,a;return new $i(((n=e.init)==null?void 0:n.status)??500,((a=e.init)==null?void 0:a.statusText)??"Internal Server Error",e.data)}function _b(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([n,a])=>typeof n=="string"&&Fb(a))}function Fb(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function Db(e){return ef(e.result)&&Zg.has(e.result.status)}function On(e){return e.type==="error"}function Ua(e){return(e&&e.type)==="redirect"}function K0(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function ef(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Lb(e){return Zg.has(e)}function Ab(e){return ef(e)&&Lb(e.status)&&e.headers.has("Location")}function Ob(e){return hb.has(e.toUpperCase())}function hn(e){return db.has(e.toUpperCase())}function tf(e){return new URLSearchParams(e).getAll("index").some(n=>n==="")}function yl(e,n){let a=typeof n=="string"?_r(n).search:n.search;if(e[e.length-1].route.index&&tf(a||""))return e[e.length-1];let s=Gg(e);return s[s.length-1]}function Y0(e){let{formMethod:n,formAction:a,formEncType:s,text:o,formData:l,json:d}=e;if(!(!n||!a||!s)){if(o!=null)return{formMethod:n,formAction:a,formEncType:s,formData:void 0,json:void 0,text:o};if(l!=null)return{formMethod:n,formAction:a,formEncType:s,formData:l,json:void 0,text:void 0};if(d!==void 0)return{formMethod:n,formAction:a,formEncType:s,formData:void 0,json:d,text:void 0}}}function $u(e,n,a,s){return s?{state:"loading",location:e,matches:n,historyAction:a,formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}:{state:"loading",location:e,matches:n,historyAction:a,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Bb(e,n,a,s){return{state:"submitting",location:e,matches:n,historyAction:a,formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}}function ki(e,n){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:n}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function zb(e,n){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:n?n.data:void 0}}function Nr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Vb(e,n){try{let a=e.sessionStorage.getItem(e1);if(a){let s=JSON.parse(a);for(let[o,l]of Object.entries(s||{}))l&&Array.isArray(l)&&n.set(o,new Set(l||[]))}}catch{}}function Ub(e,n){if(n.size>0){let a={};for(let[s,o]of n)a[s]=[...o];try{e.sessionStorage.setItem(e1,JSON.stringify(a))}catch(s){Ft(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function G0(){let e,n,a=new Promise((s,o)=>{e=async l=>{s(l);try{await a}catch{}},n=async l=>{o(l);try{await a}catch{}}});return{promise:a,resolve:e,reject:n}}var Ya=v.createContext(null);Ya.displayName="DataRouter";var Wi=v.createContext(null);Wi.displayName="DataRouterState";var u1=v.createContext(!1);function d1(){return v.useContext(u1)}var nf=v.createContext({isTransitioning:!1});nf.displayName="ViewTransition";var f1=v.createContext(new Map);f1.displayName="Fetchers";var $b=v.createContext(null);$b.displayName="Await";var zn=v.createContext(null);zn.displayName="Navigation";var Kl=v.createContext(null);Kl.displayName="Location";var tr=v.createContext({outlet:null,matches:[],isDataRoute:!1});tr.displayName="Route";var rf=v.createContext(null);rf.displayName="RouteError";var h1="REACT_ROUTER_ERROR",Hb="REDIRECT",Wb="ROUTE_ERROR_RESPONSE";function Kb(e){if(e.startsWith(`${h1}:${Hb}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function Yb(e){if(e.startsWith(`${h1}:${Wb}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new $i(n.status,n.statusText,n.data)}catch{}}function Gb(e,{relative:n}={}){Je(As(),"useHref() may be used only in the context of a component.");let{basename:a,navigator:s}=v.useContext(zn),{hash:o,pathname:l,search:d}=Ki(e,{relative:n}),f=l;return a!=="/"&&(f=l==="/"?a:Qn([a,l])),s.createHref({pathname:f,search:d,hash:o})}function As(){return v.useContext(Kl)!=null}function Ut(){return Je(As(),"useLocation() may be used only in the context of a component."),v.useContext(Kl).location}var p1="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function m1(e){v.useContext(zn).static||v.useLayoutEffect(e)}function mn(){let{isDataRoute:e}=v.useContext(tr);return e?c5():Xb()}function Xb(){Je(As(),"useNavigate() may be used only in the context of a component.");let e=v.useContext(Ya),{basename:n,navigator:a}=v.useContext(zn),{matches:s}=v.useContext(tr),{pathname:o}=Ut(),l=JSON.stringify(Wl(s)),d=v.useRef(!1);return m1(()=>{d.current=!0}),v.useCallback((m,g={})=>{if(Ft(d.current,p1),!d.current)return;if(typeof m=="number"){a.go(m);return}let y=Ui(m,JSON.parse(l),o,g.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:Qn([n,y.pathname])),(g.replace?a.replace:a.push)(y,g.state,g)},[n,a,l,o,e])}var Jb=v.createContext(null);function qb(e){let n=v.useContext(tr).outlet;return v.useMemo(()=>n&&v.createElement(Jb.Provider,{value:e},n),[n,e])}function Yl(){let{matches:e}=v.useContext(tr),n=e[e.length-1];return(n==null?void 0:n.params)??{}}function Ki(e,{relative:n}={}){let{matches:a}=v.useContext(tr),{pathname:s}=Ut(),o=JSON.stringify(Wl(a));return v.useMemo(()=>Ui(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function Qb(e,n,a){Je(As(),"useRoutes() may be used only in the context of a component.");let{navigator:s}=v.useContext(zn),{matches:o}=v.useContext(tr),l=o[o.length-1],d=l?l.params:{},f=l?l.pathname:"/",m=l?l.pathnameBase:"/",g=l&&l.route;{let j=g&&g.path||"";x1(f,!g||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${f}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + +Please change the parent to .`)}let y=Ut(),h;h=y;let b=h.pathname||"/",k=b;if(m!=="/"){let j=m.replace(/^\//,"").split("/");k="/"+b.replace(/^\//,"").split("/").slice(j.length).join("/")}let C=a&&a.state.matches.length?a.state.matches.map(j=>Object.assign(j,{route:a.manifest[j.route.id]||j.route})):$g(e,{pathname:k});return Ft(g||C!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Ft(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`),r5(C&&C.map(j=>Object.assign({},j,{params:Object.assign({},d,j.params),pathname:Qn([m,s.encodeLocation?s.encodeLocation(j.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?m:Qn([m,s.encodeLocation?s.encodeLocation(j.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),o,a)}function Zb(){let e=l5(),n=Li(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},l={padding:"2px 4px",backgroundColor:s},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:l},"ErrorBoundary")," or"," ",v.createElement("code",{style:l},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},n),a?v.createElement("pre",{style:o},a):null,d)}var e5=v.createElement(Zb,null),g1=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=Yb(e.digest);a&&(e=a)}let n=e!==void 0?v.createElement(tr.Provider,{value:this.props.routeContext},v.createElement(rf.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(t5,{error:e},n):n}};g1.contextType=u1;var Hu=new WeakMap;function t5({children:e,error:n}){let{basename:a}=v.useContext(zn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let s=Kb(n.digest);if(s){let o=Hu.get(n);if(o)throw o;let l=Jg(s.location,a);if(Xg&&!Hu.get(n))if(l.isExternal||s.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:s.replace}));throw Hu.set(n,d),d}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function n5({routeContext:e,match:n,children:a}){let s=v.useContext(Ya);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(tr.Provider,{value:e},a)}function r5(e,n=[],a){let s=a==null?void 0:a.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(n.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let o=e,l=s==null?void 0:s.errors;if(l!=null){let y=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);Je(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,y+1))}let d=!1,f=-1;if(a&&s){d=s.renderFallback;for(let y=0;y=0?o=o.slice(0,f+1):o=[o[0]];break}}}}let m=a==null?void 0:a.onError,g=s&&m?(y,h)=>{var b,k;m(y,{location:s.location,params:((k=(b=s.matches)==null?void 0:b[0])==null?void 0:k.params)??{},pattern:Hi(s.matches),errorInfo:h})}:void 0;return o.reduceRight((y,h,b)=>{let k,C=!1,N=null,j=null;s&&(k=l&&h.route.id?l[h.route.id]:void 0,N=h.route.errorElement||e5,d&&(f<0&&b===0?(x1("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,j=null):f===b&&(C=!0,j=h.route.hydrateFallbackElement||null)));let M=n.concat(o.slice(0,b+1)),P=()=>{let F;return k?F=N:C?F=j:h.route.Component?F=v.createElement(h.route.Component,null):h.route.element?F=h.route.element:F=y,v.createElement(n5,{match:h,routeContext:{outlet:y,matches:M,isDataRoute:s!=null},children:F})};return s&&(h.route.ErrorBoundary||h.route.errorElement||b===0)?v.createElement(g1,{location:s.location,revalidation:s.revalidation,component:N,error:k,children:P(),routeContext:{outlet:null,matches:M,isDataRoute:!0},onError:g}):P()},null)}function af(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function a5(e){let n=v.useContext(Ya);return Je(n,af(e)),n}function y1(e){let n=v.useContext(Wi);return Je(n,af(e)),n}function s5(e){let n=v.useContext(tr);return Je(n,af(e)),n}function sf(e){let n=s5(e),a=n.matches[n.matches.length-1];return Je(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function i5(){return sf("useRouteId")}function o5(){let{matches:e,loaderData:n}=y1("useMatches");return v.useMemo(()=>e.map(a=>Hg(a,n)),[e,n])}function l5(){var s;let e=v.useContext(rf),n=y1("useRouteError"),a=sf("useRouteError");return e!==void 0?e:(s=n.errors)==null?void 0:s[a]}function c5(){let{router:e}=a5("useNavigate"),n=sf("useNavigate"),a=v.useRef(!1);return m1(()=>{a.current=!0}),v.useCallback(async(o,l={})=>{Ft(a.current,p1),a.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...l}))},[e,n])}var X0={};function x1(e,n,a){!n&&!X0[e]&&(X0[e]=!0,Ft(!1,a))}var J0={};function q0(e,n){!e&&!J0[n]&&(J0[n]=!0,console.warn(n))}var u5="useOptimistic",Q0=_v[u5],d5=()=>{};function f5(e){return Q0?Q0(e):[e,d5]}function h5(e){let n={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Ft(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Ft(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Ft(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),n}var p5=["HydrateFallback","hydrateFallbackElement"],m5=class{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=a=>{this.status==="pending"&&(this.status="resolved",e(a))},this.reject=a=>{this.status==="pending"&&(this.status="rejected",n(a))}})}};function g5({router:e,flushSync:n,onError:a,useTransitions:s}){s=d1()||s;let[l,d]=v.useState(e.state),[f,m]=f5(l),[g,y]=v.useState(),[h,b]=v.useState({isTransitioning:!1}),[k,C]=v.useState(),[N,j]=v.useState(),[M,P]=v.useState(),F=v.useRef(new Map),U=v.useCallback((w,{deletedFetchers:R,newErrors:E,flushSync:Y,viewTransitionOpts:K})=>{E&&a&&Object.values(E).forEach($=>{var ee;return a($,{location:w.location,params:((ee=w.matches[0])==null?void 0:ee.params)??{},pattern:Hi(w.matches)})}),w.fetchers.forEach(($,ee)=>{$.data!==void 0&&F.current.set(ee,$.data)}),R.forEach($=>F.current.delete($)),q0(Y===!1||n!=null,'You provided the `flushSync` option to a router update, but you are not using the `` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let I=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(q0(K==null||I,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!K||!I){n&&Y?n(()=>d(w)):s===!1?d(w):v.startTransition(()=>{s===!0&&m($=>Z0($,w)),d(w)});return}if(n&&Y){n(()=>{N&&(k==null||k.resolve(),N.skipTransition()),b({isTransitioning:!0,flushSync:!0,currentLocation:K.currentLocation,nextLocation:K.nextLocation})});let $=e.window.document.startViewTransition(()=>{n(()=>d(w))});$.finished.finally(()=>{n(()=>{C(void 0),j(void 0),y(void 0),b({isTransitioning:!1})})}),n(()=>j($));return}N?(k==null||k.resolve(),N.skipTransition(),P({state:w,currentLocation:K.currentLocation,nextLocation:K.nextLocation})):(y(w),b({isTransitioning:!0,flushSync:!1,currentLocation:K.currentLocation,nextLocation:K.nextLocation}))},[e.window,n,N,k,s,m,a]);v.useLayoutEffect(()=>e.subscribe(U),[e,U]),v.useEffect(()=>{h.isTransitioning&&!h.flushSync&&C(new m5)},[h]),v.useEffect(()=>{if(k&&g&&e.window){let w=g,R=k.promise,E=e.window.document.startViewTransition(async()=>{s===!1?d(w):v.startTransition(()=>{s===!0&&m(Y=>Z0(Y,w)),d(w)}),await R});E.finished.finally(()=>{C(void 0),j(void 0),y(void 0),b({isTransitioning:!1})}),j(E)}},[g,k,e.window,s,m]),v.useEffect(()=>{k&&g&&f.location.key===g.location.key&&k.resolve()},[k,N,f.location,g]),v.useEffect(()=>{!h.isTransitioning&&M&&(y(M.state),b({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}),P(void 0))},[h.isTransitioning,M]);let W=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:w=>e.navigate(w),push:(w,R,E)=>e.navigate(w,{state:R,preventScrollReset:E==null?void 0:E.preventScrollReset}),replace:(w,R,E)=>e.navigate(w,{replace:!0,state:R,preventScrollReset:E==null?void 0:E.preventScrollReset})}),[e]),J=e.basename||"/",A=v.useMemo(()=>({router:e,navigator:W,static:!1,basename:J,onError:a}),[e,W,J,a]);return v.createElement(v.Fragment,null,v.createElement(Ya.Provider,{value:A},v.createElement(Wi.Provider,{value:f},v.createElement(f1.Provider,{value:F.current},v.createElement(nf.Provider,{value:h},v.createElement(v5,{basename:J,location:f.location,navigationType:f.historyAction,navigator:W,useTransitions:s},v.createElement(y5,{routes:e.routes,manifest:e.manifest,future:e.future,state:f,isStatic:!1,onError:a})))))),null)}function Z0(e,n){return{...e,navigation:n.navigation.state!=="idle"?n.navigation:e.navigation,revalidation:n.revalidation!=="idle"?n.revalidation:e.revalidation,actionData:n.navigation.state!=="submitting"?n.actionData:e.actionData,fetchers:n.fetchers}}var y5=v.memo(x5);function x5({routes:e,manifest:n,future:a,state:s,isStatic:o,onError:l}){return Qb(e,void 0,{manifest:n,state:s,isStatic:o,onError:l})}function v1({to:e,replace:n,state:a,relative:s}){Je(As()," may be used only in the context of a component.");let{static:o}=v.useContext(zn);Ft(!o," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:l}=v.useContext(tr),{pathname:d}=Ut(),f=mn(),m=Ui(e,Wl(l),d,s==="path"),g=JSON.stringify(m);return v.useEffect(()=>{f(JSON.parse(g),{replace:n,state:a,relative:s})},[f,g,s,n,a]),null}function v5({basename:e="/",children:n=null,location:a,navigationType:s="POP",navigator:o,static:l=!1,useTransitions:d}){Je(!As(),"You cannot render a inside another . You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=v.useMemo(()=>({basename:f,navigator:o,static:l,useTransitions:d,future:{}}),[f,o,l,d]);typeof a=="string"&&(a=_r(a));let{pathname:g="/",search:y="",hash:h="",state:b=null,key:k="default",mask:C}=a,N=v.useMemo(()=>{let j=er(g,f);return j==null?null:{location:{pathname:j,search:y,hash:h,state:b,key:k,mask:C},navigationType:s}},[f,g,y,h,b,k,s,C]);return Ft(N!=null,` is not able to match the URL "${g}${y}${h}" because it does not start with the basename, so the won't render anything.`),N==null?null:v.createElement(zn.Provider,{value:m},v.createElement(Kl.Provider,{children:n,value:N}))}var xl="get",vl="application/x-www-form-urlencoded";function Gl(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function b5(e){return Gl(e)&&e.tagName.toLowerCase()==="button"}function w5(e){return Gl(e)&&e.tagName.toLowerCase()==="form"}function k5(e){return Gl(e)&&e.tagName.toLowerCase()==="input"}function S5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function j5(e,n){return e.button===0&&(!n||n==="_self")&&!S5(e)}function Sd(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((n,a)=>{let s=e[a];return n.concat(Array.isArray(s)?s.map(o=>[a,o]):[[a,s]])},[]))}function C5(e,n){let a=Sd(e);return n&&n.forEach((s,o)=>{a.has(o)||n.getAll(o).forEach(l=>{a.append(o,l)})}),a}var sl=null;function N5(){if(sl===null)try{new FormData(document.createElement("form"),0),sl=!1}catch{sl=!0}return sl}var E5=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Wu(e){return e!=null&&!E5.has(e)?(Ft(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${vl}"`),null):e}function T5(e,n){let a,s,o,l,d;if(w5(e)){let f=e.getAttribute("action");s=f?er(f,n):null,a=e.getAttribute("method")||xl,o=Wu(e.getAttribute("enctype"))||vl,l=new FormData(e)}else if(b5(e)||k5(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a + )} ); } diff --git a/src/app/components/LoginPage.tsx b/src/app/components/LoginPage.tsx index 54652bb..32aafdd 100644 --- a/src/app/components/LoginPage.tsx +++ b/src/app/components/LoginPage.tsx @@ -15,6 +15,13 @@ const PERSIAN_NUMBERS = ["۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", " const ARABIC_NUMBERS = ["٠", "١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩"] as const; const CODE_LENGTH = 5; +const loadingDotTransition = { + duration: 0.6, + repeat: Infinity, + repeatType: "mirror" as const, + ease: "easeInOut" as const, +}; + export function LoginPage() { const navigate = useNavigate(); const location = useLocation(); @@ -385,6 +392,7 @@ export function LoginPage() { id="phone" type="tel" inputMode="numeric" + autoFocus={step === "phone"} value={toPersianNumber(phoneNumber)} onChange={(e) => setPhoneNumber(normalizeNumber(e.target.value))} className="w-full bg-transparent text-left text-lg text-white outline-none placeholder:text-lg placeholder:text-white/45" @@ -447,6 +455,7 @@ export function LoginPage() { }} className="h-13 w-13 rounded-xl border border-[#d680ff66] bg-[#2f1b59]/85 text-center text-2xl text-white outline-none" ref={index === 0 ? firstInputRef : undefined} + autoFocus={step === "code" && index === 0} /> ))} @@ -478,7 +487,38 @@ export function LoginPage() { boxShadow: "0 10px 26px rgba(196, 87, 255, 0.35), inset 0 1px 0 rgba(255,255,255,0.35)", }} > - {isLoading ? "در حال پردازش..." : step === "phone" ? "دریافت کد تایید" : "تایید و ورود"} + {isLoading ? ( + + در حال پردازش + + + ) : step === "phone" ? ( + "دریافت کد تایید" + ) : ( + "تایید و ورود" + )} diff --git a/src/app/components/PublicChatPage.tsx b/src/app/components/PublicChatPage.tsx index e6e1cdf..2134886 100644 --- a/src/app/components/PublicChatPage.tsx +++ b/src/app/components/PublicChatPage.tsx @@ -1,11 +1,7 @@ -import { useState, useRef, useEffect } from "react"; -import { useNavigate } from "react-router-dom"; -import { BottomNav } from "./BottomNav"; -import { ChatHeader } from "./public-chat/ChatHeader"; +import { useState, useRef, useEffect, useCallback } from "react"; import { ChatMessages, ChatMessage } from "./public-chat/ChatMessages"; -import { ChatInput } from "./public-chat/ChatInput"; +import { ChatInputBar } from "./chatbot/ChatInputBar"; import { ChatHistoryModal } from "./public-chat/ChatHistoryModal"; -import { AppBackground } from "./shared/AppBackground"; import { loadChatList, loadChat, @@ -14,14 +10,13 @@ import { PublicChatMessage, } from "../../services/publicChatService"; import { usePageTracking } from "../../hooks/usePageTracking"; -import { backgroundImages } from "../../config/backgroundConfig"; +import { toPersianDigits } from "../../utils/persianNumberUtils"; +import chatbotAvatarIcon from "../../assets/chatbot-bot-avatar.png"; export function PublicChatPage() { - const navigate = useNavigate(); usePageTracking("چت عمومی"); const [messages, setMessages] = useState([]); - const [inputText, setInputText] = useState(""); const [showChatHistory, setShowChatHistory] = useState(false); const [historyItems, setHistoryItems] = useState([]); const [currentChatWorkflowID, setCurrentChatWorkflowID] = useState(""); @@ -31,7 +26,6 @@ export function PublicChatPage() { const messagesContainerRef = useRef(null); const messagesEndRef = useRef(null); - const inputRef = useRef(null); const isNearBottom = () => { const container = messagesContainerRef.current; @@ -78,7 +72,7 @@ export function PublicChatPage() { id: crypto.randomUUID(), type: "user", content: msg.question, - timestamp: msg.datetime1, + timestamp: toPersianDigits(msg.datetime1), }); } @@ -88,7 +82,7 @@ export function PublicChatPage() { type: "other", content: msg.answer, author: "ربات", - timestamp: msg.datetime1, + timestamp: toPersianDigits(msg.datetime1), }); } }); @@ -120,8 +114,8 @@ export function PublicChatPage() { setIsLoading(false); }; - const handleSendMessage = async () => { - const trimmedText = inputText.trim(); + const handleSendMessage = async (message: string) => { + const trimmedText = message.trim(); if (!trimmedText || isSending) return; const userMessage: ChatMessage = { @@ -145,44 +139,43 @@ export function PublicChatPage() { setShouldAutoScroll(true); setMessages((prev) => [...prev, userMessage, loadingMessage]); - setInputText(""); setIsSending(true); - if (inputRef.current) { - inputRef.current.style.height = "auto"; - } + try { + const result = await sendPublicChatMessage(trimmedText, currentChatWorkflowID); - const result = await sendPublicChatMessage(trimmedText, currentChatWorkflowID); + setMessages((prev) => prev.filter((msg) => msg.id !== loadingMessageId)); - setMessages((prev) => prev.filter((msg) => msg.id !== loadingMessageId)); + if (result.success && result.answer) { + if (result.newChatlistWorkflowID) { + setCurrentChatWorkflowID(result.newChatlistWorkflowID); + } - if (result.success && result.answer) { - if (result.newChatlistWorkflowID) { - setCurrentChatWorkflowID(result.newChatlistWorkflowID); + const botMessage: ChatMessage = { + id: crypto.randomUUID(), + type: "other", + content: result.answer, + author: "ربات", + timestamp: new Date().toLocaleTimeString("fa-IR", { + hour: "2-digit", + minute: "2-digit", + }), + isTyping: true, + }; + + setMessages((prev) => [...prev, botMessage]); + } else { + alert(result.message || "خطا در ارسال پیام"); } - - const botMessage: ChatMessage = { - id: crypto.randomUUID(), - type: "other", - content: result.answer, - author: "ربات", - timestamp: new Date().toLocaleTimeString("fa-IR", { - hour: "2-digit", - minute: "2-digit", - }), - isTyping: true, - }; - - setMessages((prev) => [...prev, botMessage]); - } else { - alert(result.message || "خطا در ارسال پیام"); + } catch (error) { + setMessages((prev) => prev.filter((msg) => msg.id !== loadingMessageId)); + alert("خطا در ارسال پیام"); + } finally { + setIsSending(false); } - - setIsSending(false); - inputRef.current?.focus(); }; - const handleHistoryClick = async () => { + const handleHistoryClick = useCallback(async () => { setShowChatHistory(true); const result = await loadChatList(); @@ -193,52 +186,60 @@ export function PublicChatPage() { console.error("Failed to load chat list:", result.message); alert(result.message || "خطا در بارگذاری تاریخچه"); } - }; + }, []); - const handleNewChat = () => { - setMessages([]); - setCurrentChatWorkflowID(""); - setShouldAutoScroll(true); + useEffect(() => { + const onHistoryRequest = () => { + void handleHistoryClick(); + }; - requestAnimationFrame(() => { - inputRef.current?.focus(); - }); - }; + window.addEventListener("public-chat:history", onHistoryRequest); + return () => window.removeEventListener("public-chat:history", onHistoryRequest); + }, [handleHistoryClick]); return ( -
- - -
-
- navigate("/")} /> -
- +
+
- {isLoading ? (

در حال بارگذاری...

) : messages.length === 0 ? (
-
+
-
🤖✨
-

+

+ چت‌بات +
+

با ربات همدست چت کن!

-

+

سوالاتت رو بپرس و جواب بگیر

@@ -261,23 +262,13 @@ export function PublicChatPage() {
- -
- -
- +
@@ -288,7 +279,7 @@ export function PublicChatPage() { historyItems={historyItems.map((item) => ({ id: item.chatlist_workflowID, title: item.title || "چت عمومی", - date: item.datetime1, + date: toPersianDigits(item.datetime1), lastMessage: "", }))} onSelectChat={handleSelectChat} diff --git a/src/app/components/SubmitChallengePage.tsx b/src/app/components/SubmitChallengePage.tsx index 2ac3493..130c5d1 100644 --- a/src/app/components/SubmitChallengePage.tsx +++ b/src/app/components/SubmitChallengePage.tsx @@ -1,10 +1,10 @@ import { useNavigate, useParams, useLocation } from "react-router-dom"; -import { useState, useCallback } from "react"; +import { useState, useCallback, useMemo, useRef, useLayoutEffect } from "react"; import { useMagicBag } from "../context/MagicBagContext"; import { RewardModal } from "./RewardModal"; import { getTopicConfig } from "../../config/topicConfig"; import { usePageTracking } from "../../hooks/usePageTracking"; -import { FeedHeader } from "./feed/FeedHeader"; +import { AppHeader } from "./AppHeader"; import { useInbox } from "../context/InboxContext"; import { AppBackground } from "./shared/AppBackground"; import { backgroundImages } from "../../config/backgroundConfig"; @@ -20,9 +20,21 @@ export function SubmitChallengePage() { const { addNewItem } = useMagicBag(); const { refreshInbox } = useInbox(); const [showRewardModal, setShowRewardModal] = useState(false); + const headerWrapperRef = useRef(null); + const [headerHeight, setHeaderHeight] = useState(172); // دریافت doingMission از location state const doingMission = (location.state as any)?.doingMission; + const selectedMissionTitleFromState = (location.state as any)?.selectedMissionTitle; + + const selectedChallengeTitle = useMemo(() => { + return ( + selectedMissionTitleFromState || + localStorage.getItem("current_mission_title") || + doingMission?.title || + "چالش انتخاب‌شده" + ); + }, [selectedMissionTitleFromState, doingMission]); const handleBack = useCallback(() => { navigate(-1); @@ -47,27 +59,72 @@ export function SubmitChallengePage() { // Dynamically render the form component from config const FormComponent = topicConfig.formComponent; + useLayoutEffect(() => { + const measureHeader = () => { + const measuredHeight = headerWrapperRef.current?.getBoundingClientRect().height ?? 0; + if (measuredHeight > 0) { + setHeaderHeight(Math.ceil(measuredHeight)); + } + }; + + measureHeader(); + + const observer = new ResizeObserver(() => { + measureHeader(); + }); + + if (headerWrapperRef.current) { + observer.observe(headerWrapperRef.current); + } + + window.addEventListener("resize", measureHeader); + + return () => { + observer.disconnect(); + window.removeEventListener("resize", measureHeader); + }; + }, []); + return (
{/* Content */}
- {/* Header */} - +
+ {/* Header */} + +
+

+ {`ثبت چالش ${selectedChallengeTitle}`} +

+
+
{/* Main Content - Scrollable */}
{/* Dynamic Form Component */} diff --git a/src/app/components/chatbot/ChatDateGroup.tsx b/src/app/components/chatbot/ChatDateGroup.tsx index 1ef4e49..86f469a 100644 --- a/src/app/components/chatbot/ChatDateGroup.tsx +++ b/src/app/components/chatbot/ChatDateGroup.tsx @@ -13,14 +13,16 @@ export function ChatDateGroup({ date }: ChatDateGroupProps) { }} >
- {date} + {`• ${date} •`}
); diff --git a/src/app/components/chatbot/ChatInputBar.tsx b/src/app/components/chatbot/ChatInputBar.tsx index d13085d..2ec9609 100644 --- a/src/app/components/chatbot/ChatInputBar.tsx +++ b/src/app/components/chatbot/ChatInputBar.tsx @@ -1,4 +1,4 @@ -import { useState, useRef, useEffect } from "react"; +import { useState, useRef, useEffect, type KeyboardEvent } from "react"; import { Send } from "lucide-react"; import { motion } from "motion/react"; @@ -27,11 +27,13 @@ export function ChatInputBar({ onSendMessage, disabled = false }: ChatInputBarPr }, 0); }; - const handleKeyDown = (e: React.KeyboardEvent) => { - if (e.key === "Enter" && !e.shiftKey) { - e.preventDefault(); - handleSend(); + const handleKeyDown = (e: KeyboardEvent) => { + if (e.key !== "Enter" || e.shiftKey || e.ctrlKey || e.metaKey || e.altKey) { + return; } + + e.preventDefault(); + handleSend(); }; // Auto-resize textarea based on content @@ -47,11 +49,17 @@ export function ChatInputBar({ onSendMessage, disabled = false }: ChatInputBarPr return (
{/* Text Input */} @@ -65,10 +73,12 @@ export function ChatInputBar({ onSendMessage, disabled = false }: ChatInputBarPr dir="rtl" disabled={disabled} aria-label="پیام خود را بنویسید" - className="chat-input-textarea flex-1 bg-transparent text-white placeholder-white/50 resize-none outline-none text-right disabled:opacity-50" + className="chat-input-textarea flex-1 bg-transparent text-white placeholder:text-[rgba(207,168,212,0.7)] resize-none outline-none text-right disabled:opacity-50" style={{ fontFamily: "Alibaba, sans-serif", textAlign: "right", + minHeight: "36px", + maxHeight: "96px", lineHeight: "1.4", overflow: "hidden", fontSize: "16px", // حداقل 16px برای جلوگیری از zoom در iOS Safari @@ -77,19 +87,23 @@ export function ChatInputBar({ onSendMessage, disabled = false }: ChatInputBarPr {/* Send Button */} - +
@@ -105,4 +119,4 @@ export function ChatInputBar({ onSendMessage, disabled = false }: ChatInputBarPr `}
); -} \ No newline at end of file +} diff --git a/src/app/components/chatbot/ChatMessageItem.tsx b/src/app/components/chatbot/ChatMessageItem.tsx index 12aa302..c6c0d33 100644 --- a/src/app/components/chatbot/ChatMessageItem.tsx +++ b/src/app/components/chatbot/ChatMessageItem.tsx @@ -1,10 +1,13 @@ +import { useRef } from "react"; import { motion } from "motion/react"; import { Paperclip } from "lucide-react"; +import { toast } from "sonner"; import { ChatFlowMessage } from "../../../hooks/useChatFlow"; -import { extractTime, formatTimestamp } from "../../../utils/chatDateUtils"; +import { extractTime } from "../../../utils/chatDateUtils"; import { AudioPlayer } from "../AudioPlayer"; import { VideoPlayer } from "../VideoPlayer"; -import chatbotAvatarIcon from "figma:asset/c11973053d8410ffeb3c76aa4d1da6991076e7e1.png"; +import { EmojiText } from "./EmojiText"; +import chatbotAvatarIcon from "../../../assets/chatbot-bot-avatar.png"; interface ChatMessageItemProps { message: ChatFlowMessage; @@ -12,9 +15,159 @@ interface ChatMessageItemProps { onButtonClick: (buttonId: string, action: string) => void; } +// استایل پیام کاربر باید مستقل از دکمه ارسال و پیام بات بماند. +const USER_BUBBLE_STYLE = { + background: + "linear-gradient(145deg, rgba(218, 94, 142, 0.96) 0%, rgba(162, 56, 110, 0.95) 100%)", + boxShadow: + "0 0 24px rgba(240,110,168,0.28), 0 12px 28px rgba(84, 22, 60, 0.38), inset 0 1px 0 rgba(255,255,255,0.16)", + border: "1px solid rgba(255, 178, 214, 0.58)", + backdropFilter: "blur(14px)", + WebkitBackdropFilter: "blur(14px)", +} as const; + +const BOT_BUBBLE_STYLE = { + background: + "linear-gradient(145deg, rgba(52, 34, 76, 0.94) 0%, rgba(35, 24, 62, 0.94) 100%)", + backgroundImage: + "linear-gradient(145deg, rgba(52, 34, 76, 0.94) 0%, rgba(35, 24, 62, 0.94) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)", + backgroundOrigin: "border-box", + backgroundClip: "padding-box, border-box", + boxShadow: + "0 0 24px rgba(152,104,235,0.24), 0 12px 28px rgba(12, 8, 30, 0.4), inset 0 1px 0 rgba(255,255,255,0.12)", + border: "0.5px solid transparent", + backdropFilter: "blur(14px)", + WebkitBackdropFilter: "blur(14px)", +} as const; + +const USER_MEDIA_BUBBLE_STYLE = { + background: USER_BUBBLE_STYLE.background, + boxShadow: "0 12px 28px rgba(84, 22, 60, 0.38)", + border: USER_BUBBLE_STYLE.border, +} as const; + +const BOT_MEDIA_BUBBLE_STYLE = { + background: BOT_BUBBLE_STYLE.background, + boxShadow: "0 12px 28px rgba(12, 8, 30, 0.4)", + border: "1px solid rgba(186, 145, 235, 0.4)", +} as const; + +const USER_FILE_BUBBLE_STYLE = { + background: USER_BUBBLE_STYLE.background, + boxShadow: + "0 12px 28px rgba(84, 22, 60, 0.38), inset 0 1px 0 rgba(255,255,255,0.12)", + border: USER_BUBBLE_STYLE.border, +} as const; + +const BOT_FILE_BUBBLE_STYLE = { + background: BOT_BUBBLE_STYLE.background, + boxShadow: + "0 12px 28px rgba(12, 8, 30, 0.4), inset 0 1px 0 rgba(255,255,255,0.12)", + border: "1px solid rgba(186, 145, 235, 0.4)", +} as const; + +const chatToastStyle = { + background: + "linear-gradient(180deg, rgba(46, 27, 61, 0.95) 0%, rgba(35, 24, 62, 0.97) 100%), linear-gradient(120deg, rgba(124, 58, 237, 0.5) 0%, rgba(249, 115, 22, 0.32) 58%, rgba(250, 204, 21, 0.25) 100%)", + backgroundOrigin: "border-box", + backgroundClip: "padding-box, border-box", + border: "1px solid transparent", + boxShadow: + "0 14px 34px rgba(10, 5, 24, 0.42), 0 0 22px rgba(255, 121, 207, 0.18), inset 0 1px 0 rgba(255,255,255,0.16)", + color: "#FBE7F5", + backdropFilter: "blur(16px)", + WebkitBackdropFilter: "blur(16px)", + width: "fit-content", + minWidth: "unset", + maxWidth: "max-content", + whiteSpace: "nowrap", + margin: "0 auto", +} as const; + export function ChatMessageItem({ message, animationDelay, onButtonClick }: ChatMessageItemProps) { - const isBot = message.type === "bot"; + const isUser = message.type === "user"; + const isBot = !isUser; const timeDisplay = extractTime(message.datetime1, message.timestamp); + const textBubbleStyle = isUser ? USER_BUBBLE_STYLE : BOT_BUBBLE_STYLE; + const mediaBubbleStyle = isUser ? USER_MEDIA_BUBBLE_STYLE : BOT_MEDIA_BUBBLE_STYLE; + const fileBubbleStyle = isUser ? USER_FILE_BUBBLE_STYLE : BOT_FILE_BUBBLE_STYLE; + const pressStartRef = useRef(0); + const copyableText = + message.mediaType === "file" + ? message.mediaUrl || "" + : message.content?.trim() || ""; + + const copyWithFallback = (text: string) => { + const textarea = document.createElement("textarea"); + textarea.value = text; + textarea.setAttribute("readonly", "true"); + textarea.style.position = "fixed"; + textarea.style.opacity = "0"; + textarea.style.pointerEvents = "none"; + textarea.style.top = "0"; + textarea.style.left = "0"; + document.body.appendChild(textarea); + textarea.focus(); + textarea.select(); + textarea.setSelectionRange(0, text.length); + + let copied = false; + try { + copied = document.execCommand("copy"); + } finally { + document.body.removeChild(textarea); + } + + return copied; + }; + + const copyMessageToClipboard = async () => { + if (!copyableText) return; + + try { + if (navigator.clipboard?.writeText && window.isSecureContext) { + await navigator.clipboard.writeText(copyableText); + } else if (!copyWithFallback(copyableText)) { + throw new Error("fallback copy failed"); + } + + toast.success("پیام کپی شد", { + position: "bottom-center", + style: chatToastStyle, + }); + } catch { + if (copyWithFallback(copyableText)) { + toast.success("پیام کپی شد", { + position: "bottom-center", + style: chatToastStyle, + }); + return; + } + + toast.error("کپی پیام انجام نشد", { + position: "bottom-center", + style: chatToastStyle, + }); + } + }; + + const startLongPressCopy = () => { + if (!copyableText) return; + pressStartRef.current = Date.now(); + }; + + const stopLongPressCopy = () => { + if (!copyableText) return; + const pressDuration = Date.now() - pressStartRef.current; + pressStartRef.current = 0; + if (pressDuration >= 450) { + void copyMessageToClipboard(); + } + }; + + const cancelLongPressCopy = () => { + pressStartRef.current = 0; + }; return ( { + if (!copyableText) return; + event.preventDefault(); + void copyMessageToClipboard(); }} > -

{message.content}

+ {isBot && message.isTyping && !message.content ? ( +
+ + + +
+ ) : ( +

+ + {isBot && message.isTyping && ( + + )} +

+ )}
)} @@ -47,10 +229,15 @@ export function ChatMessageItem({ message, animationDelay, onButtonClick }: Chat {message.mediaType === "image" && message.content && (
{ + if (!copyableText) return; + event.preventDefault(); + void copyMessageToClipboard(); }} >
{ + if (!copyableText) return; + event.preventDefault(); + void copyMessageToClipboard(); }} >
onButtonClick(button.id, button.action)} - className="w-full px-4 py-3 rounded-2xl text-white text-sm font-bold text-center transition-all" + className="w-full rounded-[18px] px-4 py-3 text-center text-sm font-bold transition-all" style={{ - background: "linear-gradient(135deg, rgba(255, 183, 0, 0.9) 0%, rgba(255, 140, 0, 0.9) 100%)", - boxShadow: "0 4px 16px rgba(255, 183, 0, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.3)", - border: "1.5px solid rgba(255, 200, 50, 0.5)", + background: + "linear-gradient(135deg, rgba(174, 117, 255, 0.96) 0%, rgba(138, 82, 238, 0.95) 46%, rgba(102, 55, 204, 0.94) 100%)", + boxShadow: + "0 0 18px rgba(155,108,241,0.4), 0 10px 20px rgba(24, 10, 54, 0.34), inset 0 1px 0 rgba(255,255,255,0.28)", + border: "1px solid rgba(212, 184, 255, 0.62)", + backdropFilter: "blur(12px)", + WebkitBackdropFilter: "blur(12px)", + color: "#FFFFFF", }} aria-label={button.label} > - {button.label} + ))}
@@ -140,14 +337,21 @@ export function ChatMessageItem({ message, animationDelay, onButtonClick }: Chat {/* Bot Avatar */} {isBot && (
- چت‌بات + > + چت‌بات +
)} diff --git a/src/app/components/chatbot/ChatMessageList.tsx b/src/app/components/chatbot/ChatMessageList.tsx index 76719d0..ee432a8 100644 --- a/src/app/components/chatbot/ChatMessageList.tsx +++ b/src/app/components/chatbot/ChatMessageList.tsx @@ -57,7 +57,7 @@ export const ChatMessageList = forwardRef { scrollToBottom(); - }, [messages.length, isTyping, typingText]); + }, [messages, isTyping, typingText]); return (
@@ -89,4 +89,4 @@ export const ChatMessageList = forwardRef + {emoji} + + ); + } + + return ( + {emoji} setFailed(true)} + className="mx-0.5 inline-block h-[1.45em] w-[1.45em] translate-y-[0.32em] object-contain" + draggable={false} + /> + ); +} + +export function renderEmojiText(text: string): ReactNode { + const parts = text.split(emojiRegex); + + return parts.map((part, index) => { + if (!part) return null; + + if (emojiRegex.test(part)) { + emojiRegex.lastIndex = 0; + + return ; + } + + emojiRegex.lastIndex = 0; + return part; + }); +} + +export function EmojiText({ text }: EmojiTextProps) { + return <>{renderEmojiText(text)}; +} diff --git a/src/app/components/public-chat/ChatHeader.tsx b/src/app/components/public-chat/ChatHeader.tsx index 33bab61..a36a5a9 100644 --- a/src/app/components/public-chat/ChatHeader.tsx +++ b/src/app/components/public-chat/ChatHeader.tsx @@ -1,13 +1,38 @@ import { AppHeader } from "../AppHeader"; interface ChatHeaderProps { - onBack: () => void; + onHistoryClick: () => void; } -export function ChatHeader({ onBack }: ChatHeaderProps) { +const historyButtonStyle = { + backgroundImage: ` + linear-gradient(180deg, #2E1B3D 0%, #23183E 100%), + linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%) + `, + backgroundOrigin: "border-box", + backgroundClip: "padding-box, border-box", + border: "0.5px solid transparent", + boxShadow: + "0 -7px 20px rgba(7, 0, 18, 0.5), 0 6px 14px rgba(5, 2, 12, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 2px 5px rgba(255, 222, 255, 0.09), inset 0 -2px 0 rgba(12, 7, 27, 0.72), inset 0 -8px 14px rgba(8, 4, 18, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.045), inset 0 0 0 2px rgba(17, 10, 35, 0.32)", + backdropFilter: "blur(14px)", + WebkitBackdropFilter: "blur(14px)", +} as const; + +export function ChatHeader({ onHistoryClick }: ChatHeaderProps) { return ( -
- +
+ +
+ +
); } diff --git a/src/app/components/public-chat/ChatInput.tsx b/src/app/components/public-chat/ChatInput.tsx index c342488..1cb5bb2 100644 --- a/src/app/components/public-chat/ChatInput.tsx +++ b/src/app/components/public-chat/ChatInput.tsx @@ -12,19 +12,26 @@ interface ChatInputProps { const inputStyles = { container: { - background: - "linear-gradient(135deg, rgba(32, 76, 106, 0.9) 0%, rgba(20, 40, 60, 0.9) 100%)", - border: "2px solid rgba(138, 206, 224, 0.3)", - boxShadow: "0 4px 16px rgba(0, 0, 0, 0.4)", + backgroundImage: + "linear-gradient(180deg, #2E1B3D 0%, #23183E 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)", + backgroundOrigin: "border-box", + backgroundClip: "padding-box, border-box", + border: "0.5px solid transparent", + boxShadow: "0 -7px 20px rgba(7, 0, 18, 0.5), 0 6px 14px rgba(5, 2, 12, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 2px 5px rgba(255, 222, 255, 0.09), inset 0 -2px 0 rgba(12, 7, 27, 0.72), inset 0 -8px 14px rgba(8, 4, 18, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.045), inset 0 0 0 2px rgba(17, 10, 35, 0.32)", + backdropFilter: "blur(14px)", + WebkitBackdropFilter: "blur(14px)", }, sendButtonActive: { background: - "linear-gradient(135deg, rgba(255, 193, 7, 0.95) 0%, rgba(255, 152, 0, 0.95) 100%)", - boxShadow: "0 4px 12px rgba(255, 193, 7, 0.4)", + "linear-gradient(145deg, #F06EA8 0%, #C9579C 52%, #8A4FCF 100%)", + boxShadow: "0 0 18px rgba(240, 110, 168, 0.42), inset 0 1px 0 rgba(255,255,255,0.22)", + border: "1px solid rgba(255, 189, 228, 0.5)", }, sendButtonDisabled: { background: - "linear-gradient(135deg, rgba(96, 147, 157, 0.3) 0%, rgba(76, 127, 137, 0.3) 100%)", + "linear-gradient(145deg, rgba(72, 58, 105, 0.72) 0%, rgba(42, 35, 77, 0.76) 100%)", + border: "1px solid rgba(198, 111, 177, 0.22)", + boxShadow: "inset 0 1px 0 rgba(255,255,255,0.12), 0 0 12px rgba(203,117,171,0.12)", }, }; @@ -35,7 +42,7 @@ export function ChatInput({ onNewChat, inputRef, }: ChatInputProps) { - const handleKeyDown = (e: React.KeyboardEvent) => { + const handleKeyDown = (e: React.KeyboardEvent) => { const isSelectAll = (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "a"; @@ -49,10 +56,6 @@ export function ChatInput({ return; } - if (e.key === "Enter" && !e.shiftKey) { - e.preventDefault(); - onSend(); - } }; const handleInputChange = (e: React.ChangeEvent) => { @@ -66,22 +69,23 @@ export function ChatInput({ const isDisabled = !inputText.trim(); return ( -
+
- +