378 lines
646 KiB
JavaScript
378 lines
646 KiB
JavaScript
function uv(e,n){for(var a=0;a<n.length;a++){const s=n[a];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(s,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>s[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 u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).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 Pg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pu={exports:{}},vi={},Ru={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 op;function dv(){if(op)return et;op=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"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.iterator;function b(T){return T===null||typeof T!="object"?null:(T=g&&T[g]||T["@@iterator"],typeof T=="function"?T:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,N={};function j(T,A,te){this.props=T,this.context=A,this.refs=N,this.updater=te||S}j.prototype.isReactComponent={},j.prototype.setState=function(T,A){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,A,"setState")},j.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function L(){}L.prototype=j.prototype;function R(T,A,te){this.props=T,this.context=A,this.refs=N,this.updater=te||S}var D=R.prototype=new L;D.constructor=R,C(D,j.prototype),D.isPureReactComponent=!0;var H=Array.isArray,K=Object.prototype.hasOwnProperty,re={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function w(T,A,te){var ie,oe={},ae=null,ue=null;if(A!=null)for(ie in A.ref!==void 0&&(ue=A.ref),A.key!==void 0&&(ae=""+A.key),A)K.call(A,ie)&&!O.hasOwnProperty(ie)&&(oe[ie]=A[ie]);var xe=arguments.length-2;if(xe===1)oe.children=te;else if(1<xe){for(var ve=Array(xe),Ve=0;Ve<xe;Ve++)ve[Ve]=arguments[Ve+2];oe.children=ve}if(T&&T.defaultProps)for(ie in xe=T.defaultProps,xe)oe[ie]===void 0&&(oe[ie]=xe[ie]);return{$$typeof:e,type:T,key:ae,ref:ue,props:oe,_owner:re.current}}function M(T,A){return{$$typeof:e,type:T.type,key:A,ref:T.ref,props:T.props,_owner:T._owner}}function E(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function U(T){var A={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(te){return A[te]})}var Y=/\/+/g;function I(T,A){return typeof T=="object"&&T!==null&&T.key!=null?U(""+T.key):A.toString(36)}function W(T,A,te,ie,oe){var ae=typeof T;(ae==="undefined"||ae==="boolean")&&(T=null);var ue=!1;if(T===null)ue=!0;else switch(ae){case"string":case"number":ue=!0;break;case"object":switch(T.$$typeof){case e:case n:ue=!0}}if(ue)return ue=T,oe=oe(ue),T=ie===""?"."+I(ue,0):ie,H(oe)?(te="",T!=null&&(te=T.replace(Y,"$&/")+"/"),W(oe,A,te,"",function(Ve){return Ve})):oe!=null&&(E(oe)&&(oe=M(oe,te+(!oe.key||ue&&ue.key===oe.key?"":(""+oe.key).replace(Y,"$&/")+"/")+T)),A.push(oe)),1;if(ue=0,ie=ie===""?".":ie+":",H(T))for(var xe=0;xe<T.length;xe++){ae=T[xe];var ve=ie+I(ae,xe);ue+=W(ae,A,te,ve,oe)}else if(ve=b(T),typeof ve=="function")for(T=ve.call(T),xe=0;!(ae=T.next()).done;)ae=ae.value,ve=ie+I(ae,xe++),ue+=W(ae,A,te,ve,oe);else if(ae==="object")throw A=String(T),Error("Objects are not valid as a React child (found: "+(A==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":A)+"). If you meant to render a collection of children, use an array instead.");return ue}function Q(T,A,te){if(T==null)return T;var ie=[],oe=0;return W(T,ie,"","",function(ae){return A.call(te,ae,oe++)}),ie}function G(T){if(T._status===-1){var A=T._result;A=A(),A.then(function(te){(T._status===0||T._status===-1)&&(T._status=1,T._result=te)},function(te){(T._status===0||T._status===-1)&&(T._status=2,T._result=te)}),T._status===-1&&(T._status=0,T._result=A)}if(T._status===1)return T._result.default;throw T._result}var B={current:null},_={transition:null},X={ReactCurrentDispatcher:B,ReactCurrentBatchConfig:_,ReactCurrentOwner:re};function J(){throw Error("act(...) is not supported in production builds of React.")}return et.Children={map:Q,forEach:function(T,A,te){Q(T,function(){A.apply(this,arguments)},te)},count:function(T){var A=0;return Q(T,function(){A++}),A},toArray:function(T){return Q(T,function(A){return A})||[]},only:function(T){if(!E(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},et.Component=j,et.Fragment=a,et.Profiler=o,et.PureComponent=R,et.StrictMode=s,et.Suspense=p,et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X,et.act=J,et.cloneElement=function(T,A,te){if(T==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+T+".");var ie=C({},T.props),oe=T.key,ae=T.ref,ue=T._owner;if(A!=null){if(A.ref!==void 0&&(ae=A.ref,ue=re.current),A.key!==void 0&&(oe=""+A.key),T.type&&T.type.defaultProps)var xe=T.type.defaultProps;for(ve in A)K.call(A,ve)&&!O.hasOwnProperty(ve)&&(ie[ve]=A[ve]===void 0&&xe!==void 0?xe[ve]:A[ve])}var ve=arguments.length-2;if(ve===1)ie.children=te;else if(1<ve){xe=Array(ve);for(var Ve=0;Ve<ve;Ve++)xe[Ve]=arguments[Ve+2];ie.children=xe}return{$$typeof:e,type:T.type,key:oe,ref:ae,props:ie,_owner:ue}},et.createContext=function(T){return T={$$typeof:u,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},T.Provider={$$typeof:l,_context:T},T.Consumer=T},et.createElement=w,et.createFactory=function(T){var A=w.bind(null,T);return A.type=T,A},et.createRef=function(){return{current:null}},et.forwardRef=function(T){return{$$typeof:f,render:T}},et.isValidElement=E,et.lazy=function(T){return{$$typeof:y,_payload:{_status:-1,_result:T},_init:G}},et.memo=function(T,A){return{$$typeof:m,type:T,compare:A===void 0?null:A}},et.startTransition=function(T){var A=_.transition;_.transition={};try{T()}finally{_.transition=A}},et.unstable_act=J,et.useCallback=function(T,A){return B.current.useCallback(T,A)},et.useContext=function(T){return B.current.useContext(T)},et.useDebugValue=function(){},et.useDeferredValue=function(T){return B.current.useDeferredValue(T)},et.useEffect=function(T,A){return B.current.useEffect(T,A)},et.useId=function(){return B.current.useId()},et.useImperativeHandle=function(T,A,te){return B.current.useImperativeHandle(T,A,te)},et.useInsertionEffect=function(T,A){return B.current.useInsertionEffect(T,A)},et.useLayoutEffect=function(T,A){return B.current.useLayoutEffect(T,A)},et.useMemo=function(T,A){return B.current.useMemo(T,A)},et.useReducer=function(T,A,te){return B.current.useReducer(T,A,te)},et.useRef=function(T){return B.current.useRef(T)},et.useState=function(T){return B.current.useState(T)},et.useSyncExternalStore=function(T,A,te){return B.current.useSyncExternalStore(T,A,te)},et.useTransition=function(){return B.current.useTransition()},et.version="18.3.1",et}var lp;function zl(){return lp||(lp=1,Ru.exports=dv()),Ru.exports}/**
|
||
* @license React
|
||
* react-jsx-runtime.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 cp;function fv(){if(cp)return vi;cp=1;var e=zl(),n=Symbol.for("react.element"),a=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function u(f,p,m){var y,g={},b=null,S=null;m!==void 0&&(b=""+m),p.key!==void 0&&(b=""+p.key),p.ref!==void 0&&(S=p.ref);for(y in p)s.call(p,y)&&!l.hasOwnProperty(y)&&(g[y]=p[y]);if(f&&f.defaultProps)for(y in p=f.defaultProps,p)g[y]===void 0&&(g[y]=p[y]);return{$$typeof:n,type:f,key:b,ref:S,props:g,_owner:o.current}}return vi.Fragment=a,vi.jsx=u,vi.jsxs=u,vi}var up;function hv(){return up||(up=1,Pu.exports=fv()),Pu.exports}var d=hv(),el={},Mu={exports:{}},Pn={},Iu={exports:{}},_u={};/**
|
||
* @license React
|
||
* scheduler.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 dp;function pv(){return dp||(dp=1,(function(e){function n(_,X){var J=_.length;_.push(X);e:for(;0<J;){var T=J-1>>>1,A=_[T];if(0<o(A,X))_[T]=X,_[J]=A,J=T;else break e}}function a(_){return _.length===0?null:_[0]}function s(_){if(_.length===0)return null;var X=_[0],J=_.pop();if(J!==X){_[0]=J;e:for(var T=0,A=_.length,te=A>>>1;T<te;){var ie=2*(T+1)-1,oe=_[ie],ae=ie+1,ue=_[ae];if(0>o(oe,J))ae<A&&0>o(ue,oe)?(_[T]=ue,_[ae]=J,T=ae):(_[T]=oe,_[ie]=J,T=ie);else if(ae<A&&0>o(ue,J))_[T]=ue,_[ae]=J,T=ae;else break e}}return X}function o(_,X){var J=_.sortIndex-X.sortIndex;return J!==0?J:_.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var p=[],m=[],y=1,g=null,b=3,S=!1,C=!1,N=!1,j=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function D(_){for(var X=a(m);X!==null;){if(X.callback===null)s(m);else if(X.startTime<=_)s(m),X.sortIndex=X.expirationTime,n(p,X);else break;X=a(m)}}function H(_){if(N=!1,D(_),!C)if(a(p)!==null)C=!0,G(K);else{var X=a(m);X!==null&&B(H,X.startTime-_)}}function K(_,X){C=!1,N&&(N=!1,L(w),w=-1),S=!0;var J=b;try{for(D(X),g=a(p);g!==null&&(!(g.expirationTime>X)||_&&!U());){var T=g.callback;if(typeof T=="function"){g.callback=null,b=g.priorityLevel;var A=T(g.expirationTime<=X);X=e.unstable_now(),typeof A=="function"?g.callback=A:g===a(p)&&s(p),D(X)}else s(p);g=a(p)}if(g!==null)var te=!0;else{var ie=a(m);ie!==null&&B(H,ie.startTime-X),te=!1}return te}finally{g=null,b=J,S=!1}}var re=!1,O=null,w=-1,M=5,E=-1;function U(){return!(e.unstable_now()-E<M)}function Y(){if(O!==null){var _=e.unstable_now();E=_;var X=!0;try{X=O(!0,_)}finally{X?I():(re=!1,O=null)}}else re=!1}var I;if(typeof R=="function")I=function(){R(Y)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,Q=W.port2;W.port1.onmessage=Y,I=function(){Q.postMessage(null)}}else I=function(){j(Y,0)};function G(_){O=_,re||(re=!0,I())}function B(_,X){w=j(function(){_(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(_){_.callback=null},e.unstable_continueExecution=function(){C||S||(C=!0,G(K))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_getFirstCallbackNode=function(){return a(p)},e.unstable_next=function(_){switch(b){case 1:case 2:case 3:var X=3;break;default:X=b}var J=b;b=X;try{return _()}finally{b=J}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,X){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var J=b;b=_;try{return X()}finally{b=J}},e.unstable_scheduleCallback=function(_,X,J){var T=e.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?T+J:T):J=T,_){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=J+A,_={id:y++,callback:X,priorityLevel:_,startTime:J,expirationTime:A,sortIndex:-1},J>T?(_.sortIndex=J,n(m,_),a(p)===null&&_===a(m)&&(N?(L(w),w=-1):N=!0,B(H,J-T))):(_.sortIndex=A,n(p,_),C||S||(C=!0,G(K))),_},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(_){var X=b;return function(){var J=b;b=X;try{return _.apply(this,arguments)}finally{b=J}}}})(_u)),_u}var fp;function mv(){return fp||(fp=1,Iu.exports=pv()),Iu.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 hp;function gv(){if(hp)return Pn;hp=1;var e=zl(),n=mv();function a(t){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+t,i=1;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,o={};function l(t,r){u(t,r),u(t+"Capture",r)}function u(t,r){for(o[t]=r,t=0;t<r.length;t++)s.add(r[t])}var f=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,m=/^[: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={},g={};function b(t){return p.call(g,t)?!0:p.call(y,t)?!1:m.test(t)?g[t]=!0:(y[t]=!0,!1)}function S(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"||S(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,h,x,k){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=c,this.attributeNamespace=h,this.mustUseProperty=i,this.propertyName=t,this.type=r,this.sanitizeURL=x,this.removeEmptyString=k}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 L=/[\-:]([a-z])/g;function R(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(L,R);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(L,R);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(L,R);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 D(t,r,i,c){var h=j.hasOwnProperty(r)?j[r]:null;(h!==null?h.type!==0:c||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(C(r,i,h,c)&&(i=null),c||h===null?b(r)&&(i===null?t.removeAttribute(r):t.setAttribute(r,""+i)):h.mustUseProperty?t[h.propertyName]=i===null?h.type===3?!1:"":i:(r=h.attributeName,c=h.attributeNamespace,i===null?t.removeAttribute(r):(h=h.type,i=h===3||h===4&&i===!0?"":""+i,c?t.setAttributeNS(c,r,i):t.setAttribute(r,i))))}var H=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,K=Symbol.for("react.element"),re=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),U=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),B=Symbol.for("react.offscreen"),_=Symbol.iterator;function X(t){return t===null||typeof t!="object"?null:(t=_&&t[_]||t["@@iterator"],typeof t=="function"?t:null)}var J=Object.assign,T;function A(t){if(T===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);T=r&&r[1]||""}return`
|
||
`+T+t}var te=!1;function ie(t,r){if(!t||te)return"";te=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(ne){var c=ne}Reflect.construct(t,[],r)}else{try{r.call()}catch(ne){c=ne}t.call(r.prototype)}else{try{throw Error()}catch(ne){c=ne}t()}}catch(ne){if(ne&&c&&typeof ne.stack=="string"){for(var h=ne.stack.split(`
|
||
`),x=c.stack.split(`
|
||
`),k=h.length-1,P=x.length-1;1<=k&&0<=P&&h[k]!==x[P];)P--;for(;1<=k&&0<=P;k--,P--)if(h[k]!==x[P]){if(k!==1||P!==1)do if(k--,P--,0>P||h[k]!==x[P]){var z=`
|
||
`+h[k].replace(" at new "," at ");return t.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",t.displayName)),z}while(1<=k&&0<=P);break}}}finally{te=!1,Error.prepareStackTrace=i}return(t=t?t.displayName||t.name:"")?A(t):""}function oe(t){switch(t.tag){case 5:return A(t.type);case 16:return A("Lazy");case 13:return A("Suspense");case 19:return A("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 O:return"Fragment";case re:return"Portal";case M:return"Profiler";case w:return"StrictMode";case I:return"Suspense";case W:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case U:return(t.displayName||"Context")+".Consumer";case E:return(t._context.displayName||"Context")+".Provider";case Y:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Q: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 h=i.get,x=i.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return h.call(this)},set:function(k){c=""+k,x.call(this,k)}}),Object.defineProperty(t,r,{enumerable:i.enumerable}),{getValue:function(){return c},setValue:function(k){c=""+k},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 J({},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&&D(t,"checked",r,!1)}function ke(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 h=0;h<i.length;h++)r["$"+i[h]]=!0;for(i=0;i<t.length;i++)h=r.hasOwnProperty("$"+t[i].value),t[i].selected!==h&&(t[i].selected=h),h&&c&&(t[i].defaultSelected=!0)}else{for(i=""+xe(i),r=null,h=0;h<t.length;h++){if(t[h].value===i){t[h].selected=!0,c&&(t[h].defaultSelected=!0);return}r!==null||t[h].disabled||(r=t[h])}r!==null&&(r.selected=!0)}}function be(t,r){if(r.dangerouslySetInnerHTML!=null)throw Error(a(91));return J({},r,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Ae(t,r){var i=r.value;if(i==null){if(i=r.children,r=r.defaultValue,i!=null){if(r!=null)throw Error(a(92));if(me(i)){if(1<i.length)throw Error(a(93));i=i[0]}r=i}r==null&&(r=""),i=r}t._wrapperState={initialValue:xe(i)}}function Qe(t,r){var i=xe(r.value),c=xe(r.defaultValue);i!=null&&(i=""+i,i!==t.value&&(t.value=i),r.defaultValue==null&&t.defaultValue!==i&&(t.defaultValue=i)),c!=null&&(t.defaultValue=""+c)}function Ge(t){var r=t.textContent;r===t._wrapperState.initialValue&&r!==""&&r!==null&&(t.value=r)}function rt(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ht(t,r){return t==null||t==="http://www.w3.org/1999/xhtml"?rt(r):t==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Qt,Pt=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,i,c,h){MSApp.execUnsafeLocalFunction(function(){return t(r,i,c,h)})}:t})(function(t,r){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=r;else{for(Qt=Qt||document.createElement("div"),Qt.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",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 Sn={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(Sn).forEach(function(t){ft.forEach(function(r){r=r+t.charAt(0).toUpperCase()+t.substring(1),Sn[r]=Sn[t]})});function Mn(t,r,i){return r==null||typeof r=="boolean"||r===""?"":i||typeof r!="number"||r===0||Sn.hasOwnProperty(t)&&Sn[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,h=Mn(i,r[i],c);i==="float"&&(i="cssFloat"),c?t.setProperty(i,h):t[i]=h}}var Ze=J({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,sn=null,Vn=null;function Dr(t){if(t=ai(t)){if(typeof yr!="function")throw Error(a(280));var r=t.stateNode;r&&(r=mo(r),yr(t.stateNode,t.type,r))}}function Ye(t){sn?Vn?Vn.push(t):Vn=[t]:sn=t}function Et(){if(sn){var t=sn,r=Vn;if(Vn=sn=null,Dr(t),r)for(t=0;t<r.length;t++)Dr(r[t])}}function Lt(t,r){return t(r)}function Ut(){}var In=!1;function St(t,r,i){if(In)return t(r,i);In=!0;try{return Lt(t,r,i)}finally{In=!1,(sn!==null||Vn!==null)&&(Ut(),Et())}}function At(t,r){var i=t.stateNode;if(i===null)return null;var c=mo(i);if(c===null)return null;i=c[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(a(231,r,typeof i));return i}var xr=!1;if(f)try{var $t={};Object.defineProperty($t,"passive",{get:function(){xr=!0}}),window.addEventListener("test",$t,$t),window.removeEventListener("test",$t,$t)}catch{xr=!1}function F(t,r,i,c,h,x,k,P,z){var ne=Array.prototype.slice.call(arguments,3);try{r.apply(i,ne)}catch(fe){this.onError(fe)}}var V=!1,q=null,le=!1,ce=null,_e={onError:function(t){V=!0,q=t}};function De(t,r,i,c,h,x,k,P,z){V=!1,q=null,F.apply(_e,arguments)}function Ke(t,r,i,c,h,x,k,P,z){if(De.apply(this,arguments),V){if(V){var ne=q;V=!1,q=null}else throw Error(a(198));le||(le=!0,ce=ne)}}function ye(t){var r=t,i=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(i=r.return),t=r.return;while(t)}return r.tag===3?i:null}function Fe(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function $e(t){if(ye(t)!==t)throw Error(a(188))}function Xe(t){var r=t.alternate;if(!r){if(r=ye(t),r===null)throw Error(a(188));return r!==t?null:t}for(var i=t,c=r;;){var h=i.return;if(h===null)break;var x=h.alternate;if(x===null){if(c=h.return,c!==null){i=c;continue}break}if(h.child===x.child){for(x=h.child;x;){if(x===i)return $e(h),t;if(x===c)return $e(h),r;x=x.sibling}throw Error(a(188))}if(i.return!==c.return)i=h,c=x;else{for(var k=!1,P=h.child;P;){if(P===i){k=!0,i=h,c=x;break}if(P===c){k=!0,c=h,i=x;break}P=P.sibling}if(!k){for(P=x.child;P;){if(P===i){k=!0,i=x,c=h;break}if(P===c){k=!0,c=x,i=h;break}P=P.sibling}if(!k)throw Error(a(189))}}if(i.alternate!==c)throw Error(a(190))}if(i.tag!==3)throw Error(a(188));return i.stateNode.current===i?t:r}function Le(t){return t=Xe(t),t!==null?tt(t):null}function tt(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var r=tt(t);if(r!==null)return r;t=t.sibling}return null}var ut=n.unstable_scheduleCallback,Ot=n.unstable_cancelCallback,kt=n.unstable_shouldYield,pt=n.unstable_requestPaint,at=n.unstable_now,on=n.unstable_getCurrentPriorityLevel,Fr=n.unstable_ImmediatePriority,nr=n.unstable_UserBlockingPriority,rr=n.unstable_NormalPriority,vr=n.unstable_LowPriority,_n=n.unstable_IdlePriority,Kr=null,Ht=null;function Xa(t){if(Ht&&typeof Ht.onCommitFiberRoot=="function")try{Ht.onCommitFiberRoot(Kr,t,void 0,(t.current.flags&128)===128)}catch{}}var ln=Math.clz32?Math.clz32:cn,Ja=Math.log,st=Math.LN2;function cn(t){return t>>>=0,t===0?32:31-(Ja(t)/st|0)|0}var yn=64,kn=4194304;function Yr(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 Gr(t,r){var i=t.pendingLanes;if(i===0)return 0;var c=0,h=t.suspendedLanes,x=t.pingedLanes,k=i&268435455;if(k!==0){var P=k&~h;P!==0?c=Yr(P):(x&=k,x!==0&&(c=Yr(x)))}else k=i&~h,k!==0?c=Yr(k):x!==0&&(c=Yr(x));if(c===0)return 0;if(r!==0&&r!==c&&(r&h)===0&&(h=c&-c,x=r&-r,h>=x||h===16&&(x&4194240)!==0))return r;if((c&4)!==0&&(c|=i&16),r=t.entangledLanes,r!==0)for(t=t.entanglements,r&=c;0<r;)i=31-ln(r),h=1<<i,c|=t[i],r&=~h;return c}function bt(t,r){switch(t){case 1:case 2:case 4:return r+250;case 8:case 16:case 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 r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Lr(t,r){for(var i=t.suspendedLanes,c=t.pingedLanes,h=t.expirationTimes,x=t.pendingLanes;0<x;){var k=31-ln(x),P=1<<k,z=h[k];z===-1?((P&i)===0||(P&c)!==0)&&(h[k]=bt(P,r)):z<=r&&(t.expiredLanes|=P),x&=~P}}function qa(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Qi(){var t=yn;return yn<<=1,(yn&4194240)===0&&(yn=64),t}function ql(t){for(var r=[],i=0;31>i;i++)r.push(t);return r}function Vs(t,r,i){t.pendingLanes|=r,r!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,r=31-ln(r),t[r]=i}function Mx(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<i;){var h=31-ln(i),x=1<<h;r[h]=0,c[h]=-1,t[h]=-1,i&=~x}}function Ql(t,r){var i=t.entangledLanes|=r;for(t=t.entanglements;i;){var c=31-ln(i),h=1<<c;h&r|t[c]&r&&(t[c]|=r),i&=~h}}var mt=0;function zf(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var Bf,Zl,Vf,Uf,$f,ec=!1,Zi=[],Xr=null,Jr=null,qr=null,Us=new Map,$s=new Map,Qr=[],Ix="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Hf(t,r){switch(t){case"focusin":case"focusout":Xr=null;break;case"dragenter":case"dragleave":Jr=null;break;case"mouseover":case"mouseout":qr=null;break;case"pointerover":case"pointerout":Us.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":$s.delete(r.pointerId)}}function Hs(t,r,i,c,h,x){return t===null||t.nativeEvent!==x?(t={blockedOn:r,domEventName:i,eventSystemFlags:c,nativeEvent:x,targetContainers:[h]},r!==null&&(r=ai(r),r!==null&&Zl(r)),t):(t.eventSystemFlags|=c,r=t.targetContainers,h!==null&&r.indexOf(h)===-1&&r.push(h),t)}function _x(t,r,i,c,h){switch(r){case"focusin":return Xr=Hs(Xr,t,r,i,c,h),!0;case"dragenter":return Jr=Hs(Jr,t,r,i,c,h),!0;case"mouseover":return qr=Hs(qr,t,r,i,c,h),!0;case"pointerover":var x=h.pointerId;return Us.set(x,Hs(Us.get(x)||null,t,r,i,c,h)),!0;case"gotpointercapture":return x=h.pointerId,$s.set(x,Hs($s.get(x)||null,t,r,i,c,h)),!0}return!1}function Wf(t){var r=Ca(t.target);if(r!==null){var i=ye(r);if(i!==null){if(r=i.tag,r===13){if(r=Fe(i),r!==null){t.blockedOn=r,$f(t.priority,function(){Vf(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function eo(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var i=nc(t.domEventName,t.eventSystemFlags,r[0],t.nativeEvent);if(i===null){i=t.nativeEvent;var c=new i.constructor(i.type,i);Zt=c,i.target.dispatchEvent(c),Zt=null}else return r=ai(i),r!==null&&Zl(r),t.blockedOn=i,!1;r.shift()}return!0}function Kf(t,r,i){eo(t)&&i.delete(r)}function Dx(){ec=!1,Xr!==null&&eo(Xr)&&(Xr=null),Jr!==null&&eo(Jr)&&(Jr=null),qr!==null&&eo(qr)&&(qr=null),Us.forEach(Kf),$s.forEach(Kf)}function Ws(t,r){t.blockedOn===r&&(t.blockedOn=null,ec||(ec=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Dx)))}function Ks(t){function r(h){return Ws(h,t)}if(0<Zi.length){Ws(Zi[0],t);for(var i=1;i<Zi.length;i++){var c=Zi[i];c.blockedOn===t&&(c.blockedOn=null)}}for(Xr!==null&&Ws(Xr,t),Jr!==null&&Ws(Jr,t),qr!==null&&Ws(qr,t),Us.forEach(r),$s.forEach(r),i=0;i<Qr.length;i++)c=Qr[i],c.blockedOn===t&&(c.blockedOn=null);for(;0<Qr.length&&(i=Qr[0],i.blockedOn===null);)Wf(i),i.blockedOn===null&&Qr.shift()}var Qa=H.ReactCurrentBatchConfig,to=!0;function Fx(t,r,i,c){var h=mt,x=Qa.transition;Qa.transition=null;try{mt=1,tc(t,r,i,c)}finally{mt=h,Qa.transition=x}}function Lx(t,r,i,c){var h=mt,x=Qa.transition;Qa.transition=null;try{mt=4,tc(t,r,i,c)}finally{mt=h,Qa.transition=x}}function tc(t,r,i,c){if(to){var h=nc(t,r,i,c);if(h===null)vc(t,r,c,no,i),Hf(t,c);else if(_x(h,t,r,i,c))c.stopPropagation();else if(Hf(t,c),r&4&&-1<Ix.indexOf(t)){for(;h!==null;){var x=ai(h);if(x!==null&&Bf(x),x=nc(t,r,i,c),x===null&&vc(t,r,c,no,i),x===h)break;h=x}h!==null&&c.stopPropagation()}else vc(t,r,c,null,i)}}var no=null;function nc(t,r,i,c){if(no=null,t=gt(c),t=Ca(t),t!==null)if(r=ye(t),r===null)t=null;else if(i=r.tag,i===13){if(t=Fe(r),t!==null)return t;t=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null);return no=t,null}function Yf(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(on()){case Fr:return 1;case nr:return 4;case rr:case vr:return 16;case _n:return 536870912;default:return 16}default:return 16}}var Zr=null,rc=null,ro=null;function Gf(){if(ro)return ro;var t,r=rc,i=r.length,c,h="value"in Zr?Zr.value:Zr.textContent,x=h.length;for(t=0;t<i&&r[t]===h[t];t++);var k=i-t;for(c=1;c<=k&&r[i-c]===h[x-c];c++);return ro=h.slice(t,1<c?1-c:void 0)}function ao(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function so(){return!0}function Xf(){return!1}function Dn(t){function r(i,c,h,x,k){this._reactName=i,this._targetInst=h,this.type=c,this.nativeEvent=x,this.target=k,this.currentTarget=null;for(var P in t)t.hasOwnProperty(P)&&(i=t[P],this[P]=i?i(x):x[P]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?so:Xf,this.isPropagationStopped=Xf,this}return J(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=so)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=so)},persist:function(){},isPersistent:so}),r}var Za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ac=Dn(Za),Ys=J({},Za,{view:0,detail:0}),Ax=Dn(Ys),sc,ic,Gs,io=J({},Ys,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lc,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Gs&&(Gs&&t.type==="mousemove"?(sc=t.screenX-Gs.screenX,ic=t.screenY-Gs.screenY):ic=sc=0,Gs=t),sc)},movementY:function(t){return"movementY"in t?t.movementY:ic}}),Jf=Dn(io),Ox=J({},io,{dataTransfer:0}),zx=Dn(Ox),Bx=J({},Ys,{relatedTarget:0}),oc=Dn(Bx),Vx=J({},Za,{animationName:0,elapsedTime:0,pseudoElement:0}),Ux=Dn(Vx),$x=J({},Za,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Hx=Dn($x),Wx=J({},Za,{data:0}),qf=Dn(Wx),Kx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yx={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Gx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xx(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=Gx[t])?!!r[t]:!1}function lc(){return Xx}var Jx=J({},Ys,{key:function(t){if(t.key){var r=Kx[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=ao(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Yx[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lc,charCode:function(t){return t.type==="keypress"?ao(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ao(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),qx=Dn(Jx),Qx=J({},io,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qf=Dn(Qx),Zx=J({},Ys,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lc}),e2=Dn(Zx),t2=J({},Za,{propertyName:0,elapsedTime:0,pseudoElement:0}),n2=Dn(t2),r2=J({},io,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),a2=Dn(r2),s2=[9,13,27,32],cc=f&&"CompositionEvent"in window,Xs=null;f&&"documentMode"in document&&(Xs=document.documentMode);var i2=f&&"TextEvent"in window&&!Xs,Zf=f&&(!cc||Xs&&8<Xs&&11>=Xs),eh=" ",th=!1;function nh(t,r){switch(t){case"keyup":return s2.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var es=!1;function o2(t,r){switch(t){case"compositionend":return rh(r);case"keypress":return r.which!==32?null:(th=!0,eh);case"textInput":return t=r.data,t===eh&&th?null:t;default:return null}}function l2(t,r){if(es)return t==="compositionend"||!cc&&nh(t,r)?(t=Gf(),ro=rc=Zr=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.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Zf&&r.locale!=="ko"?null:r.data;default:return null}}var c2={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ah(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!c2[t.type]:r==="textarea"}function sh(t,r,i,c){Ye(c),r=fo(r,"onChange"),0<r.length&&(i=new ac("onChange","change",null,i,c),t.push({event:i,listeners:r}))}var Js=null,qs=null;function u2(t){kh(t,0)}function oo(t){var r=ss(t);if(Ue(r))return t}function d2(t,r){if(t==="change")return r}var ih=!1;if(f){var uc;if(f){var dc="oninput"in document;if(!dc){var oh=document.createElement("div");oh.setAttribute("oninput","return;"),dc=typeof oh.oninput=="function"}uc=dc}else uc=!1;ih=uc&&(!document.documentMode||9<document.documentMode)}function lh(){Js&&(Js.detachEvent("onpropertychange",ch),qs=Js=null)}function ch(t){if(t.propertyName==="value"&&oo(qs)){var r=[];sh(r,qs,t,gt(t)),St(u2,r)}}function f2(t,r,i){t==="focusin"?(lh(),Js=r,qs=i,Js.attachEvent("onpropertychange",ch)):t==="focusout"&&lh()}function h2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return oo(qs)}function p2(t,r){if(t==="click")return oo(r)}function m2(t,r){if(t==="input"||t==="change")return oo(r)}function g2(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var ar=typeof Object.is=="function"?Object.is:g2;function Qs(t,r){if(ar(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var i=Object.keys(t),c=Object.keys(r);if(i.length!==c.length)return!1;for(c=0;c<i.length;c++){var h=i[c];if(!p.call(r,h)||!ar(t[h],r[h]))return!1}return!0}function uh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function dh(t,r){var i=uh(t);t=0;for(var c;i;){if(i.nodeType===3){if(c=t+i.textContent.length,t<=r&&c>=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=uh(i)}}function fh(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?fh(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function hh(){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 fc(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 y2(t){var r=hh(),i=t.focusedElem,c=t.selectionRange;if(r!==i&&i&&i.ownerDocument&&fh(i.ownerDocument.documentElement,i)){if(c!==null&&fc(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 h=i.textContent.length,x=Math.min(c.start,h);c=c.end===void 0?x:Math.min(c.end,h),!t.extend&&x>c&&(h=c,c=x,x=h),h=dh(i,x);var k=dh(i,c);h&&k&&(t.rangeCount!==1||t.anchorNode!==h.node||t.anchorOffset!==h.offset||t.focusNode!==k.node||t.focusOffset!==k.offset)&&(r=r.createRange(),r.setStart(h.node,h.offset),t.removeAllRanges(),x>c?(t.addRange(r),t.extend(k.node,k.offset)):(r.setEnd(k.node,k.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<r.length;i++)t=r[i],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var x2=f&&"documentMode"in document&&11>=document.documentMode,ts=null,hc=null,Zs=null,pc=!1;function ph(t,r,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;pc||ts==null||ts!==Oe(c)||(c=ts,"selectionStart"in c&&fc(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}),Zs&&Qs(Zs,c)||(Zs=c,c=fo(hc,"onSelect"),0<c.length&&(r=new ac("onSelect","select",null,r,i),t.push({event:r,listeners:c}),r.target=ts)))}function lo(t,r){var i={};return i[t.toLowerCase()]=r.toLowerCase(),i["Webkit"+t]="webkit"+r,i["Moz"+t]="moz"+r,i}var ns={animationend:lo("Animation","AnimationEnd"),animationiteration:lo("Animation","AnimationIteration"),animationstart:lo("Animation","AnimationStart"),transitionend:lo("Transition","TransitionEnd")},mc={},mh={};f&&(mh=document.createElement("div").style,"AnimationEvent"in window||(delete ns.animationend.animation,delete ns.animationiteration.animation,delete ns.animationstart.animation),"TransitionEvent"in window||delete ns.transitionend.transition);function co(t){if(mc[t])return mc[t];if(!ns[t])return t;var r=ns[t],i;for(i in r)if(r.hasOwnProperty(i)&&i in mh)return mc[t]=r[i];return t}var gh=co("animationend"),yh=co("animationiteration"),xh=co("animationstart"),vh=co("transitionend"),bh=new Map,wh="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ea(t,r){bh.set(t,r),l(r,[t])}for(var gc=0;gc<wh.length;gc++){var yc=wh[gc],v2=yc.toLowerCase(),b2=yc[0].toUpperCase()+yc.slice(1);ea(v2,"on"+b2)}ea(gh,"onAnimationEnd"),ea(yh,"onAnimationIteration"),ea(xh,"onAnimationStart"),ea("dblclick","onDoubleClick"),ea("focusin","onFocus"),ea("focusout","onBlur"),ea(vh,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ei="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),w2=new Set("cancel close invalid load scroll toggle".split(" ").concat(ei));function Sh(t,r,i){var c=t.type||"unknown-event";t.currentTarget=i,Ke(c,r,void 0,t),t.currentTarget=null}function kh(t,r){r=(r&4)!==0;for(var i=0;i<t.length;i++){var c=t[i],h=c.event;c=c.listeners;e:{var x=void 0;if(r)for(var k=c.length-1;0<=k;k--){var P=c[k],z=P.instance,ne=P.currentTarget;if(P=P.listener,z!==x&&h.isPropagationStopped())break e;Sh(h,P,ne),x=z}else for(k=0;k<c.length;k++){if(P=c[k],z=P.instance,ne=P.currentTarget,P=P.listener,z!==x&&h.isPropagationStopped())break e;Sh(h,P,ne),x=z}}}if(le)throw t=ce,le=!1,ce=null,t}function jt(t,r){var i=r[Cc];i===void 0&&(i=r[Cc]=new Set);var c=t+"__bubble";i.has(c)||(jh(r,t,2,!1),i.add(c))}function xc(t,r,i){var c=0;r&&(c|=4),jh(i,t,c,r)}var uo="_reactListening"+Math.random().toString(36).slice(2);function ti(t){if(!t[uo]){t[uo]=!0,s.forEach(function(i){i!=="selectionchange"&&(w2.has(i)||xc(i,!1,t),xc(i,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[uo]||(r[uo]=!0,xc("selectionchange",!1,r))}}function jh(t,r,i,c){switch(Yf(r)){case 1:var h=Fx;break;case 4:h=Lx;break;default:h=tc}i=h.bind(null,r,i,t),h=void 0,!xr||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(h=!0),c?h!==void 0?t.addEventListener(r,i,{capture:!0,passive:h}):t.addEventListener(r,i,!0):h!==void 0?t.addEventListener(r,i,{passive:h}):t.addEventListener(r,i,!1)}function vc(t,r,i,c,h){var x=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var k=c.tag;if(k===3||k===4){var P=c.stateNode.containerInfo;if(P===h||P.nodeType===8&&P.parentNode===h)break;if(k===4)for(k=c.return;k!==null;){var z=k.tag;if((z===3||z===4)&&(z=k.stateNode.containerInfo,z===h||z.nodeType===8&&z.parentNode===h))return;k=k.return}for(;P!==null;){if(k=Ca(P),k===null)return;if(z=k.tag,z===5||z===6){c=x=k;continue e}P=P.parentNode}}c=c.return}St(function(){var ne=x,fe=gt(i),he=[];e:{var de=bh.get(t);if(de!==void 0){var Se=ac,Ne=t;switch(t){case"keypress":if(ao(i)===0)break e;case"keydown":case"keyup":Se=qx;break;case"focusin":Ne="focus",Se=oc;break;case"focusout":Ne="blur",Se=oc;break;case"beforeblur":case"afterblur":Se=oc;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Se=Jf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Se=zx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Se=e2;break;case gh:case yh:case xh:Se=Ux;break;case vh:Se=n2;break;case"scroll":Se=Ax;break;case"wheel":Se=a2;break;case"copy":case"cut":case"paste":Se=Hx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Se=Qf}var Pe=(r&4)!==0,zt=!Pe&&t==="scroll",Z=Pe?de!==null?de+"Capture":null:de;Pe=[];for(var $=ne,ee;$!==null;){ee=$;var pe=ee.stateNode;if(ee.tag===5&&pe!==null&&(ee=pe,Z!==null&&(pe=At($,Z),pe!=null&&Pe.push(ni($,pe,ee)))),zt)break;$=$.return}0<Pe.length&&(de=new Se(de,Ne,null,i,fe),he.push({event:de,listeners:Pe}))}}if((r&7)===0){e:{if(de=t==="mouseover"||t==="pointerover",Se=t==="mouseout"||t==="pointerout",de&&i!==Zt&&(Ne=i.relatedTarget||i.fromElement)&&(Ca(Ne)||Ne[Ar]))break e;if((Se||de)&&(de=fe.window===fe?fe:(de=fe.ownerDocument)?de.defaultView||de.parentWindow:window,Se?(Ne=i.relatedTarget||i.toElement,Se=ne,Ne=Ne?Ca(Ne):null,Ne!==null&&(zt=ye(Ne),Ne!==zt||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(Se=null,Ne=ne),Se!==Ne)){if(Pe=Jf,pe="onMouseLeave",Z="onMouseEnter",$="mouse",(t==="pointerout"||t==="pointerover")&&(Pe=Qf,pe="onPointerLeave",Z="onPointerEnter",$="pointer"),zt=Se==null?de:ss(Se),ee=Ne==null?de:ss(Ne),de=new Pe(pe,$+"leave",Se,i,fe),de.target=zt,de.relatedTarget=ee,pe=null,Ca(fe)===ne&&(Pe=new Pe(Z,$+"enter",Ne,i,fe),Pe.target=ee,Pe.relatedTarget=zt,pe=Pe),zt=pe,Se&&Ne)t:{for(Pe=Se,Z=Ne,$=0,ee=Pe;ee;ee=rs(ee))$++;for(ee=0,pe=Z;pe;pe=rs(pe))ee++;for(;0<$-ee;)Pe=rs(Pe),$--;for(;0<ee-$;)Z=rs(Z),ee--;for(;$--;){if(Pe===Z||Z!==null&&Pe===Z.alternate)break t;Pe=rs(Pe),Z=rs(Z)}Pe=null}else Pe=null;Se!==null&&Ch(he,de,Se,Pe,!1),Ne!==null&&zt!==null&&Ch(he,zt,Ne,Pe,!0)}}e:{if(de=ne?ss(ne):window,Se=de.nodeName&&de.nodeName.toLowerCase(),Se==="select"||Se==="input"&&de.type==="file")var Me=d2;else if(ah(de))if(ih)Me=m2;else{Me=h2;var ze=f2}else(Se=de.nodeName)&&Se.toLowerCase()==="input"&&(de.type==="checkbox"||de.type==="radio")&&(Me=p2);if(Me&&(Me=Me(t,ne))){sh(he,Me,i,fe);break e}ze&&ze(t,de,ne),t==="focusout"&&(ze=de._wrapperState)&&ze.controlled&&de.type==="number"&&we(de,"number",de.value)}switch(ze=ne?ss(ne):window,t){case"focusin":(ah(ze)||ze.contentEditable==="true")&&(ts=ze,hc=ne,Zs=null);break;case"focusout":Zs=hc=ts=null;break;case"mousedown":pc=!0;break;case"contextmenu":case"mouseup":case"dragend":pc=!1,ph(he,i,fe);break;case"selectionchange":if(x2)break;case"keydown":case"keyup":ph(he,i,fe)}var Be;if(cc)e:{switch(t){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else es?nh(t,i)&&(We="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(We="onCompositionStart");We&&(Zf&&i.locale!=="ko"&&(es||We!=="onCompositionStart"?We==="onCompositionEnd"&&es&&(Be=Gf()):(Zr=fe,rc="value"in Zr?Zr.value:Zr.textContent,es=!0)),ze=fo(ne,We),0<ze.length&&(We=new qf(We,t,null,i,fe),he.push({event:We,listeners:ze}),Be?We.data=Be:(Be=rh(i),Be!==null&&(We.data=Be)))),(Be=i2?o2(t,i):l2(t,i))&&(ne=fo(ne,"onBeforeInput"),0<ne.length&&(fe=new qf("onBeforeInput","beforeinput",null,i,fe),he.push({event:fe,listeners:ne}),fe.data=Be))}kh(he,r)})}function ni(t,r,i){return{instance:t,listener:r,currentTarget:i}}function fo(t,r){for(var i=r+"Capture",c=[];t!==null;){var h=t,x=h.stateNode;h.tag===5&&x!==null&&(h=x,x=At(t,i),x!=null&&c.unshift(ni(t,x,h)),x=At(t,r),x!=null&&c.push(ni(t,x,h))),t=t.return}return c}function rs(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Ch(t,r,i,c,h){for(var x=r._reactName,k=[];i!==null&&i!==c;){var P=i,z=P.alternate,ne=P.stateNode;if(z!==null&&z===c)break;P.tag===5&&ne!==null&&(P=ne,h?(z=At(i,x),z!=null&&k.unshift(ni(i,z,P))):h||(z=At(i,x),z!=null&&k.push(ni(i,z,P)))),i=i.return}k.length!==0&&t.push({event:r,listeners:k})}var S2=/\r\n?/g,k2=/\u0000|\uFFFD/g;function Nh(t){return(typeof t=="string"?t:""+t).replace(S2,`
|
||
`).replace(k2,"")}function ho(t,r,i){if(r=Nh(r),Nh(t)!==r&&i)throw Error(a(425))}function po(){}var bc=null,wc=null;function Sc(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var kc=typeof setTimeout=="function"?setTimeout:void 0,j2=typeof clearTimeout=="function"?clearTimeout:void 0,Eh=typeof Promise=="function"?Promise:void 0,C2=typeof queueMicrotask=="function"?queueMicrotask:typeof Eh<"u"?function(t){return Eh.resolve(null).then(t).catch(N2)}:kc;function N2(t){setTimeout(function(){throw t})}function jc(t,r){var i=r,c=0;do{var h=i.nextSibling;if(t.removeChild(i),h&&h.nodeType===8)if(i=h.data,i==="/$"){if(c===0){t.removeChild(h),Ks(r);return}c--}else i!=="$"&&i!=="$?"&&i!=="$!"||c++;i=h}while(i);Ks(r)}function ta(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return t}function Th(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"){if(r===0)return t;r--}else i==="/$"&&r++}t=t.previousSibling}return null}var as=Math.random().toString(36).slice(2),br="__reactFiber$"+as,ri="__reactProps$"+as,Ar="__reactContainer$"+as,Cc="__reactEvents$"+as,E2="__reactListeners$"+as,T2="__reactHandles$"+as;function Ca(t){var r=t[br];if(r)return r;for(var i=t.parentNode;i;){if(r=i[Ar]||i[br]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(t=Th(t);t!==null;){if(i=t[br])return i;t=Th(t)}return r}t=i,i=t.parentNode}return null}function ai(t){return t=t[br]||t[Ar],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function ss(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(a(33))}function mo(t){return t[ri]||null}var Nc=[],is=-1;function na(t){return{current:t}}function Ct(t){0>is||(t.current=Nc[is],Nc[is]=null,is--)}function wt(t,r){is++,Nc[is]=t.current,t.current=r}var ra={},un=na(ra),jn=na(!1),Na=ra;function os(t,r){var i=t.type.contextTypes;if(!i)return ra;var c=t.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===r)return c.__reactInternalMemoizedMaskedChildContext;var h={},x;for(x in i)h[x]=r[x];return c&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=h),h}function Cn(t){return t=t.childContextTypes,t!=null}function go(){Ct(jn),Ct(un)}function Ph(t,r,i){if(un.current!==ra)throw Error(a(168));wt(un,r),wt(jn,i)}function Rh(t,r,i){var c=t.stateNode;if(r=r.childContextTypes,typeof c.getChildContext!="function")return i;c=c.getChildContext();for(var h in c)if(!(h in r))throw Error(a(108,ue(t)||"Unknown",h));return J({},i,c)}function yo(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ra,Na=un.current,wt(un,t),wt(jn,jn.current),!0}function Mh(t,r,i){var c=t.stateNode;if(!c)throw Error(a(169));i?(t=Rh(t,r,Na),c.__reactInternalMemoizedMergedChildContext=t,Ct(jn),Ct(un),wt(un,t)):Ct(jn),wt(jn,i)}var Or=null,xo=!1,Ec=!1;function Ih(t){Or===null?Or=[t]:Or.push(t)}function P2(t){xo=!0,Ih(t)}function aa(){if(!Ec&&Or!==null){Ec=!0;var t=0,r=mt;try{var i=Or;for(mt=1;t<i.length;t++){var c=i[t];do c=c(!0);while(c!==null)}Or=null,xo=!1}catch(h){throw Or!==null&&(Or=Or.slice(t+1)),ut(Fr,aa),h}finally{mt=r,Ec=!1}}return null}var ls=[],cs=0,vo=null,bo=0,Un=[],$n=0,Ea=null,zr=1,Br="";function Ta(t,r){ls[cs++]=bo,ls[cs++]=vo,vo=t,bo=r}function _h(t,r,i){Un[$n++]=zr,Un[$n++]=Br,Un[$n++]=Ea,Ea=t;var c=zr;t=Br;var h=32-ln(c)-1;c&=~(1<<h),i+=1;var x=32-ln(r)+h;if(30<x){var k=h-h%5;x=(c&(1<<k)-1).toString(32),c>>=k,h-=k,zr=1<<32-ln(r)+h|i<<h|c,Br=x+t}else zr=1<<x|i<<h|c,Br=t}function Tc(t){t.return!==null&&(Ta(t,1),_h(t,1,0))}function Pc(t){for(;t===vo;)vo=ls[--cs],ls[cs]=null,bo=ls[--cs],ls[cs]=null;for(;t===Ea;)Ea=Un[--$n],Un[$n]=null,Br=Un[--$n],Un[$n]=null,zr=Un[--$n],Un[$n]=null}var Fn=null,Ln=null,Tt=!1,sr=null;function Dh(t,r){var i=Yn(5,null,null,0);i.elementType="DELETED",i.stateNode=r,i.return=t,r=t.deletions,r===null?(t.deletions=[i],t.flags|=16):r.push(i)}function Fh(t,r){switch(t.tag){case 5:var i=t.type;return r=r.nodeType!==1||i.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(t.stateNode=r,Fn=t,Ln=ta(r.firstChild),!0):!1;case 6:return r=t.pendingProps===""||r.nodeType!==3?null:r,r!==null?(t.stateNode=r,Fn=t,Ln=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(i=Ea!==null?{id:zr,overflow:Br}:null,t.memoizedState={dehydrated:r,treeContext:i,retryLane:1073741824},i=Yn(18,null,null,0),i.stateNode=r,i.return=t,t.child=i,Fn=t,Ln=null,!0):!1;default:return!1}}function Rc(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Mc(t){if(Tt){var r=Ln;if(r){var i=r;if(!Fh(t,r)){if(Rc(t))throw Error(a(418));r=ta(i.nextSibling);var c=Fn;r&&Fh(t,r)?Dh(c,i):(t.flags=t.flags&-4097|2,Tt=!1,Fn=t)}}else{if(Rc(t))throw Error(a(418));t.flags=t.flags&-4097|2,Tt=!1,Fn=t}}}function Lh(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Fn=t}function wo(t){if(t!==Fn)return!1;if(!Tt)return Lh(t),Tt=!0,!1;var r;if((r=t.tag!==3)&&!(r=t.tag!==5)&&(r=t.type,r=r!=="head"&&r!=="body"&&!Sc(t.type,t.memoizedProps)),r&&(r=Ln)){if(Rc(t))throw Ah(),Error(a(418));for(;r;)Dh(t,r),r=ta(r.nextSibling)}if(Lh(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));e:{for(t=t.nextSibling,r=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"){if(r===0){Ln=ta(t.nextSibling);break e}r--}else i!=="$"&&i!=="$!"&&i!=="$?"||r++}t=t.nextSibling}Ln=null}}else Ln=Fn?ta(t.stateNode.nextSibling):null;return!0}function Ah(){for(var t=Ln;t;)t=ta(t.nextSibling)}function us(){Ln=Fn=null,Tt=!1}function Ic(t){sr===null?sr=[t]:sr.push(t)}var R2=H.ReactCurrentBatchConfig;function si(t,r,i){if(t=i.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(a(309));var c=i.stateNode}if(!c)throw Error(a(147,t));var h=c,x=""+t;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===x?r.ref:(r=function(k){var P=h.refs;k===null?delete P[x]:P[x]=k},r._stringRef=x,r)}if(typeof t!="string")throw Error(a(284));if(!i._owner)throw Error(a(290,t))}return t}function So(t,r){throw t=Object.prototype.toString.call(r),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t))}function Oh(t){var r=t._init;return r(t._payload)}function zh(t){function r(Z,$){if(t){var ee=Z.deletions;ee===null?(Z.deletions=[$],Z.flags|=16):ee.push($)}}function i(Z,$){if(!t)return null;for(;$!==null;)r(Z,$),$=$.sibling;return null}function c(Z,$){for(Z=new Map;$!==null;)$.key!==null?Z.set($.key,$):Z.set($.index,$),$=$.sibling;return Z}function h(Z,$){return Z=fa(Z,$),Z.index=0,Z.sibling=null,Z}function x(Z,$,ee){return Z.index=ee,t?(ee=Z.alternate,ee!==null?(ee=ee.index,ee<$?(Z.flags|=2,$):ee):(Z.flags|=2,$)):(Z.flags|=1048576,$)}function k(Z){return t&&Z.alternate===null&&(Z.flags|=2),Z}function P(Z,$,ee,pe){return $===null||$.tag!==6?($=ku(ee,Z.mode,pe),$.return=Z,$):($=h($,ee),$.return=Z,$)}function z(Z,$,ee,pe){var Me=ee.type;return Me===O?fe(Z,$,ee.props.children,pe,ee.key):$!==null&&($.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===G&&Oh(Me)===$.type)?(pe=h($,ee.props),pe.ref=si(Z,$,ee),pe.return=Z,pe):(pe=Ko(ee.type,ee.key,ee.props,null,Z.mode,pe),pe.ref=si(Z,$,ee),pe.return=Z,pe)}function ne(Z,$,ee,pe){return $===null||$.tag!==4||$.stateNode.containerInfo!==ee.containerInfo||$.stateNode.implementation!==ee.implementation?($=ju(ee,Z.mode,pe),$.return=Z,$):($=h($,ee.children||[]),$.return=Z,$)}function fe(Z,$,ee,pe,Me){return $===null||$.tag!==7?($=La(ee,Z.mode,pe,Me),$.return=Z,$):($=h($,ee),$.return=Z,$)}function he(Z,$,ee){if(typeof $=="string"&&$!==""||typeof $=="number")return $=ku(""+$,Z.mode,ee),$.return=Z,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case K:return ee=Ko($.type,$.key,$.props,null,Z.mode,ee),ee.ref=si(Z,null,$),ee.return=Z,ee;case re:return $=ju($,Z.mode,ee),$.return=Z,$;case G:var pe=$._init;return he(Z,pe($._payload),ee)}if(me($)||X($))return $=La($,Z.mode,ee,null),$.return=Z,$;So(Z,$)}return null}function de(Z,$,ee,pe){var Me=$!==null?$.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number")return Me!==null?null:P(Z,$,""+ee,pe);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case K:return ee.key===Me?z(Z,$,ee,pe):null;case re:return ee.key===Me?ne(Z,$,ee,pe):null;case G:return Me=ee._init,de(Z,$,Me(ee._payload),pe)}if(me(ee)||X(ee))return Me!==null?null:fe(Z,$,ee,pe,null);So(Z,ee)}return null}function Se(Z,$,ee,pe,Me){if(typeof pe=="string"&&pe!==""||typeof pe=="number")return Z=Z.get(ee)||null,P($,Z,""+pe,Me);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case K:return Z=Z.get(pe.key===null?ee:pe.key)||null,z($,Z,pe,Me);case re:return Z=Z.get(pe.key===null?ee:pe.key)||null,ne($,Z,pe,Me);case G:var ze=pe._init;return Se(Z,$,ee,ze(pe._payload),Me)}if(me(pe)||X(pe))return Z=Z.get(ee)||null,fe($,Z,pe,Me,null);So($,pe)}return null}function Ne(Z,$,ee,pe){for(var Me=null,ze=null,Be=$,We=$=0,qt=null;Be!==null&&We<ee.length;We++){Be.index>We?(qt=Be,Be=null):qt=Be.sibling;var ct=de(Z,Be,ee[We],pe);if(ct===null){Be===null&&(Be=qt);break}t&&Be&&ct.alternate===null&&r(Z,Be),$=x(ct,$,We),ze===null?Me=ct:ze.sibling=ct,ze=ct,Be=qt}if(We===ee.length)return i(Z,Be),Tt&&Ta(Z,We),Me;if(Be===null){for(;We<ee.length;We++)Be=he(Z,ee[We],pe),Be!==null&&($=x(Be,$,We),ze===null?Me=Be:ze.sibling=Be,ze=Be);return Tt&&Ta(Z,We),Me}for(Be=c(Z,Be);We<ee.length;We++)qt=Se(Be,Z,We,ee[We],pe),qt!==null&&(t&&qt.alternate!==null&&Be.delete(qt.key===null?We:qt.key),$=x(qt,$,We),ze===null?Me=qt:ze.sibling=qt,ze=qt);return t&&Be.forEach(function(ha){return r(Z,ha)}),Tt&&Ta(Z,We),Me}function Pe(Z,$,ee,pe){var Me=X(ee);if(typeof Me!="function")throw Error(a(150));if(ee=Me.call(ee),ee==null)throw Error(a(151));for(var ze=Me=null,Be=$,We=$=0,qt=null,ct=ee.next();Be!==null&&!ct.done;We++,ct=ee.next()){Be.index>We?(qt=Be,Be=null):qt=Be.sibling;var ha=de(Z,Be,ct.value,pe);if(ha===null){Be===null&&(Be=qt);break}t&&Be&&ha.alternate===null&&r(Z,Be),$=x(ha,$,We),ze===null?Me=ha:ze.sibling=ha,ze=ha,Be=qt}if(ct.done)return i(Z,Be),Tt&&Ta(Z,We),Me;if(Be===null){for(;!ct.done;We++,ct=ee.next())ct=he(Z,ct.value,pe),ct!==null&&($=x(ct,$,We),ze===null?Me=ct:ze.sibling=ct,ze=ct);return Tt&&Ta(Z,We),Me}for(Be=c(Z,Be);!ct.done;We++,ct=ee.next())ct=Se(Be,Z,We,ct.value,pe),ct!==null&&(t&&ct.alternate!==null&&Be.delete(ct.key===null?We:ct.key),$=x(ct,$,We),ze===null?Me=ct:ze.sibling=ct,ze=ct);return t&&Be.forEach(function(cv){return r(Z,cv)}),Tt&&Ta(Z,We),Me}function zt(Z,$,ee,pe){if(typeof ee=="object"&&ee!==null&&ee.type===O&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case K:e:{for(var Me=ee.key,ze=$;ze!==null;){if(ze.key===Me){if(Me=ee.type,Me===O){if(ze.tag===7){i(Z,ze.sibling),$=h(ze,ee.props.children),$.return=Z,Z=$;break e}}else if(ze.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===G&&Oh(Me)===ze.type){i(Z,ze.sibling),$=h(ze,ee.props),$.ref=si(Z,ze,ee),$.return=Z,Z=$;break e}i(Z,ze);break}else r(Z,ze);ze=ze.sibling}ee.type===O?($=La(ee.props.children,Z.mode,pe,ee.key),$.return=Z,Z=$):(pe=Ko(ee.type,ee.key,ee.props,null,Z.mode,pe),pe.ref=si(Z,$,ee),pe.return=Z,Z=pe)}return k(Z);case re:e:{for(ze=ee.key;$!==null;){if($.key===ze)if($.tag===4&&$.stateNode.containerInfo===ee.containerInfo&&$.stateNode.implementation===ee.implementation){i(Z,$.sibling),$=h($,ee.children||[]),$.return=Z,Z=$;break e}else{i(Z,$);break}else r(Z,$);$=$.sibling}$=ju(ee,Z.mode,pe),$.return=Z,Z=$}return k(Z);case G:return ze=ee._init,zt(Z,$,ze(ee._payload),pe)}if(me(ee))return Ne(Z,$,ee,pe);if(X(ee))return Pe(Z,$,ee,pe);So(Z,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,$!==null&&$.tag===6?(i(Z,$.sibling),$=h($,ee),$.return=Z,Z=$):(i(Z,$),$=ku(ee,Z.mode,pe),$.return=Z,Z=$),k(Z)):i(Z,$)}return zt}var ds=zh(!0),Bh=zh(!1),ko=na(null),jo=null,fs=null,_c=null;function Dc(){_c=fs=jo=null}function Fc(t){var r=ko.current;Ct(ko),t._currentValue=r}function Lc(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){jo=t,_c=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(_c!==t)if(t={context:t,memoizedValue:r,next:null},fs===null){if(jo===null)throw Error(a(308));fs=t,jo.dependencies={lanes:0,firstContext:t}}else fs=fs.next=t;return r}var Pa=null;function Ac(t){Pa===null?Pa=[t]:Pa.push(t)}function Vh(t,r,i,c){var h=r.interleaved;return h===null?(i.next=i,Ac(r)):(i.next=h.next,h.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 sa=!1;function Oc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Uh(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 ia(t,r,i){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(lt&2)!==0){var h=c.pending;return h===null?r.next=r:(r.next=h.next,h.next=r),c.pending=r,Vr(t,i)}return h=c.interleaved,h===null?(r.next=r,Ac(c)):(r.next=h.next,h.next=r),c.interleaved=r,Vr(t,i)}function Co(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,Ql(t,i)}}function $h(t,r){var i=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,i===c)){var h=null,x=null;if(i=i.firstBaseUpdate,i!==null){do{var k={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};x===null?h=x=k:x=x.next=k,i=i.next}while(i!==null);x===null?h=x=r:x=x.next=r}else h=x=r;i={baseState:c.baseState,firstBaseUpdate:h,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 No(t,r,i,c){var h=t.updateQueue;sa=!1;var x=h.firstBaseUpdate,k=h.lastBaseUpdate,P=h.shared.pending;if(P!==null){h.shared.pending=null;var z=P,ne=z.next;z.next=null,k===null?x=ne:k.next=ne,k=z;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,P=fe.lastBaseUpdate,P!==k&&(P===null?fe.firstBaseUpdate=ne:P.next=ne,fe.lastBaseUpdate=z))}if(x!==null){var he=h.baseState;k=0,fe=ne=z=null,P=x;do{var de=P.lane,Se=P.eventTime;if((c&de)===de){fe!==null&&(fe=fe.next={eventTime:Se,lane:0,tag:P.tag,payload:P.payload,callback:P.callback,next:null});e:{var Ne=t,Pe=P;switch(de=r,Se=i,Pe.tag){case 1:if(Ne=Pe.payload,typeof Ne=="function"){he=Ne.call(Se,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(Se,he,de):Ne,de==null)break e;he=J({},he,de);break e;case 2:sa=!0}}P.callback!==null&&P.lane!==0&&(t.flags|=64,de=h.effects,de===null?h.effects=[P]:de.push(P))}else Se={eventTime:Se,lane:de,tag:P.tag,payload:P.payload,callback:P.callback,next:null},fe===null?(ne=fe=Se,z=he):fe=fe.next=Se,k|=de;if(P=P.next,P===null){if(P=h.shared.pending,P===null)break;de=P,P=de.next,de.next=null,h.lastBaseUpdate=de,h.shared.pending=null}}while(!0);if(fe===null&&(z=he),h.baseState=z,h.firstBaseUpdate=ne,h.lastBaseUpdate=fe,r=h.shared.interleaved,r!==null){h=r;do k|=h.lane,h=h.next;while(h!==r)}else x===null&&(h.shared.lanes=0);Ia|=k,t.lanes=k,t.memoizedState=he}}function Hh(t,r,i){if(t=r.effects,r.effects=null,t!==null)for(r=0;r<t.length;r++){var c=t[r],h=c.callback;if(h!==null){if(c.callback=null,c=i,typeof h!="function")throw Error(a(191,h));h.call(c)}}}var ii={},wr=na(ii),oi=na(ii),li=na(ii);function Ra(t){if(t===ii)throw Error(a(174));return t}function zc(t,r){switch(wt(li,r),wt(oi,t),wt(wr,ii),t=r.nodeType,t){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:ht(null,"");break;default:t=t===8?r.parentNode:r,r=t.namespaceURI||null,t=t.tagName,r=ht(r,t)}Ct(wr),wt(wr,r)}function ps(){Ct(wr),Ct(oi),Ct(li)}function Wh(t){Ra(li.current);var r=Ra(wr.current),i=ht(r,t.type);r!==i&&(wt(oi,t),wt(wr,i))}function Bc(t){oi.current===t&&(Ct(wr),Ct(oi))}var Rt=na(0);function Eo(t){for(var r=t;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Vc=[];function Uc(){for(var t=0;t<Vc.length;t++)Vc[t]._workInProgressVersionPrimary=null;Vc.length=0}var To=H.ReactCurrentDispatcher,$c=H.ReactCurrentBatchConfig,Ma=0,Mt=null,Wt=null,Xt=null,Po=!1,ci=!1,ui=0,M2=0;function dn(){throw Error(a(321))}function Hc(t,r){if(r===null)return!1;for(var i=0;i<r.length&&i<t.length;i++)if(!ar(t[i],r[i]))return!1;return!0}function Wc(t,r,i,c,h,x){if(Ma=x,Mt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,To.current=t===null||t.memoizedState===null?F2:L2,t=i(c,h),ci){x=0;do{if(ci=!1,ui=0,25<=x)throw Error(a(301));x+=1,Xt=Wt=null,r.updateQueue=null,To.current=A2,t=i(c,h)}while(ci)}if(To.current=Io,r=Wt!==null&&Wt.next!==null,Ma=0,Xt=Wt=Mt=null,Po=!1,r)throw Error(a(300));return t}function Kc(){var t=ui!==0;return ui=0,t}function Sr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?Mt.memoizedState=Xt=t:Xt=Xt.next=t,Xt}function Wn(){if(Wt===null){var t=Mt.alternate;t=t!==null?t.memoizedState:null}else t=Wt.next;var r=Xt===null?Mt.memoizedState:Xt.next;if(r!==null)Xt=r,Wt=t;else{if(t===null)throw Error(a(310));Wt=t,t={memoizedState:Wt.memoizedState,baseState:Wt.baseState,baseQueue:Wt.baseQueue,queue:Wt.queue,next:null},Xt===null?Mt.memoizedState=Xt=t:Xt=Xt.next=t}return Xt}function di(t,r){return typeof r=="function"?r(t):r}function Yc(t){var r=Wn(),i=r.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=t;var c=Wt,h=c.baseQueue,x=i.pending;if(x!==null){if(h!==null){var k=h.next;h.next=x.next,x.next=k}c.baseQueue=h=x,i.pending=null}if(h!==null){x=h.next,c=c.baseState;var P=k=null,z=null,ne=x;do{var fe=ne.lane;if((Ma&fe)===fe)z!==null&&(z=z.next={lane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),c=ne.hasEagerState?ne.eagerState:t(c,ne.action);else{var he={lane:fe,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null};z===null?(P=z=he,k=c):z=z.next=he,Mt.lanes|=fe,Ia|=fe}ne=ne.next}while(ne!==null&&ne!==x);z===null?k=c:z.next=P,ar(c,r.memoizedState)||(Nn=!0),r.memoizedState=c,r.baseState=k,r.baseQueue=z,i.lastRenderedState=c}if(t=i.interleaved,t!==null){h=t;do x=h.lane,Mt.lanes|=x,Ia|=x,h=h.next;while(h!==t)}else h===null&&(i.lanes=0);return[r.memoizedState,i.dispatch]}function Gc(t){var r=Wn(),i=r.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=t;var c=i.dispatch,h=i.pending,x=r.memoizedState;if(h!==null){i.pending=null;var k=h=h.next;do x=t(x,k.action),k=k.next;while(k!==h);ar(x,r.memoizedState)||(Nn=!0),r.memoizedState=x,r.baseQueue===null&&(r.baseState=x),i.lastRenderedState=x}return[x,c]}function Kh(){}function Yh(t,r){var i=Mt,c=Wn(),h=r(),x=!ar(c.memoizedState,h);if(x&&(c.memoizedState=h,Nn=!0),c=c.queue,Xc(Jh.bind(null,i,c,t),[t]),c.getSnapshot!==r||x||Xt!==null&&Xt.memoizedState.tag&1){if(i.flags|=2048,fi(9,Xh.bind(null,i,c,h,r),void 0,null),Jt===null)throw Error(a(349));(Ma&30)!==0||Gh(i,r,h)}return h}function Gh(t,r,i){t.flags|=16384,t={getSnapshot:r,value:i},r=Mt.updateQueue,r===null?(r={lastEffect:null,stores:null},Mt.updateQueue=r,r.stores=[t]):(i=r.stores,i===null?r.stores=[t]:i.push(t))}function Xh(t,r,i,c){r.value=i,r.getSnapshot=c,qh(r)&&Qh(t)}function Jh(t,r,i){return i(function(){qh(r)&&Qh(t)})}function qh(t){var r=t.getSnapshot;t=t.value;try{var i=r();return!ar(t,i)}catch{return!0}}function Qh(t){var r=Vr(t,1);r!==null&&cr(r,t,1,-1)}function Zh(t){var r=Sr();return typeof t=="function"&&(t=t()),r.memoizedState=r.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:di,lastRenderedState:t},r.queue=t,t=t.dispatch=D2.bind(null,Mt,t),[r.memoizedState,t]}function fi(t,r,i,c){return t={tag:t,create:r,destroy:i,deps:c,next:null},r=Mt.updateQueue,r===null?(r={lastEffect:null,stores:null},Mt.updateQueue=r,r.lastEffect=t.next=t):(i=r.lastEffect,i===null?r.lastEffect=t.next=t:(c=i.next,i.next=t,t.next=c,r.lastEffect=t)),t}function e0(){return Wn().memoizedState}function Ro(t,r,i,c){var h=Sr();Mt.flags|=t,h.memoizedState=fi(1|r,i,void 0,c===void 0?null:c)}function Mo(t,r,i,c){var h=Wn();c=c===void 0?null:c;var x=void 0;if(Wt!==null){var k=Wt.memoizedState;if(x=k.destroy,c!==null&&Hc(c,k.deps)){h.memoizedState=fi(r,i,x,c);return}}Mt.flags|=t,h.memoizedState=fi(1|r,i,x,c)}function t0(t,r){return Ro(8390656,8,t,r)}function Xc(t,r){return Mo(2048,8,t,r)}function n0(t,r){return Mo(4,2,t,r)}function r0(t,r){return Mo(4,4,t,r)}function a0(t,r){if(typeof r=="function")return t=t(),r(t),function(){r(null)};if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function s0(t,r,i){return i=i!=null?i.concat([t]):null,Mo(4,4,a0.bind(null,r,t),i)}function Jc(){}function i0(t,r){var i=Wn();r=r===void 0?null:r;var c=i.memoizedState;return c!==null&&r!==null&&Hc(r,c[1])?c[0]:(i.memoizedState=[t,r],t)}function o0(t,r){var i=Wn();r=r===void 0?null:r;var c=i.memoizedState;return c!==null&&r!==null&&Hc(r,c[1])?c[0]:(t=t(),i.memoizedState=[t,r],t)}function l0(t,r,i){return(Ma&21)===0?(t.baseState&&(t.baseState=!1,Nn=!0),t.memoizedState=i):(ar(i,r)||(i=Qi(),Mt.lanes|=i,Ia|=i,t.baseState=!0),r)}function I2(t,r){var i=mt;mt=i!==0&&4>i?i:4,t(!0);var c=$c.transition;$c.transition={};try{t(!1),r()}finally{mt=i,$c.transition=c}}function c0(){return Wn().memoizedState}function _2(t,r,i){var c=ua(t);if(i={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null},u0(t))d0(r,i);else if(i=Vh(t,r,i,c),i!==null){var h=vn();cr(i,t,c,h),f0(i,r,c)}}function D2(t,r,i){var c=ua(t),h={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null};if(u0(t))d0(r,h);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=r.lastRenderedReducer,x!==null))try{var k=r.lastRenderedState,P=x(k,i);if(h.hasEagerState=!0,h.eagerState=P,ar(P,k)){var z=r.interleaved;z===null?(h.next=h,Ac(r)):(h.next=z.next,z.next=h),r.interleaved=h;return}}catch{}finally{}i=Vh(t,r,h,c),i!==null&&(h=vn(),cr(i,t,c,h),f0(i,r,c))}}function u0(t){var r=t.alternate;return t===Mt||r!==null&&r===Mt}function d0(t,r){ci=Po=!0;var i=t.pending;i===null?r.next=r:(r.next=i.next,i.next=r),t.pending=r}function f0(t,r,i){if((i&4194240)!==0){var c=r.lanes;c&=t.pendingLanes,i|=c,r.lanes=i,Ql(t,i)}}var Io={readContext:Hn,useCallback:dn,useContext:dn,useEffect:dn,useImperativeHandle:dn,useInsertionEffect:dn,useLayoutEffect:dn,useMemo:dn,useReducer:dn,useRef:dn,useState:dn,useDebugValue:dn,useDeferredValue:dn,useTransition:dn,useMutableSource:dn,useSyncExternalStore:dn,useId:dn,unstable_isNewReconciler:!1},F2={readContext:Hn,useCallback:function(t,r){return Sr().memoizedState=[t,r===void 0?null:r],t},useContext:Hn,useEffect:t0,useImperativeHandle:function(t,r,i){return i=i!=null?i.concat([t]):null,Ro(4194308,4,a0.bind(null,r,t),i)},useLayoutEffect:function(t,r){return Ro(4194308,4,t,r)},useInsertionEffect:function(t,r){return Ro(4,2,t,r)},useMemo:function(t,r){var i=Sr();return r=r===void 0?null:r,t=t(),i.memoizedState=[t,r],t},useReducer:function(t,r,i){var c=Sr();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=_2.bind(null,Mt,t),[c.memoizedState,t]},useRef:function(t){var r=Sr();return t={current:t},r.memoizedState=t},useState:Zh,useDebugValue:Jc,useDeferredValue:function(t){return Sr().memoizedState=t},useTransition:function(){var t=Zh(!1),r=t[0];return t=I2.bind(null,t[1]),Sr().memoizedState=t,[r,t]},useMutableSource:function(){},useSyncExternalStore:function(t,r,i){var c=Mt,h=Sr();if(Tt){if(i===void 0)throw Error(a(407));i=i()}else{if(i=r(),Jt===null)throw Error(a(349));(Ma&30)!==0||Gh(c,r,i)}h.memoizedState=i;var x={value:i,getSnapshot:r};return h.queue=x,t0(Jh.bind(null,c,x,t),[t]),c.flags|=2048,fi(9,Xh.bind(null,c,x,i,r),void 0,null),i},useId:function(){var t=Sr(),r=Jt.identifierPrefix;if(Tt){var i=Br,c=zr;i=(c&~(1<<32-ln(c)-1)).toString(32)+i,r=":"+r+"R"+i,i=ui++,0<i&&(r+="H"+i.toString(32)),r+=":"}else i=M2++,r=":"+r+"r"+i.toString(32)+":";return t.memoizedState=r},unstable_isNewReconciler:!1},L2={readContext:Hn,useCallback:i0,useContext:Hn,useEffect:Xc,useImperativeHandle:s0,useInsertionEffect:n0,useLayoutEffect:r0,useMemo:o0,useReducer:Yc,useRef:e0,useState:function(){return Yc(di)},useDebugValue:Jc,useDeferredValue:function(t){var r=Wn();return l0(r,Wt.memoizedState,t)},useTransition:function(){var t=Yc(di)[0],r=Wn().memoizedState;return[t,r]},useMutableSource:Kh,useSyncExternalStore:Yh,useId:c0,unstable_isNewReconciler:!1},A2={readContext:Hn,useCallback:i0,useContext:Hn,useEffect:Xc,useImperativeHandle:s0,useInsertionEffect:n0,useLayoutEffect:r0,useMemo:o0,useReducer:Gc,useRef:e0,useState:function(){return Gc(di)},useDebugValue:Jc,useDeferredValue:function(t){var r=Wn();return Wt===null?r.memoizedState=t:l0(r,Wt.memoizedState,t)},useTransition:function(){var t=Gc(di)[0],r=Wn().memoizedState;return[t,r]},useMutableSource:Kh,useSyncExternalStore:Yh,useId:c0,unstable_isNewReconciler:!1};function ir(t,r){if(t&&t.defaultProps){r=J({},r),t=t.defaultProps;for(var i in t)r[i]===void 0&&(r[i]=t[i]);return r}return r}function qc(t,r,i,c){r=t.memoizedState,i=i(c,r),i=i==null?r:J({},r,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var _o={isMounted:function(t){return(t=t._reactInternals)?ye(t)===t:!1},enqueueSetState:function(t,r,i){t=t._reactInternals;var c=vn(),h=ua(t),x=Ur(c,h);x.payload=r,i!=null&&(x.callback=i),r=ia(t,x,h),r!==null&&(cr(r,t,h,c),Co(r,t,h))},enqueueReplaceState:function(t,r,i){t=t._reactInternals;var c=vn(),h=ua(t),x=Ur(c,h);x.tag=1,x.payload=r,i!=null&&(x.callback=i),r=ia(t,x,h),r!==null&&(cr(r,t,h,c),Co(r,t,h))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var i=vn(),c=ua(t),h=Ur(i,c);h.tag=2,r!=null&&(h.callback=r),r=ia(t,h,c),r!==null&&(cr(r,t,c,i),Co(r,t,c))}};function h0(t,r,i,c,h,x,k){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,x,k):r.prototype&&r.prototype.isPureReactComponent?!Qs(i,c)||!Qs(h,x):!0}function p0(t,r,i){var c=!1,h=ra,x=r.contextType;return typeof x=="object"&&x!==null?x=Hn(x):(h=Cn(r)?Na:un.current,c=r.contextTypes,x=(c=c!=null)?os(t,h):ra),r=new r(i,x),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=_o,t.stateNode=r,r._reactInternals=t,c&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=h,t.__reactInternalMemoizedMaskedChildContext=x),r}function m0(t,r,i,c){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,c),r.state!==t&&_o.enqueueReplaceState(r,r.state,null)}function Qc(t,r,i,c){var h=t.stateNode;h.props=i,h.state=t.memoizedState,h.refs={},Oc(t);var x=r.contextType;typeof x=="object"&&x!==null?h.context=Hn(x):(x=Cn(r)?Na:un.current,h.context=os(t,x)),h.state=t.memoizedState,x=r.getDerivedStateFromProps,typeof x=="function"&&(qc(t,r,x,i),h.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(r=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),r!==h.state&&_o.enqueueReplaceState(h,h.state,null),No(t,i,h,c),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308)}function ms(t,r){try{var i="",c=r;do i+=oe(c),c=c.return;while(c);var h=i}catch(x){h=`
|
||
Error generating stack: `+x.message+`
|
||
`+x.stack}return{value:t,source:r,stack:h,digest:null}}function Zc(t,r,i){return{value:t,source:null,stack:i??null,digest:r??null}}function eu(t,r){try{console.error(r.value)}catch(i){setTimeout(function(){throw i})}}var O2=typeof WeakMap=="function"?WeakMap:Map;function g0(t,r,i){i=Ur(-1,i),i.tag=3,i.payload={element:null};var c=r.value;return i.callback=function(){Bo||(Bo=!0,mu=c),eu(t,r)},i}function y0(t,r,i){i=Ur(-1,i),i.tag=3;var c=t.type.getDerivedStateFromError;if(typeof c=="function"){var h=r.value;i.payload=function(){return c(h)},i.callback=function(){eu(t,r)}}var x=t.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(i.callback=function(){eu(t,r),typeof c!="function"&&(la===null?la=new Set([this]):la.add(this));var k=r.stack;this.componentDidCatch(r.value,{componentStack:k!==null?k:""})}),i}function x0(t,r,i){var c=t.pingCache;if(c===null){c=t.pingCache=new O2;var h=new Set;c.set(r,h)}else h=c.get(r),h===void 0&&(h=new Set,c.set(r,h));h.has(i)||(h.add(i),t=Q2.bind(null,t,r,i),r.then(t,t))}function v0(t){do{var r;if((r=t.tag===13)&&(r=t.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return t;t=t.return}while(t!==null);return null}function b0(t,r,i,c,h){return(t.mode&1)===0?(t===r?t.flags|=65536:(t.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(r=Ur(-1,1),r.tag=2,ia(i,r,1))),i.lanes|=1),t):(t.flags|=65536,t.lanes=h,t)}var z2=H.ReactCurrentOwner,Nn=!1;function xn(t,r,i,c){r.child=t===null?Bh(r,null,i,c):ds(r,t.child,i,c)}function w0(t,r,i,c,h){i=i.render;var x=r.ref;return hs(r,h),c=Wc(t,r,i,c,x,h),i=Kc(),t!==null&&!Nn?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~h,$r(t,r,h)):(Tt&&i&&Tc(r),r.flags|=1,xn(t,r,c,h),r.child)}function S0(t,r,i,c,h){if(t===null){var x=i.type;return typeof x=="function"&&!Su(x)&&x.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(r.tag=15,r.type=x,k0(t,r,x,c,h)):(t=Ko(i.type,null,c,r,r.mode,h),t.ref=r.ref,t.return=r,r.child=t)}if(x=t.child,(t.lanes&h)===0){var k=x.memoizedProps;if(i=i.compare,i=i!==null?i:Qs,i(k,c)&&t.ref===r.ref)return $r(t,r,h)}return r.flags|=1,t=fa(x,c),t.ref=r.ref,t.return=r,r.child=t}function k0(t,r,i,c,h){if(t!==null){var x=t.memoizedProps;if(Qs(x,c)&&t.ref===r.ref)if(Nn=!1,r.pendingProps=c=x,(t.lanes&h)!==0)(t.flags&131072)!==0&&(Nn=!0);else return r.lanes=t.lanes,$r(t,r,h)}return tu(t,r,i,c,h)}function j0(t,r,i){var c=r.pendingProps,h=c.children,x=t!==null?t.memoizedState:null;if(c.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},wt(ys,An),An|=i;else{if((i&1073741824)===0)return t=x!==null?x.baseLanes|i:i,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:t,cachePool:null,transitions:null},r.updateQueue=null,wt(ys,An),An|=t,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},c=x!==null?x.baseLanes:i,wt(ys,An),An|=c}else x!==null?(c=x.baseLanes|i,r.memoizedState=null):c=i,wt(ys,An),An|=c;return xn(t,r,h,i),r.child}function C0(t,r){var i=r.ref;(t===null&&i!==null||t!==null&&t.ref!==i)&&(r.flags|=512,r.flags|=2097152)}function tu(t,r,i,c,h){var x=Cn(i)?Na:un.current;return x=os(r,x),hs(r,h),i=Wc(t,r,i,c,x,h),c=Kc(),t!==null&&!Nn?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~h,$r(t,r,h)):(Tt&&c&&Tc(r),r.flags|=1,xn(t,r,i,h),r.child)}function N0(t,r,i,c,h){if(Cn(i)){var x=!0;yo(r)}else x=!1;if(hs(r,h),r.stateNode===null)Fo(t,r),p0(r,i,c),Qc(r,i,c,h),c=!0;else if(t===null){var k=r.stateNode,P=r.memoizedProps;k.props=P;var z=k.context,ne=i.contextType;typeof ne=="object"&&ne!==null?ne=Hn(ne):(ne=Cn(i)?Na:un.current,ne=os(r,ne));var fe=i.getDerivedStateFromProps,he=typeof fe=="function"||typeof k.getSnapshotBeforeUpdate=="function";he||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(P!==c||z!==ne)&&m0(r,k,c,ne),sa=!1;var de=r.memoizedState;k.state=de,No(r,c,k,h),z=r.memoizedState,P!==c||de!==z||jn.current||sa?(typeof fe=="function"&&(qc(r,i,fe,c),z=r.memoizedState),(P=sa||h0(r,i,P,c,de,z,ne))?(he||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(r.flags|=4194308)):(typeof k.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=z),k.props=c,k.state=z,k.context=ne,c=P):(typeof k.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{k=r.stateNode,Uh(t,r),P=r.memoizedProps,ne=r.type===r.elementType?P:ir(r.type,P),k.props=ne,he=r.pendingProps,de=k.context,z=i.contextType,typeof z=="object"&&z!==null?z=Hn(z):(z=Cn(i)?Na:un.current,z=os(r,z));var Se=i.getDerivedStateFromProps;(fe=typeof Se=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(P!==he||de!==z)&&m0(r,k,c,z),sa=!1,de=r.memoizedState,k.state=de,No(r,c,k,h);var Ne=r.memoizedState;P!==he||de!==Ne||jn.current||sa?(typeof Se=="function"&&(qc(r,i,Se,c),Ne=r.memoizedState),(ne=sa||h0(r,i,ne,c,de,Ne,z)||!1)?(fe||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(c,Ne,z),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(c,Ne,z)),typeof k.componentDidUpdate=="function"&&(r.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof k.componentDidUpdate!="function"||P===t.memoizedProps&&de===t.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||P===t.memoizedProps&&de===t.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=Ne),k.props=c,k.state=Ne,k.context=z,c=ne):(typeof k.componentDidUpdate!="function"||P===t.memoizedProps&&de===t.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||P===t.memoizedProps&&de===t.memoizedState||(r.flags|=1024),c=!1)}return nu(t,r,i,c,x,h)}function nu(t,r,i,c,h,x){C0(t,r);var k=(r.flags&128)!==0;if(!c&&!k)return h&&Mh(r,i,!1),$r(t,r,x);c=r.stateNode,z2.current=r;var P=k&&typeof i.getDerivedStateFromError!="function"?null:c.render();return r.flags|=1,t!==null&&k?(r.child=ds(r,t.child,null,x),r.child=ds(r,null,P,x)):xn(t,r,P,x),r.memoizedState=c.state,h&&Mh(r,i,!0),r.child}function E0(t){var r=t.stateNode;r.pendingContext?Ph(t,r.pendingContext,r.pendingContext!==r.context):r.context&&Ph(t,r.context,!1),zc(t,r.containerInfo)}function T0(t,r,i,c,h){return us(),Ic(h),r.flags|=256,xn(t,r,i,c),r.child}var ru={dehydrated:null,treeContext:null,retryLane:0};function au(t){return{baseLanes:t,cachePool:null,transitions:null}}function P0(t,r,i){var c=r.pendingProps,h=Rt.current,x=!1,k=(r.flags&128)!==0,P;if((P=k)||(P=t!==null&&t.memoizedState===null?!1:(h&2)!==0),P?(x=!0,r.flags&=-129):(t===null||t.memoizedState!==null)&&(h|=1),wt(Rt,h&1),t===null)return Mc(r),t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((r.mode&1)===0?r.lanes=1:t.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(k=c.children,t=c.fallback,x?(c=r.mode,x=r.child,k={mode:"hidden",children:k},(c&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=k):x=Yo(k,c,0,null),t=La(t,c,i,null),x.return=r,t.return=r,x.sibling=t,r.child=x,r.child.memoizedState=au(i),r.memoizedState=ru,t):su(r,k));if(h=t.memoizedState,h!==null&&(P=h.dehydrated,P!==null))return B2(t,r,k,c,P,h,i);if(x){x=c.fallback,k=r.mode,h=t.child,P=h.sibling;var z={mode:"hidden",children:c.children};return(k&1)===0&&r.child!==h?(c=r.child,c.childLanes=0,c.pendingProps=z,r.deletions=null):(c=fa(h,z),c.subtreeFlags=h.subtreeFlags&14680064),P!==null?x=fa(P,x):(x=La(x,k,i,null),x.flags|=2),x.return=r,c.return=r,c.sibling=x,r.child=c,c=x,x=r.child,k=t.child.memoizedState,k=k===null?au(i):{baseLanes:k.baseLanes|i,cachePool:null,transitions:k.transitions},x.memoizedState=k,x.childLanes=t.childLanes&~i,r.memoizedState=ru,c}return x=t.child,t=x.sibling,c=fa(x,{mode:"visible",children:c.children}),(r.mode&1)===0&&(c.lanes=i),c.return=r,c.sibling=null,t!==null&&(i=r.deletions,i===null?(r.deletions=[t],r.flags|=16):i.push(t)),r.child=c,r.memoizedState=null,c}function su(t,r){return r=Yo({mode:"visible",children:r},t.mode,0,null),r.return=t,t.child=r}function Do(t,r,i,c){return c!==null&&Ic(c),ds(r,t.child,null,i),t=su(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function B2(t,r,i,c,h,x,k){if(i)return r.flags&256?(r.flags&=-257,c=Zc(Error(a(422))),Do(t,r,k,c)):r.memoizedState!==null?(r.child=t.child,r.flags|=128,null):(x=c.fallback,h=r.mode,c=Yo({mode:"visible",children:c.children},h,0,null),x=La(x,h,k,null),x.flags|=2,c.return=r,x.return=r,c.sibling=x,r.child=c,(r.mode&1)!==0&&ds(r,t.child,null,k),r.child.memoizedState=au(k),r.memoizedState=ru,x);if((r.mode&1)===0)return Do(t,r,k,null);if(h.data==="$!"){if(c=h.nextSibling&&h.nextSibling.dataset,c)var P=c.dgst;return c=P,x=Error(a(419)),c=Zc(x,c,void 0),Do(t,r,k,c)}if(P=(k&t.childLanes)!==0,Nn||P){if(c=Jt,c!==null){switch(k&-k){case 4:h=2;break;case 16:h=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:h=32;break;case 536870912:h=268435456;break;default:h=0}h=(h&(c.suspendedLanes|k))!==0?0:h,h!==0&&h!==x.retryLane&&(x.retryLane=h,Vr(t,h),cr(c,t,h,-1))}return wu(),c=Zc(Error(a(421))),Do(t,r,k,c)}return h.data==="$?"?(r.flags|=128,r.child=t.child,r=Z2.bind(null,t),h._reactRetry=r,null):(t=x.treeContext,Ln=ta(h.nextSibling),Fn=r,Tt=!0,sr=null,t!==null&&(Un[$n++]=zr,Un[$n++]=Br,Un[$n++]=Ea,zr=t.id,Br=t.overflow,Ea=r),r=su(r,c.children),r.flags|=4096,r)}function R0(t,r,i){t.lanes|=r;var c=t.alternate;c!==null&&(c.lanes|=r),Lc(t.return,r,i)}function iu(t,r,i,c,h){var x=t.memoizedState;x===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:i,tailMode:h}:(x.isBackwards=r,x.rendering=null,x.renderingStartTime=0,x.last=c,x.tail=i,x.tailMode=h)}function M0(t,r,i){var c=r.pendingProps,h=c.revealOrder,x=c.tail;if(xn(t,r,c.children,i),c=Rt.current,(c&2)!==0)c=c&1|2,r.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&R0(t,i,r);else if(t.tag===19)R0(t,i,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}c&=1}if(wt(Rt,c),(r.mode&1)===0)r.memoizedState=null;else switch(h){case"forwards":for(i=r.child,h=null;i!==null;)t=i.alternate,t!==null&&Eo(t)===null&&(h=i),i=i.sibling;i=h,i===null?(h=r.child,r.child=null):(h=i.sibling,i.sibling=null),iu(r,!1,h,i,x);break;case"backwards":for(i=null,h=r.child,r.child=null;h!==null;){if(t=h.alternate,t!==null&&Eo(t)===null){r.child=h;break}t=h.sibling,h.sibling=i,i=h,h=t}iu(r,!0,i,null,x);break;case"together":iu(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Fo(t,r){(r.mode&1)===0&&t!==null&&(t.alternate=null,r.alternate=null,r.flags|=2)}function $r(t,r,i){if(t!==null&&(r.dependencies=t.dependencies),Ia|=r.lanes,(i&r.childLanes)===0)return null;if(t!==null&&r.child!==t.child)throw Error(a(153));if(r.child!==null){for(t=r.child,i=fa(t,t.pendingProps),r.child=i,i.return=r;t.sibling!==null;)t=t.sibling,i=i.sibling=fa(t,t.pendingProps),i.return=r;i.sibling=null}return r.child}function V2(t,r,i){switch(r.tag){case 3:E0(r),us();break;case 5:Wh(r);break;case 1:Cn(r.type)&&yo(r);break;case 4:zc(r,r.stateNode.containerInfo);break;case 10:var c=r.type._context,h=r.memoizedProps.value;wt(ko,c._currentValue),c._currentValue=h;break;case 13:if(c=r.memoizedState,c!==null)return c.dehydrated!==null?(wt(Rt,Rt.current&1),r.flags|=128,null):(i&r.child.childLanes)!==0?P0(t,r,i):(wt(Rt,Rt.current&1),t=$r(t,r,i),t!==null?t.sibling:null);wt(Rt,Rt.current&1);break;case 19:if(c=(i&r.childLanes)!==0,(t.flags&128)!==0){if(c)return M0(t,r,i);r.flags|=128}if(h=r.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),wt(Rt,Rt.current),c)break;return null;case 22:case 23:return r.lanes=0,j0(t,r,i)}return $r(t,r,i)}var I0,ou,_0,D0;I0=function(t,r){for(var i=r.child;i!==null;){if(i.tag===5||i.tag===6)t.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},ou=function(){},_0=function(t,r,i,c){var h=t.memoizedProps;if(h!==c){t=r.stateNode,Ra(wr.current);var x=null;switch(i){case"input":h=dt(t,h),c=dt(t,c),x=[];break;case"select":h=J({},h,{value:void 0}),c=J({},c,{value:void 0}),x=[];break;case"textarea":h=be(t,h),c=be(t,c),x=[];break;default:typeof h.onClick!="function"&&typeof c.onClick=="function"&&(t.onclick=po)}ot(i,c);var k;i=null;for(ne in h)if(!c.hasOwnProperty(ne)&&h.hasOwnProperty(ne)&&h[ne]!=null)if(ne==="style"){var P=h[ne];for(k in P)P.hasOwnProperty(k)&&(i||(i={}),i[k]="")}else ne!=="dangerouslySetInnerHTML"&&ne!=="children"&&ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&ne!=="autoFocus"&&(o.hasOwnProperty(ne)?x||(x=[]):(x=x||[]).push(ne,null));for(ne in c){var z=c[ne];if(P=h!=null?h[ne]:void 0,c.hasOwnProperty(ne)&&z!==P&&(z!=null||P!=null))if(ne==="style")if(P){for(k in P)!P.hasOwnProperty(k)||z&&z.hasOwnProperty(k)||(i||(i={}),i[k]="");for(k in z)z.hasOwnProperty(k)&&P[k]!==z[k]&&(i||(i={}),i[k]=z[k])}else i||(x||(x=[]),x.push(ne,i)),i=z;else ne==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,P=P?P.__html:void 0,z!=null&&P!==z&&(x=x||[]).push(ne,z)):ne==="children"?typeof z!="string"&&typeof z!="number"||(x=x||[]).push(ne,""+z):ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&(o.hasOwnProperty(ne)?(z!=null&&ne==="onScroll"&&jt("scroll",t),x||P===z||(x=[])):(x=x||[]).push(ne,z))}i&&(x=x||[]).push("style",i);var ne=x;(r.updateQueue=ne)&&(r.flags|=4)}},D0=function(t,r,i,c){i!==c&&(r.flags|=4)};function hi(t,r){if(!Tt)switch(t.tailMode){case"hidden":r=t.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function fn(t){var r=t.alternate!==null&&t.alternate.child===t.child,i=0,c=0;if(r)for(var h=t.child;h!==null;)i|=h.lanes|h.childLanes,c|=h.subtreeFlags&14680064,c|=h.flags&14680064,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)i|=h.lanes|h.childLanes,c|=h.subtreeFlags,c|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=c,t.childLanes=i,r}function U2(t,r,i){var c=r.pendingProps;switch(Pc(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fn(r),null;case 1:return Cn(r.type)&&go(),fn(r),null;case 3:return c=r.stateNode,ps(),Ct(jn),Ct(un),Uc(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(t===null||t.child===null)&&(wo(r)?r.flags|=4:t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,sr!==null&&(xu(sr),sr=null))),ou(t,r),fn(r),null;case 5:Bc(r);var h=Ra(li.current);if(i=r.type,t!==null&&r.stateNode!=null)_0(t,r,i,c,h),t.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!c){if(r.stateNode===null)throw Error(a(166));return fn(r),null}if(t=Ra(wr.current),wo(r)){c=r.stateNode,i=r.type;var x=r.memoizedProps;switch(c[br]=r,c[ri]=x,t=(r.mode&1)!==0,i){case"dialog":jt("cancel",c),jt("close",c);break;case"iframe":case"object":case"embed":jt("load",c);break;case"video":case"audio":for(h=0;h<ei.length;h++)jt(ei[h],c);break;case"source":jt("error",c);break;case"img":case"image":case"link":jt("error",c),jt("load",c);break;case"details":jt("toggle",c);break;case"input":xt(c,x),jt("invalid",c);break;case"select":c._wrapperState={wasMultiple:!!x.multiple},jt("invalid",c);break;case"textarea":Ae(c,x),jt("invalid",c)}ot(i,x),h=null;for(var k in x)if(x.hasOwnProperty(k)){var P=x[k];k==="children"?typeof P=="string"?c.textContent!==P&&(x.suppressHydrationWarning!==!0&&ho(c.textContent,P,t),h=["children",P]):typeof P=="number"&&c.textContent!==""+P&&(x.suppressHydrationWarning!==!0&&ho(c.textContent,P,t),h=["children",""+P]):o.hasOwnProperty(k)&&P!=null&&k==="onScroll"&&jt("scroll",c)}switch(i){case"input":Ce(c),Re(c,x,!0);break;case"textarea":Ce(c),Ge(c);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(c.onclick=po)}c=h,r.updateQueue=c,c!==null&&(r.flags|=4)}else{k=h.nodeType===9?h:h.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=rt(i)),t==="http://www.w3.org/1999/xhtml"?i==="script"?(t=k.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof c.is=="string"?t=k.createElement(i,{is:c.is}):(t=k.createElement(i),i==="select"&&(k=t,c.multiple?k.multiple=!0:c.size&&(k.size=c.size))):t=k.createElementNS(t,i),t[br]=r,t[ri]=c,I0(t,r,!1,!1),r.stateNode=t;e:{switch(k=it(i,c),i){case"dialog":jt("cancel",t),jt("close",t),h=c;break;case"iframe":case"object":case"embed":jt("load",t),h=c;break;case"video":case"audio":for(h=0;h<ei.length;h++)jt(ei[h],t);h=c;break;case"source":jt("error",t),h=c;break;case"img":case"image":case"link":jt("error",t),jt("load",t),h=c;break;case"details":jt("toggle",t),h=c;break;case"input":xt(t,c),h=dt(t,c),jt("invalid",t);break;case"option":h=c;break;case"select":t._wrapperState={wasMultiple:!!c.multiple},h=J({},c,{value:void 0}),jt("invalid",t);break;case"textarea":Ae(t,c),h=be(t,c),jt("invalid",t);break;default:h=c}ot(i,h),P=h;for(x in P)if(P.hasOwnProperty(x)){var z=P[x];x==="style"?Te(t,z):x==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,z!=null&&Pt(t,z)):x==="children"?typeof z=="string"?(i!=="textarea"||z!=="")&&qe(t,z):typeof z=="number"&&qe(t,""+z):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(o.hasOwnProperty(x)?z!=null&&x==="onScroll"&&jt("scroll",t):z!=null&&D(t,x,z,k))}switch(i){case"input":Ce(t),Re(t,c,!1);break;case"textarea":Ce(t),Ge(t);break;case"option":c.value!=null&&t.setAttribute("value",""+xe(c.value));break;case"select":t.multiple=!!c.multiple,x=c.value,x!=null?Ie(t,!!c.multiple,x,!1):c.defaultValue!=null&&Ie(t,!!c.multiple,c.defaultValue,!0);break;default:typeof h.onClick=="function"&&(t.onclick=po)}switch(i){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}}c&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return fn(r),null;case 6:if(t&&r.stateNode!=null)D0(t,r,t.memoizedProps,c);else{if(typeof c!="string"&&r.stateNode===null)throw Error(a(166));if(i=Ra(li.current),Ra(wr.current),wo(r)){if(c=r.stateNode,i=r.memoizedProps,c[br]=r,(x=c.nodeValue!==i)&&(t=Fn,t!==null))switch(t.tag){case 3:ho(c.nodeValue,i,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&ho(c.nodeValue,i,(t.mode&1)!==0)}x&&(r.flags|=4)}else c=(i.nodeType===9?i:i.ownerDocument).createTextNode(c),c[br]=r,r.stateNode=c}return fn(r),null;case 13:if(Ct(Rt),c=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Tt&&Ln!==null&&(r.mode&1)!==0&&(r.flags&128)===0)Ah(),us(),r.flags|=98560,x=!1;else if(x=wo(r),c!==null&&c.dehydrated!==null){if(t===null){if(!x)throw Error(a(318));if(x=r.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(a(317));x[br]=r}else us(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;fn(r),x=!1}else sr!==null&&(xu(sr),sr=null),x=!0;if(!x)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=i,r):(c=c!==null,c!==(t!==null&&t.memoizedState!==null)&&c&&(r.child.flags|=8192,(r.mode&1)!==0&&(t===null||(Rt.current&1)!==0?Kt===0&&(Kt=3):wu())),r.updateQueue!==null&&(r.flags|=4),fn(r),null);case 4:return ps(),ou(t,r),t===null&&ti(r.stateNode.containerInfo),fn(r),null;case 10:return Fc(r.type._context),fn(r),null;case 17:return Cn(r.type)&&go(),fn(r),null;case 19:if(Ct(Rt),x=r.memoizedState,x===null)return fn(r),null;if(c=(r.flags&128)!==0,k=x.rendering,k===null)if(c)hi(x,!1);else{if(Kt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(k=Eo(t),k!==null){for(r.flags|=128,hi(x,!1),c=k.updateQueue,c!==null&&(r.updateQueue=c,r.flags|=4),r.subtreeFlags=0,c=i,i=r.child;i!==null;)x=i,t=c,x.flags&=14680066,k=x.alternate,k===null?(x.childLanes=0,x.lanes=t,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=k.childLanes,x.lanes=k.lanes,x.child=k.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=k.memoizedProps,x.memoizedState=k.memoizedState,x.updateQueue=k.updateQueue,x.type=k.type,t=k.dependencies,x.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),i=i.sibling;return wt(Rt,Rt.current&1|2),r.child}t=t.sibling}x.tail!==null&&at()>xs&&(r.flags|=128,c=!0,hi(x,!1),r.lanes=4194304)}else{if(!c)if(t=Eo(k),t!==null){if(r.flags|=128,c=!0,i=t.updateQueue,i!==null&&(r.updateQueue=i,r.flags|=4),hi(x,!0),x.tail===null&&x.tailMode==="hidden"&&!k.alternate&&!Tt)return fn(r),null}else 2*at()-x.renderingStartTime>xs&&i!==1073741824&&(r.flags|=128,c=!0,hi(x,!1),r.lanes=4194304);x.isBackwards?(k.sibling=r.child,r.child=k):(i=x.last,i!==null?i.sibling=k:r.child=k,x.last=k)}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):(fn(r),null);case 22:case 23:return bu(),c=r.memoizedState!==null,t!==null&&t.memoizedState!==null!==c&&(r.flags|=8192),c&&(r.mode&1)!==0?(An&1073741824)!==0&&(fn(r),r.subtreeFlags&6&&(r.flags|=8192)):fn(r),null;case 24:return null;case 25:return null}throw Error(a(156,r.tag))}function $2(t,r){switch(Pc(r),r.tag){case 1:return Cn(r.type)&&go(),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return ps(),Ct(jn),Ct(un),Uc(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 5:return Bc(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 Fc(r.type._context),null;case 22:case 23:return bu(),null;case 24:return null;default:return null}}var Lo=!1,hn=!1,H2=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 lu(t,r,i){try{i()}catch(c){It(t,r,c)}}var F0=!1;function W2(t,r){if(bc=to,t=hh(),fc(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 h=c.anchorOffset,x=c.focusNode;c=c.focusOffset;try{i.nodeType,x.nodeType}catch{i=null;break e}var k=0,P=-1,z=-1,ne=0,fe=0,he=t,de=null;t:for(;;){for(var Se;he!==i||h!==0&&he.nodeType!==3||(P=k+h),he!==x||c!==0&&he.nodeType!==3||(z=k+c),he.nodeType===3&&(k+=he.nodeValue.length),(Se=he.firstChild)!==null;)de=he,he=Se;for(;;){if(he===t)break t;if(de===i&&++ne===h&&(P=k),de===x&&++fe===c&&(z=k),(Se=he.nextSibling)!==null)break;he=de,de=he.parentNode}he=Se}i=P===-1||z===-1?null:{start:P,end:z}}else i=null}i=i||{start:0,end:0}}else i=null;for(wc={focusedElem:t,selectionRange:i},to=!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,zt=Ne.memoizedState,Z=r.stateNode,$=Z.getSnapshotBeforeUpdate(r.elementType===r.type?Pe:ir(r.type,Pe),zt);Z.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var ee=r.stateNode.containerInfo;ee.nodeType===1?ee.textContent="":ee.nodeType===9&&ee.documentElement&&ee.removeChild(ee.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=F0,F0=!1,Ne}function pi(t,r,i){var c=r.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&t)===t){var x=h.destroy;h.destroy=void 0,x!==void 0&&lu(r,i,x)}h=h.next}while(h!==c)}}function Ao(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 cu(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 L0(t){var r=t.alternate;r!==null&&(t.alternate=null,L0(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&(delete r[br],delete r[ri],delete r[Cc],delete r[E2],delete r[T2])),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 A0(t){return t.tag===5||t.tag===3||t.tag===4}function O0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||A0(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 uu(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=po));else if(c!==4&&(t=t.child,t!==null))for(uu(t,r,i),t=t.sibling;t!==null;)uu(t,r,i),t=t.sibling}function du(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(du(t,r,i),t=t.sibling;t!==null;)du(t,r,i),t=t.sibling}var en=null,or=!1;function oa(t,r,i){for(i=i.child;i!==null;)z0(t,r,i),i=i.sibling}function z0(t,r,i){if(Ht&&typeof Ht.onCommitFiberUnmount=="function")try{Ht.onCommitFiberUnmount(Kr,i)}catch{}switch(i.tag){case 5:hn||gs(i,r);case 6:var c=en,h=or;en=null,oa(t,r,i),en=c,or=h,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?jc(t.parentNode,i):t.nodeType===1&&jc(t,i),Ks(t)):jc(en,i.stateNode));break;case 4:c=en,h=or,en=i.stateNode.containerInfo,or=!0,oa(t,r,i),en=c,or=h;break;case 0:case 11:case 14:case 15:if(!hn&&(c=i.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){h=c=c.next;do{var x=h,k=x.destroy;x=x.tag,k!==void 0&&((x&2)!==0||(x&4)!==0)&&lu(i,r,k),h=h.next}while(h!==c)}oa(t,r,i);break;case 1:if(!hn&&(gs(i,r),c=i.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=i.memoizedProps,c.state=i.memoizedState,c.componentWillUnmount()}catch(P){It(i,r,P)}oa(t,r,i);break;case 21:oa(t,r,i);break;case 22:i.mode&1?(hn=(c=hn)||i.memoizedState!==null,oa(t,r,i),hn=c):oa(t,r,i);break;default:oa(t,r,i)}}function B0(t){var r=t.updateQueue;if(r!==null){t.updateQueue=null;var i=t.stateNode;i===null&&(i=t.stateNode=new H2),r.forEach(function(c){var h=ev.bind(null,t,c);i.has(c)||(i.add(c),c.then(h,h))})}}function lr(t,r){var i=r.deletions;if(i!==null)for(var c=0;c<i.length;c++){var h=i[c];try{var x=t,k=r,P=k;e:for(;P!==null;){switch(P.tag){case 5:en=P.stateNode,or=!1;break e;case 3:en=P.stateNode.containerInfo,or=!0;break e;case 4:en=P.stateNode.containerInfo,or=!0;break e}P=P.return}if(en===null)throw Error(a(160));z0(x,k,h),en=null,or=!1;var z=h.alternate;z!==null&&(z.return=null),h.return=null}catch(ne){It(h,r,ne)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)V0(r,t),r=r.sibling}function V0(t,r){var i=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(lr(r,t),kr(t),c&4){try{pi(3,t,t.return),Ao(3,t)}catch(Pe){It(t,t.return,Pe)}try{pi(5,t,t.return)}catch(Pe){It(t,t.return,Pe)}}break;case 1:lr(r,t),kr(t),c&512&&i!==null&&gs(i,i.return);break;case 5:if(lr(r,t),kr(t),c&512&&i!==null&&gs(i,i.return),t.flags&32){var h=t.stateNode;try{qe(h,"")}catch(Pe){It(t,t.return,Pe)}}if(c&4&&(h=t.stateNode,h!=null)){var x=t.memoizedProps,k=i!==null?i.memoizedProps:x,P=t.type,z=t.updateQueue;if(t.updateQueue=null,z!==null)try{P==="input"&&x.type==="radio"&&x.name!=null&&vt(h,x),it(P,k);var ne=it(P,x);for(k=0;k<z.length;k+=2){var fe=z[k],he=z[k+1];fe==="style"?Te(h,he):fe==="dangerouslySetInnerHTML"?Pt(h,he):fe==="children"?qe(h,he):D(h,fe,he,ne)}switch(P){case"input":ke(h,x);break;case"textarea":Qe(h,x);break;case"select":var de=h._wrapperState.wasMultiple;h._wrapperState.wasMultiple=!!x.multiple;var Se=x.value;Se!=null?Ie(h,!!x.multiple,Se,!1):de!==!!x.multiple&&(x.defaultValue!=null?Ie(h,!!x.multiple,x.defaultValue,!0):Ie(h,!!x.multiple,x.multiple?[]:"",!1))}h[ri]=x}catch(Pe){It(t,t.return,Pe)}}break;case 6:if(lr(r,t),kr(t),c&4){if(t.stateNode===null)throw Error(a(162));h=t.stateNode,x=t.memoizedProps;try{h.nodeValue=x}catch(Pe){It(t,t.return,Pe)}}break;case 3:if(lr(r,t),kr(t),c&4&&i!==null&&i.memoizedState.isDehydrated)try{Ks(r.containerInfo)}catch(Pe){It(t,t.return,Pe)}break;case 4:lr(r,t),kr(t);break;case 13:lr(r,t),kr(t),h=t.child,h.flags&8192&&(x=h.memoizedState!==null,h.stateNode.isHidden=x,!x||h.alternate!==null&&h.alternate.memoizedState!==null||(pu=at())),c&4&&B0(t);break;case 22:if(fe=i!==null&&i.memoizedState!==null,t.mode&1?(hn=(ne=hn)||fe,lr(r,t),hn=ne):lr(r,t),kr(t),c&8192){if(ne=t.memoizedState!==null,(t.stateNode.isHidden=ne)&&!fe&&(t.mode&1)!==0)for(je=t,fe=t.child;fe!==null;){for(he=je=fe;je!==null;){switch(de=je,Se=de.child,de.tag){case 0:case 11:case 14:case 15:pi(4,de,de.return);break;case 1:gs(de,de.return);var Ne=de.stateNode;if(typeof Ne.componentWillUnmount=="function"){c=de,i=de.return;try{r=c,Ne.props=r.memoizedProps,Ne.state=r.memoizedState,Ne.componentWillUnmount()}catch(Pe){It(c,i,Pe)}}break;case 5:gs(de,de.return);break;case 22:if(de.memoizedState!==null){H0(he);continue}}Se!==null?(Se.return=de,je=Se):H0(he)}fe=fe.sibling}e:for(fe=null,he=t;;){if(he.tag===5){if(fe===null){fe=he;try{h=he.stateNode,ne?(x=h.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(P=he.stateNode,z=he.memoizedProps.style,k=z!=null&&z.hasOwnProperty("display")?z.display:null,P.style.display=Mn("display",k))}catch(Pe){It(t,t.return,Pe)}}}else if(he.tag===6){if(fe===null)try{he.stateNode.nodeValue=ne?"":he.memoizedProps}catch(Pe){It(t,t.return,Pe)}}else if((he.tag!==22&&he.tag!==23||he.memoizedState===null||he===t)&&he.child!==null){he.child.return=he,he=he.child;continue}if(he===t)break e;for(;he.sibling===null;){if(he.return===null||he.return===t)break e;fe===he&&(fe=null),he=he.return}fe===he&&(fe=null),he.sibling.return=he.return,he=he.sibling}}break;case 19:lr(r,t),kr(t),c&4&&B0(t);break;case 21:break;default:lr(r,t),kr(t)}}function kr(t){var r=t.flags;if(r&2){try{e:{for(var i=t.return;i!==null;){if(A0(i)){var c=i;break e}i=i.return}throw Error(a(160))}switch(c.tag){case 5:var h=c.stateNode;c.flags&32&&(qe(h,""),c.flags&=-33);var x=O0(t);du(t,x,h);break;case 3:case 4:var k=c.stateNode.containerInfo,P=O0(t);uu(t,P,k);break;default:throw Error(a(161))}}catch(z){It(t,t.return,z)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function K2(t,r,i){je=t,U0(t)}function U0(t,r,i){for(var c=(t.mode&1)!==0;je!==null;){var h=je,x=h.child;if(h.tag===22&&c){var k=h.memoizedState!==null||Lo;if(!k){var P=h.alternate,z=P!==null&&P.memoizedState!==null||hn;P=Lo;var ne=hn;if(Lo=k,(hn=z)&&!ne)for(je=h;je!==null;)k=je,z=k.child,k.tag===22&&k.memoizedState!==null?W0(h):z!==null?(z.return=k,je=z):W0(h);for(;x!==null;)je=x,U0(x),x=x.sibling;je=h,Lo=P,hn=ne}$0(t)}else(h.subtreeFlags&8772)!==0&&x!==null?(x.return=h,je=x):$0(t)}}function $0(t){for(;je!==null;){var r=je;if((r.flags&8772)!==0){var i=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:hn||Ao(5,r);break;case 1:var c=r.stateNode;if(r.flags&4&&!hn)if(i===null)c.componentDidMount();else{var h=r.elementType===r.type?i.memoizedProps:ir(r.type,i.memoizedProps);c.componentDidUpdate(h,i.memoizedState,c.__reactInternalSnapshotBeforeUpdate)}var x=r.updateQueue;x!==null&&Hh(r,x,c);break;case 3:var k=r.updateQueue;if(k!==null){if(i=null,r.child!==null)switch(r.child.tag){case 5:i=r.child.stateNode;break;case 1:i=r.child.stateNode}Hh(r,k,i)}break;case 5:var P=r.stateNode;if(i===null&&r.flags&4){i=P;var z=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":z.autoFocus&&i.focus();break;case"img":z.src&&(i.src=z.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var ne=r.alternate;if(ne!==null){var fe=ne.memoizedState;if(fe!==null){var he=fe.dehydrated;he!==null&&Ks(he)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(a(163))}hn||r.flags&512&&cu(r)}catch(de){It(r,r.return,de)}}if(r===t){je=null;break}if(i=r.sibling,i!==null){i.return=r.return,je=i;break}je=r.return}}function H0(t){for(;je!==null;){var r=je;if(r===t){je=null;break}var i=r.sibling;if(i!==null){i.return=r.return,je=i;break}je=r.return}}function W0(t){for(;je!==null;){var r=je;try{switch(r.tag){case 0:case 11:case 15:var i=r.return;try{Ao(4,r)}catch(z){It(r,i,z)}break;case 1:var c=r.stateNode;if(typeof c.componentDidMount=="function"){var h=r.return;try{c.componentDidMount()}catch(z){It(r,h,z)}}var x=r.return;try{cu(r)}catch(z){It(r,x,z)}break;case 5:var k=r.return;try{cu(r)}catch(z){It(r,k,z)}}}catch(z){It(r,r.return,z)}if(r===t){je=null;break}var P=r.sibling;if(P!==null){P.return=r.return,je=P;break}je=r.return}}var Y2=Math.ceil,Oo=H.ReactCurrentDispatcher,fu=H.ReactCurrentOwner,Kn=H.ReactCurrentBatchConfig,lt=0,Jt=null,Bt=null,tn=0,An=0,ys=na(0),Kt=0,mi=null,Ia=0,zo=0,hu=0,gi=null,En=null,pu=0,xs=1/0,Hr=null,Bo=!1,mu=null,la=null,Vo=!1,ca=null,Uo=0,yi=0,gu=null,$o=-1,Ho=0;function vn(){return(lt&6)!==0?at():$o!==-1?$o:$o=at()}function ua(t){return(t.mode&1)===0?1:(lt&2)!==0&&tn!==0?tn&-tn:R2.transition!==null?(Ho===0&&(Ho=Qi()),Ho):(t=mt,t!==0||(t=window.event,t=t===void 0?16:Yf(t.type)),t)}function cr(t,r,i,c){if(50<yi)throw yi=0,gu=null,Error(a(185));Vs(t,i,c),((lt&2)===0||t!==Jt)&&(t===Jt&&((lt&2)===0&&(zo|=i),Kt===4&&da(t,tn)),Tn(t,c),i===1&<===0&&(r.mode&1)===0&&(xs=at()+500,xo&&aa()))}function Tn(t,r){var i=t.callbackNode;Lr(t,r);var c=Gr(t,t===Jt?tn:0);if(c===0)i!==null&&Ot(i),t.callbackNode=null,t.callbackPriority=0;else if(r=c&-c,t.callbackPriority!==r){if(i!=null&&Ot(i),r===1)t.tag===0?P2(Y0.bind(null,t)):Ih(Y0.bind(null,t)),C2(function(){(lt&6)===0&&aa()}),i=null;else{switch(zf(c)){case 1:i=Fr;break;case 4:i=nr;break;case 16:i=rr;break;case 536870912:i=_n;break;default:i=rr}i=tp(i,K0.bind(null,t))}t.callbackPriority=r,t.callbackNode=i}}function K0(t,r){if($o=-1,Ho=0,(lt&6)!==0)throw Error(a(327));var i=t.callbackNode;if(vs()&&t.callbackNode!==i)return null;var c=Gr(t,t===Jt?tn:0);if(c===0)return null;if((c&30)!==0||(c&t.expiredLanes)!==0||r)r=Wo(t,c);else{r=c;var h=lt;lt|=2;var x=X0();(Jt!==t||tn!==r)&&(Hr=null,xs=at()+500,Da(t,r));do try{J2();break}catch(P){G0(t,P)}while(!0);Dc(),Oo.current=x,lt=h,Bt!==null?r=0:(Jt=null,tn=0,r=Kt)}if(r!==0){if(r===2&&(h=qa(t),h!==0&&(c=h,r=yu(t,h))),r===1)throw i=mi,Da(t,0),da(t,c),Tn(t,at()),i;if(r===6)da(t,c);else{if(h=t.current.alternate,(c&30)===0&&!G2(h)&&(r=Wo(t,c),r===2&&(x=qa(t),x!==0&&(c=x,r=yu(t,x))),r===1))throw i=mi,Da(t,0),da(t,c),Tn(t,at()),i;switch(t.finishedWork=h,t.finishedLanes=c,r){case 0:case 1:throw Error(a(345));case 2:Fa(t,En,Hr);break;case 3:if(da(t,c),(c&130023424)===c&&(r=pu+500-at(),10<r)){if(Gr(t,0)!==0)break;if(h=t.suspendedLanes,(h&c)!==c){vn(),t.pingedLanes|=t.suspendedLanes&h;break}t.timeoutHandle=kc(Fa.bind(null,t,En,Hr),r);break}Fa(t,En,Hr);break;case 4:if(da(t,c),(c&4194240)===c)break;for(r=t.eventTimes,h=-1;0<c;){var k=31-ln(c);x=1<<k,k=r[k],k>h&&(h=k),c&=~x}if(c=h,c=at()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*Y2(c/1960))-c,10<c){t.timeoutHandle=kc(Fa.bind(null,t,En,Hr),c);break}Fa(t,En,Hr);break;case 5:Fa(t,En,Hr);break;default:throw Error(a(329))}}}return Tn(t,at()),t.callbackNode===i?K0.bind(null,t):null}function yu(t,r){var i=gi;return t.current.memoizedState.isDehydrated&&(Da(t,r).flags|=256),t=Wo(t,r),t!==2&&(r=En,En=i,r!==null&&xu(r)),t}function xu(t){En===null?En=t:En.push.apply(En,t)}function G2(t){for(var r=t;;){if(r.flags&16384){var i=r.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var c=0;c<i.length;c++){var h=i[c],x=h.getSnapshot;h=h.value;try{if(!ar(x(),h))return!1}catch{return!1}}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function da(t,r){for(r&=~hu,r&=~zo,t.suspendedLanes|=r,t.pingedLanes&=~r,t=t.expirationTimes;0<r;){var i=31-ln(r),c=1<<i;t[i]=-1,r&=~c}}function Y0(t){if((lt&6)!==0)throw Error(a(327));vs();var r=Gr(t,0);if((r&1)===0)return Tn(t,at()),null;var i=Wo(t,r);if(t.tag!==0&&i===2){var c=qa(t);c!==0&&(r=c,i=yu(t,c))}if(i===1)throw i=mi,Da(t,0),da(t,r),Tn(t,at()),i;if(i===6)throw Error(a(345));return t.finishedWork=t.current.alternate,t.finishedLanes=r,Fa(t,En,Hr),Tn(t,at()),null}function vu(t,r){var i=lt;lt|=1;try{return t(r)}finally{lt=i,lt===0&&(xs=at()+500,xo&&aa())}}function _a(t){ca!==null&&ca.tag===0&&(lt&6)===0&&vs();var r=lt;lt|=1;var i=Kn.transition,c=mt;try{if(Kn.transition=null,mt=1,t)return t()}finally{mt=c,Kn.transition=i,lt=r,(lt&6)===0&&aa()}}function bu(){An=ys.current,Ct(ys)}function Da(t,r){t.finishedWork=null,t.finishedLanes=0;var i=t.timeoutHandle;if(i!==-1&&(t.timeoutHandle=-1,j2(i)),Bt!==null)for(i=Bt.return;i!==null;){var c=i;switch(Pc(c),c.tag){case 1:c=c.type.childContextTypes,c!=null&&go();break;case 3:ps(),Ct(jn),Ct(un),Uc();break;case 5:Bc(c);break;case 4:ps();break;case 13:Ct(Rt);break;case 19:Ct(Rt);break;case 10:Fc(c.type._context);break;case 22:case 23:bu()}i=i.return}if(Jt=t,Bt=t=fa(t.current,null),tn=An=r,Kt=0,mi=null,hu=zo=Ia=0,En=gi=null,Pa!==null){for(r=0;r<Pa.length;r++)if(i=Pa[r],c=i.interleaved,c!==null){i.interleaved=null;var h=c.next,x=i.pending;if(x!==null){var k=x.next;x.next=h,c.next=k}i.pending=c}Pa=null}return t}function G0(t,r){do{var i=Bt;try{if(Dc(),To.current=Io,Po){for(var c=Mt.memoizedState;c!==null;){var h=c.queue;h!==null&&(h.pending=null),c=c.next}Po=!1}if(Ma=0,Xt=Wt=Mt=null,ci=!1,ui=0,fu.current=null,i===null||i.return===null){Kt=1,mi=r,Bt=null;break}e:{var x=t,k=i.return,P=i,z=r;if(r=tn,P.flags|=32768,z!==null&&typeof z=="object"&&typeof z.then=="function"){var ne=z,fe=P,he=fe.tag;if((fe.mode&1)===0&&(he===0||he===11||he===15)){var de=fe.alternate;de?(fe.updateQueue=de.updateQueue,fe.memoizedState=de.memoizedState,fe.lanes=de.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var Se=v0(k);if(Se!==null){Se.flags&=-257,b0(Se,k,P,x,r),Se.mode&1&&x0(x,ne,r),r=Se,z=ne;var Ne=r.updateQueue;if(Ne===null){var Pe=new Set;Pe.add(z),r.updateQueue=Pe}else Ne.add(z);break e}else{if((r&1)===0){x0(x,ne,r),wu();break e}z=Error(a(426))}}else if(Tt&&P.mode&1){var zt=v0(k);if(zt!==null){(zt.flags&65536)===0&&(zt.flags|=256),b0(zt,k,P,x,r),Ic(ms(z,P));break e}}x=z=ms(z,P),Kt!==4&&(Kt=2),gi===null?gi=[x]:gi.push(x),x=k;do{switch(x.tag){case 3:x.flags|=65536,r&=-r,x.lanes|=r;var Z=g0(x,z,r);$h(x,Z);break e;case 1:P=z;var $=x.type,ee=x.stateNode;if((x.flags&128)===0&&(typeof $.getDerivedStateFromError=="function"||ee!==null&&typeof ee.componentDidCatch=="function"&&(la===null||!la.has(ee)))){x.flags|=65536,r&=-r,x.lanes|=r;var pe=y0(x,P,r);$h(x,pe);break e}}x=x.return}while(x!==null)}q0(i)}catch(Me){r=Me,Bt===i&&i!==null&&(Bt=i=i.return);continue}break}while(!0)}function X0(){var t=Oo.current;return Oo.current=Io,t===null?Io:t}function wu(){(Kt===0||Kt===3||Kt===2)&&(Kt=4),Jt===null||(Ia&268435455)===0&&(zo&268435455)===0||da(Jt,tn)}function Wo(t,r){var i=lt;lt|=2;var c=X0();(Jt!==t||tn!==r)&&(Hr=null,Da(t,r));do try{X2();break}catch(h){G0(t,h)}while(!0);if(Dc(),lt=i,Oo.current=c,Bt!==null)throw Error(a(261));return Jt=null,tn=0,Kt}function X2(){for(;Bt!==null;)J0(Bt)}function J2(){for(;Bt!==null&&!kt();)J0(Bt)}function J0(t){var r=ep(t.alternate,t,An);t.memoizedProps=t.pendingProps,r===null?q0(t):Bt=r,fu.current=null}function q0(t){var r=t;do{var i=r.alternate;if(t=r.return,(r.flags&32768)===0){if(i=U2(i,r,An),i!==null){Bt=i;return}}else{if(i=$2(i,r),i!==null){i.flags&=32767,Bt=i;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Kt=6,Bt=null;return}}if(r=r.sibling,r!==null){Bt=r;return}Bt=r=t}while(r!==null);Kt===0&&(Kt=5)}function Fa(t,r,i){var c=mt,h=Kn.transition;try{Kn.transition=null,mt=1,q2(t,r,i,c)}finally{Kn.transition=h,mt=c}return null}function q2(t,r,i,c){do vs();while(ca!==null);if((lt&6)!==0)throw Error(a(327));i=t.finishedWork;var h=t.finishedLanes;if(i===null)return null;if(t.finishedWork=null,t.finishedLanes=0,i===t.current)throw Error(a(177));t.callbackNode=null,t.callbackPriority=0;var x=i.lanes|i.childLanes;if(Mx(t,x),t===Jt&&(Bt=Jt=null,tn=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||Vo||(Vo=!0,tp(rr,function(){return vs(),null})),x=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||x){x=Kn.transition,Kn.transition=null;var k=mt;mt=1;var P=lt;lt|=4,fu.current=null,W2(t,i),V0(i,t),y2(wc),to=!!bc,wc=bc=null,t.current=i,K2(i),pt(),lt=P,mt=k,Kn.transition=x}else t.current=i;if(Vo&&(Vo=!1,ca=t,Uo=h),x=t.pendingLanes,x===0&&(la=null),Xa(i.stateNode),Tn(t,at()),r!==null)for(c=t.onRecoverableError,i=0;i<r.length;i++)h=r[i],c(h.value,{componentStack:h.stack,digest:h.digest});if(Bo)throw Bo=!1,t=mu,mu=null,t;return(Uo&1)!==0&&t.tag!==0&&vs(),x=t.pendingLanes,(x&1)!==0?t===gu?yi++:(yi=0,gu=t):yi=0,aa(),null}function vs(){if(ca!==null){var t=zf(Uo),r=Kn.transition,i=mt;try{if(Kn.transition=null,mt=16>t?16:t,ca===null)var c=!1;else{if(t=ca,ca=null,Uo=0,(lt&6)!==0)throw Error(a(331));var h=lt;for(lt|=4,je=t.current;je!==null;){var x=je,k=x.child;if((je.flags&16)!==0){var P=x.deletions;if(P!==null){for(var z=0;z<P.length;z++){var ne=P[z];for(je=ne;je!==null;){var fe=je;switch(fe.tag){case 0:case 11:case 15:pi(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,Se=fe.return;if(L0(fe),fe===ne){je=null;break}if(de!==null){de.return=Se,je=de;break}je=Se}}}var Ne=x.alternate;if(Ne!==null){var Pe=Ne.child;if(Pe!==null){Ne.child=null;do{var zt=Pe.sibling;Pe.sibling=null,Pe=zt}while(Pe!==null)}}je=x}}if((x.subtreeFlags&2064)!==0&&k!==null)k.return=x,je=k;else e:for(;je!==null;){if(x=je,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:pi(9,x,x.return)}var Z=x.sibling;if(Z!==null){Z.return=x.return,je=Z;break e}je=x.return}}var $=t.current;for(je=$;je!==null;){k=je;var ee=k.child;if((k.subtreeFlags&2064)!==0&&ee!==null)ee.return=k,je=ee;else e:for(k=$;je!==null;){if(P=je,(P.flags&2048)!==0)try{switch(P.tag){case 0:case 11:case 15:Ao(9,P)}}catch(Me){It(P,P.return,Me)}if(P===k){je=null;break e}var pe=P.sibling;if(pe!==null){pe.return=P.return,je=pe;break e}je=P.return}}if(lt=h,aa(),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(Kr,t)}catch{}c=!0}return c}finally{mt=i,Kn.transition=r}}return!1}function Q0(t,r,i){r=ms(i,r),r=g0(t,r,1),t=ia(t,r,1),r=vn(),t!==null&&(Vs(t,1,r),Tn(t,r))}function It(t,r,i){if(t.tag===3)Q0(t,t,i);else for(;r!==null;){if(r.tag===3){Q0(r,t,i);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(la===null||!la.has(c))){t=ms(i,t),t=y0(r,t,1),r=ia(r,t,1),t=vn(),r!==null&&(Vs(r,1,t),Tn(r,t));break}}r=r.return}}function Q2(t,r,i){var c=t.pingCache;c!==null&&c.delete(r),r=vn(),t.pingedLanes|=t.suspendedLanes&i,Jt===t&&(tn&i)===i&&(Kt===4||Kt===3&&(tn&130023424)===tn&&500>at()-pu?Da(t,0):hu|=i),Tn(t,r)}function Z0(t,r){r===0&&((t.mode&1)===0?r=1:(r=kn,kn<<=1,(kn&130023424)===0&&(kn=4194304)));var i=vn();t=Vr(t,r),t!==null&&(Vs(t,r,i),Tn(t,i))}function Z2(t){var r=t.memoizedState,i=0;r!==null&&(i=r.retryLane),Z0(t,i)}function ev(t,r){var i=0;switch(t.tag){case 13:var c=t.stateNode,h=t.memoizedState;h!==null&&(i=h.retryLane);break;case 19:c=t.stateNode;break;default:throw Error(a(314))}c!==null&&c.delete(r),Z0(t,i)}var ep;ep=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,V2(t,r,i);Nn=(t.flags&131072)!==0}else Nn=!1,Tt&&(r.flags&1048576)!==0&&_h(r,bo,r.index);switch(r.lanes=0,r.tag){case 2:var c=r.type;Fo(t,r),t=r.pendingProps;var h=os(r,un.current);hs(r,i),h=Wc(null,r,c,t,h,i);var x=Kc();return r.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,Cn(c)?(x=!0,yo(r)):x=!1,r.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,Oc(r),h.updater=_o,r.stateNode=h,h._reactInternals=r,Qc(r,c,t,i),r=nu(null,r,c,!0,x,i)):(r.tag=0,Tt&&x&&Tc(r),xn(null,r,h,i),r=r.child),r;case 16:c=r.elementType;e:{switch(Fo(t,r),t=r.pendingProps,h=c._init,c=h(c._payload),r.type=c,h=r.tag=nv(c),t=ir(c,t),h){case 0:r=tu(null,r,c,t,i);break e;case 1:r=N0(null,r,c,t,i);break e;case 11:r=w0(null,r,c,t,i);break e;case 14:r=S0(null,r,c,ir(c.type,t),i);break e}throw Error(a(306,c,""))}return r;case 0:return c=r.type,h=r.pendingProps,h=r.elementType===c?h:ir(c,h),tu(t,r,c,h,i);case 1:return c=r.type,h=r.pendingProps,h=r.elementType===c?h:ir(c,h),N0(t,r,c,h,i);case 3:e:{if(E0(r),t===null)throw Error(a(387));c=r.pendingProps,x=r.memoizedState,h=x.element,Uh(t,r),No(r,c,null,i);var k=r.memoizedState;if(c=k.element,x.isDehydrated)if(x={element:c,isDehydrated:!1,cache:k.cache,pendingSuspenseBoundaries:k.pendingSuspenseBoundaries,transitions:k.transitions},r.updateQueue.baseState=x,r.memoizedState=x,r.flags&256){h=ms(Error(a(423)),r),r=T0(t,r,c,i,h);break e}else if(c!==h){h=ms(Error(a(424)),r),r=T0(t,r,c,i,h);break e}else for(Ln=ta(r.stateNode.containerInfo.firstChild),Fn=r,Tt=!0,sr=null,i=Bh(r,null,c,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(us(),c===h){r=$r(t,r,i);break e}xn(t,r,c,i)}r=r.child}return r;case 5:return Wh(r),t===null&&Mc(r),c=r.type,h=r.pendingProps,x=t!==null?t.memoizedProps:null,k=h.children,Sc(c,h)?k=null:x!==null&&Sc(c,x)&&(r.flags|=32),C0(t,r),xn(t,r,k,i),r.child;case 6:return t===null&&Mc(r),null;case 13:return P0(t,r,i);case 4:return zc(r,r.stateNode.containerInfo),c=r.pendingProps,t===null?r.child=ds(r,null,c,i):xn(t,r,c,i),r.child;case 11:return c=r.type,h=r.pendingProps,h=r.elementType===c?h:ir(c,h),w0(t,r,c,h,i);case 7:return xn(t,r,r.pendingProps,i),r.child;case 8:return xn(t,r,r.pendingProps.children,i),r.child;case 12:return xn(t,r,r.pendingProps.children,i),r.child;case 10:e:{if(c=r.type._context,h=r.pendingProps,x=r.memoizedProps,k=h.value,wt(ko,c._currentValue),c._currentValue=k,x!==null)if(ar(x.value,k)){if(x.children===h.children&&!jn.current){r=$r(t,r,i);break e}}else for(x=r.child,x!==null&&(x.return=r);x!==null;){var P=x.dependencies;if(P!==null){k=x.child;for(var z=P.firstContext;z!==null;){if(z.context===c){if(x.tag===1){z=Ur(-1,i&-i),z.tag=2;var ne=x.updateQueue;if(ne!==null){ne=ne.shared;var fe=ne.pending;fe===null?z.next=z:(z.next=fe.next,fe.next=z),ne.pending=z}}x.lanes|=i,z=x.alternate,z!==null&&(z.lanes|=i),Lc(x.return,i,r),P.lanes|=i;break}z=z.next}}else if(x.tag===10)k=x.type===r.type?null:x.child;else if(x.tag===18){if(k=x.return,k===null)throw Error(a(341));k.lanes|=i,P=k.alternate,P!==null&&(P.lanes|=i),Lc(k,i,r),k=x.sibling}else k=x.child;if(k!==null)k.return=x;else for(k=x;k!==null;){if(k===r){k=null;break}if(x=k.sibling,x!==null){x.return=k.return,k=x;break}k=k.return}x=k}xn(t,r,h.children,i),r=r.child}return r;case 9:return h=r.type,c=r.pendingProps.children,hs(r,i),h=Hn(h),c=c(h),r.flags|=1,xn(t,r,c,i),r.child;case 14:return c=r.type,h=ir(c,r.pendingProps),h=ir(c.type,h),S0(t,r,c,h,i);case 15:return k0(t,r,r.type,r.pendingProps,i);case 17:return c=r.type,h=r.pendingProps,h=r.elementType===c?h:ir(c,h),Fo(t,r),r.tag=1,Cn(c)?(t=!0,yo(r)):t=!1,hs(r,i),p0(r,c,h),Qc(r,c,h,i),nu(null,r,c,!0,t,i);case 19:return M0(t,r,i);case 22:return j0(t,r,i)}throw Error(a(156,r.tag))};function tp(t,r){return ut(t,r)}function tv(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 tv(t,r,i,c)}function Su(t){return t=t.prototype,!(!t||!t.isReactComponent)}function nv(t){if(typeof t=="function")return Su(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Y)return 11;if(t===Q)return 14}return 2}function fa(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 Ko(t,r,i,c,h,x){var k=2;if(c=t,typeof t=="function")Su(t)&&(k=1);else if(typeof t=="string")k=5;else e:switch(t){case O:return La(i.children,h,x,r);case w:k=8,h|=8;break;case M:return t=Yn(12,i,r,h|2),t.elementType=M,t.lanes=x,t;case I:return t=Yn(13,i,r,h),t.elementType=I,t.lanes=x,t;case W:return t=Yn(19,i,r,h),t.elementType=W,t.lanes=x,t;case B:return Yo(i,h,x,r);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case E:k=10;break e;case U:k=9;break e;case Y:k=11;break e;case Q:k=14;break e;case G:k=16,c=null;break e}throw Error(a(130,t==null?t:typeof t,""))}return r=Yn(k,i,r,h),r.elementType=t,r.type=c,r.lanes=x,r}function La(t,r,i,c){return t=Yn(7,t,c,r),t.lanes=i,t}function Yo(t,r,i,c){return t=Yn(22,t,c,r),t.elementType=B,t.lanes=i,t.stateNode={isHidden:!1},t}function ku(t,r,i){return t=Yn(6,t,null,r),t.lanes=i,t}function ju(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 rv(t,r,i,c,h){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=ql(0),this.expirationTimes=ql(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ql(0),this.identifierPrefix=c,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function Cu(t,r,i,c,h,x,k,P,z){return t=new rv(t,r,i,P,z),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},Oc(x),t}function av(t,r,i){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:re,key:c==null?null:""+c,children:t,containerInfo:r,implementation:i}}function np(t){if(!t)return ra;t=t._reactInternals;e:{if(ye(t)!==t||t.tag!==1)throw Error(a(170));var r=t;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(Cn(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(a(171))}if(t.tag===1){var i=t.type;if(Cn(i))return Rh(t,i,r)}return r}function rp(t,r,i,c,h,x,k,P,z){return t=Cu(i,c,!0,t,h,x,k,P,z),t.context=np(null),i=t.current,c=vn(),h=ua(i),x=Ur(c,h),x.callback=r??null,ia(i,x,h),t.current.lanes=h,Vs(t,h,c),Tn(t,c),t}function Go(t,r,i,c){var h=r.current,x=vn(),k=ua(h);return i=np(i),r.context===null?r.context=i:r.pendingContext=i,r=Ur(x,k),r.payload={element:t},c=c===void 0?null:c,c!==null&&(r.callback=c),t=ia(h,r,k),t!==null&&(cr(t,h,k,x),Co(t,h,k)),k}function Xo(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function ap(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<r?i:r}}function Nu(t,r){ap(t,r),(t=t.alternate)&&ap(t,r)}function sv(){return null}var sp=typeof reportError=="function"?reportError:function(t){console.error(t)};function Eu(t){this._internalRoot=t}Jo.prototype.render=Eu.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(a(409));Go(t,r,null,null)},Jo.prototype.unmount=Eu.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;_a(function(){Go(null,t,null,null)}),r[Ar]=null}};function Jo(t){this._internalRoot=t}Jo.prototype.unstable_scheduleHydration=function(t){if(t){var r=Uf();t={blockedOn:null,target:t,priority:r};for(var i=0;i<Qr.length&&r!==0&&r<Qr[i].priority;i++);Qr.splice(i,0,t),i===0&&Wf(t)}};function Tu(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function qo(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function ip(){}function iv(t,r,i,c,h){if(h){if(typeof c=="function"){var x=c;c=function(){var ne=Xo(k);x.call(ne)}}var k=rp(r,c,t,0,null,!1,!1,"",ip);return t._reactRootContainer=k,t[Ar]=k.current,ti(t.nodeType===8?t.parentNode:t),_a(),k}for(;h=t.lastChild;)t.removeChild(h);if(typeof c=="function"){var P=c;c=function(){var ne=Xo(z);P.call(ne)}}var z=Cu(t,0,!1,null,null,!1,!1,"",ip);return t._reactRootContainer=z,t[Ar]=z.current,ti(t.nodeType===8?t.parentNode:t),_a(function(){Go(r,z,i,c)}),z}function Qo(t,r,i,c,h){var x=i._reactRootContainer;if(x){var k=x;if(typeof h=="function"){var P=h;h=function(){var z=Xo(k);P.call(z)}}Go(r,k,t,h)}else k=iv(i,r,t,h,c);return Xo(k)}Bf=function(t){switch(t.tag){case 3:var r=t.stateNode;if(r.current.memoizedState.isDehydrated){var i=Yr(r.pendingLanes);i!==0&&(Ql(r,i|1),Tn(r,at()),(lt&6)===0&&(xs=at()+500,aa()))}break;case 13:_a(function(){var c=Vr(t,1);if(c!==null){var h=vn();cr(c,t,1,h)}}),Nu(t,1)}},Zl=function(t){if(t.tag===13){var r=Vr(t,134217728);if(r!==null){var i=vn();cr(r,t,134217728,i)}Nu(t,134217728)}},Vf=function(t){if(t.tag===13){var r=ua(t),i=Vr(t,r);if(i!==null){var c=vn();cr(i,t,r,c)}Nu(t,r)}},Uf=function(){return mt},$f=function(t,r){var i=mt;try{return mt=t,r()}finally{mt=i}},yr=function(t,r,i){switch(r){case"input":if(ke(t,i),r=i.name,i.type==="radio"&&r!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<i.length;r++){var c=i[r];if(c!==t&&c.form===t.form){var h=mo(c);if(!h)throw Error(a(90));Ue(c),ke(c,h)}}}break;case"textarea":Qe(t,i);break;case"select":r=i.value,r!=null&&Ie(t,!!i.multiple,r,!1)}},Lt=vu,Ut=_a;var ov={usingClientEntryPoint:!1,Events:[ai,ss,mo,Ye,Et,vu]},xi={findFiberByHostInstance:Ca,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},lv={bundleType:xi.bundleType,version:xi.version,rendererPackageName:xi.rendererPackageName,rendererConfig:xi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:H.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Le(t),t===null?null:t.stateNode},findFiberByHostInstance:xi.findFiberByHostInstance||sv,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zo.isDisabled&&Zo.supportsFiber)try{Kr=Zo.inject(lv),Ht=Zo}catch{}}return Pn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ov,Pn.createPortal=function(t,r){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Tu(r))throw Error(a(200));return av(t,r,null,i)},Pn.createRoot=function(t,r){if(!Tu(t))throw Error(a(299));var i=!1,c="",h=sp;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onRecoverableError!==void 0&&(h=r.onRecoverableError)),r=Cu(t,1,!1,null,null,i,!1,c,h),t[Ar]=r.current,ti(t.nodeType===8?t.parentNode:t),new Eu(r)},Pn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=Le(r),t=t===null?null:t.stateNode,t},Pn.flushSync=function(t){return _a(t)},Pn.hydrate=function(t,r,i){if(!qo(r))throw Error(a(200));return Qo(null,t,r,!0,i)},Pn.hydrateRoot=function(t,r,i){if(!Tu(t))throw Error(a(405));var c=i!=null&&i.hydratedSources||null,h=!1,x="",k=sp;if(i!=null&&(i.unstable_strictMode===!0&&(h=!0),i.identifierPrefix!==void 0&&(x=i.identifierPrefix),i.onRecoverableError!==void 0&&(k=i.onRecoverableError)),r=rp(r,null,t,1,i??null,h,!1,x,k),t[Ar]=r.current,ti(t),c)for(t=0;t<c.length;t++)i=c[t],h=i._getVersion,h=h(i._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[i,h]:r.mutableSourceEagerHydrationData.push(i,h);return new Jo(r)},Pn.render=function(t,r,i){if(!qo(r))throw Error(a(200));return Qo(null,t,r,!1,i)},Pn.unmountComponentAtNode=function(t){if(!qo(t))throw Error(a(40));return t._reactRootContainer?(_a(function(){Qo(null,null,t,!1,function(){t._reactRootContainer=null,t[Ar]=null})}),!0):!1},Pn.unstable_batchedUpdates=vu,Pn.unstable_renderSubtreeIntoContainer=function(t,r,i,c){if(!qo(i))throw Error(a(200));if(t==null||t._reactInternals===void 0)throw Error(a(38));return Qo(t,r,i,!1,c)},Pn.version="18.3.1-next-f1338f8080-20240426",Pn}var pp;function Rg(){if(pp)return Mu.exports;pp=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Mu.exports=gv(),Mu.exports}var mp;function yv(){if(mp)return el;mp=1;var e=Rg();return el.createRoot=e.createRoot,el.hydrateRoot=e.hydrateRoot,el}var xv=yv(),v=zl();const ge=Pg(v),vv=uv({__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 Mg=e=>{throw TypeError(e)},Ig=(e,n,a)=>n.has(e)||Mg("Cannot "+a),Gn=(e,n,a)=>(Ig(e,n,"read from private field"),a?a.call(e):n.get(e)),Ci=(e,n,a)=>n.has(e)?Mg("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,a),jr=(e,n,a,s)=>(Ig(e,n,"write to private field"),n.set(e,a),a),gp="popstate";function yp(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function bv(e={}){function n(s,o){var m;let l=(m=o.state)==null?void 0:m.masked,{pathname:u,search:f,hash:p}=l||s.location;return _i("",{pathname:u,search:f,hash:p},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 Sv(n,a,null,e)}function Je(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Dt(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function wv(){return Math.random().toString(36).substring(2,10)}function xp(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 _i(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||wv(),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 Sv(e,n,a,s={}){let{window:o=document.defaultView,v5Compat:l=!1}=s,u=o.history,f="POP",p=null,m=y();m==null&&(m=0,u.replaceState({...u.state,idx:m},""));function y(){return(u.state||{idx:null}).idx}function g(){f="POP";let j=y(),L=j==null?null:j-m;m=j,p&&p({action:f,location:N.location,delta:L})}function b(j,L){f="PUSH";let R=yp(j)?j:_i(N.location,j,L);m=y()+1;let D=xp(R,m),H=N.createHref(R.mask||R);try{u.pushState(D,"",H)}catch(K){if(K instanceof DOMException&&K.name==="DataCloneError")throw K;o.location.assign(H)}l&&p&&p({action:f,location:N.location,delta:1})}function S(j,L){f="REPLACE";let R=yp(j)?j:_i(N.location,j,L);m=y();let D=xp(R,m),H=N.createHref(R.mask||R);u.replaceState(D,"",H),l&&p&&p({action:f,location:N.location,delta:0})}function C(j){return _g(j)}let N={get action(){return f},get location(){return e(o,u)},listen(j){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(gp,g),p=j,()=>{o.removeEventListener(gp,g),p=null}},createHref(j){return n(o,j)},createURL:C,encodeLocation(j){let L=C(j);return{pathname:L.pathname,search:L.search,hash:L.hash}},push:b,replace:S,go(j){return u.go(j)}};return N}function _g(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 Ni,vp=class{constructor(e){if(Ci(this,Ni,new Map),e)for(let[n,a]of e)this.set(n,a)}get(e){if(Gn(this,Ni).has(e))return Gn(this,Ni).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,n){Gn(this,Ni).set(e,n)}};Ni=new WeakMap;var kv=new Set(["lazy","caseSensitive","path","id","index","children"]);function jv(e){return kv.has(e)}var Cv=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Nv(e){return Cv.has(e)}function Ev(e){return e.index===!0}function Di(e,n,a=[],s={},o=!1){return e.map((l,u)=>{let f=[...a,String(u)],p=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[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),Ev(l)){let m={...l,id:p};return s[p]=bp(m,n(m)),m}else{let m={...l,id:p,children:void 0};return s[p]=bp(m,n(m)),l.children&&(m.children=Di(l.children,n,f,s,o)),m}})}function bp(e,n){return Object.assign(e,{...n,...typeof n.lazy=="object"&&n.lazy!=null?{lazy:{...e.lazy,...n.lazy}}:{}})}function Dg(e,n,a="/"){return dr(e,n,a,!1)}function dr(e,n,a,s,o){let l=typeof n=="string"?_r(n):n,u=er(l.pathname||"/",a);if(u==null)return null;let f=o??hl(e),p=null,m=zv(u);for(let y=0;p==null&&y<f.length;++y)p=Av(f[y],m,s);return p}function Fg(e,n){let{route:a,pathname:s,params:o}=e;return{id:a.id,pathname:s,params:o,data:n[a.id],loaderData:n[a.id],handle:a.handle}}function hl(e){let n=Lg(e);return Tv(n),n}function Lg(e,n=[],a=[],s="",o=!1){let l=(u,f,p=o,m)=>{let y={relativePath:m===void 0?u.path||"":m,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(s)&&p)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 g=Qn([s,y.relativePath]),b=a.concat(y);u.children&&u.children.length>0&&(Je(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Lg(u.children,n,b,g,p)),!(u.path==null&&!u.index)&&n.push({path:g,score:Fv(g,u.index),routesMeta:b})};return e.forEach((u,f)=>{var p;if(u.path===""||!((p=u.path)!=null&&p.includes("?")))l(u,f);else for(let m of Ag(u.path))l(u,f,!0,m)}),n}function Ag(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 u=Ag(s.join("/")),f=[];return f.push(...u.map(p=>p===""?l:[l,p].join("/"))),o&&f.push(...u),f.map(p=>e.startsWith("/")&&p===""?"/":p)}function Tv(e){e.sort((n,a)=>n.score!==a.score?a.score-n.score:Lv(n.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var Pv=/^:[\w-]+$/,Rv=3,Mv=2,Iv=1,_v=10,Dv=-2,wp=e=>e==="*";function Fv(e,n){let a=e.split("/"),s=a.length;return a.some(wp)&&(s+=Dv),n&&(s+=Mv),a.filter(o=>!wp(o)).reduce((o,l)=>o+(Pv.test(l)?Rv:l===""?Iv:_v),s)}function Lv(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 Av(e,n,a=!1){let{routesMeta:s}=e,o={},l="/",u=[];for(let f=0;f<s.length;++f){let p=s[f],m=f===s.length-1,y=l==="/"?n:n.slice(l.length)||"/",g=Nl({path:p.relativePath,caseSensitive:p.caseSensitive,end:m},y),b=p.route;if(!g&&m&&a&&!s[s.length-1].route.index&&(g=Nl({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},y)),!g)return null;Object.assign(o,g.params),u.push({params:o,pathname:Qn([l,g.pathname]),pathnameBase:Uv(Qn([l,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(l=Qn([l,g.pathnameBase]))}return u}function Nl(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,s]=Ov(e.path,e.caseSensitive,e.end),o=n.match(a);if(!o)return null;let l=o[0],u=l.replace(/(.)\/+$/,"$1"),f=o.slice(1);return{params:s.reduce((m,{paramName:y,isOptional:g},b)=>{if(y==="*"){let C=f[b]||"";u=l.slice(0,l.length-C.length).replace(/(.)\/+$/,"$1")}const S=f[b];return g&&!S?m[y]=void 0:m[y]=(S||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:u,pattern:e}}function Ov(e,n=!1,a=!0){Dt(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,(u,f,p,m,y)=>{if(s.push({paramName:f,isOptional:p!=null}),p){let g=y.charAt(m+u.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 Dt(!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 Bv({basename:e,pathname:n}){return n==="/"?e:Qn([e,n])}var Og=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vd=e=>Og.test(e);function Vv(e,n="/"){let{pathname:a,search:s="",hash:o=""}=typeof e=="string"?_r(e):e,l;return a?(a=Ud(a),a.startsWith("/")?l=Sp(a.substring(1),"/"):l=Sp(a,n)):l=n,{pathname:l,search:$v(s),hash:Hv(o)}}function Sp(e,n){let a=El(n).split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function Du(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 <Link to="..."> and the router will parse it for you.`}function zg(e){return e.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function Bl(e){let n=zg(e);return n.map((a,s)=>s===n.length-1?a.pathname:a.pathnameBase)}function Bi(e,n,a,s=!1){let o;typeof e=="string"?o=_r(e):(o={...e},Je(!o.pathname||!o.pathname.includes("?"),Du("?","pathname","search",o)),Je(!o.pathname||!o.pathname.includes("#"),Du("#","pathname","hash",o)),Je(!o.search||!o.search.includes("#"),Du("#","search","hash",o)));let l=e===""||o.pathname==="",u=l?"/":o.pathname,f;if(u==null)f=a;else{let g=n.length-1;if(!s&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),g-=1;o.pathname=b.join("/")}f=g>=0?n[g]:"/"}let p=Vv(o,f),m=u&&u!=="/"&&u.endsWith("/"),y=(l||u===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(m||y)&&(p.pathname+="/"),p}var Ud=e=>e.replace(/\/\/+/g,"/"),Qn=e=>Ud(e.join("/")),El=e=>e.replace(/\/+$/,""),Uv=e=>El(e).replace(/^\/*/,"/"),$v=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Hv=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Vi=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 Fi(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Ui(e){let n=e.map(a=>a.route.path).filter(Boolean);return Qn(n)||"/"}var Bg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Vg(e,n){let a=e;if(typeof a!="string"||!Og.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let s=a,o=!1;if(Bg)try{let l=new URL(window.location.href),u=a.startsWith("//")?new URL(l.protocol+a):new URL(a),f=er(u.pathname,n);u.origin===l.origin&&f!=null?a=f+u.search+u.hash:o=!0}catch{Dt(!1,`<Link to="${a}"> 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 va=Symbol("Uninstrumented");function Wv(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 u=Object.keys(a);for(let f of u)l[f]&&a[f].push(l[f])}}));let s={};if(typeof n.lazy=="function"&&a.lazy.length>0){let o=js(a.lazy,n.lazy,()=>{});o&&(s.lazy=o)}if(typeof n.lazy=="object"){let o=n.lazy;["middleware","loader","action"].forEach(l=>{let u=o[l],f=a[`lazy.${l}`];if(typeof u=="function"&&f.length>0){let p=js(f,u,()=>{});p&&(s.lazy=Object.assign(s.lazy||{},{[l]:p}))}})}return["loader","action"].forEach(o=>{let l=n[o];if(typeof l=="function"&&a[o].length>0){let u=l[va]??l,f=js(a[o],u,(...p)=>kp(p[0]));f&&(o==="loader"&&u.hydrate===!0&&(f.hydrate=!0),f[va]=u,s[o]=f)}}),n.middleware&&n.middleware.length>0&&a.middleware.length>0&&(s.middleware=n.middleware.map(o=>{let l=o[va]??o,u=js(a.middleware,l,(...f)=>kp(f[0]));return u?(u[va]=l,u):o})),s}function Kv(e,n){let a={navigate:[],fetch:[]};if(n.forEach(s=>s({instrument(o){let l=Object.keys(o);for(let u of l)o[u]&&a[u].push(o[u])}})),a.navigate.length>0){let s=e.navigate[va]??e.navigate,o=js(a.navigate,s,(...l)=>{let[u,f]=l;return{to:typeof u=="number"||typeof u=="string"?u:u?Mr(u):".",...jp(e,f??{})}});o&&(o[va]=s,e.navigate=o)}if(a.fetch.length>0){let s=e.fetch[va]??e.fetch,o=js(a.fetch,s,(...l)=>{let[u,,f,p]=l;return{href:f??".",fetcherKey:u,...jp(e,p??{})}});o&&(o[va]=s,e.fetch=o)}return e}function js(e,n,a){return e.length===0?null:async(...s)=>{let o=await Ug(e,a(...s),()=>n(...s),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function Ug(e,n,a,s){let o=e[s],l;if(o){let u,f=async()=>(u?console.error("You cannot call instrumented handlers more than once"):u=Ug(e,n,a,s-1),l=await u,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(p){console.error("An instrumentation function threw an error:",p)}u||await f(),await u}else try{l={type:"success",value:await a()}}catch(u){l={type:"error",value:u}}return l||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function kp(e){let{request:n,context:a,params:s,pattern:o}=e;return{request:Yv(n),params:{...s},pattern:o,context:Gv(a)}}function jp(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 Yv(e){return{method:e.method,url:e.url,headers:{get:(...n)=>e.headers.get(...n)}}}function Gv(e){if(Jv(e)){let n={...e};return Object.freeze(n),n}else return{get:n=>e.get(n)}}var Xv=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Jv(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")===Xv}var $g=["POST","PUT","PATCH","DELETE"],qv=new Set($g),Qv=["GET",...$g],Zv=new Set(Qv),Hg=new Set([301,302,303,307,308]),eb=new Set([307,308]),Fu={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},tb={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},bi={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},nb=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Wg="remix-router-transitions",Kg=Symbol("ResetLoaderData"),za,bs,pa,ws,rb=class{constructor(e){Ci(this,za),Ci(this,bs),Ci(this,pa),Ci(this,ws),jr(this,za,e),jr(this,bs,hl(e))}get stableRoutes(){return Gn(this,za)}get activeRoutes(){return Gn(this,pa)??Gn(this,za)}get branches(){return Gn(this,ws)??Gn(this,bs)}get hasHMRRoutes(){return Gn(this,pa)!=null}setRoutes(e){jr(this,za,e),jr(this,bs,hl(e))}setHmrRoutes(e){jr(this,pa,e),jr(this,ws,hl(e))}commitHmrRoutes(){Gn(this,pa)&&(jr(this,za,Gn(this,pa)),jr(this,bs,Gn(this,ws)),jr(this,pa,void 0),jr(this,ws,void 0))}};za=new WeakMap;bs=new WeakMap;pa=new WeakMap;ws=new WeakMap;function ab(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||nb,l=o;if(e.instrumentations){let F=e.instrumentations;l=V=>({...o(V),...Wv(F.map(q=>q.route).filter(Boolean),V)})}let u={},f=new rb(Di(e.routes,l,void 0,u)),p=e.basename||"/";p.startsWith("/")||(p=`/${p}`);let m=e.dataStrategy||cb,y={...e.future},g=null,b=new Set,S=null,C=null,N=null,j=null,L=e.hydrationData!=null,R=dr(f.activeRoutes,e.history.location,p,!1,f.branches),D=!1,H=null,K,re;if(R==null&&!e.patchRoutesOnNavigation){let F=Xn(404,{pathname:e.history.location.pathname}),{matches:V,route:q}=tl(f.activeRoutes);K=!0,re=!K,R=V,H={[q.id]:F}}else if(R&&!e.hydrationData&&In(R,f.activeRoutes,e.history.location.pathname).active&&(R=null),R)if(R.some(F=>F.route.lazy))K=!1,re=!K;else if(!R.some(F=>$d(F.route)))K=!0,re=!K;else{let F=e.hydrationData?e.hydrationData.loaderData:null,V=e.hydrationData?e.hydrationData.errors:null,q=R;if(V){let le=R.findIndex(ce=>V[ce.route.id]!==void 0);q=q.slice(0,le+1)}re=!1,K=!0,q.forEach(le=>{let ce=Yg(le.route,F,V);re=re||ce.renderFallback,K=K&&!ce.shouldLoad})}else{K=!1,re=!K,R=[];let F=In(null,f.activeRoutes,e.history.location.pathname);F.active&&F.matches&&(D=!0,R=F.matches)}let O,w={historyAction:e.history.action,location:e.history.location,matches:R,initialized:K,renderFallback:re,navigation:Fu,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||H,fetchers:new Map,blockers:new Map},M="POP",E=null,U=!1,Y,I=!1,W=new Map,Q=null,G=!1,B=!1,_=new Set,X=new Map,J=0,T=-1,A=new Map,te=new Set,ie=new Map,oe=new Map,ae=new Set,ue=new Map,xe,ve=null;function Ve(){if(g=e.history.listen(({action:F,location:V,delta:q})=>{if(xe){xe(),xe=void 0;return}Dt(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:F});if(le&&q!=null){let ce=new Promise(_e=>{xe=_e});e.history.go(q*-1),sn(le,{state:"blocked",location:V,proceed(){sn(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,bi),Oe({blockers:_e})}}),E==null||E.resolve(),E=null;return}return ke(F,V)}),a){Eb(n,W);let F=()=>Tb(n,W);n.addEventListener("pagehide",F),Q=()=>n.removeEventListener("pagehide",F)}return w.initialized||ke("POP",w.location,{initialHydration:!0}),O}function Ce(){g&&g(),Q&&Q(),b.clear(),Y&&Y.abort(),w.fetchers.forEach((F,V)=>Mn(w.fetchers,V)),w.blockers.forEach((F,V)=>yr(V))}function Ue(F){if(b.add(F),S){let{newErrors:V}=S;S=null,F(w,{deletedFetchers:[],newErrors:V,viewTransitionOpts:void 0,flushSync:!1})}return()=>b.delete(F)}function Oe(F,V={}){F.matches&&(F.matches=F.matches.map(ce=>{let _e=u[ce.route.id],De=ce.route;return De.element!==_e.element||De.errorElement!==_e.errorElement||De.hydrateFallbackElement!==_e.hydrateFallbackElement?{...ce,route:_e}:ce})),w={...w,...F};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&&(S={newErrors:F.errors??null}),[...b].forEach(ce=>ce(w,{deletedFetchers:q,newErrors:F.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(F,V,{flushSync:q}={}){var $e,Xe;let le=w.actionData!=null&&w.navigation.formMethod!=null&&pn(w.navigation.formMethod)&&w.navigation.state==="loading"&&(($e=F.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?Fp(w.loaderData,V.loaderData,V.matches||[],V.errors):w.loaderData,De=w.blockers;De.size>0&&(De=new Map(De),De.forEach((Le,tt)=>De.set(tt,bi)));let Ke=G?!1:Ut(F,V.matches||w.matches),ye=U===!0||w.navigation.formMethod!=null&&pn(w.navigation.formMethod)&&((Xe=F.state)==null?void 0:Xe._isRedirect)!==!0;f.commitHmrRoutes(),G||M==="POP"||(M==="PUSH"?e.history.push(F,F.state):M==="REPLACE"&&e.history.replace(F,F.state));let Fe;if(M==="POP"){let Le=W.get(w.location.pathname);Le&&Le.has(F.pathname)?Fe={currentLocation:w.location,nextLocation:F}:W.has(F.pathname)&&(Fe={currentLocation:F,nextLocation:w.location})}else if(I){let Le=W.get(w.location.pathname);Le?Le.add(F.pathname):(Le=new Set([F.pathname]),W.set(w.location.pathname,Le)),Fe={currentLocation:w.location,nextLocation:F}}Oe({...V,actionData:ce,loaderData:_e,historyAction:M,location:F,initialized:!0,renderFallback:!1,navigation:Fu,revalidation:"idle",restoreScrollPosition:Ke,preventScrollReset:ye,blockers:De},{viewTransitionOpts:Fe,flushSync:q===!0}),M="POP",U=!1,I=!1,G=!1,B=!1,E==null||E.resolve(),E=null,ve==null||ve.resolve(),ve=null}async function xt(F,V){if(E==null||E.resolve(),E=null,typeof F=="number"){E||(E=zp());let ut=E.promise;return e.history.go(F),ut}let q=fd(w.location,w.matches,p,F,V==null?void 0:V.fromRouteId,V==null?void 0:V.relative),{path:le,submission:ce,error:_e}=Cp(!1,q,V),De;V!=null&&V.mask&&(De={pathname:"",search:"",hash:"",...typeof V.mask=="string"?_r(V.mask):{...w.location.mask,...V.mask}});let Ke=w.location,ye=_i(Ke,le,V&&V.state,void 0,De);ye={...ye,...e.history.encodeLocation(ye)};let Fe=V&&V.replace!=null?V.replace:void 0,$e="PUSH";Fe===!0?$e="REPLACE":Fe===!1||ce!=null&&pn(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){sn(tt,{state:"blocked",location:ye,proceed(){sn(tt,{state:"proceeding",proceed:void 0,reset:void 0,location:ye}),xt(F,V)},reset(){let ut=new Map(w.blockers);ut.set(tt,bi),Oe({blockers:ut})}});return}await ke($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=zp()),Qt(),Oe({revalidation:"loading"});let F=ve.promise;return w.navigation.state==="submitting"?F:w.navigation.state==="idle"?(ke(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),F):(ke(M||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:I===!0}),F)}async function ke(F,V,q){Y&&Y.abort(),Y=null,M=F,G=(q&&q.startUninterruptedRevalidation)===!0,Lt(w.location,w.matches),U=(q&&q.preventScrollReset)===!0,I=(q&&q.enableViewTransition)===!0;let le=f.activeRoutes,ce=q!=null&&q.initialHydration&&w.matches&&w.matches.length>0&&!D?w.matches:dr(le,V,p,!1,f.branches),_e=(q&&q.flushSync)===!0;if(ce&&w.initialized&&!B&&yb(w.location,V)&&!(q&&q.submission&&pn(q.submission.formMethod))){dt(V,{matches:ce},{flushSync:_e});return}let De=In(ce,le,V.pathname);if(De.active&&De.matches&&(ce=De.matches),!ce){let{error:kt,notFoundMatches:pt,route:at}=Dr(V.pathname);dt(V,{matches:pt,loaderData:{},errors:{[at.id]:kt}},{flushSync:_e});return}let Ke=q&&q.overrideNavigation?{...q.overrideNavigation,matches:ce,historyAction:F}:void 0;Y=new AbortController;let ye=Ss(e.history,V,Y.signal,q&&q.submission),Fe=e.getContext?await e.getContext():new vp,$e;if(q&&q.pendingError)$e=[ya(ce).route.id,{type:"error",error:q.pendingError}];else if(q&&q.submission&&pn(q.submission.formMethod)){let kt=await Re(ye,V,q.submission,ce,F,Fe,De.active,q&&q.initialHydration===!0,{replace:q.replace,flushSync:_e});if(kt.shortCircuited)return;if(kt.pendingActionResult){let[pt,at]=kt.pendingActionResult;if(On(at)&&Fi(at.error)&&at.error.status===404){Y=null,dt(V,{matches:kt.matches,loaderData:{},errors:{[pt]:at.error}});return}}ce=kt.matches||ce,$e=kt.pendingActionResult,Ke=Lu(V,ce,F,q.submission),_e=!1,De.active=!1,ye=Ss(e.history,ye.url,ye.signal)}let{shortCircuited:Xe,matches:Le,loaderData:tt,errors:ut,workingFetchers:Ot}=await we(ye,V,ce,F,Fe,De.active,Ke,q&&q.submission,q&&q.fetcherSubmission,q&&q.replace,q&&q.initialHydration===!0,_e,$e,q&&q.callSiteDefaultShouldRevalidate);Xe||(Y=null,dt(V,{matches:Le||ce,...Lp($e),loaderData:tt,errors:ut,...Ot?{fetchers:Ot}:{}}))}async function Re(F,V,q,le,ce,_e,De,Ke,ye={}){Qt();let Fe=Cb(V,le,ce,q);if(Oe({navigation:Fe},{flushSync:ye.flushSync===!0}),De){let Le=await St(le,V.pathname,F.signal);if(Le.type==="aborted")return{shortCircuited:!0};if(Le.type==="error"){if(Le.partialMatches.length===0){let{matches:ut,route:Ot}=tl(f.activeRoutes);return{matches:ut,pendingActionResult:[Ot.id,{type:"error",error:Le.error}]}}let tt=ya(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}=Dr(V.pathname);return{matches:tt,pendingActionResult:[Ot.id,{type:"error",error:ut}]}}}let $e,Xe=pl(le,V);if(!Xe.route.action&&!Xe.route.lazy)$e={type:"error",error:Xn(405,{method:F.method,pathname:V.pathname,routeId:Xe.route.id})};else{let Le=Ps(l,u,F,V,le,Xe,Ke?[]:s,_e),tt=await rt(F,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(F.signal.aborted)return{shortCircuited:!0}}if(Va($e)){let Le;return ye&&ye.replace!=null?Le=ye.replace:Le=Ip($e.response.headers.get("Location"),new URL(F.url),p,e.history)===w.location.pathname+w.location.search,await Ge(F,$e,!0,{submission:q,replace:Le}),{shortCircuited:!0}}if(On($e)){let Le=ya(le,Xe.route.id);return(ye&&ye.replace)!==!0&&(M="PUSH"),{matches:le,pendingActionResult:[Le.route.id,$e,Xe.route.id]}}return{matches:le,pendingActionResult:[Xe.route.id,$e]}}async function we(F,V,q,le,ce,_e,De,Ke,ye,Fe,$e,Xe,Le,tt){let ut=De||Lu(V,q,le,Ke),Ot=Ke||ye||Op(ut),kt=!G&&!$e;if(_e){if(kt){let cn=me(Le);Oe({navigation:ut,...cn!==void 0?{actionData:cn}:{}},{flushSync:Xe})}let st=await St(q,V.pathname,F.signal);if(st.type==="aborted")return{shortCircuited:!0};if(st.type==="error"){if(st.partialMatches.length===0){let{matches:yn,route:kn}=tl(f.activeRoutes);return{matches:yn,loaderData:{},errors:{[kn.id]:st.error}}}let cn=ya(st.partialMatches).route.id;return{matches:st.partialMatches,loaderData:{},errors:{[cn]:st.error}}}else if(st.matches)q=st.matches;else{let{error:cn,notFoundMatches:yn,route:kn}=Dr(V.pathname);return{matches:yn,loaderData:{},errors:{[kn.id]:cn}}}}let pt=f.activeRoutes,{dsMatches:at,revalidatingFetchers:on}=Np(F,ce,l,u,e.history,w,q,Ot,V,$e?[]:s,$e===!0,B,_,ae,ie,te,pt,p,e.patchRoutesOnNavigation!=null,f.branches,Le,tt);if(T=++J,!e.dataStrategy&&!at.some(st=>st.shouldLoad)&&!at.some(st=>st.route.middleware&&st.route.middleware.length>0)&&on.length===0){let st=new Map(w.fetchers),cn=it(st);return dt(V,{matches:q,loaderData:{},errors:Le&&On(Le[1])?{[Le[0]]:Le[1].error}:null,...Lp(Le),...cn?{fetchers:st}:{}},{flushSync:Xe}),{shortCircuited:!0}}if(kt){let st={};if(!_e){st.navigation=ut;let cn=me(Le);cn!==void 0&&(st.actionData=cn)}on.length>0&&(st.fetchers=Ie(on)),Oe(st,{flushSync:Xe})}on.forEach(st=>{Ze(st.key),st.controller&&X.set(st.key,st.controller)});let Fr=()=>on.forEach(st=>Ze(st.key));Y&&Y.signal.addEventListener("abort",Fr);let{loaderResults:nr,fetcherResults:rr}=await ht(at,on,F,V,ce);if(F.signal.aborted)return{shortCircuited:!0};Y&&Y.signal.removeEventListener("abort",Fr),on.forEach(st=>X.delete(st.key));let vr=nl(nr);if(vr)return await Ge(F,vr.result,!0,{replace:Fe}),{shortCircuited:!0};if(vr=nl(rr),vr)return te.add(vr.key),await Ge(F,vr.result,!0,{replace:Fe}),{shortCircuited:!0};let _n=new Map(w.fetchers),{loaderData:Kr,errors:Ht}=Dp(w,q,nr,Le,on,rr,_n);$e&&w.errors&&(Ht={...w.errors,...Ht});let Xa=it(_n),ln=Zt(T,_n),Ja=Xa||ln||on.length>0;return{matches:q,loaderData:Kr,errors:Ht,...Ja?{workingFetchers:_n}:{}}}function me(F){if(F&&!On(F[1]))return{[F[0]]:F[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function Ie(F){let V=new Map(w.fetchers);return F.forEach(q=>{let le=V.get(q.key),ce=wi(void 0,le?le.data:void 0);V.set(q.key,ce)}),V}async function be(F,V,q,le){Ze(F);let ce=(le&&le.flushSync)===!0,_e=f.activeRoutes,De=fd(w.location,w.matches,p,q,V,le==null?void 0:le.relative),Ke=dr(_e,De,p,!1,f.branches),ye=In(Ke,_e,De);if(ye.active&&ye.matches&&(Ke=ye.matches),!Ke){qe(F,V,Xn(404,{pathname:De}),{flushSync:ce});return}let{path:Fe,submission:$e,error:Xe}=Cp(!0,De,le);if(Xe){qe(F,V,Xe,{flushSync:ce});return}let Le=e.getContext?await e.getContext():new vp,tt=(le&&le.preventScrollReset)===!0;if($e&&pn($e.formMethod)){await Ae(F,V,Fe,Ke,Le,ye.active,ce,tt,$e,le&&le.defaultShouldRevalidate);return}ie.set(F,{routeId:V,path:Fe}),await Qe(F,V,Fe,Ke,Le,ye.active,ce,tt,$e)}async function Ae(F,V,q,le,ce,_e,De,Ke,ye,Fe){Qt(),ie.delete(F);let $e=w.fetchers.get(F);Pt(F,Nb(ye,$e),{flushSync:De});let Xe=new AbortController,Le=Ss(e.history,q,Xe.signal,ye);if(_e){let bt=await St(le,new URL(Le.url).pathname,Le.signal,F);if(bt.type==="aborted")return;if(bt.type==="error"){qe(F,V,bt.error,{flushSync:De});return}else if(bt.matches)le=bt.matches;else{qe(F,V,Xn(404,{pathname:q}),{flushSync:De});return}}let tt=pl(le,q);if(!tt.route.action&&!tt.route.lazy){let bt=Xn(405,{method:ye.formMethod,pathname:q,routeId:V});qe(F,V,bt,{flushSync:De});return}X.set(F,Xe);let ut=J,Ot=Ps(l,u,Le,q,le,tt,s,ce),kt=await rt(Le,q,Ot,ce,F),pt=kt[tt.route.id];if(!pt){for(let bt of Ot)if(kt[bt.route.id]){pt=kt[bt.route.id];break}}if(Le.signal.aborted){X.get(F)===Xe&&X.delete(F);return}if(ae.has(F)){if(Va(pt)||On(pt)){Pt(F,Nr(void 0));return}}else{if(Va(pt))if(X.delete(F),T>ut){Pt(F,Nr(void 0));return}else return te.add(F),Pt(F,wi(ye)),Ge(Le,pt,!1,{fetcherSubmission:ye,preventScrollReset:Ke});if(On(pt)){qe(F,V,pt.error);return}}let at=w.navigation.location||w.location,on=Ss(e.history,at,Xe.signal),Fr=f.activeRoutes,nr=w.navigation.state!=="idle"?dr(Fr,w.navigation.location,p,!1,f.branches):w.matches;Je(nr,"Didn't find any matches after fetcher action");let rr=++J;A.set(F,rr);let{dsMatches:vr,revalidatingFetchers:_n}=Np(on,ce,l,u,e.history,w,nr,ye,at,s,!1,B,_,ae,ie,te,Fr,p,e.patchRoutesOnNavigation!=null,f.branches,[tt.route.id,pt],Fe),Kr=wi(ye,pt.data),Ht=new Map(w.fetchers);Ht.set(F,Kr),_n.filter(bt=>bt.key!==F).forEach(bt=>{let Lr=bt.key,qa=Ht.get(Lr),Qi=wi(void 0,qa?qa.data:void 0);Ht.set(Lr,Qi),Ze(Lr),bt.controller&&X.set(Lr,bt.controller)}),Oe({fetchers:Ht});let Xa=()=>_n.forEach(bt=>Ze(bt.key));Xe.signal.addEventListener("abort",Xa);let{loaderResults:ln,fetcherResults:Ja}=await ht(vr,_n,on,at,ce);if(Xe.signal.aborted)return;Xe.signal.removeEventListener("abort",Xa),A.delete(F),X.delete(F),_n.forEach(bt=>X.delete(bt.key));let st=w.fetchers.has(F),cn=bt=>{if(!st)return bt;let Lr=new Map(bt.fetchers);return Lr.set(F,Nr(pt.data)),{...bt,fetchers:Lr}},yn=nl(ln);if(yn)return w=cn(w),Ge(on,yn.result,!1,{preventScrollReset:Ke});if(yn=nl(Ja),yn)return te.add(yn.key),w=cn(w),Ge(on,yn.result,!1,{preventScrollReset:Ke});let kn=new Map(w.fetchers);st&&kn.set(F,Nr(pt.data));let{loaderData:Yr,errors:Gr}=Dp(w,nr,ln,void 0,_n,Ja,kn);Zt(rr,kn),w.navigation.state==="loading"&&rr>T?(Je(M,"Expected pending action"),Y&&Y.abort(),dt(w.navigation.location,{matches:nr,loaderData:Yr,errors:Gr,fetchers:kn})):(Oe({errors:Gr,loaderData:Fp(w.loaderData,Yr,nr,Gr),fetchers:kn}),B=!1)}async function Qe(F,V,q,le,ce,_e,De,Ke,ye){let Fe=w.fetchers.get(F);Pt(F,wi(ye,Fe?Fe.data:void 0),{flushSync:De});let $e=new AbortController,Xe=Ss(e.history,q,$e.signal);if(_e){let pt=await St(le,new URL(Xe.url).pathname,Xe.signal,F);if(pt.type==="aborted")return;if(pt.type==="error"){qe(F,V,pt.error,{flushSync:De});return}else if(pt.matches)le=pt.matches;else{qe(F,V,Xn(404,{pathname:q}),{flushSync:De});return}}let Le=pl(le,q);X.set(F,$e);let tt=J,ut=Ps(l,u,Xe,q,le,Le,s,ce),Ot=await rt(Xe,q,ut,ce,F),kt=Ot[Le.route.id];if(!kt){for(let pt of le)if(Ot[pt.route.id]){kt=Ot[pt.route.id];break}}if(X.get(F)===$e&&X.delete(F),!Xe.signal.aborted){if(ae.has(F)){Pt(F,Nr(void 0));return}if(Va(kt))if(T>tt){Pt(F,Nr(void 0));return}else{te.add(F),await Ge(Xe,kt,!1,{preventScrollReset:Ke});return}if(On(kt)){qe(F,V,kt.error);return}Pt(F,Nr(kt.data))}}async function Ge(F,V,q,{submission:le,fetcherSubmission:ce,preventScrollReset:_e,replace:De}={}){q||(E==null||E.resolve(),E=null),V.response.headers.has("X-Remix-Revalidate")&&(B=!0);let Ke=V.response.headers.get("Location");Je(Ke,"Expected a Location header on the redirect Response"),Ke=Ip(Ke,new URL(F.url),p,e.history);let ye=_i(w.location,Ke,{_isRedirect:!0});if(a){let ut=!1;if(V.response.headers.has("X-Remix-Reload-Document"))ut=!0;else if(Vd(Ke)){const Ot=_g(Ke,!0);ut=Ot.origin!==n.location.origin||er(Ot.pathname,p)==null}if(ut){De?n.location.replace(Ke):n.location.assign(Ke);return}}Y=null;let Fe=De===!0||V.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:$e,formAction:Xe,formEncType:Le}=w.navigation;!le&&!ce&&$e&&Xe&&Le&&(le=Op(w.navigation));let tt=le||ce;if(eb.has(V.response.status)&&tt&&pn(tt.formMethod))await ke(Fe,ye,{submission:{...tt,formAction:Ke},preventScrollReset:_e||U,enableViewTransition:q?I:void 0});else{let ut=Lu(ye,[],Fe,le);await ke(Fe,ye,{overrideNavigation:ut,fetcherSubmission:ce,preventScrollReset:_e||U,enableViewTransition:q?I:void 0})}}async function rt(F,V,q,le,ce){var Ke;let _e,De={};try{_e=await db(m,F,V,q,ce,le,!1)}catch(ye){return q.filter(Fe=>Fe.shouldLoad).forEach(Fe=>{De[Fe.route.id]={type:"error",error:ye}}),De}if(F.signal.aborted)return De;if(!pn(F.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,Fe]of Object.entries(_e))if(wb(Fe)){let $e=Fe.result;De[ye]={type:"redirect",response:mb($e,F,ye,q,p)}}else De[ye]=await pb(Fe);return De}async function ht(F,V,q,le,ce){let _e=rt(q,le,F,ce,null),De=Promise.all(V.map(async Fe=>{if(Fe.matches&&Fe.match&&Fe.request&&Fe.controller){let Xe=(await rt(Fe.request,Fe.path,Fe.matches,ce,Fe.key))[Fe.match.route.id];return{[Fe.key]:Xe}}else return Promise.resolve({[Fe.key]:{type:"error",error:Xn(404,{pathname:Fe.path})}})})),Ke=await _e,ye=(await De).reduce((Fe,$e)=>Object.assign(Fe,$e),{});return{loaderResults:Ke,fetcherResults:ye}}function Qt(){B=!0,ie.forEach((F,V)=>{X.has(V)&&_.add(V),Ze(V)})}function Pt(F,V,q={}){let le=new Map(w.fetchers);le.set(F,V),Oe({fetchers:le},{flushSync:(q&&q.flushSync)===!0})}function qe(F,V,q,le={}){let ce=ya(w.matches,V),_e=new Map(w.fetchers);Mn(_e,F),Oe({errors:{[ce.route.id]:q},fetchers:_e},{flushSync:(le&&le.flushSync)===!0})}function Sn(F){return oe.set(F,(oe.get(F)||0)+1),ae.has(F)&&ae.delete(F),w.fetchers.get(F)||tb}function ft(F,V){Ze(F,V==null?void 0:V.reason),Pt(F,Nr(null))}function Mn(F,V){let q=w.fetchers.get(V);X.has(V)&&!(q&&q.state==="loading"&&A.has(V))&&Ze(V),ie.delete(V),A.delete(V),te.delete(V),ae.delete(V),_.delete(V),F.delete(V)}function Te(F){let V=(oe.get(F)||0)-1;V<=0?(oe.delete(F),ae.add(F)):oe.set(F,V),Oe({fetchers:new Map(w.fetchers)})}function Ze(F,V){let q=X.get(F);q&&(q.abort(V),X.delete(F))}function ot(F,V){for(let q of F){let le=V.get(q);Je(le,`Expected fetcher: ${q}`);let ce=Nr(le.data);V.set(q,ce)}}function it(F){let V=[],q=!1;for(let le of te){let ce=F.get(le);Je(ce,`Expected fetcher: ${le}`),ce.state==="loading"&&(te.delete(le),V.push(le),q=!0)}return ot(V,F),q}function Zt(F,V){let q=[];for(let[le,ce]of A)if(ce<F){let _e=V.get(le);Je(_e,`Expected fetcher: ${le}`),_e.state==="loading"&&(Ze(le),A.delete(le),q.push(le))}return ot(q,V),q.length>0}function gt(F,V){let q=w.blockers.get(F)||bi;return ue.get(F)!==V&&ue.set(F,V),q}function yr(F){w.blockers.delete(F),ue.delete(F)}function sn(F,V){let q=w.blockers.get(F)||bi;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(F,V),Oe({blockers:le})}function Vn({currentLocation:F,nextLocation:V,historyAction:q}){if(ue.size===0)return;ue.size>1&&Dt(!1,"A router only supports one blocker at a time");let le=Array.from(ue.entries()),[ce,_e]=le[le.length-1],De=w.blockers.get(ce);if(!(De&&De.state==="proceeding")&&_e({currentLocation:F,nextLocation:V,historyAction:q}))return ce}function Dr(F){let V=Xn(404,{pathname:F}),q=f.activeRoutes,{matches:le,route:ce}=tl(q);return{notFoundMatches:le,route:ce,error:V}}function Ye(F,V,q){if(C=F,j=V,N=q||null,!L&&w.navigation===Fu){L=!0;let le=Ut(w.location,w.matches);le!=null&&Oe({restoreScrollPosition:le})}return()=>{C=null,j=null,N=null}}function Et(F,V){return N&&N(F,V.map(le=>Fg(le,w.loaderData)))||F.key}function Lt(F,V){if(C&&j){let q=Et(F,V);C[q]=j()}}function Ut(F,V){if(C){let q=Et(F,V),le=C[q];if(typeof le=="number")return le}return null}function In(F,V,q){if(e.patchRoutesOnNavigation){let le=f.branches;if(F){if(Object.keys(F[0].params).length>0)return{active:!0,matches:dr(V,q,p,!0,le)}}else return{active:!0,matches:dr(V,q,p,!0,le)||[]}}return{active:!1,matches:null}}async function St(F,V,q,le){if(!e.patchRoutesOnNavigation)return{type:"success",matches:F};let ce=F;for(;;){let _e=u;try{await e.patchRoutesOnNavigation({signal:q,path:V,matches:ce,fetcherKey:le,patch:(Fe,$e)=>{q.aborted||Ep(Fe,$e,f,_e,l,!1)}})}catch(Fe){return{type:"error",error:Fe,partialMatches:ce}}if(q.aborted)return{type:"aborted"};let De=f.branches,Ke=dr(f.activeRoutes,V,p,!1,De),ye=null;if(Ke){if(Object.keys(Ke[0].params).length===0)return{type:"success",matches:Ke};if(ye=dr(f.activeRoutes,V,p,!0,De),!(ye&&ce.length<ye.length&&At(ce,ye.slice(0,ce.length))))return{type:"success",matches:Ke}}if(ye||(ye=dr(f.activeRoutes,V,p,!0,De)),!ye||At(ce,ye))return{type:"success",matches:null};ce=ye}}function At(F,V){return F.length===V.length&&F.every((q,le)=>q.route.id===V[le].route.id)}function xr(F){u={},f.setHmrRoutes(Di(F,l,void 0,u))}function $t(F,V,q=!1){Ep(F,V,f,u,l,q),f.hasHMRRoutes||Oe({})}return O={get basename(){return p},get future(){return y},get state(){return w},get routes(){return f.stableRoutes},get branches(){return f.branches},get manifest(){return u},get window(){return n},initialize:Ve,subscribe:Ue,enableScrollRestoration:Ye,navigate:xt,fetch:be,revalidate:vt,createHref:F=>e.history.createHref(F),encodeLocation:F=>e.history.encodeLocation(F),getFetcher:Sn,resetFetcher:ft,deleteFetcher:Te,dispose:Ce,getBlocker:gt,deleteBlocker:yr,patchRoutes:$t,_internalFetchControllers:X,_internalSetRoutes:xr,_internalSetStateDoNotUseOrYouWillBreakYourApp(F){Oe(F)}},e.instrumentations&&(O=Kv(O,e.instrumentations.map(F=>F.router).filter(Boolean))),O}function sb(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function fd(e,n,a,s,o,l){let u,f;if(o){u=[];for(let m of n)if(u.push(m),m.route.id===o){f=m;break}}else u=n,f=n[n.length-1];let p=Bi(s||".",Bl(u),er(e.pathname,a)||e.pathname,l==="path");if(s==null&&(p.search=e.search,p.hash=e.hash),(s==null||s===""||s===".")&&f){let m=Wd(p.search);if(f.route.index&&!m)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!f.route.index&&m){let y=new URLSearchParams(p.search),g=y.getAll("index");y.delete("index"),g.filter(S=>S).forEach(S=>y.append("index",S));let b=y.toString();p.search=b?`?${b}`:""}}return a!=="/"&&(p.pathname=Bv({basename:a,pathname:p.pathname})),Mr(p)}function Cp(e,n,a){if(!a||!sb(a))return{path:n};if(a.formMethod&&!jb(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(),u=e1(n);if(a.body!==void 0){if(a.formEncType==="text/plain"){if(!pn(l))return s();let g=typeof a.body=="string"?a.body:a.body instanceof FormData||a.body instanceof URLSearchParams?Array.from(a.body.entries()).reduce((b,[S,C])=>`${b}${S}=${C}
|
||
`,""):String(a.body);return{path:n,submission:{formMethod:l,formAction:u,formEncType:a.formEncType,formData:void 0,json:void 0,text:g}}}else if(a.formEncType==="application/json"){if(!pn(l))return s();try{let g=typeof a.body=="string"?JSON.parse(a.body):a.body;return{path:n,submission:{formMethod:l,formAction:u,formEncType:a.formEncType,formData:void 0,json:g,text:void 0}}}catch{return s()}}}Je(typeof FormData=="function","FormData is not available in this environment");let f,p;if(a.formData)f=pd(a.formData),p=a.formData;else if(a.body instanceof FormData)f=pd(a.body),p=a.body;else if(a.body instanceof URLSearchParams)f=a.body,p=_p(f);else if(a.body==null)f=new URLSearchParams,p=new FormData;else try{f=new URLSearchParams(a.body),p=_p(f)}catch{return s()}let m={formMethod:l,formAction:u,formEncType:a&&a.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(pn(m.formMethod))return{path:n,submission:m};let y=_r(n);return e&&y.search&&Wd(y.search)&&f.append("index",""),y.search=`?${f}`,{path:Mr(y),submission:m}}function Np(e,n,a,s,o,l,u,f,p,m,y,g,b,S,C,N,j,L,R,D,H,K){var G;let re=H?On(H[1])?H[1].error:H[1].data:void 0,O=o.createURL(l.location),w=o.createURL(p),M;if(y&&l.errors){let B=Object.keys(l.errors)[0];M=u.findIndex(_=>_.route.id===B)}else if(H&&On(H[1])){let B=H[0];M=u.findIndex(_=>_.route.id===B)-1}let E=H?H[1].statusCode:void 0,U=E&&E>=400,Y={currentUrl:O,currentParams:((G=l.matches[0])==null?void 0:G.params)||{},nextUrl:w,nextParams:u[0].params,...f,actionResult:re,actionStatus:E},I=Ui(u),W=u.map((B,_)=>{let{route:X}=B,J=null;if(M!=null&&_>M)J=!1;else if(X.lazy)J=!0;else if(!$d(X))J=!1;else if(y){let{shouldLoad:ie}=Yg(X,l.loaderData,l.errors);J=ie}else ib(l.loaderData,l.matches[_],B)&&(J=!0);if(J!==null)return hd(a,s,e,p,I,B,m,n,J);let T=!1;typeof K=="boolean"?T=K:U?T=!1:(g||O.pathname+O.search===w.pathname+w.search||O.search!==w.search||ob(l.matches[_],B))&&(T=!0);let A={...Y,defaultShouldRevalidate:T},te=Ti(B,A);return hd(a,s,e,p,I,B,m,n,te,A,K)}),Q=[];return C.forEach((B,_)=>{if(y||!u.some(ae=>ae.route.id===B.routeId)||S.has(_))return;let X=l.fetchers.get(_),J=X&&X.state!=="idle"&&X.data===void 0,T=dr(j,B.path,L??"/",!1,D);if(!T){if(R&&J)return;Q.push({key:_,routeId:B.routeId,path:B.path,matches:null,match:null,request:null,controller:null});return}if(N.has(_))return;let A=pl(T,B.path),te=new AbortController,ie=Ss(o,B.path,te.signal),oe=null;if(b.has(_))b.delete(_),oe=Ps(a,s,ie,B.path,T,A,m,n);else if(J)g&&(oe=Ps(a,s,ie,B.path,T,A,m,n));else{let ae;typeof K=="boolean"?ae=K:U?ae=!1:ae=g;let ue={...Y,defaultShouldRevalidate:ae};Ti(A,ue)&&(oe=Ps(a,s,ie,B.path,T,A,m,n,ue))}oe&&Q.push({key:_,routeId:B.routeId,path:B.path,matches:oe,match:A,request:ie,controller:te})}),{dsMatches:W,revalidatingFetchers:Q}}function $d(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Yg(e,n,a){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!$d(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 ib(e,n,a){let s=!n||a.route.id!==n.route.id,o=!e.hasOwnProperty(a.route.id);return s||o}function ob(e,n){let a=e.route.path;return e.pathname!==n.pathname||a!=null&&a.endsWith("*")&&e.params["*"]!==n.params["*"]}function Ti(e,n){if(e.route.shouldRevalidate){let a=e.route.shouldRevalidate(n);if(typeof a=="boolean")return a}return n.defaultShouldRevalidate}function Ep(e,n,a,s,o,l){let u;if(e){let m=s[e];Je(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),u=m.children}else u=a.activeRoutes;let f=[],p=[];if(n.forEach(m=>{let y=u.find(g=>Gg(m,g));y?p.push({existingRoute:y,newRoute:m}):f.push(m)}),f.length>0){let m=Di(f,o,[e||"_","patch",String((u==null?void 0:u.length)||"0")],s);u.push(...m)}if(l&&p.length>0)for(let m=0;m<p.length;m++){let{existingRoute:y,newRoute:g}=p[m],b=y,[S]=Di([g],o,[],{},!0);Object.assign(b,{element:S.element?S.element:b.element,errorElement:S.errorElement?S.errorElement:b.errorElement,hydrateFallbackElement:S.hydrateFallbackElement?S.hydrateFallbackElement:b.hydrateFallbackElement})}a.hasHMRRoutes||a.setRoutes([...a.activeRoutes])}function Gg(e,n){var a;return"id"in e&&"id"in n&&e.id===n.id?!0:e.index===n.index&&e.path===n.path&&e.caseSensitive===n.caseSensitive?(!e.children||e.children.length===0)&&(!n.children||n.children.length===0)?!0:((a=e.children)==null?void 0:a.every((s,o)=>{var l;return(l=n.children)==null?void 0:l.some(u=>Gg(s,u))}))??!1:!1}var Tp=new WeakMap,Xg=({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 u=Tp.get(o);u||(u={},Tp.set(o,u));let f=u[e];if(f)return f;let p=(async()=>{let m=jv(e),g=o[e]!==void 0&&e!=="hasErrorBoundary";if(m)Dt(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),u[e]=Promise.resolve();else if(g)Dt(!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 u[e]=p,p},Pp=new WeakMap;function lb(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=Pp.get(l);if(y)return{lazyRoutePromise:y,lazyHandlerPromise:y};let g=(async()=>{Je(typeof e.lazy=="function","No lazy route function found");let b=await e.lazy(),S={};for(let C in b){let N=b[C];if(N===void 0)continue;let j=Nv(C),R=l[C]!==void 0&&C!=="hasErrorBoundary";j?Dt(!j,"Route property "+C+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?Dt(!R,`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.`):S[C]=N}Object.assign(l,S),Object.assign(l,{...s(l),lazy:void 0})})();return Pp.set(l,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let u=Object.keys(e.lazy),f=[],p;for(let y of u){if(o&&o.includes(y))continue;let g=Xg({key:y,route:e,manifest:a,mapRouteProperties:s});g&&(f.push(g),y===n&&(p=g))}let m=f.length>0?Promise.all(f).then(()=>{}):void 0;return m==null||m.catch(()=>{}),p==null||p.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:p}}async function Rp(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 cb(e){return e.matches.some(n=>n.route.middleware)?Jg(e,()=>Rp(e)):Rp(e)}function Jg(e,n){return ub(e,n,s=>{if(kb(s))throw s;return s},vb,a);function a(s,o,l){if(l)return Promise.resolve(Object.assign(l.value,{[o]:{type:"error",result:s}}));{let{matches:u}=e,f=Math.min(Math.max(u.findIndex(m=>m.route.id===o),0),Math.max(u.findIndex(m=>m.shouldCallHandler()),0)),p=ya(u,u[f].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:s}})}}}async function ub(e,n,a,s,o){let{matches:l,...u}=e,f=l.flatMap(m=>m.route.middleware?m.route.middleware.map(y=>[m.route.id,y]):[]);return await qg(u,f,n,a,s,o)}async function qg(e,n,a,s,o,l,u=0){let{request:f}=e;if(f.signal.aborted)throw f.signal.reason??new Error(`Request aborted: ${f.method} ${f.url}`);let p=n[u];if(!p)return await a();let[m,y]=p,g,b=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await qg(e,n,a,s,o,l,u+1)},g.value}catch(S){return g={value:await l(S,m,g)},g.value}};try{let S=await y(e,b),C=S!=null?s(S):void 0;return o(C)?C:g?C??g.value:(g={value:await b()},g.value)}catch(S){return await l(S,m,g)}}function Qg(e,n,a,s,o){let l=Xg({key:"middleware",route:s.route,manifest:n,mapRouteProperties:e}),u=lb(s.route,pn(a.method)?"action":"loader",n,e,o);return{middleware:l,route:u.lazyRoutePromise,handler:u.lazyHandlerPromise}}function hd(e,n,a,s,o,l,u,f,p,m=null,y){let g=!1,b=Qg(e,n,a,l,u);return{...l,_lazyPromises:b,shouldLoad:p,shouldRevalidateArgs:m,shouldCallHandler(S){return g=!0,m?typeof y=="boolean"?Ti(l,{...m,defaultShouldRevalidate:y}):typeof S=="boolean"?Ti(l,{...m,defaultShouldRevalidate:S}):Ti(l,m):p},resolve(S){let{lazy:C,loader:N,middleware:j}=l.route,L=g||p||S&&!pn(a.method)&&(C||N),R=j&&j.length>0&&!N&&!C;return L&&(pn(a.method)||!R)?fb({request:a,path:s,pattern:o,match:l,lazyHandlerPromise:b==null?void 0:b.handler,lazyRoutePromise:b==null?void 0:b.route,handlerOverride:S,scopedContext:f}):Promise.resolve({type:"data",result:void 0})}}}function Ps(e,n,a,s,o,l,u,f,p=null){return o.map(m=>m.route.id!==l.route.id?{...m,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:Qg(e,n,a,m,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:hd(e,n,a,s,Ui(o),m,u,f,!0,p))}async function db(e,n,a,s,o,l,u){s.some(y=>{var g;return(g=y._lazyPromises)==null?void 0:g.middleware})&&await Promise.all(s.map(y=>{var g;return(g=y._lazyPromises)==null?void 0:g.middleware}));let f={request:n,url:Zg(n,a),pattern:Ui(s),params:s[0].params,context:l,matches:s},m=await e({...f,fetcherKey:o,runClientMiddleware:y=>{let g=f;return Jg(g,()=>y({...g,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(y=>{var g,b;return[(g=y._lazyPromises)==null?void 0:g.handler,(b=y._lazyPromises)==null?void 0:b.route]}))}catch{}return m}async function fb({request:e,path:n,pattern:a,match:s,lazyHandlerPromise:o,lazyRoutePromise:l,handlerOverride:u,scopedContext:f}){let p,m,y=pn(e.method),g=y?"action":"loader",b=S=>{let C,N=new Promise((R,D)=>C=D);m=()=>C(),e.signal.addEventListener("abort",m);let j=R=>typeof S!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${s.route.id}]`)):S({request:e,url:Zg(e,n),pattern:a,params:s.params,context:f},...R!==void 0?[R]:[]),L=(async()=>{try{return{type:"data",result:await(u?u(D=>j(D)):j())}}catch(R){return{type:"error",result:R}}})();return Promise.race([L,N])};try{let S=y?s.route.action:s.route.loader;if(o||l)if(S){let C,[N]=await Promise.all([b(S).catch(j=>{C=j}),o,l]);if(C!==void 0)throw C;p=N}else{await o;let C=y?s.route.action:s.route.loader;if(C)[p]=await Promise.all([b(C),l]);else if(g==="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(S)p=await b(S);else{let C=new URL(e.url),N=C.pathname+C.search;throw Xn(404,{pathname:N})}}catch(S){return{type:"error",result:S}}finally{m&&e.signal.removeEventListener("abort",m)}return p}async function hb(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 pb(e){var s,o,l,u,f;let{result:n,type:a}=e;if(Hd(n)){let p;try{p=await hb(n)}catch(m){return{type:"error",error:m}}return a==="error"?{type:"error",error:new Vi(n.status,n.statusText,p),statusCode:n.status,headers:n.headers}:{type:"data",data:p,statusCode:n.status,headers:n.headers}}return a==="error"?Ap(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:xb(n),statusCode:Fi(n)?n.status:void 0,headers:(l=n.init)!=null&&l.headers?new Headers(n.init.headers):void 0}:{type:"error",error:n,statusCode:Fi(n)?n.status:void 0}:Ap(n)?{type:"data",data:n.data,statusCode:(u=n.init)==null?void 0:u.status,headers:(f=n.init)!=null&&f.headers?new Headers(n.init.headers):void 0}:{type:"data",data:n}}function mb(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"),!Vd(l)){let u=s.slice(0,s.findIndex(f=>f.route.id===a)+1);l=fd(new URL(n.url),u,o,l),e.headers.set("Location",l)}return e}var Mp=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Ip(e,n,a,s){if(Vd(e)){let o=e,l=o.startsWith("//")?new URL(n.protocol+o):new URL(o);if(Mp.includes(l.protocol))throw new Error("Invalid redirect location");let u=er(l.pathname,a)!=null;if(l.origin===n.origin&&u)return Ud(l.pathname)+l.search+l.hash}try{let o=s.createURL(e);if(Mp.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Ss(e,n,a,s){let o=e.createURL(e1(n)).toString(),l={signal:a};if(s&&pn(s.formMethod)){let{formMethod:u,formEncType:f}=s;l.method=u.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=pd(s.formData):l.body=s.formData}return new Request(o,l)}function Zg(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 u of l.filter(Boolean))o.append("index",u);a.search=o.size?`?${o.toString()}`:""}else a.search="";return a.hash=s.hash||"",a}function pd(e){let n=new URLSearchParams;for(let[a,s]of e.entries())n.append(a,typeof s=="string"?s:s.name);return n}function _p(e){let n=new FormData;for(let[a,s]of e.entries())n.append(a,s);return n}function gb(e,n,a,s=!1,o=!1){let l={},u=null,f,p=!1,m={},y=a&&On(a[1])?a[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in n))return;let b=g.route.id,S=n[b];if(Je(!Va(S),"Cannot handle redirect results in processLoaderData"),On(S)){let C=S.error;if(y!==void 0&&(C=y,y=void 0),u=u||{},o)u[b]=C;else{let N=ya(e,b);u[N.route.id]==null&&(u[N.route.id]=C)}s||(l[b]=Kg),p||(p=!0,f=Fi(S.error)?S.error.status:500),S.headers&&(m[b]=S.headers)}else l[b]=S.data,S.statusCode&&S.statusCode!==200&&!p&&(f=S.statusCode),S.headers&&(m[b]=S.headers)}),y!==void 0&&a&&(u={[a[0]]:y},a[2]&&(l[a[2]]=void 0)),{loaderData:l,errors:u,statusCode:f||200,loaderHeaders:m}}function Dp(e,n,a,s,o,l,u){let{loaderData:f,errors:p}=gb(n,a,s);return o.filter(m=>!m.matches||m.matches.some(y=>y.shouldLoad)).forEach(m=>{let{key:y,match:g,controller:b}=m;if(b&&b.signal.aborted)return;let S=l[y];if(Je(S,"Did not find corresponding fetcher result"),On(S)){let C=ya(e.matches,g==null?void 0:g.route.id);p&&p[C.route.id]||(p={...p,[C.route.id]:S.error}),u.delete(y)}else if(Va(S))Je(!1,"Unhandled fetcher revalidation redirect");else{let C=Nr(S.data);u.set(y,C)}}),{loaderData:f,errors:p}}function Fp(e,n,a,s){let o=Object.entries(n).filter(([,l])=>l!==Kg).reduce((l,[u,f])=>(l[u]=f,l),{});for(let l of a){let u=l.route.id;if(!n.hasOwnProperty(u)&&e.hasOwnProperty(u)&&l.route.loader&&(o[u]=e[u]),s&&s.hasOwnProperty(u))break}return o}function Lp(e){return e?On(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ya(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 tl(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 u="Unknown Server Error",f="Unknown @remix-run/router error";return e===400?(u="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?(u="Forbidden",f=`Route "${a}" does not match URL "${n}"`):e===404?(u="Not Found",f=`No route matches URL "${n}"`):e===405&&(u="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 Vi(e||500,u,new Error(f),!0)}function nl(e){let n=Object.entries(e);for(let a=n.length-1;a>=0;a--){let[s,o]=n[a];if(Va(o))return{key:s,result:o}}}function e1(e){let n=typeof e=="string"?_r(e):e;return Mr({...n,hash:""})}function yb(e,n){return e.pathname!==n.pathname||e.search!==n.search?!1:e.hash===""?n.hash!=="":e.hash===n.hash?!0:n.hash!==""}function xb(e){var n,a;return new Vi(((n=e.init)==null?void 0:n.status)??500,((a=e.init)==null?void 0:a.statusText)??"Internal Server Error",e.data)}function vb(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([n,a])=>typeof n=="string"&&bb(a))}function bb(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function wb(e){return Hd(e.result)&&Hg.has(e.result.status)}function On(e){return e.type==="error"}function Va(e){return(e&&e.type)==="redirect"}function Ap(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Hd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Sb(e){return Hg.has(e)}function kb(e){return Hd(e)&&Sb(e.status)&&e.headers.has("Location")}function jb(e){return Zv.has(e.toUpperCase())}function pn(e){return qv.has(e.toUpperCase())}function Wd(e){return new URLSearchParams(e).getAll("index").some(n=>n==="")}function pl(e,n){let a=typeof n=="string"?_r(n).search:n.search;if(e[e.length-1].route.index&&Wd(a||""))return e[e.length-1];let s=zg(e);return s[s.length-1]}function Op(e){let{formMethod:n,formAction:a,formEncType:s,text:o,formData:l,json:u}=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(u!==void 0)return{formMethod:n,formAction:a,formEncType:s,formData:void 0,json:u,text:void 0}}}function Lu(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 Cb(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 wi(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 Nb(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 Eb(e,n){try{let a=e.sessionStorage.getItem(Wg);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 Tb(e,n){if(n.size>0){let a={};for(let[s,o]of n)a[s]=[...o];try{e.sessionStorage.setItem(Wg,JSON.stringify(a))}catch(s){Dt(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function zp(){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 Ka=v.createContext(null);Ka.displayName="DataRouter";var $i=v.createContext(null);$i.displayName="DataRouterState";var t1=v.createContext(!1);function n1(){return v.useContext(t1)}var Kd=v.createContext({isTransitioning:!1});Kd.displayName="ViewTransition";var r1=v.createContext(new Map);r1.displayName="Fetchers";var Pb=v.createContext(null);Pb.displayName="Await";var Bn=v.createContext(null);Bn.displayName="Navigation";var Vl=v.createContext(null);Vl.displayName="Location";var tr=v.createContext({outlet:null,matches:[],isDataRoute:!1});tr.displayName="Route";var Yd=v.createContext(null);Yd.displayName="RouteError";var a1="REACT_ROUTER_ERROR",Rb="REDIRECT",Mb="ROUTE_ERROR_RESPONSE";function Ib(e){if(e.startsWith(`${a1}:${Rb}:{`))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 _b(e){if(e.startsWith(`${a1}:${Mb}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new Vi(n.status,n.statusText,n.data)}catch{}}function Db(e,{relative:n}={}){Je(Ls(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:s}=v.useContext(Bn),{hash:o,pathname:l,search:u}=Hi(e,{relative:n}),f=l;return a!=="/"&&(f=l==="/"?a:Qn([a,l])),s.createHref({pathname:f,search:u,hash:o})}function Ls(){return v.useContext(Vl)!=null}function Gt(){return Je(Ls(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Vl).location}var s1="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function i1(e){v.useContext(Bn).static||v.useLayoutEffect(e)}function an(){let{isDataRoute:e}=v.useContext(tr);return e?Xb():Fb()}function Fb(){Je(Ls(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(Ka),{basename:n,navigator:a}=v.useContext(Bn),{matches:s}=v.useContext(tr),{pathname:o}=Gt(),l=JSON.stringify(Bl(s)),u=v.useRef(!1);return i1(()=>{u.current=!0}),v.useCallback((p,m={})=>{if(Dt(u.current,s1),!u.current)return;if(typeof p=="number"){a.go(p);return}let y=Bi(p,JSON.parse(l),o,m.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:Qn([n,y.pathname])),(m.replace?a.replace:a.push)(y,m.state,m)},[n,a,l,o,e])}var Lb=v.createContext(null);function Ab(e){let n=v.useContext(tr).outlet;return v.useMemo(()=>n&&v.createElement(Lb.Provider,{value:e},n),[n,e])}function Ul(){let{matches:e}=v.useContext(tr),n=e[e.length-1];return(n==null?void 0:n.params)??{}}function Hi(e,{relative:n}={}){let{matches:a}=v.useContext(tr),{pathname:s}=Gt(),o=JSON.stringify(Bl(a));return v.useMemo(()=>Bi(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function Ob(e,n,a){Je(Ls(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(Bn),{matches:o}=v.useContext(tr),l=o[o.length-1],u=l?l.params:{},f=l?l.pathname:"/",p=l?l.pathnameBase:"/",m=l&&l.route;{let j=m&&m.path||"";c1(f,!m||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${j}">) 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 <Route path="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let y=Gt(),g;g=y;let b=g.pathname||"/",S=b;if(p!=="/"){let j=p.replace(/^\//,"").split("/");S="/"+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})):Dg(e,{pathname:S});return Dt(m||C!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Dt(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 "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),$b(C&&C.map(j=>Object.assign({},j,{params:Object.assign({},u,j.params),pathname:Qn([p,s.encodeLocation?s.encodeLocation(j.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?p:Qn([p,s.encodeLocation?s.encodeLocation(j.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),o,a)}function zb(){let e=Gb(),n=Fi(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},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=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,u)}var Bb=v.createElement(zb,null),o1=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=_b(e.digest);a&&(e=a)}let n=e!==void 0?v.createElement(tr.Provider,{value:this.props.routeContext},v.createElement(Yd.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(Vb,{error:e},n):n}};o1.contextType=t1;var Au=new WeakMap;function Vb({children:e,error:n}){let{basename:a}=v.useContext(Bn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let s=Ib(n.digest);if(s){let o=Au.get(n);if(o)throw o;let l=Vg(s.location,a);if(Bg&&!Au.get(n))if(l.isExternal||s.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:s.replace}));throw Au.set(n,u),u}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function Ub({routeContext:e,match:n,children:a}){let s=v.useContext(Ka);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 $b(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(g=>g.route.id&&(l==null?void 0:l[g.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 u=!1,f=-1;if(a&&s){u=s.renderFallback;for(let y=0;y<o.length;y++){let g=o[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:b,errors:S}=s,C=g.route.loader&&!b.hasOwnProperty(g.route.id)&&(!S||S[g.route.id]===void 0);if(g.route.lazy||C){a.isStatic&&(u=!0),f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}}let p=a==null?void 0:a.onError,m=s&&p?(y,g)=>{var b,S;p(y,{location:s.location,params:((S=(b=s.matches)==null?void 0:b[0])==null?void 0:S.params)??{},pattern:Ui(s.matches),errorInfo:g})}:void 0;return o.reduceRight((y,g,b)=>{let S,C=!1,N=null,j=null;s&&(S=l&&g.route.id?l[g.route.id]:void 0,N=g.route.errorElement||Bb,u&&(f<0&&b===0?(c1("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,j=null):f===b&&(C=!0,j=g.route.hydrateFallbackElement||null)));let L=n.concat(o.slice(0,b+1)),R=()=>{let D;return S?D=N:C?D=j:g.route.Component?D=v.createElement(g.route.Component,null):g.route.element?D=g.route.element:D=y,v.createElement(Ub,{match:g,routeContext:{outlet:y,matches:L,isDataRoute:s!=null},children:D})};return s&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?v.createElement(o1,{location:s.location,revalidation:s.revalidation,component:N,error:S,children:R(),routeContext:{outlet:null,matches:L,isDataRoute:!0},onError:m}):R()},null)}function Gd(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Hb(e){let n=v.useContext(Ka);return Je(n,Gd(e)),n}function l1(e){let n=v.useContext($i);return Je(n,Gd(e)),n}function Wb(e){let n=v.useContext(tr);return Je(n,Gd(e)),n}function Xd(e){let n=Wb(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 Kb(){return Xd("useRouteId")}function Yb(){let{matches:e,loaderData:n}=l1("useMatches");return v.useMemo(()=>e.map(a=>Fg(a,n)),[e,n])}function Gb(){var s;let e=v.useContext(Yd),n=l1("useRouteError"),a=Xd("useRouteError");return e!==void 0?e:(s=n.errors)==null?void 0:s[a]}function Xb(){let{router:e}=Hb("useNavigate"),n=Xd("useNavigate"),a=v.useRef(!1);return i1(()=>{a.current=!0}),v.useCallback(async(o,l={})=>{Dt(a.current,s1),a.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...l}))},[e,n])}var Bp={};function c1(e,n,a){!n&&!Bp[e]&&(Bp[e]=!0,Dt(!1,a))}var Vp={};function Up(e,n){!e&&!Vp[n]&&(Vp[n]=!0,console.warn(n))}var Jb="useOptimistic",$p=vv[Jb],qb=()=>{};function Qb(e){return $p?$p(e):[e,qb]}function Zb(e){let n={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Dt(!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&&Dt(!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&&Dt(!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 ew=["HydrateFallback","hydrateFallbackElement"],tw=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 nw({router:e,flushSync:n,onError:a,useTransitions:s}){s=n1()||s;let[l,u]=v.useState(e.state),[f,p]=Qb(l),[m,y]=v.useState(),[g,b]=v.useState({isTransitioning:!1}),[S,C]=v.useState(),[N,j]=v.useState(),[L,R]=v.useState(),D=v.useRef(new Map),H=v.useCallback((w,{deletedFetchers:M,newErrors:E,flushSync:U,viewTransitionOpts:Y})=>{E&&a&&Object.values(E).forEach(W=>{var Q;return a(W,{location:w.location,params:((Q=w.matches[0])==null?void 0:Q.params)??{},pattern:Ui(w.matches)})}),w.fetchers.forEach((W,Q)=>{W.data!==void 0&&D.current.set(Q,W.data)}),M.forEach(W=>D.current.delete(W)),Up(U===!1||n!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` 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(Up(Y==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."),!Y||!I){n&&U?n(()=>u(w)):s===!1?u(w):v.startTransition(()=>{s===!0&&p(W=>Hp(W,w)),u(w)});return}if(n&&U){n(()=>{N&&(S==null||S.resolve(),N.skipTransition()),b({isTransitioning:!0,flushSync:!0,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})});let W=e.window.document.startViewTransition(()=>{n(()=>u(w))});W.finished.finally(()=>{n(()=>{C(void 0),j(void 0),y(void 0),b({isTransitioning:!1})})}),n(()=>j(W));return}N?(S==null||S.resolve(),N.skipTransition(),R({state:w,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})):(y(w),b({isTransitioning:!0,flushSync:!1,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation}))},[e.window,n,N,S,s,p,a]);v.useLayoutEffect(()=>e.subscribe(H),[e,H]),v.useEffect(()=>{g.isTransitioning&&!g.flushSync&&C(new tw)},[g]),v.useEffect(()=>{if(S&&m&&e.window){let w=m,M=S.promise,E=e.window.document.startViewTransition(async()=>{s===!1?u(w):v.startTransition(()=>{s===!0&&p(U=>Hp(U,w)),u(w)}),await M});E.finished.finally(()=>{C(void 0),j(void 0),y(void 0),b({isTransitioning:!1})}),j(E)}},[m,S,e.window,s,p]),v.useEffect(()=>{S&&m&&f.location.key===m.location.key&&S.resolve()},[S,N,f.location,m]),v.useEffect(()=>{!g.isTransitioning&&L&&(y(L.state),b({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}),R(void 0))},[g.isTransitioning,L]);let K=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:w=>e.navigate(w),push:(w,M,E)=>e.navigate(w,{state:M,preventScrollReset:E==null?void 0:E.preventScrollReset}),replace:(w,M,E)=>e.navigate(w,{replace:!0,state:M,preventScrollReset:E==null?void 0:E.preventScrollReset})}),[e]),re=e.basename||"/",O=v.useMemo(()=>({router:e,navigator:K,static:!1,basename:re,onError:a}),[e,K,re,a]);return v.createElement(v.Fragment,null,v.createElement(Ka.Provider,{value:O},v.createElement($i.Provider,{value:f},v.createElement(r1.Provider,{value:D.current},v.createElement(Kd.Provider,{value:g},v.createElement(sw,{basename:re,location:f.location,navigationType:f.historyAction,navigator:K,useTransitions:s},v.createElement(rw,{routes:e.routes,manifest:e.manifest,future:e.future,state:f,isStatic:!1,onError:a})))))),null)}function Hp(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 rw=v.memo(aw);function aw({routes:e,manifest:n,future:a,state:s,isStatic:o,onError:l}){return Ob(e,void 0,{manifest:n,state:s,isStatic:o,onError:l})}function u1({to:e,replace:n,state:a,relative:s}){Je(Ls(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=v.useContext(Bn);Dt(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=v.useContext(tr),{pathname:u}=Gt(),f=an(),p=Bi(e,Bl(l),u,s==="path"),m=JSON.stringify(p);return v.useEffect(()=>{f(JSON.parse(m),{replace:n,state:a,relative:s})},[f,m,s,n,a]),null}function sw({basename:e="/",children:n=null,location:a,navigationType:s="POP",navigator:o,static:l=!1,useTransitions:u}){Je(!Ls(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),p=v.useMemo(()=>({basename:f,navigator:o,static:l,useTransitions:u,future:{}}),[f,o,l,u]);typeof a=="string"&&(a=_r(a));let{pathname:m="/",search:y="",hash:g="",state:b=null,key:S="default",mask:C}=a,N=v.useMemo(()=>{let j=er(m,f);return j==null?null:{location:{pathname:j,search:y,hash:g,state:b,key:S,mask:C},navigationType:s}},[f,m,y,g,b,S,s,C]);return Dt(N!=null,`<Router basename="${f}"> is not able to match the URL "${m}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:v.createElement(Bn.Provider,{value:p},v.createElement(Vl.Provider,{children:n,value:N}))}var ml="get",gl="application/x-www-form-urlencoded";function $l(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function iw(e){return $l(e)&&e.tagName.toLowerCase()==="button"}function ow(e){return $l(e)&&e.tagName.toLowerCase()==="form"}function lw(e){return $l(e)&&e.tagName.toLowerCase()==="input"}function cw(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function uw(e,n){return e.button===0&&(!n||n==="_self")&&!cw(e)}function md(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 dw(e,n){let a=md(e);return n&&n.forEach((s,o)=>{a.has(o)||n.getAll(o).forEach(l=>{a.append(o,l)})}),a}var rl=null;function fw(){if(rl===null)try{new FormData(document.createElement("form"),0),rl=!1}catch{rl=!0}return rl}var hw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ou(e){return e!=null&&!hw.has(e)?(Dt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${gl}"`),null):e}function pw(e,n){let a,s,o,l,u;if(ow(e)){let f=e.getAttribute("action");s=f?er(f,n):null,a=e.getAttribute("method")||ml,o=Ou(e.getAttribute("enctype"))||gl,l=new FormData(e)}else if(iw(e)||lw(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||f.getAttribute("action");if(s=p?er(p,n):null,a=e.getAttribute("formmethod")||f.getAttribute("method")||ml,o=Ou(e.getAttribute("formenctype"))||Ou(f.getAttribute("enctype"))||gl,l=new FormData(f,e),!fw()){let{name:m,type:y,value:g}=e;if(y==="image"){let b=m?`${m}.`:"";l.append(`${b}x`,"0"),l.append(`${b}y`,"0")}else m&&l.append(m,g)}}else{if($l(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=ml,s=null,o=gl,u=e}return l&&o==="text/plain"&&(u=l,l=void 0),{action:s,method:a.toLowerCase(),encType:o,formData:l,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Jd(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function d1(e,n,a,s){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${s}`:o.pathname=`${o.pathname}.${s}`:o.pathname==="/"?o.pathname=`_root.${s}`:n&&er(o.pathname,n)==="/"?o.pathname=`${El(n)}/_root.${s}`:o.pathname=`${El(o.pathname)}.${s}`,o}async function mw(e,n){if(e.id in n)return n[e.id];try{let a=await import(e.module);return n[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function gw(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function yw(e,n,a){let s=await Promise.all(e.map(async o=>{let l=n.routes[o.route.id];if(l){let u=await mw(l,a);return u.links?u.links():[]}return[]}));return ww(s.flat(1).filter(gw).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Wp(e,n,a,s,o,l){let u=(p,m)=>a[m]?p.route.id!==a[m].route.id:!0,f=(p,m)=>{var y;return a[m].pathname!==p.pathname||((y=a[m].route.path)==null?void 0:y.endsWith("*"))&&a[m].params["*"]!==p.params["*"]};return l==="assets"?n.filter((p,m)=>u(p,m)||f(p,m)):l==="data"?n.filter((p,m)=>{var g;let y=s.routes[p.route.id];if(!y||!y.hasLoader)return!1;if(u(p,m)||f(p,m))return!0;if(p.route.shouldRevalidate){let b=p.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((g=a[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function xw(e,n,{includeHydrateFallback:a}={}){return vw(e.map(s=>{let o=n.routes[s.route.id];if(!o)return[];let l=[o.module];return o.clientActionModule&&(l=l.concat(o.clientActionModule)),o.clientLoaderModule&&(l=l.concat(o.clientLoaderModule)),a&&o.hydrateFallbackModule&&(l=l.concat(o.hydrateFallbackModule)),o.imports&&(l=l.concat(o.imports)),l}).flat(1))}function vw(e){return[...new Set(e)]}function bw(e){let n={},a=Object.keys(e).sort();for(let s of a)n[s]=e[s];return n}function ww(e,n){let a=new Set;return new Set(n),e.reduce((s,o)=>{let l=JSON.stringify(bw(o));return a.has(l)||(a.add(l),s.push({key:l,link:o})),s},[])}function qd(){let e=v.useContext(Ka);return Jd(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Sw(){let e=v.useContext($i);return Jd(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Qd=v.createContext(void 0);Qd.displayName="FrameworkContext";function Zd(){let e=v.useContext(Qd);return Jd(e,"You must render this element inside a <HydratedRouter> element"),e}function kw(e,n){let a=v.useContext(Qd),[s,o]=v.useState(!1),[l,u]=v.useState(!1),{onFocus:f,onBlur:p,onMouseEnter:m,onMouseLeave:y,onTouchStart:g}=n,b=v.useRef(null);v.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let N=L=>{L.forEach(R=>{u(R.isIntersecting)})},j=new IntersectionObserver(N,{threshold:.5});return b.current&&j.observe(b.current),()=>{j.disconnect()}}},[e]),v.useEffect(()=>{if(s){let N=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(N)}}},[s]);let S=()=>{o(!0)},C=()=>{o(!1),u(!1)};return a?e!=="intent"?[l,b,{}]:[l,b,{onFocus:Si(f,S),onBlur:Si(p,C),onMouseEnter:Si(m,S),onMouseLeave:Si(y,C),onTouchStart:Si(g,S)}]:[!1,b,{}]}function Si(e,n){return a=>{e&&e(a),a.defaultPrevented||n(a)}}function jw({page:e,...n}){let a=n1(),{router:s}=qd(),o=v.useMemo(()=>Dg(s.routes,e,s.basename),[s.routes,e,s.basename]);return o?a?v.createElement(Nw,{page:e,matches:o,...n}):v.createElement(Ew,{page:e,matches:o,...n}):null}function Cw(e){let{manifest:n,routeModules:a}=Zd(),[s,o]=v.useState([]);return v.useEffect(()=>{let l=!1;return yw(e,n,a).then(u=>{l||o(u)}),()=>{l=!0}},[e,n,a]),s}function Nw({page:e,matches:n,...a}){let s=Gt(),{future:o}=Zd(),{basename:l}=qd(),u=v.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let f=d1(e,l,o.unstable_trailingSlashAwareDataRequests,"rsc"),p=!1,m=[];for(let y of n)typeof y.route.shouldRevalidate=="function"?p=!0:m.push(y.route.id);return p&&m.length>0&&f.searchParams.set("_routes",m.join(",")),[f.pathname+f.search]},[l,o.unstable_trailingSlashAwareDataRequests,e,s,n]);return v.createElement(v.Fragment,null,u.map(f=>v.createElement("link",{key:f,rel:"prefetch",as:"fetch",href:f,...a})))}function Ew({page:e,matches:n,...a}){let s=Gt(),{future:o,manifest:l,routeModules:u}=Zd(),{basename:f}=qd(),{loaderData:p,matches:m}=Sw(),y=v.useMemo(()=>Wp(e,n,m,l,s,"data"),[e,n,m,l,s]),g=v.useMemo(()=>Wp(e,n,m,l,s,"assets"),[e,n,m,l,s]),b=v.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let N=new Set,j=!1;if(n.forEach(R=>{var H;let D=l.routes[R.route.id];!D||!D.hasLoader||(!y.some(K=>K.route.id===R.route.id)&&R.route.id in p&&((H=u[R.route.id])!=null&&H.shouldRevalidate)||D.hasClientLoader?j=!0:N.add(R.route.id))}),N.size===0)return[];let L=d1(e,f,o.unstable_trailingSlashAwareDataRequests,"data");return j&&N.size>0&&L.searchParams.set("_routes",n.filter(R=>N.has(R.route.id)).map(R=>R.route.id).join(",")),[L.pathname+L.search]},[f,o.unstable_trailingSlashAwareDataRequests,p,s,l,y,n,e,u]),S=v.useMemo(()=>xw(g,l),[g,l]),C=Cw(g);return v.createElement(v.Fragment,null,b.map(N=>v.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...a})),S.map(N=>v.createElement("link",{key:N,rel:"modulepreload",href:N,...a})),C.map(({key:N,link:j})=>v.createElement("link",{key:N,nonce:a.nonce,...j,crossOrigin:j.crossOrigin??a.crossOrigin})))}function Tw(...e){return n=>{e.forEach(a=>{typeof a=="function"?a(n):a!=null&&(a.current=n)})}}var Pw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Pw&&(window.__reactRouterVersion="7.15.1")}catch{}function Rw(e,n){return ab({basename:n==null?void 0:n.basename,getContext:n==null?void 0:n.getContext,future:n==null?void 0:n.future,history:bv({window:n==null?void 0:n.window}),hydrationData:Mw(),routes:e,mapRouteProperties:Zb,hydrationRouteProperties:ew,dataStrategy:n==null?void 0:n.dataStrategy,patchRoutesOnNavigation:n==null?void 0:n.patchRoutesOnNavigation,window:n==null?void 0:n.window,instrumentations:n==null?void 0:n.instrumentations}).initialize()}function Mw(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Iw(e.errors)}),e}function Iw(e){if(!e)return null;let n=Object.entries(e),a={};for(let[s,o]of n)if(o&&o.__type==="RouteErrorResponse")a[s]=new Vi(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let l=window[o.__subType];if(typeof l=="function")try{let u=new l(o.message);u.stack="",a[s]=u}catch{}}if(a[s]==null){let l=new Error(o.message);l.stack="",a[s]=l}}else a[s]=o;return a}var f1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,h1=v.forwardRef(function({onClick:n,discover:a="render",prefetch:s="none",relative:o,reloadDocument:l,replace:u,mask:f,state:p,target:m,to:y,preventScrollReset:g,viewTransition:b,defaultShouldRevalidate:S,...C},N){let{basename:j,navigator:L,useTransitions:R}=v.useContext(Bn),D=typeof y=="string"&&f1.test(y),H=Vg(y,j);y=H.to;let K=Db(y,{relative:o}),re=Gt(),O=null;if(f){let Q=Bi(f,[],re.mask?re.mask.pathname:"/",!0);j!=="/"&&(Q.pathname=Q.pathname==="/"?j:Qn([j,Q.pathname])),O=L.createHref(Q)}let[w,M,E]=kw(s,C),U=Fw(y,{replace:u,mask:f,state:p,target:m,preventScrollReset:g,relative:o,viewTransition:b,defaultShouldRevalidate:S,useTransitions:R});function Y(Q){n&&n(Q),Q.defaultPrevented||U(Q)}let I=!(H.isExternal||l),W=v.createElement("a",{...C,...E,href:(I?O:void 0)||H.absoluteURL||K,onClick:I?Y:n,ref:Tw(N,M),target:m,"data-discover":!D&&a==="render"?"true":void 0});return w&&!D?v.createElement(v.Fragment,null,W,v.createElement(jw,{page:K})):W});h1.displayName="Link";var p1=v.forwardRef(function({"aria-current":n="page",caseSensitive:a=!1,className:s="",end:o=!1,style:l,to:u,viewTransition:f,children:p,...m},y){let g=Hi(u,{relative:m.relative}),b=Gt(),S=v.useContext($i),{navigator:C,basename:N}=v.useContext(Bn),j=S!=null&&Vw(g)&&f===!0,L=C.encodeLocation?C.encodeLocation(g).pathname:g.pathname,R=b.pathname,D=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;a||(R=R.toLowerCase(),D=D?D.toLowerCase():null,L=L.toLowerCase()),D&&N&&(D=er(D,N)||D);const H=L!=="/"&&L.endsWith("/")?L.length-1:L.length;let K=R===L||!o&&R.startsWith(L)&&R.charAt(H)==="/",re=D!=null&&(D===L||!o&&D.startsWith(L)&&D.charAt(L.length)==="/"),O={isActive:K,isPending:re,isTransitioning:j},w=K?n:void 0,M;typeof s=="function"?M=s(O):M=[s,K?"active":null,re?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let E=typeof l=="function"?l(O):l;return v.createElement(h1,{...m,"aria-current":w,className:M,ref:y,style:E,to:u,viewTransition:f},typeof p=="function"?p(O):p)});p1.displayName="NavLink";var _w=v.forwardRef(({discover:e="render",fetcherKey:n,navigate:a,reloadDocument:s,replace:o,state:l,method:u=ml,action:f,onSubmit:p,relative:m,preventScrollReset:y,viewTransition:g,defaultShouldRevalidate:b,...S},C)=>{let{useTransitions:N}=v.useContext(Bn),j=zw(),L=Bw(f,{relative:m}),R=u.toLowerCase()==="get"?"get":"post",D=typeof f=="string"&&f1.test(f),H=K=>{if(p&&p(K),K.defaultPrevented)return;K.preventDefault();let re=K.nativeEvent.submitter,O=(re==null?void 0:re.getAttribute("formmethod"))||u,w=()=>j(re||K.currentTarget,{fetcherKey:n,method:O,navigate:a,replace:o,state:l,relative:m,preventScrollReset:y,viewTransition:g,defaultShouldRevalidate:b});N&&a!==!1?v.startTransition(()=>w()):w()};return v.createElement("form",{ref:C,method:R,action:L,onSubmit:s?p:H,...S,"data-discover":!D&&e==="render"?"true":void 0})});_w.displayName="Form";function Dw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function m1(e){let n=v.useContext(Ka);return Je(n,Dw(e)),n}function Fw(e,{target:n,replace:a,mask:s,state:o,preventScrollReset:l,relative:u,viewTransition:f,defaultShouldRevalidate:p,useTransitions:m}={}){let y=an(),g=Gt(),b=Hi(e,{relative:u});return v.useCallback(S=>{if(uw(S,n)){S.preventDefault();let C=a!==void 0?a:Mr(g)===Mr(b),N=()=>y(e,{replace:C,mask:s,state:o,preventScrollReset:l,relative:u,viewTransition:f,defaultShouldRevalidate:p});m?v.startTransition(()=>N()):N()}},[g,y,b,a,s,o,n,e,l,u,f,p,m])}function Lw(e){Dt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let n=v.useRef(md(e)),a=v.useRef(!1),s=Gt(),o=v.useMemo(()=>dw(s.search,a.current?null:n.current),[s.search]),l=an(),u=v.useCallback((f,p)=>{const m=md(typeof f=="function"?f(new URLSearchParams(o)):f);a.current=!0,l("?"+m,p)},[l,o]);return[o,u]}var Aw=0,Ow=()=>`__${String(++Aw)}__`;function zw(){let{router:e}=m1("useSubmit"),{basename:n}=v.useContext(Bn),a=Kb(),s=e.fetch,o=e.navigate;return v.useCallback(async(l,u={})=>{let{action:f,method:p,encType:m,formData:y,body:g}=pw(l,n);if(u.navigate===!1){let b=u.fetcherKey||Ow();await s(b,a,u.action||f,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||p,formEncType:u.encType||m,flushSync:u.flushSync})}else await o(u.action||f,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||p,formEncType:u.encType||m,replace:u.replace,state:u.state,fromRouteId:a,flushSync:u.flushSync,viewTransition:u.viewTransition})},[s,o,n,a])}function Bw(e,{relative:n}={}){let{basename:a}=v.useContext(Bn),s=v.useContext(tr);Je(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),l={...Hi(e||".",{relative:n})},u=Gt();if(e==null){l.search=u.search;let f=new URLSearchParams(l.search),p=f.getAll("index");if(p.some(y=>y==="")){f.delete("index"),p.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();l.search=y?`?${y}`:""}}return(!e||e===".")&&o.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(l.pathname=l.pathname==="/"?a:Qn([a,l.pathname])),Mr(l)}function Vw(e,{relative:n}={}){let a=v.useContext(Kd);Je(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=m1("useViewTransitionState"),o=Hi(e,{relative:n});if(!a.isTransitioning)return!1;let l=er(a.currentLocation.pathname,s)||a.currentLocation.pathname,u=er(a.nextLocation.pathname,s)||a.nextLocation.pathname;return Nl(o.pathname,u)!=null||Nl(o.pathname,l)!=null}var ef=Rg();const Uw=Pg(ef);function $w(e){return v.createElement(nw,{flushSync:ef.flushSync,...e})}const nt="http://141.11.1.189",g1=()=>!!localStorage.getItem("accessToken"),Hw=()=>{const e=localStorage.getItem("userInfo");if(!e)return null;try{return JSON.parse(e)}catch{return null}},Ya=()=>localStorage.getItem("accessToken"),Ww=()=>localStorage.getItem("username"),Kw=async()=>{const e=Ya();if(e)try{await fetch(`${nt}/api/logout`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${e}`},body:""})}catch(n){console.error("خطا در logout از سرور:",n)}localStorage.removeItem("accessToken"),localStorage.removeItem("refreshToken"),localStorage.removeItem("userId"),localStorage.removeItem("username"),localStorage.removeItem("userInfo"),localStorage.removeItem("userProfile")},Yw=()=>g1()?!0:(localStorage.removeItem("accessToken"),localStorage.removeItem("refreshToken"),localStorage.removeItem("userId"),localStorage.removeItem("username"),localStorage.removeItem("userInfo"),localStorage.removeItem("userProfile"),!1);function y1({children:e}){const n=Gt();return Yw()?d.jsx(d.Fragment,{children:e}):d.jsx(u1,{to:"/login",replace:!0,state:{from:n,error:"لطفاً ابتدا وارد سیستم شوید"}})}const tf=v.createContext({});function nf(e){const n=v.useRef(null);return n.current===null&&(n.current=e()),n.current}const Gw=typeof window<"u",x1=Gw?v.useLayoutEffect:v.useEffect,Hl=v.createContext(null);function rf(e,n){e.indexOf(n)===-1&&e.push(n)}function Tl(e,n){const a=e.indexOf(n);a>-1&&e.splice(a,1)}const Ir=(e,n,a)=>a>n?n:a<e?e:a;let af=()=>{};const wa={},v1=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function b1(e){return typeof e=="object"&&e!==null}const w1=e=>/^0[^.\s]+$/u.test(e);function S1(e){let n;return()=>(n===void 0&&(n=e()),n)}const Zn=e=>e,Xw=(e,n)=>a=>n(e(a)),Wi=(...e)=>e.reduce(Xw),Li=(e,n,a)=>{const s=n-e;return s===0?1:(a-e)/s};class sf{constructor(){this.subscriptions=[]}add(n){return rf(this.subscriptions,n),()=>Tl(this.subscriptions,n)}notify(n,a,s){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](n,a,s);else for(let l=0;l<o;l++){const u=this.subscriptions[l];u&&u(n,a,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const zn=e=>e*1e3,Jn=e=>e/1e3;function k1(e,n){return n?e*(1e3/n):0}const j1=(e,n,a)=>(((1-3*a+3*n)*e+(3*a-6*n))*e+3*n)*e,Jw=1e-7,qw=12;function Qw(e,n,a,s,o){let l,u,f=0;do u=n+(a-n)/2,l=j1(u,s,o)-e,l>0?a=u:n=u;while(Math.abs(l)>Jw&&++f<qw);return u}function Ki(e,n,a,s){if(e===n&&a===s)return Zn;const o=l=>Qw(l,0,1,e,a);return l=>l===0||l===1?l:j1(o(l),n,s)}const C1=e=>n=>n<=.5?e(2*n)/2:(2-e(2*(1-n)))/2,N1=e=>n=>1-e(1-n),E1=Ki(.33,1.53,.69,.99),of=N1(E1),T1=C1(of),P1=e=>e>=1?1:(e*=2)<1?.5*of(e):.5*(2-Math.pow(2,-10*(e-1))),lf=e=>1-Math.sin(Math.acos(e)),R1=N1(lf),M1=C1(lf),Zw=Ki(.42,0,1,1),e5=Ki(0,0,.58,1),I1=Ki(.42,0,.58,1),t5=e=>Array.isArray(e)&&typeof e[0]!="number",_1=e=>Array.isArray(e)&&typeof e[0]=="number",n5={linear:Zn,easeIn:Zw,easeInOut:I1,easeOut:e5,circIn:lf,circInOut:M1,circOut:R1,backIn:of,backInOut:T1,backOut:E1,anticipate:P1},r5=e=>typeof e=="string",Kp=e=>{if(_1(e)){af(e.length===4);const[n,a,s,o]=e;return Ki(n,a,s,o)}else if(r5(e))return n5[e];return e},al=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function a5(e,n){let a=new Set,s=new Set,o=!1,l=!1;const u=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function p(y){u.has(y)&&(m.schedule(y),e()),y(f)}const m={schedule:(y,g=!1,b=!1)=>{const C=b&&o?a:s;return g&&u.add(y),C.add(y),y},cancel:y=>{s.delete(y),u.delete(y)},process:y=>{if(f=y,o){l=!0;return}o=!0;const g=a;a=s,s=g,a.forEach(p),a.clear(),o=!1,l&&(l=!1,m.process(y))}};return m}const s5=40;function D1(e,n){let a=!1,s=!0;const o={delta:0,timestamp:0,isProcessing:!1},l=()=>a=!0,u=al.reduce((D,H)=>(D[H]=a5(l),D),{}),{setup:f,read:p,resolveKeyframes:m,preUpdate:y,update:g,preRender:b,render:S,postRender:C}=u,N=()=>{const D=wa.useManualTiming,H=D?o.timestamp:performance.now();a=!1,D||(o.delta=s?1e3/60:Math.max(Math.min(H-o.timestamp,s5),1)),o.timestamp=H,o.isProcessing=!0,f.process(o),p.process(o),m.process(o),y.process(o),g.process(o),b.process(o),S.process(o),C.process(o),o.isProcessing=!1,a&&n&&(s=!1,e(N))},j=()=>{a=!0,s=!0,o.isProcessing||e(N)};return{schedule:al.reduce((D,H)=>{const K=u[H];return D[H]=(re,O=!1,w=!1)=>(a||j(),K.schedule(re,O,w)),D},{}),cancel:D=>{for(let H=0;H<al.length;H++)u[al[H]].cancel(D)},state:o,steps:u}}const{schedule:yt,cancel:Sa,state:nn,steps:zu}=D1(typeof requestAnimationFrame<"u"?requestAnimationFrame:Zn,!0);let yl;function i5(){yl=void 0}const bn={now:()=>(yl===void 0&&bn.set(nn.isProcessing||wa.useManualTiming?nn.timestamp:performance.now()),yl),set:e=>{yl=e,queueMicrotask(i5)}},F1=e=>n=>typeof n=="string"&&n.startsWith(e),L1=F1("--"),o5=F1("var(--"),cf=e=>o5(e)?l5.test(e.split("/*")[0].trim()):!1,l5=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Yp(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const As={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ai={...As,transform:e=>Ir(0,1,e)},sl={...As,default:1},Pi=e=>Math.round(e*1e5)/1e5,uf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function c5(e){return e==null}const u5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,df=(e,n)=>a=>!!(typeof a=="string"&&u5.test(a)&&a.startsWith(e)||n&&!c5(a)&&Object.prototype.hasOwnProperty.call(a,n)),A1=(e,n,a)=>s=>{if(typeof s!="string")return s;const[o,l,u,f]=s.match(uf);return{[e]:parseFloat(o),[n]:parseFloat(l),[a]:parseFloat(u),alpha:f!==void 0?parseFloat(f):1}},d5=e=>Ir(0,255,e),Bu={...As,transform:e=>Math.round(d5(e))},Ua={test:df("rgb","red"),parse:A1("red","green","blue"),transform:({red:e,green:n,blue:a,alpha:s=1})=>"rgba("+Bu.transform(e)+", "+Bu.transform(n)+", "+Bu.transform(a)+", "+Pi(Ai.transform(s))+")"};function f5(e){let n="",a="",s="",o="";return e.length>5?(n=e.substring(1,3),a=e.substring(3,5),s=e.substring(5,7),o=e.substring(7,9)):(n=e.substring(1,2),a=e.substring(2,3),s=e.substring(3,4),o=e.substring(4,5),n+=n,a+=a,s+=s,o+=o),{red:parseInt(n,16),green:parseInt(a,16),blue:parseInt(s,16),alpha:o?parseInt(o,16)/255:1}}const gd={test:df("#"),parse:f5,transform:Ua.transform},Yi=e=>({test:n=>typeof n=="string"&&n.endsWith(e)&&n.split(" ").length===1,parse:parseFloat,transform:n=>`${n}${e}`}),ma=Yi("deg"),Rr=Yi("%"),Ee=Yi("px"),h5=Yi("vh"),p5=Yi("vw"),Gp={...Rr,parse:e=>Rr.parse(e)/100,transform:e=>Rr.transform(e*100)},Cs={test:df("hsl","hue"),parse:A1("hue","saturation","lightness"),transform:({hue:e,saturation:n,lightness:a,alpha:s=1})=>"hsla("+Math.round(e)+", "+Rr.transform(Pi(n))+", "+Rr.transform(Pi(a))+", "+Pi(Ai.transform(s))+")"},Vt={test:e=>Ua.test(e)||gd.test(e)||Cs.test(e),parse:e=>Ua.test(e)?Ua.parse(e):Cs.test(e)?Cs.parse(e):gd.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ua.transform(e):Cs.transform(e),getAnimatableNone:e=>{const n=Vt.parse(e);return n.alpha=0,Vt.transform(n)}},m5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function g5(e){var n,a;return isNaN(e)&&typeof e=="string"&&(((n=e.match(uf))==null?void 0:n.length)||0)+(((a=e.match(m5))==null?void 0:a.length)||0)>0}const O1="number",z1="color",y5="var",x5="var(",Xp="${}",v5=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Is(e){const n=e.toString(),a=[],s={color:[],number:[],var:[]},o=[];let l=0;const f=n.replace(v5,p=>(Vt.test(p)?(s.color.push(l),o.push(z1),a.push(Vt.parse(p))):p.startsWith(x5)?(s.var.push(l),o.push(y5),a.push(p)):(s.number.push(l),o.push(O1),a.push(parseFloat(p))),++l,Xp)).split(Xp);return{values:a,split:f,indexes:s,types:o}}function b5(e){return Is(e).values}function B1({split:e,types:n}){const a=e.length;return s=>{let o="";for(let l=0;l<a;l++)if(o+=e[l],s[l]!==void 0){const u=n[l];u===O1?o+=Pi(s[l]):u===z1?o+=Vt.transform(s[l]):o+=s[l]}return o}}function w5(e){return B1(Is(e))}const S5=e=>typeof e=="number"?0:Vt.test(e)?Vt.getAnimatableNone(e):e,k5=(e,n)=>typeof e=="number"?n!=null&&n.trim().endsWith("/")?e:0:S5(e);function j5(e){const n=Is(e);return B1(n)(n.values.map((s,o)=>k5(s,n.split[o])))}const pr={test:g5,parse:b5,createTransformer:w5,getAnimatableNone:j5};function Vu(e,n,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+(n-e)*6*a:a<1/2?n:a<2/3?e+(n-e)*(2/3-a)*6:e}function C5({hue:e,saturation:n,lightness:a,alpha:s}){e/=360,n/=100,a/=100;let o=0,l=0,u=0;if(!n)o=l=u=a;else{const f=a<.5?a*(1+n):a+n-a*n,p=2*a-f;o=Vu(p,f,e+1/3),l=Vu(p,f,e),u=Vu(p,f,e-1/3)}return{red:Math.round(o*255),green:Math.round(l*255),blue:Math.round(u*255),alpha:s}}function Pl(e,n){return a=>a>0?n:e}const Nt=(e,n,a)=>e+(n-e)*a,Uu=(e,n,a)=>{const s=e*e,o=a*(n*n-s)+s;return o<0?0:Math.sqrt(o)},N5=[gd,Ua,Cs],E5=e=>N5.find(n=>n.test(e));function Jp(e){const n=E5(e);if(!n)return!1;let a=n.parse(e);return n===Cs&&(a=C5(a)),a}const qp=(e,n)=>{const a=Jp(e),s=Jp(n);if(!a||!s)return Pl(e,n);const o={...a};return l=>(o.red=Uu(a.red,s.red,l),o.green=Uu(a.green,s.green,l),o.blue=Uu(a.blue,s.blue,l),o.alpha=Nt(a.alpha,s.alpha,l),Ua.transform(o))},yd=new Set(["none","hidden"]);function T5(e,n){return yd.has(e)?a=>a<=0?e:n:a=>a>=1?n:e}function P5(e,n){return a=>Nt(e,n,a)}function ff(e){return typeof e=="number"?P5:typeof e=="string"?cf(e)?Pl:Vt.test(e)?qp:I5:Array.isArray(e)?V1:typeof e=="object"?Vt.test(e)?qp:R5:Pl}function V1(e,n){const a=[...e],s=a.length,o=e.map((l,u)=>ff(l)(l,n[u]));return l=>{for(let u=0;u<s;u++)a[u]=o[u](l);return a}}function R5(e,n){const a={...e,...n},s={};for(const o in a)e[o]!==void 0&&n[o]!==void 0&&(s[o]=ff(e[o])(e[o],n[o]));return o=>{for(const l in s)a[l]=s[l](o);return a}}function M5(e,n){const a=[],s={color:0,var:0,number:0};for(let o=0;o<n.values.length;o++){const l=n.types[o],u=e.indexes[l][s[l]],f=e.values[u]??0;a[o]=f,s[l]++}return a}const I5=(e,n)=>{const a=pr.createTransformer(n),s=Is(e),o=Is(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?yd.has(e)&&!o.values.length||yd.has(n)&&!s.values.length?T5(e,n):Wi(V1(M5(s,o),o.values),a):Pl(e,n)};function U1(e,n,a){return typeof e=="number"&&typeof n=="number"&&typeof a=="number"?Nt(e,n,a):ff(e)(e,n)}const _5=e=>{const n=({timestamp:a})=>e(a);return{start:(a=!0)=>yt.update(n,a),stop:()=>Sa(n),now:()=>nn.isProcessing?nn.timestamp:bn.now()}},$1=(e,n,a=10)=>{let s="";const o=Math.max(Math.round(n/a),2);for(let l=0;l<o;l++)s+=Math.round(e(l/(o-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Rl=2e4;function hf(e){let n=0;const a=50;let s=e.next(n);for(;!s.done&&n<Rl;)n+=a,s=e.next(n);return n>=Rl?1/0:n}function D5(e,n=100,a){const s=a({...e,keyframes:[0,n]}),o=Math.min(hf(s),Rl);return{type:"keyframes",ease:l=>s.next(o*l).value/n,duration:Jn(o)}}const _t={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function xd(e,n){return e*Math.sqrt(1-n*n)}const F5=12;function L5(e,n,a){let s=a;for(let o=1;o<F5;o++)s=s-e(s)/n(s);return s}const $u=.001;function A5({duration:e=_t.duration,bounce:n=_t.bounce,velocity:a=_t.velocity,mass:s=_t.mass}){let o,l,u=1-n;u=Ir(_t.minDamping,_t.maxDamping,u),e=Ir(_t.minDuration,_t.maxDuration,Jn(e)),u<1?(o=m=>{const y=m*u,g=y*e,b=y-a,S=xd(m,u),C=Math.exp(-g);return $u-b/S*C},l=m=>{const g=m*u*e,b=g*a+a,S=Math.pow(u,2)*Math.pow(m,2)*e,C=Math.exp(-g),N=xd(Math.pow(m,2),u);return(-o(m)+$u>0?-1:1)*((b-S)*C)/N}):(o=m=>{const y=Math.exp(-m*e),g=(m-a)*e+1;return-$u+y*g},l=m=>{const y=Math.exp(-m*e),g=(a-m)*(e*e);return y*g});const f=5/e,p=L5(o,l,f);if(e=zn(e),isNaN(p))return{stiffness:_t.stiffness,damping:_t.damping,duration:e};{const m=Math.pow(p,2)*s;return{stiffness:m,damping:u*2*Math.sqrt(s*m),duration:e}}}const O5=["duration","bounce"],z5=["stiffness","damping","mass"];function Qp(e,n){return n.some(a=>e[a]!==void 0)}function B5(e){let n={velocity:_t.velocity,stiffness:_t.stiffness,damping:_t.damping,mass:_t.mass,isResolvedFromDuration:!1,...e};if(!Qp(e,z5)&&Qp(e,O5))if(n.velocity=0,e.visualDuration){const a=e.visualDuration,s=2*Math.PI/(a*1.2),o=s*s,l=2*Ir(.05,1,1-(e.bounce||0))*Math.sqrt(o);n={...n,mass:_t.mass,stiffness:o,damping:l}}else{const a=A5({...e,velocity:0});n={...n,...a,mass:_t.mass},n.isResolvedFromDuration=!0}return n}function Ml(e=_t.visualDuration,n=_t.bounce){const a=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:n}:e;let{restSpeed:s,restDelta:o}=a;const l=a.keyframes[0],u=a.keyframes[a.keyframes.length-1],f={done:!1,value:l},{stiffness:p,damping:m,mass:y,duration:g,velocity:b,isResolvedFromDuration:S}=B5({...a,velocity:-Jn(a.velocity||0)}),C=b||0,N=m/(2*Math.sqrt(p*y)),j=u-l,L=Jn(Math.sqrt(p/y)),R=Math.abs(j)<5;s||(s=R?_t.restSpeed.granular:_t.restSpeed.default),o||(o=R?_t.restDelta.granular:_t.restDelta.default);let D,H,K,re,O,w;if(N<1)K=xd(L,N),re=(C+N*L*j)/K,D=E=>{const U=Math.exp(-N*L*E);return u-U*(re*Math.sin(K*E)+j*Math.cos(K*E))},O=N*L*re+j*K,w=N*L*j-re*K,H=E=>Math.exp(-N*L*E)*(O*Math.sin(K*E)+w*Math.cos(K*E));else if(N===1){D=U=>u-Math.exp(-L*U)*(j+(C+L*j)*U);const E=C+L*j;H=U=>Math.exp(-L*U)*(L*E*U-C)}else{const E=L*Math.sqrt(N*N-1);D=W=>{const Q=Math.exp(-N*L*W),G=Math.min(E*W,300);return u-Q*((C+N*L*j)*Math.sinh(G)+E*j*Math.cosh(G))/E};const U=(C+N*L*j)/E,Y=N*L*U-j*E,I=N*L*j-U*E;H=W=>{const Q=Math.exp(-N*L*W),G=Math.min(E*W,300);return Q*(Y*Math.sinh(G)+I*Math.cosh(G))}}const M={calculatedDuration:S&&g||null,velocity:E=>zn(H(E)),next:E=>{if(!S&&N<1){const Y=Math.exp(-N*L*E),I=Math.sin(K*E),W=Math.cos(K*E),Q=u-Y*(re*I+j*W),G=zn(Y*(O*I+w*W));return f.done=Math.abs(G)<=s&&Math.abs(u-Q)<=o,f.value=f.done?u:Q,f}const U=D(E);if(S)f.done=E>=g;else{const Y=zn(H(E));f.done=Math.abs(Y)<=s&&Math.abs(u-U)<=o}return f.value=f.done?u:U,f},toString:()=>{const E=Math.min(hf(M),Rl),U=$1(Y=>M.next(E*Y).value,E,30);return E+"ms "+U},toTransition:()=>{}};return M}Ml.applyToOptions=e=>{const n=D5(e,100,Ml);return e.ease=n.ease,e.duration=zn(n.duration),e.type="keyframes",e};const V5=5;function H1(e,n,a){const s=Math.max(n-V5,0);return k1(a-e(s),n-s)}function vd({keyframes:e,velocity:n=0,power:a=.8,timeConstant:s=325,bounceDamping:o=10,bounceStiffness:l=500,modifyTarget:u,min:f,max:p,restDelta:m=.5,restSpeed:y}){const g=e[0],b={done:!1,value:g},S=w=>f!==void 0&&w<f||p!==void 0&&w>p,C=w=>f===void 0?p:p===void 0||Math.abs(f-w)<Math.abs(p-w)?f:p;let N=a*n;const j=g+N,L=u===void 0?j:u(j);L!==j&&(N=L-g);const R=w=>-N*Math.exp(-w/s),D=w=>L+R(w),H=w=>{const M=R(w),E=D(w);b.done=Math.abs(M)<=m,b.value=b.done?L:E};let K,re;const O=w=>{S(b.value)&&(K=w,re=Ml({keyframes:[b.value,C(b.value)],velocity:H1(D,w,b.value),damping:o,stiffness:l,restDelta:m,restSpeed:y}))};return O(0),{calculatedDuration:null,next:w=>{let M=!1;return!re&&K===void 0&&(M=!0,H(w),O(w)),K!==void 0&&w>=K?re.next(w-K):(!M&&H(w),b)}}}function U5(e,n,a){const s=[],o=a||wa.mix||U1,l=e.length-1;for(let u=0;u<l;u++){let f=o(e[u],e[u+1]);if(n){const p=Array.isArray(n)?n[u]||Zn:n;f=Wi(p,f)}s.push(f)}return s}function $5(e,n,{clamp:a=!0,ease:s,mixer:o}={}){const l=e.length;if(af(l===n.length),l===1)return()=>n[0];if(l===2&&n[0]===n[1])return()=>n[1];const u=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),n=[...n].reverse());const f=U5(n,s,o),p=f.length,m=y=>{if(u&&y<e[0])return n[0];let g=0;if(p>1)for(;g<e.length-2&&!(y<e[g+1]);g++);const b=Li(e[g],e[g+1],y);return f[g](b)};return a?y=>m(Ir(e[0],e[l-1],y)):m}function H5(e,n){const a=e[e.length-1];for(let s=1;s<=n;s++){const o=Li(0,n,s);e.push(Nt(a,1,o))}}function W5(e){const n=[0];return H5(n,e.length-1),n}function K5(e,n){return e.map(a=>a*n)}function Y5(e,n){return e.map(()=>n||I1).splice(0,e.length-1)}function Ri({duration:e=300,keyframes:n,times:a,ease:s="easeInOut"}){const o=t5(s)?s.map(Kp):Kp(s),l={done:!1,value:n[0]},u=K5(a&&a.length===n.length?a:W5(n),e),f=$5(u,n,{ease:Array.isArray(o)?o:Y5(n,o)});return{calculatedDuration:e,next:p=>(l.value=f(p),l.done=p>=e,l)}}const G5=e=>e!==null;function Wl(e,{repeat:n,repeatType:a="loop"},s,o=1){const l=e.filter(G5),f=o<0||n&&a!=="loop"&&n%2===1?0:l.length-1;return!f||s===void 0?l[f]:s}const X5={decay:vd,inertia:vd,tween:Ri,keyframes:Ri,spring:Ml};function W1(e){typeof e.type=="string"&&(e.type=X5[e.type])}class pf{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(n=>{this.resolve=n})}notifyFinished(){this.resolve()}then(n,a){return this.finished.then(n,a)}}const J5=e=>e/100;class Il extends pf{constructor(n){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var s,o;const{motionValue:a}=this.options;a&&a.updatedAt!==bn.now()&&this.tick(bn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(s=this.options).onStop)==null||o.call(s))},this.options=n,this.initAnimation(),this.play(),n.autoplay===!1&&this.pause()}initAnimation(){const{options:n}=this;W1(n);const{type:a=Ri,repeat:s=0,repeatDelay:o=0,repeatType:l,velocity:u=0}=n;let{keyframes:f}=n;const p=a||Ri;p!==Ri&&typeof f[0]!="number"&&(this.mixKeyframes=Wi(J5,U1(f[0],f[1])),f=[0,100]);const m=p({...n,keyframes:f});l==="mirror"&&(this.mirroredGenerator=p({...n,keyframes:[...f].reverse(),velocity:-u})),m.calculatedDuration===null&&(m.calculatedDuration=hf(m));const{calculatedDuration:y}=m;this.calculatedDuration=y,this.resolvedDuration=y+o,this.totalDuration=this.resolvedDuration*(s+1)-o,this.generator=m}updateTime(n){const a=Math.round(n-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=a}tick(n,a=!1){const{generator:s,totalDuration:o,mixKeyframes:l,mirroredGenerator:u,resolvedDuration:f,calculatedDuration:p}=this;if(this.startTime===null)return s.next(0);const{delay:m=0,keyframes:y,repeat:g,repeatType:b,repeatDelay:S,type:C,onUpdate:N,finalKeyframe:j}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,n):this.speed<0&&(this.startTime=Math.min(n-o/this.speed,this.startTime)),a?this.currentTime=n:this.updateTime(n);const L=this.currentTime-m*(this.playbackSpeed>=0?1:-1),R=this.playbackSpeed>=0?L<0:L>o;this.currentTime=Math.max(L,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let D=this.currentTime,H=s;if(g){const w=Math.min(this.currentTime,o)/f;let M=Math.floor(w),E=w%1;!E&&w>=1&&(E=1),E===1&&M--,M=Math.min(M,g+1),!!(M%2)&&(b==="reverse"?(E=1-E,S&&(E-=S/f)):b==="mirror"&&(H=u)),D=Ir(0,1,E)*f}let K;R?(this.delayState.value=y[0],K=this.delayState):K=H.next(D),l&&!R&&(K.value=l(K.value));let{done:re}=K;!R&&p!==null&&(re=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&re);return O&&C!==vd&&(K.value=Wl(y,this.options,j,this.speed)),N&&N(K.value),O&&this.finish(),K}then(n,a){return this.finished.then(n,a)}get duration(){return Jn(this.calculatedDuration)}get iterationDuration(){const{delay:n=0}=this.options||{};return this.duration+Jn(n)}get time(){return Jn(this.currentTime)}set time(n){n=zn(n),this.currentTime=n,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=n:this.driver&&(this.startTime=this.driver.now()-n/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=n,this.tick(n))}getGeneratorVelocity(){const n=this.currentTime;if(n<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(n);const a=this.generator.next(n).value;return H1(s=>this.generator.next(s).value,n,a)}get speed(){return this.playbackSpeed}set speed(n){const a=this.playbackSpeed!==n;a&&this.driver&&this.updateTime(bn.now()),this.playbackSpeed=n,a&&this.driver&&(this.time=Jn(this.currentTime))}play(){var o,l;if(this.isStopped)return;const{driver:n=_5,startTime:a}=this.options;this.driver||(this.driver=n(u=>this.tick(u))),(l=(o=this.options).onPlay)==null||l.call(o);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=a??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(bn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var n,a;this.notifyFinished(),this.teardown(),this.state="finished",(a=(n=this.options).onComplete)==null||a.call(n)}cancel(){var n,a;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(a=(n=this.options).onCancel)==null||a.call(n)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(n){return this.startTime=0,this.tick(n,!0)}attachTimeline(n){var a;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(a=this.driver)==null||a.stop(),n.observe(this)}}function q5(e){for(let n=1;n<e.length;n++)e[n]??(e[n]=e[n-1])}const $a=e=>e*180/Math.PI,bd=e=>{const n=$a(Math.atan2(e[1],e[0]));return wd(n)},Q5={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:bd,rotateZ:bd,skewX:e=>$a(Math.atan(e[1])),skewY:e=>$a(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},wd=e=>(e=e%360,e<0&&(e+=360),e),Zp=bd,em=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),tm=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Z5={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:em,scaleY:tm,scale:e=>(em(e)+tm(e))/2,rotateX:e=>wd($a(Math.atan2(e[6],e[5]))),rotateY:e=>wd($a(Math.atan2(-e[2],e[0]))),rotateZ:Zp,rotate:Zp,skewX:e=>$a(Math.atan(e[4])),skewY:e=>$a(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Sd(e){return e.includes("scale")?1:0}function kd(e,n){if(!e||e==="none")return Sd(n);const a=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,o;if(a)s=Z5,o=a;else{const f=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Q5,o=f}if(!o)return Sd(n);const l=s[n],u=o[1].split(",").map(t3);return typeof l=="function"?l(u):u[l]}const e3=(e,n)=>{const{transform:a="none"}=getComputedStyle(e);return kd(a,n)};function t3(e){return parseFloat(e.trim())}const Os=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zs=new Set(Os),nm=e=>e===As||e===Ee,n3=new Set(["x","y","z"]),r3=Os.filter(e=>!n3.has(e));function a3(e){const n=[];return r3.forEach(a=>{const s=e.getValue(a);s!==void 0&&(n.push([a,s.get()]),s.set(a.startsWith("scale")?1:0))}),n}const ba={width:({x:e},{paddingLeft:n="0",paddingRight:a="0",boxSizing:s})=>{const o=e.max-e.min;return s==="border-box"?o:o-parseFloat(n)-parseFloat(a)},height:({y:e},{paddingTop:n="0",paddingBottom:a="0",boxSizing:s})=>{const o=e.max-e.min;return s==="border-box"?o:o-parseFloat(n)-parseFloat(a)},top:(e,{top:n})=>parseFloat(n),left:(e,{left:n})=>parseFloat(n),bottom:({y:e},{top:n})=>parseFloat(n)+(e.max-e.min),right:({x:e},{left:n})=>parseFloat(n)+(e.max-e.min),x:(e,{transform:n})=>kd(n,"x"),y:(e,{transform:n})=>kd(n,"y")};ba.translateX=ba.x;ba.translateY=ba.y;const Ha=new Set;let jd=!1,Cd=!1,Nd=!1;function K1(){if(Cd){const e=Array.from(Ha).filter(s=>s.needsMeasurement),n=new Set(e.map(s=>s.element)),a=new Map;n.forEach(s=>{const o=a3(s);o.length&&(a.set(s,o),s.render())}),e.forEach(s=>s.measureInitialState()),n.forEach(s=>{s.render();const o=a.get(s);o&&o.forEach(([l,u])=>{var f;(f=s.getValue(l))==null||f.set(u)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Cd=!1,jd=!1,Ha.forEach(e=>e.complete(Nd)),Ha.clear()}function Y1(){Ha.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Cd=!0)})}function s3(){Nd=!0,Y1(),K1(),Nd=!1}class mf{constructor(n,a,s,o,l,u=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...n],this.onComplete=a,this.name=s,this.motionValue=o,this.element=l,this.isAsync=u}scheduleResolve(){this.state="scheduled",this.isAsync?(Ha.add(this),jd||(jd=!0,yt.read(Y1),yt.resolveKeyframes(K1))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:n,name:a,element:s,motionValue:o}=this;if(n[0]===null){const l=o==null?void 0:o.get(),u=n[n.length-1];if(l!==void 0)n[0]=l;else if(s&&a){const f=s.readValue(a,u);f!=null&&(n[0]=f)}n[0]===void 0&&(n[0]=u),o&&l===void 0&&o.set(n[0])}q5(n)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(n=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,n),Ha.delete(this)}cancel(){this.state==="scheduled"&&(Ha.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const i3=e=>e.startsWith("--");function G1(e,n,a){i3(n)?e.style.setProperty(n,a):e.style[n]=a}const o3={};function X1(e,n){const a=S1(e);return()=>o3[n]??a()}const l3=X1(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),J1=X1(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ei=([e,n,a,s])=>`cubic-bezier(${e}, ${n}, ${a}, ${s})`,rm={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ei([0,.65,.55,1]),circOut:Ei([.55,0,1,.45]),backIn:Ei([.31,.01,.66,-.59]),backOut:Ei([.33,1.53,.69,.99])};function q1(e,n){if(e)return typeof e=="function"?J1()?$1(e,n):"ease-out":_1(e)?Ei(e):Array.isArray(e)?e.map(a=>q1(a,n)||rm.easeOut):rm[e]}function c3(e,n,a,{delay:s=0,duration:o=300,repeat:l=0,repeatType:u="loop",ease:f="easeOut",times:p}={},m=void 0){const y={[n]:a};p&&(y.offset=p);const g=q1(f,o);Array.isArray(g)&&(y.easing=g);const b={delay:s,duration:o,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:l+1,direction:u==="reverse"?"alternate":"normal"};return m&&(b.pseudoElement=m),e.animate(y,b)}function Q1(e){return typeof e=="function"&&"applyToOptions"in e}function u3({type:e,...n}){return Q1(e)&&J1()?e.applyToOptions(n):(n.duration??(n.duration=300),n.ease??(n.ease="easeOut"),n)}class Z1 extends pf{constructor(n){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!n)return;const{element:a,name:s,keyframes:o,pseudoElement:l,allowFlatten:u=!1,finalKeyframe:f,onComplete:p}=n;this.isPseudoElement=!!l,this.allowFlatten=u,this.options=n,af(typeof n.type!="string");const m=u3(n);this.animation=c3(a,s,o,m,l),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!l){const y=Wl(o,this.options,f,this.speed);this.updateMotionValue&&this.updateMotionValue(y),G1(a,s,y),this.animation.cancel()}p==null||p(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var n,a;(a=(n=this.animation).finish)==null||a.call(n)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:n}=this;n==="idle"||n==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var a,s,o;const n=(a=this.options)==null?void 0:a.element;!this.isPseudoElement&&(n!=null&&n.isConnected)&&((o=(s=this.animation).commitStyles)==null||o.call(s))}get duration(){var a,s;const n=((s=(a=this.animation.effect)==null?void 0:a.getComputedTiming)==null?void 0:s.call(a).duration)||0;return Jn(Number(n))}get iterationDuration(){const{delay:n=0}=this.options||{};return this.duration+Jn(n)}get time(){return Jn(Number(this.animation.currentTime)||0)}set time(n){const a=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=zn(n),a&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(n){n<0&&(this.finishedTime=null),this.animation.playbackRate=n}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(n){this.manualStartTime=this.animation.startTime=n}attachTimeline({timeline:n,rangeStart:a,rangeEnd:s,observe:o}){var l;return this.allowFlatten&&((l=this.animation.effect)==null||l.updateTiming({easing:"linear"})),this.animation.onfinish=null,n&&l3()?(this.animation.timeline=n,a&&(this.animation.rangeStart=a),s&&(this.animation.rangeEnd=s),Zn):o(this)}}const ey={anticipate:P1,backInOut:T1,circInOut:M1};function d3(e){return e in ey}function f3(e){typeof e.ease=="string"&&d3(e.ease)&&(e.ease=ey[e.ease])}const Hu=10;class h3 extends Z1{constructor(n){f3(n),W1(n),super(n),n.startTime!==void 0&&n.autoplay!==!1&&(this.startTime=n.startTime),this.options=n}updateMotionValue(n){const{motionValue:a,onUpdate:s,onComplete:o,element:l,...u}=this.options;if(!a)return;if(n!==void 0){a.set(n);return}const f=new Il({...u,autoplay:!1}),p=Math.max(Hu,bn.now()-this.startTime),m=Ir(0,Hu,p-Hu),y=f.sample(p).value,{name:g}=this.options;l&&g&&G1(l,g,y),a.setWithVelocity(f.sample(Math.max(0,p-m)).value,y,m),f.stop()}}const am=(e,n)=>n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(pr.test(e)||e==="0")&&!e.startsWith("url("));function p3(e){const n=e[0];if(e.length===1)return!0;for(let a=0;a<e.length;a++)if(e[a]!==n)return!0}function m3(e,n,a,s){const o=e[0];if(o===null)return!1;if(n==="display"||n==="visibility")return!0;const l=e[e.length-1],u=am(o,n),f=am(l,n);return!u||!f?!1:p3(e)||(a==="spring"||Q1(a))&&s}function Ed(e){e.duration=0,e.type="keyframes"}const ty=new Set(["opacity","clipPath","filter","transform"]),g3=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function y3(e){for(let n=0;n<e.length;n++)if(typeof e[n]=="string"&&g3.test(e[n]))return!0;return!1}const x3=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),v3=S1(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function b3(e){var g;const{motionValue:n,name:a,repeatDelay:s,repeatType:o,damping:l,type:u,keyframes:f}=e;if(!(((g=n==null?void 0:n.owner)==null?void 0:g.current)instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:y}=n.owner.getProps();return v3()&&a&&(ty.has(a)||x3.has(a)&&y3(f))&&(a!=="transform"||!y)&&!m&&!s&&o!=="mirror"&&l!==0&&u!=="inertia"}const w3=40;class S3 extends pf{constructor({autoplay:n=!0,delay:a=0,type:s="keyframes",repeat:o=0,repeatDelay:l=0,repeatType:u="loop",keyframes:f,name:p,motionValue:m,element:y,...g}){var C;super(),this.stop=()=>{var N,j;this._animation&&(this._animation.stop(),(N=this.stopTimeline)==null||N.call(this)),(j=this.keyframeResolver)==null||j.cancel()},this.createdAt=bn.now();const b={autoplay:n,delay:a,type:s,repeat:o,repeatDelay:l,repeatType:u,name:p,motionValue:m,element:y,...g},S=(y==null?void 0:y.KeyframeResolver)||mf;this.keyframeResolver=new S(f,(N,j,L)=>this.onKeyframesResolved(N,j,b,!L),p,m,y),(C=this.keyframeResolver)==null||C.scheduleResolve()}onKeyframesResolved(n,a,s,o){var L,R;this.keyframeResolver=void 0;const{name:l,type:u,velocity:f,delay:p,isHandoff:m,onUpdate:y}=s;this.resolvedAt=bn.now();let g=!0;m3(n,l,u,f)||(g=!1,(wa.instantAnimations||!p)&&(y==null||y(Wl(n,s,a))),n[0]=n[n.length-1],Ed(s),s.repeat=0);const S={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>w3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:a,...s,keyframes:n},C=g&&!m&&b3(S),N=(R=(L=S.motionValue)==null?void 0:L.owner)==null?void 0:R.current;let j;if(C)try{j=new h3({...S,element:N})}catch{j=new Il(S)}else j=new Il(S);j.finished.then(()=>{this.notifyFinished()}).catch(Zn),this.pendingTimeline&&(this.stopTimeline=j.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=j}get finished(){return this._animation?this.animation.finished:this._finished}then(n,a){return this.finished.finally(n).then(()=>{})}get animation(){var n;return this._animation||((n=this.keyframeResolver)==null||n.resume(),s3()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(n){this.animation.time=n}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(n){this.animation.speed=n}get startTime(){return this.animation.startTime}attachTimeline(n){return this._animation?this.stopTimeline=this.animation.attachTimeline(n):this.pendingTimeline=n,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var n;this._animation&&this.animation.cancel(),(n=this.keyframeResolver)==null||n.cancel()}}function ny(e,n,a,s=0,o=1){const l=Array.from(e).sort((m,y)=>m.sortNodePosition(y)).indexOf(n),u=e.size,f=(u-1)*s;return typeof a=="function"?a(l,u):o===1?l*s:f-l*s}const k3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function j3(e){const n=k3.exec(e);if(!n)return[,];const[,a,s,o]=n;return[`--${a??s}`,o]}function ry(e,n,a=1){const[s,o]=j3(e);if(!s)return;const l=window.getComputedStyle(n).getPropertyValue(s);if(l){const u=l.trim();return v1(u)?parseFloat(u):u}return cf(o)?ry(o,n,a+1):o}const C3={type:"spring",stiffness:500,damping:25,restSpeed:10},N3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),E3={type:"keyframes",duration:.8},T3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},P3=(e,{keyframes:n})=>n.length>2?E3:zs.has(e)?e.startsWith("scale")?N3(n[1]):C3:T3;function ay(e,n){if(e!=null&&e.inherit&&n){const{inherit:a,...s}=e;return{...n,...s}}return e}function gf(e,n){const a=(e==null?void 0:e[n])??(e==null?void 0:e.default)??e;return a!==e?ay(a,e):a}const R3=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function M3(e){for(const n in e)if(!R3.has(n))return!0;return!1}const yf=(e,n,a,s={},o,l)=>u=>{const f=gf(s,e)||{},p=f.delay||s.delay||0;let{elapsed:m=0}=s;m=m-zn(p);const y={keyframes:Array.isArray(a)?a:[null,a],ease:"easeOut",velocity:n.getVelocity(),...f,delay:-m,onUpdate:b=>{n.set(b),f.onUpdate&&f.onUpdate(b)},onComplete:()=>{u(),f.onComplete&&f.onComplete()},name:e,motionValue:n,element:l?void 0:o};M3(f)||Object.assign(y,P3(e,y)),y.duration&&(y.duration=zn(y.duration)),y.repeatDelay&&(y.repeatDelay=zn(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let g=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(Ed(y),y.delay===0&&(g=!0)),(wa.instantAnimations||wa.skipAnimations||o!=null&&o.shouldSkipAnimations)&&(g=!0,Ed(y),y.delay=0),y.allowFlatten=!f.type&&!f.ease,g&&!l&&n.get()!==void 0){const b=Wl(y.keyframes,f);if(b!==void 0){yt.update(()=>{y.onUpdate(b),y.onComplete()});return}}return f.isSync?new Il(y):new S3(y)};function sm(e){const n=[{},{}];return e==null||e.values.forEach((a,s)=>{n[0][s]=a.get(),n[1][s]=a.getVelocity()}),n}function xf(e,n,a,s){if(typeof n=="function"){const[o,l]=sm(s);n=n(a!==void 0?a:e.custom,o,l)}if(typeof n=="string"&&(n=e.variants&&e.variants[n]),typeof n=="function"){const[o,l]=sm(s);n=n(a!==void 0?a:e.custom,o,l)}return n}function Wa(e,n,a){const s=e.getProps();return xf(s,n,a!==void 0?a:s.custom,e)}const sy=new Set(["width","height","top","left","right","bottom",...Os]),im=30,I3=e=>!isNaN(parseFloat(e));class _3{constructor(n,a={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var l;const o=bn.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((l=this.events.change)==null||l.notify(this.current),this.dependents))for(const u of this.dependents)u.dirty()},this.hasAnimated=!1,this.setCurrent(n),this.owner=a.owner}setCurrent(n){this.current=n,this.updatedAt=bn.now(),this.canTrackVelocity===null&&n!==void 0&&(this.canTrackVelocity=I3(this.current))}setPrevFrameValue(n=this.current){this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt}onChange(n){return this.on("change",n)}on(n,a){this.events[n]||(this.events[n]=new sf);const s=this.events[n].add(a);return n==="change"?()=>{s(),yt.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const n in this.events)this.events[n].clear()}attach(n,a){this.passiveEffect=n,this.stopPassiveEffect=a}set(n){this.passiveEffect?this.passiveEffect(n,this.updateAndNotify):this.updateAndNotify(n)}setWithVelocity(n,a,s){this.set(a),this.prev=void 0,this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt-s}jump(n,a=!0){this.updateAndNotify(n),this.prev=n,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var n;(n=this.events.change)==null||n.notify(this.current)}addDependent(n){this.dependents||(this.dependents=new Set),this.dependents.add(n)}removeDependent(n){this.dependents&&this.dependents.delete(n)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const n=bn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||n-this.updatedAt>im)return 0;const a=Math.min(this.updatedAt-this.prevUpdatedAt,im);return k1(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(n){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=n(a),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var n,a;(n=this.dependents)==null||n.clear(),(a=this.events.destroy)==null||a.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function _s(e,n){return new _3(e,n)}const Td=e=>Array.isArray(e);function D3(e,n,a){e.hasValue(n)?e.getValue(n).set(a):e.addValue(n,_s(a))}function F3(e){return Td(e)?e[e.length-1]||0:e}function L3(e,n){const a=Wa(e,n);let{transitionEnd:s={},transition:o={},...l}=a||{};l={...l,...s};for(const u in l){const f=F3(l[u]);D3(e,u,f)}}const rn=e=>!!(e&&e.getVelocity);function A3(e){return!!(rn(e)&&e.add)}function Pd(e,n){const a=e.getValue("willChange");if(A3(a))return a.add(n);if(!a&&wa.WillChange){const s=new wa.WillChange("auto");e.addValue("willChange",s),s.add(n)}}function vf(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}const O3="framerAppearId",iy="data-"+vf(O3);function oy(e){return e.props[iy]}function z3({protectedKeys:e,needsAnimating:n},a){const s=e.hasOwnProperty(a)&&n[a]!==!0;return n[a]=!1,s}function ly(e,n,{delay:a=0,transitionOverride:s,type:o}={}){let{transition:l,transitionEnd:u,...f}=n;const p=e.getDefaultTransition();l=l?ay(l,p):p;const m=l==null?void 0:l.reduceMotion;s&&(l=s);const y=[],g=o&&e.animationState&&e.animationState.getState()[o];for(const b in f){const S=e.getValue(b,e.latestValues[b]??null),C=f[b];if(C===void 0||g&&z3(g,b))continue;const N={delay:a,...gf(l||{},b)},j=S.get();if(j!==void 0&&!S.isAnimating()&&!Array.isArray(C)&&C===j&&!N.velocity){yt.update(()=>S.set(C));continue}let L=!1;if(window.MotionHandoffAnimation){const H=oy(e);if(H){const K=window.MotionHandoffAnimation(H,b,yt);K!==null&&(N.startTime=K,L=!0)}}Pd(e,b);const R=m??e.shouldReduceMotion;S.start(yf(b,S,C,R&&sy.has(b)?{type:!1}:N,e,L));const D=S.animation;D&&y.push(D)}if(u){const b=()=>yt.update(()=>{u&&L3(e,u)});y.length?Promise.all(y).then(b):b()}return y}function Rd(e,n,a={}){var p;const s=Wa(e,n,a.type==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=s||{};a.transitionOverride&&(o=a.transitionOverride);const l=s?()=>Promise.all(ly(e,s,a)):()=>Promise.resolve(),u=e.variantChildren&&e.variantChildren.size?(m=0)=>{const{delayChildren:y=0,staggerChildren:g,staggerDirection:b}=o;return B3(e,n,m,y,g,b,a)}:()=>Promise.resolve(),{when:f}=o;if(f){const[m,y]=f==="beforeChildren"?[l,u]:[u,l];return m().then(()=>y())}else return Promise.all([l(),u(a.delay)])}function B3(e,n,a=0,s=0,o=0,l=1,u){const f=[];for(const p of e.variantChildren)p.notify("AnimationStart",n),f.push(Rd(p,n,{...u,delay:a+(typeof s=="function"?0:s)+ny(e.variantChildren,p,s,o,l)}).then(()=>p.notify("AnimationComplete",n)));return Promise.all(f)}function V3(e,n,a={}){e.notify("AnimationStart",n);let s;if(Array.isArray(n)){const o=n.map(l=>Rd(e,l,a));s=Promise.all(o)}else if(typeof n=="string")s=Rd(e,n,a);else{const o=typeof n=="function"?Wa(e,n,a.custom):n;s=Promise.all(ly(e,o,a))}return s.then(()=>{e.notify("AnimationComplete",n)})}const U3={test:e=>e==="auto",parse:e=>e},cy=e=>n=>n.test(e),uy=[As,Ee,Rr,ma,p5,h5,U3],om=e=>uy.find(cy(e));function $3(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||w1(e):!0}const H3=new Set(["brightness","contrast","saturate","opacity"]);function W3(e){const[n,a]=e.slice(0,-1).split("(");if(n==="drop-shadow")return e;const[s]=a.match(uf)||[];if(!s)return e;const o=a.replace(s,"");let l=H3.has(n)?1:0;return s!==a&&(l*=100),n+"("+l+o+")"}const K3=/\b([a-z-]*)\(.*?\)/gu,Md={...pr,getAnimatableNone:e=>{const n=e.match(K3);return n?n.map(W3).join(" "):e}},Id={...pr,getAnimatableNone:e=>{const n=pr.parse(e);return pr.createTransformer(e)(n.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},lm={...As,transform:Math.round},Y3={rotate:ma,rotateX:ma,rotateY:ma,rotateZ:ma,scale:sl,scaleX:sl,scaleY:sl,scaleZ:sl,skew:ma,skewX:ma,skewY:ma,distance:Ee,translateX:Ee,translateY:Ee,translateZ:Ee,x:Ee,y:Ee,z:Ee,perspective:Ee,transformPerspective:Ee,opacity:Ai,originX:Gp,originY:Gp,originZ:Ee},bf={borderWidth:Ee,borderTopWidth:Ee,borderRightWidth:Ee,borderBottomWidth:Ee,borderLeftWidth:Ee,borderRadius:Ee,borderTopLeftRadius:Ee,borderTopRightRadius:Ee,borderBottomRightRadius:Ee,borderBottomLeftRadius:Ee,width:Ee,maxWidth:Ee,height:Ee,maxHeight:Ee,top:Ee,right:Ee,bottom:Ee,left:Ee,inset:Ee,insetBlock:Ee,insetBlockStart:Ee,insetBlockEnd:Ee,insetInline:Ee,insetInlineStart:Ee,insetInlineEnd:Ee,padding:Ee,paddingTop:Ee,paddingRight:Ee,paddingBottom:Ee,paddingLeft:Ee,paddingBlock:Ee,paddingBlockStart:Ee,paddingBlockEnd:Ee,paddingInline:Ee,paddingInlineStart:Ee,paddingInlineEnd:Ee,margin:Ee,marginTop:Ee,marginRight:Ee,marginBottom:Ee,marginLeft:Ee,marginBlock:Ee,marginBlockStart:Ee,marginBlockEnd:Ee,marginInline:Ee,marginInlineStart:Ee,marginInlineEnd:Ee,fontSize:Ee,backgroundPositionX:Ee,backgroundPositionY:Ee,...Y3,zIndex:lm,fillOpacity:Ai,strokeOpacity:Ai,numOctaves:lm},G3={...bf,color:Vt,backgroundColor:Vt,outlineColor:Vt,fill:Vt,stroke:Vt,borderColor:Vt,borderTopColor:Vt,borderRightColor:Vt,borderBottomColor:Vt,borderLeftColor:Vt,filter:Md,WebkitFilter:Md,mask:Id,WebkitMask:Id},dy=e=>G3[e],X3=new Set([Md,Id]);function fy(e,n){let a=dy(e);return X3.has(a)||(a=pr),a.getAnimatableNone?a.getAnimatableNone(n):void 0}const J3=new Set(["auto","none","0"]);function q3(e,n,a){let s=0,o;for(;s<e.length&&!o;){const l=e[s];typeof l=="string"&&!J3.has(l)&&Is(l).values.length&&(o=e[s]),s++}if(o&&a)for(const l of n)e[l]=fy(a,o)}class Q3 extends mf{constructor(n,a,s,o,l){super(n,a,s,o,l,!0)}readKeyframes(){const{unresolvedKeyframes:n,element:a,name:s}=this;if(!a||!a.current)return;super.readKeyframes();for(let y=0;y<n.length;y++){let g=n[y];if(typeof g=="string"&&(g=g.trim(),cf(g))){const b=ry(g,a.current);b!==void 0&&(n[y]=b),y===n.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!sy.has(s)||n.length!==2)return;const[o,l]=n,u=om(o),f=om(l),p=Yp(o),m=Yp(l);if(p!==m&&ba[s]){this.needsMeasurement=!0;return}if(u!==f)if(nm(u)&&nm(f))for(let y=0;y<n.length;y++){const g=n[y];typeof g=="string"&&(n[y]=parseFloat(g))}else ba[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:n,name:a}=this,s=[];for(let o=0;o<n.length;o++)(n[o]===null||$3(n[o]))&&s.push(o);s.length&&q3(n,s,a)}measureInitialState(){const{element:n,unresolvedKeyframes:a,name:s}=this;if(!n||!n.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ba[s](n.measureViewportBox(),window.getComputedStyle(n.current)),a[0]=this.measuredOrigin;const o=a[a.length-1];o!==void 0&&n.getValue(s,o).jump(o,!1)}measureEndState(){var f;const{element:n,name:a,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const o=n.getValue(a);o&&o.jump(this.measuredOrigin,!1);const l=s.length-1,u=s[l];s[l]=ba[a](n.measureViewportBox(),window.getComputedStyle(n.current)),u!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=u),(f=this.removedTransforms)!=null&&f.length&&this.removedTransforms.forEach(([p,m])=>{n.getValue(p).set(m)}),this.resolveNoneKeyframes()}}function hy(e,n,a){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const o=(a==null?void 0:a[e])??s.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(s=>s!=null)}const py=(e,n)=>n&&typeof e=="number"?n.transform(e):e;function xl(e){return b1(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:wf}=D1(queueMicrotask,!1),fr={x:!1,y:!1};function my(){return fr.x||fr.y}function Z3(e){return e==="x"||e==="y"?fr[e]?null:(fr[e]=!0,()=>{fr[e]=!1}):fr.x||fr.y?null:(fr.x=fr.y=!0,()=>{fr.x=fr.y=!1})}function gy(e,n){const a=hy(e),s=new AbortController,o={passive:!0,...n,signal:s.signal};return[a,o,()=>s.abort()]}function eS(e){return!(e.pointerType==="touch"||my())}function tS(e,n,a={}){const[s,o,l]=gy(e,a);return s.forEach(u=>{let f=!1,p=!1,m;const y=()=>{u.removeEventListener("pointerleave",C)},g=j=>{m&&(m(j),m=void 0),y()},b=j=>{f=!1,window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),p&&(p=!1,g(j))},S=()=>{f=!0,window.addEventListener("pointerup",b,o),window.addEventListener("pointercancel",b,o)},C=j=>{if(j.pointerType!=="touch"){if(f){p=!0;return}g(j)}},N=j=>{if(!eS(j))return;p=!1;const L=n(u,j);typeof L=="function"&&(m=L,u.addEventListener("pointerleave",C,o))};u.addEventListener("pointerenter",N,o),u.addEventListener("pointerdown",S,o)}),l}const yy=(e,n)=>n?e===n?!0:yy(e,n.parentElement):!1,Sf=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,nS=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function rS(e){return nS.has(e.tagName)||e.isContentEditable===!0}const aS=new Set(["INPUT","SELECT","TEXTAREA"]);function sS(e){return aS.has(e.tagName)||e.isContentEditable===!0}const vl=new WeakSet;function cm(e){return n=>{n.key==="Enter"&&e(n)}}function Wu(e,n){e.dispatchEvent(new PointerEvent("pointer"+n,{isPrimary:!0,bubbles:!0}))}const iS=(e,n)=>{const a=e.currentTarget;if(!a)return;const s=cm(()=>{if(vl.has(a))return;Wu(a,"down");const o=cm(()=>{Wu(a,"up")}),l=()=>Wu(a,"cancel");a.addEventListener("keyup",o,n),a.addEventListener("blur",l,n)});a.addEventListener("keydown",s,n),a.addEventListener("blur",()=>a.removeEventListener("keydown",s),n)};function um(e){return Sf(e)&&!my()}const dm=new WeakSet;function oS(e,n,a={}){const[s,o,l]=gy(e,a),u=f=>{const p=f.currentTarget;if(!um(f)||dm.has(f))return;vl.add(p),a.stopPropagation&&dm.add(f);const m=n(p,f),y=(S,C)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",b),vl.has(p)&&vl.delete(p),um(S)&&typeof m=="function"&&m(S,{success:C})},g=S=>{y(S,p===window||p===document||a.useGlobalTarget||yy(p,S.target))},b=S=>{y(S,!1)};window.addEventListener("pointerup",g,o),window.addEventListener("pointercancel",b,o)};return s.forEach(f=>{(a.useGlobalTarget?window:f).addEventListener("pointerdown",u,o),xl(f)&&(f.addEventListener("focus",m=>iS(m,o)),!rS(f)&&!f.hasAttribute("tabindex")&&(f.tabIndex=0))}),l}function kf(e){return b1(e)&&"ownerSVGElement"in e}const bl=new WeakMap;let ga;const xy=(e,n,a)=>(s,o)=>o&&o[0]?o[0][e+"Size"]:kf(s)&&"getBBox"in s?s.getBBox()[n]:s[a],lS=xy("inline","width","offsetWidth"),cS=xy("block","height","offsetHeight");function uS({target:e,borderBoxSize:n}){var a;(a=bl.get(e))==null||a.forEach(s=>{s(e,{get width(){return lS(e,n)},get height(){return cS(e,n)}})})}function dS(e){e.forEach(uS)}function fS(){typeof ResizeObserver>"u"||(ga=new ResizeObserver(dS))}function hS(e,n){ga||fS();const a=hy(e);return a.forEach(s=>{let o=bl.get(s);o||(o=new Set,bl.set(s,o)),o.add(n),ga==null||ga.observe(s)}),()=>{a.forEach(s=>{const o=bl.get(s);o==null||o.delete(n),o!=null&&o.size||ga==null||ga.unobserve(s)})}}const wl=new Set;let Ns;function pS(){Ns=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};wl.forEach(n=>n(e))},window.addEventListener("resize",Ns)}function mS(e){return wl.add(e),Ns||pS(),()=>{wl.delete(e),!wl.size&&typeof Ns=="function"&&(window.removeEventListener("resize",Ns),Ns=void 0)}}function fm(e,n){return typeof e=="function"?mS(e):hS(e,n)}function gS(e){return kf(e)&&e.tagName==="svg"}const yS=[...uy,Vt,pr],xS=e=>yS.find(cy(e)),hm=()=>({translate:0,scale:1,origin:0,originPoint:0}),Es=()=>({x:hm(),y:hm()}),pm=()=>({min:0,max:0}),Yt=()=>({x:pm(),y:pm()}),vS=new WeakMap;function Kl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Oi(e){return typeof e=="string"||Array.isArray(e)}const jf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cf=["initial",...jf];function Yl(e){return Kl(e.animate)||Cf.some(n=>Oi(e[n]))}function vy(e){return!!(Yl(e)||e.variants)}function bS(e,n,a){for(const s in n){const o=n[s],l=a[s];if(rn(o))e.addValue(s,o);else if(rn(l))e.addValue(s,_s(o,{owner:e}));else if(l!==o)if(e.hasValue(s)){const u=e.getValue(s);u.liveStyle===!0?u.jump(o):u.hasAnimated||u.set(o)}else{const u=e.getStaticValue(s);e.addValue(s,_s(u!==void 0?u:o,{owner:e}))}}for(const s in a)n[s]===void 0&&e.removeValue(s);return n}const _l={current:null},Nf={current:!1},wS=typeof window<"u";function by(){if(Nf.current=!0,!!wS)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),n=()=>_l.current=e.matches;e.addEventListener("change",n),n()}else _l.current=!1}const mm=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Dl={};function wy(e){Dl=e}function SS(){return Dl}class kS{scrapeMotionValuesFromProps(n,a,s){return{}}constructor({parent:n,props:a,presenceContext:s,reducedMotionConfig:o,skipAnimations:l,blockInitialAnimation:u,visualState:f},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=mf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const S=bn.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,yt.render(this.render,!1,!0))};const{latestValues:m,renderState:y}=f;this.latestValues=m,this.baseTarget={...m},this.initialValues=a.initial?{...m}:{},this.renderState=y,this.parent=n,this.props=a,this.presenceContext=s,this.depth=n?n.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=l,this.options=p,this.blockInitialAnimation=!!u,this.isControllingVariants=Yl(a),this.isVariantNode=vy(a),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(n&&n.current);const{willChange:g,...b}=this.scrapeMotionValuesFromProps(a,{},this);for(const S in b){const C=b[S];m[S]!==void 0&&rn(C)&&C.set(m[S])}}mount(n){var a,s;if(this.hasBeenMounted)for(const o in this.initialValues)(a=this.values.get(o))==null||a.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];this.current=n,vS.set(n,this),this.projection&&!this.projection.instance&&this.projection.mount(n),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,l)=>this.bindToMotionValue(l,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Nf.current||by(),this.shouldReduceMotion=_l.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var n;this.projection&&this.projection.unmount(),Sa(this.notifyUpdate),Sa(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(n=this.parent)==null||n.removeChild(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const s=this.features[a];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(n){this.children.add(n),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(n)}removeChild(n){this.children.delete(n),this.enteringChildren&&this.enteringChildren.delete(n)}bindToMotionValue(n,a){if(this.valueSubscriptions.has(n)&&this.valueSubscriptions.get(n)(),a.accelerate&&ty.has(n)&&this.current instanceof HTMLElement){const{factory:u,keyframes:f,times:p,ease:m,duration:y}=a.accelerate,g=new Z1({element:this.current,name:n,keyframes:f,times:p,ease:m,duration:zn(y)}),b=u(g);this.valueSubscriptions.set(n,()=>{b(),g.cancel()});return}const s=zs.has(n);s&&this.onBindTransform&&this.onBindTransform();const o=a.on("change",u=>{this.latestValues[n]=u,this.props.onUpdate&&yt.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let l;typeof window<"u"&&window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,n,a)),this.valueSubscriptions.set(n,()=>{o(),l&&l(),a.owner&&a.stop()})}sortNodePosition(n){return!this.current||!this.sortInstanceNodePosition||this.type!==n.type?0:this.sortInstanceNodePosition(this.current,n.current)}updateFeatures(){let n="animation";for(n in Dl){const a=Dl[n];if(!a)continue;const{isEnabled:s,Feature:o}=a;if(!this.features[n]&&o&&s(this.props)&&(this.features[n]=new o(this)),this.features[n]){const l=this.features[n];l.isMounted?l.update():(l.mount(),l.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Yt()}getStaticValue(n){return this.latestValues[n]}setStaticValue(n,a){this.latestValues[n]=a}update(n,a){(n.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=n,this.prevPresenceContext=this.presenceContext,this.presenceContext=a;for(let s=0;s<mm.length;s++){const o=mm[s];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const l="on"+o,u=n[l];u&&(this.propEventSubscriptions[o]=this.on(o,u))}this.prevMotionValues=bS(this,this.scrapeMotionValuesFromProps(n,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(n){return this.props.variants?this.props.variants[n]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(n){const a=this.getClosestVariantNode();if(a)return a.variantChildren&&a.variantChildren.add(n),()=>a.variantChildren.delete(n)}addValue(n,a){const s=this.values.get(n);a!==s&&(s&&this.removeValue(n),this.bindToMotionValue(n,a),this.values.set(n,a),this.latestValues[n]=a.get())}removeValue(n){this.values.delete(n);const a=this.valueSubscriptions.get(n);a&&(a(),this.valueSubscriptions.delete(n)),delete this.latestValues[n],this.removeValueFromRenderState(n,this.renderState)}hasValue(n){return this.values.has(n)}getValue(n,a){if(this.props.values&&this.props.values[n])return this.props.values[n];let s=this.values.get(n);return s===void 0&&a!==void 0&&(s=_s(a===null?void 0:a,{owner:this}),this.addValue(n,s)),s}readValue(n,a){let s=this.latestValues[n]!==void 0||!this.current?this.latestValues[n]:this.getBaseTargetFromProps(this.props,n)??this.readValueFromInstance(this.current,n,this.options);return s!=null&&(typeof s=="string"&&(v1(s)||w1(s))?s=parseFloat(s):!xS(s)&&pr.test(a)&&(s=fy(n,a)),this.setBaseTarget(n,rn(s)?s.get():s)),rn(s)?s.get():s}setBaseTarget(n,a){this.baseTarget[n]=a}getBaseTarget(n){var l;const{initial:a}=this.props;let s;if(typeof a=="string"||typeof a=="object"){const u=xf(this.props,a,(l=this.presenceContext)==null?void 0:l.custom);u&&(s=u[n])}if(a&&s!==void 0)return s;const o=this.getBaseTargetFromProps(this.props,n);return o!==void 0&&!rn(o)?o:this.initialValues[n]!==void 0&&s===void 0?void 0:this.baseTarget[n]}on(n,a){return this.events[n]||(this.events[n]=new sf),this.events[n].add(a)}notify(n,...a){this.events[n]&&this.events[n].notify(...a)}scheduleRenderMicrotask(){wf.render(this.render)}}class Sy extends kS{constructor(){super(...arguments),this.KeyframeResolver=Q3}sortInstanceNodePosition(n,a){return n.compareDocumentPosition(a)&2?1:-1}getBaseTargetFromProps(n,a){const s=n.style;return s?s[a]:void 0}removeValueFromRenderState(n,{vars:a,style:s}){delete a[n],delete s[n]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:n}=this.props;rn(n)&&(this.childSubscription=n.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}}class ja{constructor(n){this.isMounted=!1,this.node=n}update(){}}function ky({top:e,left:n,right:a,bottom:s}){return{x:{min:n,max:a},y:{min:e,max:s}}}function jS({x:e,y:n}){return{top:n.min,right:e.max,bottom:n.max,left:e.min}}function CS(e,n){if(!n)return e;const a=n({x:e.left,y:e.top}),s=n({x:e.right,y:e.bottom});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}function Ku(e){return e===void 0||e===1}function _d({scale:e,scaleX:n,scaleY:a}){return!Ku(e)||!Ku(n)||!Ku(a)}function Ba(e){return _d(e)||jy(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function jy(e){return gm(e.x)||gm(e.y)}function gm(e){return e&&e!=="0%"}function Fl(e,n,a){const s=e-a,o=n*s;return a+o}function ym(e,n,a,s,o){return o!==void 0&&(e=Fl(e,o,s)),Fl(e,a,s)+n}function Dd(e,n=0,a=1,s,o){e.min=ym(e.min,n,a,s,o),e.max=ym(e.max,n,a,s,o)}function Cy(e,{x:n,y:a}){Dd(e.x,n.translate,n.scale,n.originPoint),Dd(e.y,a.translate,a.scale,a.originPoint)}const xm=.999999999999,vm=1.0000000000001;function NS(e,n,a,s=!1){var f;const o=a.length;if(!o)return;n.x=n.y=1;let l,u;for(let p=0;p<o;p++){l=a[p],u=l.projectionDelta;const{visualElement:m}=l.options;m&&m.props.style&&m.props.style.display==="contents"||(s&&l.options.layoutScroll&&l.scroll&&l!==l.root&&(Pr(e.x,-l.scroll.offset.x),Pr(e.y,-l.scroll.offset.y)),u&&(n.x*=u.x.scale,n.y*=u.y.scale,Cy(e,u)),s&&Ba(l.latestValues)&&Sl(e,l.latestValues,(f=l.layout)==null?void 0:f.layoutBox))}n.x<vm&&n.x>xm&&(n.x=1),n.y<vm&&n.y>xm&&(n.y=1)}function Pr(e,n){e.min+=n,e.max+=n}function bm(e,n,a,s,o=.5){const l=Nt(e.min,e.max,o);Dd(e,n,a,l,s)}function wm(e,n){return typeof e=="string"?parseFloat(e)/100*(n.max-n.min):e}function Sl(e,n,a){const s=a??e;bm(e.x,wm(n.x,s.x),n.scaleX,n.scale,n.originX),bm(e.y,wm(n.y,s.y),n.scaleY,n.scale,n.originY)}function Ny(e,n){return ky(CS(e.getBoundingClientRect(),n))}function ES(e,n,a){const s=Ny(e,a),{scroll:o}=n;return o&&(Pr(s.x,o.offset.x),Pr(s.y,o.offset.y)),s}const TS={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},PS=Os.length;function RS(e,n,a){let s="",o=!0;for(let l=0;l<PS;l++){const u=Os[l],f=e[u];if(f===void 0)continue;let p=!0;if(typeof f=="number")p=f===(u.startsWith("scale")?1:0);else{const m=parseFloat(f);p=u.startsWith("scale")?m===1:m===0}if(!p||a){const m=py(f,bf[u]);if(!p){o=!1;const y=TS[u]||u;s+=`${y}(${m}) `}a&&(n[u]=m)}}return s=s.trim(),a?s=a(n,o?"":s):o&&(s="none"),s}function Ef(e,n,a){const{style:s,vars:o,transformOrigin:l}=e;let u=!1,f=!1;for(const p in n){const m=n[p];if(zs.has(p)){u=!0;continue}else if(L1(p)){o[p]=m;continue}else{const y=py(m,bf[p]);p.startsWith("origin")?(f=!0,l[p]=y):s[p]=y}}if(n.transform||(u||a?s.transform=RS(n,e.transform,a):s.transform&&(s.transform="none")),f){const{originX:p="50%",originY:m="50%",originZ:y=0}=l;s.transformOrigin=`${p} ${m} ${y}`}}function Ey(e,{style:n,vars:a},s,o){const l=e.style;let u;for(u in n)l[u]=n[u];o==null||o.applyProjectionStyles(l,s);for(u in a)l.setProperty(u,a[u])}function Sm(e,n){return n.max===n.min?0:e/(n.max-n.min)*100}const ki={correct:(e,n)=>{if(!n.target)return e;if(typeof e=="string")if(Ee.test(e))e=parseFloat(e);else return e;const a=Sm(e,n.target.x),s=Sm(e,n.target.y);return`${a}% ${s}%`}},MS={correct:(e,{treeScale:n,projectionDelta:a})=>{const s=e,o=pr.parse(e);if(o.length>5)return s;const l=pr.createTransformer(e),u=typeof o[0]!="number"?1:0,f=a.x.scale*n.x,p=a.y.scale*n.y;o[0+u]/=f,o[1+u]/=p;const m=Nt(f,p,.5);return typeof o[2+u]=="number"&&(o[2+u]/=m),typeof o[3+u]=="number"&&(o[3+u]/=m),l(o)}},Fd={borderRadius:{...ki,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ki,borderTopRightRadius:ki,borderBottomLeftRadius:ki,borderBottomRightRadius:ki,boxShadow:MS};function Ty(e,{layout:n,layoutId:a}){return zs.has(e)||e.startsWith("origin")||(n||a!==void 0)&&(!!Fd[e]||e==="opacity")}function Tf(e,n,a){var u;const s=e.style,o=n==null?void 0:n.style,l={};if(!s)return l;for(const f in s)(rn(s[f])||o&&rn(o[f])||Ty(f,e)||((u=a==null?void 0:a.getValue(f))==null?void 0:u.liveStyle)!==void 0)&&(l[f]=s[f]);return l}function IS(e){return window.getComputedStyle(e)}class _S extends Sy{constructor(){super(...arguments),this.type="html",this.renderInstance=Ey}readValueFromInstance(n,a){var s;if(zs.has(a))return(s=this.projection)!=null&&s.isProjecting?Sd(a):e3(n,a);{const o=IS(n),l=(L1(a)?o.getPropertyValue(a):o[a])||0;return typeof l=="string"?l.trim():l}}measureInstanceViewportBox(n,{transformPagePoint:a}){return Ny(n,a)}build(n,a,s){Ef(n,a,s.transformTemplate)}scrapeMotionValuesFromProps(n,a,s){return Tf(n,a,s)}}const DS={offset:"stroke-dashoffset",array:"stroke-dasharray"},FS={offset:"strokeDashoffset",array:"strokeDasharray"};function LS(e,n,a=1,s=0,o=!0){e.pathLength=1;const l=o?DS:FS;e[l.offset]=`${-s}`,e[l.array]=`${n} ${a}`}const AS=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Py(e,{attrX:n,attrY:a,attrScale:s,pathLength:o,pathSpacing:l=1,pathOffset:u=0,...f},p,m,y){if(Ef(e,f,m),p){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:b}=e;g.transform&&(b.transform=g.transform,delete g.transform),(b.transform||g.transformOrigin)&&(b.transformOrigin=g.transformOrigin??"50% 50%",delete g.transformOrigin),b.transform&&(b.transformBox=(y==null?void 0:y.transformBox)??"fill-box",delete g.transformBox);for(const S of AS)g[S]!==void 0&&(b[S]=g[S],delete g[S]);n!==void 0&&(g.x=n),a!==void 0&&(g.y=a),s!==void 0&&(g.scale=s),o!==void 0&&LS(g,o,l,u,!1)}const Ry=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),My=e=>typeof e=="string"&&e.toLowerCase()==="svg";function OS(e,n,a,s){Ey(e,n,void 0,s);for(const o in n.attrs)e.setAttribute(Ry.has(o)?o:vf(o),n.attrs[o])}function Iy(e,n,a){const s=Tf(e,n,a);for(const o in e)if(rn(e[o])||rn(n[o])){const l=Os.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;s[l]=e[o]}return s}class zS extends Sy{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Yt}getBaseTargetFromProps(n,a){return n[a]}readValueFromInstance(n,a){if(zs.has(a)){const s=dy(a);return s&&s.default||0}return a=Ry.has(a)?a:vf(a),n.getAttribute(a)}scrapeMotionValuesFromProps(n,a,s){return Iy(n,a,s)}build(n,a,s){Py(n,a,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(n,a,s,o){OS(n,a,s,o)}mount(n){this.isSVGTag=My(n.tagName),super.mount(n)}}const BS=Cf.length;function _y(e){if(!e)return;if(!e.isControllingVariants){const a=e.parent?_y(e.parent)||{}:{};return e.props.initial!==void 0&&(a.initial=e.props.initial),a}const n={};for(let a=0;a<BS;a++){const s=Cf[a],o=e.props[s];(Oi(o)||o===!1)&&(n[s]=o)}return n}function Dy(e,n){if(!Array.isArray(n))return!1;const a=n.length;if(a!==e.length)return!1;for(let s=0;s<a;s++)if(n[s]!==e[s])return!1;return!0}const VS=[...jf].reverse(),US=jf.length;function $S(e){return n=>Promise.all(n.map(({animation:a,options:s})=>V3(e,a,s)))}function HS(e){let n=$S(e),a=km(),s=!0,o=!1;const l=m=>(y,g)=>{var S;const b=Wa(e,g,m==="exit"?(S=e.presenceContext)==null?void 0:S.custom:void 0);if(b){const{transition:C,transitionEnd:N,...j}=b;y={...y,...j,...N}}return y};function u(m){n=m(e)}function f(m){const{props:y}=e,g=_y(e.parent)||{},b=[],S=new Set;let C={},N=1/0;for(let L=0;L<US;L++){const R=VS[L],D=a[R],H=y[R]!==void 0?y[R]:g[R],K=Oi(H),re=R===m?D.isActive:null;re===!1&&(N=L);let O=H===g[R]&&H!==y[R]&&K;if(O&&(s||o)&&e.manuallyAnimateOnMount&&(O=!1),D.protectedKeys={...C},!D.isActive&&re===null||!H&&!D.prevProp||Kl(H)||typeof H=="boolean")continue;if(R==="exit"&&D.isActive&&re!==!0){D.prevResolvedValues&&(C={...C,...D.prevResolvedValues});continue}const w=WS(D.prevProp,H);let M=w||R===m&&D.isActive&&!O&&K||L>N&&K,E=!1;const U=Array.isArray(H)?H:[H];let Y=U.reduce(l(R),{});re===!1&&(Y={});const{prevResolvedValues:I={}}=D,W={...I,...Y},Q=_=>{M=!0,S.has(_)&&(E=!0,S.delete(_)),D.needsAnimating[_]=!0;const X=e.getValue(_);X&&(X.liveStyle=!1)};for(const _ in W){const X=Y[_],J=I[_];if(C.hasOwnProperty(_))continue;let T=!1;Td(X)&&Td(J)?T=!Dy(X,J):T=X!==J,T?X!=null?Q(_):S.add(_):X!==void 0&&S.has(_)?Q(_):D.protectedKeys[_]=!0}D.prevProp=H,D.prevResolvedValues=Y,D.isActive&&(C={...C,...Y}),(s||o)&&e.blockInitialAnimation&&(M=!1);const G=O&&w;M&&(!G||E)&&b.push(...U.map(_=>{const X={type:R};if(typeof _=="string"&&(s||o)&&!G&&e.manuallyAnimateOnMount&&e.parent){const{parent:J}=e,T=Wa(J,_);if(J.enteringChildren&&T){const{delayChildren:A}=T.transition||{};X.delay=ny(J.enteringChildren,e,A)}}return{animation:_,options:X}}))}if(S.size){const L={};if(typeof y.initial!="boolean"){const R=Wa(e,Array.isArray(y.initial)?y.initial[0]:y.initial);R&&R.transition&&(L.transition=R.transition)}S.forEach(R=>{const D=e.getBaseTarget(R),H=e.getValue(R);H&&(H.liveStyle=!0),L[R]=D??null}),b.push({animation:L})}let j=!!b.length;return s&&(y.initial===!1||y.initial===y.animate)&&!e.manuallyAnimateOnMount&&(j=!1),s=!1,o=!1,j?n(b):Promise.resolve()}function p(m,y){var b;if(a[m].isActive===y)return Promise.resolve();(b=e.variantChildren)==null||b.forEach(S=>{var C;return(C=S.animationState)==null?void 0:C.setActive(m,y)}),a[m].isActive=y;const g=f(m);for(const S in a)a[S].protectedKeys={};return g}return{animateChanges:f,setActive:p,setAnimateFunction:u,getState:()=>a,reset:()=>{a=km(),o=!0}}}function WS(e,n){return typeof n=="string"?n!==e:Array.isArray(n)?!Dy(n,e):!1}function Aa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function km(){return{animate:Aa(!0),whileInView:Aa(),whileHover:Aa(),whileTap:Aa(),whileDrag:Aa(),whileFocus:Aa(),exit:Aa()}}function Ld(e,n){e.min=n.min,e.max=n.max}function ur(e,n){Ld(e.x,n.x),Ld(e.y,n.y)}function jm(e,n){e.translate=n.translate,e.scale=n.scale,e.originPoint=n.originPoint,e.origin=n.origin}const Fy=1e-4,KS=1-Fy,YS=1+Fy,Ly=.01,GS=0-Ly,XS=0+Ly;function wn(e){return e.max-e.min}function JS(e,n,a){return Math.abs(e-n)<=a}function Cm(e,n,a,s=.5){e.origin=s,e.originPoint=Nt(n.min,n.max,e.origin),e.scale=wn(a)/wn(n),e.translate=Nt(a.min,a.max,e.origin)-e.originPoint,(e.scale>=KS&&e.scale<=YS||isNaN(e.scale))&&(e.scale=1),(e.translate>=GS&&e.translate<=XS||isNaN(e.translate))&&(e.translate=0)}function Mi(e,n,a,s){Cm(e.x,n.x,a.x,s?s.originX:void 0),Cm(e.y,n.y,a.y,s?s.originY:void 0)}function Nm(e,n,a,s=0){const o=s?Nt(a.min,a.max,s):a.min;e.min=o+n.min,e.max=e.min+wn(n)}function qS(e,n,a,s){Nm(e.x,n.x,a.x,s==null?void 0:s.x),Nm(e.y,n.y,a.y,s==null?void 0:s.y)}function Em(e,n,a,s=0){const o=s?Nt(a.min,a.max,s):a.min;e.min=n.min-o,e.max=e.min+wn(n)}function Ll(e,n,a,s){Em(e.x,n.x,a.x,s==null?void 0:s.x),Em(e.y,n.y,a.y,s==null?void 0:s.y)}function Tm(e,n,a,s,o){return e-=n,e=Fl(e,1/a,s),o!==void 0&&(e=Fl(e,1/o,s)),e}function QS(e,n=0,a=1,s=.5,o,l=e,u=e){if(Rr.test(n)&&(n=parseFloat(n),n=Nt(u.min,u.max,n/100)-u.min),typeof n!="number")return;let f=Nt(l.min,l.max,s);e===l&&(f-=n),e.min=Tm(e.min,n,a,f,o),e.max=Tm(e.max,n,a,f,o)}function Pm(e,n,[a,s,o],l,u){QS(e,n[a],n[s],n[o],n.scale,l,u)}const ZS=["x","scaleX","originX"],ek=["y","scaleY","originY"];function Rm(e,n,a,s){Pm(e.x,n,ZS,a?a.x:void 0,s?s.x:void 0),Pm(e.y,n,ek,a?a.y:void 0,s?s.y:void 0)}function Mm(e){return e.translate===0&&e.scale===1}function Ay(e){return Mm(e.x)&&Mm(e.y)}function Im(e,n){return e.min===n.min&&e.max===n.max}function tk(e,n){return Im(e.x,n.x)&&Im(e.y,n.y)}function _m(e,n){return Math.round(e.min)===Math.round(n.min)&&Math.round(e.max)===Math.round(n.max)}function Oy(e,n){return _m(e.x,n.x)&&_m(e.y,n.y)}function Dm(e){return wn(e.x)/wn(e.y)}function Fm(e,n){return e.translate===n.translate&&e.scale===n.scale&&e.originPoint===n.originPoint}function Tr(e){return[e("x"),e("y")]}function nk(e,n,a){let s="";const o=e.x.translate/n.x,l=e.y.translate/n.y,u=(a==null?void 0:a.z)||0;if((o||l||u)&&(s=`translate3d(${o}px, ${l}px, ${u}px) `),(n.x!==1||n.y!==1)&&(s+=`scale(${1/n.x}, ${1/n.y}) `),a){const{transformPerspective:m,rotate:y,rotateX:g,rotateY:b,skewX:S,skewY:C}=a;m&&(s=`perspective(${m}px) ${s}`),y&&(s+=`rotate(${y}deg) `),g&&(s+=`rotateX(${g}deg) `),b&&(s+=`rotateY(${b}deg) `),S&&(s+=`skewX(${S}deg) `),C&&(s+=`skewY(${C}deg) `)}const f=e.x.scale*n.x,p=e.y.scale*n.y;return(f!==1||p!==1)&&(s+=`scale(${f}, ${p})`),s||"none"}const zy=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],rk=zy.length,Lm=e=>typeof e=="string"?parseFloat(e):e,Am=e=>typeof e=="number"||Ee.test(e);function ak(e,n,a,s,o,l){o?(e.opacity=Nt(0,a.opacity??1,sk(s)),e.opacityExit=Nt(n.opacity??1,0,ik(s))):l&&(e.opacity=Nt(n.opacity??1,a.opacity??1,s));for(let u=0;u<rk;u++){const f=zy[u];let p=Om(n,f),m=Om(a,f);if(p===void 0&&m===void 0)continue;p||(p=0),m||(m=0),p===0||m===0||Am(p)===Am(m)?(e[f]=Math.max(Nt(Lm(p),Lm(m),s),0),(Rr.test(m)||Rr.test(p))&&(e[f]+="%")):e[f]=m}(n.rotate||a.rotate)&&(e.rotate=Nt(n.rotate||0,a.rotate||0,s))}function Om(e,n){return e[n]!==void 0?e[n]:e.borderRadius}const sk=By(0,.5,R1),ik=By(.5,.95,Zn);function By(e,n,a){return s=>s<e?0:s>n?1:a(Li(e,n,s))}function ok(e,n,a){const s=rn(e)?e:_s(e);return s.start(yf("",s,n,a)),s.animation}function zi(e,n,a,s={passive:!0}){return e.addEventListener(n,a,s),()=>e.removeEventListener(n,a)}const lk=(e,n)=>e.depth-n.depth;class ck{constructor(){this.children=[],this.isDirty=!1}add(n){rf(this.children,n),this.isDirty=!0}remove(n){Tl(this.children,n),this.isDirty=!0}forEach(n){this.isDirty&&this.children.sort(lk),this.isDirty=!1,this.children.forEach(n)}}function uk(e,n){const a=bn.now(),s=({timestamp:o})=>{const l=o-a;l>=n&&(Sa(s),e(l-n))};return yt.setup(s,!0),()=>Sa(s)}function kl(e){return rn(e)?e.get():e}class dk{constructor(){this.members=[]}add(n){rf(this.members,n);for(let a=this.members.length-1;a>=0;a--){const s=this.members[a];if(s===n||s===this.lead||s===this.prevLead)continue;const o=s.instance;(!o||o.isConnected===!1)&&!s.snapshot&&(Tl(this.members,s),s.unmount())}n.scheduleRender()}remove(n){if(Tl(this.members,n),n===this.prevLead&&(this.prevLead=void 0),n===this.lead){const a=this.members[this.members.length-1];a&&this.promote(a)}}relegate(n){var a;for(let s=this.members.indexOf(n)-1;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1&&((a=o.instance)==null?void 0:a.isConnected)!==!1)return this.promote(o),!0}return!1}promote(n,a){var o;const s=this.lead;if(n!==s&&(this.prevLead=s,this.lead=n,n.show(),s)){s.updateSnapshot(),n.scheduleRender();const{layoutDependency:l}=s.options,{layoutDependency:u}=n.options;(l===void 0||l!==u)&&(n.resumeFrom=s,a&&(s.preserveOpacity=!0),s.snapshot&&(n.snapshot=s.snapshot,n.snapshot.latestValues=s.animationValues||s.latestValues),(o=n.root)!=null&&o.isUpdating&&(n.isLayoutDirty=!0)),n.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(n=>{var a,s,o,l,u;(s=(a=n.options).onExitComplete)==null||s.call(a),(u=(o=n.resumingFrom)==null?void 0:(l=o.options).onExitComplete)==null||u.call(l)})}scheduleRender(){this.members.forEach(n=>n.instance&&n.scheduleRender(!1))}removeLeadSnapshot(){var n;(n=this.lead)!=null&&n.snapshot&&(this.lead.snapshot=void 0)}}const jl={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Yu=["","X","Y","Z"],fk=1e3;let hk=0;function Gu(e,n,a,s){const{latestValues:o}=n;o[e]&&(a[e]=o[e],n.setStaticValue(e,0),s&&(s[e]=0))}function Vy(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:n}=e.options;if(!n)return;const a=oy(n);if(window.MotionHasOptimisedAnimation(a,"transform")){const{layout:o,layoutId:l}=e.options;window.MotionCancelOptimisedAnimation(a,"transform",yt,!(o||l))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&Vy(s)}function Uy({attachResizeListener:e,defaultParent:n,measureScroll:a,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(u={},f=n==null?void 0:n()){this.id=hk++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(gk),this.nodes.forEach(Sk),this.nodes.forEach(kk),this.nodes.forEach(yk)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=u,this.root=f?f.root||f:this,this.path=f?[...f.path,f]:[],this.parent=f,this.depth=f?f.depth+1:0;for(let p=0;p<this.path.length;p++)this.path[p].shouldResetTransform=!0;this.root===this&&(this.nodes=new ck)}addEventListener(u,f){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new sf),this.eventHandlers.get(u).add(f)}notifyListeners(u,...f){const p=this.eventHandlers.get(u);p&&p.notify(...f)}hasListeners(u){return this.eventHandlers.has(u)}mount(u){if(this.instance)return;this.isSVG=kf(u)&&!gS(u),this.instance=u;const{layoutId:f,layout:p,visualElement:m}=this.options;if(m&&!m.current&&m.mount(u),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(p||f)&&(this.isLayoutDirty=!0),e){let y,g=0;const b=()=>this.root.updateBlockedByResize=!1;yt.read(()=>{g=window.innerWidth}),e(u,()=>{const S=window.innerWidth;S!==g&&(g=S,this.root.updateBlockedByResize=!0,y&&y(),y=uk(b,250),jl.hasAnimatedSinceResize&&(jl.hasAnimatedSinceResize=!1,this.nodes.forEach(Vm)))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&m&&(f||p)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:g,hasRelativeLayoutChanged:b,layout:S})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const C=this.options.transition||m.getDefaultTransition()||Tk,{onLayoutAnimationStart:N,onLayoutAnimationComplete:j}=m.getProps(),L=!this.targetLayout||!Oy(this.targetLayout,S),R=!g&&b;if(this.options.layoutRoot||this.resumeFrom||R||g&&(L||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const D={...gf(C,"layout"),onPlay:N,onComplete:j};(m.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D),this.setAnimationOrigin(y,R)}else g||Vm(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=S})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const u=this.getStack();u&&u.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Sa(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(jk),this.animationId++)}getTransformTemplate(){const{visualElement:u}=this.options;return u&&u.getProps().transformTemplate}willUpdate(u=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Vy(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y<this.path.length;y++){const g=this.path[y];g.shouldResetTransform=!0,(typeof g.latestValues.x=="string"||typeof g.latestValues.y=="string")&&(g.isLayoutDirty=!0),g.updateScroll("snapshot"),g.options.layoutRoot&&g.willUpdate(!1)}const{layoutId:f,layout:p}=this.options;if(f===void 0&&!p)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),u&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const p=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),p&&this.nodes.forEach(vk),this.nodes.forEach(zm);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Bm);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(bk),this.nodes.forEach(wk),this.nodes.forEach(pk),this.nodes.forEach(mk)):this.nodes.forEach(Bm),this.clearAllSnapshots();const f=bn.now();nn.delta=Ir(0,1e3/60,f-nn.timestamp),nn.timestamp=f,nn.isProcessing=!0,zu.update.process(nn),zu.preRender.process(nn),zu.render.process(nn),nn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,wf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(xk),this.sharedNodes.forEach(Ck)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,yt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){yt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!wn(this.snapshot.measuredBox.x)&&!wn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let p=0;p<this.path.length;p++)this.path[p].updateScroll();const u=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Yt()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:f}=this.options;f&&f.notify("LayoutMeasure",this.layout.layoutBox,u?u.layoutBox:void 0)}updateScroll(u="measure"){let f=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===u&&(f=!1),f&&this.instance){const p=s(this.instance);this.scroll={animationId:this.root.animationId,phase:u,isRoot:p,offset:a(this.instance),wasRoot:this.scroll?this.scroll.isRoot:p}}}resetTransform(){if(!o)return;const u=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,f=this.projectionDelta&&!Ay(this.projectionDelta),p=this.getTransformTemplate(),m=p?p(this.latestValues,""):void 0,y=m!==this.prevTransformTemplateValue;u&&this.instance&&(f||Ba(this.latestValues)||y)&&(o(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(u=!0){const f=this.measurePageBox();let p=this.removeElementScroll(f);return u&&(p=this.removeTransform(p)),Pk(p),{animationId:this.root.animationId,measuredBox:f,layoutBox:p,latestValues:{},source:this.id}}measurePageBox(){var m;const{visualElement:u}=this.options;if(!u)return Yt();const f=u.measureViewportBox();if(!(((m=this.scroll)==null?void 0:m.wasRoot)||this.path.some(Rk))){const{scroll:y}=this.root;y&&(Pr(f.x,y.offset.x),Pr(f.y,y.offset.y))}return f}removeElementScroll(u){var p;const f=Yt();if(ur(f,u),(p=this.scroll)!=null&&p.wasRoot)return f;for(let m=0;m<this.path.length;m++){const y=this.path[m],{scroll:g,options:b}=y;y!==this.root&&g&&b.layoutScroll&&(g.wasRoot&&ur(f,u),Pr(f.x,g.offset.x),Pr(f.y,g.offset.y))}return f}applyTransform(u,f=!1,p){var y,g;const m=p||Yt();ur(m,u);for(let b=0;b<this.path.length;b++){const S=this.path[b];!f&&S.options.layoutScroll&&S.scroll&&S!==S.root&&(Pr(m.x,-S.scroll.offset.x),Pr(m.y,-S.scroll.offset.y)),Ba(S.latestValues)&&Sl(m,S.latestValues,(y=S.layout)==null?void 0:y.layoutBox)}return Ba(this.latestValues)&&Sl(m,this.latestValues,(g=this.layout)==null?void 0:g.layoutBox),m}removeTransform(u){var p;const f=Yt();ur(f,u);for(let m=0;m<this.path.length;m++){const y=this.path[m];if(!Ba(y.latestValues))continue;let g;y.instance&&(_d(y.latestValues)&&y.updateSnapshot(),g=Yt(),ur(g,y.measurePageBox())),Rm(f,y.latestValues,(p=y.snapshot)==null?void 0:p.layoutBox,g)}return Ba(this.latestValues)&&Rm(f,this.latestValues),f}setTargetDelta(u){this.targetDelta=u,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(u){this.options={...this.options,...u,crossfade:u.crossfade!==void 0?u.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==nn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(u=!1){var S;const f=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=f.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=f.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=f.isSharedProjectionDirty);const p=!!this.resumingFrom||this!==f;if(!(u||p&&this.isSharedProjectionDirty||this.isProjectionDirty||(S=this.parent)!=null&&S.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:g}=this.options;if(!this.layout||!(y||g))return;this.resolvedRelativeTargetAt=nn.timestamp;const b=this.getClosestProjectingParent();b&&this.linkedParentVersion!==b.layoutVersion&&!b.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&b&&b.layout?this.createRelativeTarget(b,this.layout.layoutBox,b.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Yt(),this.targetWithTransforms=Yt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),qS(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ur(this.target,this.layout.layoutBox),Cy(this.target,this.targetDelta)):ur(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?this.createRelativeTarget(b,this.target,b.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||_d(this.parent.latestValues)||jy(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(u,f,p){this.relativeParent=u,this.linkedParentVersion=u.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Yt(),this.relativeTargetOrigin=Yt(),Ll(this.relativeTargetOrigin,f,p,this.options.layoutAnchor||void 0),ur(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var C;const u=this.getLead(),f=!!this.resumingFrom||this!==u;let p=!0;if((this.isProjectionDirty||(C=this.parent)!=null&&C.isProjectionDirty)&&(p=!1),f&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(p=!1),this.resolvedRelativeTargetAt===nn.timestamp&&(p=!1),p)return;const{layout:m,layoutId:y}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(m||y))return;ur(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,b=this.treeScale.y;NS(this.layoutCorrected,this.treeScale,this.path,f),u.layout&&!u.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(u.target=u.layout.layoutBox,u.targetWithTransforms=Yt());const{target:S}=u;if(!S){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(jm(this.prevProjectionDelta.x,this.projectionDelta.x),jm(this.prevProjectionDelta.y,this.projectionDelta.y)),Mi(this.projectionDelta,this.layoutCorrected,S,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==b||!Fm(this.projectionDelta.x,this.prevProjectionDelta.x)||!Fm(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",S))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(u=!0){var f;if((f=this.options.visualElement)==null||f.scheduleRender(),u){const p=this.getStack();p&&p.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Es(),this.projectionDelta=Es(),this.projectionDeltaWithTransform=Es()}setAnimationOrigin(u,f=!1){const p=this.snapshot,m=p?p.latestValues:{},y={...this.latestValues},g=Es();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!f;const b=Yt(),S=p?p.source:void 0,C=this.layout?this.layout.source:void 0,N=S!==C,j=this.getStack(),L=!j||j.members.length<=1,R=!!(N&&!L&&this.options.crossfade===!0&&!this.path.some(Ek));this.animationProgress=0;let D;this.mixTargetDelta=H=>{const K=H/1e3;Um(g.x,u.x,K),Um(g.y,u.y,K),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ll(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Nk(this.relativeTarget,this.relativeTargetOrigin,b,K),D&&tk(this.relativeTarget,D)&&(this.isProjectionDirty=!1),D||(D=Yt()),ur(D,this.relativeTarget)),N&&(this.animationValues=y,ak(y,m,this.latestValues,K,R,L)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=K},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){var f,p,m;this.notifyListeners("animationStart"),(f=this.currentAnimation)==null||f.stop(),(m=(p=this.resumingFrom)==null?void 0:p.currentAnimation)==null||m.stop(),this.pendingAnimation&&(Sa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=yt.update(()=>{jl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_s(0)),this.motionValue.jump(0,!1),this.currentAnimation=ok(this.motionValue,[0,1e3],{...u,velocity:0,isSync:!0,onUpdate:y=>{this.mixTargetDelta(y),u.onUpdate&&u.onUpdate(y)},onStop:()=>{},onComplete:()=>{u.onComplete&&u.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const u=this.getStack();u&&u.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(fk),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const u=this.getLead();let{targetWithTransforms:f,target:p,layout:m,latestValues:y}=u;if(!(!f||!p||!m)){if(this!==u&&this.layout&&m&&$y(this.options.animationType,this.layout.layoutBox,m.layoutBox)){p=this.target||Yt();const g=wn(this.layout.layoutBox.x);p.x.min=u.target.x.min,p.x.max=p.x.min+g;const b=wn(this.layout.layoutBox.y);p.y.min=u.target.y.min,p.y.max=p.y.min+b}ur(f,p),Sl(f,y),Mi(this.projectionDeltaWithTransform,this.layoutCorrected,f,y)}}registerSharedNode(u,f){this.sharedNodes.has(u)||this.sharedNodes.set(u,new dk),this.sharedNodes.get(u).add(f);const m=f.options.initialPromotionConfig;f.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(f):void 0})}isLead(){const u=this.getStack();return u?u.lead===this:!0}getLead(){var f;const{layoutId:u}=this.options;return u?((f=this.getStack())==null?void 0:f.lead)||this:this}getPrevLead(){var f;const{layoutId:u}=this.options;return u?(f=this.getStack())==null?void 0:f.prevLead:void 0}getStack(){const{layoutId:u}=this.options;if(u)return this.root.sharedNodes.get(u)}promote({needsReset:u,transition:f,preserveFollowOpacity:p}={}){const m=this.getStack();m&&m.promote(this,p),u&&(this.projectionDelta=void 0,this.needsReset=!0),f&&this.setOptions({transition:f})}relegate(){const u=this.getStack();return u?u.relegate(this):!1}resetSkewAndRotation(){const{visualElement:u}=this.options;if(!u)return;let f=!1;const{latestValues:p}=u;if((p.z||p.rotate||p.rotateX||p.rotateY||p.rotateZ||p.skewX||p.skewY)&&(f=!0),!f)return;const m={};p.z&&Gu("z",u,m,this.animationValues);for(let y=0;y<Yu.length;y++)Gu(`rotate${Yu[y]}`,u,m,this.animationValues),Gu(`skew${Yu[y]}`,u,m,this.animationValues);u.render();for(const y in m)u.setStaticValue(y,m[y]),this.animationValues&&(this.animationValues[y]=m[y]);u.scheduleRender()}applyProjectionStyles(u,f){if(!this.instance||this.isSVG)return;if(!this.isVisible){u.visibility="hidden";return}const p=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,u.visibility="",u.opacity="",u.pointerEvents=kl(f==null?void 0:f.pointerEvents)||"",u.transform=p?p(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(u.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,u.pointerEvents=kl(f==null?void 0:f.pointerEvents)||""),this.hasProjected&&!Ba(this.latestValues)&&(u.transform=p?p({},""):"none",this.hasProjected=!1);return}u.visibility="";const y=m.animationValues||m.latestValues;this.applyTransformsToTarget();let g=nk(this.projectionDeltaWithTransform,this.treeScale,y);p&&(g=p(y,g)),u.transform=g;const{x:b,y:S}=this.projectionDelta;u.transformOrigin=`${b.origin*100}% ${S.origin*100}% 0`,m.animationValues?u.opacity=m===this?y.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:y.opacityExit:u.opacity=m===this?y.opacity!==void 0?y.opacity:"":y.opacityExit!==void 0?y.opacityExit:0;for(const C in Fd){if(y[C]===void 0)continue;const{correct:N,applyTo:j,isCSSVariable:L}=Fd[C],R=g==="none"?y[C]:N(y[C],m);if(j){const D=j.length;for(let H=0;H<D;H++)u[j[H]]=R}else L?this.options.visualElement.renderState.vars[C]=R:u[C]=R}this.options.layoutId&&(u.pointerEvents=m===this?kl(f==null?void 0:f.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(u=>{var f;return(f=u.currentAnimation)==null?void 0:f.stop()}),this.root.nodes.forEach(zm),this.root.sharedNodes.clear()}}}function pk(e){e.updateLayout()}function mk(e){var a;const n=((a=e.resumeFrom)==null?void 0:a.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=e.layout,{animationType:l}=e.options,u=n.source!==e.layout.source;if(l==="size")Tr(g=>{const b=u?n.measuredBox[g]:n.layoutBox[g],S=wn(b);b.min=s[g].min,b.max=b.min+S});else if(l==="x"||l==="y"){const g=l==="x"?"y":"x";Ld(u?n.measuredBox[g]:n.layoutBox[g],s[g])}else $y(l,n.layoutBox,s)&&Tr(g=>{const b=u?n.measuredBox[g]:n.layoutBox[g],S=wn(s[g]);b.max=b.min+S,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+S)});const f=Es();Mi(f,s,n.layoutBox);const p=Es();u?Mi(p,e.applyTransform(o,!0),n.measuredBox):Mi(p,s,n.layoutBox);const m=!Ay(f);let y=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:b,layout:S}=g;if(b&&S){const C=e.options.layoutAnchor||void 0,N=Yt();Ll(N,n.layoutBox,b.layoutBox,C);const j=Yt();Ll(j,s,S.layoutBox,C),Oy(N,j)||(y=!0),g.options.layoutRoot&&(e.relativeTarget=j,e.relativeTargetOrigin=N,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:p,layoutDelta:f,hasLayoutChanged:m,hasRelativeLayoutChanged:y})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function gk(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function yk(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function xk(e){e.clearSnapshot()}function zm(e){e.clearMeasurements()}function vk(e){e.isLayoutDirty=!0,e.updateLayout()}function Bm(e){e.isLayoutDirty=!1}function bk(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function wk(e){const{visualElement:n}=e.options;n&&n.getProps().onBeforeLayoutMeasure&&n.notify("BeforeLayoutMeasure"),e.resetTransform()}function Vm(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Sk(e){e.resolveTargetDelta()}function kk(e){e.calcProjection()}function jk(e){e.resetSkewAndRotation()}function Ck(e){e.removeLeadSnapshot()}function Um(e,n,a){e.translate=Nt(n.translate,0,a),e.scale=Nt(n.scale,1,a),e.origin=n.origin,e.originPoint=n.originPoint}function $m(e,n,a,s){e.min=Nt(n.min,a.min,s),e.max=Nt(n.max,a.max,s)}function Nk(e,n,a,s){$m(e.x,n.x,a.x,s),$m(e.y,n.y,a.y,s)}function Ek(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Tk={duration:.45,ease:[.4,0,.1,1]},Hm=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Wm=Hm("applewebkit/")&&!Hm("chrome/")?Math.round:Zn;function Km(e){e.min=Wm(e.min),e.max=Wm(e.max)}function Pk(e){Km(e.x),Km(e.y)}function $y(e,n,a){return e==="position"||e==="preserve-aspect"&&!JS(Dm(n),Dm(a),.2)}function Rk(e){var n;return e!==e.root&&((n=e.scroll)==null?void 0:n.wasRoot)}const Mk=Uy({attachResizeListener:(e,n)=>zi(e,"resize",n),measureScroll:()=>{var e,n;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((n=document.body)==null?void 0:n.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Xu={current:void 0},Hy=Uy({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Xu.current){const e=new Mk({});e.mount(window),e.setOptions({layoutScroll:!0}),Xu.current=e}return Xu.current},resetTransform:(e,n)=>{e.style.transform=n!==void 0?n:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Pf=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Ym(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Ik(...e){return n=>{let a=!1;const s=e.map(o=>{const l=Ym(o,n);return!a&&typeof l=="function"&&(a=!0),l});if(a)return()=>{for(let o=0;o<s.length;o++){const l=s[o];typeof l=="function"?l():Ym(e[o],null)}}}}function _k(...e){return v.useCallback(Ik(...e),e)}class Dk extends v.Component{getSnapshotBeforeUpdate(n){const a=this.props.childRef.current;if(xl(a)&&n.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=a.offsetParent,o=xl(s)&&s.offsetWidth||0,l=xl(s)&&s.offsetHeight||0,u=getComputedStyle(a),f=this.props.sizeRef.current;f.height=parseFloat(u.height),f.width=parseFloat(u.width),f.top=a.offsetTop,f.left=a.offsetLeft,f.right=o-f.width-f.left,f.bottom=l-f.height-f.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Fk({children:e,isPresent:n,anchorX:a,anchorY:s,root:o,pop:l}){var b;const u=v.useId(),f=v.useRef(null),p=v.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:m}=v.useContext(Pf),y=((b=e.props)==null?void 0:b.ref)??(e==null?void 0:e.ref),g=_k(f,y);return v.useInsertionEffect(()=>{const{width:S,height:C,top:N,left:j,right:L,bottom:R}=p.current;if(n||l===!1||!f.current||!S||!C)return;const D=a==="left"?`left: ${j}`:`right: ${L}`,H=s==="bottom"?`bottom: ${R}`:`top: ${N}`;f.current.dataset.motionPopId=u;const K=document.createElement("style");m&&(K.nonce=m);const re=o??document.head;return re.appendChild(K),K.sheet&&K.sheet.insertRule(`
|
||
[data-motion-pop-id="${u}"] {
|
||
position: absolute !important;
|
||
width: ${S}px !important;
|
||
height: ${C}px !important;
|
||
${D}px !important;
|
||
${H}px !important;
|
||
}
|
||
`),()=>{var O;(O=f.current)==null||O.removeAttribute("data-motion-pop-id"),re.contains(K)&&re.removeChild(K)}},[n]),d.jsx(Dk,{isPresent:n,childRef:f,sizeRef:p,pop:l,children:l===!1?e:v.cloneElement(e,{ref:g})})}const Lk=({children:e,initial:n,isPresent:a,onExitComplete:s,custom:o,presenceAffectsLayout:l,mode:u,anchorX:f,anchorY:p,root:m})=>{const y=nf(Ak),g=v.useId();let b=!0,S=v.useMemo(()=>(b=!1,{id:g,initial:n,isPresent:a,custom:o,onExitComplete:C=>{y.set(C,!0);for(const N of y.values())if(!N)return;s&&s()},register:C=>(y.set(C,!1),()=>y.delete(C))}),[a,y,s]);return l&&b&&(S={...S}),v.useMemo(()=>{y.forEach((C,N)=>y.set(N,!1))},[a]),v.useEffect(()=>{!a&&!y.size&&s&&s()},[a]),e=d.jsx(Fk,{pop:u==="popLayout",isPresent:a,anchorX:f,anchorY:p,root:m,children:e}),d.jsx(Hl.Provider,{value:S,children:e})};function Ak(){return new Map}function Wy(e=!0){const n=v.useContext(Hl);if(n===null)return[!0,null];const{isPresent:a,onExitComplete:s,register:o}=n,l=v.useId();v.useEffect(()=>{if(e)return o(l)},[e]);const u=v.useCallback(()=>e&&s&&s(l),[l,s,e]);return!a&&s?[!1,u]:[!0]}const il=e=>e.key||"";function Gm(e){const n=[];return v.Children.forEach(e,a=>{v.isValidElement(a)&&n.push(a)}),n}const gn=({children:e,custom:n,initial:a=!0,onExitComplete:s,presenceAffectsLayout:o=!0,mode:l="sync",propagate:u=!1,anchorX:f="left",anchorY:p="top",root:m})=>{const[y,g]=Wy(u),b=v.useMemo(()=>Gm(e),[e]),S=u&&!y?[]:b.map(il),C=v.useRef(!0),N=v.useRef(b),j=nf(()=>new Map),L=v.useRef(new Set),[R,D]=v.useState(b),[H,K]=v.useState(b);x1(()=>{C.current=!1,N.current=b;for(let w=0;w<H.length;w++){const M=il(H[w]);S.includes(M)?(j.delete(M),L.current.delete(M)):j.get(M)!==!0&&j.set(M,!1)}},[H,S.length,S.join("-")]);const re=[];if(b!==R){let w=[...b];for(let M=0;M<H.length;M++){const E=H[M],U=il(E);S.includes(U)||(w.splice(M,0,E),re.push(E))}return l==="wait"&&re.length&&(w=re),K(Gm(w)),D(b),null}const{forceRender:O}=v.useContext(tf);return d.jsx(d.Fragment,{children:H.map(w=>{const M=il(w),E=u&&!y?!1:b===H||S.includes(M),U=()=>{if(L.current.has(M))return;if(j.has(M))L.current.add(M),j.set(M,!0);else return;let Y=!0;j.forEach(I=>{I||(Y=!1)}),Y&&(O==null||O(),K(N.current),u&&(g==null||g()),s&&s())};return d.jsx(Lk,{isPresent:E,initial:!C.current||a?void 0:!1,custom:n,presenceAffectsLayout:o,mode:l,root:m,onExitComplete:E?void 0:U,anchorX:f,anchorY:p,children:w},M)})})},Ky=v.createContext({strict:!1}),Xm={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Jm=!1;function Ok(){if(Jm)return;const e={};for(const n in Xm)e[n]={isEnabled:a=>Xm[n].some(s=>!!a[s])};wy(e),Jm=!0}function Yy(){return Ok(),SS()}function zk(e){const n=Yy();for(const a in e)n[a]={...n[a],...e[a]};wy(n)}const Bk=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Al(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Bk.has(e)}let Gy=e=>!Al(e);function Vk(e){typeof e=="function"&&(Gy=n=>n.startsWith("on")?!Al(n):e(n))}try{Vk(require("@emotion/is-prop-valid").default)}catch{}function Uk(e,n,a){const s={};for(const o in e)o==="values"&&typeof e.values=="object"||rn(e[o])||(Gy(o)||a===!0&&Al(o)||!n&&!Al(o)||e.draggable&&o.startsWith("onDrag"))&&(s[o]=e[o]);return s}const Gl=v.createContext({});function $k(e,n){if(Yl(e)){const{initial:a,animate:s}=e;return{initial:a===!1||Oi(a)?a:void 0,animate:Oi(s)?s:void 0}}return e.inherit!==!1?n:{}}function Hk(e){const{initial:n,animate:a}=$k(e,v.useContext(Gl));return v.useMemo(()=>({initial:n,animate:a}),[qm(n),qm(a)])}function qm(e){return Array.isArray(e)?e.join(" "):e}const Rf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Xy(e,n,a){for(const s in n)!rn(n[s])&&!Ty(s,a)&&(e[s]=n[s])}function Wk({transformTemplate:e},n){return v.useMemo(()=>{const a=Rf();return Ef(a,n,e),Object.assign({},a.vars,a.style)},[n])}function Kk(e,n){const a=e.style||{},s={};return Xy(s,a,e),Object.assign(s,Wk(e,n)),s}function Yk(e,n){const a={},s=Kk(e,n);return e.drag&&e.dragListener!==!1&&(a.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(a.tabIndex=0),a.style=s,a}const Jy=()=>({...Rf(),attrs:{}});function Gk(e,n,a,s){const o=v.useMemo(()=>{const l=Jy();return Py(l,n,My(s),e.transformTemplate,e.style),{...l.attrs,style:{...l.style}}},[n]);if(e.style){const l={};Xy(l,e.style,e),o.style={...l,...o.style}}return o}const Xk=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Mf(e){return typeof e!="string"||e.includes("-")?!1:!!(Xk.indexOf(e)>-1||/[A-Z]/u.test(e))}function Jk(e,n,a,{latestValues:s},o,l=!1,u){const p=(u??Mf(e)?Gk:Yk)(n,s,o,e),m=Uk(n,typeof e=="string",l),y=e!==v.Fragment?{...m,...p,ref:a}:{},{children:g}=n,b=v.useMemo(()=>rn(g)?g.get():g,[g]);return v.createElement(e,{...y,children:b})}function qk({scrapeMotionValuesFromProps:e,createRenderState:n},a,s,o){return{latestValues:Qk(a,s,o,e),renderState:n()}}function Qk(e,n,a,s){const o={},l=s(e,{});for(const b in l)o[b]=kl(l[b]);let{initial:u,animate:f}=e;const p=Yl(e),m=vy(e);n&&m&&!p&&e.inherit!==!1&&(u===void 0&&(u=n.initial),f===void 0&&(f=n.animate));let y=a?a.initial===!1:!1;y=y||u===!1;const g=y?f:u;if(g&&typeof g!="boolean"&&!Kl(g)){const b=Array.isArray(g)?g:[g];for(let S=0;S<b.length;S++){const C=xf(e,b[S]);if(C){const{transitionEnd:N,transition:j,...L}=C;for(const R in L){let D=L[R];if(Array.isArray(D)){const H=y?D.length-1:0;D=D[H]}D!==null&&(o[R]=D)}for(const R in N)o[R]=N[R]}}}return o}const qy=e=>(n,a)=>{const s=v.useContext(Gl),o=v.useContext(Hl),l=()=>qk(e,n,s,o);return a?l():nf(l)},Zk=qy({scrapeMotionValuesFromProps:Tf,createRenderState:Rf}),e4=qy({scrapeMotionValuesFromProps:Iy,createRenderState:Jy}),t4=Symbol.for("motionComponentSymbol");function n4(e,n,a){const s=v.useRef(a);v.useInsertionEffect(()=>{s.current=a});const o=v.useRef(null);return v.useCallback(l=>{var f;l&&((f=e.onMount)==null||f.call(e,l));const u=s.current;if(typeof u=="function")if(l){const p=u(l);typeof p=="function"&&(o.current=p)}else o.current?(o.current(),o.current=null):u(l);else u&&(u.current=l);n&&(l?n.mount(l):n.unmount())},[n])}const Qy=v.createContext({});function ks(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function r4(e,n,a,s,o,l){var D,H;const{visualElement:u}=v.useContext(Gl),f=v.useContext(Ky),p=v.useContext(Hl),m=v.useContext(Pf),y=m.reducedMotion,g=m.skipAnimations,b=v.useRef(null),S=v.useRef(!1);s=s||f.renderer,!b.current&&s&&(b.current=s(e,{visualState:n,parent:u,props:a,presenceContext:p,blockInitialAnimation:p?p.initial===!1:!1,reducedMotionConfig:y,skipAnimations:g,isSVG:l}),S.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const C=b.current,N=v.useContext(Qy);C&&!C.projection&&o&&(C.type==="html"||C.type==="svg")&&a4(b.current,a,o,N);const j=v.useRef(!1);v.useInsertionEffect(()=>{C&&j.current&&C.update(a,p)});const L=a[iy],R=v.useRef(!!L&&typeof window<"u"&&!((D=window.MotionHandoffIsComplete)!=null&&D.call(window,L))&&((H=window.MotionHasOptimisedAnimation)==null?void 0:H.call(window,L)));return x1(()=>{S.current=!0,C&&(j.current=!0,window.MotionIsMounted=!0,C.updateFeatures(),C.scheduleRenderMicrotask(),R.current&&C.animationState&&C.animationState.animateChanges())}),v.useEffect(()=>{C&&(!R.current&&C.animationState&&C.animationState.animateChanges(),R.current&&(queueMicrotask(()=>{var K;(K=window.MotionHandoffMarkAsComplete)==null||K.call(window,L)}),R.current=!1),C.enteringChildren=void 0)}),C}function a4(e,n,a,s){const{layoutId:o,layout:l,drag:u,dragConstraints:f,layoutScroll:p,layoutRoot:m,layoutAnchor:y,layoutCrossfade:g}=n;e.projection=new a(e.latestValues,n["data-framer-portal-id"]?void 0:Zy(e.parent)),e.projection.setOptions({layoutId:o,layout:l,alwaysMeasureLayout:!!u||f&&ks(f),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:s,crossfade:g,layoutScroll:p,layoutRoot:m,layoutAnchor:y})}function Zy(e){if(e)return e.options.allowProjection!==!1?e.projection:Zy(e.parent)}function Ju(e,{forwardMotionProps:n=!1,type:a}={},s,o){s&&zk(s);const l=a?a==="svg":Mf(e),u=l?e4:Zk;function f(m,y){let g;const b={...v.useContext(Pf),...m,layoutId:s4(m)},{isStatic:S}=b,C=Hk(m),N=u(m,S);if(!S&&typeof window<"u"){i4();const j=o4(b);g=j.MeasureLayout,C.visualElement=r4(e,N,b,o,j.ProjectionNode,l)}return d.jsxs(Gl.Provider,{value:C,children:[g&&C.visualElement?d.jsx(g,{visualElement:C.visualElement,...b}):null,Jk(e,m,n4(N,C.visualElement,y),N,S,n,l)]})}f.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const p=v.forwardRef(f);return p[t4]=e,p}function s4({layoutId:e}){const n=v.useContext(tf).id;return n&&e!==void 0?n+"-"+e:e}function i4(e,n){v.useContext(Ky).strict}function o4(e){const n=Yy(),{drag:a,layout:s}=n;if(!a&&!s)return{};const o={...a,...s};return{MeasureLayout:a!=null&&a.isEnabled(e)||s!=null&&s.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function l4(e,n){if(typeof Proxy>"u")return Ju;const a=new Map,s=(l,u)=>Ju(l,u,e,n),o=(l,u)=>s(l,u);return new Proxy(o,{get:(l,u)=>u==="create"?s:(a.has(u)||a.set(u,Ju(u,void 0,e,n)),a.get(u))})}const c4=(e,n)=>n.isSVG??Mf(e)?new zS(n):new _S(n,{allowProjection:e!==v.Fragment});class u4 extends ja{constructor(n){super(n),n.animationState||(n.animationState=HS(n))}updateAnimationControlsSubscription(){const{animate:n}=this.node.getProps();Kl(n)&&(this.unmountControls=n.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:n}=this.node.getProps(),{animate:a}=this.node.prevProps||{};n!==a&&this.updateAnimationControlsSubscription()}unmount(){var n;this.node.animationState.reset(),(n=this.unmountControls)==null||n.call(this)}}let d4=0;class f4 extends ja{constructor(){super(...arguments),this.id=d4++,this.isExitComplete=!1}update(){var l;if(!this.node.presenceContext)return;const{isPresent:n,onExitComplete:a}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||n===s)return;if(n&&s===!1){if(this.isExitComplete){const{initial:u,custom:f}=this.node.getProps();if(typeof u=="string"){const p=Wa(this.node,u,f);if(p){const{transition:m,transitionEnd:y,...g}=p;for(const b in g)(l=this.node.getValue(b))==null||l.jump(g[b])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!n);a&&!n&&o.then(()=>{this.isExitComplete=!0,a(this.id)})}mount(){const{register:n,onExitComplete:a}=this.node.presenceContext||{};a&&a(this.id),n&&(this.unmount=n(this.id))}unmount(){}}const h4={animation:{Feature:u4},exit:{Feature:f4}};function Gi(e){return{point:{x:e.pageX,y:e.pageY}}}const p4=e=>n=>Sf(n)&&e(n,Gi(n));function Ii(e,n,a,s){return zi(e,n,p4(a),s)}const ex=({current:e})=>e?e.ownerDocument.defaultView:null,Qm=(e,n)=>Math.abs(e-n);function m4(e,n){const a=Qm(e.x,n.x),s=Qm(e.y,n.y);return Math.sqrt(a**2+s**2)}const Zm=new Set(["auto","scroll"]);class tx{constructor(n,a,{transformPagePoint:s,contextWindow:o=window,dragSnapToOrigin:l=!1,distanceThreshold:u=3,element:f}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=S=>{this.handleScroll(S.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ol(this.lastRawMoveEventInfo,this.transformPagePoint));const S=qu(this.lastMoveEventInfo,this.history),C=this.startEvent!==null,N=m4(S.offset,{x:0,y:0})>=this.distanceThreshold;if(!C&&!N)return;const{point:j}=S,{timestamp:L}=nn;this.history.push({...j,timestamp:L});const{onStart:R,onMove:D}=this.handlers;C||(R&&R(this.lastMoveEvent,S),this.startEvent=this.lastMoveEvent),D&&D(this.lastMoveEvent,S)},this.handlePointerMove=(S,C)=>{this.lastMoveEvent=S,this.lastRawMoveEventInfo=C,this.lastMoveEventInfo=ol(C,this.transformPagePoint),yt.update(this.updatePoint,!0)},this.handlePointerUp=(S,C)=>{this.end();const{onEnd:N,onSessionEnd:j,resumeAnimation:L}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&L&&L(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const R=qu(S.type==="pointercancel"?this.lastMoveEventInfo:ol(C,this.transformPagePoint),this.history);this.startEvent&&N&&N(S,R),j&&j(S,R)},!Sf(n))return;this.dragSnapToOrigin=l,this.handlers=a,this.transformPagePoint=s,this.distanceThreshold=u,this.contextWindow=o||window;const p=Gi(n),m=ol(p,this.transformPagePoint),{point:y}=m,{timestamp:g}=nn;this.history=[{...y,timestamp:g}];const{onSessionStart:b}=a;b&&b(n,qu(m,this.history)),this.removeListeners=Wi(Ii(this.contextWindow,"pointermove",this.handlePointerMove),Ii(this.contextWindow,"pointerup",this.handlePointerUp),Ii(this.contextWindow,"pointercancel",this.handlePointerUp)),f&&this.startScrollTracking(f)}startScrollTracking(n){let a=n.parentElement;for(;a;){const s=getComputedStyle(a);(Zm.has(s.overflowX)||Zm.has(s.overflowY))&&this.scrollPositions.set(a,{x:a.scrollLeft,y:a.scrollTop}),a=a.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(n){const a=this.scrollPositions.get(n);if(!a)return;const s=n===window,o=s?{x:window.scrollX,y:window.scrollY}:{x:n.scrollLeft,y:n.scrollTop},l={x:o.x-a.x,y:o.y-a.y};l.x===0&&l.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=l.x,this.lastMoveEventInfo.point.y+=l.y):this.history.length>0&&(this.history[0].x-=l.x,this.history[0].y-=l.y),this.scrollPositions.set(n,o),yt.update(this.updatePoint,!0))}updateHandlers(n){this.handlers=n}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Sa(this.updatePoint)}}function ol(e,n){return n?{point:n(e.point)}:e}function eg(e,n){return{x:e.x-n.x,y:e.y-n.y}}function qu({point:e},n){return{point:e,delta:eg(e,nx(n)),offset:eg(e,g4(n)),velocity:y4(n,.1)}}function g4(e){return e[0]}function nx(e){return e[e.length-1]}function y4(e,n){if(e.length<2)return{x:0,y:0};let a=e.length-1,s=null;const o=nx(e);for(;a>=0&&(s=e[a],!(o.timestamp-s.timestamp>zn(n)));)a--;if(!s)return{x:0,y:0};s===e[0]&&e.length>2&&o.timestamp-s.timestamp>zn(n)*2&&(s=e[1]);const l=Jn(o.timestamp-s.timestamp);if(l===0)return{x:0,y:0};const u={x:(o.x-s.x)/l,y:(o.y-s.y)/l};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}function x4(e,{min:n,max:a},s){return n!==void 0&&e<n?e=s?Nt(n,e,s.min):Math.max(e,n):a!==void 0&&e>a&&(e=s?Nt(a,e,s.max):Math.min(e,a)),e}function tg(e,n,a){return{min:n!==void 0?e.min+n:void 0,max:a!==void 0?e.max+a-(e.max-e.min):void 0}}function v4(e,{top:n,left:a,bottom:s,right:o}){return{x:tg(e.x,a,o),y:tg(e.y,n,s)}}function ng(e,n){let a=n.min-e.min,s=n.max-e.max;return n.max-n.min<e.max-e.min&&([a,s]=[s,a]),{min:a,max:s}}function b4(e,n){return{x:ng(e.x,n.x),y:ng(e.y,n.y)}}function w4(e,n){let a=.5;const s=wn(e),o=wn(n);return o>s?a=Li(n.min,n.max-s,e.min):s>o&&(a=Li(e.min,e.max-o,n.min)),Ir(0,1,a)}function S4(e,n){const a={};return n.min!==void 0&&(a.min=n.min-e.min),n.max!==void 0&&(a.max=n.max-e.min),a}const Ad=.35;function k4(e=Ad){return e===!1?e=0:e===!0&&(e=Ad),{x:rg(e,"left","right"),y:rg(e,"top","bottom")}}function rg(e,n,a){return{min:ag(e,n),max:ag(e,a)}}function ag(e,n){return typeof e=="number"?e:e[n]||0}const j4=new WeakMap;class C4{constructor(n){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Yt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=n}start(n,{snapToCursor:a=!1,distanceThreshold:s}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const l=g=>{a&&this.snapToCursor(Gi(g).point),this.stopAnimation()},u=(g,b)=>{const{drag:S,dragPropagation:C,onDragStart:N}=this.getProps();if(S&&!C&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Z3(S),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tr(L=>{let R=this.getAxisMotionValue(L).get()||0;if(Rr.test(R)){const{projection:D}=this.visualElement;if(D&&D.layout){const H=D.layout.layoutBox[L];H&&(R=wn(H)*(parseFloat(R)/100))}}this.originPoint[L]=R}),N&&yt.update(()=>N(g,b),!1,!0),Pd(this.visualElement,"transform");const{animationState:j}=this.visualElement;j&&j.setActive("whileDrag",!0)},f=(g,b)=>{this.latestPointerEvent=g,this.latestPanInfo=b;const{dragPropagation:S,dragDirectionLock:C,onDirectionLock:N,onDrag:j}=this.getProps();if(!S&&!this.openDragLock)return;const{offset:L}=b;if(C&&this.currentDirection===null){this.currentDirection=E4(L),this.currentDirection!==null&&N&&N(this.currentDirection);return}this.updateAxis("x",b.point,L),this.updateAxis("y",b.point,L),this.visualElement.render(),j&&yt.update(()=>j(g,b),!1,!0)},p=(g,b)=>{this.latestPointerEvent=g,this.latestPanInfo=b,this.stop(g,b),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>{const{dragSnapToOrigin:g}=this.getProps();(g||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:y}=this.getProps();this.panSession=new tx(n,{onSessionStart:l,onStart:u,onMove:f,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:y,distanceThreshold:s,contextWindow:ex(this.visualElement),element:this.visualElement.current})}stop(n,a){const s=n||this.latestPointerEvent,o=a||this.latestPanInfo,l=this.isDragging;if(this.cancel(),!l||!o||!s)return;const{velocity:u}=o;this.startAnimation(u);const{onDragEnd:f}=this.getProps();f&&yt.postRender(()=>f(s,o))}cancel(){this.isDragging=!1;const{projection:n,animationState:a}=this.visualElement;n&&(n.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),a&&a.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(n,a,s){const{drag:o}=this.getProps();if(!s||!ll(n,o,this.currentDirection))return;const l=this.getAxisMotionValue(n);let u=this.originPoint[n]+s[n];this.constraints&&this.constraints[n]&&(u=x4(u,this.constraints[n],this.elastic[n])),l.set(u)}resolveConstraints(){var l;const{dragConstraints:n,dragElastic:a}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(l=this.visualElement.projection)==null?void 0:l.layout,o=this.constraints;n&&ks(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=v4(s.layoutBox,n):this.constraints=!1,this.elastic=k4(a),o!==this.constraints&&!ks(n)&&s&&this.constraints&&!this.hasMutatedConstraints&&Tr(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=S4(s.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:n,onMeasureDragConstraints:a}=this.getProps();if(!n||!ks(n))return!1;const s=n.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const l=ES(s,o.root,this.visualElement.getTransformPagePoint());let u=b4(o.layout.layoutBox,l);if(a){const f=a(jS(u));this.hasMutatedConstraints=!!f,f&&(u=ky(f))}return u}startAnimation(n){const{drag:a,dragMomentum:s,dragElastic:o,dragTransition:l,dragSnapToOrigin:u,onDragTransitionEnd:f}=this.getProps(),p=this.constraints||{},m=Tr(y=>{if(!ll(y,a,this.currentDirection))return;let g=p&&p[y]||{};(u===!0||u===y)&&(g={min:0,max:0});const b=o?200:1e6,S=o?40:1e7,C={type:"inertia",velocity:s?n[y]:0,bounceStiffness:b,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...l,...g};return this.startAxisValueAnimation(y,C)});return Promise.all(m).then(f)}startAxisValueAnimation(n,a){const s=this.getAxisMotionValue(n);return Pd(this.visualElement,n),s.start(yf(n,s,0,a,this.visualElement,!1))}stopAnimation(){Tr(n=>this.getAxisMotionValue(n).stop())}getAxisMotionValue(n){const a=`_drag${n.toUpperCase()}`,s=this.visualElement.getProps(),o=s[a];return o||this.visualElement.getValue(n,(s.initial?s.initial[n]:void 0)||0)}snapToCursor(n){Tr(a=>{const{drag:s}=this.getProps();if(!ll(a,s,this.currentDirection))return;const{projection:o}=this.visualElement,l=this.getAxisMotionValue(a);if(o&&o.layout){const{min:u,max:f}=o.layout.layoutBox[a],p=l.get()||0;l.set(n[a]-Nt(u,f,.5)+p)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:n,dragConstraints:a}=this.getProps(),{projection:s}=this.visualElement;if(!ks(a)||!s||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Tr(u=>{const f=this.getAxisMotionValue(u);if(f&&this.constraints!==!1){const p=f.get();o[u]=w4({min:p,max:p},this.constraints[u])}});const{transformTemplate:l}=this.visualElement.getProps();this.visualElement.current.style.transform=l?l({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),Tr(u=>{if(!ll(u,n,null))return;const f=this.getAxisMotionValue(u),{min:p,max:m}=this.constraints[u];f.set(Nt(p,m,o[u]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;j4.set(this.visualElement,this);const n=this.visualElement.current,a=Ii(n,"pointerdown",m=>{const{drag:y,dragListener:g=!0}=this.getProps(),b=m.target,S=b!==n&&sS(b);y&&g&&!S&&this.start(m)});let s;const o=()=>{const{dragConstraints:m}=this.getProps();ks(m)&&m.current&&(this.constraints=this.resolveRefConstraints(),s||(s=N4(n,m.current,()=>this.scalePositionWithinConstraints())))},{projection:l}=this.visualElement,u=l.addEventListener("measure",o);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),yt.read(o);const f=zi(window,"resize",()=>this.scalePositionWithinConstraints()),p=l.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:y})=>{this.isDragging&&y&&(Tr(g=>{const b=this.getAxisMotionValue(g);b&&(this.originPoint[g]+=m[g].translate,b.set(b.get()+m[g].translate))}),this.visualElement.render())}));return()=>{f(),a(),u(),p&&p(),s&&s()}}getProps(){const n=this.visualElement.getProps(),{drag:a=!1,dragDirectionLock:s=!1,dragPropagation:o=!1,dragConstraints:l=!1,dragElastic:u=Ad,dragMomentum:f=!0}=n;return{...n,drag:a,dragDirectionLock:s,dragPropagation:o,dragConstraints:l,dragElastic:u,dragMomentum:f}}}function sg(e){let n=!0;return()=>{if(n){n=!1;return}e()}}function N4(e,n,a){const s=fm(e,sg(a)),o=fm(n,sg(a));return()=>{s(),o()}}function ll(e,n,a){return(n===!0||n===e)&&(a===null||a===e)}function E4(e,n=10){let a=null;return Math.abs(e.y)>n?a="y":Math.abs(e.x)>n&&(a="x"),a}class T4 extends ja{constructor(n){super(n),this.removeGroupControls=Zn,this.removeListeners=Zn,this.controls=new C4(n)}mount(){const{dragControls:n}=this.node.getProps();n&&(this.removeGroupControls=n.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Zn}update(){const{dragControls:n}=this.node.getProps(),{dragControls:a}=this.node.prevProps||{};n!==a&&(this.removeGroupControls(),n&&(this.removeGroupControls=n.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Qu=e=>(n,a)=>{e&&yt.update(()=>e(n,a),!1,!0)};class P4 extends ja{constructor(){super(...arguments),this.removePointerDownListener=Zn}onPointerDown(n){this.session=new tx(n,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ex(this.node)})}createPanHandlers(){const{onPanSessionStart:n,onPanStart:a,onPan:s,onPanEnd:o}=this.node.getProps();return{onSessionStart:Qu(n),onStart:Qu(a),onMove:Qu(s),onEnd:(l,u)=>{delete this.session,o&&yt.postRender(()=>o(l,u))}}}mount(){this.removePointerDownListener=Ii(this.node.current,"pointerdown",n=>this.onPointerDown(n))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Zu=!1;class R4 extends v.Component{componentDidMount(){const{visualElement:n,layoutGroup:a,switchLayoutGroup:s,layoutId:o}=this.props,{projection:l}=n;l&&(a.group&&a.group.add(l),s&&s.register&&o&&s.register(l),Zu&&l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),jl.hasEverUpdated=!0}getSnapshotBeforeUpdate(n){const{layoutDependency:a,visualElement:s,drag:o,isPresent:l}=this.props,{projection:u}=s;return u&&(u.isPresent=l,n.layoutDependency!==a&&u.setOptions({...u.options,layoutDependency:a}),Zu=!0,o||n.layoutDependency!==a||a===void 0||n.isPresent!==l?u.willUpdate():this.safeToRemove(),n.isPresent!==l&&(l?u.promote():u.relegate()||yt.postRender(()=>{const f=u.getStack();(!f||!f.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:n,layoutAnchor:a}=this.props,{projection:s}=n;s&&(s.options.layoutAnchor=a,s.root.didUpdate(),wf.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:n,layoutGroup:a,switchLayoutGroup:s}=this.props,{projection:o}=n;Zu=!0,o&&(o.scheduleCheckAfterUnmount(),a&&a.group&&a.group.remove(o),s&&s.deregister&&s.deregister(o))}safeToRemove(){const{safeToRemove:n}=this.props;n&&n()}render(){return null}}function rx(e){const[n,a]=Wy(),s=v.useContext(tf);return d.jsx(R4,{...e,layoutGroup:s,switchLayoutGroup:v.useContext(Qy),isPresent:n,safeToRemove:a})}const M4={pan:{Feature:P4},drag:{Feature:T4,ProjectionNode:Hy,MeasureLayout:rx}};function ig(e,n,a){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",a==="Start");const o="onHover"+a,l=s[o];l&&yt.postRender(()=>l(n,Gi(n)))}class I4 extends ja{mount(){const{current:n}=this.node;n&&(this.unmount=tS(n,(a,s)=>(ig(this.node,s,"Start"),o=>ig(this.node,o,"End"))))}unmount(){}}class _4 extends ja{constructor(){super(...arguments),this.isActive=!1}onFocus(){let n=!1;try{n=this.node.current.matches(":focus-visible")}catch{n=!0}!n||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Wi(zi(this.node.current,"focus",()=>this.onFocus()),zi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function og(e,n,a){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",a==="Start");const o="onTap"+(a==="End"?"":a),l=s[o];l&&yt.postRender(()=>l(n,Gi(n)))}class D4 extends ja{mount(){const{current:n}=this.node;if(!n)return;const{globalTapTarget:a,propagate:s}=this.node.props;this.unmount=oS(n,(o,l)=>(og(this.node,l,"Start"),(u,{success:f})=>og(this.node,u,f?"End":"Cancel")),{useGlobalTarget:a,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const Od=new WeakMap,ed=new WeakMap,F4=e=>{const n=Od.get(e.target);n&&n(e)},L4=e=>{e.forEach(F4)};function A4({root:e,...n}){const a=e||document;ed.has(a)||ed.set(a,{});const s=ed.get(a),o=JSON.stringify(n);return s[o]||(s[o]=new IntersectionObserver(L4,{root:e,...n})),s[o]}function O4(e,n,a){const s=A4(n);return Od.set(e,a),s.observe(e),()=>{Od.delete(e),s.unobserve(e)}}const z4={some:0,all:1};class B4 extends ja{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var p;(p=this.stopObserver)==null||p.call(this);const{viewport:n={}}=this.node.getProps(),{root:a,margin:s,amount:o="some",once:l}=n,u={root:a?a.current:void 0,rootMargin:s,threshold:typeof o=="number"?o:z4[o]},f=m=>{const{isIntersecting:y}=m;if(this.isInView===y||(this.isInView=y,l&&!y&&this.hasEnteredView))return;y&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",y);const{onViewportEnter:g,onViewportLeave:b}=this.node.getProps(),S=y?g:b;S&&S(m)};this.stopObserver=O4(this.node.current,u,f)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:n,prevProps:a}=this.node;["amount","margin","root"].some(V4(n,a))&&this.startObserver()}unmount(){var n;(n=this.stopObserver)==null||n.call(this),this.hasEnteredView=!1,this.isInView=!1}}function V4({viewport:e={}},{viewport:n={}}={}){return a=>e[a]!==n[a]}const U4={inView:{Feature:B4},tap:{Feature:D4},focus:{Feature:_4},hover:{Feature:I4}},$4={layout:{ProjectionNode:Hy,MeasureLayout:rx}},H4={...h4,...U4,...M4,...$4},se=l4(H4,c4);function W4(){!Nf.current&&by();const[e]=v.useState(_l.current);return e}/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const K4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Y4=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,a,s)=>s?s.toUpperCase():a.toLowerCase()),lg=e=>{const n=Y4(e);return n.charAt(0).toUpperCase()+n.slice(1)},ax=(...e)=>e.filter((n,a,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===a).join(" ").trim();/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/var G4={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const X4=v.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:o="",children:l,iconNode:u,...f},p)=>v.createElement("svg",{ref:p,...G4,width:n,height:n,stroke:e,strokeWidth:s?Number(a)*24/Number(n):a,className:ax("lucide",o),...f},[...u.map(([m,y])=>v.createElement(m,y)),...Array.isArray(l)?l:[l]]));/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const He=(e,n)=>{const a=v.forwardRef(({className:s,...o},l)=>v.createElement(X4,{ref:l,iconNode:n,className:ax(`lucide-${K4(lg(e))}`,`lucide-${e}`,s),...o}));return a.displayName=lg(e),a};/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const J4=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],q4=He("arrow-right",J4);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Q4=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Z4=He("book-open",Q4);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const e6=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],sx=He("camera",e6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const t6=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],n6=He("check",t6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const r6=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],a6=He("chevron-down",r6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const s6=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],i6=He("chevron-left",s6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const o6=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ix=He("chevron-right",o6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const l6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],c6=He("circle-alert",l6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const u6=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],d6=He("circle-check-big",u6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const f6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],zd=He("circle-check",f6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const h6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ox=He("circle-x",h6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const p6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],m6=He("clock",p6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const g6=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],cg=He("download",g6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const y6=[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]],x6=He("droplets",y6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const v6=[["path",{d:"M14.4 14.4 9.6 9.6",key:"ic80wn"}],["path",{d:"M18.657 21.485a2 2 0 1 1-2.829-2.828l-1.767 1.768a2 2 0 1 1-2.829-2.829l6.364-6.364a2 2 0 1 1 2.829 2.829l-1.768 1.767a2 2 0 1 1 2.828 2.829z",key:"nnl7wr"}],["path",{d:"m21.5 21.5-1.4-1.4",key:"1f1ice"}],["path",{d:"M3.9 3.9 2.5 2.5",key:"1evmna"}],["path",{d:"M6.404 12.768a2 2 0 1 1-2.829-2.829l1.768-1.767a2 2 0 1 1-2.828-2.829l2.828-2.828a2 2 0 1 1 2.829 2.828l1.767-1.768a2 2 0 1 1 2.829 2.829z",key:"yhosts"}]],b6=He("dumbbell",v6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const w6=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],S6=He("file-plus",w6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const k6=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],j6=He("file-text",k6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const C6=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],lx=He("gift",C6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const N6=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],cx=He("image",N6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const E6=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],T6=He("info",E6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const P6=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],R6=He("loader-circle",P6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const M6=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],I6=He("lock",M6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const _6=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],D6=He("log-out",_6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const F6=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],ux=He("message-circle",F6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const L6=[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]],A6=He("mic",L6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const O6=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],z6=He("music",O6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const B6=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],V6=He("newspaper",B6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const U6=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],$6=He("notebook-pen",U6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const H6=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],ug=He("package",H6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const W6=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],K6=He("palette",W6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Y6=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],G6=He("paperclip",Y6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const X6=[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]],J6=He("party-popper",X6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const q6=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],Q6=He("pause",q6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Z6=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],dg=He("pen",Z6);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const e8=[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]],t8=He("phone",e8);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const n8=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Xi=He("play",n8);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const r8=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],If=He("plus",r8);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const a8=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],s8=He("save",a8);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const i8=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],_f=He("send",i8);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const o8=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],l8=He("shield-check",o8);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const c8=[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]],u8=He("shopping-bag",c8);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const d8=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],f8=He("sparkles",d8);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const h8=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],p8=He("sun",h8);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const m8=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],dx=He("trash-2",m8);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const g8=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],y8=He("trending-up",g8);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const x8=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],Df=He("upload",x8);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const v8=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],fx=He("users",v8);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const b8=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],hx=He("video",b8);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const w8=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ds=He("x",w8),px="/assets/0a77244cc5b7dea0bea10275d45df2915d5170ca-B-lUX1TY.png",S8="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdefs%3e%3clinearGradient%20id='phoneGrad'%20x1='26'%20y1='16'%20x2='102'%20y2='112'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFC4FF'/%3e%3cstop%20offset='0.5'%20stop-color='%23D56CFF'/%3e%3cstop%20offset='1'%20stop-color='%238F36EE'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20d='M38.6%2022.7c-2.9.9-5.5%202.8-7.2%205.4-3.3%205-4.9%2012.3-1.5%2023.4%203.7%2012%2011.2%2024.4%2020.8%2034%209.6%209.6%2022%2017.2%2034%2020.8%2011.1%203.4%2018.4%201.8%2023.4-1.5%202.6-1.7%204.5-4.3%205.4-7.2.9-2.9.8-6-.6-8.7l-8.7-16.9a8.3%208.3%200%200%200-10.5-3.9l-10.6%204.1c-1.9.7-4%20.2-5.4-1.2L57%2050.3c-1.4-1.4-1.9-3.5-1.2-5.4l4.1-10.6a8.3%208.3%200%200%200-3.9-10.5l-16.9-8.7a10.5%2010.5%200%200%200-8.7-.6z'%20fill='url(%23phoneGrad)'/%3e%3cpath%20d='M38.6%2022.7c-2.9.9-5.5%202.8-7.2%205.4-3.3%205-4.9%2012.3-1.5%2023.4%203.7%2012%2011.2%2024.4%2020.8%2034%209.6%209.6%2022%2017.2%2034%2020.8%2011.1%203.4%2018.4%201.8%2023.4-1.5%202.6-1.7%204.5-4.3%205.4-7.2.9-2.9.8-6-.6-8.7l-8.7-16.9a8.3%208.3%200%200%200-10.5-3.9l-10.6%204.1c-1.9.7-4%20.2-5.4-1.2L57%2050.3c-1.4-1.4-1.9-3.5-1.2-5.4l4.1-10.6a8.3%208.3%200%200%200-3.9-10.5l-16.9-8.7a10.5%2010.5%200%200%200-8.7-.6z'%20stroke='%23FFD7FF'%20stroke-width='3.25'/%3e%3c/svg%3e",Xl=async()=>{const e=Ya();if(!e)return hr();try{const n=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${e}`},body:JSON.stringify({get_user_profile_function:{}})});if(!n.ok)return hr();const a=await n.json();if(a.state===0&&a.data){const s=JSON.parse(a.data);if(s.profile){const o=JSON.parse(s.profile);if(o&&o.length>0){const l=o[0];return localStorage.setItem("userProfile",JSON.stringify(l)),l}}}return hr()}catch{return hr()}},mx=async e=>{const n=Ya();if(!n)return console.warn("توکن احراز هویت یافت نشد"),!1;try{const a=await fetch(`${nt}/api/save`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)});if(!a.ok){console.warn(`خطا در ذخیره اطلاعات پروفایل: ${a.status}`);const o=hr();if(o){const l={...o,...e.user};localStorage.setItem("userProfile",JSON.stringify(l))}return!1}return(await a.json()).state===0?(await Xl(),!0):!1}catch(a){console.warn("خطا در ذخیره پروفایل:",a);const s=hr();if(s){const o={...s,...e.user};localStorage.setItem("userProfile",JSON.stringify(o))}return!1}},k8=e=>e?!!(e.name&&e.family&&e.education_level&&e.base):!1,hr=()=>{const e=localStorage.getItem("userProfile");if(!e)return null;try{return JSON.parse(e)}catch{return null}},j8=async()=>{const e=Ya();if(!e)return null;try{const n=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${e}`},body:JSON.stringify({get_user_profile_function2:{}})});if(!n.ok)return null;const a=await n.json();if(a.state===0&&a.data){const s=JSON.parse(a.data);return{challenges:s.challenges?JSON.parse(s.challenges):[],coin_transaction:s.coin_transaction?JSON.parse(s.coin_transaction):[],posts:s.posts?JSON.parse(s.posts):[]}}return null}catch{return null}},gx=v.createContext(void 0);function C8({children:e}){const[n,a]=v.useState(hr()),[s,o]=v.useState(!0),l=async()=>{o(!0);const f=await Xl();a(f),o(!1)};v.useEffect(()=>{l()},[]);const u=k8(n);return d.jsx(gx.Provider,{value:{profile:n,isProfileComplete:u,isLoading:s,refreshProfile:l},children:e})}function mr(){const e=v.useContext(gx);if(!e)throw new Error("useProfile must be used within ProfileProvider");return e}const N8=async e=>{const n=Ya();n&&fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify({user_log_function:{page_title:e}})}).catch(a=>{console.debug("Page log failed:",a)})},yx=v.createContext(null);function E8({children:e}){const[n,a]=v.useState(null),s=v.useRef(null),o=v.useRef(!0);return v.useEffect(()=>(o.current=!0,s.current=setInterval(()=>{o.current&&n&&!document.hidden&&N8(n)},1e4),()=>{o.current=!1,s.current&&clearInterval(s.current)}),[n]),d.jsx(yx.Provider,{value:{currentPage:n,setCurrentPage:a},children:e})}function T8(){const e=v.useContext(yx);if(!e)throw new Error("usePageTrackingContext must be used within PageTrackingProvider");return e}function gr(e){const{setCurrentPage:n}=T8();v.useEffect(()=>(n(e),()=>{n(null)}),[e,n])}const P8=async()=>{const e=Ya();if(!e)return{inbox:[],unreadCount:0};try{const a=await(await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${e}`},body:JSON.stringify({get_inbox_function:{}})})).json();if(a.state===0&&a.data){const s=JSON.parse(a.data),o=s.inbox?JSON.parse(s.inbox):[],l=o.filter(u=>u.status==="خوانده نشده").length;return{inbox:o,unreadCount:l}}return{inbox:[],unreadCount:0}}catch(n){return console.error("Error loading inbox:",n),{inbox:[],unreadCount:0}}},R8=async e=>{const n=Ya();!n||e.length===0||fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify({read_inbox_function:{stage_ids:e.join(",")}})}).catch(a=>{console.debug("Mark as read failed:",a)})},xx=v.createContext(null);function M8({children:e}){const[n,a]=v.useState([]),[s,o]=v.useState(0),[l,u]=v.useState(!1),f=v.useCallback(async()=>{u(!0);try{const m=await P8();a(m.inbox),o(m.unreadCount)}catch(m){console.error("Failed to refresh inbox:",m)}finally{u(!1)}},[]),p=v.useCallback(m=>{m.length!==0&&(a(y=>y.map(g=>m.includes(String(g.stageID))?{...g,status:"خوانده شده"}:g)),o(y=>Math.max(0,y-m.length)),R8(m))},[]);return v.useEffect(()=>{f()},[f]),d.jsx(xx.Provider,{value:{messages:n,unreadCount:s,loading:l,refreshInbox:f,markMessagesAsRead:p},children:e})}function Ji(){const e=v.useContext(xx);if(!e)throw new Error("useInbox must be used within InboxProvider");return e}const I8="/assets/login-new-bg-x9sSRPsV.png",_8="/assets/home-bg-C3pbIsUx.jpg",D8="/assets/All%20BG-Bxd0STfA.jpg",Er=D8,mn={login:I8,home:_8,profile:Er,editProfile:Er,magicBag:Er,messages:Er,publicChat:Er,feed:Er,challenges:Er,chatbot:Er,submitChallenge:Er};function F8(e){return e==="/"?mn.home:e.startsWith("/profile")?mn.profile:e.startsWith("/edit-profile")?mn.editProfile:e.startsWith("/magic-bag")?mn.magicBag:e.startsWith("/messages")?mn.messages:e.startsWith("/public-chat")?mn.publicChat:Er}const fg=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],L8=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],cl=5;function A8(){const e=an(),n=Gt(),{refreshProfile:a}=mr(),{refreshInbox:s}=Ji();gr("ورود");const[o,l]=v.useState(""),[u,f]=v.useState(""),[p,m]=v.useState("phone"),[y,g]=v.useState(!1),[b,S]=v.useState(0),[C,N]=v.useState(""),[j,L]=v.useState(!1),R=v.useRef(null),D=v.useRef(null),H=v.useRef(null),K=v.useRef(!1);if(v.useEffect(()=>{var B;(B=n.state)!=null&&B.error&&(N(n.state.error),window.history.replaceState({},document.title))},[n]),v.useEffect(()=>{if(p==="code"&&R.current){const B=setTimeout(()=>{var _;(_=R.current)==null||_.focus()},100);return()=>clearTimeout(B)}},[p]),v.useEffect(()=>{if(p==="phone"&&D.current){const B=setTimeout(()=>{var _;(_=D.current)==null||_.focus()},100);return()=>clearTimeout(B)}},[p]),v.useEffect(()=>{p==="code"&&u.length===5&&!y&&!K.current&&(K.current=!0,Y()),u.length<5&&(K.current=!1)},[u,p,y]),v.useEffect(()=>()=>{H.current&&(clearInterval(H.current),H.current=null)},[]),g1()&&!j)return d.jsx(u1,{to:"/",replace:!0});const re=B=>{let _=B;return fg.forEach((X,J)=>{_=_.replace(new RegExp(X,"g"),J.toString())}),L8.forEach((X,J)=>{_=_.replace(new RegExp(X,"g"),J.toString())}),_},O=B=>B.replace(/\d/g,_=>fg[parseInt(_,10)]),w=()=>{H.current&&(clearInterval(H.current),H.current=null)},M=()=>{w(),S(120),H.current=setInterval(()=>{S(B=>B<=1?(w(),0):B-1)},1e3)},E=async B=>{const _=await fetch(`${nt}/api/SignUpLoginBySMS`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(B)}),X=await _.json();return{response:_,result:X}},U=async B=>{B.preventDefault(),g(!0),N("");try{const _=re(o),{response:X,result:J}=await E(_);X.ok&&J.state===0?(m("code"),f(""),K.current=!1,M()):N(J.message||"خطا در ارسال کد تایید")}catch(_){console.error("Error sending code:",_),N("خطا در برقراری ارتباط با سرور")}finally{g(!1)}},Y=async B=>{B==null||B.preventDefault(),g(!0),N("");try{const _=re(o),X=re(u),J=await fetch(`${nt}/api/verifyloginbysms`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mobile:_,code:X})}),T=await J.json();if(J.ok&&T.state===0){L(!0);const A=JSON.parse(T.data);localStorage.setItem("accessToken",A.Token.AccessToken),localStorage.setItem("refreshToken",A.Token.RefreshToken),localStorage.setItem("userId",A.Person.ID.toString()),localStorage.setItem("username",A.Person.ID.toString()),localStorage.setItem("userInfo",JSON.stringify(A.Person)),await a(),await s(),setTimeout(()=>{sessionStorage.setItem("homeEntranceFromLogin","1"),e("/",{replace:!0})},1250)}else K.current=!1,N(T.message||"کد تایید اشتباه است")}catch(_){console.error("Error verifying code:",_),K.current=!1,N("خطا در برقراری ارتباط با سرور")}finally{g(!1)}},I=async()=>{g(!0),N("");try{const B=re(o),{response:_,result:X}=await E(B);_.ok&&X.state===0?(f(""),K.current=!1,M()):N(X.message||"خطا در ارسال مجدد کد")}catch(B){console.error("Error resending code:",B),N("خطا در برقراری ارتباط با سرور")}finally{g(!1)}},W=B=>{const _=Math.floor(B/60),X=B%60;return`${_}:${X.toString().padStart(2,"0")}`},Q=()=>{m("phone"),f(""),S(0),N(""),K.current=!1,w()},G=(B,_,X)=>{const J=B.split("");for(;J.length<cl;)J.push("");return J[_]=X,J.join("").slice(0,cl)};return d.jsxs("div",{className:"relative h-[100dvh] overflow-hidden",style:{backgroundImage:`url(${mn.login})`,backgroundSize:"cover",backgroundPosition:"center -90px",backgroundRepeat:"no-repeat",backgroundColor:"#10053a"},children:[d.jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg, rgba(22, 10, 62, 0.38) 0%, rgba(24, 10, 64, 0.32) 38%, rgba(22, 8, 58, 0.74) 100%)"}}),d.jsx(gn,{children:j&&d.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5,ease:"easeInOut"},className:"absolute inset-0 z-50 flex items-center justify-center px-8",style:{background:"radial-gradient(circle at 50% 35%, rgba(195, 114, 255, 0.32) 0%, rgba(53, 22, 102, 0.9) 42%, rgba(19, 8, 54, 0.98) 100%)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:d.jsxs(se.div,{initial:{opacity:0,y:14,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.62,ease:[.25,.1,.25,1]},className:"w-full max-w-[280px] rounded-3xl border border-white/20 bg-white/10 p-5 text-center shadow-[0_12px_32px_rgba(0,0,0,0.35)]",children:[d.jsx(se.div,{className:"mx-auto mb-3 h-10 w-10 rounded-full border-2 border-white/25 border-t-white",animate:{rotate:360},transition:{duration:.9,repeat:1/0,ease:"linear"}}),d.jsx("p",{className:"text-base font-semibold text-white",children:"در حال ورود به همدست..."}),d.jsx(se.div,{className:"mx-auto mt-4 h-1.5 w-full overflow-hidden rounded-full bg-white/15",initial:!1,children:d.jsx(se.div,{className:"h-full rounded-full",style:{background:"linear-gradient(90deg, rgba(255,139,91,1) 0%, rgba(238,91,166,1) 45%, rgba(147,78,255,1) 100%)"},initial:{x:"-100%"},animate:{x:"100%"},transition:{duration:1.4,repeat:1/0,ease:"easeInOut"}})})]})})}),d.jsxs("div",{className:"relative z-10 mx-auto flex h-full w-full max-w-[430px] flex-col px-6 pb-8 pt-8 sm:px-7",dir:"rtl",children:[d.jsxs("div",{className:"text-center",children:[d.jsx("img",{src:px,alt:"همدست",className:"mx-auto h-16 w-auto object-contain"}),d.jsx("p",{className:"mt-1 text-xl font-medium text-white",children:"خوش آمدی قهرمان!"})]}),d.jsxs("section",{className:"mt-auto",children:[d.jsx(gn,{mode:"wait",initial:!1,children:d.jsxs(se.div,{initial:{opacity:0,y:8,scale:.985,filter:"blur(5px)"},animate:{opacity:1,y:0,scale:1,filter:"blur(0px)"},exit:{opacity:0,y:-8,scale:1.015,filter:"blur(5px)"},transition:{duration:.42,ease:[.25,.1,.25,1]},className:"origin-center",children:[d.jsx("h2",{className:"text-center text-[24px] font-bold leading-tight text-white",children:"ورود به حساب کاربری"}),d.jsx("p",{className:"mt-1 text-center text-base text-[#eadfff]",children:p==="phone"?"شماره تلفن خود را وارد کنید":"کد تایید ارسال شده را وارد کنید"})]},`login-copy-${p}`)}),d.jsxs("form",{onSubmit:p==="phone"?U:Y,className:"mt-4 space-y-4",children:[C&&d.jsx("div",{className:"rounded-2xl border border-red-400/40 bg-red-500/20 p-3 text-center text-sm text-red-100",children:C}),d.jsx(gn,{mode:"wait",initial:!1,children:p==="phone"?d.jsx(se.div,{initial:{opacity:0,y:8,filter:"blur(4px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},exit:{opacity:0,y:-8,filter:"blur(4px)"},transition:{duration:.38,ease:"easeInOut"},children:d.jsxs("div",{className:"flex h-14 items-center rounded-full border border-[#d680ff66] px-4",style:{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",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)"},dir:"ltr",children:[d.jsxs("button",{type:"button",className:"flex items-center gap-1 text-lg text-white/90",children:[d.jsx("span",{children:"+۹۸"}),d.jsx(a6,{size:16})]}),d.jsx("div",{className:"mx-3 h-7 w-px bg-white/30"}),d.jsx("input",{id:"phone",type:"tel",inputMode:"numeric",value:O(o),onChange:B=>l(re(B.target.value)),className:"w-full bg-transparent text-left text-lg text-white outline-none placeholder:text-lg placeholder:text-white/45",placeholder:"۹۱۲ ۱۲۳ ۴۵۶۷",required:!0,ref:D}),d.jsx("img",{src:S8,alt:"تلفن",className:"ml-2 h-5 w-5 object-contain opacity-100"})]})},"phone-step"):d.jsxs(se.div,{initial:{opacity:0,y:8,filter:"blur(4px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},exit:{opacity:0,y:-8,filter:"blur(4px)"},transition:{duration:.38,ease:"easeInOut"},children:[d.jsxs("div",{className:"mx-auto mb-2 flex w-[16.5rem] items-center justify-between text-sm text-white/80",children:[d.jsxs("button",{type:"button",onClick:Q,className:"flex items-center gap-1 text-[#ffcf7e]",children:[d.jsx(ix,{size:14}),d.jsx("span",{children:"ویرایش شماره تلفن"})]}),d.jsx("span",{children:O(o)})]}),d.jsx("div",{className:"flex justify-center gap-1.5",dir:"ltr",children:Array.from({length:cl},(B,_)=>d.jsx("input",{type:"tel",inputMode:"numeric",pattern:"[0-9]*",maxLength:1,value:O(u[_]||""),onChange:X=>{var T;const J=re(X.target.value);if(J.match(/^[0-9]$/)){if(f(G(u,_,J)),_<cl-1){const A=(T=X.target.parentElement)==null?void 0:T.children[_+1];A==null||A.focus()}}else X.target.value===""&&f(G(u,_,""))},onKeyDown:X=>{var J;if(X.key==="Backspace"){if(u[_])f(G(u,_,""));else if(_>0){f(G(u,_-1,""));const T=(J=X.currentTarget.parentElement)==null?void 0:J.children[_-1];T==null||T.focus()}}},className:"h-13 w-13 rounded-xl border border-[#d680ff66] bg-[#2f1b59]/85 text-center text-2xl text-white outline-none",ref:_===0?R:void 0},_))}),d.jsx("div",{className:"mx-auto w-[16.5rem]",children:d.jsx("button",{type:"button",onClick:I,className:"mt-3 text-sm text-[#f7dcff] disabled:opacity-55",disabled:b>0||y,children:b>0?`ارسال دوباره کد (${W(b)})`:"ارسال دوباره کد"})})]},"code-step")}),d.jsx(se.button,{whileTap:{scale:.985},whileHover:{scale:1.01},type:"submit",disabled:y,className:"h-14 w-full rounded-full border border-transparent text-lg font-bold text-white",style:{backgroundImage:"linear-gradient(90deg, rgba(255,139,91,1) 0%, rgba(238,91,166,1) 45%, rgba(147,78,255,1) 100%), linear-gradient(120deg, #7c3aed 0%, #f97316 58%, #facc15 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 10px 26px rgba(196, 87, 255, 0.35), inset 0 1px 0 rgba(255,255,255,0.35)"},children:y?"در حال پردازش...":p==="phone"?"دریافت کد تایید":"تایید و ورود"})]}),d.jsx("div",{className:"mt-8 rounded-2xl border border-[#db8bff44] bg-[#3a1f67]/48 p-4",children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(l8,{className:"h-6 w-6 text-[#f1c0ff]"}),d.jsx("p",{className:"text-sm text-white sm:text-base",children:"اطلاعات شما با استانداردهای ایمنی نرمافزار محافظت میشود."})]})})]})]})]})}const O8="modulepreload",z8=function(e){return"/"+e},hg={},B8=function(n,a,s){let o=Promise.resolve();if(a&&a.length>0){let u=function(m){return Promise.all(m.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),p=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));o=u(a.map(m=>{if(m=z8(m),m in hg)return;hg[m]=!0;const y=m.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":O8,y||(b.as="script"),b.crossOrigin="",b.href=m,p&&b.setAttribute("nonce",p),document.head.appendChild(b),y)return new Promise((S,C)=>{b.addEventListener("load",S),b.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return o.then(u=>{for(const f of u||[])f.status==="rejected"&&l(f.reason);return n().catch(l)})},Ft=()=>{const e=localStorage.getItem("accessToken");return e||localStorage.getItem("authToken")},V8=()=>localStorage.getItem("userId"),vx=e=>{let n=e.message||"خطا در عملیات";return e.data&&typeof e.data=="string"&&/[\u0600-\u06FF]/.test(e.data)&&e.data!==e.message&&(n=`${n}
|
||
${e.data}`),n},U8=e=>{try{const n=JSON.parse(e);return JSON.parse(n.feed||"[]")}catch(n){return console.error("Error parsing feed data:",n),[]}},$8=async(e,n=1)=>{const a=Ft();if(!a)return{success:!1,data:[],message:"توکن موجود نیست"};try{const o=await(await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${a}`},body:JSON.stringify({load_feeds_function:{mission_type:e,page_number:n.toString()}})})).json();return o.resultType!==0?{success:!1,data:[],message:o.message}:{success:!0,data:U8(o.data)}}catch(s){return console.error("Error loading feeds:",s),{success:!1,data:[],message:"خطا در بارگذاری فید"}}},Ts=e=>{const n=Ft();return`${nt}/api/getimage?stageID=${e}&nameOrID=image&token=${n}`},Ol=(e,n)=>{const a=Ft();return`${nt}/api/getimage?stageID=${n}&nameOrID=image&token=${a}`},Rs=e=>{const n=Ft();return`${nt}/api/getimage?stageID=${e}&nameOrID=image&token=${n}`},bx=e=>{const n=Ft();return`${nt}/api/getFile?stageID=${e}&nameOrID=film&token=${n}`},wx=e=>{const n=Ft();return`${nt}/api/getFile?stageID=${e}&nameOrID=audio&token=${n}`},H8=e=>V8()===e,pg=async(e,n,a)=>{const s=Ft();if(!s){console.error("No auth token found");return}try{fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${s}`},body:JSON.stringify({like_dislike_function:{kind:e,mission_type:n,mission_done_workflowID:a}})}).catch(o=>{console.error("Error submitting like/dislike:",o)})}catch(o){console.error("Error in submitLikeDislike:",o)}},W8=async(e,n)=>{const a=Ft();if(!a){console.error("No auth token found");return}try{fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${a}`},body:JSON.stringify({delete_done_mission_function:{mission_done_workflowID:n,mission_type:e}})}).catch(s=>{console.error("Error deleting post:",s)})}catch(s){console.error("Error in deletePost:",s)}},K8=async(e,n,a,s="")=>{const o=Ft();if(!o){console.error("No auth token found");return}try{fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${o}`},body:JSON.stringify({save_comment_function:{mission_type:e,mission_done_workflowID:n,text:a,replay_workflowID:s}})}).catch(l=>{console.error("Error saving comment:",l)})}catch(l){console.error("Error in saveComment:",l)}},Y8=async e=>{const n=Ft();if(!n)return console.error("No auth token found"),!1;try{const a=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify({delete_comment_function:{comment_id:e}})});return a.ok?(await a.json()).state===0:(console.error("Failed to delete comment"),!1)}catch(a){return console.error("Error deleting comment:",a),!1}},G8=async(e,n=1)=>{const a=Ft();if(!a)return console.error("No auth token found"),{comments:[]};try{const s=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${a}`},body:JSON.stringify({load_comments_function:{mission_done_workflowID:e,page_number:n.toString()}})}),o=await s.json();if(s.ok&&o.state===0){const l=JSON.parse(o.data);return{comments:JSON.parse(l.comments)}}else return console.error("Error loading comments:",o.message),{comments:[]}}catch(s){return console.error("Error in loadComments:",s),{comments:[]}}},X8=async e=>{const n=Ft();if(!n)return console.error("No auth token found"),{missions:[]};try{const a=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify({load_missions_function:{mission_type:e}})}),s=await a.json();if(a.ok&&s.state===0){const o=JSON.parse(s.data);return{missions:JSON.parse(o.missions)}}else return console.error("Error loading missions:",s.message),{missions:[]}}catch(a){return console.error("Error in loadMissions:",a),{missions:[]}}},J8=e=>{const n=Ft();return n?`${nt}/api/getimage?stageID=${e}&nameOrID=image&token=${n}`:(console.error("No auth token found for mission image"),"")},Sx=async(e,n)=>{const a=Ft();if(!a)return console.error("No auth token found"),{doing_mission:null,chats:[]};try{const s=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${a}`},body:JSON.stringify({start_mission_function:{mission_type:e,mission_id:n}})}),o=await s.json();if(s.ok&&o.state===0){const l=JSON.parse(o.data),u=JSON.parse(l.doing_mission),f=JSON.parse(l.chats);return{doing_mission:u.length>0?u[0]:null,chats:f}}else return console.error("Error starting mission:",o.message),{doing_mission:null,chats:[]}}catch(s){return console.error("Error in startMission:",s),{doing_mission:null,chats:[]}}},q8=async(e,n)=>{const a=Ft();if(console.log("sendChatMessage API called:",{userMessage:e,missionDoneWorkflowID:n,hasToken:!!a}),!a)return console.error("No auth token found"),{success:!1};try{const s={chat_service_function:{user_message:e,mission_done_workflowID:n}};console.log("Sending chat request to server:",JSON.stringify(s));const o=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${a}`},body:JSON.stringify(s)}),l=await o.json();if(o.ok&&l.state===0){const u=JSON.parse(l.data),f=Object.keys(u);if(f.length>0){const p=JSON.parse(u[f[0]]);return{success:!0,message:p.message,actions:p.actions,is_mission_end:p.is_mission_end}}return{success:!1}}else return console.error("Error sending chat message:",l.message),{success:!1}}catch(s){return console.error("Error in sendChatMessage:",s),{success:!1}}},kx=async e=>{const n=Ft();if(!n)return console.error("No auth token found"),null;try{const a=new FormData;a.append("file",e);const s=new AbortController,o=setTimeout(()=>s.abort(),3e5),l=await fetch(`${nt}/api/UploadFile`,{method:"POST",headers:{Authorization:`Bearer ${n}`},body:a,signal:s.signal});clearTimeout(o);const u=await l.json();return l.ok&&u.state===0?u.data||null:(console.error("Error uploading file:",u.message),null)}catch(a){return a instanceof Error&&a.name==="AbortError"?console.error("Error in uploadFile: Request timeout after 5 minutes"):console.error("Error in uploadFile:",a),null}},Fs=async e=>{const n=Ft();if(!n)return console.error("uploadImage: No auth token found"),null;try{console.log("uploadImage: Starting upload for file:",e.name,"size:",e.size);const{resizeImage:a}=await B8(async()=>{const{resizeImage:m}=await import("./imageResize-7aJ4C0Tb.js");return{resizeImage:m}},[]);let s=e;try{console.log("uploadImage: Resizing image..."),s=await a(e),console.log("uploadImage: Image resized successfully")}catch(m){console.warn("uploadImage: Failed to resize image, uploading original:",m),s=e}const o=new FormData;o.append("file",s),console.log("uploadImage: Sending request to:",`${nt}/api/UploadImage`),console.log("uploadImage: Token:",n.substring(0,20)+"...");const l=new AbortController,u=setTimeout(()=>l.abort(),3e5),f=await fetch(`${nt}/api/UploadImage`,{method:"POST",headers:{Authorization:`Bearer ${n}`},body:o,signal:l.signal});clearTimeout(u),console.log("uploadImage: Response status:",f.status),console.log("uploadImage: Response ok:",f.ok);const p=await f.json();return console.log("uploadImage: Response data:",JSON.stringify(p)),f.ok&&p.state===0?(console.log("uploadImage: Success! Filename:",p.data),p.data||null):(console.error("uploadImage: Error - Message:",p.message,"State:",p.state),null)}catch(a){return a instanceof Error&&a.name==="AbortError"?console.error("Error in uploadImage: Request timeout after 5 minutes"):console.error("Error in uploadImage:",a),null}},Jl=async e=>{const n=Ft();if(!n)return console.error("No auth token found"),{success:!1,message:"توکن احراز هویت یافت نشد"};try{const a={do_mission_function:{title:e.title||"",mission_type:e.mission_type||"",mission_done_workflowID:e.mission_done_workflowID||"",description:e.description||"",film:e.film||"",image:e.image||"",audio:e.audio||"",team_member:e.team_member||""}};e.enter_code&&(a.do_mission_function.enter_code=e.enter_code);const s=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify(a)}),o=await s.json();if(s.ok&&o.state===0)return{success:!0,message:"ماموریت با موفقیت ثبت شد"};{const l=vx(o);return console.error("Error submitting mission:",l),{success:!1,message:l}}}catch(a){return console.error("Error in submitMission:",a),{success:!1,message:"خطا در ارتباط با سرور"}}},Q8=async(e,n)=>{const a=Ft();if(!a)return console.error("No auth token found"),{success:!1,message:"توکن احراز هویت یافت نشد"};try{const s=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${a}`},body:JSON.stringify({supervisor_registration_function:{mission_done_workflowID:n,mobile:e}})}),o=await s.json();if(s.ok&&o.state===0)return{success:!0,message:"کد با موفقیت ارسال شد"};{const l=vx(o);return console.error("Error sending supervisor code:",l),{success:!1,message:l}}}catch(s){return console.error("Error in sendSupervisorCode:",s),{success:!1,message:"خطا در ارتباط با سرور"}}},Z8=async()=>{const e=Ft();if(!e)return console.error("No auth token found"),{success:!1,data:[],message:"توکن موجود نیست"};try{const a=await(await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${e}`},body:JSON.stringify({load_magic_bag_mission_function:{}})})).json();if(a.state===0&&a.data){const s=JSON.parse(a.data);return{success:!0,data:JSON.parse(s.magic_bag).filter(u=>u.magic_bag_title)}}else return{success:!1,data:[],message:a.message||"خطا در بارگذاری ماموریتها"}}catch(n){return console.error("Error loading magic bag missions:",n),{success:!1,data:[],message:"خطا در بارگذاری ماموریتهای کیف جادویی"}}},td=e=>{const n=Ft();return`${nt}/api/getfile?stageID=${e}&nameOrID=magic_bag_file&token=${n}`},ej=e=>{if(!e)return!1;const n=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg"],a=e.toLowerCase();return n.some(s=>a.endsWith(s))},jx=async e=>{const n=Ft();if(!n)return console.error("No auth token found"),{success:!1,data:[],message:"توکن موجود نیست"};try{const s=await(await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify({load_team_member_function:{team_member:e}})})).json();if(s.state===0&&s.data){const o=JSON.parse(s.data);return{success:!0,data:JSON.parse(o.team_members)}}else return{success:!1,data:[],message:s.message||"خطا در بارگذاری اعضای تیم"}}catch(a){return console.error("Error loading team members:",a),{success:!1,data:[],message:"خطا در بارگذاری اعضای تیم"}}},tj="/assets/coin-star-ZXR71mmp.png",qn="/assets/image%205-OPfS95Ik.png",nj=e=>{if(e==null)return"۰";const n="۰۱۲۳۴۵۶۷۸۹";return String(e).replace(/\d/g,a=>n[parseInt(a,10)])};function Ff({showBack:e=!1,onBack:n,centerTitle:a,centerSubtitle:s}){const o=an(),{profile:l}=mr(),[u,f]=v.useState(()=>{const g=hr();return(g==null?void 0:g.coin_count)??0});v.useEffect(()=>{(l==null?void 0:l.coin_count)!==null&&(l==null?void 0:l.coin_count)!==void 0&&f(l.coin_count)},[l]);const p=!!(l!=null&&l.image&&(l!=null&&l.user_stage_id)),m=v.useMemo(()=>p?Ol(l.image,l.user_stage_id):qn,[p,l==null?void 0:l.image,l==null?void 0:l.user_stage_id]),y={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",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)"};return d.jsxs("div",{className:"relative z-20 flex items-center justify-between px-4 pt-3 pb-2",dir:"rtl",children:[e?d.jsx("button",{onClick:n,className:"w-11 h-11 rounded-full flex items-center justify-center border-[0.5px] border-transparent","aria-label":"بازگشت",style:y,children:d.jsx(ix,{size:22,color:"#ffffff"})}):d.jsx("button",{onClick:()=>o("/profile"),className:"relative w-12 h-12 rounded-full p-[2px] border-[0.5px] border-transparent overflow-hidden","aria-label":"پروفایل",style:y,children:p?d.jsx("img",{src:m,alt:"پروفایل",className:"w-full h-full rounded-full object-cover",onError:g=>{g.currentTarget.src=qn}}):d.jsx("div",{className:"w-full h-full rounded-full flex items-center justify-center",style:y,children:d.jsx("img",{src:qn,alt:"پروفایل پیشفرض",className:" object-cover rounded-full"})})}),d.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 top-2 pointer-events-none text-center",children:a?d.jsxs("div",{className:"leading-none",children:[d.jsx("div",{className:"font-extrabold text-[31px]",style:{background:"linear-gradient(90deg, #ff8ccf 0%, #ff6dbe 32%, #f88bd4 100%)",WebkitBackgroundClip:"text",backgroundClip:"text",color:"transparent",textShadow:"0 2px 10px rgba(255, 119, 202, 0.4)"},children:a}),s&&d.jsx("div",{className:"mt-1 text-[12px] font-medium",style:{color:"#ffb7dd",textShadow:"0 1px 6px rgba(255, 119, 202, 0.35)"},children:s})]}):d.jsx("img",{src:px,alt:"مدرسه",className:"h-12 object-contain",style:{filter:"drop-shadow(0 2px 6px rgba(192, 132, 252, 0.55))"}})}),d.jsxs("div",{className:"relative h-10 w-fit rounded-full px-2.5 flex items-center gap-[6px] border-[0.5px] border-transparent",style:y,children:[d.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center border-[0.5px] border-transparent",style:y,children:d.jsx(If,{size:11,color:"#ffd6f0",strokeWidth:2.25})}),d.jsx("span",{className:"font-semibold leading-none text-white tracking-tight",style:{fontSize:16},children:nj(u)}),d.jsx("img",{src:tj,alt:"سکه",className:"w-7 h-7 object-contain -my-0.5"})]})]})}function rj({showBack:e=!1,onBack:n}){return d.jsx("header",{className:"app-header",children:d.jsx(Ff,{showBack:e,onBack:n})})}const Cx=v.createContext(void 0);function aj({children:e}){const[n,a]=v.useState(!1),s=()=>{a(!0)},o=()=>{a(!1)};return d.jsx(Cx.Provider,{value:{hasNewItem:n,setHasNewItem:a,addNewItem:s,clearBadge:o},children:e})}function Nx(){const e=v.useContext(Cx);if(!e)throw new Error("useMagicBag must be used within MagicBagProvider");return e}const sj="/assets/nav-icon-profile-Czwx6ScU.png",ij="/assets/nav-icon-chatbot-CvcoiN6a.png",oj="/assets/nav-icon-bag-BCVFWePV.png",lj="/assets/nav-icon-home-Bhtms1mp.png",cj="/assets/nav-icon-bell-Dd2R6-kz.png",uj=[{id:"chatbot",label:"چت با ربات",path:"/public-chat",icon:ij},{id:"magic-bag",label:"کیف جادویی",path:"/magic-bag",icon:oj},{id:"home",label:"خانه",path:"/",icon:lj},{id:"messages",label:"اعلانها",path:"/messages",icon:cj},{id:"profile",label:"پروفایل",path:"/profile",icon:sj}],dj="drop-shadow(0 0 8px rgba(255, 104, 205, 0.55)) drop-shadow(0 0 14px rgba(255, 104, 205, 0.2))",fj="drop-shadow(0 3px 6px rgba(0, 0, 0, 0.34))",hj="radial-gradient(ellipse at center, rgba(255, 106, 207, 0.22) 0%, rgba(255, 106, 207, 0.08) 56%, transparent 100%)",pj=e=>{if(e>99)return"۹۹+";const n="۰۱۲۳۴۵۶۷۸۹";return String(e).replace(/\d/g,a=>n[parseInt(a,10)])},mj=(e,n,a)=>e==="home"?a==="/":e==="chatbot"?a==="/public-chat"||a.startsWith("/chatbot"):e==="profile"?a==="/profile"||a==="/edit-profile":a===n;function Ga({fixed:e=!0}){const n=Gt(),{hasNewItem:a,clearBadge:s}=Nx(),{unreadCount:o}=Ji();return d.jsx("div",{className:e?"app-bottom-nav pointer-events-none fixed bottom-0 left-0 right-0 z-50 w-full transition-opacity duration-200":"bottom-nav app-bottom-nav pointer-events-none w-full transition-opacity duration-200",children:d.jsx("nav",{className:"pointer-events-auto relative mx-auto w-full max-w-[392px] px-1","aria-label":"ناوبری اصلی",style:{paddingBottom:"calc(env(safe-area-inset-bottom, 0px) + 8px)"},children:d.jsx("div",{className:"relative h-[86px] rounded-[999px] border-[0.5px] border-transparent px-1",style:{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",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)"},children:d.jsx("div",{className:"relative mx-auto grid h-full w-[calc(100%-14px)] grid-cols-5 items-start pt-1.5",dir:"ltr",children:uj.map(l=>{const u=l.id==="magic-bag",f=l.id==="messages"&&o>0;return d.jsx(p1,{to:l.path,end:l.path==="/",onClick:()=>{u&&a&&s()},className:"relative flex h-full min-w-0 flex-col items-center justify-start pb-1 pt-0.5 outline-none","aria-label":l.label,dir:"rtl",children:({isActive:p})=>{const m=p||mj(l.id,l.path,n.pathname);return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"relative",children:[d.jsxs("div",{className:"relative flex h-[37px] w-[37px] items-center justify-center",style:{filter:m?dj:fj},children:[d.jsx("img",{src:l.icon,alt:"",className:"h-[37px] w-[37px] object-contain",style:{opacity:m?1:.92}}),u&&a&&d.jsx("span",{className:"absolute -right-0.5 top-0.5 h-3 w-3 rounded-full border border-white",style:{background:"linear-gradient(135deg, #ff4d66 0%, #d7193f 100%)",boxShadow:"0 0 10px rgba(255, 57, 92, 0.8)"}}),f&&d.jsx("span",{className:"absolute -right-2 -top-1 flex h-5 min-w-5 items-center justify-center rounded-full border border-red-200 px-1 text-[12px] font-bold leading-none text-white",style:{background:"linear-gradient(180deg, #ff403f 0%, #d51d28 100%)",boxShadow:"0 0 12px rgba(255, 58, 70, 0.85)"},children:pj(o)})]}),m&&d.jsx("span",{className:"pointer-events-none absolute left-1/2 top-[39px] h-[12px] w-[40px] -translate-x-1/2 rounded-full",style:{background:hj}})]}),d.jsx("span",{className:"absolute bottom-[14px] left-1/2 block w-[92%] -translate-x-1/2 truncate px-0.5 text-center font-[Alibaba] text-[10px] font-bold leading-4 sm:text-[11px]",style:{opacity:m?1:.92,color:m?"#ff79cf":"#ffd6f0",textShadow:m?"0 0 10px rgba(255, 83, 198, 0.72), 0 2px 4px rgba(0, 0, 0, 0.65)":"0 2px 5px rgba(0, 0, 0, 0.7)"},children:l.label})]})}},l.id)})})})})})}const gj={title:"خانه",showBack:!1,action:"profile"},yj=["/","/public-chat","/magic-bag","/messages","/profile"];function mg(e){return yj.findIndex(n=>e===n||n!=="/"&&e.startsWith(`${n}/`))}const gg={duration:.22,ease:[.22,1,.36,1]};function xj(){const e=Gt(),n=Ab(),a=W4(),s=v.useRef(e.pathname),o=v.useRef(null),l=v.useMemo(()=>{const m=e.pathname,y=s.current,g=mg(y),b=mg(m);return g!==-1&&b!==-1?b>g?1:b<g?-1:0:0},[e.pathname]);v.useEffect(()=>{var m;s.current=e.pathname,(m=o.current)==null||m.scrollTo({top:0,behavior:"auto"})},[e.pathname]);const u=a?{opacity:0}:l===0?{opacity:0,y:12,scale:.98}:{opacity:0,x:l*32,scale:.98},f=a?{opacity:1}:l===0?{opacity:1,y:0,scale:1}:{opacity:1,x:0,scale:1},p=a?{opacity:0}:l===0?{opacity:0,y:-8,scale:.98}:{opacity:0,x:l*-32,scale:.98};return d.jsx("div",{className:"page-frame",children:d.jsx(gn,{mode:"wait",initial:!1,children:d.jsx(se.div,{className:"page",ref:o,initial:u,animate:f,exit:p,transition:{...gg,duration:a?.12:gg.duration},style:{willChange:"opacity, transform"},children:n},e.pathname)})})}function Wr({position:e="fixed",style:n,zIndex:a=0,imageUrl:s=mn.home}){return d.jsx("div",{className:`inset-0 w-full ${e==="fixed"?"fixed":"absolute"}`,style:{backgroundImage:`url(${s})`,backgroundSize:"100% auto",backgroundPosition:"top center",backgroundRepeat:"no-repeat",backgroundColor:"#23183E",zIndex:a,...n}})}function vj(){const e=Gt(),n=an(),a=Yb(),s=v.useMemo(()=>{var o;for(let l=a.length-1;l>=0;l-=1){const u=(o=a[l].handle)==null?void 0:o.header;if(u)return u}return gj},[a]);return d.jsxs("div",{className:"app-viewport",children:[d.jsx(Wr,{position:"fixed",zIndex:0,imageUrl:F8(e.pathname)}),d.jsx("div",{className:"app-shell-frame",children:d.jsxs("div",{className:"app-shell",children:[d.jsx(rj,{title:s.title,action:s.action,showBack:!!s.showBack,onBack:s.showBack?()=>n(s.backTo??"/"):void 0}),d.jsx(xj,{}),d.jsx(Ga,{fixed:!1})]})})]})}var ul={},yg;function bj(){if(yg)return ul;yg=1,Object.defineProperty(ul,"__esModule",{value:!0});var e=zl();function n(w){return Array.prototype.slice.call(w)}function a(w,M){var E=Math.floor(w);return E===M||E+1===M?w:M}function s(){return Date.now()}function o(w,M,E){if(M="data-keen-slider-"+M,E===null)return w.removeAttribute(M);w.setAttribute(M,E||"")}function l(w,M){return M=M||document,typeof w=="function"&&(w=w(M)),Array.isArray(w)?w:typeof w=="string"?n(M.querySelectorAll(w)):w instanceof HTMLElement?[w]:w instanceof NodeList?n(w):[]}function u(w){w.raw&&(w=w.raw),w.cancelable&&!w.defaultPrevented&&w.preventDefault()}function f(w){w.raw&&(w=w.raw),w.stopPropagation&&w.stopPropagation()}function p(){var w=[];return{add:function(M,E,U,Y){M.addListener?M.addListener(U):M.addEventListener(E,U,Y),w.push([M,E,U,Y])},input:function(M,E,U,Y){this.add(M,E,(function(I){return function(W){W.nativeEvent&&(W=W.nativeEvent);var Q=W.changedTouches||[],G=W.targetTouches||[],B=W.detail&&W.detail.x?W.detail:null;return I({id:B?B.identifier?B.identifier:"i":G[0]?G[0]?G[0].identifier:"e":"d",idChanged:B?B.identifier?B.identifier:"i":Q[0]?Q[0]?Q[0].identifier:"e":"d",raw:W,x:B&&B.x?B.x:G[0]?G[0].screenX:B?B.x:W.pageX,y:B&&B.y?B.y:G[0]?G[0].screenY:B?B.y:W.pageY})}})(U),Y)},purge:function(){w.forEach((function(M){M[0].removeListener?M[0].removeListener(M[2]):M[0].removeEventListener(M[1],M[2],M[3])})),w=[]}}}function m(w,M,E){return Math.min(Math.max(w,M),E)}function y(w){return(w>0?1:0)-(w<0?1:0)||+w}function g(w){var M=w.getBoundingClientRect();return{height:a(M.height,w.offsetHeight),width:a(M.width,w.offsetWidth)}}function b(w,M,E,U){var Y=w&&w[M];return Y==null?E:U&&typeof Y=="function"?Y():Y}function S(w){return Math.round(1e6*w)/1e6}function C(w,M){if(w===M)return!0;var E=typeof w;if(E!==typeof M)return!1;if(E!=="object"||w===null||M===null)return E==="function"&&w.toString()===M.toString();if(w.length!==M.length||Object.getOwnPropertyNames(w).length!==Object.getOwnPropertyNames(M).length)return!1;for(var U in w)if(!C(w[U],M[U]))return!1;return!0}var N=function(){return N=Object.assign||function(w){for(var M,E=1,U=arguments.length;E<U;E++)for(var Y in M=arguments[E])Object.prototype.hasOwnProperty.call(M,Y)&&(w[Y]=M[Y]);return w},N.apply(this,arguments)};function j(w,M,E){for(var U,Y=0,I=M.length;Y<I;Y++)!U&&Y in M||(U||(U=Array.prototype.slice.call(M,0,Y)),U[Y]=M[Y]);return w.concat(U||Array.prototype.slice.call(M))}function L(w){var M,E,U,Y,I,W;function Q(J){W||(W=J),G(!0);var T=J-W;T>U&&(T=U);var A=Y[E];if(A[3]<T)return E++,Q(J);var te=A[2],ie=A[4],oe=A[0],ae=A[1]*(0,A[5])(ie===0?1:(T-te)/ie);if(ae&&w.track.to(oe+ae),T<U)return _();W=null,G(!1),B(null),w.emit("animationEnded")}function G(J){M.active=J}function B(J){M.targetIdx=J}function _(){var J;J=Q,I=window.requestAnimationFrame(J)}function X(){var J;J=I,window.cancelAnimationFrame(J),G(!1),B(null),W&&w.emit("animationStopped"),W=null}return M={active:!1,start:function(J){if(X(),w.track.details){var T=0,A=w.track.details.position;E=0,U=0,Y=J.map((function(te){var ie,oe=Number(A),ae=(ie=te.earlyExit)!==null&&ie!==void 0?ie:te.duration,ue=te.easing,xe=te.distance*ue(ae/te.duration)||0;A+=xe;var ve=U;return U+=ae,T+=xe,[oe,te.distance,ve,U,te.duration,ue]})),B(w.track.distToIdx(T)),_(),w.emit("animationStarted")}},stop:X,targetIdx:null}}function R(w){var M,E,U,Y,I,W,Q,G,B,_,X,J,T,A,te=1/0,ie=[],oe=null,ae=0;function ue(Re){vt(ae+Re)}function xe(Re){var we=ve(ae+Re).abs;return Ue(we)?we:null}function ve(Re){var we=Math.floor(Math.abs(S(Re/E))),me=S((Re%E+E)%E);me===E&&(me=0);var Ie=y(Re),be=Q.indexOf(j([],Q).reduce((function(Qe,Ge){return Math.abs(Ge-me)<Math.abs(Qe-me)?Ge:Qe}))),Ae=be;return Ie<0&&we++,be===W&&(Ae=0,we+=Ie>0?1:-1),{abs:Ae+we*W*Ie,origin:be,rel:Ae}}function Ve(Re,we,me){var Ie;if(we||!dt())return Ce(Re,me);if(!Ue(Re))return null;var be=ve(me??ae),Ae=be.abs,Qe=Re-be.rel,Ge=Ae+Qe;Ie=Ce(Ge);var rt=Ce(Ge-W*y(Qe));return(rt!==null&&Math.abs(rt)<Math.abs(Ie)||Ie===null)&&(Ie=rt),S(Ie)}function Ce(Re,we){if(we==null&&(we=S(ae)),!Ue(Re)||Re===null)return null;Re=Math.round(Re);var me=ve(we),Ie=me.abs,be=me.rel,Ae=me.origin,Qe=xt(Re),Ge=(we%E+E)%E,rt=Q[Ae],ht=Math.floor((Re-(Ie-be))/W)*E;return S(rt-Ge-rt+Q[Qe]+ht+(Ae===W?E:0))}function Ue(Re){return Oe(Re)===Re}function Oe(Re){return m(Re,B,_)}function dt(){return Y.loop}function xt(Re){return(Re%W+W)%W}function vt(Re){var we;we=Re-ae,ie.push({distance:we,timestamp:s()}),ie.length>6&&(ie=ie.slice(-6)),ae=S(Re);var me=ke().abs;if(me!==oe){var Ie=oe!==null;oe=me,Ie&&w.emit("slideChanged")}}function ke(Re){var we=Re?null:(function(){if(W){var me=dt(),Ie=me?(ae%E+E)%E:ae,be=(me?ae%E:ae)-I[0][2],Ae=0-(be<0&&me?E-Math.abs(be):be),Qe=0,Ge=ve(ae),rt=Ge.abs,ht=Ge.rel,Qt=I[ht][2],Pt=I.map((function(qe,Sn){var ft=Ae+Qe;(ft<0-qe[0]||ft>1)&&(ft+=(Math.abs(ft)>E-1&&me?E:0)*y(-ft));var Mn=Sn-ht,Te=y(Mn),Ze=Mn+rt;me&&(Te===-1&&ft>Qt&&(Ze+=W),Te===1&&ft<Qt&&(Ze-=W),X!==null&&Ze<X&&(ft+=E),J!==null&&Ze>J&&(ft-=E));var ot=ft+qe[0]+qe[1],it=Math.max(ft>=0&&ot<=1?1:ot<0||ft>1?0:ft<0?Math.min(1,(qe[0]+ft)/qe[0]):(1-ft)/qe[0],0);return Qe+=qe[0]+qe[1],{abs:Ze,distance:Y.rtl?-1*ft+1-qe[0]:ft,portion:it,size:qe[0]}}));return rt=Oe(rt),ht=xt(rt),{abs:Oe(rt),length:U,max:A,maxIdx:_,min:T,minIdx:B,position:ae,progress:me?Ie/E:ae/U,rel:ht,slides:Pt,slidesLength:E}}})();return M.details=we,w.emit("detailsChanged"),we}return M={absToRel:xt,add:ue,details:null,distToIdx:xe,idxToDist:Ve,init:function(Re){if((function(){if(Y=w.options,I=(Y.trackConfig||[]).map((function(be){return[b(be,"size",1),b(be,"spacing",0),b(be,"origin",0)]})),W=I.length){E=S(I.reduce((function(be,Ae){return be+Ae[0]+Ae[1]}),0));var me,Ie=W-1;U=S(E+I[0][2]-I[Ie][0]-I[Ie][2]-I[Ie][1]),Q=I.reduce((function(be,Ae){if(!be)return[0];var Qe=I[be.length-1],Ge=be[be.length-1]+(Qe[0]+Qe[2])+Qe[1];return Ge-=Ae[2],be[be.length-1]>Ge&&(Ge=be[be.length-1]),Ge=S(Ge),be.push(Ge),(!me||me<Ge)&&(G=be.length-1),me=Ge,be}),null),U===0&&(G=0),Q.push(S(E))}})(),!W)return ke(!0);var we;(function(){var me=w.options.range,Ie=w.options.loop;X=B=Ie?b(Ie,"min",-1/0):0,J=_=Ie?b(Ie,"max",te):G;var be=b(me,"min",null),Ae=b(me,"max",null);be!==null&&(B=be),Ae!==null&&(_=Ae),T=B===-1/0?B:w.track.idxToDist(B||0,!0,0),A=_===te?_:Ve(_,!0,0),Ae===null&&(J=_),b(me,"align",!1)&&_!==te&&I[xt(_)][2]===0&&(A-=1-I[xt(_)][0],_=xe(A-ae)),T=S(T),A=S(A)})(),we=Re,Number(we)===we?ue(Ce(Oe(Re))):ke()},to:vt,velocity:function(){var Re=s(),we=ie.reduce((function(me,Ie){var be=Ie.distance,Ae=Ie.timestamp;return Re-Ae>200||(y(be)!==y(me.distance)&&me.distance&&(me={distance:0,lastTimestamp:0,time:0}),me.time&&(me.distance+=be),me.lastTimestamp&&(me.time+=Ae-me.lastTimestamp),me.lastTimestamp=Ae),me}),{distance:0,lastTimestamp:0,time:0});return we.distance/we.time||0}}}function D(w){var M,E,U,Y,I,W,Q,G;function B(oe){return 2*oe}function _(oe){return m(oe,Q,G)}function X(oe){return 1-Math.pow(1-oe,3)}function J(){return U?w.track.velocity():0}function T(){ie();var oe=w.options.mode==="free-snap",ae=w.track,ue=J();Y=y(ue);var xe=w.track.details,ve=[];if(ue||!oe){var Ve=A(ue),Ce=Ve.dist,Ue=Ve.dur;if(Ue=B(Ue),Ce*=Y,oe){var Oe=ae.idxToDist(ae.distToIdx(Ce),!0);Oe&&(Ce=Oe)}ve.push({distance:Ce,duration:Ue,easing:X});var dt=xe.position,xt=dt+Ce;if(xt<I||xt>W){var vt=xt<I?I-dt:W-dt,ke=0,Re=ue;if(y(vt)===Y){var we=Math.min(Math.abs(vt)/Math.abs(Ce),1),me=(function(Ae){return 1-Math.pow(1-Ae,1/3)})(we)*Ue;ve[0].earlyExit=me,Re=ue*(1-we)}else ve[0].earlyExit=0,ke+=vt;var Ie=A(Re,100),be=Ie.dist*Y;w.options.rubberband&&(ve.push({distance:be,duration:B(Ie.dur),easing:X}),ve.push({distance:-be+ke,duration:500,easing:X}))}w.animator.start(ve)}else w.moveToIdx(_(xe.abs),!0,{duration:500,easing:function(Ae){return 1+--Ae*Ae*Ae*Ae*Ae}})}function A(oe,ae){ae===void 0&&(ae=1e3);var ue=147e-9+(oe=Math.abs(oe))/ae;return{dist:Math.pow(oe,2)/ue,dur:oe/ue}}function te(){var oe=w.track.details;oe&&(I=oe.min,W=oe.max,Q=oe.minIdx,G=oe.maxIdx)}function ie(){w.animator.stop()}w.on("updated",te),w.on("optionsChanged",te),w.on("created",te),w.on("dragStarted",(function(){U=!1,ie(),M=E=w.track.details.abs})),w.on("dragChecked",(function(){U=!0})),w.on("dragEnded",(function(){var oe=w.options.mode;oe==="snap"&&(function(){var ae=w.track,ue=w.track.details,xe=ue.position,ve=y(J());(xe>W||xe<I)&&(ve=0);var Ve=M+ve;ue.slides[ae.absToRel(Ve)].portion===0&&(Ve-=ve),M!==E&&(Ve=E),y(ae.idxToDist(Ve,!0))!==ve&&(Ve+=ve),Ve=_(Ve);var Ce=ae.idxToDist(Ve,!0);w.animator.start([{distance:Ce,duration:500,easing:function(Ue){return 1+--Ue*Ue*Ue*Ue*Ue}}])})(),oe!=="free"&&oe!=="free-snap"||T()})),w.on("dragged",(function(){E=w.track.details.abs}))}function H(w){var M,E,U,Y,I,W,Q,G,B,_,X,J,T,A,te,ie,oe,ae,ue=p();function xe(ke){if(W&&G===ke.id){var Re=Ue(ke);if(B){if(!Ce(ke))return Ve(ke);_=Re,B=!1,w.emit("dragChecked")}if(ie)return _=Re;u(ke);var we=(function(Ie){if(oe===-1/0&&ae===1/0)return Ie;var be=w.track.details,Ae=be.length,Qe=be.position,Ge=m(Ie,oe-Qe,ae-Qe);if(Ae===0)return 0;if(!w.options.rubberband)return Ge;if(Qe<=ae&&Qe>=oe||Qe<oe&&E>0||Qe>ae&&E<0)return Ie;var rt=(Qe<oe?Qe-oe:Qe-ae)/Ae,ht=Y*Ae,Qt=Math.abs(rt*ht),Pt=Math.max(0,1-Qt/I*2);return Pt*Pt*Ie})(Q(_-Re)/Y*U);E=y(we);var me=w.track.details.position;(me>oe&&me<ae||me===oe&&E>0||me===ae&&E<0)&&f(ke),X+=we,!J&&Math.abs(X*Y)>5&&(J=!0),w.track.add(we),_=Re,w.emit("dragged")}}function ve(ke){!W&&w.track.details&&w.track.details.length&&(X=0,W=!0,J=!1,B=!0,G=ke.id,Ce(ke),_=Ue(ke),w.emit("dragStarted"))}function Ve(ke){W&&G===ke.idChanged&&(W=!1,w.emit("dragEnded"))}function Ce(ke){var Re=Oe(),we=Re?ke.y:ke.x,me=Re?ke.x:ke.y,Ie=T!==void 0&&A!==void 0&&Math.abs(A-me)<=Math.abs(T-we);return T=we,A=me,Ie}function Ue(ke){return Oe()?ke.y:ke.x}function Oe(){return w.options.vertical}function dt(){Y=w.size,I=Oe()?window.innerHeight:window.innerWidth;var ke=w.track.details;ke&&(oe=ke.min,ae=ke.max)}function xt(ke){J&&(f(ke),u(ke))}function vt(){if(ue.purge(),w.options.drag&&!w.options.disabled){var ke;ke=w.options.dragSpeed||1,Q=typeof ke=="function"?ke:function(we){return we*ke},U=w.options.rtl?-1:1,dt(),M=w.container,(function(){var we="data-keen-slider-clickable";l("[".concat(we,"]:not([").concat(we,"=false])"),M).map((function(me){ue.add(me,"dragstart",f),ue.add(me,"mousedown",f),ue.add(me,"touchstart",f)}))})(),ue.add(M,"dragstart",(function(we){u(we)})),ue.add(M,"click",xt,{capture:!0}),ue.input(M,"ksDragStart",ve),ue.input(M,"ksDrag",xe),ue.input(M,"ksDragEnd",Ve),ue.input(M,"mousedown",ve),ue.input(M,"mousemove",xe),ue.input(M,"mouseleave",Ve),ue.input(M,"mouseup",Ve),ue.input(M,"touchstart",ve,{passive:!0}),ue.input(M,"touchmove",xe,{passive:!1}),ue.input(M,"touchend",Ve),ue.input(M,"touchcancel",Ve),ue.add(window,"wheel",(function(we){W&&u(we)}));var Re="data-keen-slider-scrollable";l("[".concat(Re,"]:not([").concat(Re,"=false])"),w.container).map((function(we){return(function(me){var Ie;ue.input(me,"touchstart",(function(be){Ie=Ue(be),ie=!0,te=!0}),{passive:!0}),ue.input(me,"touchmove",(function(be){var Ae=Oe(),Qe=Ae?me.scrollHeight-me.clientHeight:me.scrollWidth-me.clientWidth,Ge=Ie-Ue(be),rt=Ae?me.scrollTop:me.scrollLeft,ht=Ae&&me.style.overflowY==="scroll"||!Ae&&me.style.overflowX==="scroll";if(Ie=Ue(be),(Ge<0&&rt>0||Ge>0&&rt<Qe)&&te&&ht)return ie=!0;te=!1,u(be),ie=!1})),ue.input(me,"touchend",(function(){ie=!1}))})(we)}))}}w.on("updated",dt),w.on("optionsChanged",vt),w.on("created",vt),w.on("destroyed",ue.purge)}function K(w){var M,E,U=null;function Y(T,A,te){w.animator.active?W(T,A,te):requestAnimationFrame((function(){return W(T,A,te)}))}function I(){Y(!1,!1,E)}function W(T,A,te){var ie=0,oe=w.size,ae=w.track.details;if(ae&&M){var ue=ae.slides;M.forEach((function(xe,ve){if(T)!U&&A&&G(xe,null,te),B(xe,null,te);else{if(!ue[ve])return;var Ve=ue[ve].size*oe;!U&&A&&G(xe,Ve,te),B(xe,ue[ve].distance*oe-ie,te),ie+=Ve}}))}}function Q(T){return w.options.renderMode==="performance"?Math.round(T):T}function G(T,A,te){var ie=te?"height":"width";A!==null&&(A=Q(A)+"px"),T.style["min-"+ie]=A,T.style["max-"+ie]=A}function B(T,A,te){if(A!==null){A=Q(A);var ie=te?A:0;A="translate3d(".concat(te?0:A,"px, ").concat(ie,"px, 0)")}T.style.transform=A,T.style["-webkit-transform"]=A}function _(){M&&(W(!0,!0,E),M=null),w.on("detailsChanged",I,!0)}function X(){Y(!1,!0,E)}function J(){_(),E=w.options.vertical,w.options.disabled||w.options.renderMode==="custom"||(U=b(w.options.slides,"perView",null)==="auto",w.on("detailsChanged",I),(M=w.slides).length&&X())}w.on("created",J),w.on("optionsChanged",J),w.on("beforeOptionsChanged",(function(){_()})),w.on("updated",X),w.on("destroyed",_)}function re(w,M){return function(E){var U,Y,I,W,Q,G=p();function B(Ce){var Ue;o(E.container,"reverse",(Ue=E.container,window.getComputedStyle(Ue,null).getPropertyValue("direction")!=="rtl"||Ce?null:"")),o(E.container,"v",E.options.vertical&&!Ce?"":null),o(E.container,"disabled",E.options.disabled&&!Ce?"":null)}function _(){X()&&ie()}function X(){var Ce=null;if(W.forEach((function(Oe){Oe.matches&&(Ce=Oe.__media)})),Ce===U)return!1;U||E.emit("beforeOptionsChanged"),U=Ce;var Ue=Ce?I.breakpoints[Ce]:I;return E.options=N(N({},I),Ue),B(),ve(),Ve(),ae(),!0}function J(Ce){var Ue=g(Ce);return(E.options.vertical?Ue.height:Ue.width)/E.size||1}function T(){return E.options.trackConfig.length}function A(Ce){for(var Ue in U=!1,I=N(N({},M),Ce),G.purge(),Y=E.size,W=[],I.breakpoints||[]){var Oe=window.matchMedia(Ue);Oe.__media=Ue,W.push(Oe),G.add(Oe,"change",_)}G.add(window,"orientationchange",xe),G.add(window,"resize",ue),X()}function te(Ce){E.animator.stop();var Ue=E.track.details;E.track.init(Ce??(Ue?Ue.abs:0))}function ie(Ce){te(Ce),E.emit("optionsChanged")}function oe(Ce,Ue){if(Ce)return A(Ce),void ie(Ue);ve(),Ve();var Oe=T();ae(),T()!==Oe?ie(Ue):te(Ue),E.emit("updated")}function ae(){var Ce=E.options.slides;if(typeof Ce=="function")return E.options.trackConfig=Ce(E.size,E.slides);for(var Ue=E.slides,Oe=Ue.length,dt=typeof Ce=="number"?Ce:b(Ce,"number",Oe,!0),xt=[],vt=b(Ce,"perView",1,!0),ke=b(Ce,"spacing",0,!0)/E.size||0,Re=vt==="auto"?ke:ke/vt,we=b(Ce,"origin","auto"),me=0,Ie=0;Ie<dt;Ie++){var be=vt==="auto"?J(Ue[Ie]):1/vt-ke+Re,Ae=we==="center"?.5-be/2:we==="auto"?0:we;xt.push({origin:Ae,size:be,spacing:ke}),me+=be}if(me+=ke*(dt-1),we==="auto"&&!E.options.loop&&vt!==1){var Qe=0;xt.map((function(Ge){var rt=me-Qe;return Qe+=Ge.size+ke,rt>=1||(Ge.origin=1-rt-(me>1?0:1-me)),Ge}))}E.options.trackConfig=xt}function ue(){ve();var Ce=E.size;E.options.disabled||Ce===Y||(Y=Ce,oe())}function xe(){ue(),setTimeout(ue,500),setTimeout(ue,2e3)}function ve(){var Ce=g(E.container);E.size=(E.options.vertical?Ce.height:Ce.width)||1}function Ve(){E.slides=l(E.options.selector,E.container)}E.container=(Q=l(w,document)).length?Q[0]:null,E.destroy=function(){G.purge(),E.emit("destroyed"),B(!0)},E.prev=function(){E.moveToIdx(E.track.details.abs-1,!0)},E.next=function(){E.moveToIdx(E.track.details.abs+1,!0)},E.update=oe,A(E.options)}}var O=function(w,M,E){try{return(function(U,Y){var I,W={};return I={emit:function(Q){W[Q]&&W[Q].forEach((function(B){B(I)}));var G=I.options&&I.options[Q];G&&G(I)},moveToIdx:function(Q,G,B){var _=I.track.idxToDist(Q,G);if(_){var X=I.options.defaultAnimation;I.animator.start([{distance:_,duration:b(B||X,"duration",500),easing:b(B||X,"easing",(function(J){return 1+--J*J*J*J*J}))}])}},on:function(Q,G,B){B===void 0&&(B=!1),W[Q]||(W[Q]=[]);var _=W[Q].indexOf(G);_>-1?B&&delete W[Q][_]:B||W[Q].push(G)},options:U},(function(){if(I.track=R(I),I.animator=L(I),Y)for(var Q=0,G=Y;Q<G.length;Q++)(0,G[Q])(I);I.track.init(I.options.initial||0),I.emit("created")})(),I})(M,j([re(w,{drag:!0,mode:"snap",renderMode:"precision",rubberband:!0,selector:".keen-slider__slide"}),K,H,D],E||[],!0))}catch(U){console.error(U)}};return ul.useKeenSlider=function(w,M){var E=e.useRef(null),U=e.useRef(!1),Y=e.useRef(w),I=e.useCallback((function(W){W?(Y.current=w,E.current=new O(W,w,M),U.current=!1):(E.current&&E.current.destroy&&E.current.destroy(),E.current=null)}),[]);return e.useEffect((function(){C(Y.current,w)||(Y.current=w,E.current&&E.current.update(Y.current))}),[w]),[I,E]},ul}var wj=bj();const Ex={1:{title:"تخته سیاه",serverName:"تخته سیاه",description:"ماموریتهای آموزشی و خلاقانه",backgroundColor:"#0a1f2e",accentColor:"#8ACEE0",hasFeed:!0},2:{title:"نیمکت",serverName:"نیمکت",description:"لحظات استراحت و گفتگو",backgroundColor:"#0e1a25",accentColor:"#A8D5E2",hasFeed:!0},3:{title:"دفترچه یادداشت",serverName:"دفترچه یادداشت",description:"یادداشتها و خاطرات",backgroundColor:"#1a1f2e",accentColor:"#B8E0F0",hasFeed:!0},4:{title:"دیوار حیاط",serverName:"دیوار حیاط",description:"نقاشی و هنر",backgroundColor:"#0f1f30",accentColor:"#90C8E0",hasFeed:!0},5:{title:"آبخوری",serverName:"آبخوری",description:"تجربههای روزانه",backgroundColor:"#1a1530",accentColor:"#A890E0",hasFeed:!0},6:{title:"زنگ ورزش",serverName:"زنگ ورزش",description:"فعالیتهای ورزشی",backgroundColor:"#0a1f2e",accentColor:"#80D0E0",hasFeed:!0},7:{title:"سه ماه تعطیلی",serverName:"سه ماه تعطیلی",description:"ماجراهای تابستانی",backgroundColor:"#0f1a30",accentColor:"#90D8F0",hasFeed:!1},8:{title:"روزنامه دیواری",serverName:"روزنامه دیواری",description:"اخبار و گزارشها",backgroundColor:"#151a2e",accentColor:"#A0D0E8",hasFeed:!0},9:{title:"زنگ تفریح",serverName:"زنگ تفریح",description:"سرگرمی و بازی",backgroundColor:"#0a1f2e",accentColor:"#8ACEE0",hasFeed:!1}},Sj=e=>e&&Ex[e]||null,kj="/assets/takhtesiyah-CZHoAAAB.jpg",jj="/assets/nimkat-erYkVpnh.jpg",Cj="/assets/daftarcheyadasht-Cei08k5t.jpg",Nj="/assets/divarehayat-CpfZ3_s0.jpg",Ej="/assets/abkhori-BLwhFlbe.jpg",Tj="/assets/zangvarzsh-iJQNX0Ln.jpg",Pj="/assets/semahtatili-CKTx4sxX.jpg",Rj="/assets/roznamedivari-D7e7L_HK.jpg",Mj="/assets/zangtafrih-YNSka48i.jpg",Ij="/assets/takhtesiyah-overlay-D0TInUoR.png",_j="/assets/nimkat-overlay-C8rEc9bN.png",Dj="/assets/daftarcheyadasht-overlay-CQxwu2Xs.png",Fj="/assets/divarehayat-overlay-DJcovQj8.png",Lj="/assets/abkhori-overlay-B1UUEC18.png",Aj="/assets/sample-overlay-DE8T3m17.png",Oj="/assets/semahtatili-overlay-DuhScTDW.png",zj="/assets/roznamedivari-overlay-Gr9jXnq2.png",Bj="/assets/zangtafrih-overlay-3HxwzusR.png",nd="/assets/sample-overlay-DE8T3m17.png",Vj=new Set(["7"]),Uj={1:kj,2:jj,3:Cj,4:Nj,5:Ej,6:Tj,7:Pj,8:Rj,9:Mj},$j={1:Z4,2:fx,3:$6,4:K6,5:x6,6:b6,7:p8,8:V6,9:J6},Hj={1:Ij,2:_j,3:Dj,4:Fj,5:Lj,6:Aj,7:Oj,8:zj,9:Bj},Wj=e=>{const l=new WeakMap;let u=0,f=!1,p=1;function m(b){return((b+180)%360+360)%360-180}function y(){const b=e.track.details;if(!b)return;const S=360*b.progress,C=360/e.slides.length;if(f){const O=m(S-u);Math.abs(O)>.02&&(p=O>0?1:-1)}u=S,f=!0;const N=S+p*(C*.5);let j=0,L=Number.POSITIVE_INFINITY;e.slides.forEach((O,w)=>{const M=C*w,E=m(M-S),U=Math.abs(E),Y=U<=80,I=O,W=-22,Q=U<=12?1:Math.max(0,1-(U-12)/68),G=Q*Q*(3-2*Q),B=m(M-N),_=Math.abs(B);_<L&&(L=_,j=w);const X=1+G*.3,J=23+W,T=l.get(I)??{scale:X,tilt:J},A=T.scale+(X-T.scale)*.22,te=T.tilt+(J-T.tilt)*.22;l.set(I,{scale:A,tilt:te}),I.style.transform=`rotateY(${M}deg) translateZ(240px) rotateX(${te.toFixed(2)}deg) scale(${A.toFixed(3)})`,I.style.setProperty("--ui-counter-tilt",`${(-te).toFixed(2)}deg`),I.style.opacity=Y?"1":"0",I.style.pointerEvents=Y?"auto":"none"});const R=C*j,D=m(R-S),H=Math.max(0,1-Math.abs(D)/(80*.7)),K=H*H*(3-2*H),re=e.container;re.style.setProperty("--active-overlay-index",`${j}`),re.style.setProperty("--active-overlay-progress",`${K.toFixed(3)}`)}function g(){const b=360*e.track.details.progress;e.container.style.transform=`translateZ(-240px) rotateX(-23deg) rotateY(${-b}deg)`,y()}e.on("created",g),e.on("detailsChanged",g)};function Kj(){const e=an();gr("صفحه اصلی");const[n,a]=v.useState(0),[s,o]=v.useState(0),[l,u]=v.useState(0),f=v.useRef(0),p=v.useRef(0),m=v.useRef(0),y=v.useRef(0),g=v.useRef(0),b=v.useRef(0),S=v.useRef(0),C=v.useRef(1),N=O=>Math.max(0,Math.min(1,O)),j=(O,w)=>w<=0?0:(O%w+w)%w,L=O=>O>.5?O-1:O<-.5?O+1:O,R=O=>O*O*(3-2*O),D=Object.entries(Ex).sort(([O],[w])=>Number(O)-Number(w)).map(([O,w])=>({id:Number(O),topicId:O,title:w.title,subtitle:w.description,Icon:$j[O]||fx,image:Uj[O],overlayImage:Hj[O]||nd,disabled:Vj.has(O),targetPath:w.hasFeed?`/feed/${O}`:`/challenges/${O}`})),[H]=wj.useKeenSlider({loop:!0,selector:".carousel__item",renderMode:"custom",mode:"free-snap",created(O){const w=O.track.details;if(!w)return;const M=O.slides.length,E=j(w.rel,M);f.current=E,p.current=E,m.current=E,y.current=0,b.current=w.progress*M,g.current=b.current,S.current=w.progress},dragStarted(O){const w=O.track.details;if(!w)return;const M=O.slides.length||1;b.current=w.progress*M,g.current=b.current,S.current=w.progress,O.container.setAttribute("data-drag-start-abs",String(w.abs))},dragEnded(O){const w=O.track.details;if(!w)return;const M=Number.parseFloat(O.container.getAttribute("data-drag-start-abs")||`${w.abs}`),E=w.abs-M;if(Math.abs(E)<=1.05)return;const Y=Math.round(M)+(E>0?1:-1);O.moveToIdx(Y,!0,{duration:360,easing:I=>1-Math.pow(1-I,3)})},animationStarted(O){const w=O.track.details;if(!w)return;const M=O.slides.length||1;b.current=w.progress*M},detailsChanged(O){const w=O.track.details;if(!w)return;const M=O.slides.length;if(!M)return;const E=L(w.progress-S.current);b.current+=E*M;const U=Math.abs(E)>35e-5;if(S.current=w.progress,U&&(C.current=E>0?1:-1),!U&&!O.animator.active){const I=j(w.rel,M);f.current=I,p.current=I,m.current=I,y.current=0,g.current=b.current}else{const I=b.current-Math.floor(b.current),W=I<0?I+1:I,Q=C.current>0?W:(1-W)%1,G=0,B=N((Q-G)/(1-G)),_=B<=.001?0:B>=.999?1:R(B),X=C.current>0?j(Math.floor(b.current),M):j(Math.ceil(b.current),M),J=j(X+C.current,M);p.current=X,m.current=J,y.current=_,f.current=_>=.999?J:X}const Y=O.container;Y.style.setProperty("--active-overlay-index",String(m.current)),Y.style.setProperty("--active-overlay-progress",y.current.toFixed(3)),a(p.current),o(m.current),u(y.current)}},[Wj]),K=v.useMemo(()=>{var O;return((O=D[n])==null?void 0:O.overlayImage)||nd},[D,n]),re=v.useMemo(()=>{var O;return((O=D[s])==null?void 0:O.overlayImage)||nd},[D,s]);return d.jsx("div",{className:"home-page",dir:"rtl",children:d.jsx("div",{className:"home-carousel-wrapper",children:d.jsxs("div",{className:"home-carousel-scene",children:[d.jsxs("div",{className:"home-carousel-floating-overlay",style:{"--floating-progress":l.toFixed(3)},"aria-hidden":"true",children:[d.jsx("img",{src:K,alt:"",className:"home-carousel-floating-overlay-image home-carousel-floating-overlay-image--out"}),d.jsx("img",{src:re,alt:"",className:"home-carousel-floating-overlay-image home-carousel-floating-overlay-image--in"})]}),d.jsx("div",{className:"home-carousel keen-slider",ref:H,dir:"ltr",children:D.map((O,w)=>d.jsx("div",{className:`carousel__item number-slide${w%6+1}`,children:d.jsxs("button",{type:"button",onClick:()=>!O.disabled&&e(O.targetPath),disabled:O.disabled,className:"carousel__cell",style:{cursor:O.disabled?"not-allowed":"pointer"},dir:"rtl",children:[d.jsx("span",{className:"home-carousel-icon-badge","aria-hidden":"true",children:d.jsx(O.Icon,{size:20,strokeWidth:2})}),d.jsxs("div",{className:"home-carousel-text",children:[d.jsx("span",{className:"home-carousel-label",children:O.disabled?`🔒 ${O.title}`:O.title}),d.jsx("span",{className:"home-carousel-subtitle",children:O.subtitle})]}),d.jsx("img",{src:O.image,alt:O.title,className:"home-carousel-image",loading:"eager"})]})},O.id))})]})})})}const Cl="/assets/f7664d355c12b1003ad460ff44c8f22cfb1bbf5a-D6aHsuNC.png",Yj="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODgiIGhlaWdodD0iODgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBvcGFjaXR5PSIuMyIgZmlsbD0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIzLjciPjxyZWN0IHg9IjE2IiB5PSIxNiIgd2lkdGg9IjU2IiBoZWlnaHQ9IjU2IiByeD0iNiIvPjxwYXRoIGQ9Im0xNiA1OCAxNi0xOCAzMiAzMiIvPjxjaXJjbGUgY3g9IjUzIiBjeT0iMzUiIHI9IjciLz48L3N2Zz4KCg==";function xa(e){const{fallbackSrc:n,...a}=e,[s,o]=v.useState(!1),l=()=>{o(!0)},{src:u,alt:f,style:p,className:m,...y}=a,g=n||Yj;return s?d.jsx("div",{className:`inline-block bg-gray-100 text-center align-middle ${m??""}`,style:p,children:d.jsx("div",{className:"flex items-center justify-center w-full h-full",children:d.jsx("img",{src:g,alt:"Error loading image",...y,"data-original-url":u})})}):d.jsx("img",{src:u,alt:f,className:m,style:p,...y,onError:l})}function Gj({isOpen:e,onClose:n,comments:a,postAuthor:s,onAddComment:o,onDeleteComment:l,hasMoreComments:u=!1,isLoadingMoreComments:f=!1,onLoadMoreComments:p}){const[m,y]=v.useState(""),[g,b]=v.useState(null),[S,C]=v.useState(a),[N,j]=v.useState(null),{isProfileComplete:L,profile:R}=mr(),D=an(),H=v.useMemo(()=>R!=null&&R.image&&(R!=null&&R.user_stage_id)?Ol(R.image,R.user_stage_id):qn,[R==null?void 0:R.image,R==null?void 0:R.user_stage_id]);v.useEffect(()=>{C(a)},[a]),v.useEffect(()=>{const O=document.documentElement,w=document.body,M=w.style.overflow,E=w.style.touchAction,U=w.style.overscrollBehavior,Y=O.style.overflow,I=O.style.touchAction,W=O.style.overscrollBehavior;return e?(w.style.overflow="hidden",w.style.touchAction="none",w.style.overscrollBehavior="none",O.style.overflow="hidden",O.style.touchAction="none",O.style.overscrollBehavior="none",w.classList.add("comments-modal-open")):(w.style.overflow=M,w.style.touchAction=E,w.style.overscrollBehavior=U,O.style.overflow=Y,O.style.touchAction=I,O.style.overscrollBehavior=W,w.classList.remove("comments-modal-open")),()=>{w.style.overflow=M,w.style.touchAction=E,w.style.overscrollBehavior=U,O.style.overflow=Y,O.style.touchAction=I,O.style.overscrollBehavior=W,w.classList.remove("comments-modal-open")}},[e]);const K=()=>{m.trim()&&(o(m,g==null?void 0:g.id),y(""),b(null))},re=({comment:O,isReply:w=!1,parentId:M})=>{const E=(R==null?void 0:R.user_stage_id)===O.userStageId;return d.jsx("div",{className:`${w?"mr-12 mt-3":""}`,dir:"rtl",children:d.jsxs("div",{className:"flex gap-3 items-start",children:[d.jsx("div",{className:"w-8 h-8 rounded-full overflow-hidden flex-shrink-0",style:{border:"2px solid rgba(138, 206, 224, 0.3)"},children:d.jsx(xa,{src:O.authorAvatar,alt:O.author,className:"w-full h-full object-cover",fallbackSrc:qn})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx("span",{className:"text-sm font-bold text-white",children:O.author}),O.author===s&&d.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{background:"rgba(138, 206, 224, 0.2)",color:"#8ACEE0",border:"1px solid rgba(138, 206, 224, 0.3)"},children:"نویسنده"}),d.jsx("span",{className:"text-xs text-gray-400",children:O.timestamp})]}),d.jsx("p",{className:"text-sm text-white leading-relaxed mb-2",children:O.text}),d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("button",{onClick:()=>b({id:O.id,author:O.author}),className:"text-xs font-bold text-gray-400 hover:text-gray-200 transition-colors",children:"پاسخ"}),E&&l&&d.jsxs("button",{onClick:()=>j(O.id),className:"text-xs font-bold text-red-400 hover:text-red-300 transition-colors flex items-center gap-1",children:[d.jsx(dx,{className:"w-3.5 h-3.5"}),d.jsx("span",{children:"حذف"})]})]}),O.replies&&O.replies.length>0&&d.jsx("div",{className:"mt-3 space-y-3",children:O.replies.map(U=>d.jsx(re,{comment:U,isReply:!0,parentId:O.id},U.id))})]})]})})};return typeof document>"u"?null:ef.createPortal(d.jsx(gn,{children:e&&d.jsxs(d.Fragment,{children:[d.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n,className:"fixed inset-0 bg-black/60 z-[120] backdrop-blur-sm"}),d.jsxs(se.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:30,stiffness:300},className:"fixed left-0 right-0 z-[121] rounded-t-3xl overflow-hidden flex flex-col max-w-md mx-auto",style:{background:"linear-gradient(180deg, rgba(46, 27, 61, 0.98) 0%, rgba(35, 24, 62, 0.98) 100%)",border:"1px solid rgba(255, 170, 224, 0.22)",bottom:"env(safe-area-inset-bottom, 0px)",maxHeight:"min(82dvh, 760px)",height:"min(82dvh, 760px)"},children:[d.jsxs("div",{className:"sticky top-0 z-10 px-4 py-3 flex items-center justify-between flex-shrink-0",style:{background:"rgba(46, 27, 61, 0.94)",borderBottom:"1px solid rgba(255, 170, 224, 0.2)"},dir:"rtl",children:[d.jsx("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 w-12 h-1 rounded-full bg-gray-600"}),d.jsx("h2",{className:"text-white font-bold text-base mt-3",children:"نظرات"}),d.jsx("button",{onClick:n,className:"w-8 h-8 rounded-full flex items-center justify-center mt-3",style:{background:"rgba(255, 170, 224, 0.1)"},children:d.jsx(Ds,{className:"w-5 h-5 text-gray-300"})})]}),d.jsx("div",{className:"comments-scroll flex-1 overflow-y-auto px-4 py-4 space-y-4",style:{scrollbarWidth:"thin",scrollbarColor:"rgba(255, 170, 224, 0.3) transparent"},children:S.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[d.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-3",style:{background:"rgba(138, 206, 224, 0.1)",border:"2px solid rgba(138, 206, 224, 0.2)"},children:d.jsx("svg",{className:"w-8 h-8",style:{color:"#8ACEE0"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})}),d.jsx("p",{className:"text-gray-400 text-sm",children:"هنوز نظری ثبت نشده است"}),d.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"اولین نفری باشید که نظر میدهد"})]}):d.jsxs(d.Fragment,{children:[S.map(O=>d.jsx(re,{comment:O},O.id)),u&&d.jsx("div",{className:"pt-2 text-center",children:d.jsx(se.button,{whileTap:{scale:f?1:.97},onClick:p,disabled:f,className:"px-4 py-2 rounded-full text-xs font-bold text-white",style:{background:"linear-gradient(135deg, rgba(96, 147, 157, 0.9) 0%, rgba(76, 127, 137, 0.9) 100%)",border:"1px solid rgba(138, 206, 224, 0.3)",opacity:f?.65:1,cursor:f?"not-allowed":"pointer"},children:f?"در حال بارگذاری...":"نمایش نظرات بیشتر"})})]})}),d.jsx("div",{className:"sticky bottom-0 px-4 py-3 flex-shrink-0",style:{background:"rgba(46, 27, 61, 0.9)",borderTop:"1px solid rgba(255, 170, 224, 0.2)",paddingBottom:"calc(env(safe-area-inset-bottom, 0px) + 10px)"},dir:"rtl",children:L?d.jsxs(d.Fragment,{children:[g&&d.jsxs("div",{className:"mb-2 px-3 py-2 rounded-lg flex items-center justify-between",style:{background:"rgba(138, 206, 224, 0.1)",border:"1px solid rgba(138, 206, 224, 0.2)"},children:[d.jsxs("span",{className:"text-xs text-gray-300",children:["در حال پاسخ به ",d.jsx("span",{style:{color:"#8ACEE0"},children:g.author})]}),d.jsx("button",{onClick:()=>b(null),className:"text-gray-400 hover:text-white",children:d.jsx(Ds,{className:"w-4 h-4"})})]}),d.jsxs("div",{className:"flex gap-2 items-center",children:[d.jsx("div",{className:"w-8 h-8 rounded-full flex-shrink-0 overflow-hidden",style:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.4) 0%, rgba(62, 121, 131, 0.4) 100%)",border:"1.5px solid rgba(138, 206, 224, 0.5)"},children:d.jsx(xa,{src:H,alt:"پروفایل من",className:"w-full h-full object-cover",fallbackSrc:qn})}),d.jsx("input",{type:"text",value:m,onChange:O=>y(O.target.value),onKeyPress:O=>O.key==="Enter"&&K(),placeholder:g?`پاسخ به ${g.author}...`:"نظر خود را بنویسید...",className:"flex-1 px-4 py-2.5 rounded-full text-white placeholder-gray-400 outline-none transition-all",style:{fontSize:16,background:"rgba(32, 76, 106, 0.3)",border:"1.5px solid rgba(138, 206, 224, 0.3)"},onFocus:O=>{O.target.style.border="1.5px solid rgba(138, 206, 224, 0.6)",O.target.style.boxShadow="0 0 15px rgba(138, 206, 224, 0.3)"},onBlur:O=>{O.target.style.border="1.5px solid rgba(138, 206, 224, 0.3)",O.target.style.boxShadow="none"}}),m.trim()&&d.jsx(se.button,{initial:{scale:0},animate:{scale:1},exit:{scale:0},whileTap:{scale:.9},onClick:K,className:"px-4 py-2.5 rounded-full text-sm font-bold text-white flex-shrink-0",style:{background:"linear-gradient(135deg, #FFB800 0%, #FF9500 100%)",boxShadow:"0 4px 15px rgba(255, 165, 0, 0.4)"},children:"ارسال"})]})]}):d.jsxs("div",{className:"px-4 py-3 rounded-2xl flex items-center justify-between gap-3",style:{background:"rgba(255, 184, 0, 0.1)",border:"1.5px solid rgba(255, 184, 0, 0.3)"},children:[d.jsx("p",{className:"text-sm text-gray-300 flex-1",children:"برای ثبت نظر، ابتدا پروفایل خود را تکمیل کنید"}),d.jsx(se.button,{whileTap:{scale:.95},onClick:()=>{n(),D("/profile")},className:"px-4 py-2 rounded-full text-xs font-bold text-white flex-shrink-0",style:{background:"linear-gradient(135deg, #FFB800 0%, #FF9500 100%)",boxShadow:"0 2px 8px rgba(255, 165, 0, 0.4)"},children:"تکمیل پروفایل"})]})})]}),d.jsx(gn,{children:N&&d.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[60] flex items-center justify-center p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.7)"},onClick:()=>j(null),children:d.jsxs(se.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},exit:{scale:.9,y:20},onClick:O=>O.stopPropagation(),className:"w-full max-w-md rounded-3xl overflow-hidden",style:{background:"linear-gradient(180deg, rgba(32, 76, 106, 0.98) 0%, rgba(20, 40, 60, 0.98) 100%)",border:"2px solid rgba(138, 206, 224, 0.3)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.5)"},children:[d.jsx("div",{className:"px-6 py-4 border-b",style:{borderColor:"rgba(138, 206, 224, 0.2)"},children:d.jsx("h3",{className:"text-lg font-bold text-center",style:{color:"#FFFFFF",textShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"},children:"تایید حذف نظر"})}),d.jsx("div",{className:"p-6",dir:"rtl",children:d.jsxs("p",{className:"text-base text-center leading-relaxed",style:{color:"#FFFFFF",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:["آیا مطمئن هستید که میخواهید این نظر را حذف کنید؟",d.jsx("br",{}),d.jsx("span",{className:"text-sm text-gray-400 mt-2 block",children:"تمام پاسخهای این نظر نیز حذف خواهند شد."})]})}),d.jsxs("div",{className:"px-6 py-4 flex gap-3",dir:"rtl",children:[d.jsx(se.button,{whileTap:{scale:.95},onClick:()=>j(null),className:"flex-1 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, rgba(96, 96, 96, 0.9) 0%, rgba(64, 64, 64, 0.9) 100%)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},children:"انصراف"}),d.jsx(se.button,{whileTap:{scale:.95},onClick:()=>{l&&l(N),j(null)},className:"flex-1 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, #ef4444 0%, #dc2626 100%)",boxShadow:"0 4px 12px rgba(239, 68, 68, 0.4)"},children:"حذف نظر"})]})]})})})]})}),document.body)}const xg="data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20d='M8.93014%206.45563C9.0872%206.31265%209.35273%206.12763%209.53076%205.98322C9.99282%205.60838%2010.4265%205.26103%2010.8381%204.82861C11.0691%204.58506%2011.2862%204.32893%2011.4884%204.06143C11.7709%203.68056%2011.9337%203.35265%2012.3173%203.04952C13.3709%202.21679%2014.2244%203.15344%2014.1072%204.27919C14.0171%205.14458%2013.7154%205.97962%2013.3158%206.739C13.1517%207.09648%2012.934%207.46294%2012.7408%207.80523C12.6635%207.94209%2012.5018%208.16931%2012.4512%208.30253C12.4927%208.42366%2012.7696%208.38337%2012.883%208.38297L13.4778%208.38304L15.4332%208.38323C15.7122%208.38288%2016.1319%208.36986%2016.3939%208.40266C16.8968%208.47021%2017.3516%208.7341%2017.6573%209.13565C17.9692%209.54186%2018.1046%2010.0547%2018.0335%2010.5603C17.9883%2010.8864%2017.7542%2011.4364%2017.6293%2011.7668L16.9186%2013.639L16.2115%2015.5076C16.0861%2015.8391%2015.961%2016.1948%2015.8168%2016.5163C15.6907%2016.7852%2015.5055%2017.002%2015.2755%2017.1858C14.688%2017.655%2014.0365%2017.5913%2013.336%2017.5914L11.6134%2017.5915L9.85324%2017.5913C9.59195%2017.5913%209.33116%2017.5919%209.06951%2017.5876C8.44789%2017.5776%207.91102%2017.303%207.52476%2016.8163C7.04223%2016.2083%207.13643%2015.5001%207.13651%2014.7746L7.13673%2012.6306L7.13682%2010.2716C7.13673%209.84315%207.11446%209.21564%207.17638%208.81556C7.30178%208.00526%207.83312%207.36588%208.44282%206.85042C8.59578%206.72111%208.76661%206.57232%208.93014%206.45563Z'%20fill='url(%23paint0_linear_69_15)'/%3e%3cpath%20d='M8.93014%206.45563C9.0872%206.31265%209.35273%206.12763%209.53076%205.98322C9.99282%205.60838%2010.4265%205.26103%2010.8381%204.82861C11.0691%204.58506%2011.2862%204.32893%2011.4884%204.06143C11.7709%203.68056%2011.9337%203.35265%2012.3173%203.04952C13.3709%202.21679%2014.2244%203.15344%2014.1072%204.27919C14.0171%205.14458%2013.7154%205.97962%2013.3158%206.739C13.1517%207.09648%2012.934%207.46294%2012.7408%207.80523C12.6635%207.94209%2012.5018%208.16931%2012.4512%208.30253C12.4927%208.42366%2012.7696%208.38337%2012.883%208.38297L13.4778%208.38304L15.4332%208.38323C15.7122%208.38288%2016.1319%208.36986%2016.3939%208.40266C16.8968%208.47021%2017.3516%208.7341%2017.6573%209.13565C17.9692%209.54186%2018.1046%2010.0547%2018.0335%2010.5603C17.9883%2010.8864%2017.7542%2011.4364%2017.6293%2011.7668L16.9186%2013.639L16.2115%2015.5076C16.0861%2015.8391%2015.961%2016.1948%2015.8168%2016.5163C15.6907%2016.7852%2015.5055%2017.002%2015.2755%2017.1858C14.688%2017.655%2014.0365%2017.5913%2013.336%2017.5914L11.6134%2017.5915L9.85324%2017.5913C9.59195%2017.5913%209.33116%2017.5919%209.06951%2017.5876C8.44789%2017.5776%207.91102%2017.303%207.52476%2016.8163C7.04223%2016.2083%207.13643%2015.5001%207.13651%2014.7746L7.13673%2012.6306L7.13682%2010.2716C7.13673%209.84315%207.11446%209.21564%207.17638%208.81556C7.30178%208.00526%207.83312%207.36588%208.44282%206.85042C8.59578%206.72111%208.76661%206.57232%208.93014%206.45563Z'%20fill='url(%23paint1_linear_69_15)'/%3e%3c/g%3e%3cg%3e%3cpath%20d='M3.64002%207.50399C4.59494%207.41054%205.45108%208.17183%205.46613%209.11963C5.46828%209.25479%205.47569%209.38642%205.47559%209.52292L5.47482%2010.1911L5.47518%2012.468L5.47589%2014.7783L5.47625%2015.4611C5.47625%2015.634%205.47708%2015.8864%205.45247%2016.057C5.41099%2016.3528%205.29285%2016.6329%205.10959%2016.87C4.81986%2017.2507%204.41411%2017.4334%203.94826%2017.4977C3.49341%2017.5368%203.07863%2017.42%202.71922%2017.1354C2.38499%2016.8709%202.15171%2016.4572%202.10737%2016.0359C2.08908%2015.862%202.09373%2015.6472%202.09388%2015.4695L2.09431%2014.6733L2.09488%2012.0786L2.09506%2010.0008C2.09485%209.33049%202.00446%208.64776%202.47734%208.09594C2.78563%207.73621%203.16914%207.55069%203.64002%207.50399Z'%20fill='url(%23paint2_linear_69_15)'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_69_15'%20x1='15.0323'%20y1='17.6016'%20x2='10.1059'%20y2='4.60476'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2C6C4'/%3e%3cstop%20offset='0.614493'%20stop-color='%23D7ABBE'/%3e%3cstop%20offset='1'%20stop-color='%23BD8EAF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_69_15'%20x1='15.0323'%20y1='17.6016'%20x2='10.1059'%20y2='4.60476'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2C6C4'/%3e%3cstop%20offset='0.614493'%20stop-color='%23D7ABBE'/%3e%3cstop%20offset='1'%20stop-color='%23BD8EAF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_69_15'%20x1='4.53955'%20y1='17.51'%20x2='-0.371472'%20y2='11.5417'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2C6C4'/%3e%3cstop%20offset='0.614493'%20stop-color='%23D7ABBE'/%3e%3cstop%20offset='1'%20stop-color='%23BD8EAF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",Xj="data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.26151%207.04808C2.36271%206.64226%202.55803%206.19349%202.76705%205.83249C3.43492%204.67778%204.54195%203.83661%205.84047%203.49717C6.16362%203.41264%206.49438%203.35989%206.82797%203.3397C7.26517%203.31378%207.86835%203.33109%208.32121%203.33123L11.018%203.33111L13.0919%203.33118C13.578%203.33125%2014.1163%203.31349%2014.5938%203.38011C15.2393%203.47522%2015.8603%203.69267%2016.4229%204.02056C17.5546%204.68065%2018.3824%205.75166%2018.7308%207.00651C18.7754%207.22104%2018.8471%207.45922%2018.8665%207.67816C18.951%208.63431%2018.8882%209.607%2018.9074%2010.5667C18.9102%2010.7055%2018.9063%2010.8529%2018.8975%2010.9909C18.8426%2011.868%2018.5556%2012.7155%2018.0654%2013.4478C17.3301%2014.549%2016.1835%2015.3155%2014.878%2015.5787C14.2122%2015.7139%2013.6255%2015.6778%2012.9552%2015.6812C12.7386%2015.6823%2012.4033%2015.6699%2012.2037%2015.7035C12.0322%2015.7322%2011.694%2015.9027%2011.52%2015.9831L10.9278%2016.2519L7.8034%2017.6647L6.98947%2018.0321C6.85271%2018.0937%206.70771%2018.165%206.56733%2018.2151C6.53514%2018.2265%206.48044%2018.2428%206.4576%2018.2214C6.43628%2018.2013%206.40266%2018.1859%206.40648%2018.1532C6.42422%2018.0011%206.56988%2017.74%206.63335%2017.6061L7.17221%2016.4669C7.27297%2016.2575%207.37978%2016.0495%207.46758%2015.8343C7.5379%2015.6619%207.38007%2015.681%207.26229%2015.6794C7.19601%2015.6784%207.12854%2015.6812%207.06227%2015.6801C6.6308%2015.672%206.20201%2015.6108%205.78577%2015.4978C4.09155%2015.03%202.76592%2013.7208%202.28812%2012.0432C2.1831%2011.6869%202.12063%2011.3196%202.10196%2010.9489C2.07901%2010.4156%202.10022%209.81715%202.09531%209.27816C2.09064%208.76609%202.08243%208.22179%202.13015%207.71449C2.15306%207.47102%202.21758%207.27584%202.26151%207.04808Z'%20fill='url(%23paint0_linear_69_4)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_69_4'%20x1='14.2617'%20y1='18.2393'%20x2='10.7933'%20y2='4.18829'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2C6C4'/%3e%3cstop%20offset='0.614493'%20stop-color='%23D7ABBE'/%3e%3cstop%20offset='1'%20stop-color='%23BD8EAF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";function Tx({id:e,authorName:n,authorAvatar:a,image:s,title:o,caption:l,likes:u,dislikes:f,comments:p,timestamp:m,initialComments:y,mediaType:g="image",mediaUrl:b,isOwnPost:S=!1,initialLikeState:C="",missionType:N,workflowID:j,onDelete:L,teamMemberIds:R,preloadedTeamMembers:D}){const K={border:"1px solid transparent",backgroundImage:"linear-gradient(180deg, rgba(46, 27, 61, 0.95) 0%, rgba(35, 24, 62, 0.93) 100%), linear-gradient(120deg, rgba(124, 58, 237, 0.72) 0%, rgba(249, 115, 22, 0.56) 58%, rgba(250, 204, 21, 0.42) 100%)",backgroundOrigin:"border-box",backgroundClip:"padding-box, border-box",boxShadow:"0 -9px 24px rgba(7, 0, 18, 0.52), 0 14px 30px rgba(5, 2, 12, 0.42), 0 0 20px rgba(255, 121, 207, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.24), inset 0 2px 6px rgba(255, 222, 255, 0.1), inset 0 -2px 0 rgba(12, 7, 27, 0.72), inset 0 -10px 18px rgba(8, 4, 18, 0.36), inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 0 0 2px rgba(17, 10, 35, 0.34)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},[re,O]=v.useState(u),[w,M]=v.useState(f),E=()=>C==="پسند"?"liked":C==="عدم پسند"?"disliked":null,[U,Y]=v.useState(E()),[I,W]=v.useState(!1),[Q,G]=v.useState(!1),[B,_]=v.useState(!1),[X,J]=v.useState(y||[]),[T,A]=v.useState(!1),[te,ie]=v.useState(!1),[oe,ae]=v.useState(!1),[ue,xe]=v.useState(!1),[ve,Ve]=v.useState(1),[Ce,Ue]=v.useState(!1),[Oe,dt]=v.useState(D||[]),[xt,vt]=v.useState(!1),{isProfileComplete:ke}=mr(),Re=an(),we=Te=>{const Ze=it=>Te.filter(gt=>gt.parent===it).map(gt=>({id:gt.comment_id,author:gt.full_name,authorAvatar:Ts(gt.user_stage_id),text:gt.comment_text,timestamp:gt.datetimee,likes:0,isLiked:!1,userStageId:gt.user_stage_id,replies:Ze(gt.comment_id)}));return Te.filter(it=>!it.parent).map(it=>({id:it.comment_id,author:it.full_name,authorAvatar:Ts(it.user_stage_id),text:it.comment_text,timestamp:it.datetimee,likes:0,isLiked:!1,userStageId:it.user_stage_id,replies:Ze(it.comment_id)}))},me=async(Te,Ze)=>{if(j){Ze?xe(!0):ae(!0);try{const ot=await G8(j,Te),it=we(ot.comments);Ue(ot.comments.length>=25),Ve(Te),J(Zt=>Ze?[...Zt,...it]:it)}catch(ot){console.error("Error loading comments:",ot)}finally{ae(!1),xe(!1)}}};v.useEffect(()=>{I&&j&&me(1,!1)},[I,j]),v.useEffect(()=>{D&&dt(D)},[D]),v.useEffect(()=>{D||R&&R.trim()&&!xt&&(vt(!0),jx(R).then(Te=>{Te.success&&dt(Te.data)}).catch(Te=>{console.error("Error loading team members:",Te)}).finally(()=>{vt(!1)}))},[R,xt,D]);const Ie=()=>{if(!ke){A(!0);return}let Te;U==="liked"?(O(re-1),Y(null),Te="حذف"):(U==="disliked"&&M(w-1),O(re+1),Y("liked"),Te="پسند"),N&&j&&pg(Te,N,j)},be=()=>{if(!ke){A(!0);return}let Te;U==="disliked"?(M(w-1),Y(null),Te="حذف"):(U==="liked"&&O(re-1),M(w+1),Y("disliked"),Te="عدم پسند"),N&&j&&pg(Te,N,j)},Ae=(Te,Ze)=>{if(!ke){A(!0);return}N&&j&&(K8(N,j,Te,Ze||""),setTimeout(()=>{me(1,!1)},500))},Qe=()=>{ue||oe||!Ce||me(ve+1,!0)},Ge=Te=>{Y8(Te);const Ze=ot=>ot.filter(it=>it.id===Te?!1:(it.replies&&it.replies.length>0&&(it.replies=Ze(it.replies)),!0));J(ot=>Ze(ot))},rt=X.map(Te=>({id:Te.id,author:Te.author,authorAvatar:Te.authorAvatar||qn,text:Te.text,timestamp:Te.timestamp||"الان",likes:Te.likes||0,isLiked:Te.isLiked||!1,userStageId:Te.userStageId,replies:Te.replies||[]})),ht=Te=>{const Ze=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"];return Te.toString().split("").map(ot=>Ze[parseInt(ot)]).join("")},Pt=(Te=>{if(!Te)return"لحظاتی پیش";const Ze=new Date(Te);if(Number.isNaN(Ze.getTime()))return"لحظاتی پیش";const ot=Date.now()-Ze.getTime();if(ot<=0)return"لحظاتی پیش";const it=60*1e3,Zt=60*it,gt=24*Zt,yr=7*gt,sn=30*gt;return ot<Zt?`${ht(Math.max(1,Math.floor(ot/it)))} دقیقه پیش`:ot<gt?`${ht(Math.floor(ot/Zt))} ساعت پیش`:ot<sn?`${ht(Math.floor(ot/yr))} هفته پیش`:`${ht(Math.floor(ot/sn))} ماه پیش`})(m),qe={border:"0.6px solid rgba(255, 205, 236, 0.085)",background:"linear-gradient(130deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.0075) 32%, rgba(160, 106, 224, 0.05) 100%), linear-gradient(180deg, rgba(88, 52, 126, 0.09) 0%, rgba(48, 31, 85, 0.075) 100%)",boxShadow:"inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -1px 0 rgba(45, 24, 70, 0.13), inset 0 0 16px rgba(188, 131, 255, 0.04), 0 8px 22px rgba(8, 3, 18, 0.085)",backdropFilter:"blur(12px) saturate(108%)",WebkitBackdropFilter:"blur(12px) saturate(108%)"},Sn={border:"0.6px solid rgba(255, 140, 220, 0.38)",background:"linear-gradient(130deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 32%, rgba(255, 121, 207, 0.12) 100%), linear-gradient(180deg, rgba(88, 52, 126, 0.16) 0%, rgba(48, 31, 85, 0.13) 100%)",boxShadow:"inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(45, 24, 70, 0.16), inset 0 0 18px rgba(255, 121, 207, 0.16), 0 0 14px rgba(255, 121, 207, 0.2)"},ft={border:"0.6px solid rgba(255, 140, 220, 0.38)",background:"linear-gradient(130deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 32%, rgba(255, 121, 207, 0.12) 100%), linear-gradient(180deg, rgba(88, 52, 126, 0.16) 0%, rgba(48, 31, 85, 0.13) 100%)",boxShadow:"inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(45, 24, 70, 0.16), inset 0 0 18px rgba(255, 121, 207, 0.16), 0 0 14px rgba(255, 121, 207, 0.2)"},Mn={border:"0.6px solid rgba(255, 205, 236, 0.085)",background:"linear-gradient(130deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.0075) 32%, rgba(160, 106, 224, 0.05) 100%), linear-gradient(180deg, rgba(88, 52, 126, 0.09) 0%, rgba(48, 31, 85, 0.075) 100%)",boxShadow:"inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -1px 0 rgba(45, 24, 70, 0.13), inset 0 0 16px rgba(188, 131, 255, 0.04), 0 8px 22px rgba(8, 3, 18, 0.085)",backdropFilter:"blur(12px) saturate(108%)",WebkitBackdropFilter:"blur(12px) saturate(108%)"};return d.jsxs(se.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-4",children:[d.jsxs("div",{className:"feed-panel rounded-3xl overflow-hidden",style:K,children:[d.jsx("div",{className:"flex items-start px-4 pt-4 pb-2",dir:"rtl",children:d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx("div",{className:"w-12 h-12 rounded-full overflow-hidden flex-shrink-0",style:{border:"1px solid rgba(255, 170, 224, 0.82)",boxShadow:"0 0 12px rgba(255, 121, 207, 0.35)"},children:d.jsx(xa,{src:a,alt:n,className:"w-full h-full object-cover",fallbackSrc:qn})}),d.jsxs("div",{className:"pt-0",children:[d.jsx("h3",{className:"font-bold text-[18px] leading-6 text-right text-white",children:n}),d.jsx("p",{className:"text-[11px] font-normal text-right text-white/75",children:Pt})]})]})}),d.jsxs("div",{className:"px-4 pb-3",dir:"rtl",children:[d.jsx("h3",{className:"font-semibold mb-1 text-[14px]",style:{color:"#ffd6f0",textShadow:"0 2px 4px rgba(0, 0, 0, 0.6)"},children:o}),d.jsx("p",{className:"text-white leading-relaxed text-[12px]",style:{display:"-webkit-box",WebkitLineClamp:Q?"unset":4,WebkitBoxOrient:"vertical",overflow:"hidden"},children:l}),l.length>150&&d.jsx("button",{onClick:()=>G(!Q),className:"text-xs mt-1",style:{color:"#ff9be0"},children:Q?"کمتر":"بیشتر"})]}),d.jsx("div",{className:"px-4 pb-3",children:d.jsx("div",{className:"relative w-full rounded-3xl overflow-hidden",style:{background:"linear-gradient(180deg, rgba(47, 27, 66, 0.92) 0%, rgba(34, 22, 58, 0.9) 100%)",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 121, 207, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(10, 20, 35, 0.5)"},children:g==="video"?d.jsx("video",{src:b,poster:s,controls:!0,playsInline:!0,className:"w-full h-auto cursor-pointer block",style:{objectFit:"contain",display:"block"}}):g==="audio"?d.jsxs("div",{className:"w-full",children:[s&&d.jsx(xa,{src:s,alt:"کاور صوت",className:"w-full h-auto max-h-[600px] mb-4",style:{objectFit:"contain"}}),d.jsx("audio",{src:b,controls:!0,className:"w-full",style:{background:"rgba(255, 255, 255, 0.1)",borderRadius:"12px"}})]}):d.jsx(xa,{src:s,alt:"پست",className:"w-full h-auto max-h-[600px]",style:{objectFit:"contain"}})})}),d.jsx("div",{className:"mx-[14px] mb-[10px] mt-1",dir:"rtl",children:d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsxs(se.button,{whileTap:{scale:.9},onClick:Ie,className:"flex items-center gap-2 px-3 py-1.5 rounded-full transition-all min-w-[30px] justify-center",style:U==="liked"?{...qe,...Sn}:qe,children:[d.jsx("img",{src:xg,alt:"",className:"w-5 h-5 object-contain",style:{filter:U==="liked"?"saturate(1.28) hue-rotate(-8deg) brightness(1.08) drop-shadow(0 0 6px rgba(255, 121, 207, 0.6))":"none",transition:"filter 60ms linear"}}),d.jsx("span",{className:"text-sm font-bold min-w-[20px] text-center",style:{color:"#FFFFFF",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:ht(re)})]}),d.jsxs(se.button,{whileTap:{scale:.9},onClick:be,className:"flex items-center gap-2 px-3 py-1.5 rounded-full transition-all min-w-[30px] justify-center",style:U==="disliked"?{...qe,...ft}:qe,children:[d.jsx("img",{src:xg,alt:"",className:"w-5 h-5 object-contain rotate-180",style:{filter:U==="disliked"?"saturate(1.28) hue-rotate(-8deg) brightness(1.08) drop-shadow(0 0 6px rgba(255, 121, 207, 0.6))":"none",transition:"filter 60ms linear"}}),d.jsx("span",{className:"text-sm font-bold min-w-[20px] text-center",style:{color:"#FFFFFF",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:ht(w)})]})]}),d.jsx("div",{className:"flex items-center",children:d.jsxs(se.button,{whileTap:{scale:.9},onClick:()=>W(!I),className:"flex items-center gap-2 px-3 py-1.5 rounded-full transition-all min-w-[30px] justify-center",style:qe,children:[d.jsx("img",{src:Xj,alt:"",className:"w-5 h-5 object-contain",style:{filter:I?"drop-shadow(0 0 6px rgba(255, 121, 207, 0.6))":"none",transition:"filter 120ms ease"}}),d.jsx("span",{className:"text-sm font-bold min-w-[20px] text-center",style:{color:"#FFFFFF",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:ht(p)})]})})]})}),Oe.length>0&&d.jsxs("div",{className:"mx-[14px] mb-[16px] rounded-full px-4 py-2.5 flex items-center justify-between",style:Mn,dir:"rtl",children:[d.jsxs("button",{type:"button",onClick:()=>_(!0),className:"flex items-center gap-2",children:[d.jsxs("div",{className:"flex -space-x-2",dir:"ltr",children:[Oe.slice(0,3).map(Te=>d.jsx("div",{className:"w-8 h-8 rounded-full overflow-hidden",style:{boxShadow:"0 2px 8px rgba(0, 0, 0, 0.28)"},children:d.jsx(xa,{src:Ts(Te.StageID.toString()),alt:Te.full_name,className:"w-full h-full object-cover",fallbackSrc:qn})},Te.StageID)),Oe.length>3&&d.jsxs("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-[11px] font-bold text-white",style:{background:"rgba(255, 121, 207, 0.35)"},children:["+",ht(Oe.length-3)]})]}),d.jsx("div",{className:"text-[#ffd6f0] text-[14px] whitespace-nowrap",children:"همکاریکنندگان"})]}),d.jsx(i6,{size:18,color:"#ffd6f0"})]})]}),d.jsx(Gj,{isOpen:I,onClose:()=>W(!1),comments:rt,postAuthor:n,onAddComment:Ae,onDeleteComment:Ge,hasMoreComments:Ce,isLoadingMoreComments:ue,onLoadMoreComments:Qe}),d.jsx(gn,{children:B&&Oe.length>0&&d.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.7)"},onClick:()=>_(!1),children:d.jsxs(se.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},exit:{scale:.9,y:20},onClick:Te=>Te.stopPropagation(),className:"w-full max-w-md rounded-3xl overflow-hidden",style:{background:"linear-gradient(180deg, rgba(46, 27, 61, 0.98) 0%, rgba(35, 24, 62, 0.98) 100%)",border:"1px solid rgba(255, 170, 224, 0.4)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.5)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",maxHeight:"80vh"},children:[d.jsx("div",{className:"px-6 py-4 border-b",style:{borderColor:"rgba(255, 170, 224, 0.2)"},children:d.jsxs("h3",{className:"text-lg font-bold text-center",style:{color:"#FFFFFF",textShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"},children:["مشارکتکنندگان (",ht(Oe.length)," نفر)"]})}),d.jsx("div",{className:"overflow-y-auto p-4",style:{maxHeight:"60vh"},children:d.jsx("div",{className:"space-y-3",children:Oe.map((Te,Ze)=>d.jsxs(se.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:Ze*.05},className:"flex items-center gap-3 p-3 rounded-2xl",style:{background:"linear-gradient(135deg, rgba(85, 48, 121, 0.4) 0%, rgba(48, 31, 85, 0.4) 100%)",border:"1px solid rgba(255, 170, 224, 0.2)"},dir:"rtl",children:[d.jsx("div",{className:"w-12 h-12 rounded-full overflow-hidden flex-shrink-0",style:{boxShadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},children:d.jsx(xa,{src:Ts(Te.StageID.toString()),alt:Te.full_name,className:"w-full h-full object-cover",fallbackSrc:qn})}),d.jsx("div",{className:"flex-1",children:d.jsx("h4",{className:"font-bold text-base",style:{color:"#FFFFFF",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:Te.full_name})})]},Te.StageID))})}),d.jsx("div",{className:"px-6 py-4",children:d.jsx(se.button,{whileTap:{scale:.95},onClick:()=>_(!1),className:"w-full py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, rgba(255, 121, 207, 0.9) 0%, rgba(124, 58, 237, 0.85) 100%)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},children:"بستن"})})]})})}),d.jsx(gn,{children:T&&d.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.7)"},onClick:()=>A(!1),children:d.jsxs(se.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},exit:{scale:.9,y:20},onClick:Te=>Te.stopPropagation(),className:"w-full max-w-md rounded-3xl overflow-hidden",style:{background:"linear-gradient(180deg, rgba(32, 76, 106, 0.98) 0%, rgba(20, 40, 60, 0.98) 100%)",border:"2px solid rgba(138, 206, 224, 0.3)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.5)",maxHeight:"80vh"},children:[d.jsx("div",{className:"px-6 py-4 border-b",style:{borderColor:"rgba(138, 206, 224, 0.2)"},children:d.jsx("h3",{className:"text-lg font-bold text-center",style:{color:"#FFFFFF",textShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"},children:"اخطار"})}),d.jsx("div",{className:"p-6",dir:"rtl",children:d.jsx("p",{className:"text-base text-center leading-relaxed",style:{color:"#FFFFFF",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:"برای لایک، دیسلایک یا نظر دادن به پستها، ابتدا باید پروفایل خود را تکمیل کنید."})}),d.jsxs("div",{className:"px-6 py-4 flex gap-3",dir:"rtl",children:[d.jsx(se.button,{whileTap:{scale:.95},onClick:()=>A(!1),className:"flex-1 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, rgba(96, 96, 96, 0.9) 0%, rgba(64, 64, 64, 0.9) 100%)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},children:"بستن"}),d.jsx(se.button,{whileTap:{scale:.95},onClick:()=>{A(!1),Re("/profile")},className:"flex-1 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, #FFB800 0%, #FF9500 100%)",boxShadow:"0 4px 12px rgba(255, 165, 0, 0.4)"},children:"تکمیل پروفایل"})]})]})})}),d.jsx(gn,{children:te&&d.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.7)"},onClick:()=>ie(!1),children:d.jsxs(se.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},exit:{scale:.9,y:20},onClick:Te=>Te.stopPropagation(),className:"w-full max-w-md rounded-3xl overflow-hidden",style:{background:"linear-gradient(180deg, rgba(32, 76, 106, 0.98) 0%, rgba(20, 40, 60, 0.98) 100%)",border:"2px solid rgba(138, 206, 224, 0.3)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.5)",maxHeight:"80vh"},children:[d.jsx("div",{className:"px-6 py-4 border-b",style:{borderColor:"rgba(138, 206, 224, 0.2)"},children:d.jsx("h3",{className:"text-lg font-bold text-center",style:{color:"#FFFFFF",textShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"},children:"تایید حذف"})}),d.jsx("div",{className:"p-6",dir:"rtl",children:d.jsx("p",{className:"text-base text-center leading-relaxed",style:{color:"#FFFFFF",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:"آیا مطمئن هستید که میخواهید این پست را حذف کنید؟"})}),d.jsxs("div",{className:"px-6 py-4 flex gap-3",dir:"rtl",children:[d.jsx(se.button,{whileTap:{scale:.95},onClick:()=>ie(!1),className:"flex-1 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, rgba(96, 96, 96, 0.9) 0%, rgba(64, 64, 64, 0.9) 100%)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},children:"انصراف"}),d.jsx(se.button,{whileTap:{scale:.95},onClick:()=>{N&&j&&W8(N,j),ie(!1),L&&e&&L(e)},className:"flex-1 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, #ef4444 0%, #dc2626 100%)",boxShadow:"0 4px 12px rgba(239, 68, 68, 0.4)"},children:"حذف"})]})]})})})]})}const Jj=["https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=400&q=80","https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=400&q=80","https://images.unsplash.com/photo-1527980965255-d3b416303d12?w=400&q=80","https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=400&q=80","https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=400&q=80","https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=400&q=80","https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=400&q=80","https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?w=400&q=80","https://images.unsplash.com/photo-1554151228-14d9def656e4?w=400&q=80","https://images.unsplash.com/photo-1522075469751-3a6694fb2f61?w=400&q=80","https://images.unsplash.com/photo-1517841905240-472988babdf9?w=400&q=80","https://images.unsplash.com/photo-1542909168-82c3e7fdca5c?w=400&q=80"];function qj({isOpen:e,onClose:n,onSelectAvatar:a,currentAvatar:s}){const[o,l]=v.useState(null),[u,f]=v.useState(null),[p,m]=v.useState(null),[y,g]=v.useState(!1),b=v.useRef(null),S=N=>{var L;const j=(L=N.target.files)==null?void 0:L[0];if(j){m(j);const R=new FileReader;R.onloadend=()=>{const D=R.result;f(D),l(D)},R.readAsDataURL(j)}},C=async()=>{if(console.log("handleConfirm called"),console.log("selectedAvatar:",o),console.log("uploadedImageFile:",p),!!o){g(!0);try{let N=p;if(!p&&o.startsWith("http")){console.log("Downloading suggested avatar from URL:",o);try{const L=await(await fetch(o)).blob(),R=`avatar_${Date.now()}.jpg`;N=new File([L],R,{type:L.type||"image/jpeg"}),console.log("Downloaded file:",N.name,N.size)}catch(j){console.error("Error downloading suggested avatar:",j),alert("خطا در دانلود تصویر. لطفاً دوباره تلاش کنید."),g(!1);return}}if(N){console.log("Starting image upload...",N.name);const j=await Fs(N);console.log("Upload result:",j),j?(console.log("Sending filename to parent:",j),a(j),n()):(console.error("Upload returned null filename"),alert("خطا در آپلود تصویر. لطفاً دوباره تلاش کنید."))}else console.error("No file to upload"),alert("لطفاً یک تصویر انتخاب کنید.")}catch(N){console.error("Error in handleConfirm:",N),alert("خطا در آپلود تصویر. لطفاً دوباره تلاش کنید.")}finally{g(!1)}}};return d.jsx(gn,{children:e&&d.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[100] flex items-center justify-center p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.8)"},onClick:n,children:d.jsxs(se.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},exit:{scale:.9,y:20},onClick:N=>N.stopPropagation(),className:"w-full max-w-md rounded-3xl overflow-hidden",style:{background:"linear-gradient(180deg, rgba(32, 76, 106, 0.98) 0%, rgba(20, 40, 60, 0.98) 100%)",border:"2px solid rgba(138, 206, 224, 0.3)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.5)",maxHeight:"85vh"},children:[d.jsxs("div",{className:"px-6 py-4 border-b flex items-center justify-between",style:{borderColor:"rgba(138, 206, 224, 0.2)"},children:[d.jsx("h3",{className:"text-lg font-bold",style:{color:"#FFFFFF",textShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"},children:"انتخاب عکس پروفایل"}),d.jsx(se.button,{whileTap:{scale:.9},onClick:n,className:"w-8 h-8 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%)",boxShadow:"0 2px 8px rgba(239, 68, 68, 0.4)"},children:d.jsx(Ds,{className:"w-5 h-5 text-white"})})]}),d.jsxs("div",{className:"overflow-y-auto p-6",style:{maxHeight:"calc(85vh - 180px)"},children:[d.jsxs("div",{className:"mb-6",children:[d.jsx("h4",{className:"text-sm font-bold mb-3",style:{color:"#8ACEE0",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:"آپلود عکس شخصی"}),d.jsx("input",{ref:b,type:"file",accept:"image/*",onChange:S,className:"hidden"}),d.jsxs(se.button,{whileTap:{scale:.95},onClick:()=>{var N;return(N=b.current)==null?void 0:N.click()},className:"w-full py-4 rounded-2xl font-bold text-sm flex items-center justify-center gap-2",style:{background:"linear-gradient(135deg, rgba(96, 147, 157, 0.9) 0%, rgba(76, 127, 137, 0.9) 100%)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1)",border:"2px solid rgba(138, 206, 224, 0.3)",color:"#FFFFFF",textShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"},children:[d.jsx(Df,{className:"w-5 h-5"}),d.jsx("span",{children:"انتخاب از گالری"})]}),u&&d.jsx(se.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},className:"mt-4 flex justify-center",children:d.jsx("div",{className:"w-24 h-24 rounded-full overflow-hidden",style:{border:"3px solid rgba(138, 206, 224, 0.5)",boxShadow:"0 4px 16px rgba(138, 206, 224, 0.4), inset 0 -4px 12px rgba(0, 0, 0, 0.3)"},children:d.jsx("img",{src:u,alt:"آپلود شده",className:"w-full h-full object-cover"})})})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-sm font-bold mb-3",style:{color:"#8ACEE0",textShadow:"0 1px 2px rgba(0, 0, 0, 0.3)"},children:"عکسهای پیشنهادی"}),d.jsx("div",{className:"grid grid-cols-4 gap-3",children:Jj.map((N,j)=>d.jsxs(se.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:j*.05},whileTap:{scale:.9},onClick:()=>{l(N),f(null),m(null)},className:"aspect-square rounded-full overflow-hidden relative",style:{border:o===N?"3px solid rgba(255, 193, 7, 0.8)":"2px solid rgba(138, 206, 224, 0.3)",boxShadow:o===N?"0 4px 16px rgba(255, 193, 7, 0.6), inset 0 0 20px rgba(255, 193, 7, 0.2)":"0 2px 8px rgba(0, 0, 0, 0.3)"},children:[d.jsx("img",{src:N,alt:`آواتار ${j+1}`,className:"w-full h-full object-cover"}),o===N&&d.jsx(se.div,{initial:{scale:0},animate:{scale:1},className:"absolute inset-0 flex items-center justify-center",style:{background:"rgba(255, 193, 7, 0.3)"},children:d.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(255, 193, 7, 0.95) 0%, rgba(255, 152, 0, 0.95) 100%)",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.4)"},children:d.jsx(sx,{className:"w-3 h-3 text-white"})})})]},j))})]})]}),d.jsxs("div",{className:"px-6 py-4 border-t flex gap-3",style:{borderColor:"rgba(138, 206, 224, 0.2)"},children:[d.jsx(se.button,{whileTap:{scale:.95},onClick:n,className:"flex-1 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, rgba(96, 147, 157, 0.6) 0%, rgba(76, 127, 137, 0.6) 100%)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)",border:"1.5px solid rgba(138, 206, 224, 0.3)"},children:"انصراف"}),d.jsx(se.button,{whileTap:{scale:o?.95:1},onClick:C,disabled:!o||y,className:"flex-1 py-3 rounded-full font-bold",style:{background:o&&!y?"linear-gradient(135deg, rgba(255, 193, 7, 0.95) 0%, rgba(255, 152, 0, 0.95) 100%)":"linear-gradient(135deg, rgba(96, 147, 157, 0.3) 0%, rgba(76, 127, 137, 0.3) 100%)",boxShadow:o&&!y?"0 4px 16px rgba(255, 193, 7, 0.5)":"0 2px 8px rgba(0, 0, 0, 0.2)",border:o&&!y?"1.5px solid rgba(255, 200, 50, 0.5)":"1.5px solid rgba(138, 206, 224, 0.2)",color:o&&!y?"#5A3800":"#FFFFFF50",textShadow:o&&!y?"0 1px 0 rgba(255, 255, 255, 0.2)":"none",cursor:o&&!y?"pointer":"not-allowed",opacity:o&&!y?1:.6},children:y?"در حال آپلود...":"تایید"})]})]})})})}function Qj(e){return{"تخته سیاه":"1",نیمکت:"2","دفترچه یادداشت":"3","دیوار حیاط":"4",آبخوری:"5","زنگ ورزش":"6","سه ماه تعطیلی":"7","روزنامه دیواری":"8","زنگ تفریح":"9"}[e]||"1"}const Zj=e=>e==="انجام شده"?{icon:d.jsx(zd,{className:"w-4 h-4"}),text:"انجام شده",gradient:"linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(22, 163, 74, 0.9) 100%)",border:"rgba(34, 197, 94, 0.5)",shadow:"0 2px 8px rgba(34, 197, 94, 0.4)"}:e==="تایید شده"?{icon:d.jsx(zd,{className:"w-4 h-4"}),text:"تایید شده",gradient:"linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(37, 99, 235, 0.9) 100%)",border:"rgba(59, 130, 246, 0.5)",shadow:"0 2px 8px rgba(59, 130, 246, 0.4)"}:e==="در حال انجام"?{icon:d.jsx(Xi,{className:"w-4 h-4"}),text:"در حال انجام",gradient:"linear-gradient(135deg, rgba(255, 193, 7, 0.9) 0%, rgba(255, 160, 0, 0.9) 100%)",border:"rgba(255, 193, 7, 0.5)",shadow:"0 2px 8px rgba(255, 193, 7, 0.4)"}:e==="رد شده"?{icon:d.jsx(ox,{className:"w-4 h-4"}),text:"رد شده",gradient:"linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%)",border:"rgba(239, 68, 68, 0.5)",shadow:"0 2px 8px rgba(239, 68, 68, 0.4)"}:{icon:d.jsx(m6,{className:"w-4 h-4"}),text:e,gradient:"linear-gradient(135deg, rgba(156, 163, 175, 0.9) 0%, rgba(107, 114, 128, 0.9) 100%)",border:"rgba(156, 163, 175, 0.5)",shadow:"0 2px 8px rgba(156, 163, 175, 0.4)"};function eC(){const e=an();gr("پروفایل");const{refreshProfile:n}=mr(),[a,s]=v.useState(null),[o,l]=v.useState(null),[u,f]=v.useState(!1),[p,m]=v.useState(!0),[y,g]=v.useState("challenges"),[b,S]=v.useState(!1),[C,N]=v.useState([]),[j,L]=v.useState([]),[R,D]=v.useState([]),[H,K]=v.useState(!1);v.useEffect(()=>{const I=Hw();s(I),re()},[]);const re=async()=>{m(!0);try{const I=hr();I&&l(I);const W=await Xl();W&&l(W)}catch{}finally{m(!1)}O()},O=async()=>{K(!0);try{const I=await j8();I&&(N(I.challenges),L(I.coin_transaction),D(I.posts))}catch(I){console.error("خطا در بارگذاری دادههای پروفایل:",I)}finally{K(!1)}},w=async()=>{f(!0);try{await Kw(),e("/login",{state:{error:"شما با موفقیت از سیستم خارج شدید"}})}catch(I){console.error("خطا در خروج:",I),e("/login",{state:{error:"شما با موفقیت از سیستم خارج شدید"}})}finally{f(!1)}},M=I=>{if(I==null)return"۰";const W="۰۱۲۳۴۵۶۷۸۹";return String(I).replace(/\d/g,Q=>W[parseInt(Q)])},E=async I=>{if(console.log("handleAvatarSelect called with:",I),o){l({...o,image:I});try{const W=o.username,Q={WorkflowID:o.user_workflowID,user:{username:W,name:o.name,family:o.family,education_level:o.education_level,base:o.base,image:I}};console.log("Saving profile with data:",JSON.stringify(Q));const G=await mx(Q);console.log("Save profile result:",G),console.log("Reloading profile from server..."),await n(),console.log("Profile reloaded successfully")}catch(W){console.error("Error saving avatar:",W),alert("خطا در ذخیره تصویر پروفایل")}}else console.error("No userProfile available")},U=I=>{D(W=>W.filter(Q=>Q.workflow_ID!==I))},Y={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",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)"};return d.jsxs("div",{className:"pt-6 pb-2",dir:"rtl",children:[d.jsxs(se.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},className:"flex flex-col items-center mb-4",children:[d.jsxs("div",{className:"relative mb-3",children:[d.jsx(se.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",duration:.5},className:"w-24 h-24 rounded-full p-[2px]",style:Y,children:d.jsx("div",{className:"w-full h-full rounded-full overflow-hidden flex items-center justify-center",style:Y,children:o!=null&&o.image?d.jsx(xa,{src:Ol(o.image,o.user_stage_id),alt:"پروفایل",className:"w-full h-full rounded-full object-cover",fallbackSrc:qn,style:{filter:"drop-shadow(0 3px 6px rgba(138, 206, 224, 0.6))"}}):d.jsx("img",{src:qn,alt:"پروفایل",className:"w-[84px] h-[84px] object-cover rounded-full"})})}),d.jsx(se.button,{whileTap:{scale:.9},whileHover:{scale:1.1},onClick:()=>S(!0),className:"absolute bottom-0 right-0 w-8 h-8 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(255, 193, 7, 0.95) 0%, rgba(255, 152, 0, 0.95) 100%)",boxShadow:"0 3px 10px rgba(255, 193, 7, 0.6), 0 0 16px rgba(255, 193, 7, 0.4)",border:"2px solid rgba(255, 255, 255, 0.9)"},children:d.jsx(sx,{className:"w-3.5 h-3.5",style:{color:"#5A3800"}})})]}),d.jsx("h2",{className:"text-white text-lg font-bold mb-0.5",style:{textShadow:"0 3px 8px rgba(138, 206, 224, 0.6), 0 2px 4px rgba(0, 0, 0, 0.8)"},children:p?"در حال بارگذاری...":o?`${o.name} ${o.family}`:a?`${a.Name} ${a.Family}`:"کاربر گرامی"}),o&&d.jsxs("div",{style:{color:"rgba(138, 206, 224, 0.8)"},className:"text-[10px] mb-3",children:[o.education_level," - پایه ",o.base]}),d.jsx("div",{className:"flex gap-2.5 mb-3",children:[{label:"چالشها",value:M(C.filter(I=>I.status==="انجام شده").length)},{label:"سکهها",value:M(o==null?void 0:o.coin_count)},{label:"پستها",value:M(R.length)}].map((I,W)=>d.jsxs("div",{className:"px-4 py-2 rounded-2xl",style:{background:"linear-gradient(135deg, rgba(32, 76, 106, 0.6) 0%, rgba(20, 40, 60, 0.6) 100%)",border:"1.5px solid rgba(138, 206, 224, 0.3)",boxShadow:"inset 0 1.5px 6px rgba(0, 0, 0, 0.4), 0 3px 8px rgba(0, 0, 0, 0.3)"},children:[d.jsx("div",{className:"text-white font-bold text-sm mb-0.5",children:I.value}),d.jsx("div",{style:{color:"#8ACEE0"},className:"text-[9px]",children:I.label})]},W))}),d.jsxs("div",{className:"flex gap-2 w-full",children:[o!=null&&o.user_workflowID?d.jsxs(se.button,{whileHover:{scale:1.03},whileTap:{scale:.97},onClick:()=>e("/edit-profile"),className:"flex-1 flex items-center justify-center gap-1.5 px-4 py-2 rounded-2xl font-bold text-xs",style:{background:"linear-gradient(135deg, rgba(76, 175, 80, 0.9) 0%, rgba(56, 142, 60, 0.9) 100%)",boxShadow:"0 3px 12px rgba(76, 175, 80, 0.4)",color:"#FFFFFF",textShadow:"0 1px 3px rgba(0, 0, 0, 0.5)"},children:[d.jsx(dg,{size:14}),d.jsx("span",{children:"ویرایش"})]}):p?null:d.jsxs(se.button,{whileHover:{scale:1.03},whileTap:{scale:.97},onClick:()=>e("/edit-profile"),className:"flex-1 flex items-center justify-center gap-1.5 px-4 py-2 rounded-2xl font-bold text-xs",style:{background:"linear-gradient(135deg, rgba(255, 193, 7, 0.9) 0%, rgba(255, 160, 0, 0.9) 100%)",boxShadow:"0 3px 12px rgba(255, 193, 7, 0.4)",color:"#FFFFFF",textShadow:"0 1px 3px rgba(0, 0, 0, 0.5)"},children:[d.jsx(dg,{size:14}),d.jsx("span",{children:"تکمیل پروفایل"})]}),d.jsxs(se.button,{whileHover:{scale:u?1:1.03},whileTap:{scale:u?1:.97},onClick:w,disabled:u,className:"flex-1 flex items-center justify-center gap-1.5 px-4 py-2 rounded-2xl font-bold text-xs",style:{background:u?"linear-gradient(135deg, rgba(120, 30, 40, 0.7) 0%, rgba(96, 24, 32, 0.7) 100%)":"linear-gradient(135deg, rgba(220, 53, 69, 0.9) 0%, rgba(176, 42, 55, 0.9) 100%)",boxShadow:"0 3px 12px rgba(220, 53, 69, 0.4)",color:"#FFFFFF",textShadow:"0 1px 3px rgba(0, 0, 0, 0.5)",opacity:u?.7:1,cursor:u?"not-allowed":"pointer"},children:[d.jsx(D6,{size:14}),d.jsx("span",{children:u?"خروج...":"خروج"})]})]})]}),d.jsxs("div",{className:"mb-3 flex gap-2",children:[d.jsx(se.button,{whileTap:{scale:.97},onClick:()=>g("challenges"),className:"flex-1 py-2 rounded-2xl font-bold text-[11px] flex items-center justify-center gap-1",style:{background:y==="challenges"?"linear-gradient(135deg, rgba(255, 183, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)":"linear-gradient(135deg, rgba(50, 107, 118, 0.6) 0%, rgba(32, 76, 106, 0.6) 100%)",boxShadow:y==="challenges"?"0 3px 12px rgba(255, 165, 0, 0.5)":"0 2px 6px rgba(0, 0, 0, 0.3)",border:y==="challenges"?"1.5px solid rgba(255, 200, 50, 0.5)":"1.5px solid rgba(138, 206, 224, 0.3)",color:y==="challenges"?"#5A3800":"#FFFFFF",textShadow:y==="challenges"?"0 1px 0 rgba(255, 255, 255, 0.2)":"none"},children:"سابقه چالشها"}),d.jsx(se.button,{whileTap:{scale:.97},onClick:()=>g("coins"),className:"flex-1 py-2 rounded-2xl font-bold text-[11px] flex items-center justify-center gap-1",style:{background:y==="coins"?"linear-gradient(135deg, rgba(255, 183, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)":"linear-gradient(135deg, rgba(50, 107, 118, 0.6) 0%, rgba(32, 76, 106, 0.6) 100%)",boxShadow:y==="coins"?"0 3px 12px rgba(255, 165, 0, 0.5)":"0 2px 6px rgba(0, 0, 0, 0.3)",border:y==="coins"?"1.5px solid rgba(255, 200, 50, 0.5)":"1.5px solid rgba(138, 206, 224, 0.3)",color:y==="coins"?"#5A3800":"#FFFFFF",textShadow:y==="coins"?"0 1px 0 rgba(255, 255, 255, 0.2)":"none"},children:"سابقه سکهها"}),d.jsx(se.button,{whileTap:{scale:.97},onClick:()=>g("posts"),className:"flex-1 py-2 rounded-2xl font-bold text-[11px] flex items-center justify-center gap-1",style:{background:y==="posts"?"linear-gradient(135deg, rgba(255, 183, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)":"linear-gradient(135deg, rgba(50, 107, 118, 0.6) 0%, rgba(32, 76, 106, 0.6) 100%)",boxShadow:y==="posts"?"0 3px 12px rgba(255, 165, 0, 0.5)":"0 2px 6px rgba(0, 0, 0, 0.3)",border:y==="posts"?"1.5px solid rgba(255, 200, 50, 0.5)":"1.5px solid rgba(138, 206, 224, 0.3)",color:y==="posts"?"#5A3800":"#FFFFFF",textShadow:y==="posts"?"0 1px 0 rgba(255, 255, 255, 0.2)":"none"},children:"پستها"})]}),y==="challenges"&&d.jsx("div",{className:"space-y-3",children:H?d.jsx("div",{className:"text-center text-white/60 py-8",children:"در حال بارگذاری..."}):C.length===0?d.jsx("div",{className:"text-center text-white/60 py-8",children:"هنوز چالشی ثبت نشده است"}):C.map((I,W)=>{const Q=Zj(I.status),G=parseInt(I.coin_count||"0"),B=I.status==="در حال انجام";return d.jsxs(se.div,{initial:{opacity:0,x:-30},animate:{opacity:1,x:0},transition:{delay:W*.08,duration:.3},onClick:()=>{if(B&&I.mission_id){const _=Qj(I.mission_type);e(`/chatbot/${_}?missionId=${I.mission_id}&missionType=${encodeURIComponent(I.mission_type)}&continueMode=true`)}},className:`rounded-2xl p-4 ${B?"cursor-pointer":""}`,style:{background:B?"linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 152, 0, 0.15) 100%)":"linear-gradient(135deg, rgba(32, 76, 106, 0.5) 0%, rgba(20, 40, 60, 0.5) 100%)",border:B?"1.5px solid rgba(255, 193, 7, 0.4)":"1.5px solid rgba(138, 206, 224, 0.3)",boxShadow:B?"0 4px 16px rgba(255, 193, 7, 0.3)":"0 4px 12px rgba(0, 0, 0, 0.3)"},whileHover:B?{scale:1.02,y:-2}:{},whileTap:B?{scale:.98}:{},children:[d.jsxs("div",{className:"flex items-start justify-between mb-2",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[d.jsx("h3",{className:`font-bold text-sm ${B?"text-yellow-300":"text-white"}`,children:I.mission_title}),B&&d.jsx(se.div,{animate:{x:[0,4,0]},transition:{repeat:1/0,duration:1.5},children:d.jsx(Xi,{className:"w-3.5 h-3.5 text-yellow-300"})})]}),d.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full text-white text-[10px] font-bold",style:{background:Q.gradient,border:`1px solid ${Q.border}`,boxShadow:Q.shadow},children:[Q.icon,d.jsx("span",{children:Q.text})]})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-white/60 text-xs",children:I.datetime1}),B&&d.jsx("span",{className:"text-white/50 text-[10px] px-2 py-0.5 rounded-full",style:{background:"rgba(138, 206, 224, 0.2)",border:"1px solid rgba(138, 206, 224, 0.3)"},children:I.mission_type})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[(I.status==="انجام شده"||I.status==="تایید شده")&&G>0&&d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("img",{src:Cl,alt:"سکه",className:"w-4 h-4"}),d.jsxs("span",{className:"text-yellow-400 font-bold text-xs",children:["+",M(G)]})]}),B?d.jsx("span",{className:"text-yellow-300 text-[10px] font-bold",children:"برای ادامه کلیک کنید ←"}):d.jsx("span",{className:"text-white/50 text-[10px]",children:I.mission_type})]})]})]},I.mission_done_id)})}),y==="coins"&&d.jsxs("div",{className:"space-y-3",children:[d.jsx(se.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"rounded-2xl p-4 mb-4",style:{background:"linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 152, 0, 0.2) 100%)",border:"2px solid rgba(255, 193, 7, 0.4)",boxShadow:"0 4px 16px rgba(255, 193, 7, 0.3)"},children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-white/70 text-xs mb-1",children:"مجموع سکههای دریافتی"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("img",{src:Cl,alt:"سکه",className:"w-8 h-8"}),d.jsx("span",{className:"text-yellow-300 font-bold text-2xl",children:M(o==null?void 0:o.coin_count)})]})]}),d.jsx(y8,{className:"w-8 h-8 text-yellow-300"})]})}),H?d.jsx("div",{className:"text-center text-white/60 py-8",children:"در حال بارگذاری..."}):j.length===0?d.jsx("div",{className:"text-center text-white/60 py-8",children:"هنوز تراکنشی ثبت نشده است"}):j.map((I,W)=>{const Q=parseInt(I.coin_count||"0"),G=Q<0,B=Math.abs(Q);return d.jsx(se.div,{initial:{opacity:0,x:-30},animate:{opacity:1,x:0},transition:{delay:W*.08,duration:.3},className:"rounded-2xl p-4",style:{background:G?"linear-gradient(135deg, rgba(76, 29, 29, 0.5) 0%, rgba(60, 20, 20, 0.5) 100%)":"linear-gradient(135deg, rgba(32, 76, 106, 0.5) 0%, rgba(20, 40, 60, 0.5) 100%)",border:G?"1.5px solid rgba(239, 68, 68, 0.4)":"1.5px solid rgba(138, 206, 224, 0.3)",boxShadow:G?"0 4px 12px rgba(239, 68, 68, 0.2)":"0 4px 12px rgba(0, 0, 0, 0.3)"},children:d.jsxs("div",{className:"flex items-start justify-between mb-2",children:[d.jsx("h3",{className:"text-white font-bold text-sm flex-1",children:I.description}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("img",{src:Cl,alt:"سکه",className:"w-5 h-5",style:{filter:G?"grayscale(100%) brightness(0.8)":"none"}}),d.jsxs("span",{className:"font-bold text-sm",style:{color:G?"#ef4444":"#fcd34d"},children:[G?"-":"+",M(B)]})]})]})},`${I.StageID}-${W}`)})]}),y==="posts"&&d.jsx("div",{className:"space-y-4",children:H?d.jsx("div",{className:"text-center text-white/60 py-8",children:"در حال بارگذاری..."}):R.length===0?d.jsx("div",{className:"text-center text-white/60 py-8",children:"هنوز پستی منتشر نشده است"}):R.map((I,W)=>{let Q="image",G,B;return I.film?(Q="video",G=bx(I.StageID),B=I.image?Rs(I.StageID):""):I.audio?(Q="audio",G=wx(I.StageID),B=I.image?Rs(I.StageID):""):(Q="image",B=I.image?Rs(I.StageID):""),d.jsxs("div",{children:[d.jsxs(se.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},transition:{delay:W*.05},className:"mb-3 flex items-center gap-3",dir:"rtl",children:[d.jsx("div",{className:"h-[1px] flex-1",style:{background:"rgba(138, 206, 224, 0.3)"}}),d.jsx("span",{className:"text-xs text-white/60 px-2",children:I.mission_type}),d.jsx("div",{className:"h-[1px] flex-1",style:{background:"rgba(138, 206, 224, 0.3)"}})]}),d.jsx(Tx,{id:I.workflow_ID,authorName:I.full_name,authorUsername:I.user_id,authorAvatar:Ts(I.person_stage_id),image:B,title:I.title,caption:I.description,likes:I.like_count||0,dislikes:I.dislike_count||0,comments:I.comment_count||0,timestamp:"",topicName:I.mission_type,mediaType:Q,mediaUrl:G,isOwnPost:!0,workflowID:I.workflow_ID,missionType:I.mission_type,initialLikeState:I.like_state||"",onDelete:U})]},I.workflow_ID)})}),d.jsx(qj,{isOpen:b,onClose:()=>S(!1),onSelectAvatar:E,currentAvatar:o!=null&&o.image?Ol(o.image,o.user_stage_id):void 0})]})}function tC(){const e=an(),n=Gt();gr("ویرایش پروفایل");const{refreshProfile:a}=mr(),[s,o]=v.useState(!0),[l,u]=v.useState(!1),[f,p]=v.useState(null),[m,y]=v.useState(""),[g,b]=v.useState({name:"",family:"",education_level:"",base:""}),[S,C]=v.useState({});v.useEffect(()=>{var D;N(),(D=n.state)!=null&&D.message&&(y(n.state.message),window.history.replaceState({},document.title),setTimeout(()=>{y("")},5e3))},[n]);const N=async()=>{o(!0);try{const D=hr();D&&(p(D),b({name:D.name||"",family:D.family||"",education_level:D.education_level||"",base:D.base||""}));const H=await Xl();H&&(p(H),b({name:H.name||"",family:H.family||"",education_level:H.education_level||"",base:H.base||""}))}catch{console.warn("عدم دسترسی به سرور - از دادههای کش استفاده میشود")}finally{o(!1)}},j=()=>{const D={};return g.name.trim()||(D.name="نام الزامی است"),g.family.trim()||(D.family="نام خانوادگی الزامی است"),g.education_level||(D.education_level="مقطع تحصیلی الزامی است"),g.base||(D.base="پایه تحصیلی الزامی است"),C(D),Object.keys(D).length===0},L=async D=>{if(D.preventDefault(),!!j()){u(!0);try{const H=Ww();if(!H)throw new Error("نام کاربری یافت نشد");const K={username:H,name:g.name,family:g.family,education_level:g.education_level,base:g.base},re=f!=null&&f.user_workflowID?{WorkflowID:f.user_workflowID,user:K}:{user:K};console.log("Saving profile data:",JSON.stringify(re)),await mx(re)?(await a(),e("/profile")):alert("خطا در ذخیره اطلاعات")}catch(H){console.error("خطا در ذخیره:",H),alert("خطا در ذخیره اطلاعات")}finally{u(!1)}}},R=(D,H)=>{b(K=>({...K,[D]:H})),S[D]&&C(K=>{const re={...K};return delete re[D],re})};return s?d.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"radial-gradient(120% 120% at 50% 0%, rgba(124, 58, 237, 0.32) 0%, rgba(46, 27, 61, 0.98) 52%, rgba(35, 24, 62, 1) 100%)"},children:d.jsxs(se.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},className:"text-center",children:[d.jsx(se.div,{className:"w-16 h-16 border-4 rounded-full mx-auto mb-4",style:{borderColor:"rgba(255, 214, 240, 0.28)",borderTopColor:"#ff79cf"},animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"}}),d.jsx("p",{className:"text-lg font-bold",style:{color:"#ffd6f0",textShadow:"0 2px 4px rgba(0, 0, 0, 0.6)"},dir:"rtl",children:"در حال بارگذاری پروفایل..."})]})}):d.jsxs("div",{className:"max-w-2xl mx-auto px-6 py-8",dir:"rtl",children:[d.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[d.jsx(se.button,{whileHover:{scale:1.1},whileTap:{scale:.9},onClick:()=>e("/profile"),className:"w-10 h-10 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(32, 76, 106, 0.6) 0%, rgba(20, 40, 60, 0.6) 100%)",border:"2px solid rgba(138, 206, 224, 0.3)"},children:d.jsx(q4,{className:"text-white",size:20})}),d.jsx("h1",{className:"text-2xl font-bold text-white",style:{textShadow:"0 4px 12px rgba(138, 206, 224, 0.6), 0 2px 4px rgba(0, 0, 0, 0.8)"},children:f!=null&&f.user_workflowID?"ویرایش پروفایل":"تکمیل پروفایل"})]}),m&&d.jsx(se.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"mb-6 p-4 rounded-xl text-center font-bold",style:{background:"linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(56, 142, 60, 0.2) 100%)",border:"2px solid rgba(76, 175, 80, 0.4)",color:"#A7F3D0",textShadow:"0 2px 4px rgba(0, 0, 0, 0.6)"},children:m}),d.jsxs("form",{onSubmit:L,className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-white mb-2 text-sm font-bold",children:"نام"}),d.jsx("input",{type:"text",value:g.name,onChange:D=>R("name",D.target.value),className:"w-full px-4 py-3 rounded-xl text-white font-bold",style:{background:"linear-gradient(135deg, rgba(32, 76, 106, 0.4) 0%, rgba(20, 40, 60, 0.4) 100%)",border:S.name?"2px solid rgba(220, 53, 69, 0.6)":"2px solid rgba(138, 206, 224, 0.3)",outline:"none"},placeholder:"نام خود را وارد کنید"}),S.name&&d.jsx("p",{className:"text-red-400 text-xs mt-1",children:S.name})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-white mb-2 text-sm font-bold",children:"نام خانوادگی"}),d.jsx("input",{type:"text",value:g.family,onChange:D=>R("family",D.target.value),className:"w-full px-4 py-3 rounded-xl text-white font-bold",style:{background:"linear-gradient(135deg, rgba(32, 76, 106, 0.4) 0%, rgba(20, 40, 60, 0.4) 100%)",border:S.family?"2px solid rgba(220, 53, 69, 0.6)":"2px solid rgba(138, 206, 224, 0.3)",outline:"none"},placeholder:"نام خانوادگی خود را وارد کنید"}),S.family&&d.jsx("p",{className:"text-red-400 text-xs mt-1",children:S.family})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-white mb-2 text-sm font-bold",children:"مقطع تحصیلی"}),d.jsxs("select",{value:g.education_level,onChange:D=>R("education_level",D.target.value),className:"w-full px-4 py-3 rounded-xl text-white font-bold",style:{background:"linear-gradient(135deg, rgba(32, 76, 106, 0.4) 0%, rgba(20, 40, 60, 0.4) 100%)",border:S.education_level?"2px solid rgba(220, 53, 69, 0.6)":"2px solid rgba(138, 206, 224, 0.3)",outline:"none"},children:[d.jsx("option",{value:"",children:"انتخاب کنید"}),d.jsx("option",{value:"ابتدایی",children:"ابتدایی"}),d.jsx("option",{value:"متوسطه اول",children:"متوسطه اول"}),d.jsx("option",{value:"متوسطه دوم",children:"متوسطه دوم"})]}),S.education_level&&d.jsx("p",{className:"text-red-400 text-xs mt-1",children:S.education_level})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-white mb-2 text-sm font-bold",children:"پایه تحصیلی"}),d.jsxs("select",{value:g.base,onChange:D=>R("base",D.target.value),className:"w-full px-4 py-3 rounded-xl text-white font-bold",style:{background:"linear-gradient(135deg, rgba(32, 76, 106, 0.4) 0%, rgba(20, 40, 60, 0.4) 100%)",border:S.base?"2px solid rgba(220, 53, 69, 0.6)":"2px solid rgba(138, 206, 224, 0.3)",outline:"none"},children:[d.jsx("option",{value:"",children:"انتخاب کنید"}),g.education_level==="ابتدایی"&&d.jsxs(d.Fragment,{children:[d.jsx("option",{value:"اول",children:"اول"}),d.jsx("option",{value:"دوم",children:"دوم"}),d.jsx("option",{value:"سوم",children:"سوم"}),d.jsx("option",{value:"چهارم",children:"چهارم"}),d.jsx("option",{value:"پنجم",children:"پنجم"}),d.jsx("option",{value:"ششم",children:"ششم"})]}),g.education_level==="متوسطه اول"&&d.jsxs(d.Fragment,{children:[d.jsx("option",{value:"هفتم",children:"هفتم"}),d.jsx("option",{value:"هشتم",children:"هشتم"}),d.jsx("option",{value:"نهم",children:"نهم"})]}),g.education_level==="متوسطه دوم"&&d.jsxs(d.Fragment,{children:[d.jsx("option",{value:"دهم",children:"دهم"}),d.jsx("option",{value:"یازدهم",children:"یازدهم"}),d.jsx("option",{value:"دوازدهم",children:"دوازدهم"})]})]}),S.base&&d.jsx("p",{className:"text-red-400 text-xs mt-1",children:S.base})]}),d.jsxs(se.button,{type:"submit",disabled:l,whileHover:{scale:l?1:1.02},whileTap:{scale:l?1:.98},className:"w-full flex items-center justify-center gap-3 px-8 py-4 rounded-2xl font-bold text-lg",style:{background:l?"linear-gradient(135deg, rgba(60, 140, 150, 0.7) 0%, rgba(40, 100, 110, 0.7) 100%)":"linear-gradient(135deg, rgba(76, 175, 80, 0.9) 0%, rgba(56, 142, 60, 0.9) 100%)",boxShadow:"0 12px 32px rgba(76, 175, 80, 0.4), 0 4px 12px rgba(0, 0, 0, 0.4)",color:"#FFFFFF",textShadow:"0 2px 4px rgba(0, 0, 0, 0.5)",opacity:l?.7:1,cursor:l?"not-allowed":"pointer"},children:[d.jsx(s8,{size:24}),d.jsx("span",{children:l?"در حال ذخیره...":"ذخیره اطلاعات"})]})]})]})}const rd="/assets/0469c3ac6223dede16e9f8943a3cac9943835707-RJiYkdb5.png",nC=[{id:"1",name:"نشان ستاره طلایی",price:150,isOwned:!1},{id:"2",name:"آواتار جادوگر",price:250,isOwned:!1},{id:"3",name:"قاب طلایی",price:100,isOwned:!1},{id:"4",name:"پسزمینه کهکشانی",price:200,isOwned:!1},{id:"5",name:"نشان شیر",price:80,isOwned:!1},{id:"6",name:"افکت درخشش",price:300,isOwned:!1,isLocked:!0},{id:"7",name:"تاج طلایی",price:180,isOwned:!1},{id:"8",name:"جام قهرمانی",price:220,isOwned:!1}],dl=[{id:"p1",name:"نشان ستاره طلایی",isOwned:!0},{id:"p2",name:"قاب طلایی",isOwned:!0}];function rC(){gr("کیف جادویی");const[e,n]=v.useState("shop"),[a,s]=v.useState([]),[o,l]=v.useState(!1),[u,f]=v.useState(null),p=1e3;return v.useEffect(()=>{e==="owned"&&a.length===0&&(async()=>{l(!0);const y=await Z8();y.success?s(y.data):console.error("Error loading magic bag missions:",y.message),l(!1)})()},[e,a.length]),d.jsxs("div",{className:"pt-6 pb-2",dir:"rtl",children:[d.jsxs("div",{className:"mb-4 flex gap-2",children:[d.jsxs(se.button,{whileTap:{scale:.97},onClick:()=>n("shop"),className:"flex-1 py-2.5 rounded-2xl font-bold text-sm flex items-center justify-center gap-1.5",style:{background:e==="shop"?"linear-gradient(135deg, rgba(255, 183, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)":"linear-gradient(135deg, rgba(50, 107, 118, 0.6) 0%, rgba(32, 76, 106, 0.6) 100%)",boxShadow:e==="shop"?"0 6px 18px rgba(255, 165, 0, 0.5)":"0 3px 10px rgba(0, 0, 0, 0.3)",border:e==="shop"?"1.5px solid rgba(255, 200, 50, 0.5)":"1.5px solid rgba(138, 206, 224, 0.3)",color:e==="shop"?"#5A3800":"#FFFFFF",textShadow:e==="shop"?"0 1px 0 rgba(255, 255, 255, 0.2)":"none"},children:[d.jsx(u8,{className:"w-4 h-4"}),"فروشگاه"]}),d.jsxs(se.button,{whileTap:{scale:.97},onClick:()=>n("owned"),className:"flex-1 py-2.5 rounded-2xl font-bold text-sm flex items-center justify-center gap-1.5",style:{background:e==="owned"?"linear-gradient(135deg, rgba(255, 183, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)":"linear-gradient(135deg, rgba(50, 107, 118, 0.6) 0%, rgba(32, 76, 106, 0.6) 100%)",boxShadow:e==="owned"?"0 6px 18px rgba(255, 165, 0, 0.5)":"0 3px 10px rgba(0, 0, 0, 0.3)",border:e==="owned"?"1.5px solid rgba(255, 200, 50, 0.5)":"1.5px solid rgba(138, 206, 224, 0.3)",color:e==="owned"?"#5A3800":"#FFFFFF",textShadow:e==="owned"?"0 1px 0 rgba(255, 255, 255, 0.2)":"none"},children:[d.jsx(ug,{className:"w-4 h-4"}),"ایتمهای من"]})]}),e==="shop"&&d.jsx("div",{className:"grid grid-cols-4 gap-4",children:nC.map((m,y)=>{const g=!m.isLocked&&m.price&&p>=m.price;return d.jsxs(se.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:y*.05,duration:.3},whileHover:{scale:m.isLocked?1:1.1,y:-4},whileTap:{scale:m.isLocked?1:.9},disabled:m.isLocked,className:"flex flex-col items-center gap-1.5",children:[d.jsxs("div",{className:"relative w-full",children:[d.jsx("img",{src:rd,alt:m.name,className:"w-full h-auto object-contain",style:{filter:m.isLocked?"grayscale(100%) brightness(0.4)":"drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3))"}}),m.isLocked&&d.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:d.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(185, 28, 28, 0.95) 100%)",boxShadow:"0 4px 12px rgba(220, 38, 38, 0.8)"},children:d.jsx(I6,{className:"w-4 h-4 text-white"})})}),!m.isLocked&&m.price&&d.jsxs("div",{className:"absolute top-0 left-0 flex items-center gap-1 px-2 py-1 rounded-full",style:{background:g?"linear-gradient(135deg, rgba(255, 193, 7, 0.95) 0%, rgba(255, 152, 0, 0.95) 100%)":"linear-gradient(135deg, rgba(107, 114, 128, 0.95) 0%, rgba(75, 85, 99, 0.95) 100%)",border:`1.5px solid ${g?"rgba(255, 200, 50, 0.8)":"rgba(107, 114, 128, 0.8)"}`,boxShadow:g?"0 2px 8px rgba(255, 193, 7, 0.6)":"0 2px 8px rgba(0, 0, 0, 0.4)"},children:[d.jsx("img",{src:Cl,alt:"سکه",className:"w-3.5 h-3.5"}),d.jsx("span",{className:"text-[10px] font-bold",style:{color:g?"#5A3800":"rgba(255, 255, 255, 0.7)",textShadow:g?"0 1px 0 rgba(255, 255, 255, 0.3)":"none"},children:m.price})]})]}),d.jsx("p",{className:"text-white text-[11px] font-bold text-center leading-tight line-clamp-2 w-full",style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.5)"},children:m.name})]},m.id)})}),e==="owned"&&d.jsx("div",{children:a.length===0&&dl.length===0?d.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[d.jsx("div",{className:"w-24 h-24 rounded-full flex items-center justify-center mb-4",style:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.2) 0%, rgba(76, 127, 137, 0.2) 100%)",border:"3px solid rgba(138, 206, 224, 0.3)"},children:d.jsx(ug,{className:"w-12 h-12 text-white/50"})}),d.jsx("h3",{className:"text-white text-lg font-bold mb-2",children:"هنوز ایتمی ندارید"}),d.jsx("p",{className:"text-white/60 text-sm text-center",children:"با انجام چالشها و خرید از فروشگاه، ایتمهای جذاب جمع کنید!"}),d.jsx(se.button,{whileTap:{scale:.95},onClick:()=>n("shop"),className:"mt-6 px-6 py-3 rounded-full font-bold",style:{background:"linear-gradient(135deg, rgba(255, 183, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)",boxShadow:"0 8px 24px rgba(255, 165, 0, 0.5)",color:"#5A3800"},children:"رفتن به فروشگاه"})]}):d.jsxs(d.Fragment,{children:[a.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("h3",{className:"text-white text-sm font-bold mb-3",style:{textShadow:"0 2px 4px rgba(0, 0, 0, 0.5)"},children:"🏆 از ماموریتها"}),o?d.jsx("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[1,2,3,4].map(m=>d.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[d.jsx("div",{className:"w-full aspect-square rounded-lg animate-pulse",style:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.2) 0%, rgba(76, 127, 137, 0.2) 100%)"}}),d.jsx("div",{className:"w-full h-4 rounded animate-pulse",style:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.2) 0%, rgba(76, 127, 137, 0.2) 100%)"}})]},m))}):d.jsx("div",{className:"grid grid-cols-4 gap-4 mb-6",children:a.map((m,y)=>{const g=ej(m.magic_bag_file),b=()=>{if(g)f({url:td(m.StageID),title:m.magic_bag_title});else{const S=document.createElement("a");S.href=td(m.StageID),S.download=m.magic_bag_file||m.magic_bag_title,S.click()}};return d.jsxs(se.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:y*.05,duration:.3},className:"flex flex-col items-center gap-1.5",children:[d.jsxs(se.button,{onClick:b,whileHover:{scale:1.1,y:-4},whileTap:{scale:.9},className:"relative w-full",children:[d.jsx("img",{src:td(m.StageID),alt:m.magic_bag_title,className:"w-full h-auto object-contain",style:{filter:"drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3))"},onError:S=>{S.currentTarget.src=rd}}),!g&&d.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/30 rounded-lg",children:d.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(255, 183, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)",boxShadow:"0 4px 12px rgba(255, 165, 0, 0.8)"},children:d.jsx(cg,{className:"w-5 h-5 text-white"})})})]}),d.jsx("p",{className:"text-white text-[11px] font-bold text-center leading-tight line-clamp-2 w-full",style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.5)"},children:m.magic_bag_title})]},m.StageID)})})]}),a.length>0&&dl.length>0&&d.jsx("div",{className:"mb-6 flex items-center gap-3",children:d.jsx("div",{className:"flex-1 h-[1px]",style:{background:"linear-gradient(90deg, transparent 0%, rgba(138, 206, 224, 0.3) 50%, transparent 100%)"}})}),dl.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("h3",{className:"text-white text-sm font-bold mb-3",style:{textShadow:"0 2px 4px rgba(0, 0, 0, 0.5)"},children:"🛒 خریداری شده"}),d.jsx("div",{className:"grid grid-cols-4 gap-4",children:dl.map((m,y)=>d.jsxs(se.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:(a.length+y)*.05,duration:.3},whileHover:{scale:1.1,y:-4},whileTap:{scale:.9},className:"flex flex-col items-center gap-1.5",children:[d.jsx("div",{className:"relative w-full",children:d.jsx("img",{src:rd,alt:m.name,className:"w-full h-auto object-contain",style:{filter:"drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3))"}})}),d.jsx("p",{className:"text-white text-[11px] font-bold text-center leading-tight line-clamp-2 w-full",style:{textShadow:"0 1px 2px rgba(0, 0, 0, 0.5)"},children:m.name})]},m.id))})]})]})}),d.jsx(gn,{children:u&&d.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>f(null),className:"fixed inset-0 z-50 flex items-center justify-center bg-black/90 px-4",style:{backdropFilter:"blur(8px)"},children:d.jsxs(se.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},onClick:m=>m.stopPropagation(),className:"relative max-w-4xl w-full",children:[d.jsx(se.button,{whileTap:{scale:.9},onClick:()=>f(null),className:"absolute -top-12 left-0 w-10 h-10 rounded-full flex items-center justify-center z-10",style:{background:"linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(185, 28, 28, 0.95) 100%)",boxShadow:"0 4px 12px rgba(220, 38, 38, 0.8)"},children:d.jsx(Ds,{className:"w-6 h-6 text-white"})}),d.jsx(se.button,{whileTap:{scale:.9},onClick:()=>{const m=document.createElement("a");m.href=u.url,m.download=u.title,m.click()},className:"absolute -top-12 right-0 w-10 h-10 rounded-full flex items-center justify-center z-10",style:{background:"linear-gradient(135deg, rgba(255, 183, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)",boxShadow:"0 4px 12px rgba(255, 165, 0, 0.8)"},children:d.jsx(cg,{className:"w-6 h-6 text-white"})}),d.jsx("div",{className:"rounded-2xl overflow-hidden",style:{boxShadow:"0 25px 50px rgba(0, 0, 0, 0.5)",border:"2px solid rgba(138, 206, 224, 0.3)"},children:d.jsx("img",{src:u.url,alt:u.title,className:"w-full h-auto max-h-[80vh] object-contain bg-black/50"})}),d.jsx("div",{className:"mt-4 text-center",children:d.jsx("p",{className:"text-white text-lg font-bold",style:{textShadow:"0 2px 4px rgba(0, 0, 0, 0.8)"},children:u.title})})]})})})]})}function qi({topicTitle:e,subtitle:n,onBack:a}){return d.jsx("div",{className:"flex-shrink-0 w-full",children:d.jsx(Ff,{showBack:!0,onBack:a,centerTitle:e,centerSubtitle:n})})}const aC=e=>{switch(e){case"موفقیت":return{icon:d.jsx(zd,{className:"w-6 h-6"}),gradient:"linear-gradient(135deg, rgba(34, 197, 94, 0.9) 0%, rgba(22, 163, 74, 0.9) 100%)",border:"rgba(34, 197, 94, 0.5)",shadow:"0 4px 16px rgba(34, 197, 94, 0.3)"};case"خبر":return{icon:d.jsx(T6,{className:"w-6 h-6"}),gradient:"linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(37, 99, 235, 0.9) 100%)",border:"rgba(59, 130, 246, 0.5)",shadow:"0 4px 16px rgba(59, 130, 246, 0.3)"};case"اخطار":return{icon:d.jsx(c6,{className:"w-6 h-6"}),gradient:"linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%)",border:"rgba(239, 68, 68, 0.5)",shadow:"0 4px 16px rgba(239, 68, 68, 0.3)"};case"پیشنهاد":return{icon:d.jsx(lx,{className:"w-6 h-6"}),gradient:"linear-gradient(135deg, rgba(168, 85, 247, 0.9) 0%, rgba(147, 51, 234, 0.9) 100%)",border:"rgba(168, 85, 247, 0.5)",shadow:"0 4px 16px rgba(168, 85, 247, 0.3)"};case"عادی":default:return{icon:d.jsx(j6,{className:"w-6 h-6"}),gradient:"linear-gradient(135deg, rgba(107, 114, 128, 0.9) 0%, rgba(75, 85, 99, 0.9) 100%)",border:"rgba(107, 114, 128, 0.5)",shadow:"0 4px 16px rgba(107, 114, 128, 0.3)"}}};function sC(){const e=an();gr("پیامها");const{messages:n,loading:a,markMessagesAsRead:s}=Ji(),o=v.useRef(!1),l=v.useCallback(()=>{e("/")},[e]);return v.useEffect(()=>{if(!a&&n.length>0&&!o.current){const u=n.filter(f=>f.status==="خوانده نشده").map(f=>String(f.stageID));u.length>0&&(o.current=!0,s(u))}},[a,n,s]),d.jsxs("div",{className:"min-h-screen w-full relative overflow-hidden",children:[d.jsx(Wr,{position:"fixed",zIndex:0,imageUrl:mn.messages}),d.jsxs("div",{className:"relative z-10 max-w-md mx-auto",children:[d.jsx(qi,{topicTitle:"پیامها",onBack:l}),d.jsxs("div",{className:"fixed top-0 left-0 right-0 bottom-0 max-w-md mx-auto overflow-hidden",style:{paddingTop:"110px",zIndex:1},children:[d.jsx("div",{className:"h-full overflow-y-auto relative px-[20px] pt-[48px] pb-[128px]",style:{scrollbarWidth:"none",msOverflowStyle:"none",maskImage:"linear-gradient(to bottom, transparent 0%, black 60px)",WebkitMaskImage:"linear-gradient(to bottom, transparent 0%, black 60px)"},children:a?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsxs("div",{className:"text-white text-center",children:[d.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-white mx-auto mb-4"}),d.jsx("p",{children:"در حال بارگذاری پیامها..."})]})}):n.length===0?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx("div",{className:"text-white text-center",children:d.jsx("p",{className:"text-lg",children:"پیامی وجود ندارد"})})}):d.jsx("div",{className:"space-y-4",dir:"rtl",children:n.map((u,f)=>{const p=aC(u.kind),m=u.status==="خوانده نشده";return d.jsx(se.div,{initial:{opacity:0,x:-50},animate:{opacity:1,x:0},transition:{delay:f*.1,duration:.4},className:"relative",children:d.jsxs("div",{className:"rounded-3xl p-5 backdrop-blur-sm",style:{background:p.gradient,border:`1.5px solid ${p.border}`,boxShadow:p.shadow,opacity:m?1:.85},children:[m&&d.jsx("div",{className:"absolute top-3 left-3 w-3 h-3 rounded-full",style:{background:"linear-gradient(135deg, #FF4444 0%, #CC0000 100%)",boxShadow:"0 0 8px rgba(255, 68, 68, 0.8)"}}),d.jsxs("div",{className:"flex items-start gap-4",children:[d.jsx("div",{className:"flex-shrink-0 w-12 h-12 rounded-full flex items-center justify-center text-white",style:{background:p.gradient,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},children:p.icon}),d.jsxs("div",{className:"flex-1",children:[d.jsx("h3",{className:"text-white font-bold text-base mb-2",children:u.title}),d.jsx("p",{className:"text-white/80 text-sm leading-relaxed",children:u.Message})]})]})]})},`${u.user_id}-${f}`)})})}),d.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-16 pointer-events-none",style:{background:"linear-gradient(180deg, transparent 0%, rgba(46, 27, 61, 0.82) 50%, rgba(35, 24, 62, 1) 100%)"}})]})]}),d.jsx("style",{children:`
|
||
/* Hide scrollbar for Chrome, Safari and Opera */
|
||
.h-full.overflow-y-auto::-webkit-scrollbar {
|
||
display: none;
|
||
}
|
||
`}),d.jsx(Ga,{})]})}function iC({onBack:e}){return d.jsx("div",{className:"flex-shrink-0",children:d.jsx(Ff,{showBack:!0,onBack:e})})}function oC({text:e,speed:n=30,onTyping:a}){const[s,o]=v.useState(""),[l,u]=v.useState(0);return v.useEffect(()=>{if(l<e.length){const f=setTimeout(()=>{o(p=>p+e[l]),u(p=>p+1),a&&a()},n);return()=>clearTimeout(f)}},[l,e,n,a]),v.useEffect(()=>{o(""),u(0)},[e]),d.jsxs("p",{className:"text-white text-sm break-words whitespace-pre-wrap",children:[s,l<e.length&&d.jsx("span",{className:"inline-block w-1 h-4 bg-white/70 ml-0.5 animate-pulse"})]})}const vg={user:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.9) 0%, rgba(76, 127, 137, 0.9) 100%)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)",border:"1.5px solid rgba(138, 206, 224, 0.5)"},other:{background:"linear-gradient(135deg, rgba(32, 76, 106, 0.8) 0%, rgba(20, 40, 60, 0.8) 100%)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)",border:"1.5px solid rgba(138, 206, 224, 0.3)"}};function lC({messages:e,containerRef:n,endRef:a,onTyping:s}){return d.jsx("div",{ref:n,className:"flex-1 overflow-y-auto px-4 pb-20",dir:"rtl",children:d.jsxs("div",{className:"space-y-3",children:[e.map(o=>{const l=o.type==="user",u=o.type==="loading";return d.jsx(se.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex ${l?"justify-start":"justify-end"}`,children:d.jsxs("div",{className:"max-w-[75%] rounded-2xl px-4 py-3",style:l?vg.user:vg.other,children:[o.author&&d.jsx("p",{className:"text-xs font-bold mb-1",style:{color:"#8ACEE0"},children:o.author}),u?d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(se.span,{className:"w-2 h-2 rounded-full bg-white",animate:{opacity:[.3,1,.3]},transition:{duration:1.5,repeat:1/0,delay:0}}),d.jsx(se.span,{className:"w-2 h-2 rounded-full bg-white",animate:{opacity:[.3,1,.3]},transition:{duration:1.5,repeat:1/0,delay:.2}}),d.jsx(se.span,{className:"w-2 h-2 rounded-full bg-white",animate:{opacity:[.3,1,.3]},transition:{duration:1.5,repeat:1/0,delay:.4}})]}):o.type==="other"&&o.isTyping?d.jsx(oC,{text:o.content,speed:30,onTyping:s}):d.jsx("p",{className:"text-white text-sm break-words whitespace-pre-wrap",children:o.content}),d.jsx("p",{className:"text-white/60 text-xs mt-1 text-left",children:o.timestamp})]})},o.id)}),d.jsx("div",{ref:a})]})})}const ad={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)"},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)"},sendButtonDisabled:{background:"linear-gradient(135deg, rgba(96, 147, 157, 0.3) 0%, rgba(76, 127, 137, 0.3) 100%)"}};function cC({inputText:e,onInputChange:n,onSend:a,onNewChat:s,inputRef:o}){const l=p=>{if((p.ctrlKey||p.metaKey)&&p.key.toLowerCase()==="a"){p.preventDefault(),p.currentTarget.select();return}p.ctrlKey||p.metaKey||p.altKey||p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),a())},u=p=>{n(p.target.value);const m=p.target;m.style.height="auto",m.style.height=`${Math.min(m.scrollHeight,100)}px`},f=!e.trim();return d.jsx("div",{className:"flex-shrink-0 px-3 mb-16 pb-[env(safe-area-inset-bottom)]",children:d.jsxs("div",{className:"flex items-end gap-2 p-2.5 rounded-2xl",style:ad.container,children:[d.jsx(se.button,{whileTap:{scale:.92},onClick:s,className:"w-9 h-9 rounded-full flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.9) 0%, rgba(76, 127, 137, 0.9) 100%)",boxShadow:"0 3px 10px rgba(138, 206, 224, 0.4)"},children:d.jsx(S6,{className:"w-4 h-4",style:{color:"#FFFFFF"}})}),d.jsx("textarea",{ref:o,value:e,onChange:u,onKeyDown:l,placeholder:"پیام خود را بنویسید",dir:"auto",className:"flex-1 bg-transparent text-white placeholder-white/50 resize-none outline-none",style:{direction:"auto",textAlign:e?"start":"right",maxHeight:"90px",minHeight:"36px",lineHeight:"20px",paddingTop:"8px",paddingBottom:"8px",fontSize:"16px"},rows:1}),d.jsx(se.button,{whileTap:{scale:f?1:.92},onClick:a,disabled:f,className:"w-9 h-9 rounded-full flex items-center justify-center flex-shrink-0",style:{...f?ad.sendButtonDisabled:ad.sendButtonActive,cursor:f?"not-allowed":"pointer",opacity:f?.5:1},children:d.jsx(_f,{className:"w-4 h-4",style:{color:f?"rgba(255, 255, 255, 0.3)":"#5A3800"}})})]})})}const ji={overlay:{backgroundColor:"rgba(0, 0, 0, 0.8)"},container:{background:"linear-gradient(180deg, rgba(32, 76, 106, 0.98) 0%, rgba(20, 40, 60, 0.98) 100%)",border:"2px solid rgba(138, 206, 224, 0.3)",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.3)",maxHeight:"85vh"},chatItem:{background:"linear-gradient(135deg, rgba(50, 107, 118, 0.6) 0%, rgba(32, 76, 106, 0.6) 100%)",border:"1.5px solid rgba(138, 206, 224, 0.3)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)"},iconContainer:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.3) 0%, rgba(76, 127, 137, 0.3) 100%)"},closeButton:{background:"linear-gradient(135deg, rgba(96, 147, 157, 0.6) 0%, rgba(76, 127, 137, 0.6) 100%)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)",border:"1.5px solid rgba(138, 206, 224, 0.3)"}};function uC({isOpen:e,onClose:n,historyItems:a,onSelectChat:s}){return v.useEffect(()=>{const o=l=>{l.key==="Escape"&&n()};if(e)return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[e,n]),d.jsx(gn,{children:e&&d.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[100] flex items-center justify-center p-4",style:ji.overlay,onClick:n,children:d.jsxs(se.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},exit:{scale:.9,y:20},onClick:o=>o.stopPropagation(),className:"w-full max-w-md rounded-3xl overflow-hidden",style:ji.container,children:[d.jsx("div",{className:"px-6 py-4 border-b",style:{borderColor:"rgba(138, 206, 224, 0.2)"},children:d.jsx("h3",{className:"text-lg font-bold text-center text-white",style:{textShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"},children:"تاریخچه گفتگوها"})}),d.jsx("div",{className:"overflow-y-auto p-6",style:{maxHeight:"calc(85vh - 120px)"},children:d.jsx("div",{className:"space-y-3",children:a.map((o,l)=>d.jsx(se.button,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:l*.1},whileTap:{scale:.95},onClick:()=>{n(),s(o.id)},className:"w-full p-4 rounded-2xl text-right",style:ji.chatItem,children:d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center",style:ji.iconContainer,children:d.jsx(ux,{className:"w-5 h-5",style:{color:"#8ACEE0"}})}),d.jsxs("div",{className:"flex-1",children:[d.jsx("h4",{className:"text-white font-bold text-sm mb-1",children:o.title}),d.jsx("p",{className:"text-white/60 text-xs mb-1",children:o.lastMessage}),d.jsx("p",{className:"text-white/40 text-xs",children:o.date})]})]})},o.id))})}),d.jsx("div",{className:"px-6 py-4 border-t",style:{borderColor:"rgba(138, 206, 224, 0.2)"},children:d.jsx(se.button,{whileTap:{scale:.95},onClick:n,className:"w-full py-3 rounded-full font-bold text-white",style:ji.closeButton,children:"بستن"})})]})})})}const Lf=()=>{const e=localStorage.getItem("accessToken");return e||localStorage.getItem("authToken")},dC=async()=>{console.log("loadChatList: Function called");const e=Lf();if(console.log("loadChatList: Token:",e?e.substring(0,20)+"...":"null"),!e)return console.error("loadChatList: No token found"),{success:!1,data:[],message:"توکن احراز هویت یافت نشد"};try{console.log("loadChatList: Sending request to:",`${nt}/api/call`);const n=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${e}`},body:JSON.stringify({chat_list_load_function:{}})});console.log("loadChatList: Response status:",n.status);const a=await n.json();if(console.log("loadChatList: Response data:",JSON.stringify(a)),a.state===0){console.log("loadChatList: Parsing result.data");const s=JSON.parse(a.data);console.log("loadChatList: Parsed data:",s);const o=JSON.parse(s.chat_list);return console.log("loadChatList: Chat list:",o),{success:!0,data:o}}else return console.error("loadChatList: API returned error state:",a.state,a.message),{success:!1,data:[],message:a.message}}catch(n){return console.error("loadChatList: Exception caught:",n),{success:!1,data:[],message:"خطا در بارگذاری لیست چتها"}}},fC=async e=>{const n=Lf();if(!n)return{success:!1,data:[],message:"توکن احراز هویت یافت نشد"};try{const s=await(await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify({chat_load_function:{chatlist_workflowID:e}})})).json();if(s.state===0){const o=JSON.parse(s.data);return{success:!0,data:JSON.parse(o.chats)}}else return{success:!1,data:[],message:s.message}}catch(a){return console.error("Error loading chat:",a),{success:!1,data:[],message:"خطا در بارگذاری چت"}}},hC=async(e,n="")=>{const a=Lf();if(!a)return{success:!1,message:"توکن احراز هویت یافت نشد"};try{const o=await(await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${a}`},body:JSON.stringify({public_caht_function:{chatlist_workflowID:n,question:e}})})).json();if(o.state===0){const l=JSON.parse(o.data),u=JSON.parse(l.message);return{success:!0,answer:u.answer,newChatlistWorkflowID:u.chatlist_workflowID2}}else return{success:!1,message:o.message}}catch(s){return console.error("Error sending public chat message:",s),{success:!1,message:"خطا در ارسال پیام"}}};function pC(){const e=an();gr("چت عمومی");const[n,a]=v.useState([]),[s,o]=v.useState(""),[l,u]=v.useState(!1),[f,p]=v.useState([]),[m,y]=v.useState(""),[g,b]=v.useState(!1),[S,C]=v.useState(!1),[N,j]=v.useState(!0),L=v.useRef(null),R=v.useRef(null),D=v.useRef(null),H=()=>{const U=L.current;return U?U.scrollHeight-U.scrollTop-U.clientHeight<100:!0},K=(U=!0)=>{var Y;(Y=R.current)==null||Y.scrollIntoView({behavior:U?"smooth":"auto",block:"end"})};v.useEffect(()=>{N&&K()},[n,N]),v.useEffect(()=>{const U=L.current;if(!U)return;const Y=()=>{j(H())};return U.addEventListener("scroll",Y,{passive:!0}),()=>U.removeEventListener("scroll",Y)},[]);const re=U=>{const Y=[];return U.forEach(I=>{I.question&&Y.push({id:crypto.randomUUID(),type:"user",content:I.question,timestamp:I.datetime1}),I.answer&&Y.push({id:crypto.randomUUID(),type:"other",content:I.answer,author:"ربات",timestamp:I.datetime1})}),Y},O=async U=>{u(!1),b(!0),y(U);const Y=await fC(U);if(Y.success){const I=re(Y.data);a(I),requestAnimationFrame(()=>{requestAnimationFrame(()=>{K(!1)})})}else console.error("Failed to load chat:",Y.message),alert("خطا در بارگذاری چت");b(!1)},w=async()=>{var G;const U=s.trim();if(!U||S)return;const Y={id:crypto.randomUUID(),type:"user",content:U,timestamp:new Date().toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit"})},I=crypto.randomUUID(),W={id:I,type:"loading",content:"",author:"ربات",timestamp:""};j(!0),a(B=>[...B,Y,W]),o(""),C(!0),D.current&&(D.current.style.height="auto");const Q=await hC(U,m);if(a(B=>B.filter(_=>_.id!==I)),Q.success&&Q.answer){Q.newChatlistWorkflowID&&y(Q.newChatlistWorkflowID);const B={id:crypto.randomUUID(),type:"other",content:Q.answer,author:"ربات",timestamp:new Date().toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit"}),isTyping:!0};a(_=>[..._,B])}else alert(Q.message||"خطا در ارسال پیام");C(!1),(G=D.current)==null||G.focus()},M=async()=>{u(!0);const U=await dC();U.success?p(U.data):(console.error("Failed to load chat list:",U.message),alert(U.message||"خطا در بارگذاری تاریخچه"))},E=()=>{a([]),y(""),j(!0),requestAnimationFrame(()=>{var U;(U=D.current)==null||U.focus()})};return d.jsxs("div",{className:"relative h-[100dvh] w-full overflow-hidden bg-black",children:[d.jsx(Wr,{position:"fixed",zIndex:0,imageUrl:mn.publicChat}),d.jsxs("div",{className:"relative z-10 mx-auto grid h-full w-full max-w-md grid-rows-[auto_minmax(0,1fr)_auto]",children:[d.jsx("div",{className:"shrink-0",children:d.jsx(iC,{onBack:()=>e("/")})}),d.jsxs("main",{className:"relative min-h-0 overflow-hidden",children:[d.jsx("button",{onClick:M,className:"absolute left-4 top-3 z-20 px-3 py-1.5 rounded-full text-xs text-white font-bold",style:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.9) 0%, rgba(76, 127, 137, 0.9) 100%)",border:"1px solid rgba(208, 240, 255, 0.6)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.25)"},children:"تاریخچه"}),g?d.jsx("div",{className:"flex h-full items-center justify-center px-5",children:d.jsx("p",{className:"text-sm text-white",children:"در حال بارگذاری..."})}):n.length===0?d.jsx("div",{className:"flex h-full items-center justify-center px-5",children:d.jsx("div",{className:"max-w-sm rounded-2xl border-2 border-purple-400/50 bg-gradient-to-br from-purple-500/20 to-pink-500/20 p-5 shadow-2xl backdrop-blur-md",children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"mb-2 text-3xl",children:"🤖✨"}),d.jsx("p",{className:"mb-1.5 text-base font-bold text-white",children:"با ربات همدست چت کن!"}),d.jsx("p",{className:"text-xs text-purple-200",children:"سوالاتت رو بپرس و جواب بگیر"})]})})}):d.jsx("div",{className:"h-full min-h-0",children:d.jsx(lC,{messages:n,containerRef:L,endRef:R,onTyping:()=>{N&&K(!1)}})})]}),d.jsxs("footer",{className:"shrink-0 border-white/10 ",style:{paddingBottom:"calc(env(safe-area-inset-bottom, 0px) + 8px)"},children:[d.jsx("div",{className:"px-3 pt-2",children:d.jsx(cC,{inputText:s,onInputChange:o,onSend:w,onNewChat:E,inputRef:D})}),d.jsx("div",{className:"px-2 pt-6",children:d.jsx(Ga,{})})]})]}),d.jsx(uC,{isOpen:l,onClose:()=>u(!1),historyItems:f.map(U=>({id:U.chatlist_workflowID,title:U.title||"چت عمومی",date:U.datetime1,lastMessage:""})),onSelectChat:O})]})}const mC=e=>{const[n,a]=v.useState([]),[s,o]=v.useState(!0),[l,u]=v.useState(!1),[f,p]=v.useState(null),[m,y]=v.useState(1),[g,b]=v.useState(!0),S=v.useRef(!1),C=v.useRef(null),N=v.useCallback(async(R,D)=>{if(!e||!e.hasFeed){o(!1);return}if(!S.current){S.current=!0,D?o(!0):u(!0),p(null);try{const H=await $8(e.serverName,R);if(C.current!==e.serverName)return;if(H.success){const K=H.data;(K.length===0||K.length<25)&&b(!1),a(D?K:re=>{const O=new Set(re.map(M=>M.StageID)),w=K.filter(M=>!O.has(M.StageID));return[...re,...w]})}else p(H.message||"خطا در بارگذاری فید")}catch{C.current===e.serverName&&p("خطا در ارتباط با سرور")}finally{C.current===e.serverName&&(o(!1),u(!1)),S.current=!1}}},[e]);v.useEffect(()=>{if(!e){o(!1);return}return C.current=e.serverName,a([]),y(1),b(!0),p(null),N(1,!0),()=>{C.current=null}},[e,N]);const j=v.useCallback(()=>{if(!g||l||s)return;const R=m+1;y(R),N(R,!1)},[g,l,s,m,N]),L=v.useCallback(R=>{a(D=>D.filter(H=>H.StageID.toString()!==R))},[]);return{feedItems:n,initialLoading:s,loadingMore:l,error:f,hasMore:g,loadMore:j,deletePost:L}},sd=e=>typeof e=="string"&&e.trim().length>0,gC=(e,n)=>{const a=sd(e.image),s=sd(e.film),o=sd(e.audio);let l="image",u,f="";s?(l="video",u=bx(e.StageID),f=a?Rs(e.StageID):""):o?(l="audio",u=wx(e.StageID),f=a?Rs(e.StageID):""):a&&(l="image",f=Rs(e.StageID));const p=e.datetimee||e.datetime1||e.create_date||"";return{id:e.StageID.toString(),authorName:e.full_name,authorUsername:e.full_name,authorAvatar:Ts(e.person_stage_id),image:f,title:e.title,caption:e.description,likes:e.like_count,dislikes:e.dislike_count,comments:e.comment_count,timestamp:p,topicName:n,initialComments:[],mediaType:l,mediaUrl:u,isOwnPost:H8(e.user_id),initialLikeState:e.like_state,missionType:n,workflowID:e.workflow_ID||e.StageID.toString(),teamMemberIds:e.team_member}};function yC({posts:e,loadingMore:n,error:a,onScroll:s,onDelete:o}){const l=v.useCallback(f=>Math.min(f*.1,1),[]),u=v.useMemo(()=>e.map((f,p)=>d.jsx(se.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{delay:l(p)},children:d.jsx(Tx,{...f,onDelete:o})},f.id)),[e,o,l]);return d.jsx("div",{className:"feed-scroll flex-1 overflow-y-auto px-4 pb-56",onScroll:s,children:d.jsxs("div",{className:"pt-6",children:[u,n&&d.jsx("div",{className:"flex items-center justify-center mt-4 mb-4",children:d.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#ff9be0]"})}),a&&d.jsx("div",{className:"text-red-500 text-center mt-4 mb-4",children:a})]})})}function xC({accentColor:e,onStartMission:n}){return d.jsxs("div",{className:"flex flex-col items-center justify-center px-4 py-16 mt-32",children:[d.jsx("div",{className:"w-24 h-24 rounded-full flex items-center justify-center mb-4",style:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.15) 0%, rgba(62, 121, 131, 0.15) 100%)",border:"2px solid rgba(138, 206, 224, 0.3)"},children:d.jsx(ux,{className:"w-12 h-12",style:{color:e}})}),d.jsx("h3",{className:"text-white text-lg font-bold mb-2",children:"هنوز پستی وجود ندارد"}),d.jsx("p",{className:"text-gray-400 text-sm text-center mb-6",children:"اولین نفری باش که ماموریتشو به اشتراک میذاره!"}),d.jsx(se.button,{whileTap:{scale:.95},onClick:n,className:"px-6 py-3 rounded-full font-bold text-white",style:{background:"linear-gradient(135deg, #FFB800 0%, #FF9500 100%)",boxShadow:"0 4px 16px rgba(255, 165, 0, 0.4)"},children:"شروع ماموریت جدید"})]})}function vC({onClick:e}){return d.jsx("div",{className:"feed-floating-cta fixed left-0 right-0 z-40 px-4 max-w-md mx-auto pointer-events-none transition-opacity duration-200",style:{bottom:"calc(env(safe-area-inset-bottom, 0px) + 112px)"},children:d.jsxs(se.button,{onClick:e,whileHover:{scale:1.02,y:-2},whileTap:{scale:.98},animate:{y:[0,-4,0]},transition:{y:{duration:2.5,repeat:1/0,ease:"easeInOut"}},className:"pointer-events-auto ml-auto flex items-center gap-2",style:{filter:"drop-shadow(0 8px 18px rgba(12, 5, 24, 0.45))"},children:[d.jsx("span",{className:"rounded-full px-3 py-1.5 text-[11px] font-semibold text-white",style:{background:"linear-gradient(180deg, rgba(88, 52, 126, 0.92) 0%, rgba(48, 31, 85, 0.9) 100%)",border:"1px solid rgba(255, 170, 224, 0.46)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:"چالش خودت رو شروع کن"}),d.jsx("span",{className:"h-12 w-12 rounded-full flex items-center justify-center",style:{background:"linear-gradient(180deg, #ff79cf 0%, #a855f7 100%)",boxShadow:"inset 0 1px 0 rgba(255,255,255,0.35), 0 10px 20px rgba(31, 9, 51, 0.45)"},"aria-hidden":!0,children:d.jsx(If,{size:26,color:"#fff5fb",strokeWidth:2.5})})]})})}function bC(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}const wC=e=>{switch(e){case"success":return jC;case"info":return NC;case"warning":return CC;case"error":return EC;default:return null}},SC=Array(12).fill(0),kC=({visible:e,className:n})=>ge.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},ge.createElement("div",{className:"sonner-spinner"},SC.map((a,s)=>ge.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),jC=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),CC=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),NC=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),EC=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ge.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),TC=ge.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ge.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ge.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),PC=()=>{const[e,n]=ge.useState(document.hidden);return ge.useEffect(()=>{const a=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),e};let Bd=1;class RC{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const a=this.subscribers.indexOf(n);this.subscribers.splice(a,1)}),this.publish=n=>{this.subscribers.forEach(a=>a(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var a;const{message:s,...o}=n,l=typeof(n==null?void 0:n.id)=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:Bd++,u=this.toasts.find(p=>p.id===l),f=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),u?this.toasts=this.toasts.map(p=>p.id===l?(this.publish({...p,...n,id:l,title:s}),{...p,...n,id:l,dismissible:f,title:s}):p):this.addToast({title:s,...o,dismissible:f,id:l}),l},this.dismiss=n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:n,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),n),this.message=(n,a)=>this.create({...a,message:n}),this.error=(n,a)=>this.create({...a,message:n,type:"error"}),this.success=(n,a)=>this.create({...a,type:"success",message:n}),this.info=(n,a)=>this.create({...a,type:"info",message:n}),this.warning=(n,a)=>this.create({...a,type:"warning",message:n}),this.loading=(n,a)=>this.create({...a,type:"loading",message:n}),this.promise=(n,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:n,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const o=Promise.resolve(n instanceof Function?n():n);let l=s!==void 0,u;const f=o.then(async m=>{if(u=["resolve",m],ge.isValidElement(m))l=!1,this.create({id:s,type:"default",message:m});else if(IC(m)&&!m.ok){l=!1;const g=typeof a.error=="function"?await a.error(`HTTP error! status: ${m.status}`):a.error,b=typeof a.description=="function"?await a.description(`HTTP error! status: ${m.status}`):a.description,C=typeof g=="object"&&!ge.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:b,...C})}else if(m instanceof Error){l=!1;const g=typeof a.error=="function"?await a.error(m):a.error,b=typeof a.description=="function"?await a.description(m):a.description,C=typeof g=="object"&&!ge.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:b,...C})}else if(a.success!==void 0){l=!1;const g=typeof a.success=="function"?await a.success(m):a.success,b=typeof a.description=="function"?await a.description(m):a.description,C=typeof g=="object"&&!ge.isValidElement(g)?g:{message:g};this.create({id:s,type:"success",description:b,...C})}}).catch(async m=>{if(u=["reject",m],a.error!==void 0){l=!1;const y=typeof a.error=="function"?await a.error(m):a.error,g=typeof a.description=="function"?await a.description(m):a.description,S=typeof y=="object"&&!ge.isValidElement(y)?y:{message:y};this.create({id:s,type:"error",description:g,...S})}}).finally(()=>{l&&(this.dismiss(s),s=void 0),a.finally==null||a.finally.call(a)}),p=()=>new Promise((m,y)=>f.then(()=>u[0]==="reject"?y(u[1]):m(u[1])).catch(y));return typeof s!="string"&&typeof s!="number"?{unwrap:p}:Object.assign(s,{unwrap:p})},this.custom=(n,a)=>{const s=(a==null?void 0:a.id)||Bd++;return this.create({jsx:n(s),id:s,...a}),s},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Rn=new RC,MC=(e,n)=>{const a=(n==null?void 0:n.id)||Bd++;return Rn.addToast({title:e,...n,id:a}),a},IC=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",_C=MC,DC=()=>Rn.toasts,FC=()=>Rn.getActiveToasts(),LC=Object.assign(_C,{success:Rn.success,info:Rn.info,warning:Rn.warning,error:Rn.error,custom:Rn.custom,message:Rn.message,promise:Rn.promise,dismiss:Rn.dismiss,loading:Rn.loading},{getHistory:DC,getToasts:FC});bC("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function fl(e){return e.label!==void 0}const AC=3,OC="24px",zC="16px",bg=4e3,BC=356,VC=14,UC=45,$C=200;function Cr(...e){return e.filter(Boolean).join(" ")}function HC(e){const[n,a]=e.split("-"),s=[];return n&&s.push(n),a&&s.push(a),s}const WC=e=>{var n,a,s,o,l,u,f,p,m;const{invert:y,toast:g,unstyled:b,interacting:S,setHeights:C,visibleToasts:N,heights:j,index:L,toasts:R,expanded:D,removeToast:H,defaultRichColors:K,closeButton:re,style:O,cancelButtonStyle:w,actionButtonStyle:M,className:E="",descriptionClassName:U="",duration:Y,position:I,gap:W,expandByDefault:Q,classNames:G,icons:B,closeButtonAriaLabel:_="Close toast"}=e,[X,J]=ge.useState(null),[T,A]=ge.useState(null),[te,ie]=ge.useState(!1),[oe,ae]=ge.useState(!1),[ue,xe]=ge.useState(!1),[ve,Ve]=ge.useState(!1),[Ce,Ue]=ge.useState(!1),[Oe,dt]=ge.useState(0),[xt,vt]=ge.useState(0),ke=ge.useRef(g.duration||Y||bg),Re=ge.useRef(null),we=ge.useRef(null),me=L===0,Ie=L+1<=N,be=g.type,Ae=g.dismissible!==!1,Qe=g.className||"",Ge=g.descriptionClassName||"",rt=ge.useMemo(()=>j.findIndex(Ye=>Ye.toastId===g.id)||0,[j,g.id]),ht=ge.useMemo(()=>{var Ye;return(Ye=g.closeButton)!=null?Ye:re},[g.closeButton,re]),Qt=ge.useMemo(()=>g.duration||Y||bg,[g.duration,Y]),Pt=ge.useRef(0),qe=ge.useRef(0),Sn=ge.useRef(0),ft=ge.useRef(null),[Mn,Te]=I.split("-"),Ze=ge.useMemo(()=>j.reduce((Ye,Et,Lt)=>Lt>=rt?Ye:Ye+Et.height,0),[j,rt]),ot=PC(),it=g.invert||y,Zt=be==="loading";qe.current=ge.useMemo(()=>rt*W+Ze,[rt,Ze]),ge.useEffect(()=>{ke.current=Qt},[Qt]),ge.useEffect(()=>{ie(!0)},[]),ge.useEffect(()=>{const Ye=we.current;if(Ye){const Et=Ye.getBoundingClientRect().height;return vt(Et),C(Lt=>[{toastId:g.id,height:Et,position:g.position},...Lt]),()=>C(Lt=>Lt.filter(Ut=>Ut.toastId!==g.id))}},[C,g.id]),ge.useLayoutEffect(()=>{if(!te)return;const Ye=we.current,Et=Ye.style.height;Ye.style.height="auto";const Lt=Ye.getBoundingClientRect().height;Ye.style.height=Et,vt(Lt),C(Ut=>Ut.find(St=>St.toastId===g.id)?Ut.map(St=>St.toastId===g.id?{...St,height:Lt}:St):[{toastId:g.id,height:Lt,position:g.position},...Ut])},[te,g.title,g.description,C,g.id]);const gt=ge.useCallback(()=>{ae(!0),dt(qe.current),C(Ye=>Ye.filter(Et=>Et.toastId!==g.id)),setTimeout(()=>{H(g)},$C)},[g,H,C,qe]);ge.useEffect(()=>{if(g.promise&&be==="loading"||g.duration===1/0||g.type==="loading")return;let Ye;return D||S||ot?(()=>{if(Sn.current<Pt.current){const Ut=new Date().getTime()-Pt.current;ke.current=ke.current-Ut}Sn.current=new Date().getTime()})():(()=>{ke.current!==1/0&&(Pt.current=new Date().getTime(),Ye=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),gt()},ke.current))})(),()=>clearTimeout(Ye)},[D,S,g,be,ot,gt]),ge.useEffect(()=>{g.delete&>()},[gt,g.delete]);function yr(){var Ye;if(B!=null&&B.loading){var Et;return ge.createElement("div",{className:Cr(G==null?void 0:G.loader,g==null||(Et=g.classNames)==null?void 0:Et.loader,"sonner-loader"),"data-visible":be==="loading"},B.loading)}return ge.createElement(kC,{className:Cr(G==null?void 0:G.loader,g==null||(Ye=g.classNames)==null?void 0:Ye.loader),visible:be==="loading"})}const sn=g.icon||(B==null?void 0:B[be])||wC(be);var Vn,Dr;return ge.createElement("li",{tabIndex:0,ref:we,className:Cr(E,Qe,G==null?void 0:G.toast,g==null||(n=g.classNames)==null?void 0:n.toast,G==null?void 0:G.default,G==null?void 0:G[be],g==null||(a=g.classNames)==null?void 0:a[be]),"data-sonner-toast":"","data-rich-colors":(Vn=g.richColors)!=null?Vn:K,"data-styled":!(g.jsx||g.unstyled||b),"data-mounted":te,"data-promise":!!g.promise,"data-swiped":Ce,"data-removed":oe,"data-visible":Ie,"data-y-position":Mn,"data-x-position":Te,"data-index":L,"data-front":me,"data-swiping":ue,"data-dismissible":Ae,"data-type":be,"data-invert":it,"data-swipe-out":ve,"data-swipe-direction":T,"data-expanded":!!(D||Q&&te),style:{"--index":L,"--toasts-before":L,"--z-index":R.length-L,"--offset":`${oe?Oe:qe.current}px`,"--initial-height":Q?"auto":`${xt}px`,...O,...g.style},onDragEnd:()=>{xe(!1),J(null),ft.current=null},onPointerDown:Ye=>{Zt||!Ae||(Re.current=new Date,dt(qe.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(xe(!0),ft.current={x:Ye.clientX,y:Ye.clientY}))},onPointerUp:()=>{var Ye,Et,Lt;if(ve||!Ae)return;ft.current=null;const Ut=Number(((Ye=we.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),In=Number(((Et=we.current)==null?void 0:Et.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),St=new Date().getTime()-((Lt=Re.current)==null?void 0:Lt.getTime()),At=X==="x"?Ut:In,xr=Math.abs(At)/St;if(Math.abs(At)>=UC||xr>.11){dt(qe.current),g.onDismiss==null||g.onDismiss.call(g,g),A(X==="x"?Ut>0?"right":"left":In>0?"down":"up"),gt(),Ve(!0);return}else{var $t,F;($t=we.current)==null||$t.style.setProperty("--swipe-amount-x","0px"),(F=we.current)==null||F.style.setProperty("--swipe-amount-y","0px")}Ue(!1),xe(!1),J(null)},onPointerMove:Ye=>{var Et,Lt,Ut;if(!ft.current||!Ae||((Et=window.getSelection())==null?void 0:Et.toString().length)>0)return;const St=Ye.clientY-ft.current.y,At=Ye.clientX-ft.current.x;var xr;const $t=(xr=e.swipeDirections)!=null?xr:HC(I);!X&&(Math.abs(At)>1||Math.abs(St)>1)&&J(Math.abs(At)>Math.abs(St)?"x":"y");let F={x:0,y:0};const V=q=>1/(1.5+Math.abs(q)/20);if(X==="y"){if($t.includes("top")||$t.includes("bottom"))if($t.includes("top")&&St<0||$t.includes("bottom")&&St>0)F.y=St;else{const q=St*V(St);F.y=Math.abs(q)<Math.abs(St)?q:St}}else if(X==="x"&&($t.includes("left")||$t.includes("right")))if($t.includes("left")&&At<0||$t.includes("right")&&At>0)F.x=At;else{const q=At*V(At);F.x=Math.abs(q)<Math.abs(At)?q:At}(Math.abs(F.x)>0||Math.abs(F.y)>0)&&Ue(!0),(Lt=we.current)==null||Lt.style.setProperty("--swipe-amount-x",`${F.x}px`),(Ut=we.current)==null||Ut.style.setProperty("--swipe-amount-y",`${F.y}px`)}},ht&&!g.jsx&&be!=="loading"?ge.createElement("button",{"aria-label":_,"data-disabled":Zt,"data-close-button":!0,onClick:Zt||!Ae?()=>{}:()=>{gt(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Cr(G==null?void 0:G.closeButton,g==null||(s=g.classNames)==null?void 0:s.closeButton)},(Dr=B==null?void 0:B.close)!=null?Dr:TC):null,(be||g.icon||g.promise)&&g.icon!==null&&((B==null?void 0:B[be])!==null||g.icon)?ge.createElement("div",{"data-icon":"",className:Cr(G==null?void 0:G.icon,g==null||(o=g.classNames)==null?void 0:o.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||yr():null,g.type!=="loading"?sn:null):null,ge.createElement("div",{"data-content":"",className:Cr(G==null?void 0:G.content,g==null||(l=g.classNames)==null?void 0:l.content)},ge.createElement("div",{"data-title":"",className:Cr(G==null?void 0:G.title,g==null||(u=g.classNames)==null?void 0:u.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?ge.createElement("div",{"data-description":"",className:Cr(U,Ge,G==null?void 0:G.description,g==null||(f=g.classNames)==null?void 0:f.description)},typeof g.description=="function"?g.description():g.description):null),ge.isValidElement(g.cancel)?g.cancel:g.cancel&&fl(g.cancel)?ge.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||w,onClick:Ye=>{fl(g.cancel)&&Ae&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,Ye),gt())},className:Cr(G==null?void 0:G.cancelButton,g==null||(p=g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,ge.isValidElement(g.action)?g.action:g.action&&fl(g.action)?ge.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||M,onClick:Ye=>{fl(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,Ye),!Ye.defaultPrevented&>())},className:Cr(G==null?void 0:G.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function wg(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function KC(e,n){const a={};return[e,n].forEach((s,o)=>{const l=o===1,u=l?"--mobile-offset":"--offset",f=l?zC:OC;function p(m){["top","right","bottom","left"].forEach(y=>{a[`${u}-${y}`]=typeof m=="number"?`${m}px`:m})}typeof s=="number"||typeof s=="string"?p(s):typeof s=="object"?["top","right","bottom","left"].forEach(m=>{s[m]===void 0?a[`${u}-${m}`]=f:a[`${u}-${m}`]=typeof s[m]=="number"?`${s[m]}px`:s[m]}):p(f)}),a}const YC=ge.forwardRef(function(n,a){const{invert:s,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:f,className:p,offset:m,mobileOffset:y,theme:g="light",richColors:b,duration:S,style:C,visibleToasts:N=AC,toastOptions:j,dir:L=wg(),gap:R=VC,icons:D,containerAriaLabel:H="Notifications"}=n,[K,re]=ge.useState([]),O=ge.useMemo(()=>Array.from(new Set([o].concat(K.filter(T=>T.position).map(T=>T.position)))),[K,o]),[w,M]=ge.useState([]),[E,U]=ge.useState(!1),[Y,I]=ge.useState(!1),[W,Q]=ge.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=ge.useRef(null),B=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=ge.useRef(null),X=ge.useRef(!1),J=ge.useCallback(T=>{re(A=>{var te;return(te=A.find(ie=>ie.id===T.id))!=null&&te.delete||Rn.dismiss(T.id),A.filter(({id:ie})=>ie!==T.id)})},[]);return ge.useEffect(()=>Rn.subscribe(T=>{if(T.dismiss){requestAnimationFrame(()=>{re(A=>A.map(te=>te.id===T.id?{...te,delete:!0}:te))});return}setTimeout(()=>{Uw.flushSync(()=>{re(A=>{const te=A.findIndex(ie=>ie.id===T.id);return te!==-1?[...A.slice(0,te),{...A[te],...T},...A.slice(te+1)]:[T,...A]})})})}),[K]),ge.useEffect(()=>{if(g!=="system"){Q(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Q("dark"):Q("light")),typeof window>"u")return;const T=window.matchMedia("(prefers-color-scheme: dark)");try{T.addEventListener("change",({matches:A})=>{Q(A?"dark":"light")})}catch{T.addListener(({matches:te})=>{try{Q(te?"dark":"light")}catch(ie){console.error(ie)}})}},[g]),ge.useEffect(()=>{K.length<=1&&U(!1)},[K]),ge.useEffect(()=>{const T=A=>{var te;if(l.every(ae=>A[ae]||A.code===ae)){var oe;U(!0),(oe=G.current)==null||oe.focus()}A.code==="Escape"&&(document.activeElement===G.current||(te=G.current)!=null&&te.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[l]),ge.useEffect(()=>{if(G.current)return()=>{_.current&&(_.current.focus({preventScroll:!0}),_.current=null,X.current=!1)}},[G.current]),ge.createElement("section",{ref:a,"aria-label":`${H} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((T,A)=>{var te;const[ie,oe]=T.split("-");return K.length?ge.createElement("ol",{key:T,dir:L==="auto"?wg():L,tabIndex:-1,ref:G,className:p,"data-sonner-toaster":!0,"data-sonner-theme":W,"data-y-position":ie,"data-lifted":E&&K.length>1&&!u,"data-x-position":oe,style:{"--front-toast-height":`${((te=w[0])==null?void 0:te.height)||0}px`,"--width":`${BC}px`,"--gap":`${R}px`,...C,...KC(m,y)},onBlur:ae=>{X.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(X.current=!1,_.current&&(_.current.focus({preventScroll:!0}),_.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||X.current||(X.current=!0,_.current=ae.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{Y||U(!1)},onDragEnd:()=>U(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},K.filter(ae=>!ae.position&&A===0||ae.position===T).map((ae,ue)=>{var xe,ve;return ge.createElement(WC,{key:ae.id,icons:D,index:ue,toast:ae,defaultRichColors:b,duration:(xe=j==null?void 0:j.duration)!=null?xe:S,className:j==null?void 0:j.className,descriptionClassName:j==null?void 0:j.descriptionClassName,invert:s,visibleToasts:N,closeButton:(ve=j==null?void 0:j.closeButton)!=null?ve:f,interacting:Y,position:T,style:j==null?void 0:j.style,unstyled:j==null?void 0:j.unstyled,classNames:j==null?void 0:j.classNames,cancelButtonStyle:j==null?void 0:j.cancelButtonStyle,actionButtonStyle:j==null?void 0:j.actionButtonStyle,closeButtonAriaLabel:j==null?void 0:j.closeButtonAriaLabel,removeToast:J,toasts:K.filter(Ve=>Ve.position==ae.position),heights:w.filter(Ve=>Ve.position==ae.position),setHeights:M,expandByDefault:u,gap:R,expanded:E,swipeDirections:n.swipeDirections})})):null}))}),Sg=e=>e?new Promise(n=>{const a=new Image;a.onload=()=>{if(a.decode){a.decode().then(()=>n()).catch(()=>n());return}n()},a.onerror=()=>n(),a.src=e}):Promise.resolve(),id=e=>[e.id,e.image,e.authorAvatar].join("|");function GC(){const{topicId:e}=Ul(),n=an(),{isProfileComplete:a}=mr(),s=v.useMemo(()=>Sj(e),[e]);gr((s==null?void 0:s.title)||"فید");const{feedItems:o,initialLoading:l,loadingMore:u,error:f,hasMore:p,loadMore:m,deletePost:y}=mC(s),g=v.useMemo(()=>s?o.map(W=>gC(W,s.serverName)):[],[o,s]),[b,S]=v.useState(()=>new Set),[C,N]=v.useState(!1),[j,L]=v.useState({}),[R,D]=v.useState(()=>new Set);v.useEffect(()=>{let W=!1;const Q=g.filter(G=>!b.has(id(G)));if(Q.length!==0)return Promise.all(Q.map(async G=>(await Promise.all([Sg(G.image),Sg(G.authorAvatar)]),id(G)))).then(G=>{W||S(B=>{const _=new Set(B);return G.forEach(X=>_.add(X)),_})}),()=>{W=!0}},[g,b]);const H=v.useMemo(()=>g.filter(W=>b.has(id(W))),[g,b]),K=v.useMemo(()=>g.filter(W=>typeof W.teamMemberIds=="string"&&W.teamMemberIds.trim().length>0),[g]);v.useEffect(()=>{let W=!1;const Q=K.filter(G=>!R.has(G.id));if(Q.length!==0)return Promise.all(Q.map(async G=>{const B=await jx(G.teamMemberIds.trim());return{id:G.id,members:B.success?B.data:[]}})).then(G=>{W||(L(B=>{const _={...B};return G.forEach(({id:X,members:J})=>{_[X]=J}),_}),D(B=>{const _=new Set(B);return G.forEach(({id:X})=>_.add(X)),_}))}),()=>{W=!0}},[K,R]);const re=g.length===0||H.length===g.length,O=K.length===0||K.every(W=>R.has(W.id));v.useEffect(()=>{!l&&g.length>0&&re&&O&&N(!0)},[re,O,l,g.length]);const w=v.useCallback(W=>{const Q=W.currentTarget,G=Q.scrollHeight-Q.clientHeight-80;Q.scrollTop>=G&&!u&&p&&m()},[u,p,m]),M=v.useCallback(()=>{if(!a){LC.error("لطفاً ابتدا پروفایل خود را در قسمت 'پروفایل من' تکمیل کنید",{duration:3e3,position:"top-center"});return}n(`/challenges/${e}`)},[n,e,a]),E=v.useCallback(()=>{n("/")},[n]);if(!s)return d.jsx("div",{className:"flex items-center justify-center h-screen text-white",children:"موضوع یافت نشد"});const U=!l&&!f&&g.length===0,Y=!l&&g.length>0&&!C,I=H.length<g.length;return d.jsxs("div",{className:"feed-page-shell fixed inset-0 w-full h-screen overflow-hidden",children:[d.jsx(Wr,{position:"fixed",zIndex:0,imageUrl:mn.feed}),d.jsxs("div",{className:"relative z-10 max-w-md mx-auto h-full flex flex-col",children:[d.jsx(qi,{topicTitle:s.title,subtitle:"صفحه فید",onBack:E}),l||Y?d.jsx("div",{className:"flex-1 flex items-center justify-center",children:d.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-white"})}):U?d.jsx(xC,{accentColor:s.accentColor,onStartMission:M}):d.jsx(yC,{posts:H.map(W=>({...W,preloadedTeamMembers:j[W.id]})),loadingMore:u||I,error:f,onScroll:w,onDelete:y})]}),d.jsx(vC,{onClick:M}),d.jsx(Ga,{fixed:!0})]})}function XC(){return d.jsx(y1,{children:d.jsx(GC,{})})}const Af="/assets/c11973053d8410ffeb3c76aa4d1da6991076e7e1-Cd6V5TCX.png",JC={background:"linear-gradient(135deg, rgba(50, 107, 118, 0.6) 0%, rgba(32, 76, 106, 0.6) 100%)",border:"1.5px solid rgba(138, 206, 224, 0.3)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.2)"};function Ms({type:e,uploadedFile:n,onUpload:a,onRemove:s,fileName:o,label:l,required:u}){const f=e==="video",p=n?"1.5px solid rgba(138, 206, 224, 0.5)":u?"1.5px dashed rgba(255, 184, 0, 0.6)":"1.5px dashed rgba(138, 206, 224, 0.5)";return d.jsxs("div",{children:[l&&d.jsxs("label",{className:"block text-white text-sm font-bold mb-3",children:[l,u&&d.jsx("span",{className:"mr-2 text-xs font-normal px-2 py-0.5 rounded-full",style:{background:"rgba(255, 184, 0, 0.2)",color:"#FFB800",border:"1px solid rgba(255, 184, 0, 0.4)"},children:"الزامی"})]}),d.jsx("div",{className:"relative rounded-2xl overflow-hidden",style:{...JC,border:p},children:n?d.jsxs("div",{className:"relative",children:[f?d.jsxs(d.Fragment,{children:[d.jsx("video",{src:n,className:"w-full h-48 object-cover",controls:!1,muted:!0}),d.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:d.jsx("div",{className:"w-14 h-14 rounded-full flex items-center justify-center",style:{background:"rgba(0,0,0,0.5)",border:"2px solid rgba(255,255,255,0.6)"},children:d.jsx(Xi,{className:"w-6 h-6 text-white fill-white ml-1"})})}),o&&d.jsx("div",{className:"absolute bottom-0 left-0 right-0 px-3 py-2",style:{background:"rgba(0,0,0,0.55)"},children:d.jsx("p",{className:"text-white text-xs truncate",children:o})})]}):d.jsx("img",{src:n,alt:"آپلود شده",className:"w-full h-48 object-cover"}),d.jsx(se.button,{whileTap:{scale:.9},onClick:s,className:"absolute top-2 left-2 w-8 h-8 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(220, 38, 38, 0.9) 0%, rgba(185, 28, 28, 0.9) 100%)",boxShadow:"0 4px 12px rgba(220, 38, 38, 0.4)"},children:d.jsx(Ds,{className:"w-4 h-4 text-white"})})]}):d.jsxs("label",{className:"flex flex-col items-center justify-center h-48 cursor-pointer",children:[u?d.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-2",style:{background:"linear-gradient(135deg, rgba(255, 184, 0, 0.3) 0%, rgba(255, 140, 0, 0.3) 100%)",border:"1.5px solid rgba(255, 184, 0, 0.5)"},children:d.jsx(cx,{className:"w-6 h-6 text-yellow-400"})}):f?d.jsx(hx,{className:"w-12 h-12 text-white/70 mb-2"}):d.jsx(Df,{className:"w-12 h-12 text-white/70 mb-2"}),d.jsx("span",{className:`text-sm ${u?"text-white/80":"text-white/70"}`,children:f?u?"انتخاب کاور برای ویدیو":"کلیک کنید برای آپلود ویدیو":"کلیک کنید برای آپلود تصویر"}),f&&!u&&d.jsx("span",{className:"text-white/40 text-xs mt-1",children:"MP4، MOV، AVI پشتیبانی میشود"}),u&&d.jsx("span",{className:"text-white/40 text-xs mt-1",children:"تصویری که نمایش داده میشود"}),d.jsx("input",{type:"file",accept:f?"video/*":"image/*",onChange:a,className:"hidden"})]})})]})}const qC={background:"linear-gradient(135deg, rgba(50, 107, 118, 0.6) 0%, rgba(32, 76, 106, 0.6) 100%)",border:"1.5px solid rgba(138, 206, 224, 0.3)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.2)"};function QC(e,n){const[a,s]=v.useState(e);return v.useEffect(()=>{const o=setTimeout(()=>{s(e)},n);return()=>{clearTimeout(o)}},[e,n]),a}async function ZC(e){try{const n=localStorage.getItem("accessToken");if(!n)return console.error("No token found"),null;const a=await fetch(`${nt}/api/call`,{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify({get_person_function:{mobile:e.replace(/^0/,"")}})});if(!a.ok)return null;const s=await a.json();if(s.state===0&&s.data){const o=JSON.parse(s.data);if(o.full_name&&o.user_id)return{fullName:o.full_name,userId:o.user_id}}return null}catch(n){return console.error("Error verifying phone:",n),null}}function eN({teammate:e,canRemove:n,allTeammates:a,currentUserPhone:s,currentUserId:o,onRemove:l,onChange:u,onVerify:f}){const[p,m]=v.useState(!1),[y,g]=v.useState(""),b=QC(e.phone,1e3),S=v.useMemo(()=>a.map(j=>j.phone).join(","),[a]);v.useEffect(()=>{(async()=>{if(b===y)return;if(!b){g("");return}if(!/^09\d{9}$/.test(b)){g("");return}if(a.find(D=>D.id!==e.id&&D.phone===b)){f("","","این شماره قبلاً وارد شده است"),g(b);return}m(!0);const R=await ZC(b);if(m(!1),R){if(R.userId===o){f("","","شما نمیتوانید خودتان را به عنوان عضو اضافه کنید"),g(b);return}f(R.fullName,R.userId)}else f("","","کاربر یافت نشد");g(b)})()},[b,o,S,e.id,y]);const C=e.error||e.fullName===""&&/^09\d{9}$/.test(e.phone),N=e.fullName&&!e.error;return d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("div",{className:"flex-1 relative",children:[d.jsx("input",{type:"tel",value:e.phone,onChange:j=>{const L=j.target.value;(L===""||/^[0-9]*$/.test(L))&&u(L)},placeholder:"۰۹۱۲۳۴۵۶۷۸۹",dir:"ltr",maxLength:11,className:"w-full rounded-2xl text-white text-sm outline-none pl-[43px] pr-[48px] py-[12px]",style:qC}),d.jsxs("div",{className:"absolute left-3 top-1/2 -translate-y-1/2",children:[p&&d.jsx(R6,{className:"w-5 h-5 text-blue-400 animate-spin"}),!p&&N&&d.jsx(d6,{className:"w-5 h-5 text-green-400 m-[0px]"}),!p&&C&&d.jsx(ox,{className:"w-5 h-5 text-red-400"})]})]}),n&&d.jsx(se.button,{type:"button",whileTap:{scale:.9},onClick:l,className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(135deg, rgba(220, 38, 38, 0.8) 0%, rgba(185, 28, 28, 0.8) 100%)",boxShadow:"0 4px 12px rgba(220, 38, 38, 0.4)"},children:d.jsx(Ds,{className:"w-5 h-5 text-white"})})]}),!p&&N&&d.jsxs("div",{className:"text-sm text-green-300 flex items-center gap-1 px-[8px] py-[0px] m-[0px]",children:[d.jsx("span",{children:"✓"}),d.jsx("span",{children:e.fullName})]}),!p&&e.error&&d.jsxs("div",{className:"px-2 text-sm text-red-300 flex items-center gap-1",children:[d.jsx("span",{children:"✗"}),d.jsx("span",{children:e.error})]}),!p&&!e.error&&e.fullName===""&&/^09\d{9}$/.test(e.phone)&&d.jsxs("div",{className:"px-2 text-sm text-red-300 flex items-center gap-1",children:[d.jsx("span",{children:"✗"}),d.jsx("span",{children:"کاربر یافت نشد"})]})]})}function Of({teammates:e,onAdd:n,onRemove:a,onChange:s,onVerify:o}){const[l,u]=v.useState(""),[f,p]=v.useState("");return v.useEffect(()=>{const m=hr();m!=null&&m.username&&u(m.username),m!=null&&m.user_id&&p(m.user_id)},[]),d.jsxs("div",{children:[d.jsx("label",{className:"block text-white text-sm font-bold mb-3",children:"شماره تلفن همتیمیها"}),d.jsxs("div",{className:"space-y-3",children:[e.map(m=>d.jsx(eN,{teammate:m,canRemove:e.length>1,allTeammates:e,currentUserPhone:l,currentUserId:f,onRemove:()=>a(m.id),onChange:y=>s(m.id,y),onVerify:(y,g,b)=>o(m.id,y,g,b)},m.id)),d.jsxs(se.button,{type:"button",whileTap:{scale:.95},onClick:n,className:"w-full px-4 py-3 rounded-2xl text-white text-sm font-bold flex items-center justify-center gap-2",style:{background:"linear-gradient(135deg, rgba(100, 200, 255, 0.3) 0%, rgba(50, 150, 220, 0.3) 100%)",border:"1.5px dashed rgba(138, 206, 224, 0.5)"},children:[d.jsx(If,{className:"w-5 h-5"}),"افزودن همتیمی"]})]})]})}const kg={background:"linear-gradient(135deg, rgba(50, 107, 118, 0.6) 0%, rgba(32, 76, 106, 0.6) 100%)",border:"1.5px solid rgba(138, 206, 224, 0.3)",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.2)"};function ka({label:e,value:n,onChange:a,placeholder:s,multiline:o,rows:l=6}){return d.jsxs("div",{children:[d.jsx("label",{className:"block text-white text-sm font-bold mb-3",children:e}),o?d.jsx("textarea",{value:n,onChange:u=>a(u.target.value),placeholder:s,dir:"rtl",rows:l,className:"w-full px-4 py-3 rounded-2xl text-white text-sm outline-none resize-none",style:kg}):d.jsx("input",{type:"text",value:n,onChange:u=>a(u.target.value),placeholder:s,dir:"rtl",className:"w-full px-4 py-3 rounded-2xl text-white text-sm outline-none",style:kg})]})}const od=()=>`teammate-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;function ld({topicId:e,topicTitle:n,onSubmit:a}){const s=Bs(e),{refreshProfile:o}=mr(),[l,u]=v.useState(""),[f,p]=v.useState(""),[m,y]=v.useState([{id:od(),phone:""}]),[g,b]=v.useState(null),[S,C]=v.useState(null),[N,j]=v.useState(!1),[L,R]=v.useState(""),D=M=>{var U;const E=(U=M.target.files)==null?void 0:U[0];if(E){C(E);const Y=new FileReader;Y.onloadend=()=>b(Y.result),Y.readAsDataURL(E)}},H=()=>{y([...m,{id:od(),phone:""}])},K=M=>{const E=m.filter(U=>U.id!==M);y(E.length>0?E:[{id:od(),phone:""}])},re=(M,E)=>{y(m.map(U=>U.id===M?{...U,phone:E,fullName:void 0,userId:void 0,error:void 0}:U))},O=(M,E,U,Y)=>{y(m.map(I=>I.id===M?{...I,fullName:E,userId:U,error:Y}:I))},w=async()=>{if(!N){j(!0);try{let M="";if(S){R("در حال آپلود تصویر...");const I=await Fs(S);if(I)M=I;else{alert("خطا در آپلود تصویر"),j(!1),R("");return}}const E=m.filter(I=>I.userId).map(I=>I.userId).join(","),U=localStorage.getItem("current_workflow_ID")||"";R("در حال ثبت ماموریت...");const Y=await Jl({title:l||"",mission_type:n,mission_done_workflowID:U,description:f||"",film:"",image:M,audio:"",team_member:E});Y.success?(await o(),a({topicId:e,title:l,learnings:f,teammates:E?[E]:[],mediaType:"image",uploadedImage:g})):alert(Y.message||"خطا در ثبت ماموریت")}catch(M){console.error("Error submitting:",M),alert("خطا در ثبت ماموریت")}finally{j(!1),R("")}}};return d.jsxs("div",{className:"space-y-6",dir:"rtl",children:[d.jsx(Ms,{type:"image",uploadedFile:g,onUpload:D,onRemove:()=>b(null),label:"تصویر چالش"}),s.requiresTeammates&&d.jsx(Of,{teammates:m,onAdd:H,onRemove:K,onChange:re,onVerify:O}),d.jsx(ka,{label:"عنوان چالش",value:l,onChange:u,placeholder:"عنوان چالش خود را وارد کنید..."}),d.jsx(ka,{label:"از این چالش چه چیزی یاد گرفتیم",value:f,onChange:p,placeholder:"توضیحات خود را وارد کنید...",multiline:!0,rows:6}),d.jsx(se.button,{whileTap:{scale:.95},onClick:w,disabled:N,className:"w-full py-4 rounded-full text-white text-base font-bold mb-6",style:{background:N?"linear-gradient(135deg, rgba(150, 150, 150, 0.95) 0%, rgba(100, 100, 100, 0.95) 100%)":"linear-gradient(135deg, rgba(255, 183, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)",boxShadow:"0 8px 24px rgba(255, 165, 0, 0.5)",border:"1.5px solid rgba(255, 200, 50, 0.5)",opacity:N?.7:1,cursor:N?"not-allowed":"pointer"},children:N?"در حال ثبت...":"ثبت نهایی چالش"}),L&&d.jsx(se.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"text-center mb-4 p-4 rounded-2xl",style:{background:"linear-gradient(135deg, rgba(135, 206, 250, 0.15) 0%, rgba(100, 149, 237, 0.15) 100%)",border:"2px solid rgba(135, 206, 250, 0.3)"},children:d.jsxs("div",{className:"flex items-center justify-center gap-3",children:[d.jsx(se.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-5 h-5 border-3 border-blue-400 border-t-transparent rounded-full"}),d.jsx("span",{className:"text-blue-600 font-bold text-sm",children:L})]})})]})}const cd=()=>`teammate-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;function ud({topicId:e,topicTitle:n,onSubmit:a}){const s=Bs(e),{refreshProfile:o}=mr(),[l,u]=v.useState(""),[f,p]=v.useState(""),[m,y]=v.useState([{id:cd(),phone:""}]),[g,b]=v.useState("image"),[S,C]=v.useState(null),[N,j]=v.useState(null),[L,R]=v.useState(null),[D,H]=v.useState(null),[K,re]=v.useState(null),[O,w]=v.useState(null),[M,E]=v.useState(!1),[U,Y]=v.useState(""),I=te=>{var oe;const ie=(oe=te.target.files)==null?void 0:oe[0];if(ie){j(ie);const ae=new FileReader;ae.onloadend=()=>C(ae.result),ae.readAsDataURL(ie)}},W=te=>{var oe;const ie=(oe=te.target.files)==null?void 0:oe[0];if(ie){H(ie);const ae=URL.createObjectURL(ie);R({url:ae,name:ie.name}),re(null),w(null)}},Q=te=>{var oe;const ie=(oe=te.target.files)==null?void 0:oe[0];if(ie){w(ie);const ae=new FileReader;ae.onloadend=()=>re(ae.result),ae.readAsDataURL(ie)}},G=te=>{b(te),C(null),j(null),R(null),H(null),re(null),w(null)},B=()=>{y([...m,{id:cd(),phone:""}])},_=te=>{const ie=m.filter(oe=>oe.id!==te);y(ie.length>0?ie:[{id:cd(),phone:""}])},X=(te,ie)=>{y(m.map(oe=>oe.id===te?{...oe,phone:ie,fullName:void 0,userId:void 0,error:void 0}:oe))},J=(te,ie,oe,ae)=>{y(m.map(ue=>ue.id===te?{...ue,fullName:ie,userId:oe,error:ae}:ue))},T=async()=>{if(!M){E(!0);try{let te="",ie="";if(g==="video"){if(!D||!O){alert("لطفاً ویدیو و کاور آن را انتخاب کنید"),E(!1);return}Y("در حال آپلود ویدیو...");const xe=await kx(D);if(!xe){alert("خطا در آپلود ویدیو"),E(!1),Y("");return}ie=xe,Y("در حال آپلود کاور ویدیو...");const ve=await Fs(O);if(!ve){alert("خطا در آپلود کاور ویدیو"),E(!1),Y("");return}te=ve}else if(g==="image"&&N){Y("در حال آپلود تصویر...");const xe=await Fs(N);if(!xe){alert("خطا در آپلود تصویر"),E(!1),Y("");return}te=xe}const oe=m.filter(xe=>xe.userId).map(xe=>xe.userId).join(","),ae=localStorage.getItem("current_workflow_ID")||"";Y("در حال ثبت ماموریت...");const ue=await Jl({title:l||"",mission_type:n,mission_done_workflowID:ae,description:f||"",film:ie,image:te,audio:"",team_member:oe});ue.success?(await o(),a({topicId:e,title:l,learnings:f,teammates:oe?[oe]:[],mediaType:g,uploadedImage:S,uploadedVideo:L,videoCover:K})):alert(ue.message||"خطا در ثبت ماموریت")}catch(te){console.error("Error submitting:",te),alert("خطا در ثبت ماموریت")}finally{E(!1),Y("")}}},A=g==="video"&&L!==null&&K===null;return d.jsxs("div",{className:"space-y-6",dir:"rtl",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-white text-sm font-bold mb-3",children:"رسانه چالش"}),d.jsx("div",{className:"flex rounded-2xl p-1 mb-4",style:{background:"linear-gradient(135deg, rgba(20, 50, 70, 0.7) 0%, rgba(10, 30, 50, 0.7) 100%)",border:"1.5px solid rgba(138, 206, 224, 0.2)"},children:["image","video"].map(te=>d.jsx(se.button,{whileTap:{scale:.96},onClick:()=>G(te),className:"flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl text-sm font-bold transition-all duration-300",style:g===te?{background:"linear-gradient(135deg, rgba(255, 184, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)",color:"#5A3800",boxShadow:"0 4px 12px rgba(255, 165, 0, 0.4)"}:{color:"rgba(255,255,255,0.55)"},children:te==="image"?d.jsxs(d.Fragment,{children:[d.jsx(cx,{className:"w-4 h-4"})," عکس"]}):d.jsxs(d.Fragment,{children:[d.jsx(hx,{className:"w-4 h-4"})," ویدیو"]})},te))}),d.jsxs(gn,{mode:"wait",children:[g==="image"&&d.jsx(se.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.25},children:d.jsx(Ms,{type:"image",uploadedFile:S,onUpload:I,onRemove:()=>C(null)})},"image-upload"),g==="video"&&d.jsxs(se.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.25},className:"space-y-4",children:[d.jsx(Ms,{type:"video",uploadedFile:(L==null?void 0:L.url)||null,onUpload:W,onRemove:()=>{R(null),re(null)},fileName:L==null?void 0:L.name}),d.jsx(gn,{children:L&&d.jsx(se.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},children:d.jsx(Ms,{type:"image",uploadedFile:K,onUpload:Q,onRemove:()=>re(null),label:"کاور ویدیو",required:!0})})})]},"video-upload")]})]}),s.requiresTeammates&&d.jsx(Of,{teammates:m,onAdd:B,onRemove:_,onChange:X,onVerify:J}),d.jsx(ka,{label:"عنوان چالش",value:l,onChange:u,placeholder:"عنوان چالش خود را وارد کنید..."}),d.jsx(ka,{label:"از این چالش چه چیزی یاد گرفتیم",value:f,onChange:p,placeholder:"توضیحات خود را وارد کنید...",multiline:!0,rows:6}),d.jsx(se.button,{whileTap:{scale:.95},onClick:T,disabled:A||M,className:"w-full py-4 rounded-full text-white text-base font-bold mb-6 transition-opacity",style:{background:A||M?"linear-gradient(135deg, rgba(100,100,100,0.6) 0%, rgba(70,70,70,0.6) 100%)":"linear-gradient(135deg, rgba(255, 183, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)",boxShadow:A||M?"none":"0 8px 24px rgba(255, 165, 0, 0.5)",border:"1.5px solid rgba(255, 200, 50, 0.5)"},children:A?"ابتدا کاور ویدیو را انتخاب کنید":M?"در حال ارسال...":"ثبت نهایی چالش"}),U&&d.jsx(se.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"text-center mb-4 p-4 rounded-2xl",style:{background:"linear-gradient(135deg, rgba(135, 206, 250, 0.15) 0%, rgba(100, 149, 237, 0.15) 100%)",border:"2px solid rgba(135, 206, 250, 0.3)"},children:d.jsxs("div",{className:"flex items-center justify-center gap-3",children:[d.jsx(se.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-5 h-5 border-3 border-blue-400 border-t-transparent rounded-full"}),d.jsx("span",{className:"text-blue-600 font-bold text-sm",children:U})]})})]})}function tN({onSupervisorDataChange:e,initialMobile:n="",initialCode:a=""}){const[s,o]=v.useState(""),[l,u]=v.useState(""),[f,p]=v.useState(!1),[m,y]=v.useState(!1);v.useEffect(()=>{n&&a?(o(n),u(""),p(!0)):n&&!a&&o(n)},[n,a]),v.useEffect(()=>{const S=s.length===10?`0${s}`:s;e(S,l)},[s,l,e]);const g=async()=>{if(!s||s.length<10){alert("لطفاً شماره تلفن معتبر وارد کنید");return}const S=localStorage.getItem("current_workflow_ID");if(!S){alert("خطا: شناسه ماموریت یافت نشد. لطفاً دوباره تلاش کنید.");return}y(!0);const C=s.length===10?`0${s}`:s;try{const N=await Q8(C,S);N.success?(p(!0),alert(N.message||`کد تأیید به شماره ${s} ارسال شد`)):alert(N.message||"خطا در ارسال کد. لطفاً دوباره تلاش کنید.")}catch(N){console.error("Error sending supervisor code:",N),alert("خطا در ارتباط با سرور. لطفاً دوباره تلاش کنید.")}finally{y(!1)}},b=()=>{p(!1),u("")};return d.jsxs("div",{className:"relative overflow-hidden rounded-3xl p-6",style:{background:"linear-gradient(135deg, rgba(168, 144, 224, 0.15) 0%, rgba(138, 206, 224, 0.15) 100%)",border:"2px solid rgba(168, 144, 224, 0.3)",boxShadow:"0 8px 24px rgba(168, 144, 224, 0.2)"},children:[d.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[d.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, #A890E0 0%, #8ACEE0 100%)",boxShadow:"0 4px 12px rgba(168, 144, 224, 0.4)"},children:d.jsx(t8,{className:"w-5 h-5 text-white"})}),d.jsxs("div",{className:"flex-1",children:[d.jsx("h3",{className:"text-white font-bold text-base",children:"درخواست معرفی ناظر"}),d.jsx("p",{className:"text-white/70 text-sm mt-0.5",children:"شماره تلفن ناظر خود را وارد کنید"})]})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"relative",children:d.jsx("input",{type:"tel",value:s,onChange:S=>o(S.target.value.replace(/\D/g,"")),maxLength:11,placeholder:"09123456789",disabled:f,className:"w-full px-4 py-3 rounded-2xl text-white text-center text-lg font-bold tracking-wider",style:{background:"rgba(10, 20, 35, 0.6)",border:"2px solid rgba(168, 144, 224, 0.4)",outline:"none"},dir:"ltr"})}),!f&&d.jsx(se.button,{whileTap:{scale:.95},onClick:g,disabled:m||s.length<10,className:"w-full py-3 rounded-2xl text-white font-bold flex items-center justify-center gap-2",style:{background:s.length>=10?"linear-gradient(135deg, #A890E0 0%, #8ACEE0 100%)":"rgba(100, 100, 100, 0.5)",boxShadow:s.length>=10?"0 4px 16px rgba(168, 144, 224, 0.4)":"none",cursor:s.length>=10?"pointer":"not-allowed"},children:m?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}),"در حال ارسال..."]}):d.jsxs(d.Fragment,{children:[d.jsx(_f,{className:"w-5 h-5"}),"ارسال کد تأیید"]})}),f&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"relative",children:d.jsx("input",{type:"text",value:l,onChange:S=>u(S.target.value.replace(/\D/g,"")),maxLength:6,placeholder:"کد تأیید را وارد کنید",className:"w-full px-4 py-3 rounded-2xl text-white text-center text-xl font-bold tracking-widest",style:{background:"rgba(10, 20, 35, 0.6)",border:"2px solid rgba(168, 144, 224, 0.4)",outline:"none"},dir:"ltr"})}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:b,className:"flex-1 py-2.5 rounded-2xl text-white/80 text-sm font-bold hover:text-white transition-colors",style:{background:"rgba(168, 144, 224, 0.2)",border:"1px solid rgba(168, 144, 224, 0.3)"},children:"تغییر شماره"}),d.jsx("button",{onClick:()=>{p(!1),u("")},className:"flex-1 py-2.5 rounded-2xl text-white/80 text-sm font-bold hover:text-white transition-colors",style:{background:"rgba(168, 144, 224, 0.2)",border:"1px solid rgba(168, 144, 224, 0.3)"},children:"ارسال مجدد کد"})]})]})]})]})}function nN({topicId:e,topicTitle:n,onSubmit:a,doingMission:s}){const{refreshProfile:o}=mr(),[l,u]=v.useState(""),[f,p]=v.useState(""),[m,y]=v.useState(null),[g,b]=v.useState(null),[S,C]=v.useState(""),[N,j]=v.useState(""),[L,R]=v.useState(!1),[D,H]=v.useState(""),K=(s==null?void 0:s.mobile)||"",re=(s==null?void 0:s.code)||"",O=E=>{var Y;const U=(Y=E.target.files)==null?void 0:Y[0];if(U){b(U);const I=new FileReader;I.onloadend=()=>y(I.result),I.readAsDataURL(U)}},w=(E,U)=>{C(E),j(U)},M=async()=>{if(S.length<10){alert("لطفاً شماره تلفن ناظر را به طور کامل وارد کنید");return}if(N.length<6){alert("لطفاً کد تأیید 6 رقمی ناظر را وارد کنید");return}if(!L){R(!0);try{let E="";if(g){H("در حال آپلود تصویر...");const W=await Fs(g);if(W)E=W;else{alert("خطا در آپلود تصویر"),R(!1),H("");return}}const U=localStorage.getItem("current_workflow_ID")||"",Y=S.length===10?`0${S}`:S;H("در حال ثبت ماموریت...");const I=await Jl({title:l||"",mission_type:n,mission_done_workflowID:U,description:f||"",film:"",image:E,audio:"",team_member:"",enter_code:N});I.success?(await o(),a({topicId:e,title:l,learnings:f,mediaType:"image",uploadedImage:m,supervisor:{phone:S,code:N}})):alert(I.message||"خطا در ثبت ماموریت")}catch(E){console.error("Error submitting:",E),alert("خطا در ثبت ماموریت")}finally{R(!1),H("")}}};return d.jsxs("div",{className:"space-y-6",dir:"rtl",children:[d.jsx(Ms,{type:"image",uploadedFile:m,onUpload:O,onRemove:()=>y(null),label:"تصویر چالش"}),d.jsx(tN,{onSupervisorDataChange:w,initialMobile:K,initialCode:re}),d.jsx(ka,{label:"عنوان چالش",value:l,onChange:u,placeholder:"عنوان چالش خود را وارد کنید..."}),d.jsx(ka,{label:"از این چالش چه چیزی یاد گرفتیم",value:f,onChange:p,placeholder:"توضیحات خود را وارد کنید...",multiline:!0,rows:6}),d.jsx(se.button,{whileTap:{scale:.95},onClick:M,disabled:S.length<10||N.length<6||L,className:"w-full py-4 rounded-full text-white text-base font-bold mb-6",style:{background:S.length>=10&&N.length>=6&&!L?"linear-gradient(135deg, rgba(255, 184, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)":"rgba(100, 100, 100, 0.5)",boxShadow:S.length>=10&&N.length>=6&&!L?"0 8px 24px rgba(255, 165, 0, 0.4)":"none",border:"2px solid rgba(255, 184, 0, 0.3)",cursor:S.length>=10&&N.length>=6&&!L?"pointer":"not-allowed",opacity:L?.7:1},children:S.length<10||N.length<6?"لطفاً شماره و کد ناظر را کامل کنید":L?"در حال ثبت...":"ثبت نهایی چالش"}),D&&d.jsx(se.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"text-center mb-4 p-4 rounded-2xl",style:{background:"linear-gradient(135deg, rgba(135, 206, 250, 0.15) 0%, rgba(100, 149, 237, 0.15) 100%)",border:"2px solid rgba(135, 206, 250, 0.3)"},children:d.jsxs("div",{className:"flex items-center justify-center gap-3",children:[d.jsx(se.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-5 h-5 border-3 border-blue-400 border-t-transparent rounded-full"}),d.jsx("span",{className:"text-blue-600 font-bold text-sm",children:D})]})})]})}function rN({uploadedAudio:e,onUpload:n,onRemove:a,label:s="پادکست صوتی"}){const o=v.useRef(null);return d.jsxs("div",{className:"relative overflow-hidden rounded-3xl p-6",style:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.15) 0%, rgba(128, 208, 224, 0.15) 100%)",border:"2px solid rgba(138, 206, 224, 0.3)",boxShadow:"0 8px 24px rgba(138, 206, 224, 0.2)"},children:[d.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[d.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, #8ACEE0 0%, #80D0E0 100%)",boxShadow:"0 4px 12px rgba(138, 206, 224, 0.4)"},children:d.jsx(A6,{className:"w-5 h-5 text-white"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-white font-bold text-base",children:s}),d.jsx("p",{className:"text-white/70 text-sm",children:"MP3, WAV, M4A"})]})]}),e?d.jsxs("div",{className:"relative rounded-2xl p-4",style:{background:"rgba(10, 20, 35, 0.6)",border:"2px solid rgba(138, 206, 224, 0.4)"},children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("div",{className:"w-14 h-14 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(135deg, #8ACEE0 0%, #80D0E0 100%)",boxShadow:"0 4px 12px rgba(138, 206, 224, 0.4)"},children:d.jsx(z6,{className:"w-7 h-7 text-white"})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsxs("audio",{controls:!0,className:"w-full",style:{maxHeight:"40px"},children:[d.jsx("source",{src:e}),"مرورگر شما از پخش صوت پشتیبانی نمیکند."]})})]}),d.jsx(se.button,{whileTap:{scale:.9},onClick:a,className:"absolute -top-3 -left-3 w-10 h-10 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, #ef4444 0%, #dc2626 100%)",boxShadow:"0 4px 12px rgba(239, 68, 68, 0.4)"},children:d.jsx(dx,{className:"w-5 h-5 text-white"})})]}):d.jsxs(se.button,{whileTap:{scale:.98},onClick:()=>{var l;return(l=o.current)==null?void 0:l.click()},className:"w-full py-8 rounded-2xl border-2 border-dashed flex flex-col items-center justify-center gap-3 transition-all hover:bg-white/5",style:{borderColor:"rgba(138, 206, 224, 0.4)"},children:[d.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(138, 206, 224, 0.3) 0%, rgba(128, 208, 224, 0.3) 100%)"},children:d.jsx(Df,{className:"w-8 h-8 text-[#8ACEE0]"})}),d.jsxs("div",{className:"text-center",children:[d.jsx("p",{className:"text-white font-bold text-base",children:"آپلود فایل صوتی"}),d.jsx("p",{className:"text-white/60 text-sm mt-1",children:"برای انتخاب فایل کلیک کنید"})]})]}),d.jsx("input",{ref:o,type:"file",accept:"audio/*,.mp3,.wav,.m4a",onChange:n,className:"hidden"})]})}const dd=()=>`teammate-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;function jg({topicId:e,topicTitle:n,onSubmit:a}){const s=Bs(e),{refreshProfile:o}=mr(),[l,u]=v.useState(""),[f,p]=v.useState(""),[m,y]=v.useState([{id:dd(),phone:""}]),[g,b]=v.useState(null),[S,C]=v.useState(null),[N,j]=v.useState(null),[L,R]=v.useState(null),[D,H]=v.useState(!1),[K,re]=v.useState(""),O=W=>{var G;const Q=(G=W.target.files)==null?void 0:G[0];if(Q){C(Q);const B=new FileReader;B.onloadend=()=>b(B.result),B.readAsDataURL(Q)}},w=W=>{var G;const Q=(G=W.target.files)==null?void 0:G[0];if(Q){R(Q);const B=new FileReader;B.onloadend=()=>j(B.result),B.readAsDataURL(Q)}},M=()=>{y([...m,{id:dd(),phone:""}])},E=W=>{const Q=m.filter(G=>G.id!==W);y(Q.length>0?Q:[{id:dd(),phone:""}])},U=(W,Q)=>{y(m.map(G=>G.id===W?{...G,phone:Q,fullName:void 0,userId:void 0,error:void 0}:G))},Y=(W,Q,G,B)=>{y(m.map(_=>_.id===W?{..._,fullName:Q,userId:G,error:B}:_))},I=async()=>{if(!D){H(!0);try{let W="",Q="";if(S){re("در حال آپلود تصویر...");const X=await Fs(S);if(X)W=X;else{alert("خطا در آپلود تصویر"),H(!1),re("");return}}if(L){re("در حال آپلود فایل صوتی...");const X=await kx(L);if(X)Q=X;else{alert("خطا در آپلود فایل صوتی"),H(!1),re("");return}if(!S){alert("برای آپلود صوت، تصویر کاور الزامی است"),H(!1),re("");return}}const G=m.filter(X=>X.userId).map(X=>X.userId).join(","),B=localStorage.getItem("current_workflow_ID")||"";re("در حال ثبت ماموریت...");const _=await Jl({title:l||"",mission_type:n,mission_done_workflowID:B,description:f||"",film:"",image:W,audio:Q,team_member:G});_.success?(await o(),a({topicId:e,title:l,learnings:f,teammates:G?[G]:[],mediaType:"image",uploadedImage:g,uploadedAudio:N})):alert(_.message||"خطا در ثبت ماموریت")}catch(W){console.error("Error submitting:",W),alert("خطا در ثبت ماموریت")}finally{H(!1),re("")}}};return d.jsxs("div",{className:"space-y-6",dir:"rtl",children:[d.jsx(Ms,{type:"image",uploadedFile:g,onUpload:O,onRemove:()=>b(null),label:"تصویر چالش"}),d.jsx(rN,{uploadedAudio:N,onUpload:w,onRemove:()=>j(null),label:"پادکست صوتی"}),s.requiresTeammates&&d.jsx(Of,{teammates:m,onAdd:M,onRemove:E,onChange:U,onVerify:Y}),d.jsx(ka,{label:"عنوان چالش",value:l,onChange:u,placeholder:"عنوان چالش خود را وارد کنید..."}),d.jsx(ka,{label:"از این چالش چه چیزی یاد گرفتیم",value:f,onChange:p,placeholder:"توضیحات خود را وارد کنید...",multiline:!0,rows:6}),d.jsx(se.button,{whileTap:{scale:.95},onClick:I,disabled:D,className:"w-full py-4 rounded-full text-white text-base font-bold mb-6",style:{background:D?"linear-gradient(135deg, rgba(150, 150, 150, 0.95) 0%, rgba(100, 100, 100, 0.95) 100%)":"linear-gradient(135deg, rgba(255, 184, 0, 0.95) 0%, rgba(255, 140, 0, 0.95) 100%)",boxShadow:"0 8px 24px rgba(255, 165, 0, 0.4)",border:"2px solid rgba(255, 184, 0, 0.3)",opacity:D?.7:1,cursor:D?"not-allowed":"pointer"},children:D?"در حال ثبت...":"ثبت نهایی چالش"}),K&&d.jsx(se.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"text-center mb-4 p-4 rounded-2xl",style:{background:"linear-gradient(135deg, rgba(135, 206, 250, 0.15) 0%, rgba(100, 149, 237, 0.15) 100%)",border:"2px solid rgba(135, 206, 250, 0.3)"},children:d.jsxs("div",{className:"flex items-center justify-center gap-3",children:[d.jsx(se.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-5 h-5 border-3 border-blue-400 border-t-transparent rounded-full"}),d.jsx("span",{className:"text-blue-600 font-bold text-sm",children:K})]})})]})}const Cg={1:{id:"1",title:"تخته سیاه",description:"ماموریتهای آموزشی و خلاقانه",accentColor:"#8ACEE0",backgroundColor:"#0a1f2e",mediaType:"image",requiresTeammates:!0,formComponent:ld,challenges:[{id:"chalkboard-1",title:"درس جدید یاد بگیر",description:"یک مفهوم علمی یا درسی جدید را با کمک همکلاسیهایت یاد بگیر و برای بقیه توضیح بده."},{id:"chalkboard-2",title:"معلم کوچک",description:"یه درس که بهش مسلطی رو به یه نفر از همکلاسیهایت آموزش بده."},{id:"chalkboard-3",title:"سوال خلاقانه",description:"یه سوال مخصوص از معلمت بپرس که فکر همه رو درگیر کنه."}],chatbotIntro:`سلام! به دنیای تخته سیاه خوش اومدی 📚✨
|
||
|
||
اینجا میتونی ماموریتهای آموزشی جذاب رو قبول کنی و با یادگیری جدید سکه جمع کنی!`},2:{id:"2",title:"نیمکت",description:"لحظات استراحت و گفتگو",accentColor:"#A8D5E2",backgroundColor:"#0e1a25",mediaType:"image",requiresTeammates:!1,formComponent:ld,challenges:[{id:"bench-1",title:"دوست جدید پیدا کن",description:"با یه نفر که کمتر باهاش صحبت کردی، حرف بزن و یه چیز جالب ازش یاد بگیر."},{id:"bench-2",title:"گوش شنوا",description:"یه روز کامل سعی کن بیشتر گوش بدی و کمتر صحبت کنی. ببین چقدر چیز یاد میگیری."},{id:"bench-3",title:"مشکلگشا باش",description:"به یه همکلاسی که مشکل دارد کمک کن. کمکت رو ثبت کن."}],chatbotIntro:`سلام! خوش اومدی به نیمکت 🪑💙
|
||
|
||
اینجا فضایی برای رشد مهارتهای اجتماعی و دوستیهای عمیقتره. بریم یه ماموریت باحال شروع کنیم!`},3:{id:"3",title:"دفترچه یادداشت",description:"یادداشتها و خاطرات",accentColor:"#B8E0F0",backgroundColor:"#1a1f2e",mediaType:"both",requiresTeammates:!1,formComponent:ud,challenges:[{id:"notebook-1",title:"روزنگاری",description:"هر روز یه پاراگراف از اتفاقات روزت بنویس. بعد از یه هفته برگرد و بخونش."},{id:"notebook-2",title:"داستان کوتاه",description:"یه داستان کوتاه ۵ جملهای بنویس که شخصیت اصلیش خودت باشی."},{id:"notebook-3",title:"نامه به آینده",description:"یه نامه به خودت در ۵ سال آینده بنویس. ارزوها، هدفها و احساساتت رو بنویس."}],chatbotIntro:`سلام نویسنده کوچولو! 📔✏️
|
||
|
||
دفترچه یادداشت جاییه که میتونی همه چیز رو ثبت کنی. ماموریتهای نوشتاری خیلی جالبی برات دارم!`},4:{id:"4",title:"دیوار حیاط",description:"نقاشی و هنر",accentColor:"#90C8E0",backgroundColor:"#0f1f30",mediaType:"image",requiresTeammates:!0,formComponent:jg,challenges:[{id:"wall-1",title:"نقاشی با موضوع محیطزیست",description:"یه نقاشی بکش که پیام حفاظت از محیطزیست رو داشته باشه."},{id:"wall-2",title:"پرتره دوست",description:"یه پرتره از یکی از دوستانت بکش و بهش هدیه بده."},{id:"wall-3",title:"نقاشی با رنگ طبیعی",description:"از مواد طبیعی مثل چغندر، اسفناج یا زردچوبه رنگ بساز و باهاش نقاشی بکش."}],chatbotIntro:`سلام هنرمند! 🎨🖌️
|
||
|
||
دیوار حیاط جای ابراز خلاقیته! ماموریتهای هنری شگفتانگیزی برات دارم که میتونی با رنگ و نقاشی دنیا رو زیباتر کنی.`},5:{id:"5",title:"آبخوری",description:"تجربههای روزانه",accentColor:"#A890E0",backgroundColor:"#1a1530",mediaType:"image",requiresTeammates:!1,formComponent:nN,challenges:[{id:"fountain-1",title:"صرفهجویی در آب",description:"یه هفته میزان مصرف آب خانوادت رو بررسی کن و یه راهکار برای کاهش مصرف پیدا کن."},{id:"fountain-2",title:"گیاه کوچک",description:"یه گیاه کوچک بکار، هر روز بهش آب بده و رشدش رو عکس بگیر."},{id:"fountain-3",title:"محیطزیستیار",description:"یه بار در هفته حیاط مدرسه رو از زباله پاک کن و عکس قبل و بعد بگیر."}],chatbotIntro:`سلام! 💧🌿
|
||
|
||
آبخوری یادآور ارزش آب و طبیعته. اینجا ماموریتهایی داریم که میتونه تأثیر واقعی روی محیطزیست داشته باشه!`},6:{id:"6",title:"زنگ ورزش",description:"فعالیتهای ورزشی",accentColor:"#80D0E0",backgroundColor:"#0a1f2e",mediaType:"both",requiresTeammates:!0,formComponent:ud,challenges:[{id:"sports-1",title:"۱۰ دقیقه ورزش",description:"هر روز صبح ۱۰ دقیقه ورزش کن. بعد از یه هفته احساست رو گزارش بده."},{id:"sports-2",title:"بازی جدید",description:"یه بازی ورزشی که بلد نیستی رو یاد بگیر و با دوستانت بازی کن."},{id:"sports-3",title:"تیمسازی",description:"یه تیم ۴ نفره برای یه بازی گروهی تشکیل بده و یه مسابقه برگزار کن."}],chatbotIntro:`سلام قهرمان! 🏃♂️⚽
|
||
|
||
زنگ ورزش وقت نشاط و سرزندگیه! ماموریتهای ورزشی که برات دارم نهتنها بدنت رو قوی میکنه بلکه روح تیمی رو هم تقویت میکنه.`},7:{id:"7",title:"سه ماه تعطیلی",description:"ماجراهای تابستانی",accentColor:"#90D8F0",backgroundColor:"#0f1a30",mediaType:"image",requiresTeammates:!1,formComponent:ld,challenges:[{id:"vacation-1",title:"سفر خلاقانه",description:"یه جای جدید در شهرت کشف کن. یه پارک، موزه یا مکان تاریخی که هرگز نرفتی."},{id:"vacation-2",title:"مهارت تابستانی",description:"یه مهارت جدید در تابستان یاد بگیر: آشپزی، نقاشی، موسیقی یا هر چیزی که دوست داری."},{id:"vacation-3",title:"کتابخوانی",description:"یه کتاب کامل بخوان و خلاصهای ازش برای دوستانت بنویس."}],chatbotIntro:`سلام! ☀️🌊
|
||
|
||
سه ماه تعطیلی فرصت طلاییه! اینجا ماموریتهایی داریم که تابستانت رو به یه ماجراجویی فوقالعاده تبدیل میکنه.`},8:{id:"8",title:"روزنامه دیواری",description:"اخبار و گزارشها",accentColor:"#A0D0E8",backgroundColor:"#151a2e",mediaType:"both",requiresTeammates:!1,formComponent:ud,challenges:[{id:"newspaper-1",title:"خبرنگار مدرسه",description:"یه رویداد مهم در مدرسه رو گزارش بده: مسابقه، جشن یا اتفاق خاص."},{id:"newspaper-2",title:"مصاحبه با معلم",description:"با یکی از معلمانت مصاحبه کن و داستان تدریسش رو بنویس."},{id:"newspaper-3",title:"شعر و داستان",description:"یه شعر یا داستان کوتاه بنویس و برای روزنامه دیواری کلاست آماده کن."}],chatbotIntro:`سلام خبرنگار کوچولو! 📰✍️
|
||
|
||
روزنامه دیواری صدای بچههای مدرسهست! ماموریتهایی داریم که میتونی با نوشتن و گزارش، صدات رو به گوش همه برسونی.`},9:{id:"9",title:"زنگ تفریح",description:"سرگرمی و بازی",accentColor:"#8ACEE0",backgroundColor:"#0a1f2e",mediaType:"image",requiresTeammates:!0,formComponent:jg,challenges:[{id:"recess-1",title:"بازی ابداعی",description:"یه بازی جدید اختراع کن که حداقل ۵ نفر بتونن باهم بازی کنن."},{id:"recess-2",title:"شادیآفرین",description:"با یه کار خلاقانه (شعر، نقاشی، بازی) حال همکلاسیهایت رو خوب کن."},{id:"recess-3",title:"قصهگو",description:"یه قصه جالب بساز و برای بچههای کلاست تعریف کن. ببین چقدر خندیدن!"}],chatbotIntro:`سلام بازیگوش! 🎮🎉
|
||
|
||
زنگ تفریح وقت شادیه! ماموریتهایی داریم که خنده و نشاط رو به مدرسه برمیگردونه.`}};function Bs(e){return Cg[e]||Cg[1]}function Ng(){const e=an(),{topicId:n="1"}=Ul(),a=Bs(n);gr(`انتخاب چالش ${a.title}`);const{refreshInbox:s}=Ji(),o=v.useCallback(async C=>{var N;y(!0);try{const j=await Sx(a.title,C);localStorage.setItem("current_mission_type",a.title),localStorage.setItem("current_mission_id",C),(N=j.doing_mission)!=null&&N.workflow_ID&&localStorage.setItem("current_workflow_ID",j.doing_mission.workflow_ID),await s(),e(`/chatbot/${n}`,{state:{chats:j.chats,doingMission:j.doing_mission,missionType:a.title}})}catch(j){console.error("Error starting mission:",j),alert("خطا در شروع چالش. لطفاً دوباره تلاش کنید."),b(!1)}finally{y(!1)}},[a.title,n,e,s]),[l,u]=v.useState([]),[f,p]=v.useState(!0),[m,y]=v.useState(!1),[g,b]=v.useState(!1),S=v.useCallback(()=>{e(`/feed/${n}`)},[e,n]);return v.useEffect(()=>{(async()=>{p(!0);const N=await X8(a.title);u(N.missions),p(!1),n==="3"&&(N.missions.length>0?(b(!0),await o(N.missions[0].mission_workflowID)):(alert("چالشی برای این بخش وجود ندارد"),e(`/feed/${n}`)))})()},[a.title,n,e,o]),d.jsxs("div",{className:"fixed inset-0 w-full h-screen overflow-hidden",children:[d.jsx(Wr,{position:"fixed",zIndex:0,imageUrl:mn.challenges}),g&&d.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center backdrop-blur-sm",style:{background:"radial-gradient(120% 120% at 50% 0%, rgba(124, 58, 237, 0.36) 0%, rgba(46, 27, 61, 0.9) 55%, rgba(35, 24, 62, 0.96) 100%)"},children:d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"inline-block w-12 h-12 border-4 border-[#ffd6f0]/30 border-t-[#ff79cf] rounded-full animate-spin mb-3"}),d.jsx("p",{className:"text-white text-base font-bold",children:"در حال بارگذاری چالش..."})]})}),d.jsxs("div",{className:"relative z-10 max-w-md mx-auto h-full flex flex-col",children:[d.jsx(qi,{topicTitle:a.title,subtitle:"انتخاب چالش",onBack:S}),d.jsx("div",{className:"flex-1 overflow-y-auto px-4 pb-20",style:{maskImage:"linear-gradient(to bottom, transparent 0%, black 48px)",WebkitMaskImage:"linear-gradient(to bottom, transparent 0%, black 48px)",scrollbarWidth:"none",msOverflowStyle:"none"},children:d.jsx("div",{className:"pt-8",children:d.jsx("div",{className:"w-full space-y-4",dir:"rtl",children:f?d.jsxs(se.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center py-10",children:[d.jsx("div",{className:"inline-block w-10 h-10 border-4 border-[#ffd6f0]/30 border-t-[#ff79cf] rounded-full animate-spin mb-3"}),d.jsx("p",{className:"text-[#ffd6f0] text-xs",children:"در حال بارگذاری چالشها..."})]}):l.length===0?d.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center py-10",children:d.jsx("p",{className:"text-teal-200 text-xs",children:"هیچ چالشی یافت نشد"})}):l.map((C,N)=>d.jsx(se.div,{initial:{x:-80,opacity:0},animate:{x:0,opacity:1},transition:{delay:.3+N*.1,duration:.4},className:"relative",children:d.jsxs("div",{className:"bg-gradient-to-br from-teal-700/60 to-teal-900/70 backdrop-blur-md rounded-2xl p-4 border border-teal-500/30 shadow-xl shadow-teal-500/20 flex items-center gap-3 hover:scale-[1.01] transition-transform",children:[d.jsxs("div",{className:"flex-shrink-0 w-16 h-16 relative",children:[d.jsx("div",{className:"absolute inset-0 rounded-full bg-gradient-to-br from-purple-500/30 to-blue-500/30 blur-lg animate-pulse"}),d.jsx("img",{src:J8(C.StageID),alt:C.title,className:"w-full h-full object-cover rounded-full relative z-10 drop-shadow-xl",loading:"eager",onError:j=>{j.currentTarget.src=Af,j.currentTarget.style.objectFit="contain"}})]}),d.jsxs("div",{className:"flex-1 text-right",children:[d.jsx("h3",{className:"text-white font-bold text-base mb-1",children:C.title}),d.jsx("p",{className:"text-teal-100 text-xs leading-relaxed mb-2 opacity-90",children:C.description}),d.jsx(se.button,{whileHover:{scale:1.03},whileTap:{scale:.97},onClick:()=>o(C.mission_workflowID),className:"bg-gradient-to-r from-yellow-400 via-yellow-500 to-yellow-400 text-gray-900 font-bold text-sm rounded-full px-6 py-1.5 shadow-lg shadow-yellow-500/50 border-2 border-yellow-300/50",children:"شروع"})]})]})},C.mission_workflowID))})})})]}),d.jsx(Ga,{}),d.jsx("style",{children:`
|
||
.flex-1.overflow-y-auto::-webkit-scrollbar {
|
||
display: none;
|
||
}
|
||
`})]})}const aN=()=>{const e=Gt(),[n]=Lw(),[a,s]=v.useState(()=>{const m=e.state;return m!=null&&m.chats||m!=null&&m.doingMission?{chats:m.chats||[],doingMission:m.doingMission||null,missionType:m.missionType||""}:null}),[o,l]=v.useState(!1),[u,f]=v.useState(null),p=v.useRef(!0);return v.useEffect(()=>(p.current=!0,(async()=>{var j;const y=e.state;if(y!=null&&y.chats||y!=null&&y.doingMission)return;const g=n.get("missionId"),b=n.get("missionType"),S=n.get("continueMode");let C=null,N=null;if(S==="true"&&g&&b?(C=b,N=g,localStorage.setItem("current_mission_type",C),localStorage.setItem("current_mission_id",N)):(C=localStorage.getItem("current_mission_type"),N=localStorage.getItem("current_mission_id")),!(!C||!N)){l(!0),f(null);try{const L=await Sx(C,N);if(!p.current)return;(j=L.doing_mission)!=null&&j.workflow_ID&&localStorage.setItem("current_workflow_ID",L.doing_mission.workflow_ID),s({chats:L.chats,doingMission:L.doing_mission,missionType:C})}catch{if(!p.current)return;f("خطا در بارگذاری ماموریت")}finally{p.current&&l(!1)}}})(),()=>{p.current=!1}),[e.pathname,n]),{sessionData:a,isLoading:o,error:u}},sN=()=>{const[e,n]=v.useState(!1),[a,s]=v.useState(""),o=v.useRef(null),l=v.useRef(!0);v.useEffect(()=>(l.current=!0,()=>{l.current=!1,o.current&&clearInterval(o.current)}),[]);const u=v.useCallback(()=>{o.current&&(clearInterval(o.current),o.current=null),l.current&&(n(!1),s(""))},[]),f=v.useCallback((p,m)=>{if(u(),!l.current||(n(!0),s(""),!p||p.length===0))return;let y=0;o.current=setInterval(()=>{if(!l.current){o.current&&(clearInterval(o.current),o.current=null);return}y<p.length?(s(p.substring(0,y+1)),y++):(o.current&&(clearInterval(o.current),o.current=null),n(!1),s(""),m())},30)},[u]);return{isTyping:e,typingText:a,startTyping:f,stopTyping:u}},iN=e=>e===!0||e==="true"||e==="True",oN=({workflowId:e,onMissionEnd:n})=>{const[a,s]=v.useState([]),[o,l]=v.useState(!1),{isTyping:u,typingText:f,startTyping:p}=sN(),m=v.useRef(0),y=v.useRef(!0),g=v.useCallback(async(b,S)=>{if(console.log("sendMessage called:",{messageText:b,workflowId:e,isSending:o,skipUserMessage:S==null?void 0:S.skipUserMessage}),!b.trim()||!e){console.log("sendMessage aborted:",{hasMessage:!!b.trim(),hasWorkflowId:!!e});return}if(o){console.log("Already sending, skipping");return}const C=++m.current,N=b.trim();try{if(l(!0),!(S!=null&&S.skipUserMessage)){const L={id:`user-${Date.now()}`,type:"user",content:N,mediaType:"text",timestamp:new Date,datetime1:new Date().toLocaleString("fa-IR")};y.current&&C===m.current&&s(R=>[...R,L])}p("",()=>{});const j=await q8(N,e);if(!y.current||C!==m.current)return;if(j.success&&j.message){const L=iN(j.is_mission_end);p(j.message,()=>{if(!y.current||C!==m.current)return;let R;j.actions&&j.actions.length>0&&j.actions[0].multi_choice&&(R=j.actions[0].multi_choice.map((H,K)=>({id:`action-${Date.now()}-${K}`,label:H,action:`multi_choice_${K}`}))),L&&(R||(R=[]),R.push({id:`submit-challenge-${Date.now()}`,label:"🎯 رفتن به مرحله بعد و ثبت ماموریت",action:"submit-challenge"}),n&&n());const D={id:`bot-${Date.now()}`,type:"bot",content:j.message,mediaType:"text",timestamp:new Date,datetime1:new Date().toLocaleString("fa-IR"),buttons:R};s(H=>[...H,D])})}else{const L={id:`bot-${Date.now()}`,type:"bot",content:"متأسفانه خطایی رخ داد. لطفاً دوباره تلاش کنید.",mediaType:"text",timestamp:new Date,datetime1:new Date().toLocaleString("fa-IR")};s(R=>[...R,L])}}catch{if(!y.current||C!==m.current)return;const L={id:`bot-${Date.now()}`,type:"bot",content:"متأسفانه خطایی رخ داد. لطفاً دوباره تلاش کنید.",mediaType:"text",timestamp:new Date,datetime1:new Date().toLocaleString("fa-IR")};s(R=>[...R,L])}finally{y.current&&C===m.current&&l(!1)}},[e,o,p,n]);return{messages:a,setMessages:s,isSending:o,sendMessage:g,isTyping:u,typingText:f}},lN=e=>e===!0||e==="true"||e==="True",cN=e=>{const n=[];if(e.forEach((a,s)=>{const o=a.question&&a.question.trim().toLowerCase()==="شروع";a.question&&a.question.trim()&&!o&&n.push({id:`user-${s}`,type:"user",content:a.question,mediaType:"text",timestamp:new Date,datetime1:a.datetime1}),a.answer&&a.answer.trim()&&n.push({id:`bot-${s}`,type:"bot",content:a.answer,mediaType:"text",timestamp:new Date,datetime1:a.datetime1})}),e.length>0&&n.length>0){const a=e[e.length-1];let s=-1;for(let o=n.length-1;o>=0;o--)if(n[o].type==="bot"){s=o;break}if(s!==-1){let o;a.actions&&a.actions.length>0&&a.actions[0].multi_choice&&(o=a.actions[0].multi_choice.map((l,u)=>({id:`action-init-${u}`,label:l,action:`multi_choice_${u}`}))),lN(a.is_mission_end)===!0&&(o||(o=[]),o.push({id:"submit-challenge-init",label:"🎯 رفتن به مرحله بعد و ثبت ماموریت",action:"submit-challenge"})),o&&o.length>0&&(n[s].buttons=o)}}return n},uN=e=>e==="3"?"/feed/3":-1;function dN({date:e}){return e?d.jsx("div",{className:"sticky z-20 flex justify-center",style:{top:"10px"},children:d.jsx("div",{className:"px-4 py-2 rounded-full text-xs text-white font-bold backdrop-blur-md",style:{background:"linear-gradient(135deg, rgba(50, 107, 118, 0.85) 0%, rgba(32, 76, 106, 0.85) 100%)",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(138, 206, 224, 0.2)",border:"1px solid rgba(138, 206, 224, 0.3)"},children:e})}):null}const fN=(e,n)=>e?e.split(" - ")[0]||"":n?n.toLocaleDateString("fa-IR"):"",hN=(e,n)=>e?e.split(" - ")[1]||"":n?pN(n):"",pN=e=>e.toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit"});function mN({duration:e,audioUrl:n}){const[a,s]=v.useState(!1),[o,l]=v.useState(0),[u,f]=v.useState(0),p=()=>{if(s(!a),!a){const m=setInterval(()=>{f(y=>y>=100?(clearInterval(m),s(!1),0):y+1)},100)}};return d.jsxs("div",{className:"rounded-2xl px-4 py-3 flex items-center gap-3 min-w-[240px]",style:{background:"linear-gradient(135deg, rgba(100, 200, 255, 0.9) 0%, rgba(50, 150, 220, 0.9) 100%)",boxShadow:"0 4px 16px rgba(100, 200, 255, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.3)",border:"1.5px solid rgba(150, 220, 255, 0.4)"},children:[d.jsx("button",{onClick:p,className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 transition-all",style:{background:"rgba(255, 255, 255, 0.25)"},children:a?d.jsx(Q6,{className:"w-5 h-5 text-white fill-white"}):d.jsx(Xi,{className:"w-5 h-5 text-white fill-white",style:{marginLeft:"2px"}})}),d.jsxs("div",{className:"flex-1 flex flex-col gap-1",children:[d.jsx("div",{className:"h-1 rounded-full bg-white/20 overflow-hidden",children:d.jsx("div",{className:"h-full rounded-full transition-all duration-100",style:{width:`${u}%`,background:"linear-gradient(90deg, #FFFFFF 0%, #E0F7FF 100%)"}})}),d.jsx("div",{className:"flex justify-between items-center",children:d.jsx("span",{className:"text-white/80 text-xs",children:e})})]})]})}function gN({thumbnailUrl:e,duration:n,videoUrl:a}){const[s,o]=v.useState(!1);return d.jsx("div",{className:"rounded-2xl p-3",style:{background:"linear-gradient(135deg, rgba(100, 200, 255, 0.9) 0%, rgba(50, 150, 220, 0.9) 100%)",border:"1.5px solid rgba(150, 220, 255, 0.4)",boxShadow:"0 4px 16px rgba(100, 200, 255, 0.4)"},children:d.jsxs("div",{className:"relative rounded-xl overflow-hidden group cursor-pointer",children:[d.jsx("img",{src:e,alt:"ویدیو",className:"w-full h-auto max-h-64 object-cover"}),d.jsx("div",{className:"absolute inset-0 flex items-center justify-center transition-all",style:{background:"rgba(0, 0, 0, 0.3)"},children:d.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center transition-all group-hover:scale-110",style:{background:"rgba(255, 255, 255, 0.9)",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.3)"},children:d.jsx(Xi,{className:"w-7 h-7 fill-blue-500 text-blue-500",style:{marginLeft:"3px"}})})}),d.jsx("div",{className:"absolute bottom-3 right-3 px-2 py-1 rounded text-xs font-bold text-white",style:{background:"rgba(0, 0, 0, 0.6)"},children:n})]})})}function yN({message:e,animationDelay:n,onButtonClick:a}){const s=e.type==="bot",o=hN(e.datetime1,e.timestamp);return d.jsxs(se.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,delay:n},className:`flex ${s?"justify-end":"justify-start"} items-start gap-2`,children:[d.jsxs("div",{className:`max-w-[75%] ${s?"ml-0":"mr-0"}`,children:[e.mediaType==="text"&&d.jsx("div",{className:"rounded-3xl px-5 py-3",style:{background:s?"linear-gradient(135deg, rgba(100, 200, 255, 0.9) 0%, rgba(50, 150, 220, 0.9) 100%)":"linear-gradient(135deg, rgba(150, 100, 200, 0.85) 0%, rgba(100, 60, 150, 0.85) 100%)",boxShadow:s?"0 4px 16px rgba(100, 200, 255, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.3)":"0 4px 16px rgba(150, 100, 200, 0.4), inset 0 1px 2px rgba(200, 150, 255, 0.3)",border:s?"1.5px solid rgba(150, 220, 255, 0.4)":"1.5px solid rgba(180, 130, 230, 0.4)"},children:d.jsx("p",{className:"text-white text-sm leading-relaxed whitespace-pre-line",children:e.content})}),e.mediaType==="image"&&e.content&&d.jsx("div",{className:"rounded-2xl p-3",style:{background:"linear-gradient(135deg, rgba(100, 200, 255, 0.9) 0%, rgba(50, 150, 220, 0.9) 100%)",border:"1.5px solid rgba(150, 220, 255, 0.4)",boxShadow:"0 4px 16px rgba(100, 200, 255, 0.4)"},children:d.jsx("div",{className:"rounded-xl overflow-hidden",style:{boxShadow:"0 2px 8px rgba(0, 0, 0, 0.2)"},children:d.jsx("img",{src:e.content,alt:"تصویر",className:"w-full h-auto max-h-64 object-cover"})})}),e.mediaType==="audio"&&e.mediaUrl&&d.jsx(mN,{duration:e.duration||"0:00",audioUrl:e.mediaUrl}),e.mediaType==="video"&&e.content&&e.mediaUrl&&d.jsx(gN,{thumbnailUrl:e.content,duration:e.duration||"0:00",videoUrl:e.mediaUrl}),e.mediaType==="file"&&e.mediaUrl&&d.jsxs("div",{className:"rounded-3xl px-5 py-4 flex items-center gap-3",style:{background:"linear-gradient(135deg, rgba(100, 200, 255, 0.9) 0%, rgba(50, 150, 220, 0.9) 100%)",boxShadow:"0 4px 16px rgba(100, 200, 255, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.3)",border:"1.5px solid rgba(150, 220, 255, 0.4)"},children:[d.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(135deg, #FFD700 0%, #FFA500 100%)",boxShadow:"0 2px 8px rgba(255, 215, 0, 0.4)"},children:d.jsx(G6,{className:"w-5 h-5 text-white"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-white text-sm font-bold truncate",children:e.mediaUrl}),d.jsx("p",{className:"text-white/70 text-xs",children:"فایل"})]}),d.jsx("button",{className:"text-white hover:text-white/80 text-xs font-bold px-3 py-1 rounded-lg transition-all",style:{background:"rgba(255, 255, 255, 0.2)"},"aria-label":"دانلود فایل",children:"دانلود"})]}),e.buttons&&e.buttons.length>0&&d.jsx("div",{className:"mt-3 space-y-2",children:e.buttons.map(l=>d.jsx(se.button,{whileTap:{scale:.95},onClick:()=>a(l.id,l.action),className:"w-full px-4 py-3 rounded-2xl text-white text-sm font-bold text-center 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)"},"aria-label":l.label,children:l.label},l.id))}),d.jsx("div",{className:`mt-1 text-xs ${s?"text-left":"text-right"}`,style:{color:"rgba(255, 255, 255, 0.5)"},children:o})]}),s&&d.jsx("div",{className:"flex-shrink-0",children:d.jsx("img",{src:Af,alt:"چتبات",className:"w-12 h-12 rounded-full object-contain",style:{filter:"drop-shadow(0 2px 8px rgba(138, 206, 224, 0.5))"}})})]})}const xN={background:"linear-gradient(135deg, rgba(100, 200, 255, 0.9) 0%, rgba(50, 150, 220, 0.9) 100%)",boxShadow:"0 4px 16px rgba(100, 200, 255, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.3)",border:"1.5px solid rgba(150, 220, 255, 0.4)"};function vN({isTyping:e,typingText:n}){return d.jsx(gn,{mode:"wait",children:e&&d.jsxs(se.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},className:"flex justify-end items-start gap-2",role:"status","aria-live":"polite","aria-label":n?"در حال نوشتن پاسخ":"در حال تایپ",children:[d.jsx("div",{className:"rounded-3xl px-5 py-3 min-h-[44px] flex items-center",style:xN,children:n?d.jsxs("p",{className:"text-white text-sm leading-relaxed whitespace-pre-line",style:{minHeight:"1.25rem"},children:[n,d.jsx("span",{className:"inline-block w-0.5 h-4 bg-white/70 animate-pulse ml-0.5",style:{verticalAlign:"text-bottom"}})]}):d.jsxs("div",{className:"flex gap-1",children:[d.jsx("div",{className:"w-2 h-2 rounded-full bg-white/60 chat-typing-dot",style:{animationDelay:"0s"}}),d.jsx("div",{className:"w-2 h-2 rounded-full bg-white/60 chat-typing-dot",style:{animationDelay:"0.2s"}}),d.jsx("div",{className:"w-2 h-2 rounded-full bg-white/60 chat-typing-dot",style:{animationDelay:"0.4s"}})]})}),d.jsx("div",{className:"flex-shrink-0",children:d.jsx("img",{src:Af,alt:"چتبات",className:"w-12 h-12 rounded-full object-contain",style:{filter:"drop-shadow(0 2px 8px rgba(138, 206, 224, 0.5))"}})})]},"typing-indicator")})}const Px=v.forwardRef(({messages:e,onButtonClick:n,isTyping:a,typingText:s},o)=>{const l=v.useRef(null),u=v.useMemo(()=>{const p=[];for(const m of e){const y=fN(m.datetime1,m.timestamp)||"",g=p[p.length-1];!g||g.date!==y?p.push({id:`group-${p.length}-${y||"unknown"}`,date:y,messages:[m]}):g.messages.push(m)}return p},[e]),f=()=>{var p;(p=l.current)==null||p.scrollIntoView({behavior:"smooth"})};return v.useImperativeHandle(o,()=>({scrollToBottom:f})),v.useEffect(()=>{f()},[e.length,a,s]),d.jsxs("div",{className:"space-y-4",dir:"rtl",children:[u.map(p=>d.jsxs("div",{className:"space-y-4",children:[d.jsx(dN,{date:p.date}),p.messages.map((m,y)=>{const g=Math.min(y*.05,1);return d.jsx(yN,{message:m,animationDelay:g,onButtonClick:n},m.id)})]},p.id)),d.jsx(vN,{isTyping:a,typingText:s}),d.jsx("div",{ref:l})]})});Px.displayName="ChatMessageList";function bN({onSendMessage:e,disabled:n=!1}){const[a,s]=v.useState(""),o=v.useRef(null),l=a.trim().length>0&&!n,u=()=>{l&&(e(a.trim()),s(""),setTimeout(()=>{o.current&&(o.current.style.height="auto",o.current.focus())},0))},f=p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),u())};return v.useEffect(()=>{if(o.current){o.current.style.height="auto";const p=o.current.scrollHeight,m=96;o.current.style.height=`${Math.min(p,m)}px`}},[a]),d.jsxs("div",{className:"px-3",children:[d.jsxs("div",{className:"rounded-3xl p-2.5 flex items-center gap-1.5",style:{background:"linear-gradient(135deg, rgba(50, 107, 118, 0.95) 0%, rgba(32, 76, 106, 0.95) 100%)",boxShadow:"0 -3px 16px rgba(0, 0, 0, 0.3), 0 3px 12px rgba(138, 206, 224, 0.2)",border:"1.5px solid rgba(138, 206, 224, 0.3)"},children:[d.jsx("textarea",{ref:o,value:a,onChange:p=>s(p.target.value),onKeyDown:f,placeholder:"پیام خود را بنویسید...",rows:1,dir:"rtl",disabled:n,"aria-label":"پیام خود را بنویسید",className:"chat-input-textarea flex-1 bg-transparent text-white placeholder-white/50 resize-none outline-none text-right disabled:opacity-50",style:{fontFamily:"Alibaba, sans-serif",textAlign:"right",lineHeight:"1.4",overflow:"hidden",fontSize:"16px"}}),d.jsx(se.button,{whileTap:{scale:.92},onClick:u,disabled:!l,"aria-label":"ارسال پیام",className:"flex-shrink-0 w-9 h-9 rounded-full flex items-center justify-center",style:{background:l?"linear-gradient(135deg, #FFB800 0%, #FF9500 100%)":"rgba(255, 255, 255, 0.1)",boxShadow:l?"0 3px 10px rgba(255, 165, 0, 0.4)":"none"},children:d.jsx(_f,{className:`w-4 h-4 ${l?"text-white":"text-white/30"}`})})]}),d.jsx("style",{children:`
|
||
.chat-input-textarea {
|
||
scrollbar-width: none;
|
||
-ms-overflow-style: none;
|
||
}
|
||
|
||
.chat-input-textarea::-webkit-scrollbar {
|
||
display: none;
|
||
}
|
||
`})]})}function Eg(){var D,H;const e=an(),{topicId:n="1"}=Ul(),a=Bs(n);gr(`چتبات ${a.title}`);const{sessionData:s,isLoading:o,error:l}=aN(),[u,f]=v.useState(!1),{messages:p,setMessages:m,isSending:y,sendMessage:g,isTyping:b,typingText:S}=oN({workflowId:((D=s==null?void 0:s.doingMission)==null?void 0:D.workflow_ID)||null,onMissionEnd:()=>f(!0)}),C=v.useRef(!1),N=v.useRef(null),j=v.useRef(null);v.useEffect(()=>{if(s!=null&&s.chats&&s.chats.length>0){const K=cN(s.chats);m(K);const re=s.chats[s.chats.length-1];((re==null?void 0:re.is_mission_end)===!0||(re==null?void 0:re.is_mission_end)==="True")&&f(!0)}},[s,m]),v.useEffect(()=>{var O;const K=(O=s==null?void 0:s.doingMission)==null?void 0:O.workflow_ID;if(!K||(N.current!==K&&(N.current=K,C.current=!1),C.current))return;((s==null?void 0:s.chats)||[]).length===0&&(C.current=!0,g("شروع",{skipUserMessage:!0}))},[(H=s==null?void 0:s.doingMission)==null?void 0:H.workflow_ID,s==null?void 0:s.chats,g]);const L=(K,re)=>{var O;if(re==="submit-challenge"){e(`/submit/${n}`,{state:{doingMission:s==null?void 0:s.doingMission}});return}if(re.startsWith("multi_choice_")){const w=p.find(M=>{var E;return(E=M.buttons)==null?void 0:E.some(U=>U.id===K)});if(w){const M=(O=w.buttons)==null?void 0:O.find(E=>E.id===K);M&&g(M.label)}}},R=()=>{const K=uN(n);e(K)};return o?d.jsxs("div",{className:"relative h-[100dvh] w-full overflow-hidden",children:[d.jsx(Wr,{position:"fixed",zIndex:0,imageUrl:mn.chatbot}),d.jsx("div",{className:"relative z-10 flex h-full items-center justify-center text-center text-white",children:d.jsx("p",{className:"text-base",children:"در حال بارگذاری..."})})]}):l?d.jsxs("div",{className:"relative h-[100dvh] w-full overflow-hidden",children:[d.jsx(Wr,{position:"fixed",zIndex:0,imageUrl:mn.chatbot}),d.jsx("div",{className:"relative z-10 flex h-full items-center justify-center px-4 text-center text-white",children:d.jsxs("div",{children:[d.jsx("p",{className:"text-base text-red-400",children:l}),d.jsx("button",{onClick:R,className:"mt-3 rounded-lg bg-white/20 px-5 py-1.5 text-sm transition hover:bg-white/30",children:"بازگشت"})]})})]}):d.jsxs("div",{className:"relative h-[100dvh] w-full overflow-hidden",children:[d.jsx(Wr,{position:"fixed",zIndex:0,imageUrl:mn.chatbot}),d.jsxs("div",{className:"relative z-10 mx-auto grid h-full w-full max-w-md grid-rows-[auto_minmax(0,1fr)_auto]",children:[d.jsx("div",{className:"shrink-0",children:d.jsx(qi,{topicTitle:a.title,onBack:R})}),d.jsx("main",{className:"min-h-0 overflow-y-auto px-3 pb-2",style:{maskImage:"linear-gradient(to bottom, transparent 0%, black 48px)",WebkitMaskImage:"linear-gradient(to bottom, transparent 0%, black 48px)",scrollbarWidth:"none",msOverflowStyle:"none"},children:d.jsx("div",{className:"pt-8",children:d.jsx(Px,{ref:j,messages:p,onButtonClick:L,isTyping:b,typingText:S})})}),d.jsxs("footer",{className:"shrink-0",style:{paddingBottom:"0px"},children:[d.jsx("div",{className:"px-3 pt-2",children:d.jsx(bN,{onSendMessage:g,disabled:y||b})}),d.jsx("div",{className:"px-2 pt-6",children:d.jsx(Ga,{fixed:!1})})]})]}),d.jsx("style",{children:`
|
||
main::-webkit-scrollbar {
|
||
display: none;
|
||
}
|
||
`})]})}function wN({isOpen:e,onClose:n,topicTitle:a}){const s=v.useMemo(()=>{const o=typeof window<"u"?window.innerWidth:390;return Array.from({length:20},(l,u)=>({id:u,x:Math.random()*o,duration:3+Math.random()*2,delay:Math.random()*2,color:u%2===0?"#FFB800":"#8ACEE0"}))},[]);return d.jsx(gn,{children:e&&d.jsxs(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[100] flex items-center justify-center p-4",onClick:n,children:[d.jsx(se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0",style:{background:"radial-gradient(circle at center, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.95) 100%)",backdropFilter:"blur(8px)"}}),d.jsxs(se.div,{initial:{scale:.5,opacity:0,y:50},animate:{scale:1,opacity:1,y:0},exit:{scale:.8,opacity:0,y:30},transition:{type:"spring",stiffness:300,damping:25},onClick:o=>o.stopPropagation(),className:"relative max-w-sm w-full",dir:"rtl",children:[Array.from({length:12}).map((o,l)=>d.jsx(se.div,{initial:{opacity:0,scale:0},animate:{opacity:[0,1,0],scale:[0,1.5,0],x:[0,Math.cos(l/12*2*Math.PI)*100],y:[0,Math.sin(l/12*2*Math.PI)*100]},transition:{duration:2,delay:l*.1,repeat:1/0,repeatDelay:1},className:"absolute top-1/2 left-1/2 w-2 h-2 rounded-full",style:{background:"radial-gradient(circle, rgba(255, 215, 0, 1) 0%, rgba(255, 165, 0, 0.8) 100%)",boxShadow:"0 0 10px rgba(255, 215, 0, 0.8)"}},l)),d.jsxs("div",{className:"relative overflow-hidden rounded-3xl p-8",style:{background:"linear-gradient(135deg, rgba(30, 60, 90, 0.95) 0%, rgba(20, 40, 70, 0.98) 100%)",border:"3px solid rgba(138, 206, 224, 0.6)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(138, 206, 224, 0.3), inset 0 2px 10px rgba(138, 206, 224, 0.2)"},children:[d.jsx(se.div,{animate:{background:["radial-gradient(circle at 20% 20%, rgba(138, 206, 224, 0.15) 0%, transparent 50%)","radial-gradient(circle at 80% 80%, rgba(138, 206, 224, 0.15) 0%, transparent 50%)","radial-gradient(circle at 20% 20%, rgba(138, 206, 224, 0.15) 0%, transparent 50%)"]},transition:{duration:4,repeat:1/0},className:"absolute inset-0 pointer-events-none"}),d.jsx("div",{className:"flex justify-center mb-4",children:d.jsxs(se.div,{initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},transition:{delay:.2,type:"spring",stiffness:200},className:"relative",children:[d.jsx("div",{className:"w-20 h-20 rounded-full flex items-center justify-center",style:{background:"linear-gradient(135deg, #4ade80 0%, #22c55e 100%)",boxShadow:"0 10px 30px rgba(34, 197, 94, 0.5), inset 0 2px 10px rgba(255, 255, 255, 0.3)"},children:d.jsx(n6,{className:"w-10 h-10 text-white",strokeWidth:3})}),d.jsx(se.div,{animate:{scale:[1,1.3,1],opacity:[.5,0,.5]},transition:{duration:2,repeat:1/0},className:"absolute inset-0 rounded-full",style:{background:"radial-gradient(circle, rgba(74, 222, 128, 0.6) 0%, transparent 70%)"}})]})}),d.jsx(se.h2,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},className:"text-2xl font-black text-center mb-3",style:{color:"#8ACEE0",textShadow:"0 2px 10px rgba(138, 206, 224, 0.5), 0 0 20px rgba(138, 206, 224, 0.3)"},children:"🎉 تبریک! 🎉"}),d.jsxs(se.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},className:"space-y-3 mb-6",children:[d.jsx("p",{className:"text-white text-center text-base leading-relaxed font-bold",children:"چالش با موفقیت به پایان رسید!"}),d.jsx("p",{className:"text-white/80 text-center text-sm leading-relaxed",children:"پست شما بعد از بررسی منتشر میشود"})]}),d.jsx(se.div,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},transition:{delay:.7,type:"spring",stiffness:150},className:"relative mb-6",children:d.jsxs("div",{className:"relative overflow-hidden rounded-2xl p-6",style:{background:"linear-gradient(135deg, rgba(255, 184, 0, 0.2) 0%, rgba(255, 140, 0, 0.15) 100%)",border:"2px solid rgba(255, 184, 0, 0.5)",boxShadow:"0 10px 30px rgba(255, 165, 0, 0.3), inset 0 2px 8px rgba(255, 255, 255, 0.2)"},children:[d.jsx(se.div,{animate:{x:["-100%","200%"]},transition:{duration:2,repeat:1/0,repeatDelay:1},className:"absolute inset-0",style:{background:"linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%)"}}),d.jsxs("div",{className:"flex items-center justify-center gap-3 mb-2",children:[d.jsx(se.div,{animate:{rotate:[0,10,-10,0]},transition:{duration:1,repeat:1/0,repeatDelay:1},children:d.jsx(lx,{className:"w-8 h-8",style:{color:"#FFB800"}})}),d.jsx("h3",{className:"text-xl font-black",style:{color:"#FFB800",textShadow:"0 2px 10px rgba(255, 184, 0, 0.5)"},children:"جایزه دریافت شد!"}),d.jsx(se.div,{animate:{rotate:[0,-10,10,0]},transition:{duration:1,repeat:1/0,repeatDelay:1,delay:.2},children:d.jsx(f8,{className:"w-7 h-7",style:{color:"#FFB800"}})})]}),d.jsxs("p",{className:"text-white text-center text-base font-bold leading-relaxed",children:["مدال ",d.jsx("span",{style:{color:"#FFB800"},children:a})," به کیف جادوییت اضافه شد!"]})]})}),d.jsx(se.button,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.9},whileHover:{scale:1.05},whileTap:{scale:.95},onClick:n,className:"w-full py-4 rounded-full font-black text-lg",style:{background:"linear-gradient(180deg, #8ACEE0 0%, #5A9FB0 100%)",boxShadow:"0 6px 20px rgba(138, 206, 224, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3)",color:"#0a1f2e",textShadow:"0 1px 0 rgba(255, 255, 255, 0.3)"},children:"باشه، بریم!"})]})]}),s.map(o=>d.jsx(se.div,{initial:{x:o.x,y:window.innerHeight+20,opacity:0},animate:{y:-20,opacity:[0,1,0]},transition:{duration:o.duration,delay:o.delay,repeat:1/0},className:"absolute w-1 h-1 rounded-full",style:{background:o.color,boxShadow:`0 0 6px ${o.color}`}},`particle-${o.id}`))]})})}function Tg(){var S;const e=an(),n=Gt(),{topicId:a="1"}=Ul(),s=Bs(a);gr(`ثبت ماموریت ${s.title}`);const{addNewItem:o}=Nx(),{refreshInbox:l}=Ji(),[u,f]=v.useState(!1),p=(S=n.state)==null?void 0:S.doingMission,m=v.useCallback(()=>{e(-1)},[e]),y=C=>{console.log("Submitting challenge:",C),f(!0),o(),l()},g=()=>{f(!1),e(`/feed/${a}`)},b=s.formComponent;return d.jsxs("div",{className:"min-h-screen w-full relative overflow-hidden",children:[d.jsx(Wr,{position:"fixed",zIndex:0,imageUrl:mn.submitChallenge}),d.jsxs("div",{className:"relative z-10 max-w-md mx-auto",children:[d.jsx(qi,{topicTitle:`ثبت چالش ${s.title}`,onBack:m}),d.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 max-w-md mx-auto overflow-hidden",style:{paddingTop:"110px",zIndex:1},children:d.jsx("div",{className:"h-full overflow-y-auto relative px-[24px] pt-[48px] pb-[132px]",style:{scrollbarWidth:"none",msOverflowStyle:"none",maskImage:"linear-gradient(to bottom, transparent 0%, black 60px)",WebkitMaskImage:"linear-gradient(to bottom, transparent 0%, black 60px)"},children:d.jsx(b,{topicId:a,topicTitle:s.title,onSubmit:y,doingMission:p})})})]}),d.jsx("style",{children:`
|
||
.h-full.overflow-y-auto::-webkit-scrollbar { display: none; }
|
||
`}),d.jsx(Ga,{}),d.jsx(wN,{isOpen:u,onClose:g,topicTitle:s.title})]})}function Rx(e){return d.jsx(y1,{children:e})}function Oa(e){return Rx(d.jsx(e,{}))}const SN=Rw([{path:"/login",element:d.jsx(A8,{})},{path:"/",element:Rx(d.jsx(vj,{})),handle:{header:{title:"خانه",showBack:!1,action:"profile"}},children:[{index:!0,element:d.jsx(Kj,{}),handle:{header:{title:"خانه",showBack:!1,action:"profile"}}},{path:"public-chat",element:d.jsx(pC,{}),handle:{header:{title:"چت با ربات",showBack:!1,action:"profile"}}},{path:"magic-bag",element:d.jsx(rC,{}),handle:{header:{title:"کیف جادویی",showBack:!1,action:"profile"}}},{path:"messages",element:d.jsx(sC,{}),handle:{header:{title:"اعلانها",showBack:!1,action:"profile"}}},{path:"profile",element:d.jsx(eC,{}),handle:{header:{title:"پروفایل",showBack:!1,action:"profile"}}},{path:"edit-profile",element:d.jsx(tC,{}),handle:{header:{title:"ویرایش پروفایل",showBack:!0,backTo:"/profile",action:"settings"}}}]},{path:"/feed/:topicId",element:Oa(XC)},{path:"/challenges/:topicId",element:Oa(Ng)},{path:"/chatbot/:topicId",element:Oa(Eg)},{path:"/submit/:topicId",element:Oa(Tg)},{path:"/challenges",element:Oa(Ng)},{path:"/chatbot",element:Oa(Eg)},{path:"/submit-challenge",element:Oa(Tg)}]);function kN(){return d.jsx("div",{className:"fixed inset-0 flex items-center justify-center",style:{background:"radial-gradient(120% 120% at 50% 0%, rgba(124, 58, 237, 0.32) 0%, rgba(46, 27, 61, 1) 52%, rgba(35, 24, 62, 1) 100%)"},children:d.jsx("div",{className:"h-9 w-9 animate-spin rounded-full border-2 border-[#ffd6f0]/30 border-t-[#ff79cf]","aria-label":"در حال بارگذاری"})})}function jN(){return d.jsx(C8,{children:d.jsx(aj,{children:d.jsx(M8,{children:d.jsxs(E8,{children:[d.jsx($w,{router:SN,fallbackElement:d.jsx(kN,{})}),d.jsx(YC,{position:"top-center",richColors:!0,dir:"rtl",toastOptions:{style:{fontFamily:"Alibaba, sans-serif",direction:"rtl",textAlign:"right"}}})]})})})})}xv.createRoot(document.getElementById("root")).render(d.jsx(jN,{}));
|