(function(){const b=document.createElement("link").relList;if(b&&b.supports&&b.supports("modulepreload"))return;for(const g of document.querySelectorAll('link[rel="modulepreload"]'))f(g);new MutationObserver(g=>{for(const v of g)if(v.type==="childList")for(const H of v.addedNodes)H.tagName==="LINK"&&H.rel==="modulepreload"&&f(H)}).observe(document,{childList:!0,subtree:!0});function N(g){const v={};return g.integrity&&(v.integrity=g.integrity),g.referrerPolicy&&(v.referrerPolicy=g.referrerPolicy),g.crossOrigin==="use-credentials"?v.credentials="include":g.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function f(g){if(g.ep)return;g.ep=!0;const v=N(g);fetch(g.href,v)}})();function ch(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}var Xu={exports:{}},Zi={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Im;function ax(){if(Im)return Zi;Im=1;var c=Symbol.for("react.transitional.element"),b=Symbol.for("react.fragment");function N(f,g,v){var H=null;if(v!==void 0&&(H=""+v),g.key!==void 0&&(H=""+g.key),"key"in g){v={};for(var S in g)S!=="key"&&(v[S]=g[S])}else v=g;return g=v.ref,{$$typeof:c,type:f,key:H,ref:g!==void 0?g:null,props:v}}return Zi.Fragment=b,Zi.jsx=N,Zi.jsxs=N,Zi}var Pm;function sx(){return Pm||(Pm=1,Xu.exports=ax()),Xu.exports}var a=sx(),Fu={exports:{}},Qe={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var e0;function lx(){if(e0)return Qe;e0=1;var c=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),H=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),Z=Symbol.iterator;function X(w){return w===null||typeof w!="object"?null:(w=Z&&w[Z]||w["@@iterator"],typeof w=="function"?w:null)}var V={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Q=Object.assign,M={};function m(w,q,K){this.props=w,this.context=q,this.refs=M,this.updater=K||V}m.prototype.isReactComponent={},m.prototype.setState=function(w,q){if(typeof w!="object"&&typeof w!="function"&&w!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,q,"setState")},m.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function j(){}j.prototype=m.prototype;function R(w,q,K){this.props=w,this.context=q,this.refs=M,this.updater=K||V}var U=R.prototype=new j;U.constructor=R,Q(U,m.prototype),U.isPureReactComponent=!0;var de=Array.isArray;function pe(){}var z={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function ke(w,q,K){var xe=K.ref;return{$$typeof:c,type:w,key:q,ref:xe!==void 0?xe:null,props:K}}function ye(w,q){return ke(w.type,q,w.props)}function ne(w){return typeof w=="object"&&w!==null&&w.$$typeof===c}function E(w){var q={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(K){return q[K]})}var fe=/\/+/g;function be(w,q){return typeof w=="object"&&w!==null&&w.key!=null?E(""+w.key):q.toString(36)}function me(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(pe,pe):(w.status="pending",w.then(function(q){w.status==="pending"&&(w.status="fulfilled",w.value=q)},function(q){w.status==="pending"&&(w.status="rejected",w.reason=q)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function B(w,q,K,xe,ee){var Te=typeof w;(Te==="undefined"||Te==="boolean")&&(w=null);var ze=!1;if(w===null)ze=!0;else switch(Te){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(w.$$typeof){case c:case b:ze=!0;break;case G:return ze=w._init,B(ze(w._payload),q,K,xe,ee)}}if(ze)return ee=ee(w),ze=xe===""?"."+be(w,0):xe,de(ee)?(K="",ze!=null&&(K=ze.replace(fe,"$&/")+"/"),B(ee,q,K,"",function(A){return A})):ee!=null&&(ne(ee)&&(ee=ye(ee,K+(ee.key==null||w&&w.key===ee.key?"":(""+ee.key).replace(fe,"$&/")+"/")+ze)),q.push(ee)),1;ze=0;var Be=xe===""?".":xe+":";if(de(w))for(var k=0;k<w.length;k++)xe=w[k],Te=Be+be(xe,k),ze+=B(xe,q,K,Te,ee);else if(k=X(w),typeof k=="function")for(w=k.call(w),k=0;!(xe=w.next()).done;)xe=xe.value,Te=Be+be(xe,k++),ze+=B(xe,q,K,Te,ee);else if(Te==="object"){if(typeof w.then=="function")return B(me(w),q,K,xe,ee);throw q=String(w),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return ze}function oe(w,q,K){if(w==null)return w;var xe=[],ee=0;return B(w,xe,"","",function(Te){return q.call(K,Te,ee++)}),xe}function Ne(w){if(w._status===-1){var q=w._result;q=q(),q.then(function(K){(w._status===0||w._status===-1)&&(w._status=1,w._result=K)},function(K){(w._status===0||w._status===-1)&&(w._status=2,w._result=K)}),w._status===-1&&(w._status=0,w._result=q)}if(w._status===1)return w._result.default;throw w._result}var Ae=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},De={map:oe,forEach:function(w,q,K){oe(w,function(){q.apply(this,arguments)},K)},count:function(w){var q=0;return oe(w,function(){q++}),q},toArray:function(w){return oe(w,function(q){return q})||[]},only:function(w){if(!ne(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return Qe.Activity=O,Qe.Children=De,Qe.Component=m,Qe.Fragment=N,Qe.Profiler=g,Qe.PureComponent=R,Qe.StrictMode=f,Qe.Suspense=T,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(w){return z.H.useMemoCache(w)}},Qe.cache=function(w){return function(){return w.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(w,q,K){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var xe=Q({},w.props),ee=w.key;if(q!=null)for(Te in q.key!==void 0&&(ee=""+q.key),q)!F.call(q,Te)||Te==="key"||Te==="__self"||Te==="__source"||Te==="ref"&&q.ref===void 0||(xe[Te]=q[Te]);var Te=arguments.length-2;if(Te===1)xe.children=K;else if(1<Te){for(var ze=Array(Te),Be=0;Be<Te;Be++)ze[Be]=arguments[Be+2];xe.children=ze}return ke(w.type,ee,xe)},Qe.createContext=function(w){return w={$$typeof:H,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:v,_context:w},w},Qe.createElement=function(w,q,K){var xe,ee={},Te=null;if(q!=null)for(xe in q.key!==void 0&&(Te=""+q.key),q)F.call(q,xe)&&xe!=="key"&&xe!=="__self"&&xe!=="__source"&&(ee[xe]=q[xe]);var ze=arguments.length-2;if(ze===1)ee.children=K;else if(1<ze){for(var Be=Array(ze),k=0;k<ze;k++)Be[k]=arguments[k+2];ee.children=Be}if(w&&w.defaultProps)for(xe in ze=w.defaultProps,ze)ee[xe]===void 0&&(ee[xe]=ze[xe]);return ke(w,Te,ee)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(w){return{$$typeof:S,render:w}},Qe.isValidElement=ne,Qe.lazy=function(w){return{$$typeof:G,_payload:{_status:-1,_result:w},_init:Ne}},Qe.memo=function(w,q){return{$$typeof:_,type:w,compare:q===void 0?null:q}},Qe.startTransition=function(w){var q=z.T,K={};z.T=K;try{var xe=w(),ee=z.S;ee!==null&&ee(K,xe),typeof xe=="object"&&xe!==null&&typeof xe.then=="function"&&xe.then(pe,Ae)}catch(Te){Ae(Te)}finally{q!==null&&K.types!==null&&(q.types=K.types),z.T=q}},Qe.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},Qe.use=function(w){return z.H.use(w)},Qe.useActionState=function(w,q,K){return z.H.useActionState(w,q,K)},Qe.useCallback=function(w,q){return z.H.useCallback(w,q)},Qe.useContext=function(w){return z.H.useContext(w)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(w,q){return z.H.useDeferredValue(w,q)},Qe.useEffect=function(w,q){return z.H.useEffect(w,q)},Qe.useEffectEvent=function(w){return z.H.useEffectEvent(w)},Qe.useId=function(){return z.H.useId()},Qe.useImperativeHandle=function(w,q,K){return z.H.useImperativeHandle(w,q,K)},Qe.useInsertionEffect=function(w,q){return z.H.useInsertionEffect(w,q)},Qe.useLayoutEffect=function(w,q){return z.H.useLayoutEffect(w,q)},Qe.useMemo=function(w,q){return z.H.useMemo(w,q)},Qe.useOptimistic=function(w,q){return z.H.useOptimistic(w,q)},Qe.useReducer=function(w,q,K){return z.H.useReducer(w,q,K)},Qe.useRef=function(w){return z.H.useRef(w)},Qe.useState=function(w){return z.H.useState(w)},Qe.useSyncExternalStore=function(w,q,K){return z.H.useSyncExternalStore(w,q,K)},Qe.useTransition=function(){return z.H.useTransition()},Qe.version="19.2.0",Qe}var t0;function dh(){return t0||(t0=1,Fu.exports=lx()),Fu.exports}var y=dh();const rx=ch(y);var Wu={exports:{}},Xi={},Ju={exports:{}},Ku={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var a0;function nx(){return a0||(a0=1,(function(c){function b(B,oe){var Ne=B.length;B.push(oe);e:for(;0<Ne;){var Ae=Ne-1>>>1,De=B[Ae];if(0<g(De,oe))B[Ae]=oe,B[Ne]=De,Ne=Ae;else break e}}function N(B){return B.length===0?null:B[0]}function f(B){if(B.length===0)return null;var oe=B[0],Ne=B.pop();if(Ne!==oe){B[0]=Ne;e:for(var Ae=0,De=B.length,w=De>>>1;Ae<w;){var q=2*(Ae+1)-1,K=B[q],xe=q+1,ee=B[xe];if(0>g(K,Ne))xe<De&&0>g(ee,K)?(B[Ae]=ee,B[xe]=Ne,Ae=xe):(B[Ae]=K,B[q]=Ne,Ae=q);else if(xe<De&&0>g(ee,Ne))B[Ae]=ee,B[xe]=Ne,Ae=xe;else break e}}return oe}function g(B,oe){var Ne=B.sortIndex-oe.sortIndex;return Ne!==0?Ne:B.id-oe.id}if(c.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var v=performance;c.unstable_now=function(){return v.now()}}else{var H=Date,S=H.now();c.unstable_now=function(){return H.now()-S}}var T=[],_=[],G=1,O=null,Z=3,X=!1,V=!1,Q=!1,M=!1,m=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function U(B){for(var oe=N(_);oe!==null;){if(oe.callback===null)f(_);else if(oe.startTime<=B)f(_),oe.sortIndex=oe.expirationTime,b(T,oe);else break;oe=N(_)}}function de(B){if(Q=!1,U(B),!V)if(N(T)!==null)V=!0,pe||(pe=!0,E());else{var oe=N(_);oe!==null&&me(de,oe.startTime-B)}}var pe=!1,z=-1,F=5,ke=-1;function ye(){return M?!0:!(c.unstable_now()-ke<F)}function ne(){if(M=!1,pe){var B=c.unstable_now();ke=B;var oe=!0;try{e:{V=!1,Q&&(Q=!1,j(z),z=-1),X=!0;var Ne=Z;try{t:{for(U(B),O=N(T);O!==null&&!(O.expirationTime>B&&ye());){var Ae=O.callback;if(typeof Ae=="function"){O.callback=null,Z=O.priorityLevel;var De=Ae(O.expirationTime<=B);if(B=c.unstable_now(),typeof De=="function"){O.callback=De,U(B),oe=!0;break t}O===N(T)&&f(T),U(B)}else f(T);O=N(T)}if(O!==null)oe=!0;else{var w=N(_);w!==null&&me(de,w.startTime-B),oe=!1}}break e}finally{O=null,Z=Ne,X=!1}oe=void 0}}finally{oe?E():pe=!1}}}var E;if(typeof R=="function")E=function(){R(ne)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,be=fe.port2;fe.port1.onmessage=ne,E=function(){be.postMessage(null)}}else E=function(){m(ne,0)};function me(B,oe){z=m(function(){B(c.unstable_now())},oe)}c.unstable_IdlePriority=5,c.unstable_ImmediatePriority=1,c.unstable_LowPriority=4,c.unstable_NormalPriority=3,c.unstable_Profiling=null,c.unstable_UserBlockingPriority=2,c.unstable_cancelCallback=function(B){B.callback=null},c.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<B?Math.floor(1e3/B):5},c.unstable_getCurrentPriorityLevel=function(){return Z},c.unstable_next=function(B){switch(Z){case 1:case 2:case 3:var oe=3;break;default:oe=Z}var Ne=Z;Z=oe;try{return B()}finally{Z=Ne}},c.unstable_requestPaint=function(){M=!0},c.unstable_runWithPriority=function(B,oe){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Ne=Z;Z=B;try{return oe()}finally{Z=Ne}},c.unstable_scheduleCallback=function(B,oe,Ne){var Ae=c.unstable_now();switch(typeof Ne=="object"&&Ne!==null?(Ne=Ne.delay,Ne=typeof Ne=="number"&&0<Ne?Ae+Ne:Ae):Ne=Ae,B){case 1:var De=-1;break;case 2:De=250;break;case 5:De=1073741823;break;case 4:De=1e4;break;default:De=5e3}return De=Ne+De,B={id:G++,callback:oe,priorityLevel:B,startTime:Ne,expirationTime:De,sortIndex:-1},Ne>Ae?(B.sortIndex=Ne,b(_,B),N(T)===null&&B===N(_)&&(Q?(j(z),z=-1):Q=!0,me(de,Ne-Ae))):(B.sortIndex=De,b(T,B),V||X||(V=!0,pe||(pe=!0,E()))),B},c.unstable_shouldYield=ye,c.unstable_wrapCallback=function(B){var oe=Z;return function(){var Ne=Z;Z=oe;try{return B.apply(this,arguments)}finally{Z=Ne}}}})(Ku)),Ku}var s0;function ix(){return s0||(s0=1,Ju.exports=nx()),Ju.exports}var Iu={exports:{}},pa={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var l0;function ox(){if(l0)return pa;l0=1;var c=dh();function b(T){var _="https://react.dev/errors/"+T;if(1<arguments.length){_+="?args[]="+encodeURIComponent(arguments[1]);for(var G=2;G<arguments.length;G++)_+="&args[]="+encodeURIComponent(arguments[G])}return"Minified React error #"+T+"; visit "+_+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function N(){}var f={d:{f:N,r:function(){throw Error(b(522))},D:N,C:N,L:N,m:N,X:N,S:N,M:N},p:0,findDOMNode:null},g=Symbol.for("react.portal");function v(T,_,G){var O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:g,key:O==null?null:""+O,children:T,containerInfo:_,implementation:G}}var H=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function S(T,_){if(T==="font")return"";if(typeof _=="string")return _==="use-credentials"?_:""}return pa.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=f,pa.createPortal=function(T,_){var G=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_||_.nodeType!==1&&_.nodeType!==9&&_.nodeType!==11)throw Error(b(299));return v(T,_,null,G)},pa.flushSync=function(T){var _=H.T,G=f.p;try{if(H.T=null,f.p=2,T)return T()}finally{H.T=_,f.p=G,f.d.f()}},pa.preconnect=function(T,_){typeof T=="string"&&(_?(_=_.crossOrigin,_=typeof _=="string"?_==="use-credentials"?_:"":void 0):_=null,f.d.C(T,_))},pa.prefetchDNS=function(T){typeof T=="string"&&f.d.D(T)},pa.preinit=function(T,_){if(typeof T=="string"&&_&&typeof _.as=="string"){var G=_.as,O=S(G,_.crossOrigin),Z=typeof _.integrity=="string"?_.integrity:void 0,X=typeof _.fetchPriority=="string"?_.fetchPriority:void 0;G==="style"?f.d.S(T,typeof _.precedence=="string"?_.precedence:void 0,{crossOrigin:O,integrity:Z,fetchPriority:X}):G==="script"&&f.d.X(T,{crossOrigin:O,integrity:Z,fetchPriority:X,nonce:typeof _.nonce=="string"?_.nonce:void 0})}},pa.preinitModule=function(T,_){if(typeof T=="string")if(typeof _=="object"&&_!==null){if(_.as==null||_.as==="script"){var G=S(_.as,_.crossOrigin);f.d.M(T,{crossOrigin:G,integrity:typeof _.integrity=="string"?_.integrity:void 0,nonce:typeof _.nonce=="string"?_.nonce:void 0})}}else _==null&&f.d.M(T)},pa.preload=function(T,_){if(typeof T=="string"&&typeof _=="object"&&_!==null&&typeof _.as=="string"){var G=_.as,O=S(G,_.crossOrigin);f.d.L(T,G,{crossOrigin:O,integrity:typeof _.integrity=="string"?_.integrity:void 0,nonce:typeof _.nonce=="string"?_.nonce:void 0,type:typeof _.type=="string"?_.type:void 0,fetchPriority:typeof _.fetchPriority=="string"?_.fetchPriority:void 0,referrerPolicy:typeof _.referrerPolicy=="string"?_.referrerPolicy:void 0,imageSrcSet:typeof _.imageSrcSet=="string"?_.imageSrcSet:void 0,imageSizes:typeof _.imageSizes=="string"?_.imageSizes:void 0,media:typeof _.media=="string"?_.media:void 0})}},pa.preloadModule=function(T,_){if(typeof T=="string")if(_){var G=S(_.as,_.crossOrigin);f.d.m(T,{as:typeof _.as=="string"&&_.as!=="script"?_.as:void 0,crossOrigin:G,integrity:typeof _.integrity=="string"?_.integrity:void 0})}else f.d.m(T)},pa.requestFormReset=function(T){f.d.r(T)},pa.unstable_batchedUpdates=function(T,_){return T(_)},pa.useFormState=function(T,_,G){return H.H.useFormState(T,_,G)},pa.useFormStatus=function(){return H.H.useHostTransitionStatus()},pa.version="19.2.0",pa}var r0;function cx(){if(r0)return Iu.exports;r0=1;function c(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(b){console.error(b)}}return c(),Iu.exports=ox(),Iu.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var n0;function dx(){if(n0)return Xi;n0=1;var c=ix(),b=dh(),N=cx();function f(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function g(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function v(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function H(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function S(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function T(e){if(v(e)!==e)throw Error(f(188))}function _(e){var t=e.alternate;if(!t){if(t=v(e),t===null)throw Error(f(188));return t!==e?null:e}for(var s=e,l=t;;){var n=s.return;if(n===null)break;var i=n.alternate;if(i===null){if(l=n.return,l!==null){s=l;continue}break}if(n.child===i.child){for(i=n.child;i;){if(i===s)return T(n),e;if(i===l)return T(n),t;i=i.sibling}throw Error(f(188))}if(s.return!==l.return)s=n,l=i;else{for(var u=!1,p=n.child;p;){if(p===s){u=!0,s=n,l=i;break}if(p===l){u=!0,l=n,s=i;break}p=p.sibling}if(!u){for(p=i.child;p;){if(p===s){u=!0,s=i,l=n;break}if(p===l){u=!0,l=i,s=n;break}p=p.sibling}if(!u)throw Error(f(189))}}if(s.alternate!==l)throw Error(f(190))}if(s.tag!==3)throw Error(f(188));return s.stateNode.current===s?e:t}function G(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=G(e),t!==null)return t;e=e.sibling}return null}var O=Object.assign,Z=Symbol.for("react.element"),X=Symbol.for("react.transitional.element"),V=Symbol.for("react.portal"),Q=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),R=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),de=Symbol.for("react.suspense"),pe=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),ke=Symbol.for("react.activity"),ye=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function E(e){return e===null||typeof e!="object"?null:(e=ne&&e[ne]||e["@@iterator"],typeof e=="function"?e:null)}var fe=Symbol.for("react.client.reference");function be(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===fe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Q:return"Fragment";case m:return"Profiler";case M:return"StrictMode";case de:return"Suspense";case pe:return"SuspenseList";case ke:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case V:return"Portal";case R:return e.displayName||"Context";case j:return(e._context.displayName||"Context")+".Consumer";case U:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:be(e.type)||"Memo";case F:t=e._payload,e=e._init;try{return be(e(t))}catch{}}return null}var me=Array.isArray,B=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=N.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ne={pending:!1,data:null,method:null,action:null},Ae=[],De=-1;function w(e){return{current:e}}function q(e){0>De||(e.current=Ae[De],Ae[De]=null,De--)}function K(e,t){De++,Ae[De]=e.current,e.current=t}var xe=w(null),ee=w(null),Te=w(null),ze=w(null);function Be(e,t){switch(K(Te,t),K(ee,e),K(xe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?jm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=jm(t),e=Nm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(xe),K(xe,e)}function k(){q(xe),q(ee),q(Te)}function A(e){e.memoizedState!==null&&K(ze,e);var t=xe.current,s=Nm(t,e.type);t!==s&&(K(ee,e),K(xe,s))}function ae(e){ee.current===e&&(q(xe),q(ee)),ze.current===e&&(q(ze),$i._currentValue=Ne)}var ie,we;function Ce(e){if(ie===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);ie=t&&t[1]||"",we=-1<s.stack.indexOf(`
    at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ie+e+we}var We=!1;function Je(e,t){if(!e||We)return"";We=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(te){var P=te}Reflect.construct(e,[],ue)}else{try{ue.call()}catch(te){P=te}e.call(ue.prototype)}}else{try{throw Error()}catch(te){P=te}(ue=e())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(te){if(te&&P&&typeof te.stack=="string")return[te.stack,P.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=l.DetermineComponentFrameRoot(),u=i[0],p=i[1];if(u&&p){var C=u.split(`
`),J=p.split(`
`);for(n=l=0;l<C.length&&!C[l].includes("DetermineComponentFrameRoot");)l++;for(;n<J.length&&!J[n].includes("DetermineComponentFrameRoot");)n++;if(l===C.length||n===J.length)for(l=C.length-1,n=J.length-1;1<=l&&0<=n&&C[l]!==J[n];)n--;for(;1<=l&&0<=n;l--,n--)if(C[l]!==J[n]){if(l!==1||n!==1)do if(l--,n--,0>n||C[l]!==J[n]){var re=`
`+C[l].replace(" at new "," at ");return e.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",e.displayName)),re}while(1<=l&&0<=n);break}}}finally{We=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Ce(s):""}function st(e,t){switch(e.tag){case 26:case 27:case 5:return Ce(e.type);case 16:return Ce("Lazy");case 13:return e.child!==t&&t!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return Je(e.type,!1);case 11:return Je(e.type.render,!1);case 1:return Je(e.type,!0);case 31:return Ce("Activity");default:return""}}function $t(e){try{var t="",s=null;do t+=st(e,s),s=e,e=e.return;while(e);return t}catch(l){return`
Error generating stack: `+l.message+`
`+l.stack}}var Gt=Object.prototype.hasOwnProperty,Vt=c.unstable_scheduleCallback,bt=c.unstable_cancelCallback,ea=c.unstable_shouldYield,Se=c.unstable_requestPaint,le=c.unstable_now,_e=c.unstable_getCurrentPriorityLevel,Ee=c.unstable_ImmediatePriority,ft=c.unstable_UserBlockingPriority,he=c.unstable_NormalPriority,ot=c.unstable_LowPriority,Ge=c.unstable_IdlePriority,Lt=c.log,Re=c.unstable_setDisableYieldValue,ta=null,At=null;function Wt(e){if(typeof Lt=="function"&&Re(e),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(ta,e)}catch{}}var kt=Math.clz32?Math.clz32:Ye,ge=Math.log,tt=Math.LN2;function Ye(e){return e>>>=0,e===0?32:31-(ge(e)/tt|0)|0}var Ze=256,Rt=262144,$e=4194304;function I(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function mt(e,t,s){var l=e.pendingLanes;if(l===0)return 0;var n=0,i=e.suspendedLanes,u=e.pingedLanes;e=e.warmLanes;var p=l&134217727;return p!==0?(l=p&~i,l!==0?n=I(l):(u&=p,u!==0?n=I(u):s||(s=p&~e,s!==0&&(n=I(s))))):(p=l&~i,p!==0?n=I(p):u!==0?n=I(u):s||(s=l&~e,s!==0&&(n=I(s)))),n===0?0:t!==0&&t!==n&&(t&i)===0&&(i=n&-n,s=t&-t,i>=s||i===32&&(s&4194048)!==0)?t:n}function je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ot(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function lr(){var e=$e;return $e<<=1,($e&62914560)===0&&($e=4194304),e}function ma(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Zt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ke(e,t,s,l,n,i){var u=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var p=e.entanglements,C=e.expirationTimes,J=e.hiddenUpdates;for(s=u&~s;0<s;){var re=31-kt(s),ue=1<<re;p[re]=0,C[re]=-1;var P=J[re];if(P!==null)for(J[re]=null,re=0;re<P.length;re++){var te=P[re];te!==null&&(te.lane&=-536870913)}s&=~ue}l!==0&&Is(e,l,0),i!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=i&~(u&~t))}function Is(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-kt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|s&261930}function ht(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var l=31-kt(s),n=1<<l;n&t|e[l]&t&&(e[l]|=t),s&=~n}}function Ea(e,t){var s=t&-t;return s=(s&42)!==0?1:zr(s),(s&(e.suspendedLanes|t))!==0?0:s}function zr(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ut(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xt(){var e=oe.p;return e!==0?e:(e=window.event,e===void 0?32:Qm(e.type))}function La(e,t){var s=oe.p;try{return oe.p=e,t()}finally{oe.p=s}}var Yt=Math.random().toString(36).slice(2),Xe="__reactFiber$"+Yt,Et="__reactProps$"+Yt,ga="__reactContainer$"+Yt,fs="__reactEvents$"+Yt,ad="__reactListeners$"+Yt,sd="__reactHandles$"+Yt,Nl="__reactResources$"+Yt,wl="__reactMarker$"+Yt;function Tn(e){delete e[Xe],delete e[Et],delete e[fs],delete e[ad],delete e[sd]}function Za(e){var t=e[Xe];if(t)return t;for(var s=e.parentNode;s;){if(t=s[ga]||s[Xe]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=Cm(e);e!==null;){if(s=e[Xe])return s;e=Cm(e)}return t}e=s,s=e.parentNode}return null}function Pa(e){if(e=e[Xe]||e[ga]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function kl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(f(33))}function _l(e){var t=e[Nl];return t||(t=e[Nl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Jt(e){e[wl]=!0}var oo=new Set,Ut={};function ms(e,t){Sl(e,t),Sl(e+"Capture",t)}function Sl(e,t){for(Ut[e]=t,e=0;e<t.length;e++)oo.add(t[e])}var co=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),On={},uo={};function ld(e){return Gt.call(uo,e)?!0:Gt.call(On,e)?!1:co.test(e)?uo[e]=!0:(On[e]=!0,!1)}function Rr(e,t,s){if(ld(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function Ur(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function gs(e,t,s,l){if(l===null)e.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+l)}}function Aa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function En(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ho(e,t,s){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var n=l.get,i=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(u){s=""+u,i.call(this,u)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(u){s=""+u},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ln(e){if(!e._valueTracker){var t=En(e)?"checked":"value";e._valueTracker=ho(e,t,""+e[t])}}function fo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),l="";return e&&(l=En(e)?e.checked?"true":"false":e.value),e=l,e!==s?(t.setValue(e),!0):!1}function Hr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var mo=/[\n"\\]/g;function Ya(e){return e.replace(mo,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ps(e,t,s,l,n,i,u,p){e.name="",u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"?e.type=u:e.removeAttribute("type"),t!=null?u==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Aa(t)):e.value!==""+Aa(t)&&(e.value=""+Aa(t)):u!=="submit"&&u!=="reset"||e.removeAttribute("value"),t!=null?qr(e,u,Aa(t)):s!=null?qr(e,u,Aa(s)):l!=null&&e.removeAttribute("value"),n==null&&i!=null&&(e.defaultChecked=!!i),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+Aa(p):e.removeAttribute("name")}function rr(e,t,s,l,n,i,u,p){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||s!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){Ln(e);return}s=s!=null?""+Aa(s):"",t=t!=null?""+Aa(t):s,p||t===e.value||(e.value=t),e.defaultValue=t}l=l??n,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=p?e.checked:!!l,e.defaultChecked=!!l,u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.name=u),Ln(e)}function qr(e,t,s){t==="number"&&Hr(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function es(e,t,s,l){if(e=e.options,t){t={};for(var n=0;n<s.length;n++)t["$"+s[n]]=!0;for(s=0;s<e.length;s++)n=t.hasOwnProperty("$"+e[s].value),e[s].selected!==n&&(e[s].selected=n),n&&l&&(e[s].defaultSelected=!0)}else{for(s=""+Aa(s),t=null,n=0;n<e.length;n++){if(e[n].value===s){e[n].selected=!0,l&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function ts(e,t,s){if(t!=null&&(t=""+Aa(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Aa(s):""}function go(e,t,s,l){if(t==null){if(l!=null){if(s!=null)throw Error(f(92));if(me(l)){if(1<l.length)throw Error(f(93));l=l[0]}s=l}s==null&&(s=""),t=s}s=Aa(t),e.defaultValue=s,l=e.textContent,l===s&&l!==""&&l!==null&&(e.value=l),Ln(e)}function Dl(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var rd=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function xo(e,t,s){var l=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,s):typeof s!="number"||s===0||rd.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function po(e,t,s){if(t!=null&&typeof t!="object")throw Error(f(62));if(e=e.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var n in t)l=t[n],t.hasOwnProperty(n)&&s[n]!==l&&xo(e,n,l)}else for(var i in t)t.hasOwnProperty(i)&&xo(e,i,t[i])}function An(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var nd=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),id=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ml(e){return id.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function xs(){}var Br=null;function Yn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cl=null,Tl=null;function yo(e){var t=Pa(e);if(t&&(e=t.stateNode)){var s=e[Et]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ps(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Ya(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var l=s[t];if(l!==e&&l.form===e.form){var n=l[Et]||null;if(!n)throw Error(f(90));Ps(l,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<s.length;t++)l=s[t],l.form===e.form&&fo(l)}break e;case"textarea":ts(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&es(e,!!s.multiple,t,!1)}}}var zn=!1;function bo(e,t,s){if(zn)return e(t,s);zn=!0;try{var l=e(t);return l}finally{if(zn=!1,(Cl!==null||Tl!==null)&&(Nc(),Cl&&(t=Cl,e=Tl,Tl=Cl=null,yo(t),e)))for(t=0;t<e.length;t++)yo(e[t])}}function nr(e,t){var s=e.stateNode;if(s===null)return null;var l=s[Et]||null;if(l===null)return null;s=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(f(231,t,typeof s));return s}var ps=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rn=!1;if(ps)try{var ir={};Object.defineProperty(ir,"passive",{get:function(){Rn=!0}}),window.addEventListener("test",ir,ir),window.removeEventListener("test",ir,ir)}catch{Rn=!1}var Es=null,Un=null,$r=null;function vo(){if($r)return $r;var e,t=Un,s=t.length,l,n="value"in Es?Es.value:Es.textContent,i=n.length;for(e=0;e<s&&t[e]===n[e];e++);var u=s-e;for(l=1;l<=u&&t[s-l]===n[i-l];l++);return $r=n.slice(e,1<l?1-l:void 0)}function Gr(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ol(){return!0}function Vr(){return!1}function xa(e){function t(s,l,n,i,u){this._reactName=s,this._targetInst=n,this.type=l,this.nativeEvent=i,this.target=u,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(s=e[p],this[p]=s?s(i):i[p]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ol:Vr,this.isPropagationStopped=Vr,this}return O(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ol)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ol)},persist:function(){},isPersistent:Ol}),t}var Ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},or=xa(Ls),cr=O({},Ls,{view:0,detail:0}),od=xa(cr),Hn,qn,El,jt=O({},cr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==El&&(El&&e.type==="mousemove"?(Hn=e.screenX-El.screenX,qn=e.screenY-El.screenY):qn=Hn=0,El=e),Hn)},movementY:function(e){return"movementY"in e?e.movementY:qn}}),Ll=xa(jt),dr=O({},jt,{dataTransfer:0}),cd=xa(dr),jo=O({},cr,{relatedTarget:0}),Bn=xa(jo),dd=O({},Ls,{animationName:0,elapsedTime:0,pseudoElement:0}),Qr=xa(dd),As=O({},Ls,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$n=xa(As),ud=O({},Ls,{data:0}),as=xa(ud),hd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gn={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"},fd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function md(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fd[e])?!!t[e]:!1}function Vn(){return md}var Zr=O({},cr,{key:function(e){if(e.key){var t=hd[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Gr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Gn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vn,charCode:function(e){return e.type==="keypress"?Gr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Gr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Qn=xa(Zr),gd=O({},jt,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),No=xa(gd),xd=O({},cr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vn}),wo=xa(xd),pd=O({},Ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),yd=xa(pd),bd=O({},jt,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),vd=xa(bd),jd=O({},Ls,{newState:0,oldState:0}),ko=xa(jd),Nd=[9,13,27,32],Ys=ps&&"CompositionEvent"in window,ur=null;ps&&"documentMode"in document&&(ur=document.documentMode);var Zn=ps&&"TextEvent"in window&&!ur,_o=ps&&(!Ys||ur&&8<ur&&11>=ur),Xr=" ",So=!1;function Do(e,t){switch(e){case"keyup":return Nd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Al=!1;function Co(e,t){switch(e){case"compositionend":return Mo(t);case"keypress":return t.which!==32?null:(So=!0,Xr);case"textInput":return e=t.data,e===Xr&&So?null:e;default:return null}}function wd(e,t){if(Al)return e==="compositionend"||!Ys&&Do(e,t)?(e=vo(),$r=Un=Es=null,Al=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return _o&&t.locale!=="ko"?null:t.data;default:return null}}var To={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 _t(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!To[e.type]:t==="textarea"}function Oo(e,t,s,l){Cl?Tl?Tl.push(l):Tl=[l]:Cl=l,t=Cc(t,"onChange"),0<t.length&&(s=new or("onChange","change",null,s,l),e.push({event:s,listeners:t}))}var hr=null,Yl=null;function kd(e){gm(e,0)}function Fr(e){var t=kl(e);if(fo(t))return e}function Eo(e,t){if(e==="change")return t}var zl=!1;if(ps){var Xn;if(ps){var Fn="oninput"in document;if(!Fn){var Lo=document.createElement("div");Lo.setAttribute("oninput","return;"),Fn=typeof Lo.oninput=="function"}Xn=Fn}else Xn=!1;zl=Xn&&(!document.documentMode||9<document.documentMode)}function fr(){hr&&(hr.detachEvent("onpropertychange",mr),Yl=hr=null)}function mr(e){if(e.propertyName==="value"&&Fr(Yl)){var t=[];Oo(t,Yl,e,Yn(e)),bo(kd,t)}}function Wn(e,t,s){e==="focusin"?(fr(),hr=t,Yl=s,hr.attachEvent("onpropertychange",mr)):e==="focusout"&&fr()}function _d(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Fr(Yl)}function Ao(e,t){if(e==="click")return Fr(t)}function Sd(e,t){if(e==="input"||e==="change")return Fr(t)}function Jn(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var na=typeof Object.is=="function"?Object.is:Jn;function el(e,t){if(na(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var n=s[l];if(!Gt.call(t,n)||!na(e[n],t[n]))return!1}return!0}function Yo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zo(e,t){var s=Yo(e);e=0;for(var l;s;){if(s.nodeType===3){if(l=e+s.textContent.length,e<=t&&l>=t)return{node:s,offset:t-e};e=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Yo(s)}}function Ro(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ro(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Uo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Hr(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Hr(e.document)}return t}function Kn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Dd=ps&&"documentMode"in document&&11>=document.documentMode,Rl=null,In=null,gr=null,Pn=!1;function ei(e,t,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Pn||Rl==null||Rl!==Hr(l)||(l=Rl,"selectionStart"in l&&Kn(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),gr&&el(gr,l)||(gr=l,l=Cc(In,"onSelect"),0<l.length&&(t=new or("onSelect","select",null,t,s),e.push({event:t,listeners:l}),t.target=Rl)))}function tl(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Ul={animationend:tl("Animation","AnimationEnd"),animationiteration:tl("Animation","AnimationIteration"),animationstart:tl("Animation","AnimationStart"),transitionrun:tl("Transition","TransitionRun"),transitionstart:tl("Transition","TransitionStart"),transitioncancel:tl("Transition","TransitionCancel"),transitionend:tl("Transition","TransitionEnd")},ja={},zs={};ps&&(zs=document.createElement("div").style,"AnimationEvent"in window||(delete Ul.animationend.animation,delete Ul.animationiteration.animation,delete Ul.animationstart.animation),"TransitionEvent"in window||delete Ul.transitionend.transition);function Rs(e){if(ja[e])return ja[e];if(!Ul[e])return e;var t=Ul[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in zs)return ja[e]=t[s];return e}var Ho=Rs("animationend"),ti=Rs("animationiteration"),ai=Rs("animationstart"),Md=Rs("transitionrun"),Cd=Rs("transitionstart"),qo=Rs("transitioncancel"),Bo=Rs("transitionend"),$o=new Map,si="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");si.push("scrollEnd");function Xa(e,t){$o.set(e,t),ms(t,[e])}var Wr=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},za=[],Hl=0,li=0;function Jr(){for(var e=Hl,t=li=Hl=0;t<e;){var s=za[t];za[t++]=null;var l=za[t];za[t++]=null;var n=za[t];za[t++]=null;var i=za[t];if(za[t++]=null,l!==null&&n!==null){var u=l.pending;u===null?n.next=n:(n.next=u.next,u.next=n),l.pending=n}i!==0&&Go(s,n,i)}}function Kr(e,t,s,l){za[Hl++]=e,za[Hl++]=t,za[Hl++]=s,za[Hl++]=l,li|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function ri(e,t,s,l){return Kr(e,t,s,l),Ir(e)}function al(e,t){return Kr(e,null,null,t),Ir(e)}function Go(e,t,s){e.lanes|=s;var l=e.alternate;l!==null&&(l.lanes|=s);for(var n=!1,i=e.return;i!==null;)i.childLanes|=s,l=i.alternate,l!==null&&(l.childLanes|=s),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(n=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,n&&t!==null&&(n=31-kt(s),e=i.hiddenUpdates,l=e[n],l===null?e[n]=[t]:l.push(t),t.lane=s|536870912),i):null}function Ir(e){if(50<Yi)throw Yi=0,pu=null,Error(f(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ys={};function Td(e,t,s,l){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Na(e,t,s,l){return new Td(e,t,s,l)}function ni(e){return e=e.prototype,!(!e||!e.isReactComponent)}function bs(e,t){var s=e.alternate;return s===null?(s=Na(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Vo(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Pr(e,t,s,l,n,i){var u=0;if(l=e,typeof e=="function")ni(e)&&(u=1);else if(typeof e=="string")u=Vg(e,s,xe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ke:return e=Na(31,s,t,n),e.elementType=ke,e.lanes=i,e;case Q:return sl(s.children,n,i,t);case M:u=8,n|=24;break;case m:return e=Na(12,s,t,n|2),e.elementType=m,e.lanes=i,e;case de:return e=Na(13,s,t,n),e.elementType=de,e.lanes=i,e;case pe:return e=Na(19,s,t,n),e.elementType=pe,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case R:u=10;break e;case j:u=9;break e;case U:u=11;break e;case z:u=14;break e;case F:u=16,l=null;break e}u=29,s=Error(f(130,e===null?"null":typeof e,"")),l=null}return t=Na(u,s,t,n),t.elementType=e,t.type=l,t.lanes=i,t}function sl(e,t,s,l){return e=Na(7,e,l,t),e.lanes=s,e}function ii(e,t,s){return e=Na(6,e,null,t),e.lanes=s,e}function oi(e){var t=Na(18,null,null,0);return t.stateNode=e,t}function en(e,t,s){return t=Na(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ci=new WeakMap;function ia(e,t){if(typeof e=="object"&&e!==null){var s=ci.get(e);return s!==void 0?s:(t={value:e,source:t,stack:$t(t)},ci.set(e,t),t)}return{value:e,source:t,stack:$t(t)}}var Fa=[],vs=0,xr=null,ss=0,wa=[],ka=0,Us=null,ls=1,rs="";function js(e,t){Fa[vs++]=ss,Fa[vs++]=xr,xr=e,ss=t}function Qo(e,t,s){wa[ka++]=ls,wa[ka++]=rs,wa[ka++]=Us,Us=e;var l=ls;e=rs;var n=32-kt(l)-1;l&=~(1<<n),s+=1;var i=32-kt(t)+n;if(30<i){var u=n-n%5;i=(l&(1<<u)-1).toString(32),l>>=u,n-=u,ls=1<<32-kt(t)+n|s<<n|l,rs=i+e}else ls=1<<i|s<<n|l,rs=e}function di(e){e.return!==null&&(js(e,1),Qo(e,1,0))}function ui(e){for(;e===xr;)xr=Fa[--vs],Fa[vs]=null,ss=Fa[--vs],Fa[vs]=null;for(;e===Us;)Us=wa[--ka],wa[ka]=null,rs=wa[--ka],wa[ka]=null,ls=wa[--ka],wa[ka]=null}function Zo(e,t){wa[ka++]=ls,wa[ka++]=rs,wa[ka++]=Us,ls=t.id,rs=t.overflow,Us=e}var aa=null,Mt=null,lt=!1,Hs=null,Ra=!1,hi=Error(f(519));function qs(e){var t=Error(f(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw pr(ia(t,e)),hi}function Xo(e){var t=e.stateNode,s=e.type,l=e.memoizedProps;switch(t[Xe]=e,t[Et]=l,s){case"dialog":it("cancel",t),it("close",t);break;case"iframe":case"object":case"embed":it("load",t);break;case"video":case"audio":for(s=0;s<Ri.length;s++)it(Ri[s],t);break;case"source":it("error",t);break;case"img":case"image":case"link":it("error",t),it("load",t);break;case"details":it("toggle",t);break;case"input":it("invalid",t),rr(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":it("invalid",t);break;case"textarea":it("invalid",t),go(t,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||l.suppressHydrationWarning===!0||bm(t.textContent,s)?(l.popover!=null&&(it("beforetoggle",t),it("toggle",t)),l.onScroll!=null&&it("scroll",t),l.onScrollEnd!=null&&it("scrollend",t),l.onClick!=null&&(t.onclick=xs),t=!0):t=!1,t||qs(e,!0)}function Fo(e){for(aa=e.return;aa;)switch(aa.tag){case 5:case 31:case 13:Ra=!1;return;case 27:case 3:Ra=!0;return;default:aa=aa.return}}function ql(e){if(e!==aa)return!1;if(!lt)return Fo(e),lt=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Eu(e.type,e.memoizedProps)),s=!s),s&&Mt&&qs(e),Fo(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(317));Mt=Mm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(317));Mt=Mm(e)}else t===27?(t=Mt,Il(e.type)?(e=Ru,Ru=null,Mt=e):Mt=t):Mt=aa?ds(e.stateNode.nextSibling):null;return!0}function ll(){Mt=aa=null,lt=!1}function fi(){var e=Hs;return e!==null&&(Ga===null?Ga=e:Ga.push.apply(Ga,e),Hs=null),e}function pr(e){Hs===null?Hs=[e]:Hs.push(e)}var mi=w(null),Ns=null,ws=null;function Bs(e,t,s){K(mi,t._currentValue),t._currentValue=s}function ks(e){e._currentValue=mi.current,q(mi)}function yr(e,t,s){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===s)break;e=e.return}}function Bl(e,t,s,l){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var i=n.dependencies;if(i!==null){var u=n.child;i=i.firstContext;e:for(;i!==null;){var p=i;i=n;for(var C=0;C<t.length;C++)if(p.context===t[C]){i.lanes|=s,p=i.alternate,p!==null&&(p.lanes|=s),yr(i.return,s,e),l||(u=null);break e}i=p.next}}else if(n.tag===18){if(u=n.return,u===null)throw Error(f(341));u.lanes|=s,i=u.alternate,i!==null&&(i.lanes|=s),yr(u,s,e),u=null}else u=n.child;if(u!==null)u.return=n;else for(u=n;u!==null;){if(u===e){u=null;break}if(n=u.sibling,n!==null){n.return=u.return,u=n;break}u=u.return}n=u}}function $l(e,t,s,l){e=null;for(var n=t,i=!1;n!==null;){if(!i){if((n.flags&524288)!==0)i=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var u=n.alternate;if(u===null)throw Error(f(387));if(u=u.memoizedProps,u!==null){var p=n.type;na(n.pendingProps.value,u.value)||(e!==null?e.push(p):e=[p])}}else if(n===ze.current){if(u=n.alternate,u===null)throw Error(f(387));u.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push($i):e=[$i])}n=n.return}e!==null&&Bl(t,e,s,l),t.flags|=262144}function tn(e){for(e=e.firstContext;e!==null;){if(!na(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function rl(e){Ns=e,ws=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function sa(e){return Wo(Ns,e)}function an(e,t){return Ns===null&&rl(e),Wo(e,t)}function Wo(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},ws===null){if(e===null)throw Error(f(308));ws=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ws=ws.next=t;return s}var Jo=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},Od=c.unstable_scheduleCallback,Ed=c.unstable_NormalPriority,qt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function gi(){return{controller:new Jo,data:new Map,refCount:0}}function br(e){e.refCount--,e.refCount===0&&Od(Ed,function(){e.controller.abort()})}var vr=null,ns=0,nl=0,Gl=null;function Ld(e,t){if(vr===null){var s=vr=[];ns=0,nl=wu(),Gl={status:"pending",value:void 0,then:function(l){s.push(l)}}}return ns++,t.then(Ko,Ko),t}function Ko(){if(--ns===0&&vr!==null){Gl!==null&&(Gl.status="fulfilled");var e=vr;vr=null,nl=0,Gl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ve(e,t){var s=[],l={status:"pending",value:null,reason:null,then:function(n){s.push(n)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var n=0;n<s.length;n++)(0,s[n])(t)},function(n){for(l.status="rejected",l.reason=n,n=0;n<s.length;n++)(0,s[n])(void 0)}),l}var Io=B.S;B.S=function(e,t){Gf=le(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ld(e,t),Io!==null&&Io(e,t)};var il=w(null);function sn(){var e=il.current;return e!==null?e:Tt.pooledCache}function rt(e,t){t===null?K(il,il.current):K(il,t.pool)}function jr(){var e=sn();return e===null?null:{parent:qt._currentValue,pool:e}}var ol=Error(f(460)),Nr=Error(f(474)),ln=Error(f(542)),rn={then:function(){}};function Po(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ec(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(xs,xs),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,xi(e),e;default:if(typeof t.status=="string")t.then(xs,xs);else{if(e=Tt,e!==null&&100<e.shellSuspendCounter)throw Error(f(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=l}},function(l){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,xi(e),e}throw oa=t,ol}}function cl(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(oa=s,ol):s}}var oa=null;function tc(){if(oa===null)throw Error(f(459));var e=oa;return oa=null,e}function xi(e){if(e===ol||e===ln)throw Error(f(483))}var Vl=null,wr=0;function kr(e){var t=wr;return wr+=1,Vl===null&&(Vl=[]),ec(Vl,e,t)}function _r(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Sr(e,t){throw t.$$typeof===Z?Error(f(525)):(e=Object.prototype.toString.call(t),Error(f(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function nn(e){function t($,Y){if(e){var W=$.deletions;W===null?($.deletions=[Y],$.flags|=16):W.push(Y)}}function s($,Y){if(!e)return null;for(;Y!==null;)t($,Y),Y=Y.sibling;return null}function l($){for(var Y=new Map;$!==null;)$.key!==null?Y.set($.key,$):Y.set($.index,$),$=$.sibling;return Y}function n($,Y){return $=bs($,Y),$.index=0,$.sibling=null,$}function i($,Y,W){return $.index=W,e?(W=$.alternate,W!==null?(W=W.index,W<Y?($.flags|=67108866,Y):W):($.flags|=67108866,Y)):($.flags|=1048576,Y)}function u($){return e&&$.alternate===null&&($.flags|=67108866),$}function p($,Y,W,ce){return Y===null||Y.tag!==6?(Y=ii(W,$.mode,ce),Y.return=$,Y):(Y=n(Y,W),Y.return=$,Y)}function C($,Y,W,ce){var Ue=W.type;return Ue===Q?re($,Y,W.props.children,ce,W.key):Y!==null&&(Y.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===F&&cl(Ue)===Y.type)?(Y=n(Y,W.props),_r(Y,W),Y.return=$,Y):(Y=Pr(W.type,W.key,W.props,null,$.mode,ce),_r(Y,W),Y.return=$,Y)}function J($,Y,W,ce){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==W.containerInfo||Y.stateNode.implementation!==W.implementation?(Y=en(W,$.mode,ce),Y.return=$,Y):(Y=n(Y,W.children||[]),Y.return=$,Y)}function re($,Y,W,ce,Ue){return Y===null||Y.tag!==7?(Y=sl(W,$.mode,ce,Ue),Y.return=$,Y):(Y=n(Y,W),Y.return=$,Y)}function ue($,Y,W){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=ii(""+Y,$.mode,W),Y.return=$,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case X:return W=Pr(Y.type,Y.key,Y.props,null,$.mode,W),_r(W,Y),W.return=$,W;case V:return Y=en(Y,$.mode,W),Y.return=$,Y;case F:return Y=cl(Y),ue($,Y,W)}if(me(Y)||E(Y))return Y=sl(Y,$.mode,W,null),Y.return=$,Y;if(typeof Y.then=="function")return ue($,kr(Y),W);if(Y.$$typeof===R)return ue($,an($,Y),W);Sr($,Y)}return null}function P($,Y,W,ce){var Ue=Y!==null?Y.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return Ue!==null?null:p($,Y,""+W,ce);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case X:return W.key===Ue?C($,Y,W,ce):null;case V:return W.key===Ue?J($,Y,W,ce):null;case F:return W=cl(W),P($,Y,W,ce)}if(me(W)||E(W))return Ue!==null?null:re($,Y,W,ce,null);if(typeof W.then=="function")return P($,Y,kr(W),ce);if(W.$$typeof===R)return P($,Y,an($,W),ce);Sr($,W)}return null}function te($,Y,W,ce,Ue){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return $=$.get(W)||null,p(Y,$,""+ce,Ue);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case X:return $=$.get(ce.key===null?W:ce.key)||null,C(Y,$,ce,Ue);case V:return $=$.get(ce.key===null?W:ce.key)||null,J(Y,$,ce,Ue);case F:return ce=cl(ce),te($,Y,W,ce,Ue)}if(me(ce)||E(ce))return $=$.get(W)||null,re(Y,$,ce,Ue,null);if(typeof ce.then=="function")return te($,Y,W,kr(ce),Ue);if(ce.$$typeof===R)return te($,Y,W,an(Y,ce),Ue);Sr(Y,ce)}return null}function Oe($,Y,W,ce){for(var Ue=null,xt=null,Le=Y,Pe=Y=0,dt=null;Le!==null&&Pe<W.length;Pe++){Le.index>Pe?(dt=Le,Le=null):dt=Le.sibling;var pt=P($,Le,W[Pe],ce);if(pt===null){Le===null&&(Le=dt);break}e&&Le&&pt.alternate===null&&t($,Le),Y=i(pt,Y,Pe),xt===null?Ue=pt:xt.sibling=pt,xt=pt,Le=dt}if(Pe===W.length)return s($,Le),lt&&js($,Pe),Ue;if(Le===null){for(;Pe<W.length;Pe++)Le=ue($,W[Pe],ce),Le!==null&&(Y=i(Le,Y,Pe),xt===null?Ue=Le:xt.sibling=Le,xt=Le);return lt&&js($,Pe),Ue}for(Le=l(Le);Pe<W.length;Pe++)dt=te(Le,$,Pe,W[Pe],ce),dt!==null&&(e&&dt.alternate!==null&&Le.delete(dt.key===null?Pe:dt.key),Y=i(dt,Y,Pe),xt===null?Ue=dt:xt.sibling=dt,xt=dt);return e&&Le.forEach(function(sr){return t($,sr)}),lt&&js($,Pe),Ue}function He($,Y,W,ce){if(W==null)throw Error(f(151));for(var Ue=null,xt=null,Le=Y,Pe=Y=0,dt=null,pt=W.next();Le!==null&&!pt.done;Pe++,pt=W.next()){Le.index>Pe?(dt=Le,Le=null):dt=Le.sibling;var sr=P($,Le,pt.value,ce);if(sr===null){Le===null&&(Le=dt);break}e&&Le&&sr.alternate===null&&t($,Le),Y=i(sr,Y,Pe),xt===null?Ue=sr:xt.sibling=sr,xt=sr,Le=dt}if(pt.done)return s($,Le),lt&&js($,Pe),Ue;if(Le===null){for(;!pt.done;Pe++,pt=W.next())pt=ue($,pt.value,ce),pt!==null&&(Y=i(pt,Y,Pe),xt===null?Ue=pt:xt.sibling=pt,xt=pt);return lt&&js($,Pe),Ue}for(Le=l(Le);!pt.done;Pe++,pt=W.next())pt=te(Le,$,Pe,pt.value,ce),pt!==null&&(e&&pt.alternate!==null&&Le.delete(pt.key===null?Pe:pt.key),Y=i(pt,Y,Pe),xt===null?Ue=pt:xt.sibling=pt,xt=pt);return e&&Le.forEach(function(tx){return t($,tx)}),lt&&js($,Pe),Ue}function Dt($,Y,W,ce){if(typeof W=="object"&&W!==null&&W.type===Q&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case X:e:{for(var Ue=W.key;Y!==null;){if(Y.key===Ue){if(Ue=W.type,Ue===Q){if(Y.tag===7){s($,Y.sibling),ce=n(Y,W.props.children),ce.return=$,$=ce;break e}}else if(Y.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===F&&cl(Ue)===Y.type){s($,Y.sibling),ce=n(Y,W.props),_r(ce,W),ce.return=$,$=ce;break e}s($,Y);break}else t($,Y);Y=Y.sibling}W.type===Q?(ce=sl(W.props.children,$.mode,ce,W.key),ce.return=$,$=ce):(ce=Pr(W.type,W.key,W.props,null,$.mode,ce),_r(ce,W),ce.return=$,$=ce)}return u($);case V:e:{for(Ue=W.key;Y!==null;){if(Y.key===Ue)if(Y.tag===4&&Y.stateNode.containerInfo===W.containerInfo&&Y.stateNode.implementation===W.implementation){s($,Y.sibling),ce=n(Y,W.children||[]),ce.return=$,$=ce;break e}else{s($,Y);break}else t($,Y);Y=Y.sibling}ce=en(W,$.mode,ce),ce.return=$,$=ce}return u($);case F:return W=cl(W),Dt($,Y,W,ce)}if(me(W))return Oe($,Y,W,ce);if(E(W)){if(Ue=E(W),typeof Ue!="function")throw Error(f(150));return W=Ue.call(W),He($,Y,W,ce)}if(typeof W.then=="function")return Dt($,Y,kr(W),ce);if(W.$$typeof===R)return Dt($,Y,an($,W),ce);Sr($,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,Y!==null&&Y.tag===6?(s($,Y.sibling),ce=n(Y,W),ce.return=$,$=ce):(s($,Y),ce=ii(W,$.mode,ce),ce.return=$,$=ce),u($)):s($,Y)}return function($,Y,W,ce){try{wr=0;var Ue=Dt($,Y,W,ce);return Vl=null,Ue}catch(Le){if(Le===ol||Le===ln)throw Le;var xt=Na(29,Le,null,$.mode);return xt.lanes=ce,xt.return=$,xt}finally{}}}var dl=nn(!0),is=nn(!1),_s=!1;function pi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yi(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function $s(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Gs(e,t,s){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(vt&2)!==0){var n=l.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),l.pending=t,t=Ir(e),Go(e,null,s),t}return Kr(e,l,t,s),Ir(e)}function Dr(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,ht(e,s)}}function bi(e,t){var s=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var n=null,i=null;if(s=s.firstBaseUpdate,s!==null){do{var u={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};i===null?n=i=u:i=i.next=u,s=s.next}while(s!==null);i===null?n=i=t:i=i.next=t}else n=i=t;s={baseState:l.baseState,firstBaseUpdate:n,lastBaseUpdate:i,shared:l.shared,callbacks:l.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var vi=!1;function Mr(){if(vi){var e=Gl;if(e!==null)throw e}}function Cr(e,t,s,l){vi=!1;var n=e.updateQueue;_s=!1;var i=n.firstBaseUpdate,u=n.lastBaseUpdate,p=n.shared.pending;if(p!==null){n.shared.pending=null;var C=p,J=C.next;C.next=null,u===null?i=J:u.next=J,u=C;var re=e.alternate;re!==null&&(re=re.updateQueue,p=re.lastBaseUpdate,p!==u&&(p===null?re.firstBaseUpdate=J:p.next=J,re.lastBaseUpdate=C))}if(i!==null){var ue=n.baseState;u=0,re=J=C=null,p=i;do{var P=p.lane&-536870913,te=P!==p.lane;if(te?(ct&P)===P:(l&P)===P){P!==0&&P===nl&&(vi=!0),re!==null&&(re=re.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var Oe=e,He=p;P=t;var Dt=s;switch(He.tag){case 1:if(Oe=He.payload,typeof Oe=="function"){ue=Oe.call(Dt,ue,P);break e}ue=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=He.payload,P=typeof Oe=="function"?Oe.call(Dt,ue,P):Oe,P==null)break e;ue=O({},ue,P);break e;case 2:_s=!0}}P=p.callback,P!==null&&(e.flags|=64,te&&(e.flags|=8192),te=n.callbacks,te===null?n.callbacks=[P]:te.push(P))}else te={lane:P,tag:p.tag,payload:p.payload,callback:p.callback,next:null},re===null?(J=re=te,C=ue):re=re.next=te,u|=P;if(p=p.next,p===null){if(p=n.shared.pending,p===null)break;te=p,p=te.next,te.next=null,n.lastBaseUpdate=te,n.shared.pending=null}}while(!0);re===null&&(C=ue),n.baseState=C,n.firstBaseUpdate=J,n.lastBaseUpdate=re,i===null&&(n.shared.lanes=0),Xl|=u,e.lanes=u,e.memoizedState=ue}}function ac(e,t){if(typeof e!="function")throw Error(f(191,e));e.call(t)}function sc(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)ac(s[e],t)}var Ua=w(null),on=w(0);function lc(e,t){e=bl,K(on,e),K(Ua,t),bl=e|t.baseLanes}function ji(){K(on,bl),K(Ua,Ua.current)}function Ni(){bl=on.current,q(Ua),q(on)}var _a=w(null),Ha=null;function Vs(e){var t=e.alternate;K(Bt,Bt.current&1),K(_a,e),Ha===null&&(t===null||Ua.current!==null||t.memoizedState!==null)&&(Ha=e)}function wi(e){K(Bt,Bt.current),K(_a,e),Ha===null&&(Ha=e)}function os(e){e.tag===22?(K(Bt,Bt.current),K(_a,e),Ha===null&&(Ha=e)):Sa()}function Sa(){K(Bt,Bt.current),K(_a,_a.current)}function Da(e){q(_a),Ha===e&&(Ha=null),q(Bt)}var Bt=w(0);function cn(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Yu(s)||zu(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ss=0,Ve=null,gt=null,Ct=null,ul=!1,Ie=!1,r=!1,o=0,d=0,h=null,x=0;function D(){throw Error(f(321))}function se(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!na(e[s],t[s]))return!1;return!0}function Me(e,t,s,l,n,i){return Ss=i,Ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?Ph:Zd,r=!1,i=s(l,n),r=!1,Ie&&(i=at(t,s,l,n)),qe(e),i}function qe(e){B.H=Si;var t=gt!==null&&gt.next!==null;if(Ss=0,Ct=gt=Ve=null,ul=!1,d=0,h=null,t)throw Error(f(300));e===null||Kt||(e=e.dependencies,e!==null&&tn(e)&&(Kt=!0))}function at(e,t,s,l){Ve=e;var n=0;do{if(Ie&&(h=null),d=0,Ie=!1,25<=n)throw Error(f(301));if(n+=1,Ct=gt=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}B.H=ef,i=t(s,l)}while(Ie);return i}function ca(){var e=B.H,t=e.useState()[0];return t=typeof t.then=="function"?ki(t):t,e=e.useState()[0],(gt!==null?gt.memoizedState:null)!==e&&(Ve.flags|=1024),t}function Wa(){var e=o!==0;return o=0,e}function cs(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Ad(e){if(ul){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ul=!1}Ss=0,Ct=gt=Ve=null,Ie=!1,d=o=0,h=null}function Ma(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?Ve.memoizedState=Ct=e:Ct=Ct.next=e,Ct}function Ft(){if(gt===null){var e=Ve.alternate;e=e!==null?e.memoizedState:null}else e=gt.next;var t=Ct===null?Ve.memoizedState:Ct.next;if(t!==null)Ct=t,gt=e;else{if(e===null)throw Ve.alternate===null?Error(f(467)):Error(f(310));gt=e,e={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},Ct===null?Ve.memoizedState=Ct=e:Ct=Ct.next=e}return Ct}function rc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ki(e){var t=d;return d+=1,h===null&&(h=[]),e=ec(h,e,t),t=Ve,(Ct===null?t.memoizedState:Ct.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?Ph:Zd),e}function nc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ki(e);if(e.$$typeof===R)return sa(e)}throw Error(f(438,String(e)))}function Yd(e){var t=null,s=Ve.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var l=Ve.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=rc(),Ve.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),l=0;l<e;l++)s[l]=ye;return t.index++,s}function hl(e,t){return typeof t=="function"?t(e):t}function ic(e){var t=Ft();return zd(t,gt,e)}function zd(e,t,s){var l=e.queue;if(l===null)throw Error(f(311));l.lastRenderedReducer=s;var n=e.baseQueue,i=l.pending;if(i!==null){if(n!==null){var u=n.next;n.next=i.next,i.next=u}t.baseQueue=n=i,l.pending=null}if(i=e.baseState,n===null)e.memoizedState=i;else{t=n.next;var p=u=null,C=null,J=t,re=!1;do{var ue=J.lane&-536870913;if(ue!==J.lane?(ct&ue)===ue:(Ss&ue)===ue){var P=J.revertLane;if(P===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),ue===nl&&(re=!0);else if((Ss&P)===P){J=J.next,P===nl&&(re=!0);continue}else ue={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},C===null?(p=C=ue,u=i):C=C.next=ue,Ve.lanes|=P,Xl|=P;ue=J.action,r&&s(i,ue),i=J.hasEagerState?J.eagerState:s(i,ue)}else P={lane:ue,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},C===null?(p=C=P,u=i):C=C.next=P,Ve.lanes|=ue,Xl|=ue;J=J.next}while(J!==null&&J!==t);if(C===null?u=i:C.next=p,!na(i,e.memoizedState)&&(Kt=!0,re&&(s=Gl,s!==null)))throw s;e.memoizedState=i,e.baseState=u,e.baseQueue=C,l.lastRenderedState=i}return n===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Rd(e){var t=Ft(),s=t.queue;if(s===null)throw Error(f(311));s.lastRenderedReducer=e;var l=s.dispatch,n=s.pending,i=t.memoizedState;if(n!==null){s.pending=null;var u=n=n.next;do i=e(i,u.action),u=u.next;while(u!==n);na(i,t.memoizedState)||(Kt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),s.lastRenderedState=i}return[i,l]}function bh(e,t,s){var l=Ve,n=Ft(),i=lt;if(i){if(s===void 0)throw Error(f(407));s=s()}else s=t();var u=!na((gt||n).memoizedState,s);if(u&&(n.memoizedState=s,Kt=!0),n=n.queue,qd(Nh.bind(null,l,n,e),[e]),n.getSnapshot!==t||u||Ct!==null&&Ct.memoizedState.tag&1){if(l.flags|=2048,dn(9,{destroy:void 0},jh.bind(null,l,n,s,t),null),Tt===null)throw Error(f(349));i||(Ss&127)!==0||vh(l,t,s)}return s}function vh(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Ve.updateQueue,t===null?(t=rc(),Ve.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function jh(e,t,s,l){t.value=s,t.getSnapshot=l,wh(t)&&kh(e)}function Nh(e,t,s){return s(function(){wh(t)&&kh(e)})}function wh(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!na(e,s)}catch{return!0}}function kh(e){var t=al(e,2);t!==null&&Va(t,e,2)}function Ud(e){var t=Ma();if(typeof e=="function"){var s=e;if(e=s(),r){Wt(!0);try{s()}finally{Wt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hl,lastRenderedState:e},t}function _h(e,t,s,l){return e.baseState=s,zd(e,gt,typeof l=="function"?l:hl)}function X0(e,t,s,l,n){if(dc(e))throw Error(f(485));if(e=t.action,e!==null){var i={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(u){i.listeners.push(u)}};B.T!==null?s(!0):i.isTransition=!1,l(i),s=t.pending,s===null?(i.next=t.pending=i,Sh(t,i)):(i.next=s.next,t.pending=s.next=i)}}function Sh(e,t){var s=t.action,l=t.payload,n=e.state;if(t.isTransition){var i=B.T,u={};B.T=u;try{var p=s(n,l),C=B.S;C!==null&&C(u,p),Dh(e,t,p)}catch(J){Hd(e,t,J)}finally{i!==null&&u.types!==null&&(i.types=u.types),B.T=i}}else try{i=s(n,l),Dh(e,t,i)}catch(J){Hd(e,t,J)}}function Dh(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){Mh(e,t,l)},function(l){return Hd(e,t,l)}):Mh(e,t,s)}function Mh(e,t,s){t.status="fulfilled",t.value=s,Ch(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Sh(e,s)))}function Hd(e,t,s){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=s,Ch(t),t=t.next;while(t!==l)}e.action=null}function Ch(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Th(e,t){return t}function Oh(e,t){if(lt){var s=Tt.formState;if(s!==null){e:{var l=Ve;if(lt){if(Mt){t:{for(var n=Mt,i=Ra;n.nodeType!==8;){if(!i){n=null;break t}if(n=ds(n.nextSibling),n===null){n=null;break t}}i=n.data,n=i==="F!"||i==="F"?n:null}if(n){Mt=ds(n.nextSibling),l=n.data==="F!";break e}}qs(l)}l=!1}l&&(t=s[0])}}return s=Ma(),s.memoizedState=s.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Th,lastRenderedState:t},s.queue=l,s=Jh.bind(null,Ve,l),l.dispatch=s,l=Ud(!1),i=Qd.bind(null,Ve,!1,l.queue),l=Ma(),n={state:t,dispatch:null,action:e,pending:null},l.queue=n,s=X0.bind(null,Ve,n,i,s),n.dispatch=s,l.memoizedState=e,[t,s,!1]}function Eh(e){var t=Ft();return Lh(t,gt,e)}function Lh(e,t,s){if(t=zd(e,t,Th)[0],e=ic(hl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=ki(t)}catch(u){throw u===ol?ln:u}else l=t;t=Ft();var n=t.queue,i=n.dispatch;return s!==t.memoizedState&&(Ve.flags|=2048,dn(9,{destroy:void 0},F0.bind(null,n,s),null)),[l,i,e]}function F0(e,t){e.action=t}function Ah(e){var t=Ft(),s=gt;if(s!==null)return Lh(t,s,e);Ft(),t=t.memoizedState,s=Ft();var l=s.queue.dispatch;return s.memoizedState=e,[t,l,!1]}function dn(e,t,s,l){return e={tag:e,create:s,deps:l,inst:t,next:null},t=Ve.updateQueue,t===null&&(t=rc(),Ve.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(l=s.next,s.next=e,e.next=l,t.lastEffect=e),e}function Yh(){return Ft().memoizedState}function oc(e,t,s,l){var n=Ma();Ve.flags|=e,n.memoizedState=dn(1|t,{destroy:void 0},s,l===void 0?null:l)}function cc(e,t,s,l){var n=Ft();l=l===void 0?null:l;var i=n.memoizedState.inst;gt!==null&&l!==null&&se(l,gt.memoizedState.deps)?n.memoizedState=dn(t,i,s,l):(Ve.flags|=e,n.memoizedState=dn(1|t,i,s,l))}function zh(e,t){oc(8390656,8,e,t)}function qd(e,t){cc(2048,8,e,t)}function W0(e){Ve.flags|=4;var t=Ve.updateQueue;if(t===null)t=rc(),Ve.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Rh(e){var t=Ft().memoizedState;return W0({ref:t,nextImpl:e}),function(){if((vt&2)!==0)throw Error(f(440));return t.impl.apply(void 0,arguments)}}function Uh(e,t){return cc(4,2,e,t)}function Hh(e,t){return cc(4,4,e,t)}function qh(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Bh(e,t,s){s=s!=null?s.concat([e]):null,cc(4,4,qh.bind(null,t,e),s)}function Bd(){}function $h(e,t){var s=Ft();t=t===void 0?null:t;var l=s.memoizedState;return t!==null&&se(t,l[1])?l[0]:(s.memoizedState=[e,t],e)}function Gh(e,t){var s=Ft();t=t===void 0?null:t;var l=s.memoizedState;if(t!==null&&se(t,l[1]))return l[0];if(l=e(),r){Wt(!0);try{e()}finally{Wt(!1)}}return s.memoizedState=[l,t],l}function $d(e,t,s){return s===void 0||(Ss&1073741824)!==0&&(ct&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Qf(),Ve.lanes|=e,Xl|=e,s)}function Vh(e,t,s,l){return na(s,t)?s:Ua.current!==null?(e=$d(e,s,l),na(e,t)||(Kt=!0),e):(Ss&42)===0||(Ss&1073741824)!==0&&(ct&261930)===0?(Kt=!0,e.memoizedState=s):(e=Qf(),Ve.lanes|=e,Xl|=e,t)}function Qh(e,t,s,l,n){var i=oe.p;oe.p=i!==0&&8>i?i:8;var u=B.T,p={};B.T=p,Qd(e,!1,t,s);try{var C=n(),J=B.S;if(J!==null&&J(p,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var re=ve(C,l);_i(e,t,re,Ia(e))}else _i(e,t,l,Ia(e))}catch(ue){_i(e,t,{then:function(){},status:"rejected",reason:ue},Ia())}finally{oe.p=i,u!==null&&p.types!==null&&(u.types=p.types),B.T=u}}function J0(){}function Gd(e,t,s,l){if(e.tag!==5)throw Error(f(476));var n=Zh(e).queue;Qh(e,n,t,Ne,s===null?J0:function(){return Xh(e),s(l)})}function Zh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ne,baseState:Ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hl,lastRenderedState:Ne},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hl,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Xh(e){var t=Zh(e);t.next===null&&(t=e.alternate.memoizedState),_i(e,t.next.queue,{},Ia())}function Vd(){return sa($i)}function Fh(){return Ft().memoizedState}function Wh(){return Ft().memoizedState}function K0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Ia();e=$s(s);var l=Gs(t,e,s);l!==null&&(Va(l,t,s),Dr(l,t,s)),t={cache:gi()},e.payload=t;return}t=t.return}}function I0(e,t,s){var l=Ia();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},dc(e)?Kh(t,s):(s=ri(e,t,s,l),s!==null&&(Va(s,e,l),Ih(s,t,l)))}function Jh(e,t,s){var l=Ia();_i(e,t,s,l)}function _i(e,t,s,l){var n={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(dc(e))Kh(t,n);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var u=t.lastRenderedState,p=i(u,s);if(n.hasEagerState=!0,n.eagerState=p,na(p,u))return Kr(e,t,n,0),Tt===null&&Jr(),!1}catch{}finally{}if(s=ri(e,t,n,l),s!==null)return Va(s,e,l),Ih(s,t,l),!0}return!1}function Qd(e,t,s,l){if(l={lane:2,revertLane:wu(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},dc(e)){if(t)throw Error(f(479))}else t=ri(e,s,l,2),t!==null&&Va(t,e,2)}function dc(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function Kh(e,t){Ie=ul=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Ih(e,t,s){if((s&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,ht(e,s)}}var Si={readContext:sa,use:nc,useCallback:D,useContext:D,useEffect:D,useImperativeHandle:D,useLayoutEffect:D,useInsertionEffect:D,useMemo:D,useReducer:D,useRef:D,useState:D,useDebugValue:D,useDeferredValue:D,useTransition:D,useSyncExternalStore:D,useId:D,useHostTransitionStatus:D,useFormState:D,useActionState:D,useOptimistic:D,useMemoCache:D,useCacheRefresh:D};Si.useEffectEvent=D;var Ph={readContext:sa,use:nc,useCallback:function(e,t){return Ma().memoizedState=[e,t===void 0?null:t],e},useContext:sa,useEffect:zh,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,oc(4194308,4,qh.bind(null,t,e),s)},useLayoutEffect:function(e,t){return oc(4194308,4,e,t)},useInsertionEffect:function(e,t){oc(4,2,e,t)},useMemo:function(e,t){var s=Ma();t=t===void 0?null:t;var l=e();if(r){Wt(!0);try{e()}finally{Wt(!1)}}return s.memoizedState=[l,t],l},useReducer:function(e,t,s){var l=Ma();if(s!==void 0){var n=s(t);if(r){Wt(!0);try{s(t)}finally{Wt(!1)}}}else n=t;return l.memoizedState=l.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=I0.bind(null,Ve,e),[l.memoizedState,e]},useRef:function(e){var t=Ma();return e={current:e},t.memoizedState=e},useState:function(e){e=Ud(e);var t=e.queue,s=Jh.bind(null,Ve,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Bd,useDeferredValue:function(e,t){var s=Ma();return $d(s,e,t)},useTransition:function(){var e=Ud(!1);return e=Qh.bind(null,Ve,e.queue,!0,!1),Ma().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var l=Ve,n=Ma();if(lt){if(s===void 0)throw Error(f(407));s=s()}else{if(s=t(),Tt===null)throw Error(f(349));(ct&127)!==0||vh(l,t,s)}n.memoizedState=s;var i={value:s,getSnapshot:t};return n.queue=i,zh(Nh.bind(null,l,i,e),[e]),l.flags|=2048,dn(9,{destroy:void 0},jh.bind(null,l,i,s,t),null),s},useId:function(){var e=Ma(),t=Tt.identifierPrefix;if(lt){var s=rs,l=ls;s=(l&~(1<<32-kt(l)-1)).toString(32)+s,t="_"+t+"R_"+s,s=o++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=x++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Vd,useFormState:Oh,useActionState:Oh,useOptimistic:function(e){var t=Ma();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Qd.bind(null,Ve,!0,s),s.dispatch=t,[e,t]},useMemoCache:Yd,useCacheRefresh:function(){return Ma().memoizedState=K0.bind(null,Ve)},useEffectEvent:function(e){var t=Ma(),s={impl:e};return t.memoizedState=s,function(){if((vt&2)!==0)throw Error(f(440));return s.impl.apply(void 0,arguments)}}},Zd={readContext:sa,use:nc,useCallback:$h,useContext:sa,useEffect:qd,useImperativeHandle:Bh,useInsertionEffect:Uh,useLayoutEffect:Hh,useMemo:Gh,useReducer:ic,useRef:Yh,useState:function(){return ic(hl)},useDebugValue:Bd,useDeferredValue:function(e,t){var s=Ft();return Vh(s,gt.memoizedState,e,t)},useTransition:function(){var e=ic(hl)[0],t=Ft().memoizedState;return[typeof e=="boolean"?e:ki(e),t]},useSyncExternalStore:bh,useId:Fh,useHostTransitionStatus:Vd,useFormState:Eh,useActionState:Eh,useOptimistic:function(e,t){var s=Ft();return _h(s,gt,e,t)},useMemoCache:Yd,useCacheRefresh:Wh};Zd.useEffectEvent=Rh;var ef={readContext:sa,use:nc,useCallback:$h,useContext:sa,useEffect:qd,useImperativeHandle:Bh,useInsertionEffect:Uh,useLayoutEffect:Hh,useMemo:Gh,useReducer:Rd,useRef:Yh,useState:function(){return Rd(hl)},useDebugValue:Bd,useDeferredValue:function(e,t){var s=Ft();return gt===null?$d(s,e,t):Vh(s,gt.memoizedState,e,t)},useTransition:function(){var e=Rd(hl)[0],t=Ft().memoizedState;return[typeof e=="boolean"?e:ki(e),t]},useSyncExternalStore:bh,useId:Fh,useHostTransitionStatus:Vd,useFormState:Ah,useActionState:Ah,useOptimistic:function(e,t){var s=Ft();return gt!==null?_h(s,gt,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Yd,useCacheRefresh:Wh};ef.useEffectEvent=Rh;function Xd(e,t,s,l){t=e.memoizedState,s=s(l,t),s=s==null?t:O({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Fd={enqueueSetState:function(e,t,s){e=e._reactInternals;var l=Ia(),n=$s(l);n.payload=t,s!=null&&(n.callback=s),t=Gs(e,n,l),t!==null&&(Va(t,e,l),Dr(t,e,l))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var l=Ia(),n=$s(l);n.tag=1,n.payload=t,s!=null&&(n.callback=s),t=Gs(e,n,l),t!==null&&(Va(t,e,l),Dr(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Ia(),l=$s(s);l.tag=2,t!=null&&(l.callback=t),t=Gs(e,l,s),t!==null&&(Va(t,e,s),Dr(t,e,s))}};function tf(e,t,s,l,n,i,u){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,i,u):t.prototype&&t.prototype.isPureReactComponent?!el(s,l)||!el(n,i):!0}function af(e,t,s,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,l),t.state!==e&&Fd.enqueueReplaceState(t,t.state,null)}function Tr(e,t){var s=t;if("ref"in t){s={};for(var l in t)l!=="ref"&&(s[l]=t[l])}if(e=e.defaultProps){s===t&&(s=O({},s));for(var n in e)s[n]===void 0&&(s[n]=e[n])}return s}function sf(e){Wr(e)}function lf(e){console.error(e)}function rf(e){Wr(e)}function uc(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function nf(e,t,s){try{var l=e.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function Wd(e,t,s){return s=$s(s),s.tag=3,s.payload={element:null},s.callback=function(){uc(e,t)},s}function of(e){return e=$s(e),e.tag=3,e}function cf(e,t,s,l){var n=s.type.getDerivedStateFromError;if(typeof n=="function"){var i=l.value;e.payload=function(){return n(i)},e.callback=function(){nf(t,s,l)}}var u=s.stateNode;u!==null&&typeof u.componentDidCatch=="function"&&(e.callback=function(){nf(t,s,l),typeof n!="function"&&(Fl===null?Fl=new Set([this]):Fl.add(this));var p=l.stack;this.componentDidCatch(l.value,{componentStack:p!==null?p:""})})}function P0(e,t,s,l,n){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=s.alternate,t!==null&&$l(t,s,n,!0),s=_a.current,s!==null){switch(s.tag){case 31:case 13:return Ha===null?wc():s.alternate===null&&Qt===0&&(Qt=3),s.flags&=-257,s.flags|=65536,s.lanes=n,l===rn?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([l]):t.add(l),vu(e,l,n)),!1;case 22:return s.flags|=65536,l===rn?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([l]):s.add(l)),vu(e,l,n)),!1}throw Error(f(435,s.tag))}return vu(e,l,n),wc(),!1}if(lt)return t=_a.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,l!==hi&&(e=Error(f(422),{cause:l}),pr(ia(e,s)))):(l!==hi&&(t=Error(f(423),{cause:l}),pr(ia(t,s))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,l=ia(l,s),n=Wd(e.stateNode,l,n),bi(e,n),Qt!==4&&(Qt=2)),!1;var i=Error(f(520),{cause:l});if(i=ia(i,s),Ai===null?Ai=[i]:Ai.push(i),Qt!==4&&(Qt=2),t===null)return!0;l=ia(l,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=n&-n,s.lanes|=e,e=Wd(s.stateNode,l,e),bi(s,e),!1;case 1:if(t=s.type,i=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Fl===null||!Fl.has(i))))return s.flags|=65536,n&=-n,s.lanes|=n,n=of(n),cf(n,e,s,l),bi(s,n),!1}s=s.return}while(s!==null);return!1}var Jd=Error(f(461)),Kt=!1;function da(e,t,s,l){t.child=e===null?is(t,null,s,l):dl(t,e.child,s,l)}function df(e,t,s,l,n){s=s.render;var i=t.ref;if("ref"in l){var u={};for(var p in l)p!=="ref"&&(u[p]=l[p])}else u=l;return rl(t),l=Me(e,t,s,u,i,n),p=Wa(),e!==null&&!Kt?(cs(e,t,n),fl(e,t,n)):(lt&&p&&di(t),t.flags|=1,da(e,t,l,n),t.child)}function uf(e,t,s,l,n){if(e===null){var i=s.type;return typeof i=="function"&&!ni(i)&&i.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=i,hf(e,t,i,l,n)):(e=Pr(s.type,null,l,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!lu(e,n)){var u=i.memoizedProps;if(s=s.compare,s=s!==null?s:el,s(u,l)&&e.ref===t.ref)return fl(e,t,n)}return t.flags|=1,e=bs(i,l),e.ref=t.ref,e.return=t,t.child=e}function hf(e,t,s,l,n){if(e!==null){var i=e.memoizedProps;if(el(i,l)&&e.ref===t.ref)if(Kt=!1,t.pendingProps=l=i,lu(e,n))(e.flags&131072)!==0&&(Kt=!0);else return t.lanes=e.lanes,fl(e,t,n)}return Kd(e,t,s,l,n)}function ff(e,t,s,l){var n=l.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|s:s,e!==null){for(l=t.child=e.child,n=0;l!==null;)n=n|l.lanes|l.childLanes,l=l.sibling;l=n&~i}else l=0,t.child=null;return mf(e,t,i,s,l)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&rt(t,i!==null?i.cachePool:null),i!==null?lc(t,i):ji(),os(t);else return l=t.lanes=536870912,mf(e,t,i!==null?i.baseLanes|s:s,s,l)}else i!==null?(rt(t,i.cachePool),lc(t,i),Sa(),t.memoizedState=null):(e!==null&&rt(t,null),ji(),Sa());return da(e,t,n,s),t.child}function Di(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function mf(e,t,s,l,n){var i=sn();return i=i===null?null:{parent:qt._currentValue,pool:i},t.memoizedState={baseLanes:s,cachePool:i},e!==null&&rt(t,null),ji(),os(t),e!==null&&$l(e,t,l,!0),t.childLanes=n,null}function hc(e,t){return t=mc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function gf(e,t,s){return dl(t,e.child,null,s),e=hc(t,t.pendingProps),e.flags|=2,Da(t),t.memoizedState=null,e}function eg(e,t,s){var l=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(lt){if(l.mode==="hidden")return e=hc(t,l),t.lanes=536870912,Di(null,e);if(wi(t),(e=Mt)?(e=Dm(e,Ra),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Us!==null?{id:ls,overflow:rs}:null,retryLane:536870912,hydrationErrors:null},s=oi(e),s.return=t,t.child=s,aa=t,Mt=null)):e=null,e===null)throw qs(t);return t.lanes=536870912,null}return hc(t,l)}var i=e.memoizedState;if(i!==null){var u=i.dehydrated;if(wi(t),n)if(t.flags&256)t.flags&=-257,t=gf(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(f(558));else if(Kt||$l(e,t,s,!1),n=(s&e.childLanes)!==0,Kt||n){if(l=Tt,l!==null&&(u=Ea(l,s),u!==0&&u!==i.retryLane))throw i.retryLane=u,al(e,u),Va(l,e,u),Jd;wc(),t=gf(e,t,s)}else e=i.treeContext,Mt=ds(u.nextSibling),aa=t,lt=!0,Hs=null,Ra=!1,e!==null&&Zo(t,e),t=hc(t,l),t.flags|=4096;return t}return e=bs(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(f(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Kd(e,t,s,l,n){return rl(t),s=Me(e,t,s,l,void 0,n),l=Wa(),e!==null&&!Kt?(cs(e,t,n),fl(e,t,n)):(lt&&l&&di(t),t.flags|=1,da(e,t,s,n),t.child)}function xf(e,t,s,l,n,i){return rl(t),t.updateQueue=null,s=at(t,l,s,n),qe(e),l=Wa(),e!==null&&!Kt?(cs(e,t,i),fl(e,t,i)):(lt&&l&&di(t),t.flags|=1,da(e,t,s,i),t.child)}function pf(e,t,s,l,n){if(rl(t),t.stateNode===null){var i=ys,u=s.contextType;typeof u=="object"&&u!==null&&(i=sa(u)),i=new s(l,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Fd,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=l,i.state=t.memoizedState,i.refs={},pi(t),u=s.contextType,i.context=typeof u=="object"&&u!==null?sa(u):ys,i.state=t.memoizedState,u=s.getDerivedStateFromProps,typeof u=="function"&&(Xd(t,s,u,l),i.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(u=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),u!==i.state&&Fd.enqueueReplaceState(i,i.state,null),Cr(t,l,i,n),Mr(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){i=t.stateNode;var p=t.memoizedProps,C=Tr(s,p);i.props=C;var J=i.context,re=s.contextType;u=ys,typeof re=="object"&&re!==null&&(u=sa(re));var ue=s.getDerivedStateFromProps;re=typeof ue=="function"||typeof i.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,re||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(p||J!==u)&&af(t,i,l,u),_s=!1;var P=t.memoizedState;i.state=P,Cr(t,l,i,n),Mr(),J=t.memoizedState,p||P!==J||_s?(typeof ue=="function"&&(Xd(t,s,ue,l),J=t.memoizedState),(C=_s||tf(t,s,C,l,P,J,u))?(re||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=J),i.props=l,i.state=J,i.context=u,l=C):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{i=t.stateNode,yi(e,t),u=t.memoizedProps,re=Tr(s,u),i.props=re,ue=t.pendingProps,P=i.context,J=s.contextType,C=ys,typeof J=="object"&&J!==null&&(C=sa(J)),p=s.getDerivedStateFromProps,(J=typeof p=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(u!==ue||P!==C)&&af(t,i,l,C),_s=!1,P=t.memoizedState,i.state=P,Cr(t,l,i,n),Mr();var te=t.memoizedState;u!==ue||P!==te||_s||e!==null&&e.dependencies!==null&&tn(e.dependencies)?(typeof p=="function"&&(Xd(t,s,p,l),te=t.memoizedState),(re=_s||tf(t,s,re,l,P,te,C)||e!==null&&e.dependencies!==null&&tn(e.dependencies))?(J||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(l,te,C),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(l,te,C)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||u===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=te),i.props=l,i.state=te,i.context=C,l=re):(typeof i.componentDidUpdate!="function"||u===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),l=!1)}return i=l,fc(e,t),l=(t.flags&128)!==0,i||l?(i=t.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&l?(t.child=dl(t,e.child,null,n),t.child=dl(t,null,s,n)):da(e,t,s,n),t.memoizedState=i.state,e=t.child):e=fl(e,t,n),e}function yf(e,t,s,l){return ll(),t.flags|=256,da(e,t,s,l),t.child}var Id={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Pd(e){return{baseLanes:e,cachePool:jr()}}function eu(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=Ka),e}function bf(e,t,s){var l=t.pendingProps,n=!1,i=(t.flags&128)!==0,u;if((u=i)||(u=e!==null&&e.memoizedState===null?!1:(Bt.current&2)!==0),u&&(n=!0,t.flags&=-129),u=(t.flags&32)!==0,t.flags&=-33,e===null){if(lt){if(n?Vs(t):Sa(),(e=Mt)?(e=Dm(e,Ra),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Us!==null?{id:ls,overflow:rs}:null,retryLane:536870912,hydrationErrors:null},s=oi(e),s.return=t,t.child=s,aa=t,Mt=null)):e=null,e===null)throw qs(t);return zu(e)?t.lanes=32:t.lanes=536870912,null}var p=l.children;return l=l.fallback,n?(Sa(),n=t.mode,p=mc({mode:"hidden",children:p},n),l=sl(l,n,s,null),p.return=t,l.return=t,p.sibling=l,t.child=p,l=t.child,l.memoizedState=Pd(s),l.childLanes=eu(e,u,s),t.memoizedState=Id,Di(null,l)):(Vs(t),tu(t,p))}var C=e.memoizedState;if(C!==null&&(p=C.dehydrated,p!==null)){if(i)t.flags&256?(Vs(t),t.flags&=-257,t=au(e,t,s)):t.memoizedState!==null?(Sa(),t.child=e.child,t.flags|=128,t=null):(Sa(),p=l.fallback,n=t.mode,l=mc({mode:"visible",children:l.children},n),p=sl(p,n,s,null),p.flags|=2,l.return=t,p.return=t,l.sibling=p,t.child=l,dl(t,e.child,null,s),l=t.child,l.memoizedState=Pd(s),l.childLanes=eu(e,u,s),t.memoizedState=Id,t=Di(null,l));else if(Vs(t),zu(p)){if(u=p.nextSibling&&p.nextSibling.dataset,u)var J=u.dgst;u=J,l=Error(f(419)),l.stack="",l.digest=u,pr({value:l,source:null,stack:null}),t=au(e,t,s)}else if(Kt||$l(e,t,s,!1),u=(s&e.childLanes)!==0,Kt||u){if(u=Tt,u!==null&&(l=Ea(u,s),l!==0&&l!==C.retryLane))throw C.retryLane=l,al(e,l),Va(u,e,l),Jd;Yu(p)||wc(),t=au(e,t,s)}else Yu(p)?(t.flags|=192,t.child=e.child,t=null):(e=C.treeContext,Mt=ds(p.nextSibling),aa=t,lt=!0,Hs=null,Ra=!1,e!==null&&Zo(t,e),t=tu(t,l.children),t.flags|=4096);return t}return n?(Sa(),p=l.fallback,n=t.mode,C=e.child,J=C.sibling,l=bs(C,{mode:"hidden",children:l.children}),l.subtreeFlags=C.subtreeFlags&65011712,J!==null?p=bs(J,p):(p=sl(p,n,s,null),p.flags|=2),p.return=t,l.return=t,l.sibling=p,t.child=l,Di(null,l),l=t.child,p=e.child.memoizedState,p===null?p=Pd(s):(n=p.cachePool,n!==null?(C=qt._currentValue,n=n.parent!==C?{parent:C,pool:C}:n):n=jr(),p={baseLanes:p.baseLanes|s,cachePool:n}),l.memoizedState=p,l.childLanes=eu(e,u,s),t.memoizedState=Id,Di(e.child,l)):(Vs(t),s=e.child,e=s.sibling,s=bs(s,{mode:"visible",children:l.children}),s.return=t,s.sibling=null,e!==null&&(u=t.deletions,u===null?(t.deletions=[e],t.flags|=16):u.push(e)),t.child=s,t.memoizedState=null,s)}function tu(e,t){return t=mc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function mc(e,t){return e=Na(22,e,null,t),e.lanes=0,e}function au(e,t,s){return dl(t,e.child,null,s),e=tu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vf(e,t,s){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),yr(e.return,t,s)}function su(e,t,s,l,n,i){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:n,treeForkCount:i}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=l,u.tail=s,u.tailMode=n,u.treeForkCount=i)}function jf(e,t,s){var l=t.pendingProps,n=l.revealOrder,i=l.tail;l=l.children;var u=Bt.current,p=(u&2)!==0;if(p?(u=u&1|2,t.flags|=128):u&=1,K(Bt,u),da(e,t,l,s),l=lt?ss:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vf(e,s,t);else if(e.tag===19)vf(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(n){case"forwards":for(s=t.child,n=null;s!==null;)e=s.alternate,e!==null&&cn(e)===null&&(n=s),s=s.sibling;s=n,s===null?(n=t.child,t.child=null):(n=s.sibling,s.sibling=null),su(t,!1,n,s,i,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&cn(e)===null){t.child=n;break}e=n.sibling,n.sibling=s,s=n,n=e}su(t,!0,s,null,i,l);break;case"together":su(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function fl(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Xl|=t.lanes,(s&t.childLanes)===0)if(e!==null){if($l(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(f(153));if(t.child!==null){for(e=t.child,s=bs(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=bs(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function lu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&tn(e)))}function tg(e,t,s){switch(t.tag){case 3:Be(t,t.stateNode.containerInfo),Bs(t,qt,e.memoizedState.cache),ll();break;case 27:case 5:A(t);break;case 4:Be(t,t.stateNode.containerInfo);break;case 10:Bs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,wi(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Vs(t),t.flags|=128,null):(s&t.child.childLanes)!==0?bf(e,t,s):(Vs(t),e=fl(e,t,s),e!==null?e.sibling:null);Vs(t);break;case 19:var n=(e.flags&128)!==0;if(l=(s&t.childLanes)!==0,l||($l(e,t,s,!1),l=(s&t.childLanes)!==0),n){if(l)return jf(e,t,s);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),K(Bt,Bt.current),l)break;return null;case 22:return t.lanes=0,ff(e,t,s,t.pendingProps);case 24:Bs(t,qt,e.memoizedState.cache)}return fl(e,t,s)}function Nf(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)Kt=!0;else{if(!lu(e,s)&&(t.flags&128)===0)return Kt=!1,tg(e,t,s);Kt=(e.flags&131072)!==0}else Kt=!1,lt&&(t.flags&1048576)!==0&&Qo(t,ss,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=cl(t.elementType),t.type=e,typeof e=="function")ni(e)?(l=Tr(e,l),t.tag=1,t=pf(null,t,e,l,s)):(t.tag=0,t=Kd(null,t,e,l,s));else{if(e!=null){var n=e.$$typeof;if(n===U){t.tag=11,t=df(null,t,e,l,s);break e}else if(n===z){t.tag=14,t=uf(null,t,e,l,s);break e}}throw t=be(e)||e,Error(f(306,t,""))}}return t;case 0:return Kd(e,t,t.type,t.pendingProps,s);case 1:return l=t.type,n=Tr(l,t.pendingProps),pf(e,t,l,n,s);case 3:e:{if(Be(t,t.stateNode.containerInfo),e===null)throw Error(f(387));l=t.pendingProps;var i=t.memoizedState;n=i.element,yi(e,t),Cr(t,l,null,s);var u=t.memoizedState;if(l=u.cache,Bs(t,qt,l),l!==i.cache&&Bl(t,[qt],s,!0),Mr(),l=u.element,i.isDehydrated)if(i={element:l,isDehydrated:!1,cache:u.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=yf(e,t,l,s);break e}else if(l!==n){n=ia(Error(f(424)),t),pr(n),t=yf(e,t,l,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Mt=ds(e.firstChild),aa=t,lt=!0,Hs=null,Ra=!0,s=is(t,null,l,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ll(),l===n){t=fl(e,t,s);break e}da(e,t,l,s)}t=t.child}return t;case 26:return fc(e,t),e===null?(s=Lm(t.type,null,t.pendingProps,null))?t.memoizedState=s:lt||(s=t.type,e=t.pendingProps,l=Tc(Te.current).createElement(s),l[Xe]=t,l[Et]=e,ua(l,s,e),Jt(l),t.stateNode=l):t.memoizedState=Lm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return A(t),e===null&&lt&&(l=t.stateNode=Tm(t.type,t.pendingProps,Te.current),aa=t,Ra=!0,n=Mt,Il(t.type)?(Ru=n,Mt=ds(l.firstChild)):Mt=n),da(e,t,t.pendingProps.children,s),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&lt&&((n=l=Mt)&&(l=Og(l,t.type,t.pendingProps,Ra),l!==null?(t.stateNode=l,aa=t,Mt=ds(l.firstChild),Ra=!1,n=!0):n=!1),n||qs(t)),A(t),n=t.type,i=t.pendingProps,u=e!==null?e.memoizedProps:null,l=i.children,Eu(n,i)?l=null:u!==null&&Eu(n,u)&&(t.flags|=32),t.memoizedState!==null&&(n=Me(e,t,ca,null,null,s),$i._currentValue=n),fc(e,t),da(e,t,l,s),t.child;case 6:return e===null&&lt&&((e=s=Mt)&&(s=Eg(s,t.pendingProps,Ra),s!==null?(t.stateNode=s,aa=t,Mt=null,e=!0):e=!1),e||qs(t)),null;case 13:return bf(e,t,s);case 4:return Be(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=dl(t,null,l,s):da(e,t,l,s),t.child;case 11:return df(e,t,t.type,t.pendingProps,s);case 7:return da(e,t,t.pendingProps,s),t.child;case 8:return da(e,t,t.pendingProps.children,s),t.child;case 12:return da(e,t,t.pendingProps.children,s),t.child;case 10:return l=t.pendingProps,Bs(t,t.type,l.value),da(e,t,l.children,s),t.child;case 9:return n=t.type._context,l=t.pendingProps.children,rl(t),n=sa(n),l=l(n),t.flags|=1,da(e,t,l,s),t.child;case 14:return uf(e,t,t.type,t.pendingProps,s);case 15:return hf(e,t,t.type,t.pendingProps,s);case 19:return jf(e,t,s);case 31:return eg(e,t,s);case 22:return ff(e,t,s,t.pendingProps);case 24:return rl(t),l=sa(qt),e===null?(n=sn(),n===null&&(n=Tt,i=gi(),n.pooledCache=i,i.refCount++,i!==null&&(n.pooledCacheLanes|=s),n=i),t.memoizedState={parent:l,cache:n},pi(t),Bs(t,qt,n)):((e.lanes&s)!==0&&(yi(e,t),Cr(t,null,null,s),Mr()),n=e.memoizedState,i=t.memoizedState,n.parent!==l?(n={parent:l,cache:l},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),Bs(t,qt,l)):(l=i.cache,Bs(t,qt,l),l!==n.cache&&Bl(t,[qt],s,!0))),da(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(f(156,t.tag))}function ml(e){e.flags|=4}function ru(e,t,s,l,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(Wf())e.flags|=8192;else throw oa=rn,Nr}else e.flags&=-16777217}function wf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Um(t))if(Wf())e.flags|=8192;else throw oa=rn,Nr}function gc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?lr():536870912,e.lanes|=t,mn|=t)}function Mi(e,t){if(!lt)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function zt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,l=0;if(t)for(var n=e.child;n!==null;)s|=n.lanes|n.childLanes,l|=n.subtreeFlags&65011712,l|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)s|=n.lanes|n.childLanes,l|=n.subtreeFlags,l|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=l,e.childLanes=s,t}function ag(e,t,s){var l=t.pendingProps;switch(ui(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(t),null;case 1:return zt(t),null;case 3:return s=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ks(qt),k(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ql(t)?ml(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,fi())),zt(t),null;case 26:var n=t.type,i=t.memoizedState;return e===null?(ml(t),i!==null?(zt(t),wf(t,i)):(zt(t),ru(t,n,null,l,s))):i?i!==e.memoizedState?(ml(t),zt(t),wf(t,i)):(zt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&ml(t),zt(t),ru(t,n,e,l,s)),null;case 27:if(ae(t),s=Te.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ml(t);else{if(!l){if(t.stateNode===null)throw Error(f(166));return zt(t),null}e=xe.current,ql(t)?Xo(t):(e=Tm(n,l,s),t.stateNode=e,ml(t))}return zt(t),null;case 5:if(ae(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ml(t);else{if(!l){if(t.stateNode===null)throw Error(f(166));return zt(t),null}if(i=xe.current,ql(t))Xo(t);else{var u=Tc(Te.current);switch(i){case 1:i=u.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:i=u.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":i=u.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":i=u.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":i=u.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof l.is=="string"?u.createElement("select",{is:l.is}):u.createElement("select"),l.multiple?i.multiple=!0:l.size&&(i.size=l.size);break;default:i=typeof l.is=="string"?u.createElement(n,{is:l.is}):u.createElement(n)}}i[Xe]=t,i[Et]=l;e:for(u=t.child;u!==null;){if(u.tag===5||u.tag===6)i.appendChild(u.stateNode);else if(u.tag!==4&&u.tag!==27&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===t)break e;for(;u.sibling===null;){if(u.return===null||u.return===t)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}t.stateNode=i;e:switch(ua(i,n,l),n){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&ml(t)}}return zt(t),ru(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&ml(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(f(166));if(e=Te.current,ql(t)){if(e=t.stateNode,s=t.memoizedProps,l=null,n=aa,n!==null)switch(n.tag){case 27:case 5:l=n.memoizedProps}e[Xe]=t,e=!!(e.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||bm(e.nodeValue,s)),e||qs(t,!0)}else e=Tc(e).createTextNode(l),e[Xe]=t,t.stateNode=e}return zt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(l=ql(t),s!==null){if(e===null){if(!l)throw Error(f(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(557));e[Xe]=t}else ll(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zt(t),e=!1}else s=fi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(Da(t),t):(Da(t),null);if((t.flags&128)!==0)throw Error(f(558))}return zt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=ql(t),l!==null&&l.dehydrated!==null){if(e===null){if(!n)throw Error(f(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(f(317));n[Xe]=t}else ll(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zt(t),n=!1}else n=fi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(Da(t),t):(Da(t),null)}return Da(t),(t.flags&128)!==0?(t.lanes=s,t):(s=l!==null,e=e!==null&&e.memoizedState!==null,s&&(l=t.child,n=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(n=l.alternate.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==n&&(l.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),gc(t,t.updateQueue),zt(t),null);case 4:return k(),e===null&&Du(t.stateNode.containerInfo),zt(t),null;case 10:return ks(t.type),zt(t),null;case 19:if(q(Bt),l=t.memoizedState,l===null)return zt(t),null;if(n=(t.flags&128)!==0,i=l.rendering,i===null)if(n)Mi(l,!1);else{if(Qt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=cn(e),i!==null){for(t.flags|=128,Mi(l,!1),e=i.updateQueue,t.updateQueue=e,gc(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Vo(s,e),s=s.sibling;return K(Bt,Bt.current&1|2),lt&&js(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&le()>vc&&(t.flags|=128,n=!0,Mi(l,!1),t.lanes=4194304)}else{if(!n)if(e=cn(i),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,gc(t,e),Mi(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!lt)return zt(t),null}else 2*le()-l.renderingStartTime>vc&&s!==536870912&&(t.flags|=128,n=!0,Mi(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(e=l.last,e!==null?e.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=le(),e.sibling=null,s=Bt.current,K(Bt,n?s&1|2:s&1),lt&&js(t,l.treeForkCount),e):(zt(t),null);case 22:case 23:return Da(t),Ni(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(s&536870912)!==0&&(t.flags&128)===0&&(zt(t),t.subtreeFlags&6&&(t.flags|=8192)):zt(t),s=t.updateQueue,s!==null&&gc(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==s&&(t.flags|=2048),e!==null&&q(il),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ks(qt),zt(t),null;case 25:return null;case 30:return null}throw Error(f(156,t.tag))}function sg(e,t){switch(ui(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ks(qt),k(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ae(t),null;case 31:if(t.memoizedState!==null){if(Da(t),t.alternate===null)throw Error(f(340));ll()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Da(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(f(340));ll()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(Bt),null;case 4:return k(),null;case 10:return ks(t.type),null;case 22:case 23:return Da(t),Ni(),e!==null&&q(il),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ks(qt),null;case 25:return null;default:return null}}function kf(e,t){switch(ui(t),t.tag){case 3:ks(qt),k();break;case 26:case 27:case 5:ae(t);break;case 4:k();break;case 31:t.memoizedState!==null&&Da(t);break;case 13:Da(t);break;case 19:q(Bt);break;case 10:ks(t.type);break;case 22:case 23:Da(t),Ni(),e!==null&&q(il);break;case 24:ks(qt)}}function Ci(e,t){try{var s=t.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var n=l.next;s=n;do{if((s.tag&e)===e){l=void 0;var i=s.create,u=s.inst;l=i(),u.destroy=l}s=s.next}while(s!==n)}}catch(p){wt(t,t.return,p)}}function Ql(e,t,s){try{var l=t.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var i=n.next;l=i;do{if((l.tag&e)===e){var u=l.inst,p=u.destroy;if(p!==void 0){u.destroy=void 0,n=t;var C=s,J=p;try{J()}catch(re){wt(n,C,re)}}}l=l.next}while(l!==i)}}catch(re){wt(t,t.return,re)}}function _f(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{sc(t,s)}catch(l){wt(e,e.return,l)}}}function Sf(e,t,s){s.props=Tr(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(l){wt(e,t,l)}}function Ti(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof s=="function"?e.refCleanup=s(l):s.current=l}}catch(n){wt(e,t,n)}}function Qs(e,t){var s=e.ref,l=e.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(n){wt(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(n){wt(e,t,n)}else s.current=null}function Df(e){var t=e.type,s=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(n){wt(e,e.return,n)}}function nu(e,t,s){try{var l=e.stateNode;_g(l,e.type,s,t),l[Et]=t}catch(n){wt(e,e.return,n)}}function Mf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Il(e.type)||e.tag===4}function iu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Mf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Il(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ou(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=xs));else if(l!==4&&(l===27&&Il(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(ou(e,t,s),e=e.sibling;e!==null;)ou(e,t,s),e=e.sibling}function xc(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(l!==4&&(l===27&&Il(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(xc(e,t,s),e=e.sibling;e!==null;)xc(e,t,s),e=e.sibling}function Cf(e){var t=e.stateNode,s=e.memoizedProps;try{for(var l=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);ua(t,l,s),t[Xe]=e,t[Et]=s}catch(i){wt(e,e.return,i)}}var gl=!1,It=!1,cu=!1,Tf=typeof WeakSet=="function"?WeakSet:Set,ra=null;function lg(e,t){if(e=e.containerInfo,Tu=Rc,e=Uo(e),Kn(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var n=l.anchorOffset,i=l.focusNode;l=l.focusOffset;try{s.nodeType,i.nodeType}catch{s=null;break e}var u=0,p=-1,C=-1,J=0,re=0,ue=e,P=null;t:for(;;){for(var te;ue!==s||n!==0&&ue.nodeType!==3||(p=u+n),ue!==i||l!==0&&ue.nodeType!==3||(C=u+l),ue.nodeType===3&&(u+=ue.nodeValue.length),(te=ue.firstChild)!==null;)P=ue,ue=te;for(;;){if(ue===e)break t;if(P===s&&++J===n&&(p=u),P===i&&++re===l&&(C=u),(te=ue.nextSibling)!==null)break;ue=P,P=ue.parentNode}ue=te}s=p===-1||C===-1?null:{start:p,end:C}}else s=null}s=s||{start:0,end:0}}else s=null;for(Ou={focusedElem:e,selectionRange:s},Rc=!1,ra=t;ra!==null;)if(t=ra,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ra=e;else for(;ra!==null;){switch(t=ra,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)n=e[s],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,s=t,n=i.memoizedProps,i=i.memoizedState,l=s.stateNode;try{var Oe=Tr(s.type,n);e=l.getSnapshotBeforeUpdate(Oe,i),l.__reactInternalSnapshotBeforeUpdate=e}catch(He){wt(s,s.return,He)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Au(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Au(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(f(163))}if(e=t.sibling,e!==null){e.return=t.return,ra=e;break}ra=t.return}}function Of(e,t,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:pl(e,s),l&4&&Ci(5,s);break;case 1:if(pl(e,s),l&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(u){wt(s,s.return,u)}else{var n=Tr(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(u){wt(s,s.return,u)}}l&64&&_f(s),l&512&&Ti(s,s.return);break;case 3:if(pl(e,s),l&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{sc(e,t)}catch(u){wt(s,s.return,u)}}break;case 27:t===null&&l&4&&Cf(s);case 26:case 5:pl(e,s),t===null&&l&4&&Df(s),l&512&&Ti(s,s.return);break;case 12:pl(e,s);break;case 31:pl(e,s),l&4&&Af(e,s);break;case 13:pl(e,s),l&4&&Yf(e,s),l&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=fg.bind(null,s),Lg(e,s))));break;case 22:if(l=s.memoizedState!==null||gl,!l){t=t!==null&&t.memoizedState!==null||It,n=gl;var i=It;gl=l,(It=t)&&!i?yl(e,s,(s.subtreeFlags&8772)!==0):pl(e,s),gl=n,It=i}break;case 30:break;default:pl(e,s)}}function Ef(e){var t=e.alternate;t!==null&&(e.alternate=null,Ef(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tn(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ht=null,qa=!1;function xl(e,t,s){for(s=s.child;s!==null;)Lf(e,t,s),s=s.sibling}function Lf(e,t,s){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(ta,s)}catch{}switch(s.tag){case 26:It||Qs(s,t),xl(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:It||Qs(s,t);var l=Ht,n=qa;Il(s.type)&&(Ht=s.stateNode,qa=!1),xl(e,t,s),Hi(s.stateNode),Ht=l,qa=n;break;case 5:It||Qs(s,t);case 6:if(l=Ht,n=qa,Ht=null,xl(e,t,s),Ht=l,qa=n,Ht!==null)if(qa)try{(Ht.nodeType===9?Ht.body:Ht.nodeName==="HTML"?Ht.ownerDocument.body:Ht).removeChild(s.stateNode)}catch(i){wt(s,t,i)}else try{Ht.removeChild(s.stateNode)}catch(i){wt(s,t,i)}break;case 18:Ht!==null&&(qa?(e=Ht,_m(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Nn(e)):_m(Ht,s.stateNode));break;case 4:l=Ht,n=qa,Ht=s.stateNode.containerInfo,qa=!0,xl(e,t,s),Ht=l,qa=n;break;case 0:case 11:case 14:case 15:Ql(2,s,t),It||Ql(4,s,t),xl(e,t,s);break;case 1:It||(Qs(s,t),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Sf(s,t,l)),xl(e,t,s);break;case 21:xl(e,t,s);break;case 22:It=(l=It)||s.memoizedState!==null,xl(e,t,s),It=l;break;default:xl(e,t,s)}}function Af(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Nn(e)}catch(s){wt(t,t.return,s)}}}function Yf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Nn(e)}catch(s){wt(t,t.return,s)}}function rg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Tf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Tf),t;default:throw Error(f(435,e.tag))}}function pc(e,t){var s=rg(e);t.forEach(function(l){if(!s.has(l)){s.add(l);var n=mg.bind(null,e,l);l.then(n,n)}})}function Ba(e,t){var s=t.deletions;if(s!==null)for(var l=0;l<s.length;l++){var n=s[l],i=e,u=t,p=u;e:for(;p!==null;){switch(p.tag){case 27:if(Il(p.type)){Ht=p.stateNode,qa=!1;break e}break;case 5:Ht=p.stateNode,qa=!1;break e;case 3:case 4:Ht=p.stateNode.containerInfo,qa=!0;break e}p=p.return}if(Ht===null)throw Error(f(160));Lf(i,u,n),Ht=null,qa=!1,i=n.alternate,i!==null&&(i.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)zf(t,e),t=t.sibling}var Ds=null;function zf(e,t){var s=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ba(t,e),$a(e),l&4&&(Ql(3,e,e.return),Ci(3,e),Ql(5,e,e.return));break;case 1:Ba(t,e),$a(e),l&512&&(It||s===null||Qs(s,s.return)),l&64&&gl&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var n=Ds;if(Ba(t,e),$a(e),l&512&&(It||s===null||Qs(s,s.return)),l&4){var i=s!==null?s.memoizedState:null;if(l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null){e:{l=e.type,s=e.memoizedProps,n=n.ownerDocument||n;t:switch(l){case"title":i=n.getElementsByTagName("title")[0],(!i||i[wl]||i[Xe]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=n.createElement(l),n.head.insertBefore(i,n.querySelector("head > title"))),ua(i,l,s),i[Xe]=e,Jt(i),l=i;break e;case"link":var u=zm("link","href",n).get(l+(s.href||""));if(u){for(var p=0;p<u.length;p++)if(i=u[p],i.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&i.getAttribute("rel")===(s.rel==null?null:s.rel)&&i.getAttribute("title")===(s.title==null?null:s.title)&&i.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){u.splice(p,1);break t}}i=n.createElement(l),ua(i,l,s),n.head.appendChild(i);break;case"meta":if(u=zm("meta","content",n).get(l+(s.content||""))){for(p=0;p<u.length;p++)if(i=u[p],i.getAttribute("content")===(s.content==null?null:""+s.content)&&i.getAttribute("name")===(s.name==null?null:s.name)&&i.getAttribute("property")===(s.property==null?null:s.property)&&i.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&i.getAttribute("charset")===(s.charSet==null?null:s.charSet)){u.splice(p,1);break t}}i=n.createElement(l),ua(i,l,s),n.head.appendChild(i);break;default:throw Error(f(468,l))}i[Xe]=e,Jt(i),l=i}e.stateNode=l}else Rm(n,e.type,e.stateNode);else e.stateNode=Ym(n,l,e.memoizedProps);else i!==l?(i===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):i.count--,l===null?Rm(n,e.type,e.stateNode):Ym(n,l,e.memoizedProps)):l===null&&e.stateNode!==null&&nu(e,e.memoizedProps,s.memoizedProps)}break;case 27:Ba(t,e),$a(e),l&512&&(It||s===null||Qs(s,s.return)),s!==null&&l&4&&nu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Ba(t,e),$a(e),l&512&&(It||s===null||Qs(s,s.return)),e.flags&32){n=e.stateNode;try{Dl(n,"")}catch(Oe){wt(e,e.return,Oe)}}l&4&&e.stateNode!=null&&(n=e.memoizedProps,nu(e,n,s!==null?s.memoizedProps:n)),l&1024&&(cu=!0);break;case 6:if(Ba(t,e),$a(e),l&4){if(e.stateNode===null)throw Error(f(162));l=e.memoizedProps,s=e.stateNode;try{s.nodeValue=l}catch(Oe){wt(e,e.return,Oe)}}break;case 3:if(Lc=null,n=Ds,Ds=Oc(t.containerInfo),Ba(t,e),Ds=n,$a(e),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Nn(t.containerInfo)}catch(Oe){wt(e,e.return,Oe)}cu&&(cu=!1,Rf(e));break;case 4:l=Ds,Ds=Oc(e.stateNode.containerInfo),Ba(t,e),$a(e),Ds=l;break;case 12:Ba(t,e),$a(e);break;case 31:Ba(t,e),$a(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,pc(e,l)));break;case 13:Ba(t,e),$a(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(bc=le()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,pc(e,l)));break;case 22:n=e.memoizedState!==null;var C=s!==null&&s.memoizedState!==null,J=gl,re=It;if(gl=J||n,It=re||C,Ba(t,e),It=re,gl=J,$a(e),l&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(s===null||C||gl||It||Or(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){C=s=t;try{if(i=C.stateNode,n)u=i.style,typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none";else{p=C.stateNode;var ue=C.memoizedProps.style,P=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;p.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(Oe){wt(C,C.return,Oe)}}}else if(t.tag===6){if(s===null){C=t;try{C.stateNode.nodeValue=n?"":C.memoizedProps}catch(Oe){wt(C,C.return,Oe)}}}else if(t.tag===18){if(s===null){C=t;try{var te=C.stateNode;n?Sm(te,!0):Sm(C.stateNode,!1)}catch(Oe){wt(C,C.return,Oe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,pc(e,s))));break;case 19:Ba(t,e),$a(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,pc(e,l)));break;case 30:break;case 21:break;default:Ba(t,e),$a(e)}}function $a(e){var t=e.flags;if(t&2){try{for(var s,l=e.return;l!==null;){if(Mf(l)){s=l;break}l=l.return}if(s==null)throw Error(f(160));switch(s.tag){case 27:var n=s.stateNode,i=iu(e);xc(e,i,n);break;case 5:var u=s.stateNode;s.flags&32&&(Dl(u,""),s.flags&=-33);var p=iu(e);xc(e,p,u);break;case 3:case 4:var C=s.stateNode.containerInfo,J=iu(e);ou(e,J,C);break;default:throw Error(f(161))}}catch(re){wt(e,e.return,re)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Rf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Rf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function pl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Of(e,t.alternate,t),t=t.sibling}function Or(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ql(4,t,t.return),Or(t);break;case 1:Qs(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&Sf(t,t.return,s),Or(t);break;case 27:Hi(t.stateNode);case 26:case 5:Qs(t,t.return),Or(t);break;case 22:t.memoizedState===null&&Or(t);break;case 30:Or(t);break;default:Or(t)}e=e.sibling}}function yl(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,n=e,i=t,u=i.flags;switch(i.tag){case 0:case 11:case 15:yl(n,i,s),Ci(4,i);break;case 1:if(yl(n,i,s),l=i,n=l.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(J){wt(l,l.return,J)}if(l=i,n=l.updateQueue,n!==null){var p=l.stateNode;try{var C=n.shared.hiddenCallbacks;if(C!==null)for(n.shared.hiddenCallbacks=null,n=0;n<C.length;n++)ac(C[n],p)}catch(J){wt(l,l.return,J)}}s&&u&64&&_f(i),Ti(i,i.return);break;case 27:Cf(i);case 26:case 5:yl(n,i,s),s&&l===null&&u&4&&Df(i),Ti(i,i.return);break;case 12:yl(n,i,s);break;case 31:yl(n,i,s),s&&u&4&&Af(n,i);break;case 13:yl(n,i,s),s&&u&4&&Yf(n,i);break;case 22:i.memoizedState===null&&yl(n,i,s),Ti(i,i.return);break;case 30:break;default:yl(n,i,s)}t=t.sibling}}function du(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&br(s))}function uu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&br(e))}function Ms(e,t,s,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Uf(e,t,s,l),t=t.sibling}function Uf(e,t,s,l){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Ms(e,t,s,l),n&2048&&Ci(9,t);break;case 1:Ms(e,t,s,l);break;case 3:Ms(e,t,s,l),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&br(e)));break;case 12:if(n&2048){Ms(e,t,s,l),e=t.stateNode;try{var i=t.memoizedProps,u=i.id,p=i.onPostCommit;typeof p=="function"&&p(u,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(C){wt(t,t.return,C)}}else Ms(e,t,s,l);break;case 31:Ms(e,t,s,l);break;case 13:Ms(e,t,s,l);break;case 23:break;case 22:i=t.stateNode,u=t.alternate,t.memoizedState!==null?i._visibility&2?Ms(e,t,s,l):Oi(e,t):i._visibility&2?Ms(e,t,s,l):(i._visibility|=2,un(e,t,s,l,(t.subtreeFlags&10256)!==0||!1)),n&2048&&du(u,t);break;case 24:Ms(e,t,s,l),n&2048&&uu(t.alternate,t);break;default:Ms(e,t,s,l)}}function un(e,t,s,l,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,u=t,p=s,C=l,J=u.flags;switch(u.tag){case 0:case 11:case 15:un(i,u,p,C,n),Ci(8,u);break;case 23:break;case 22:var re=u.stateNode;u.memoizedState!==null?re._visibility&2?un(i,u,p,C,n):Oi(i,u):(re._visibility|=2,un(i,u,p,C,n)),n&&J&2048&&du(u.alternate,u);break;case 24:un(i,u,p,C,n),n&&J&2048&&uu(u.alternate,u);break;default:un(i,u,p,C,n)}t=t.sibling}}function Oi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,l=t,n=l.flags;switch(l.tag){case 22:Oi(s,l),n&2048&&du(l.alternate,l);break;case 24:Oi(s,l),n&2048&&uu(l.alternate,l);break;default:Oi(s,l)}t=t.sibling}}var Ei=8192;function hn(e,t,s){if(e.subtreeFlags&Ei)for(e=e.child;e!==null;)Hf(e,t,s),e=e.sibling}function Hf(e,t,s){switch(e.tag){case 26:hn(e,t,s),e.flags&Ei&&e.memoizedState!==null&&Qg(s,Ds,e.memoizedState,e.memoizedProps);break;case 5:hn(e,t,s);break;case 3:case 4:var l=Ds;Ds=Oc(e.stateNode.containerInfo),hn(e,t,s),Ds=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Ei,Ei=16777216,hn(e,t,s),Ei=l):hn(e,t,s));break;default:hn(e,t,s)}}function qf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Li(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];ra=l,$f(l,e)}qf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bf(e),e=e.sibling}function Bf(e){switch(e.tag){case 0:case 11:case 15:Li(e),e.flags&2048&&Ql(9,e,e.return);break;case 3:Li(e);break;case 12:Li(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,yc(e)):Li(e);break;default:Li(e)}}function yc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];ra=l,$f(l,e)}qf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ql(8,t,t.return),yc(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,yc(t));break;default:yc(t)}e=e.sibling}}function $f(e,t){for(;ra!==null;){var s=ra;switch(s.tag){case 0:case 11:case 15:Ql(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:br(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,ra=l;else e:for(s=e;ra!==null;){l=ra;var n=l.sibling,i=l.return;if(Ef(l),l===s){ra=null;break e}if(n!==null){n.return=i,ra=n;break e}ra=i}}}var ng={getCacheForType:function(e){var t=sa(qt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return sa(qt).controller.signal}},ig=typeof WeakMap=="function"?WeakMap:Map,vt=0,Tt=null,nt=null,ct=0,Nt=0,Ja=null,Zl=!1,fn=!1,hu=!1,bl=0,Qt=0,Xl=0,Er=0,fu=0,Ka=0,mn=0,Ai=null,Ga=null,mu=!1,bc=0,Gf=0,vc=1/0,jc=null,Fl=null,la=0,Wl=null,gn=null,vl=0,gu=0,xu=null,Vf=null,Yi=0,pu=null;function Ia(){return(vt&2)!==0&&ct!==0?ct&-ct:B.T!==null?wu():Xt()}function Qf(){if(Ka===0)if((ct&536870912)===0||lt){var e=Rt;Rt<<=1,(Rt&3932160)===0&&(Rt=262144),Ka=e}else Ka=536870912;return e=_a.current,e!==null&&(e.flags|=32),Ka}function Va(e,t,s){(e===Tt&&(Nt===2||Nt===9)||e.cancelPendingCommit!==null)&&(xn(e,0),Jl(e,ct,Ka,!1)),Zt(e,s),((vt&2)===0||e!==Tt)&&(e===Tt&&((vt&2)===0&&(Er|=s),Qt===4&&Jl(e,ct,Ka,!1)),Zs(e))}function Zf(e,t,s){if((vt&6)!==0)throw Error(f(327));var l=!s&&(t&127)===0&&(t&e.expiredLanes)===0||je(e,t),n=l?dg(e,t):bu(e,t,!0),i=l;do{if(n===0){fn&&!l&&Jl(e,t,0,!1);break}else{if(s=e.current.alternate,i&&!og(s)){n=bu(e,t,!1),i=!1;continue}if(n===2){if(i=t,e.errorRecoveryDisabledLanes&i)var u=0;else u=e.pendingLanes&-536870913,u=u!==0?u:u&536870912?536870912:0;if(u!==0){t=u;e:{var p=e;n=Ai;var C=p.current.memoizedState.isDehydrated;if(C&&(xn(p,u).flags|=256),u=bu(p,u,!1),u!==2){if(hu&&!C){p.errorRecoveryDisabledLanes|=i,Er|=i,n=4;break e}i=Ga,Ga=n,i!==null&&(Ga===null?Ga=i:Ga.push.apply(Ga,i))}n=u}if(i=!1,n!==2)continue}}if(n===1){xn(e,0),Jl(e,t,0,!0);break}e:{switch(l=e,i=n,i){case 0:case 1:throw Error(f(345));case 4:if((t&4194048)!==t)break;case 6:Jl(l,t,Ka,!Zl);break e;case 2:Ga=null;break;case 3:case 5:break;default:throw Error(f(329))}if((t&62914560)===t&&(n=bc+300-le(),10<n)){if(Jl(l,t,Ka,!Zl),mt(l,0,!0)!==0)break e;vl=t,l.timeoutHandle=wm(Xf.bind(null,l,s,Ga,jc,mu,t,Ka,Er,mn,Zl,i,"Throttled",-0,0),n);break e}Xf(l,s,Ga,jc,mu,t,Ka,Er,mn,Zl,i,null,-0,0)}}break}while(!0);Zs(e)}function Xf(e,t,s,l,n,i,u,p,C,J,re,ue,P,te){if(e.timeoutHandle=-1,ue=t.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xs},Hf(t,i,ue);var Oe=(i&62914560)===i?bc-le():(i&4194048)===i?Gf-le():0;if(Oe=Zg(ue,Oe),Oe!==null){vl=i,e.cancelPendingCommit=Oe(tm.bind(null,e,t,i,s,l,n,u,p,C,re,ue,null,P,te)),Jl(e,i,u,!J);return}}tm(e,t,i,s,l,n,u,p,C)}function og(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var n=s[l],i=n.getSnapshot;n=n.value;try{if(!na(i(),n))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Jl(e,t,s,l){t&=~fu,t&=~Er,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var n=t;0<n;){var i=31-kt(n),u=1<<i;l[i]=-1,n&=~u}s!==0&&Is(e,s,t)}function Nc(){return(vt&6)===0?(zi(0),!1):!0}function yu(){if(nt!==null){if(Nt===0)var e=nt.return;else e=nt,ws=Ns=null,Ad(e),Vl=null,wr=0,e=nt;for(;e!==null;)kf(e.alternate,e),e=e.return;nt=null}}function xn(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,Mg(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),vl=0,yu(),Tt=e,nt=s=bs(e.current,null),ct=t,Nt=0,Ja=null,Zl=!1,fn=je(e,t),hu=!1,mn=Ka=fu=Er=Xl=Qt=0,Ga=Ai=null,mu=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var n=31-kt(l),i=1<<n;t|=e[n],l&=~i}return bl=t,Jr(),s}function Ff(e,t){Ve=null,B.H=Si,t===ol||t===ln?(t=tc(),Nt=3):t===Nr?(t=tc(),Nt=4):Nt=t===Jd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ja=t,nt===null&&(Qt=1,uc(e,ia(t,e.current)))}function Wf(){var e=_a.current;return e===null?!0:(ct&4194048)===ct?Ha===null:(ct&62914560)===ct||(ct&536870912)!==0?e===Ha:!1}function Jf(){var e=B.H;return B.H=Si,e===null?Si:e}function Kf(){var e=B.A;return B.A=ng,e}function wc(){Qt=4,Zl||(ct&4194048)!==ct&&_a.current!==null||(fn=!0),(Xl&134217727)===0&&(Er&134217727)===0||Tt===null||Jl(Tt,ct,Ka,!1)}function bu(e,t,s){var l=vt;vt|=2;var n=Jf(),i=Kf();(Tt!==e||ct!==t)&&(jc=null,xn(e,t)),t=!1;var u=Qt;e:do try{if(Nt!==0&&nt!==null){var p=nt,C=Ja;switch(Nt){case 8:yu(),u=6;break e;case 3:case 2:case 9:case 6:_a.current===null&&(t=!0);var J=Nt;if(Nt=0,Ja=null,pn(e,p,C,J),s&&fn){u=0;break e}break;default:J=Nt,Nt=0,Ja=null,pn(e,p,C,J)}}cg(),u=Qt;break}catch(re){Ff(e,re)}while(!0);return t&&e.shellSuspendCounter++,ws=Ns=null,vt=l,B.H=n,B.A=i,nt===null&&(Tt=null,ct=0,Jr()),u}function cg(){for(;nt!==null;)If(nt)}function dg(e,t){var s=vt;vt|=2;var l=Jf(),n=Kf();Tt!==e||ct!==t?(jc=null,vc=le()+500,xn(e,t)):fn=je(e,t);e:do try{if(Nt!==0&&nt!==null){t=nt;var i=Ja;t:switch(Nt){case 1:Nt=0,Ja=null,pn(e,t,i,1);break;case 2:case 9:if(Po(i)){Nt=0,Ja=null,Pf(t);break}t=function(){Nt!==2&&Nt!==9||Tt!==e||(Nt=7),Zs(e)},i.then(t,t);break e;case 3:Nt=7;break e;case 4:Nt=5;break e;case 7:Po(i)?(Nt=0,Ja=null,Pf(t)):(Nt=0,Ja=null,pn(e,t,i,7));break;case 5:var u=null;switch(nt.tag){case 26:u=nt.memoizedState;case 5:case 27:var p=nt;if(u?Um(u):p.stateNode.complete){Nt=0,Ja=null;var C=p.sibling;if(C!==null)nt=C;else{var J=p.return;J!==null?(nt=J,kc(J)):nt=null}break t}}Nt=0,Ja=null,pn(e,t,i,5);break;case 6:Nt=0,Ja=null,pn(e,t,i,6);break;case 8:yu(),Qt=6;break e;default:throw Error(f(462))}}ug();break}catch(re){Ff(e,re)}while(!0);return ws=Ns=null,B.H=l,B.A=n,vt=s,nt!==null?0:(Tt=null,ct=0,Jr(),Qt)}function ug(){for(;nt!==null&&!ea();)If(nt)}function If(e){var t=Nf(e.alternate,e,bl);e.memoizedProps=e.pendingProps,t===null?kc(e):nt=t}function Pf(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=xf(s,t,t.pendingProps,t.type,void 0,ct);break;case 11:t=xf(s,t,t.pendingProps,t.type.render,t.ref,ct);break;case 5:Ad(t);default:kf(s,t),t=nt=Vo(t,bl),t=Nf(s,t,bl)}e.memoizedProps=e.pendingProps,t===null?kc(e):nt=t}function pn(e,t,s,l){ws=Ns=null,Ad(t),Vl=null,wr=0;var n=t.return;try{if(P0(e,n,t,s,ct)){Qt=1,uc(e,ia(s,e.current)),nt=null;return}}catch(i){if(n!==null)throw nt=n,i;Qt=1,uc(e,ia(s,e.current)),nt=null;return}t.flags&32768?(lt||l===1?e=!0:fn||(ct&536870912)!==0?e=!1:(Zl=e=!0,(l===2||l===9||l===3||l===6)&&(l=_a.current,l!==null&&l.tag===13&&(l.flags|=16384))),em(t,e)):kc(t)}function kc(e){var t=e;do{if((t.flags&32768)!==0){em(t,Zl);return}e=t.return;var s=ag(t.alternate,t,bl);if(s!==null){nt=s;return}if(t=t.sibling,t!==null){nt=t;return}nt=t=e}while(t!==null);Qt===0&&(Qt=5)}function em(e,t){do{var s=sg(e.alternate,e);if(s!==null){s.flags&=32767,nt=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){nt=e;return}nt=e=s}while(e!==null);Qt=6,nt=null}function tm(e,t,s,l,n,i,u,p,C){e.cancelPendingCommit=null;do _c();while(la!==0);if((vt&6)!==0)throw Error(f(327));if(t!==null){if(t===e.current)throw Error(f(177));if(i=t.lanes|t.childLanes,i|=li,Ke(e,s,i,u,p,C),e===Tt&&(nt=Tt=null,ct=0),gn=t,Wl=e,vl=s,gu=i,xu=n,Vf=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,gg(he,function(){return nm(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=B.T,B.T=null,n=oe.p,oe.p=2,u=vt,vt|=4;try{lg(e,t,s)}finally{vt=u,oe.p=n,B.T=l}}la=1,am(),sm(),lm()}}function am(){if(la===1){la=0;var e=Wl,t=gn,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=B.T,B.T=null;var l=oe.p;oe.p=2;var n=vt;vt|=4;try{zf(t,e);var i=Ou,u=Uo(e.containerInfo),p=i.focusedElem,C=i.selectionRange;if(u!==p&&p&&p.ownerDocument&&Ro(p.ownerDocument.documentElement,p)){if(C!==null&&Kn(p)){var J=C.start,re=C.end;if(re===void 0&&(re=J),"selectionStart"in p)p.selectionStart=J,p.selectionEnd=Math.min(re,p.value.length);else{var ue=p.ownerDocument||document,P=ue&&ue.defaultView||window;if(P.getSelection){var te=P.getSelection(),Oe=p.textContent.length,He=Math.min(C.start,Oe),Dt=C.end===void 0?He:Math.min(C.end,Oe);!te.extend&&He>Dt&&(u=Dt,Dt=He,He=u);var $=zo(p,He),Y=zo(p,Dt);if($&&Y&&(te.rangeCount!==1||te.anchorNode!==$.node||te.anchorOffset!==$.offset||te.focusNode!==Y.node||te.focusOffset!==Y.offset)){var W=ue.createRange();W.setStart($.node,$.offset),te.removeAllRanges(),He>Dt?(te.addRange(W),te.extend(Y.node,Y.offset)):(W.setEnd(Y.node,Y.offset),te.addRange(W))}}}}for(ue=[],te=p;te=te.parentNode;)te.nodeType===1&&ue.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<ue.length;p++){var ce=ue[p];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Rc=!!Tu,Ou=Tu=null}finally{vt=n,oe.p=l,B.T=s}}e.current=t,la=2}}function sm(){if(la===2){la=0;var e=Wl,t=gn,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=B.T,B.T=null;var l=oe.p;oe.p=2;var n=vt;vt|=4;try{Of(e,t.alternate,t)}finally{vt=n,oe.p=l,B.T=s}}la=3}}function lm(){if(la===4||la===3){la=0,Se();var e=Wl,t=gn,s=vl,l=Vf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?la=5:(la=0,gn=Wl=null,rm(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(Fl=null),ut(s),t=t.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(ta,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=B.T,n=oe.p,oe.p=2,B.T=null;try{for(var i=e.onRecoverableError,u=0;u<l.length;u++){var p=l[u];i(p.value,{componentStack:p.stack})}}finally{B.T=t,oe.p=n}}(vl&3)!==0&&_c(),Zs(e),n=e.pendingLanes,(s&261930)!==0&&(n&42)!==0?e===pu?Yi++:(Yi=0,pu=e):Yi=0,zi(0)}}function rm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,br(t)))}function _c(){return am(),sm(),lm(),nm()}function nm(){if(la!==5)return!1;var e=Wl,t=gu;gu=0;var s=ut(vl),l=B.T,n=oe.p;try{oe.p=32>s?32:s,B.T=null,s=xu,xu=null;var i=Wl,u=vl;if(la=0,gn=Wl=null,vl=0,(vt&6)!==0)throw Error(f(331));var p=vt;if(vt|=4,Bf(i.current),Uf(i,i.current,u,s),vt=p,zi(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(ta,i)}catch{}return!0}finally{oe.p=n,B.T=l,rm(e,t)}}function im(e,t,s){t=ia(s,t),t=Wd(e.stateNode,t,2),e=Gs(e,t,2),e!==null&&(Zt(e,2),Zs(e))}function wt(e,t,s){if(e.tag===3)im(e,e,s);else for(;t!==null;){if(t.tag===3){im(t,e,s);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Fl===null||!Fl.has(l))){e=ia(s,e),s=of(2),l=Gs(t,s,2),l!==null&&(cf(s,l,t,e),Zt(l,2),Zs(l));break}}t=t.return}}function vu(e,t,s){var l=e.pingCache;if(l===null){l=e.pingCache=new ig;var n=new Set;l.set(t,n)}else n=l.get(t),n===void 0&&(n=new Set,l.set(t,n));n.has(s)||(hu=!0,n.add(s),e=hg.bind(null,e,t,s),t.then(e,e))}function hg(e,t,s){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Tt===e&&(ct&s)===s&&(Qt===4||Qt===3&&(ct&62914560)===ct&&300>le()-bc?(vt&2)===0&&xn(e,0):fu|=s,mn===ct&&(mn=0)),Zs(e)}function om(e,t){t===0&&(t=lr()),e=al(e,t),e!==null&&(Zt(e,t),Zs(e))}function fg(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),om(e,s)}function mg(e,t){var s=0;switch(e.tag){case 31:case 13:var l=e.stateNode,n=e.memoizedState;n!==null&&(s=n.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(f(314))}l!==null&&l.delete(t),om(e,s)}function gg(e,t){return Vt(e,t)}var Sc=null,yn=null,ju=!1,Dc=!1,Nu=!1,Kl=0;function Zs(e){e!==yn&&e.next===null&&(yn===null?Sc=yn=e:yn=yn.next=e),Dc=!0,ju||(ju=!0,pg())}function zi(e,t){if(!Nu&&Dc){Nu=!0;do for(var s=!1,l=Sc;l!==null;){if(e!==0){var n=l.pendingLanes;if(n===0)var i=0;else{var u=l.suspendedLanes,p=l.pingedLanes;i=(1<<31-kt(42|e)+1)-1,i&=n&~(u&~p),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(s=!0,hm(l,i))}else i=ct,i=mt(l,l===Tt?i:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(i&3)===0||je(l,i)||(s=!0,hm(l,i));l=l.next}while(s);Nu=!1}}function xg(){cm()}function cm(){Dc=ju=!1;var e=0;Kl!==0&&Dg()&&(e=Kl);for(var t=le(),s=null,l=Sc;l!==null;){var n=l.next,i=dm(l,t);i===0?(l.next=null,s===null?Sc=n:s.next=n,n===null&&(yn=s)):(s=l,(e!==0||(i&3)!==0)&&(Dc=!0)),l=n}la!==0&&la!==5||zi(e),Kl!==0&&(Kl=0)}function dm(e,t){for(var s=e.suspendedLanes,l=e.pingedLanes,n=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var u=31-kt(i),p=1<<u,C=n[u];C===-1?((p&s)===0||(p&l)!==0)&&(n[u]=Ot(p,t)):C<=t&&(e.expiredLanes|=p),i&=~p}if(t=Tt,s=ct,s=mt(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,s===0||e===t&&(Nt===2||Nt===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&bt(l),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||je(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(l!==null&&bt(l),ut(s)){case 2:case 8:s=ft;break;case 32:s=he;break;case 268435456:s=Ge;break;default:s=he}return l=um.bind(null,e),s=Vt(s,l),e.callbackPriority=t,e.callbackNode=s,t}return l!==null&&l!==null&&bt(l),e.callbackPriority=2,e.callbackNode=null,2}function um(e,t){if(la!==0&&la!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(_c()&&e.callbackNode!==s)return null;var l=ct;return l=mt(e,e===Tt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Zf(e,l,t),dm(e,le()),e.callbackNode!=null&&e.callbackNode===s?um.bind(null,e):null)}function hm(e,t){if(_c())return null;Zf(e,t,!0)}function pg(){Cg(function(){(vt&6)!==0?Vt(Ee,xg):cm()})}function wu(){if(Kl===0){var e=nl;e===0&&(e=Ze,Ze<<=1,(Ze&261888)===0&&(Ze=256)),Kl=e}return Kl}function fm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ml(""+e)}function mm(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function yg(e,t,s,l,n){if(t==="submit"&&s&&s.stateNode===n){var i=fm((n[Et]||null).action),u=l.submitter;u&&(t=(t=u[Et]||null)?fm(t.formAction):u.getAttribute("formAction"),t!==null&&(i=t,u=null));var p=new or("action","action",null,l,n);e.push({event:p,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Kl!==0){var C=u?mm(n,u):new FormData(n);Gd(s,{pending:!0,data:C,method:n.method,action:i},null,C)}}else typeof i=="function"&&(p.preventDefault(),C=u?mm(n,u):new FormData(n),Gd(s,{pending:!0,data:C,method:n.method,action:i},i,C))},currentTarget:n}]})}}for(var ku=0;ku<si.length;ku++){var _u=si[ku],bg=_u.toLowerCase(),vg=_u[0].toUpperCase()+_u.slice(1);Xa(bg,"on"+vg)}Xa(Ho,"onAnimationEnd"),Xa(ti,"onAnimationIteration"),Xa(ai,"onAnimationStart"),Xa("dblclick","onDoubleClick"),Xa("focusin","onFocus"),Xa("focusout","onBlur"),Xa(Md,"onTransitionRun"),Xa(Cd,"onTransitionStart"),Xa(qo,"onTransitionCancel"),Xa(Bo,"onTransitionEnd"),Sl("onMouseEnter",["mouseout","mouseover"]),Sl("onMouseLeave",["mouseout","mouseover"]),Sl("onPointerEnter",["pointerout","pointerover"]),Sl("onPointerLeave",["pointerout","pointerover"]),ms("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ms("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ms("onBeforeInput",["compositionend","keypress","textInput","paste"]),ms("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ms("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ms("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ri="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(" "),jg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ri));function gm(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var l=e[s],n=l.event;l=l.listeners;e:{var i=void 0;if(t)for(var u=l.length-1;0<=u;u--){var p=l[u],C=p.instance,J=p.currentTarget;if(p=p.listener,C!==i&&n.isPropagationStopped())break e;i=p,n.currentTarget=J;try{i(n)}catch(re){Wr(re)}n.currentTarget=null,i=C}else for(u=0;u<l.length;u++){if(p=l[u],C=p.instance,J=p.currentTarget,p=p.listener,C!==i&&n.isPropagationStopped())break e;i=p,n.currentTarget=J;try{i(n)}catch(re){Wr(re)}n.currentTarget=null,i=C}}}}function it(e,t){var s=t[fs];s===void 0&&(s=t[fs]=new Set);var l=e+"__bubble";s.has(l)||(xm(t,e,2,!1),s.add(l))}function Su(e,t,s){var l=0;t&&(l|=4),xm(s,e,l,t)}var Mc="_reactListening"+Math.random().toString(36).slice(2);function Du(e){if(!e[Mc]){e[Mc]=!0,oo.forEach(function(s){s!=="selectionchange"&&(jg.has(s)||Su(s,!1,e),Su(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Mc]||(t[Mc]=!0,Su("selectionchange",!1,t))}}function xm(e,t,s,l){switch(Qm(t)){case 2:var n=Wg;break;case 8:n=Jg;break;default:n=$u}s=n.bind(null,t,s,e),n=void 0,!Rn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),l?n!==void 0?e.addEventListener(t,s,{capture:!0,passive:n}):e.addEventListener(t,s,!0):n!==void 0?e.addEventListener(t,s,{passive:n}):e.addEventListener(t,s,!1)}function Mu(e,t,s,l,n){var i=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var u=l.tag;if(u===3||u===4){var p=l.stateNode.containerInfo;if(p===n)break;if(u===4)for(u=l.return;u!==null;){var C=u.tag;if((C===3||C===4)&&u.stateNode.containerInfo===n)return;u=u.return}for(;p!==null;){if(u=Za(p),u===null)return;if(C=u.tag,C===5||C===6||C===26||C===27){l=i=u;continue e}p=p.parentNode}}l=l.return}bo(function(){var J=i,re=Yn(s),ue=[];e:{var P=$o.get(e);if(P!==void 0){var te=or,Oe=e;switch(e){case"keypress":if(Gr(s)===0)break e;case"keydown":case"keyup":te=Qn;break;case"focusin":Oe="focus",te=Bn;break;case"focusout":Oe="blur",te=Bn;break;case"beforeblur":case"afterblur":te=Bn;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=Ll;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=cd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=wo;break;case Ho:case ti:case ai:te=Qr;break;case Bo:te=yd;break;case"scroll":case"scrollend":te=od;break;case"wheel":te=vd;break;case"copy":case"cut":case"paste":te=$n;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=No;break;case"toggle":case"beforetoggle":te=ko}var He=(t&4)!==0,Dt=!He&&(e==="scroll"||e==="scrollend"),$=He?P!==null?P+"Capture":null:P;He=[];for(var Y=J,W;Y!==null;){var ce=Y;if(W=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||W===null||$===null||(ce=nr(Y,$),ce!=null&&He.push(Ui(Y,ce,W))),Dt)break;Y=Y.return}0<He.length&&(P=new te(P,Oe,null,s,re),ue.push({event:P,listeners:He}))}}if((t&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",te=e==="mouseout"||e==="pointerout",P&&s!==Br&&(Oe=s.relatedTarget||s.fromElement)&&(Za(Oe)||Oe[ga]))break e;if((te||P)&&(P=re.window===re?re:(P=re.ownerDocument)?P.defaultView||P.parentWindow:window,te?(Oe=s.relatedTarget||s.toElement,te=J,Oe=Oe?Za(Oe):null,Oe!==null&&(Dt=v(Oe),He=Oe.tag,Oe!==Dt||He!==5&&He!==27&&He!==6)&&(Oe=null)):(te=null,Oe=J),te!==Oe)){if(He=Ll,ce="onMouseLeave",$="onMouseEnter",Y="mouse",(e==="pointerout"||e==="pointerover")&&(He=No,ce="onPointerLeave",$="onPointerEnter",Y="pointer"),Dt=te==null?P:kl(te),W=Oe==null?P:kl(Oe),P=new He(ce,Y+"leave",te,s,re),P.target=Dt,P.relatedTarget=W,ce=null,Za(re)===J&&(He=new He($,Y+"enter",Oe,s,re),He.target=W,He.relatedTarget=Dt,ce=He),Dt=ce,te&&Oe)t:{for(He=Ng,$=te,Y=Oe,W=0,ce=$;ce;ce=He(ce))W++;ce=0;for(var Ue=Y;Ue;Ue=He(Ue))ce++;for(;0<W-ce;)$=He($),W--;for(;0<ce-W;)Y=He(Y),ce--;for(;W--;){if($===Y||Y!==null&&$===Y.alternate){He=$;break t}$=He($),Y=He(Y)}He=null}else He=null;te!==null&&pm(ue,P,te,He,!1),Oe!==null&&Dt!==null&&pm(ue,Dt,Oe,He,!0)}}e:{if(P=J?kl(J):window,te=P.nodeName&&P.nodeName.toLowerCase(),te==="select"||te==="input"&&P.type==="file")var xt=Eo;else if(_t(P))if(zl)xt=Sd;else{xt=_d;var Le=Wn}else te=P.nodeName,!te||te.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?J&&An(J.elementType)&&(xt=Eo):xt=Ao;if(xt&&(xt=xt(e,J))){Oo(ue,xt,s,re);break e}Le&&Le(e,P,J),e==="focusout"&&J&&P.type==="number"&&J.memoizedProps.value!=null&&qr(P,"number",P.value)}switch(Le=J?kl(J):window,e){case"focusin":(_t(Le)||Le.contentEditable==="true")&&(Rl=Le,In=J,gr=null);break;case"focusout":gr=In=Rl=null;break;case"mousedown":Pn=!0;break;case"contextmenu":case"mouseup":case"dragend":Pn=!1,ei(ue,s,re);break;case"selectionchange":if(Dd)break;case"keydown":case"keyup":ei(ue,s,re)}var Pe;if(Ys)e:{switch(e){case"compositionstart":var dt="onCompositionStart";break e;case"compositionend":dt="onCompositionEnd";break e;case"compositionupdate":dt="onCompositionUpdate";break e}dt=void 0}else Al?Do(e,s)&&(dt="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(dt="onCompositionStart");dt&&(_o&&s.locale!=="ko"&&(Al||dt!=="onCompositionStart"?dt==="onCompositionEnd"&&Al&&(Pe=vo()):(Es=re,Un="value"in Es?Es.value:Es.textContent,Al=!0)),Le=Cc(J,dt),0<Le.length&&(dt=new as(dt,e,null,s,re),ue.push({event:dt,listeners:Le}),Pe?dt.data=Pe:(Pe=Mo(s),Pe!==null&&(dt.data=Pe)))),(Pe=Zn?Co(e,s):wd(e,s))&&(dt=Cc(J,"onBeforeInput"),0<dt.length&&(Le=new as("onBeforeInput","beforeinput",null,s,re),ue.push({event:Le,listeners:dt}),Le.data=Pe)),yg(ue,e,J,s,re)}gm(ue,t)})}function Ui(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Cc(e,t){for(var s=t+"Capture",l=[];e!==null;){var n=e,i=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||i===null||(n=nr(e,s),n!=null&&l.unshift(Ui(e,n,i)),n=nr(e,t),n!=null&&l.push(Ui(e,n,i))),e.tag===3)return l;e=e.return}return[]}function Ng(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function pm(e,t,s,l,n){for(var i=t._reactName,u=[];s!==null&&s!==l;){var p=s,C=p.alternate,J=p.stateNode;if(p=p.tag,C!==null&&C===l)break;p!==5&&p!==26&&p!==27||J===null||(C=J,n?(J=nr(s,i),J!=null&&u.unshift(Ui(s,J,C))):n||(J=nr(s,i),J!=null&&u.push(Ui(s,J,C)))),s=s.return}u.length!==0&&e.push({event:t,listeners:u})}var wg=/\r\n?/g,kg=/\u0000|\uFFFD/g;function ym(e){return(typeof e=="string"?e:""+e).replace(wg,`
`).replace(kg,"")}function bm(e,t){return t=ym(t),ym(e)===t}function St(e,t,s,l,n,i){switch(s){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Dl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Dl(e,""+l);break;case"className":Ur(e,"class",l);break;case"tabIndex":Ur(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Ur(e,s,l);break;case"style":po(e,l,i);break;case"data":if(t!=="object"){Ur(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Ml(""+l),e.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(s==="formAction"?(t!=="input"&&St(e,t,"name",n.name,n,null),St(e,t,"formEncType",n.formEncType,n,null),St(e,t,"formMethod",n.formMethod,n,null),St(e,t,"formTarget",n.formTarget,n,null)):(St(e,t,"encType",n.encType,n,null),St(e,t,"method",n.method,n,null),St(e,t,"target",n.target,n,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=Ml(""+l),e.setAttribute(s,l);break;case"onClick":l!=null&&(e.onclick=xs);break;case"onScroll":l!=null&&it("scroll",e);break;case"onScrollEnd":l!=null&&it("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(f(61));if(s=l.__html,s!=null){if(n.children!=null)throw Error(f(60));e.innerHTML=s}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}s=Ml(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""+l):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":l===!0?e.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(s,l):e.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(s):e.setAttribute(s,l);break;case"popover":it("beforetoggle",e),it("toggle",e),Rr(e,"popover",l);break;case"xlinkActuate":gs(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":gs(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":gs(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":gs(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":gs(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":gs(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":gs(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":gs(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":gs(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Rr(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=nd.get(s)||s,Rr(e,s,l))}}function Cu(e,t,s,l,n,i){switch(s){case"style":po(e,l,i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(f(61));if(s=l.__html,s!=null){if(n.children!=null)throw Error(f(60));e.innerHTML=s}}break;case"children":typeof l=="string"?Dl(e,l):(typeof l=="number"||typeof l=="bigint")&&Dl(e,""+l);break;case"onScroll":l!=null&&it("scroll",e);break;case"onScrollEnd":l!=null&&it("scrollend",e);break;case"onClick":l!=null&&(e.onclick=xs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ut.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(n=s.endsWith("Capture"),t=s.slice(2,n?s.length-7:void 0),i=e[Et]||null,i=i!=null?i[s]:null,typeof i=="function"&&e.removeEventListener(t,i,n),typeof l=="function")){typeof i!="function"&&i!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,l,n);break e}s in e?e[s]=l:l===!0?e.setAttribute(s,""):Rr(e,s,l)}}}function ua(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":it("error",e),it("load",e);var l=!1,n=!1,i;for(i in s)if(s.hasOwnProperty(i)){var u=s[i];if(u!=null)switch(i){case"src":l=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(f(137,t));default:St(e,t,i,u,s,null)}}n&&St(e,t,"srcSet",s.srcSet,s,null),l&&St(e,t,"src",s.src,s,null);return;case"input":it("invalid",e);var p=i=u=n=null,C=null,J=null;for(l in s)if(s.hasOwnProperty(l)){var re=s[l];if(re!=null)switch(l){case"name":n=re;break;case"type":u=re;break;case"checked":C=re;break;case"defaultChecked":J=re;break;case"value":i=re;break;case"defaultValue":p=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(f(137,t));break;default:St(e,t,l,re,s,null)}}rr(e,i,p,C,J,u,n,!1);return;case"select":it("invalid",e),l=u=i=null;for(n in s)if(s.hasOwnProperty(n)&&(p=s[n],p!=null))switch(n){case"value":i=p;break;case"defaultValue":u=p;break;case"multiple":l=p;default:St(e,t,n,p,s,null)}t=i,s=u,e.multiple=!!l,t!=null?es(e,!!l,t,!1):s!=null&&es(e,!!l,s,!0);return;case"textarea":it("invalid",e),i=n=l=null;for(u in s)if(s.hasOwnProperty(u)&&(p=s[u],p!=null))switch(u){case"value":l=p;break;case"defaultValue":n=p;break;case"children":i=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(f(91));break;default:St(e,t,u,p,s,null)}go(e,l,n,i);return;case"option":for(C in s)if(s.hasOwnProperty(C)&&(l=s[C],l!=null))switch(C){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:St(e,t,C,l,s,null)}return;case"dialog":it("beforetoggle",e),it("toggle",e),it("cancel",e),it("close",e);break;case"iframe":case"object":it("load",e);break;case"video":case"audio":for(l=0;l<Ri.length;l++)it(Ri[l],e);break;case"image":it("error",e),it("load",e);break;case"details":it("toggle",e);break;case"embed":case"source":case"link":it("error",e),it("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in s)if(s.hasOwnProperty(J)&&(l=s[J],l!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(f(137,t));default:St(e,t,J,l,s,null)}return;default:if(An(t)){for(re in s)s.hasOwnProperty(re)&&(l=s[re],l!==void 0&&Cu(e,t,re,l,s,void 0));return}}for(p in s)s.hasOwnProperty(p)&&(l=s[p],l!=null&&St(e,t,p,l,s,null))}function _g(e,t,s,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,i=null,u=null,p=null,C=null,J=null,re=null;for(te in s){var ue=s[te];if(s.hasOwnProperty(te)&&ue!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":C=ue;default:l.hasOwnProperty(te)||St(e,t,te,null,l,ue)}}for(var P in l){var te=l[P];if(ue=s[P],l.hasOwnProperty(P)&&(te!=null||ue!=null))switch(P){case"type":i=te;break;case"name":n=te;break;case"checked":J=te;break;case"defaultChecked":re=te;break;case"value":u=te;break;case"defaultValue":p=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(f(137,t));break;default:te!==ue&&St(e,t,P,te,l,ue)}}Ps(e,u,p,C,J,re,i,n);return;case"select":te=u=p=P=null;for(i in s)if(C=s[i],s.hasOwnProperty(i)&&C!=null)switch(i){case"value":break;case"multiple":te=C;default:l.hasOwnProperty(i)||St(e,t,i,null,l,C)}for(n in l)if(i=l[n],C=s[n],l.hasOwnProperty(n)&&(i!=null||C!=null))switch(n){case"value":P=i;break;case"defaultValue":p=i;break;case"multiple":u=i;default:i!==C&&St(e,t,n,i,l,C)}t=p,s=u,l=te,P!=null?es(e,!!s,P,!1):!!l!=!!s&&(t!=null?es(e,!!s,t,!0):es(e,!!s,s?[]:"",!1));return;case"textarea":te=P=null;for(p in s)if(n=s[p],s.hasOwnProperty(p)&&n!=null&&!l.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:St(e,t,p,null,l,n)}for(u in l)if(n=l[u],i=s[u],l.hasOwnProperty(u)&&(n!=null||i!=null))switch(u){case"value":P=n;break;case"defaultValue":te=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(f(91));break;default:n!==i&&St(e,t,u,n,l,i)}ts(e,P,te);return;case"option":for(var Oe in s)if(P=s[Oe],s.hasOwnProperty(Oe)&&P!=null&&!l.hasOwnProperty(Oe))switch(Oe){case"selected":e.selected=!1;break;default:St(e,t,Oe,null,l,P)}for(C in l)if(P=l[C],te=s[C],l.hasOwnProperty(C)&&P!==te&&(P!=null||te!=null))switch(C){case"selected":e.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:St(e,t,C,P,l,te)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var He in s)P=s[He],s.hasOwnProperty(He)&&P!=null&&!l.hasOwnProperty(He)&&St(e,t,He,null,l,P);for(J in l)if(P=l[J],te=s[J],l.hasOwnProperty(J)&&P!==te&&(P!=null||te!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(f(137,t));break;default:St(e,t,J,P,l,te)}return;default:if(An(t)){for(var Dt in s)P=s[Dt],s.hasOwnProperty(Dt)&&P!==void 0&&!l.hasOwnProperty(Dt)&&Cu(e,t,Dt,void 0,l,P);for(re in l)P=l[re],te=s[re],!l.hasOwnProperty(re)||P===te||P===void 0&&te===void 0||Cu(e,t,re,P,l,te);return}}for(var $ in s)P=s[$],s.hasOwnProperty($)&&P!=null&&!l.hasOwnProperty($)&&St(e,t,$,null,l,P);for(ue in l)P=l[ue],te=s[ue],!l.hasOwnProperty(ue)||P===te||P==null&&te==null||St(e,t,ue,P,l,te)}function vm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Sg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var n=s[l],i=n.transferSize,u=n.initiatorType,p=n.duration;if(i&&p&&vm(u)){for(u=0,p=n.responseEnd,l+=1;l<s.length;l++){var C=s[l],J=C.startTime;if(J>p)break;var re=C.transferSize,ue=C.initiatorType;re&&vm(ue)&&(C=C.responseEnd,u+=re*(C<p?1:(p-J)/(C-J)))}if(--l,t+=8*(i+u)/(n.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Tu=null,Ou=null;function Tc(e){return e.nodeType===9?e:e.ownerDocument}function jm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Nm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Eu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Lu=null;function Dg(){var e=window.event;return e&&e.type==="popstate"?e===Lu?!1:(Lu=e,!0):(Lu=null,!1)}var wm=typeof setTimeout=="function"?setTimeout:void 0,Mg=typeof clearTimeout=="function"?clearTimeout:void 0,km=typeof Promise=="function"?Promise:void 0,Cg=typeof queueMicrotask=="function"?queueMicrotask:typeof km<"u"?function(e){return km.resolve(null).then(e).catch(Tg)}:wm;function Tg(e){setTimeout(function(){throw e})}function Il(e){return e==="head"}function _m(e,t){var s=t,l=0;do{var n=s.nextSibling;if(e.removeChild(s),n&&n.nodeType===8)if(s=n.data,s==="/$"||s==="/&"){if(l===0){e.removeChild(n),Nn(t);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Hi(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Hi(s);for(var i=s.firstChild;i;){var u=i.nextSibling,p=i.nodeName;i[wl]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&i.rel.toLowerCase()==="stylesheet"||s.removeChild(i),i=u}}else s==="body"&&Hi(e.ownerDocument.body);s=n}while(s);Nn(t)}function Sm(e,t){var s=e;e=0;do{var l=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=l}while(s)}function Au(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Au(s),Tn(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function Og(e,t,s,l){for(;e.nodeType===1;){var n=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[wl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=ds(e.nextSibling),e===null)break}return null}function Eg(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=ds(e.nextSibling),e===null))return null;return e}function Dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ds(e.nextSibling),e===null))return null;return e}function Yu(e){return e.data==="$?"||e.data==="$~"}function zu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Lg(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var l=function(){t(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function ds(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Ru=null;function Mm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return ds(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function Cm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function Tm(e,t,s){switch(t=Tc(s),e){case"html":if(e=t.documentElement,!e)throw Error(f(452));return e;case"head":if(e=t.head,!e)throw Error(f(453));return e;case"body":if(e=t.body,!e)throw Error(f(454));return e;default:throw Error(f(451))}}function Hi(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tn(e)}var us=new Map,Om=new Set;function Oc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var jl=oe.d;oe.d={f:Ag,r:Yg,D:zg,C:Rg,L:Ug,m:Hg,X:Bg,S:qg,M:$g};function Ag(){var e=jl.f(),t=Nc();return e||t}function Yg(e){var t=Pa(e);t!==null&&t.tag===5&&t.type==="form"?Xh(t):jl.r(e)}var bn=typeof document>"u"?null:document;function Em(e,t,s){var l=bn;if(l&&typeof t=="string"&&t){var n=Ya(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof s=="string"&&(n+='[crossorigin="'+s+'"]'),Om.has(n)||(Om.add(n),e={rel:e,crossOrigin:s,href:t},l.querySelector(n)===null&&(t=l.createElement("link"),ua(t,"link",e),Jt(t),l.head.appendChild(t)))}}function zg(e){jl.D(e),Em("dns-prefetch",e,null)}function Rg(e,t){jl.C(e,t),Em("preconnect",e,t)}function Ug(e,t,s){jl.L(e,t,s);var l=bn;if(l&&e&&t){var n='link[rel="preload"][as="'+Ya(t)+'"]';t==="image"&&s&&s.imageSrcSet?(n+='[imagesrcset="'+Ya(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(n+='[imagesizes="'+Ya(s.imageSizes)+'"]')):n+='[href="'+Ya(e)+'"]';var i=n;switch(t){case"style":i=vn(e);break;case"script":i=jn(e)}us.has(i)||(e=O({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),us.set(i,e),l.querySelector(n)!==null||t==="style"&&l.querySelector(qi(i))||t==="script"&&l.querySelector(Bi(i))||(t=l.createElement("link"),ua(t,"link",e),Jt(t),l.head.appendChild(t)))}}function Hg(e,t){jl.m(e,t);var s=bn;if(s&&e){var l=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+Ya(l)+'"][href="'+Ya(e)+'"]',i=n;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=jn(e)}if(!us.has(i)&&(e=O({rel:"modulepreload",href:e},t),us.set(i,e),s.querySelector(n)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Bi(i)))return}l=s.createElement("link"),ua(l,"link",e),Jt(l),s.head.appendChild(l)}}}function qg(e,t,s){jl.S(e,t,s);var l=bn;if(l&&e){var n=_l(l).hoistableStyles,i=vn(e);t=t||"default";var u=n.get(i);if(!u){var p={loading:0,preload:null};if(u=l.querySelector(qi(i)))p.loading=5;else{e=O({rel:"stylesheet",href:e,"data-precedence":t},s),(s=us.get(i))&&Uu(e,s);var C=u=l.createElement("link");Jt(C),ua(C,"link",e),C._p=new Promise(function(J,re){C.onload=J,C.onerror=re}),C.addEventListener("load",function(){p.loading|=1}),C.addEventListener("error",function(){p.loading|=2}),p.loading|=4,Ec(u,t,l)}u={type:"stylesheet",instance:u,count:1,state:p},n.set(i,u)}}}function Bg(e,t){jl.X(e,t);var s=bn;if(s&&e){var l=_l(s).hoistableScripts,n=jn(e),i=l.get(n);i||(i=s.querySelector(Bi(n)),i||(e=O({src:e,async:!0},t),(t=us.get(n))&&Hu(e,t),i=s.createElement("script"),Jt(i),ua(i,"link",e),s.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(n,i))}}function $g(e,t){jl.M(e,t);var s=bn;if(s&&e){var l=_l(s).hoistableScripts,n=jn(e),i=l.get(n);i||(i=s.querySelector(Bi(n)),i||(e=O({src:e,async:!0,type:"module"},t),(t=us.get(n))&&Hu(e,t),i=s.createElement("script"),Jt(i),ua(i,"link",e),s.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(n,i))}}function Lm(e,t,s,l){var n=(n=Te.current)?Oc(n):null;if(!n)throw Error(f(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=vn(s.href),s=_l(n).hoistableStyles,l=s.get(t),l||(l={type:"style",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=vn(s.href);var i=_l(n).hoistableStyles,u=i.get(e);if(u||(n=n.ownerDocument||n,u={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,u),(i=n.querySelector(qi(e)))&&!i._p&&(u.instance=i,u.state.loading=5),us.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},us.set(e,s),i||Gg(n,e,s,u.state))),t&&l===null)throw Error(f(528,""));return u}if(t&&l!==null)throw Error(f(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=jn(s),s=_l(n).hoistableScripts,l=s.get(t),l||(l={type:"script",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(f(444,e))}}function vn(e){return'href="'+Ya(e)+'"'}function qi(e){return'link[rel="stylesheet"]['+e+"]"}function Am(e){return O({},e,{"data-precedence":e.precedence,precedence:null})}function Gg(e,t,s,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),ua(t,"link",s),Jt(t),e.head.appendChild(t))}function jn(e){return'[src="'+Ya(e)+'"]'}function Bi(e){return"script[async]"+e}function Ym(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Ya(s.href)+'"]');if(l)return t.instance=l,Jt(l),l;var n=O({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Jt(l),ua(l,"style",n),Ec(l,s.precedence,e),t.instance=l;case"stylesheet":n=vn(s.href);var i=e.querySelector(qi(n));if(i)return t.state.loading|=4,t.instance=i,Jt(i),i;l=Am(s),(n=us.get(n))&&Uu(l,n),i=(e.ownerDocument||e).createElement("link"),Jt(i);var u=i;return u._p=new Promise(function(p,C){u.onload=p,u.onerror=C}),ua(i,"link",l),t.state.loading|=4,Ec(i,s.precedence,e),t.instance=i;case"script":return i=jn(s.src),(n=e.querySelector(Bi(i)))?(t.instance=n,Jt(n),n):(l=s,(n=us.get(i))&&(l=O({},s),Hu(l,n)),e=e.ownerDocument||e,n=e.createElement("script"),Jt(n),ua(n,"link",l),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(f(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Ec(l,s.precedence,e));return t.instance}function Ec(e,t,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=l.length?l[l.length-1]:null,i=n,u=0;u<l.length;u++){var p=l[u];if(p.dataset.precedence===t)i=p;else if(i!==n)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Uu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Hu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Lc=null;function zm(e,t,s){if(Lc===null){var l=new Map,n=Lc=new Map;n.set(s,l)}else n=Lc,l=n.get(s),l||(l=new Map,n.set(s,l));if(l.has(e))return l;for(l.set(e,null),s=s.getElementsByTagName(e),n=0;n<s.length;n++){var i=s[n];if(!(i[wl]||i[Xe]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var u=i.getAttribute(t)||"";u=e+u;var p=l.get(u);p?p.push(i):l.set(u,[i])}}return l}function Rm(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function Vg(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Um(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Qg(e,t,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var n=vn(l.href),i=t.querySelector(qi(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ac.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=i,Jt(i);return}i=t.ownerDocument||t,l=Am(l),(n=us.get(n))&&Uu(l,n),i=i.createElement("link"),Jt(i);var u=i;u._p=new Promise(function(p,C){u.onload=p,u.onerror=C}),ua(i,"link",l),s.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Ac.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var qu=0;function Zg(e,t){return e.stylesheets&&e.count===0&&zc(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var l=setTimeout(function(){if(e.stylesheets&&zc(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&qu===0&&(qu=62500*Sg());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&zc(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>qu?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(n)}}:null}function Ac(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yc=null;function zc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yc=new Map,t.forEach(Xg,e),Yc=null,Ac.call(e))}function Xg(e,t){if(!(t.state.loading&4)){var s=Yc.get(e);if(s)var l=s.get(null);else{s=new Map,Yc.set(e,s);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<n.length;i++){var u=n[i];(u.nodeName==="LINK"||u.getAttribute("media")!=="not all")&&(s.set(u.dataset.precedence,u),l=u)}l&&s.set(null,l)}n=t.instance,u=n.getAttribute("data-precedence"),i=s.get(u)||l,i===l&&s.set(null,n),s.set(u,n),this.count++,l=Ac.bind(this),n.addEventListener("load",l),n.addEventListener("error",l),i?i.parentNode.insertBefore(n,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var $i={$$typeof:R,Provider:null,Consumer:null,_currentValue:Ne,_currentValue2:Ne,_threadCount:0};function Fg(e,t,s,l,n,i,u,p,C){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ma(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ma(0),this.hiddenUpdates=ma(null),this.identifierPrefix=l,this.onUncaughtError=n,this.onCaughtError=i,this.onRecoverableError=u,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function Hm(e,t,s,l,n,i,u,p,C,J,re,ue){return e=new Fg(e,t,s,u,C,J,re,ue,p),t=1,i===!0&&(t|=24),i=Na(3,null,null,t),e.current=i,i.stateNode=e,t=gi(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:l,isDehydrated:s,cache:t},pi(i),e}function qm(e){return e?(e=ys,e):ys}function Bm(e,t,s,l,n,i){n=qm(n),l.context===null?l.context=n:l.pendingContext=n,l=$s(t),l.payload={element:s},i=i===void 0?null:i,i!==null&&(l.callback=i),s=Gs(e,l,t),s!==null&&(Va(s,e,t),Dr(s,e,t))}function $m(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Bu(e,t){$m(e,t),(e=e.alternate)&&$m(e,t)}function Gm(e){if(e.tag===13||e.tag===31){var t=al(e,67108864);t!==null&&Va(t,e,67108864),Bu(e,67108864)}}function Vm(e){if(e.tag===13||e.tag===31){var t=Ia();t=zr(t);var s=al(e,t);s!==null&&Va(s,e,t),Bu(e,t)}}var Rc=!0;function Wg(e,t,s,l){var n=B.T;B.T=null;var i=oe.p;try{oe.p=2,$u(e,t,s,l)}finally{oe.p=i,B.T=n}}function Jg(e,t,s,l){var n=B.T;B.T=null;var i=oe.p;try{oe.p=8,$u(e,t,s,l)}finally{oe.p=i,B.T=n}}function $u(e,t,s,l){if(Rc){var n=Gu(l);if(n===null)Mu(e,t,l,Uc,s),Zm(e,l);else if(Ig(n,e,t,s,l))l.stopPropagation();else if(Zm(e,l),t&4&&-1<Kg.indexOf(e)){for(;n!==null;){var i=Pa(n);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var u=I(i.pendingLanes);if(u!==0){var p=i;for(p.pendingLanes|=2,p.entangledLanes|=2;u;){var C=1<<31-kt(u);p.entanglements[1]|=C,u&=~C}Zs(i),(vt&6)===0&&(vc=le()+500,zi(0))}}break;case 31:case 13:p=al(i,2),p!==null&&Va(p,i,2),Nc(),Bu(i,2)}if(i=Gu(l),i===null&&Mu(e,t,l,Uc,s),i===n)break;n=i}n!==null&&l.stopPropagation()}else Mu(e,t,l,null,s)}}function Gu(e){return e=Yn(e),Vu(e)}var Uc=null;function Vu(e){if(Uc=null,e=Za(e),e!==null){var t=v(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=H(t),e!==null)return e;e=null}else if(s===31){if(e=S(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Uc=e,null}function Qm(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(_e()){case Ee:return 2;case ft:return 8;case he:case ot:return 32;case Ge:return 268435456;default:return 32}default:return 32}}var Qu=!1,Pl=null,er=null,tr=null,Gi=new Map,Vi=new Map,ar=[],Kg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Zm(e,t){switch(e){case"focusin":case"focusout":Pl=null;break;case"dragenter":case"dragleave":er=null;break;case"mouseover":case"mouseout":tr=null;break;case"pointerover":case"pointerout":Gi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vi.delete(t.pointerId)}}function Qi(e,t,s,l,n,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:s,eventSystemFlags:l,nativeEvent:i,targetContainers:[n]},t!==null&&(t=Pa(t),t!==null&&Gm(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function Ig(e,t,s,l,n){switch(t){case"focusin":return Pl=Qi(Pl,e,t,s,l,n),!0;case"dragenter":return er=Qi(er,e,t,s,l,n),!0;case"mouseover":return tr=Qi(tr,e,t,s,l,n),!0;case"pointerover":var i=n.pointerId;return Gi.set(i,Qi(Gi.get(i)||null,e,t,s,l,n)),!0;case"gotpointercapture":return i=n.pointerId,Vi.set(i,Qi(Vi.get(i)||null,e,t,s,l,n)),!0}return!1}function Xm(e){var t=Za(e.target);if(t!==null){var s=v(t);if(s!==null){if(t=s.tag,t===13){if(t=H(s),t!==null){e.blockedOn=t,La(e.priority,function(){Vm(s)});return}}else if(t===31){if(t=S(s),t!==null){e.blockedOn=t,La(e.priority,function(){Vm(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Gu(e.nativeEvent);if(s===null){s=e.nativeEvent;var l=new s.constructor(s.type,s);Br=l,s.target.dispatchEvent(l),Br=null}else return t=Pa(s),t!==null&&Gm(t),e.blockedOn=s,!1;t.shift()}return!0}function Fm(e,t,s){Hc(e)&&s.delete(t)}function Pg(){Qu=!1,Pl!==null&&Hc(Pl)&&(Pl=null),er!==null&&Hc(er)&&(er=null),tr!==null&&Hc(tr)&&(tr=null),Gi.forEach(Fm),Vi.forEach(Fm)}function qc(e,t){e.blockedOn===t&&(e.blockedOn=null,Qu||(Qu=!0,c.unstable_scheduleCallback(c.unstable_NormalPriority,Pg)))}var Bc=null;function Wm(e){Bc!==e&&(Bc=e,c.unstable_scheduleCallback(c.unstable_NormalPriority,function(){Bc===e&&(Bc=null);for(var t=0;t<e.length;t+=3){var s=e[t],l=e[t+1],n=e[t+2];if(typeof l!="function"){if(Vu(l||s)===null)continue;break}var i=Pa(s);i!==null&&(e.splice(t,3),t-=3,Gd(i,{pending:!0,data:n,method:s.method,action:l},l,n))}}))}function Nn(e){function t(C){return qc(C,e)}Pl!==null&&qc(Pl,e),er!==null&&qc(er,e),tr!==null&&qc(tr,e),Gi.forEach(t),Vi.forEach(t);for(var s=0;s<ar.length;s++){var l=ar[s];l.blockedOn===e&&(l.blockedOn=null)}for(;0<ar.length&&(s=ar[0],s.blockedOn===null);)Xm(s),s.blockedOn===null&&ar.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var n=s[l],i=s[l+1],u=n[Et]||null;if(typeof i=="function")u||Wm(s);else if(u){var p=null;if(i&&i.hasAttribute("formAction")){if(n=i,u=i[Et]||null)p=u.formAction;else if(Vu(n)!==null)continue}else p=u.action;typeof p=="function"?s[l+1]=p:(s.splice(l,3),l-=3),Wm(s)}}}function Jm(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(u){return n=u})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function Zu(e){this._internalRoot=e}$c.prototype.render=Zu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(f(409));var s=t.current,l=Ia();Bm(s,l,e,t,null,null)},$c.prototype.unmount=Zu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bm(e.current,2,null,e,null,null),Nc(),t[ga]=null}};function $c(e){this._internalRoot=e}$c.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xt();e={blockedOn:null,target:e,priority:t};for(var s=0;s<ar.length&&t!==0&&t<ar[s].priority;s++);ar.splice(s,0,e),s===0&&Xm(e)}};var Km=b.version;if(Km!=="19.2.0")throw Error(f(527,Km,"19.2.0"));oe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(f(188)):(e=Object.keys(e).join(","),Error(f(268,e)));return e=_(t),e=e!==null?G(e):null,e=e===null?null:e.stateNode,e};var ex={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gc.isDisabled&&Gc.supportsFiber)try{ta=Gc.inject(ex),At=Gc}catch{}}return Xi.createRoot=function(e,t){if(!g(e))throw Error(f(299));var s=!1,l="",n=sf,i=lf,u=rf;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(u=t.onRecoverableError)),t=Hm(e,1,!1,null,null,s,l,null,n,i,u,Jm),e[ga]=t.current,Du(e),new Zu(t)},Xi.hydrateRoot=function(e,t,s){if(!g(e))throw Error(f(299));var l=!1,n="",i=sf,u=lf,p=rf,C=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(n=s.identifierPrefix),s.onUncaughtError!==void 0&&(i=s.onUncaughtError),s.onCaughtError!==void 0&&(u=s.onCaughtError),s.onRecoverableError!==void 0&&(p=s.onRecoverableError),s.formState!==void 0&&(C=s.formState)),t=Hm(e,1,!0,t,s??null,l,n,C,i,u,p,Jm),t.context=qm(null),s=t.current,l=Ia(),l=zr(l),n=$s(l),n.callback=null,Gs(s,n,l),s=l,t.current.lanes=s,Zt(t,s),Zs(t),e[ga]=t.current,Du(e),new $c(t)},Xi.version="19.2.0",Xi}var i0;function ux(){if(i0)return Wu.exports;i0=1;function c(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(b){console.error(b)}}return c(),Wu.exports=dx(),Wu.exports}var hx=ux();const fx=ch(hx),mx=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),a.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),a.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),hs=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),a.jsx("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),a.jsx("line",{x1:"8",y1:"18",x2:"21",y2:"18"}),a.jsx("line",{x1:"3",y1:"6",x2:"3.01",y2:"6"}),a.jsx("line",{x1:"3",y1:"12",x2:"3.01",y2:"12"}),a.jsx("line",{x1:"3",y1:"18",x2:"3.01",y2:"18"})]}),ya=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M12 22a10 10 0 1 0-10-10"}),a.jsx("path",{d:"M2 12h20"}),a.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),Ws=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("circle",{cx:"9",cy:"21",r:"1"}),a.jsx("circle",{cx:"20",cy:"21",r:"1"}),a.jsx("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),uh=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("circle",{cx:"12",cy:"12",r:"5"}),a.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),a.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),a.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),a.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),a.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),a.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),a.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),a.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}),hh=({className:c})=>a.jsx("svg",{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",className:c,children:a.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),gx=({className:c})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:c,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})}),ro=({className:c})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:c,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.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"})}),fa=({className:c})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:c,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),xx=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("rect",{x:"3",y:"3",width:"7",height:"7"}),a.jsx("rect",{x:"14",y:"3",width:"7",height:"7"}),a.jsx("rect",{x:"14",y:"14",width:"7",height:"7"}),a.jsx("rect",{x:"3",y:"14",width:"7",height:"7"})]}),Js=({className:c,style:b})=>a.jsxs("svg",{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",className:c,style:b,children:[a.jsx("line",{x1:"16.5",y1:"9.4",x2:"7.5",y2:"4.2"}),a.jsx("path",{d:"M21 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.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),a.jsx("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),a.jsx("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),va=({className:c,style:b,width:N=24,height:f=24})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:c,style:b,width:N,height:f,children:a.jsx("path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1.5-1.5-3-1-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z"})}),px=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M2 9a3 3 0 0 1 0 6v5a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5a3 3 0 0 1 0-6V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"}),a.jsx("path",{d:"M13 5v2"}),a.jsx("path",{d:"M13 17v2"}),a.jsx("path",{d:"M13 11v2"})]}),Ta=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),yx=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),a.jsx("polyline",{points:"16 17 21 12 16 7"}),a.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),yt=({className:c})=>a.jsx("svg",{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",className:c,children:a.jsx("polyline",{points:"6 9 12 15 18 9"})}),fh=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M5 12h14"}),a.jsx("path",{d:"m12 5 7 7-7 7"})]}),Ic=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"16"}),a.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]}),Fe=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),a.jsx("circle",{cx:"12",cy:"10",r:"3"})]}),B0=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),a.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),no=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]}),Vc=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),a.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),a.jsx("path",{d:"M12 11h4"}),a.jsx("path",{d:"M12 16h4"}),a.jsx("path",{d:"M8 11h.01"}),a.jsx("path",{d:"M8 16h.01"})]}),Mn=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242"}),a.jsx("path",{d:"M12 12v9"}),a.jsx("path",{d:"m16 16-4-4-4 4"})]}),ao=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("polyline",{points:"4 7 4 4 20 4 20 7"}),a.jsx("line",{x1:"9",y1:"20",x2:"15",y2:"20"}),a.jsx("line",{x1:"12",y1:"4",x2:"12",y2:"20"})]}),Qa=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z"}),a.jsx("path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z"}),a.jsx("path",{d:"M7 21h10"}),a.jsx("path",{d:"M12 3v18"}),a.jsx("path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2"})]}),so=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z"}),a.jsx("path",{d:"M7 7h.01"})]}),ba=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"22"}),a.jsx("path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})]}),Ks=({className:c})=>a.jsx("svg",{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",className:c,children:a.jsx("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"})}),Oa=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),io=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"22",y1:"12",x2:"18",y2:"12"}),a.jsx("line",{x1:"6",y1:"12",x2:"2",y2:"12"}),a.jsx("line",{x1:"12",y1:"6",x2:"12",y2:"2"}),a.jsx("line",{x1:"12",y1:"22",x2:"12",y2:"18"})]}),Os=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),a.jsx("polyline",{points:"9 22 9 12 15 12 15 22"})]}),mh=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("rect",{x:"2",y:"7",width:"20",height:"14",rx:"2",ry:"2"}),a.jsx("path",{d:"M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"})]}),Yr=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),a.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),a.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),a.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),gh=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),a.jsx("path",{d:"M3 11V6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5"}),a.jsx("path",{d:"M8 6V4"}),a.jsx("path",{d:"M16 6V4"}),a.jsx("circle",{cx:"6",cy:"16",r:"2"}),a.jsx("circle",{cx:"18",cy:"16",r:"2"})]}),xh=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M16 18h2a2 2 0 0 0 2-2V8a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v8a2 2 0 0 0 2 2h2"}),a.jsx("path",{d:"M6 18h12"}),a.jsx("path",{d:"M18 14h-5"}),a.jsx("path",{d:"M6 14h.01"}),a.jsx("path",{d:"M10 4v2"}),a.jsx("path",{d:"M14 4v2"}),a.jsx("path",{d:"M8 18v2"}),a.jsx("path",{d:"M16 18v2"})]}),lo=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M14 16.5 12 14l-2 2.5"}),a.jsx("path",{d:"M14 16.5a2 2 0 0 1-4 0"}),a.jsx("path",{d:"M18 19H6a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2Z"}),a.jsx("path",{d:"M7 12V8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v4"})]}),o0=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.72"}),a.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.72-1.72"})]}),ed=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),a.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]}),to=({className:c})=>a.jsx("svg",{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",className:c,children:a.jsx("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})}),bx=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),a.jsx("polyline",{points:"12 19 5 12 12 5"})]}),vx=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}),a.jsx("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),a.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),a.jsx("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]}),ph=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("polyline",{points:"3 6 5 6 21 6"}),a.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),a.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),a.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]}),jx=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"}),a.jsx("polyline",{points:"13 2 13 9 20 9"})]}),Nx=({className:c})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",className:c,children:a.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),wx=({className:c})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",className:c,children:[a.jsx("rect",{x:"6",y:"4",width:"4",height:"16"}),a.jsx("rect",{x:"14",y:"4",width:"4",height:"16"})]}),Cn=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),a.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),kx=({className:c})=>a.jsxs("svg",{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",className:c,children:[a.jsx("path",{d:"M3 18v-6a9 9 0 0 1 18 0v6"}),a.jsx("path",{d:"M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"})]}),$0=({className:c})=>a.jsx("svg",{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",className:c,children:a.jsx("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})}),G0=({className:c})=>a.jsx("svg",{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",className:c,children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}),c0=({className:c})=>a.jsx("svg",{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",className:c,children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}),_x=[{name:"داشبورد",icon:xx,id:"dashboard"},{name:"مرسولات",icon:Js,id:"shipments",children:[{name:"ثبت مرسوله",id:"register-shipment"},{name:"لیست درخواست‌های من",id:"my-shipment-requests"}]},{name:"سفر ها",icon:va,id:"trips",children:[{name:"ثبت سفر",id:"register-trip"},{name:"لیست سفرهای من",id:"my-trips"}]},{name:"خرید اینترنتی",icon:Ws,id:"online-purchase",children:[{name:"ثبت خرید اینترنتی",id:"register-online-purchase"},{name:"لیست درخواست‌های من",id:"my-purchase-requests"}]},{name:"پیام ها",icon:ro,id:"messages"},{name:"تیکت‌ها",icon:px,id:"tickets-parent",children:[{name:"لیست تیکت‌ها",id:"tickets"},{name:"ارسال تیکت جدید",id:"new-ticket"}]},{name:"حساب کاربری",icon:Ta,id:"account"},{name:"خروج",icon:yx,id:"logout"}],Sx=({isOpen:c,currentPage:b,onNavigate:N})=>{const[f,g]=y.useState(""),v=S=>{g(T=>T===S?"":S)},H=S=>{N(S)};return a.jsxs("aside",{className:`bg-custom-light-card dark:bg-custom-dark-blue-light w-64 p-6 flex flex-col h-screen fixed lg:sticky top-0 right-0 z-40 transition-transform duration-300 ease-in-out ${c?"translate-x-0":"translate-x-full"} lg:translate-x-0`,children:[a.jsx("div",{className:"flex items-center justify-between mb-10",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(mh,{className:"w-10 h-10 text-custom-purple"}),a.jsx("span",{className:"text-2xl font-bold text-gray-800 dark:text-white mr-2",children:"اینوببر"})]})}),a.jsx("nav",{className:"flex-grow",children:a.jsx("ul",{children:_x.map(S=>{var O;const T=(O=S.children)==null?void 0:O.some(Z=>Z.id===b),_=f===S.id;if(S.children)return a.jsxs("li",{className:"my-1",children:[a.jsxs("div",{className:`flex items-center justify-between p-3 cursor-pointer rounded-lg transition-colors ${T?"text-custom-purple":"hover:bg-gray-100 dark:hover:bg-custom-dark-blue"}`,onClick:()=>v(S.id),children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(S.icon,{className:"w-5 h-5 ml-3"}),a.jsx("span",{className:`${T?"font-semibold":""}`,children:S.name})]}),a.jsx(yt,{className:`w-5 h-5 transition-transform ${_?"rotate-180":""}`})]}),_&&a.jsx("ul",{className:"mr-6 mt-1 border-r-2 border-gray-200 dark:border-gray-600",children:S.children.map(Z=>{const X=b===Z.id;return a.jsxs("li",{className:`p-2 pr-4 my-1 cursor-pointer rounded-r-lg transition-colors relative ${X?"bg-custom-purple/10 text-custom-purple":"hover:bg-gray-100 dark:hover:bg-custom-dark-blue"}`,onClick:()=>H(Z.id),children:[X&&a.jsx("div",{className:"absolute right-0 top-0 h-full w-1 bg-custom-purple rounded-r-full"}),a.jsx("span",{className:`${X?"font-bold":""}`,children:Z.name})]},Z.id)})})]},S.id);const G=b===S.id;return a.jsxs("li",{className:`flex items-center p-3 my-1 cursor-pointer transition-colors ${G?"bg-custom-purple text-white rounded-lg":"rounded-lg hover:bg-gray-100 dark:hover:bg-custom-dark-blue"}`,onClick:()=>H(S.id),children:[a.jsx(S.icon,{className:"w-5 h-5 ml-3"}),a.jsx("span",{className:`flex-grow ${G?"font-semibold":""}`,children:S.name})]},S.id)})})})]})},Dx=({onMenuClick:c,theme:b,toggleTheme:N,onNavigate:f})=>a.jsxs("header",{className:"flex items-center justify-between p-4 sm:p-4 lg:p-4 bg-custom-light-card dark:bg-custom-dark-blue-light shadow-md dark:shadow-none sticky top-0 z-20",children:[a.jsx("div",{className:"flex items-center",children:a.jsx("button",{onClick:c,className:"lg:hidden text-gray-500 dark:text-gray-400 mr-4","aria-label":"Open menu",children:a.jsx(mx,{className:"w-6 h-6"})})}),a.jsxs("div",{className:"flex items-center space-x-2 sm:space-x-4 space-x-reverse",children:[a.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-3 space-x-reverse",children:[a.jsxs("button",{onClick:()=>f("messages"),className:"p-2 bg-custom-light-bg dark:bg-custom-dark-blue-light rounded-full cursor-pointer relative","aria-label":"Messages",children:[a.jsx(gx,{className:"h-6 w-6 text-gray-600 dark:text-gray-300"}),a.jsx("span",{className:"absolute top-0 right-0 block h-2 w-2 rounded-full ring-2 ring-custom-light-card dark:ring-custom-dark-blue-light bg-custom-orange"})]}),a.jsx("button",{onClick:N,className:"p-2 bg-custom-light-bg dark:bg-custom-dark-blue-light rounded-full cursor-pointer","aria-label":"Toggle theme",children:b==="dark"?a.jsx(uh,{className:"h-6 w-6 text-yellow-400"}):a.jsx(hh,{className:"h-6 w-6 text-gray-800"})})]}),a.jsx("img",{src:"https://picsum.photos/id/64/100/100",alt:"User Avatar",className:"w-12 h-12 rounded-full"})]})]}),et="https://panel.eifa.site/public/api",d0=({onNavigate:c})=>{const[b,N]=y.useState([]),[f,g]=y.useState(!0),[v,H]=y.useState(""),[S,T]=y.useState("all"),[_,G]=y.useState("all"),O=Q=>{if(!Q)return"تاریخ نامعلوم";const M=new Date(Q),j=new Date().getTime()-M.getTime(),R=Math.floor(j/6e4),U=Math.floor(j/36e5),de=Math.floor(j/864e5);return R<1?"الان":R<60?`${R} دقیقه پیش`:U<24?`${U} ساعت پیش`:de<7?`${de} روز پیش`:new Intl.DateTimeFormat("fa-IR",{day:"numeric",month:"short"}).format(M)},Z=async()=>{var Q;try{g(!0);const[M,m,j,R,U,de]=await Promise.all([X(`${et}/online-purchase/my-requests`),X(`${et}/online-purchase/my-shopper`),X(`${et}/shipments/my-list`),X(`${et}/trips/my-trips`),X(`${et}/trips/my-companions`),X(`${et}/tickets`)]),pe=[];if(M.ok&&((await M.json()).data||[]).forEach(F=>{pe.push({id:`pr-${F.id}`,type:"purchase-request",title:F.title||"درخواست خرید بدون عنوان",status:F.status==="active"?"active":"pending",time:O(F.created_at),rawDate:F.created_at,icon:Ws,color:"cyan",detailRoute:"purchase-request-detail",detailId:F.id})}),m.ok){const z=await m.json();if(z.data){const F=z.data;pe.push({id:`po-${F.id}`,type:"purchase-offer",title:((Q=F.service_title)==null?void 0:Q.trim())||`آماده خرید از ${F.country||"کشور نامشخص"}`,status:F.status==="active"?"active":"pending",time:O(F.created_at||F.updated_at),rawDate:F.created_at||F.updated_at,icon:Ta,color:"orange",detailRoute:"purchase-shopper-detail",detailId:F.id})}}if(j.ok&&((await j.json()).data||[]).forEach(F=>{pe.push({id:`sh-${F.id}`,type:F.type==="send"?"shipment-send":"shipment-carry",title:F.title,status:F.status,time:O(F.created_at),rawDate:F.created_at,icon:F.type==="send"?Js:va,color:F.type==="send"?"cyan":"orange",detailRoute:"shipment-detail",detailId:F.id})}),R.ok&&((await R.json()).data||[]).forEach(F=>{pe.push({id:`tr-${F.id}`,type:"trip",title:`سفر از ${F.origin_city} به ${F.destination_city}`,status:F.status==="active"?"active":F.status==="completed"?"completed":"pending",time:O(F.created_at),rawDate:F.created_at,icon:va,color:"orange",detailRoute:"trip-detail",detailId:F.id})}),U.ok&&((await U.json()).data||[]).forEach(F=>{pe.push({id:`co-${F.id}`,type:"companion",title:`همسفر: ${F.origin_city} → ${F.destination_city}`,status:F.status==="active"?"active":F.status==="completed"?"completed":"pending",time:O(F.created_at),rawDate:F.created_at,icon:Ta,color:"cyan",detailRoute:"trip-detail",detailId:F.id})}),de.ok){const z=await de.json();if(Array.isArray(z.data)){const F={open:"pending",pending:"pending",in_progress:"pending",answered:"answered",closed:"closed"};z.data.forEach(ke=>{pe.push({id:`tk-${ke.id}`,type:"ticket",title:ke.subject||"بدون عنوان",status:F[ke.status]||"pending",time:O(ke.updated_at||ke.created_at),rawDate:ke.updated_at||ke.created_at,icon:c0,color:F[ke.status]==="answered"?"green":F[ke.status]==="closed"?"gray":"orange",detailRoute:"ticket-detail",detailId:ke.id})})}}pe.sort((z,F)=>new Date(F.rawDate).getTime()-new Date(z.rawDate).getTime()),N(pe)}catch(M){console.error("Error fetching dashboard data:",M)}finally{g(!1)}},X=Q=>Cx(Q);y.useEffect(()=>{Z()},[]);const V={total:b.length,active:b.filter(Q=>Q.status==="active"||Q.status==="answered").length,pending:b.filter(Q=>Q.status==="pending").length,tickets:b.filter(Q=>Q.type==="ticket").length};return a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"داشبورد من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"خلاصه‌ی فعالیت‌های شما در یک نما"})]}),a.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-6 gap-4",children:[{icon:Ic,title:"ثبت مرسوله جدید",color:"purple",page:"register-shipment"},{icon:Vc,title:"مرسوله‌های من",color:"cyan",page:"my-shipment-requests"},{icon:Ic,title:"ثبت سفر جدید",color:"orange",page:"register-trip"},{icon:Vc,title:"سفرهای من",color:"pink",page:"my-trips"},{icon:Ic,title:"ثبت خرید اینترنتی",color:"green",page:"register-online-purchase"},{icon:Vc,title:"خریدهای من",color:"blue",page:"my-purchase-requests"}].map((Q,M)=>a.jsx(Mx,{icon:Q.icon,title:Q.title,color:Q.color,pageId:Q.page,onNavigate:c},M))}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsx(Qc,{icon:B0,title:"فعال/پاسخ داده شده",value:V.active,variant:"green"}),a.jsx(Qc,{icon:Cn,title:"در انتظار",value:V.pending,variant:"orange"}),a.jsx(Qc,{icon:c0,title:"تیکت‌های باز",value:V.tickets,variant:"blue"}),a.jsx(Qc,{icon:Vc,title:"کل فعالیت‌ها",value:V.total,variant:"purple"})]})]})},Mx=({icon:c,title:b,description:N,color:f,pageId:g,onNavigate:v})=>{const H={purple:"from-custom-purple to-custom-light-purple",cyan:"from-custom-cyan to-teal-400",orange:"from-custom-orange to-amber-400",pink:"from-custom-pink to-rose-400",green:"from-green-500 to-emerald-400",blue:"from-blue-500 to-sky-400"};return a.jsxs("div",{onClick:()=>v(g),className:`relative bg-gradient-to-br ${H[f]} p-4 rounded-2xl text-white shadow-lg hover:shadow-xl hover:scale-[1.02] transform transition-all duration-300 cursor-pointer overflow-hidden group`,children:[a.jsx(c,{className:"absolute -right-2 -top-2 w-16 h-16 text-white/10 transform rotate-12"}),a.jsxs("div",{className:"relative z-10",children:[a.jsx("div",{className:"bg-white/20 w-10 h-10 rounded-full flex items-center justify-center mb-2",children:a.jsx(c,{className:"w-5 h-5"})}),a.jsx("h3",{className:"font-bold text-sm",children:b}),N&&a.jsx("p",{className:"opacity-80 mt-1 text-xs",children:N})]})]})},Qc=({icon:c,title:b,value:N,variant:f="purple"})=>{const g={green:"text-green-500",orange:"text-custom-orange",blue:"text-blue-500",purple:"text-custom-purple"};return a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl flex items-center",children:[a.jsx("div",{className:"p-2 bg-custom-light-bg dark:bg-custom-dark-blue rounded-full ml-3",children:a.jsx(c,{className:`w-5 h-5 ${g[f]}`})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-xs",children:b}),a.jsx("p",{className:"text-xl font-bold text-gray-900 dark:text-white",children:N})]})]})},Cx=(c,b={})=>fetch(c,{...b,headers:{"X-Auth-Token":localStorage.getItem("auth_token"),"Content-Type":"application/json",...b.headers}}),u0={registerShipment:(c,b=[])=>{const N=new FormData;return Object.keys(c).forEach(f=>{typeof c[f]=="object"&&c[f]!==null?Object.keys(c[f]).forEach(g=>{N.append(`${f}[${g}]`,c[f][g])}):N.append(f,c[f])}),b.forEach((f,g)=>{N.append(`images[${g}]`,f)}),fetch(`${et}/shipments/register`,{method:"POST",headers:{"X-Auth-Token":localStorage.getItem("auth_token")},body:N})},registerCarryTrip:c=>{const b=new FormData;return Object.keys(c).forEach(N=>{typeof c[N]=="object"&&c[N]!==null?Object.keys(c[N]).forEach(f=>{b.append(`${N}[${f}]`,c[N][f])}):b.append(N,c[N])}),fetch(`${et}/shipments/carry`,{method:"POST",headers:{"X-Auth-Token":localStorage.getItem("auth_token")},body:b})}},Tx=({showError:c,showSuccess:b})=>{const[N,f]=y.useState("send"),[g,v]=y.useState("fixed"),[H,S]=y.useState("IRT"),[T,_]=y.useState(!1),[G,O]=y.useState([]),[Z,X]=y.useState({isOpen:!1,field:null}),[V,Q]=y.useState(null),[M,m]=y.useState(null),[j,R]=y.useState(""),[U,de]=y.useState(""),[pe,z]=y.useState(""),[F,ke]=y.useState(""),[ye,ne]=y.useState(""),[E,fe]=y.useState(""),[be,me]=y.useState(""),[B,oe]=y.useState(""),[Ne,Ae]=y.useState(""),[De,w]=y.useState(""),[q,K]=y.useState(""),[xe,ee]=y.useState(""),[Te,ze]=y.useState(""),[Be,k]=y.useState(""),[A,ae]=y.useState(""),[ie,we]=y.useState(""),[Ce,We]=y.useState(!1),Je=V?`${V.lat.toFixed(5)}, ${V.lng.toFixed(5)}`:"",st=M?`${M.lat.toFixed(5)}, ${M.lng.toFixed(5)}`:"",$t=[{value:"IRT",label:"تومان"},{value:"USD",label:"دلار آمریکا"},{value:"CAD",label:"دلار کانادا"},{value:"IQD",label:"دینار"}];y.useEffect(()=>{Q(null),m(null),R(""),de(""),z(""),ke(""),ne(""),fe(""),w(""),K(""),ee(""),ze(""),k(""),me(""),oe(""),Ae(""),ae(""),we(""),O([]),v("fixed"),S("IRT"),_(!1)},[N]);const Gt=he=>{const ot=he.target.files;if(ot){const Ge=Array.from(ot).map(Lt=>({id:Date.now()+Math.random(),url:URL.createObjectURL(Lt),file:Lt}));O(Lt=>[...Lt,...Ge])}},Vt=he=>{O(ot=>ot.filter(Ge=>Ge.id!==he))},bt=y.useCallback(he=>{he.preventDefault(),he.stopPropagation();const ot=he.dataTransfer.files;if(ot&&ot.length>0){const Ge=Array.from(ot).filter(Lt=>Lt.type.startsWith("image/")).map(Lt=>({id:Date.now()+Math.random(),url:URL.createObjectURL(Lt),file:Lt}));O(Lt=>[...Lt,...Ge])}},[]),ea=he=>{he.preventDefault(),he.stopPropagation()},Se=he=>{X({isOpen:!0,field:he})},le=()=>{X({isOpen:!1,field:null})},_e=he=>{Z.field==="origin"?Q(he):Z.field==="destination"&&m(he),le()},Ee=async he=>{he.preventDefault(),We(!0);try{const ot={origin:{country:j,city:U,address:pe,coordinates:V?`${V.lat},${V.lng}`:""},destination:{country:F,city:ye,address:E,coordinates:M?`${M.lat},${M.lng}`:""},price_type:g,show_phone:T?1:0};g==="fixed"&&(ot.currency=H,N==="send"?ot.amount=Be:ot.amount=ie);let Ge;if(N==="send"){const Re={...ot,title:De,description:q,weight:xe,category:Te};Ge=await u0.registerShipment(Re,G.map(ta=>ta.file))}else{const Re=At=>{if(!At)return null;const[Wt,kt,ge]=At.split("/").map(Number);return new Date(Wt+621,kt-1,ge).toISOString().split("T")[0]},ta={...ot,departure_date:Re(be),arrival_date:B?Re(B):null,carry_weight_capacity:A,trip_description:Ne||""};Ge=await u0.registerCarryTrip(ta)}const Lt=await Ge.json();if(!Ge.ok){const Re=Lt.errors?Object.values(Lt.errors)[0]:Lt.message;c(Array.isArray(Re)?Re[0]:Re);return}b("با موفقیت ثبت شد!"),ft()}catch(ot){c("خطای اتصال به سرور"),console.error(ot)}finally{We(!1)}},ft=()=>{Q(null),m(null),R(""),de(""),z(""),ke(""),ne(""),fe(""),w(""),K(""),ee(""),ze(""),k(""),me(""),oe(""),Ae(""),ae(""),we(""),O([]),_(!1),v("fixed"),S("IRT")};return a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:N==="send"?"ثبت مرسوله جدید":"ثبت سفر جدید"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:N==="send"?"اطلاعات مرسوله خود را برای حمل وارد کنید.":"اطلاعات سفر خود را برای حمل مرسوله وارد کنید."})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-center text-gray-800 dark:text-gray-200",children:"نوع فعالیت خود را انتخاب کنید"}),a.jsx("div",{className:"max-w-sm mx-auto",children:a.jsx("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl shadow-inner p-1",children:a.jsxs("div",{className:"relative flex rounded-lg overflow-hidden",children:[a.jsx("span",{className:`absolute top-0 bottom-0 right-0 w-1/2 bg-custom-purple rounded-lg shadow-md transition-transform duration-300 ease-in-out ${N==="carry"?"-translate-x-full":"translate-x-0"}`,"aria-hidden":"true"}),a.jsxs("button",{type:"button",onClick:()=>f("send"),className:`relative z-10 flex w-1/2 items-center justify-center gap-2 rounded-lg py-2.5 text-md font-semibold transition-colors duration-300 ${N==="send"?"text-white":"text-gray-600 dark:text-gray-300"}`,"aria-label":"ارسال مرسوله",children:[a.jsx(Js,{className:"h-5 w-5"}),a.jsx("span",{children:"ارسال مرسوله"})]}),a.jsxs("button",{type:"button",onClick:()=>f("carry"),className:`relative z-10 flex w-1/2 items-center justify-center gap-2 rounded-lg py-2.5 text-md font-semibold transition-colors duration-300 ${N==="carry"?"text-white":"text-gray-600 dark:text-gray-300"}`,"aria-label":"حمل مرسوله",children:[a.jsx(va,{className:"h-5 w-5"}),a.jsx("span",{children:"حمل مرسوله"})]})]})})})]}),N==="send"?a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-1 space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"تصاویر مرسوله"}),a.jsxs("label",{htmlFor:"file-upload",className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer bg-custom-light-bg dark:bg-custom-dark-blue hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",onDrop:bt,onDragOver:ea,children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[a.jsx(Mn,{className:"w-10 h-10 mb-3 text-gray-400"}),a.jsxs("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[a.jsx("span",{className:"font-semibold",children:"برای آپلود کلیک کنید"})," یا بکشید و رها کنید"]}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"PNG, JPG or GIF (MAX. 800x400px)"})]}),a.jsx("input",{id:"file-upload",type:"file",className:"hidden",multiple:!0,accept:"image/*",onChange:Gt})]})]}),G.length>0&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"پیش‌نمایش"}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:G.map(he=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:he.url,alt:"Preview",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{onClick:()=>Vt(he.id),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(Oa,{className:"w-4 h-4"})})]},he.id))})]})]}),a.jsx("div",{className:"lg:col-span-2",children:a.jsxs("form",{onSubmit:Ee,className:"space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۱. اطلاعات اصلی مرسوله"}),a.jsxs("div",{className:"mt-6 space-y-6",children:[a.jsx(Ca,{icon:ao,id:"title",placeholder:"مثال: کتاب‌های درسی",label:"عنوان مرسوله",value:De,onChange:he=>w(he.target.value)}),a.jsx(f0,{icon:hs,id:"description",placeholder:"جزئیات بیشتر در مورد مرسوله، شرایط نگهداری و...",label:"توضیحات (اختیاری)",value:q,onChange:he=>K(he.target.value)}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(Ca,{icon:Qa,id:"weight",placeholder:"به کیلوگرم",label:"وزن تقریبی",type:"number",value:xe,onChange:he=>ee(he.target.value)}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"category",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"دسته‌بندی"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(so,{className:"w-5 h-5 text-gray-400"})}),a.jsxs("select",{id:"category",value:Te,onChange:he=>ze(he.target.value),className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",children:[a.jsx("option",{value:"",children:"انتخاب کنید"}),a.jsx("option",{value:"documents",children:"مدارک و اسناد"}),a.jsx("option",{value:"electronics",children:"لوازم الکترونیکی"}),a.jsx("option",{value:"clothing",children:"پوشاک"}),a.jsx("option",{value:"furniture",children:"اثاثیه منزل"}),a.jsx("option",{value:"miscellaneous",children:"متفرقه"})]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]})]})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۲. مبدأ و مقصد"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مبدأ"}),a.jsx(Zc,{onButtonClick:()=>Se("origin"),value:Je,id:"origin",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Ca,{icon:ya,id:"origin_country",placeholder:"مثال: ایران",label:"کشور",value:j,onChange:he=>R(he.target.value)}),a.jsx(Ca,{icon:Fe,id:"origin_city",placeholder:"مثال: تهران",label:"شهر",value:U,onChange:he=>de(he.target.value)})]}),a.jsx(Ca,{icon:Os,id:"origin_address",placeholder:"آدرس کامل، پلاک و واحد",label:"آدرس دستی",value:pe,onChange:he=>z(he.target.value)})]}),a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مقصد"}),a.jsx(Zc,{onButtonClick:()=>Se("destination"),value:st,id:"destination",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Ca,{icon:ya,id:"destination_country",placeholder:"مثال: کانادا",label:"کشور",value:F,onChange:he=>ke(he.target.value)}),a.jsx(Ca,{icon:Fe,id:"destination_city",placeholder:"مثال: تورنتو",label:"شهر",value:ye,onChange:he=>ne(he.target.value)})]}),a.jsx(Ca,{icon:Os,id:"destination_address",placeholder:"آدرس کامل، پلاک و واحد",label:"آدرس دستی",value:E,onChange:he=>fe(he.target.value)})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. قیمت‌گذاری و اطلاعات تماس"}),a.jsxs("div",{className:"mt-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"قیمت"}),a.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[a.jsxs("div",{className:"flex-1 grid grid-cols-2 gap-2 bg-custom-light-bg dark:bg-custom-dark-blue p-1 rounded-lg",children:[a.jsx("button",{type:"button",onClick:()=>v("fixed"),className:`px-4 py-2 rounded-md text-sm font-semibold transition ${g==="fixed"?"bg-custom-purple text-white shadow":"text-gray-600 dark:text-gray-300"}`,children:"قیمت ثابت"}),a.jsx("button",{type:"button",onClick:()=>v("negotiable"),className:`px-4 py-2 rounded-md text-sm font-semibold transition ${g==="negotiable"?"bg-custom-purple text-white shadow":"text-gray-600 dark:text-gray-300"}`,children:"توافقی"})]}),g==="fixed"&&a.jsxs("div",{className:"flex-1 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"currency",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"واحد پولی"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(ba,{className:"w-5 h-5 text-gray-400"})}),a.jsx("select",{id:"currency",value:H,onChange:he=>S(he.target.value),className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",children:$t.map(({value:he,label:ot})=>a.jsx("option",{value:he,children:ot},he))}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"amount",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"مبلغ"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(ba,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{id:"amount",type:"number",placeholder:"مبلغ",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:Be,onChange:he=>k(he.target.value)})]})]})]})]})]}),a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Ks,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(m0,{enabled:T,setEnabled:_})]})]})]}),a.jsx("button",{type:"submit",disabled:Ce,className:"w-full bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-3 px-4 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 disabled:bg-gray-400 disabled:cursor-not-allowed flex items-center justify-center",children:Ce?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):"ثبت و انتشار مرسوله"})]})})]}):a.jsx("div",{className:"w-full max-w-4xl mx-auto",children:a.jsxs("form",{onSubmit:Ee,className:"space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۱. مبدأ و مقصد سفر"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مبدأ"}),a.jsx(Zc,{onButtonClick:()=>Se("origin"),value:Je,id:"origin_carry",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Ca,{icon:ya,id:"origin_country_carry",placeholder:"مثال: ایران",label:"کشور",value:j,onChange:he=>R(he.target.value)}),a.jsx(Ca,{icon:Fe,id:"origin_city_carry",placeholder:"مثال: تهران",label:"شهر",value:U,onChange:he=>de(he.target.value)})]}),a.jsx(Ca,{icon:Os,id:"origin_address_carry",placeholder:"آدرس کامل، پلاک و واحد",label:"آدرس دستی",value:pe,onChange:he=>z(he.target.value)})]}),a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مقصد"}),a.jsx(Zc,{onButtonClick:()=>Se("destination"),value:st,id:"destination_carry",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Ca,{icon:ya,id:"destination_country_carry",placeholder:"مثال: کانادا",label:"کشور",value:F,onChange:he=>ke(he.target.value)}),a.jsx(Ca,{icon:Fe,id:"destination_city_carry",placeholder:"مثال: تورنتو",label:"شهر",value:ye,onChange:he=>ne(he.target.value)})]}),a.jsx(Ca,{icon:Os,id:"destination_address_carry",placeholder:"آدرس کامل، پلاک و واحد",label:"آدرس دستی",value:E,onChange:he=>fe(he.target.value)})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۲. جزئیات سفر"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(h0,{id:"departure_date",label:"تاریخ حرکت",value:be,onChange:me}),a.jsx(h0,{id:"arrival_date",label:"تاریخ رسیدن",value:B,onChange:oe})]}),a.jsx("div",{className:"mt-6",children:a.jsx(Ca,{icon:Qa,id:"carry_weight",label:"ظرفیت حمل",placeholder:"حداکثر وزن قابل حمل به کیلوگرم",type:"number",value:A,onChange:he=>ae(he.target.value)})}),a.jsx("div",{className:"mt-6",children:a.jsx(f0,{icon:hs,id:"trip_description",label:"توضیحات (اختیاری)",placeholder:"توضیحات بیشتر در مورد سفر، نوع وسیله نقلیه، اقلام ممنوعه و...",value:Ne,onChange:he=>Ae(he.target.value)})})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. قیمت‌گذاری و اطلاعات تماس"}),a.jsxs("div",{className:"mt-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"قیمت"}),a.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[a.jsxs("div",{className:"flex-1 grid grid-cols-2 gap-2 bg-custom-light-bg dark:bg-custom-dark-blue p-1 rounded-lg",children:[a.jsx("button",{type:"button",onClick:()=>v("fixed"),className:`px-4 py-2 rounded-md text-sm font-semibold transition ${g==="fixed"?"bg-custom-purple text-white shadow":"text-gray-600 dark:text-gray-300"}`,children:"قیمت ثابت"}),a.jsx("button",{type:"button",onClick:()=>v("negotiable"),className:`px-4 py-2 rounded-md text-sm font-semibold transition ${g==="negotiable"?"bg-custom-purple text-white shadow":"text-gray-600 dark:text-gray-300"}`,children:"توافقی"})]}),g==="fixed"&&a.jsxs("div",{className:"flex-1 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"currency_carry",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"واحد پولی"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(ba,{className:"w-5 h-5 text-gray-400"})}),a.jsx("select",{id:"currency_carry",value:H,onChange:he=>S(he.target.value),className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",children:$t.map(({value:he,label:ot})=>a.jsx("option",{value:he,children:ot},he))}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"amount_carry",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"مبلغ به ازای هر کیلوگرم"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(ba,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{id:"amount_carry",type:"number",placeholder:"مبلغ",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:ie,onChange:he=>we(he.target.value)})]})]})]})]})]}),a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Ks,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(m0,{enabled:T,setEnabled:_})]})]})]}),a.jsx("button",{type:"submit",disabled:Ce,className:"w-full bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-3 px-4 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 disabled:bg-gray-400 disabled:cursor-not-allowed flex items-center justify-center",children:Ce?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):"ثبت و اعلام سفر"})]})}),a.jsx(Yx,{isOpen:Z.isOpen,onClose:le,onConfirm:_e,field:Z.field})]})},Ox=c=>[1,5,9,13,17,22,26,30].includes(c%33),Ex=(c,b)=>b<7?31:b<12?30:b===12?Ox(c)?30:29:0,Lx=()=>{const c=new Date().toLocaleDateString("fa-IR-u-nu-latn"),[b,N,f]=c.split("/").map(Number);return{year:b,month:N,day:f}},Ax=["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],h0=({id:c,label:b,value:N,onChange:f})=>{const v=Lx().year,[H,S]=y.useState(),[T,_]=y.useState(),[G,O]=y.useState(),Z=Array.from({length:4},(j,R)=>v+R),X=H&&T?Ex(H,T):31;y.useEffect(()=>{if(N){const[j,R,U]=N.split("/").map(Number);S(j),_(R),O(U)}else S(void 0),_(void 0),O(void 0)},[N]),y.useEffect(()=>{f(H&&T&&G?`${H}/${T}/${G}`:"")},[H,T,G,f]),y.useEffect(()=>{G&&G>X&&O(X)},[X,G]);const V=j=>S(Number(j.target.value)),Q=j=>_(Number(j.target.value)),M=j=>O(Number(j.target.value)),m="w-full appearance-none pr-4 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition";return a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_day`,value:G||"",onChange:M,className:m,children:[a.jsx("option",{value:"",disabled:!0,children:"روز"}),Array.from({length:X},(j,R)=>R+1).map(j=>a.jsx("option",{value:j,children:j},j))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_month`,value:T||"",onChange:Q,className:m,children:[a.jsx("option",{value:"",disabled:!0,children:"ماه"}),Ax.map((j,R)=>a.jsx("option",{value:R+1,children:j},R))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_year`,value:H||"",onChange:V,className:m,children:[a.jsx("option",{value:"",disabled:!0,children:"سال"}),Z.map(j=>a.jsx("option",{value:j,children:j},j))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]})]})]})},Ca=({id:c,icon:b,label:N,placeholder:f,type:g="text",value:v,onChange:H,step:S,min:T})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[b&&a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:g,id:c,className:`w-full ${b?"pr-10":"pr-4"} pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition`,placeholder:f,value:v,onChange:H,step:S,min:T})]})]}),f0=({id:c,icon:b,label:N,placeholder:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute top-3.5 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("textarea",{id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition min-h-[100px] resize-y",placeholder:f,value:g,onChange:v})]})]}),Zc=({id:c,label:b,placeholder:N,value:f,onButtonClick:g})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative flex items-center",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(Fe,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",placeholder:N,value:f,readOnly:!0,onClick:g,style:{cursor:"pointer"}}),a.jsx("button",{type:"button",onClick:g,className:"absolute left-2 text-sm bg-custom-purple text-white px-3 py-1 rounded-md hover:bg-custom-light-purple transition-colors",children:"ثبت"})]})]}),m0=({enabled:c,setEnabled:b})=>a.jsx("button",{type:"button",dir:"ltr",className:`${c?"bg-custom-purple":"bg-gray-200 dark:bg-gray-600"}
              relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent 
              transition-colors duration-200 ease-in-out 
              focus:outline-none focus:ring-2 focus:ring-custom-purple focus:ring-offset-2`,onClick:()=>b(!c),children:a.jsx("span",{"aria-hidden":"true",className:`${c?"translate-x-5":"translate-x-0"}
                pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white 
                shadow-lg ring-0 transition duration-200 ease-in-out`})}),Yx=({isOpen:c,onClose:b,onConfirm:N,field:f})=>{const g=y.useRef(null),v=y.useRef(null),H=y.useRef(null),[S,T]=y.useState(null),[_,G]=y.useState(""),[O,Z]=y.useState(!1);y.useEffect(()=>{if(!c)return;const m=()=>{g.current&&(g.current.remove(),g.current=null),v.current=null,T(null),G("")};if(H.current&&!g.current){const j=L.map(H.current).setView([35.6892,51.389],10);g.current=j,L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(j),j.on("click",R=>{const{lat:U,lng:de}=R.latlng;T({lat:U,lng:de}),v.current?v.current.setLatLng(R.latlng):v.current=L.marker(R.latlng).addTo(g.current)}),setTimeout(()=>j.invalidateSize(),100)}return m},[c]);const X=async()=>{if(_.trim()){Z(!0);try{const m=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(_)}&accept-language=fa`);if(!m.ok)throw new Error("Network response was not ok");const j=await m.json();if(j&&j.length>0){const{lat:R,lon:U}=j[0],de=parseFloat(R),pe=parseFloat(U),z={lat:de,lng:pe};T(z),g.current&&(g.current.setView(z,15),v.current?v.current.setLatLng(z):v.current=L.marker(z).addTo(g.current))}else console.log("مکان مورد نظر یافت نشد.")}catch(m){console.error("Geocoding error:",m),console.log("خطایی در جستجوی مکان رخ داد.")}finally{Z(!1)}}},V=async()=>{if(!navigator.geolocation){console.log("مرورگر شما از موقعیت‌یابی جغرافیایی پشتیبانی نمی‌کند.");return}if(navigator.permissions&&navigator.permissions.query)try{if((await navigator.permissions.query({name:"geolocation"})).state==="denied"){console.log("شما دسترسی به موقعیت مکانی را مسدود کرده‌اید.");return}}catch(m){console.warn("Could not check permission status:",m)}navigator.geolocation.getCurrentPosition(m=>{const{latitude:j,longitude:R}=m.coords,U={lat:j,lng:R};T(U),g.current&&(g.current.setView(U,15),v.current?v.current.setLatLng(U):v.current=L.marker(U).addTo(g.current))},m=>{console.error("Geolocation error:",m.message);let j="امکان دسترسی به موقعیت مکانی شما وجود ندارد.";switch(m.code){case m.PERMISSION_DENIED:j="شما اجازه دسترسی به موقعیت مکانی را نداده‌اید.";break;case m.POSITION_UNAVAILABLE:j="اطلاعات موقعیت مکانی در دسترس نیست.";break;case m.TIMEOUT:j="درخواست برای دریافت موقعیت مکانی بیش از حد طول کشید.";break}console.log(j)})},Q=()=>{S?N(S):console.log("لطفاً یک موقعیت روی نقشه انتخاب کنید.")};if(!c)return null;const M=f==="origin"?"ثبت موقعیت مبدأ":"ثبت موقعیت مقصد";return a.jsxs("div",{className:"fixed inset-0 bg-black/70 z-50 flex items-center justify-center p-4 backdrop-blur-sm",onClick:b,children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light w-full max-w-2xl rounded-2xl shadow-2xl border border-gray-200 dark:border-gray-700/50 transform transition-all duration-300 ease-out scale-95 opacity-0 animate-fade-in-scale overflow-hidden",onClick:m=>m.stopPropagation(),children:[a.jsxs("div",{className:"flex justify-between items-center p-5 bg-custom-light-bg dark:bg-custom-dark-blue",children:[a.jsxs("h2",{className:"text-xl font-bold flex items-center gap-3",children:[a.jsx(Fe,{className:"w-6 h-6 text-custom-purple"})," ",M]}),a.jsx("button",{onClick:b,className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",children:a.jsx(Oa,{className:"w-6 h-6 text-gray-500 dark:text-gray-400"})})]}),a.jsxs("div",{className:"p-6 space-y-5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative flex-grow",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(fa,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",value:_,onChange:m=>G(m.target.value),onKeyDown:m=>{m.key==="Enter"&&X()},placeholder:"جستجوی آدرس یا مکان...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition"})]}),a.jsx("button",{onClick:X,disabled:O,className:"flex-shrink-0 flex items-center justify-center w-28 py-2.5 px-4 rounded-lg bg-custom-purple text-white font-semibold hover:bg-custom-light-purple transition-colors disabled:bg-gray-400 disabled:cursor-wait",children:O?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):a.jsx("span",{children:"جستجو"})})]}),a.jsxs("button",{onClick:V,className:"w-full flex items-center justify-center gap-2 py-3 px-4 rounded-xl bg-gradient-to-br from-custom-cyan to-teal-400 text-white font-semibold hover:shadow-lg hover:shadow-custom-cyan/30 transition-all duration-300 transform hover:-translate-y-0.5",children:[a.jsx(io,{className:"w-5 h-5"}),a.jsx("span",{children:"استفاده از موقعیت فعلی من"})]}),a.jsxs("div",{className:"relative my-4",children:[a.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true",children:a.jsx("div",{className:"w-full border-t border-gray-300 dark:border-gray-600"})}),a.jsx("div",{className:"relative flex justify-center",children:a.jsx("span",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light px-3 text-sm text-gray-500 dark:text-gray-400",children:"یا"})})]}),a.jsx("p",{className:"text-center text-sm text-gray-500 dark:text-gray-400 -mt-2 mb-2",children:"برای انتخاب، روی نقشه کلیک کنید."}),a.jsx("div",{ref:H,className:"w-full h-80 bg-gray-200 dark:bg-gray-700 rounded-lg cursor-pointer z-0 border border-gray-300 dark:border-gray-600 shadow-inner"})]}),a.jsxs("div",{className:"px-6 py-4 bg-custom-light-bg dark:bg-custom-dark-blue border-t border-gray-200 dark:border-gray-700 flex justify-between items-center",children:[a.jsx("button",{onClick:b,className:"py-2 px-5 rounded-lg text-gray-700 dark:text-gray-300 font-semibold hover:bg-gray-200 dark:hover:bg-gray-700/50 transition-colors",children:"انصراف"}),a.jsx("button",{onClick:Q,disabled:!S,className:"py-2.5 px-6 rounded-xl bg-gradient-to-br from-custom-purple to-custom-light-purple text-white font-semibold hover:shadow-lg hover:shadow-custom-purple/30 transition-all duration-300 disabled:from-gray-400 disabled:to-gray-500 disabled:shadow-none disabled:cursor-not-allowed transform disabled:transform-none hover:-translate-y-0.5",children:"تایید موقعیت"})]})]}),a.jsx("style",{children:`
                @keyframes fade-in-scale {
                    from { transform: scale(0.95); opacity: 0; }
                    to { transform: scale(1); opacity: 1; }
                }
                .animate-fade-in-scale {
                    animation: fade-in-scale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
                }
                .leaflet-container {
                    font-family: 'Vazirmatn', sans-serif;
                }
            `})]})},g0=[{id:1,title:"بسته مدارک مهم شرکتی",imageUrl:"https://picsum.photos/seed/docs1/400/300",origin:{country:"ایران",city:"تهران"},destination:{country:"کانادا",city:"تورنتو"},weight:.5,category:"مدارک و اسناد",fee:50,currency:"USD",datePosted:"۳ ساعت پیش"},{id:2,title:"لپتاپ و لوازم جانبی",imageUrl:"https://picsum.photos/seed/laptop2/400/300",origin:{country:"آمریکا",city:"لس آنجلس"},destination:{country:"ایران",city:"شیراز"},weight:3,category:"لوازم الکترونیکی",fee:120,currency:"USD",datePosted:"۱ روز پیش"},{id:3,title:"مجموعه کتاب‌های نایاب",imageUrl:"https://picsum.photos/seed/books3/400/300",origin:{country:"ایران",city:"اصفهان"},destination:{country:"آلمان",city:"برلین"},weight:4.5,category:"کتاب و مجله",fee:80,currency:"EUR",datePosted:"۲ روز پیش"},{id:4,title:"لباس‌های محلی و صنایع دستی",imageUrl:"https://picsum.photos/seed/crafts4/400/300",origin:{country:"ایران",city:"یزد"},destination:{country:"آمریکا",city:"نیویورک"},weight:2,category:"پوشاک",fee:65,currency:"USD",datePosted:"۵ روز پیش"},{id:5,title:"هدیه تولد (عطر و ادکلن)",imageUrl:"https://picsum.photos/seed/perfume5/400/300",origin:{country:"فرانسه",city:"پاریس"},destination:{country:"ایران",city:"تهران"},weight:1,category:"هدیه",fee:40,currency:"EUR",datePosted:"۱ هفته پیش"},{id:6,title:"قطعات یدکی خودرو",imageUrl:"https://picsum.photos/seed/carparts6/400/300",origin:{country:"آلمان",city:"مونیخ"},destination:{country:"ایران",city:"تبریز"},weight:8,category:"قطعات",fee:200,currency:"EUR",datePosted:"۲ هفته پیش"}],zx=({onNavigate:c})=>{const[b,N]=y.useState(g0),[f,g]=y.useState(g0),[v,H]=y.useState(""),[S,T]=y.useState(""),[_,G]=y.useState(""),[O,Z]=y.useState(""),[X,V]=y.useState(""),[Q,M]=y.useState("newest");return y.useEffect(()=>{let m=[...b];switch(v&&(m=m.filter(j=>j.title.toLowerCase().includes(v.toLowerCase()))),S&&(m=m.filter(j=>j.origin.country.toLowerCase().includes(S.toLowerCase()))),_&&(m=m.filter(j=>j.origin.city.toLowerCase().includes(_.toLowerCase()))),O&&(m=m.filter(j=>j.destination.country.toLowerCase().includes(O.toLowerCase()))),X&&(m=m.filter(j=>j.destination.city.toLowerCase().includes(X.toLowerCase()))),Q){case"fee_asc":m.sort((j,R)=>j.fee-R.fee);break;case"fee_desc":m.sort((j,R)=>R.fee-j.fee);break;case"oldest":m.reverse();break}g(m)},[v,S,_,O,X,Q,b]),a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"پیدا کردن مرسوله"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"مرسوله‌های موجود برای حمل را مشاهده و انتخاب کنید."})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:[a.jsx(Fi,{id:"searchQuery",label:"عنوان مرسوله",placeholder:"مثال: کتاب...",value:v,onChange:m=>H(m.target.value),icon:fa}),a.jsx(Fi,{id:"originCountry",label:"کشور مبدا",placeholder:"مثال: ایران",value:S,onChange:m=>T(m.target.value),icon:ya}),a.jsx(Fi,{id:"originCity",label:"شهر مبدا",placeholder:"مثال: تهران",value:_,onChange:m=>G(m.target.value),icon:Fe}),a.jsx(Fi,{id:"destinationCountry",label:"کشور مقصد",placeholder:"مثال: کانادا",value:O,onChange:m=>Z(m.target.value),icon:ya}),a.jsx(Fi,{id:"destinationCity",label:"شهر مقصد",placeholder:"مثال: تورنتو",value:X,onChange:m=>V(m.target.value),icon:Fe}),a.jsx(Rx,{value:Q,onChange:m=>M(m.target.value)})]}),a.jsx("div",{className:"mt-6 flex justify-end",children:a.jsxs("button",{className:"w-full sm:w-auto bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-8 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 flex items-center justify-center gap-2",children:[a.jsx(fa,{className:"w-5 h-5"}),a.jsx("span",{children:"جستجو"})]})})]}),f.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:f.map(m=>a.jsx(Ux,{...m,onNavigate:c},m.id))}):a.jsxs("div",{className:"col-span-1 md:col-span-2 lg:col-span-3 text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx(Js,{className:"w-16 h-16 mx-auto text-gray-300 dark:text-gray-600"}),a.jsx("h3",{className:"mt-4 text-xl font-semibold text-gray-800 dark:text-gray-200",children:"مرسوله‌ای یافت نشد"}),a.jsx("p",{className:"mt-1 text-gray-500 dark:text-gray-400",children:"هیچ مرسوله‌ای با این مشخصات یافت نشد."})]})]})},Fi=({id:c,label:b,placeholder:N,value:f,onChange:g,icon:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(v,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,placeholder:N,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:f,onChange:g})]})]}),Rx=({value:c,onChange:b})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"مرتب‌سازی"}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:"sortBy",className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:c,onChange:b,children:[a.jsx("option",{value:"newest",children:"جدیدترین"}),a.jsx("option",{value:"oldest",children:"قدیمی‌ترین"}),a.jsx("option",{value:"fee_asc",children:"کارمزد: کم به زیاد"}),a.jsx("option",{value:"fee_desc",children:"کارمزد: زیاد به کم"})]}),a.jsx(yt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]})]}),Ux=({id:c,title:b,imageUrl:N,origin:f,destination:g,weight:v,category:H,fee:S,currency:T,datePosted:_,onNavigate:G})=>a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl shadow-sm overflow-hidden flex flex-col group transform hover:-translate-y-1.5 transition-transform duration-300",children:[a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:N,alt:b,className:"w-full h-48 object-cover"}),a.jsx("div",{className:"absolute top-0 right-0 m-2 px-3 py-1 bg-black/60 text-white text-xs font-bold rounded-full backdrop-blur-sm",children:_}),a.jsx("div",{className:"absolute top-0 left-0 m-2 px-3 py-1 bg-custom-cyan/80 text-white text-xs font-bold rounded-full backdrop-blur-sm",children:H})]}),a.jsxs("div",{className:"p-5 flex flex-col flex-grow",children:[a.jsx("h3",{className:"text-lg font-bold text-gray-800 dark:text-white mb-3 flex-grow",children:b}),a.jsxs("div",{className:"space-y-3 text-sm text-gray-600 dark:text-gray-300 mb-4 border-t border-gray-200 dark:border-gray-700 pt-4",children:[a.jsx(Xc,{icon:Js,label:"مبدا",value:`${f.city}, ${f.country}`}),a.jsx(Xc,{icon:Fe,label:"مقصد",value:`${g.city}, ${g.country}`}),a.jsx(Xc,{icon:Qa,label:"وزن تقریبی",value:`${v} کیلوگرم`}),a.jsx(Xc,{icon:ba,label:"هزینه حمل",value:`${S.toLocaleString()} ${T}`,valueClassName:"text-green-600 dark:text-green-400"})]}),a.jsxs("div",{className:"mt-auto grid grid-cols-2 gap-3",children:[a.jsxs("button",{onClick:()=>G("messages"),className:"w-full flex items-center justify-center gap-2 bg-custom-cyan/10 hover:bg-custom-cyan/20 text-custom-cyan font-bold py-2.5 px-4 rounded-lg transition-colors duration-300",children:[a.jsx(ro,{className:"w-5 h-5"}),a.jsx("span",{children:"چت"})]}),a.jsx("button",{onClick:()=>{G("shipment-detail",c.toString())},className:"w-full bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-4 rounded-lg transition-colors duration-300",children:"ارسال درخواست"})]})]})]}),Xc=({icon:c,label:b,value:N,valueClassName:f="text-gray-800 dark:text-gray-200"})=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[a.jsx(c,{className:"w-4 h-4 ml-2"}),a.jsxs("span",{children:[b,":"]})]}),a.jsx("span",{className:`font-semibold ${f}`,children:N})]}),x0=[{id:"private_car",name:"ماشین شخصی",icon:lo},{id:"bus",name:"اتوبوس",icon:gh},{id:"train",name:"قطار",icon:xh},{id:"airplane",name:"هواپیما",icon:va}],p0={registerTrip:c=>fetch(`${et}/trips/register`,{method:"POST",headers:{"Content-Type":"application/json","X-Auth-Token":localStorage.getItem("auth_token")},body:JSON.stringify(c)}),registerCompanion:c=>fetch(`${et}/trips/companion`,{method:"POST",headers:{"Content-Type":"application/json","X-Auth-Token":localStorage.getItem("auth_token")},body:JSON.stringify(c)})},Hx=({showError:c,showSuccess:b})=>{const[N,f]=y.useState("register"),[g,v]=y.useState(!1),[H,S]=y.useState(!1),[T,_]=y.useState({isOpen:!1,field:null}),[G,O]=y.useState(null),[Z,X]=y.useState(null),[V,Q]=y.useState(""),[M,m]=y.useState(""),[j,R]=y.useState(""),[U,de]=y.useState(""),[pe,z]=y.useState(""),[F,ke]=y.useState(""),[ye,ne]=y.useState(""),[E,fe]=y.useState([]),[be,me]=y.useState(""),[B,oe]=y.useState(""),[Ne,Ae]=y.useState(""),[De,w]=y.useState(""),q=G?`${G.lat.toFixed(5)}, ${G.lng.toFixed(5)}`:"",K=Z?`${Z.lat.toFixed(5)}, ${Z.lng.toFixed(5)}`:"",xe=k=>{_({isOpen:!0,field:k})},ee=()=>{_({isOpen:!1,field:null})},Te=k=>{T.field==="origin"?O(k):T.field==="destination"&&X(k),ee()};y.useEffect(()=>{O(null),X(null),Q(""),m(""),R(""),de(""),z(""),ke(""),me(""),oe(""),Ae(""),ne(""),fe([]),w("")},[N]);const ze=k=>{fe(A=>A.includes(k)?A.filter(ae=>ae!==k):[...A,k])},Be=async k=>{k.preventDefault(),S(!0);try{let A,ae;if(N==="register"){if(!V||!M||!U||!pe||!ye||!be||!De)throw new Error("لطفا تمام فیلدهای обязаاری را پر کنید");A={origin:{country:V,city:M,address:j,coordinates:G?`${G.lat},${G.lng}`:null},destination:{country:U,city:pe,address:F,coordinates:Z?`${Z.lat},${Z.lng}`:null},vehicle_type:ye,departure_date:be,arrival_date:B,capacity:parseFloat(De),description:Ne,show_phone:g},ae=p0.registerTrip}else{if(!V||!M||!U||!pe||E.length===0||!be||!De)throw new Error("لطفا تمام فیلدهای обязаاری را پر کنید");A={origin:{country:V,city:M,address:j,coordinates:G?`${G.lat},${G.lng}`:null},destination:{country:U,city:pe,address:F,coordinates:Z?`${Z.lat},${Z.lng}`:null},vehicle_types:E,available_from:be,available_to:B,capacity:parseFloat(De),description:Ne,show_phone:g},ae=p0.registerCompanion}const ie=await ae(A),we=await ie.json();if(!ie.ok){const Ce=await ie.json(),We=Ce.messages||Ce.error||"خطا در ثبت اطلاعات";if(Ce.errors){const Je=Object.values(Ce.errors)[0];c(Array.isArray(Je)?Je[0]:String(Je))}else c(We);return}b(N==="register"?"سفر با موفقیت ثبت شد!":"آمادگی برای همسفری با موفقیت ثبت شد!"),O(null),X(null),Q(""),m(""),R(""),de(""),z(""),ke(""),me(""),oe(""),Ae(""),ne(""),fe([]),w(""),v(!1)}catch(A){c(A.message||"خطای ناشناخته رخ داد")}finally{S(!1)}};return a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:N==="register"?"ثبت سفر جدید":"اعلام آمادگی برای همسفری"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:N==="register"?"اطلاعات سفر خود را برای حمل مرسوله وارد کنید.":"اطلاعات مسیر و زمان در دسترس بودن خود را ثبت کنید."})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-center text-gray-800 dark:text-gray-200",children:"نوع فعالیت خود را انتخاب کنید"}),a.jsx("div",{className:"max-w-sm mx-auto",children:a.jsx("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl shadow-inner p-1",children:a.jsxs("div",{className:"relative flex rounded-lg overflow-hidden",children:[a.jsx("span",{className:`absolute top-0 bottom-0 right-0 w-1/2 bg-custom-purple rounded-lg shadow-md transition-transform duration-300 ease-in-out ${N==="companion"?"-translate-x-full":"translate-x-0"}`,"aria-hidden":"true"}),a.jsxs("button",{type:"button",onClick:()=>f("register"),className:`relative z-10 flex w-1/2 items-center justify-center gap-2 rounded-lg py-2.5 text-md font-semibold transition-colors duration-300 ${N==="register"?"text-white":"text-gray-600 dark:text-gray-300"}`,"aria-label":"ثبت سفر",children:[a.jsx(va,{className:"h-5 w-5"}),a.jsx("span",{children:"ثبت سفر"})]}),a.jsxs("button",{type:"button",onClick:()=>f("companion"),className:`relative z-10 flex w-1/2 items-center justify-center gap-2 rounded-lg py-2.5 text-md font-semibold transition-colors duration-300 ${N==="companion"?"text-white":"text-gray-600 dark:text-gray-300"}`,"aria-label":"همسفر می‌شوم",children:[a.jsx(Ta,{className:"h-5 w-5"}),a.jsx("span",{children:"همسفر می‌شوم"})]})]})})})]}),a.jsx("div",{className:"w-full max-w-4xl mx-auto",children:a.jsxs("form",{onSubmit:Be,className:"space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۱. مبدأ و مقصد سفر"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مبدأ"}),a.jsx(b0,{onButtonClick:()=>xe("origin"),value:q,id:"origin",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Lr,{icon:ya,id:"origin_country",placeholder:"مثال: ایران",label:"کشور",value:V,onChange:k=>Q(k.target.value)}),a.jsx(Lr,{icon:Fe,id:"origin_city",placeholder:"مثال: تهران",label:"شهر",value:M,onChange:k=>m(k.target.value)})]}),a.jsx(Lr,{icon:Os,id:"origin_address",placeholder:"آدرس کامل، پلاک و واحد",label:"آدرس دستی",value:j,onChange:k=>R(k.target.value)})]}),a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مقصد"}),a.jsx(b0,{onButtonClick:()=>xe("destination"),value:K,id:"destination",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Lr,{icon:ya,id:"destination_country",placeholder:"مثال: کانادا",label:"کشور",value:U,onChange:k=>de(k.target.value)}),a.jsx(Lr,{icon:Fe,id:"destination_city",placeholder:"مثال: تورنتو",label:"شهر",value:pe,onChange:k=>z(k.target.value)})]}),a.jsx(Lr,{icon:Os,id:"destination_address",placeholder:"آدرس کامل، پلاک و واحد",label:"آدرس دستی",value:F,onChange:k=>ke(k.target.value)})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:N==="register"?"۲. جزئیات سفر":"۲. زمان و ظرفیت در دسترس"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(y0,{id:N==="register"?"departure_date":"available_from_date",label:N==="register"?"تاریخ حرکت":"در دسترس از تاریخ",value:be,onChange:me}),a.jsx(y0,{id:N==="register"?"arrival_date":"available_to_date",label:N==="register"?"تاریخ رسیدن":"در دسترس تا تاریخ",value:B,onChange:oe})]}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[N==="register"?a.jsx(qx,{label:"نوع وسیله نقلیه",options:x0,selectedValue:ye,onChange:ne}):a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"وسیله‌های نقلیه مورد نظر"}),a.jsx("div",{className:"grid grid-cols-2 gap-3",children:x0.map(k=>a.jsxs("label",{className:`flex items-center p-3 border rounded-lg cursor-pointer transition-all duration-200 ${E.includes(k.id)?"bg-custom-purple/10 border-custom-purple ring-2 ring-custom-purple/50 dark:bg-custom-purple/20":"bg-custom-light-bg dark:bg-custom-dark-blue border-gray-300 dark:border-gray-600 hover:border-custom-purple/50"}`,children:[a.jsx("input",{type:"checkbox",checked:E.includes(k.id),onChange:()=>ze(k.id),className:"sr-only"}),a.jsx("div",{className:`w-5 h-5 border-2 rounded flex-shrink-0 flex items-center justify-center ml-3 transition-all duration-200 ${E.includes(k.id)?"bg-custom-purple border-custom-purple":"border-gray-300 dark:border-gray-500"}`,children:E.includes(k.id)&&a.jsx("svg",{className:"w-3 h-3 text-white fill-current",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M0 11l2-2 5 5L18 3l2 2L7 18z"})})}),a.jsx(k.icon,{className:`w-6 h-6 ml-2 transition-colors ${E.includes(k.id)?"text-custom-purple":"text-gray-500 dark:text-gray-400"}`}),a.jsx("span",{className:`font-semibold transition-colors ${E.includes(k.id)?"text-custom-purple dark:text-custom-light-purple":"text-gray-800 dark:text-gray-200"}`,children:k.name})]},k.id))})]}),a.jsx(Lr,{icon:Qa,id:"capacity",label:"ظرفیت حمل",placeholder:"حداکثر وزن قابل حمل به کیلوگرم",type:"number",value:De,onChange:k=>w(k.target.value)})]}),a.jsx("div",{className:"mt-6",children:a.jsx(Zx,{icon:hs,id:"description",label:"توضیحات (اختیاری)",placeholder:N==="register"?"توضیحات بیشتر در مورد سفر، نوع وسیله نقلیه، اقلام ممنوعه و...":"توضیحات بیشتر در مورد نوع سفر، شرایط خاص و...",value:Ne,onChange:k=>Ae(k.target.value)})})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. اطلاعات تماس"}),a.jsx("div",{className:"mt-6",children:a.jsx(Bx,{enabled:g,setEnabled:v})})]}),a.jsx("button",{type:"submit",disabled:H,className:"w-full bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-3 px-4 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 disabled:bg-gray-400 disabled:cursor-not-allowed",children:H?"در حال ثبت...":N==="register"?"ثبت و اعلام سفر":"ثبت آمادگی"})]})}),a.jsx(Fx,{isOpen:T.isOpen,onClose:ee,onConfirm:Te,field:T.field})]})},qx=({selectedValue:c,onChange:b,options:N,label:f})=>{const[g,v]=y.useState(!1),H=y.useRef(null),S=N.find(T=>T.id===c);return y.useEffect(()=>{const T=_=>{H.current&&!H.current.contains(_.target)&&v(!1)};return document.addEventListener("mousedown",T),()=>{document.removeEventListener("mousedown",T)}},[H]),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:f}),a.jsxs("div",{className:"relative",ref:H,children:[a.jsxs("button",{type:"button",onClick:()=>v(!g),className:"w-full flex items-center justify-between text-right pr-4 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",children:[a.jsx("div",{className:"flex items-center",children:S?a.jsxs(a.Fragment,{children:[a.jsx(S.icon,{className:"w-5 h-5 ml-2 text-gray-500 dark:text-gray-400"}),a.jsx("span",{className:"text-gray-800 dark:text-gray-200",children:S.name})]}):a.jsx("span",{className:"text-gray-400",children:"یک گزینه را انتخاب کنید"})}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:`w-5 h-5 text-gray-400 transition-transform ${g?"rotate-180":""}`})})]}),g&&a.jsx("ul",{className:"absolute z-10 w-full mt-1 bg-custom-light-card dark:bg-custom-dark-blue-light border border-gray-300 dark:border-gray-600 rounded-lg shadow-lg max-h-60 overflow-auto",children:N.map(T=>a.jsxs("li",{onClick:()=>{b(T.id),v(!1)},className:"flex items-center p-3 cursor-pointer hover:bg-gray-100 dark:hover:bg-custom-dark-blue",children:[a.jsx(T.icon,{className:"w-5 h-5 ml-3 text-gray-500 dark:text-gray-400"}),a.jsx("span",{className:"text-gray-800 dark:text-gray-200",children:T.name})]},T.id))})]})]})},Bx=({enabled:c,setEnabled:b})=>a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Ks,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(Xx,{enabled:c,setEnabled:b})]}),$x=c=>[1,5,9,13,17,22,26,30].includes(c%33),Gx=(c,b)=>b<7?31:b<12?30:b===12?$x(c)?30:29:0,Vx=()=>{const c=new Date().toLocaleDateString("fa-IR-u-nu-latn"),[b,N,f]=c.split("/").map(Number);return{year:b,month:N,day:f}},Qx=["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],y0=({id:c,label:b,value:N,onChange:f})=>{const v=Vx().year,[H,S]=y.useState(),[T,_]=y.useState(),[G,O]=y.useState(),Z=Array.from({length:4},(j,R)=>v+R),X=H&&T?Gx(H,T):31;y.useEffect(()=>{if(N){const[j,R,U]=N.split("/").map(Number);S(j),_(R),O(U)}else S(void 0),_(void 0),O(void 0)},[N]),y.useEffect(()=>{f(H&&T&&G?`${H}/${T}/${G}`:"")},[H,T,G,f]),y.useEffect(()=>{G&&G>X&&O(X)},[X,G]);const V=j=>S(Number(j.target.value)),Q=j=>_(Number(j.target.value)),M=j=>O(Number(j.target.value)),m="w-full appearance-none pr-4 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition";return a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:c+"_day",value:G||"",onChange:M,className:m,children:[a.jsx("option",{value:"",disabled:!0,children:"روز"}),Array.from({length:X},(j,R)=>R+1).map(j=>a.jsx("option",{value:j,children:j},j))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:c+"_month",value:T||"",onChange:Q,className:m,children:[a.jsx("option",{value:"",disabled:!0,children:"ماه"}),Qx.map((j,R)=>a.jsx("option",{value:R+1,children:j},R))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:c+"_year",value:H||"",onChange:V,className:m,children:[a.jsx("option",{value:"",disabled:!0,children:"سال"}),Z.map(j=>a.jsx("option",{value:j,children:j},j))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]})]})]})},Lr=({id:c,icon:b,label:N,placeholder:f,type:g="text",value:v,onChange:H})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[b&&a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:g,id:c,className:`w-full ${b?"pr-10":"pr-4"} pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition`,placeholder:f,value:v,onChange:H})]})]}),Zx=({id:c,icon:b,label:N,placeholder:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute top-3.5 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("textarea",{id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition min-h-[100px] resize-y",placeholder:f,value:g,onChange:v})]})]}),b0=({id:c,label:b,placeholder:N,value:f,onButtonClick:g})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative flex items-center",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(Fe,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",placeholder:N,value:f,readOnly:!0,onClick:g,style:{cursor:"pointer"}}),a.jsx("button",{type:"button",onClick:g,className:"absolute left-2 text-sm bg-custom-purple text-white px-3 py-1 rounded-md hover:bg-custom-light-purple transition-colors",children:"ثبت"})]})]}),Xx=({enabled:c,setEnabled:b})=>a.jsx("button",{type:"button",dir:"ltr",className:`${c?"bg-custom-purple":"bg-gray-200 dark:bg-gray-600"}
              relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent 
              transition-colors duration-200 ease-in-out 
              focus:outline-none focus:ring-2 focus:ring-custom-purple focus:ring-offset-2`,onClick:()=>b(!c),children:a.jsx("span",{"aria-hidden":"true",className:`${c?"translate-x-5":"translate-x-0"}
                pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white 
                shadow-lg ring-0 transition duration-200 ease-in-out`})}),Fx=({isOpen:c,onClose:b,onConfirm:N,field:f})=>{const g=y.useRef(null),v=y.useRef(null),H=y.useRef(null),[S,T]=y.useState(null),[_,G]=y.useState(""),[O,Z]=y.useState(!1);y.useEffect(()=>{if(!c)return;const m=()=>{g.current&&(g.current.remove(),g.current=null),v.current=null,T(null),G("")};if(H.current&&!g.current){const j=L.map(H.current).setView([35.6892,51.389],10);g.current=j,L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(j),j.on("click",R=>{const{lat:U,lng:de}=R.latlng;T({lat:U,lng:de}),v.current?v.current.setLatLng(R.latlng):v.current=L.marker(R.latlng).addTo(g.current)}),setTimeout(()=>j.invalidateSize(),100)}return m},[c]);const X=async()=>{if(_.trim()){Z(!0);try{const m=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(_)}&accept-language=fa`);if(!m.ok)throw new Error("Network response was not ok");const j=await m.json();if(j&&j.length>0){const{lat:R,lon:U}=j[0],de=parseFloat(R),pe=parseFloat(U),z={lat:de,lng:pe};T(z),g.current&&(g.current.setView(z,15),v.current?v.current.setLatLng(z):v.current=L.marker(z).addTo(g.current))}else alert("مکان مورد نظر یافت نشد.")}catch(m){console.error("Geocoding error:",m),alert("خطایی در جستجوی مکان رخ داد.")}finally{Z(!1)}}},V=async()=>{if(!navigator.geolocation){alert("مرورگر شما از موقعیت‌یابی جغرافیایی پشتیبانی نمی‌کند.");return}if(navigator.permissions&&navigator.permissions.query)try{if((await navigator.permissions.query({name:"geolocation"})).state==="denied"){alert("شما دسترسی به موقعیت مکانی را مسدود کرده‌اید. لطفاً آن را در تنظیمات مرورگر خود فعال کنید.");return}}catch(m){console.warn("Could not check permission status:",m)}navigator.geolocation.getCurrentPosition(m=>{const{latitude:j,longitude:R}=m.coords,U={lat:j,lng:R};T(U),g.current&&(g.current.setView(U,15),v.current?v.current.setLatLng(U):v.current=L.marker(U).addTo(g.current))},m=>{console.error("Geolocation error:",m.message);let j="امکان دسترسی به موقعیت مکانی شما وجود ندارد.";switch(m.code){case m.PERMISSION_DENIED:j="شما اجازه دسترسی به موقعیت مکانی را نداده‌اید. لطفاً دسترسی را از تنظیمات مرورگر خود فعال کنید.";break;case m.POSITION_UNAVAILABLE:j="اطلاعات موقعیت مکانی در دسترس نیست.";break;case m.TIMEOUT:j="درخواست برای دریافت موقعیت مکانی بیش از حد طول کشید.";break}alert(j)})},Q=()=>{S&&N(S)};if(!c)return null;const M=f==="origin"?"ثبت موقعیت مبدأ":"ثبت موقعیت مقصد";return a.jsxs("div",{className:"fixed inset-0 bg-black/70 z-50 flex items-center justify-center p-4 backdrop-blur-sm",onClick:b,children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light w-full max-w-2xl rounded-2xl shadow-2xl border border-gray-200 dark:border-gray-700/50 transform transition-all duration-300 ease-out scale-95 opacity-0 animate-fade-in-scale overflow-hidden",onClick:m=>m.stopPropagation(),children:[a.jsxs("div",{className:"flex justify-between items-center p-5 bg-custom-light-bg dark:bg-custom-dark-blue",children:[a.jsxs("h2",{className:"text-xl font-bold flex items-center gap-3",children:[a.jsx(Fe,{className:"w-6 h-6 text-custom-purple"})," ",M]}),a.jsx("button",{onClick:b,className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",children:a.jsx(Oa,{className:"w-6 h-6 text-gray-500 dark:text-gray-400"})})]}),a.jsxs("div",{className:"p-6 space-y-5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative flex-grow",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(fa,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",value:_,onChange:m=>G(m.target.value),onKeyDown:m=>{m.key==="Enter"&&X()},placeholder:"جستجوی آدرس یا مکان...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition"})]}),a.jsx("button",{onClick:X,disabled:O,className:"flex-shrink-0 flex items-center justify-center w-28 py-2.5 px-4 rounded-lg bg-custom-purple text-white font-semibold hover:bg-custom-light-purple transition-colors disabled:bg-gray-400 disabled:cursor-wait",children:O?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):a.jsx("span",{children:"جستجو"})})]}),a.jsxs("button",{onClick:V,className:"w-full flex items-center justify-center gap-2 py-3 px-4 rounded-xl bg-gradient-to-br from-custom-cyan to-teal-400 text-white font-semibold hover:shadow-lg hover:shadow-custom-cyan/30 transition-all duration-300 transform hover:-translate-y-0.5",children:[a.jsx(io,{className:"w-5 h-5"}),a.jsx("span",{children:"استفاده از موقعیت فعلی من"})]}),a.jsxs("div",{className:"relative my-4",children:[a.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true",children:a.jsx("div",{className:"w-full border-t border-gray-300 dark:border-gray-600"})}),a.jsx("div",{className:"relative flex justify-center",children:a.jsx("span",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light px-3 text-sm text-gray-500 dark:text-gray-400",children:"یا"})})]}),a.jsx("p",{className:"text-center text-sm text-gray-500 dark:text-gray-400 -mt-2 mb-2",children:"برای انتخاب، روی نقشه کلیک کنید."}),a.jsx("div",{ref:H,className:"w-full h-80 bg-gray-200 dark:bg-gray-700 rounded-lg cursor-pointer z-0 border border-gray-300 dark:border-gray-600 shadow-inner"})]}),a.jsxs("div",{className:"px-6 py-4 bg-custom-light-bg dark:bg-custom-dark-blue border-t border-gray-200 dark:border-gray-700 flex justify-between items-center",children:[a.jsx("button",{onClick:b,className:"py-2 px-5 rounded-lg text-gray-700 dark:text-gray-300 font-semibold hover:bg-gray-200 dark:hover:bg-gray-700/50 transition-colors",children:"انصراف"}),a.jsx("button",{onClick:Q,disabled:!S,className:"py-2.5 px-6 rounded-xl bg-gradient-to-br from-custom-purple to-custom-light-purple text-white font-semibold hover:shadow-lg hover:shadow-custom-purple/30 transition-all duration-300 disabled:from-gray-400 disabled:to-gray-500 disabled:shadow-none disabled:cursor-not-allowed transform disabled:transform-none hover:-translate-y-0.5",children:"تایید موقعیت"})]})]}),a.jsx("style",{children:`
                @keyframes fade-in-scale {
                    from { transform: scale(0.95); opacity: 0; }
                    to { transform: scale(1); opacity: 1; }
                }
                .animate-fade-in-scale {
                    animation: fade-in-scale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
                }
                .leaflet-container {
                    font-family: 'Vazirmatn', sans-serif;
                }
            `})]})},v0=[{id:1,user:{name:"رضا محمدی",avatar:"https://picsum.photos/id/1012/100/100",rating:4.8},title:"سفر هفتگی از تهران به تورنتو",origin:{country:"ایران",city:"تهران"},destination:{country:"کانادا",city:"تورنتو"},departureDate:"۱۴۰۳/۰۵/۱۰",arrivalDate:"۱۴۰۳/۰۵/۱۱",carryCapacity:7,vehicleTypes:["airplane"],datePosted:"۱ ساعت پیش"},{id:2,user:{name:"مریم حسینی",avatar:"https://picsum.photos/id/1013/100/100",rating:4.9},title:"حمل بار با خودرو شخصی از اصفهان به شیراز",origin:{country:"ایران",city:"اصفهان"},destination:{country:"ایران",city:"شیراز"},departureDate:"۱۴۰۳/۰۵/۱۲",arrivalDate:"۱۴۰۳/۰۵/۱۲",carryCapacity:20,vehicleTypes:["car"],datePosted:"۸ ساعت پیش"},{id:3,user:{name:"علی اکبری",avatar:"https://picsum.photos/id/1015/100/100",rating:4.5},title:"سفر با قطار از مشهد به تهران",origin:{country:"ایران",city:"مشهد"},destination:{country:"ایران",city:"تهران"},departureDate:"۱۴۰۳/۰۵/۱۵",arrivalDate:"۱۴۰۳/۰۵/۱۵",carryCapacity:15,vehicleTypes:["train"],datePosted:"۲ روز پیش"},{id:4,user:{name:"سارا نادری",avatar:"https://picsum.photos/id/1016/100/100",rating:5},title:"آماده حمل بار از آلمان به ایران",origin:{country:"آلمان",city:"برلین"},destination:{country:"ایران",city:"تهران"},departureDate:"۱۴۰۳/۰۶/۰۱",arrivalDate:"۱۴۰۳/۰۶/۰۱",carryCapacity:10,vehicleTypes:["airplane","bus"],datePosted:"۳ روز پیش"}],Wx=({onNavigate:c})=>{const[b,N]=y.useState(v0),[f,g]=y.useState(v0),[v,H]=y.useState(""),[S,T]=y.useState(""),[_,G]=y.useState(""),[O,Z]=y.useState(""),[X,V]=y.useState(""),[Q,M]=y.useState("newest");return y.useEffect(()=>{let m=[...b];switch(v&&(m=m.filter(j=>j.title.toLowerCase().includes(v.toLowerCase()))),S&&(m=m.filter(j=>j.origin.country.toLowerCase().includes(S.toLowerCase()))),_&&(m=m.filter(j=>j.origin.city.toLowerCase().includes(_.toLowerCase()))),O&&(m=m.filter(j=>j.destination.country.toLowerCase().includes(O.toLowerCase()))),X&&(m=m.filter(j=>j.destination.city.toLowerCase().includes(X.toLowerCase()))),Q){case"capacity_asc":m.sort((j,R)=>j.carryCapacity-R.carryCapacity);break;case"capacity_desc":m.sort((j,R)=>R.carryCapacity-j.carryCapacity);break;case"oldest":m.reverse();break}g(m)},[v,S,_,O,X,Q,b]),a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"پیدا کردن همسفر"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"لیست افرادی که آماده همسفری و حمل مرسوله شما هستند را مشاهده کنید."})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:[a.jsx(Wi,{id:"searchQuery",label:"جستجو در عنوان",placeholder:"مثال: سفر از تهران...",value:v,onChange:m=>H(m.target.value),icon:fa}),a.jsx(Wi,{id:"originCountry",label:"کشور مبدا",placeholder:"مثال: ایران",value:S,onChange:m=>T(m.target.value),icon:ya}),a.jsx(Wi,{id:"originCity",label:"شهر مبدا",placeholder:"مثال: تهران",value:_,onChange:m=>G(m.target.value),icon:Fe}),a.jsx(Wi,{id:"destinationCountry",label:"کشور مقصد",placeholder:"مثال: کانادا",value:O,onChange:m=>Z(m.target.value),icon:ya}),a.jsx(Wi,{id:"destinationCity",label:"شهر مقصد",placeholder:"مثال: تورنتو",value:X,onChange:m=>V(m.target.value),icon:Fe}),a.jsx(Jx,{value:Q,onChange:m=>M(m.target.value)})]}),a.jsx("div",{className:"mt-6 flex justify-end",children:a.jsxs("button",{className:"w-full sm:w-auto bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-8 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 flex items-center justify-center gap-2",children:[a.jsx(fa,{className:"w-5 h-5"}),a.jsx("span",{children:"جستجو"})]})})]}),f.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:f.map(m=>a.jsx(Ix,{...m,onNavigate:c},m.id))}):a.jsxs("div",{className:"col-span-1 md:col-span-2 lg:col-span-3 text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx(Ta,{className:"w-16 h-16 mx-auto text-gray-300 dark:text-gray-600"}),a.jsx("h3",{className:"mt-4 text-xl font-semibold text-gray-800 dark:text-gray-200",children:"همسفری یافت نشد"}),a.jsx("p",{className:"mt-1 text-gray-500 dark:text-gray-400",children:"هیچ همسفری با این مشخصات یافت نشد."})]})]})},Wi=({id:c,label:b,placeholder:N,value:f,onChange:g,icon:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(v,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,placeholder:N,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:f,onChange:g})]})]}),Jx=({value:c,onChange:b})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"مرتب‌سازی"}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:"sortBy",className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:c,onChange:b,children:[a.jsx("option",{value:"newest",children:"جدیدترین"}),a.jsx("option",{value:"oldest",children:"قدیمی‌ترین"}),a.jsx("option",{value:"capacity_asc",children:"ظرفیت حمل: کم به زیاد"}),a.jsx("option",{value:"capacity_desc",children:"ظرفیت حمل: زیاد به کم"})]}),a.jsx(yt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]})]}),Kx={airplane:va,car:lo,bus:gh,train:xh},Ix=({id:c,user:b,title:N,origin:f,destination:g,departureDate:v,arrivalDate:H,carryCapacity:S,vehicleTypes:T,datePosted:_,onNavigate:G})=>a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl shadow-sm overflow-hidden flex flex-col group transform hover:-translate-y-1.5 transition-transform duration-300",children:a.jsxs("div",{className:"p-5 flex flex-col flex-grow",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("img",{src:b.avatar,alt:b.name,className:"w-12 h-12 rounded-full"}),a.jsxs("div",{className:"mr-3",children:[a.jsx("h3",{className:"font-bold text-gray-800 dark:text-white",children:b.name}),a.jsxs("div",{className:"flex items-center text-xs text-amber-500",children:[a.jsx("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M10 15l-5.878 3.09 1.123-6.545L.489 6.91l6.572-.955L10 0l2.939 5.955 6.572.955-4.756 4.635 1.123 6.545z"})}),a.jsx("span",{className:"mr-1 font-bold",children:b.rating})]})]})]}),a.jsx("div",{className:"px-3 py-1 bg-custom-light-bg dark:bg-custom-dark-blue text-gray-500 dark:text-gray-400 text-xs font-bold rounded-full",children:_})]}),a.jsx("h4",{className:"text-lg font-semibold text-gray-800 dark:text-white mb-3 flex-grow",children:N}),a.jsxs("div",{className:"space-y-3 text-sm text-gray-600 dark:text-gray-300 mb-4 border-t border-gray-200 dark:border-gray-700 pt-4",children:[a.jsx(Ji,{icon:Fe,label:"مبدا",value:`${f.city}, ${f.country}`}),a.jsx(Ji,{icon:Fe,label:"مقصد",value:`${g.city}, ${g.country}`}),a.jsx(Ji,{icon:Yr,label:"تاریخ حرکت",value:v}),a.jsx(Ji,{icon:Yr,label:"تاریخ رسیدن",value:H}),a.jsx(Ji,{icon:Qa,label:"ظرفیت حمل",value:`${S} کیلوگرم`,valueClassName:"text-green-600 dark:text-green-400"})]}),a.jsxs("div",{className:"flex items-center justify-between mt-2 mb-4",children:[a.jsx("span",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"وسیله نقلیه:"}),a.jsx("div",{className:"flex gap-2",children:T.map(O=>{const Z=Kx[O];return a.jsx("div",{title:O,className:"w-6 h-6 p-1 flex items-center justify-center text-custom-purple bg-custom-purple/10 rounded-full",children:a.jsx(Z,{className:"w-4 h-4"})},O)})})]}),a.jsxs("div",{className:"mt-auto grid grid-cols-2 gap-3",children:[a.jsxs("button",{onClick:()=>G("messages"),className:"w-full flex items-center justify-center gap-2 bg-custom-cyan/10 hover:bg-custom-cyan/20 text-custom-cyan font-bold py-2.5 px-4 rounded-lg transition-colors duration-300",children:[a.jsx(ro,{className:"w-5 h-5"}),a.jsx("span",{children:"چت"})]}),a.jsx("button",{onClick:()=>G("trip-detail",c.toString()),className:"w-full bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-4 rounded-lg transition-colors duration-300",children:"ارسال درخواست"})]})]})}),Ji=({icon:c,label:b,value:N,valueClassName:f="text-gray-800 dark:text-gray-200"})=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[a.jsx(c,{className:"w-4 h-4 ml-2"}),a.jsxs("span",{children:[b,":"]})]}),a.jsx("span",{className:`font-semibold ${f}`,children:N})]}),Px=({onNavigate:c})=>{const[b,N]=y.useState([]),[f,g]=y.useState(!1),[v,H]=y.useState(null),[S,T]=y.useState({title:"",department:"technical",priority:"medium",message:""}),_=Q=>{const M=Q.target.files;if(M){if(b.length+M.length>5){H("حداکثر ۵ فایل می‌توانید آپلود کنید");return}const m=Array.from(M).map(j=>({id:Date.now()+Math.random(),url:URL.createObjectURL(j),file:j}));N(j=>[...j,...m]),H(null)}},G=Q=>{const M=b.find(m=>m.id===Q);M&&URL.revokeObjectURL(M.url),N(m=>m.filter(j=>j.id!==Q))},O=y.useCallback(Q=>{Q.preventDefault(),Q.stopPropagation();const M=Q.dataTransfer.files;if(M&&M.length>0){if(b.length+M.length>5){H("حداکثر ۵ فایل می‌توانید آپلود کنید");return}const m=Array.from(M).map(j=>({id:Date.now()+Math.random(),url:URL.createObjectURL(j),file:j}));N(j=>[...j,...m]),H(null)}},[b.length]),Z=Q=>{Q.preventDefault(),Q.stopPropagation()},X=async Q=>{if(Q.preventDefault(),g(!0),H(null),!S.title.trim()||!S.message.trim()){H("عنوان و متن پیام الزامی هستند"),g(!1);return}try{const M=localStorage.getItem("auth_token");if(!M)throw new Error("لطفاً ابتدا وارد شوید");const m=new FormData;m.append("title",S.title),m.append("department",S.department),m.append("priority",S.priority),m.append("message",S.message),b.forEach(U=>{m.append("attachments[]",U.file)});const j=await fetch(`${et}/tickets`,{method:"POST",headers:{"X-Auth-Token":M},body:m}),R=await j.json();if(!j.ok)throw new Error(R.message||R.errors?Object.values(R.errors).flat().join(", "):"خطا در ارسال تیکت");c("tickets")}catch(M){H(M.message||"خطای ناشناخته رخ داد")}finally{g(!1)}},V=Q=>{const{name:M,value:m}=Q.target;T(j=>({...j,[M]:m}))};return a.jsxs("div",{className:"flex flex-col space-y-8",children:[v&&a.jsxs("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded-lg",children:[a.jsx("strong",{children:"خطا:"})," ",v]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"ارسال تیکت جدید"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"مشکل یا پیشنهاد خود را با ما در میان بگذارید."})]}),a.jsxs("button",{onClick:()=>c("tickets"),className:"flex items-center gap-2 py-2 px-4 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors",children:[a.jsx(fh,{className:"w-5 h-5"}),a.jsx("span",{children:"بازگشت به لیست"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsx("div",{className:"lg:col-span-2",children:a.jsxs("form",{onSubmit:X,className:"space-y-8 bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(ep,{icon:ao,id:"title",name:"title",placeholder:"مثال: مشکل در پرداخت",label:"عنوان تیکت",value:S.title,onChange:V,required:!0}),a.jsxs(j0,{icon:so,id:"department",name:"department",label:"دپارتمان",value:S.department,onChange:V,required:!0,children:[a.jsx("option",{value:"technical",children:"پشتیبانی فنی"}),a.jsx("option",{value:"financial",children:"مالی"}),a.jsx("option",{value:"suggestions",children:"پیشنهادات"})]})]}),a.jsxs(j0,{icon:Cn,id:"priority",name:"priority",label:"اولویت",value:S.priority,onChange:V,required:!0,children:[a.jsx("option",{value:"low",children:"کم"}),a.jsx("option",{value:"medium",children:"متوسط"}),a.jsx("option",{value:"high",children:"زیاد"})]}),a.jsx(tp,{icon:hs,id:"message",name:"message",placeholder:"لطفا مشکل خود را با جزئیات کامل شرح دهید...",label:"متن پیام",value:S.message,onChange:V,required:!0}),a.jsx("button",{type:"submit",disabled:f,className:"w-full bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-3 px-4 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 flex items-center justify-center gap-2 disabled:bg-gray-400 disabled:cursor-not-allowed",children:f?a.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-white"}):a.jsxs(a.Fragment,{children:[a.jsx(ed,{className:"w-5 h-5"}),a.jsx("span",{children:"ارسال تیکت"})]})})]})}),a.jsxs("div",{className:"lg:col-span-1 space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"پیوست فایل (اختیاری)"}),a.jsxs("label",{htmlFor:"file-upload",className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer bg-custom-light-bg dark:bg-custom-dark-blue hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",onDrop:O,onDragOver:Z,children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[a.jsx(Mn,{className:"w-10 h-10 mb-3 text-gray-400"}),a.jsxs("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[a.jsx("span",{className:"font-semibold",children:"برای آپلود کلیک کنید"})," یا بکشید"]}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"PNG, JPG, PDF, DOC, DOCX (حداکثر ۱۰MB)"}),a.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500 mt-1",children:"حداکثر ۵ فایل"})]}),a.jsx("input",{id:"file-upload",type:"file",className:"hidden",multiple:!0,accept:"image/*,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",onChange:_})]})]}),b.length>0&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-lg font-semibold mb-4",children:["فایل‌های پیوست شده (",b.length,"/5)"]}),a.jsx("div",{className:"space-y-3",children:b.map(Q=>a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-3 rounded-lg border border-gray-200 dark:border-gray-600",children:[a.jsxs("div",{className:"flex items-center gap-3 overflow-hidden flex-1",children:[a.jsx(to,{className:"w-4 h-4 text-gray-500 flex-shrink-0"}),a.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[a.jsx("span",{className:"text-sm font-medium text-gray-800 dark:text-gray-200 truncate",children:Q.file.name}),a.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[(Q.file.size/(1024*1024)).toFixed(2)," MB"]})]})]}),a.jsx("button",{type:"button",onClick:()=>G(Q.id),className:"p-1 text-red-500 hover:bg-red-100 dark:hover:bg-red-900/50 rounded-full flex-shrink-0 ml-2",children:a.jsx(Oa,{className:"w-4 h-4"})})]},Q.id))})]})]})]})]})},ep=({id:c,name:b,icon:N,label:f,placeholder:g,value:v,onChange:H,required:S})=>a.jsxs("div",{children:[a.jsxs("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[f,S&&a.jsx("span",{className:"text-red-500 mr-1",children:"*"})]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(N,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,name:b,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",placeholder:g,value:v,onChange:H,required:S})]})]}),j0=({id:c,name:b,icon:N,label:f,children:g,value:v,onChange:H,required:S})=>a.jsxs("div",{children:[a.jsxs("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[f,S&&a.jsx("span",{className:"text-red-500 mr-1",children:"*"})]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(N,{className:"w-5 h-5 text-gray-400"})}),a.jsx("select",{id:c,name:b,className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:v,onChange:H,required:S,children:g}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]})]}),tp=({id:c,name:b,icon:N,label:f,placeholder:g,value:v,onChange:H,required:S})=>a.jsxs("div",{children:[a.jsxs("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[f,S&&a.jsx("span",{className:"text-red-500 mr-1",children:"*"})]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute top-3.5 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(N,{className:"w-5 h-5 text-gray-400"})}),a.jsx("textarea",{id:c,name:b,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition min-h-[150px] resize-y",placeholder:g,value:v,onChange:H,required:S})]})]}),ap=({showError:c,showSuccess:b})=>{const[N,f]=y.useState("request"),[g,v]=y.useState([]),[H,S]=y.useState([]),[T,_]=y.useState("IRT"),[G,O]=y.useState(!1),[Z,X]=y.useState({isOpen:!1,field:null}),[V,Q]=y.useState(null),[M,m]=y.useState(""),[j,R]=y.useState(""),[U,de]=y.useState(""),[pe,z]=y.useState(""),[F,ke]=y.useState(""),[ye,ne]=y.useState(""),[E,fe]=y.useState(""),[be,me]=y.useState(""),[B,oe]=y.useState([]),[Ne,Ae]=y.useState([]),[De,w]=y.useState(!1),[q,K]=y.useState(""),[xe,ee]=y.useState(""),[Te,ze]=y.useState(""),[Be,k]=y.useState(""),[A,ae]=y.useState(""),ie=V?`${V.lat.toFixed(5)}, ${V.lng.toFixed(5)}`:"",we=[{value:"IRT",label:"تومان"},{value:"USD",label:"دلار آمریکا"},{value:"CAD",label:"دلار کانادا"},{value:"IQD",label:"دینار"}],Ce=[{value:"electronics",label:"الکترونیک"},{value:"fashion",label:"مد و پوشاک"},{value:"books",label:"کتاب و رسانه"},{value:"home",label:"خانه و آشپزخانه"},{value:"beauty",label:"آرایشی و بهداشتی"},{value:"other",label:"سایر"}];y.useEffect(()=>()=>{[...g,...H].forEach(le=>URL.revokeObjectURL(le.url))},[g,H]);const We=(le,_e)=>{const Ee=le.target.files;if(Ee){const ft=Array.from(Ee).map(he=>({id:Date.now()+Math.random(),url:URL.createObjectURL(he),file:he}));_e==="request"?v(he=>[...he,...ft]):S(he=>[...he,...ft])}},Je=(le,_e)=>{(_e==="request"?v:S)(ft=>{const he=ft.find(ot=>ot.id===le);return he&&URL.revokeObjectURL(he.url),ft.filter(ot=>ot.id!==le)})},st=y.useCallback((le,_e)=>{le.preventDefault(),le.stopPropagation();const Ee=le.dataTransfer.files;if(Ee&&Ee.length>0){const ft=Array.from(Ee).filter(he=>he.type.startsWith("image/")).map(he=>({id:Date.now()+Math.random(),url:URL.createObjectURL(he),file:he}));_e==="request"?v(he=>[...he,...ft]):S(he=>[...he,...ft])}},[]),$t=le=>{le.preventDefault(),le.stopPropagation()},Gt=le=>{X({isOpen:!0,field:le})},Vt=()=>{X({isOpen:!1,field:null})},bt=le=>{Z.field==="delivery"&&Q(le),Vt()},ea=async le=>{if(le.preventDefault(),w(!0),!q.trim()||Be===""||A===""){c("لطفاً فیلدهای اجباری (عنوان، قیمت کالا، هزینه پیشنهادی) را پر کنید."),w(!1);return}const _e=new FormData;_e.append("title",q.trim()),xe&&_e.append("link",xe),Te&&_e.append("description",Te),V&&(_e.append("delivery_lat",V.lat.toString()),_e.append("delivery_lng",V.lng.toString())),M&&_e.append("delivery_country",M),j&&_e.append("delivery_city",j),U&&_e.append("delivery_address",U),_e.append("item_price",Be.toString()),_e.append("proposed_fee",A.toString()),_e.append("currency",T),_e.append("show_phone",G?"1":"0"),g.forEach(Ee=>_e.append("images[]",Ee.file));try{const Ee=await fetch(`${et}/online-purchase/request`,{method:"POST",headers:{"X-Auth-Token":localStorage.getItem("auth_token")||""},body:_e}),ft=await Ee.json();if(!Ee.ok){const he=ft.message||"خطا در ثبت درخواست";c(he);return}b("درخواست خرید با موفقیت ثبت شد!"),K(""),ee(""),ze(""),Q(null),m(""),R(""),de(""),k(""),ae(""),_("IRT"),O(!1),v([])}catch(Ee){console.error("خطا در ارسال درخواست خرید:",Ee),c(Ee.message||"خطا در ارتباط با سرور")}finally{w(!1)}},Se=async le=>{if(le.preventDefault(),w(!0),!pe.trim()||!F.trim()){c("لطفاً کشور و شهر خود را وارد کنید."),w(!1);return}const _e=new FormData;_e.append("country",pe.trim()),_e.append("city",F.trim()),be&&_e.append("service_title",be),B.length>0&&B.forEach(Ee=>_e.append("categories[]",Ee)),Ne.length>0&&Ne.forEach(Ee=>_e.append("supported_sites[]",Ee)),ye&&_e.append("fee_description",ye),E&&_e.append("capabilities",E),H.length>0&&H.forEach(Ee=>_e.append("images[]",Ee.file)),_e.append("show_phone",G?"1":"0");try{const Ee=await fetch(`${et}/online-purchase/shopper`,{method:"POST",headers:{"X-Auth-Token":localStorage.getItem("auth_token")||""},body:_e}),ft=await Ee.json();if(!Ee.ok){const he=ft.message||"خطا در ثبت اطلاعات";c(he);return}b("اطلاعات شما با موفقیت ثبت شد!"),z(""),ke(""),me(""),oe([]),Ae([]),ne(""),fe(""),S([]),O(!1)}catch(Ee){console.error("خطا در ثبت اطلاعات خریدار:",Ee),c(Ee.message||"خطا در ارتباط با سرور")}finally{w(!1)}};return y.useEffect(()=>{O(!1),N==="request"?(v([]),K(""),ee(""),ze(""),Q(null),m(""),R(""),de(""),k(""),ae(""),_("IRT")):(S([]),z(""),ke(""),me(""),oe([]),Ae([]),ne(""),fe(""))},[N]),a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:N==="request"?"ثبت درخواست خرید اینترنتی":"اعلام آمادگی برای انجام خرید"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:N==="request"?"اطلاعات کالای مورد نظر خود برای خرید را ثبت کنید.":"اطلاعات خود را برای پذیرش سفارشات خرید ثبت کنید."})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-center text-gray-800 dark:text-gray-200",children:"نوع فعالیت خود را انتخاب کنید"}),a.jsx("div",{className:"max-w-sm mx-auto",children:a.jsx("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl shadow-inner p-1",children:a.jsxs("div",{className:"relative flex rounded-lg overflow-hidden",children:[a.jsx("span",{className:`absolute top-0 bottom-0 right-0 w-1/2 bg-custom-purple rounded-lg shadow-md transition-transform duration-300 ease-in-out ${N==="accept"?"-translate-x-full":"translate-x-0"}`,"aria-hidden":"true"}),a.jsxs("button",{type:"button",onClick:()=>f("request"),className:`relative z-10 flex w-1/2 items-center justify-center gap-2 rounded-lg py-2.5 text-md font-semibold transition-colors duration-300 ${N==="request"?"text-white":"text-gray-600 dark:text-gray-300"}`,"aria-label":"درخواست خرید",children:[a.jsx(Ws,{className:"h-5 w-5"}),a.jsx("span",{children:"درخواست خرید"})]}),a.jsxs("button",{type:"button",onClick:()=>f("accept"),className:`relative z-10 flex w-1/2 items-center justify-center gap-2 rounded-lg py-2.5 text-md font-semibold transition-colors duration-300 ${N==="accept"?"text-white":"text-gray-600 dark:text-gray-300"}`,"aria-label":"قبول کردن خرید",children:[a.jsx(Ta,{className:"h-5 w-5"}),a.jsx("span",{children:"قبول کردن خرید"})]})]})})})]}),N==="request"?a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-1 space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"تصویر کالا"}),a.jsxs("label",{htmlFor:"file-upload-request",className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer bg-custom-light-bg dark:bg-custom-dark-blue hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",onDrop:le=>st(le,"request"),onDragOver:$t,children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[a.jsx(Mn,{className:"w-10 h-10 mb-3 text-gray-400"}),a.jsxs("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[a.jsx("span",{className:"font-semibold",children:"برای آپلود کلیک کنید"})," یا بکشید"]}),a.jsx("p",{className:"text-xs text-gray-400",children:"فرمت‌های مجاز: JPG, PNG, GIF"})]}),a.jsx("input",{id:"file-upload-request",type:"file",className:"hidden",multiple:!0,accept:"image/jpeg,image/png,image/gif",onChange:le=>We(le,"request")})]})]}),g.length>0&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-lg font-semibold mb-4",children:["پیش‌نمایش (",g.length," تصویر)"]}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:g.map(le=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:le.url,alt:"Preview",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{type:"button",onClick:()=>Je(le.id,"request"),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(Oa,{className:"w-4 h-4"})})]},le.id))})]})]}),a.jsx("div",{className:"lg:col-span-2",children:a.jsxs("form",{className:"space-y-8",onSubmit:ea,children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۱. اطلاعات کالا"}),a.jsxs("div",{className:"mt-6 space-y-6",children:[a.jsx(Cs,{icon:ao,id:"title",placeholder:"مثال: گوشی موبایل سامسونگ",label:"عنوان کالا *",value:q,onChange:le=>K(le.target.value),required:!0}),a.jsx(Cs,{icon:o0,id:"link",placeholder:"https://example.com/product",label:"لینک خرید (اختیاری)",value:xe,onChange:le=>ee(le.target.value)}),a.jsx(Pu,{icon:hs,id:"description",placeholder:"جزئیات بیشتر در مورد کالا، رنگ، مدل، سایز و...",label:"توضیحات (اختیاری)",value:Te,onChange:le=>ze(le.target.value)})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۲. محل تحویل کالا"}),a.jsx("div",{className:"mt-6",children:a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مقصد تحویل"}),a.jsx(lp,{onButtonClick:()=>Gt("delivery"),value:ie,id:"destination",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه (اختیاری)"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Cs,{icon:ya,id:"destination_country",placeholder:"مثال: ایران",label:"کشور (اختیاری)",value:M,onChange:le=>m(le.target.value)}),a.jsx(Cs,{icon:Fe,id:"destination_city",placeholder:"مثال: تهران",label:"شهر (اختیاری)",value:j,onChange:le=>R(le.target.value)})]}),a.jsx(Cs,{icon:Os,id:"destination_address",placeholder:"آدرس کامل، پلاک و واحد",label:"آدرس دستی (اختیاری)",value:U,onChange:le=>de(le.target.value)})]})})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. قیمت‌گذاری و اطلاعات تماس"}),a.jsxs("div",{className:"mt-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(Cs,{icon:ba,id:"item_price",placeholder:"مثال: 5000000",label:"قیمت کالا *",type:"number",value:Be,onChange:le=>k(le.target.value?Number(le.target.value):""),required:!0}),a.jsx(Cs,{icon:ba,id:"proposed_fee",placeholder:"مثال: 200000",label:"هزینه پیشنهادی انجام *",type:"number",value:A,onChange:le=>ae(le.target.value?Number(le.target.value):""),required:!0})]}),a.jsx(sp,{id:"currency",icon:ba,label:"واحد پولی *",value:T,onChange:le=>_(le.target.value),children:we.map(({value:le,label:_e})=>a.jsx("option",{value:le,children:_e},le))}),a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Ks,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(N0,{enabled:G,setEnabled:O})]})]})]}),a.jsx("button",{type:"submit",disabled:De,className:"w-full bg-custom-purple hover:bg-custom-light-purple disabled:bg-gray-400 text-white font-bold py-3 px-4 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50",children:De?"در حال ثبت...":"ثبت درخواست خرید"})]})})]}):a.jsx("div",{className:"w-full max-w-4xl mx-auto",children:a.jsxs("form",{className:"space-y-8",onSubmit:Se,children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۱. عنوان خدمات شما"}),a.jsx(Cs,{icon:ao,id:"service_title",label:"عنوان خدمات (اختیاری)",placeholder:"مثال: خرید از آمازون، خرید لپ‌تاپ و موبایل",value:be,onChange:le=>me(le.target.value)})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۲. دسته‌بندی کالاهای قابل خرید"}),a.jsxs("div",{className:"mt-4",children:[a.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:"دسته‌بندی‌هایی که می‌توانید از آن‌ها خرید کنید را انتخاب نمایید:"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:Ce.map(le=>a.jsxs("label",{className:`flex items-center justify-between p-4 border rounded-lg cursor-pointer transition-all duration-200 ${B.includes(le.value)?"bg-custom-purple/10 border-custom-purple ring-2 ring-custom-purple/50 dark:bg-custom-purple/20":"bg-custom-light-bg dark:bg-custom-dark-blue border-gray-300 dark:border-gray-600 hover:border-custom-purple/50"}`,children:[a.jsx("span",{className:`font-semibold transition-colors ${B.includes(le.value)?"text-custom-purple dark:text-custom-light-purple":"text-gray-800 dark:text-gray-200"}`,children:le.label}),a.jsx("input",{type:"checkbox",checked:B.includes(le.value),onChange:_e=>{_e.target.checked?oe(Ee=>[...Ee,le.value]):oe(Ee=>Ee.filter(ft=>ft!==le.value))},className:"sr-only"}),B.includes(le.value)&&a.jsx(G0,{className:"w-5 h-5 text-custom-purple"})]},le.value))})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. سایت‌هایی که می‌توانید از آن‌ها خرید کنید"}),a.jsxs("div",{className:"mt-4",children:[a.jsx(Cs,{icon:o0,id:"supported_sites",label:"سایت‌ها (با کاما جدا کنید)",placeholder:"مثال: amazon.com, aliexpress.com, ebay.com",value:Ne.join(", "),onChange:le=>{const Ee=le.target.value.split(",").map(ft=>ft.trim()).filter(ft=>ft.length>0);Ae(Ee)}}),a.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:"نام دامنه سایت‌ها را با کاما جدا کنید. (اختیاری)"})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۴. محل فعالیت شما"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(Cs,{icon:ya,id:"shopper_country",placeholder:"مثال: آمریکا",label:"کشور *",value:pe,onChange:le=>z(le.target.value),required:!0}),a.jsx(Cs,{icon:Fe,id:"shopper_city",placeholder:"مثال: نیویورک",label:"شهر *",value:F,onChange:le=>ke(le.target.value),required:!0})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۵. تصویر (اختیاری)"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("label",{htmlFor:"file-upload-shopper",className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer bg-custom-light-bg dark:bg-custom-dark-blue hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",onDrop:le=>st(le,"shopper"),onDragOver:$t,children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[a.jsx(Mn,{className:"w-10 h-10 mb-3 text-gray-400"}),a.jsxs("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[a.jsx("span",{className:"font-semibold",children:"آپلود عکس"})," (اختیاری)"]}),a.jsx("p",{className:"text-xs text-gray-400",children:"فرمت‌های مجاز: JPG, PNG, GIF"})]}),a.jsx("input",{id:"file-upload-shopper",type:"file",className:"hidden",multiple:!0,accept:"image/jpeg,image/png,image/gif",onChange:le=>We(le,"shopper")})]}),H.length>0&&a.jsxs("div",{className:"pt-4",children:[a.jsxs("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:["پیش‌نمایش (",H.length," تصویر):"]}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:H.map(le=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:le.url,alt:"Preview",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{type:"button",onClick:()=>Je(le.id,"shopper"),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(Oa,{className:"w-4 h-4"})})]},le.id))})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۶. جزئیات خدمات"}),a.jsxs("div",{className:"mt-6 space-y-6",children:[a.jsx(Pu,{icon:ba,id:"fee_description",label:"توضیحات کارمزد (اختیاری)",placeholder:"نحوه محاسبه کارمزد خود را توضیح دهید (مثلاً: درصدی از قیمت کالا، مبلغ ثابت و...)",value:ye,onChange:le=>ne(le.target.value)}),a.jsx(Pu,{icon:hs,id:"capabilities",label:"توضیحات بیشتر (اختیاری)",placeholder:"اطلاعات بیشتر در مورد خدماتی که ارائه می‌دهید، تجربیات قبلی، شرایط خاص و...",value:E,onChange:le=>fe(le.target.value)})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۷. اطلاعات تماس"}),a.jsx("div",{className:"mt-6",children:a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Ks,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(N0,{enabled:G,setEnabled:O})]})})]}),a.jsx("button",{type:"submit",disabled:De,className:"w-full bg-custom-purple hover:bg-custom-light-purple disabled:bg-gray-400 text-white font-bold py-3 px-4 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50",children:De?"در حال ثبت...":"ثبت آمادگی برای خرید"})]})}),a.jsx(rp,{isOpen:Z.isOpen,onClose:Vt,onConfirm:bt,field:Z.field})]})},Cs=({id:c,icon:b,label:N,placeholder:f,type:g="text",value:v,onChange:H,min:S,step:T,required:_=!1})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[b&&a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:g,id:c,className:`w-full ${b?"pr-10":"pr-4"} pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition`,placeholder:f,value:v,onChange:H,min:S,step:T,required:_})]})]}),Pu=({id:c,icon:b,label:N,placeholder:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute top-3.5 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("textarea",{id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition min-h-[100px] resize-y",placeholder:f,value:g,onChange:v})]})]}),sp=({id:c,icon:b,label:N,children:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("select",{id:c,className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:g,onChange:v,children:f}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]})]}),lp=({id:c,label:b,placeholder:N,value:f,onButtonClick:g})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative flex items-center",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(Fe,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",placeholder:N,value:f,readOnly:!0,onClick:g,style:{cursor:"pointer"}}),a.jsx("button",{type:"button",onClick:g,className:"absolute left-2 text-sm bg-custom-purple text-white px-3 py-1 rounded-md hover:bg-custom-light-purple transition-colors",children:"انتخاب"})]})]}),N0=({enabled:c,setEnabled:b})=>a.jsx("button",{type:"button",dir:"ltr",className:`${c?"bg-custom-purple":"bg-gray-200 dark:bg-gray-600"}
relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent
transition-colors duration-200 ease-in-out
focus:outline-none focus:ring-2 focus:ring-custom-purple focus:ring-offset-2`,onClick:()=>b(!c),children:a.jsx("span",{"aria-hidden":"true",className:`${c?"translate-x-5":"translate-x-0"}
pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white
shadow-lg ring-0 transition duration-200 ease-in-out`})}),rp=({isOpen:c,onClose:b,onConfirm:N,field:f})=>{const g=y.useRef(null),v=y.useRef(null),H=y.useRef(null),[S,T]=y.useState(null),[_,G]=y.useState(""),[O,Z]=y.useState(!1);y.useEffect(()=>{if(!c)return;const m=()=>{g.current&&(g.current.remove(),g.current=null),v.current=null,T(null),G("")};if(H.current&&!g.current){const j=L.map(H.current).setView([35.6892,51.389],10);g.current=j,L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(j),j.on("click",R=>{const{lat:U,lng:de}=R.latlng;T({lat:U,lng:de}),v.current?v.current.setLatLng(R.latlng):v.current=L.marker(R.latlng).addTo(g.current)}),setTimeout(()=>j.invalidateSize(),100)}return m},[c]);const X=async()=>{if(_.trim()){Z(!0);try{const m=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(_)}&accept-language=fa`);if(!m.ok)throw new Error("Network response was not ok");const j=await m.json();if(j&&j.length>0){const{lat:R,lon:U}=j[0],de=parseFloat(R),pe=parseFloat(U),z={lat:de,lng:pe};T(z),g.current&&(g.current.setView(z,15),v.current?v.current.setLatLng(z):v.current=L.marker(z).addTo(g.current))}else alert("مکان مورد نظر یافت نشد.")}catch(m){console.error("Geocoding error:",m),alert("خطایی در جستجوی مکان رخ داد.")}finally{Z(!1)}}},V=async()=>{if(!navigator.geolocation){alert("مرورگر شما از موقعیت‌یابی جغرافیایی پشتیبانی نمی‌کند.");return}if(navigator.permissions&&navigator.permissions.query)try{if((await navigator.permissions.query({name:"geolocation"})).state==="denied"){alert("شما دسترسی به موقعیت مکانی را مسدود کرده‌اید. لطفاً آن را در تنظیمات مرورگر خود فعال کنید.");return}}catch(m){console.warn("Could not check permission status:",m)}navigator.geolocation.getCurrentPosition(m=>{const{latitude:j,longitude:R}=m.coords,U={lat:j,lng:R};T(U),g.current&&(g.current.setView(U,15),v.current?v.current.setLatLng(U):v.current=L.marker(U).addTo(g.current))},m=>{console.error("Geolocation error:",m.message);let j="امکان دسترسی به موقعیت مکانی شما وجود ندارد.";switch(m.code){case m.PERMISSION_DENIED:j="شما اجازه دسترسی به موقعیت مکانی را نداده‌اید. لطفاً دسترسی را از تنظیمات مرورگر خود فعال کنید.";break;case m.POSITION_UNAVAILABLE:j="اطلاعات موقعیت مکانی در دسترس نیست.";break;case m.TIMEOUT:j="درخواست برای دریافت موقعیت مکانی بیش از حد طول کشید.";break}alert(j)})},Q=()=>{S&&N(S)};return c?a.jsx("div",{className:"fixed inset-0 bg-black/70 z-50 flex items-center justify-center p-4 backdrop-blur-sm",onClick:b,children:a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light w-full max-w-2xl rounded-2xl shadow-2xl border border-gray-200 dark:border-gray-700/50 transform transition-all duration-300 ease-out scale-95 opacity-0 animate-fade-in-scale overflow-hidden",onClick:m=>m.stopPropagation(),children:[a.jsxs("div",{className:"flex justify-between items-center p-5 bg-custom-light-bg dark:bg-custom-dark-blue",children:[a.jsxs("h2",{className:"text-xl font-bold flex items-center gap-3",children:[a.jsx(Fe,{className:"w-6 h-6 text-custom-purple"})," ","ثبت موقعیت تحویل"]}),a.jsx("button",{onClick:b,className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",children:a.jsx(Oa,{className:"w-6 h-6 text-gray-500 dark:text-gray-400"})})]}),a.jsxs("div",{className:"p-6 space-y-5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative flex-grow",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(fa,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",value:_,onChange:m=>G(m.target.value),onKeyDown:m=>{m.key==="Enter"&&X()},placeholder:"جستجوی آدرس یا مکان...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition"})]}),a.jsx("button",{onClick:X,disabled:O,className:"flex-shrink-0 flex items-center justify-center w-28 py-2.5 px-4 rounded-lg bg-custom-purple text-white font-semibold hover:bg-custom-light-purple transition-colors disabled:bg-gray-400 disabled:cursor-wait",children:O?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):a.jsx("span",{children:"جستجو"})})]}),a.jsxs("button",{onClick:V,className:"w-full flex items-center justify-center gap-2 py-3 px-4 rounded-xl bg-gradient-to-br from-custom-cyan to-teal-400 text-white font-semibold hover:shadow-lg hover:shadow-custom-cyan/30 transition-all duration-300 transform hover:-translate-y-0.5",children:[a.jsx(io,{className:"w-5 h-5"}),a.jsx("span",{children:"استفاده از موقعیت فعلی من"})]}),a.jsxs("div",{className:"relative my-4",children:[a.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true",children:a.jsx("div",{className:"w-full border-t border-gray-300 dark:border-gray-600"})}),a.jsx("div",{className:"relative flex justify-center",children:a.jsx("span",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light px-3 text-sm text-gray-500 dark:text-gray-400",children:"یا"})})]}),a.jsx("p",{className:"text-center text-sm text-gray-500 dark:text-gray-400 -mt-2 mb-2",children:"برای انتخاب، روی نقشه کلیک کنید."}),a.jsx("div",{ref:H,className:"w-full h-80 bg-gray-200 dark:bg-gray-700 rounded-lg cursor-pointer z-0 border border-gray-300 dark:border-gray-600 shadow-inner"}),a.jsxs("div",{className:"px-6 py-4 bg-custom-light-bg dark:bg-custom-dark-blue border-t border-gray-200 dark:border-gray-700 flex justify-between items-center",children:[a.jsx("button",{onClick:b,className:"py-2 px-5 rounded-lg text-gray-700 dark:text-gray-300 font-semibold hover:bg-gray-200 dark:hover:bg-gray-700/50 transition-colors",children:"انصراف"}),a.jsx("button",{onClick:Q,disabled:!S,className:"py-2.5 px-6 rounded-xl bg-gradient-to-br from-custom-purple to-custom-light-purple text-white font-semibold hover:shadow-lg hover:shadow-custom-purple/30 transition-all duration-300 disabled:from-gray-400 disabled:to-gray-500 disabled:shadow-none disabled:cursor-not-allowed transform disabled:transform-none hover:-translate-y-0.5",children:"تایید موقعیت"})]})]}),a.jsx("style",{children:`
@keyframes fade-in-scale {
from { transform: scale(0.95); opacity: 0; }
to { transform: scale(1); opacity: 1; }
}
.animate-fade-in-scale {
animation: fade-in-scale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.leaflet-container {
font-family: 'Vazirmatn', sans-serif;
}
`})]})}):null},w0=[{id:1,title:"گوشی موبایل سامسونگ S23 Ultra",imageUrl:"https://picsum.photos/seed/s23ultra/400/300",purchaseLocation:{country:"آمریکا",city:"نیویورک"},deliveryLocation:{country:"ایران",city:"تهران"},itemPrice:1199,proposedFee:100,currency:"USD",datePosted:"۲ ساعت پیش"},{id:2,title:"کتاب Clean Architecture",imageUrl:"https://picsum.photos/seed/cleanarch/400/300",purchaseLocation:{country:"کانادا",city:"تورنتو"},deliveryLocation:{country:"ایران",city:"اصفهان"},itemPrice:45,proposedFee:15,currency:"CAD",datePosted:"۱ روز پیش"},{id:3,title:"پردازنده گرافیکی Nvidia RTX 4080",imageUrl:"https://picsum.photos/seed/rtx4080/400/300",purchaseLocation:{country:"آمریکا",city:"لس آنجلس"},deliveryLocation:{country:"ایران",city:"شیراز"},itemPrice:1250,proposedFee:150,currency:"USD",datePosted:"۳ روز پیش"},{id:4,title:"ست لگو Star Wars",imageUrl:"https://picsum.photos/seed/legosw/400/300",purchaseLocation:{country:"آلمان",city:"برلین"},deliveryLocation:{country:"ایران",city:"مشهد"},itemPrice:200,proposedFee:40,currency:"EUR",datePosted:"۵ روز پیش"},{id:5,title:"کیف دستی زنانه برند Coach",imageUrl:"https://picsum.photos/seed/coachbag/400/300",purchaseLocation:{country:"آمریکا",city:"نیویورک"},deliveryLocation:{country:"ایران",city:"تهران"},itemPrice:350,proposedFee:60,currency:"USD",datePosted:"۱ هفته پیش"},{id:6,title:"کفش ورزشی نایکی Air Jordan",imageUrl:"https://picsum.photos/seed/jordans/400/300",purchaseLocation:{country:"کانادا",city:"ونکوور"},deliveryLocation:{country:"ایران",city:"تبریز"},itemPrice:180,proposedFee:35,currency:"CAD",datePosted:"۲ هفته پیش"}],np=({onNavigate:c})=>{const[b,N]=y.useState(w0),[f,g]=y.useState(w0),[v,H]=y.useState(""),[S,T]=y.useState(""),[_,G]=y.useState(""),[O,Z]=y.useState(""),[X,V]=y.useState(""),[Q,M]=y.useState("newest");return y.useEffect(()=>{let m=[...b];switch(v&&(m=m.filter(j=>j.title.toLowerCase().includes(v.toLowerCase()))),S&&(m=m.filter(j=>j.purchaseLocation.country.toLowerCase().includes(S.toLowerCase()))),_&&(m=m.filter(j=>j.purchaseLocation.city.toLowerCase().includes(_.toLowerCase()))),O&&(m=m.filter(j=>j.deliveryLocation.country.toLowerCase().includes(O.toLowerCase()))),X&&(m=m.filter(j=>j.deliveryLocation.city.toLowerCase().includes(X.toLowerCase()))),Q){case"fee_asc":m.sort((j,R)=>j.proposedFee-R.proposedFee);break;case"fee_desc":m.sort((j,R)=>R.proposedFee-j.proposedFee);break;case"oldest":m.reverse();break}g(m)},[v,S,_,O,X,Q,b]),a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"قبول کردن خرید اینترنتی"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"لیست تمام خریدهای ثبت شده توسط کاربران را مشاهده کنید."})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:[a.jsx(Ki,{id:"searchQuery",label:"عنوان کالا",placeholder:"مثال: گوشی موبایل...",value:v,onChange:m=>H(m.target.value),icon:fa}),a.jsx(Ki,{id:"purchaseCountry",label:"کشور خرید",placeholder:"مثال: آمریکا",value:S,onChange:m=>T(m.target.value),icon:ya}),a.jsx(Ki,{id:"purchaseCity",label:"شهر خرید",placeholder:"مثال: نیویورک",value:_,onChange:m=>G(m.target.value),icon:Fe}),a.jsx(Ki,{id:"deliveryCountry",label:"کشور تحویل",placeholder:"مثال: ایران",value:O,onChange:m=>Z(m.target.value),icon:ya}),a.jsx(Ki,{id:"deliveryCity",label:"شهر تحویل",placeholder:"مثال: تهران",value:X,onChange:m=>V(m.target.value),icon:Fe}),a.jsx(ip,{value:Q,onChange:m=>M(m.target.value)})]}),a.jsx("div",{className:"mt-6 flex justify-end",children:a.jsxs("button",{className:"w-full sm:w-auto bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-8 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 flex items-center justify-center gap-2",children:[a.jsx(fa,{className:"w-5 h-5"}),a.jsx("span",{children:"جستجو"})]})})]}),f.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:f.map(m=>a.jsx(op,{...m,onNavigate:c},m.id))}):a.jsxs("div",{className:"col-span-1 md:col-span-2 lg:col-span-3 text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx(Ws,{className:"w-16 h-16 mx-auto text-gray-300 dark:text-gray-600"}),a.jsx("h3",{className:"mt-4 text-xl font-semibold text-gray-800 dark:text-gray-200",children:"درخواستی یافت نشد"}),a.jsx("p",{className:"mt-1 text-gray-500 dark:text-gray-400",children:"هیچ درخواستی با این مشخصات یافت نشد."})]})]})},Ki=({id:c,label:b,placeholder:N,value:f,onChange:g,icon:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(v,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,placeholder:N,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:f,onChange:g})]})]}),ip=({value:c,onChange:b})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"مرتب‌سازی"}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:"sortBy",className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:c,onChange:b,children:[a.jsx("option",{value:"newest",children:"جدیدترین"}),a.jsx("option",{value:"oldest",children:"قدیمی‌ترین"}),a.jsx("option",{value:"fee_asc",children:"کارمزد: کم به زیاد"}),a.jsx("option",{value:"fee_desc",children:"کارمزد: زیاد به کم"})]}),a.jsx(yt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]})]}),op=({id:c,title:b,imageUrl:N,purchaseLocation:f,deliveryLocation:g,itemPrice:v,proposedFee:H,currency:S,datePosted:T,onNavigate:_})=>a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl shadow-sm overflow-hidden flex flex-col group transform hover:-translate-y-1.5 transition-transform duration-300",children:[a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:N,alt:b,className:"w-full h-48 object-cover"}),a.jsx("div",{className:"absolute top-0 right-0 m-2 px-3 py-1 bg-black/60 text-white text-xs font-bold rounded-full backdrop-blur-sm",children:T})]}),a.jsxs("div",{className:"p-5 flex flex-col flex-grow",children:[a.jsx("h3",{className:"text-lg font-bold text-gray-800 dark:text-white mb-3 flex-grow",children:b}),a.jsxs("div",{className:"space-y-3 text-sm text-gray-600 dark:text-gray-300 mb-4 border-t border-gray-200 dark:border-gray-700 pt-4",children:[a.jsx(Fc,{icon:Ws,label:"خرید از",value:`${f.city}, ${f.country}`}),a.jsx(Fc,{icon:Fe,label:"تحویل در",value:`${g.city}, ${g.country}`}),a.jsx(Fc,{icon:ba,label:"قیمت کالا",value:`${v.toLocaleString()} ${S}`}),a.jsx(Fc,{icon:ba,label:"کارمزد پیشنهادی",value:`${H.toLocaleString()} ${S}`,valueClassName:"text-green-600 dark:text-green-400"})]}),a.jsxs("div",{className:"mt-auto grid grid-cols-2 gap-3",children:[a.jsxs("button",{onClick:()=>_("messages"),className:"w-full flex items-center justify-center gap-2 bg-custom-cyan/10 hover:bg-custom-cyan/20 text-custom-cyan font-bold py-2.5 px-4 rounded-lg transition-colors duration-300",children:[a.jsx(ro,{className:"w-5 h-5"}),a.jsx("span",{children:"چت"})]}),a.jsx("button",{onClick:()=>_("purchase-detail",c.toString()),className:"w-full bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-4 rounded-lg transition-colors duration-300",children:"ارسال درخواست"})]})]})]}),Fc=({icon:c,label:b,value:N,valueClassName:f="text-gray-800 dark:text-gray-200"})=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[a.jsx(c,{className:"w-4 h-4 ml-2"}),a.jsxs("span",{children:[b,":"]})]}),a.jsx("span",{className:`font-semibold ${f}`,children:N})]}),yh=({open:c,title:b="حذف آیتم",message:N="آیا از حذف این مورد مطمئن هستید؟ این عملیات غیرقابل بازگشت است.",onCancel:f,onConfirm:g})=>c?a.jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",children:a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light w-full max-w-md rounded-2xl shadow-xl p-6 animate-scale-in relative",children:[a.jsx("h3",{className:"text-xl font-bold text-gray-800 dark:text-white mb-4",children:b}),a.jsx("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed mb-6",children:N}),a.jsxs("div",{className:"flex items-center justify-end gap-3",children:[a.jsx("button",{onClick:f,className:"px-4 py-2 rounded-lg bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200",children:"انصراف"}),a.jsx("button",{onClick:g,className:"px-4 py-2 rounded-lg bg-red-600 hover:bg-red-700 text-white",children:"حذف کن"})]})]})}):null,cp=({onNavigate:c,showSuccess:b,showError:N})=>{var ne;const[f,g]=y.useState(""),[v,H]=y.useState("all"),[S,T]=y.useState("all"),[_,G]=y.useState([]),[O,Z]=y.useState([]),[X,V]=y.useState(!0),[Q,M]=y.useState(null),[m,j]=y.useState(null),[R,U]=y.useState({open:!1,item:null}),de=E=>{if(!E)return"تاریخ نامعلوم";const fe=new Date(E),me=Math.floor((new Date().getTime()-fe.getTime())/(1e3*60*60));return me<1?"چند دقیقه پیش":me<24?`${me} ساعت پیش`:me<168?`${Math.floor(me/24)} روز پیش`:`${Math.floor(me/168)} هفته پیش`},pe=async()=>{var E,fe,be,me,B,oe;try{V(!0),M(null);const Ae=(await(await ha(`${et}/online-purchase/my-requests`)).json()).data||[],De=await ha(`${et}/online-purchase/my-shopper`);if(!De.ok)throw new Error("خطا در دریافت پروفایل خریدار");const q=(await De.json()).data,K=Ae.map(ee=>{var Te,ze,Be,k,A;return{id:ee.id.toString(),type:"request",title:ee.title||"بدون عنوان",requestDate:de(ee.created_at),status:ee.status==="active"?"active":"pending",fee:((Te=ee.proposed_fee)==null?void 0:Te.toString())||"0",currency:ee.currency||"IRT",location:[ee.delivery_city,ee.delivery_country].filter(Boolean).join("، ")||"—",imageUrl:((Be=(ze=ee.images)==null?void 0:ze[0])==null?void 0:Be.url)||((A=(k=ee.images)==null?void 0:k[0])!=null&&A.path?`https://eino.eifa.site/users-api/public/${ee.images[0].path}`:void 0)}}),xe=[];if(q&&q.id){const ee=(E=q.service_title)!=null&&E.trim()?q.service_title.trim():`آماده خرید از ${q.country||"کشور نامشخص"}`;xe.push({id:q.id.toString(),type:"offer",title:ee,requestDate:de(q.created_at||q.updated_at),status:q.status==="active"?"active":"pending",fee:((fe=q.fee_description)==null?void 0:fe.trim())||"توافقی",currency:"",shopperLocation:[(be=q.city)==null?void 0:be.trim(),(me=q.country)==null?void 0:me.trim()].filter(Boolean).join("، ")||"—",imageUrl:(oe=(B=q.images)==null?void 0:B[0])==null?void 0:oe.url})}G([...K,...xe])}catch(Ne){console.error("خطا در دریافت داده‌ها:",Ne),M(Ne.message||"خطا در بارگذاری اطلاعات")}finally{V(!1)}};y.useEffect(()=>{pe()},[]),y.useEffect(()=>{const E=f.toLowerCase(),fe=_.filter(be=>{const me=be.title.toLowerCase().includes(E),B=v==="all"||be.status===v,oe=S==="all"||be.type===S;return me&&B&&oe});Z(fe)},[f,v,S,_]);const z=E=>{console.log("🔴 DELETE CLICKED:",E),U({open:!0,item:E})},F=()=>{U({open:!1,item:null})},ke=async()=>{const E=R.item;if(E){j(E.id);try{const fe=E.type==="request"?`online-purchase/request/${E.id}`:`online-purchase/shopper/${E.id}`,be=await ha(`${et}/${fe}`,{method:"DELETE"});if(!be.ok){const me=await be.json();throw new Error(me.message||"خطا در حذف")}b(E.type==="request"?"درخواست خرید با موفقیت حذف شد":"پروفایل خریدار با موفقیت حذف شد"),G(me=>me.filter(B=>B.id!==E.id)),U({open:!1,item:null})}catch(fe){N(fe.message||"خطا در حذف آیتم")}finally{j(null)}}},ye=E=>{E.type==="request"?c("purchase-request-detail",E.id,{isOwnerView:!0}):c("purchase-shopper-detail",E.id,{isOwnerView:!0})};return X?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست فعالیت‌های من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"در حال بارگذاری..."})]}),a.jsx("div",{className:"flex justify-center items-center py-12",children:a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-custom-purple"})})]}):Q?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست فعالیت‌های من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"خطا در بارگذاری اطلاعات"})]}),a.jsxs("div",{className:"text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx("div",{className:"text-red-500 mb-4 text-4xl",children:"⚠️"}),a.jsx("h3",{className:"text-xl font-semibold text-red-600 dark:text-red-400 mb-2",children:"خطا در بارگذاری"}),a.jsx("p",{className:"text-red-500 dark:text-red-300 mb-4",children:Q}),a.jsx("button",{onClick:pe,className:"bg-custom-purple hover:bg-custom-light-purple text-white px-6 py-2 rounded-lg transition-colors",children:"تلاش مجدد"})]})]}):a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست فعالیت‌های من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"درخواست‌های خرید و پروفایل خریداری شما"})]}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"w-full grid grid-cols-1 sm:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",placeholder:"جستجو در فعالیت‌ها...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:f,onChange:E=>g(E.target.value)}),a.jsx(fa,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:v,onChange:E=>H(E.target.value),children:[a.jsx("option",{value:"all",children:"همه وضعیت‌ها"}),a.jsx("option",{value:"active",children:"فعال"}),a.jsx("option",{value:"pending",children:"در حال بررسی"})]}),a.jsx(yt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:S,onChange:E=>T(E.target.value),children:[a.jsx("option",{value:"all",children:"همه انواع"}),a.jsx("option",{value:"request",children:"درخواست خرید"}),a.jsx("option",{value:"offer",children:"قبول کردن خرید"})]}),a.jsx(yt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]})]})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"کل فعالیت‌ها"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.length})]}),a.jsx(Ws,{className:"w-8 h-8 text-custom-purple"})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"درخواست‌های خرید"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.filter(E=>E.type==="request").length})]}),a.jsx(Ws,{className:"w-8 h-8 text-custom-cyan"})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"پروفایل خریدار"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.filter(E=>E.type==="offer").length})]}),a.jsx(Ta,{className:"w-8 h-8 text-custom-orange"})]})})]}),a.jsx("div",{className:"space-y-6",children:O.length>0?O.map(E=>a.jsx(dp,{item:E,onViewDetails:ye,onDelete:z,isDeleting:m===E.id},`${E.type}-${E.id}`)):a.jsxs("div",{className:"text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx(Ws,{className:"w-16 h-16 mx-auto text-gray-300 dark:text-gray-600"}),a.jsx("h3",{className:"mt-4 text-xl font-semibold text-gray-800 dark:text-gray-200",children:"فعالیتی یافت نشد"}),a.jsx("p",{className:"mt-1 text-gray-500 dark:text-gray-400",children:_.length===0?"شما هنوز درخواست یا پروفایل خریداری ثبت نکرده‌اید.":"هیچ فعالیتی با این مشخصات یافت نشد."}),_.length===0&&a.jsx("button",{onClick:()=>c("register-online-purchase"),className:"mt-4 bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300",children:"ثبت اولین فعالیت"})]})}),a.jsx(yh,{open:R.open,title:((ne=R.item)==null?void 0:ne.type)==="request"?"حذف درخواست خرید":"حذف پروفایل خریدار",message:R.item?`آیا از حذف "${R.item.title}" مطمئن هستید؟ این عملیات غیرقابل بازگشت است.`:"آیا مطمئن هستید؟",onCancel:F,onConfirm:ke})]})},dp=({item:c,onViewDetails:b,onDelete:N,isDeleting:f})=>{const g=c.type==="request",v=()=>{switch(c.status){case"active":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-green-500/10 text-green-500",children:"فعال"});case"pending":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-custom-orange/10 text-custom-orange",children:"در حال بررسی"});case"rejected":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-red-500/10 text-red-500",children:"رد شده"});default:return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-gray-500/10 text-gray-500",children:c.status})}};return a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-6 bg-custom-light-card dark:bg-custom-dark-blue-light p-5 rounded-2xl shadow-sm border border-transparent hover:border-custom-purple/50 hover:shadow-lg transition-all duration-300",children:[a.jsx("div",{className:"flex-shrink-0 w-full md:w-32 h-32",children:c.imageUrl?a.jsx("img",{src:c.imageUrl,alt:c.title,className:"w-full h-full object-cover rounded-xl",onError:H=>{const S=H.currentTarget.parentElement;S&&(S.innerHTML=`
                                    <div class="w-full h-full bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl flex items-center justify-center">
                                        <svg class="w-16 h-16 text-custom-purple/50" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
                                        </svg>
                                    </div>
                                `)}}):a.jsx("div",{className:"w-full h-full bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl flex items-center justify-center",children:g?a.jsx(Ws,{className:"w-16 h-16 text-custom-purple/50"}):a.jsx(Ta,{className:"w-16 h-16 text-custom-purple/50"})})}),a.jsxs("div",{className:"flex flex-col flex-grow w-full",children:[a.jsxs("div",{className:"flex justify-between items-start mb-3",children:[a.jsxs("div",{children:[a.jsxs("div",{className:`flex items-center gap-2 mb-1 ${g?"text-custom-cyan":"text-custom-orange"}`,children:[g?a.jsx(Ws,{className:"w-5 h-5"}):a.jsx(Ta,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm font-semibold",children:g?"درخواست خرید":"قبول کردن خرید"})]}),a.jsx("h3",{className:"text-lg font-bold text-gray-800 dark:text-white",children:c.title})]}),a.jsx("div",{className:"flex-shrink-0",children:v()})]}),a.jsxs("div",{className:"flex-grow space-y-2 text-sm text-gray-600 dark:text-gray-300 border-t border-gray-200 dark:border-gray-700 pt-3",children:[a.jsx(eh,{icon:no,label:"تاریخ ثبت",value:c.requestDate}),a.jsx(eh,{icon:ba,label:g?"هزینه پیشنهادی":"شرایط کارمزد",value:`${c.fee} ${c.currency}`.trim(),valueClassName:g?"text-green-600 dark:text-green-400":"text-gray-800 dark:text-gray-200"}),a.jsx(eh,{icon:Fe,label:g?"محل تحویل":"محل فعالیت",value:g?c.location:c.shopperLocation})]}),a.jsxs("div",{className:"mt-4 flex items-center justify-end gap-3",children:[a.jsx("button",{onClick:()=>N(c),disabled:f,className:"flex items-center gap-2 bg-red-500 hover:bg-red-600 disabled:bg-gray-400 text-white font-bold py-2 px-4 rounded-lg transition-colors duration-300 text-sm",children:f?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),a.jsx("span",{children:"در حال حذف..."})]}):a.jsxs(a.Fragment,{children:[a.jsx(Oa,{className:"w-4 h-4"}),a.jsx("span",{children:"حذف"})]})}),a.jsx("button",{onClick:()=>b(c),className:"bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300 text-sm",children:"مشاهده جزئیات"})]})]})]})},eh=({icon:c,label:b,value:N,valueClassName:f="text-gray-800 dark:text-gray-200"})=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[a.jsx(c,{className:"w-4 h-4 ml-2"}),a.jsxs("span",{children:[b,":"]})]}),a.jsx("span",{className:`font-semibold ${f}`,children:N||"-"})]}),up=({onNavigate:c,showSuccess:b,showError:N})=>{var ne;const[f,g]=y.useState(""),[v,H]=y.useState("all"),[S,T]=y.useState("all"),[_,G]=y.useState([]),[O,Z]=y.useState([]),[X,V]=y.useState(!0),[Q,M]=y.useState(null),[m,j]=y.useState(null),[R,U]=y.useState({open:!1,item:null}),de=E=>{if(!E)return"تاریخ نامعلوم";const fe=new Date(E),me=Math.floor((new Date().getTime()-fe.getTime())/(1e3*60*60));return me<1?"چند دقیقه پیش":me<24?`${me} ساعت پیش`:me<168?`${Math.floor(me/24)} روز پیش`:`${Math.floor(me/168)} هفته پیش`},pe=async()=>{try{V(!0),M(null);const E=await ha(`${et}/shipments/my-list`);if(!E.ok)throw new Error("خطا در دریافت لیست مرسوله‌ها");const fe=await E.json();G(fe.data||[])}catch(E){console.error("خطا در دریافت داده‌ها:",E),M(E.message||"خطا در بارگذاری اطلاعات")}finally{V(!1)}};y.useEffect(()=>{pe()},[]),y.useEffect(()=>{const E=f.toLowerCase(),fe=_.filter(be=>{const me=be.title||be.origin_city.toLowerCase().includes(E)||be.destination_city.toLowerCase().includes(E),B=v==="all"||be.status===v,oe=S==="all"||be.type===S;return me&&B&&oe});Z(fe)},[f,v,S,_]);const z=E=>{U({open:!0,item:E})},F=async()=>{if(!R.item)return;const E=R.item;j(E.id),U({open:!1,item:null});try{const fe=await ha(`${et}/shipments/${E.id}`,{method:"DELETE"});if(!fe.ok){const be=await fe.json();throw new Error(be.message||"خطا در حذف")}b("مرسوله با موفقیت حذف شد"),G(be=>be.filter(me=>me.id!==E.id))}catch(fe){N(fe.message||"خطا در حذف مرسوله")}finally{j(null)}},ke=()=>{U({open:!1,item:null})},ye=E=>{c("shipment-detail",E.id,{isOwnerView:!0})};return X?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست مرسوله‌های من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"در حال بارگذاری..."})]}),a.jsx("div",{className:"flex justify-center items-center py-12",children:a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-custom-purple"})})]}):Q?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست مرسوله‌های من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"خطا در بارگذاری اطلاعات"})]}),a.jsxs("div",{className:"text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx("div",{className:"text-red-500 mb-4 text-4xl",children:"⚠️"}),a.jsx("h3",{className:"text-xl font-semibold text-red-600 dark:text-red-400 mb-2",children:"خطا در بارگذاری"}),a.jsx("p",{className:"text-red-500 dark:text-red-300 mb-4",children:Q}),a.jsx("button",{onClick:pe,className:"bg-custom-purple hover:bg-custom-light-purple text-white px-6 py-2 rounded-lg transition-colors",children:"تلاش مجدد"})]})]}):a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست مرسوله‌های من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"مرسولات و سفرهای ثبت شده خود را مدیریت کنید."})]}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"w-full grid grid-cols-1 sm:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",placeholder:"جستجو در مرسوله‌ها...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:f,onChange:E=>g(E.target.value)}),a.jsx(fa,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:v,onChange:E=>H(E.target.value),children:[a.jsx("option",{value:"all",children:"همه وضعیت‌ها"}),a.jsx("option",{value:"active",children:"فعال"}),a.jsx("option",{value:"pending",children:"در حال بررسی"}),a.jsx("option",{value:"rejected",children:"رد شده"})]}),a.jsx(yt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:S,onChange:E=>T(E.target.value),children:[a.jsx("option",{value:"all",children:"همه انواع"}),a.jsx("option",{value:"send",children:"ارسال مرسوله"}),a.jsx("option",{value:"carry",children:"حمل مرسوله (سفر)"})]}),a.jsx(yt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]})]})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"کل مرسوله‌ها"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.length})]}),a.jsx(Js,{className:"w-8 h-8 text-custom-purple"})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"ارسال مرسوله"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.filter(E=>E.type==="send").length})]}),a.jsx(Js,{className:"w-8 h-8 text-custom-cyan"})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"سفرها (حمل)"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.filter(E=>E.type==="carry").length})]}),a.jsx(va,{className:"w-8 h-8 text-custom-orange"})]})})]}),a.jsx("div",{className:"space-y-6",children:O.length>0?O.map(E=>a.jsx(hp,{item:E,formatDate:de,onViewDetails:ye,onDelete:z,isDeleting:m===E.id},E.id)):a.jsxs("div",{className:"text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx(Js,{className:"w-16 h-16 mx-auto text-gray-300 dark:text-gray-600"}),a.jsx("h3",{className:"mt-4 text-xl font-semibold text-gray-800 dark:text-gray-200",children:"مرسوله‌ای یافت نشد"}),a.jsx("p",{className:"mt-1 text-gray-500 dark:text-gray-400",children:_.length===0?"شما هنوز مرسوله یا سفری ثبت نکرده‌اید.":"هیچ مرسوله‌ای با این مشخصات یافت نشد."}),_.length===0&&a.jsx("button",{onClick:()=>c("register-shipment"),className:"mt-4 bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300",children:"ثبت اولین مرسوله"})]})}),a.jsx(yh,{open:R.open,title:"حذف مرسوله",message:`آیا از حذف "${(ne=R.item)==null?void 0:ne.title}" مطمئن هستید؟ این عملیات غیرقابل بازگشت است.`,onCancel:ke,onConfirm:F})]})},hp=({item:c,formatDate:b,onViewDetails:N,onDelete:f,isDeleting:g})=>{const v=c.type==="send",H=()=>{switch(c.status){case"active":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-green-500/10 text-green-500",children:"فعال"});case"pending":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-custom-orange/10 text-custom-orange",children:"در حال بررسی"});case"rejected":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-red-500/10 text-red-500",children:"رد شده"});default:return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-gray-500/10 text-gray-500",children:c.status})}},S=()=>[c.origin_city,c.origin_country].filter(Boolean).join("، ")||"—",T=()=>[c.destination_city,c.destination_country].filter(Boolean).join("، ")||"—",_=()=>{if(c.price_type==="negotiable")return"توافقی";if(c.amount&&c.currency){const G={IRT:"تومان",USD:"دلار",CAD:"دلار کانادا",IQD:"دینار"};return`${c.amount} ${G[c.currency]||c.currency}`}return"—"};return a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-6 bg-custom-light-card dark:bg-custom-dark-blue-light p-5 rounded-2xl shadow-sm border border-transparent hover:border-custom-purple/50 hover:shadow-lg transition-all duration-300",children:[a.jsx("div",{className:"flex-shrink-0 w-full md:w-32 h-32",children:v&&c.images&&c.images.length>0?a.jsx("img",{src:c.images[0].url,alt:c.title,className:"w-full h-full object-cover rounded-xl",onError:G=>{const O=G.currentTarget.parentElement;O&&(O.innerHTML=`
                                    <div class="w-full h-full bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl flex items-center justify-center">
                                        <svg class="w-16 h-16 text-custom-purple/50" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"></path>
                                        </svg>
                                    </div>
                                `)}}):a.jsx("div",{className:"w-full h-full bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl flex items-center justify-center",children:v?a.jsx(Js,{className:"w-16 h-16 text-custom-purple/50"}):a.jsx(va,{className:"w-16 h-16 text-custom-purple/50"})})}),a.jsxs("div",{className:"flex flex-col flex-grow w-full",children:[a.jsxs("div",{className:"flex justify-between items-start mb-3",children:[a.jsxs("div",{children:[a.jsxs("div",{className:`flex items-center gap-2 mb-1 ${v?"text-custom-cyan":"text-custom-orange"}`,children:[v?a.jsx(Js,{className:"w-5 h-5"}):a.jsx(va,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm font-semibold",children:v?"ارسال مرسوله":"حمل مرسوله (سفر)"})]}),a.jsx("h3",{className:"text-lg font-bold text-gray-800 dark:text-white",children:c.title})]}),a.jsx("div",{className:"flex-shrink-0",children:H()})]}),a.jsxs("div",{className:"flex-grow space-y-2 text-sm text-gray-600 dark:text-gray-300 border-t border-gray-200 dark:border-gray-700 pt-3",children:[a.jsx(wn,{icon:no,label:"تاریخ ثبت",value:b(c.created_at)}),a.jsx(wn,{icon:Fe,label:"مبدأ",value:S()}),a.jsx(wn,{icon:Fe,label:"مقصد",value:T()}),v?a.jsx(wn,{icon:Qa,label:"وزن",value:c.weight?`${c.weight} کیلوگرم`:"—"}):a.jsx(wn,{icon:Qa,label:"ظرفیت حمل",value:c.carry_weight_capacity?`${c.carry_weight_capacity} کیلوگرم`:"—"}),a.jsx(wn,{icon:ba,label:"قیمت",value:_(),valueClassName:"text-green-600 dark:text-green-400"})]}),a.jsxs("div",{className:"mt-4 flex items-center justify-end gap-3",children:[a.jsx("button",{onClick:()=>f(c),disabled:g,className:"flex items-center gap-2 bg-red-500 hover:bg-red-600 disabled:bg-gray-400 text-white font-bold py-2 px-4 rounded-lg transition-colors duration-300 text-sm",children:g?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),a.jsx("span",{children:"در حال حذف..."})]}):a.jsxs(a.Fragment,{children:[a.jsx(Oa,{className:"w-4 h-4"}),a.jsx("span",{children:"حذف"})]})}),a.jsx("button",{onClick:()=>N(c),className:"bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300 text-sm",children:"مشاهده جزئیات"})]})]})]})},wn=({icon:c,label:b,value:N,valueClassName:f="text-gray-800 dark:text-gray-200"})=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[a.jsx(c,{className:"w-4 h-4 ml-2"}),a.jsxs("span",{children:[b,":"]})]}),a.jsx("span",{className:`font-semibold ${f}`,children:N||"—"})]}),fp=({onNavigate:c,showSuccess:b,showError:N})=>{var ye,ne;const[f,g]=y.useState(""),[v,H]=y.useState("all"),[S,T]=y.useState("all"),[_,G]=y.useState([]),[O,Z]=y.useState(!0),[X,V]=y.useState(null),[Q,M]=y.useState(null),[m,j]=y.useState({open:!1,item:null}),R=async()=>{var E,fe;try{Z(!0),V(null);const be=await ha(`${et}/trips/my-trips`),me=await ha(`${et}/trips/my-companions`);if(!be.ok||!me.ok)throw new Error("خطا در دریافت اطلاعات");const B=await be.json(),oe=await me.json(),Ne=((E=B.data)==null?void 0:E.map(w=>({id:w.id.toString(),type:"trip",title:`سفر از ${w.origin_city} به ${w.destination_city}`,requestDate:de(w.created_at),status:U(w.status),origin:`${w.origin_city}, ${w.origin_country}`,destination:`${w.destination_city}, ${w.destination_country}`,departureDate:w.departure_date,capacity:w.capacity,created_at:w.created_at,origin_country:w.origin_country,origin_city:w.origin_city,destination_country:w.destination_country,destination_city:w.destination_city,vehicle_type:w.vehicle_type,description:w.description,show_phone:w.show_phone})))||[],Ae=((fe=oe.data)==null?void 0:fe.map(w=>({id:w.id.toString(),type:"companion",title:`همسفر برای مسیر ${w.origin_city} به ${w.destination_city}`,requestDate:de(w.created_at),status:U(w.status),origin:`${w.origin_city}, ${w.origin_country}`,destination:`${w.destination_city}, ${w.destination_country}`,departureDate:w.available_from,capacity:w.capacity,created_at:w.created_at,origin_country:w.origin_country,origin_city:w.origin_city,destination_country:w.destination_country,destination_city:w.destination_city,vehicle_types:w.vehicle_types,description:w.description,show_phone:w.show_phone})))||[],De=[...Ne,...Ae];G(De)}catch(be){V(be.message||"خطا در دریافت اطلاعات"),console.error("Error fetching user trips:",be)}finally{Z(!1)}},U=E=>{switch(E){case"active":return"active";case"completed":return"completed";case"cancelled":return"completed";case"inactive":return"completed";default:return"pending"}},de=E=>{if(!E)return"تاریخ نامعلوم";const fe=new Date(E),me=new Date().getTime()-fe.getTime(),B=Math.floor(me/(1e3*60)),oe=Math.floor(me/(1e3*60*60)),Ne=Math.floor(me/(1e3*60*60*24));return B<60?`${B} دقیقه پیش`:oe<24?`${oe} ساعت پیش`:Ne<7?`${Ne} روز پیش`:new Date(E).toLocaleDateString("fa-IR")},pe=_.filter(E=>{const fe=f.toLowerCase(),be=E.title.toLowerCase().includes(fe)||E.origin.toLowerCase().includes(fe)||E.destination.toLowerCase().includes(fe),me=v==="all"||E.status===v,B=S==="all"||E.type===S;return be&&me&&B});y.useEffect(()=>{R()},[]);const z=E=>{j({open:!0,item:E})},F=async()=>{if(!m.item)return;const E=m.item;M(E.id),j({open:!1,item:null});try{const fe=E.type==="trip"?"trip":"companion",be=await ha(`${et}/trips/${fe}/${E.id}`,{method:"DELETE"});if(!be.ok){const me=await be.json();throw new Error(me.message||"خطا در حذف")}b(E.type==="trip"?"سفر با موفقیت حذف شد":"همسفری با موفقیت حذف شد"),G(me=>me.filter(B=>B.id!==E.id))}catch(fe){N(fe.message||"خطا در حذف آیتم")}finally{M(null)}},ke=()=>{j({open:!1,item:null})};return O?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست سفرهای من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"در حال دریافت اطلاعات..."})]}),a.jsx("div",{className:"flex justify-center items-center py-12",children:a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-custom-purple"})})]}):X?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست سفرهای من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"خطا در دریافت اطلاعات"})]}),a.jsxs("div",{className:"text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx("div",{className:"text-red-500 mb-4 text-4xl",children:"⚠️"}),a.jsx("h3",{className:"text-xl font-semibold text-red-600 dark:text-red-400 mb-2",children:"خطا در بارگذاری"}),a.jsx("p",{className:"text-red-500 dark:text-red-300 mb-4",children:X}),a.jsx("button",{onClick:R,className:"bg-custom-purple hover:bg-custom-light-purple text-white px-6 py-2 rounded-lg transition-colors",children:"تلاش مجدد"})]})]}):a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست سفرهای من"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"سفرها و اعلام آمادگی‌های همسفری خود را مدیریت کنید."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"کل سفرها"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.filter(E=>E.type==="trip").length})]}),a.jsx(va,{className:"w-8 h-8 text-custom-orange"})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"کل همسفرها"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.filter(E=>E.type==="companion").length})]}),a.jsx(Ta,{className:"w-8 h-8 text-custom-cyan"})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"فعال"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:_.filter(E=>E.status==="active").length})]}),a.jsx("div",{className:"w-8 h-8 bg-green-500 rounded-full flex items-center justify-center",children:a.jsx("span",{className:"text-white text-sm",children:"✓"})})]})})]}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:a.jsxs("div",{className:"w-full grid grid-cols-1 sm:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",placeholder:"جستجو در عنوان، مبدأ یا مقصد...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:f,onChange:E=>g(E.target.value)}),a.jsx(fa,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:v,onChange:E=>H(E.target.value),children:[a.jsx("option",{value:"all",children:"همه وضعیت‌ها"}),a.jsx("option",{value:"active",children:"فعال"}),a.jsx("option",{value:"pending",children:"در حال بررسی"}),a.jsx("option",{value:"completed",children:"انجام شده"})]}),a.jsx(yt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:S,onChange:E=>T(E.target.value),children:[a.jsx("option",{value:"all",children:"همه انواع"}),a.jsx("option",{value:"trip",children:"سفرهای من"}),a.jsx("option",{value:"companion",children:"همسفری‌های من"})]}),a.jsx(yt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]})]})}),a.jsx("div",{className:"space-y-6",children:pe.length>0?pe.map(E=>a.jsx(mp,{request:E,onNavigate:c,onDelete:z,isDeleting:Q===E.id},`${E.type}-${E.id}`)):a.jsxs("div",{className:"text-center py-12 bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl",children:[a.jsx(va,{className:"w-16 h-16 mx-auto text-gray-300 dark:text-gray-600"}),a.jsx("h3",{className:"mt-4 text-xl font-semibold text-gray-800 dark:text-gray-200",children:"سفری یافت نشد"}),a.jsx("p",{className:"mt-1 text-gray-500 dark:text-gray-400",children:_.length===0?"هنوز هیچ سفری ثبت نکرده‌اید.":"هیچ سفری با این مشخصات یافت نشد."}),_.length===0&&a.jsx("button",{onClick:()=>c("register-trip"),className:"mt-4 bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300",children:"ثبت اولین سفر"})]})}),a.jsx(yh,{open:m.open,title:((ye=m.item)==null?void 0:ye.type)==="trip"?"حذف سفر":"حذف همسفری",message:`آیا از حذف "${(ne=m.item)==null?void 0:ne.title}" مطمئن هستید؟ این عملیات غیرقابل بازگشت است.`,onCancel:ke,onConfirm:F})]})},mp=({request:c,onNavigate:b,onDelete:N,isDeleting:f})=>{const{id:g,type:v,title:H,requestDate:S,status:T,origin:_,destination:G,departureDate:O,capacity:Z}=c,X=()=>{switch(T){case"active":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-green-500/10 text-green-500",children:"فعال"});case"pending":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-custom-orange/10 text-custom-orange",children:"در حال بررسی"});case"completed":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-gray-500/10 text-gray-500 dark:bg-gray-400/10 dark:text-gray-400",children:"انجام شده"})}},V=v==="trip";return a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-6 bg-custom-light-card dark:bg-custom-dark-blue-light p-5 rounded-2xl shadow-sm border border-transparent hover:border-custom-purple/50 hover:shadow-lg transition-all duration-300",children:[a.jsx("div",{className:"flex-shrink-0 w-full md:w-32 h-32 bg-custom-light-bg dark:bg-custom-dark-blue rounded-xl flex items-center justify-center",children:V?a.jsx(va,{className:"w-16 h-16 text-custom-purple/50"}):a.jsx(Ta,{className:"w-16 h-16 text-custom-purple/50"})}),a.jsxs("div",{className:"flex flex-col flex-grow w-full",children:[a.jsxs("div",{className:"flex justify-between items-start mb-3",children:[a.jsxs("div",{children:[a.jsxs("div",{className:`flex items-center gap-2 mb-1 ${V?"text-custom-orange":"text-custom-cyan"}`,children:[V?a.jsx(va,{className:"w-5 h-5"}):a.jsx(Ta,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm font-semibold",children:V?"سفر":"همسفری"})]}),a.jsx("h3",{className:"text-lg font-bold text-gray-800 dark:text-white",children:H})]}),a.jsx("div",{className:"flex-shrink-0",children:X()})]}),a.jsxs("div",{className:"flex-grow space-y-2 text-sm text-gray-600 dark:text-gray-300 border-t border-gray-200 dark:border-gray-700 pt-3",children:[a.jsx(Ii,{icon:no,label:"تاریخ ثبت",value:S}),a.jsx(Ii,{icon:Fe,label:"مبدأ",value:_}),a.jsx(Ii,{icon:Fe,label:"مقصد",value:G}),a.jsx(Ii,{icon:Yr,label:"تاریخ حرکت",value:O}),V&&Z!==void 0&&a.jsx(Ii,{icon:Qa,label:"ظرفیت",value:`${Z} کیلوگرم`})]}),a.jsxs("div",{className:"mt-4 flex items-center justify-end gap-3",children:[a.jsx("button",{onClick:()=>N(c),disabled:f,className:"flex items-center gap-2 bg-red-500 hover:bg-red-600 disabled:bg-gray-400 text-white font-bold py-2 px-4 rounded-lg transition-colors duration-300 text-sm",children:f?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),a.jsx("span",{children:"در حال حذف..."})]}):a.jsx("span",{children:"حذف"})}),a.jsx("button",{onClick:()=>b("trip-detail",{tripId:g,type:v},{isOwnerView:!0}),className:"bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300 text-sm",children:"مشاهده جزئیات"})]})]})]})},Ii=({icon:c,label:b,value:N,valueClassName:f="text-gray-800 dark:text-gray-200"})=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[a.jsx(c,{className:"w-4 h-4 ml-2"}),a.jsxs("span",{children:[b,":"]})]}),a.jsx("span",{className:`font-semibold ${f}`,children:N||"-"})]}),k0=[{id:1,user:{name:"علی رضایی",avatar:"https://picsum.photos/id/1005/100/100",online:!0},lastMessage:"باشه حتما، فردا هماهنگ می‌کنم.",timestamp:"۵ دقیقه پیش",unreadCount:2,messages:[{id:1,text:"سلام، بسته من کی به دستم میرسه؟",timestamp:"۱۰:۳۰",sender:"them"},{id:2,text:"سلام علی جان، لطفاً شماره سفارشت رو بفرست.",timestamp:"۱۰:۳۱",sender:"me"},{id:3,text:"شماره سفارش ۱۲۳۴۵ هست.",timestamp:"۱۰:۳۲",sender:"them"},{id:4,text:"ممنون. در حال بررسی هستم...",timestamp:"۱۰:۳۳",sender:"me"},{id:5,text:"باشه حتما، فردا هماهنگ می‌کنم.",timestamp:"۱۰:۳۵",sender:"them"}]},{id:2,user:{name:"زهرا احمدی",avatar:"https://picsum.photos/id/1011/100/100",online:!1},lastMessage:"ممنونم از راهنماییتون.",timestamp:"۲ ساعت پیش",unreadCount:0,messages:[{id:1,text:"سلام، وقت بخیر",timestamp:"۰۸:۱۵",sender:"them"},{id:2,text:"سلام خانم احمدی، در خدمتم.",timestamp:"۰۸:۱۶",sender:"me"},{id:3,text:"میخواستم در مورد وضعیت سفرم بپرسم.",timestamp:"۰۸:۱۷",sender:"them"},{id:4,text:"سفر شما طبق برنامه در حال انجام است.",timestamp:"۰۸:۲۰",sender:"me"},{id:5,text:"ممنونم از راهنماییتون.",timestamp:"۰۸:۲۱",sender:"them"}]},{id:3,user:{name:"پشتیبانی",avatar:"https://picsum.photos/id/1025/100/100",online:!0},lastMessage:"خواهش میکنم، روز خوبی داشته باشید.",timestamp:"دیروز",unreadCount:0,messages:[{id:1,text:"مشکل گزارش شده شما بررسی و حل شد.",timestamp:"دیروز",sender:"them"},{id:2,text:"خیلی ممنون از پیگیری شما.",timestamp:"دیروز",sender:"me"},{id:3,text:"خواهش میکنم، روز خوبی داشته باشید.",timestamp:"دیروز",sender:"them"}]},{id:4,user:{name:"محمد قاسمی",avatar:"https://picsum.photos/id/1027/100/100",online:!1},lastMessage:"آدرس رو لطف می‌کنید؟",timestamp:"۳ روز پیش",unreadCount:1,messages:[{id:1,text:"آدرس رو لطف می‌کنید؟",timestamp:"۳ روز پیش",sender:"them"}]}],gp=()=>{var ye;const[c,b]=y.useState(k0),[N,f]=y.useState(((ye=k0[0])==null?void 0:ye.id)||null),[g,v]=y.useState(""),[H,S]=y.useState(!1),[T,_]=y.useState(0),G=y.useRef(null),O=y.useRef(null),Z=y.useRef(null),X=y.useRef(null),V=y.useRef([]),Q=y.useRef(!1),M=y.useRef(null),m=y.useRef(c);m.current=c;const j=c.find(ne=>ne.id===N),R=()=>{var ne;(ne=G.current)==null||ne.scrollIntoView({behavior:"smooth"})};y.useEffect(()=>{N&&R()},[j==null?void 0:j.messages,N]),y.useEffect(()=>()=>{Z.current&&Z.current.state==="recording"&&Z.current.stop(),X.current&&clearInterval(X.current),m.current.forEach(ne=>{ne.messages.forEach(E=>{var fe,be;(fe=E.audio)!=null&&fe.url&&URL.revokeObjectURL(E.audio.url),(be=E.file)!=null&&be.url&&URL.revokeObjectURL(E.file.url)})})},[]);const U=(ne,E,fe)=>{const be=c.map(B=>B.id===ne?{...B,messages:[...B.messages,fe],lastMessage:E,timestamp:"همین الان"}:B),me=be.findIndex(B=>B.id===ne);if(me>-1){const[B]=be.splice(me,1);be.unshift(B)}b(be)},de=ne=>{if(ne.preventDefault(),!g.trim()||!N)return;const E=new Date,fe={id:Date.now(),text:g,timestamp:`${E.getHours()}:${E.getMinutes().toString().padStart(2,"0")}`,sender:"me"};U(N,g,fe),v("")},pe=ne=>{var fe;const E=(fe=ne.target.files)==null?void 0:fe[0];if(E&&N){const be={id:Date.now(),file:{url:URL.createObjectURL(E),name:E.name,type:E.type},timestamp:new Date().toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit"}),sender:"me"};U(N,E.name,be)}ne.target&&(ne.target.value="")},z=async()=>{if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia||!window.MediaRecorder){alert("مرورگر شما از ضبط صدا پشتیبانی نمی‌کند.");return}const E=["audio/webm;codecs=opus","audio/ogg;codecs=opus","audio/webm","audio/mp4","audio/aac"].find(fe=>MediaRecorder.isTypeSupported(fe));if(!E){alert("مرورگر شما از هیچ فرمت صوتی پشتیبانی نمی‌کند.");return}M.current=E;try{V.current=[],Q.current=!1;const fe=await navigator.mediaDevices.getUserMedia({audio:!0});Z.current=new MediaRecorder(fe,{mimeType:M.current}),Z.current.ondataavailable=be=>{V.current.push(be.data)},Z.current.onstop=()=>{var be;if((be=Z.current)==null||be.stream.getTracks().forEach(me=>me.stop()),Q.current){const me=new Blob(V.current,{type:M.current});if(me.size>0){const B=URL.createObjectURL(me),oe={id:Date.now(),audio:{url:B,duration:T},timestamp:new Date().toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit"}),sender:"me"};N&&U(N,"پیام صوتی",oe)}}V.current=[],Q.current=!1},Z.current.start(),S(!0),_(0),X.current=setInterval(()=>{_(be=>be+1)},1e3)}catch(fe){console.error("Error starting recording:",fe);let be="دسترسی به میکروفون امکان‌پذیر نیست. لطفا دسترسی لازم را بدهید.";fe instanceof DOMException&&(fe.name==="NotAllowedError"?be="شما اجازه دسترسی به میکروفون را نداده‌اید. لطفاً دسترسی را از تنظیمات مرورگر خود فعال کنید.":fe.name==="NotFoundError"?be="هیچ میکروفونی یافت نشد.":fe.name==="NotReadableError"&&(be="مشکلی در سخت‌افزار میکروفون شما وجود دارد.")),alert(be)}},F=ne=>{var E;H&&(Q.current=ne,((E=Z.current)==null?void 0:E.state)==="recording"&&Z.current.stop(),X.current&&(clearInterval(X.current),X.current=null),S(!1))},ke=ne=>{const E=Math.floor(ne/60).toString().padStart(2,"0"),fe=(ne%60).toString().padStart(2,"0");return`${E}:${fe}`};return a.jsxs("div",{className:"flex h-[calc(100vh-130px)] bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl shadow-lg overflow-hidden",children:[a.jsxs("div",{className:`w-full md:w-1/3 lg:w-1/4 flex flex-col border-l border-gray-200 dark:border-gray-700 transition-all duration-300 ${N&&"hidden"} md:flex`,children:[a.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:[a.jsx("h2",{className:"text-xl font-bold",children:"پیام‌ها"}),a.jsxs("div",{className:"relative mt-4",children:[a.jsx("input",{type:"text",placeholder:"جستجو در پیام‌ها...",className:"w-full pr-10 pl-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition"}),a.jsx(fa,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"})]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto",children:c.map(ne=>a.jsxs("button",{onClick:()=>f(ne.id),className:`w-full text-right flex items-center p-4 border-b border-gray-200 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors ${N===ne.id?"bg-custom-purple/10 dark:bg-custom-purple/20":""}`,children:[a.jsxs("div",{className:"relative",children:[a.jsx("img",{src:ne.user.avatar,alt:ne.user.name,className:"w-12 h-12 rounded-full"}),ne.user.online&&a.jsx("span",{className:"absolute bottom-0 right-0 block h-3 w-3 rounded-full bg-green-500 ring-2 ring-custom-light-card dark:ring-custom-dark-blue-light"})]}),a.jsxs("div",{className:"flex-1 mr-4 overflow-hidden",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h3",{className:"font-semibold text-gray-800 dark:text-gray-200",children:ne.user.name}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 flex-shrink-0",children:ne.timestamp})]}),a.jsxs("div",{className:"flex justify-between items-center mt-1",children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 truncate",children:ne.lastMessage}),ne.unreadCount>0&&a.jsx("span",{className:"bg-custom-purple text-white text-xs font-bold rounded-full px-2 py-0.5",children:ne.unreadCount})]})]})]},ne.id))})]}),a.jsx("div",{className:`flex-1 flex-col ${j?"flex":"hidden"} md:flex`,children:j?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center p-4 border-b border-gray-200 dark:border-gray-700 bg-custom-light-card dark:bg-custom-dark-blue-light/50",children:[a.jsx("button",{className:"md:hidden ml-2 p-2",onClick:()=>f(null),children:a.jsx(bx,{className:"w-6 h-6 transform rotate-180"})}),a.jsx("img",{src:j.user.avatar,alt:j.user.name,className:"w-12 h-12 rounded-full"}),a.jsxs("div",{className:"mr-4",children:[a.jsx("h3",{className:"font-bold text-lg",children:j.user.name}),j.user.online&&a.jsxs("p",{className:"text-sm text-green-500 flex items-center",children:[" ",a.jsx("span",{className:"h-2 w-2 bg-green-500 rounded-full inline-block ml-2"})," آنلاین"]})]})]}),a.jsxs("div",{className:"flex-1 p-6 overflow-y-auto bg-custom-light-bg dark:bg-custom-dark-blue space-y-4",children:[j.messages.map(ne=>a.jsx("div",{className:`flex ${ne.sender==="me"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-md flex items-end gap-2 ${ne.sender==="me"?"flex-row-reverse":"flex-row"}`,children:[ne.sender==="them"&&a.jsx("img",{src:j.user.avatar,className:"w-8 h-8 rounded-full self-end mb-3"}),a.jsxs("div",{children:[a.jsxs("div",{className:`px-4 py-2 rounded-2xl ${ne.sender==="me"?"bg-custom-purple text-white rounded-br-none":"bg-white dark:bg-custom-dark-blue-light text-gray-800 dark:text-gray-200 rounded-bl-none"}`,children:[ne.text&&a.jsx("p",{children:ne.text}),ne.audio&&a.jsx(xp,{src:ne.audio.url}),ne.file&&a.jsx(pp,{file:ne.file})]}),a.jsx("p",{className:`text-xs text-gray-400 mt-1 px-1 ${ne.sender==="me"?"text-left":"text-right"}`,children:ne.timestamp})]})]})},ne.id)),a.jsx("div",{ref:G})]}),a.jsx("div",{className:"p-4 bg-custom-light-card dark:bg-custom-dark-blue-light border-t border-gray-200 dark:border-gray-700",children:H?a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("button",{onClick:()=>F(!1),className:"p-3 text-red-500 hover:bg-red-100 dark:hover:bg-red-900/50 rounded-full transition-colors",children:a.jsx(ph,{className:"w-6 h-6"})}),a.jsxs("div",{className:"flex items-center gap-2 text-lg font-mono text-red-500",children:[a.jsx("div",{className:"w-3 h-3 bg-red-500 rounded-full animate-pulse"}),a.jsx("span",{children:ke(T)})]}),a.jsx("button",{onClick:()=>F(!0),className:"p-3 bg-custom-purple text-white rounded-full hover:bg-custom-light-purple transition-colors shadow-lg",children:a.jsx(ed,{className:"w-6 h-6"})})]}):a.jsxs("form",{onSubmit:de,className:"flex items-center space-x-2 space-x-reverse",children:[a.jsx("input",{ref:O,type:"file",onChange:pe,className:"hidden"}),a.jsx("button",{type:"button",onClick:()=>{var ne;return(ne=O.current)==null?void 0:ne.click()},className:"p-2 text-gray-500 dark:text-gray-400 hover:text-custom-purple dark:hover:text-custom-light-purple rounded-full",children:a.jsx(to,{className:"w-6 h-6"})}),a.jsx("input",{type:"text",value:g,onChange:ne=>v(ne.target.value),placeholder:"پیام خود را بنویسید...",className:"flex-1 pr-4 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-full bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition"}),g.trim()?a.jsx("button",{type:"submit",className:"p-3 bg-custom-purple text-white rounded-full hover:bg-custom-light-purple transition-colors shadow-lg disabled:bg-gray-400",children:a.jsx(ed,{className:"w-6 h-6"})}):a.jsx("button",{type:"button",onClick:z,className:"p-3 bg-custom-purple text-white rounded-full hover:bg-custom-light-purple transition-colors shadow-lg",children:a.jsx(vx,{className:"w-6 h-6"})})]})})]}):a.jsxs("div",{className:"flex-1 flex-col items-center justify-center text-center text-gray-500 dark:text-gray-400 bg-custom-light-bg dark:bg-custom-dark-blue hidden md:flex",children:[a.jsx(ro,{className:"w-24 h-24 mb-4 text-gray-300 dark:text-gray-600"}),a.jsx("h2",{className:"text-2xl font-semibold",children:"گفتگویی را انتخاب کنید"}),a.jsx("p",{children:"برای شروع مکالمه، یک نفر را از لیست انتخاب کنید."})]})})]})},xp=({src:c})=>{const b=y.useRef(null),[N,f]=y.useState(!1),[g,v]=y.useState(0),[H,S]=y.useState(0);y.useEffect(()=>{const O=b.current;if(!O)return;const Z=()=>{isFinite(O.duration)&&S(O.duration)},X=()=>v(O.currentTime),V=()=>{f(!1),v(0)};return O.addEventListener("loadedmetadata",Z),O.addEventListener("timeupdate",X),O.addEventListener("ended",V),()=>{O.removeEventListener("loadedmetadata",Z),O.removeEventListener("timeupdate",X),O.removeEventListener("ended",V)}},[]);const T=()=>{b.current&&(N?b.current.pause():b.current.play(),f(!N))},_=O=>{if(!isFinite(O)||O<0)return"0:00";const Z=Math.floor(O/60),X=Math.floor(O%60).toString().padStart(2,"0");return`${Z}:${X}`},G=H>0?g/H*100:0;return a.jsxs("div",{className:"flex items-center gap-2 w-48 text-current",children:[a.jsx("audio",{ref:b,src:c,preload:"metadata"}),a.jsx("button",{onClick:T,className:"p-2 flex-shrink-0",children:N?a.jsx(wx,{className:"w-5 h-5"}):a.jsx(Nx,{className:"w-5 h-5"})}),a.jsxs("div",{className:"w-full h-1 bg-gray-400/50 dark:bg-gray-500/50 rounded-full relative",children:[a.jsx("div",{className:"absolute top-0 right-0 h-1 bg-current rounded-full",style:{width:`${G}%`}}),a.jsx("div",{className:"absolute h-3 w-3 bg-current rounded-full top-1/2 -mt-1.5",style:{right:`calc(${G}% - 6px)`}})]}),a.jsx("span",{className:"text-xs text-inherit opacity-70 w-10 text-center",children:_(H)})]})},pp=({file:c})=>a.jsx("a",{href:c.url,download:c.name,className:"flex flex-col gap-2 max-w-xs cursor-pointer",children:c.type.startsWith("image/")?a.jsx("img",{src:c.url,alt:c.name,className:"rounded-lg max-w-full h-auto"}):a.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-black/10 dark:bg-white/10",children:[a.jsx(jx,{className:"w-8 h-8 flex-shrink-0"}),a.jsx("span",{className:"text-sm truncate font-medium",children:c.name})]})}),yp=c=>{const b={technical:"پشتیبانی فنی",financial:"مالی",sales:"فروش",suggestions:"پیشنهادات",general:"عمومی"},N={open:"pending",pending:"pending",in_progress:"pending",answered:"answered",closed:"closed"},f=g=>{const v=new Date(g),S=new Date().getTime()-v.getTime(),T=Math.floor(S/6e4),_=Math.floor(S/36e5),G=Math.floor(S/864e5);return T<1?"الان":T<60?`${T} دقیقه پیش`:_<24?`${_} ساعت پیش`:G<7?`${G} روز پیش`:new Intl.DateTimeFormat("fa-IR",{year:"numeric",month:"long",day:"numeric"}).format(v)};return{id:String(c.id),subject:c.subject||c.title,department:b[c.department]||c.department,lastUpdate:f(c.updated_at||c.created_at),status:N[c.status]||"pending",priority:c.priority||"normal",created_at:c.created_at,replies_count:c.replies_count||0}},bp={async request(c,b={}){try{const N=await ha(`${et}${c}`,b),f=N.headers.get("content-type");if(!f||!f.includes("application/json"))throw console.error("Response is not JSON:",await N.text()),new Error("پاسخ سرور به فرمت JSON نیست");const g=await N.json();if(!g.success&&g.message)throw new Error(g.message);return g}catch(N){throw console.error("API Error:",N),N instanceof Error?N.message==="Token expired or invalid"||N.message==="SESSION_EXPIRED"?new Error("SESSION_EXPIRED"):N:new Error("خطای ناشناخته در ارتباط با سرور")}},async getTickets(){return this.request("/tickets")}},vp=({onNavigate:c})=>{const[b,N]=y.useState(""),[f,g]=y.useState("all"),[v,H]=y.useState("all"),[S,T]=y.useState([]),[_,G]=y.useState(!0),[O,Z]=y.useState(null),X=async()=>{try{G(!0),Z(null),console.log("Fetching tickets from: /api/tickets");const U=await bp.getTickets();if(console.log("API Response:",U),U.success&&Array.isArray(U.data)){const de=U.data.map(yp);console.log("Transformed tickets:",de),T(de)}else throw new Error(U.message||"فرمت پاسخ سرور نامعتبر است")}catch(U){console.error("Error fetching tickets:",U),U.message==="SESSION_EXPIRED"&&Z("session_expired")}finally{G(!1)}};y.useEffect(()=>{X()},[]);const V=S.filter(U=>{const de=b.toLowerCase(),pe=U.subject.toLowerCase().includes(de)||U.id.toLowerCase().includes(de),z=f==="all"||U.status===f,F=v==="all"||U.department===v;return pe&&z&&F}),Q=U=>{switch(U){case"answered":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-green-500/10 text-green-500 border border-green-500/20",children:"پاسخ داده شده"});case"pending":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-custom-orange/10 text-custom-orange border border-custom-orange/20",children:"در حال بررسی"});case"closed":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-gray-500/10 text-gray-500 dark:bg-gray-400/10 dark:text-gray-400 border border-gray-500/20",children:"بسته شده"})}},M=U=>{switch(U){case"high":return a.jsx("span",{className:"px-2 py-1 text-xs font-bold rounded-full bg-red-500/10 text-red-500 border border-red-500/20",children:"بالا"});case"normal":return a.jsx("span",{className:"px-2 py-1 text-xs font-bold rounded-full bg-blue-500/10 text-blue-500 border border-blue-500/20",children:"متوسط"});case"low":return a.jsx("span",{className:"px-2 py-1 text-xs font-bold rounded-full bg-gray-500/10 text-gray-500 border border-gray-500/20",children:"پایین"});default:return a.jsx("span",{className:"px-2 py-1 text-xs font-bold rounded-full bg-blue-500/10 text-blue-500 border border-blue-500/20",children:"متوسط"})}},m=()=>{X()},j=()=>{localStorage.removeItem("auth_token"),localStorage.removeItem("auth_phone"),c("dashboard"),window.location.reload()},R=()=>O==="session_expired"?a.jsx("div",{className:"bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 rounded-2xl p-6",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(Cn,{className:"w-8 h-8 text-amber-500 flex-shrink-0"}),a.jsxs("div",{className:"flex-grow",children:[a.jsx("h3",{className:"font-semibold text-amber-800 dark:text-amber-300 mb-2",children:"زمان احراز هویت به پایان رسیده"}),a.jsx("p",{className:"text-amber-700 dark:text-amber-400 mb-4",children:"برای ادامه کار، لطفاً مجدداً وارد حساب کاربری خود شوید."}),a.jsx("button",{onClick:j,className:"bg-amber-500 hover:bg-amber-600 text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300",children:"ورود مجدد"})]})]})}):a.jsx("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-2xl p-6",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(Cn,{className:"w-8 h-8 text-red-500 flex-shrink-0"}),a.jsxs("div",{className:"flex-grow",children:[a.jsx("h3",{className:"font-semibold text-red-800 dark:text-red-300 mb-2",children:"خطا در دریافت اطلاعات"}),a.jsx("p",{className:"text-red-700 dark:text-red-400 mb-4",children:O}),a.jsx("button",{onClick:m,className:"bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300",children:"تلاش مجدد"})]})]})});return _?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست تیکت‌ها"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"در حال دریافت اطلاعات..."})]}),a.jsx("div",{className:"space-y-4",children:[...Array(5)].map((U,de)=>a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm animate-pulse",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"w-12 h-12 bg-gray-300 dark:bg-gray-600 rounded-lg"}),a.jsxs("div",{className:"flex-grow space-y-2",children:[a.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-3/4"}),a.jsx("div",{className:"h-3 bg-gray-300 dark:bg-gray-600 rounded w-1/2"})]}),a.jsx("div",{className:"w-20 h-8 bg-gray-300 dark:bg-gray-600 rounded-full"})]})},de))})]}):O?a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست تیکت‌ها"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"خطا در دریافت اطلاعات"})]}),a.jsx(R,{})]}):a.jsxs("div",{className:"flex flex-col space-y-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"لیست تیکت‌ها"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"تیکت‌های پشتیبانی خود را مدیریت کنید."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"کل تیکت‌ها"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:S.length})]}),a.jsx("div",{className:"w-12 h-12 bg-blue-500/10 rounded-xl flex items-center justify-center",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-6 h-6 text-blue-500",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z"})})})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"در حال بررسی"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:S.filter(U=>U.status==="pending").length})]}),a.jsx("div",{className:"w-12 h-12 bg-custom-orange/10 rounded-xl flex items-center justify-center",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-6 h-6 text-custom-orange",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})})})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"پاسخ داده شده"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:S.filter(U=>U.status==="answered").length})]}),a.jsx("div",{className:"w-12 h-12 bg-green-500/10 rounded-xl flex items-center justify-center",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-6 h-6 text-green-500",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z"})})})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-4 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"بسته شده"}),a.jsx("p",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:S.filter(U=>U.status==="closed").length})]}),a.jsx("div",{className:"w-12 h-12 bg-gray-500/10 rounded-xl flex items-center justify-center",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-6 h-6 text-gray-500 dark:text-gray-400",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})})})]})})]}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700",children:a.jsxs("div",{className:"flex flex-col lg:flex-row items-center justify-between gap-4",children:[a.jsxs("div",{className:"w-full lg:w-auto flex-grow grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",placeholder:"جستجو در موضوع یا شناسه تیکت...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:b,onChange:U=>N(U.target.value)}),a.jsx(fa,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:f,onChange:U=>g(U.target.value),children:[a.jsx("option",{value:"all",children:"همه وضعیت‌ها"}),a.jsx("option",{value:"answered",children:"پاسخ داده شده"}),a.jsx("option",{value:"pending",children:"در حال بررسی"}),a.jsx("option",{value:"closed",children:"بسته شده"})]}),a.jsx(yt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{className:"w-full appearance-none pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:v,onChange:U=>H(U.target.value),children:[a.jsx("option",{value:"all",children:"همه دپارتمان‌ها"}),a.jsx("option",{value:"پشتیبانی فنی",children:"پشتیبانی فنی"}),a.jsx("option",{value:"مالی",children:"مالی"}),a.jsx("option",{value:"فروش",children:"فروش"}),a.jsx("option",{value:"پیشنهادات",children:"پیشنهادات"}),a.jsx("option",{value:"عمومی",children:"عمومی"})]}),a.jsx(yt,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"})]})]}),a.jsxs("button",{onClick:()=>c("new-ticket"),className:"w-full lg:w-auto flex-shrink-0 bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-6 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 flex items-center justify-center gap-2",children:[a.jsx(Ic,{className:"w-5 h-5"}),a.jsx("span",{children:"تیکت جدید"})]})]})}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm text-right",children:[a.jsx("thead",{className:"bg-custom-light-bg dark:bg-custom-dark-blue text-gray-500 dark:text-gray-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"p-4 font-semibold",children:"شناسه"}),a.jsx("th",{className:"p-4 font-semibold",children:"موضوع"}),a.jsx("th",{className:"p-4 font-semibold hidden lg:table-cell",children:"دپارتمان"}),a.jsx("th",{className:"p-4 font-semibold hidden md:table-cell",children:"اولویت"}),a.jsx("th",{className:"p-4 font-semibold hidden sm:table-cell",children:"آخرین بروزرسانی"}),a.jsx("th",{className:"p-4 font-semibold",children:"وضعیت"}),a.jsx("th",{className:"p-4 font-semibold",children:"عملیات"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:V.length>0?V.map(U=>a.jsxs("tr",{className:"hover:bg-gray-50 dark:hover:bg-custom-dark-blue transition-colors",children:[a.jsxs("td",{className:"p-4 font-mono text-custom-purple font-bold",children:["#",U.id]}),a.jsxs("td",{className:"p-4",children:[a.jsx("div",{className:"font-semibold text-gray-800 dark:text-gray-200",children:U.subject}),a.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 lg:hidden mt-1",children:[U.department," ",U.replies_count?`• ${U.replies_count} پاسخ`:""]})]}),a.jsx("td",{className:"p-4 hidden lg:table-cell",children:a.jsx("span",{className:"px-2 py-1 text-xs bg-custom-purple/10 text-custom-purple rounded-full border border-custom-purple/20",children:U.department})}),a.jsx("td",{className:"p-4 hidden md:table-cell",children:M(U.priority||"normal")}),a.jsx("td",{className:"p-4 hidden sm:table-cell text-gray-500 dark:text-gray-400",children:U.lastUpdate}),a.jsx("td",{className:"p-4",children:Q(U.status)}),a.jsx("td",{className:"p-4",children:a.jsx("button",{onClick:()=>{console.log("🔘 Button clicked!"),console.log("🎫 Ticket:",U),console.log("🆔 Ticket ID:",U.id),c("ticket-detail",U.id)},className:"bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-4 rounded-lg transition-colors duration-300 text-xs",children:"مشاهده"})})]},U.id)):a.jsx("tr",{children:a.jsx("td",{colSpan:7,className:"text-center p-12",children:a.jsxs("div",{className:"flex flex-col items-center justify-center",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-100 dark:bg-gray-700 rounded-full flex items-center justify-center mb-4",children:a.jsx(fa,{className:"w-8 h-8 text-gray-400"})}),a.jsx("h3",{className:"text-lg font-semibold text-gray-800 dark:text-gray-200 mb-2",children:S.length===0?"هنوز هیچ تیکتی ندارید":"تیکتی یافت نشد"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-4 text-center",children:S.length===0?"برای شروع اولین تیکت خود را ایجاد کنید.":"هیچ تیکتی با فیلترهای انتخاب شده مطابقت ندارد."}),S.length===0&&a.jsx("button",{onClick:()=>c("new-ticket"),className:"bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300",children:"ایجاد اولین تیکت"})]})})})})]})}),V.length>0&&a.jsx("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue px-6 py-4 border-t border-gray-200 dark:border-gray-700",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:["نمایش ",V.length," از ",S.length," تیکت"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{disabled:!0,className:"px-3 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"قبلی"}),a.jsx("span",{className:"px-3 py-1 text-sm bg-custom-purple text-white rounded-lg",children:"1"}),a.jsx("button",{disabled:!0,className:"px-3 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"بعدی"})]})]})})]}),a.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-2xl p-6",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-8 h-8 bg-blue-500 rounded-full flex items-center justify-center flex-shrink-0",children:a.jsx("span",{className:"text-white text-sm",children:"💡"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold text-blue-800 dark:text-blue-300 mb-2",children:"راهنمای تیکت‌ها"}),a.jsxs("ul",{className:"text-sm text-blue-700 dark:text-blue-400 space-y-1",children:[a.jsxs("li",{children:["• تیکت‌های ",a.jsx("span",{className:"font-semibold",children:"در حال بررسی"})," توسط پشتیبانی در دست اقدام هستند"]}),a.jsxs("li",{children:["• تیکت‌های ",a.jsx("span",{className:"font-semibold",children:"پاسخ داده شده"})," نیاز به پاسخ‌گویی شما دارند"]}),a.jsxs("li",{children:["• می‌توانید تیکت‌های حل شده را ",a.jsx("span",{className:"font-semibold",children:"ببندید"})]}),a.jsxs("li",{children:["• برای مسائل فوری از اولویت ",a.jsx("span",{className:"font-semibold",children:"بالا"})," استفاده کنید"]})]})]})]})})]})},jp=({ticketId:c,onNavigate:b})=>{const[N,f]=y.useState(null),[g,v]=y.useState(!0),[H,S]=y.useState(null),[T,_]=y.useState(""),[G,O]=y.useState(!1),[Z,X]=y.useState([]),V=y.useRef(null),Q=z=>{const F=new Date(z),ye=new Date().getTime()-F.getTime(),ne=Math.floor(ye/6e4),E=Math.floor(ye/36e5),fe=Math.floor(ye/864e5);return ne<1?"الان":ne<60?`${ne} دقیقه پیش`:E<24?`${E} ساعت پیش`:fe<7?`${fe} روز پیش`:new Intl.DateTimeFormat("fa-IR",{year:"numeric",month:"long",day:"numeric"}).format(F)},M=z=>{if(z===0)return"0 بایت";const F=1024,ke=["بایت","کیلوبایت","مگابایت"],ye=Math.floor(Math.log(z)/Math.log(F));return Math.round(z/Math.pow(F,ye)*100)/100+" "+ke[ye]},m=z=>{const F={technical:"پشتیبانی فنی",financial:"مالی",sales:"فروش",suggestions:"پیشنهادات",general:"عمومی"},ke={open:"pending",pending:"pending",in_progress:"pending",answered:"answered",closed:"closed"};return{id:String(z.id),subject:z.subject||z.title,department:F[z.department]||z.department,lastUpdate:Q(z.updated_at||z.created_at),status:ke[z.status]||"pending",priority:z.priority||"normal",created_at:z.created_at,messages:(z.replies||[]).map(ye=>({id:ye.id,sender:ye.is_admin?"support":"user",text:ye.message||ye.content,timestamp:Q(ye.created_at),created_at:ye.created_at,attachments:ye.attachments||[]}))}},j=async z=>{if(z.preventDefault(),O(!0),!T.trim()&&Z.length===0){showError("لطفاً متن پاسخ را وارد کنید یا فایلی را پیوست کنید."),O(!1);return}const F=new FormData;T.trim()&&F.append("message",T.trim()),Z.forEach(ke=>{F.append("attachments[]",ke)});try{console.log("📤 Sending reply to ticket:",c);const ye=await(await fetch(`${et}/tickets/${c}/reply`,{method:"POST",headers:{"X-Auth-Token":localStorage.getItem("auth_token")||""},body:F})).json();if(console.log("✅ Reply API Response:",ye),ye.success){const ne={id:Date.now(),sender:"user",text:T.trim(),timestamp:"الان",created_at:new Date().toISOString(),attachments:ye.data.attachments||[]};f(E=>E?{...E,messages:[...E.messages,ne],lastUpdate:Q(new Date().toISOString())}:null),_(""),X([]),showSuccess("پاسخ شما با موفقیت ارسال شد.")}else throw new Error(ye.message||"خطا در ارسال پاسخ")}catch(ke){console.error("❌ Error sending reply:",ke),showError(ke.message||"خطا در ارسال پاسخ. لطفاً دوباره تلاش کنید.")}finally{O(!1)}},R=async()=>{try{v(!0),S(null),console.log("🎫 Fetching ticket:",c);const F=await(await ha(`${et}/tickets/${c}`)).json();if(console.log("✅ API Response:",F),F.success&&F.data){const ke=m(F.data);console.log("✅ Transformed ticket:",ke),f(ke)}else throw new Error(F.message||"تیکت یافت نشد")}catch(z){console.error("❌ Error fetching ticket:",z),z.message==="Token expired or invalid"?S("session_expired"):S(z.message||"خطا در دریافت اطلاعات تیکت")}finally{v(!1)}},U=z=>{const F=Array.from(z.target.files||[]);if(Z.length+F.length>5){alert("حداکثر 5 فایل می‌توانید انتخاب کنید");return}if(F.filter(E=>E.size>10*1024*1024).length>0){alert("حجم هر فایل نباید بیشتر از 10 مگابایت باشد");return}const ye=["image/jpeg","image/jpg","image/png","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"];if(F.filter(E=>!ye.includes(E.type)).length>0){alert("فرمت فایل باید از نوع: jpg, jpeg, png, pdf, doc, docx باشد");return}X(E=>[...E,...F])},de=z=>{X(F=>F.filter((ke,ye)=>ye!==z))};y.useEffect(()=>{console.log("🎫 TicketDetailPage mounted"),console.log("📋 ticketId:",c),R()},[c]);const pe=z=>{switch(z){case"answered":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-green-500/10 text-green-500 border border-green-500/20",children:"پاسخ داده شده"});case"pending":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-custom-orange/10 text-custom-orange border border-custom-orange/20",children:"در حال بررسی"});case"closed":return a.jsx("span",{className:"px-3 py-1 text-xs font-bold rounded-full bg-gray-500/10 text-gray-500 dark:bg-gray-400/10 dark:text-gray-400 border border-gray-500/20",children:"بسته شده"})}};return g?a.jsxs("div",{className:"flex flex-col space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsx("div",{className:"h-8 w-64 bg-gray-300 dark:bg-gray-600 rounded animate-pulse"}),a.jsx("div",{className:"h-4 w-48 bg-gray-300 dark:bg-gray-600 rounded mt-2 animate-pulse"})]})}),a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm space-y-4",children:[...Array(3)].map((z,F)=>a.jsxs("div",{className:"flex gap-4",children:[a.jsx("div",{className:"w-10 h-10 bg-gray-300 dark:bg-gray-600 rounded-full animate-pulse"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-3/4 animate-pulse"}),a.jsx("div",{className:"h-4 bg-gray-300 dark:bg-gray-600 rounded w-1/2 animate-pulse"})]})]},F))})]}):H?a.jsxs("div",{className:"flex flex-col space-y-6",children:[a.jsx("div",{children:a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"خطا"})}),a.jsx("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-2xl p-6",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(Cn,{className:"w-8 h-8 text-red-500 flex-shrink-0"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-red-800 dark:text-red-300 mb-2",children:H==="session_expired"?"زمان احراز هویت به پایان رسیده":"خطا در دریافت اطلاعات"}),a.jsx("p",{className:"text-red-700 dark:text-red-400 mb-4",children:H}),a.jsx("button",{onClick:()=>b("tickets"),className:"bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-6 rounded-lg transition-colors duration-300",children:"بازگشت به لیست تیکت‌ها"})]})]})})]}):N?a.jsxs("div",{className:"flex flex-col space-y-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl font-bold text-gray-800 dark:text-white flex items-center gap-3",children:[N.subject,pe(N.status)]}),a.jsxs("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:["جزئیات و گفتگوی مربوط به تیکت #",N.id]})]}),a.jsxs("button",{onClick:()=>b("tickets"),className:"flex items-center gap-2 py-2 px-4 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors self-start sm:self-center",children:[a.jsx(fh,{className:"w-5 h-5"}),a.jsx("span",{children:"بازگشت به لیست"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"lg:col-span-2 flex flex-col space-y-6",children:[a.jsx("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm space-y-6",children:N.messages.length>0?N.messages.map(z=>a.jsxs("div",{className:`flex items-start gap-4 ${z.sender==="user"?"flex-row-reverse":""}`,children:[a.jsx("div",{className:`flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${z.sender==="user"?"bg-custom-purple":"bg-custom-cyan"}`,children:z.sender==="user"?a.jsx(Ta,{className:"w-6 h-6 text-white"}):a.jsx(kx,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"flex-1 max-w-xl",children:[a.jsxs("div",{className:`p-4 rounded-xl ${z.sender==="user"?"bg-custom-purple/10 dark:bg-custom-purple/20 rounded-tr-none":"bg-gray-100 dark:bg-custom-dark-blue rounded-tl-none"}`,children:[a.jsx("p",{className:"text-gray-800 dark:text-gray-200",children:z.text}),a.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500 mt-2 text-left",children:z.timestamp})]}),z.attachments&&z.attachments.length>0&&a.jsx("div",{className:"mt-2 space-y-2",children:z.attachments.map(F=>a.jsxs("a",{href:F.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-2 bg-gray-50 dark:bg-custom-dark-blue rounded-lg hover:bg-gray-100 dark:hover:bg-custom-dark-blue/80 transition-colors",children:[a.jsx(to,{className:"w-4 h-4 text-gray-500"}),a.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 flex-1",children:F.file_name}),a.jsx("span",{className:"text-xs text-gray-500",children:M(F.file_size)})]},F.id))})]})]},z.id)):a.jsx("p",{className:"text-center text-gray-500",children:"هنوز پاسخی ثبت نشده است"})}),N.status!=="closed"?a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-800 dark:text-gray-200",children:"ارسال پاسخ جدید"}),a.jsxs("form",{onSubmit:j,className:"space-y-4",children:[a.jsx("textarea",{value:T,onChange:z=>_(z.target.value),placeholder:"پاسخ خود را اینجا بنویسید...",className:"w-full pr-4 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition min-h-[120px] resize-y",disabled:G}),Z.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("p",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:["فایل‌های انتخاب شده (",Z.length,"/5):"]}),Z.map((z,F)=>a.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 dark:bg-custom-dark-blue rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[a.jsx(to,{className:"w-4 h-4 text-gray-500"}),a.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:z.name}),a.jsxs("span",{className:"text-xs text-gray-500",children:["(",M(z.size),")"]})]}),a.jsx("button",{type:"button",onClick:()=>de(F),className:"p-1 hover:bg-red-100 dark:hover:bg-red-900/20 rounded transition-colors",children:a.jsx(Oa,{className:"w-4 h-4 text-red-500"})})]},F))]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("input",{ref:V,type:"file",multiple:!0,accept:".jpg,.jpeg,.png,.pdf,.doc,.docx",onChange:U,className:"hidden",id:"file-upload",disabled:G||Z.length>=5}),a.jsxs("label",{htmlFor:"file-upload",className:`flex items-center gap-2 py-2 px-4 rounded-lg transition-colors cursor-pointer ${Z.length>=5?"text-gray-400 dark:text-gray-600 cursor-not-allowed":"text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue"}`,children:[a.jsx(to,{className:"w-5 h-5"}),a.jsx("span",{children:"پیوست فایل"}),Z.length>0&&a.jsx("span",{className:"text-xs bg-custom-purple text-white px-2 py-0.5 rounded-full",children:Z.length})]})]}),a.jsxs("button",{type:"submit",disabled:G||!T.trim(),className:"bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-2.5 px-6 rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",children:[a.jsx(ed,{className:"w-5 h-5"}),a.jsx("span",{children:G?"در حال ارسال...":"ارسال پاسخ"})]})]})]})]}):a.jsx("div",{className:"bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 p-4 rounded-xl text-center",children:a.jsx("p",{className:"font-semibold",children:"این تیکت بسته شده است و امکان ارسال پاسخ جدید وجود ندارد."})})]}),a.jsx("div",{className:"lg:col-span-1",children:a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm space-y-4 sticky top-28",children:[a.jsx("h3",{className:"text-lg font-semibold mb-2 pb-3 border-b border-gray-200 dark:border-gray-700",children:"اطلاعات تیکت"}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[a.jsx(hs,{className:"w-5 h-5"}),a.jsx("span",{children:"شناسه تیکت"})]}),a.jsxs("span",{className:"font-mono font-semibold text-gray-800 dark:text-gray-200",children:["#",N.id]})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[a.jsx(so,{className:"w-5 h-5"}),a.jsx("span",{children:"دپارتمان"})]}),a.jsx("span",{className:"font-semibold text-gray-800 dark:text-gray-200",children:N.department})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[a.jsx(no,{className:"w-5 h-5"}),a.jsx("span",{children:"آخرین بروزرسانی"})]}),a.jsx("span",{className:"font-semibold text-gray-800 dark:text-gray-200",children:N.lastUpdate})]})]})})]})]}):a.jsxs("div",{className:"text-center p-8",children:[a.jsx("h2",{className:"text-xl font-bold",children:"تیکت یافت نشد"}),a.jsx("button",{onClick:()=>b("tickets"),className:"mt-4 text-custom-purple hover:underline",children:"بازگشت به لیست تیکت‌ها"})]})},Np=()=>{const[c,b]=y.useState(""),[N,f]=y.useState(""),[g,v]=y.useState("09123456789"),[H,S]=y.useState(null),[T,_]=y.useState("unverified"),G=m=>{const j=m.target.files;if(j&&j[0]){const R=j[0];S({id:Date.now(),url:URL.createObjectURL(R),file:R})}},O=()=>{H&&(URL.revokeObjectURL(H.url),S(null))},Z=y.useCallback(m=>{m.preventDefault(),m.stopPropagation();const j=m.dataTransfer.files;if(j&&j[0]&&j[0].type.startsWith("image/")){const R=j[0];S({id:Date.now(),url:URL.createObjectURL(R),file:R})}},[]),X=m=>{m.preventDefault(),m.stopPropagation()},V=m=>{m.preventDefault(),_("pending"),window.scrollTo(0,0)},Q=()=>{switch(T){case"verified":return a.jsxs("div",{className:"bg-green-500/10 border border-green-500/20 rounded-2xl p-6 flex items-center gap-4 mb-8",children:[a.jsx("div",{className:"bg-green-500 rounded-full p-2",children:a.jsx(B0,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold text-green-600 dark:text-green-400 text-lg",children:"حساب کاربری تایید شده"}),a.jsx("p",{className:"text-green-700/80 dark:text-green-400/80 text-sm mt-1",children:"هویت شما تایید شده است و می‌توانید از تمام امکانات استفاده کنید."})]})]});case"pending":return a.jsxs("div",{className:"bg-custom-orange/10 border border-custom-orange/20 rounded-2xl p-6 flex items-center gap-4 mb-8",children:[a.jsx("div",{className:"bg-custom-orange rounded-full p-2",children:a.jsx(no,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold text-custom-orange text-lg",children:"در حال بررسی مدارک"}),a.jsx("p",{className:"text-custom-orange/80 text-sm mt-1",children:"مدارک شما ارسال شده و در صف بررسی توسط کارشناسان است."})]})]});case"unverified":default:return a.jsxs("div",{className:"bg-gray-500/10 border border-gray-500/20 dark:bg-gray-700/30 dark:border-gray-600 rounded-2xl p-6 flex items-center gap-4 mb-8",children:[a.jsx("div",{className:"bg-gray-500 dark:bg-gray-600 rounded-full p-2",children:a.jsx(Cn,{className:"w-8 h-8 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold text-gray-700 dark:text-gray-200 text-lg",children:"حساب کاربری تایید نشده"}),a.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm mt-1",children:"لطفاً برای استفاده از خدمات، فرم زیر را تکمیل و کارت ملی خود را ارسال کنید."})]})]})}},M=T!=="unverified";return a.jsxs("div",{className:"flex flex-col max-w-4xl mx-auto",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"حساب کاربری"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:"مدیریت اطلاعات شخصی و احراز هویت."})]}),Q(),a.jsxs("form",{onSubmit:V,className:"space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"اطلاعات هویتی"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"نام و نام خانوادگی"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(Ta,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition disabled:opacity-60 disabled:cursor-not-allowed",placeholder:"مثال: علی رضایی",value:c,onChange:m=>b(m.target.value),disabled:M,required:!0})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"کد ملی"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(hs,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",maxLength:10,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition disabled:opacity-60 disabled:cursor-not-allowed font-mono dir-ltr text-right",placeholder:"0123456789",value:N,onChange:m=>{const j=m.target.value.replace(/[^0-9]/g,"");f(j)},disabled:M,required:!0})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"شماره موبایل"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(Ks,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition opacity-60 cursor-not-allowed font-mono dir-ltr text-right",value:g,readOnly:!0,disabled:!0})]})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"تصویر کارت ملی"}),H?a.jsxs("div",{className:"relative group rounded-xl overflow-hidden border border-gray-200 dark:border-gray-700",children:[a.jsx("img",{src:H.url,alt:"ID Card Preview",className:"w-full h-64 object-cover"}),!M&&a.jsx("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:a.jsxs("button",{type:"button",onClick:O,className:"bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-lg flex items-center gap-2 transition-colors",children:[a.jsx(Oa,{className:"w-5 h-5"}),a.jsx("span",{children:"حذف و انتخاب مجدد"})]})})]}):a.jsxs("label",{htmlFor:"id-card-upload",className:`flex flex-col items-center justify-center w-full h-64 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-xl bg-custom-light-bg dark:bg-custom-dark-blue transition-colors ${M?"opacity-60 cursor-not-allowed":"cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800"}`,onDrop:M?void 0:Z,onDragOver:M?void 0:X,children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6 text-center px-4",children:[a.jsx("div",{className:"p-4 bg-gray-200 dark:bg-gray-700 rounded-full mb-4",children:a.jsx(Mn,{className:"w-8 h-8 text-gray-500 dark:text-gray-400"})}),a.jsx("p",{className:"mb-2 text-lg font-medium text-gray-700 dark:text-gray-200",children:"تصویر روی کارت ملی خود را بارگذاری کنید"}),a.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:M?"امکان تغییر تصویر وجود ندارد":"برای انتخاب کلیک کنید یا تصویر را اینجا رها کنید"}),a.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500 mt-2",children:"JPG, PNG (Max. 2MB)"})]}),a.jsx("input",{id:"id-card-upload",type:"file",className:"hidden",accept:"image/*",onChange:G,disabled:M})]})]}),!M&&a.jsx("div",{className:"flex justify-end",children:a.jsx("button",{type:"submit",className:"bg-custom-purple hover:bg-custom-light-purple text-white font-bold py-3 px-8 rounded-xl transition-colors duration-300 shadow-lg hover:shadow-xl focus:outline-none focus:ring-4 focus:ring-custom-purple/50 disabled:bg-gray-400 disabled:cursor-not-allowed",disabled:!c||!N||!H,children:"ثبت اطلاعات و درخواست تایید"})})]}),a.jsxs("div",{className:"mt-12 p-4 border border-dashed border-gray-300 dark:border-gray-700 rounded-lg opacity-50 hover:opacity-100 transition-opacity",children:[a.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"تنظیمات دمو (برای مشاهده وضعیت‌های مختلف):"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"button",onClick:()=>_("unverified"),className:"px-3 py-1 bg-gray-200 dark:bg-gray-700 rounded text-xs",children:"تایید نشده"}),a.jsx("button",{type:"button",onClick:()=>_("pending"),className:"px-3 py-1 bg-yellow-200 dark:bg-yellow-900 rounded text-xs",children:"در حال بررسی"}),a.jsx("button",{type:"button",onClick:()=>_("verified"),className:"px-3 py-1 bg-green-200 dark:bg-green-900 rounded text-xs",children:"تایید شده"})]})]})]})},V0=()=>{const c="M-100 400 C 100 200, 250 600, 450 400 C 550 300, 650 300, 650 400 C 650 500, 550 600, 450 500 C 350 400, 250 400, 250 500 C 250 600, 450 700, 650 500 C 850 300, 1150 300, 1350 500 L1500 500",b="flightPath",N="trailMask";return a.jsx("div",{className:"absolute inset-0 z-0 overflow-hidden","aria-hidden":"true",children:a.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 1400 800",preserveAspectRatio:"xMidYMid slice",className:"absolute inset-0 opacity-40 dark:opacity-70",children:[a.jsxs("defs",{children:[a.jsx("path",{id:b,d:c,fill:"none"}),a.jsx("mask",{id:N,children:a.jsx("use",{href:`#${b}`,stroke:"white",strokeWidth:"5",className:"animate-draw-trail"})})]}),a.jsx("use",{href:`#${b}`,stroke:"currentColor",strokeWidth:"2",strokeDasharray:"8 12",className:"text-custom-purple",mask:`url(#${N})`}),a.jsx("g",{className:"animate-fly-plane",children:a.jsx(va,{className:"text-custom-purple",width:50,height:50,style:{transform:"translate(-25px, -25px)"}})})]})})},wp=({onLogin:c,theme:b,toggleTheme:N,showError:f})=>{const[g,v]=y.useState(""),[H,S]=y.useState(null),T=G=>{G.preventDefault();const O=g.trim();if(O.length===11&&O.startsWith("09"))c(O),S(null);else{const Z="لطفاً یک شماره موبایل معتبر (11 رقمی با 09) وارد کنید.";S(Z),f(Z)}},_=b==="dark";return a.jsxs("div",{className:"relative min-h-screen",children:[H&&a.jsxs("div",{className:"fixed top-4 left-1/2 transform -translate-x-1/2 z-50 bg-red-500 text-white px-6 py-3 rounded-lg shadow-lg flex items-center animate-fade-in",children:[a.jsx("span",{children:H}),a.jsx("button",{onClick:()=>S(null),className:"mr-3 text-white hover:text-gray-200","aria-label":"بستن",children:"✕"})]}),a.jsxs("div",{className:`relative flex items-center justify-center min-h-screen font-sans overflow-hidden
                ${_?"bg-custom-dark-blue text-white bg-[radial-gradient(#27314e_1px,transparent_1px)]":"bg-gradient-to-br from-gray-100 via-purple-50 to-indigo-100 text-gray-800 bg-[radial-gradient(#c7d2fe_1px,transparent_1px)]"} [background-size:16px_16px]`,children:[a.jsx(V0,{}),a.jsx("div",{className:"absolute top-6 left-6 z-20",children:a.jsx("button",{onClick:N,className:`p-2 rounded-full cursor-pointer shadow-md transition-colors
                            ${_?"bg-custom-dark-blue-light":"bg-white border border-gray-200 hover:bg-gray-50"}`,"aria-label":"Toggle theme",children:_?a.jsx(uh,{className:"h-6 w-6 text-yellow-400"}):a.jsx(hh,{className:"h-6 w-6 text-indigo-600"})})}),a.jsxs("div",{className:`relative z-10 w-full max-w-sm p-8 space-y-8 rounded-2xl shadow-xl backdrop-blur-sm
                    ${_?"bg-custom-dark-blue-light/80 border border-white/10":"bg-white/90 border border-gray-200 shadow-purple-100/50"}`,children:[a.jsxs("div",{className:"text-center",children:[a.jsxs("div",{className:"flex items-center justify-center mb-6",children:[a.jsx(mh,{className:`w-12 h-12 ${_?"text-custom-purple":"text-indigo-600"}`}),a.jsx("span",{className:`text-4xl font-bold mr-3 ${_?"text-white":"text-gray-800"}`,children:"اینوببر"})]}),a.jsx("h2",{className:`text-2xl font-bold ${_?"text-white":"text-gray-800"}`,children:"ورود | ثبت نام"}),a.jsx("p",{className:`mt-2 ${_?"text-gray-400":"text-gray-500"}`,children:"لطفا شماره موبایل خود را وارد کنید"})]}),a.jsxs("form",{className:"space-y-6",onSubmit:T,children:[a.jsx("input",{id:"phone",name:"phone",type:"tel",autoComplete:"tel",required:!0,className:`w-full px-4 py-3 text-center tracking-[.2em] rounded-lg focus:outline-none focus:ring-2 transition-colors
                                ${_?"bg-custom-dark-blue border border-gray-700 placeholder-gray-500 text-white focus:ring-custom-purple":"bg-gray-50 border border-gray-300 placeholder-gray-400 text-gray-800 focus:ring-indigo-500 focus:border-indigo-500"}`,placeholder:"۰۹۱۲*******",value:g,onChange:G=>v(G.target.value)}),a.jsx("button",{type:"submit",className:`w-full py-3 px-4 rounded-lg font-semibold transition-colors duration-300 text-white
                                ${_?"bg-custom-purple hover:bg-custom-light-purple":"bg-indigo-600 hover:bg-indigo-700 shadow-lg shadow-indigo-200"}`,children:"ورود"})]}),a.jsx("p",{className:`text-xs text-center ${_?"text-gray-500":"text-gray-400"}`,children:"ورود شما به معنای پذیرش قوانین سایت است"})]})]})]})},kp=({onVerify:c,onResend:b,theme:N,toggleTheme:f})=>{const[g,v]=y.useState(new Array(6).fill("")),H=y.useRef([]),S=N==="dark",T=(Z,X)=>{var M;const V=Z.target.value;if(isNaN(Number(V)))return;const Q=[...g];Q[X]=V.substring(V.length-1),v(Q),V&&X<5&&((M=H.current[X+1])==null||M.focus())},_=(Z,X)=>{var V;Z.key==="Backspace"&&!g[X]&&X>0&&((V=H.current[X-1])==null||V.focus())},G=Z=>{var V;Z.preventDefault();const X=Z.clipboardData.getData("text");if(X.length===6&&/^\d+$/.test(X)){const Q=X.split("");v(Q),(V=H.current[5])==null||V.focus()}},O=Z=>{Z.preventDefault();const X=g.join("");X.length===6?c(X):alert("لطفاً کد 6 رقمی را کامل وارد کنید.")};return a.jsxs("div",{className:`relative flex items-center justify-center min-h-screen font-sans overflow-hidden
            ${S?"bg-custom-dark-blue text-white bg-[radial-gradient(#27314e_1px,transparent_1px)]":"bg-gradient-to-br from-gray-100 via-purple-50 to-indigo-100 text-gray-800 bg-[radial-gradient(#c7d2fe_1px,transparent_1px)]"} [background-size:16px_16px]`,children:[a.jsx(V0,{}),a.jsx("div",{className:"absolute top-6 left-6 z-20",children:a.jsx("button",{onClick:f,className:`p-2 rounded-full cursor-pointer shadow-md transition-colors
                        ${S?"bg-custom-dark-blue-light":"bg-white border border-gray-200 hover:bg-gray-50"}`,"aria-label":"Toggle theme",children:S?a.jsx(uh,{className:"h-6 w-6 text-yellow-400"}):a.jsx(hh,{className:"h-6 w-6 text-indigo-600"})})}),a.jsxs("div",{className:`relative z-10 w-full max-w-md p-8 space-y-8 rounded-2xl shadow-xl backdrop-blur-sm
                ${S?"bg-custom-dark-blue-light/80 border border-white/10":"bg-white/90 border border-gray-200 shadow-purple-100/50"}`,children:[a.jsxs("div",{className:"text-center",children:[a.jsxs("div",{className:"flex items-center justify-center mb-6",children:[a.jsx(mh,{className:`w-12 h-12 ${S?"text-custom-purple":"text-indigo-600"}`}),a.jsx("span",{className:`text-4xl font-bold mr-3 ${S?"text-white":"text-gray-800"}`,children:"اینوببر"})]}),a.jsx("h2",{className:`text-2xl font-bold ${S?"text-white":"text-gray-800"}`,children:"کد تایید را وارد کنید"}),a.jsx("p",{className:`mt-2 ${S?"text-gray-400":"text-gray-500"}`,children:"کد تایید برای شما ارسال گردید."})]}),a.jsxs("form",{onSubmit:O,children:[a.jsx("div",{className:"flex justify-center gap-2 mb-6",dir:"ltr",onPaste:G,children:g.map((Z,X)=>a.jsx("input",{type:"text",name:"otp",inputMode:"numeric",pattern:"[0-9]*",maxLength:1,className:`w-12 h-14 sm:w-14 sm:h-14 text-center text-2xl font-semibold rounded-lg focus:outline-none focus:ring-2 transition-colors
                                    ${S?"bg-custom-dark-blue border border-gray-700 text-white focus:ring-custom-purple":"bg-gray-50 border border-gray-300 text-gray-800 focus:ring-indigo-500 focus:border-indigo-500"}`,value:Z,onChange:V=>T(V,X),onKeyDown:V=>_(V,X),ref:V=>{H.current[X]=V},autoFocus:X===0},X))}),a.jsx("button",{type:"submit",className:`w-full py-3 px-4 rounded-lg font-semibold transition-colors duration-300 text-white
                            ${S?"bg-custom-purple hover:bg-custom-light-purple":"bg-indigo-600 hover:bg-indigo-700 shadow-lg shadow-indigo-200"}`,children:"ادامه"})]}),a.jsx("div",{className:"text-center",children:a.jsx("button",{onClick:b,className:`text-sm hover:underline transition-colors
                            ${S?"text-custom-light-purple":"text-indigo-600 hover:text-indigo-700"}`,children:"دریافت مجدد کد"})})]})]})};function _p(c){throw new Error('Could not dynamically require "'+c+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Pc={exports:{}},Sp=Pc.exports,_0;function Dp(){return _0||(_0=1,(function(c,b){(function(N,f){c.exports=f()})(Sp,(function(){var N;function f(){return N.apply(null,arguments)}function g(r){N=r}function v(r){return r instanceof Array||Object.prototype.toString.call(r)==="[object Array]"}function H(r){return r!=null&&Object.prototype.toString.call(r)==="[object Object]"}function S(r,o){return Object.prototype.hasOwnProperty.call(r,o)}function T(r){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(r).length===0;var o;for(o in r)if(S(r,o))return!1;return!0}function _(r){return r===void 0}function G(r){return typeof r=="number"||Object.prototype.toString.call(r)==="[object Number]"}function O(r){return r instanceof Date||Object.prototype.toString.call(r)==="[object Date]"}function Z(r,o){var d=[],h,x=r.length;for(h=0;h<x;++h)d.push(o(r[h],h));return d}function X(r,o){for(var d in o)S(o,d)&&(r[d]=o[d]);return S(o,"toString")&&(r.toString=o.toString),S(o,"valueOf")&&(r.valueOf=o.valueOf),r}function V(r,o,d,h){return To(r,o,d,h,!0).utc()}function Q(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function M(r){return r._pf==null&&(r._pf=Q()),r._pf}var m;Array.prototype.some?m=Array.prototype.some:m=function(r){var o=Object(this),d=o.length>>>0,h;for(h=0;h<d;h++)if(h in o&&r.call(this,o[h],h,o))return!0;return!1};function j(r){var o=null,d=!1,h=r._d&&!isNaN(r._d.getTime());if(h&&(o=M(r),d=m.call(o.parsedDateParts,function(x){return x!=null}),h=o.overflow<0&&!o.empty&&!o.invalidEra&&!o.invalidMonth&&!o.invalidWeekday&&!o.weekdayMismatch&&!o.nullInput&&!o.invalidFormat&&!o.userInvalidated&&(!o.meridiem||o.meridiem&&d),r._strict&&(h=h&&o.charsLeftOver===0&&o.unusedTokens.length===0&&o.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(r))r._isValid=h;else return h;return r._isValid}function R(r){var o=V(NaN);return r!=null?X(M(o),r):M(o).userInvalidated=!0,o}var U=f.momentProperties=[],de=!1;function pe(r,o){var d,h,x,D=U.length;if(_(o._isAMomentObject)||(r._isAMomentObject=o._isAMomentObject),_(o._i)||(r._i=o._i),_(o._f)||(r._f=o._f),_(o._l)||(r._l=o._l),_(o._strict)||(r._strict=o._strict),_(o._tzm)||(r._tzm=o._tzm),_(o._isUTC)||(r._isUTC=o._isUTC),_(o._offset)||(r._offset=o._offset),_(o._pf)||(r._pf=M(o)),_(o._locale)||(r._locale=o._locale),D>0)for(d=0;d<D;d++)h=U[d],x=o[h],_(x)||(r[h]=x);return r}function z(r){pe(this,r),this._d=new Date(r._d!=null?r._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),de===!1&&(de=!0,f.updateOffset(this),de=!1)}function F(r){return r instanceof z||r!=null&&r._isAMomentObject!=null}function ke(r){f.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+r)}function ye(r,o){var d=!0;return X(function(){if(f.deprecationHandler!=null&&f.deprecationHandler(null,r),d){var h=[],x,D,se,Me=arguments.length;for(D=0;D<Me;D++){if(x="",typeof arguments[D]=="object"){x+=`
[`+D+"] ";for(se in arguments[0])S(arguments[0],se)&&(x+=se+": "+arguments[0][se]+", ");x=x.slice(0,-2)}else x=arguments[D];h.push(x)}ke(r+`
Arguments: `+Array.prototype.slice.call(h).join("")+`
`+new Error().stack),d=!1}return o.apply(this,arguments)},o)}var ne={};function E(r,o){f.deprecationHandler!=null&&f.deprecationHandler(r,o),ne[r]||(ke(o),ne[r]=!0)}f.suppressDeprecationWarnings=!1,f.deprecationHandler=null;function fe(r){return typeof Function<"u"&&r instanceof Function||Object.prototype.toString.call(r)==="[object Function]"}function be(r){var o,d;for(d in r)S(r,d)&&(o=r[d],fe(o)?this[d]=o:this["_"+d]=o);this._config=r,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function me(r,o){var d=X({},r),h;for(h in o)S(o,h)&&(H(r[h])&&H(o[h])?(d[h]={},X(d[h],r[h]),X(d[h],o[h])):o[h]!=null?d[h]=o[h]:delete d[h]);for(h in r)S(r,h)&&!S(o,h)&&H(r[h])&&(d[h]=X({},d[h]));return d}function B(r){r!=null&&this.set(r)}var oe;Object.keys?oe=Object.keys:oe=function(r){var o,d=[];for(o in r)S(r,o)&&d.push(o);return d};var Ne={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Ae(r,o,d){var h=this._calendar[r]||this._calendar.sameElse;return fe(h)?h.call(o,d):h}function De(r,o,d){var h=""+Math.abs(r),x=o-h.length,D=r>=0;return(D?d?"+":"":"-")+Math.pow(10,Math.max(0,x)).toString().substr(1)+h}var w=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,q=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,K={},xe={};function ee(r,o,d,h){var x=h;typeof h=="string"&&(x=function(){return this[h]()}),r&&(xe[r]=x),o&&(xe[o[0]]=function(){return De(x.apply(this,arguments),o[1],o[2])}),d&&(xe[d]=function(){return this.localeData().ordinal(x.apply(this,arguments),r)})}function Te(r){return r.match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"")}function ze(r){var o=r.match(w),d,h;for(d=0,h=o.length;d<h;d++)xe[o[d]]?o[d]=xe[o[d]]:o[d]=Te(o[d]);return function(x){var D="",se;for(se=0;se<h;se++)D+=fe(o[se])?o[se].call(x,r):o[se];return D}}function Be(r,o){return r.isValid()?(o=k(o,r.localeData()),K[o]=K[o]||ze(o),K[o](r)):r.localeData().invalidDate()}function k(r,o){var d=5;function h(x){return o.longDateFormat(x)||x}for(q.lastIndex=0;d>=0&&q.test(r);)r=r.replace(q,h),q.lastIndex=0,d-=1;return r}var A={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function ae(r){var o=this._longDateFormat[r],d=this._longDateFormat[r.toUpperCase()];return o||!d?o:(this._longDateFormat[r]=d.match(w).map(function(h){return h==="MMMM"||h==="MM"||h==="DD"||h==="dddd"?h.slice(1):h}).join(""),this._longDateFormat[r])}var ie="Invalid date";function we(){return this._invalidDate}var Ce="%d",We=/\d{1,2}/;function Je(r){return this._ordinal.replace("%d",r)}var st={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function $t(r,o,d,h){var x=this._relativeTime[d];return fe(x)?x(r,o,d,h):x.replace(/%d/i,r)}function Gt(r,o){var d=this._relativeTime[r>0?"future":"past"];return fe(d)?d(o):d.replace(/%s/i,o)}var Vt={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function bt(r){return typeof r=="string"?Vt[r]||Vt[r.toLowerCase()]:void 0}function ea(r){var o={},d,h;for(h in r)S(r,h)&&(d=bt(h),d&&(o[d]=r[h]));return o}var Se={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function le(r){var o=[],d;for(d in r)S(r,d)&&o.push({unit:d,priority:Se[d]});return o.sort(function(h,x){return h.priority-x.priority}),o}var _e=/\d/,Ee=/\d\d/,ft=/\d{3}/,he=/\d{4}/,ot=/[+-]?\d{6}/,Ge=/\d\d?/,Lt=/\d\d\d\d?/,Re=/\d\d\d\d\d\d?/,ta=/\d{1,3}/,At=/\d{1,4}/,Wt=/[+-]?\d{1,6}/,kt=/\d+/,ge=/[+-]?\d+/,tt=/Z|[+-]\d\d:?\d\d/gi,Ye=/Z|[+-]\d\d(?::?\d\d)?/gi,Ze=/[+-]?\d+(\.\d{1,3})?/,Rt=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,$e=/^[1-9]\d?/,I=/^([1-9]\d|\d)/,mt;mt={};function je(r,o,d){mt[r]=fe(o)?o:function(h,x){return h&&d?d:o}}function Ot(r,o){return S(mt,r)?mt[r](o._strict,o._locale):new RegExp(lr(r))}function lr(r){return ma(r.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(o,d,h,x,D){return d||h||x||D}))}function ma(r){return r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Zt(r){return r<0?Math.ceil(r)||0:Math.floor(r)}function Ke(r){var o=+r,d=0;return o!==0&&isFinite(o)&&(d=Zt(o)),d}var Is={};function ht(r,o){var d,h=o,x;for(typeof r=="string"&&(r=[r]),G(o)&&(h=function(D,se){se[o]=Ke(D)}),x=r.length,d=0;d<x;d++)Is[r[d]]=h}function Ea(r,o){ht(r,function(d,h,x,D){x._w=x._w||{},o(d,x._w,x,D)})}function zr(r,o,d){o!=null&&S(Is,r)&&Is[r](o,d._a,d,r)}function ut(r){return r%4===0&&r%100!==0||r%400===0}var Xt=0,La=1,Yt=2,Xe=3,Et=4,ga=5,fs=6,ad=7,sd=8;ee("Y",0,0,function(){var r=this.year();return r<=9999?De(r,4):"+"+r}),ee(0,["YY",2],0,function(){return this.year()%100}),ee(0,["YYYY",4],0,"year"),ee(0,["YYYYY",5],0,"year"),ee(0,["YYYYYY",6,!0],0,"year"),je("Y",ge),je("YY",Ge,Ee),je("YYYY",At,he),je("YYYYY",Wt,ot),je("YYYYYY",Wt,ot),ht(["YYYYY","YYYYYY"],Xt),ht("YYYY",function(r,o){o[Xt]=r.length===2?f.parseTwoDigitYear(r):Ke(r)}),ht("YY",function(r,o){o[Xt]=f.parseTwoDigitYear(r)}),ht("Y",function(r,o){o[Xt]=parseInt(r,10)});function Nl(r){return ut(r)?366:365}f.parseTwoDigitYear=function(r){return Ke(r)+(Ke(r)>68?1900:2e3)};var wl=Za("FullYear",!0);function Tn(){return ut(this.year())}function Za(r,o){return function(d){return d!=null?(kl(this,r,d),f.updateOffset(this,o),this):Pa(this,r)}}function Pa(r,o){if(!r.isValid())return NaN;var d=r._d,h=r._isUTC;switch(o){case"Milliseconds":return h?d.getUTCMilliseconds():d.getMilliseconds();case"Seconds":return h?d.getUTCSeconds():d.getSeconds();case"Minutes":return h?d.getUTCMinutes():d.getMinutes();case"Hours":return h?d.getUTCHours():d.getHours();case"Date":return h?d.getUTCDate():d.getDate();case"Day":return h?d.getUTCDay():d.getDay();case"Month":return h?d.getUTCMonth():d.getMonth();case"FullYear":return h?d.getUTCFullYear():d.getFullYear();default:return NaN}}function kl(r,o,d){var h,x,D,se,Me;if(!(!r.isValid()||isNaN(d))){switch(h=r._d,x=r._isUTC,o){case"Milliseconds":return void(x?h.setUTCMilliseconds(d):h.setMilliseconds(d));case"Seconds":return void(x?h.setUTCSeconds(d):h.setSeconds(d));case"Minutes":return void(x?h.setUTCMinutes(d):h.setMinutes(d));case"Hours":return void(x?h.setUTCHours(d):h.setHours(d));case"Date":return void(x?h.setUTCDate(d):h.setDate(d));case"FullYear":break;default:return}D=d,se=r.month(),Me=r.date(),Me=Me===29&&se===1&&!ut(D)?28:Me,x?h.setUTCFullYear(D,se,Me):h.setFullYear(D,se,Me)}}function _l(r){return r=bt(r),fe(this[r])?this[r]():this}function Jt(r,o){if(typeof r=="object"){r=ea(r);var d=le(r),h,x=d.length;for(h=0;h<x;h++)this[d[h].unit](r[d[h].unit])}else if(r=bt(r),fe(this[r]))return this[r](o);return this}function oo(r,o){return(r%o+o)%o}var Ut;Array.prototype.indexOf?Ut=Array.prototype.indexOf:Ut=function(r){var o;for(o=0;o<this.length;++o)if(this[o]===r)return o;return-1};function ms(r,o){if(isNaN(r)||isNaN(o))return NaN;var d=oo(o,12);return r+=(o-d)/12,d===1?ut(r)?29:28:31-d%7%2}ee("M",["MM",2],"Mo",function(){return this.month()+1}),ee("MMM",0,0,function(r){return this.localeData().monthsShort(this,r)}),ee("MMMM",0,0,function(r){return this.localeData().months(this,r)}),je("M",Ge,$e),je("MM",Ge,Ee),je("MMM",function(r,o){return o.monthsShortRegex(r)}),je("MMMM",function(r,o){return o.monthsRegex(r)}),ht(["M","MM"],function(r,o){o[La]=Ke(r)-1}),ht(["MMM","MMMM"],function(r,o,d,h){var x=d._locale.monthsParse(r,h,d._strict);x!=null?o[La]=x:M(d).invalidMonth=r});var Sl="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),co="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),On=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,uo=Rt,ld=Rt;function Rr(r,o){return r?v(this._months)?this._months[r.month()]:this._months[(this._months.isFormat||On).test(o)?"format":"standalone"][r.month()]:v(this._months)?this._months:this._months.standalone}function Ur(r,o){return r?v(this._monthsShort)?this._monthsShort[r.month()]:this._monthsShort[On.test(o)?"format":"standalone"][r.month()]:v(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function gs(r,o,d){var h,x,D,se=r.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],h=0;h<12;++h)D=V([2e3,h]),this._shortMonthsParse[h]=this.monthsShort(D,"").toLocaleLowerCase(),this._longMonthsParse[h]=this.months(D,"").toLocaleLowerCase();return d?o==="MMM"?(x=Ut.call(this._shortMonthsParse,se),x!==-1?x:null):(x=Ut.call(this._longMonthsParse,se),x!==-1?x:null):o==="MMM"?(x=Ut.call(this._shortMonthsParse,se),x!==-1?x:(x=Ut.call(this._longMonthsParse,se),x!==-1?x:null)):(x=Ut.call(this._longMonthsParse,se),x!==-1?x:(x=Ut.call(this._shortMonthsParse,se),x!==-1?x:null))}function Aa(r,o,d){var h,x,D;if(this._monthsParseExact)return gs.call(this,r,o,d);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),h=0;h<12;h++){if(x=V([2e3,h]),d&&!this._longMonthsParse[h]&&(this._longMonthsParse[h]=new RegExp("^"+this.months(x,"").replace(".","")+"$","i"),this._shortMonthsParse[h]=new RegExp("^"+this.monthsShort(x,"").replace(".","")+"$","i")),!d&&!this._monthsParse[h]&&(D="^"+this.months(x,"")+"|^"+this.monthsShort(x,""),this._monthsParse[h]=new RegExp(D.replace(".",""),"i")),d&&o==="MMMM"&&this._longMonthsParse[h].test(r))return h;if(d&&o==="MMM"&&this._shortMonthsParse[h].test(r))return h;if(!d&&this._monthsParse[h].test(r))return h}}function En(r,o){if(!r.isValid())return r;if(typeof o=="string"){if(/^\d+$/.test(o))o=Ke(o);else if(o=r.localeData().monthsParse(o),!G(o))return r}var d=o,h=r.date();return h=h<29?h:Math.min(h,ms(r.year(),d)),r._isUTC?r._d.setUTCMonth(d,h):r._d.setMonth(d,h),r}function ho(r){return r!=null?(En(this,r),f.updateOffset(this,!0),this):Pa(this,"Month")}function Ln(){return ms(this.year(),this.month())}function fo(r){return this._monthsParseExact?(S(this,"_monthsRegex")||mo.call(this),r?this._monthsShortStrictRegex:this._monthsShortRegex):(S(this,"_monthsShortRegex")||(this._monthsShortRegex=uo),this._monthsShortStrictRegex&&r?this._monthsShortStrictRegex:this._monthsShortRegex)}function Hr(r){return this._monthsParseExact?(S(this,"_monthsRegex")||mo.call(this),r?this._monthsStrictRegex:this._monthsRegex):(S(this,"_monthsRegex")||(this._monthsRegex=ld),this._monthsStrictRegex&&r?this._monthsStrictRegex:this._monthsRegex)}function mo(){function r(qe,at){return at.length-qe.length}var o=[],d=[],h=[],x,D,se,Me;for(x=0;x<12;x++)D=V([2e3,x]),se=ma(this.monthsShort(D,"")),Me=ma(this.months(D,"")),o.push(se),d.push(Me),h.push(Me),h.push(se);o.sort(r),d.sort(r),h.sort(r),this._monthsRegex=new RegExp("^("+h.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Ya(r,o,d,h,x,D,se){var Me;return r<100&&r>=0?(Me=new Date(r+400,o,d,h,x,D,se),isFinite(Me.getFullYear())&&Me.setFullYear(r)):Me=new Date(r,o,d,h,x,D,se),Me}function Ps(r){var o,d;return r<100&&r>=0?(d=Array.prototype.slice.call(arguments),d[0]=r+400,o=new Date(Date.UTC.apply(null,d)),isFinite(o.getUTCFullYear())&&o.setUTCFullYear(r)):o=new Date(Date.UTC.apply(null,arguments)),o}function rr(r,o,d){var h=7+o-d,x=(7+Ps(r,0,h).getUTCDay()-o)%7;return-x+h-1}function qr(r,o,d,h,x){var D=(7+d-h)%7,se=rr(r,h,x),Me=1+7*(o-1)+D+se,qe,at;return Me<=0?(qe=r-1,at=Nl(qe)+Me):Me>Nl(r)?(qe=r+1,at=Me-Nl(r)):(qe=r,at=Me),{year:qe,dayOfYear:at}}function es(r,o,d){var h=rr(r.year(),o,d),x=Math.floor((r.dayOfYear()-h-1)/7)+1,D,se;return x<1?(se=r.year()-1,D=x+ts(se,o,d)):x>ts(r.year(),o,d)?(D=x-ts(r.year(),o,d),se=r.year()+1):(se=r.year(),D=x),{week:D,year:se}}function ts(r,o,d){var h=rr(r,o,d),x=rr(r+1,o,d);return(Nl(r)-h+x)/7}ee("w",["ww",2],"wo","week"),ee("W",["WW",2],"Wo","isoWeek"),je("w",Ge,$e),je("ww",Ge,Ee),je("W",Ge,$e),je("WW",Ge,Ee),Ea(["w","ww","W","WW"],function(r,o,d,h){o[h.substr(0,1)]=Ke(r)});function go(r){return es(r,this._week.dow,this._week.doy).week}var Dl={dow:0,doy:6};function rd(){return this._week.dow}function xo(){return this._week.doy}function po(r){var o=this.localeData().week(this);return r==null?o:this.add((r-o)*7,"d")}function An(r){var o=es(this,1,4).week;return r==null?o:this.add((r-o)*7,"d")}ee("d",0,"do","day"),ee("dd",0,0,function(r){return this.localeData().weekdaysMin(this,r)}),ee("ddd",0,0,function(r){return this.localeData().weekdaysShort(this,r)}),ee("dddd",0,0,function(r){return this.localeData().weekdays(this,r)}),ee("e",0,0,"weekday"),ee("E",0,0,"isoWeekday"),je("d",Ge),je("e",Ge),je("E",Ge),je("dd",function(r,o){return o.weekdaysMinRegex(r)}),je("ddd",function(r,o){return o.weekdaysShortRegex(r)}),je("dddd",function(r,o){return o.weekdaysRegex(r)}),Ea(["dd","ddd","dddd"],function(r,o,d,h){var x=d._locale.weekdaysParse(r,h,d._strict);x!=null?o.d=x:M(d).invalidWeekday=r}),Ea(["d","e","E"],function(r,o,d,h){o[h]=Ke(r)});function nd(r,o){return typeof r!="string"?r:isNaN(r)?(r=o.weekdaysParse(r),typeof r=="number"?r:null):parseInt(r,10)}function id(r,o){return typeof r=="string"?o.weekdaysParse(r)%7||7:isNaN(r)?null:r}function Ml(r,o){return r.slice(o,7).concat(r.slice(0,o))}var xs="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Br="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Yn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Cl=Rt,Tl=Rt,yo=Rt;function zn(r,o){var d=v(this._weekdays)?this._weekdays:this._weekdays[r&&r!==!0&&this._weekdays.isFormat.test(o)?"format":"standalone"];return r===!0?Ml(d,this._week.dow):r?d[r.day()]:d}function bo(r){return r===!0?Ml(this._weekdaysShort,this._week.dow):r?this._weekdaysShort[r.day()]:this._weekdaysShort}function nr(r){return r===!0?Ml(this._weekdaysMin,this._week.dow):r?this._weekdaysMin[r.day()]:this._weekdaysMin}function ps(r,o,d){var h,x,D,se=r.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],h=0;h<7;++h)D=V([2e3,1]).day(h),this._minWeekdaysParse[h]=this.weekdaysMin(D,"").toLocaleLowerCase(),this._shortWeekdaysParse[h]=this.weekdaysShort(D,"").toLocaleLowerCase(),this._weekdaysParse[h]=this.weekdays(D,"").toLocaleLowerCase();return d?o==="dddd"?(x=Ut.call(this._weekdaysParse,se),x!==-1?x:null):o==="ddd"?(x=Ut.call(this._shortWeekdaysParse,se),x!==-1?x:null):(x=Ut.call(this._minWeekdaysParse,se),x!==-1?x:null):o==="dddd"?(x=Ut.call(this._weekdaysParse,se),x!==-1||(x=Ut.call(this._shortWeekdaysParse,se),x!==-1)?x:(x=Ut.call(this._minWeekdaysParse,se),x!==-1?x:null)):o==="ddd"?(x=Ut.call(this._shortWeekdaysParse,se),x!==-1||(x=Ut.call(this._weekdaysParse,se),x!==-1)?x:(x=Ut.call(this._minWeekdaysParse,se),x!==-1?x:null)):(x=Ut.call(this._minWeekdaysParse,se),x!==-1||(x=Ut.call(this._weekdaysParse,se),x!==-1)?x:(x=Ut.call(this._shortWeekdaysParse,se),x!==-1?x:null))}function Rn(r,o,d){var h,x,D;if(this._weekdaysParseExact)return ps.call(this,r,o,d);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),h=0;h<7;h++){if(x=V([2e3,1]).day(h),d&&!this._fullWeekdaysParse[h]&&(this._fullWeekdaysParse[h]=new RegExp("^"+this.weekdays(x,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[h]=new RegExp("^"+this.weekdaysShort(x,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[h]=new RegExp("^"+this.weekdaysMin(x,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[h]||(D="^"+this.weekdays(x,"")+"|^"+this.weekdaysShort(x,"")+"|^"+this.weekdaysMin(x,""),this._weekdaysParse[h]=new RegExp(D.replace(".",""),"i")),d&&o==="dddd"&&this._fullWeekdaysParse[h].test(r))return h;if(d&&o==="ddd"&&this._shortWeekdaysParse[h].test(r))return h;if(d&&o==="dd"&&this._minWeekdaysParse[h].test(r))return h;if(!d&&this._weekdaysParse[h].test(r))return h}}function ir(r){if(!this.isValid())return r!=null?this:NaN;var o=Pa(this,"Day");return r!=null?(r=nd(r,this.localeData()),this.add(r-o,"d")):o}function Es(r){if(!this.isValid())return r!=null?this:NaN;var o=(this.day()+7-this.localeData()._week.dow)%7;return r==null?o:this.add(r-o,"d")}function Un(r){if(!this.isValid())return r!=null?this:NaN;if(r!=null){var o=id(r,this.localeData());return this.day(this.day()%7?o:o-7)}else return this.day()||7}function $r(r){return this._weekdaysParseExact?(S(this,"_weekdaysRegex")||Ol.call(this),r?this._weekdaysStrictRegex:this._weekdaysRegex):(S(this,"_weekdaysRegex")||(this._weekdaysRegex=Cl),this._weekdaysStrictRegex&&r?this._weekdaysStrictRegex:this._weekdaysRegex)}function vo(r){return this._weekdaysParseExact?(S(this,"_weekdaysRegex")||Ol.call(this),r?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(S(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Tl),this._weekdaysShortStrictRegex&&r?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Gr(r){return this._weekdaysParseExact?(S(this,"_weekdaysRegex")||Ol.call(this),r?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(S(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=yo),this._weekdaysMinStrictRegex&&r?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ol(){function r(ca,Wa){return Wa.length-ca.length}var o=[],d=[],h=[],x=[],D,se,Me,qe,at;for(D=0;D<7;D++)se=V([2e3,1]).day(D),Me=ma(this.weekdaysMin(se,"")),qe=ma(this.weekdaysShort(se,"")),at=ma(this.weekdays(se,"")),o.push(Me),d.push(qe),h.push(at),x.push(Me),x.push(qe),x.push(at);o.sort(r),d.sort(r),h.sort(r),x.sort(r),this._weekdaysRegex=new RegExp("^("+x.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Vr(){return this.hours()%12||12}function xa(){return this.hours()||24}ee("H",["HH",2],0,"hour"),ee("h",["hh",2],0,Vr),ee("k",["kk",2],0,xa),ee("hmm",0,0,function(){return""+Vr.apply(this)+De(this.minutes(),2)}),ee("hmmss",0,0,function(){return""+Vr.apply(this)+De(this.minutes(),2)+De(this.seconds(),2)}),ee("Hmm",0,0,function(){return""+this.hours()+De(this.minutes(),2)}),ee("Hmmss",0,0,function(){return""+this.hours()+De(this.minutes(),2)+De(this.seconds(),2)});function Ls(r,o){ee(r,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),o)})}Ls("a",!0),Ls("A",!1);function or(r,o){return o._meridiemParse}je("a",or),je("A",or),je("H",Ge,I),je("h",Ge,$e),je("k",Ge,$e),je("HH",Ge,Ee),je("hh",Ge,Ee),je("kk",Ge,Ee),je("hmm",Lt),je("hmmss",Re),je("Hmm",Lt),je("Hmmss",Re),ht(["H","HH"],Xe),ht(["k","kk"],function(r,o,d){var h=Ke(r);o[Xe]=h===24?0:h}),ht(["a","A"],function(r,o,d){d._isPm=d._locale.isPM(r),d._meridiem=r}),ht(["h","hh"],function(r,o,d){o[Xe]=Ke(r),M(d).bigHour=!0}),ht("hmm",function(r,o,d){var h=r.length-2;o[Xe]=Ke(r.substr(0,h)),o[Et]=Ke(r.substr(h)),M(d).bigHour=!0}),ht("hmmss",function(r,o,d){var h=r.length-4,x=r.length-2;o[Xe]=Ke(r.substr(0,h)),o[Et]=Ke(r.substr(h,2)),o[ga]=Ke(r.substr(x)),M(d).bigHour=!0}),ht("Hmm",function(r,o,d){var h=r.length-2;o[Xe]=Ke(r.substr(0,h)),o[Et]=Ke(r.substr(h))}),ht("Hmmss",function(r,o,d){var h=r.length-4,x=r.length-2;o[Xe]=Ke(r.substr(0,h)),o[Et]=Ke(r.substr(h,2)),o[ga]=Ke(r.substr(x))});function cr(r){return(r+"").toLowerCase().charAt(0)==="p"}var od=/[ap]\.?m?\.?/i,Hn=Za("Hours",!0);function qn(r,o,d){return r>11?d?"pm":"PM":d?"am":"AM"}var El={calendar:Ne,longDateFormat:A,invalidDate:ie,ordinal:Ce,dayOfMonthOrdinalParse:We,relativeTime:st,months:Sl,monthsShort:co,week:Dl,weekdays:xs,weekdaysMin:Yn,weekdaysShort:Br,meridiemParse:od},jt={},Ll={},dr;function cd(r,o){var d,h=Math.min(r.length,o.length);for(d=0;d<h;d+=1)if(r[d]!==o[d])return d;return h}function jo(r){return r&&r.toLowerCase().replace("_","-")}function Bn(r){for(var o=0,d,h,x,D;o<r.length;){for(D=jo(r[o]).split("-"),d=D.length,h=jo(r[o+1]),h=h?h.split("-"):null;d>0;){if(x=Qr(D.slice(0,d).join("-")),x)return x;if(h&&h.length>=d&&cd(D,h)>=d-1)break;d--}o++}return dr}function dd(r){return!!(r&&r.match("^[^/\\\\]*$"))}function Qr(r){var o=null,d;if(jt[r]===void 0&&c&&c.exports&&dd(r))try{o=dr._abbr,d=_p,d("./locale/"+r),As(o)}catch{jt[r]=null}return jt[r]}function As(r,o){var d;return r&&(_(o)?d=as(r):d=$n(r,o),d?dr=d:typeof console<"u"&&console.warn&&console.warn("Locale "+r+" not found. Did you forget to load it?")),dr._abbr}function $n(r,o){if(o!==null){var d,h=El;if(o.abbr=r,jt[r]!=null)E("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),h=jt[r]._config;else if(o.parentLocale!=null)if(jt[o.parentLocale]!=null)h=jt[o.parentLocale]._config;else if(d=Qr(o.parentLocale),d!=null)h=d._config;else return Ll[o.parentLocale]||(Ll[o.parentLocale]=[]),Ll[o.parentLocale].push({name:r,config:o}),null;return jt[r]=new B(me(h,o)),Ll[r]&&Ll[r].forEach(function(x){$n(x.name,x.config)}),As(r),jt[r]}else return delete jt[r],null}function ud(r,o){if(o!=null){var d,h,x=El;jt[r]!=null&&jt[r].parentLocale!=null?jt[r].set(me(jt[r]._config,o)):(h=Qr(r),h!=null&&(x=h._config),o=me(x,o),h==null&&(o.abbr=r),d=new B(o),d.parentLocale=jt[r],jt[r]=d),As(r)}else jt[r]!=null&&(jt[r].parentLocale!=null?(jt[r]=jt[r].parentLocale,r===As()&&As(r)):jt[r]!=null&&delete jt[r]);return jt[r]}function as(r){var o;if(r&&r._locale&&r._locale._abbr&&(r=r._locale._abbr),!r)return dr;if(!v(r)){if(o=Qr(r),o)return o;r=[r]}return Bn(r)}function hd(){return oe(jt)}function Gn(r){var o,d=r._a;return d&&M(r).overflow===-2&&(o=d[La]<0||d[La]>11?La:d[Yt]<1||d[Yt]>ms(d[Xt],d[La])?Yt:d[Xe]<0||d[Xe]>24||d[Xe]===24&&(d[Et]!==0||d[ga]!==0||d[fs]!==0)?Xe:d[Et]<0||d[Et]>59?Et:d[ga]<0||d[ga]>59?ga:d[fs]<0||d[fs]>999?fs:-1,M(r)._overflowDayOfYear&&(o<Xt||o>Yt)&&(o=Yt),M(r)._overflowWeeks&&o===-1&&(o=ad),M(r)._overflowWeekday&&o===-1&&(o=sd),M(r).overflow=o),r}var fd=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,md=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Vn=/Z|[+-]\d\d(?::?\d\d)?/,Zr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Qn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],gd=/^\/?Date\((-?\d+)/i,No=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,xd={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function wo(r){var o,d,h=r._i,x=fd.exec(h)||md.exec(h),D,se,Me,qe,at=Zr.length,ca=Qn.length;if(x){for(M(r).iso=!0,o=0,d=at;o<d;o++)if(Zr[o][1].exec(x[1])){se=Zr[o][0],D=Zr[o][2]!==!1;break}if(se==null){r._isValid=!1;return}if(x[3]){for(o=0,d=ca;o<d;o++)if(Qn[o][1].exec(x[3])){Me=(x[2]||" ")+Qn[o][0];break}if(Me==null){r._isValid=!1;return}}if(!D&&Me!=null){r._isValid=!1;return}if(x[4])if(Vn.exec(x[4]))qe="Z";else{r._isValid=!1;return}r._f=se+(Me||"")+(qe||""),Xr(r)}else r._isValid=!1}function pd(r,o,d,h,x,D){var se=[yd(r),co.indexOf(o),parseInt(d,10),parseInt(h,10),parseInt(x,10)];return D&&se.push(parseInt(D,10)),se}function yd(r){var o=parseInt(r,10);return o<=49?2e3+o:o<=999?1900+o:o}function bd(r){return r.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function vd(r,o,d){if(r){var h=Br.indexOf(r),x=new Date(o[0],o[1],o[2]).getDay();if(h!==x)return M(d).weekdayMismatch=!0,d._isValid=!1,!1}return!0}function jd(r,o,d){if(r)return xd[r];if(o)return 0;var h=parseInt(d,10),x=h%100,D=(h-x)/100;return D*60+x}function ko(r){var o=No.exec(bd(r._i)),d;if(o){if(d=pd(o[4],o[3],o[2],o[5],o[6],o[7]),!vd(o[1],d,r))return;r._a=d,r._tzm=jd(o[8],o[9],o[10]),r._d=Ps.apply(null,r._a),r._d.setUTCMinutes(r._d.getUTCMinutes()-r._tzm),M(r).rfc2822=!0}else r._isValid=!1}function Nd(r){var o=gd.exec(r._i);if(o!==null){r._d=new Date(+o[1]);return}if(wo(r),r._isValid===!1)delete r._isValid;else return;if(ko(r),r._isValid===!1)delete r._isValid;else return;r._strict?r._isValid=!1:f.createFromInputFallback(r)}f.createFromInputFallback=ye("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(r){r._d=new Date(r._i+(r._useUTC?" UTC":""))});function Ys(r,o,d){return r??o??d}function ur(r){var o=new Date(f.now());return r._useUTC?[o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()]:[o.getFullYear(),o.getMonth(),o.getDate()]}function Zn(r){var o,d,h=[],x,D,se;if(!r._d){for(x=ur(r),r._w&&r._a[Yt]==null&&r._a[La]==null&&_o(r),r._dayOfYear!=null&&(se=Ys(r._a[Xt],x[Xt]),(r._dayOfYear>Nl(se)||r._dayOfYear===0)&&(M(r)._overflowDayOfYear=!0),d=Ps(se,0,r._dayOfYear),r._a[La]=d.getUTCMonth(),r._a[Yt]=d.getUTCDate()),o=0;o<3&&r._a[o]==null;++o)r._a[o]=h[o]=x[o];for(;o<7;o++)r._a[o]=h[o]=r._a[o]==null?o===2?1:0:r._a[o];r._a[Xe]===24&&r._a[Et]===0&&r._a[ga]===0&&r._a[fs]===0&&(r._nextDay=!0,r._a[Xe]=0),r._d=(r._useUTC?Ps:Ya).apply(null,h),D=r._useUTC?r._d.getUTCDay():r._d.getDay(),r._tzm!=null&&r._d.setUTCMinutes(r._d.getUTCMinutes()-r._tzm),r._nextDay&&(r._a[Xe]=24),r._w&&typeof r._w.d<"u"&&r._w.d!==D&&(M(r).weekdayMismatch=!0)}}function _o(r){var o,d,h,x,D,se,Me,qe,at;o=r._w,o.GG!=null||o.W!=null||o.E!=null?(D=1,se=4,d=Ys(o.GG,r._a[Xt],es(_t(),1,4).year),h=Ys(o.W,1),x=Ys(o.E,1),(x<1||x>7)&&(qe=!0)):(D=r._locale._week.dow,se=r._locale._week.doy,at=es(_t(),D,se),d=Ys(o.gg,r._a[Xt],at.year),h=Ys(o.w,at.week),o.d!=null?(x=o.d,(x<0||x>6)&&(qe=!0)):o.e!=null?(x=o.e+D,(o.e<0||o.e>6)&&(qe=!0)):x=D),h<1||h>ts(d,D,se)?M(r)._overflowWeeks=!0:qe!=null?M(r)._overflowWeekday=!0:(Me=qr(d,h,x,D,se),r._a[Xt]=Me.year,r._dayOfYear=Me.dayOfYear)}f.ISO_8601=function(){},f.RFC_2822=function(){};function Xr(r){if(r._f===f.ISO_8601){wo(r);return}if(r._f===f.RFC_2822){ko(r);return}r._a=[],M(r).empty=!0;var o=""+r._i,d,h,x,D,se,Me=o.length,qe=0,at,ca;for(x=k(r._f,r._locale).match(w)||[],ca=x.length,d=0;d<ca;d++)D=x[d],h=(o.match(Ot(D,r))||[])[0],h&&(se=o.substr(0,o.indexOf(h)),se.length>0&&M(r).unusedInput.push(se),o=o.slice(o.indexOf(h)+h.length),qe+=h.length),xe[D]?(h?M(r).empty=!1:M(r).unusedTokens.push(D),zr(D,h,r)):r._strict&&!h&&M(r).unusedTokens.push(D);M(r).charsLeftOver=Me-qe,o.length>0&&M(r).unusedInput.push(o),r._a[Xe]<=12&&M(r).bigHour===!0&&r._a[Xe]>0&&(M(r).bigHour=void 0),M(r).parsedDateParts=r._a.slice(0),M(r).meridiem=r._meridiem,r._a[Xe]=So(r._locale,r._a[Xe],r._meridiem),at=M(r).era,at!==null&&(r._a[Xt]=r._locale.erasConvertYear(at,r._a[Xt])),Zn(r),Gn(r)}function So(r,o,d){var h;return d==null?o:r.meridiemHour!=null?r.meridiemHour(o,d):(r.isPM!=null&&(h=r.isPM(d),h&&o<12&&(o+=12),!h&&o===12&&(o=0)),o)}function Do(r){var o,d,h,x,D,se,Me=!1,qe=r._f.length;if(qe===0){M(r).invalidFormat=!0,r._d=new Date(NaN);return}for(x=0;x<qe;x++)D=0,se=!1,o=pe({},r),r._useUTC!=null&&(o._useUTC=r._useUTC),o._f=r._f[x],Xr(o),j(o)&&(se=!0),D+=M(o).charsLeftOver,D+=M(o).unusedTokens.length*10,M(o).score=D,Me?D<h&&(h=D,d=o):(h==null||D<h||se)&&(h=D,d=o,se&&(Me=!0));X(r,d||o)}function Mo(r){if(!r._d){var o=ea(r._i),d=o.day===void 0?o.date:o.day;r._a=Z([o.year,o.month,d,o.hour,o.minute,o.second,o.millisecond],function(h){return h&&parseInt(h,10)}),Zn(r)}}function Al(r){var o=new z(Gn(Co(r)));return o._nextDay&&(o.add(1,"d"),o._nextDay=void 0),o}function Co(r){var o=r._i,d=r._f;return r._locale=r._locale||as(r._l),o===null||d===void 0&&o===""?R({nullInput:!0}):(typeof o=="string"&&(r._i=o=r._locale.preparse(o)),F(o)?new z(Gn(o)):(O(o)?r._d=o:v(d)?Do(r):d?Xr(r):wd(r),j(r)||(r._d=null),r))}function wd(r){var o=r._i;_(o)?r._d=new Date(f.now()):O(o)?r._d=new Date(o.valueOf()):typeof o=="string"?Nd(r):v(o)?(r._a=Z(o.slice(0),function(d){return parseInt(d,10)}),Zn(r)):H(o)?Mo(r):G(o)?r._d=new Date(o):f.createFromInputFallback(r)}function To(r,o,d,h,x){var D={};return(o===!0||o===!1)&&(h=o,o=void 0),(d===!0||d===!1)&&(h=d,d=void 0),(H(r)&&T(r)||v(r)&&r.length===0)&&(r=void 0),D._isAMomentObject=!0,D._useUTC=D._isUTC=x,D._l=d,D._i=r,D._f=o,D._strict=h,Al(D)}function _t(r,o,d,h){return To(r,o,d,h,!1)}var Oo=ye("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var r=_t.apply(null,arguments);return this.isValid()&&r.isValid()?r<this?this:r:R()}),hr=ye("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var r=_t.apply(null,arguments);return this.isValid()&&r.isValid()?r>this?this:r:R()});function Yl(r,o){var d,h;if(o.length===1&&v(o[0])&&(o=o[0]),!o.length)return _t();for(d=o[0],h=1;h<o.length;++h)(!o[h].isValid()||o[h][r](d))&&(d=o[h]);return d}function kd(){var r=[].slice.call(arguments,0);return Yl("isBefore",r)}function Fr(){var r=[].slice.call(arguments,0);return Yl("isAfter",r)}var Eo=function(){return Date.now?Date.now():+new Date},zl=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Xn(r){var o,d=!1,h,x=zl.length;for(o in r)if(S(r,o)&&!(Ut.call(zl,o)!==-1&&(r[o]==null||!isNaN(r[o]))))return!1;for(h=0;h<x;++h)if(r[zl[h]]){if(d)return!1;parseFloat(r[zl[h]])!==Ke(r[zl[h]])&&(d=!0)}return!0}function Fn(){return this._isValid}function Lo(){return ja(NaN)}function fr(r){var o=ea(r),d=o.year||0,h=o.quarter||0,x=o.month||0,D=o.week||o.isoWeek||0,se=o.day||0,Me=o.hour||0,qe=o.minute||0,at=o.second||0,ca=o.millisecond||0;this._isValid=Xn(o),this._milliseconds=+ca+at*1e3+qe*6e4+Me*1e3*60*60,this._days=+se+D*7,this._months=+x+h*3+d*12,this._data={},this._locale=as(),this._bubble()}function mr(r){return r instanceof fr}function Wn(r){return r<0?Math.round(-1*r)*-1:Math.round(r)}function _d(r,o,d){var h=Math.min(r.length,o.length),x=Math.abs(r.length-o.length),D=0,se;for(se=0;se<h;se++)Ke(r[se])!==Ke(o[se])&&D++;return D+x}function Ao(r,o){ee(r,0,0,function(){var d=this.utcOffset(),h="+";return d<0&&(d=-d,h="-"),h+De(~~(d/60),2)+o+De(~~d%60,2)})}Ao("Z",":"),Ao("ZZ",""),je("Z",Ye),je("ZZ",Ye),ht(["Z","ZZ"],function(r,o,d){d._useUTC=!0,d._tzm=Jn(Ye,r)});var Sd=/([\+\-]|\d\d)/gi;function Jn(r,o){var d=(o||"").match(r),h,x,D;return d===null?null:(h=d[d.length-1]||[],x=(h+"").match(Sd)||["-",0,0],D=+(x[1]*60)+Ke(x[2]),D===0?0:x[0]==="+"?D:-D)}function na(r,o){var d,h;return o._isUTC?(d=o.clone(),h=(F(r)||O(r)?r.valueOf():_t(r).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+h),f.updateOffset(d,!1),d):_t(r).local()}function el(r){return-Math.round(r._d.getTimezoneOffset())}f.updateOffset=function(){};function Yo(r,o,d){var h=this._offset||0,x;if(!this.isValid())return r!=null?this:NaN;if(r!=null){if(typeof r=="string"){if(r=Jn(Ye,r),r===null)return this}else Math.abs(r)<16&&!d&&(r=r*60);return!this._isUTC&&o&&(x=el(this)),this._offset=r,this._isUTC=!0,x!=null&&this.add(x,"m"),h!==r&&(!o||this._changeInProgress?ai(this,ja(r-h,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,f.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?h:el(this)}function zo(r,o){return r!=null?(typeof r!="string"&&(r=-r),this.utcOffset(r,o),this):-this.utcOffset()}function Ro(r){return this.utcOffset(0,r)}function Uo(r){return this._isUTC&&(this.utcOffset(0,r),this._isUTC=!1,r&&this.subtract(el(this),"m")),this}function Kn(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var r=Jn(tt,this._i);r!=null?this.utcOffset(r):this.utcOffset(0,!0)}return this}function Dd(r){return this.isValid()?(r=r?_t(r).utcOffset():0,(this.utcOffset()-r)%60===0):!1}function Rl(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function In(){if(!_(this._isDSTShifted))return this._isDSTShifted;var r={},o;return pe(r,this),r=Co(r),r._a?(o=r._isUTC?V(r._a):_t(r._a),this._isDSTShifted=this.isValid()&&_d(r._a,o.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function gr(){return this.isValid()?!this._isUTC:!1}function Pn(){return this.isValid()?this._isUTC:!1}function ei(){return this.isValid()?this._isUTC&&this._offset===0:!1}var tl=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ul=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ja(r,o){var d=r,h=null,x,D,se;return mr(r)?d={ms:r._milliseconds,d:r._days,M:r._months}:G(r)||!isNaN(+r)?(d={},o?d[o]=+r:d.milliseconds=+r):(h=tl.exec(r))?(x=h[1]==="-"?-1:1,d={y:0,d:Ke(h[Yt])*x,h:Ke(h[Xe])*x,m:Ke(h[Et])*x,s:Ke(h[ga])*x,ms:Ke(Wn(h[fs]*1e3))*x}):(h=Ul.exec(r))?(x=h[1]==="-"?-1:1,d={y:zs(h[2],x),M:zs(h[3],x),w:zs(h[4],x),d:zs(h[5],x),h:zs(h[6],x),m:zs(h[7],x),s:zs(h[8],x)}):d==null?d={}:typeof d=="object"&&("from"in d||"to"in d)&&(se=Ho(_t(d.from),_t(d.to)),d={},d.ms=se.milliseconds,d.M=se.months),D=new fr(d),mr(r)&&S(r,"_locale")&&(D._locale=r._locale),mr(r)&&S(r,"_isValid")&&(D._isValid=r._isValid),D}ja.fn=fr.prototype,ja.invalid=Lo;function zs(r,o){var d=r&&parseFloat(r.replace(",","."));return(isNaN(d)?0:d)*o}function Rs(r,o){var d={};return d.months=o.month()-r.month()+(o.year()-r.year())*12,r.clone().add(d.months,"M").isAfter(o)&&--d.months,d.milliseconds=+o-+r.clone().add(d.months,"M"),d}function Ho(r,o){var d;return r.isValid()&&o.isValid()?(o=na(o,r),r.isBefore(o)?d=Rs(r,o):(d=Rs(o,r),d.milliseconds=-d.milliseconds,d.months=-d.months),d):{milliseconds:0,months:0}}function ti(r,o){return function(d,h){var x,D;return h!==null&&!isNaN(+h)&&(E(o,"moment()."+o+"(period, number) is deprecated. Please use moment()."+o+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),D=d,d=h,h=D),x=ja(d,h),ai(this,x,r),this}}function ai(r,o,d,h){var x=o._milliseconds,D=Wn(o._days),se=Wn(o._months);r.isValid()&&(h=h??!0,se&&En(r,Pa(r,"Month")+se*d),D&&kl(r,"Date",Pa(r,"Date")+D*d),x&&r._d.setTime(r._d.valueOf()+x*d),h&&f.updateOffset(r,D||se))}var Md=ti(1,"add"),Cd=ti(-1,"subtract");function qo(r){return typeof r=="string"||r instanceof String}function Bo(r){return F(r)||O(r)||qo(r)||G(r)||si(r)||$o(r)||r===null||r===void 0}function $o(r){var o=H(r)&&!T(r),d=!1,h=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],x,D,se=h.length;for(x=0;x<se;x+=1)D=h[x],d=d||S(r,D);return o&&d}function si(r){var o=v(r),d=!1;return o&&(d=r.filter(function(h){return!G(h)&&qo(r)}).length===0),o&&d}function Xa(r){var o=H(r)&&!T(r),d=!1,h=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],x,D;for(x=0;x<h.length;x+=1)D=h[x],d=d||S(r,D);return o&&d}function Wr(r,o){var d=r.diff(o,"days",!0);return d<-6?"sameElse":d<-1?"lastWeek":d<0?"lastDay":d<1?"sameDay":d<2?"nextDay":d<7?"nextWeek":"sameElse"}function za(r,o){arguments.length===1&&(arguments[0]?Bo(arguments[0])?(r=arguments[0],o=void 0):Xa(arguments[0])&&(o=arguments[0],r=void 0):(r=void 0,o=void 0));var d=r||_t(),h=na(d,this).startOf("day"),x=f.calendarFormat(this,h)||"sameElse",D=o&&(fe(o[x])?o[x].call(this,d):o[x]);return this.format(D||this.localeData().calendar(x,this,_t(d)))}function Hl(){return new z(this)}function li(r,o){var d=F(r)?r:_t(r);return this.isValid()&&d.isValid()?(o=bt(o)||"millisecond",o==="millisecond"?this.valueOf()>d.valueOf():d.valueOf()<this.clone().startOf(o).valueOf()):!1}function Jr(r,o){var d=F(r)?r:_t(r);return this.isValid()&&d.isValid()?(o=bt(o)||"millisecond",o==="millisecond"?this.valueOf()<d.valueOf():this.clone().endOf(o).valueOf()<d.valueOf()):!1}function Kr(r,o,d,h){var x=F(r)?r:_t(r),D=F(o)?o:_t(o);return this.isValid()&&x.isValid()&&D.isValid()?(h=h||"()",(h[0]==="("?this.isAfter(x,d):!this.isBefore(x,d))&&(h[1]===")"?this.isBefore(D,d):!this.isAfter(D,d))):!1}function ri(r,o){var d=F(r)?r:_t(r),h;return this.isValid()&&d.isValid()?(o=bt(o)||"millisecond",o==="millisecond"?this.valueOf()===d.valueOf():(h=d.valueOf(),this.clone().startOf(o).valueOf()<=h&&h<=this.clone().endOf(o).valueOf())):!1}function al(r,o){return this.isSame(r,o)||this.isAfter(r,o)}function Go(r,o){return this.isSame(r,o)||this.isBefore(r,o)}function Ir(r,o,d){var h,x,D;if(!this.isValid())return NaN;if(h=na(r,this),!h.isValid())return NaN;switch(x=(h.utcOffset()-this.utcOffset())*6e4,o=bt(o),o){case"year":D=ys(this,h)/12;break;case"month":D=ys(this,h);break;case"quarter":D=ys(this,h)/3;break;case"second":D=(this-h)/1e3;break;case"minute":D=(this-h)/6e4;break;case"hour":D=(this-h)/36e5;break;case"day":D=(this-h-x)/864e5;break;case"week":D=(this-h-x)/6048e5;break;default:D=this-h}return d?D:Zt(D)}function ys(r,o){if(r.date()<o.date())return-ys(o,r);var d=(o.year()-r.year())*12+(o.month()-r.month()),h=r.clone().add(d,"months"),x,D;return o-h<0?(x=r.clone().add(d-1,"months"),D=(o-h)/(h-x)):(x=r.clone().add(d+1,"months"),D=(o-h)/(x-h)),-(d+D)||0}f.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",f.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Td(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Na(r){if(!this.isValid())return null;var o=r!==!0,d=o?this.clone().utc():this;return d.year()<0||d.year()>9999?Be(d,o?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):fe(Date.prototype.toISOString)?o?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Be(d,"Z")):Be(d,o?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ni(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var r="moment",o="",d,h,x,D;return this.isLocal()||(r=this.utcOffset()===0?"moment.utc":"moment.parseZone",o="Z"),d="["+r+'("]',h=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",x="-MM-DD[T]HH:mm:ss.SSS",D=o+'[")]',this.format(d+h+x+D)}function bs(r){r||(r=this.isUtc()?f.defaultFormatUtc:f.defaultFormat);var o=Be(this,r);return this.localeData().postformat(o)}function Vo(r,o){return this.isValid()&&(F(r)&&r.isValid()||_t(r).isValid())?ja({to:this,from:r}).locale(this.locale()).humanize(!o):this.localeData().invalidDate()}function Pr(r){return this.from(_t(),r)}function sl(r,o){return this.isValid()&&(F(r)&&r.isValid()||_t(r).isValid())?ja({from:this,to:r}).locale(this.locale()).humanize(!o):this.localeData().invalidDate()}function ii(r){return this.to(_t(),r)}function oi(r){var o;return r===void 0?this._locale._abbr:(o=as(r),o!=null&&(this._locale=o),this)}var en=ye("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(r){return r===void 0?this.localeData():this.locale(r)});function ci(){return this._locale}var ia=1e3,Fa=60*ia,vs=60*Fa,xr=(365*400+97)*24*vs;function ss(r,o){return(r%o+o)%o}function wa(r,o,d){return r<100&&r>=0?new Date(r+400,o,d)-xr:new Date(r,o,d).valueOf()}function ka(r,o,d){return r<100&&r>=0?Date.UTC(r+400,o,d)-xr:Date.UTC(r,o,d)}function Us(r){var o,d;if(r=bt(r),r===void 0||r==="millisecond"||!this.isValid())return this;switch(d=this._isUTC?ka:wa,r){case"year":o=d(this.year(),0,1);break;case"quarter":o=d(this.year(),this.month()-this.month()%3,1);break;case"month":o=d(this.year(),this.month(),1);break;case"week":o=d(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":o=d(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":o=d(this.year(),this.month(),this.date());break;case"hour":o=this._d.valueOf(),o-=ss(o+(this._isUTC?0:this.utcOffset()*Fa),vs);break;case"minute":o=this._d.valueOf(),o-=ss(o,Fa);break;case"second":o=this._d.valueOf(),o-=ss(o,ia);break}return this._d.setTime(o),f.updateOffset(this,!0),this}function ls(r){var o,d;if(r=bt(r),r===void 0||r==="millisecond"||!this.isValid())return this;switch(d=this._isUTC?ka:wa,r){case"year":o=d(this.year()+1,0,1)-1;break;case"quarter":o=d(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":o=d(this.year(),this.month()+1,1)-1;break;case"week":o=d(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":o=d(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":o=d(this.year(),this.month(),this.date()+1)-1;break;case"hour":o=this._d.valueOf(),o+=vs-ss(o+(this._isUTC?0:this.utcOffset()*Fa),vs)-1;break;case"minute":o=this._d.valueOf(),o+=Fa-ss(o,Fa)-1;break;case"second":o=this._d.valueOf(),o+=ia-ss(o,ia)-1;break}return this._d.setTime(o),f.updateOffset(this,!0),this}function rs(){return this._d.valueOf()-(this._offset||0)*6e4}function js(){return Math.floor(this.valueOf()/1e3)}function Qo(){return new Date(this.valueOf())}function di(){var r=this;return[r.year(),r.month(),r.date(),r.hour(),r.minute(),r.second(),r.millisecond()]}function ui(){var r=this;return{years:r.year(),months:r.month(),date:r.date(),hours:r.hours(),minutes:r.minutes(),seconds:r.seconds(),milliseconds:r.milliseconds()}}function Zo(){return this.isValid()?this.toISOString():null}function aa(){return j(this)}function Mt(){return X({},M(this))}function lt(){return M(this).overflow}function Hs(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ee("N",0,0,"eraAbbr"),ee("NN",0,0,"eraAbbr"),ee("NNN",0,0,"eraAbbr"),ee("NNNN",0,0,"eraName"),ee("NNNNN",0,0,"eraNarrow"),ee("y",["y",1],"yo","eraYear"),ee("y",["yy",2],0,"eraYear"),ee("y",["yyy",3],0,"eraYear"),ee("y",["yyyy",4],0,"eraYear"),je("N",Ns),je("NN",Ns),je("NNN",Ns),je("NNNN",ws),je("NNNNN",Bs),ht(["N","NN","NNN","NNNN","NNNNN"],function(r,o,d,h){var x=d._locale.erasParse(r,h,d._strict);x?M(d).era=x:M(d).invalidEra=r}),je("y",kt),je("yy",kt),je("yyy",kt),je("yyyy",kt),je("yo",ks),ht(["y","yy","yyy","yyyy"],Xt),ht(["yo"],function(r,o,d,h){var x;d._locale._eraYearOrdinalRegex&&(x=r.match(d._locale._eraYearOrdinalRegex)),d._locale.eraYearOrdinalParse?o[Xt]=d._locale.eraYearOrdinalParse(r,x):o[Xt]=parseInt(r,10)});function Ra(r,o){var d,h,x,D=this._eras||as("en")._eras;for(d=0,h=D.length;d<h;++d){switch(typeof D[d].since){case"string":x=f(D[d].since).startOf("day"),D[d].since=x.valueOf();break}switch(typeof D[d].until){case"undefined":D[d].until=1/0;break;case"string":x=f(D[d].until).startOf("day").valueOf(),D[d].until=x.valueOf();break}}return D}function hi(r,o,d){var h,x,D=this.eras(),se,Me,qe;for(r=r.toUpperCase(),h=0,x=D.length;h<x;++h)if(se=D[h].name.toUpperCase(),Me=D[h].abbr.toUpperCase(),qe=D[h].narrow.toUpperCase(),d)switch(o){case"N":case"NN":case"NNN":if(Me===r)return D[h];break;case"NNNN":if(se===r)return D[h];break;case"NNNNN":if(qe===r)return D[h];break}else if([se,Me,qe].indexOf(r)>=0)return D[h]}function qs(r,o){var d=r.since<=r.until?1:-1;return o===void 0?f(r.since).year():f(r.since).year()+(o-r.offset)*d}function Xo(){var r,o,d,h=this.localeData().eras();for(r=0,o=h.length;r<o;++r)if(d=this.clone().startOf("day").valueOf(),h[r].since<=d&&d<=h[r].until||h[r].until<=d&&d<=h[r].since)return h[r].name;return""}function Fo(){var r,o,d,h=this.localeData().eras();for(r=0,o=h.length;r<o;++r)if(d=this.clone().startOf("day").valueOf(),h[r].since<=d&&d<=h[r].until||h[r].until<=d&&d<=h[r].since)return h[r].narrow;return""}function ql(){var r,o,d,h=this.localeData().eras();for(r=0,o=h.length;r<o;++r)if(d=this.clone().startOf("day").valueOf(),h[r].since<=d&&d<=h[r].until||h[r].until<=d&&d<=h[r].since)return h[r].abbr;return""}function ll(){var r,o,d,h,x=this.localeData().eras();for(r=0,o=x.length;r<o;++r)if(d=x[r].since<=x[r].until?1:-1,h=this.clone().startOf("day").valueOf(),x[r].since<=h&&h<=x[r].until||x[r].until<=h&&h<=x[r].since)return(this.year()-f(x[r].since).year())*d+x[r].offset;return this.year()}function fi(r){return S(this,"_erasNameRegex")||yr.call(this),r?this._erasNameRegex:this._erasRegex}function pr(r){return S(this,"_erasAbbrRegex")||yr.call(this),r?this._erasAbbrRegex:this._erasRegex}function mi(r){return S(this,"_erasNarrowRegex")||yr.call(this),r?this._erasNarrowRegex:this._erasRegex}function Ns(r,o){return o.erasAbbrRegex(r)}function ws(r,o){return o.erasNameRegex(r)}function Bs(r,o){return o.erasNarrowRegex(r)}function ks(r,o){return o._eraYearOrdinalRegex||kt}function yr(){var r=[],o=[],d=[],h=[],x,D,se,Me,qe,at=this.eras();for(x=0,D=at.length;x<D;++x)se=ma(at[x].name),Me=ma(at[x].abbr),qe=ma(at[x].narrow),o.push(se),r.push(Me),d.push(qe),h.push(se),h.push(Me),h.push(qe);this._erasRegex=new RegExp("^("+h.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+o.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+d.join("|")+")","i")}ee(0,["gg",2],0,function(){return this.weekYear()%100}),ee(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Bl(r,o){ee(0,[r,r.length],0,o)}Bl("gggg","weekYear"),Bl("ggggg","weekYear"),Bl("GGGG","isoWeekYear"),Bl("GGGGG","isoWeekYear"),je("G",ge),je("g",ge),je("GG",Ge,Ee),je("gg",Ge,Ee),je("GGGG",At,he),je("gggg",At,he),je("GGGGG",Wt,ot),je("ggggg",Wt,ot),Ea(["gggg","ggggg","GGGG","GGGGG"],function(r,o,d,h){o[h.substr(0,2)]=Ke(r)}),Ea(["gg","GG"],function(r,o,d,h){o[h]=f.parseTwoDigitYear(r)});function $l(r){return Jo.call(this,r,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function tn(r){return Jo.call(this,r,this.isoWeek(),this.isoWeekday(),1,4)}function rl(){return ts(this.year(),1,4)}function sa(){return ts(this.isoWeekYear(),1,4)}function an(){var r=this.localeData()._week;return ts(this.year(),r.dow,r.doy)}function Wo(){var r=this.localeData()._week;return ts(this.weekYear(),r.dow,r.doy)}function Jo(r,o,d,h,x){var D;return r==null?es(this,h,x).year:(D=ts(r,h,x),o>D&&(o=D),Od.call(this,r,o,d,h,x))}function Od(r,o,d,h,x){var D=qr(r,o,d,h,x),se=Ps(D.year,0,D.dayOfYear);return this.year(se.getUTCFullYear()),this.month(se.getUTCMonth()),this.date(se.getUTCDate()),this}ee("Q",0,"Qo","quarter"),je("Q",_e),ht("Q",function(r,o){o[La]=(Ke(r)-1)*3});function Ed(r){return r==null?Math.ceil((this.month()+1)/3):this.month((r-1)*3+this.month()%3)}ee("D",["DD",2],"Do","date"),je("D",Ge,$e),je("DD",Ge,Ee),je("Do",function(r,o){return r?o._dayOfMonthOrdinalParse||o._ordinalParse:o._dayOfMonthOrdinalParseLenient}),ht(["D","DD"],Yt),ht("Do",function(r,o){o[Yt]=Ke(r.match(Ge)[0])});var qt=Za("Date",!0);ee("DDD",["DDDD",3],"DDDo","dayOfYear"),je("DDD",ta),je("DDDD",ft),ht(["DDD","DDDD"],function(r,o,d){d._dayOfYear=Ke(r)});function gi(r){var o=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return r==null?o:this.add(r-o,"d")}ee("m",["mm",2],0,"minute"),je("m",Ge,I),je("mm",Ge,Ee),ht(["m","mm"],Et);var br=Za("Minutes",!1);ee("s",["ss",2],0,"second"),je("s",Ge,I),je("ss",Ge,Ee),ht(["s","ss"],ga);var vr=Za("Seconds",!1);ee("S",0,0,function(){return~~(this.millisecond()/100)}),ee(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ee(0,["SSS",3],0,"millisecond"),ee(0,["SSSS",4],0,function(){return this.millisecond()*10}),ee(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ee(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ee(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ee(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ee(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),je("S",ta,_e),je("SS",ta,Ee),je("SSS",ta,ft);var ns,nl;for(ns="SSSS";ns.length<=9;ns+="S")je(ns,kt);function Gl(r,o){o[fs]=Ke(("0."+r)*1e3)}for(ns="S";ns.length<=9;ns+="S")ht(ns,Gl);nl=Za("Milliseconds",!1),ee("z",0,0,"zoneAbbr"),ee("zz",0,0,"zoneName");function Ld(){return this._isUTC?"UTC":""}function Ko(){return this._isUTC?"Coordinated Universal Time":""}var ve=z.prototype;ve.add=Md,ve.calendar=za,ve.clone=Hl,ve.diff=Ir,ve.endOf=ls,ve.format=bs,ve.from=Vo,ve.fromNow=Pr,ve.to=sl,ve.toNow=ii,ve.get=_l,ve.invalidAt=lt,ve.isAfter=li,ve.isBefore=Jr,ve.isBetween=Kr,ve.isSame=ri,ve.isSameOrAfter=al,ve.isSameOrBefore=Go,ve.isValid=aa,ve.lang=en,ve.locale=oi,ve.localeData=ci,ve.max=hr,ve.min=Oo,ve.parsingFlags=Mt,ve.set=Jt,ve.startOf=Us,ve.subtract=Cd,ve.toArray=di,ve.toObject=ui,ve.toDate=Qo,ve.toISOString=Na,ve.inspect=ni,typeof Symbol<"u"&&Symbol.for!=null&&(ve[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ve.toJSON=Zo,ve.toString=Td,ve.unix=js,ve.valueOf=rs,ve.creationData=Hs,ve.eraName=Xo,ve.eraNarrow=Fo,ve.eraAbbr=ql,ve.eraYear=ll,ve.year=wl,ve.isLeapYear=Tn,ve.weekYear=$l,ve.isoWeekYear=tn,ve.quarter=ve.quarters=Ed,ve.month=ho,ve.daysInMonth=Ln,ve.week=ve.weeks=po,ve.isoWeek=ve.isoWeeks=An,ve.weeksInYear=an,ve.weeksInWeekYear=Wo,ve.isoWeeksInYear=rl,ve.isoWeeksInISOWeekYear=sa,ve.date=qt,ve.day=ve.days=ir,ve.weekday=Es,ve.isoWeekday=Un,ve.dayOfYear=gi,ve.hour=ve.hours=Hn,ve.minute=ve.minutes=br,ve.second=ve.seconds=vr,ve.millisecond=ve.milliseconds=nl,ve.utcOffset=Yo,ve.utc=Ro,ve.local=Uo,ve.parseZone=Kn,ve.hasAlignedHourOffset=Dd,ve.isDST=Rl,ve.isLocal=gr,ve.isUtcOffset=Pn,ve.isUtc=ei,ve.isUTC=ei,ve.zoneAbbr=Ld,ve.zoneName=Ko,ve.dates=ye("dates accessor is deprecated. Use date instead.",qt),ve.months=ye("months accessor is deprecated. Use month instead",ho),ve.years=ye("years accessor is deprecated. Use year instead",wl),ve.zone=ye("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",zo),ve.isDSTShifted=ye("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",In);function Io(r){return _t(r*1e3)}function il(){return _t.apply(null,arguments).parseZone()}function sn(r){return r}var rt=B.prototype;rt.calendar=Ae,rt.longDateFormat=ae,rt.invalidDate=we,rt.ordinal=Je,rt.preparse=sn,rt.postformat=sn,rt.relativeTime=$t,rt.pastFuture=Gt,rt.set=be,rt.eras=Ra,rt.erasParse=hi,rt.erasConvertYear=qs,rt.erasAbbrRegex=pr,rt.erasNameRegex=fi,rt.erasNarrowRegex=mi,rt.months=Rr,rt.monthsShort=Ur,rt.monthsParse=Aa,rt.monthsRegex=Hr,rt.monthsShortRegex=fo,rt.week=go,rt.firstDayOfYear=xo,rt.firstDayOfWeek=rd,rt.weekdays=zn,rt.weekdaysMin=nr,rt.weekdaysShort=bo,rt.weekdaysParse=Rn,rt.weekdaysRegex=$r,rt.weekdaysShortRegex=vo,rt.weekdaysMinRegex=Gr,rt.isPM=cr,rt.meridiem=qn;function jr(r,o,d,h){var x=as(),D=V().set(h,o);return x[d](D,r)}function ol(r,o,d){if(G(r)&&(o=r,r=void 0),r=r||"",o!=null)return jr(r,o,d,"month");var h,x=[];for(h=0;h<12;h++)x[h]=jr(r,h,d,"month");return x}function Nr(r,o,d,h){typeof r=="boolean"?(G(o)&&(d=o,o=void 0),o=o||""):(o=r,d=o,r=!1,G(o)&&(d=o,o=void 0),o=o||"");var x=as(),D=r?x._week.dow:0,se,Me=[];if(d!=null)return jr(o,(d+D)%7,h,"day");for(se=0;se<7;se++)Me[se]=jr(o,(se+D)%7,h,"day");return Me}function ln(r,o){return ol(r,o,"months")}function rn(r,o){return ol(r,o,"monthsShort")}function Po(r,o,d){return Nr(r,o,d,"weekdays")}function ec(r,o,d){return Nr(r,o,d,"weekdaysShort")}function cl(r,o,d){return Nr(r,o,d,"weekdaysMin")}As("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(r){var o=r%10,d=Ke(r%100/10)===1?"th":o===1?"st":o===2?"nd":o===3?"rd":"th";return r+d}}),f.lang=ye("moment.lang is deprecated. Use moment.locale instead.",As),f.langData=ye("moment.langData is deprecated. Use moment.localeData instead.",as);var oa=Math.abs;function tc(){var r=this._data;return this._milliseconds=oa(this._milliseconds),this._days=oa(this._days),this._months=oa(this._months),r.milliseconds=oa(r.milliseconds),r.seconds=oa(r.seconds),r.minutes=oa(r.minutes),r.hours=oa(r.hours),r.months=oa(r.months),r.years=oa(r.years),this}function xi(r,o,d,h){var x=ja(o,d);return r._milliseconds+=h*x._milliseconds,r._days+=h*x._days,r._months+=h*x._months,r._bubble()}function Vl(r,o){return xi(this,r,o,1)}function wr(r,o){return xi(this,r,o,-1)}function kr(r){return r<0?Math.floor(r):Math.ceil(r)}function _r(){var r=this._milliseconds,o=this._days,d=this._months,h=this._data,x,D,se,Me,qe;return r>=0&&o>=0&&d>=0||r<=0&&o<=0&&d<=0||(r+=kr(nn(d)+o)*864e5,o=0,d=0),h.milliseconds=r%1e3,x=Zt(r/1e3),h.seconds=x%60,D=Zt(x/60),h.minutes=D%60,se=Zt(D/60),h.hours=se%24,o+=Zt(se/24),qe=Zt(Sr(o)),d+=qe,o-=kr(nn(qe)),Me=Zt(d/12),d%=12,h.days=o,h.months=d,h.years=Me,this}function Sr(r){return r*4800/146097}function nn(r){return r*146097/4800}function dl(r){if(!this.isValid())return NaN;var o,d,h=this._milliseconds;if(r=bt(r),r==="month"||r==="quarter"||r==="year")switch(o=this._days+h/864e5,d=this._months+Sr(o),r){case"month":return d;case"quarter":return d/3;case"year":return d/12}else switch(o=this._days+Math.round(nn(this._months)),r){case"week":return o/7+h/6048e5;case"day":return o+h/864e5;case"hour":return o*24+h/36e5;case"minute":return o*1440+h/6e4;case"second":return o*86400+h/1e3;case"millisecond":return Math.floor(o*864e5)+h;default:throw new Error("Unknown unit "+r)}}function is(r){return function(){return this.as(r)}}var _s=is("ms"),pi=is("s"),yi=is("m"),$s=is("h"),Gs=is("d"),Dr=is("w"),bi=is("M"),vi=is("Q"),Mr=is("y"),Cr=_s;function ac(){return ja(this)}function sc(r){return r=bt(r),this.isValid()?this[r+"s"]():NaN}function Ua(r){return function(){return this.isValid()?this._data[r]:NaN}}var on=Ua("milliseconds"),lc=Ua("seconds"),ji=Ua("minutes"),Ni=Ua("hours"),_a=Ua("days"),Ha=Ua("months"),Vs=Ua("years");function wi(){return Zt(this.days()/7)}var os=Math.round,Sa={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Da(r,o,d,h,x){return x.relativeTime(o||1,!!d,r,h)}function Bt(r,o,d,h){var x=ja(r).abs(),D=os(x.as("s")),se=os(x.as("m")),Me=os(x.as("h")),qe=os(x.as("d")),at=os(x.as("M")),ca=os(x.as("w")),Wa=os(x.as("y")),cs=D<=d.ss&&["s",D]||D<d.s&&["ss",D]||se<=1&&["m"]||se<d.m&&["mm",se]||Me<=1&&["h"]||Me<d.h&&["hh",Me]||qe<=1&&["d"]||qe<d.d&&["dd",qe];return d.w!=null&&(cs=cs||ca<=1&&["w"]||ca<d.w&&["ww",ca]),cs=cs||at<=1&&["M"]||at<d.M&&["MM",at]||Wa<=1&&["y"]||["yy",Wa],cs[2]=o,cs[3]=+r>0,cs[4]=h,Da.apply(null,cs)}function cn(r){return r===void 0?os:typeof r=="function"?(os=r,!0):!1}function Ss(r,o){return Sa[r]===void 0?!1:o===void 0?Sa[r]:(Sa[r]=o,r==="s"&&(Sa.ss=o-1),!0)}function Ve(r,o){if(!this.isValid())return this.localeData().invalidDate();var d=!1,h=Sa,x,D;return typeof r=="object"&&(o=r,r=!1),typeof r=="boolean"&&(d=r),typeof o=="object"&&(h=Object.assign({},Sa,o),o.s!=null&&o.ss==null&&(h.ss=o.s-1)),x=this.localeData(),D=Bt(this,!d,h,x),d&&(D=x.pastFuture(+this,D)),x.postformat(D)}var gt=Math.abs;function Ct(r){return(r>0)-(r<0)||+r}function ul(){if(!this.isValid())return this.localeData().invalidDate();var r=gt(this._milliseconds)/1e3,o=gt(this._days),d=gt(this._months),h,x,D,se,Me=this.asSeconds(),qe,at,ca,Wa;return Me?(h=Zt(r/60),x=Zt(h/60),r%=60,h%=60,D=Zt(d/12),d%=12,se=r?r.toFixed(3).replace(/\.?0+$/,""):"",qe=Me<0?"-":"",at=Ct(this._months)!==Ct(Me)?"-":"",ca=Ct(this._days)!==Ct(Me)?"-":"",Wa=Ct(this._milliseconds)!==Ct(Me)?"-":"",qe+"P"+(D?at+D+"Y":"")+(d?at+d+"M":"")+(o?ca+o+"D":"")+(x||h||r?"T":"")+(x?Wa+x+"H":"")+(h?Wa+h+"M":"")+(r?Wa+se+"S":"")):"P0D"}var Ie=fr.prototype;Ie.isValid=Fn,Ie.abs=tc,Ie.add=Vl,Ie.subtract=wr,Ie.as=dl,Ie.asMilliseconds=_s,Ie.asSeconds=pi,Ie.asMinutes=yi,Ie.asHours=$s,Ie.asDays=Gs,Ie.asWeeks=Dr,Ie.asMonths=bi,Ie.asQuarters=vi,Ie.asYears=Mr,Ie.valueOf=Cr,Ie._bubble=_r,Ie.clone=ac,Ie.get=sc,Ie.milliseconds=on,Ie.seconds=lc,Ie.minutes=ji,Ie.hours=Ni,Ie.days=_a,Ie.weeks=wi,Ie.months=Ha,Ie.years=Vs,Ie.humanize=Ve,Ie.toISOString=ul,Ie.toString=ul,Ie.toJSON=ul,Ie.locale=oi,Ie.localeData=ci,Ie.toIsoString=ye("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ul),Ie.lang=en,ee("X",0,0,"unix"),ee("x",0,0,"valueOf"),je("x",ge),je("X",Ze),ht("X",function(r,o,d){d._d=new Date(parseFloat(r)*1e3)}),ht("x",function(r,o,d){d._d=new Date(Ke(r))});//! moment.js
return f.version="2.30.1",g(_t),f.fn=ve,f.min=kd,f.max=Fr,f.now=Eo,f.utc=V,f.unix=Io,f.months=ln,f.isDate=O,f.locale=As,f.invalid=R,f.duration=ja,f.isMoment=F,f.weekdays=Po,f.parseZone=il,f.localeData=as,f.isDuration=mr,f.monthsShort=rn,f.weekdaysMin=cl,f.defineLocale=$n,f.updateLocale=ud,f.locales=hd,f.weekdaysShort=ec,f.normalizeUnits=bt,f.relativeTimeRounding=cn,f.relativeTimeThreshold=Ss,f.calendarFormat=Wr,f.prototype=ve,f.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},f}))})(Pc)),Pc.exports}var th,S0;function Mp(){if(S0)return th;S0=1,th={toJalaali:b,toGregorian:N,isValidJalaaliDate:f,isLeapJalaaliYear:g,jalaaliMonthLength:v,jalCal:S,j2d:T,d2j:_,g2d:G,d2g:O,jalaaliToDateObject:X,jalaaliWeek:Z};var c=[-61,9,38,199,426,686,756,818,1111,1181,1210,1635,2060,2097,2192,2262,2324,2394,2456,3178];function b(M,m,j){return Object.prototype.toString.call(M)==="[object Date]"&&(j=M.getDate(),m=M.getMonth()+1,M=M.getFullYear()),_(G(M,m,j))}function N(M,m,j){return O(T(M,m,j))}function f(M,m,j){return M>=-61&&M<=3177&&m>=1&&m<=12&&j>=1&&j<=v(M,m)}function g(M){return H(M)===0}function v(M,m){return m<=6?31:m<=11||g(M)?30:29}function H(M){var m=c.length,j=c[0],R,U,de,pe,z;if(M<j||M>=c[m-1])throw new Error("Invalid Jalaali year "+M);for(z=1;z<m&&(R=c[z],U=R-j,!(M<R));z+=1)j=R;return pe=M-j,U-pe<6&&(pe=pe-U+V(U+4,33)*33),de=Q(Q(pe+1,33)-1,4),de===-1&&(de=4),de}function S(M,m){var j=c.length,R=M+621,U=-14,de=c[0],pe,z,F,ke,ye,ne,E;if(M<de||M>=c[j-1])throw new Error("Invalid Jalaali year "+M);for(E=1;E<j&&(pe=c[E],z=pe-de,!(M<pe));E+=1)U=U+V(z,33)*8+V(Q(z,33),4),de=pe;return ne=M-de,U=U+V(ne,33)*8+V(Q(ne,33)+3,4),Q(z,33)===4&&z-ne===4&&(U+=1),ke=V(R,4)-V((V(R,100)+1)*3,4)-150,ye=20+U-ke,m?{gy:R,march:ye}:(z-ne<6&&(ne=ne-z+V(z+4,33)*33),F=Q(Q(ne+1,33)-1,4),F===-1&&(F=4),{leap:F,gy:R,march:ye})}function T(M,m,j){var R=S(M,!0);return G(R.gy,3,R.march)+(m-1)*31-V(m,7)*(m-7)+j-1}function _(M){var m=O(M).gy,j=m-621,R=S(j,!1),U=G(m,3,R.march),de,pe,z;if(z=M-U,z>=0){if(z<=185)return pe=1+V(z,31),de=Q(z,31)+1,{jy:j,jm:pe,jd:de};z-=186}else j-=1,z+=179,R.leap===1&&(z+=1);return pe=7+V(z,30),de=Q(z,30)+1,{jy:j,jm:pe,jd:de}}function G(M,m,j){var R=V((M+V(m-8,6)+100100)*1461,4)+V(153*Q(m+9,12)+2,5)+j-34840408;return R=R-V(V(M+100100+V(m-8,6),100)*3,4)+752,R}function O(M){var m,j,R,U,de;return m=4*M+139361631,m=m+V(V(4*M+183187720,146097)*3,4)*4-3908,j=V(Q(m,1461),4)*5+308,R=V(Q(j,153),5)+1,U=Q(V(j,153),12)+1,de=V(m,1461)-100100+V(8-U,6),{gy:de,gm:U,gd:R}}function Z(M,m,j){var R=X(M,m,j).getDay(),U=R==6?0:-(R+1),de=6+U;return{saturday:_(T(M,m,j+U)),friday:_(T(M,m,j+de))}}function X(M,m,j,R,U,de,pe){var z=N(M,m,j);return new Date(z.gy,z.gm-1,z.gd,R||0,U||0,de||0,pe||0)}function V(M,m){return~~(M/m)}function Q(M,m){return M-~~(M/m)*m}return th}var ah,D0;function Cp(){if(D0)return ah;D0=1,ah=K;var c=Dp(),b=Mp(),N=/(\[[^\[]*\])|(\\)?j(Mo|MM?M?M?|Do|DDDo|DD?D?D?|w[o|w]?|YYYYY|YYYY|YY|gg(ggg?)?|)|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,f=/(\[[^\[]*\])|(\\)?(LTS?|LL?L?L?|l{1,4})/g,g=/\d\d?/,v=/\d{1,3}/,H=/\d{3}/,S=/\d{1,4}/,T=/[+\-]?\d{1,6}/,_=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,G=/Z|[\+\-]\d\d:?\d\d/i,O=/T/i,Z=/[\+\-]?\d+(\.\d{1,3})?/,X={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},V={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},Q={jm:"jmonth",jmonths:"jmonth",jy:"jyear",jyears:"jyear"},M={},m="DDD w M D".split(" "),j="M D w".split(" "),R={jM:function(){return this.jMonth()+1},jMMM:function(k){return this.localeData().jMonthsShort(this,k)},jMMMM:function(k){return this.localeData().jMonths(this,k)},jD:function(){return this.jDate()},jDDD:function(){return this.jDayOfYear()},jw:function(){return this.jWeek()},jYY:function(){return z(this.jYear()%100,2)},jYYYY:function(){return z(this.jYear(),4)},jYYYYY:function(){return z(this.jYear(),5)},jgg:function(){return z(this.jWeekYear()%100,2)},jgggg:function(){return this.jWeekYear()},jggggg:function(){return z(this.jWeekYear(),5)}};function U(k,A){return function(ae){return z(k.call(this,ae),A)}}function de(k,A){return function(ae){return this.localeData().ordinal(k.call(this,ae),A)}}(function(){for(var k;m.length;)k=m.pop(),R["j"+k+"o"]=de(R["j"+k],k);for(;j.length;)k=j.pop(),R["j"+k+k]=U(R["j"+k],2);R.jDDDD=U(R.jDDD,3)})();function pe(k,A){var ae;for(ae in A)A.hasOwnProperty(ae)&&(k[ae]=A[ae]);return k}function z(k,A){for(var ae=k+"";ae.length<A;)ae="0"+ae;return ae}function F(k){return Object.prototype.toString.call(k)==="[object Array]"}function ke(k){if(k){var A=k.toLowerCase();k=Q[A]||A}return k}function ye(k,A,ae,ie){var we=k._d;isNaN(A)&&(k._isValid=!1),k._isUTC?k._d=new Date(Date.UTC(A,ae,ie,we.getUTCHours(),we.getUTCMinutes(),we.getUTCSeconds(),we.getUTCMilliseconds())):k._d=new Date(A,ae,ie,we.getHours(),we.getMinutes(),we.getSeconds(),we.getMilliseconds())}function ne(k){function A(){}return A.prototype=k,new A}function E(k){return Object.getPrototypeOf?Object.getPrototypeOf(k):"".__proto__?k.__proto__:k.constructor.prototype}pe(E(c.localeData()),{_jMonths:["Farvardin","Ordibehesht","Khordaad","Tir","Amordaad","Shahrivar","Mehr","Aabaan","Aazar","Dey","Bahman","Esfand"],jMonths:function(k){return this._jMonths[k.jMonth()]},_jMonthsShort:["Far","Ord","Kho","Tir","Amo","Sha","Meh","Aab","Aaz","Dey","Bah","Esf"],jMonthsShort:function(k){return this._jMonthsShort[k.jMonth()]},jMonthsParse:function(k){var A,ae,ie;for(this._jMonthsParse||(this._jMonthsParse=[]),A=0;A<12;A+=1)if(this._jMonthsParse[A]||(ae=K([2e3,(2+A)%12,25]),ie="^"+this.jMonths(ae,"")+"|^"+this.jMonthsShort(ae,""),this._jMonthsParse[A]=new RegExp(ie.replace(".",""),"i")),this._jMonthsParse[A].test(k))return A}});function fe(k){var A=k.match(N),ae=A.length,ie;for(ie=0;ie<ae;ie+=1)R[A[ie]]&&(A[ie]=R[A[ie]]);return function(we){var Ce="";for(ie=0;ie<ae;ie+=1)Ce+=A[ie]instanceof Function?"["+A[ie].call(we,k)+"]":A[ie];return Ce}}function be(k,A){switch(k){case"jDDDD":return H;case"jYYYY":return S;case"jYYYYY":return T;case"jDDD":return v;case"jMMM":case"jMMMM":return _;case"jMM":case"jDD":case"jYY":case"jM":case"jD":return g;case"DDDD":return H;case"YYYY":return S;case"YYYYY":return T;case"S":case"SS":case"SSS":case"DDD":return v;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return _;case"a":case"A":return c.localeData(A._l)._meridiemParse;case"X":return Z;case"Z":case"ZZ":return G;case"T":return O;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return g;default:return new RegExp(k.replace("\\",""))}}function me(k,A,ae){var ie,we=ae._a;switch(k){case"jM":case"jMM":we[1]=A==null?0:~~A-1;break;case"jMMM":case"jMMMM":ie=c.localeData(ae._l).jMonthsParse(A),ie!=null?we[1]=ie:ae._isValid=!1;break;case"jD":case"jDD":case"jDDD":case"jDDDD":A!=null&&(we[2]=~~A);break;case"jYY":we[0]=~~A+(~~A>47?1300:1400);break;case"jYYYY":case"jYYYYY":we[0]=~~A}A==null&&(ae._isValid=!1)}function B(k){var A,ae,ie=k._a[0],we=k._a[1],Ce=k._a[2];return ie==null&&we==null&&Ce==null?[0,0,1]:(ie=ie??0,we=we??0,Ce=Ce??1,(Ce<1||Ce>K.jDaysInMonth(ie,we)||we<0||we>11)&&(k._isValid=!1),A=Te(ie,we,Ce),ae=ee(A.gy,A.gm,A.gd),isNaN(A.gy)&&(k._isValid=!1),k._jDiff=0,~~ae.jy!==ie&&(k._jDiff+=1),~~ae.jm!==we&&(k._jDiff+=1),~~ae.jd!==Ce&&(k._jDiff+=1),[A.gy,A.gm,A.gd])}function oe(k){var A=k._f.match(N),ae=k._i+"",ie=A.length,we,Ce,We;for(k._a=[],we=0;we<ie;we+=1)Ce=A[we],We=(be(Ce,k).exec(ae)||[])[0],We&&(ae=ae.slice(ae.indexOf(We)+We.length)),R[Ce]&&me(Ce,We,k);return ae&&(k._il=ae),B(k)}function Ne(k,A){var ae=k._f.length,ie,we,Ce,We,Je,st;if(ae===0)return q(new Date(NaN));for(ie=0;ie<ae;ie+=1)we=k._f[ie],Je=0,Ce=q(k._i,we,k._l,k._strict,A),Ce.isValid()&&(Je+=Ce._jDiff,Ce._il&&(Je+=Ce._il.length),(st==null||Je<st)&&(st=Je,We=Ce));return We}function Ae(k){var A=k._i+"",ae="",ie="",we=k._f.match(N),Ce=we.length,We,Je,st;for(We=0;We<Ce;We+=1)Je=we[We],st=(be(Je,k).exec(A)||[])[0],st&&(A=A.slice(A.indexOf(st)+st.length)),R[Je]instanceof Function||(ie+=Je,st&&(ae+=st));k._i=ae,k._f=ie}function De(k,A,ae){var ie=ae-A,we=ae-k.day(),Ce;return we>ie&&(we-=7),we<ie-7&&(we+=7),Ce=K(k).add(we,"d"),{week:Math.ceil(Ce.jDayOfYear()/7),year:Ce.jYear()}}var w=57724432199999;function q(k,A,ae,ie,we){typeof ae=="boolean"&&(ie=ae,ae=void 0),A&&typeof A=="string"&&(A=xe(A,c));var Ce={_i:k,_f:A,_l:ae,_strict:ie},We,Je,st,$t=k,Gt=A;if(A){if(F(A))return Ne(Ce,we);We=oe(Ce),Ae(Ce),A="YYYY-MM-DD-"+Ce._f,k=z(We[0],4)+"-"+z(We[1]+1,2)+"-"+z(We[2],2)+"-"+Ce._i}return we?Je=c.utc(k,A,ae,ie):Je=c(k,A,ae,ie),Ce._isValid===!1&&(Je._isValid=!1),Je._jDiff=Ce._jDiff||0,st=ne(K.fn),pe(st,Je),ie&&A&&st.isValid()&&(st._isValid=st.format(Gt)===$t),Je._d.getTime()>w&&(st._isValid=!1),st}function K(k,A,ae,ie){return q(k,A,ae,ie,!1)}pe(K,c),K.fn=ne(c.fn),K.utc=function(k,A,ae,ie){return q(k,A,ae,ie,!0)},K.unix=function(k){return q(k*1e3)};function xe(k,A){for(var ae=5,ie=function(we){return A.localeData().longDateFormat(we)||we};ae>0&&f.test(k);)ae-=1,k=k.replace(f,ie);return k}K.fn.format=function(k){return k&&(k=xe(k,this),M[k]||(M[k]=fe(k)),k=M[k](this)),c.fn.format.call(this,k)},K.fn.jYear=function(k){var A,ae,ie;return typeof k=="number"?(ae=ee(this.year(),this.month(),this.date()),A=Math.min(ae.jd,K.jDaysInMonth(k,ae.jm)),ie=Te(k,ae.jm,A),ye(this,ie.gy,ie.gm,ie.gd),c.updateOffset(this),this):ee(this.year(),this.month(),this.date()).jy},K.fn.jMonth=function(k){var A,ae,ie;return k!=null?typeof k=="string"&&(k=this.localeData().jMonthsParse(k),typeof k!="number")?this:(ae=ee(this.year(),this.month(),this.date()),A=Math.min(ae.jd,K.jDaysInMonth(ae.jy,k)),this.jYear(ae.jy+ze(k,12)),k=Be(k,12),k<0&&(k+=12,this.jYear(this.jYear()-1)),ie=Te(this.jYear(),k,A),ye(this,ie.gy,ie.gm,ie.gd),c.updateOffset(this),this):ee(this.year(),this.month(),this.date()).jm},K.fn.jDate=function(k){var A,ae;return typeof k=="number"?(A=ee(this.year(),this.month(),this.date()),ae=Te(A.jy,A.jm,k),ye(this,ae.gy,ae.gm,ae.gd),c.updateOffset(this),this):ee(this.year(),this.month(),this.date()).jd},K.fn.jDayOfYear=function(k){var A=Math.round((K(this).startOf("day")-K(this).startOf("jYear"))/864e5)+1;return k==null?A:this.add(k-A,"d")},K.fn.jWeek=function(k){var A=De(this,this.localeData()._week.dow,this.localeData()._week.doy).week;return k==null?A:this.add((k-A)*7,"d")},K.fn.jWeekYear=function(k){var A=De(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return k==null?A:this.add(k-A,"y")},K.fn.add=function(k,A){var ae;return A!==null&&!isNaN(+A)&&(ae=k,k=A,A=ae),A=ke(A),A==="jyear"?this.jYear(this.jYear()+k):A==="jmonth"?this.jMonth(this.jMonth()+k):(c.fn.add.call(this,k,A),isNaN(this.jYear())&&(this._isValid=!1)),this},K.fn.subtract=function(k,A){var ae;return A!==null&&!isNaN(+A)&&(ae=k,k=A,A=ae),A=ke(A),A==="jyear"?this.jYear(this.jYear()-k):A==="jmonth"?this.jMonth(this.jMonth()-k):c.fn.subtract.call(this,k,A),this},K.fn.startOf=function(k){return k=ke(k),k==="jyear"||k==="jmonth"?(k==="jyear"&&this.jMonth(0),this.jDate(1),this.hours(0),this.minutes(0),this.seconds(0),this.milliseconds(0),this):c.fn.startOf.call(this,k)},K.fn.endOf=function(k){return k=ke(k),k===void 0||k==="milisecond"?this:this.startOf(k).add(1,k==="isoweek"?"week":k).subtract(1,"ms")},K.fn.isSame=function(k,A){return A=ke(A),A==="jyear"||A==="jmonth"?c.fn.isSame.call(this.startOf(A),k.startOf(A)):c.fn.isSame.call(this,k,A)},K.fn.clone=function(){return K(this)},K.fn.jYears=K.fn.jYear,K.fn.jMonths=K.fn.jMonth,K.fn.jDates=K.fn.jDate,K.fn.jWeeks=K.fn.jWeek,K.jDaysInMonth=function(k,A){return k+=ze(A,12),A=Be(A,12),A<0&&(A+=12,k-=1),A<6?31:A<11||K.jIsLeapYear(k)?30:29},K.jIsLeapYear=b.isLeapJalaaliYear,K.loadPersian=function(k){var A=k!==void 0&&k.hasOwnProperty("usePersianDigits")?k.usePersianDigits:!1,ae=k!==void 0&&k.hasOwnProperty("dialect")?k.dialect:"persian";c.locale("fa"),c.updateLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[ae],weekdaysShort:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[ae],weekdaysMin:{persian:"ی_د_س_چ_پ_آ_ش".split("_"),"persian-modern":"ی_د_س_چ_پ_ج_ش".split("_")}[ae],longDateFormat:{LT:"HH:mm",L:"jYYYY/jMM/jDD",LL:"jD jMMMM jYYYY",LLL:"jD jMMMM jYYYY LT",LLLL:"dddd، jD jMMMM jYYYY LT"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [ی پیش ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"1 دقیقه",mm:"%d دقیقه",h:"1 ساعت",hh:"%d ساعت",d:"1 روز",dd:"%d روز",M:"1 ماه",MM:"%d ماه",y:"1 سال",yy:"%d سال"},preparse:function(ie){return A?ie.replace(/[۰-۹]/g,function(we){return V[we]}).replace(/،/g,","):ie},postformat:function(ie){return A?ie.replace(/\d/g,function(we){return X[we]}).replace(/,/g,"،"):ie},ordinal:"%dم",week:{dow:6,doy:12},meridiem:function(ie){return ie<12?"ق.ظ":"ب.ظ"},jMonths:{persian:"فروردین_اردیبهشت_خرداد_تیر_امرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_"),"persian-modern":"فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_")}[ae],jMonthsShort:{persian:"فرو_ارد_خرد_تیر_امر_شهر_مهر_آبا_آذر_دی_بهم_اسف".split("_"),"persian-modern":"فرو_ارد_خرد_تیر_مرد_شهر_مهر_آبا_آذر_دی_بهم_اسف".split("_")}[ae]})},K.loadPersian_dari=function(k){var A=k!==void 0&&k.hasOwnProperty("usePersianDigits")?k.usePersianDigits:!1,ae=k!==void 0&&k.hasOwnProperty("dialect")?k.dialect:"persian-dari";c.locale("fa-af"),c.updateLocale("fa-af",{months:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),monthsShort:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),weekdays:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[ae],weekdaysShort:{persian:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"persian-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[ae],weekdaysMin:{persian:"ی_د_س_چ_پ_آ_ش".split("_"),"persian-modern":"ی_د_س_چ_پ_ج_ش".split("_")}[ae],longDateFormat:{LT:"HH:mm",L:"jYYYY/jMM/jDD",LL:"jD jMMMM jYYYY",LLL:"jD jMMMM jYYYY LT",LLLL:"dddd، jD jMMMM jYYYY LT"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [ی پیش ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"1 دقیقه",mm:"%d دقیقه",h:"1 ساعت",hh:"%d ساعت",d:"1 روز",dd:"%d روز",M:"1 ماه",MM:"%d ماه",y:"1 سال",yy:"%d سال"},preparse:function(ie){return A?ie.replace(/[۰-۹]/g,function(we){return V[we]}).replace(/،/g,","):ie},postformat:function(ie){return A?ie.replace(/\d/g,function(we){return X[we]}).replace(/,/g,"،"):ie},ordinal:"%dم",week:{dow:6,doy:12},meridiem:function(ie){return ie<12?"ق.ظ":"ب.ظ"},jMonths:{"persian-dari":"حمل_ثور_جوزا_سرطان_اسد_سنبله_میزان_عقرب_قوس_جدی_دلو_حوت".split("_"),"persian-modern-dari":"حمل_ثور_جوزا_سرطان_اسد_سنبله_میزان_عقرب_قوس_جدی_دلو_حوت".split("_")}[ae],jMonthsShort:{"persian-dari":"حمل_ثور_جوزا_سرط_اسد_سنب_میز_عقر_قوس_جدی_دلو_حوت".split("_"),"persian-modern-dari":"حمل_ثور_جوزا_سرط_اسد_سنب_میز_عقر_قوس_جدی_دلو_حوت".split("_")}[ae]})},K.loadPashto=function(k){var A=k!==void 0&&k.hasOwnProperty("usePersianDigits")?k.usePersianDigits:!1,ae=k!==void 0&&k.hasOwnProperty("dialect")?k.dialect:"pashto";c.locale("ps-af"),c.updateLocale("ps-af",{months:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),monthsShort:"جنوری_فبروری_مارچ_اپریل_می_جون_جولای_آگست_سپتمبر_اکتوبر_نومبر_دیسمبر".split("_"),weekdays:{pashto:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"pashto-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[ae],weekdaysShort:{pashto:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_آدینه_شنبه".split("_"),"pashto-modern":"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_")}[ae],weekdaysMin:{pashto:"ی_د_س_چ_پ_آ_ش".split("_"),"pashto-modern":"ی_د_س_چ_پ_ج_ش".split("_")}[ae],longDateFormat:{LT:"HH:mm",L:"jYYYY/jMM/jDD",LL:"jD jMMMM jYYYY",LLL:"jD jMMMM jYYYY LT",LLLL:"dddd، jD jMMMM jYYYY LT"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [ی پیش ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"1 دقیقه",mm:"%d دقیقه",h:"1 ساعت",hh:"%d ساعت",d:"1 روز",dd:"%d روز",M:"1 ماه",MM:"%d ماه",y:"1 سال",yy:"%d سال"},preparse:function(ie){return A?ie.replace(/[۰-۹]/g,function(we){return V[we]}).replace(/،/g,","):ie},postformat:function(ie){return A?ie.replace(/\d/g,function(we){return X[we]}).replace(/,/g,"،"):ie},ordinal:"%dم",week:{dow:6,doy:12},meridiem:function(ie){return ie<12?"ق.ظ":"ب.ظ"},jMonths:{pashto:"وری_غویی_غبرګولی_چنګاښ_زمری_وږی_تله_لړم_لیندی_مرغومی_سلواغه_کب".split("_"),"pashto-modern":"وری_غویی_غبرګولی_چنګاښ_زمری_وږی_تله_لړم_لیندی_مرغومی_سلواغه_کب".split("_")}[ae],jMonthsShort:{pashto:"وری_غوی_غبر_چنګ_زمر_وږی_لړم_لین_مرغ_سلو_کب".split("_"),"pashto-modern":"وری_غوی_غبر_چنګ_زمر_وږی_لړم_لین_مرغ_سلو_کب".split("_")}[ae]})},K.jConvert={toJalaali:ee,toGregorian:Te};function ee(k,A,ae){try{var ie=b.toJalaali(k,A+1,ae);return ie.jm-=1,ie}catch{return{jy:NaN,jm:NaN,jd:NaN}}}function Te(k,A,ae){try{var ie=b.toGregorian(k,A+1,ae);return ie.gm-=1,ie}catch{return{gy:NaN,gm:NaN,gd:NaN}}}function ze(k,A){return~~(k/A)}function Be(k,A){return k-~~(k/A)*A}return ah}var Tp=Cp();const td=ch(Tp);function kn(c){return c?td(c,"YYYY-MM-DD").format("jYYYY/jMM/jDD"):""}const M0=c=>c?td(c,"jYYYY/jMM/jDD").format("YYYY-MM-DD"):"",Op=({shipmentId:c,onNavigate:b,showSuccess:N,showError:f,isOwnerView:g=!1})=>{const[v,H]=y.useState(null),[S,T]=y.useState(!0),[_,G]=y.useState(null),[O,Z]=y.useState(!1),[X,V]=y.useState(!1),[Q,M]=y.useState(!1),[m,j]=y.useState(""),[R,U]=y.useState(""),[de,pe]=y.useState(""),[z,F]=y.useState(""),[ke,ye]=y.useState(""),[ne,E]=y.useState(""),[fe,be]=y.useState(""),[me,B]=y.useState(""),[oe,Ne]=y.useState(""),[Ae,De]=y.useState(""),[w,q]=y.useState("fixed"),[K,xe]=y.useState("IRT"),[ee,Te]=y.useState(""),[ze,Be]=y.useState(!1),[k,A]=y.useState(""),[ae,ie]=y.useState(""),[we,Ce]=y.useState(""),[We,Je]=y.useState(""),[st,$t]=y.useState([]),[Gt,Vt]=y.useState([]),[bt,ea]=y.useState({isOpen:!1,field:null}),[Se,le]=y.useState(null),[_e,Ee]=y.useState(null),ft=Se?`${Se.lat.toFixed(5)}, ${Se.lng.toFixed(5)}`:"",he=_e?`${_e.lat.toFixed(5)}, ${_e.lng.toFixed(5)}`:"",ot=[{value:"IRT",label:"تومان"},{value:"USD",label:"دلار آمریکا"},{value:"CAD",label:"دلار کانادا"},{value:"IQD",label:"دینار"}];y.useEffect(()=>{if(!c)return;let I=!0;return(async()=>{var je,Ot,lr,ma,Zt,Ke,Is,ht;try{T(!0),G(null);const Ea=await ha(`${et}/shipments/${c}`);if(!Ea.ok)throw new Error("خطا در دریافت اطلاعات مرسوله");const ut=(await Ea.json()).data;if(!I)return;H(ut);const Xt=ut.departure_date?kn(ut.departure_date):"",La=ut.arrival_date?kn(ut.arrival_date):"";if(j(ut.title??""),U(ut.description??""),pe(ut.weight??""),F(ut.category??""),ye(((je=ut.origin)==null?void 0:je.country)??""),E(((Ot=ut.origin)==null?void 0:Ot.city)??""),be(((lr=ut.origin)==null?void 0:lr.address)??""),B(((ma=ut.destination)==null?void 0:ma.country)??""),Ne(((Zt=ut.destination)==null?void 0:Zt.city)??""),De(((Ke=ut.destination)==null?void 0:Ke.address)??""),q(ut.price_type??"fixed"),xe(ut.currency??"IRT"),Te(ut.amount??""),Be(!!ut.show_phone),A(ut.carry_weight_capacity??""),ie(Xt),Ce(La),Je(ut.trip_description??""),$t(ut.images??[]),(Is=ut.origin)!=null&&Is.coordinates){const[Yt,Xe]=ut.origin.coordinates.split(",").map(Number);!Number.isNaN(Yt)&&!Number.isNaN(Xe)&&le({lat:Yt,lng:Xe})}if((ht=ut.destination)!=null&&ht.coordinates){const[Yt,Xe]=ut.destination.coordinates.split(",").map(Number);!Number.isNaN(Yt)&&!Number.isNaN(Xe)&&Ee({lat:Yt,lng:Xe})}}catch(Ea){console.error("خطا در دریافت جزئیات:",Ea),I&&G(Ea.message||"خطا در بارگذاری اطلاعات")}finally{I&&T(!1)}})(),()=>{I=!1}},[c]);const Ge=async()=>{if(!(!c||!window.confirm("آیا از حذف این مرسوله مطمئن هستید؟"))){Z(!0);try{if(!(await ha(`${et}/shipments/${c}`,{method:"DELETE"})).ok)throw new Error("خطا در حذف مرسوله");N("مرسوله با موفقیت حذف شد"),b("my-shipment-requests")}catch(I){f(I.message||"خطا در حذف مرسوله")}finally{Z(!1)}}},Lt=I=>{const mt=I.target.files;if(mt){const je=Array.from(mt).map(Ot=>({id:Date.now()+Math.random(),url:URL.createObjectURL(Ot),file:Ot}));Vt(Ot=>[...Ot,...je])}},Re=I=>{Vt(mt=>mt.filter(je=>je.id!==I))},ta=async I=>{if(window.confirm("آیا از حذف این تصویر مطمئن هستید؟"))try{if(!(await ha(`${et}/shipments/${c}/images/${I}`,{method:"DELETE"})).ok)throw new Error("خطا در حذف تصویر");$t(je=>je.filter(Ot=>Ot.id!==I)),N("تصویر حذف شد")}catch(mt){f(mt.message||"خطا در حذف تصویر")}},At=y.useCallback(I=>{I.preventDefault(),I.stopPropagation();const mt=I.dataTransfer.files;if(mt&&mt.length>0){const je=Array.from(mt).filter(Ot=>Ot.type.startsWith("image/")).map(Ot=>({id:Date.now()+Math.random(),url:URL.createObjectURL(Ot),file:Ot}));Vt(Ot=>[...Ot,...je])}},[]),Wt=I=>{I.preventDefault(),I.stopPropagation()},kt=I=>{ea({isOpen:!0,field:I})},ge=()=>{ea({isOpen:!1,field:null})},tt=I=>{bt.field==="origin"?le(I):bt.field==="destination"&&Ee(I),ge()},Ye=async()=>{if(!(!c||!v)){M(!0);try{const I=new FormData;I.append("_method","PUT"),I.append("origin[country]",ke),I.append("origin[city]",ne),I.append("origin[address]",fe),I.append("origin[coordinates]",Se?`${Se.lat},${Se.lng}`:""),I.append("destination[country]",me),I.append("destination[city]",oe),I.append("destination[address]",Ae),I.append("destination[coordinates]",_e?`${_e.lat},${_e.lng}`:""),I.append("price_type",w),I.append("show_phone",ze?"1":"0"),w==="fixed"&&(I.append("currency",K),I.append("amount",ee)),v.type==="send"?(I.append("title",m),I.append("description",R),I.append("weight",de),I.append("category",z),Gt.forEach((je,Ot)=>{je.file&&I.append(`images[${Ot}]`,je.file)})):(I.append("departure_date",ae?M0(ae):""),I.append("arrival_date",we?M0(we):""),I.append("carry_weight_capacity",k),I.append("trip_description",We));const mt=await ha(`${et}/shipments/${c}`,{method:"POST",body:I});if(!mt.ok){const je=await mt.json(),Ot=je.errors?Object.values(je.errors)[0]:je.message;throw new Error(Array.isArray(Ot)?Ot[0]:Ot)}N("تغییرات با موفقیت ذخیره شد"),V(!1),window.location.reload()}catch(I){f(I.message||"خطا در ذخیره تغییرات")}finally{M(!1)}}},Ze=()=>{if(V(!1),Vt([]),v){j(v.title||""),U(v.description||""),pe(v.weight||""),F(v.category||""),ye(v.origin.country||""),E(v.origin.city||""),be(v.origin.address||""),B(v.destination.country||""),Ne(v.destination.city||""),De(v.destination.address||""),q(v.price_type||"fixed"),xe(v.currency||"IRT"),Te(v.amount||""),Be(v.show_phone||!1);const I=v.departure_date?kn(v.departure_date):"",mt=v.arrival_date?kn(v.arrival_date):"";ie(I),Ce(mt),A(v.carry_weight_capacity||""),Je(v.trip_description||"")}},Rt=()=>{if(!v)return"—";if(v.price_type==="negotiable")return"توافقی";if(v.amount&&v.currency){const I={IRT:"تومان",USD:"دلار",CAD:"دلار کانادا",IQD:"دینار"};return`${parseFloat(v.amount).toLocaleString("fa-IR")} ${I[v.currency]||v.currency}`}return"—"},$e=I=>({furniture:"مبلمان",electronics:"الکترونیکی",clothing:"پوشاک",food:"غذایی",documents:"اسناد",miscellaneous:"متفرقه",other:"سایر"})[I]||I;return S?a.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-custom-purple"}),a.jsx("p",{className:"mt-4 text-gray-500 dark:text-gray-400",children:"در حال بارگذاری..."})]}):_||!v?a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"text-red-500 mb-4 text-4xl",children:"⚠️"}),a.jsx("h2",{className:"text-xl font-bold text-red-600 dark:text-red-400",children:"خطا در بارگذاری"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-2",children:_||"مرسوله یافت نشد"}),a.jsx("button",{onClick:()=>b(g?"my-shipment-requests":"accept-shipment"),className:"mt-4 text-custom-purple hover:underline",children:"بازگشت به لیست"})]}):a.jsxs("div",{className:"flex flex-col space-y-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:X?"ویرایش مرسوله":v.title}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:v.type==="send"?"📦 ارسال مرسوله":"✈️ سفر حمل مرسوله"})]}),a.jsxs("button",{onClick:()=>b(g?"my-shipment-requests":"accept-shipment"),className:"flex items-center gap-2 py-2 px-4 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors self-start sm:self-center",children:[a.jsx(fh,{className:"w-5 h-5"}),a.jsx("span",{children:"بازگشت"})]})]}),X?a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[v.type==="send"&&a.jsxs("div",{className:"lg:col-span-1 space-y-6",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4",children:"تصاویر فعلی"}),a.jsx("div",{className:"grid grid-cols-2 gap-4",children:st.map(I=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:I.url,alt:"تصویر",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{type:"button",onClick:()=>ta(I.id),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(Oa,{className:"w-4 h-4"})})]},I.id))})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4",children:"افزودن تصاویر جدید"}),a.jsxs("label",{htmlFor:"file-upload-edit",className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-xl cursor-pointer bg-custom-light-bg dark:bg-custom-dark-blue hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",onDrop:At,onDragOver:Wt,children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[a.jsx(Mn,{className:"w-10 h-10 mb-3 text-gray-400"}),a.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[a.jsx("span",{className:"font-semibold",children:"برای آپلود کلیک کنید"})," یا بکشید"]}),a.jsx("p",{className:"text-xs text-gray-400",children:"فرمت‌های مجاز: JPG, PNG, GIF"})]}),a.jsx("input",{id:"file-upload-edit",type:"file",className:"hidden",multiple:!0,accept:"image/*",onChange:Lt})]}),Gt.length>0&&a.jsx("div",{className:"grid grid-cols-2 gap-4 mt-4",children:Gt.map(I=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:I.url,alt:"پیش‌نمایش",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{type:"button",onClick:()=>Re(I.id),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(Oa,{className:"w-4 h-4"})})]},I.id))})]})]}),a.jsx("div",{className:v.type==="send"?"lg:col-span-2":"lg:col-span-3",children:a.jsxs("div",{className:"space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:v.type==="send"?"۱. اطلاعات مرسوله":"۱. اطلاعات سفر"}),a.jsx("div",{className:"space-y-6",children:v.type==="send"?a.jsxs(a.Fragment,{children:[a.jsx(Fs,{icon:ao,id:"title",placeholder:"عنوان مرسوله",label:"عنوان",value:m,onChange:I=>j(I.target.value)}),a.jsx(C0,{icon:hs,id:"description",placeholder:"توضیحات مرسوله",label:"توضیحات",value:R,onChange:I=>U(I.target.value)}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(Fs,{icon:Qa,id:"weight",placeholder:"وزن به کیلوگرم",label:"وزن",type:"number",value:de,onChange:I=>pe(I.target.value),step:"0.1",min:"0.1"}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"دسته‌بندی"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(so,{className:"w-5 h-5 text-gray-400"})}),a.jsxs("select",{value:z,onChange:I=>F(I.target.value),className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",children:[a.jsx("option",{value:"",children:"انتخاب کنید"}),a.jsx("option",{value:"documents",children:"مدارک و اسناد"}),a.jsx("option",{value:"electronics",children:"لوازم الکترونیکی"}),a.jsx("option",{value:"clothing",children:"پوشاک"}),a.jsx("option",{value:"furniture",children:"اثاثیه منزل"}),a.jsx("option",{value:"miscellaneous",children:"متفرقه"})]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]})]})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(T0,{id:"departure_date",label:"تاریخ حرکت",value:ae,onChange:ie}),a.jsx(T0,{id:"arrival_date",label:"تاریخ رسیدن",value:we,onChange:Ce})]}),a.jsx(Fs,{icon:Qa,id:"carry_weight",placeholder:"ظرفیت حمل به کیلوگرم",label:"ظرفیت حمل",type:"number",value:k,onChange:I=>A(I.target.value),step:"0.1",min:"0.1"}),a.jsx(C0,{icon:hs,id:"trip_description",placeholder:"توضیحات سفر",label:"توضیحات",value:We,onChange:I=>Je(I.target.value)})]})})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۲. مبدأ و مقصد"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مبدأ"}),a.jsx(O0,{onButtonClick:()=>kt("origin"),value:ft,id:"origin",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Fs,{icon:Fe,id:"origin_country",placeholder:"کشور",label:"کشور",value:ke,onChange:I=>ye(I.target.value)}),a.jsx(Fs,{icon:Fe,id:"origin_city",placeholder:"شهر",label:"شهر",value:ne,onChange:I=>E(I.target.value)})]}),a.jsx(Fs,{icon:Os,id:"origin_address",placeholder:"آدرس",label:"آدرس",value:fe,onChange:I=>be(I.target.value)})]}),a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مقصد"}),a.jsx(O0,{onButtonClick:()=>kt("destination"),value:he,id:"destination",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx("div",{className:"text-center text-sm text-gray-500 dark:text-gray-400",children:"یا"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Fs,{icon:Fe,id:"destination_country",placeholder:"کشور",label:"کشور",value:me,onChange:I=>B(I.target.value)}),a.jsx(Fs,{icon:Fe,id:"destination_city",placeholder:"شهر",label:"شهر",value:oe,onChange:I=>Ne(I.target.value)})]}),a.jsx(Fs,{icon:Os,id:"destination_address",placeholder:"آدرس",label:"آدرس",value:Ae,onChange:I=>De(I.target.value)})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. قیمت‌گذاری"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"نوع قیمت"}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 bg-custom-light-bg dark:bg-custom-dark-blue p-1 rounded-lg",children:[a.jsx("button",{type:"button",onClick:()=>q("fixed"),className:`px-4 py-2 rounded-md text-sm font-semibold transition ${w==="fixed"?"bg-custom-purple text-white shadow":"text-gray-600 dark:text-gray-300"}`,children:"قیمت ثابت"}),a.jsx("button",{type:"button",onClick:()=>q("negotiable"),className:`px-4 py-2 rounded-md text-sm font-semibold transition ${w==="negotiable"?"bg-custom-purple text-white shadow":"text-gray-600 dark:text-gray-300"}`,children:"توافقی"})]})]}),w==="fixed"&&a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"واحد پولی"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(ba,{className:"w-5 h-5 text-gray-400"})}),a.jsx("select",{value:K,onChange:I=>xe(I.target.value),className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",children:ot.map(({value:I,label:mt})=>a.jsx("option",{value:I,children:mt},I))}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]})]}),a.jsx(Fs,{icon:ba,id:"amount",placeholder:"مبلغ",label:"مبلغ",type:"number",value:ee,onChange:I=>Te(I.target.value),step:"1000",min:"0"})]}),a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Ks,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(Ep,{enabled:ze,setEnabled:Be})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-4",children:[a.jsx("button",{type:"button",onClick:Ze,disabled:Q,className:"px-6 py-3 bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 font-bold rounded-lg transition-colors duration-300 disabled:opacity-50",children:a.jsx("span",{children:"لغو"})}),a.jsxs("button",{type:"button",onClick:Ye,disabled:Q,className:"px-6 py-3 bg-custom-purple hover:bg-custom-light-purple text-white font-bold rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl disabled:opacity-50 flex items-center gap-2",children:[Q?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):a.jsx(G0,{className:"w-5 h-5"}),a.jsx("span",{children:Q?"در حال ذخیره...":"ذخیره تغییرات"})]})]})]})})]}):a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[v.images&&v.images.length>0?a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("img",{src:v.images[0].url,alt:v.title,className:"w-full h-auto max-h-96 object-cover rounded-xl",onError:I=>{I.currentTarget.src="https://via.placeholder.com/800x600?text=بدون+تصویر"}}),v.images.length>1&&a.jsx("div",{className:"grid grid-cols-4 gap-2 pt-3",children:v.images.slice(1,5).map(I=>a.jsx("img",{src:I.url,alt:"تصویر مرسوله",className:"w-full h-20 object-cover rounded-lg cursor-pointer hover:opacity-80 transition-opacity",onError:mt=>{mt.currentTarget.style.display="none"}},I.id))})]}):a.jsx("p",{}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b pb-3 border-gray-200 dark:border-gray-700",children:"توضیحات"}),a.jsx("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed whitespace-pre-line",children:v.description||"توضیحاتی ثبت نشده است."})]})]}),a.jsxs("div",{className:"lg:col-span-1 space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm space-y-4 lg:sticky lg:top-28",children:[a.jsx("h3",{className:"text-lg font-semibold mb-2 pb-3 border-b border-gray-200 dark:border-gray-700",children:"اطلاعات کلی"}),v.category&&a.jsx(Xs,{icon:so,label:"دسته‌بندی",value:$e(v.category)}),v.type==="send"&&v.weight&&a.jsx(Xs,{icon:Qa,label:"وزن",value:`${parseFloat(v.weight).toLocaleString("fa-IR")} کیلوگرم`}),v.type==="carry"&&v.carry_weight_capacity&&a.jsx(Xs,{icon:Qa,label:"ظرفیت حمل",value:`${parseFloat(v.carry_weight_capacity).toLocaleString("fa-IR")} کیلوگرم`}),a.jsx(Xs,{icon:Fe,label:"مبدأ",value:`${v.origin.city}, ${v.origin.country}`}),a.jsx(Xs,{icon:Fe,label:"مقصد",value:`${v.destination.city}, ${v.destination.country}`}),v.departure_date&&a.jsx(Xs,{icon:Yr,label:"تاریخ حرکت",value:kn(v.departure_date)}),v.arrival_date&&a.jsx(Xs,{icon:Yr,label:"تاریخ رسیدن",value:kn(v.arrival_date)}),a.jsx(Xs,{icon:ba,label:"هزینه",value:Rt(),valueClassName:"text-green-600 dark:text-green-400 font-bold"}),!g&&v.user&&a.jsxs("div",{className:"pt-3 border-t border-gray-200 dark:border-gray-700",children:[a.jsx(Xs,{icon:Ta,label:"ثبت‌کننده",value:v.user.name||"بدون نام"}),v.show_phone&&v.user.phone&&a.jsx(Xs,{icon:Ks,label:"تماس",value:v.user.phone})]})]}),g&&a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-3",children:"عملیات"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("button",{onClick:()=>V(!0),className:"w-full flex flex-col items-center justify-center gap-2 bg-custom-cyan/10 hover:bg-custom-cyan/20 text-custom-cyan font-bold py-3 px-4 rounded-lg transition-colors duration-300",children:[a.jsx($0,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm",children:"ویرایش"})]}),a.jsxs("button",{onClick:Ge,disabled:O,className:"w-full flex flex-col items-center justify-center gap-2 bg-red-500/10 hover:bg-red-500/20 text-red-500 font-bold py-3 px-4 rounded-lg transition-colors duration-300 disabled:opacity-50",children:[O?a.jsx("div",{className:"w-5 h-5 border-2 border-red-500 border-t-transparent rounded-full animate-spin"}):a.jsx(ph,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm",children:O?"حذف...":"حذف"})]})]})]})})]})]}),a.jsx(Rp,{isOpen:bt.isOpen,onClose:ge,onConfirm:tt,field:bt.field})]})},Xs=({icon:c,label:b,value:N,valueClassName:f="text-gray-800 dark:text-gray-200"})=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center text-gray-500 dark:text-gray-400",children:[a.jsx(c,{className:"w-5 h-5 ml-2"}),a.jsx("span",{className:"text-sm",children:b})]}),a.jsx("span",{className:`font-semibold text-sm ${f}`,children:N})]}),Fs=({icon:c,id:b,placeholder:N,label:f,value:g,onChange:v,type:H="text",step:S,min:T})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:b,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:f}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(c,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{id:b,type:H,placeholder:N,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:g,onChange:v,step:S,min:T})]})]}),C0=({icon:c,id:b,placeholder:N,label:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:b,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:f}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute top-3 right-3 pointer-events-none",children:a.jsx(c,{className:"w-5 h-5 text-gray-400"})}),a.jsx("textarea",{id:b,placeholder:N,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition h-24 resize-none",value:g,onChange:v})]})]}),Ep=({enabled:c,setEnabled:b})=>a.jsx("button",{type:"button",dir:"ltr",className:`${c?"bg-custom-purple":"bg-gray-200 dark:bg-gray-600"}
              relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent 
              transition-colors duration-200 ease-in-out 
              focus:outline-none focus:ring-2 focus:ring-custom-purple focus:ring-offset-2`,onClick:()=>b(!c),children:a.jsx("span",{"aria-hidden":"true",className:`${c?"translate-x-5":"translate-x-0"}
                pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white 
                shadow-lg ring-0 transition duration-200 ease-in-out`})}),Lp=c=>[1,5,9,13,17,22,26,30].includes(c%33),Ap=(c,b)=>b<7?31:b<12?30:b===12?Lp(c)?30:29:0,Yp=()=>{const c=new Date().toLocaleDateString("fa-IR-u-nu-latn"),[b,N]=c.split("/").map(Number);return{year:b,month:N}},zp=["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],T0=({id:c,label:b,value:N,onChange:f})=>{const v=Yp().year,H=Array.from({length:4},(Q,M)=>v+M),[S,T,_]=N?N.split("/").map(Number):[void 0,void 0,void 0],G=S&&T?Ap(S,T):31,O=Q=>{const m=`${Number(Q.target.value)}/${T||""}/${_||""}`;f(m.replace(/\/{2,}/g,"/").replace(/\/$/,""))},Z=Q=>{const M=Number(Q.target.value),m=`${S||""}/${M}/${_||""}`;f(m.replace(/\/{2,}/g,"/").replace(/\/$/,""))},X=Q=>{const M=Number(Q.target.value),m=`${S||""}/${T||""}/${M}`;f(m.replace(/\/{2,}/g,"/").replace(/\/$/,""))},V="w-full appearance-none pr-4 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition";return a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_day`,value:_||"",onChange:X,className:V,children:[a.jsx("option",{value:"",disabled:!0,children:"روز"}),Array.from({length:G},(Q,M)=>M+1).map(Q=>a.jsx("option",{value:Q,children:Q},Q))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_month`,value:T||"",onChange:Z,className:V,children:[a.jsx("option",{value:"",disabled:!0,children:"ماه"}),zp.map((Q,M)=>a.jsx("option",{value:M+1,children:Q},M))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_year`,value:S||"",onChange:O,className:V,children:[a.jsx("option",{value:"",disabled:!0,children:"سال"}),H.map(Q=>a.jsx("option",{value:Q,children:Q},Q))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]})]})]})},O0=({id:c,label:b,placeholder:N,value:f,onButtonClick:g})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative flex items-center",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(Fe,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",placeholder:N,value:f,readOnly:!0,onClick:g,style:{cursor:"pointer"}}),a.jsx("button",{type:"button",onClick:g,className:"absolute left-2 text-sm bg-custom-purple text-white px-3 py-1 rounded-md hover:bg-custom-light-purple transition-colors",children:"ثبت"})]})]}),Rp=({isOpen:c,onClose:b,onConfirm:N,field:f})=>{const g=y.useRef(null),v=y.useRef(null),H=y.useRef(null),[S,T]=y.useState(null),[_,G]=y.useState(""),[O,Z]=y.useState(!1);y.useEffect(()=>{if(!c)return;const m=()=>{g.current&&(g.current.remove(),g.current=null),v.current=null,T(null),G("")};if(H.current&&!g.current){const j=L.map(H.current).setView([35.6892,51.389],10);g.current=j,L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(j),j.on("click",R=>{const{lat:U,lng:de}=R.latlng;T({lat:U,lng:de}),v.current?v.current.setLatLng(R.latlng):v.current=L.marker(R.latlng).addTo(g.current)}),setTimeout(()=>j.invalidateSize(),100)}return m},[c]);const X=async()=>{if(_.trim()){Z(!0);try{const m=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(_)}&accept-language=fa`);if(!m.ok)throw new Error("Network response was not ok");const j=await m.json();if(j&&j.length>0){const{lat:R,lon:U}=j[0],de=parseFloat(R),pe=parseFloat(U),z={lat:de,lng:pe};T(z),g.current&&(g.current.setView(z,15),v.current?v.current.setLatLng(z):v.current=L.marker(z).addTo(g.current))}else console.log("مکان مورد نظر یافت نشد.")}catch(m){console.error("Geocoding error:",m),console.log("خطایی در جستجوی مکان رخ داد.")}finally{Z(!1)}}},V=async()=>{if(!navigator.geolocation){console.log("مرورگر شما از موقعیت‌یابی جغرافیایی پشتیبانی نمی‌کند.");return}if(navigator.permissions&&navigator.permissions.query)try{if((await navigator.permissions.query({name:"geolocation"})).state==="denied"){console.log("شما دسترسی به موقعیت مکانی را مسدود کرده‌اید.");return}}catch(m){console.warn("Could not check permission status:",m)}navigator.geolocation.getCurrentPosition(m=>{const{latitude:j,longitude:R}=m.coords,U={lat:j,lng:R};T(U),g.current&&(g.current.setView(U,15),v.current?v.current.setLatLng(U):v.current=L.marker(U).addTo(g.current))},m=>{console.error("Geolocation error:",m.message);let j="امکان دسترسی به موقعیت مکانی شما وجود ندارد.";switch(m.code){case m.PERMISSION_DENIED:j="شما اجازه دسترسی به موقعیت مکانی را نداده‌اید.";break;case m.POSITION_UNAVAILABLE:j="اطلاعات موقعیت مکانی در دسترس نیست.";break;case m.TIMEOUT:j="درخواست برای دریافت موقعیت مکانی بیش از حد طول کشید.";break}console.log(j)})},Q=()=>{S?N(S):console.log("لطفاً یک موقعیت روی نقشه انتخاب کنید.")};if(!c)return null;const M=f==="origin"?"ثبت موقعیت مبدأ":"ثبت موقعیت مقصد";return a.jsxs("div",{className:"fixed inset-0 bg-black/70 z-50 flex items-center justify-center p-4 backdrop-blur-sm",onClick:b,children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light w-full max-w-2xl rounded-2xl shadow-2xl border border-gray-200 dark:border-gray-700/50 transform transition-all duration-300 ease-out scale-95 opacity-0 animate-fade-in-scale overflow-hidden",onClick:m=>m.stopPropagation(),children:[a.jsxs("div",{className:"flex justify-between items-center p-5 bg-custom-light-bg dark:bg-custom-dark-blue",children:[a.jsxs("h2",{className:"text-xl font-bold flex items-center gap-3",children:[a.jsx(Fe,{className:"w-6 h-6 text-custom-purple"})," ",M]}),a.jsx("button",{onClick:b,className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",children:a.jsx(Oa,{className:"w-6 h-6 text-gray-500 dark:text-gray-400"})})]}),a.jsxs("div",{className:"p-6 space-y-5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative flex-grow",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(fa,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",value:_,onChange:m=>G(m.target.value),onKeyDown:m=>{m.key==="Enter"&&X()},placeholder:"جستجوی آدرس یا مکان...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition"})]}),a.jsx("button",{onClick:X,disabled:O,className:"flex-shrink-0 flex items-center justify-center w-28 py-2.5 px-4 rounded-lg bg-custom-purple text-white font-semibold hover:bg-custom-light-purple transition-colors disabled:bg-gray-400 disabled:cursor-wait",children:O?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):a.jsx("span",{children:"جستجو"})})]}),a.jsxs("button",{onClick:V,className:"w-full flex items-center justify-center gap-2 py-3 px-4 rounded-xl bg-gradient-to-br from-custom-cyan to-teal-400 text-white font-semibold hover:shadow-lg hover:shadow-custom-cyan/30 transition-all duration-300 transform hover:-translate-y-0.5",children:[a.jsx(io,{className:"w-5 h-5"}),a.jsx("span",{children:"استفاده از موقعیت فعلی من"})]}),a.jsxs("div",{className:"relative my-4",children:[a.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true",children:a.jsx("div",{className:"w-full border-t border-gray-300 dark:border-gray-600"})}),a.jsx("div",{className:"relative flex justify-center",children:a.jsx("span",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light px-3 text-sm text-gray-500 dark:text-gray-400",children:"یا"})})]}),a.jsx("p",{className:"text-center text-sm text-gray-500 dark:text-gray-400 -mt-2 mb-2",children:"برای انتخاب، روی نقشه کلیک کنید."}),a.jsx("div",{ref:H,className:"w-full h-80 bg-gray-200 dark:bg-gray-700 rounded-xl cursor-pointer z-0 border border-gray-300 dark:border-gray-600 shadow-inner"})]}),a.jsxs("div",{className:"px-6 py-4 bg-custom-light-bg dark:bg-custom-dark-blue border-t border-gray-200 dark:border-gray-700 flex justify-between items-center",children:[a.jsx("button",{onClick:b,className:"py-2 px-5 rounded-lg text-gray-700 dark:text-gray-300 font-semibold hover:bg-gray-200 dark:hover:bg-gray-700/50 transition-colors",children:"انصراف"}),a.jsx("button",{onClick:Q,disabled:!S,className:"py-2.5 px-6 rounded-xl bg-gradient-to-br from-custom-purple to-custom-light-purple text-white font-semibold hover:shadow-lg hover:shadow-custom-purple/30 transition-all duration-300 disabled:from-gray-400 disabled:to-gray-500 disabled:shadow-none disabled:cursor-not-allowed transform disabled:transform-none hover:-translate-y-0.5",children:"تایید موقعیت"})]})]}),a.jsx("style",{children:`
                @keyframes fade-in-scale {
                    from { transform: scale(0.95); opacity: 0; }
                    to { transform: scale(1); opacity: 1; }
                }
                .animate-fade-in-scale {
                    animation: fade-in-scale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
                }
                .leaflet-container {
                    font-family: 'Vazirmatn', sans-serif;
                }
            `})]})},Up=c=>[1,5,9,13,17,22,26,30].includes(c%33),Hp=(c,b)=>b<7?31:b<12?30:b===12?Up(c)?30:29:0,qp=["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],_n=c=>c?c.replace(/-/g,"/"):"",Pi=c=>c?c.replace(/\//g,"-"):"",Bp=c=>c?new Date(c).toLocaleDateString("fa-IR",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—",E0=({id:c,label:b,value:N,onChange:f})=>{const g=td().locale("fa").format("jYYYY/jMM/jDD"),v=parseInt(g.split("/")[0]),H=Array.from({length:4},(m,j)=>v+j),[S,T,_]=N?N.split("/"):["","",""],G=S?parseInt(S):void 0,O=T?parseInt(T):void 0,Z=G&&O?Hp(G,O):31,X=m=>{const j=`${m.target.value}/${T||""}/${_||""}`;f(j.replace(/\/{2,}/g,"/").replace(/\/$/,""))},V=m=>{const j=`${S||""}/${m.target.value}/${_||""}`;f(j.replace(/\/{2,}/g,"/").replace(/\/$/,""))},Q=m=>{const j=`${S||""}/${T||""}/${m.target.value}`;f(j.replace(/\/{2,}/g,"/").replace(/\/$/,""))},M="w-full appearance-none pr-4 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition";return a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_day`,value:_||"",onChange:Q,className:M,children:[a.jsx("option",{value:"",disabled:!0,children:"روز"}),Array.from({length:Z},(m,j)=>j+1).map(m=>a.jsx("option",{value:m,children:m},m))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_month`,value:T||"",onChange:V,className:M,children:[a.jsx("option",{value:"",disabled:!0,children:"ماه"}),qp.map((m,j)=>a.jsx("option",{value:j+1,children:m},j))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("select",{id:`${c}_year`,value:S||"",onChange:X,className:M,children:[a.jsx("option",{value:"",disabled:!0,children:"سال"}),H.map(m=>a.jsx("option",{value:m,children:m},m))]}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(yt,{className:"w-5 h-5 text-gray-400"})})]})]})]})},Ar=({icon:c,id:b,placeholder:N,label:f,value:g,onChange:v,type:H="text"})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:b,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:f}),a.jsxs("div",{className:"relative",children:[c&&a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(c,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{id:b,type:H,placeholder:N,className:`w-full ${c?"pr-10":"pr-4"} pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition`,value:g,onChange:v})]})]}),$p=({icon:c,id:b,placeholder:N,label:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:b,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:f}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute top-3 right-3 pointer-events-none",children:a.jsx(c,{className:"w-5 h-5 text-gray-400"})}),a.jsx("textarea",{id:b,placeholder:N,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition min-h-[100px] resize-y",value:g,onChange:v})]})]}),Gp=({enabled:c,setEnabled:b})=>a.jsx("button",{type:"button",onClick:()=>b(!c),className:`${c?"bg-custom-purple":"bg-gray-300 dark:bg-gray-600"} relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-custom-purple focus:ring-offset-2`,children:a.jsx("span",{className:`${c?"translate-x-6":"translate-x-1"} inline-block h-4 w-4 transform rounded-full bg-white transition-transform`})}),L0=({id:c,label:b,placeholder:N,value:f,onButtonClick:g})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:b}),a.jsxs("div",{className:"relative flex items-center",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(Fe,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",placeholder:N,value:f,readOnly:!0,onClick:g,style:{cursor:"pointer"}}),a.jsx("button",{type:"button",onClick:g,className:"absolute left-2 text-sm bg-custom-purple text-white px-3 py-1 rounded-md hover:bg-custom-light-purple transition-colors",children:"ثبت"})]})]}),oh=[{id:"private_car",name:"ماشین شخصی",icon:lo},{id:"bus",name:"اتوبوس",icon:gh},{id:"train",name:"قطار",icon:xh},{id:"airplane",name:"هواپیما",icon:va}],A0=c=>{const b=oh.find(N=>N.id===c);return b?b.name:c},Vp=({tripId:c,onNavigate:b,isOwnerView:N=!1,type:f="trip"})=>{var ea;const[g,v]=y.useState(null),[H,S]=y.useState(!0),[T,_]=y.useState(null),[G,O]=y.useState(!1),[Z,X]=y.useState(!1),[V,Q]=y.useState(!1),[M,m]=y.useState(""),[j,R]=y.useState(""),[U,de]=y.useState(""),[pe,z]=y.useState(""),[F,ke]=y.useState(""),[ye,ne]=y.useState(""),[E,fe]=y.useState(""),[be,me]=y.useState(""),[B,oe]=y.useState(""),[Ne,Ae]=y.useState([]),[De,w]=y.useState(""),[q,K]=y.useState(""),[xe,ee]=y.useState(""),[Te,ze]=y.useState(""),[Be,k]=y.useState(!1),[A,ae]=y.useState({isOpen:!1,field:null}),[ie,we]=y.useState(null),[Ce,We]=y.useState(null);y.useEffect(()=>{if(!c)return;(async()=>{try{S(!0),_(null);const le=f==="trip"?`trips/trip/${c}`:`trips/companion/${c}`,_e=await ha(`${et}/${le}`);if(!_e.ok)throw new Error("خطا در دریافت اطلاعات");const Ee=await _e.json();v(Ee.data)}catch(le){_(le.message||"خطا در بارگذاری اطلاعات")}finally{S(!1)}})()},[c,f]),y.useEffect(()=>{G&&g&&(m(g.origin_country||""),R(g.origin_city||""),de(g.origin_address||""),z(g.origin_coordinates||""),we(g.origin_coordinates?{lat:parseFloat(g.origin_coordinates.split(",")[0]),lng:parseFloat(g.origin_coordinates.split(",")[1])}:null),ke(g.destination_country||""),ne(g.destination_city||""),fe(g.destination_address||""),me(g.destination_coordinates||""),We(g.destination_coordinates?{lat:parseFloat(g.destination_coordinates.split(",")[0]),lng:parseFloat(g.destination_coordinates.split(",")[1])}:null),oe(g.vehicle_type||""),Ae(g.vehicle_types||[]),w(g.departure_date?_n(g.departure_date):""),K(g.arrival_date?_n(g.arrival_date):""),ee(g.capacity?String(g.capacity):""),ze(g.description||""),k(g.show_phone||!1))},[G,g]);const Je=async()=>{if(!(!c||!window.confirm("آیا از حذف این مورد مطمئن هستید؟"))){Q(!0);try{const Se=f==="trip"?`trips/trip/${c}`:`trips/companion/${c}`,le=await ha(`${et}/${Se}`,{method:"DELETE"});if(!le.ok){const _e=await le.json();throw new Error(_e.message||"خطا در حذف")}b(f==="trip"?"my-trips":"my-companions")}catch(Se){alert(Se.message||"خطا در حذف")}finally{Q(!1)}}},st=Se=>ae({isOpen:!0,field:Se}),$t=()=>ae({isOpen:!1,field:null}),Gt=Se=>{A.field==="origin"?(we(Se),z(`${Se.lat},${Se.lng}`)):A.field==="destination"&&(We(Se),me(`${Se.lat},${Se.lng}`)),$t()},Vt=Se=>{Ae(le=>le.includes(Se)?le.filter(_e=>_e!==Se):[...le,Se])},bt=async Se=>{Se.preventDefault(),X(!0);try{const le=f==="trip"?`trips/trip/${c}`:`trips/companion/${c}`,_e=new FormData;if(_e.append("_method","PUT"),_e.append("origin[country]",M),_e.append("origin[city]",j),_e.append("origin[address]",U),_e.append("origin[coordinates]",pe),_e.append("destination[country]",F),_e.append("destination[city]",ye),_e.append("destination[address]",E),_e.append("destination[coordinates]",be),_e.append("capacity",xe),_e.append("description",Te),_e.append("show_phone",Be?"1":"0"),f==="trip")_e.append("vehicle_type",B),_e.append("departure_date",De?Pi(De):""),_e.append("arrival_date",q?Pi(q):"");else{if(Ne.forEach(he=>{_e.append("vehicle_types[]",he)}),De)_e.append("available_from",Pi(De));else{const he=td().locale("fa").format("jYYYY/jMM/jDD");_e.append("available_from",Pi(he))}_e.append("available_to",q?Pi(q):"")}const Ee=await ha(`${et}/${le}`,{method:"POST",body:_e});if(!Ee.ok){const he=await Ee.json();throw new Error(he.message||"خطا در به‌روزرسانی")}const ft=await Ee.json();v(ft.data),O(!1)}catch(le){alert(le.message||"خطا در به‌روزرسانی")}finally{X(!1)}};return H?a.jsx("div",{className:"text-center py-12",children:"در حال بارگذاری..."}):T?a.jsxs("div",{className:"text-center py-12 text-red-500",children:["خطا: ",T]}):g?G?a.jsxs("form",{onSubmit:bt,className:"space-y-8",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsxs("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:["ویرایش ",f==="trip"?"سفر":"همسفری"]}),a.jsx("button",{type:"button",onClick:()=>O(!1),className:"flex items-center gap-2 py-2 px-4 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors",children:a.jsx("span",{children:"بازگشت به نمایش"})})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"اطلاعات مبدأ و مقصد"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مبدأ"}),a.jsx(L0,{onButtonClick:()=>st("origin"),value:ie?`${ie.lat.toFixed(5)}, ${ie.lng.toFixed(5)}`:"",id:"edit_origin",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx(Ar,{icon:ya,id:"edit_origin_country",placeholder:"مثال: ایران",label:"کشور",value:M,onChange:Se=>m(Se.target.value)}),a.jsx(Ar,{icon:Fe,id:"edit_origin_city",placeholder:"مثال: تهران",label:"شهر",value:j,onChange:Se=>R(Se.target.value)}),a.jsx(Ar,{icon:Os,id:"edit_origin_address",placeholder:"آدرس کامل",label:"آدرس دستی",value:U,onChange:Se=>de(Se.target.value)})]}),a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مقصد"}),a.jsx(L0,{onButtonClick:()=>st("destination"),value:Ce?`${Ce.lat.toFixed(5)}, ${Ce.lng.toFixed(5)}`:"",id:"edit_destination",placeholder:"موقعیت ثبت نشده",label:"انتخاب از روی نقشه"}),a.jsx(Ar,{icon:ya,id:"edit_destination_country",placeholder:"مثال: کانادا",label:"کشور",value:F,onChange:Se=>ke(Se.target.value)}),a.jsx(Ar,{icon:Fe,id:"edit_destination_city",placeholder:"مثال: تورنتو",label:"شهر",value:ye,onChange:Se=>ne(Se.target.value)}),a.jsx(Ar,{icon:Os,id:"edit_destination_address",placeholder:"آدرس کامل",label:"آدرس دستی",value:E,onChange:Se=>fe(Se.target.value)})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:["جزئیات ",f==="trip"?"سفر":"همسفری"]}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(E0,{id:"edit_departure_date",label:f==="trip"?"تاریخ حرکت":"در دسترس از تاریخ",value:De,onChange:w}),a.jsx(E0,{id:"edit_arrival_date",label:f==="trip"?"تاریخ رسیدن":"در دسترس تا تاریخ",value:q,onChange:K})]}),f==="trip"?a.jsxs("div",{className:"mt-6",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"وسیله نقلیه"}),a.jsx("select",{value:B,onChange:Se=>oe(Se.target.value),className:"w-full appearance-none pr-4 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",children:oh.map(Se=>a.jsx("option",{value:Se.id,children:Se.name},Se.id))})]}):a.jsxs("div",{className:"mt-6",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"وسایل نقلیه مورد نظر"}),a.jsx("div",{className:"grid grid-cols-2 gap-3",children:oh.map(Se=>a.jsxs("label",{className:`flex items-center p-3 border rounded-lg cursor-pointer transition-all duration-200 ${Ne.includes(Se.id)?"bg-custom-purple/10 border-custom-purple ring-2 ring-custom-purple/50 dark:bg-custom-purple/20":"bg-custom-light-bg dark:bg-custom-dark-blue border-gray-300 dark:border-gray-600 hover:border-custom-purple/50"}`,children:[a.jsx("input",{type:"checkbox",checked:Ne.includes(Se.id),onChange:()=>Vt(Se.id),className:"sr-only"}),a.jsx("div",{className:`w-5 h-5 border-2 rounded flex-shrink-0 flex items-center justify-center ml-3 transition-all duration-200 ${Ne.includes(Se.id)?"bg-custom-purple border-custom-purple":"border-gray-300 dark:border-gray-500"}`,children:Ne.includes(Se.id)&&a.jsx("svg",{className:"w-3 h-3 text-white fill-current",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M0 11l2-2 5 5L18 3l2 2L7 18z"})})}),a.jsx(Se.icon,{className:`w-6 h-6 ml-2 transition-colors ${Ne.includes(Se.id)?"text-custom-purple":"text-gray-500 dark:text-gray-400"}`}),a.jsx("span",{className:`font-semibold transition-colors ${Ne.includes(Se.id)?"text-custom-purple dark:text-custom-light-purple":"text-gray-800 dark:text-gray-200"}`,children:Se.name})]},Se.id))})]}),a.jsx(Ar,{icon:Qa,id:"edit_capacity",label:"ظرفیت حمل",placeholder:"به کیلوگرم",type:"number",value:xe,onChange:Se=>ee(Se.target.value),className:"mt-6"}),a.jsx($p,{icon:hs,id:"edit_description",label:"توضیحات",placeholder:f==="trip"?"توضیحات سفر...":"توضیحات همسفری...",value:Te,onChange:Se=>ze(Se.target.value),className:"mt-6"})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"اطلاعات تماس"}),a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Ks,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"آیا شماره شما نمایش داده شود؟"})]})]}),a.jsx(Gp,{enabled:Be,setEnabled:k})]})]}),a.jsxs("div",{className:"flex justify-end gap-4",children:[a.jsx("button",{type:"button",onClick:()=>O(!1),disabled:Z,className:"px-6 py-3 bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 font-bold rounded-lg transition-colors duration-300 disabled:opacity-50",children:"لغو"}),a.jsxs("button",{type:"submit",disabled:Z,className:"px-6 py-3 bg-custom-purple hover:bg-custom-light-purple text-white font-bold rounded-lg transition-colors duration-300 shadow-lg hover:shadow-xl disabled:opacity-50 flex items-center gap-2",children:[Z&&a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}),"ذخیره تغییرات"]})]}),a.jsx(Y0,{isOpen:A.isOpen,onClose:$t,onConfirm:Gt,field:A.field})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:f==="trip"?`سفر از ${g.origin_city} به ${g.destination_city}`:`همسفری از ${g.origin_city} به ${g.destination_city}`}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:f==="trip"?"جزئیات کامل سفر":"جزئیات کامل اعلام آمادگی"})]}),a.jsx("div",{className:"flex gap-2",children:a.jsx("button",{onClick:()=>b(f==="trip"?"my-trips":"my-companions"),className:"flex items-center gap-2 py-2 px-4 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors",children:"بازگشت"})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:f==="trip"?"جزئیات سفر":"جزئیات اعلام آمادگی همسفری"}),a.jsxs("div",{className:"space-y-4",children:[(g.departure_date||g.available_from)&&a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Yr,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:f==="trip"?"تاریخ حرکت:":"در دسترس از تاریخ:"}),a.jsx("p",{className:"font-medium",children:_n(f==="trip"?g.departure_date:g.available_from)})]})]}),(g.arrival_date||g.available_to)&&a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Yr,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:f==="trip"?"تاریخ رسیدن:":"در دسترس تا تاریخ:"}),a.jsx("p",{className:"font-medium",children:_n(f==="trip"?g.arrival_date:g.available_to)})]})]}),g.capacity&&a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Qa,{className:"w-5 h-5 text-gray-500"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"ظرفیت حمل:"}),a.jsxs("p",{className:"font-medium",children:[g.capacity," کیلوگرم"]})]})]}),f==="trip"&&g.vehicle_type&&a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(lo,{className:"w-5 h-5 text-gray-500"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"وسیله نقلیه:"}),a.jsx("p",{className:"font-medium",children:A0(g.vehicle_type)})]})]}),f==="companion"&&g.vehicle_types&&g.vehicle_types.length>0&&a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(lo,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"وسایل نقلیه مورد نظر:"}),a.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:g.vehicle_types.map(Se=>a.jsx("span",{className:"px-3 py-1 bg-custom-purple/10 text-custom-purple dark:bg-custom-purple/20 dark:text-custom-light-purple rounded-full text-sm font-medium",children:A0(Se)},Se))})]})]}),g.description&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[a.jsx(hs,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"توضیحات:"})]}),a.jsx("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed whitespace-pre-line bg-custom-light-bg dark:bg-custom-dark-blue p-3 rounded-lg",children:g.description})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4",children:"آدرس‌های کامل"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsxs("h4",{className:"font-medium text-green-600 dark:text-green-400 mb-2 flex items-center gap-2",children:[a.jsx(Fe,{className:"w-4 h-4"})," مبدأ"]}),a.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-1",children:a.jsxs("span",{className:"font-semibold",children:[g.origin_city,", ",g.origin_country]})}),g.origin_address&&a.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:g.origin_address}),g.origin_coordinates&&a.jsx("a",{href:`https://www.google.com/maps?q=${g.origin_coordinates}`,target:"_blank",rel:"noopener noreferrer",className:"text-custom-purple hover:underline text-sm mt-1 inline-block",children:"نمایش روی نقشه"})]}),a.jsxs("div",{children:[a.jsxs("h4",{className:"font-medium text-red-600 dark:text-red-400 mb-2 flex items-center gap-2",children:[a.jsx(Fe,{className:"w-4 h-4"})," مقصد"]}),a.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-1",children:a.jsxs("span",{className:"font-semibold",children:[g.destination_city,", ",g.destination_country]})}),g.destination_address&&a.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:g.destination_address}),g.destination_coordinates&&a.jsx("a",{href:`https://www.google.com/maps?q=${g.destination_coordinates}`,target:"_blank",rel:"noopener noreferrer",className:"text-custom-purple hover:underline text-sm mt-1 inline-block",children:"نمایش روی نقشه"})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:"وضعیت و اطلاعات"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"وضعیت"}),a.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-bold ${g.status==="active"?"bg-green-500/10 text-green-500":g.status==="pending"?"bg-custom-orange/10 text-custom-orange":"bg-gray-500/10 text-gray-500 dark:bg-gray-400/10 dark:text-gray-400"}`,children:g.status==="active"?"فعال":g.status==="pending"?"در انتظار تایید":"انجام شده"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"تاریخ ثبت"}),a.jsx("span",{className:"font-medium",children:Bp(g.created_at)})]}),g.show_phone&&((ea=g.user)==null?void 0:ea.phone)&&a.jsx("div",{className:"pt-3 border-t border-gray-200 dark:border-gray-700",children:a.jsxs("div",{className:"flex items-center gap-2 text-gray-700 dark:text-gray-300",children:[a.jsx(Ks,{className:"w-5 h-5 text-gray-500"}),a.jsx("span",{className:"font-medium",children:g.user.phone})]})})]})]})]}),N&&a.jsx("div",{className:"lg:col-span-1 space-y-6",children:a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold pb-3 border-b border-gray-200 dark:border-gray-700",children:"عملیات"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[a.jsxs("button",{onClick:()=>O(!0),className:"flex flex-col items-center justify-center gap-2 bg-custom-cyan/10 hover:bg-custom-cyan/20 text-custom-cyan font-bold py-3 px-4 rounded-lg transition-colors",children:[a.jsx($0,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm",children:"ویرایش"})]}),a.jsxs("button",{onClick:Je,disabled:V,className:"flex flex-col items-center justify-center gap-2 bg-red-500/10 hover:bg-red-500/20 text-red-500 font-bold py-3 px-4 rounded-lg transition-colors disabled:opacity-50",children:[V?a.jsx("div",{className:"w-5 h-5 border-2 border-red-500 border-t-transparent rounded-full animate-spin"}):a.jsx(ph,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm",children:V?"حذف...":"حذف"})]})]})]})})]}),a.jsx(Y0,{isOpen:A.isOpen,onClose:$t,onConfirm:Gt,field:A.field})]}):a.jsx("div",{className:"text-center py-12",children:"اطلاعاتی یافت نشد."})},Y0=({isOpen:c,onClose:b,onConfirm:N,field:f})=>{const g=y.useRef(null),v=y.useRef(null),H=y.useRef(null),[S,T]=y.useState(null),[_,G]=y.useState(""),[O,Z]=y.useState(!1);y.useEffect(()=>{if(!c)return;const m=()=>{g.current&&(g.current.remove(),g.current=null),v.current=null,T(null),G("")};if(H.current&&!g.current){const j=L.map(H.current).setView([35.6892,51.389],10);g.current=j,L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(j),j.on("click",R=>{const{lat:U,lng:de}=R.latlng;T({lat:U,lng:de}),v.current?v.current.setLatLng(R.latlng):v.current=L.marker(R.latlng).addTo(g.current)}),setTimeout(()=>j.invalidateSize(),100)}return m},[c]);const X=async()=>{if(_.trim()){Z(!0);try{const m=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(_)}&accept-language=fa`);if(!m.ok)throw new Error("جستجو ناموفق بود");const j=await m.json();if(j&&j.length>0){const{lat:R,lon:U}=j[0],de={lat:parseFloat(R),lng:parseFloat(U)};T(de),g.current&&(g.current.setView(de,15),v.current?v.current.setLatLng(de):v.current=L.marker(de).addTo(g.current))}}catch(m){console.error("Geocoding error:",m)}finally{Z(!1)}}},V=async()=>{navigator.geolocation&&navigator.geolocation.getCurrentPosition(m=>{const{lat:j,lng:R}=m.coords,U={lat:j,lng:R};T(U),g.current&&(g.current.setView(U,15),v.current?v.current.setLatLng(U):v.current=L.marker(U).addTo(g.current))},m=>console.error("Geolocation error:",m.message))},Q=()=>{S&&N(S)};if(!c)return null;const M=f==="origin"?"ثبت موقعیت مبدأ":"ثبت موقعیت مقصد";return a.jsxs("div",{className:"fixed inset-0 bg-black/70 z-50 flex items-center justify-center p-4 backdrop-blur-sm",onClick:b,children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light w-full max-w-2xl rounded-2xl shadow-2xl border border-gray-200 dark:border-gray-700/50 transform transition-all duration-300 ease-out scale-95 opacity-0 animate-fade-in-scale overflow-hidden",onClick:m=>m.stopPropagation(),children:[a.jsxs("div",{className:"flex justify-between items-center p-5 bg-custom-light-bg dark:bg-custom-dark-blue",children:[a.jsxs("h2",{className:"text-xl font-bold flex items-center gap-3",children:[a.jsx(Fe,{className:"w-6 h-6 text-custom-purple"})," ",M]}),a.jsx("button",{onClick:b,className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",children:a.jsx(Oa,{className:"w-6 h-6 text-gray-500 dark:text-gray-400"})})]}),a.jsxs("div",{className:"p-6 space-y-5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative flex-grow",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(fa,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:"text",value:_,onChange:m=>G(m.target.value),onKeyDown:m=>{m.key==="Enter"&&X()},placeholder:"جستجوی آدرس یا مکان...",className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition"})]}),a.jsx("button",{onClick:X,disabled:O,className:"flex-shrink-0 flex items-center justify-center w-28 py-2.5 px-4 rounded-lg bg-custom-purple text-white font-semibold hover:bg-custom-light-purple transition-colors disabled:bg-gray-400 disabled:cursor-wait",children:O?a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}):a.jsx("span",{children:"جستجو"})})]}),a.jsxs("button",{onClick:V,className:"w-full flex items-center justify-center gap-2 py-3 px-4 rounded-xl bg-gradient-to-br from-custom-cyan to-teal-400 text-white font-semibold hover:shadow-lg hover:shadow-custom-cyan/30 transition-all duration-300 transform hover:-translate-y-0.5",children:[a.jsx(io,{className:"w-5 h-5"}),a.jsx("span",{children:"استفاده از موقعیت فعلی من"})]}),a.jsxs("div",{className:"relative my-4",children:[a.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true",children:a.jsx("div",{className:"w-full border-t border-gray-300 dark:border-gray-600"})}),a.jsx("div",{className:"relative flex justify-center",children:a.jsx("span",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light px-3 text-sm text-gray-500 dark:text-gray-400",children:"یا"})})]}),a.jsx("p",{className:"text-center text-sm text-gray-500 dark:text-gray-400 -mt-2 mb-2",children:"برای انتخاب، روی نقشه کلیک کنید."}),a.jsx("div",{ref:H,className:"w-full h-80 bg-gray-200 dark:bg-gray-700 rounded-xl cursor-pointer z-0 border border-gray-300 dark:border-gray-600 shadow-inner"})]}),a.jsxs("div",{className:"px-6 py-4 bg-custom-light-bg dark:bg-custom-dark-blue border-t border-gray-200 dark:border-gray-700 flex justify-between items-center",children:[a.jsx("button",{onClick:b,className:"py-2 px-5 rounded-lg text-gray-700 dark:text-gray-300 font-semibold hover:bg-gray-200 dark:hover:bg-gray-700/50 transition-colors",children:"انصراف"}),a.jsx("button",{onClick:Q,disabled:!S,className:"py-2.5 px-6 rounded-xl bg-gradient-to-br from-custom-purple to-custom-light-purple text-white font-semibold hover:shadow-lg hover:shadow-custom-purple/30 transition-all duration-300 disabled:from-gray-400 disabled:to-gray-500 disabled:shadow-none disabled:cursor-not-allowed transform disabled:transform-none hover:-translate-y-0.5",children:"تایید موقعیت"})]})]}),a.jsx("style",{children:"@keyframes fade-in-scale { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } } .animate-fade-in-scale { animation: fade-in-scale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; } .leaflet-container { font-family: 'Vazirmatn', sans-serif; }"})]})};/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qp=c=>c.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Zp=c=>c.replace(/^([A-Z])|[\s-_]+(\w)/g,(b,N,f)=>f?f.toUpperCase():N.toLowerCase()),z0=c=>{const b=Zp(c);return b.charAt(0).toUpperCase()+b.slice(1)},Q0=(...c)=>c.filter((b,N,f)=>!!b&&b.trim()!==""&&f.indexOf(b)===N).join(" ").trim(),Xp=c=>{for(const b in c)if(b.startsWith("aria-")||b==="role"||b==="title")return!0};/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var Fp={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.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wp=y.forwardRef(({color:c="currentColor",size:b=24,strokeWidth:N=2,absoluteStrokeWidth:f,className:g="",children:v,iconNode:H,...S},T)=>y.createElement("svg",{ref:T,...Fp,width:b,height:b,stroke:c,strokeWidth:f?Number(N)*24/Number(b):N,className:Q0("lucide",g),...!v&&!Xp(S)&&{"aria-hidden":"true"},...S},[...H.map(([_,G])=>y.createElement(_,G)),...Array.isArray(v)?v:[v]]));/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pt=(c,b)=>{const N=y.forwardRef(({className:f,...g},v)=>y.createElement(Wp,{ref:v,iconNode:b,className:Q0(`lucide-${Qp(z0(c))}`,`lucide-${c}`,f),...g}));return N.displayName=z0(c),N};/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Jp=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Kp=Pt("arrow-left",Jp);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ip=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Pp=Pt("chevron-down",Ip);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ey=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],R0=Pt("cloud-upload",ey);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ty=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],Sn=Pt("dollar-sign",ty);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ay=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Wc=Pt("globe",ay);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sy=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],ly=Pt("house",sy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ry=[["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"}]],ny=Pt("image",ry);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],oy=Pt("info",iy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cy=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],sh=Pt("link",cy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dy=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Jc=Pt("list",dy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uy=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],eo=Pt("map-pin",uy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hy=[["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"}]],fy=Pt("package",hy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const my=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],gy=Pt("pencil",my);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xy=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],lh=Pt("phone",xy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const py=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],yy=Pt("shopping-bag",py);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const by=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],vy=Pt("trash-2",by);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jy=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],Ny=Pt("truck",jy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wy=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],rh=Pt("type",wy);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ky=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],_y=Pt("user",ky);/**
 * @license lucide-react v0.561.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Sy=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],nh=Pt("x",Sy),Ts=({id:c,icon:b,label:N,placeholder:f,type:g="text",value:v,onChange:H,min:S,step:T,required:_=!1})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[b&&a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("input",{type:g,id:c,className:`w-full ${b?"pr-10":"pr-4"} pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition`,placeholder:f,value:v??"",onChange:H,min:S,step:T,required:_})]})]}),ih=({id:c,icon:b,label:N,placeholder:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute top-3.5 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("textarea",{id:c,className:"w-full pr-10 pl-4 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition min-h-[100px] resize-y",placeholder:f,value:g,onChange:v})]})]}),Dy=({id:c,icon:b,label:N,children:f,value:g,onChange:v})=>a.jsxs("div",{children:[a.jsx("label",{htmlFor:c,className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:N}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none",children:a.jsx(b,{className:"w-5 h-5 text-gray-400"})}),a.jsx("select",{id:c,className:"w-full appearance-none pr-10 pl-10 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-custom-light-bg dark:bg-custom-dark-blue focus:ring-2 focus:ring-custom-purple focus:border-transparent outline-none transition",value:g,onChange:v,children:f}),a.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:a.jsx(Pp,{className:"w-5 h-5 text-gray-400"})})]})]}),U0=({enabled:c,setEnabled:b})=>a.jsx("button",{type:"button",dir:"ltr",className:`${c?"bg-custom-purple":"bg-gray-200 dark:bg-gray-600"}
          relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent 
          transition-colors duration-200 ease-in-out 
          focus:outline-none focus:ring-2 focus:ring-custom-purple focus:ring-offset-2`,onClick:()=>b(!c),children:a.jsx("span",{"aria-hidden":"true",className:`${c?"translate-x-5":"translate-x-0"}
            pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white 
            shadow-lg ring-0 transition duration-200 ease-in-out`})}),Kc=[{value:"IRT",label:"تومان"},{value:"USD",label:"دلار آمریکا"},{value:"CAD",label:"دلار کانادا"},{value:"IQD",label:"دینار"}],H0=[{value:"electronics",label:"الکترونیک"},{value:"fashion",label:"مد و پوشاک"},{value:"books",label:"کتاب و رسانه"},{value:"home",label:"خانه و آشپزخانه"},{value:"beauty",label:"آرایشی و بهداشتی"},{value:"other",label:"سایر"}],Dn=c=>{if(Array.isArray(c))return c;if(typeof c=="string"&&c.trim()!=="")try{return JSON.parse(c)}catch(b){return console.error("Failed to parse JSON field:",c,b),[]}return[]},q0=({purchaseId:c,type:b,onNavigate:N,isOwnerView:f=!1})=>{var ta,At,Wt,kt;const[g,v]=y.useState(!0),[H,S]=y.useState(null),[T,_]=y.useState(null),[G,O]=y.useState(!1),[Z,X]=y.useState(!1),[V,Q]=y.useState(!1),[M,m]=y.useState(""),[j,R]=y.useState(""),[U,de]=y.useState(""),[pe,z]=y.useState(null),[F,ke]=y.useState(null),[ye,ne]=y.useState(""),[E,fe]=y.useState(""),[be,me]=y.useState(""),[B,oe]=y.useState(""),[Ne,Ae]=y.useState(""),[De,w]=y.useState("IRT"),[q,K]=y.useState(!1),[xe,ee]=y.useState([]),[Te,ze]=y.useState([]),[Be,k]=y.useState([]),[A,ae]=y.useState(""),[ie,we]=y.useState([]),[Ce,We]=y.useState([]),[Je,st]=y.useState(""),[$t,Gt]=y.useState(""),[Vt,bt]=y.useState(""),[ea,Se]=y.useState(""),[le,_e]=y.useState([]),[Ee,ft]=y.useState([]);y.useEffect(()=>{if(!c){S("شناسه نامعتبر است"),v(!1);return}(async()=>{try{v(!0);const tt=localStorage.getItem("auth_token"),Ye=b==="request"?`${et}/online-purchase/request/${c}`:`${et}/online-purchase/shopper/${c}`,Ze=await fetch(Ye,{headers:{"X-Auth-Token":tt}});if(!Ze.ok)throw new Error("خطا در دریافت اطلاعات");const Rt=await Ze.json();if(!Rt.success||!Rt.data)throw new Error("داده‌ای یافت نشد");const $e=Rt.data;_($e),b==="request"?(m($e.title||""),R($e.link||""),de($e.description||""),z($e.delivery_lat?parseFloat($e.delivery_lat):null),ke($e.delivery_lng?parseFloat($e.delivery_lng):null),ne($e.delivery_country||""),fe($e.delivery_city||""),me($e.delivery_address||""),oe($e.item_price?parseFloat($e.item_price):""),Ae($e.proposed_fee?parseFloat($e.proposed_fee):""),w($e.currency||"IRT"),K($e.show_phone||!1),ee($e.images||[])):(ae($e.service_title||""),we(Dn($e.categories)),We(Dn($e.supported_sites)),st($e.country||""),Gt($e.city||""),bt($e.fee_description||""),Se($e.capabilities||""),_e($e.images||[]),K($e.show_phone||!1))}catch(tt){S(tt.message||"خطای ناشناخته")}finally{v(!1)}})()},[c,b]);const he=async()=>{if(confirm("آیا از حذف اطمینان دارید؟")){Q(!0);try{const ge=localStorage.getItem("auth_token"),tt=b==="request"?`${et}/online-purchase/request/${c}`:`${et}/online-purchase/shopper/${c}`,Ze=await(await fetch(tt,{method:"DELETE",headers:{"X-Auth-Token":ge}})).json();if(Ze.success)alert("با موفقیت حذف شد"),N("online-purchase");else throw new Error(Ze.message||"خطا در حذف")}catch(ge){alert(ge.message||"خطا در اتصال")}finally{Q(!1)}}},ot=(ge,tt)=>{if(ge){const Ye=Array.from(ge).map(Ze=>({id:Date.now()+Math.random(),url:URL.createObjectURL(Ze),file:Ze}));tt==="request"?k(Ze=>[...Ze,...Ye]):_e(Ze=>[...Ze,...Ye])}},Ge=(ge,tt)=>{if(tt==="request"){const Ye=xe.find(Ze=>Ze.id===ge);Ye&&URL.revokeObjectURL(Ye.url),ee(Ze=>Ze.filter(Rt=>Rt.id!==ge)),ze(Ze=>[...Ze,ge])}else{const Ye=le.findIndex(Ze=>Ze.id===ge);if(Ye>-1){const Ze=le[Ye];Ze.url.startsWith("blob:")&&URL.revokeObjectURL(Ze.url);const Rt=[...le];Rt.splice(Ye,1),_e(Rt),ft($e=>[...$e,ge])}}},Lt=async ge=>{ge.preventDefault(),X(!0);try{const tt=localStorage.getItem("auth_token"),Ye=new FormData;b==="request"?(Ye.append("title",M),j&&Ye.append("link",j),U&&Ye.append("description",U),pe&&Ye.append("delivery_lat",String(pe)),F&&Ye.append("delivery_lng",String(F)),Ye.append("delivery_country",ye),Ye.append("delivery_city",E),Ye.append("delivery_address",be),Ye.append("item_price",String(B)),Ye.append("proposed_fee",String(Ne)),Ye.append("currency",De),Ye.append("show_phone",q?"1":"0"),Te.forEach(I=>Ye.append("deleted_images[]",String(I))),Be.forEach(I=>Ye.append("images[]",I.file))):(Ye.append("service_title",A),Ye.append("country",Je),Ye.append("city",$t),Vt&&Ye.append("fee_description",Vt),ea&&Ye.append("capabilities",ea),Ye.append("show_phone",q?"1":"0"),ie.forEach(I=>Ye.append("categories[]",I)),Ce.forEach(I=>Ye.append("supported_sites[]",I)),Ee.forEach(I=>Ye.append("deleted_images[]",String(I))),le.filter(I=>I.file).forEach(I=>Ye.append("images[]",I.file))),Ye.append("_method","PUT");const Ze=b==="request"?`${et}/online-purchase/request/${c}`:`${et}/online-purchase/shopper/${c}`,$e=await(await fetch(Ze,{method:"POST",headers:{"X-Auth-Token":tt},body:Ye})).json();if($e.success){alert("تغییرات با موفقیت ذخیره شد"),O(!1);const I=$e.data;_(I),b==="request"?(m(I.title||""),R(I.link||""),de(I.description||""),z(I.delivery_lat?parseFloat(I.delivery_lat):null),ke(I.delivery_lng?parseFloat(I.delivery_lng):null),ne(I.delivery_country||""),fe(I.delivery_city||""),me(I.delivery_address||""),oe(I.item_price?parseFloat(I.item_price):""),Ae(I.proposed_fee?parseFloat(I.proposed_fee):""),w(I.currency||"IRT"),K(I.show_phone||!1),ee(I.images||[]),k([]),ze([])):(ae(I.service_title||""),we(Dn(I.categories)),We(Dn(I.supported_sites)),st(I.country||""),Gt(I.city||""),bt(I.fee_description||""),Se(I.capabilities||""),_e(I.images||[]),K(I.show_phone||!1),ft([]))}else throw new Error($e.message||"خطا در ذخیره")}catch(tt){alert(tt.message||"خطا در ارسال")}finally{X(!1)}};if(g)return a.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:a.jsx("div",{className:"w-12 h-12 border-4 border-custom-purple border-t-transparent rounded-full animate-spin"})});if(H||!T)return a.jsxs("div",{className:"text-center py-12",children:[a.jsx("p",{className:"text-red-500 mb-4",children:H||"اطلاعات یافت نشد"}),a.jsxs("button",{onClick:()=>N("online-purchase"),className:"flex items-center gap-2 text-custom-purple hover:underline",children:[a.jsx(Kp,{className:"w-4 h-4"})," بازگشت"]})]});const Re=T;return G&&b==="request"?a.jsxs("form",{onSubmit:Lt,className:"space-y-8",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"ویرایش درخواست خرید"}),a.jsx("button",{type:"button",onClick:()=>O(!1),className:"flex items-center gap-2 py-2 px-4 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors",children:a.jsx("span",{children:"بازگشت به نمایش"})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-1 space-y-6",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4",children:"تصاویر کالا"}),a.jsxs("label",{htmlFor:"file-upload-request",className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer bg-custom-light-bg dark:bg-custom-dark-blue hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[a.jsx(R0,{className:"w-10 h-10 mb-3 text-gray-400"}),a.jsxs("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[a.jsx("span",{className:"font-semibold",children:"برای آپلود کلیک کنید"})," یا بکشید"]}),a.jsx("p",{className:"text-xs text-gray-400",children:"فرمت‌های مجاز: JPG, PNG, GIF"})]}),a.jsx("input",{id:"file-upload-request",type:"file",className:"hidden",multiple:!0,accept:"image/jpeg,image/png,image/gif",onChange:ge=>ot(ge.target.files,"request")})]})]}),(xe.length>0||Be.length>0)&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4",children:["پیش‌نمایش (",xe.length+Be.length," تصویر)"]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[xe.map(ge=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:`${ge.url}`,alt:"تصویر",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{type:"button",onClick:()=>Ge(ge.id,"request"),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(nh,{className:"w-4 h-4"})})]},ge.id)),Be.map((ge,tt)=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:ge.url,alt:"جدید",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{type:"button",onClick:()=>k(Ye=>Ye.filter((Ze,Rt)=>Rt!==tt)),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(nh,{className:"w-4 h-4"})})]},`new-${tt}`))]})]})]}),a.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۱. اطلاعات کالا"}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(Ts,{icon:rh,id:"title",placeholder:"مثال: گوشی موبایل سامسونگ",label:"عنوان کالا *",value:M,onChange:ge=>m(ge.target.value),required:!0}),a.jsx(Ts,{icon:sh,id:"link",placeholder:"https://example.com/product",label:"لینک خرید (اختیاری)",value:j,onChange:ge=>R(ge.target.value)}),a.jsx(ih,{icon:Jc,id:"description",placeholder:"جزئیات بیشتر در مورد کالا...",label:"توضیحات (اختیاری)",value:U,onChange:ge=>de(ge.target.value)})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۲. محل تحویل کالا"}),a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-xl p-4 space-y-4",children:[a.jsx("h3",{className:"font-semibold text-lg text-gray-800 dark:text-gray-200",children:"مقصد تحویل"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsx(Ts,{icon:Wc,id:"delivery_country",placeholder:"مثال: ایران",label:"کشور (اختیاری)",value:ye,onChange:ge=>ne(ge.target.value)}),a.jsx(Ts,{icon:eo,id:"delivery_city",placeholder:"مثال: تهران",label:"شهر (اختیاری)",value:E,onChange:ge=>fe(ge.target.value)})]}),a.jsx(Ts,{icon:ly,id:"delivery_address",placeholder:"آدرس کامل محل تحویل",label:"آدرس دستی (اختیاری)",value:be,onChange:ge=>me(ge.target.value)})]})})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. قیمت‌گذاری و اطلاعات تماس"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(Ts,{icon:Sn,id:"item_price",placeholder:"مثال: 5000000",label:"قیمت کالا *",type:"number",min:"0",step:"1000",value:B,onChange:ge=>oe(ge.target.value),required:!0}),a.jsx(Ts,{icon:Sn,id:"proposed_fee",placeholder:"مثال: 200000",label:"هزینه پیشنهادی *",type:"number",min:"0",step:"1000",value:Ne,onChange:ge=>Ae(ge.target.value),required:!0})]}),a.jsx(Dy,{id:"currency",icon:Sn,label:"واحد پولی *",value:De,onChange:ge=>w(ge.target.value),children:Kc.map(({value:ge,label:tt})=>a.jsx("option",{value:ge,children:tt},ge))}),a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(lh,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(U0,{enabled:q,setEnabled:K})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-4",children:[a.jsx("button",{type:"button",onClick:()=>O(!1),disabled:Z,className:"px-6 py-3 bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 font-bold rounded-lg transition-colors duration-300 disabled:opacity-50",children:"لغو"}),a.jsxs("button",{type:"submit",disabled:Z,className:"px-6 py-3 bg-custom-purple hover:bg-custom-light-purple text-white font-bold rounded-xl transition-colors shadow-lg hover:shadow-xl disabled:opacity-50 flex items-center gap-2",children:[Z&&a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}),"ذخیره تغییرات"]})]})]})]})]}):G&&b==="shopper"?a.jsxs("form",{onSubmit:Lt,className:"space-y-8",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:"ویرایش پروفایل خریدار"}),a.jsx("button",{type:"button",onClick:()=>O(!1),className:"flex items-center gap-2 py-2 px-4 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-custom-dark-blue transition-colors",children:a.jsx("span",{children:"بازگشت به نمایش"})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-1 space-y-6",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4",children:"تصویر (اختیاری)"}),a.jsxs("label",{htmlFor:"file-upload-shopper",className:"flex flex-col items-center justify-center w-full h-48 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer bg-custom-light-bg dark:bg-custom-dark-blue hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[a.jsx(R0,{className:"w-10 h-10 mb-3 text-gray-400"}),a.jsxs("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[a.jsx("span",{className:"font-semibold",children:"آپلود عکس"})," (اختیاری)"]}),a.jsx("p",{className:"text-xs text-gray-400",children:"فرمت‌های مجاز: JPG, PNG, GIF"})]}),a.jsx("input",{id:"file-upload-shopper",type:"file",className:"hidden",multiple:!0,accept:"image/jpeg,image/png,image/gif",onChange:ge=>ot(ge.target.files,"shopper")})]})]}),le.length>0&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4",children:["پیش‌نمایش (",le.length," تصویر)"]}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:le.map((ge,tt)=>a.jsxs("div",{className:"relative group",children:[a.jsx("img",{src:ge.url,alt:"Preview",className:"w-full h-24 object-cover rounded-md"}),a.jsx("button",{type:"button",onClick:()=>Ge(ge.id||`temp-${tt}`,"shopper"),className:"absolute top-1 right-1 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(nh,{className:"w-4 h-4"})})]},typeof ge.id=="number"?ge.id:`temp-${tt}`))})]})]}),a.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۱. عنوان خدمات شما"}),a.jsx(Ts,{icon:rh,id:"service_title",label:"عنوان خدمات (اختیاری)",placeholder:"مثال: خرید از آمازون، خرید لپ‌تاپ و موبایل",value:A,onChange:ge=>ae(ge.target.value)})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۲. دسته‌بندی کالاهای قابل خرید"}),a.jsxs("div",{className:"mt-4",children:[a.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:"دسته‌بندی‌هایی که می‌توانید از آن‌ها خرید کنید را انتخاب نمایید:"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:H0.map(ge=>a.jsxs("label",{className:`flex items-center p-3 border rounded-lg cursor-pointer transition-all duration-200 ${ie.includes(ge.value)?"bg-custom-purple/10 border-custom-purple ring-2 ring-custom-purple/50 dark:bg-custom-purple/20":"bg-custom-light-bg dark:bg-custom-dark-blue border-gray-300 dark:border-gray-600 hover:border-custom-purple/50"}`,children:[a.jsx("input",{type:"checkbox",checked:ie.includes(ge.value),onChange:tt=>{tt.target.checked?we(Ye=>[...Ye,ge.value]):we(Ye=>Ye.filter(Ze=>Ze!==ge.value))},className:"sr-only"}),a.jsx("div",{className:`w-5 h-5 border-2 rounded flex-shrink-0 flex items-center justify-center ml-3 transition-all duration-200 ${ie.includes(ge.value)?"bg-custom-purple border-custom-purple":"border-gray-300 dark:border-gray-500"}`,children:ie.includes(ge.value)&&a.jsx("svg",{className:"w-3 h-3 text-white fill-current",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M0 11l2-2 5 5L18 3l2 2L7 18z"})})}),a.jsx("span",{className:`font-semibold transition-colors ${ie.includes(ge.value)?"text-custom-purple dark:text-custom-light-purple":"text-gray-800 dark:text-gray-200"}`,children:ge.label})]},ge.value))})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۳. سایت‌هایی که می‌توانید از آن‌ها خرید کنید"}),a.jsxs("div",{className:"mt-4",children:[a.jsx(Ts,{icon:sh,id:"supported_sites",label:"سایت‌ها (با کاما جدا کنید)",placeholder:"مثال: amazon.com, aliexpress.com, ebay.com",value:Ce.join(", "),onChange:ge=>{const Ye=ge.target.value.split(",").map(Ze=>Ze.trim()).filter(Ze=>Ze.length>0);We(Ye)}}),a.jsx("p",{className:"mt-2 text-sm text-gray-500 dark:text-gray-400",children:"نام دامنه سایت‌ها را با کاما جدا کنید. (اختیاری)"})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۴. محل فعالیت شما"}),a.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(Ts,{icon:Wc,id:"shopper_country",placeholder:"مثال: آمریکا",label:"کشور *",value:Je,onChange:ge=>st(ge.target.value),required:!0}),a.jsx(Ts,{icon:eo,id:"shopper_city",placeholder:"مثال: نیویورک",label:"شهر *",value:$t,onChange:ge=>Gt(ge.target.value),required:!0})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۵. جزئیات خدمات"}),a.jsxs("div",{className:"mt-6 space-y-6",children:[a.jsx(ih,{icon:Sn,id:"fee_description",label:"توضیحات کارمزد (اختیاری)",placeholder:"نحوه محاسبه کارمزد خود را توضیح دهید...",value:Vt,onChange:ge=>bt(ge.target.value)}),a.jsx(ih,{icon:Jc,id:"capabilities",label:"توضیحات بیشتر (اختیاری)",placeholder:"اطلاعات بیشتر در مورد خدماتی که ارائه می‌دهید...",value:ea,onChange:ge=>Se(ge.target.value)})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-8 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-xl font-semibold mb-6 border-b border-gray-200 dark:border-gray-700 pb-4",children:"۶. اطلاعات تماس"}),a.jsxs("div",{className:"flex items-center justify-between bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(lh,{className:"w-5 h-5 text-gray-500 dark:text-gray-400 ml-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:"نمایش شماره تماس"}),a.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"برای هماهنگی شماره شما نمایش داده شود؟"})]})]}),a.jsx(U0,{enabled:q,setEnabled:K})]})]}),a.jsxs("div",{className:"flex justify-end gap-4",children:[a.jsx("button",{type:"button",onClick:()=>O(!1),disabled:Z,className:"px-6 py-3 bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-200 font-bold rounded-lg transition-colors duration-300 disabled:opacity-50",children:"لغو"}),a.jsxs("button",{type:"submit",disabled:Z,className:"px-6 py-3 bg-custom-purple hover:bg-custom-light-purple text-white font-bold rounded-xl transition-colors shadow-lg hover:shadow-xl disabled:opacity-50 flex items-center gap-2",children:[Z&&a.jsx("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}),"ذخیره تغییرات"]})]})]})]})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:a.jsx("div",{className:"flex items-center gap-4",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:b==="request"?Re.title:Re.service_title||"پروفایل خریدار"}),a.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:b==="request"?"جزئیات درخواست خرید آنلاین":"جزئیات پروفایل خریدار"})]})})}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[Re.images&&Re.images.length>0&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(ny,{className:"w-5 h-5 text-custom-purple"})," تصاویر"]}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:Re.images.map(ge=>a.jsx("img",{src:ge.url.startsWith("http")?ge.url:`https://eino.eifa.site/users-api/public${ge.url}`,alt:"تصویر",className:"w-full h-32 object-cover rounded-xl"},ge.id))})]}),b==="request"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(fy,{className:"w-5 h-5 text-custom-purple"})," اطلاعات کالا"]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(rh,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"عنوان:"}),a.jsx("p",{className:"font-medium",children:Re.title})]})]}),Re.link&&a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(sh,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"لینک:"}),a.jsx("a",{href:Re.link,target:"_blank",rel:"noopener noreferrer",className:"text-custom-purple hover:underline block",children:Re.link})]})]}),Re.description&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[a.jsx(Jc,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"توضیحات:"})]}),a.jsx("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed whitespace-pre-line bg-custom-light-bg dark:bg-custom-dark-blue p-3 rounded-lg",children:Re.description})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(Sn,{className:"w-5 h-5 text-custom-purple"})," قیمت‌گذاری"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-xl",children:[a.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"قیمت کالا:"}),a.jsxs("p",{className:"font-bold text-custom-purple",children:[parseFloat(Re.item_price).toLocaleString()," ",((ta=Kc.find(ge=>ge.value===Re.currency))==null?void 0:ta.label)||Re.currency]})]}),a.jsxs("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-xl",children:[a.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"هزینه پیشنهادی:"}),a.jsxs("p",{className:"font-bold text-custom-cyan",children:[parseFloat(Re.proposed_fee).toLocaleString()," ",((At=Kc.find(ge=>ge.value===Re.currency))==null?void 0:At.label)||Re.currency]})]}),a.jsxs("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue p-4 rounded-xl",children:[a.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"جمع کل:"}),a.jsxs("p",{className:"font-bold text-green-500",children:[(parseFloat(Re.item_price)+parseFloat(Re.proposed_fee)).toLocaleString()," ",((Wt=Kc.find(ge=>ge.value===Re.currency))==null?void 0:Wt.label)||Re.currency]})]})]})]}),a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(Ny,{className:"w-5 h-5 text-custom-purple"})," محل تحویل"]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:a.jsxs("div",{children:[a.jsxs("h4",{className:"font-medium text-green-600 dark:text-green-400 mb-2 flex items-center gap-2",children:[a.jsx(eo,{className:"w-4 h-4"})," مقصد تحویل"]}),Re.delivery_country&&a.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-1",children:a.jsx("span",{className:"font-semibold",children:Re.delivery_country})}),Re.delivery_city&&a.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:Re.delivery_city}),Re.delivery_address&&a.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:Re.delivery_address})]})})]})]}),b==="shopper"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(eo,{className:"w-5 h-5 text-custom-purple"})," موقعیت مکانی"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsxs("h4",{className:"font-medium text-green-600 dark:text-green-400 mb-2 flex items-center gap-2",children:[a.jsx(Wc,{className:"w-4 h-4"})," کشور"]}),a.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-1",children:a.jsx("span",{className:"font-semibold",children:Re.country})})]}),a.jsxs("div",{children:[a.jsxs("h4",{className:"font-medium text-green-600 dark:text-green-400 mb-2 flex items-center gap-2",children:[a.jsx(eo,{className:"w-4 h-4"})," شهر"]}),a.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-1",children:a.jsx("span",{className:"font-semibold",children:Re.city})})]})]})]}),(()=>{const ge=Dn(Re.categories);return ge.length>0&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(yy,{className:"w-5 h-5 text-custom-purple"})," دسته‌بندی‌ها"]}),a.jsx("div",{className:"flex flex-wrap gap-2",children:ge.map(tt=>{const Ye=H0.find(Ze=>Ze.value===tt);return a.jsx("span",{className:"px-3 py-1 bg-custom-purple/10 text-custom-purple dark:bg-custom-purple/20 dark:text-custom-light-purple rounded-full text-sm font-medium",children:(Ye==null?void 0:Ye.label)||tt},tt)})})]})})(),(()=>{const ge=Dn(Re.supported_sites);return ge.length>0&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(Wc,{className:"w-5 h-5 text-custom-purple"})," سایت‌های پشتیبانی شده"]}),a.jsx("div",{className:"flex flex-wrap gap-2",children:ge.map(tt=>a.jsx("span",{className:"px-3 py-1 bg-custom-purple/10 text-custom-purple dark:bg-custom-purple/20 dark:text-custom-light-purple rounded-full text-sm font-medium",children:tt},tt))})]})})(),(Re.fee_description||Re.capabilities)&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(oy,{className:"w-5 h-5 text-custom-purple"})," جزئیات خدمات"]}),a.jsxs("div",{className:"space-y-4",children:[Re.fee_description&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[a.jsx(Sn,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"توضیحات کارمزد:"})]}),a.jsx("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed whitespace-pre-line bg-custom-light-bg dark:bg-custom-dark-blue p-3 rounded-lg",children:Re.fee_description})]}),Re.capabilities&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[a.jsx(Jc,{className:"w-5 h-5 text-gray-500 mt-0.5"}),a.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"توضیحات بیشتر:"})]}),a.jsx("p",{className:"text-gray-600 dark:text-gray-300 leading-relaxed whitespace-pre-line bg-custom-light-bg dark:bg-custom-dark-blue p-3 rounded-lg",children:Re.capabilities})]})]})]})]}),Re.show_phone&&((kt=Re.user)==null?void 0:kt.phone)&&a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-4 border-b border-gray-200 dark:border-gray-700 pb-4 flex items-center gap-2",children:[a.jsx(lh,{className:"w-5 h-5 text-custom-purple"})," اطلاعات تماس"]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(_y,{className:"w-10 h-10 text-gray-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-800 dark:text-gray-200",children:Re.user.name}),a.jsx("p",{className:"text-custom-purple",children:Re.user.phone})]})]})]})]}),f&&a.jsx("div",{className:"lg:col-span-1 space-y-6",children:a.jsxs("div",{className:"bg-custom-light-card dark:bg-custom-dark-blue-light p-6 rounded-2xl shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold pb-3 border-b border-gray-200 dark:border-gray-700",children:"عملیات"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[a.jsxs("button",{onClick:()=>O(!0),className:"flex flex-col items-center justify-center gap-2 bg-custom-cyan/10 hover:bg-custom-cyan/20 text-custom-cyan font-bold py-3 px-4 rounded-lg transition-colors",children:[a.jsx(gy,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm",children:"ویرایش"})]}),a.jsxs("button",{onClick:he,disabled:V,className:"flex flex-col items-center justify-center gap-2 bg-red-500/10 hover:bg-red-500/20 text-red-500 font-bold py-3 px-4 rounded-lg transition-colors disabled:opacity-50",children:[V?a.jsx("div",{className:"w-5 h-5 border-2 border-red-500 border-t-transparent rounded-full animate-spin"}):a.jsx(vy,{className:"w-5 h-5"}),a.jsx("span",{className:"text-sm",children:V?"حذف...":"حذف"})]})]})]})})]})]})},My=()=>{const[c,b]=y.useState(!1),[N,f]=y.useState("dark"),[g,v]=y.useState("dashboard"),[H,S]=y.useState(null),[T,_]=y.useState(null),[G,O]=y.useState(null),[Z,X]=y.useState(null),[V,Q]=y.useState(null),[M,m]=y.useState(null),[j,R]=y.useState(!1),[U,de]=y.useState(!1),[pe,z]=y.useState("phone"),[F,ke]=y.useState(null),ye=w=>{ke({text:w,type:"error"}),setTimeout(()=>ke(null),5e3)},ne=w=>{ke({text:w,type:"success"}),setTimeout(()=>ke(null),5e3)},E=async()=>{const w=localStorage.getItem("auth_token");if(!w){de(!1),z("phone");return}try{if((await fetch(`${et}/auth/check`,{headers:{"X-Auth-Token":w,"Content-Type":"application/json"}})).ok)de(!0);else throw new Error("توکن شما منقضی شده است.")}catch{localStorage.removeItem("auth_token"),localStorage.removeItem("auth_phone"),de(!1),z("phone"),ye("لطفاً دوباره وارد شوید.")}};y.useEffect(()=>{E()},[]),y.useEffect(()=>{const w=localStorage.getItem("theme");w&&(w==="light"||w==="dark")?f(w):localStorage.setItem("theme","dark")},[]),y.useEffect(()=>{N==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem("theme",N)},[N]);const fe=()=>{f(w=>w==="dark"?"light":"dark")},be=()=>{b(!c)},me=async(w,q,K)=>{if(S(null),_(null),O(null),X(null),Q(null),m(null),R((K==null?void 0:K.isOwnerView)??!1),w==="ticket-detail"&&q?S(q):w==="shipment-detail"&&q?_(q):w==="trip-detail"&&q&&typeof q=="object"?(O(q.tripId),X(q.type||"trip")):w==="purchase-request-detail"&&q?Q(q):w==="purchase-shopper-detail"&&q&&m(q),w==="logout"){localStorage.removeItem("auth_token"),localStorage.removeItem("auth_phone"),de(!1),z("phone"),v("dashboard");return}await E(),U&&(v(w),b(!1))},B=()=>{switch(g){case"dashboard":return a.jsx(d0,{onNavigate:me});case"register-shipment":return a.jsx(Tx,{showError:ye,showSuccess:ne});case"accept-shipment":return a.jsx(zx,{onNavigate:me});case"my-shipment-requests":return a.jsx(up,{showError:ye,showSuccess:ne,onNavigate:me});case"register-trip":return a.jsx(Hx,{showError:ye,showSuccess:ne});case"accept-companion":return a.jsx(Wx,{onNavigate:me});case"my-trips":return a.jsx(fp,{showError:ye,showSuccess:ne,onNavigate:me});case"new-ticket":return a.jsx(Px,{onNavigate:me});case"register-online-purchase":return a.jsx(ap,{showError:ye,showSuccess:ne});case"accept-online-purchase":return a.jsx(np,{onNavigate:me});case"my-purchase-requests":return a.jsx(cp,{showError:ye,showSuccess:ne,onNavigate:me});case"messages":return a.jsx(gp,{});case"tickets":return a.jsx(vp,{onNavigate:me});case"ticket-detail":return a.jsx(jp,{ticketId:H,onNavigate:me});case"shipment-detail":return a.jsx(Op,{shipmentId:T,onNavigate:me,isOwnerView:j});case"trip-detail":return a.jsx(Vp,{tripId:G,type:Z,onNavigate:me,isOwnerView:j});case"purchase-request-detail":return a.jsx(q0,{purchaseId:V,onNavigate:me,isOwnerView:j,type:"request"});case"purchase-shopper-detail":return a.jsx(q0,{purchaseId:M,onNavigate:me,isOwnerView:j,type:"shopper"});case"account":return a.jsx(Np,{});default:return a.jsx(d0,{onNavigate:me})}},oe=async w=>{try{const q=await fetch(`${et}/auth/request-otp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({phone:w})}),K=await q.json();q.ok?(z("code"),localStorage.setItem("auth_phone",w)):ye(K.error||"خطا در ارسال کد")}catch{ye("اتصال به سرور برقرار نشد")}},Ne=async w=>{const q=localStorage.getItem("auth_phone");if(q)try{const K=await fetch(`${et}/auth/verify-otp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({phone:q,otp:w})}),xe=await K.json();K.ok?(localStorage.setItem("auth_token",xe.token),de(!0)):ye(xe.error||"کد نامعتبر است")}catch{ye("اتصال به سرور برقرار نشد")}},Ae=async()=>{const w=localStorage.getItem("auth_phone");if(w)try{const q=await fetch(`${et}/auth/request-otp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({phone:w})});if(q.ok)ne("کد جدید ارسال شد!");else{const K=await q.json();ye(K.message||"خطا در ارسال مجدد")}}catch{ye("اتصال به سرور برقرار نشد")}};if(!U)return a.jsxs(a.Fragment,{children:[F&&a.jsx("div",{className:`fixed top-4 right-4 px-6 py-3 rounded-lg shadow-lg text-white font-medium z-50 ${F.type==="success"?"bg-green-500":"bg-red-500"}`,children:F.text}),pe==="phone"&&a.jsx(wp,{onLogin:oe,theme:N,toggleTheme:fe}),pe==="code"&&a.jsx(kp,{onVerify:Ne,onResend:Ae,theme:N,toggleTheme:fe})]});const De=g==="messages";return a.jsxs("div",{className:"bg-custom-light-bg dark:bg-custom-dark-blue min-h-screen text-gray-800 dark:text-gray-200 font-sans flex relative",children:[F&&a.jsx("div",{className:`fixed top-4 right-4 px-6 py-3 rounded-lg shadow-lg text-white font-medium z-50 ${F.type==="success"?"bg-green-500":"bg-red-500"}`,children:F.text}),a.jsx(Sx,{isOpen:c,currentPage:g,onNavigate:me}),a.jsxs("div",{className:"flex-1 flex flex-col overflow-x-hidden",children:[a.jsx(Dx,{onMenuClick:be,theme:N,toggleTheme:fe,onNavigate:me}),a.jsx("main",{className:`flex-1 p-4 sm:p-6 lg:p-8 ${De?"flex flex-col":"overflow-y-auto"}`,children:B()})]}),c&&a.jsx("div",{onClick:()=>b(!1),className:"bg-black/50 fixed inset-0 z-30 lg:hidden","aria-hidden":"true"})]})},ha=async(c,b={})=>{const N=localStorage.getItem("auth_token");if(!N)throw localStorage.removeItem("auth_token"),localStorage.removeItem("auth_phone"),window.location.reload(),new Error("Not authenticated");const f=await fetch(c,{...b,headers:{"X-Auth-Token":N,"Content-Type":"application/json",...b.headers}});if(f.status===401)throw localStorage.removeItem("auth_token"),localStorage.removeItem("auth_phone"),window.location.reload(),new Error("Token expired or invalid");if(!f.ok){const g=await f.json().catch(()=>({}));throw new Error(g.error||"خطا در انجام عملیات")}return f},Z0=document.getElementById("root");if(!Z0)throw new Error("Could not find root element to mount to");const Cy=fx.createRoot(Z0);Cy.render(a.jsx(rx.StrictMode,{children:a.jsx(My,{})}));
