454 lines
1.2 MiB
Plaintext
454 lines
1.2 MiB
Plaintext
var m_=e=>{throw TypeError(e)};var zp=(e,t,n)=>t.has(e)||m_("Cannot "+n);var V=(e,t,n)=>(zp(e,t,"read from private field"),n?n.call(e):t.get(e)),ze=(e,t,n)=>t.has(e)?m_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ke=(e,t,n,r)=>(zp(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ot=(e,t,n)=>(zp(e,t,"access private method"),n);var $d=(e,t,n,r)=>({set _(i){ke(e,t,i,n)},get _(){return V(e,t,r)}});function q4(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function cu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bp={exports:{}},dc={},Vp={exports:{}},ut={};/**
|
||
* @license React
|
||
* react.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var h_;function F4(){if(h_)return ut;h_=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function g(B){return B===null||typeof B!="object"?null:(B=p&&B[p]||B["@@iterator"],typeof B=="function"?B:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function N(B,Z,I){this.props=B,this.context=Z,this.refs=_,this.updater=I||x}N.prototype.isReactComponent={},N.prototype.setState=function(B,Z){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,Z,"setState")},N.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function C(){}C.prototype=N.prototype;function k(B,Z,I){this.props=B,this.context=Z,this.refs=_,this.updater=I||x}var P=k.prototype=new C;P.constructor=k,w(P,N.prototype),P.isPureReactComponent=!0;var T=Array.isArray,S=Object.prototype.hasOwnProperty,E={current:null},z={key:!0,ref:!0,__self:!0,__source:!0};function D(B,Z,I){var de,Ne={},_e=null,le=null;if(Z!=null)for(de in Z.ref!==void 0&&(le=Z.ref),Z.key!==void 0&&(_e=""+Z.key),Z)S.call(Z,de)&&!z.hasOwnProperty(de)&&(Ne[de]=Z[de]);var we=arguments.length-2;if(we===1)Ne.children=I;else if(1<we){for(var je=Array(we),Se=0;Se<we;Se++)je[Se]=arguments[Se+2];Ne.children=je}if(B&&B.defaultProps)for(de in we=B.defaultProps,we)Ne[de]===void 0&&(Ne[de]=we[de]);return{$$typeof:e,type:B,key:_e,ref:le,props:Ne,_owner:E.current}}function K(B,Z){return{$$typeof:e,type:B.type,key:Z,ref:B.ref,props:B.props,_owner:B._owner}}function U(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function W(B){var Z={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(I){return Z[I]})}var G=/\/+/g;function R(B,Z){return typeof B=="object"&&B!==null&&B.key!=null?W(""+B.key):Z.toString(36)}function q(B,Z,I,de,Ne){var _e=typeof B;(_e==="undefined"||_e==="boolean")&&(B=null);var le=!1;if(B===null)le=!0;else switch(_e){case"string":case"number":le=!0;break;case"object":switch(B.$$typeof){case e:case t:le=!0}}if(le)return le=B,Ne=Ne(le),B=de===""?"."+R(le,0):de,T(Ne)?(I="",B!=null&&(I=B.replace(G,"$&/")+"/"),q(Ne,Z,I,"",function(Se){return Se})):Ne!=null&&(U(Ne)&&(Ne=K(Ne,I+(!Ne.key||le&&le.key===Ne.key?"":(""+Ne.key).replace(G,"$&/")+"/")+B)),Z.push(Ne)),1;if(le=0,de=de===""?".":de+":",T(B))for(var we=0;we<B.length;we++){_e=B[we];var je=de+R(_e,we);le+=q(_e,Z,I,je,Ne)}else if(je=g(B),typeof je=="function")for(B=je.call(B),we=0;!(_e=B.next()).done;)_e=_e.value,je=de+R(_e,we++),le+=q(_e,Z,I,je,Ne);else if(_e==="object")throw Z=String(B),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.");return le}function J(B,Z,I){if(B==null)return B;var de=[],Ne=0;return q(B,de,"","",function(_e){return Z.call(I,_e,Ne++)}),de}function ae(B){if(B._status===-1){var Z=B._result;Z=Z(),Z.then(function(I){(B._status===0||B._status===-1)&&(B._status=1,B._result=I)},function(I){(B._status===0||B._status===-1)&&(B._status=2,B._result=I)}),B._status===-1&&(B._status=0,B._result=Z)}if(B._status===1)return B._result.default;throw B._result}var re={current:null},L={transition:null},Y={ReactCurrentDispatcher:re,ReactCurrentBatchConfig:L,ReactCurrentOwner:E};function M(){throw Error("act(...) is not supported in production builds of React.")}return ut.Children={map:J,forEach:function(B,Z,I){J(B,function(){Z.apply(this,arguments)},I)},count:function(B){var Z=0;return J(B,function(){Z++}),Z},toArray:function(B){return J(B,function(Z){return Z})||[]},only:function(B){if(!U(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},ut.Component=N,ut.Fragment=n,ut.Profiler=i,ut.PureComponent=k,ut.StrictMode=r,ut.Suspense=d,ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,ut.act=M,ut.cloneElement=function(B,Z,I){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var de=w({},B.props),Ne=B.key,_e=B.ref,le=B._owner;if(Z!=null){if(Z.ref!==void 0&&(_e=Z.ref,le=E.current),Z.key!==void 0&&(Ne=""+Z.key),B.type&&B.type.defaultProps)var we=B.type.defaultProps;for(je in Z)S.call(Z,je)&&!z.hasOwnProperty(je)&&(de[je]=Z[je]===void 0&&we!==void 0?we[je]:Z[je])}var je=arguments.length-2;if(je===1)de.children=I;else if(1<je){we=Array(je);for(var Se=0;Se<je;Se++)we[Se]=arguments[Se+2];de.children=we}return{$$typeof:e,type:B.type,key:Ne,ref:_e,props:de,_owner:le}},ut.createContext=function(B){return B={$$typeof:l,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:o,_context:B},B.Consumer=B},ut.createElement=D,ut.createFactory=function(B){var Z=D.bind(null,B);return Z.type=B,Z},ut.createRef=function(){return{current:null}},ut.forwardRef=function(B){return{$$typeof:u,render:B}},ut.isValidElement=U,ut.lazy=function(B){return{$$typeof:h,_payload:{_status:-1,_result:B},_init:ae}},ut.memo=function(B,Z){return{$$typeof:f,type:B,compare:Z===void 0?null:Z}},ut.startTransition=function(B){var Z=L.transition;L.transition={};try{B()}finally{L.transition=Z}},ut.unstable_act=M,ut.useCallback=function(B,Z){return re.current.useCallback(B,Z)},ut.useContext=function(B){return re.current.useContext(B)},ut.useDebugValue=function(){},ut.useDeferredValue=function(B){return re.current.useDeferredValue(B)},ut.useEffect=function(B,Z){return re.current.useEffect(B,Z)},ut.useId=function(){return re.current.useId()},ut.useImperativeHandle=function(B,Z,I){return re.current.useImperativeHandle(B,Z,I)},ut.useInsertionEffect=function(B,Z){return re.current.useInsertionEffect(B,Z)},ut.useLayoutEffect=function(B,Z){return re.current.useLayoutEffect(B,Z)},ut.useMemo=function(B,Z){return re.current.useMemo(B,Z)},ut.useReducer=function(B,Z,I){return re.current.useReducer(B,Z,I)},ut.useRef=function(B){return re.current.useRef(B)},ut.useState=function(B){return re.current.useState(B)},ut.useSyncExternalStore=function(B,Z,I){return re.current.useSyncExternalStore(B,Z,I)},ut.useTransition=function(){return re.current.useTransition()},ut.version="18.3.1",ut}var p_;function h0(){return p_||(p_=1,Vp.exports=F4()),Vp.exports}/**
|
||
* @license React
|
||
* react-jsx-runtime.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var g_;function z4(){if(g_)return dc;g_=1;var e=h0(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function l(u,d,f){var h,p={},g=null,x=null;f!==void 0&&(g=""+f),d.key!==void 0&&(g=""+d.key),d.ref!==void 0&&(x=d.ref);for(h in d)r.call(d,h)&&!o.hasOwnProperty(h)&&(p[h]=d[h]);if(u&&u.defaultProps)for(h in d=u.defaultProps,d)p[h]===void 0&&(p[h]=d[h]);return{$$typeof:t,type:u,key:g,ref:x,props:p,_owner:i.current}}return dc.Fragment=n,dc.jsx=l,dc.jsxs=l,dc}var y_;function B4(){return y_||(y_=1,Bp.exports=z4()),Bp.exports}var a=B4(),v=h0();const Tn=cu(v),p0=q4({__proto__:null,default:Tn},[v]);var Ud={},$p={exports:{}},Hn={},Up={exports:{}},Wp={};/**
|
||
* @license React
|
||
* scheduler.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var x_;function V4(){return x_||(x_=1,(function(e){function t(L,Y){var M=L.length;L.push(Y);e:for(;0<M;){var B=M-1>>>1,Z=L[B];if(0<i(Z,Y))L[B]=Y,L[M]=Z,M=B;else break e}}function n(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var Y=L[0],M=L.pop();if(M!==Y){L[0]=M;e:for(var B=0,Z=L.length,I=Z>>>1;B<I;){var de=2*(B+1)-1,Ne=L[de],_e=de+1,le=L[_e];if(0>i(Ne,M))_e<Z&&0>i(le,Ne)?(L[B]=le,L[_e]=M,B=_e):(L[B]=Ne,L[de]=M,B=de);else if(_e<Z&&0>i(le,M))L[B]=le,L[_e]=M,B=_e;else break e}}return Y}function i(L,Y){var M=L.sortIndex-Y.sortIndex;return M!==0?M:L.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],f=[],h=1,p=null,g=3,x=!1,w=!1,_=!1,N=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P(L){for(var Y=n(f);Y!==null;){if(Y.callback===null)r(f);else if(Y.startTime<=L)r(f),Y.sortIndex=Y.expirationTime,t(d,Y);else break;Y=n(f)}}function T(L){if(_=!1,P(L),!w)if(n(d)!==null)w=!0,ae(S);else{var Y=n(f);Y!==null&&re(T,Y.startTime-L)}}function S(L,Y){w=!1,_&&(_=!1,C(D),D=-1),x=!0;var M=g;try{for(P(Y),p=n(d);p!==null&&(!(p.expirationTime>Y)||L&&!W());){var B=p.callback;if(typeof B=="function"){p.callback=null,g=p.priorityLevel;var Z=B(p.expirationTime<=Y);Y=e.unstable_now(),typeof Z=="function"?p.callback=Z:p===n(d)&&r(d),P(Y)}else r(d);p=n(d)}if(p!==null)var I=!0;else{var de=n(f);de!==null&&re(T,de.startTime-Y),I=!1}return I}finally{p=null,g=M,x=!1}}var E=!1,z=null,D=-1,K=5,U=-1;function W(){return!(e.unstable_now()-U<K)}function G(){if(z!==null){var L=e.unstable_now();U=L;var Y=!0;try{Y=z(!0,L)}finally{Y?R():(E=!1,z=null)}}else E=!1}var R;if(typeof k=="function")R=function(){k(G)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,J=q.port2;q.port1.onmessage=G,R=function(){J.postMessage(null)}}else R=function(){N(G,0)};function ae(L){z=L,E||(E=!0,R())}function re(L,Y){D=N(function(){L(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){w||x||(w=!0,ae(S))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(L){switch(g){case 1:case 2:case 3:var Y=3;break;default:Y=g}var M=g;g=Y;try{return L()}finally{g=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,Y){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var M=g;g=L;try{return Y()}finally{g=M}},e.unstable_scheduleCallback=function(L,Y,M){var B=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?B+M:B):M=B,L){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=M+Z,L={id:h++,callback:Y,priorityLevel:L,startTime:M,expirationTime:Z,sortIndex:-1},M>B?(L.sortIndex=M,t(f,L),n(d)===null&&L===n(f)&&(_?(C(D),D=-1):_=!0,re(T,M-B))):(L.sortIndex=Z,t(d,L),w||x||(w=!0,ae(S))),L},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(L){var Y=g;return function(){var M=g;g=Y;try{return L.apply(this,arguments)}finally{g=M}}}})(Wp)),Wp}var v_;function $4(){return v_||(v_=1,Up.exports=V4()),Up.exports}/**
|
||
* @license React
|
||
* react-dom.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var b_;function U4(){if(b_)return Hn;b_=1;var e=h0(),t=$4();function n(s){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+s,m=1;m<arguments.length;m++)c+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function o(s,c){l(s,c),l(s+"Capture",c)}function l(s,c){for(i[s]=c,s=0;s<c.length;s++)r.add(c[s])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[: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]*$/,h={},p={};function g(s){return d.call(p,s)?!0:d.call(h,s)?!1:f.test(s)?p[s]=!0:(h[s]=!0,!1)}function x(s,c,m,y){if(m!==null&&m.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return y?!1:m!==null?!m.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function w(s,c,m,y){if(c===null||typeof c>"u"||x(s,c,m,y))return!0;if(y)return!1;if(m!==null)switch(m.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function _(s,c,m,y,b,j,A){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=b,this.mustUseProperty=m,this.propertyName=s,this.type=c,this.sanitizeURL=j,this.removeEmptyString=A}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){N[s]=new _(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var c=s[0];N[c]=new _(c,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){N[s]=new _(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){N[s]=new _(s,2,!1,s,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(s){N[s]=new _(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){N[s]=new _(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){N[s]=new _(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){N[s]=new _(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){N[s]=new _(s,5,!1,s.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function k(s){return s[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(s){var c=s.replace(C,k);N[c]=new _(c,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var c=s.replace(C,k);N[c]=new _(c,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var c=s.replace(C,k);N[c]=new _(c,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){N[s]=new _(s,1,!1,s.toLowerCase(),null,!1,!1)}),N.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){N[s]=new _(s,1,!1,s.toLowerCase(),null,!0,!0)});function P(s,c,m,y){var b=N.hasOwnProperty(c)?N[c]:null;(b!==null?b.type!==0:y||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(w(c,m,b,y)&&(m=null),y||b===null?g(c)&&(m===null?s.removeAttribute(c):s.setAttribute(c,""+m)):b.mustUseProperty?s[b.propertyName]=m===null?b.type===3?!1:"":m:(c=b.attributeName,y=b.attributeNamespace,m===null?s.removeAttribute(c):(b=b.type,m=b===3||b===4&&m===!0?"":""+m,y?s.setAttributeNS(y,c,m):s.setAttribute(c,m))))}var T=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for("react.element"),E=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),U=Symbol.for("react.provider"),W=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),re=Symbol.for("react.offscreen"),L=Symbol.iterator;function Y(s){return s===null||typeof s!="object"?null:(s=L&&s[L]||s["@@iterator"],typeof s=="function"?s:null)}var M=Object.assign,B;function Z(s){if(B===void 0)try{throw Error()}catch(m){var c=m.stack.trim().match(/\n( *(at )?)/);B=c&&c[1]||""}return`
|
||
`+B+s}var I=!1;function de(s,c){if(!s||I)return"";I=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(ee){var y=ee}Reflect.construct(s,[],c)}else{try{c.call()}catch(ee){y=ee}s.call(c.prototype)}else{try{throw Error()}catch(ee){y=ee}s()}}catch(ee){if(ee&&y&&typeof ee.stack=="string"){for(var b=ee.stack.split(`
|
||
`),j=y.stack.split(`
|
||
`),A=b.length-1,F=j.length-1;1<=A&&0<=F&&b[A]!==j[F];)F--;for(;1<=A&&0<=F;A--,F--)if(b[A]!==j[F]){if(A!==1||F!==1)do if(A--,F--,0>F||b[A]!==j[F]){var $=`
|
||
`+b[A].replace(" at new "," at ");return s.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",s.displayName)),$}while(1<=A&&0<=F);break}}}finally{I=!1,Error.prepareStackTrace=m}return(s=s?s.displayName||s.name:"")?Z(s):""}function Ne(s){switch(s.tag){case 5:return Z(s.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return s=de(s.type,!1),s;case 11:return s=de(s.type.render,!1),s;case 1:return s=de(s.type,!0),s;default:return""}}function _e(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case z:return"Fragment";case E:return"Portal";case K:return"Profiler";case D:return"StrictMode";case R:return"Suspense";case q:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case W:return(s.displayName||"Context")+".Consumer";case U:return(s._context.displayName||"Context")+".Provider";case G:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case J:return c=s.displayName||null,c!==null?c:_e(s.type)||"Memo";case ae:c=s._payload,s=s._init;try{return _e(s(c))}catch{}}return null}function le(s){var c=s.type;switch(s.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=c.render,s=s.displayName||s.name||"",c.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _e(c);case 8:return c===D?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function we(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function je(s){var c=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Se(s){var c=je(s)?"checked":"value",m=Object.getOwnPropertyDescriptor(s.constructor.prototype,c),y=""+s[c];if(!s.hasOwnProperty(c)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var b=m.get,j=m.set;return Object.defineProperty(s,c,{configurable:!0,get:function(){return b.call(this)},set:function(A){y=""+A,j.call(this,A)}}),Object.defineProperty(s,c,{enumerable:m.enumerable}),{getValue:function(){return y},setValue:function(A){y=""+A},stopTracking:function(){s._valueTracker=null,delete s[c]}}}}function se(s){s._valueTracker||(s._valueTracker=Se(s))}function be(s){if(!s)return!1;var c=s._valueTracker;if(!c)return!0;var m=c.getValue(),y="";return s&&(y=je(s)?s.checked?"true":"false":s.value),s=y,s!==m?(c.setValue(s),!0):!1}function ce(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Pe(s,c){var m=c.checked;return M({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??s._wrapperState.initialChecked})}function Mt(s,c){var m=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;m=we(c.value!=null?c.value:m),s._wrapperState={initialChecked:y,initialValue:m,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function Rt(s,c){c=c.checked,c!=null&&P(s,"checked",c,!1)}function pe(s,c){Rt(s,c);var m=we(c.value),y=c.type;if(m!=null)y==="number"?(m===0&&s.value===""||s.value!=m)&&(s.value=""+m):s.value!==""+m&&(s.value=""+m);else if(y==="submit"||y==="reset"){s.removeAttribute("value");return}c.hasOwnProperty("value")?rt(s,c.type,m):c.hasOwnProperty("defaultValue")&&rt(s,c.type,we(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(s.defaultChecked=!!c.defaultChecked)}function Ye(s,c,m){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+s._wrapperState.initialValue,m||c===s.value||(s.value=c),s.defaultValue=c}m=s.name,m!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,m!==""&&(s.name=m)}function rt(s,c,m){(c!=="number"||ce(s.ownerDocument)!==s)&&(m==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+m&&(s.defaultValue=""+m))}var te=Array.isArray;function xe(s,c,m,y){if(s=s.options,c){c={};for(var b=0;b<m.length;b++)c["$"+m[b]]=!0;for(m=0;m<s.length;m++)b=c.hasOwnProperty("$"+s[m].value),s[m].selected!==b&&(s[m].selected=b),b&&y&&(s[m].defaultSelected=!0)}else{for(m=""+we(m),c=null,b=0;b<s.length;b++){if(s[b].value===m){s[b].selected=!0,y&&(s[b].defaultSelected=!0);return}c!==null||s[b].disabled||(c=s[b])}c!==null&&(c.selected=!0)}}function Je(s,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return M({},c,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function We(s,c){var m=c.value;if(m==null){if(m=c.children,c=c.defaultValue,m!=null){if(c!=null)throw Error(n(92));if(te(m)){if(1<m.length)throw Error(n(93));m=m[0]}c=m}c==null&&(c=""),m=c}s._wrapperState={initialValue:we(m)}}function Ct(s,c){var m=we(c.value),y=we(c.defaultValue);m!=null&&(m=""+m,m!==s.value&&(s.value=m),c.defaultValue==null&&s.defaultValue!==m&&(s.defaultValue=m)),y!=null&&(s.defaultValue=""+y)}function gt(s){var c=s.textContent;c===s._wrapperState.initialValue&&c!==""&&c!==null&&(s.value=c)}function ie(s){switch(s){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ge(s,c){return s==null||s==="http://www.w3.org/1999/xhtml"?ie(c):s==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var De,qe=(function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,m,y,b){MSApp.execUnsafeLocalFunction(function(){return s(c,m,y,b)})}:s})(function(s,c){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=c;else{for(De=De||document.createElement("div"),De.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=De.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;c.firstChild;)s.appendChild(c.firstChild)}});function Ve(s,c){if(c){var m=s.firstChild;if(m&&m===s.lastChild&&m.nodeType===3){m.nodeValue=c;return}}s.textContent=c}var Ot={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Dr=["Webkit","ms","Moz","O"];Object.keys(Ot).forEach(function(s){Dr.forEach(function(c){c=c+s.charAt(0).toUpperCase()+s.substring(1),Ot[c]=Ot[s]})});function ar(s,c,m){return c==null||typeof c=="boolean"||c===""?"":m||typeof c!="number"||c===0||Ot.hasOwnProperty(s)&&Ot[s]?(""+c).trim():c+"px"}function ea(s,c){s=s.style;for(var m in c)if(c.hasOwnProperty(m)){var y=m.indexOf("--")===0,b=ar(m,c[m],y);m==="float"&&(m="cssFloat"),y?s.setProperty(m,b):s[m]=b}}var Za=M({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yn(s,c){if(c){if(Za[s]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,s));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function ti(s,c){if(s.indexOf("-")===-1)return typeof c.is=="string";switch(s){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 sr=null;function th(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var nh=null,to=null,no=null;function Tv(s){if(s=Yl(s)){if(typeof nh!="function")throw Error(n(280));var c=s.stateNode;c&&(c=id(c),nh(s.stateNode,s.type,c))}}function Av(s){to?no?no.push(s):no=[s]:to=s}function Mv(){if(to){var s=to,c=no;if(no=to=null,Tv(s),c)for(s=0;s<c.length;s++)Tv(c[s])}}function Rv(s,c){return s(c)}function Ov(){}var rh=!1;function Iv(s,c,m){if(rh)return s(c,m);rh=!0;try{return Rv(s,c,m)}finally{rh=!1,(to!==null||no!==null)&&(Ov(),Mv())}}function El(s,c){var m=s.stateNode;if(m===null)return null;var y=id(m);if(y===null)return null;m=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(s=s.type,y=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!y;break e;default:s=!1}if(s)return null;if(m&&typeof m!="function")throw Error(n(231,c,typeof m));return m}var ih=!1;if(u)try{var Tl={};Object.defineProperty(Tl,"passive",{get:function(){ih=!0}}),window.addEventListener("test",Tl,Tl),window.removeEventListener("test",Tl,Tl)}catch{ih=!1}function U2(s,c,m,y,b,j,A,F,$){var ee=Array.prototype.slice.call(arguments,3);try{c.apply(m,ee)}catch(fe){this.onError(fe)}}var Al=!1,Du=null,Lu=!1,ah=null,W2={onError:function(s){Al=!0,Du=s}};function H2(s,c,m,y,b,j,A,F,$){Al=!1,Du=null,U2.apply(W2,arguments)}function K2(s,c,m,y,b,j,A,F,$){if(H2.apply(this,arguments),Al){if(Al){var ee=Du;Al=!1,Du=null}else throw Error(n(198));Lu||(Lu=!0,ah=ee)}}function es(s){var c=s,m=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,(c.flags&4098)!==0&&(m=c.return),s=c.return;while(s)}return c.tag===3?m:null}function Dv(s){if(s.tag===13){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function Lv(s){if(es(s)!==s)throw Error(n(188))}function G2(s){var c=s.alternate;if(!c){if(c=es(s),c===null)throw Error(n(188));return c!==s?null:s}for(var m=s,y=c;;){var b=m.return;if(b===null)break;var j=b.alternate;if(j===null){if(y=b.return,y!==null){m=y;continue}break}if(b.child===j.child){for(j=b.child;j;){if(j===m)return Lv(b),s;if(j===y)return Lv(b),c;j=j.sibling}throw Error(n(188))}if(m.return!==y.return)m=b,y=j;else{for(var A=!1,F=b.child;F;){if(F===m){A=!0,m=b,y=j;break}if(F===y){A=!0,y=b,m=j;break}F=F.sibling}if(!A){for(F=j.child;F;){if(F===m){A=!0,m=j,y=b;break}if(F===y){A=!0,y=j,m=b;break}F=F.sibling}if(!A)throw Error(n(189))}}if(m.alternate!==y)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?s:c}function qv(s){return s=G2(s),s!==null?Fv(s):null}function Fv(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var c=Fv(s);if(c!==null)return c;s=s.sibling}return null}var zv=t.unstable_scheduleCallback,Bv=t.unstable_cancelCallback,Q2=t.unstable_shouldYield,Y2=t.unstable_requestPaint,Yt=t.unstable_now,X2=t.unstable_getCurrentPriorityLevel,sh=t.unstable_ImmediatePriority,Vv=t.unstable_UserBlockingPriority,qu=t.unstable_NormalPriority,J2=t.unstable_LowPriority,$v=t.unstable_IdlePriority,Fu=null,ni=null;function Z2(s){if(ni&&typeof ni.onCommitFiberRoot=="function")try{ni.onCommitFiberRoot(Fu,s,void 0,(s.current.flags&128)===128)}catch{}}var Lr=Math.clz32?Math.clz32:nR,eR=Math.log,tR=Math.LN2;function nR(s){return s>>>=0,s===0?32:31-(eR(s)/tR|0)|0}var zu=64,Bu=4194304;function Ml(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function Vu(s,c){var m=s.pendingLanes;if(m===0)return 0;var y=0,b=s.suspendedLanes,j=s.pingedLanes,A=m&268435455;if(A!==0){var F=A&~b;F!==0?y=Ml(F):(j&=A,j!==0&&(y=Ml(j)))}else A=m&~b,A!==0?y=Ml(A):j!==0&&(y=Ml(j));if(y===0)return 0;if(c!==0&&c!==y&&(c&b)===0&&(b=y&-y,j=c&-c,b>=j||b===16&&(j&4194240)!==0))return c;if((y&4)!==0&&(y|=m&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=y;0<c;)m=31-Lr(c),b=1<<m,y|=s[m],c&=~b;return y}function rR(s,c){switch(s){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function iR(s,c){for(var m=s.suspendedLanes,y=s.pingedLanes,b=s.expirationTimes,j=s.pendingLanes;0<j;){var A=31-Lr(j),F=1<<A,$=b[A];$===-1?((F&m)===0||(F&y)!==0)&&(b[A]=rR(F,c)):$<=c&&(s.expiredLanes|=F),j&=~F}}function oh(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function Uv(){var s=zu;return zu<<=1,(zu&4194240)===0&&(zu=64),s}function lh(s){for(var c=[],m=0;31>m;m++)c.push(s);return c}function Rl(s,c,m){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-Lr(c),s[c]=m}function aR(s,c){var m=s.pendingLanes&~c;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=c,s.mutableReadLanes&=c,s.entangledLanes&=c,c=s.entanglements;var y=s.eventTimes;for(s=s.expirationTimes;0<m;){var b=31-Lr(m),j=1<<b;c[b]=0,y[b]=-1,s[b]=-1,m&=~j}}function ch(s,c){var m=s.entangledLanes|=c;for(s=s.entanglements;m;){var y=31-Lr(m),b=1<<y;b&c|s[y]&c&&(s[y]|=c),m&=~b}}var St=0;function Wv(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var Hv,uh,Kv,Gv,Qv,dh=!1,$u=[],ta=null,na=null,ra=null,Ol=new Map,Il=new Map,ia=[],sR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Yv(s,c){switch(s){case"focusin":case"focusout":ta=null;break;case"dragenter":case"dragleave":na=null;break;case"mouseover":case"mouseout":ra=null;break;case"pointerover":case"pointerout":Ol.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Il.delete(c.pointerId)}}function Dl(s,c,m,y,b,j){return s===null||s.nativeEvent!==j?(s={blockedOn:c,domEventName:m,eventSystemFlags:y,nativeEvent:j,targetContainers:[b]},c!==null&&(c=Yl(c),c!==null&&uh(c)),s):(s.eventSystemFlags|=y,c=s.targetContainers,b!==null&&c.indexOf(b)===-1&&c.push(b),s)}function oR(s,c,m,y,b){switch(c){case"focusin":return ta=Dl(ta,s,c,m,y,b),!0;case"dragenter":return na=Dl(na,s,c,m,y,b),!0;case"mouseover":return ra=Dl(ra,s,c,m,y,b),!0;case"pointerover":var j=b.pointerId;return Ol.set(j,Dl(Ol.get(j)||null,s,c,m,y,b)),!0;case"gotpointercapture":return j=b.pointerId,Il.set(j,Dl(Il.get(j)||null,s,c,m,y,b)),!0}return!1}function Xv(s){var c=ts(s.target);if(c!==null){var m=es(c);if(m!==null){if(c=m.tag,c===13){if(c=Dv(m),c!==null){s.blockedOn=c,Qv(s.priority,function(){Kv(m)});return}}else if(c===3&&m.stateNode.current.memoizedState.isDehydrated){s.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Uu(s){if(s.blockedOn!==null)return!1;for(var c=s.targetContainers;0<c.length;){var m=mh(s.domEventName,s.eventSystemFlags,c[0],s.nativeEvent);if(m===null){m=s.nativeEvent;var y=new m.constructor(m.type,m);sr=y,m.target.dispatchEvent(y),sr=null}else return c=Yl(m),c!==null&&uh(c),s.blockedOn=m,!1;c.shift()}return!0}function Jv(s,c,m){Uu(s)&&m.delete(c)}function lR(){dh=!1,ta!==null&&Uu(ta)&&(ta=null),na!==null&&Uu(na)&&(na=null),ra!==null&&Uu(ra)&&(ra=null),Ol.forEach(Jv),Il.forEach(Jv)}function Ll(s,c){s.blockedOn===c&&(s.blockedOn=null,dh||(dh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,lR)))}function ql(s){function c(b){return Ll(b,s)}if(0<$u.length){Ll($u[0],s);for(var m=1;m<$u.length;m++){var y=$u[m];y.blockedOn===s&&(y.blockedOn=null)}}for(ta!==null&&Ll(ta,s),na!==null&&Ll(na,s),ra!==null&&Ll(ra,s),Ol.forEach(c),Il.forEach(c),m=0;m<ia.length;m++)y=ia[m],y.blockedOn===s&&(y.blockedOn=null);for(;0<ia.length&&(m=ia[0],m.blockedOn===null);)Xv(m),m.blockedOn===null&&ia.shift()}var ro=T.ReactCurrentBatchConfig,Wu=!0;function cR(s,c,m,y){var b=St,j=ro.transition;ro.transition=null;try{St=1,fh(s,c,m,y)}finally{St=b,ro.transition=j}}function uR(s,c,m,y){var b=St,j=ro.transition;ro.transition=null;try{St=4,fh(s,c,m,y)}finally{St=b,ro.transition=j}}function fh(s,c,m,y){if(Wu){var b=mh(s,c,m,y);if(b===null)Th(s,c,y,Hu,m),Yv(s,y);else if(oR(b,s,c,m,y))y.stopPropagation();else if(Yv(s,y),c&4&&-1<sR.indexOf(s)){for(;b!==null;){var j=Yl(b);if(j!==null&&Hv(j),j=mh(s,c,m,y),j===null&&Th(s,c,y,Hu,m),j===b)break;b=j}b!==null&&y.stopPropagation()}else Th(s,c,y,null,m)}}var Hu=null;function mh(s,c,m,y){if(Hu=null,s=th(y),s=ts(s),s!==null)if(c=es(s),c===null)s=null;else if(m=c.tag,m===13){if(s=Dv(c),s!==null)return s;s=null}else if(m===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;s=null}else c!==s&&(s=null);return Hu=s,null}function Zv(s){switch(s){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(X2()){case sh:return 1;case Vv:return 4;case qu:case J2:return 16;case $v:return 536870912;default:return 16}default:return 16}}var aa=null,hh=null,Ku=null;function eb(){if(Ku)return Ku;var s,c=hh,m=c.length,y,b="value"in aa?aa.value:aa.textContent,j=b.length;for(s=0;s<m&&c[s]===b[s];s++);var A=m-s;for(y=1;y<=A&&c[m-y]===b[j-y];y++);return Ku=b.slice(s,1<y?1-y:void 0)}function Gu(s){var c=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&c===13&&(s=13)):s=c,s===10&&(s=13),32<=s||s===13?s:0}function Qu(){return!0}function tb(){return!1}function or(s){function c(m,y,b,j,A){this._reactName=m,this._targetInst=b,this.type=y,this.nativeEvent=j,this.target=A,this.currentTarget=null;for(var F in s)s.hasOwnProperty(F)&&(m=s[F],this[F]=m?m(j):j[F]);return this.isDefaultPrevented=(j.defaultPrevented!=null?j.defaultPrevented:j.returnValue===!1)?Qu:tb,this.isPropagationStopped=tb,this}return M(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=Qu)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Qu)},persist:function(){},isPersistent:Qu}),c}var io={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ph=or(io),Fl=M({},io,{view:0,detail:0}),dR=or(Fl),gh,yh,zl,Yu=M({},Fl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vh,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==zl&&(zl&&s.type==="mousemove"?(gh=s.screenX-zl.screenX,yh=s.screenY-zl.screenY):yh=gh=0,zl=s),gh)},movementY:function(s){return"movementY"in s?s.movementY:yh}}),nb=or(Yu),fR=M({},Yu,{dataTransfer:0}),mR=or(fR),hR=M({},Fl,{relatedTarget:0}),xh=or(hR),pR=M({},io,{animationName:0,elapsedTime:0,pseudoElement:0}),gR=or(pR),yR=M({},io,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),xR=or(yR),vR=M({},io,{data:0}),rb=or(vR),bR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wR={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"},_R={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function SR(s){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(s):(s=_R[s])?!!c[s]:!1}function vh(){return SR}var jR=M({},Fl,{key:function(s){if(s.key){var c=bR[s.key]||s.key;if(c!=="Unidentified")return c}return s.type==="keypress"?(s=Gu(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?wR[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vh,charCode:function(s){return s.type==="keypress"?Gu(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Gu(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),NR=or(jR),CR=M({},Yu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ib=or(CR),kR=M({},Fl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vh}),PR=or(kR),ER=M({},io,{propertyName:0,elapsedTime:0,pseudoElement:0}),TR=or(ER),AR=M({},Yu,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),MR=or(AR),RR=[9,13,27,32],bh=u&&"CompositionEvent"in window,Bl=null;u&&"documentMode"in document&&(Bl=document.documentMode);var OR=u&&"TextEvent"in window&&!Bl,ab=u&&(!bh||Bl&&8<Bl&&11>=Bl),sb=" ",ob=!1;function lb(s,c){switch(s){case"keyup":return RR.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cb(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var ao=!1;function IR(s,c){switch(s){case"compositionend":return cb(c);case"keypress":return c.which!==32?null:(ob=!0,sb);case"textInput":return s=c.data,s===sb&&ob?null:s;default:return null}}function DR(s,c){if(ao)return s==="compositionend"||!bh&&lb(s,c)?(s=eb(),Ku=hh=aa=null,ao=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return ab&&c.locale!=="ko"?null:c.data;default:return null}}var LR={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 ub(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c==="input"?!!LR[s.type]:c==="textarea"}function db(s,c,m,y){Av(y),c=td(c,"onChange"),0<c.length&&(m=new ph("onChange","change",null,m,y),s.push({event:m,listeners:c}))}var Vl=null,$l=null;function qR(s){Eb(s,0)}function Xu(s){var c=uo(s);if(be(c))return s}function FR(s,c){if(s==="change")return c}var fb=!1;if(u){var wh;if(u){var _h="oninput"in document;if(!_h){var mb=document.createElement("div");mb.setAttribute("oninput","return;"),_h=typeof mb.oninput=="function"}wh=_h}else wh=!1;fb=wh&&(!document.documentMode||9<document.documentMode)}function hb(){Vl&&(Vl.detachEvent("onpropertychange",pb),$l=Vl=null)}function pb(s){if(s.propertyName==="value"&&Xu($l)){var c=[];db(c,$l,s,th(s)),Iv(qR,c)}}function zR(s,c,m){s==="focusin"?(hb(),Vl=c,$l=m,Vl.attachEvent("onpropertychange",pb)):s==="focusout"&&hb()}function BR(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Xu($l)}function VR(s,c){if(s==="click")return Xu(c)}function $R(s,c){if(s==="input"||s==="change")return Xu(c)}function UR(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var qr=typeof Object.is=="function"?Object.is:UR;function Ul(s,c){if(qr(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var m=Object.keys(s),y=Object.keys(c);if(m.length!==y.length)return!1;for(y=0;y<m.length;y++){var b=m[y];if(!d.call(c,b)||!qr(s[b],c[b]))return!1}return!0}function gb(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function yb(s,c){var m=gb(s);s=0;for(var y;m;){if(m.nodeType===3){if(y=s+m.textContent.length,s<=c&&y>=c)return{node:m,offset:c-s};s=y}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=gb(m)}}function xb(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?xb(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function vb(){for(var s=window,c=ce();c instanceof s.HTMLIFrameElement;){try{var m=typeof c.contentWindow.location.href=="string"}catch{m=!1}if(m)s=c.contentWindow;else break;c=ce(s.document)}return c}function Sh(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}function WR(s){var c=vb(),m=s.focusedElem,y=s.selectionRange;if(c!==m&&m&&m.ownerDocument&&xb(m.ownerDocument.documentElement,m)){if(y!==null&&Sh(m)){if(c=y.start,s=y.end,s===void 0&&(s=c),"selectionStart"in m)m.selectionStart=c,m.selectionEnd=Math.min(s,m.value.length);else if(s=(c=m.ownerDocument||document)&&c.defaultView||window,s.getSelection){s=s.getSelection();var b=m.textContent.length,j=Math.min(y.start,b);y=y.end===void 0?j:Math.min(y.end,b),!s.extend&&j>y&&(b=y,y=j,j=b),b=yb(m,j);var A=yb(m,y);b&&A&&(s.rangeCount!==1||s.anchorNode!==b.node||s.anchorOffset!==b.offset||s.focusNode!==A.node||s.focusOffset!==A.offset)&&(c=c.createRange(),c.setStart(b.node,b.offset),s.removeAllRanges(),j>y?(s.addRange(c),s.extend(A.node,A.offset)):(c.setEnd(A.node,A.offset),s.addRange(c)))}}for(c=[],s=m;s=s.parentNode;)s.nodeType===1&&c.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<c.length;m++)s=c[m],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var HR=u&&"documentMode"in document&&11>=document.documentMode,so=null,jh=null,Wl=null,Nh=!1;function bb(s,c,m){var y=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;Nh||so==null||so!==ce(y)||(y=so,"selectionStart"in y&&Sh(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Wl&&Ul(Wl,y)||(Wl=y,y=td(jh,"onSelect"),0<y.length&&(c=new ph("onSelect","select",null,c,m),s.push({event:c,listeners:y}),c.target=so)))}function Ju(s,c){var m={};return m[s.toLowerCase()]=c.toLowerCase(),m["Webkit"+s]="webkit"+c,m["Moz"+s]="moz"+c,m}var oo={animationend:Ju("Animation","AnimationEnd"),animationiteration:Ju("Animation","AnimationIteration"),animationstart:Ju("Animation","AnimationStart"),transitionend:Ju("Transition","TransitionEnd")},Ch={},wb={};u&&(wb=document.createElement("div").style,"AnimationEvent"in window||(delete oo.animationend.animation,delete oo.animationiteration.animation,delete oo.animationstart.animation),"TransitionEvent"in window||delete oo.transitionend.transition);function Zu(s){if(Ch[s])return Ch[s];if(!oo[s])return s;var c=oo[s],m;for(m in c)if(c.hasOwnProperty(m)&&m in wb)return Ch[s]=c[m];return s}var _b=Zu("animationend"),Sb=Zu("animationiteration"),jb=Zu("animationstart"),Nb=Zu("transitionend"),Cb=new Map,kb="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function sa(s,c){Cb.set(s,c),o(c,[s])}for(var kh=0;kh<kb.length;kh++){var Ph=kb[kh],KR=Ph.toLowerCase(),GR=Ph[0].toUpperCase()+Ph.slice(1);sa(KR,"on"+GR)}sa(_b,"onAnimationEnd"),sa(Sb,"onAnimationIteration"),sa(jb,"onAnimationStart"),sa("dblclick","onDoubleClick"),sa("focusin","onFocus"),sa("focusout","onBlur"),sa(Nb,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hl="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(" "),QR=new Set("cancel close invalid load scroll toggle".split(" ").concat(Hl));function Pb(s,c,m){var y=s.type||"unknown-event";s.currentTarget=m,K2(y,c,void 0,s),s.currentTarget=null}function Eb(s,c){c=(c&4)!==0;for(var m=0;m<s.length;m++){var y=s[m],b=y.event;y=y.listeners;e:{var j=void 0;if(c)for(var A=y.length-1;0<=A;A--){var F=y[A],$=F.instance,ee=F.currentTarget;if(F=F.listener,$!==j&&b.isPropagationStopped())break e;Pb(b,F,ee),j=$}else for(A=0;A<y.length;A++){if(F=y[A],$=F.instance,ee=F.currentTarget,F=F.listener,$!==j&&b.isPropagationStopped())break e;Pb(b,F,ee),j=$}}}if(Lu)throw s=ah,Lu=!1,ah=null,s}function It(s,c){var m=c[Dh];m===void 0&&(m=c[Dh]=new Set);var y=s+"__bubble";m.has(y)||(Tb(c,s,2,!1),m.add(y))}function Eh(s,c,m){var y=0;c&&(y|=4),Tb(m,s,y,c)}var ed="_reactListening"+Math.random().toString(36).slice(2);function Kl(s){if(!s[ed]){s[ed]=!0,r.forEach(function(m){m!=="selectionchange"&&(QR.has(m)||Eh(m,!1,s),Eh(m,!0,s))});var c=s.nodeType===9?s:s.ownerDocument;c===null||c[ed]||(c[ed]=!0,Eh("selectionchange",!1,c))}}function Tb(s,c,m,y){switch(Zv(c)){case 1:var b=cR;break;case 4:b=uR;break;default:b=fh}m=b.bind(null,c,m,s),b=void 0,!ih||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(b=!0),y?b!==void 0?s.addEventListener(c,m,{capture:!0,passive:b}):s.addEventListener(c,m,!0):b!==void 0?s.addEventListener(c,m,{passive:b}):s.addEventListener(c,m,!1)}function Th(s,c,m,y,b){var j=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var A=y.tag;if(A===3||A===4){var F=y.stateNode.containerInfo;if(F===b||F.nodeType===8&&F.parentNode===b)break;if(A===4)for(A=y.return;A!==null;){var $=A.tag;if(($===3||$===4)&&($=A.stateNode.containerInfo,$===b||$.nodeType===8&&$.parentNode===b))return;A=A.return}for(;F!==null;){if(A=ts(F),A===null)return;if($=A.tag,$===5||$===6){y=j=A;continue e}F=F.parentNode}}y=y.return}Iv(function(){var ee=j,fe=th(m),he=[];e:{var ue=Cb.get(s);if(ue!==void 0){var Ee=ph,Me=s;switch(s){case"keypress":if(Gu(m)===0)break e;case"keydown":case"keyup":Ee=NR;break;case"focusin":Me="focus",Ee=xh;break;case"focusout":Me="blur",Ee=xh;break;case"beforeblur":case"afterblur":Ee=xh;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ee=nb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ee=mR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ee=PR;break;case _b:case Sb:case jb:Ee=gR;break;case Nb:Ee=TR;break;case"scroll":Ee=dR;break;case"wheel":Ee=MR;break;case"copy":case"cut":case"paste":Ee=xR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ee=ib}var Ie=(c&4)!==0,Xt=!Ie&&s==="scroll",Q=Ie?ue!==null?ue+"Capture":null:ue;Ie=[];for(var H=ee,X;H!==null;){X=H;var ve=X.stateNode;if(X.tag===5&&ve!==null&&(X=ve,Q!==null&&(ve=El(H,Q),ve!=null&&Ie.push(Gl(H,ve,X)))),Xt)break;H=H.return}0<Ie.length&&(ue=new Ee(ue,Me,null,m,fe),he.push({event:ue,listeners:Ie}))}}if((c&7)===0){e:{if(ue=s==="mouseover"||s==="pointerover",Ee=s==="mouseout"||s==="pointerout",ue&&m!==sr&&(Me=m.relatedTarget||m.fromElement)&&(ts(Me)||Me[Ei]))break e;if((Ee||ue)&&(ue=fe.window===fe?fe:(ue=fe.ownerDocument)?ue.defaultView||ue.parentWindow:window,Ee?(Me=m.relatedTarget||m.toElement,Ee=ee,Me=Me?ts(Me):null,Me!==null&&(Xt=es(Me),Me!==Xt||Me.tag!==5&&Me.tag!==6)&&(Me=null)):(Ee=null,Me=ee),Ee!==Me)){if(Ie=nb,ve="onMouseLeave",Q="onMouseEnter",H="mouse",(s==="pointerout"||s==="pointerover")&&(Ie=ib,ve="onPointerLeave",Q="onPointerEnter",H="pointer"),Xt=Ee==null?ue:uo(Ee),X=Me==null?ue:uo(Me),ue=new Ie(ve,H+"leave",Ee,m,fe),ue.target=Xt,ue.relatedTarget=X,ve=null,ts(fe)===ee&&(Ie=new Ie(Q,H+"enter",Me,m,fe),Ie.target=X,Ie.relatedTarget=Xt,ve=Ie),Xt=ve,Ee&&Me)t:{for(Ie=Ee,Q=Me,H=0,X=Ie;X;X=lo(X))H++;for(X=0,ve=Q;ve;ve=lo(ve))X++;for(;0<H-X;)Ie=lo(Ie),H--;for(;0<X-H;)Q=lo(Q),X--;for(;H--;){if(Ie===Q||Q!==null&&Ie===Q.alternate)break t;Ie=lo(Ie),Q=lo(Q)}Ie=null}else Ie=null;Ee!==null&&Ab(he,ue,Ee,Ie,!1),Me!==null&&Xt!==null&&Ab(he,Xt,Me,Ie,!0)}}e:{if(ue=ee?uo(ee):window,Ee=ue.nodeName&&ue.nodeName.toLowerCase(),Ee==="select"||Ee==="input"&&ue.type==="file")var Le=FR;else if(ub(ue))if(fb)Le=$R;else{Le=BR;var He=zR}else(Ee=ue.nodeName)&&Ee.toLowerCase()==="input"&&(ue.type==="checkbox"||ue.type==="radio")&&(Le=VR);if(Le&&(Le=Le(s,ee))){db(he,Le,m,fe);break e}He&&He(s,ue,ee),s==="focusout"&&(He=ue._wrapperState)&&He.controlled&&ue.type==="number"&&rt(ue,"number",ue.value)}switch(He=ee?uo(ee):window,s){case"focusin":(ub(He)||He.contentEditable==="true")&&(so=He,jh=ee,Wl=null);break;case"focusout":Wl=jh=so=null;break;case"mousedown":Nh=!0;break;case"contextmenu":case"mouseup":case"dragend":Nh=!1,bb(he,m,fe);break;case"selectionchange":if(HR)break;case"keydown":case"keyup":bb(he,m,fe)}var Ke;if(bh)e:{switch(s){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else ao?lb(s,m)&&(Ze="onCompositionEnd"):s==="keydown"&&m.keyCode===229&&(Ze="onCompositionStart");Ze&&(ab&&m.locale!=="ko"&&(ao||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&ao&&(Ke=eb()):(aa=fe,hh="value"in aa?aa.value:aa.textContent,ao=!0)),He=td(ee,Ze),0<He.length&&(Ze=new rb(Ze,s,null,m,fe),he.push({event:Ze,listeners:He}),Ke?Ze.data=Ke:(Ke=cb(m),Ke!==null&&(Ze.data=Ke)))),(Ke=OR?IR(s,m):DR(s,m))&&(ee=td(ee,"onBeforeInput"),0<ee.length&&(fe=new rb("onBeforeInput","beforeinput",null,m,fe),he.push({event:fe,listeners:ee}),fe.data=Ke))}Eb(he,c)})}function Gl(s,c,m){return{instance:s,listener:c,currentTarget:m}}function td(s,c){for(var m=c+"Capture",y=[];s!==null;){var b=s,j=b.stateNode;b.tag===5&&j!==null&&(b=j,j=El(s,m),j!=null&&y.unshift(Gl(s,j,b)),j=El(s,c),j!=null&&y.push(Gl(s,j,b))),s=s.return}return y}function lo(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function Ab(s,c,m,y,b){for(var j=c._reactName,A=[];m!==null&&m!==y;){var F=m,$=F.alternate,ee=F.stateNode;if($!==null&&$===y)break;F.tag===5&&ee!==null&&(F=ee,b?($=El(m,j),$!=null&&A.unshift(Gl(m,$,F))):b||($=El(m,j),$!=null&&A.push(Gl(m,$,F)))),m=m.return}A.length!==0&&s.push({event:c,listeners:A})}var YR=/\r\n?/g,XR=/\u0000|\uFFFD/g;function Mb(s){return(typeof s=="string"?s:""+s).replace(YR,`
|
||
`).replace(XR,"")}function nd(s,c,m){if(c=Mb(c),Mb(s)!==c&&m)throw Error(n(425))}function rd(){}var Ah=null,Mh=null;function Rh(s,c){return s==="textarea"||s==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Oh=typeof setTimeout=="function"?setTimeout:void 0,JR=typeof clearTimeout=="function"?clearTimeout:void 0,Rb=typeof Promise=="function"?Promise:void 0,ZR=typeof queueMicrotask=="function"?queueMicrotask:typeof Rb<"u"?function(s){return Rb.resolve(null).then(s).catch(e4)}:Oh;function e4(s){setTimeout(function(){throw s})}function Ih(s,c){var m=c,y=0;do{var b=m.nextSibling;if(s.removeChild(m),b&&b.nodeType===8)if(m=b.data,m==="/$"){if(y===0){s.removeChild(b),ql(c);return}y--}else m!=="$"&&m!=="$?"&&m!=="$!"||y++;m=b}while(m);ql(c)}function oa(s){for(;s!=null;s=s.nextSibling){var c=s.nodeType;if(c===1||c===3)break;if(c===8){if(c=s.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return s}function Ob(s){s=s.previousSibling;for(var c=0;s;){if(s.nodeType===8){var m=s.data;if(m==="$"||m==="$!"||m==="$?"){if(c===0)return s;c--}else m==="/$"&&c++}s=s.previousSibling}return null}var co=Math.random().toString(36).slice(2),ri="__reactFiber$"+co,Ql="__reactProps$"+co,Ei="__reactContainer$"+co,Dh="__reactEvents$"+co,t4="__reactListeners$"+co,n4="__reactHandles$"+co;function ts(s){var c=s[ri];if(c)return c;for(var m=s.parentNode;m;){if(c=m[Ei]||m[ri]){if(m=c.alternate,c.child!==null||m!==null&&m.child!==null)for(s=Ob(s);s!==null;){if(m=s[ri])return m;s=Ob(s)}return c}s=m,m=s.parentNode}return null}function Yl(s){return s=s[ri]||s[Ei],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function uo(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(n(33))}function id(s){return s[Ql]||null}var Lh=[],fo=-1;function la(s){return{current:s}}function Dt(s){0>fo||(s.current=Lh[fo],Lh[fo]=null,fo--)}function Et(s,c){fo++,Lh[fo]=s.current,s.current=c}var ca={},Nn=la(ca),Bn=la(!1),ns=ca;function mo(s,c){var m=s.type.contextTypes;if(!m)return ca;var y=s.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var b={},j;for(j in m)b[j]=c[j];return y&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=b),b}function Vn(s){return s=s.childContextTypes,s!=null}function ad(){Dt(Bn),Dt(Nn)}function Ib(s,c,m){if(Nn.current!==ca)throw Error(n(168));Et(Nn,c),Et(Bn,m)}function Db(s,c,m){var y=s.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return m;y=y.getChildContext();for(var b in y)if(!(b in c))throw Error(n(108,le(s)||"Unknown",b));return M({},m,y)}function sd(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ca,ns=Nn.current,Et(Nn,s),Et(Bn,Bn.current),!0}function Lb(s,c,m){var y=s.stateNode;if(!y)throw Error(n(169));m?(s=Db(s,c,ns),y.__reactInternalMemoizedMergedChildContext=s,Dt(Bn),Dt(Nn),Et(Nn,s)):Dt(Bn),Et(Bn,m)}var Ti=null,od=!1,qh=!1;function qb(s){Ti===null?Ti=[s]:Ti.push(s)}function r4(s){od=!0,qb(s)}function ua(){if(!qh&&Ti!==null){qh=!0;var s=0,c=St;try{var m=Ti;for(St=1;s<m.length;s++){var y=m[s];do y=y(!0);while(y!==null)}Ti=null,od=!1}catch(b){throw Ti!==null&&(Ti=Ti.slice(s+1)),zv(sh,ua),b}finally{St=c,qh=!1}}return null}var ho=[],po=0,ld=null,cd=0,br=[],wr=0,rs=null,Ai=1,Mi="";function is(s,c){ho[po++]=cd,ho[po++]=ld,ld=s,cd=c}function Fb(s,c,m){br[wr++]=Ai,br[wr++]=Mi,br[wr++]=rs,rs=s;var y=Ai;s=Mi;var b=32-Lr(y)-1;y&=~(1<<b),m+=1;var j=32-Lr(c)+b;if(30<j){var A=b-b%5;j=(y&(1<<A)-1).toString(32),y>>=A,b-=A,Ai=1<<32-Lr(c)+b|m<<b|y,Mi=j+s}else Ai=1<<j|m<<b|y,Mi=s}function Fh(s){s.return!==null&&(is(s,1),Fb(s,1,0))}function zh(s){for(;s===ld;)ld=ho[--po],ho[po]=null,cd=ho[--po],ho[po]=null;for(;s===rs;)rs=br[--wr],br[wr]=null,Mi=br[--wr],br[wr]=null,Ai=br[--wr],br[wr]=null}var lr=null,cr=null,qt=!1,Fr=null;function zb(s,c){var m=Nr(5,null,null,0);m.elementType="DELETED",m.stateNode=c,m.return=s,c=s.deletions,c===null?(s.deletions=[m],s.flags|=16):c.push(m)}function Bb(s,c){switch(s.tag){case 5:var m=s.type;return c=c.nodeType!==1||m.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(s.stateNode=c,lr=s,cr=oa(c.firstChild),!0):!1;case 6:return c=s.pendingProps===""||c.nodeType!==3?null:c,c!==null?(s.stateNode=c,lr=s,cr=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(m=rs!==null?{id:Ai,overflow:Mi}:null,s.memoizedState={dehydrated:c,treeContext:m,retryLane:1073741824},m=Nr(18,null,null,0),m.stateNode=c,m.return=s,s.child=m,lr=s,cr=null,!0):!1;default:return!1}}function Bh(s){return(s.mode&1)!==0&&(s.flags&128)===0}function Vh(s){if(qt){var c=cr;if(c){var m=c;if(!Bb(s,c)){if(Bh(s))throw Error(n(418));c=oa(m.nextSibling);var y=lr;c&&Bb(s,c)?zb(y,m):(s.flags=s.flags&-4097|2,qt=!1,lr=s)}}else{if(Bh(s))throw Error(n(418));s.flags=s.flags&-4097|2,qt=!1,lr=s}}}function Vb(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;lr=s}function ud(s){if(s!==lr)return!1;if(!qt)return Vb(s),qt=!0,!1;var c;if((c=s.tag!==3)&&!(c=s.tag!==5)&&(c=s.type,c=c!=="head"&&c!=="body"&&!Rh(s.type,s.memoizedProps)),c&&(c=cr)){if(Bh(s))throw $b(),Error(n(418));for(;c;)zb(s,c),c=oa(c.nextSibling)}if(Vb(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));e:{for(s=s.nextSibling,c=0;s;){if(s.nodeType===8){var m=s.data;if(m==="/$"){if(c===0){cr=oa(s.nextSibling);break e}c--}else m!=="$"&&m!=="$!"&&m!=="$?"||c++}s=s.nextSibling}cr=null}}else cr=lr?oa(s.stateNode.nextSibling):null;return!0}function $b(){for(var s=cr;s;)s=oa(s.nextSibling)}function go(){cr=lr=null,qt=!1}function $h(s){Fr===null?Fr=[s]:Fr.push(s)}var i4=T.ReactCurrentBatchConfig;function Xl(s,c,m){if(s=m.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(n(309));var y=m.stateNode}if(!y)throw Error(n(147,s));var b=y,j=""+s;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===j?c.ref:(c=function(A){var F=b.refs;A===null?delete F[j]:F[j]=A},c._stringRef=j,c)}if(typeof s!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,s))}return s}function dd(s,c){throw s=Object.prototype.toString.call(c),Error(n(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s))}function Ub(s){var c=s._init;return c(s._payload)}function Wb(s){function c(Q,H){if(s){var X=Q.deletions;X===null?(Q.deletions=[H],Q.flags|=16):X.push(H)}}function m(Q,H){if(!s)return null;for(;H!==null;)c(Q,H),H=H.sibling;return null}function y(Q,H){for(Q=new Map;H!==null;)H.key!==null?Q.set(H.key,H):Q.set(H.index,H),H=H.sibling;return Q}function b(Q,H){return Q=xa(Q,H),Q.index=0,Q.sibling=null,Q}function j(Q,H,X){return Q.index=X,s?(X=Q.alternate,X!==null?(X=X.index,X<H?(Q.flags|=2,H):X):(Q.flags|=2,H)):(Q.flags|=1048576,H)}function A(Q){return s&&Q.alternate===null&&(Q.flags|=2),Q}function F(Q,H,X,ve){return H===null||H.tag!==6?(H=Op(X,Q.mode,ve),H.return=Q,H):(H=b(H,X),H.return=Q,H)}function $(Q,H,X,ve){var Le=X.type;return Le===z?fe(Q,H,X.props.children,ve,X.key):H!==null&&(H.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===ae&&Ub(Le)===H.type)?(ve=b(H,X.props),ve.ref=Xl(Q,H,X),ve.return=Q,ve):(ve=Id(X.type,X.key,X.props,null,Q.mode,ve),ve.ref=Xl(Q,H,X),ve.return=Q,ve)}function ee(Q,H,X,ve){return H===null||H.tag!==4||H.stateNode.containerInfo!==X.containerInfo||H.stateNode.implementation!==X.implementation?(H=Ip(X,Q.mode,ve),H.return=Q,H):(H=b(H,X.children||[]),H.return=Q,H)}function fe(Q,H,X,ve,Le){return H===null||H.tag!==7?(H=fs(X,Q.mode,ve,Le),H.return=Q,H):(H=b(H,X),H.return=Q,H)}function he(Q,H,X){if(typeof H=="string"&&H!==""||typeof H=="number")return H=Op(""+H,Q.mode,X),H.return=Q,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case S:return X=Id(H.type,H.key,H.props,null,Q.mode,X),X.ref=Xl(Q,null,H),X.return=Q,X;case E:return H=Ip(H,Q.mode,X),H.return=Q,H;case ae:var ve=H._init;return he(Q,ve(H._payload),X)}if(te(H)||Y(H))return H=fs(H,Q.mode,X,null),H.return=Q,H;dd(Q,H)}return null}function ue(Q,H,X,ve){var Le=H!==null?H.key:null;if(typeof X=="string"&&X!==""||typeof X=="number")return Le!==null?null:F(Q,H,""+X,ve);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case S:return X.key===Le?$(Q,H,X,ve):null;case E:return X.key===Le?ee(Q,H,X,ve):null;case ae:return Le=X._init,ue(Q,H,Le(X._payload),ve)}if(te(X)||Y(X))return Le!==null?null:fe(Q,H,X,ve,null);dd(Q,X)}return null}function Ee(Q,H,X,ve,Le){if(typeof ve=="string"&&ve!==""||typeof ve=="number")return Q=Q.get(X)||null,F(H,Q,""+ve,Le);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case S:return Q=Q.get(ve.key===null?X:ve.key)||null,$(H,Q,ve,Le);case E:return Q=Q.get(ve.key===null?X:ve.key)||null,ee(H,Q,ve,Le);case ae:var He=ve._init;return Ee(Q,H,X,He(ve._payload),Le)}if(te(ve)||Y(ve))return Q=Q.get(X)||null,fe(H,Q,ve,Le,null);dd(H,ve)}return null}function Me(Q,H,X,ve){for(var Le=null,He=null,Ke=H,Ze=H=0,hn=null;Ke!==null&&Ze<X.length;Ze++){Ke.index>Ze?(hn=Ke,Ke=null):hn=Ke.sibling;var yt=ue(Q,Ke,X[Ze],ve);if(yt===null){Ke===null&&(Ke=hn);break}s&&Ke&&yt.alternate===null&&c(Q,Ke),H=j(yt,H,Ze),He===null?Le=yt:He.sibling=yt,He=yt,Ke=hn}if(Ze===X.length)return m(Q,Ke),qt&&is(Q,Ze),Le;if(Ke===null){for(;Ze<X.length;Ze++)Ke=he(Q,X[Ze],ve),Ke!==null&&(H=j(Ke,H,Ze),He===null?Le=Ke:He.sibling=Ke,He=Ke);return qt&&is(Q,Ze),Le}for(Ke=y(Q,Ke);Ze<X.length;Ze++)hn=Ee(Ke,Q,Ze,X[Ze],ve),hn!==null&&(s&&hn.alternate!==null&&Ke.delete(hn.key===null?Ze:hn.key),H=j(hn,H,Ze),He===null?Le=hn:He.sibling=hn,He=hn);return s&&Ke.forEach(function(va){return c(Q,va)}),qt&&is(Q,Ze),Le}function Ie(Q,H,X,ve){var Le=Y(X);if(typeof Le!="function")throw Error(n(150));if(X=Le.call(X),X==null)throw Error(n(151));for(var He=Le=null,Ke=H,Ze=H=0,hn=null,yt=X.next();Ke!==null&&!yt.done;Ze++,yt=X.next()){Ke.index>Ze?(hn=Ke,Ke=null):hn=Ke.sibling;var va=ue(Q,Ke,yt.value,ve);if(va===null){Ke===null&&(Ke=hn);break}s&&Ke&&va.alternate===null&&c(Q,Ke),H=j(va,H,Ze),He===null?Le=va:He.sibling=va,He=va,Ke=hn}if(yt.done)return m(Q,Ke),qt&&is(Q,Ze),Le;if(Ke===null){for(;!yt.done;Ze++,yt=X.next())yt=he(Q,yt.value,ve),yt!==null&&(H=j(yt,H,Ze),He===null?Le=yt:He.sibling=yt,He=yt);return qt&&is(Q,Ze),Le}for(Ke=y(Q,Ke);!yt.done;Ze++,yt=X.next())yt=Ee(Ke,Q,Ze,yt.value,ve),yt!==null&&(s&&yt.alternate!==null&&Ke.delete(yt.key===null?Ze:yt.key),H=j(yt,H,Ze),He===null?Le=yt:He.sibling=yt,He=yt);return s&&Ke.forEach(function(L4){return c(Q,L4)}),qt&&is(Q,Ze),Le}function Xt(Q,H,X,ve){if(typeof X=="object"&&X!==null&&X.type===z&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case S:e:{for(var Le=X.key,He=H;He!==null;){if(He.key===Le){if(Le=X.type,Le===z){if(He.tag===7){m(Q,He.sibling),H=b(He,X.props.children),H.return=Q,Q=H;break e}}else if(He.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===ae&&Ub(Le)===He.type){m(Q,He.sibling),H=b(He,X.props),H.ref=Xl(Q,He,X),H.return=Q,Q=H;break e}m(Q,He);break}else c(Q,He);He=He.sibling}X.type===z?(H=fs(X.props.children,Q.mode,ve,X.key),H.return=Q,Q=H):(ve=Id(X.type,X.key,X.props,null,Q.mode,ve),ve.ref=Xl(Q,H,X),ve.return=Q,Q=ve)}return A(Q);case E:e:{for(He=X.key;H!==null;){if(H.key===He)if(H.tag===4&&H.stateNode.containerInfo===X.containerInfo&&H.stateNode.implementation===X.implementation){m(Q,H.sibling),H=b(H,X.children||[]),H.return=Q,Q=H;break e}else{m(Q,H);break}else c(Q,H);H=H.sibling}H=Ip(X,Q.mode,ve),H.return=Q,Q=H}return A(Q);case ae:return He=X._init,Xt(Q,H,He(X._payload),ve)}if(te(X))return Me(Q,H,X,ve);if(Y(X))return Ie(Q,H,X,ve);dd(Q,X)}return typeof X=="string"&&X!==""||typeof X=="number"?(X=""+X,H!==null&&H.tag===6?(m(Q,H.sibling),H=b(H,X),H.return=Q,Q=H):(m(Q,H),H=Op(X,Q.mode,ve),H.return=Q,Q=H),A(Q)):m(Q,H)}return Xt}var yo=Wb(!0),Hb=Wb(!1),fd=la(null),md=null,xo=null,Uh=null;function Wh(){Uh=xo=md=null}function Hh(s){var c=fd.current;Dt(fd),s._currentValue=c}function Kh(s,c,m){for(;s!==null;){var y=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),s===m)break;s=s.return}}function vo(s,c){md=s,Uh=xo=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&c)!==0&&($n=!0),s.firstContext=null)}function _r(s){var c=s._currentValue;if(Uh!==s)if(s={context:s,memoizedValue:c,next:null},xo===null){if(md===null)throw Error(n(308));xo=s,md.dependencies={lanes:0,firstContext:s}}else xo=xo.next=s;return c}var as=null;function Gh(s){as===null?as=[s]:as.push(s)}function Kb(s,c,m,y){var b=c.interleaved;return b===null?(m.next=m,Gh(c)):(m.next=b.next,b.next=m),c.interleaved=m,Ri(s,y)}function Ri(s,c){s.lanes|=c;var m=s.alternate;for(m!==null&&(m.lanes|=c),m=s,s=s.return;s!==null;)s.childLanes|=c,m=s.alternate,m!==null&&(m.childLanes|=c),m=s,s=s.return;return m.tag===3?m.stateNode:null}var da=!1;function Qh(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Gb(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function Oi(s,c){return{eventTime:s,lane:c,tag:0,payload:null,callback:null,next:null}}function fa(s,c,m){var y=s.updateQueue;if(y===null)return null;if(y=y.shared,(pt&2)!==0){var b=y.pending;return b===null?c.next=c:(c.next=b.next,b.next=c),y.pending=c,Ri(s,m)}return b=y.interleaved,b===null?(c.next=c,Gh(y)):(c.next=b.next,b.next=c),y.interleaved=c,Ri(s,m)}function hd(s,c,m){if(c=c.updateQueue,c!==null&&(c=c.shared,(m&4194240)!==0)){var y=c.lanes;y&=s.pendingLanes,m|=y,c.lanes=m,ch(s,m)}}function Qb(s,c){var m=s.updateQueue,y=s.alternate;if(y!==null&&(y=y.updateQueue,m===y)){var b=null,j=null;if(m=m.firstBaseUpdate,m!==null){do{var A={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};j===null?b=j=A:j=j.next=A,m=m.next}while(m!==null);j===null?b=j=c:j=j.next=c}else b=j=c;m={baseState:y.baseState,firstBaseUpdate:b,lastBaseUpdate:j,shared:y.shared,effects:y.effects},s.updateQueue=m;return}s=m.lastBaseUpdate,s===null?m.firstBaseUpdate=c:s.next=c,m.lastBaseUpdate=c}function pd(s,c,m,y){var b=s.updateQueue;da=!1;var j=b.firstBaseUpdate,A=b.lastBaseUpdate,F=b.shared.pending;if(F!==null){b.shared.pending=null;var $=F,ee=$.next;$.next=null,A===null?j=ee:A.next=ee,A=$;var fe=s.alternate;fe!==null&&(fe=fe.updateQueue,F=fe.lastBaseUpdate,F!==A&&(F===null?fe.firstBaseUpdate=ee:F.next=ee,fe.lastBaseUpdate=$))}if(j!==null){var he=b.baseState;A=0,fe=ee=$=null,F=j;do{var ue=F.lane,Ee=F.eventTime;if((y&ue)===ue){fe!==null&&(fe=fe.next={eventTime:Ee,lane:0,tag:F.tag,payload:F.payload,callback:F.callback,next:null});e:{var Me=s,Ie=F;switch(ue=c,Ee=m,Ie.tag){case 1:if(Me=Ie.payload,typeof Me=="function"){he=Me.call(Ee,he,ue);break e}he=Me;break e;case 3:Me.flags=Me.flags&-65537|128;case 0:if(Me=Ie.payload,ue=typeof Me=="function"?Me.call(Ee,he,ue):Me,ue==null)break e;he=M({},he,ue);break e;case 2:da=!0}}F.callback!==null&&F.lane!==0&&(s.flags|=64,ue=b.effects,ue===null?b.effects=[F]:ue.push(F))}else Ee={eventTime:Ee,lane:ue,tag:F.tag,payload:F.payload,callback:F.callback,next:null},fe===null?(ee=fe=Ee,$=he):fe=fe.next=Ee,A|=ue;if(F=F.next,F===null){if(F=b.shared.pending,F===null)break;ue=F,F=ue.next,ue.next=null,b.lastBaseUpdate=ue,b.shared.pending=null}}while(!0);if(fe===null&&($=he),b.baseState=$,b.firstBaseUpdate=ee,b.lastBaseUpdate=fe,c=b.shared.interleaved,c!==null){b=c;do A|=b.lane,b=b.next;while(b!==c)}else j===null&&(b.shared.lanes=0);ls|=A,s.lanes=A,s.memoizedState=he}}function Yb(s,c,m){if(s=c.effects,c.effects=null,s!==null)for(c=0;c<s.length;c++){var y=s[c],b=y.callback;if(b!==null){if(y.callback=null,y=m,typeof b!="function")throw Error(n(191,b));b.call(y)}}}var Jl={},ii=la(Jl),Zl=la(Jl),ec=la(Jl);function ss(s){if(s===Jl)throw Error(n(174));return s}function Yh(s,c){switch(Et(ec,c),Et(Zl,s),Et(ii,Jl),s=c.nodeType,s){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:ge(null,"");break;default:s=s===8?c.parentNode:c,c=s.namespaceURI||null,s=s.tagName,c=ge(c,s)}Dt(ii),Et(ii,c)}function bo(){Dt(ii),Dt(Zl),Dt(ec)}function Xb(s){ss(ec.current);var c=ss(ii.current),m=ge(c,s.type);c!==m&&(Et(Zl,s),Et(ii,m))}function Xh(s){Zl.current===s&&(Dt(ii),Dt(Zl))}var Vt=la(0);function gd(s){for(var c=s;c!==null;){if(c.tag===13){var m=c.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Jh=[];function Zh(){for(var s=0;s<Jh.length;s++)Jh[s]._workInProgressVersionPrimary=null;Jh.length=0}var yd=T.ReactCurrentDispatcher,ep=T.ReactCurrentBatchConfig,os=0,$t=null,ln=null,fn=null,xd=!1,tc=!1,nc=0,a4=0;function Cn(){throw Error(n(321))}function tp(s,c){if(c===null)return!1;for(var m=0;m<c.length&&m<s.length;m++)if(!qr(s[m],c[m]))return!1;return!0}function np(s,c,m,y,b,j){if(os=j,$t=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,yd.current=s===null||s.memoizedState===null?c4:u4,s=m(y,b),tc){j=0;do{if(tc=!1,nc=0,25<=j)throw Error(n(301));j+=1,fn=ln=null,c.updateQueue=null,yd.current=d4,s=m(y,b)}while(tc)}if(yd.current=wd,c=ln!==null&&ln.next!==null,os=0,fn=ln=$t=null,xd=!1,c)throw Error(n(300));return s}function rp(){var s=nc!==0;return nc=0,s}function ai(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fn===null?$t.memoizedState=fn=s:fn=fn.next=s,fn}function Sr(){if(ln===null){var s=$t.alternate;s=s!==null?s.memoizedState:null}else s=ln.next;var c=fn===null?$t.memoizedState:fn.next;if(c!==null)fn=c,ln=s;else{if(s===null)throw Error(n(310));ln=s,s={memoizedState:ln.memoizedState,baseState:ln.baseState,baseQueue:ln.baseQueue,queue:ln.queue,next:null},fn===null?$t.memoizedState=fn=s:fn=fn.next=s}return fn}function rc(s,c){return typeof c=="function"?c(s):c}function ip(s){var c=Sr(),m=c.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=s;var y=ln,b=y.baseQueue,j=m.pending;if(j!==null){if(b!==null){var A=b.next;b.next=j.next,j.next=A}y.baseQueue=b=j,m.pending=null}if(b!==null){j=b.next,y=y.baseState;var F=A=null,$=null,ee=j;do{var fe=ee.lane;if((os&fe)===fe)$!==null&&($=$.next={lane:0,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),y=ee.hasEagerState?ee.eagerState:s(y,ee.action);else{var he={lane:fe,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null};$===null?(F=$=he,A=y):$=$.next=he,$t.lanes|=fe,ls|=fe}ee=ee.next}while(ee!==null&&ee!==j);$===null?A=y:$.next=F,qr(y,c.memoizedState)||($n=!0),c.memoizedState=y,c.baseState=A,c.baseQueue=$,m.lastRenderedState=y}if(s=m.interleaved,s!==null){b=s;do j=b.lane,$t.lanes|=j,ls|=j,b=b.next;while(b!==s)}else b===null&&(m.lanes=0);return[c.memoizedState,m.dispatch]}function ap(s){var c=Sr(),m=c.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=s;var y=m.dispatch,b=m.pending,j=c.memoizedState;if(b!==null){m.pending=null;var A=b=b.next;do j=s(j,A.action),A=A.next;while(A!==b);qr(j,c.memoizedState)||($n=!0),c.memoizedState=j,c.baseQueue===null&&(c.baseState=j),m.lastRenderedState=j}return[j,y]}function Jb(){}function Zb(s,c){var m=$t,y=Sr(),b=c(),j=!qr(y.memoizedState,b);if(j&&(y.memoizedState=b,$n=!0),y=y.queue,sp(nw.bind(null,m,y,s),[s]),y.getSnapshot!==c||j||fn!==null&&fn.memoizedState.tag&1){if(m.flags|=2048,ic(9,tw.bind(null,m,y,b,c),void 0,null),mn===null)throw Error(n(349));(os&30)!==0||ew(m,c,b)}return b}function ew(s,c,m){s.flags|=16384,s={getSnapshot:c,value:m},c=$t.updateQueue,c===null?(c={lastEffect:null,stores:null},$t.updateQueue=c,c.stores=[s]):(m=c.stores,m===null?c.stores=[s]:m.push(s))}function tw(s,c,m,y){c.value=m,c.getSnapshot=y,rw(c)&&iw(s)}function nw(s,c,m){return m(function(){rw(c)&&iw(s)})}function rw(s){var c=s.getSnapshot;s=s.value;try{var m=c();return!qr(s,m)}catch{return!0}}function iw(s){var c=Ri(s,1);c!==null&&$r(c,s,1,-1)}function aw(s){var c=ai();return typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:rc,lastRenderedState:s},c.queue=s,s=s.dispatch=l4.bind(null,$t,s),[c.memoizedState,s]}function ic(s,c,m,y){return s={tag:s,create:c,destroy:m,deps:y,next:null},c=$t.updateQueue,c===null?(c={lastEffect:null,stores:null},$t.updateQueue=c,c.lastEffect=s.next=s):(m=c.lastEffect,m===null?c.lastEffect=s.next=s:(y=m.next,m.next=s,s.next=y,c.lastEffect=s)),s}function sw(){return Sr().memoizedState}function vd(s,c,m,y){var b=ai();$t.flags|=s,b.memoizedState=ic(1|c,m,void 0,y===void 0?null:y)}function bd(s,c,m,y){var b=Sr();y=y===void 0?null:y;var j=void 0;if(ln!==null){var A=ln.memoizedState;if(j=A.destroy,y!==null&&tp(y,A.deps)){b.memoizedState=ic(c,m,j,y);return}}$t.flags|=s,b.memoizedState=ic(1|c,m,j,y)}function ow(s,c){return vd(8390656,8,s,c)}function sp(s,c){return bd(2048,8,s,c)}function lw(s,c){return bd(4,2,s,c)}function cw(s,c){return bd(4,4,s,c)}function uw(s,c){if(typeof c=="function")return s=s(),c(s),function(){c(null)};if(c!=null)return s=s(),c.current=s,function(){c.current=null}}function dw(s,c,m){return m=m!=null?m.concat([s]):null,bd(4,4,uw.bind(null,c,s),m)}function op(){}function fw(s,c){var m=Sr();c=c===void 0?null:c;var y=m.memoizedState;return y!==null&&c!==null&&tp(c,y[1])?y[0]:(m.memoizedState=[s,c],s)}function mw(s,c){var m=Sr();c=c===void 0?null:c;var y=m.memoizedState;return y!==null&&c!==null&&tp(c,y[1])?y[0]:(s=s(),m.memoizedState=[s,c],s)}function hw(s,c,m){return(os&21)===0?(s.baseState&&(s.baseState=!1,$n=!0),s.memoizedState=m):(qr(m,c)||(m=Uv(),$t.lanes|=m,ls|=m,s.baseState=!0),c)}function s4(s,c){var m=St;St=m!==0&&4>m?m:4,s(!0);var y=ep.transition;ep.transition={};try{s(!1),c()}finally{St=m,ep.transition=y}}function pw(){return Sr().memoizedState}function o4(s,c,m){var y=ga(s);if(m={lane:y,action:m,hasEagerState:!1,eagerState:null,next:null},gw(s))yw(c,m);else if(m=Kb(s,c,m,y),m!==null){var b=In();$r(m,s,y,b),xw(m,c,y)}}function l4(s,c,m){var y=ga(s),b={lane:y,action:m,hasEagerState:!1,eagerState:null,next:null};if(gw(s))yw(c,b);else{var j=s.alternate;if(s.lanes===0&&(j===null||j.lanes===0)&&(j=c.lastRenderedReducer,j!==null))try{var A=c.lastRenderedState,F=j(A,m);if(b.hasEagerState=!0,b.eagerState=F,qr(F,A)){var $=c.interleaved;$===null?(b.next=b,Gh(c)):(b.next=$.next,$.next=b),c.interleaved=b;return}}catch{}finally{}m=Kb(s,c,b,y),m!==null&&(b=In(),$r(m,s,y,b),xw(m,c,y))}}function gw(s){var c=s.alternate;return s===$t||c!==null&&c===$t}function yw(s,c){tc=xd=!0;var m=s.pending;m===null?c.next=c:(c.next=m.next,m.next=c),s.pending=c}function xw(s,c,m){if((m&4194240)!==0){var y=c.lanes;y&=s.pendingLanes,m|=y,c.lanes=m,ch(s,m)}}var wd={readContext:_r,useCallback:Cn,useContext:Cn,useEffect:Cn,useImperativeHandle:Cn,useInsertionEffect:Cn,useLayoutEffect:Cn,useMemo:Cn,useReducer:Cn,useRef:Cn,useState:Cn,useDebugValue:Cn,useDeferredValue:Cn,useTransition:Cn,useMutableSource:Cn,useSyncExternalStore:Cn,useId:Cn,unstable_isNewReconciler:!1},c4={readContext:_r,useCallback:function(s,c){return ai().memoizedState=[s,c===void 0?null:c],s},useContext:_r,useEffect:ow,useImperativeHandle:function(s,c,m){return m=m!=null?m.concat([s]):null,vd(4194308,4,uw.bind(null,c,s),m)},useLayoutEffect:function(s,c){return vd(4194308,4,s,c)},useInsertionEffect:function(s,c){return vd(4,2,s,c)},useMemo:function(s,c){var m=ai();return c=c===void 0?null:c,s=s(),m.memoizedState=[s,c],s},useReducer:function(s,c,m){var y=ai();return c=m!==void 0?m(c):c,y.memoizedState=y.baseState=c,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:c},y.queue=s,s=s.dispatch=o4.bind(null,$t,s),[y.memoizedState,s]},useRef:function(s){var c=ai();return s={current:s},c.memoizedState=s},useState:aw,useDebugValue:op,useDeferredValue:function(s){return ai().memoizedState=s},useTransition:function(){var s=aw(!1),c=s[0];return s=s4.bind(null,s[1]),ai().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,m){var y=$t,b=ai();if(qt){if(m===void 0)throw Error(n(407));m=m()}else{if(m=c(),mn===null)throw Error(n(349));(os&30)!==0||ew(y,c,m)}b.memoizedState=m;var j={value:m,getSnapshot:c};return b.queue=j,ow(nw.bind(null,y,j,s),[s]),y.flags|=2048,ic(9,tw.bind(null,y,j,m,c),void 0,null),m},useId:function(){var s=ai(),c=mn.identifierPrefix;if(qt){var m=Mi,y=Ai;m=(y&~(1<<32-Lr(y)-1)).toString(32)+m,c=":"+c+"R"+m,m=nc++,0<m&&(c+="H"+m.toString(32)),c+=":"}else m=a4++,c=":"+c+"r"+m.toString(32)+":";return s.memoizedState=c},unstable_isNewReconciler:!1},u4={readContext:_r,useCallback:fw,useContext:_r,useEffect:sp,useImperativeHandle:dw,useInsertionEffect:lw,useLayoutEffect:cw,useMemo:mw,useReducer:ip,useRef:sw,useState:function(){return ip(rc)},useDebugValue:op,useDeferredValue:function(s){var c=Sr();return hw(c,ln.memoizedState,s)},useTransition:function(){var s=ip(rc)[0],c=Sr().memoizedState;return[s,c]},useMutableSource:Jb,useSyncExternalStore:Zb,useId:pw,unstable_isNewReconciler:!1},d4={readContext:_r,useCallback:fw,useContext:_r,useEffect:sp,useImperativeHandle:dw,useInsertionEffect:lw,useLayoutEffect:cw,useMemo:mw,useReducer:ap,useRef:sw,useState:function(){return ap(rc)},useDebugValue:op,useDeferredValue:function(s){var c=Sr();return ln===null?c.memoizedState=s:hw(c,ln.memoizedState,s)},useTransition:function(){var s=ap(rc)[0],c=Sr().memoizedState;return[s,c]},useMutableSource:Jb,useSyncExternalStore:Zb,useId:pw,unstable_isNewReconciler:!1};function zr(s,c){if(s&&s.defaultProps){c=M({},c),s=s.defaultProps;for(var m in s)c[m]===void 0&&(c[m]=s[m]);return c}return c}function lp(s,c,m,y){c=s.memoizedState,m=m(y,c),m=m==null?c:M({},c,m),s.memoizedState=m,s.lanes===0&&(s.updateQueue.baseState=m)}var _d={isMounted:function(s){return(s=s._reactInternals)?es(s)===s:!1},enqueueSetState:function(s,c,m){s=s._reactInternals;var y=In(),b=ga(s),j=Oi(y,b);j.payload=c,m!=null&&(j.callback=m),c=fa(s,j,b),c!==null&&($r(c,s,b,y),hd(c,s,b))},enqueueReplaceState:function(s,c,m){s=s._reactInternals;var y=In(),b=ga(s),j=Oi(y,b);j.tag=1,j.payload=c,m!=null&&(j.callback=m),c=fa(s,j,b),c!==null&&($r(c,s,b,y),hd(c,s,b))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var m=In(),y=ga(s),b=Oi(m,y);b.tag=2,c!=null&&(b.callback=c),c=fa(s,b,y),c!==null&&($r(c,s,y,m),hd(c,s,y))}};function vw(s,c,m,y,b,j,A){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(y,j,A):c.prototype&&c.prototype.isPureReactComponent?!Ul(m,y)||!Ul(b,j):!0}function bw(s,c,m){var y=!1,b=ca,j=c.contextType;return typeof j=="object"&&j!==null?j=_r(j):(b=Vn(c)?ns:Nn.current,y=c.contextTypes,j=(y=y!=null)?mo(s,b):ca),c=new c(m,j),s.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=_d,s.stateNode=c,c._reactInternals=s,y&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=b,s.__reactInternalMemoizedMaskedChildContext=j),c}function ww(s,c,m,y){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(m,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(m,y),c.state!==s&&_d.enqueueReplaceState(c,c.state,null)}function cp(s,c,m,y){var b=s.stateNode;b.props=m,b.state=s.memoizedState,b.refs={},Qh(s);var j=c.contextType;typeof j=="object"&&j!==null?b.context=_r(j):(j=Vn(c)?ns:Nn.current,b.context=mo(s,j)),b.state=s.memoizedState,j=c.getDerivedStateFromProps,typeof j=="function"&&(lp(s,c,j,m),b.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(c=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),c!==b.state&&_d.enqueueReplaceState(b,b.state,null),pd(s,m,b,y),b.state=s.memoizedState),typeof b.componentDidMount=="function"&&(s.flags|=4194308)}function wo(s,c){try{var m="",y=c;do m+=Ne(y),y=y.return;while(y);var b=m}catch(j){b=`
|
||
Error generating stack: `+j.message+`
|
||
`+j.stack}return{value:s,source:c,stack:b,digest:null}}function up(s,c,m){return{value:s,source:null,stack:m??null,digest:c??null}}function dp(s,c){try{console.error(c.value)}catch(m){setTimeout(function(){throw m})}}var f4=typeof WeakMap=="function"?WeakMap:Map;function _w(s,c,m){m=Oi(-1,m),m.tag=3,m.payload={element:null};var y=c.value;return m.callback=function(){Ed||(Ed=!0,Cp=y),dp(s,c)},m}function Sw(s,c,m){m=Oi(-1,m),m.tag=3;var y=s.type.getDerivedStateFromError;if(typeof y=="function"){var b=c.value;m.payload=function(){return y(b)},m.callback=function(){dp(s,c)}}var j=s.stateNode;return j!==null&&typeof j.componentDidCatch=="function"&&(m.callback=function(){dp(s,c),typeof y!="function"&&(ha===null?ha=new Set([this]):ha.add(this));var A=c.stack;this.componentDidCatch(c.value,{componentStack:A!==null?A:""})}),m}function jw(s,c,m){var y=s.pingCache;if(y===null){y=s.pingCache=new f4;var b=new Set;y.set(c,b)}else b=y.get(c),b===void 0&&(b=new Set,y.set(c,b));b.has(m)||(b.add(m),s=C4.bind(null,s,c,m),c.then(s,s))}function Nw(s){do{var c;if((c=s.tag===13)&&(c=s.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return s;s=s.return}while(s!==null);return null}function Cw(s,c,m,y,b){return(s.mode&1)===0?(s===c?s.flags|=65536:(s.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(c=Oi(-1,1),c.tag=2,fa(m,c,1))),m.lanes|=1),s):(s.flags|=65536,s.lanes=b,s)}var m4=T.ReactCurrentOwner,$n=!1;function On(s,c,m,y){c.child=s===null?Hb(c,null,m,y):yo(c,s.child,m,y)}function kw(s,c,m,y,b){m=m.render;var j=c.ref;return vo(c,b),y=np(s,c,m,y,j,b),m=rp(),s!==null&&!$n?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~b,Ii(s,c,b)):(qt&&m&&Fh(c),c.flags|=1,On(s,c,y,b),c.child)}function Pw(s,c,m,y,b){if(s===null){var j=m.type;return typeof j=="function"&&!Rp(j)&&j.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(c.tag=15,c.type=j,Ew(s,c,j,y,b)):(s=Id(m.type,null,y,c,c.mode,b),s.ref=c.ref,s.return=c,c.child=s)}if(j=s.child,(s.lanes&b)===0){var A=j.memoizedProps;if(m=m.compare,m=m!==null?m:Ul,m(A,y)&&s.ref===c.ref)return Ii(s,c,b)}return c.flags|=1,s=xa(j,y),s.ref=c.ref,s.return=c,c.child=s}function Ew(s,c,m,y,b){if(s!==null){var j=s.memoizedProps;if(Ul(j,y)&&s.ref===c.ref)if($n=!1,c.pendingProps=y=j,(s.lanes&b)!==0)(s.flags&131072)!==0&&($n=!0);else return c.lanes=s.lanes,Ii(s,c,b)}return fp(s,c,m,y,b)}function Tw(s,c,m){var y=c.pendingProps,b=y.children,j=s!==null?s.memoizedState:null;if(y.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Et(So,ur),ur|=m;else{if((m&1073741824)===0)return s=j!==null?j.baseLanes|m:m,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:s,cachePool:null,transitions:null},c.updateQueue=null,Et(So,ur),ur|=s,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=j!==null?j.baseLanes:m,Et(So,ur),ur|=y}else j!==null?(y=j.baseLanes|m,c.memoizedState=null):y=m,Et(So,ur),ur|=y;return On(s,c,b,m),c.child}function Aw(s,c){var m=c.ref;(s===null&&m!==null||s!==null&&s.ref!==m)&&(c.flags|=512,c.flags|=2097152)}function fp(s,c,m,y,b){var j=Vn(m)?ns:Nn.current;return j=mo(c,j),vo(c,b),m=np(s,c,m,y,j,b),y=rp(),s!==null&&!$n?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~b,Ii(s,c,b)):(qt&&y&&Fh(c),c.flags|=1,On(s,c,m,b),c.child)}function Mw(s,c,m,y,b){if(Vn(m)){var j=!0;sd(c)}else j=!1;if(vo(c,b),c.stateNode===null)jd(s,c),bw(c,m,y),cp(c,m,y,b),y=!0;else if(s===null){var A=c.stateNode,F=c.memoizedProps;A.props=F;var $=A.context,ee=m.contextType;typeof ee=="object"&&ee!==null?ee=_r(ee):(ee=Vn(m)?ns:Nn.current,ee=mo(c,ee));var fe=m.getDerivedStateFromProps,he=typeof fe=="function"||typeof A.getSnapshotBeforeUpdate=="function";he||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(F!==y||$!==ee)&&ww(c,A,y,ee),da=!1;var ue=c.memoizedState;A.state=ue,pd(c,y,A,b),$=c.memoizedState,F!==y||ue!==$||Bn.current||da?(typeof fe=="function"&&(lp(c,m,fe,y),$=c.memoizedState),(F=da||vw(c,m,F,y,ue,$,ee))?(he||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(c.flags|=4194308)):(typeof A.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=$),A.props=y,A.state=$,A.context=ee,y=F):(typeof A.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{A=c.stateNode,Gb(s,c),F=c.memoizedProps,ee=c.type===c.elementType?F:zr(c.type,F),A.props=ee,he=c.pendingProps,ue=A.context,$=m.contextType,typeof $=="object"&&$!==null?$=_r($):($=Vn(m)?ns:Nn.current,$=mo(c,$));var Ee=m.getDerivedStateFromProps;(fe=typeof Ee=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(F!==he||ue!==$)&&ww(c,A,y,$),da=!1,ue=c.memoizedState,A.state=ue,pd(c,y,A,b);var Me=c.memoizedState;F!==he||ue!==Me||Bn.current||da?(typeof Ee=="function"&&(lp(c,m,Ee,y),Me=c.memoizedState),(ee=da||vw(c,m,ee,y,ue,Me,$)||!1)?(fe||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(y,Me,$),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(y,Me,$)),typeof A.componentDidUpdate=="function"&&(c.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof A.componentDidUpdate!="function"||F===s.memoizedProps&&ue===s.memoizedState||(c.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||F===s.memoizedProps&&ue===s.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=Me),A.props=y,A.state=Me,A.context=$,y=ee):(typeof A.componentDidUpdate!="function"||F===s.memoizedProps&&ue===s.memoizedState||(c.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||F===s.memoizedProps&&ue===s.memoizedState||(c.flags|=1024),y=!1)}return mp(s,c,m,y,j,b)}function mp(s,c,m,y,b,j){Aw(s,c);var A=(c.flags&128)!==0;if(!y&&!A)return b&&Lb(c,m,!1),Ii(s,c,j);y=c.stateNode,m4.current=c;var F=A&&typeof m.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,s!==null&&A?(c.child=yo(c,s.child,null,j),c.child=yo(c,null,F,j)):On(s,c,F,j),c.memoizedState=y.state,b&&Lb(c,m,!0),c.child}function Rw(s){var c=s.stateNode;c.pendingContext?Ib(s,c.pendingContext,c.pendingContext!==c.context):c.context&&Ib(s,c.context,!1),Yh(s,c.containerInfo)}function Ow(s,c,m,y,b){return go(),$h(b),c.flags|=256,On(s,c,m,y),c.child}var hp={dehydrated:null,treeContext:null,retryLane:0};function pp(s){return{baseLanes:s,cachePool:null,transitions:null}}function Iw(s,c,m){var y=c.pendingProps,b=Vt.current,j=!1,A=(c.flags&128)!==0,F;if((F=A)||(F=s!==null&&s.memoizedState===null?!1:(b&2)!==0),F?(j=!0,c.flags&=-129):(s===null||s.memoizedState!==null)&&(b|=1),Et(Vt,b&1),s===null)return Vh(c),s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((c.mode&1)===0?c.lanes=1:s.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(A=y.children,s=y.fallback,j?(y=c.mode,j=c.child,A={mode:"hidden",children:A},(y&1)===0&&j!==null?(j.childLanes=0,j.pendingProps=A):j=Dd(A,y,0,null),s=fs(s,y,m,null),j.return=c,s.return=c,j.sibling=s,c.child=j,c.child.memoizedState=pp(m),c.memoizedState=hp,s):gp(c,A));if(b=s.memoizedState,b!==null&&(F=b.dehydrated,F!==null))return h4(s,c,A,y,F,b,m);if(j){j=y.fallback,A=c.mode,b=s.child,F=b.sibling;var $={mode:"hidden",children:y.children};return(A&1)===0&&c.child!==b?(y=c.child,y.childLanes=0,y.pendingProps=$,c.deletions=null):(y=xa(b,$),y.subtreeFlags=b.subtreeFlags&14680064),F!==null?j=xa(F,j):(j=fs(j,A,m,null),j.flags|=2),j.return=c,y.return=c,y.sibling=j,c.child=y,y=j,j=c.child,A=s.child.memoizedState,A=A===null?pp(m):{baseLanes:A.baseLanes|m,cachePool:null,transitions:A.transitions},j.memoizedState=A,j.childLanes=s.childLanes&~m,c.memoizedState=hp,y}return j=s.child,s=j.sibling,y=xa(j,{mode:"visible",children:y.children}),(c.mode&1)===0&&(y.lanes=m),y.return=c,y.sibling=null,s!==null&&(m=c.deletions,m===null?(c.deletions=[s],c.flags|=16):m.push(s)),c.child=y,c.memoizedState=null,y}function gp(s,c){return c=Dd({mode:"visible",children:c},s.mode,0,null),c.return=s,s.child=c}function Sd(s,c,m,y){return y!==null&&$h(y),yo(c,s.child,null,m),s=gp(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function h4(s,c,m,y,b,j,A){if(m)return c.flags&256?(c.flags&=-257,y=up(Error(n(422))),Sd(s,c,A,y)):c.memoizedState!==null?(c.child=s.child,c.flags|=128,null):(j=y.fallback,b=c.mode,y=Dd({mode:"visible",children:y.children},b,0,null),j=fs(j,b,A,null),j.flags|=2,y.return=c,j.return=c,y.sibling=j,c.child=y,(c.mode&1)!==0&&yo(c,s.child,null,A),c.child.memoizedState=pp(A),c.memoizedState=hp,j);if((c.mode&1)===0)return Sd(s,c,A,null);if(b.data==="$!"){if(y=b.nextSibling&&b.nextSibling.dataset,y)var F=y.dgst;return y=F,j=Error(n(419)),y=up(j,y,void 0),Sd(s,c,A,y)}if(F=(A&s.childLanes)!==0,$n||F){if(y=mn,y!==null){switch(A&-A){case 4:b=2;break;case 16:b=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(y.suspendedLanes|A))!==0?0:b,b!==0&&b!==j.retryLane&&(j.retryLane=b,Ri(s,b),$r(y,s,b,-1))}return Mp(),y=up(Error(n(421))),Sd(s,c,A,y)}return b.data==="$?"?(c.flags|=128,c.child=s.child,c=k4.bind(null,s),b._reactRetry=c,null):(s=j.treeContext,cr=oa(b.nextSibling),lr=c,qt=!0,Fr=null,s!==null&&(br[wr++]=Ai,br[wr++]=Mi,br[wr++]=rs,Ai=s.id,Mi=s.overflow,rs=c),c=gp(c,y.children),c.flags|=4096,c)}function Dw(s,c,m){s.lanes|=c;var y=s.alternate;y!==null&&(y.lanes|=c),Kh(s.return,c,m)}function yp(s,c,m,y,b){var j=s.memoizedState;j===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:m,tailMode:b}:(j.isBackwards=c,j.rendering=null,j.renderingStartTime=0,j.last=y,j.tail=m,j.tailMode=b)}function Lw(s,c,m){var y=c.pendingProps,b=y.revealOrder,j=y.tail;if(On(s,c,y.children,m),y=Vt.current,(y&2)!==0)y=y&1|2,c.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&Dw(s,m,c);else if(s.tag===19)Dw(s,m,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}y&=1}if(Et(Vt,y),(c.mode&1)===0)c.memoizedState=null;else switch(b){case"forwards":for(m=c.child,b=null;m!==null;)s=m.alternate,s!==null&&gd(s)===null&&(b=m),m=m.sibling;m=b,m===null?(b=c.child,c.child=null):(b=m.sibling,m.sibling=null),yp(c,!1,b,m,j);break;case"backwards":for(m=null,b=c.child,c.child=null;b!==null;){if(s=b.alternate,s!==null&&gd(s)===null){c.child=b;break}s=b.sibling,b.sibling=m,m=b,b=s}yp(c,!0,m,null,j);break;case"together":yp(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function jd(s,c){(c.mode&1)===0&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=2)}function Ii(s,c,m){if(s!==null&&(c.dependencies=s.dependencies),ls|=c.lanes,(m&c.childLanes)===0)return null;if(s!==null&&c.child!==s.child)throw Error(n(153));if(c.child!==null){for(s=c.child,m=xa(s,s.pendingProps),c.child=m,m.return=c;s.sibling!==null;)s=s.sibling,m=m.sibling=xa(s,s.pendingProps),m.return=c;m.sibling=null}return c.child}function p4(s,c,m){switch(c.tag){case 3:Rw(c),go();break;case 5:Xb(c);break;case 1:Vn(c.type)&&sd(c);break;case 4:Yh(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,b=c.memoizedProps.value;Et(fd,y._currentValue),y._currentValue=b;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(Et(Vt,Vt.current&1),c.flags|=128,null):(m&c.child.childLanes)!==0?Iw(s,c,m):(Et(Vt,Vt.current&1),s=Ii(s,c,m),s!==null?s.sibling:null);Et(Vt,Vt.current&1);break;case 19:if(y=(m&c.childLanes)!==0,(s.flags&128)!==0){if(y)return Lw(s,c,m);c.flags|=128}if(b=c.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),Et(Vt,Vt.current),y)break;return null;case 22:case 23:return c.lanes=0,Tw(s,c,m)}return Ii(s,c,m)}var qw,xp,Fw,zw;qw=function(s,c){for(var m=c.child;m!==null;){if(m.tag===5||m.tag===6)s.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===c)break;for(;m.sibling===null;){if(m.return===null||m.return===c)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},xp=function(){},Fw=function(s,c,m,y){var b=s.memoizedProps;if(b!==y){s=c.stateNode,ss(ii.current);var j=null;switch(m){case"input":b=Pe(s,b),y=Pe(s,y),j=[];break;case"select":b=M({},b,{value:void 0}),y=M({},y,{value:void 0}),j=[];break;case"textarea":b=Je(s,b),y=Je(s,y),j=[];break;default:typeof b.onClick!="function"&&typeof y.onClick=="function"&&(s.onclick=rd)}yn(m,y);var A;m=null;for(ee in b)if(!y.hasOwnProperty(ee)&&b.hasOwnProperty(ee)&&b[ee]!=null)if(ee==="style"){var F=b[ee];for(A in F)F.hasOwnProperty(A)&&(m||(m={}),m[A]="")}else ee!=="dangerouslySetInnerHTML"&&ee!=="children"&&ee!=="suppressContentEditableWarning"&&ee!=="suppressHydrationWarning"&&ee!=="autoFocus"&&(i.hasOwnProperty(ee)?j||(j=[]):(j=j||[]).push(ee,null));for(ee in y){var $=y[ee];if(F=b!=null?b[ee]:void 0,y.hasOwnProperty(ee)&&$!==F&&($!=null||F!=null))if(ee==="style")if(F){for(A in F)!F.hasOwnProperty(A)||$&&$.hasOwnProperty(A)||(m||(m={}),m[A]="");for(A in $)$.hasOwnProperty(A)&&F[A]!==$[A]&&(m||(m={}),m[A]=$[A])}else m||(j||(j=[]),j.push(ee,m)),m=$;else ee==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,F=F?F.__html:void 0,$!=null&&F!==$&&(j=j||[]).push(ee,$)):ee==="children"?typeof $!="string"&&typeof $!="number"||(j=j||[]).push(ee,""+$):ee!=="suppressContentEditableWarning"&&ee!=="suppressHydrationWarning"&&(i.hasOwnProperty(ee)?($!=null&&ee==="onScroll"&&It("scroll",s),j||F===$||(j=[])):(j=j||[]).push(ee,$))}m&&(j=j||[]).push("style",m);var ee=j;(c.updateQueue=ee)&&(c.flags|=4)}},zw=function(s,c,m,y){m!==y&&(c.flags|=4)};function ac(s,c){if(!qt)switch(s.tailMode){case"hidden":c=s.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?s.tail=null:m.sibling=null;break;case"collapsed":m=s.tail;for(var y=null;m!==null;)m.alternate!==null&&(y=m),m=m.sibling;y===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:y.sibling=null}}function kn(s){var c=s.alternate!==null&&s.alternate.child===s.child,m=0,y=0;if(c)for(var b=s.child;b!==null;)m|=b.lanes|b.childLanes,y|=b.subtreeFlags&14680064,y|=b.flags&14680064,b.return=s,b=b.sibling;else for(b=s.child;b!==null;)m|=b.lanes|b.childLanes,y|=b.subtreeFlags,y|=b.flags,b.return=s,b=b.sibling;return s.subtreeFlags|=y,s.childLanes=m,c}function g4(s,c,m){var y=c.pendingProps;switch(zh(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kn(c),null;case 1:return Vn(c.type)&&ad(),kn(c),null;case 3:return y=c.stateNode,bo(),Dt(Bn),Dt(Nn),Zh(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(s===null||s.child===null)&&(ud(c)?c.flags|=4:s===null||s.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Fr!==null&&(Ep(Fr),Fr=null))),xp(s,c),kn(c),null;case 5:Xh(c);var b=ss(ec.current);if(m=c.type,s!==null&&c.stateNode!=null)Fw(s,c,m,y,b),s.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(n(166));return kn(c),null}if(s=ss(ii.current),ud(c)){y=c.stateNode,m=c.type;var j=c.memoizedProps;switch(y[ri]=c,y[Ql]=j,s=(c.mode&1)!==0,m){case"dialog":It("cancel",y),It("close",y);break;case"iframe":case"object":case"embed":It("load",y);break;case"video":case"audio":for(b=0;b<Hl.length;b++)It(Hl[b],y);break;case"source":It("error",y);break;case"img":case"image":case"link":It("error",y),It("load",y);break;case"details":It("toggle",y);break;case"input":Mt(y,j),It("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!j.multiple},It("invalid",y);break;case"textarea":We(y,j),It("invalid",y)}yn(m,j),b=null;for(var A in j)if(j.hasOwnProperty(A)){var F=j[A];A==="children"?typeof F=="string"?y.textContent!==F&&(j.suppressHydrationWarning!==!0&&nd(y.textContent,F,s),b=["children",F]):typeof F=="number"&&y.textContent!==""+F&&(j.suppressHydrationWarning!==!0&&nd(y.textContent,F,s),b=["children",""+F]):i.hasOwnProperty(A)&&F!=null&&A==="onScroll"&&It("scroll",y)}switch(m){case"input":se(y),Ye(y,j,!0);break;case"textarea":se(y),gt(y);break;case"select":case"option":break;default:typeof j.onClick=="function"&&(y.onclick=rd)}y=b,c.updateQueue=y,y!==null&&(c.flags|=4)}else{A=b.nodeType===9?b:b.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=ie(m)),s==="http://www.w3.org/1999/xhtml"?m==="script"?(s=A.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof y.is=="string"?s=A.createElement(m,{is:y.is}):(s=A.createElement(m),m==="select"&&(A=s,y.multiple?A.multiple=!0:y.size&&(A.size=y.size))):s=A.createElementNS(s,m),s[ri]=c,s[Ql]=y,qw(s,c,!1,!1),c.stateNode=s;e:{switch(A=ti(m,y),m){case"dialog":It("cancel",s),It("close",s),b=y;break;case"iframe":case"object":case"embed":It("load",s),b=y;break;case"video":case"audio":for(b=0;b<Hl.length;b++)It(Hl[b],s);b=y;break;case"source":It("error",s),b=y;break;case"img":case"image":case"link":It("error",s),It("load",s),b=y;break;case"details":It("toggle",s),b=y;break;case"input":Mt(s,y),b=Pe(s,y),It("invalid",s);break;case"option":b=y;break;case"select":s._wrapperState={wasMultiple:!!y.multiple},b=M({},y,{value:void 0}),It("invalid",s);break;case"textarea":We(s,y),b=Je(s,y),It("invalid",s);break;default:b=y}yn(m,b),F=b;for(j in F)if(F.hasOwnProperty(j)){var $=F[j];j==="style"?ea(s,$):j==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,$!=null&&qe(s,$)):j==="children"?typeof $=="string"?(m!=="textarea"||$!=="")&&Ve(s,$):typeof $=="number"&&Ve(s,""+$):j!=="suppressContentEditableWarning"&&j!=="suppressHydrationWarning"&&j!=="autoFocus"&&(i.hasOwnProperty(j)?$!=null&&j==="onScroll"&&It("scroll",s):$!=null&&P(s,j,$,A))}switch(m){case"input":se(s),Ye(s,y,!1);break;case"textarea":se(s),gt(s);break;case"option":y.value!=null&&s.setAttribute("value",""+we(y.value));break;case"select":s.multiple=!!y.multiple,j=y.value,j!=null?xe(s,!!y.multiple,j,!1):y.defaultValue!=null&&xe(s,!!y.multiple,y.defaultValue,!0);break;default:typeof b.onClick=="function"&&(s.onclick=rd)}switch(m){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return kn(c),null;case 6:if(s&&c.stateNode!=null)zw(s,c,s.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(m=ss(ec.current),ss(ii.current),ud(c)){if(y=c.stateNode,m=c.memoizedProps,y[ri]=c,(j=y.nodeValue!==m)&&(s=lr,s!==null))switch(s.tag){case 3:nd(y.nodeValue,m,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&nd(y.nodeValue,m,(s.mode&1)!==0)}j&&(c.flags|=4)}else y=(m.nodeType===9?m:m.ownerDocument).createTextNode(y),y[ri]=c,c.stateNode=y}return kn(c),null;case 13:if(Dt(Vt),y=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(qt&&cr!==null&&(c.mode&1)!==0&&(c.flags&128)===0)$b(),go(),c.flags|=98560,j=!1;else if(j=ud(c),y!==null&&y.dehydrated!==null){if(s===null){if(!j)throw Error(n(318));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(n(317));j[ri]=c}else go(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;kn(c),j=!1}else Fr!==null&&(Ep(Fr),Fr=null),j=!0;if(!j)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=m,c):(y=y!==null,y!==(s!==null&&s.memoizedState!==null)&&y&&(c.child.flags|=8192,(c.mode&1)!==0&&(s===null||(Vt.current&1)!==0?cn===0&&(cn=3):Mp())),c.updateQueue!==null&&(c.flags|=4),kn(c),null);case 4:return bo(),xp(s,c),s===null&&Kl(c.stateNode.containerInfo),kn(c),null;case 10:return Hh(c.type._context),kn(c),null;case 17:return Vn(c.type)&&ad(),kn(c),null;case 19:if(Dt(Vt),j=c.memoizedState,j===null)return kn(c),null;if(y=(c.flags&128)!==0,A=j.rendering,A===null)if(y)ac(j,!1);else{if(cn!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(A=gd(s),A!==null){for(c.flags|=128,ac(j,!1),y=A.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=m,m=c.child;m!==null;)j=m,s=y,j.flags&=14680066,A=j.alternate,A===null?(j.childLanes=0,j.lanes=s,j.child=null,j.subtreeFlags=0,j.memoizedProps=null,j.memoizedState=null,j.updateQueue=null,j.dependencies=null,j.stateNode=null):(j.childLanes=A.childLanes,j.lanes=A.lanes,j.child=A.child,j.subtreeFlags=0,j.deletions=null,j.memoizedProps=A.memoizedProps,j.memoizedState=A.memoizedState,j.updateQueue=A.updateQueue,j.type=A.type,s=A.dependencies,j.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),m=m.sibling;return Et(Vt,Vt.current&1|2),c.child}s=s.sibling}j.tail!==null&&Yt()>jo&&(c.flags|=128,y=!0,ac(j,!1),c.lanes=4194304)}else{if(!y)if(s=gd(A),s!==null){if(c.flags|=128,y=!0,m=s.updateQueue,m!==null&&(c.updateQueue=m,c.flags|=4),ac(j,!0),j.tail===null&&j.tailMode==="hidden"&&!A.alternate&&!qt)return kn(c),null}else 2*Yt()-j.renderingStartTime>jo&&m!==1073741824&&(c.flags|=128,y=!0,ac(j,!1),c.lanes=4194304);j.isBackwards?(A.sibling=c.child,c.child=A):(m=j.last,m!==null?m.sibling=A:c.child=A,j.last=A)}return j.tail!==null?(c=j.tail,j.rendering=c,j.tail=c.sibling,j.renderingStartTime=Yt(),c.sibling=null,m=Vt.current,Et(Vt,y?m&1|2:m&1),c):(kn(c),null);case 22:case 23:return Ap(),y=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(ur&1073741824)!==0&&(kn(c),c.subtreeFlags&6&&(c.flags|=8192)):kn(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function y4(s,c){switch(zh(c),c.tag){case 1:return Vn(c.type)&&ad(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return bo(),Dt(Bn),Dt(Nn),Zh(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 5:return Xh(c),null;case 13:if(Dt(Vt),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(n(340));go()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return Dt(Vt),null;case 4:return bo(),null;case 10:return Hh(c.type._context),null;case 22:case 23:return Ap(),null;case 24:return null;default:return null}}var Nd=!1,Pn=!1,x4=typeof WeakSet=="function"?WeakSet:Set,Te=null;function _o(s,c){var m=s.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(y){Wt(s,c,y)}else m.current=null}function vp(s,c,m){try{m()}catch(y){Wt(s,c,y)}}var Bw=!1;function v4(s,c){if(Ah=Wu,s=vb(),Sh(s)){if("selectionStart"in s)var m={start:s.selectionStart,end:s.selectionEnd};else e:{m=(m=s.ownerDocument)&&m.defaultView||window;var y=m.getSelection&&m.getSelection();if(y&&y.rangeCount!==0){m=y.anchorNode;var b=y.anchorOffset,j=y.focusNode;y=y.focusOffset;try{m.nodeType,j.nodeType}catch{m=null;break e}var A=0,F=-1,$=-1,ee=0,fe=0,he=s,ue=null;t:for(;;){for(var Ee;he!==m||b!==0&&he.nodeType!==3||(F=A+b),he!==j||y!==0&&he.nodeType!==3||($=A+y),he.nodeType===3&&(A+=he.nodeValue.length),(Ee=he.firstChild)!==null;)ue=he,he=Ee;for(;;){if(he===s)break t;if(ue===m&&++ee===b&&(F=A),ue===j&&++fe===y&&($=A),(Ee=he.nextSibling)!==null)break;he=ue,ue=he.parentNode}he=Ee}m=F===-1||$===-1?null:{start:F,end:$}}else m=null}m=m||{start:0,end:0}}else m=null;for(Mh={focusedElem:s,selectionRange:m},Wu=!1,Te=c;Te!==null;)if(c=Te,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,Te=s;else for(;Te!==null;){c=Te;try{var Me=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Me!==null){var Ie=Me.memoizedProps,Xt=Me.memoizedState,Q=c.stateNode,H=Q.getSnapshotBeforeUpdate(c.elementType===c.type?Ie:zr(c.type,Ie),Xt);Q.__reactInternalSnapshotBeforeUpdate=H}break;case 3:var X=c.stateNode.containerInfo;X.nodeType===1?X.textContent="":X.nodeType===9&&X.documentElement&&X.removeChild(X.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ve){Wt(c,c.return,ve)}if(s=c.sibling,s!==null){s.return=c.return,Te=s;break}Te=c.return}return Me=Bw,Bw=!1,Me}function sc(s,c,m){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var b=y=y.next;do{if((b.tag&s)===s){var j=b.destroy;b.destroy=void 0,j!==void 0&&vp(c,m,j)}b=b.next}while(b!==y)}}function Cd(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var m=c=c.next;do{if((m.tag&s)===s){var y=m.create;m.destroy=y()}m=m.next}while(m!==c)}}function bp(s){var c=s.ref;if(c!==null){var m=s.stateNode;switch(s.tag){case 5:s=m;break;default:s=m}typeof c=="function"?c(s):c.current=s}}function Vw(s){var c=s.alternate;c!==null&&(s.alternate=null,Vw(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&(delete c[ri],delete c[Ql],delete c[Dh],delete c[t4],delete c[n4])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function $w(s){return s.tag===5||s.tag===3||s.tag===4}function Uw(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||$w(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function wp(s,c,m){var y=s.tag;if(y===5||y===6)s=s.stateNode,c?m.nodeType===8?m.parentNode.insertBefore(s,c):m.insertBefore(s,c):(m.nodeType===8?(c=m.parentNode,c.insertBefore(s,m)):(c=m,c.appendChild(s)),m=m._reactRootContainer,m!=null||c.onclick!==null||(c.onclick=rd));else if(y!==4&&(s=s.child,s!==null))for(wp(s,c,m),s=s.sibling;s!==null;)wp(s,c,m),s=s.sibling}function _p(s,c,m){var y=s.tag;if(y===5||y===6)s=s.stateNode,c?m.insertBefore(s,c):m.appendChild(s);else if(y!==4&&(s=s.child,s!==null))for(_p(s,c,m),s=s.sibling;s!==null;)_p(s,c,m),s=s.sibling}var xn=null,Br=!1;function ma(s,c,m){for(m=m.child;m!==null;)Ww(s,c,m),m=m.sibling}function Ww(s,c,m){if(ni&&typeof ni.onCommitFiberUnmount=="function")try{ni.onCommitFiberUnmount(Fu,m)}catch{}switch(m.tag){case 5:Pn||_o(m,c);case 6:var y=xn,b=Br;xn=null,ma(s,c,m),xn=y,Br=b,xn!==null&&(Br?(s=xn,m=m.stateNode,s.nodeType===8?s.parentNode.removeChild(m):s.removeChild(m)):xn.removeChild(m.stateNode));break;case 18:xn!==null&&(Br?(s=xn,m=m.stateNode,s.nodeType===8?Ih(s.parentNode,m):s.nodeType===1&&Ih(s,m),ql(s)):Ih(xn,m.stateNode));break;case 4:y=xn,b=Br,xn=m.stateNode.containerInfo,Br=!0,ma(s,c,m),xn=y,Br=b;break;case 0:case 11:case 14:case 15:if(!Pn&&(y=m.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){b=y=y.next;do{var j=b,A=j.destroy;j=j.tag,A!==void 0&&((j&2)!==0||(j&4)!==0)&&vp(m,c,A),b=b.next}while(b!==y)}ma(s,c,m);break;case 1:if(!Pn&&(_o(m,c),y=m.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=m.memoizedProps,y.state=m.memoizedState,y.componentWillUnmount()}catch(F){Wt(m,c,F)}ma(s,c,m);break;case 21:ma(s,c,m);break;case 22:m.mode&1?(Pn=(y=Pn)||m.memoizedState!==null,ma(s,c,m),Pn=y):ma(s,c,m);break;default:ma(s,c,m)}}function Hw(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var m=s.stateNode;m===null&&(m=s.stateNode=new x4),c.forEach(function(y){var b=P4.bind(null,s,y);m.has(y)||(m.add(y),y.then(b,b))})}}function Vr(s,c){var m=c.deletions;if(m!==null)for(var y=0;y<m.length;y++){var b=m[y];try{var j=s,A=c,F=A;e:for(;F!==null;){switch(F.tag){case 5:xn=F.stateNode,Br=!1;break e;case 3:xn=F.stateNode.containerInfo,Br=!0;break e;case 4:xn=F.stateNode.containerInfo,Br=!0;break e}F=F.return}if(xn===null)throw Error(n(160));Ww(j,A,b),xn=null,Br=!1;var $=b.alternate;$!==null&&($.return=null),b.return=null}catch(ee){Wt(b,c,ee)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Kw(c,s),c=c.sibling}function Kw(s,c){var m=s.alternate,y=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Vr(c,s),si(s),y&4){try{sc(3,s,s.return),Cd(3,s)}catch(Ie){Wt(s,s.return,Ie)}try{sc(5,s,s.return)}catch(Ie){Wt(s,s.return,Ie)}}break;case 1:Vr(c,s),si(s),y&512&&m!==null&&_o(m,m.return);break;case 5:if(Vr(c,s),si(s),y&512&&m!==null&&_o(m,m.return),s.flags&32){var b=s.stateNode;try{Ve(b,"")}catch(Ie){Wt(s,s.return,Ie)}}if(y&4&&(b=s.stateNode,b!=null)){var j=s.memoizedProps,A=m!==null?m.memoizedProps:j,F=s.type,$=s.updateQueue;if(s.updateQueue=null,$!==null)try{F==="input"&&j.type==="radio"&&j.name!=null&&Rt(b,j),ti(F,A);var ee=ti(F,j);for(A=0;A<$.length;A+=2){var fe=$[A],he=$[A+1];fe==="style"?ea(b,he):fe==="dangerouslySetInnerHTML"?qe(b,he):fe==="children"?Ve(b,he):P(b,fe,he,ee)}switch(F){case"input":pe(b,j);break;case"textarea":Ct(b,j);break;case"select":var ue=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!j.multiple;var Ee=j.value;Ee!=null?xe(b,!!j.multiple,Ee,!1):ue!==!!j.multiple&&(j.defaultValue!=null?xe(b,!!j.multiple,j.defaultValue,!0):xe(b,!!j.multiple,j.multiple?[]:"",!1))}b[Ql]=j}catch(Ie){Wt(s,s.return,Ie)}}break;case 6:if(Vr(c,s),si(s),y&4){if(s.stateNode===null)throw Error(n(162));b=s.stateNode,j=s.memoizedProps;try{b.nodeValue=j}catch(Ie){Wt(s,s.return,Ie)}}break;case 3:if(Vr(c,s),si(s),y&4&&m!==null&&m.memoizedState.isDehydrated)try{ql(c.containerInfo)}catch(Ie){Wt(s,s.return,Ie)}break;case 4:Vr(c,s),si(s);break;case 13:Vr(c,s),si(s),b=s.child,b.flags&8192&&(j=b.memoizedState!==null,b.stateNode.isHidden=j,!j||b.alternate!==null&&b.alternate.memoizedState!==null||(Np=Yt())),y&4&&Hw(s);break;case 22:if(fe=m!==null&&m.memoizedState!==null,s.mode&1?(Pn=(ee=Pn)||fe,Vr(c,s),Pn=ee):Vr(c,s),si(s),y&8192){if(ee=s.memoizedState!==null,(s.stateNode.isHidden=ee)&&!fe&&(s.mode&1)!==0)for(Te=s,fe=s.child;fe!==null;){for(he=Te=fe;Te!==null;){switch(ue=Te,Ee=ue.child,ue.tag){case 0:case 11:case 14:case 15:sc(4,ue,ue.return);break;case 1:_o(ue,ue.return);var Me=ue.stateNode;if(typeof Me.componentWillUnmount=="function"){y=ue,m=ue.return;try{c=y,Me.props=c.memoizedProps,Me.state=c.memoizedState,Me.componentWillUnmount()}catch(Ie){Wt(y,m,Ie)}}break;case 5:_o(ue,ue.return);break;case 22:if(ue.memoizedState!==null){Yw(he);continue}}Ee!==null?(Ee.return=ue,Te=Ee):Yw(he)}fe=fe.sibling}e:for(fe=null,he=s;;){if(he.tag===5){if(fe===null){fe=he;try{b=he.stateNode,ee?(j=b.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none"):(F=he.stateNode,$=he.memoizedProps.style,A=$!=null&&$.hasOwnProperty("display")?$.display:null,F.style.display=ar("display",A))}catch(Ie){Wt(s,s.return,Ie)}}}else if(he.tag===6){if(fe===null)try{he.stateNode.nodeValue=ee?"":he.memoizedProps}catch(Ie){Wt(s,s.return,Ie)}}else if((he.tag!==22&&he.tag!==23||he.memoizedState===null||he===s)&&he.child!==null){he.child.return=he,he=he.child;continue}if(he===s)break e;for(;he.sibling===null;){if(he.return===null||he.return===s)break e;fe===he&&(fe=null),he=he.return}fe===he&&(fe=null),he.sibling.return=he.return,he=he.sibling}}break;case 19:Vr(c,s),si(s),y&4&&Hw(s);break;case 21:break;default:Vr(c,s),si(s)}}function si(s){var c=s.flags;if(c&2){try{e:{for(var m=s.return;m!==null;){if($w(m)){var y=m;break e}m=m.return}throw Error(n(160))}switch(y.tag){case 5:var b=y.stateNode;y.flags&32&&(Ve(b,""),y.flags&=-33);var j=Uw(s);_p(s,j,b);break;case 3:case 4:var A=y.stateNode.containerInfo,F=Uw(s);wp(s,F,A);break;default:throw Error(n(161))}}catch($){Wt(s,s.return,$)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function b4(s,c,m){Te=s,Gw(s)}function Gw(s,c,m){for(var y=(s.mode&1)!==0;Te!==null;){var b=Te,j=b.child;if(b.tag===22&&y){var A=b.memoizedState!==null||Nd;if(!A){var F=b.alternate,$=F!==null&&F.memoizedState!==null||Pn;F=Nd;var ee=Pn;if(Nd=A,(Pn=$)&&!ee)for(Te=b;Te!==null;)A=Te,$=A.child,A.tag===22&&A.memoizedState!==null?Xw(b):$!==null?($.return=A,Te=$):Xw(b);for(;j!==null;)Te=j,Gw(j),j=j.sibling;Te=b,Nd=F,Pn=ee}Qw(s)}else(b.subtreeFlags&8772)!==0&&j!==null?(j.return=b,Te=j):Qw(s)}}function Qw(s){for(;Te!==null;){var c=Te;if((c.flags&8772)!==0){var m=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Pn||Cd(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!Pn)if(m===null)y.componentDidMount();else{var b=c.elementType===c.type?m.memoizedProps:zr(c.type,m.memoizedProps);y.componentDidUpdate(b,m.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var j=c.updateQueue;j!==null&&Yb(c,j,y);break;case 3:var A=c.updateQueue;if(A!==null){if(m=null,c.child!==null)switch(c.child.tag){case 5:m=c.child.stateNode;break;case 1:m=c.child.stateNode}Yb(c,A,m)}break;case 5:var F=c.stateNode;if(m===null&&c.flags&4){m=F;var $=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":$.autoFocus&&m.focus();break;case"img":$.src&&(m.src=$.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var ee=c.alternate;if(ee!==null){var fe=ee.memoizedState;if(fe!==null){var he=fe.dehydrated;he!==null&&ql(he)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Pn||c.flags&512&&bp(c)}catch(ue){Wt(c,c.return,ue)}}if(c===s){Te=null;break}if(m=c.sibling,m!==null){m.return=c.return,Te=m;break}Te=c.return}}function Yw(s){for(;Te!==null;){var c=Te;if(c===s){Te=null;break}var m=c.sibling;if(m!==null){m.return=c.return,Te=m;break}Te=c.return}}function Xw(s){for(;Te!==null;){var c=Te;try{switch(c.tag){case 0:case 11:case 15:var m=c.return;try{Cd(4,c)}catch($){Wt(c,m,$)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var b=c.return;try{y.componentDidMount()}catch($){Wt(c,b,$)}}var j=c.return;try{bp(c)}catch($){Wt(c,j,$)}break;case 5:var A=c.return;try{bp(c)}catch($){Wt(c,A,$)}}}catch($){Wt(c,c.return,$)}if(c===s){Te=null;break}var F=c.sibling;if(F!==null){F.return=c.return,Te=F;break}Te=c.return}}var w4=Math.ceil,kd=T.ReactCurrentDispatcher,Sp=T.ReactCurrentOwner,jr=T.ReactCurrentBatchConfig,pt=0,mn=null,nn=null,vn=0,ur=0,So=la(0),cn=0,oc=null,ls=0,Pd=0,jp=0,lc=null,Un=null,Np=0,jo=1/0,Di=null,Ed=!1,Cp=null,ha=null,Td=!1,pa=null,Ad=0,cc=0,kp=null,Md=-1,Rd=0;function In(){return(pt&6)!==0?Yt():Md!==-1?Md:Md=Yt()}function ga(s){return(s.mode&1)===0?1:(pt&2)!==0&&vn!==0?vn&-vn:i4.transition!==null?(Rd===0&&(Rd=Uv()),Rd):(s=St,s!==0||(s=window.event,s=s===void 0?16:Zv(s.type)),s)}function $r(s,c,m,y){if(50<cc)throw cc=0,kp=null,Error(n(185));Rl(s,m,y),((pt&2)===0||s!==mn)&&(s===mn&&((pt&2)===0&&(Pd|=m),cn===4&&ya(s,vn)),Wn(s,y),m===1&&pt===0&&(c.mode&1)===0&&(jo=Yt()+500,od&&ua()))}function Wn(s,c){var m=s.callbackNode;iR(s,c);var y=Vu(s,s===mn?vn:0);if(y===0)m!==null&&Bv(m),s.callbackNode=null,s.callbackPriority=0;else if(c=y&-y,s.callbackPriority!==c){if(m!=null&&Bv(m),c===1)s.tag===0?r4(Zw.bind(null,s)):qb(Zw.bind(null,s)),ZR(function(){(pt&6)===0&&ua()}),m=null;else{switch(Wv(y)){case 1:m=sh;break;case 4:m=Vv;break;case 16:m=qu;break;case 536870912:m=$v;break;default:m=qu}m=o_(m,Jw.bind(null,s))}s.callbackPriority=c,s.callbackNode=m}}function Jw(s,c){if(Md=-1,Rd=0,(pt&6)!==0)throw Error(n(327));var m=s.callbackNode;if(No()&&s.callbackNode!==m)return null;var y=Vu(s,s===mn?vn:0);if(y===0)return null;if((y&30)!==0||(y&s.expiredLanes)!==0||c)c=Od(s,y);else{c=y;var b=pt;pt|=2;var j=t_();(mn!==s||vn!==c)&&(Di=null,jo=Yt()+500,us(s,c));do try{j4();break}catch(F){e_(s,F)}while(!0);Wh(),kd.current=j,pt=b,nn!==null?c=0:(mn=null,vn=0,c=cn)}if(c!==0){if(c===2&&(b=oh(s),b!==0&&(y=b,c=Pp(s,b))),c===1)throw m=oc,us(s,0),ya(s,y),Wn(s,Yt()),m;if(c===6)ya(s,y);else{if(b=s.current.alternate,(y&30)===0&&!_4(b)&&(c=Od(s,y),c===2&&(j=oh(s),j!==0&&(y=j,c=Pp(s,j))),c===1))throw m=oc,us(s,0),ya(s,y),Wn(s,Yt()),m;switch(s.finishedWork=b,s.finishedLanes=y,c){case 0:case 1:throw Error(n(345));case 2:ds(s,Un,Di);break;case 3:if(ya(s,y),(y&130023424)===y&&(c=Np+500-Yt(),10<c)){if(Vu(s,0)!==0)break;if(b=s.suspendedLanes,(b&y)!==y){In(),s.pingedLanes|=s.suspendedLanes&b;break}s.timeoutHandle=Oh(ds.bind(null,s,Un,Di),c);break}ds(s,Un,Di);break;case 4:if(ya(s,y),(y&4194240)===y)break;for(c=s.eventTimes,b=-1;0<y;){var A=31-Lr(y);j=1<<A,A=c[A],A>b&&(b=A),y&=~j}if(y=b,y=Yt()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*w4(y/1960))-y,10<y){s.timeoutHandle=Oh(ds.bind(null,s,Un,Di),y);break}ds(s,Un,Di);break;case 5:ds(s,Un,Di);break;default:throw Error(n(329))}}}return Wn(s,Yt()),s.callbackNode===m?Jw.bind(null,s):null}function Pp(s,c){var m=lc;return s.current.memoizedState.isDehydrated&&(us(s,c).flags|=256),s=Od(s,c),s!==2&&(c=Un,Un=m,c!==null&&Ep(c)),s}function Ep(s){Un===null?Un=s:Un.push.apply(Un,s)}function _4(s){for(var c=s;;){if(c.flags&16384){var m=c.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var y=0;y<m.length;y++){var b=m[y],j=b.getSnapshot;b=b.value;try{if(!qr(j(),b))return!1}catch{return!1}}}if(m=c.child,c.subtreeFlags&16384&&m!==null)m.return=c,c=m;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function ya(s,c){for(c&=~jp,c&=~Pd,s.suspendedLanes|=c,s.pingedLanes&=~c,s=s.expirationTimes;0<c;){var m=31-Lr(c),y=1<<m;s[m]=-1,c&=~y}}function Zw(s){if((pt&6)!==0)throw Error(n(327));No();var c=Vu(s,0);if((c&1)===0)return Wn(s,Yt()),null;var m=Od(s,c);if(s.tag!==0&&m===2){var y=oh(s);y!==0&&(c=y,m=Pp(s,y))}if(m===1)throw m=oc,us(s,0),ya(s,c),Wn(s,Yt()),m;if(m===6)throw Error(n(345));return s.finishedWork=s.current.alternate,s.finishedLanes=c,ds(s,Un,Di),Wn(s,Yt()),null}function Tp(s,c){var m=pt;pt|=1;try{return s(c)}finally{pt=m,pt===0&&(jo=Yt()+500,od&&ua())}}function cs(s){pa!==null&&pa.tag===0&&(pt&6)===0&&No();var c=pt;pt|=1;var m=jr.transition,y=St;try{if(jr.transition=null,St=1,s)return s()}finally{St=y,jr.transition=m,pt=c,(pt&6)===0&&ua()}}function Ap(){ur=So.current,Dt(So)}function us(s,c){s.finishedWork=null,s.finishedLanes=0;var m=s.timeoutHandle;if(m!==-1&&(s.timeoutHandle=-1,JR(m)),nn!==null)for(m=nn.return;m!==null;){var y=m;switch(zh(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&ad();break;case 3:bo(),Dt(Bn),Dt(Nn),Zh();break;case 5:Xh(y);break;case 4:bo();break;case 13:Dt(Vt);break;case 19:Dt(Vt);break;case 10:Hh(y.type._context);break;case 22:case 23:Ap()}m=m.return}if(mn=s,nn=s=xa(s.current,null),vn=ur=c,cn=0,oc=null,jp=Pd=ls=0,Un=lc=null,as!==null){for(c=0;c<as.length;c++)if(m=as[c],y=m.interleaved,y!==null){m.interleaved=null;var b=y.next,j=m.pending;if(j!==null){var A=j.next;j.next=b,y.next=A}m.pending=y}as=null}return s}function e_(s,c){do{var m=nn;try{if(Wh(),yd.current=wd,xd){for(var y=$t.memoizedState;y!==null;){var b=y.queue;b!==null&&(b.pending=null),y=y.next}xd=!1}if(os=0,fn=ln=$t=null,tc=!1,nc=0,Sp.current=null,m===null||m.return===null){cn=1,oc=c,nn=null;break}e:{var j=s,A=m.return,F=m,$=c;if(c=vn,F.flags|=32768,$!==null&&typeof $=="object"&&typeof $.then=="function"){var ee=$,fe=F,he=fe.tag;if((fe.mode&1)===0&&(he===0||he===11||he===15)){var ue=fe.alternate;ue?(fe.updateQueue=ue.updateQueue,fe.memoizedState=ue.memoizedState,fe.lanes=ue.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var Ee=Nw(A);if(Ee!==null){Ee.flags&=-257,Cw(Ee,A,F,j,c),Ee.mode&1&&jw(j,ee,c),c=Ee,$=ee;var Me=c.updateQueue;if(Me===null){var Ie=new Set;Ie.add($),c.updateQueue=Ie}else Me.add($);break e}else{if((c&1)===0){jw(j,ee,c),Mp();break e}$=Error(n(426))}}else if(qt&&F.mode&1){var Xt=Nw(A);if(Xt!==null){(Xt.flags&65536)===0&&(Xt.flags|=256),Cw(Xt,A,F,j,c),$h(wo($,F));break e}}j=$=wo($,F),cn!==4&&(cn=2),lc===null?lc=[j]:lc.push(j),j=A;do{switch(j.tag){case 3:j.flags|=65536,c&=-c,j.lanes|=c;var Q=_w(j,$,c);Qb(j,Q);break e;case 1:F=$;var H=j.type,X=j.stateNode;if((j.flags&128)===0&&(typeof H.getDerivedStateFromError=="function"||X!==null&&typeof X.componentDidCatch=="function"&&(ha===null||!ha.has(X)))){j.flags|=65536,c&=-c,j.lanes|=c;var ve=Sw(j,F,c);Qb(j,ve);break e}}j=j.return}while(j!==null)}r_(m)}catch(Le){c=Le,nn===m&&m!==null&&(nn=m=m.return);continue}break}while(!0)}function t_(){var s=kd.current;return kd.current=wd,s===null?wd:s}function Mp(){(cn===0||cn===3||cn===2)&&(cn=4),mn===null||(ls&268435455)===0&&(Pd&268435455)===0||ya(mn,vn)}function Od(s,c){var m=pt;pt|=2;var y=t_();(mn!==s||vn!==c)&&(Di=null,us(s,c));do try{S4();break}catch(b){e_(s,b)}while(!0);if(Wh(),pt=m,kd.current=y,nn!==null)throw Error(n(261));return mn=null,vn=0,cn}function S4(){for(;nn!==null;)n_(nn)}function j4(){for(;nn!==null&&!Q2();)n_(nn)}function n_(s){var c=s_(s.alternate,s,ur);s.memoizedProps=s.pendingProps,c===null?r_(s):nn=c,Sp.current=null}function r_(s){var c=s;do{var m=c.alternate;if(s=c.return,(c.flags&32768)===0){if(m=g4(m,c,ur),m!==null){nn=m;return}}else{if(m=y4(m,c),m!==null){m.flags&=32767,nn=m;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{cn=6,nn=null;return}}if(c=c.sibling,c!==null){nn=c;return}nn=c=s}while(c!==null);cn===0&&(cn=5)}function ds(s,c,m){var y=St,b=jr.transition;try{jr.transition=null,St=1,N4(s,c,m,y)}finally{jr.transition=b,St=y}return null}function N4(s,c,m,y){do No();while(pa!==null);if((pt&6)!==0)throw Error(n(327));m=s.finishedWork;var b=s.finishedLanes;if(m===null)return null;if(s.finishedWork=null,s.finishedLanes=0,m===s.current)throw Error(n(177));s.callbackNode=null,s.callbackPriority=0;var j=m.lanes|m.childLanes;if(aR(s,j),s===mn&&(nn=mn=null,vn=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||Td||(Td=!0,o_(qu,function(){return No(),null})),j=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||j){j=jr.transition,jr.transition=null;var A=St;St=1;var F=pt;pt|=4,Sp.current=null,v4(s,m),Kw(m,s),WR(Mh),Wu=!!Ah,Mh=Ah=null,s.current=m,b4(m),Y2(),pt=F,St=A,jr.transition=j}else s.current=m;if(Td&&(Td=!1,pa=s,Ad=b),j=s.pendingLanes,j===0&&(ha=null),Z2(m.stateNode),Wn(s,Yt()),c!==null)for(y=s.onRecoverableError,m=0;m<c.length;m++)b=c[m],y(b.value,{componentStack:b.stack,digest:b.digest});if(Ed)throw Ed=!1,s=Cp,Cp=null,s;return(Ad&1)!==0&&s.tag!==0&&No(),j=s.pendingLanes,(j&1)!==0?s===kp?cc++:(cc=0,kp=s):cc=0,ua(),null}function No(){if(pa!==null){var s=Wv(Ad),c=jr.transition,m=St;try{if(jr.transition=null,St=16>s?16:s,pa===null)var y=!1;else{if(s=pa,pa=null,Ad=0,(pt&6)!==0)throw Error(n(331));var b=pt;for(pt|=4,Te=s.current;Te!==null;){var j=Te,A=j.child;if((Te.flags&16)!==0){var F=j.deletions;if(F!==null){for(var $=0;$<F.length;$++){var ee=F[$];for(Te=ee;Te!==null;){var fe=Te;switch(fe.tag){case 0:case 11:case 15:sc(8,fe,j)}var he=fe.child;if(he!==null)he.return=fe,Te=he;else for(;Te!==null;){fe=Te;var ue=fe.sibling,Ee=fe.return;if(Vw(fe),fe===ee){Te=null;break}if(ue!==null){ue.return=Ee,Te=ue;break}Te=Ee}}}var Me=j.alternate;if(Me!==null){var Ie=Me.child;if(Ie!==null){Me.child=null;do{var Xt=Ie.sibling;Ie.sibling=null,Ie=Xt}while(Ie!==null)}}Te=j}}if((j.subtreeFlags&2064)!==0&&A!==null)A.return=j,Te=A;else e:for(;Te!==null;){if(j=Te,(j.flags&2048)!==0)switch(j.tag){case 0:case 11:case 15:sc(9,j,j.return)}var Q=j.sibling;if(Q!==null){Q.return=j.return,Te=Q;break e}Te=j.return}}var H=s.current;for(Te=H;Te!==null;){A=Te;var X=A.child;if((A.subtreeFlags&2064)!==0&&X!==null)X.return=A,Te=X;else e:for(A=H;Te!==null;){if(F=Te,(F.flags&2048)!==0)try{switch(F.tag){case 0:case 11:case 15:Cd(9,F)}}catch(Le){Wt(F,F.return,Le)}if(F===A){Te=null;break e}var ve=F.sibling;if(ve!==null){ve.return=F.return,Te=ve;break e}Te=F.return}}if(pt=b,ua(),ni&&typeof ni.onPostCommitFiberRoot=="function")try{ni.onPostCommitFiberRoot(Fu,s)}catch{}y=!0}return y}finally{St=m,jr.transition=c}}return!1}function i_(s,c,m){c=wo(m,c),c=_w(s,c,1),s=fa(s,c,1),c=In(),s!==null&&(Rl(s,1,c),Wn(s,c))}function Wt(s,c,m){if(s.tag===3)i_(s,s,m);else for(;c!==null;){if(c.tag===3){i_(c,s,m);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(ha===null||!ha.has(y))){s=wo(m,s),s=Sw(c,s,1),c=fa(c,s,1),s=In(),c!==null&&(Rl(c,1,s),Wn(c,s));break}}c=c.return}}function C4(s,c,m){var y=s.pingCache;y!==null&&y.delete(c),c=In(),s.pingedLanes|=s.suspendedLanes&m,mn===s&&(vn&m)===m&&(cn===4||cn===3&&(vn&130023424)===vn&&500>Yt()-Np?us(s,0):jp|=m),Wn(s,c)}function a_(s,c){c===0&&((s.mode&1)===0?c=1:(c=Bu,Bu<<=1,(Bu&130023424)===0&&(Bu=4194304)));var m=In();s=Ri(s,c),s!==null&&(Rl(s,c,m),Wn(s,m))}function k4(s){var c=s.memoizedState,m=0;c!==null&&(m=c.retryLane),a_(s,m)}function P4(s,c){var m=0;switch(s.tag){case 13:var y=s.stateNode,b=s.memoizedState;b!==null&&(m=b.retryLane);break;case 19:y=s.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(c),a_(s,m)}var s_;s_=function(s,c,m){if(s!==null)if(s.memoizedProps!==c.pendingProps||Bn.current)$n=!0;else{if((s.lanes&m)===0&&(c.flags&128)===0)return $n=!1,p4(s,c,m);$n=(s.flags&131072)!==0}else $n=!1,qt&&(c.flags&1048576)!==0&&Fb(c,cd,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;jd(s,c),s=c.pendingProps;var b=mo(c,Nn.current);vo(c,m),b=np(null,c,y,s,b,m);var j=rp();return c.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Vn(y)?(j=!0,sd(c)):j=!1,c.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,Qh(c),b.updater=_d,c.stateNode=b,b._reactInternals=c,cp(c,y,s,m),c=mp(null,c,y,!0,j,m)):(c.tag=0,qt&&j&&Fh(c),On(null,c,b,m),c=c.child),c;case 16:y=c.elementType;e:{switch(jd(s,c),s=c.pendingProps,b=y._init,y=b(y._payload),c.type=y,b=c.tag=T4(y),s=zr(y,s),b){case 0:c=fp(null,c,y,s,m);break e;case 1:c=Mw(null,c,y,s,m);break e;case 11:c=kw(null,c,y,s,m);break e;case 14:c=Pw(null,c,y,zr(y.type,s),m);break e}throw Error(n(306,y,""))}return c;case 0:return y=c.type,b=c.pendingProps,b=c.elementType===y?b:zr(y,b),fp(s,c,y,b,m);case 1:return y=c.type,b=c.pendingProps,b=c.elementType===y?b:zr(y,b),Mw(s,c,y,b,m);case 3:e:{if(Rw(c),s===null)throw Error(n(387));y=c.pendingProps,j=c.memoizedState,b=j.element,Gb(s,c),pd(c,y,null,m);var A=c.memoizedState;if(y=A.element,j.isDehydrated)if(j={element:y,isDehydrated:!1,cache:A.cache,pendingSuspenseBoundaries:A.pendingSuspenseBoundaries,transitions:A.transitions},c.updateQueue.baseState=j,c.memoizedState=j,c.flags&256){b=wo(Error(n(423)),c),c=Ow(s,c,y,m,b);break e}else if(y!==b){b=wo(Error(n(424)),c),c=Ow(s,c,y,m,b);break e}else for(cr=oa(c.stateNode.containerInfo.firstChild),lr=c,qt=!0,Fr=null,m=Hb(c,null,y,m),c.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(go(),y===b){c=Ii(s,c,m);break e}On(s,c,y,m)}c=c.child}return c;case 5:return Xb(c),s===null&&Vh(c),y=c.type,b=c.pendingProps,j=s!==null?s.memoizedProps:null,A=b.children,Rh(y,b)?A=null:j!==null&&Rh(y,j)&&(c.flags|=32),Aw(s,c),On(s,c,A,m),c.child;case 6:return s===null&&Vh(c),null;case 13:return Iw(s,c,m);case 4:return Yh(c,c.stateNode.containerInfo),y=c.pendingProps,s===null?c.child=yo(c,null,y,m):On(s,c,y,m),c.child;case 11:return y=c.type,b=c.pendingProps,b=c.elementType===y?b:zr(y,b),kw(s,c,y,b,m);case 7:return On(s,c,c.pendingProps,m),c.child;case 8:return On(s,c,c.pendingProps.children,m),c.child;case 12:return On(s,c,c.pendingProps.children,m),c.child;case 10:e:{if(y=c.type._context,b=c.pendingProps,j=c.memoizedProps,A=b.value,Et(fd,y._currentValue),y._currentValue=A,j!==null)if(qr(j.value,A)){if(j.children===b.children&&!Bn.current){c=Ii(s,c,m);break e}}else for(j=c.child,j!==null&&(j.return=c);j!==null;){var F=j.dependencies;if(F!==null){A=j.child;for(var $=F.firstContext;$!==null;){if($.context===y){if(j.tag===1){$=Oi(-1,m&-m),$.tag=2;var ee=j.updateQueue;if(ee!==null){ee=ee.shared;var fe=ee.pending;fe===null?$.next=$:($.next=fe.next,fe.next=$),ee.pending=$}}j.lanes|=m,$=j.alternate,$!==null&&($.lanes|=m),Kh(j.return,m,c),F.lanes|=m;break}$=$.next}}else if(j.tag===10)A=j.type===c.type?null:j.child;else if(j.tag===18){if(A=j.return,A===null)throw Error(n(341));A.lanes|=m,F=A.alternate,F!==null&&(F.lanes|=m),Kh(A,m,c),A=j.sibling}else A=j.child;if(A!==null)A.return=j;else for(A=j;A!==null;){if(A===c){A=null;break}if(j=A.sibling,j!==null){j.return=A.return,A=j;break}A=A.return}j=A}On(s,c,b.children,m),c=c.child}return c;case 9:return b=c.type,y=c.pendingProps.children,vo(c,m),b=_r(b),y=y(b),c.flags|=1,On(s,c,y,m),c.child;case 14:return y=c.type,b=zr(y,c.pendingProps),b=zr(y.type,b),Pw(s,c,y,b,m);case 15:return Ew(s,c,c.type,c.pendingProps,m);case 17:return y=c.type,b=c.pendingProps,b=c.elementType===y?b:zr(y,b),jd(s,c),c.tag=1,Vn(y)?(s=!0,sd(c)):s=!1,vo(c,m),bw(c,y,b),cp(c,y,b,m),mp(null,c,y,!0,s,m);case 19:return Lw(s,c,m);case 22:return Tw(s,c,m)}throw Error(n(156,c.tag))};function o_(s,c){return zv(s,c)}function E4(s,c,m,y){this.tag=s,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nr(s,c,m,y){return new E4(s,c,m,y)}function Rp(s){return s=s.prototype,!(!s||!s.isReactComponent)}function T4(s){if(typeof s=="function")return Rp(s)?1:0;if(s!=null){if(s=s.$$typeof,s===G)return 11;if(s===J)return 14}return 2}function xa(s,c){var m=s.alternate;return m===null?(m=Nr(s.tag,c,s.key,s.mode),m.elementType=s.elementType,m.type=s.type,m.stateNode=s.stateNode,m.alternate=s,s.alternate=m):(m.pendingProps=c,m.type=s.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=s.flags&14680064,m.childLanes=s.childLanes,m.lanes=s.lanes,m.child=s.child,m.memoizedProps=s.memoizedProps,m.memoizedState=s.memoizedState,m.updateQueue=s.updateQueue,c=s.dependencies,m.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},m.sibling=s.sibling,m.index=s.index,m.ref=s.ref,m}function Id(s,c,m,y,b,j){var A=2;if(y=s,typeof s=="function")Rp(s)&&(A=1);else if(typeof s=="string")A=5;else e:switch(s){case z:return fs(m.children,b,j,c);case D:A=8,b|=8;break;case K:return s=Nr(12,m,c,b|2),s.elementType=K,s.lanes=j,s;case R:return s=Nr(13,m,c,b),s.elementType=R,s.lanes=j,s;case q:return s=Nr(19,m,c,b),s.elementType=q,s.lanes=j,s;case re:return Dd(m,b,j,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case U:A=10;break e;case W:A=9;break e;case G:A=11;break e;case J:A=14;break e;case ae:A=16,y=null;break e}throw Error(n(130,s==null?s:typeof s,""))}return c=Nr(A,m,c,b),c.elementType=s,c.type=y,c.lanes=j,c}function fs(s,c,m,y){return s=Nr(7,s,y,c),s.lanes=m,s}function Dd(s,c,m,y){return s=Nr(22,s,y,c),s.elementType=re,s.lanes=m,s.stateNode={isHidden:!1},s}function Op(s,c,m){return s=Nr(6,s,null,c),s.lanes=m,s}function Ip(s,c,m){return c=Nr(4,s.children!==null?s.children:[],s.key,c),c.lanes=m,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function A4(s,c,m,y,b){this.tag=c,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=lh(0),this.expirationTimes=lh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lh(0),this.identifierPrefix=y,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function Dp(s,c,m,y,b,j,A,F,$){return s=new A4(s,c,m,F,$),c===1?(c=1,j===!0&&(c|=8)):c=0,j=Nr(3,null,null,c),s.current=j,j.stateNode=s,j.memoizedState={element:y,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qh(j),s}function M4(s,c,m){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:E,key:y==null?null:""+y,children:s,containerInfo:c,implementation:m}}function l_(s){if(!s)return ca;s=s._reactInternals;e:{if(es(s)!==s||s.tag!==1)throw Error(n(170));var c=s;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Vn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(s.tag===1){var m=s.type;if(Vn(m))return Db(s,m,c)}return c}function c_(s,c,m,y,b,j,A,F,$){return s=Dp(m,y,!0,s,b,j,A,F,$),s.context=l_(null),m=s.current,y=In(),b=ga(m),j=Oi(y,b),j.callback=c??null,fa(m,j,b),s.current.lanes=b,Rl(s,b,y),Wn(s,y),s}function Ld(s,c,m,y){var b=c.current,j=In(),A=ga(b);return m=l_(m),c.context===null?c.context=m:c.pendingContext=m,c=Oi(j,A),c.payload={element:s},y=y===void 0?null:y,y!==null&&(c.callback=y),s=fa(b,c,A),s!==null&&($r(s,b,A,j),hd(s,b,A)),A}function qd(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function u_(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var m=s.retryLane;s.retryLane=m!==0&&m<c?m:c}}function Lp(s,c){u_(s,c),(s=s.alternate)&&u_(s,c)}function R4(){return null}var d_=typeof reportError=="function"?reportError:function(s){console.error(s)};function qp(s){this._internalRoot=s}Fd.prototype.render=qp.prototype.render=function(s){var c=this._internalRoot;if(c===null)throw Error(n(409));Ld(s,c,null,null)},Fd.prototype.unmount=qp.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var c=s.containerInfo;cs(function(){Ld(null,s,null,null)}),c[Ei]=null}};function Fd(s){this._internalRoot=s}Fd.prototype.unstable_scheduleHydration=function(s){if(s){var c=Gv();s={blockedOn:null,target:s,priority:c};for(var m=0;m<ia.length&&c!==0&&c<ia[m].priority;m++);ia.splice(m,0,s),m===0&&Xv(s)}};function Fp(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function zd(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function f_(){}function O4(s,c,m,y,b){if(b){if(typeof y=="function"){var j=y;y=function(){var ee=qd(A);j.call(ee)}}var A=c_(c,y,s,0,null,!1,!1,"",f_);return s._reactRootContainer=A,s[Ei]=A.current,Kl(s.nodeType===8?s.parentNode:s),cs(),A}for(;b=s.lastChild;)s.removeChild(b);if(typeof y=="function"){var F=y;y=function(){var ee=qd($);F.call(ee)}}var $=Dp(s,0,!1,null,null,!1,!1,"",f_);return s._reactRootContainer=$,s[Ei]=$.current,Kl(s.nodeType===8?s.parentNode:s),cs(function(){Ld(c,$,m,y)}),$}function Bd(s,c,m,y,b){var j=m._reactRootContainer;if(j){var A=j;if(typeof b=="function"){var F=b;b=function(){var $=qd(A);F.call($)}}Ld(c,A,s,b)}else A=O4(m,c,s,b,y);return qd(A)}Hv=function(s){switch(s.tag){case 3:var c=s.stateNode;if(c.current.memoizedState.isDehydrated){var m=Ml(c.pendingLanes);m!==0&&(ch(c,m|1),Wn(c,Yt()),(pt&6)===0&&(jo=Yt()+500,ua()))}break;case 13:cs(function(){var y=Ri(s,1);if(y!==null){var b=In();$r(y,s,1,b)}}),Lp(s,1)}},uh=function(s){if(s.tag===13){var c=Ri(s,134217728);if(c!==null){var m=In();$r(c,s,134217728,m)}Lp(s,134217728)}},Kv=function(s){if(s.tag===13){var c=ga(s),m=Ri(s,c);if(m!==null){var y=In();$r(m,s,c,y)}Lp(s,c)}},Gv=function(){return St},Qv=function(s,c){var m=St;try{return St=s,c()}finally{St=m}},nh=function(s,c,m){switch(c){case"input":if(pe(s,m),c=m.name,m.type==="radio"&&c!=null){for(m=s;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<m.length;c++){var y=m[c];if(y!==s&&y.form===s.form){var b=id(y);if(!b)throw Error(n(90));be(y),pe(y,b)}}}break;case"textarea":Ct(s,m);break;case"select":c=m.value,c!=null&&xe(s,!!m.multiple,c,!1)}},Rv=Tp,Ov=cs;var I4={usingClientEntryPoint:!1,Events:[Yl,uo,id,Av,Mv,Tp]},uc={findFiberByHostInstance:ts,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},D4={bundleType:uc.bundleType,version:uc.version,rendererPackageName:uc.rendererPackageName,rendererConfig:uc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=qv(s),s===null?null:s.stateNode},findFiberByHostInstance:uc.findFiberByHostInstance||R4,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vd.isDisabled&&Vd.supportsFiber)try{Fu=Vd.inject(D4),ni=Vd}catch{}}return Hn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I4,Hn.createPortal=function(s,c){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Fp(c))throw Error(n(200));return M4(s,c,null,m)},Hn.createRoot=function(s,c){if(!Fp(s))throw Error(n(299));var m=!1,y="",b=d_;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(b=c.onRecoverableError)),c=Dp(s,1,!1,null,null,m,!1,y,b),s[Ei]=c.current,Kl(s.nodeType===8?s.parentNode:s),new qp(c)},Hn.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(n(188)):(s=Object.keys(s).join(","),Error(n(268,s)));return s=qv(c),s=s===null?null:s.stateNode,s},Hn.flushSync=function(s){return cs(s)},Hn.hydrate=function(s,c,m){if(!zd(c))throw Error(n(200));return Bd(null,s,c,!0,m)},Hn.hydrateRoot=function(s,c,m){if(!Fp(s))throw Error(n(405));var y=m!=null&&m.hydratedSources||null,b=!1,j="",A=d_;if(m!=null&&(m.unstable_strictMode===!0&&(b=!0),m.identifierPrefix!==void 0&&(j=m.identifierPrefix),m.onRecoverableError!==void 0&&(A=m.onRecoverableError)),c=c_(c,null,s,1,m??null,b,!1,j,A),s[Ei]=c.current,Kl(s),y)for(s=0;s<y.length;s++)m=y[s],b=m._getVersion,b=b(m._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[m,b]:c.mutableSourceEagerHydrationData.push(m,b);return new Fd(c)},Hn.render=function(s,c,m){if(!zd(c))throw Error(n(200));return Bd(null,s,c,!1,m)},Hn.unmountComponentAtNode=function(s){if(!zd(s))throw Error(n(40));return s._reactRootContainer?(cs(function(){Bd(null,null,s,!1,function(){s._reactRootContainer=null,s[Ei]=null})}),!0):!1},Hn.unstable_batchedUpdates=Tp,Hn.unstable_renderSubtreeIntoContainer=function(s,c,m,y){if(!zd(m))throw Error(n(200));if(s==null||s._reactInternals===void 0)throw Error(n(38));return Bd(s,c,m,!1,y)},Hn.version="18.3.1-next-f1338f8080-20240426",Hn}var w_;function PN(){if(w_)return $p.exports;w_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$p.exports=U4(),$p.exports}var __;function W4(){if(__)return Ud;__=1;var e=PN();return Ud.createRoot=e.createRoot,Ud.hydrateRoot=e.hydrateRoot,Ud}var H4=W4();const K4=cu(H4),G4=20,Q4=1e6,Ui={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let Hp=0;function Y4(){return Hp=(Hp+1)%Number.MAX_VALUE,Hp.toString()}const Kp=new Map,S_=e=>{if(Kp.has(e))return;const t=setTimeout(()=>{Kp.delete(e),Rc({type:Ui.REMOVE_TOAST,toastId:e})},Q4);Kp.set(e,t)},X4=(e,t)=>{switch(t.type){case Ui.ADD_TOAST:return{...e,toasts:[t.toast,...e.toasts].slice(0,G4)};case Ui.UPDATE_TOAST:return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case Ui.DISMISS_TOAST:{const{toastId:n}=t;return n?S_(n):e.toasts.forEach(r=>{S_(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case Ui.REMOVE_TOAST:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},ff=[];let mf={toasts:[]};function Rc(e){mf=X4(mf,e),ff.forEach(t=>{t(mf)})}function J4({...e}){const t=Y4(),n=i=>Rc({type:Ui.UPDATE_TOAST,toast:{...i,id:t}}),r=()=>Rc({type:Ui.DISMISS_TOAST,toastId:t});return Rc({type:Ui.ADD_TOAST,toast:{...e,id:t,open:!0,onOpenChange:i=>{i||r()}}}),{id:t,dismiss:r,update:n}}function g0(){const[e,t]=v.useState(mf);return v.useEffect(()=>(ff.push(t),()=>{const n=ff.indexOf(t);n>-1&&ff.splice(n,1)}),[e]),{...e,toast:J4,dismiss:n=>Rc({type:Ui.DISMISS_TOAST,toastId:n})}}function EN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=EN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function TN(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=EN(e))&&(r&&(r+=" "),r+=t);return r}const j_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,N_=TN,uu=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return N_(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(f=>{const h=n==null?void 0:n[f],p=o==null?void 0:o[f];if(h===null)return null;const g=j_(h)||j_(p);return i[f][g]}),u=n&&Object.entries(n).reduce((f,h)=>{let[p,g]=h;return g===void 0||(f[p]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:g,...x}=h;return Object.entries(x).every(w=>{let[_,N]=w;return Array.isArray(N)?N.includes({...o,...u}[_]):{...o,...u}[_]===N})?[...f,p,g]:f},[]);return N_(e,l,d,n==null?void 0:n.class,n==null?void 0:n.className)};/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Z4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),AN=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/var eO={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.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const tO=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...u},d)=>v.createElement("svg",{ref:d,...eO,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:AN("lucide",i),...u},[...l.map(([f,h])=>v.createElement(f,h)),...Array.isArray(o)?o:[o]]));/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ue=(e,t)=>{const n=v.forwardRef(({className:r,...i},o)=>v.createElement(tO,{ref:o,iconNode:t,className:AN(`lucide-${Z4(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const nO=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Fo=Ue("Activity",nO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const rO=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],um=Ue("ArrowLeft",rO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const iO=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Tf=Ue("ArrowRight",iO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const aO=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],sO=Ue("Award",aO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const oO=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],il=Ue("Bell",oO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const lO=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],MN=Ue("CheckCheck",lO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const cO=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],dm=Ue("Check",cO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const uO=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],RN=Ue("ChevronDown",uO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const dO=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],fO=Ue("ChevronRight",dO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const mO=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],hO=Ue("ChevronUp",mO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const pO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Yr=Ue("CircleAlert",pO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const gO=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Or=Ue("CircleCheckBig",gO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const yO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ON=Ue("CircleX",yO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const xO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],vO=Ue("Circle",xO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const bO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],wO=Ue("Clock",bO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const _O=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],IN=Ue("Crosshair",_O);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const SO=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],C_=Ue("Crown",SO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const jO=[["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"}]],NO=Ue("DollarSign",jO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const CO=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],y0=Ue("ExternalLink",CO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const kO=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],PO=Ue("Eye",kO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const EO=[["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"}]],du=Ue("Globe",EO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const TO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],x0=Ue("Info",TO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const AO=[["line",{x1:"3",x2:"21",y1:"22",y2:"22",key:"j8o0r"}],["line",{x1:"6",x2:"6",y1:"18",y2:"11",key:"10tf0k"}],["line",{x1:"10",x2:"10",y1:"18",y2:"11",key:"54lgf6"}],["line",{x1:"14",x2:"14",y1:"18",y2:"11",key:"380y"}],["line",{x1:"18",x2:"18",y1:"18",y2:"11",key:"1kevvc"}],["polygon",{points:"12 2 20 7 4 7",key:"jkujk7"}]],Ug=Ue("Landmark",AO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const MO=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],RO=Ue("Languages",MO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const OO=[["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"}]],v0=Ue("Link",OO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const IO=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],tt=Ue("LoaderCircle",IO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const DO=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],fu=Ue("Lock",DO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const LO=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],DN=Ue("LogOut",LO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const qO=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]],LN=Ue("Mail",qO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const FO=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],Gi=Ue("MessageCircle",FO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const zO=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],Af=Ue("MessageSquare",zO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const BO=[["path",{d:"M5 12h14",key:"1ays0h"}]],VO=Ue("Minus",BO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $O=[["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"}]],Nt=Ue("Package",$O);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const UO=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],WO=Ue("Pause",UO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const HO=[["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"}]],b0=Ue("Pen",HO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const KO=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],er=Ue("Plus",KO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const GO=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Mf=Ue("RefreshCw",GO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const QO=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],Ba=Ue("Rocket",QO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const YO=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],qN=Ue("Save",YO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const XO=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Ks=Ue("Search",XO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const JO=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],fm=Ue("Send",JO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ZO=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Sn=Ue("Shield",ZO);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const eI=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],FN=Ue("ShoppingCart",eI);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const tI=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],nI=Ue("SquarePen",tI);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const rI=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],w0=Ue("Star",rI);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const iI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],k_=Ue("Target",iI);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const aI=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],wi=Ue("Trash2",aI);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const sI=[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]],oI=Ue("TrendingDown",sI);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const lI=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],Sc=Ue("TrendingUp",lI);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const cI=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],_0=Ue("Upload",cI);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const uI=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],dI=Ue("UserPlus",uI);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const fI=[["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"}]],Rf=Ue("User",fI);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const mI=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],gr=Ue("Users",mI);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const hI=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],mm=Ue("X",hI),S0="-",pI=e=>{const t=yI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const u=l.split(S0);return u[0]===""&&u.length!==1&&u.shift(),zN(u,t)||gI(l)},getConflictingClassGroupIds:(l,u)=>{const d=n[l]||[];return u&&r[l]?[...d,...r[l]]:d}}},zN=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?zN(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(S0);return(l=t.validators.find(({validator:u})=>u(o)))==null?void 0:l.classGroupId},P_=/^\[(.+)\]$/,gI=e=>{if(P_.test(e)){const t=P_.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},yI=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)Wg(n[i],r,i,t);return r},Wg=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:E_(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(xI(i)){Wg(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,l])=>{Wg(l,E_(t,o),n,r)})})},E_=(e,t)=>{let n=e;return t.split(S0).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},xI=e=>e.isThemeGetter,vI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,l)=>{n.set(o,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let l=n.get(o);if(l!==void 0)return l;if((l=r.get(o))!==void 0)return i(o,l),l},set(o,l){n.has(o)?n.set(o,l):i(o,l)}}},Hg="!",Kg=":",bI=Kg.length,wI=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let l=0,u=0,d=0,f;for(let w=0;w<i.length;w++){let _=i[w];if(l===0&&u===0){if(_===Kg){o.push(i.slice(d,w)),d=w+bI;continue}if(_==="/"){f=w;continue}}_==="["?l++:_==="]"?l--:_==="("?u++:_===")"&&u--}const h=o.length===0?i:i.substring(d),p=_I(h),g=p!==h,x=f&&f>d?f-d:void 0;return{modifiers:o,hasImportantModifier:g,baseClassName:p,maybePostfixModifierPosition:x}};if(t){const i=t+Kg,o=r;r=l=>l.startsWith(i)?o(l.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},_I=e=>e.endsWith(Hg)?e.substring(0,e.length-1):e.startsWith(Hg)?e.substring(1):e,SI=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let o=[];return r.forEach(l=>{l[0]==="["||t[l]?(i.push(...o.sort(),l),o=[]):o.push(l)}),i.push(...o.sort()),i}},jI=e=>({cache:vI(e.cacheSize),parseClassName:wI(e),sortModifiers:SI(e),...pI(e)}),NI=/\s+/,CI=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,l=[],u=e.trim().split(NI);let d="";for(let f=u.length-1;f>=0;f-=1){const h=u[f],{isExternal:p,modifiers:g,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:_}=n(h);if(p){d=h+(d.length>0?" "+d:d);continue}let N=!!_,C=r(N?w.substring(0,_):w);if(!C){if(!N){d=h+(d.length>0?" "+d:d);continue}if(C=r(w),!C){d=h+(d.length>0?" "+d:d);continue}N=!1}const k=o(g).join(":"),P=x?k+Hg:k,T=P+C;if(l.includes(T))continue;l.push(T);const S=i(C,N);for(let E=0;E<S.length;++E){const z=S[E];l.push(P+z)}d=h+(d.length>0?" "+d:d)}return d};function kI(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=BN(t))&&(r&&(r+=" "),r+=n);return r}const BN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=BN(e[r]))&&(n&&(n+=" "),n+=t);return n};function PI(e,...t){let n,r,i,o=l;function l(d){const f=t.reduce((h,p)=>p(h),e());return n=jI(f),r=n.cache.get,i=n.cache.set,o=u,u(d)}function u(d){const f=r(d);if(f)return f;const h=CI(d,n);return i(d,h),h}return function(){return o(kI.apply(null,arguments))}}const un=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},VN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$N=/^\((?:(\w[\w-]*):)?(.+)\)$/i,EI=/^\d+\/\d+$/,TI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,AI=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,MI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,RI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Co=e=>EI.test(e),lt=e=>!!e&&!Number.isNaN(Number(e)),ba=e=>!!e&&Number.isInteger(Number(e)),Gp=e=>e.endsWith("%")&<(e.slice(0,-1)),Li=e=>TI.test(e),II=()=>!0,DI=e=>AI.test(e)&&!MI.test(e),UN=()=>!1,LI=e=>RI.test(e),qI=e=>OI.test(e),FI=e=>!Re(e)&&!Oe(e),zI=e=>ml(e,KN,UN),Re=e=>VN.test(e),ms=e=>ml(e,GN,DI),Qp=e=>ml(e,WI,lt),T_=e=>ml(e,WN,UN),BI=e=>ml(e,HN,qI),Wd=e=>ml(e,QN,LI),Oe=e=>$N.test(e),fc=e=>hl(e,GN),VI=e=>hl(e,HI),A_=e=>hl(e,WN),$I=e=>hl(e,KN),UI=e=>hl(e,HN),Hd=e=>hl(e,QN,!0),ml=(e,t,n)=>{const r=VN.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},hl=(e,t,n=!1)=>{const r=$N.exec(e);return r?r[1]?t(r[1]):n:!1},WN=e=>e==="position"||e==="percentage",HN=e=>e==="image"||e==="url",KN=e=>e==="length"||e==="size"||e==="bg-size",GN=e=>e==="length",WI=e=>e==="number",HI=e=>e==="family-name",QN=e=>e==="shadow",KI=()=>{const e=un("color"),t=un("font"),n=un("text"),r=un("font-weight"),i=un("tracking"),o=un("leading"),l=un("breakpoint"),u=un("container"),d=un("spacing"),f=un("radius"),h=un("shadow"),p=un("inset-shadow"),g=un("text-shadow"),x=un("drop-shadow"),w=un("blur"),_=un("perspective"),N=un("aspect"),C=un("ease"),k=un("animate"),P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...T(),Oe,Re],E=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],D=()=>[Oe,Re,d],K=()=>[Co,"full","auto",...D()],U=()=>[ba,"none","subgrid",Oe,Re],W=()=>["auto",{span:["full",ba,Oe,Re]},ba,Oe,Re],G=()=>[ba,"auto",Oe,Re],R=()=>["auto","min","max","fr",Oe,Re],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],ae=()=>["auto",...D()],re=()=>[Co,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],L=()=>[e,Oe,Re],Y=()=>[...T(),A_,T_,{position:[Oe,Re]}],M=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",$I,zI,{size:[Oe,Re]}],Z=()=>[Gp,fc,ms],I=()=>["","none","full",f,Oe,Re],de=()=>["",lt,fc,ms],Ne=()=>["solid","dashed","dotted","double"],_e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[lt,Gp,A_,T_],we=()=>["","none",w,Oe,Re],je=()=>["none",lt,Oe,Re],Se=()=>["none",lt,Oe,Re],se=()=>[lt,Oe,Re],be=()=>[Co,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Li],breakpoint:[Li],color:[II],container:[Li],"drop-shadow":[Li],ease:["in","out","in-out"],font:[FI],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Li],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Li],shadow:[Li],spacing:["px",lt],text:[Li],"text-shadow":[Li],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Co,Re,Oe,N]}],container:["container"],columns:[{columns:[lt,Re,Oe,u]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{start:K()}],end:[{end:K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[ba,"auto",Oe,Re]}],basis:[{basis:[Co,"full","auto",u,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[lt,Co,"auto","initial","none",Re]}],grow:[{grow:["",lt,Oe,Re]}],shrink:[{shrink:["",lt,Oe,Re]}],order:[{order:[ba,"first","last","none",Oe,Re]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":R()}],"auto-rows":[{"auto-rows":R()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:ae()}],mx:[{mx:ae()}],my:[{my:ae()}],ms:[{ms:ae()}],me:[{me:ae()}],mt:[{mt:ae()}],mr:[{mr:ae()}],mb:[{mb:ae()}],ml:[{ml:ae()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],w:[{w:[u,"screen",...re()]}],"min-w":[{"min-w":[u,"screen","none",...re()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...re()]}],h:[{h:["screen","lh",...re()]}],"min-h":[{"min-h":["screen","lh","none",...re()]}],"max-h":[{"max-h":["screen","lh",...re()]}],"font-size":[{text:["base",n,fc,ms]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Oe,Qp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Gp,Re]}],"font-family":[{font:[VI,Re,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Oe,Re]}],"line-clamp":[{"line-clamp":[lt,"none",Oe,Qp]}],leading:[{leading:[o,...D()]}],"list-image":[{"list-image":["none",Oe,Re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Oe,Re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[lt,"from-font","auto",Oe,ms]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[lt,"auto",Oe,Re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Oe,Re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Oe,Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:M()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ba,Oe,Re],radial:["",Oe,Re],conic:[ba,Oe,Re]},UI,BI]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ne(),"hidden","none"]}],"divide-style":[{divide:[...Ne(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...Ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[lt,Oe,Re]}],"outline-w":[{outline:["",lt,fc,ms]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",h,Hd,Wd]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",p,Hd,Wd]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[lt,ms]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",g,Hd,Wd]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[lt,Oe,Re]}],"mix-blend":[{"mix-blend":[..._e(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":_e()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[lt]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[Oe,Re]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[lt]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:M()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Oe,Re]}],filter:[{filter:["","none",Oe,Re]}],blur:[{blur:we()}],brightness:[{brightness:[lt,Oe,Re]}],contrast:[{contrast:[lt,Oe,Re]}],"drop-shadow":[{"drop-shadow":["","none",x,Hd,Wd]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",lt,Oe,Re]}],"hue-rotate":[{"hue-rotate":[lt,Oe,Re]}],invert:[{invert:["",lt,Oe,Re]}],saturate:[{saturate:[lt,Oe,Re]}],sepia:[{sepia:["",lt,Oe,Re]}],"backdrop-filter":[{"backdrop-filter":["","none",Oe,Re]}],"backdrop-blur":[{"backdrop-blur":we()}],"backdrop-brightness":[{"backdrop-brightness":[lt,Oe,Re]}],"backdrop-contrast":[{"backdrop-contrast":[lt,Oe,Re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",lt,Oe,Re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lt,Oe,Re]}],"backdrop-invert":[{"backdrop-invert":["",lt,Oe,Re]}],"backdrop-opacity":[{"backdrop-opacity":[lt,Oe,Re]}],"backdrop-saturate":[{"backdrop-saturate":[lt,Oe,Re]}],"backdrop-sepia":[{"backdrop-sepia":["",lt,Oe,Re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Oe,Re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[lt,"initial",Oe,Re]}],ease:[{ease:["linear","initial",C,Oe,Re]}],delay:[{delay:[lt,Oe,Re]}],animate:[{animate:["none",k,Oe,Re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Oe,Re]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[Oe,Re,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:be()}],"translate-x":[{"translate-x":be()}],"translate-y":[{"translate-y":be()}],"translate-z":[{"translate-z":be()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Oe,Re]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Oe,Re]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[lt,fc,ms,Qp]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},GI=PI(KI);function Fe(...e){return GI(TN(e))}const YN=v.forwardRef(({...e},t)=>a.jsx("div",{ref:t,className:"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",...e}));YN.displayName="ToastProvider";const XN=v.forwardRef(({...e},t)=>a.jsx("div",{ref:t,className:"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",...e}));XN.displayName="ToastViewport";const QI=uu("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),JN=v.forwardRef(({className:e,variant:t,...n},r)=>a.jsx("div",{ref:r,className:Fe(QI({variant:t}),e),...n}));JN.displayName="Toast";const YI=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Fe("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));YI.displayName="ToastAction";const ZN=v.forwardRef(({className:e,...t},n)=>a.jsx("button",{ref:n,className:Fe("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:a.jsx(mm,{className:"h-4 w-4"})}));ZN.displayName="ToastClose";const eC=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Fe("text-sm font-semibold",e),...t}));eC.displayName="ToastTitle";const tC=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Fe("text-sm opacity-90",e),...t}));tC.displayName="ToastDescription";function XI(){const{toasts:e}=g0();return a.jsxs(YN,{children:[e.map(function({id:t,title:n,description:r,action:i,...o}){return a.jsxs(JN,{...o,children:[a.jsxs("div",{className:"grid gap-1",children:[n&&a.jsx(eC,{children:n}),r&&a.jsx(tC,{children:r})]}),i,a.jsx(ZN,{})]},t)}),a.jsx(XN,{})]})}var pl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},JI={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Pa,m0,yN,ZI=(yN=class{constructor(){ze(this,Pa,JI);ze(this,m0,!1)}setTimeoutProvider(e){ke(this,Pa,e)}setTimeout(e,t){return V(this,Pa).setTimeout(e,t)}clearTimeout(e){V(this,Pa).clearTimeout(e)}setInterval(e,t){return V(this,Pa).setInterval(e,t)}clearInterval(e){V(this,Pa).clearInterval(e)}},Pa=new WeakMap,m0=new WeakMap,yN),xs=new ZI;function eD(e){setTimeout(e,0)}var Fs=typeof window>"u"||"Deno"in globalThis;function qn(){}function tD(e,t){return typeof e=="function"?e(t):e}function Gg(e){return typeof e=="number"&&e>=0&&e!==1/0}function nC(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qa(e,t){return typeof e=="function"?e(t):e}function Tr(e,t){return typeof e=="function"?e(t):e}function M_(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:l,stale:u}=e;if(l){if(r){if(t.queryHash!==j0(l,t.options))return!1}else if(!Vc(t.queryKey,l))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||i&&i!==t.state.fetchStatus||o&&!o(t))}function R_(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(zs(t.options.mutationKey)!==zs(o))return!1}else if(!Vc(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function j0(e,t){return((t==null?void 0:t.queryKeyHashFn)||zs)(e)}function zs(e){return JSON.stringify(e,(t,n)=>Qg(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Vc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Vc(e[n],t[n])):!1}var nD=Object.prototype.hasOwnProperty;function rC(e,t){if(e===t)return e;const n=O_(e)&&O_(t);if(!n&&!(Qg(e)&&Qg(t)))return t;const i=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),l=o.length,u=n?new Array(l):{};let d=0;for(let f=0;f<l;f++){const h=n?f:o[f],p=e[h],g=t[h];if(p===g){u[h]=p,(n?f<i:nD.call(e,h))&&d++;continue}if(p===null||g===null||typeof p!="object"||typeof g!="object"){u[h]=g;continue}const x=rC(p,g);u[h]=x,x===p&&d++}return i===l&&d===i?e:u}function Of(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function O_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qg(e){if(!I_(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!I_(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function I_(e){return Object.prototype.toString.call(e)==="[object Object]"}function rD(e){return new Promise(t=>{xs.setTimeout(t,e)})}function Yg(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?rC(e,t):t}function iD(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function aD(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var N0=Symbol();function iC(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===N0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function aC(e,t){return typeof e=="function"?e(...t):!!e}var ws,Ea,Ho,xN,sD=(xN=class extends pl{constructor(){super();ze(this,ws);ze(this,Ea);ze(this,Ho);ke(this,Ho,t=>{if(!Fs&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){V(this,Ea)||this.setEventListener(V(this,Ho))}onUnsubscribe(){var t;this.hasListeners()||((t=V(this,Ea))==null||t.call(this),ke(this,Ea,void 0))}setEventListener(t){var n;ke(this,Ho,t),(n=V(this,Ea))==null||n.call(this),ke(this,Ea,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){V(this,ws)!==t&&(ke(this,ws,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof V(this,ws)=="boolean"?V(this,ws):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ws=new WeakMap,Ea=new WeakMap,Ho=new WeakMap,xN),C0=new sD;function Xg(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var oD=eD;function lD(){let e=[],t=0,n=u=>{u()},r=u=>{u()},i=oD;const o=u=>{t?e.push(u):i(()=>{n(u)})},l=()=>{const u=e;e=[],u.length&&i(()=>{r(()=>{u.forEach(d=>{n(d)})})})};return{batch:u=>{let d;t++;try{d=u()}finally{t--,t||l()}return d},batchCalls:u=>(...d)=>{o(()=>{u(...d)})},schedule:o,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var dn=lD(),Ko,Ta,Go,vN,cD=(vN=class extends pl{constructor(){super();ze(this,Ko,!0);ze(this,Ta);ze(this,Go);ke(this,Go,t=>{if(!Fs&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){V(this,Ta)||this.setEventListener(V(this,Go))}onUnsubscribe(){var t;this.hasListeners()||((t=V(this,Ta))==null||t.call(this),ke(this,Ta,void 0))}setEventListener(t){var n;ke(this,Go,t),(n=V(this,Ta))==null||n.call(this),ke(this,Ta,t(this.setOnline.bind(this)))}setOnline(t){V(this,Ko)!==t&&(ke(this,Ko,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return V(this,Ko)}},Ko=new WeakMap,Ta=new WeakMap,Go=new WeakMap,vN),If=new cD;function uD(e){return Math.min(1e3*2**e,3e4)}function sC(e){return(e??"online")==="online"?If.isOnline():!0}var Jg=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function oC(e){let t=!1,n=0,r;const i=Xg(),o=()=>i.status!=="pending",l=_=>{var N;if(!o()){const C=new Jg(_);g(C),(N=e.onCancel)==null||N.call(e,C)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>C0.isFocused()&&(e.networkMode==="always"||If.isOnline())&&e.canRun(),h=()=>sC(e.networkMode)&&e.canRun(),p=_=>{o()||(r==null||r(),i.resolve(_))},g=_=>{o()||(r==null||r(),i.reject(_))},x=()=>new Promise(_=>{var N;r=C=>{(o()||f())&&_(C)},(N=e.onPause)==null||N.call(e)}).then(()=>{var _;r=void 0,o()||(_=e.onContinue)==null||_.call(e)}),w=()=>{if(o())return;let _;const N=n===0?e.initialPromise:void 0;try{_=N??e.fn()}catch(C){_=Promise.reject(C)}Promise.resolve(_).then(p).catch(C=>{var E;if(o())return;const k=e.retry??(Fs?0:3),P=e.retryDelay??uD,T=typeof P=="function"?P(n,C):P,S=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,C);if(t||!S){g(C);return}n++,(E=e.onFail)==null||E.call(e,n,C),rD(T).then(()=>f()?void 0:x()).then(()=>{t?g(C):w()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r==null||r(),i),cancelRetry:u,continueRetry:d,canStart:h,start:()=>(h()?w():x().then(w),i)}}var _s,bN,lC=(bN=class{constructor(){ze(this,_s)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Gg(this.gcTime)&&ke(this,_s,xs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fs?1/0:300*1e3))}clearGcTimeout(){V(this,_s)&&(xs.clearTimeout(V(this,_s)),ke(this,_s,void 0))}},_s=new WeakMap,bN),Ss,Qo,Er,js,pn,iu,Ns,Hr,qi,wN,dD=(wN=class extends lC{constructor(t){super();ze(this,Hr);ze(this,Ss);ze(this,Qo);ze(this,Er);ze(this,js);ze(this,pn);ze(this,iu);ze(this,Ns);ke(this,Ns,!1),ke(this,iu,t.defaultOptions),this.setOptions(t.options),this.observers=[],ke(this,js,t.client),ke(this,Er,V(this,js).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ke(this,Ss,D_(this.options)),this.state=t.state??V(this,Ss),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=V(this,pn))==null?void 0:t.promise}setOptions(t){if(this.options={...V(this,iu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=D_(this.options);n.data!==void 0&&(this.setData(n.data,{updatedAt:n.dataUpdatedAt,manual:!0}),ke(this,Ss,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&V(this,Er).remove(this)}setData(t,n){const r=Yg(this.state.data,t,this.options);return ot(this,Hr,qi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ot(this,Hr,qi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=V(this,pn))==null?void 0:r.promise;return(i=V(this,pn))==null||i.cancel(t),n?n.then(qn).catch(qn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(V(this,Ss))}isActive(){return this.observers.some(t=>Tr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===N0||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>qa(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!nC(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=V(this,pn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=V(this,pn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),V(this,Er).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(V(this,pn)&&(V(this,Ns)?V(this,pn).cancel({revert:!0}):V(this,pn).cancelRetry()),this.scheduleGc()),V(this,Er).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ot(this,Hr,qi).call(this,{type:"invalidate"})}async fetch(t,n){var d,f,h,p,g,x,w,_,N,C,k,P;if(this.state.fetchStatus!=="idle"&&((d=V(this,pn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(V(this,pn))return V(this,pn).continueRetry(),V(this,pn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const T=this.observers.find(S=>S.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,i=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(ke(this,Ns,!0),r.signal)})},o=()=>{const T=iC(this.options,n),E=(()=>{const z={client:V(this,js),queryKey:this.queryKey,meta:this.meta};return i(z),z})();return ke(this,Ns,!1),this.options.persister?this.options.persister(T,E,this):T(E)},u=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:V(this,js),state:this.state,fetchFn:o};return i(T),T})();(f=this.options.behavior)==null||f.onFetch(u,this),ke(this,Qo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=u.fetchOptions)==null?void 0:h.meta))&&ot(this,Hr,qi).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),ke(this,pn,oC({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:T=>{T instanceof Jg&&T.revert&&this.setState({...V(this,Qo),fetchStatus:"idle"}),r.abort()},onFail:(T,S)=>{ot(this,Hr,qi).call(this,{type:"failed",failureCount:T,error:S})},onPause:()=>{ot(this,Hr,qi).call(this,{type:"pause"})},onContinue:()=>{ot(this,Hr,qi).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const T=await V(this,pn).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(x=(g=V(this,Er).config).onSuccess)==null||x.call(g,T,this),(_=(w=V(this,Er).config).onSettled)==null||_.call(w,T,this.state.error,this),T}catch(T){if(T instanceof Jg){if(T.silent)return V(this,pn).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw ot(this,Hr,qi).call(this,{type:"error",error:T}),(C=(N=V(this,Er).config).onError)==null||C.call(N,T,this),(P=(k=V(this,Er).config).onSettled)==null||P.call(k,this.state.data,T,this),T}finally{this.scheduleGc()}}},Ss=new WeakMap,Qo=new WeakMap,Er=new WeakMap,js=new WeakMap,pn=new WeakMap,iu=new WeakMap,Ns=new WeakMap,Hr=new WeakSet,qi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...cC(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ke(this,Qo,t.manual?i:void 0),i;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),dn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),V(this,Er).notify({query:this,type:"updated",action:t})})},wN);function cC(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:sC(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function D_(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Gn,ft,au,Dn,Cs,Yo,zi,Aa,su,Xo,Jo,ks,Ps,Ma,Zo,_t,jc,Zg,ey,ty,ny,ry,iy,ay,uC,_N,fD=(_N=class extends pl{constructor(t,n){super();ze(this,_t);ze(this,Gn);ze(this,ft);ze(this,au);ze(this,Dn);ze(this,Cs);ze(this,Yo);ze(this,zi);ze(this,Aa);ze(this,su);ze(this,Xo);ze(this,Jo);ze(this,ks);ze(this,Ps);ze(this,Ma);ze(this,Zo,new Set);this.options=n,ke(this,Gn,t),ke(this,Aa,null),ke(this,zi,Xg()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(V(this,ft).addObserver(this),L_(V(this,ft),this.options)?ot(this,_t,jc).call(this):this.updateResult(),ot(this,_t,ny).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return sy(V(this,ft),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return sy(V(this,ft),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ot(this,_t,ry).call(this),ot(this,_t,iy).call(this),V(this,ft).removeObserver(this)}setOptions(t){const n=this.options,r=V(this,ft);if(this.options=V(this,Gn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Tr(this.options.enabled,V(this,ft))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ot(this,_t,ay).call(this),V(this,ft).setOptions(this.options),n._defaulted&&!Of(this.options,n)&&V(this,Gn).getQueryCache().notify({type:"observerOptionsUpdated",query:V(this,ft),observer:this});const i=this.hasListeners();i&&q_(V(this,ft),r,this.options,n)&&ot(this,_t,jc).call(this),this.updateResult(),i&&(V(this,ft)!==r||Tr(this.options.enabled,V(this,ft))!==Tr(n.enabled,V(this,ft))||qa(this.options.staleTime,V(this,ft))!==qa(n.staleTime,V(this,ft)))&&ot(this,_t,Zg).call(this);const o=ot(this,_t,ey).call(this);i&&(V(this,ft)!==r||Tr(this.options.enabled,V(this,ft))!==Tr(n.enabled,V(this,ft))||o!==V(this,Ma))&&ot(this,_t,ty).call(this,o)}getOptimisticResult(t){const n=V(this,Gn).getQueryCache().build(V(this,Gn),t),r=this.createResult(n,t);return hD(this,r)&&(ke(this,Dn,r),ke(this,Yo,this.options),ke(this,Cs,V(this,ft).state)),r}getCurrentResult(){return V(this,Dn)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&!this.options.experimental_prefetchInRender&&V(this,zi).status==="pending"&&V(this,zi).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(r,i))})}trackProp(t){V(this,Zo).add(t)}getCurrentQuery(){return V(this,ft)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=V(this,Gn).defaultQueryOptions(t),r=V(this,Gn).getQueryCache().build(V(this,Gn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ot(this,_t,jc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),V(this,Dn)))}createResult(t,n){var K;const r=V(this,ft),i=this.options,o=V(this,Dn),l=V(this,Cs),u=V(this,Yo),f=t!==r?t.state:V(this,au),{state:h}=t;let p={...h},g=!1,x;if(n._optimisticResults){const U=this.hasListeners(),W=!U&&L_(t,n),G=U&&q_(t,r,n,i);(W||G)&&(p={...p,...cC(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:w,errorUpdatedAt:_,status:N}=p;x=p.data;let C=!1;if(n.placeholderData!==void 0&&x===void 0&&N==="pending"){let U;o!=null&&o.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(U=o.data,C=!0):U=typeof n.placeholderData=="function"?n.placeholderData((K=V(this,Jo))==null?void 0:K.state.data,V(this,Jo)):n.placeholderData,U!==void 0&&(N="success",x=Yg(o==null?void 0:o.data,U,n),g=!0)}if(n.select&&x!==void 0&&!C)if(o&&x===(l==null?void 0:l.data)&&n.select===V(this,su))x=V(this,Xo);else try{ke(this,su,n.select),x=n.select(x),x=Yg(o==null?void 0:o.data,x,n),ke(this,Xo,x),ke(this,Aa,null)}catch(U){ke(this,Aa,U)}V(this,Aa)&&(w=V(this,Aa),x=V(this,Xo),_=Date.now(),N="error");const k=p.fetchStatus==="fetching",P=N==="pending",T=N==="error",S=P&&k,E=x!==void 0,D={status:N,fetchStatus:p.fetchStatus,isPending:P,isSuccess:N==="success",isError:T,isInitialLoading:S,isLoading:S,data:x,dataUpdatedAt:p.dataUpdatedAt,error:w,errorUpdatedAt:_,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:k,isRefetching:k&&!P,isLoadingError:T&&!E,isPaused:p.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:T&&E,isStale:k0(t,n),refetch:this.refetch,promise:V(this,zi),isEnabled:Tr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const U=R=>{D.status==="error"?R.reject(D.error):D.data!==void 0&&R.resolve(D.data)},W=()=>{const R=ke(this,zi,D.promise=Xg());U(R)},G=V(this,zi);switch(G.status){case"pending":t.queryHash===r.queryHash&&U(G);break;case"fulfilled":(D.status==="error"||D.data!==G.value)&&W();break;case"rejected":(D.status!=="error"||D.error!==G.reason)&&W();break}}return D}updateResult(){const t=V(this,Dn),n=this.createResult(V(this,ft),this.options);if(ke(this,Cs,V(this,ft).state),ke(this,Yo,this.options),V(this,Cs).data!==void 0&&ke(this,Jo,V(this,ft)),Of(n,t))return;ke(this,Dn,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!V(this,Zo).size)return!0;const l=new Set(o??V(this,Zo));return this.options.throwOnError&&l.add("error"),Object.keys(V(this,Dn)).some(u=>{const d=u;return V(this,Dn)[d]!==t[d]&&l.has(d)})};ot(this,_t,uC).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ot(this,_t,ny).call(this)}},Gn=new WeakMap,ft=new WeakMap,au=new WeakMap,Dn=new WeakMap,Cs=new WeakMap,Yo=new WeakMap,zi=new WeakMap,Aa=new WeakMap,su=new WeakMap,Xo=new WeakMap,Jo=new WeakMap,ks=new WeakMap,Ps=new WeakMap,Ma=new WeakMap,Zo=new WeakMap,_t=new WeakSet,jc=function(t){ot(this,_t,ay).call(this);let n=V(this,ft).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(qn)),n},Zg=function(){ot(this,_t,ry).call(this);const t=qa(this.options.staleTime,V(this,ft));if(Fs||V(this,Dn).isStale||!Gg(t))return;const r=nC(V(this,Dn).dataUpdatedAt,t)+1;ke(this,ks,xs.setTimeout(()=>{V(this,Dn).isStale||this.updateResult()},r))},ey=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(V(this,ft)):this.options.refetchInterval)??!1},ty=function(t){ot(this,_t,iy).call(this),ke(this,Ma,t),!(Fs||Tr(this.options.enabled,V(this,ft))===!1||!Gg(V(this,Ma))||V(this,Ma)===0)&&ke(this,Ps,xs.setInterval(()=>{(this.options.refetchIntervalInBackground||C0.isFocused())&&ot(this,_t,jc).call(this)},V(this,Ma)))},ny=function(){ot(this,_t,Zg).call(this),ot(this,_t,ty).call(this,ot(this,_t,ey).call(this))},ry=function(){V(this,ks)&&(xs.clearTimeout(V(this,ks)),ke(this,ks,void 0))},iy=function(){V(this,Ps)&&(xs.clearInterval(V(this,Ps)),ke(this,Ps,void 0))},ay=function(){const t=V(this,Gn).getQueryCache().build(V(this,Gn),this.options);if(t===V(this,ft))return;const n=V(this,ft);ke(this,ft,t),ke(this,au,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},uC=function(t){dn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(V(this,Dn))}),V(this,Gn).getQueryCache().notify({query:V(this,ft),type:"observerResultsUpdated"})})},_N);function mD(e,t){return Tr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function L_(e,t){return mD(e,t)||e.state.data!==void 0&&sy(e,t,t.refetchOnMount)}function sy(e,t,n){if(Tr(t.enabled,e)!==!1&&qa(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&k0(e,t)}return!1}function q_(e,t,n,r){return(e!==t||Tr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&k0(e,n)}function k0(e,t){return Tr(t.enabled,e)!==!1&&e.isStaleByTime(qa(t.staleTime,e))}function hD(e,t){return!Of(e.getCurrentResult(),t)}function F_(e){return{onFetch:(t,n)=>{var h,p,g,x,w;const r=t.options,i=(g=(p=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:g.direction,o=((x=t.state.data)==null?void 0:x.pages)||[],l=((w=t.state.data)==null?void 0:w.pageParams)||[];let u={pages:[],pageParams:[]},d=0;const f=async()=>{let _=!1;const N=P=>{Object.defineProperty(P,"signal",{enumerable:!0,get:()=>(t.signal.aborted?_=!0:t.signal.addEventListener("abort",()=>{_=!0}),t.signal)})},C=iC(t.options,t.fetchOptions),k=async(P,T,S)=>{if(_)return Promise.reject();if(T==null&&P.pages.length)return Promise.resolve(P);const z=(()=>{const W={client:t.client,queryKey:t.queryKey,pageParam:T,direction:S?"backward":"forward",meta:t.options.meta};return N(W),W})(),D=await C(z),{maxPages:K}=t.options,U=S?aD:iD;return{pages:U(P.pages,D,K),pageParams:U(P.pageParams,T,K)}};if(i&&o.length){const P=i==="backward",T=P?pD:z_,S={pages:o,pageParams:l},E=T(r,S);u=await k(S,E,P)}else{const P=e??o.length;do{const T=d===0?l[0]??r.initialPageParam:z_(r,u);if(d>0&&T==null)break;u=await k(u,T),d++}while(d<P)}return u};t.options.persister?t.fetchFn=()=>{var _,N;return(N=(_=t.options).persister)==null?void 0:N.call(_,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=f}}}function z_(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function pD(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ou,ui,Ln,Es,di,ja,SN,gD=(SN=class extends lC{constructor(t){super();ze(this,di);ze(this,ou);ze(this,ui);ze(this,Ln);ze(this,Es);ke(this,ou,t.client),this.mutationId=t.mutationId,ke(this,Ln,t.mutationCache),ke(this,ui,[]),this.state=t.state||dC(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){V(this,ui).includes(t)||(V(this,ui).push(t),this.clearGcTimeout(),V(this,Ln).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ke(this,ui,V(this,ui).filter(n=>n!==t)),this.scheduleGc(),V(this,Ln).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){V(this,ui).length||(this.state.status==="pending"?this.scheduleGc():V(this,Ln).remove(this))}continue(){var t;return((t=V(this,Es))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,u,d,f,h,p,g,x,w,_,N,C,k,P,T,S,E,z,D,K;const n=()=>{ot(this,di,ja).call(this,{type:"continue"})},r={client:V(this,ou),meta:this.options.meta,mutationKey:this.options.mutationKey};ke(this,Es,oC({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(U,W)=>{ot(this,di,ja).call(this,{type:"failed",failureCount:U,error:W})},onPause:()=>{ot(this,di,ja).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>V(this,Ln).canRun(this)}));const i=this.state.status==="pending",o=!V(this,Es).canStart();try{if(i)n();else{ot(this,di,ja).call(this,{type:"pending",variables:t,isPaused:o}),await((u=(l=V(this,Ln).config).onMutate)==null?void 0:u.call(l,t,this,r));const W=await((f=(d=this.options).onMutate)==null?void 0:f.call(d,t,r));W!==this.state.context&&ot(this,di,ja).call(this,{type:"pending",context:W,variables:t,isPaused:o})}const U=await V(this,Es).start();return await((p=(h=V(this,Ln).config).onSuccess)==null?void 0:p.call(h,U,t,this.state.context,this,r)),await((x=(g=this.options).onSuccess)==null?void 0:x.call(g,U,t,this.state.context,r)),await((_=(w=V(this,Ln).config).onSettled)==null?void 0:_.call(w,U,null,this.state.variables,this.state.context,this,r)),await((C=(N=this.options).onSettled)==null?void 0:C.call(N,U,null,t,this.state.context,r)),ot(this,di,ja).call(this,{type:"success",data:U}),U}catch(U){try{throw await((P=(k=V(this,Ln).config).onError)==null?void 0:P.call(k,U,t,this.state.context,this,r)),await((S=(T=this.options).onError)==null?void 0:S.call(T,U,t,this.state.context,r)),await((z=(E=V(this,Ln).config).onSettled)==null?void 0:z.call(E,void 0,U,this.state.variables,this.state.context,this,r)),await((K=(D=this.options).onSettled)==null?void 0:K.call(D,void 0,U,t,this.state.context,r)),U}finally{ot(this,di,ja).call(this,{type:"error",error:U})}}finally{V(this,Ln).runNext(this)}}},ou=new WeakMap,ui=new WeakMap,Ln=new WeakMap,Es=new WeakMap,di=new WeakSet,ja=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),dn.batch(()=>{V(this,ui).forEach(r=>{r.onMutationUpdate(t)}),V(this,Ln).notify({mutation:this,type:"updated",action:t})})},SN);function dC(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Bi,Kr,lu,jN,yD=(jN=class extends pl{constructor(t={}){super();ze(this,Bi);ze(this,Kr);ze(this,lu);this.config=t,ke(this,Bi,new Set),ke(this,Kr,new Map),ke(this,lu,0)}build(t,n,r){const i=new gD({client:t,mutationCache:this,mutationId:++$d(this,lu)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){V(this,Bi).add(t);const n=Kd(t);if(typeof n=="string"){const r=V(this,Kr).get(n);r?r.push(t):V(this,Kr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(V(this,Bi).delete(t)){const n=Kd(t);if(typeof n=="string"){const r=V(this,Kr).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&V(this,Kr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Kd(t);if(typeof n=="string"){const r=V(this,Kr).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Kd(t);if(typeof n=="string"){const i=(r=V(this,Kr).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){dn.batch(()=>{V(this,Bi).forEach(t=>{this.notify({type:"removed",mutation:t})}),V(this,Bi).clear(),V(this,Kr).clear()})}getAll(){return Array.from(V(this,Bi))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>R_(n,r))}findAll(t={}){return this.getAll().filter(n=>R_(t,n))}notify(t){dn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return dn.batch(()=>Promise.all(t.map(n=>n.continue().catch(qn))))}},Bi=new WeakMap,Kr=new WeakMap,lu=new WeakMap,jN);function Kd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Vi,Ra,Qn,$i,Ki,hf,oy,NN,xD=(NN=class extends pl{constructor(n,r){super();ze(this,Ki);ze(this,Vi);ze(this,Ra);ze(this,Qn);ze(this,$i);ke(this,Vi,n),this.setOptions(r),this.bindMethods(),ot(this,Ki,hf).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=V(this,Vi).defaultMutationOptions(n),Of(this.options,r)||V(this,Vi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:V(this,Qn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&zs(r.mutationKey)!==zs(this.options.mutationKey)?this.reset():((i=V(this,Qn))==null?void 0:i.state.status)==="pending"&&V(this,Qn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=V(this,Qn))==null||n.removeObserver(this)}onMutationUpdate(n){ot(this,Ki,hf).call(this),ot(this,Ki,oy).call(this,n)}getCurrentResult(){return V(this,Ra)}reset(){var n;(n=V(this,Qn))==null||n.removeObserver(this),ke(this,Qn,void 0),ot(this,Ki,hf).call(this),ot(this,Ki,oy).call(this)}mutate(n,r){var i;return ke(this,$i,r),(i=V(this,Qn))==null||i.removeObserver(this),ke(this,Qn,V(this,Vi).getMutationCache().build(V(this,Vi),this.options)),V(this,Qn).addObserver(this),V(this,Qn).execute(n)}},Vi=new WeakMap,Ra=new WeakMap,Qn=new WeakMap,$i=new WeakMap,Ki=new WeakSet,hf=function(){var r;const n=((r=V(this,Qn))==null?void 0:r.state)??dC();ke(this,Ra,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},oy=function(n){dn.batch(()=>{var r,i,o,l,u,d,f,h;if(V(this,$i)&&this.hasListeners()){const p=V(this,Ra).variables,g=V(this,Ra).context,x={client:V(this,Vi),meta:this.options.meta,mutationKey:this.options.mutationKey};(n==null?void 0:n.type)==="success"?((i=(r=V(this,$i)).onSuccess)==null||i.call(r,n.data,p,g,x),(l=(o=V(this,$i)).onSettled)==null||l.call(o,n.data,null,p,g,x)):(n==null?void 0:n.type)==="error"&&((d=(u=V(this,$i)).onError)==null||d.call(u,n.error,p,g,x),(h=(f=V(this,$i)).onSettled)==null||h.call(f,void 0,n.error,p,g,x))}this.listeners.forEach(p=>{p(V(this,Ra))})})},NN),fi,CN,vD=(CN=class extends pl{constructor(t={}){super();ze(this,fi);this.config=t,ke(this,fi,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??j0(i,n);let l=this.get(o);return l||(l=new dD({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(l)),l}add(t){V(this,fi).has(t.queryHash)||(V(this,fi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=V(this,fi).get(t.queryHash);n&&(t.destroy(),n===t&&V(this,fi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){dn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return V(this,fi).get(t)}getAll(){return[...V(this,fi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>M_(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>M_(t,r)):n}notify(t){dn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){dn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){dn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fi=new WeakMap,CN),Ht,Oa,Ia,el,tl,Da,nl,rl,kN,bD=(kN=class{constructor(e={}){ze(this,Ht);ze(this,Oa);ze(this,Ia);ze(this,el);ze(this,tl);ze(this,Da);ze(this,nl);ze(this,rl);ke(this,Ht,e.queryCache||new vD),ke(this,Oa,e.mutationCache||new yD),ke(this,Ia,e.defaultOptions||{}),ke(this,el,new Map),ke(this,tl,new Map),ke(this,Da,0)}mount(){$d(this,Da)._++,V(this,Da)===1&&(ke(this,nl,C0.subscribe(async e=>{e&&(await this.resumePausedMutations(),V(this,Ht).onFocus())})),ke(this,rl,If.subscribe(async e=>{e&&(await this.resumePausedMutations(),V(this,Ht).onOnline())})))}unmount(){var e,t;$d(this,Da)._--,V(this,Da)===0&&((e=V(this,nl))==null||e.call(this),ke(this,nl,void 0),(t=V(this,rl))==null||t.call(this),ke(this,rl,void 0))}isFetching(e){return V(this,Ht).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return V(this,Oa).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=V(this,Ht).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=V(this,Ht).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(qa(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return V(this,Ht).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=V(this,Ht).get(r.queryHash),o=i==null?void 0:i.state.data,l=tD(t,o);if(l!==void 0)return V(this,Ht).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return dn.batch(()=>V(this,Ht).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=V(this,Ht).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=V(this,Ht);dn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=V(this,Ht);return dn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=dn.batch(()=>V(this,Ht).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(qn).catch(qn)}invalidateQueries(e,t={}){return dn.batch(()=>(V(this,Ht).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=dn.batch(()=>V(this,Ht).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(qn)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(qn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=V(this,Ht).build(this,t);return n.isStaleByTime(qa(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(qn).catch(qn)}fetchInfiniteQuery(e){return e.behavior=F_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(qn).catch(qn)}ensureInfiniteQueryData(e){return e.behavior=F_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return If.isOnline()?V(this,Oa).resumePausedMutations():Promise.resolve()}getQueryCache(){return V(this,Ht)}getMutationCache(){return V(this,Oa)}getDefaultOptions(){return V(this,Ia)}setDefaultOptions(e){ke(this,Ia,e)}setQueryDefaults(e,t){V(this,el).set(zs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...V(this,el).values()],n={};return t.forEach(r=>{Vc(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){V(this,tl).set(zs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...V(this,tl).values()],n={};return t.forEach(r=>{Vc(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...V(this,Ia).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=j0(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===N0&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...V(this,Ia).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){V(this,Ht).clear(),V(this,Oa).clear()}},Ht=new WeakMap,Oa=new WeakMap,Ia=new WeakMap,el=new WeakMap,tl=new WeakMap,Da=new WeakMap,nl=new WeakMap,rl=new WeakMap,kN),fC=v.createContext(void 0),Bt=e=>{const t=v.useContext(fC);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},wD=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(fC.Provider,{value:e,children:t})),mC=v.createContext(!1),_D=()=>v.useContext(mC);mC.Provider;function SD(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var jD=v.createContext(SD()),ND=()=>v.useContext(jD),CD=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},kD=e=>{v.useEffect(()=>{e.clearReset()},[e])},PD=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||aC(n,[e.error,r])),ED=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},TD=(e,t)=>e.isLoading&&e.isFetching&&!t,AD=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,B_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function MD(e,t,n){var p,g,x,w,_;const r=_D(),i=ND(),o=Bt(),l=o.defaultQueryOptions(e);(g=(p=o.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||g.call(p,l),l._optimisticResults=r?"isRestoring":"optimistic",ED(l),CD(l,i),kD(i);const u=!o.getQueryCache().get(l.queryHash),[d]=v.useState(()=>new t(o,l)),f=d.getOptimisticResult(l),h=!r&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(N=>{const C=h?d.subscribe(dn.batchCalls(N)):qn;return d.updateResult(),C},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),v.useEffect(()=>{d.setOptions(l)},[l,d]),AD(l,f))throw B_(l,d,i);if(PD({result:f,errorResetBoundary:i,throwOnError:l.throwOnError,query:o.getQueryCache().get(l.queryHash),suspense:l.suspense}))throw f.error;if((w=(x=o.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||w.call(x,l,f),l.experimental_prefetchInRender&&!Fs&&TD(f,r)){const N=u?B_(l,d,i):(_=o.getQueryCache().get(l.queryHash))==null?void 0:_.promise;N==null||N.catch(qn).finally(()=>{d.updateResult()})}return l.notifyOnChangeProps?f:d.trackResult(f)}function me(e,t){return MD(e,fD)}function Ae(e,t){const n=Bt(),[r]=v.useState(()=>new xD(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(l=>r.subscribe(dn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=v.useCallback((l,u)=>{r.mutate(l,u).catch(qn)},[r]);if(i.error&&aC(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}const RD=new bD({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});var mu=PN();const OD=cu(mu);/**
|
||
* @remix-run/router v1.23.0
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function $c(){return $c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$c.apply(this,arguments)}var La;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(La||(La={}));const V_="popstate";function ID(e){e===void 0&&(e={});function t(r,i){let{pathname:o,search:l,hash:u}=r.location;return ly("",{pathname:o,search:l,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Df(i)}return LD(t,n,null,e)}function on(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function hC(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function DD(){return Math.random().toString(36).substr(2,8)}function $_(e,t){return{usr:e.state,key:e.key,idx:t}}function ly(e,t,n,r){return n===void 0&&(n=null),$c({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?gl(t):t,{state:n,key:t&&t.key||r||DD()})}function Df(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function gl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function LD(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,u=La.Pop,d=null,f=h();f==null&&(f=0,l.replaceState($c({},l.state,{idx:f}),""));function h(){return(l.state||{idx:null}).idx}function p(){u=La.Pop;let N=h(),C=N==null?null:N-f;f=N,d&&d({action:u,location:_.location,delta:C})}function g(N,C){u=La.Push;let k=ly(_.location,N,C);f=h()+1;let P=$_(k,f),T=_.createHref(k);try{l.pushState(P,"",T)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(T)}o&&d&&d({action:u,location:_.location,delta:1})}function x(N,C){u=La.Replace;let k=ly(_.location,N,C);f=h();let P=$_(k,f),T=_.createHref(k);l.replaceState(P,"",T),o&&d&&d({action:u,location:_.location,delta:0})}function w(N){let C=i.location.origin!=="null"?i.location.origin:i.location.href,k=typeof N=="string"?N:Df(N);return k=k.replace(/ $/,"%20"),on(C,"No window.location.(origin|href) available to create URL for href: "+k),new URL(k,C)}let _={get action(){return u},get location(){return e(i,l)},listen(N){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(V_,p),d=N,()=>{i.removeEventListener(V_,p),d=null}},createHref(N){return t(i,N)},createURL:w,encodeLocation(N){let C=w(N);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:g,replace:x,go(N){return l.go(N)}};return _}var U_;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(U_||(U_={}));function qD(e,t,n){return n===void 0&&(n="/"),FD(e,t,n)}function FD(e,t,n,r){let i=typeof t=="string"?gl(t):t,o=P0(i.pathname||"/",n);if(o==null)return null;let l=pC(e);zD(l);let u=null;for(let d=0;u==null&&d<l.length;++d){let f=JD(o);u=QD(l[d],f)}return u}function pC(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(o,l,u)=>{let d={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};d.relativePath.startsWith("/")&&(on(d.relativePath.startsWith(r),'Absolute route path "'+d.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),d.relativePath=d.relativePath.slice(r.length));let f=Fa([r,d.relativePath]),h=n.concat(d);o.children&&o.children.length>0&&(on(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),pC(o.children,t,h,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:KD(f,o.index),routesMeta:h})};return e.forEach((o,l)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))i(o,l);else for(let d of gC(o.path))i(o,l,d)}),t}function gC(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=gC(r.join("/")),u=[];return u.push(...l.map(d=>d===""?o:[o,d].join("/"))),i&&u.push(...l),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function zD(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:GD(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const BD=/^:[\w-]+$/,VD=3,$D=2,UD=1,WD=10,HD=-2,W_=e=>e==="*";function KD(e,t){let n=e.split("/"),r=n.length;return n.some(W_)&&(r+=HD),t&&(r+=$D),n.filter(i=>!W_(i)).reduce((i,o)=>i+(BD.test(o)?VD:o===""?UD:WD),r)}function GD(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function QD(e,t,n){let{routesMeta:r}=e,i={},o="/",l=[];for(let u=0;u<r.length;++u){let d=r[u],f=u===r.length-1,h=o==="/"?t:t.slice(o.length)||"/",p=YD({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),g=d.route;if(!p)return null;Object.assign(i,p.params),l.push({params:i,pathname:Fa([o,p.pathname]),pathnameBase:n5(Fa([o,p.pathnameBase])),route:g}),p.pathnameBase!=="/"&&(o=Fa([o,p.pathnameBase]))}return l}function YD(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=XD(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],l=o.replace(/(.)\/+$/,"$1"),u=i.slice(1);return{params:r.reduce((f,h,p)=>{let{paramName:g,isOptional:x}=h;if(g==="*"){let _=u[p]||"";l=o.slice(0,o.length-_.length).replace(/(.)\/+$/,"$1")}const w=u[p];return x&&!w?f[g]=void 0:f[g]=(w||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:l,pattern:e}}function XD(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),hC(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d)=>(r.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function JD(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return hC(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function P0(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function ZD(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?gl(e):e;return{pathname:n?n.startsWith("/")?n:e5(n,t):t,search:r5(r),hash:i5(i)}}function e5(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Yp(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function t5(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function yC(e,t){let n=t5(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function xC(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=gl(e):(i=$c({},e),on(!i.pathname||!i.pathname.includes("?"),Yp("?","pathname","search",i)),on(!i.pathname||!i.pathname.includes("#"),Yp("#","pathname","hash",i)),on(!i.search||!i.search.includes("#"),Yp("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,u;if(l==null)u=n;else{let p=t.length-1;if(!r&&l.startsWith("..")){let g=l.split("/");for(;g[0]==="..";)g.shift(),p-=1;i.pathname=g.join("/")}u=p>=0?t[p]:"/"}let d=ZD(i,u),f=l&&l!=="/"&&l.endsWith("/"),h=(o||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Fa=e=>e.join("/").replace(/\/\/+/g,"/"),n5=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),r5=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,i5=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function a5(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const vC=["post","put","patch","delete"];new Set(vC);const s5=["get",...vC];new Set(s5);/**
|
||
* React Router v6.30.1
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function Uc(){return Uc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Uc.apply(this,arguments)}const E0=v.createContext(null),o5=v.createContext(null),Gs=v.createContext(null),hm=v.createContext(null),Qs=v.createContext({outlet:null,matches:[],isDataRoute:!1}),bC=v.createContext(null);function l5(e,t){let{relative:n}=t===void 0?{}:t;hu()||on(!1);let{basename:r,navigator:i}=v.useContext(Gs),{hash:o,pathname:l,search:u}=_C(e,{relative:n}),d=l;return r!=="/"&&(d=l==="/"?r:Fa([r,l])),i.createHref({pathname:d,search:u,hash:o})}function hu(){return v.useContext(hm)!=null}function Ys(){return hu()||on(!1),v.useContext(hm).location}function wC(e){v.useContext(Gs).static||v.useLayoutEffect(e)}function yl(){let{isDataRoute:e}=v.useContext(Qs);return e?w5():c5()}function c5(){hu()||on(!1);let e=v.useContext(E0),{basename:t,future:n,navigator:r}=v.useContext(Gs),{matches:i}=v.useContext(Qs),{pathname:o}=Ys(),l=JSON.stringify(yC(i,n.v7_relativeSplatPath)),u=v.useRef(!1);return wC(()=>{u.current=!0}),v.useCallback(function(f,h){if(h===void 0&&(h={}),!u.current)return;if(typeof f=="number"){r.go(f);return}let p=xC(f,JSON.parse(l),o,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Fa([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,l,o,e])}function _C(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(Gs),{matches:i}=v.useContext(Qs),{pathname:o}=Ys(),l=JSON.stringify(yC(i,r.v7_relativeSplatPath));return v.useMemo(()=>xC(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function u5(e,t){return d5(e,t)}function d5(e,t,n,r){hu()||on(!1);let{navigator:i}=v.useContext(Gs),{matches:o}=v.useContext(Qs),l=o[o.length-1],u=l?l.params:{};l&&l.pathname;let d=l?l.pathnameBase:"/";l&&l.route;let f=Ys(),h;if(t){var p;let N=typeof t=="string"?gl(t):t;d==="/"||(p=N.pathname)!=null&&p.startsWith(d)||on(!1),h=N}else h=f;let g=h.pathname||"/",x=g;if(d!=="/"){let N=d.replace(/^\//,"").split("/");x="/"+g.replace(/^\//,"").split("/").slice(N.length).join("/")}let w=qD(e,{pathname:x}),_=g5(w&&w.map(N=>Object.assign({},N,{params:Object.assign({},u,N.params),pathname:Fa([d,i.encodeLocation?i.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?d:Fa([d,i.encodeLocation?i.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),o,n,r);return t&&_?v.createElement(hm.Provider,{value:{location:Uc({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:La.Pop}},_):_}function f5(){let e=b5(),t=a5(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:i},n):null,null)}const m5=v.createElement(f5,null);class h5 extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?v.createElement(Qs.Provider,{value:this.props.routeContext},v.createElement(bC.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function p5(e){let{routeContext:t,match:n,children:r}=e,i=v.useContext(E0);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Qs.Provider,{value:t},r)}function g5(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,u=(i=n)==null?void 0:i.errors;if(u!=null){let h=l.findIndex(p=>p.route.id&&(u==null?void 0:u[p.route.id])!==void 0);h>=0||on(!1),l=l.slice(0,Math.min(l.length,h+1))}let d=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<l.length;h++){let p=l[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=h),p.route.id){let{loaderData:g,errors:x}=n,w=p.route.loader&&g[p.route.id]===void 0&&(!x||x[p.route.id]===void 0);if(p.route.lazy||w){d=!0,f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}return l.reduceRight((h,p,g)=>{let x,w=!1,_=null,N=null;n&&(x=u&&p.route.id?u[p.route.id]:void 0,_=p.route.errorElement||m5,d&&(f<0&&g===0?(_5("route-fallback"),w=!0,N=null):f===g&&(w=!0,N=p.route.hydrateFallbackElement||null)));let C=t.concat(l.slice(0,g+1)),k=()=>{let P;return x?P=_:w?P=N:p.route.Component?P=v.createElement(p.route.Component,null):p.route.element?P=p.route.element:P=h,v.createElement(p5,{match:p,routeContext:{outlet:h,matches:C,isDataRoute:n!=null},children:P})};return n&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?v.createElement(h5,{location:n.location,revalidation:n.revalidation,component:_,error:x,children:k(),routeContext:{outlet:null,matches:C,isDataRoute:!0}}):k()},null)}var SC=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(SC||{}),jC=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(jC||{});function y5(e){let t=v.useContext(E0);return t||on(!1),t}function x5(e){let t=v.useContext(o5);return t||on(!1),t}function v5(e){let t=v.useContext(Qs);return t||on(!1),t}function NC(e){let t=v5(),n=t.matches[t.matches.length-1];return n.route.id||on(!1),n.route.id}function b5(){var e;let t=v.useContext(bC),n=x5(),r=NC();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function w5(){let{router:e}=y5(SC.UseNavigateStable),t=NC(jC.UseNavigateStable),n=v.useRef(!1);return wC(()=>{n.current=!0}),v.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Uc({fromRouteId:t},o)))},[e,t])}const H_={};function _5(e,t,n){H_[e]||(H_[e]=!0)}function S5(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function li(e){on(!1)}function j5(e){let{basename:t="/",children:n=null,location:r,navigationType:i=La.Pop,navigator:o,static:l=!1,future:u}=e;hu()&&on(!1);let d=t.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:o,static:l,future:Uc({v7_relativeSplatPath:!1},u)}),[d,u,o,l]);typeof r=="string"&&(r=gl(r));let{pathname:h="/",search:p="",hash:g="",state:x=null,key:w="default"}=r,_=v.useMemo(()=>{let N=P0(h,d);return N==null?null:{location:{pathname:N,search:p,hash:g,state:x,key:w},navigationType:i}},[d,h,p,g,x,w,i]);return _==null?null:v.createElement(Gs.Provider,{value:f},v.createElement(hm.Provider,{children:n,value:_}))}function N5(e){let{children:t,location:n}=e;return u5(cy(t),n)}new Promise(()=>{});function cy(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(r,i)=>{if(!v.isValidElement(r))return;let o=[...t,i];if(r.type===v.Fragment){n.push.apply(n,cy(r.props.children,o));return}r.type!==li&&on(!1),!r.props.index||!r.props.children||on(!1);let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=cy(r.props.children,o)),n.push(l)}),n}/**
|
||
* React Router DOM v6.30.1
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function uy(){return uy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uy.apply(this,arguments)}function C5(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function k5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function P5(e,t){return e.button===0&&(!t||t==="_self")&&!k5(e)}function dy(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function E5(e,t){let n=dy(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}const T5=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],A5="6";try{window.__reactRouterVersion=A5}catch{}const M5="startTransition",K_=p0[M5];function R5(e){let{basename:t,children:n,future:r,window:i}=e,o=v.useRef();o.current==null&&(o.current=ID({window:i,v5Compat:!0}));let l=o.current,[u,d]=v.useState({action:l.action,location:l.location}),{v7_startTransition:f}=r||{},h=v.useCallback(p=>{f&&K_?K_(()=>d(p)):d(p)},[d,f]);return v.useLayoutEffect(()=>l.listen(h),[l,h]),v.useEffect(()=>S5(r),[r]),v.createElement(j5,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:l,future:r})}const O5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",I5=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ft=v.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:l,state:u,target:d,to:f,preventScrollReset:h,viewTransition:p}=t,g=C5(t,T5),{basename:x}=v.useContext(Gs),w,_=!1;if(typeof f=="string"&&I5.test(f)&&(w=f,O5))try{let P=new URL(window.location.href),T=f.startsWith("//")?new URL(P.protocol+f):new URL(f),S=P0(T.pathname,x);T.origin===P.origin&&S!=null?f=S+T.search+T.hash:_=!0}catch{}let N=l5(f,{relative:i}),C=D5(f,{replace:l,state:u,target:d,preventScrollReset:h,relative:i,viewTransition:p});function k(P){r&&r(P),P.defaultPrevented||C(P)}return v.createElement("a",uy({},g,{href:w||N,onClick:_||o?r:k,ref:n,target:d}))});var G_;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(G_||(G_={}));var Q_;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Q_||(Q_={}));function D5(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,viewTransition:u}=t===void 0?{}:t,d=yl(),f=Ys(),h=_C(e,{relative:l});return v.useCallback(p=>{if(P5(p,n)){p.preventDefault();let g=r!==void 0?r:Df(f)===Df(h);d(e,{replace:g,state:i,preventScrollReset:o,relative:l,viewTransition:u})}},[f,d,h,r,i,n,e,o,l,u])}function L5(e){let t=v.useRef(dy(e)),n=v.useRef(!1),r=Ys(),i=v.useMemo(()=>E5(r.search,n.current?null:t.current),[r.search]),o=yl(),l=v.useCallback((u,d)=>{const f=dy(typeof u=="function"?u(i):u);n.current=!0,o("?"+f,d)},[o,i]);return[i,l]}function CC(e,t){return function(){return e.apply(t,arguments)}}const{toString:q5}=Object.prototype,{getPrototypeOf:T0}=Object,{iterator:pm,toStringTag:kC}=Symbol,gm=(e=>t=>{const n=q5.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Zr=e=>(e=e.toLowerCase(),t=>gm(t)===e),ym=e=>t=>typeof t===e,{isArray:xl}=Array,al=ym("undefined");function pu(e){return e!==null&&!al(e)&&e.constructor!==null&&!al(e.constructor)&&Xn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const PC=Zr("ArrayBuffer");function F5(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&PC(e.buffer),t}const z5=ym("string"),Xn=ym("function"),EC=ym("number"),gu=e=>e!==null&&typeof e=="object",B5=e=>e===!0||e===!1,pf=e=>{if(gm(e)!=="object")return!1;const t=T0(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(kC in e)&&!(pm in e)},V5=e=>{if(!gu(e)||pu(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},$5=Zr("Date"),U5=Zr("File"),W5=Zr("Blob"),H5=Zr("FileList"),K5=e=>gu(e)&&Xn(e.pipe),G5=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Xn(e.append)&&((t=gm(e))==="formdata"||t==="object"&&Xn(e.toString)&&e.toString()==="[object FormData]"))},Q5=Zr("URLSearchParams"),[Y5,X5,J5,Z5]=["ReadableStream","Request","Response","Headers"].map(Zr),eL=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function yu(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),xl(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(pu(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),l=o.length;let u;for(r=0;r<l;r++)u=o[r],t.call(null,e[u],u,e)}}function TC(e,t){if(pu(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const vs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,AC=e=>!al(e)&&e!==vs;function fy(){const{caseless:e,skipUndefined:t}=AC(this)&&this||{},n={},r=(i,o)=>{const l=e&&TC(n,o)||o;pf(n[l])&&pf(i)?n[l]=fy(n[l],i):pf(i)?n[l]=fy({},i):xl(i)?n[l]=i.slice():(!t||!al(i))&&(n[l]=i)};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&yu(arguments[i],r);return n}const tL=(e,t,n,{allOwnKeys:r}={})=>(yu(t,(i,o)=>{n&&Xn(i)?e[o]=CC(i,n):e[o]=i},{allOwnKeys:r}),e),nL=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),rL=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},iL=(e,t,n,r)=>{let i,o,l;const u={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)l=i[o],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&T0(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},aL=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},sL=e=>{if(!e)return null;if(xl(e))return e;let t=e.length;if(!EC(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},oL=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&T0(Uint8Array)),lL=(e,t)=>{const r=(e&&e[pm]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},cL=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},uL=Zr("HTMLFormElement"),dL=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Y_=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),fL=Zr("RegExp"),MC=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};yu(n,(i,o)=>{let l;(l=t(i,o,e))!==!1&&(r[o]=l||i)}),Object.defineProperties(e,r)},mL=e=>{MC(e,(t,n)=>{if(Xn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Xn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},hL=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return xl(e)?r(e):r(String(e).split(t)),n},pL=()=>{},gL=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function yL(e){return!!(e&&Xn(e.append)&&e[kC]==="FormData"&&e[pm])}const xL=e=>{const t=new Array(10),n=(r,i)=>{if(gu(r)){if(t.indexOf(r)>=0)return;if(pu(r))return r;if(!("toJSON"in r)){t[i]=r;const o=xl(r)?[]:{};return yu(r,(l,u)=>{const d=n(l,i+1);!al(d)&&(o[u]=d)}),t[i]=void 0,o}}return r};return n(e,0)},vL=Zr("AsyncFunction"),bL=e=>e&&(gu(e)||Xn(e))&&Xn(e.then)&&Xn(e.catch),RC=((e,t)=>e?setImmediate:t?((n,r)=>(vs.addEventListener("message",({source:i,data:o})=>{i===vs&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),vs.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Xn(vs.postMessage)),wL=typeof queueMicrotask<"u"?queueMicrotask.bind(vs):typeof process<"u"&&process.nextTick||RC,_L=e=>e!=null&&Xn(e[pm]),ne={isArray:xl,isArrayBuffer:PC,isBuffer:pu,isFormData:G5,isArrayBufferView:F5,isString:z5,isNumber:EC,isBoolean:B5,isObject:gu,isPlainObject:pf,isEmptyObject:V5,isReadableStream:Y5,isRequest:X5,isResponse:J5,isHeaders:Z5,isUndefined:al,isDate:$5,isFile:U5,isBlob:W5,isRegExp:fL,isFunction:Xn,isStream:K5,isURLSearchParams:Q5,isTypedArray:oL,isFileList:H5,forEach:yu,merge:fy,extend:tL,trim:eL,stripBOM:nL,inherits:rL,toFlatObject:iL,kindOf:gm,kindOfTest:Zr,endsWith:aL,toArray:sL,forEachEntry:lL,matchAll:cL,isHTMLForm:uL,hasOwnProperty:Y_,hasOwnProp:Y_,reduceDescriptors:MC,freezeMethods:mL,toObjectSet:hL,toCamelCase:dL,noop:pL,toFiniteNumber:gL,findKey:TC,global:vs,isContextDefined:AC,isSpecCompliantForm:yL,toJSONObject:xL,isAsyncFn:vL,isThenable:bL,setImmediate:RC,asap:wL,isIterable:_L};function it(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}ne.inherits(it,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ne.toJSONObject(this.config),code:this.code,status:this.status}}});const OC=it.prototype,IC={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{IC[e]={value:e}});Object.defineProperties(it,IC);Object.defineProperty(OC,"isAxiosError",{value:!0});it.from=(e,t,n,r,i,o)=>{const l=Object.create(OC);ne.toFlatObject(e,l,function(h){return h!==Error.prototype},f=>f!=="isAxiosError");const u=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return it.call(l,u,d,n,r,i),e&&l.cause==null&&Object.defineProperty(l,"cause",{value:e,configurable:!0}),l.name=e&&e.name||"Error",o&&Object.assign(l,o),l};const SL=null;function my(e){return ne.isPlainObject(e)||ne.isArray(e)}function DC(e){return ne.endsWith(e,"[]")?e.slice(0,-2):e}function X_(e,t,n){return e?e.concat(t).map(function(i,o){return i=DC(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function jL(e){return ne.isArray(e)&&!e.some(my)}const NL=ne.toFlatObject(ne,{},null,function(t){return/^is[A-Z]/.test(t)});function xm(e,t,n){if(!ne.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ne.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_,N){return!ne.isUndefined(N[_])});const r=n.metaTokens,i=n.visitor||h,o=n.dots,l=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&ne.isSpecCompliantForm(t);if(!ne.isFunction(i))throw new TypeError("visitor must be a function");function f(w){if(w===null)return"";if(ne.isDate(w))return w.toISOString();if(ne.isBoolean(w))return w.toString();if(!d&&ne.isBlob(w))throw new it("Blob is not supported. Use a Buffer instead.");return ne.isArrayBuffer(w)||ne.isTypedArray(w)?d&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function h(w,_,N){let C=w;if(w&&!N&&typeof w=="object"){if(ne.endsWith(_,"{}"))_=r?_:_.slice(0,-2),w=JSON.stringify(w);else if(ne.isArray(w)&&jL(w)||(ne.isFileList(w)||ne.endsWith(_,"[]"))&&(C=ne.toArray(w)))return _=DC(_),C.forEach(function(P,T){!(ne.isUndefined(P)||P===null)&&t.append(l===!0?X_([_],T,o):l===null?_:_+"[]",f(P))}),!1}return my(w)?!0:(t.append(X_(N,_,o),f(w)),!1)}const p=[],g=Object.assign(NL,{defaultVisitor:h,convertValue:f,isVisitable:my});function x(w,_){if(!ne.isUndefined(w)){if(p.indexOf(w)!==-1)throw Error("Circular reference detected in "+_.join("."));p.push(w),ne.forEach(w,function(C,k){(!(ne.isUndefined(C)||C===null)&&i.call(t,C,ne.isString(k)?k.trim():k,_,g))===!0&&x(C,_?_.concat(k):[k])}),p.pop()}}if(!ne.isObject(e))throw new TypeError("data must be an object");return x(e),t}function J_(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function A0(e,t){this._pairs=[],e&&xm(e,this,t)}const LC=A0.prototype;LC.append=function(t,n){this._pairs.push([t,n])};LC.toString=function(t){const n=t?function(r){return t.call(this,r,J_)}:J_;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function CL(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function qC(e,t,n){if(!t)return e;const r=n&&n.encode||CL;ne.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=ne.isURLSearchParams(t)?t.toString():new A0(t,n).toString(r),o){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Z_{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ne.forEach(this.handlers,function(r){r!==null&&t(r)})}}const FC={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kL=typeof URLSearchParams<"u"?URLSearchParams:A0,PL=typeof FormData<"u"?FormData:null,EL=typeof Blob<"u"?Blob:null,TL={isBrowser:!0,classes:{URLSearchParams:kL,FormData:PL,Blob:EL},protocols:["http","https","file","blob","url","data"]},M0=typeof window<"u"&&typeof document<"u",hy=typeof navigator=="object"&&navigator||void 0,AL=M0&&(!hy||["ReactNative","NativeScript","NS"].indexOf(hy.product)<0),ML=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",RL=M0&&window.location.href||"http://localhost",OL=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:M0,hasStandardBrowserEnv:AL,hasStandardBrowserWebWorkerEnv:ML,navigator:hy,origin:RL},Symbol.toStringTag,{value:"Module"})),An={...OL,...TL};function IL(e,t){return xm(e,new An.classes.URLSearchParams,{visitor:function(n,r,i,o){return An.isNode&&ne.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function DL(e){return ne.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function LL(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}function zC(e){function t(n,r,i,o){let l=n[o++];if(l==="__proto__")return!0;const u=Number.isFinite(+l),d=o>=n.length;return l=!l&&ne.isArray(i)?i.length:l,d?(ne.hasOwnProp(i,l)?i[l]=[i[l],r]:i[l]=r,!u):((!i[l]||!ne.isObject(i[l]))&&(i[l]=[]),t(n,r,i[l],o)&&ne.isArray(i[l])&&(i[l]=LL(i[l])),!u)}if(ne.isFormData(e)&&ne.isFunction(e.entries)){const n={};return ne.forEachEntry(e,(r,i)=>{t(DL(r),i,n,0)}),n}return null}function qL(e,t,n){if(ne.isString(e))try{return(t||JSON.parse)(e),ne.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const xu={transitional:FC,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=ne.isObject(t);if(o&&ne.isHTMLForm(t)&&(t=new FormData(t)),ne.isFormData(t))return i?JSON.stringify(zC(t)):t;if(ne.isArrayBuffer(t)||ne.isBuffer(t)||ne.isStream(t)||ne.isFile(t)||ne.isBlob(t)||ne.isReadableStream(t))return t;if(ne.isArrayBufferView(t))return t.buffer;if(ne.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return IL(t,this.formSerializer).toString();if((u=ne.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return xm(u?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),qL(t)):t}],transformResponse:[function(t){const n=this.transitional||xu.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(ne.isResponse(t)||ne.isReadableStream(t))return t;if(t&&ne.isString(t)&&(r&&!this.responseType||i)){const l=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(u){if(l)throw u.name==="SyntaxError"?it.from(u,it.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:An.classes.FormData,Blob:An.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ne.forEach(["delete","get","head","post","put","patch"],e=>{xu.headers[e]={}});const FL=ne.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),zL=e=>{const t={};let n,r,i;return e&&e.split(`
|
||
`).forEach(function(l){i=l.indexOf(":"),n=l.substring(0,i).trim().toLowerCase(),r=l.substring(i+1).trim(),!(!n||t[n]&&FL[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},eS=Symbol("internals");function mc(e){return e&&String(e).trim().toLowerCase()}function gf(e){return e===!1||e==null?e:ne.isArray(e)?e.map(gf):String(e)}function BL(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const VL=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Xp(e,t,n,r,i){if(ne.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!ne.isString(t)){if(ne.isString(r))return t.indexOf(r)!==-1;if(ne.isRegExp(r))return r.test(t)}}function $L(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function UL(e,t){const n=ne.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,l){return this[r].call(this,t,i,o,l)},configurable:!0})})}let Jn=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(u,d,f){const h=mc(d);if(!h)throw new Error("header name must be a non-empty string");const p=ne.findKey(i,h);(!p||i[p]===void 0||f===!0||f===void 0&&i[p]!==!1)&&(i[p||d]=gf(u))}const l=(u,d)=>ne.forEach(u,(f,h)=>o(f,h,d));if(ne.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(ne.isString(t)&&(t=t.trim())&&!VL(t))l(zL(t),n);else if(ne.isObject(t)&&ne.isIterable(t)){let u={},d,f;for(const h of t){if(!ne.isArray(h))throw TypeError("Object iterator must return a key-value pair");u[f=h[0]]=(d=u[f])?ne.isArray(d)?[...d,h[1]]:[d,h[1]]:h[1]}l(u,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=mc(t),t){const r=ne.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return BL(i);if(ne.isFunction(n))return n.call(this,i,r);if(ne.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=mc(t),t){const r=ne.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Xp(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(l){if(l=mc(l),l){const u=ne.findKey(r,l);u&&(!n||Xp(r,r[u],u,n))&&(delete r[u],i=!0)}}return ne.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||Xp(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return ne.forEach(this,(i,o)=>{const l=ne.findKey(r,o);if(l){n[l]=gf(i),delete n[o];return}const u=t?$L(o):String(o).trim();u!==o&&delete n[o],n[u]=gf(i),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ne.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&ne.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
||
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[eS]=this[eS]={accessors:{}}).accessors,i=this.prototype;function o(l){const u=mc(l);r[u]||(UL(i,l),r[u]=!0)}return ne.isArray(t)?t.forEach(o):o(t),this}};Jn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ne.reduceDescriptors(Jn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ne.freezeMethods(Jn);function Jp(e,t){const n=this||xu,r=t||n,i=Jn.from(r.headers);let o=r.data;return ne.forEach(e,function(u){o=u.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function BC(e){return!!(e&&e.__CANCEL__)}function vl(e,t,n){it.call(this,e??"canceled",it.ERR_CANCELED,t,n),this.name="CanceledError"}ne.inherits(vl,it,{__CANCEL__:!0});function VC(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new it("Request failed with status code "+n.status,[it.ERR_BAD_REQUEST,it.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function WL(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function HL(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,l;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),h=r[o];l||(l=f),n[i]=d,r[i]=f;let p=o,g=0;for(;p!==i;)g+=n[p++],p=p%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),f-l<t)return;const x=h&&f-h;return x?Math.round(g*1e3/x):void 0}}function KL(e,t){let n=0,r=1e3/t,i,o;const l=(f,h=Date.now())=>{n=h,i=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const h=Date.now(),p=h-n;p>=r?l(f,h):(i=f,o||(o=setTimeout(()=>{o=null,l(i)},r-p)))},()=>i&&l(i)]}const Lf=(e,t,n=3)=>{let r=0;const i=HL(50,250);return KL(o=>{const l=o.loaded,u=o.lengthComputable?o.total:void 0,d=l-r,f=i(d),h=l<=u;r=l;const p={loaded:l,total:u,progress:u?l/u:void 0,bytes:d,rate:f||void 0,estimated:f&&u&&h?(u-l)/f:void 0,event:o,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(p)},n)},tS=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},nS=e=>(...t)=>ne.asap(()=>e(...t)),GL=An.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,An.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(An.origin),An.navigator&&/(msie|trident)/i.test(An.navigator.userAgent)):()=>!0,QL=An.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const l=[e+"="+encodeURIComponent(t)];ne.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),ne.isString(r)&&l.push("path="+r),ne.isString(i)&&l.push("domain="+i),o===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function YL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function XL(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function $C(e,t,n){let r=!YL(t);return e&&(r||n==!1)?XL(e,t):t}const rS=e=>e instanceof Jn?{...e}:e;function Bs(e,t){t=t||{};const n={};function r(f,h,p,g){return ne.isPlainObject(f)&&ne.isPlainObject(h)?ne.merge.call({caseless:g},f,h):ne.isPlainObject(h)?ne.merge({},h):ne.isArray(h)?h.slice():h}function i(f,h,p,g){if(ne.isUndefined(h)){if(!ne.isUndefined(f))return r(void 0,f,p,g)}else return r(f,h,p,g)}function o(f,h){if(!ne.isUndefined(h))return r(void 0,h)}function l(f,h){if(ne.isUndefined(h)){if(!ne.isUndefined(f))return r(void 0,f)}else return r(void 0,h)}function u(f,h,p){if(p in t)return r(f,h);if(p in e)return r(void 0,f)}const d={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(f,h,p)=>i(rS(f),rS(h),p,!0)};return ne.forEach(Object.keys({...e,...t}),function(h){const p=d[h]||i,g=p(e[h],t[h],h);ne.isUndefined(g)&&p!==u||(n[h]=g)}),n}const UC=e=>{const t=Bs({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:l,auth:u}=t;if(t.headers=l=Jn.from(l),t.url=qC($C(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),ne.isFormData(n)){if(An.hasStandardBrowserEnv||An.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(ne.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([h,p])=>{f.includes(h.toLowerCase())&&l.set(h,p)})}}if(An.hasStandardBrowserEnv&&(r&&ne.isFunction(r)&&(r=r(t)),r||r!==!1&&GL(t.url))){const d=i&&o&&QL.read(o);d&&l.set(i,d)}return t},JL=typeof XMLHttpRequest<"u",ZL=JL&&function(e){return new Promise(function(n,r){const i=UC(e);let o=i.data;const l=Jn.from(i.headers).normalize();let{responseType:u,onUploadProgress:d,onDownloadProgress:f}=i,h,p,g,x,w;function _(){x&&x(),w&&w(),i.cancelToken&&i.cancelToken.unsubscribe(h),i.signal&&i.signal.removeEventListener("abort",h)}let N=new XMLHttpRequest;N.open(i.method.toUpperCase(),i.url,!0),N.timeout=i.timeout;function C(){if(!N)return;const P=Jn.from("getAllResponseHeaders"in N&&N.getAllResponseHeaders()),S={data:!u||u==="text"||u==="json"?N.responseText:N.response,status:N.status,statusText:N.statusText,headers:P,config:e,request:N};VC(function(z){n(z),_()},function(z){r(z),_()},S),N=null}"onloadend"in N?N.onloadend=C:N.onreadystatechange=function(){!N||N.readyState!==4||N.status===0&&!(N.responseURL&&N.responseURL.indexOf("file:")===0)||setTimeout(C)},N.onabort=function(){N&&(r(new it("Request aborted",it.ECONNABORTED,e,N)),N=null)},N.onerror=function(T){const S=T&&T.message?T.message:"Network Error",E=new it(S,it.ERR_NETWORK,e,N);E.event=T||null,r(E),N=null},N.ontimeout=function(){let T=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const S=i.transitional||FC;i.timeoutErrorMessage&&(T=i.timeoutErrorMessage),r(new it(T,S.clarifyTimeoutError?it.ETIMEDOUT:it.ECONNABORTED,e,N)),N=null},o===void 0&&l.setContentType(null),"setRequestHeader"in N&&ne.forEach(l.toJSON(),function(T,S){N.setRequestHeader(S,T)}),ne.isUndefined(i.withCredentials)||(N.withCredentials=!!i.withCredentials),u&&u!=="json"&&(N.responseType=i.responseType),f&&([g,w]=Lf(f,!0),N.addEventListener("progress",g)),d&&N.upload&&([p,x]=Lf(d),N.upload.addEventListener("progress",p),N.upload.addEventListener("loadend",x)),(i.cancelToken||i.signal)&&(h=P=>{N&&(r(!P||P.type?new vl(null,e,N):P),N.abort(),N=null)},i.cancelToken&&i.cancelToken.subscribe(h),i.signal&&(i.signal.aborted?h():i.signal.addEventListener("abort",h)));const k=WL(i.url);if(k&&An.protocols.indexOf(k)===-1){r(new it("Unsupported protocol "+k+":",it.ERR_BAD_REQUEST,e));return}N.send(o||null)})},eq=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(f){if(!i){i=!0,u();const h=f instanceof Error?f:this.reason;r.abort(h instanceof it?h:new vl(h instanceof Error?h.message:h))}};let l=t&&setTimeout(()=>{l=null,o(new it(`timeout ${t} of ms exceeded`,it.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>ne.asap(u),d}},tq=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},nq=async function*(e,t){for await(const n of rq(e))yield*tq(n,t)},rq=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},iS=(e,t,n,r)=>{const i=nq(e,t);let o=0,l,u=d=>{l||(l=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:f,value:h}=await i.next();if(f){u(),d.close();return}let p=h.byteLength;if(n){let g=o+=p;n(g)}d.enqueue(new Uint8Array(h))}catch(f){throw u(f),f}},cancel(d){return u(d),i.return()}},{highWaterMark:2})},aS=64*1024,{isFunction:Gd}=ne,iq=(({Request:e,Response:t})=>({Request:e,Response:t}))(ne.global),{ReadableStream:sS,TextEncoder:oS}=ne.global,lS=(e,...t)=>{try{return!!e(...t)}catch{return!1}},aq=e=>{e=ne.merge.call({skipUndefined:!0},iq,e);const{fetch:t,Request:n,Response:r}=e,i=t?Gd(t):typeof fetch=="function",o=Gd(n),l=Gd(r);if(!i)return!1;const u=i&&Gd(sS),d=i&&(typeof oS=="function"?(w=>_=>w.encode(_))(new oS):async w=>new Uint8Array(await new n(w).arrayBuffer())),f=o&&u&&lS(()=>{let w=!1;const _=new n(An.origin,{body:new sS,method:"POST",get duplex(){return w=!0,"half"}}).headers.has("Content-Type");return w&&!_}),h=l&&u&&lS(()=>ne.isReadableStream(new r("").body)),p={stream:h&&(w=>w.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!p[w]&&(p[w]=(_,N)=>{let C=_&&_[w];if(C)return C.call(_);throw new it(`Response type '${w}' is not supported`,it.ERR_NOT_SUPPORT,N)})});const g=async w=>{if(w==null)return 0;if(ne.isBlob(w))return w.size;if(ne.isSpecCompliantForm(w))return(await new n(An.origin,{method:"POST",body:w}).arrayBuffer()).byteLength;if(ne.isArrayBufferView(w)||ne.isArrayBuffer(w))return w.byteLength;if(ne.isURLSearchParams(w)&&(w=w+""),ne.isString(w))return(await d(w)).byteLength},x=async(w,_)=>{const N=ne.toFiniteNumber(w.getContentLength());return N??g(_)};return async w=>{let{url:_,method:N,data:C,signal:k,cancelToken:P,timeout:T,onDownloadProgress:S,onUploadProgress:E,responseType:z,headers:D,withCredentials:K="same-origin",fetchOptions:U}=UC(w),W=t||fetch;z=z?(z+"").toLowerCase():"text";let G=eq([k,P&&P.toAbortSignal()],T),R=null;const q=G&&G.unsubscribe&&(()=>{G.unsubscribe()});let J;try{if(E&&f&&N!=="get"&&N!=="head"&&(J=await x(D,C))!==0){let B=new n(_,{method:"POST",body:C,duplex:"half"}),Z;if(ne.isFormData(C)&&(Z=B.headers.get("content-type"))&&D.setContentType(Z),B.body){const[I,de]=tS(J,Lf(nS(E)));C=iS(B.body,aS,I,de)}}ne.isString(K)||(K=K?"include":"omit");const ae=o&&"credentials"in n.prototype,re={...U,signal:G,method:N.toUpperCase(),headers:D.normalize().toJSON(),body:C,duplex:"half",credentials:ae?K:void 0};R=o&&new n(_,re);let L=await(o?W(R,U):W(_,re));const Y=h&&(z==="stream"||z==="response");if(h&&(S||Y&&q)){const B={};["status","statusText","headers"].forEach(Ne=>{B[Ne]=L[Ne]});const Z=ne.toFiniteNumber(L.headers.get("content-length")),[I,de]=S&&tS(Z,Lf(nS(S),!0))||[];L=new r(iS(L.body,aS,I,()=>{de&&de(),q&&q()}),B)}z=z||"text";let M=await p[ne.findKey(p,z)||"text"](L,w);return!Y&&q&&q(),await new Promise((B,Z)=>{VC(B,Z,{data:M,headers:Jn.from(L.headers),status:L.status,statusText:L.statusText,config:w,request:R})})}catch(ae){throw q&&q(),ae&&ae.name==="TypeError"&&/Load failed|fetch/i.test(ae.message)?Object.assign(new it("Network Error",it.ERR_NETWORK,w,R),{cause:ae.cause||ae}):it.from(ae,ae&&ae.code,w,R)}}},sq=new Map,WC=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let l=o.length,u=l,d,f,h=sq;for(;u--;)d=o[u],f=h.get(d),f===void 0&&h.set(d,f=u?new Map:aq(t)),h=f;return f};WC();const py={http:SL,xhr:ZL,fetch:{get:WC}};ne.forEach(py,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const cS=e=>`- ${e}`,oq=e=>ne.isFunction(e)||e===null||e===!1,HC={getAdapter:(e,t)=>{e=ne.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let l=0;l<n;l++){r=e[l];let u;if(i=r,!oq(r)&&(i=py[(u=String(r)).toLowerCase()],i===void 0))throw new it(`Unknown adapter '${u}'`);if(i&&(ne.isFunction(i)||(i=i.get(t))))break;o[u||"#"+l]=i}if(!i){const l=Object.entries(o).map(([d,f])=>`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let u=n?l.length>1?`since :
|
||
`+l.map(cS).join(`
|
||
`):" "+cS(l[0]):"as no adapter specified";throw new it("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return i},adapters:py};function Zp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new vl(null,e)}function uS(e){return Zp(e),e.headers=Jn.from(e.headers),e.data=Jp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),HC.getAdapter(e.adapter||xu.adapter,e)(e).then(function(r){return Zp(e),r.data=Jp.call(e,e.transformResponse,r),r.headers=Jn.from(r.headers),r},function(r){return BC(r)||(Zp(e),r&&r.response&&(r.response.data=Jp.call(e,e.transformResponse,r.response),r.response.headers=Jn.from(r.response.headers))),Promise.reject(r)})}const KC="1.12.2",vm={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{vm[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const dS={};vm.transitional=function(t,n,r){function i(o,l){return"[Axios v"+KC+"] Transitional option '"+o+"'"+l+(r?". "+r:"")}return(o,l,u)=>{if(t===!1)throw new it(i(l," has been removed"+(n?" in "+n:"")),it.ERR_DEPRECATED);return n&&!dS[l]&&(dS[l]=!0,console.warn(i(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,l,u):!0}};vm.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function lq(e,t,n){if(typeof e!="object")throw new it("options must be an object",it.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],l=t[o];if(l){const u=e[o],d=u===void 0||l(u,o,e);if(d!==!0)throw new it("option "+o+" must be "+d,it.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new it("Unknown option "+o,it.ERR_BAD_OPTION)}}const yf={assertOptions:lq,validators:vm},oi=yf.validators;let Ts=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Z_,response:new Z_}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
||
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Bs(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&yf.assertOptions(r,{silentJSONParsing:oi.transitional(oi.boolean),forcedJSONParsing:oi.transitional(oi.boolean),clarifyTimeoutError:oi.transitional(oi.boolean)},!1),i!=null&&(ne.isFunction(i)?n.paramsSerializer={serialize:i}:yf.assertOptions(i,{encode:oi.function,serialize:oi.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),yf.assertOptions(n,{baseUrl:oi.spelling("baseURL"),withXsrfToken:oi.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&ne.merge(o.common,o[n.method]);o&&ne.forEach(["delete","get","head","post","put","patch","common"],w=>{delete o[w]}),n.headers=Jn.concat(l,o);const u=[];let d=!0;this.interceptors.request.forEach(function(_){typeof _.runWhen=="function"&&_.runWhen(n)===!1||(d=d&&_.synchronous,u.unshift(_.fulfilled,_.rejected))});const f=[];this.interceptors.response.forEach(function(_){f.push(_.fulfilled,_.rejected)});let h,p=0,g;if(!d){const w=[uS.bind(this),void 0];for(w.unshift(...u),w.push(...f),g=w.length,h=Promise.resolve(n);p<g;)h=h.then(w[p++],w[p++]);return h}g=u.length;let x=n;for(;p<g;){const w=u[p++],_=u[p++];try{x=w(x)}catch(N){_.call(this,N);break}}try{h=uS.call(this,x)}catch(w){return Promise.reject(w)}for(p=0,g=f.length;p<g;)h=h.then(f[p++],f[p++]);return h}getUri(t){t=Bs(this.defaults,t);const n=$C(t.baseURL,t.url,t.allowAbsoluteUrls);return qC(n,t.params,t.paramsSerializer)}};ne.forEach(["delete","get","head","options"],function(t){Ts.prototype[t]=function(n,r){return this.request(Bs(r||{},{method:t,url:n,data:(r||{}).data}))}});ne.forEach(["post","put","patch"],function(t){function n(r){return function(o,l,u){return this.request(Bs(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:l}))}}Ts.prototype[t]=n(),Ts.prototype[t+"Form"]=n(!0)});let cq=class GC{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const l=new Promise(u=>{r.subscribe(u),o=u}).then(i);return l.cancel=function(){r.unsubscribe(o)},l},t(function(o,l,u){r.reason||(r.reason=new vl(o,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new GC(function(i){t=i}),cancel:t}}};function uq(e){return function(n){return e.apply(null,n)}}function dq(e){return ne.isObject(e)&&e.isAxiosError===!0}const gy={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(gy).forEach(([e,t])=>{gy[t]=e});function QC(e){const t=new Ts(e),n=CC(Ts.prototype.request,t);return ne.extend(n,Ts.prototype,t,{allOwnKeys:!0}),ne.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return QC(Bs(e,i))},n}const Zt=QC(xu);Zt.Axios=Ts;Zt.CanceledError=vl;Zt.CancelToken=cq;Zt.isCancel=BC;Zt.VERSION=KC;Zt.toFormData=xm;Zt.AxiosError=it;Zt.Cancel=Zt.CanceledError;Zt.all=function(t){return Promise.all(t)};Zt.spread=uq;Zt.isAxiosError=dq;Zt.mergeConfig=Bs;Zt.AxiosHeaders=Jn;Zt.formToJSON=e=>zC(ne.isHTMLForm(e)?new FormData(e):e);Zt.getAdapter=HC.getAdapter;Zt.HttpStatusCode=gy;Zt.default=Zt;const{Axios:IJ,AxiosError:DJ,CanceledError:LJ,isCancel:qJ,CancelToken:FJ,VERSION:zJ,all:BJ,Cancel:VJ,isAxiosError:$J,spread:UJ,toFormData:WJ,AxiosHeaders:HJ,HttpStatusCode:KJ,formToJSON:GJ,getAdapter:QJ,mergeConfig:YJ}=Zt,fq=typeof window>"u",fS=!fq&&window.self!==window.top,eg=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),bn=[];for(let e=0;e<256;++e)bn.push((e+256).toString(16).slice(1));function mq(e,t=0){return(bn[e[t+0]]+bn[e[t+1]]+bn[e[t+2]]+bn[e[t+3]]+"-"+bn[e[t+4]]+bn[e[t+5]]+"-"+bn[e[t+6]]+bn[e[t+7]]+"-"+bn[e[t+8]]+bn[e[t+9]]+"-"+bn[e[t+10]]+bn[e[t+11]]+bn[e[t+12]]+bn[e[t+13]]+bn[e[t+14]]+bn[e[t+15]]).toLowerCase()}let tg;const hq=new Uint8Array(16);function pq(){if(!tg){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");tg=crypto.getRandomValues.bind(crypto)}return tg(hq)}const gq=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),mS={randomUUID:gq};function yq(e,t,n){var i;e=e||{};const r=e.random??((i=e.rng)==null?void 0:i.call(e))??pq();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,mq(r)}function xq(e,t,n){return mS.randomUUID&&!e?mS.randomUUID():yq(e)}class vq extends Error{constructor(t,n,r,i,o){super(t),this.name="Base44Error",this.status=n,this.code=r,this.data=i,this.originalError=o}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code,data:this.data}}}function Nc({baseURL:e,headers:t={},token:n,interceptResponses:r=!0,onError:i}){const o=Zt.create({baseURL:e,headers:{"Content-Type":"application/json",Accept:"application/json",...t}});return n&&(o.defaults.headers.common.Authorization=`Bearer ${n}`),o.interceptors.request.use(l=>{typeof window<"u"&&l.headers.set("X-Origin-URL",window.location.href);const u=xq();if(l.requestId=u,fS)try{window.parent.postMessage({type:"api-request-start",requestId:u,data:{url:e+l.url,method:l.method,body:l.data instanceof FormData?"[FormData object]":l.data}},"*")}catch{}return l}),r&&o.interceptors.response.use(l=>{var u;const d=(u=l.config)===null||u===void 0?void 0:u.requestId;try{fS&&d&&window.parent.postMessage({type:"api-request-end",requestId:d,data:{statusCode:l.status,response:l.data}},"*")}catch{}return l.data},l=>{var u,d,f,h,p,g,x,w;const _=((d=(u=l.response)===null||u===void 0?void 0:u.data)===null||d===void 0?void 0:d.message)||((h=(f=l.response)===null||f===void 0?void 0:f.data)===null||h===void 0?void 0:h.detail)||l.message,N=new vq(_,(p=l.response)===null||p===void 0?void 0:p.status,(x=(g=l.response)===null||g===void 0?void 0:g.data)===null||x===void 0?void 0:x.code,(w=l.response)===null||w===void 0?void 0:w.data,l);return i==null||i(N),Promise.reject(N)}),o}function hS(e){const{axios:t,appId:n,getSocket:r}=e;return new Proxy({},{get(i,o){if(!(typeof o!="string"||o==="then"||o.startsWith("_")))return wq(t,n,o,r)}})}function bq(e){var t;try{const n=JSON.parse(e);return{type:n.type,data:n.data,id:n.id||((t=n.data)===null||t===void 0?void 0:t.id),timestamp:n.timestamp||new Date().toISOString()}}catch(n){return console.warn("[Base44 SDK] Failed to parse realtime message:",n),null}}function wq(e,t,n,r){const i=`/apps/${t}/entities/${n}`;return{async list(o,l,u,d){const f={};return o&&(f.sort=o),l&&(f.limit=l),u&&(f.skip=u),d&&(f.fields=Array.isArray(d)?d.join(","):d),e.get(i,{params:f})},async filter(o,l,u,d,f){const h={q:JSON.stringify(o)};return l&&(h.sort=l),u&&(h.limit=u),d&&(h.skip=d),f&&(h.fields=Array.isArray(f)?f.join(","):f),e.get(i,{params:h})},async get(o){return e.get(`${i}/${o}`)},async create(o){return e.post(i,o)},async update(o,l){return e.put(`${i}/${o}`,l)},async delete(o){return e.delete(`${i}/${o}`)},async deleteMany(o){return e.delete(i,{data:o})},async bulkCreate(o){return e.post(`${i}/bulk`,o)},async updateMany(o,l){return e.patch(`${i}/update-many`,{query:o,data:l})},async bulkUpdate(o){return e.put(`${i}/bulk`,o)},async importEntities(o){const l=new FormData;return l.append("file",o,o.name),e.post(`${i}/import`,l,{headers:{"Content-Type":"multipart/form-data"}})},subscribe(o){const l=`entities:${t}:${n}`;return r().subscribeToRoom(l,{update_model:f=>{var h;const p=bq(f.data);if(p){p.type!=="delete"&&(!((h=p.data)===null||h===void 0)&&h._oversize)&&console.error(`[Base44 SDK] Realtime broadcast for ${n}#${p.id} was oversize and got slimmed for transport. Fields >10 KB are empty and the rest of the record may be a stub. Call \`entities.${n}.get("${p.id}")\` to fetch the full record.`);try{o(p)}catch(g){console.error("[Base44 SDK] Subscription callback error:",g)}}}})}}}function _q(e,t){return{async call(n,r,i){if(!(n!=null&&n.trim()))throw new Error("Integration slug is required and cannot be empty");if(!(r!=null&&r.trim()))throw new Error("Operation ID is required and cannot be empty");const{pathParams:o,queryParams:l,...u}=i??{},d={...u,...o&&{path_params:o},...l&&{query_params:l}};return await e.post(`/apps/${t}/integrations/custom/${n}/${r}`,d)}}}function pS(e,t){const n=_q(e,t);return new Proxy({},{get(r,i){if(!(typeof i!="string"||i==="then"||i.startsWith("_")))return i==="custom"?n:new Proxy({},{get(o,l){if(!(typeof l!="string"||l==="then"||l.startsWith("_")))return async u=>{if(typeof u=="string")throw new Error(`Integration ${l} must receive an object with named parameters, received: ${u}`);let d,f;return u instanceof FormData||u&&Object.values(u).some(h=>h instanceof File)?(d=new FormData,Object.keys(u).forEach(h=>{u[h]instanceof File?d.append(h,u[h],u[h].name):typeof u[h]=="object"&&u[h]!==null?d.append(h,JSON.stringify(u[h])):d.append(h,u[h])}),f="multipart/form-data"):(d=u,f="application/json"),i==="Core"?e.post(`/apps/${t}/integration-endpoints/Core/${l}`,d||u,{headers:{"Content-Type":f}}):e.post(`/apps/${t}/integration-endpoints/installable/${i}/integration-endpoints/${l}`,d||u,{headers:{"Content-Type":f}})}}})}})}function Sq(){return typeof window>"u"?!1:window!==window.parent}function jq(e,t,n){const o=Math.round(window.screenX+(window.outerWidth-500)/2),l=Math.round(window.screenY+(window.outerHeight-600)/2),u=window.open(e,"base44_auth",`width=500,height=600,left=${o},top=${l},resizable=yes,scrollbars=yes`);if(!u)return;const d=()=>{window.removeEventListener("message",f),clearInterval(h),u.closed||u.close()},f=p=>{var g;if(p.origin!==n||p.source!==u||!(!((g=p.data)===null||g===void 0)&&g.access_token))return;d();const x=new URL(t),{access_token:w,is_new_user:_}=p.data;x.searchParams.set("access_token",w),_!=null&&x.searchParams.set("is_new_user",String(_)),window.location.href=x.toString()},h=setInterval(()=>{u.closed&&d()},500);window.addEventListener("message",f)}function Nq(e,t,n,r){return{async me(){return e.get(`/apps/${n}/entities/User/me`)},async updateMe(i){return e.put(`/apps/${n}/entities/User/me`,i)},redirectToLogin(i){if(typeof window>"u")throw new Error("Login method can only be used in a browser environment");const o=i?new URL(i,window.location.origin).toString():window.location.href,l=`${r.appBaseUrl}/login?from_url=${encodeURIComponent(o)}`;window.location.href=l},loginWithProvider(i,o="/"){const l=new URL(o,window.location.origin).toString(),u=`app_id=${n}&from_url=${encodeURIComponent(l)}`;let d;i==="sso"?d=`/apps/${n}/auth/sso/login`:d=`/apps/auth${i==="google"?"":`/${i}`}/login`;const f=`${r.appBaseUrl}/api${d}?${u}`;if(Sq()){const h=`${f}&popup_origin=${encodeURIComponent(window.location.origin)}`;return jq(h,l,window.location.origin)}window.location.href=f},logout(i){if(delete e.defaults.headers.common.Authorization,typeof window<"u"){if(window.localStorage)try{window.localStorage.removeItem("base44_access_token"),window.localStorage.removeItem("token")}catch(u){console.error("Failed to remove token from localStorage:",u)}const o=i||window.location.href,l=`${r.appBaseUrl}/api/apps/auth/logout?from_url=${encodeURIComponent(o)}`;window.location.href=l}},setToken(i,o=!0){if(i&&(e.defaults.headers.common.Authorization=`Bearer ${i}`,t.defaults.headers.common.Authorization=`Bearer ${i}`,o&&typeof window<"u"&&window.localStorage))try{window.localStorage.setItem("base44_access_token",i),window.localStorage.setItem("token",i)}catch(l){console.error("Failed to save token to localStorage:",l)}},async loginViaEmailPassword(i,o,l){var u;try{const d=await e.post(`/apps/${n}/auth/login`,{email:i,password:o,...l&&{turnstile_token:l}}),{access_token:f,user:h}=d;return f&&this.setToken(f),{access_token:f,user:h}}catch(d){throw((u=d.response)===null||u===void 0?void 0:u.status)===401&&await this.logout(),d}},async isAuthenticated(){try{return await this.me(),!0}catch{return!1}},inviteUser(i,o){return e.post(`/apps/${n}/users/invite-user`,{user_email:i,role:o})},register(i){return e.post(`/apps/${n}/auth/register`,i)},verifyOtp({email:i,otpCode:o}){return e.post(`/apps/${n}/auth/verify-otp`,{email:i,otp_code:o})},resendOtp(i){return e.post(`/apps/${n}/auth/resend-otp`,{email:i})},resetPasswordRequest(i){return e.post(`/apps/${n}/auth/reset-password-request`,{email:i})},resetPassword({resetToken:i,newPassword:o}){return e.post(`/apps/${n}/auth/reset-password`,{reset_token:i,new_password:o})},changePassword({userId:i,currentPassword:o,newPassword:l}){return e.post(`/apps/${n}/auth/change-password`,{user_id:i,current_password:o,new_password:l})}}}function Cq(e,t){return{async getAccessToken(n){const r=`/apps/${t}/auth/sso/accesstoken/${n}`;return e.get(r)}}}function kq(e,t){return{async getAccessToken(n){if(!n||typeof n!="string")throw new Error("Integration type is required and must be a string");return(await e.get(`/apps/${t}/external-auth/tokens/${n}`)).access_token},async getConnection(n){var r;if(!n||typeof n!="string")throw new Error("Integration type is required and must be a string");const o=await e.get(`/apps/${t}/external-auth/tokens/${n}`);return{accessToken:o.access_token,connectionConfig:(r=o.connection_config)!==null&&r!==void 0?r:null}},async getCurrentAppUserAccessToken(n){if(!n||typeof n!="string")throw new Error("Connector ID is required and must be a string");return(await e.get(`/apps/${t}/app-user-auth/connectors/${n}/token`)).access_token},async getCurrentAppUserConnection(n){var r;if(!n||typeof n!="string")throw new Error("Connector ID is required and must be a string");const o=await e.get(`/apps/${t}/app-user-auth/connectors/${n}/token`);return{accessToken:o.access_token,connectionConfig:(r=o.connection_config)!==null&&r!==void 0?r:null}}}}function Pq(e,t){return{async connectAppUser(n){if(!n||typeof n!="string")throw new Error("Connector ID is required and must be a string");return(await e.post(`/apps/${t}/app-user-auth/connectors/${n}/initiate`)).redirect_url},async disconnectAppUser(n){if(!n||typeof n!="string")throw new Error("Connector ID is required and must be a string");await e.delete(`/apps/${t}/app-user-auth/connectors/${n}`)}}}function Wc(e={}){const{storageKey:t="base44_access_token",paramName:n="access_token",saveToStorage:r=!0,removeFromUrl:i=!0}=e;let o=null;if(typeof window<"u"&&window.location)try{const l=new URLSearchParams(window.location.search);if(o=l.get(n),o){if(r&&Eq(o,{storageKey:t}),i){l.delete(n);const u=`${window.location.pathname}${l.toString()?`?${l.toString()}`:""}${window.location.hash}`;window.history.replaceState({},document.title,u)}return o}}catch(l){console.error("Error retrieving token from URL:",l)}if(typeof window<"u"&&window.localStorage)try{return o=window.localStorage.getItem(t),o}catch(l){console.error("Error retrieving token from local storage:",l)}return null}function Eq(e,t){const{storageKey:n="base44_access_token"}=t;if(typeof window>"u"||!window.localStorage||!e)return!1;try{return window.localStorage.setItem(n,e),window.localStorage.setItem("token",e),!0}catch(r){return console.error("Error saving token to local storage:",r),!1}}function gS(e,t,n){const r=(o,l)=>o?`${String(o).replace(/\/$/,"")}${l}`:l,i=o=>{const l=new Headers;if(n!=null&&n.getAuthHeaders){const u=n.getAuthHeaders();Object.entries(u).forEach(([d,f])=>{f!=null&&l.set(d,String(f))})}return o&&new Headers(o).forEach((u,d)=>{l.set(d,u)}),l};return{async invoke(o,l){if(typeof l=="string")throw new Error(`Function ${o} must receive an object with named parameters, received: ${l}`);let u,d;return l instanceof FormData||l&&Object.values(l).some(f=>f instanceof File)?(u=new FormData,Object.keys(l).forEach(f=>{l[f]instanceof File?u.append(f,l[f],l[f].name):typeof l[f]=="object"&&l[f]!==null?u.append(f,JSON.stringify(l[f])):u.append(f,l[f])}),d="multipart/form-data"):(u=l,d="application/json"),e.post(`/apps/${t}/functions/${o}`,u||l,{headers:{"Content-Type":d}})},async fetch(o,l={}){const d=`/functions${o.startsWith("/")?o:`/${o}`}`,f=i(l.headers),h={...l,headers:f};return await fetch(r(n==null?void 0:n.baseURL,d),h)}}}function yS({axios:e,getSocket:t,appId:n,serverUrl:r,token:i}){const o=`/apps/${n}/agents`,l={},u=()=>e.get(`${o}/conversations`),d=_=>e.get(`${o}/conversations/${_}`);return{getConversations:u,getConversation:d,listConversations:_=>e.get(`${o}/conversations`,{params:_}),createConversation:_=>e.post(`${o}/conversations`,_),addMessage:async(_,N)=>e.post(`${o}/conversations/v2/${_.id}/messages`,N),subscribeToConversation:(_,N)=>{const C=`/agent-conversations/${_}`,k=t(),P=d(_).then(T=>(l[_]=T,T));return k.subscribeToRoom(C,{connect:()=>{},update_model:async({data:T})=>{const S=JSON.parse(T);if(S._message){await P;const E=S._message,z=l[_];if(z){const D=z.messages||[],K=D.findIndex(W=>W.id===E.id),U=K!==-1?D.map((W,G)=>G===K?E:W):[...D,E];l[_]={...z,messages:U},N==null||N(l[_])}}}})},getWhatsAppConnectURL:_=>{const N=`${r}/api/apps/${n}/agents/${encodeURIComponent(_)}/whatsapp`,C=i??Wc();return C?`${N}?token=${C}`:N},getTelegramConnectURL:_=>{const N=`${r}/api/apps/${n}/agents/${encodeURIComponent(_)}/telegram`,C=i??Wc();return C?`${N}?token=${C}`:N}}}function xS(e,t){const n=`/app-logs/${t}`;return{async logUserInApp(r){await e.post(`${n}/log-user-in-app/${r}`)},async fetchLogs(r={}){return await e.get(n,{params:r})},async getStats(r={}){return await e.get(`${n}/stats`,{params:r})}}}function Tq(e,t){return{async inviteUser(n,r){if(r!=="user"&&r!=="admin")throw new Error(`Invalid role: "${r}". Role must be either "user" or "admin".`);return await e.post(`/apps/${t}/runtime/users/invite-user`,{user_email:n,role:r})}}}const _i=Object.create(null);_i.open="0";_i.close="1";_i.ping="2";_i.pong="3";_i.message="4";_i.upgrade="5";_i.noop="6";const xf=Object.create(null);Object.keys(_i).forEach(e=>{xf[_i[e]]=e});const yy={type:"error",data:"parser error"},YC=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",XC=typeof ArrayBuffer=="function",JC=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,R0=({type:e,data:t},n,r)=>YC&&t instanceof Blob?n?r(t):vS(t,r):XC&&(t instanceof ArrayBuffer||JC(t))?n?r(t):vS(new Blob([t]),r):r(_i[e]+(t||"")),vS=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function bS(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let ng;function Aq(e,t){if(YC&&e.data instanceof Blob)return e.data.arrayBuffer().then(bS).then(t);if(XC&&(e.data instanceof ArrayBuffer||JC(e.data)))return t(bS(e.data));R0(e,!1,n=>{ng||(ng=new TextEncoder),t(ng.encode(n))})}const wS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cc=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<wS.length;e++)Cc[wS.charCodeAt(e)]=e;const Mq=e=>{let t=e.length*.75,n=e.length,r,i=0,o,l,u,d;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),h=new Uint8Array(f);for(r=0;r<n;r+=4)o=Cc[e.charCodeAt(r)],l=Cc[e.charCodeAt(r+1)],u=Cc[e.charCodeAt(r+2)],d=Cc[e.charCodeAt(r+3)],h[i++]=o<<2|l>>4,h[i++]=(l&15)<<4|u>>2,h[i++]=(u&3)<<6|d&63;return f},Rq=typeof ArrayBuffer=="function",O0=(e,t)=>{if(typeof e!="string")return{type:"message",data:ZC(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Oq(e.substring(1),t)}:xf[n]?e.length>1?{type:xf[n],data:e.substring(1)}:{type:xf[n]}:yy},Oq=(e,t)=>{if(Rq){const n=Mq(e);return ZC(n,t)}else return{base64:!0,data:e}},ZC=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},ek="",Iq=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,l)=>{R0(o,!1,u=>{r[l]=u,++i===n&&t(r.join(ek))})})},Dq=(e,t)=>{const n=e.split(ek),r=[];for(let i=0;i<n.length;i++){const o=O0(n[i],t);if(r.push(o),o.type==="error")break}return r};function Lq(){return new TransformStream({transform(e,t){Aq(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let rg;function Qd(e){return e.reduce((t,n)=>t+n.length,0)}function Yd(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function qq(e,t){rg||(rg=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(l,u){for(n.push(l);;){if(r===0){if(Qd(n)<1)break;const d=Yd(n,1);o=(d[0]&128)===128,i=d[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Qd(n)<2)break;const d=Yd(n,2);i=new DataView(d.buffer,d.byteOffset,d.length).getUint16(0),r=3}else if(r===2){if(Qd(n)<8)break;const d=Yd(n,8),f=new DataView(d.buffer,d.byteOffset,d.length),h=f.getUint32(0);if(h>Math.pow(2,21)-1){u.enqueue(yy);break}i=h*Math.pow(2,32)+f.getUint32(4),r=3}else{if(Qd(n)<i)break;const d=Yd(n,i);u.enqueue(O0(o?d:rg.decode(d),t)),r=0}if(i===0||i>e){u.enqueue(yy);break}}}})}const tk=4;function an(e){if(e)return Fq(e)}function Fq(e){for(var t in an.prototype)e[t]=an.prototype[t];return e}an.prototype.on=an.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};an.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};an.prototype.off=an.prototype.removeListener=an.prototype.removeAllListeners=an.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};an.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};an.prototype.emitReserved=an.prototype.emit;an.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};an.prototype.hasListeners=function(e){return!!this.listeners(e).length};const bm=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Ar=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),zq="arraybuffer";function nk(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Bq=Ar.setTimeout,Vq=Ar.clearTimeout;function wm(e,t){t.useNativeTimers?(e.setTimeoutFn=Bq.bind(Ar),e.clearTimeoutFn=Vq.bind(Ar)):(e.setTimeoutFn=Ar.setTimeout.bind(Ar),e.clearTimeoutFn=Ar.clearTimeout.bind(Ar))}const $q=1.33;function Uq(e){return typeof e=="string"?Wq(e):Math.ceil((e.byteLength||e.size)*$q)}function Wq(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function rk(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Hq(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Kq(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class Gq extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class I0 extends an{constructor(t){super(),this.writable=!1,wm(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Gq(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=O0(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Hq(t);return n.length?"?"+n:""}}class Qq extends I0{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Dq(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Iq(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=rk()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let ik=!1;try{ik=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Yq=ik;function Xq(){}class Jq extends Qq{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class yi extends an{constructor(t,n,r){super(),this.createRequest=t,wm(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=nk(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=yi.requestsCount++,yi.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Xq,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete yi.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}yi.requestsCount=0;yi.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",_S);else if(typeof addEventListener=="function"){const e="onpagehide"in Ar?"pagehide":"unload";addEventListener(e,_S,!1)}}function _S(){for(let e in yi.requests)yi.requests.hasOwnProperty(e)&&yi.requests[e].abort()}const Zq=(function(){const e=ak({xdomain:!1});return e&&e.responseType!==null})();class eF extends Jq{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Zq&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new yi(ak,this.uri(),t)}}function ak(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Yq))return new XMLHttpRequest}catch{}if(!t)try{return new Ar[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const sk=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class tF extends I0{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=sk?{}:nk(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;R0(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}i&&bm(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=rk()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const ig=Ar.WebSocket||Ar.MozWebSocket;class nF extends tF{createSocket(t,n,r){return sk?new ig(t,n,r):n?new ig(t,n):new ig(t)}doWrite(t,n){this.ws.send(n)}}class rF extends I0{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=qq(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=Lq();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const o=()=>{r.read().then(({done:u,value:d})=>{u||(this.onPacket(d),o())}).catch(u=>{})};o();const l={type:"open"};this.query.sid&&(l.data=`{"sid":"${this.query.sid}"}`),this._writer.write(l).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&bm(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const iF={websocket:nF,webtransport:rF,polling:eF},aF=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,sF=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function xy(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=aF.exec(e||""),o={},l=14;for(;l--;)o[sF[l]]=i[l]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=oF(o,o.path),o.queryKey=lF(o,o.query),o}function oF(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function lF(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}const vy=typeof addEventListener=="function"&&typeof removeEventListener=="function",vf=[];vy&&addEventListener("offline",()=>{vf.forEach(e=>e())},!1);class za extends an{constructor(t,n){if(super(),this.binaryType=zq,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=xy(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=xy(n.host).host);wm(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Kq(this.opts.query)),vy&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},vf.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=tk,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&za.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",za.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=Uq(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,bm(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(za.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),vy&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=vf.indexOf(this._offlineEventListener);r!==-1&&vf.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}za.protocol=tk;class cF extends za{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;za.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;za.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=n.name,this.emitReserved("upgradeError",g)}}))};function o(){r||(r=!0,h(),n.close(),n=null)}const l=p=>{const g=new Error("probe error: "+p);g.transport=n.name,o(),this.emitReserved("upgradeError",g)};function u(){l("transport closed")}function d(){l("socket closed")}function f(p){n&&p.name!==n.name&&o()}const h=()=>{n.removeListener("open",i),n.removeListener("error",l),n.removeListener("close",u),this.off("close",d),this.off("upgrading",f)};n.once("open",i),n.once("error",l),n.once("close",u),this.once("close",d),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let uF=class extends cF{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>iF[i]).filter(i=>!!i)),super(t,r)}};function dF(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=xy(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const fF=typeof ArrayBuffer=="function",mF=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,ok=Object.prototype.toString,hF=typeof Blob=="function"||typeof Blob<"u"&&ok.call(Blob)==="[object BlobConstructor]",pF=typeof File=="function"||typeof File<"u"&&ok.call(File)==="[object FileConstructor]";function D0(e){return fF&&(e instanceof ArrayBuffer||mF(e))||hF&&e instanceof Blob||pF&&e instanceof File}function bf(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(bf(e[n]))return!0;return!1}if(D0(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return bf(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&bf(e[n]))return!0;return!1}function gF(e){const t=[],n=e.data,r=e;return r.data=by(n,t),r.attachments=t.length,{packet:r,buffers:t}}function by(e,t){if(!e)return e;if(D0(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=by(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=by(e[r],t));return n}return e}function yF(e,t){return e.data=wy(e.data,t),delete e.attachments,e}function wy(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=wy(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=wy(e[n],t));return e}const xF=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],vF=5;var mt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(mt||(mt={}));class bF{constructor(t){this.replacer=t}encode(t){return(t.type===mt.EVENT||t.type===mt.ACK)&&bf(t)?this.encodeAsBinary({type:t.type===mt.EVENT?mt.BINARY_EVENT:mt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===mt.BINARY_EVENT||t.type===mt.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=gF(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function SS(e){return Object.prototype.toString.call(e)==="[object Object]"}class L0 extends an{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===mt.BINARY_EVENT;r||n.type===mt.BINARY_ACK?(n.type=r?mt.EVENT:mt.ACK,this.reconstructor=new wF(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(D0(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(mt[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===mt.BINARY_EVENT||r.type===mt.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const l=t.substring(o,n);if(l!=Number(l)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(l)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const l=t.charAt(n);if(l==null||Number(l)!=l){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(L0.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case mt.CONNECT:return SS(n);case mt.DISCONNECT:return n===void 0;case mt.CONNECT_ERROR:return typeof n=="string"||SS(n);case mt.EVENT:case mt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&xF.indexOf(n[0])===-1);case mt.ACK:case mt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class wF{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=yF(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const _F=Object.freeze(Object.defineProperty({__proto__:null,Decoder:L0,Encoder:bF,get PacketType(){return mt},protocol:vF},Symbol.toStringTag,{value:"Module"}));function Gr(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const SF=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class lk extends an{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Gr(t,"open",this.onopen.bind(this)),Gr(t,"packet",this.onpacket.bind(this)),Gr(t,"error",this.onerror.bind(this)),Gr(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,o;if(SF.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const l={type:mt.EVENT,data:n};if(l.options={},l.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const h=this.ids++,p=n.pop();this._registerAckCallback(h,p),l.id=h}const u=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,d=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!u||(d?(this.notifyOutgoingListeners(l),this.packet(l)):this.sendBuffer.push(l)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let u=0;u<this.sendBuffer.length;u++)this.sendBuffer[u].id===t&&this.sendBuffer.splice(u,1);n.call(this,new Error("operation has timed out"))},i),l=(...u)=>{this.io.clearTimeoutFn(o),n.apply(this,u)};l.withError=!0,this.acks[t]=l}emitWithAck(t,...n){return new Promise((r,i)=>{const o=(l,u)=>l?i(l):r(u);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:mt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case mt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case mt.EVENT:case mt.BINARY_EVENT:this.onevent(t);break;case mt.ACK:case mt.BINARY_ACK:this.onack(t);break;case mt.DISCONNECT:this.ondisconnect();break;case mt.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:mt.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:mt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function bl(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}bl.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};bl.prototype.reset=function(){this.attempts=0};bl.prototype.setMin=function(e){this.ms=e};bl.prototype.setMax=function(e){this.max=e};bl.prototype.setJitter=function(e){this.jitter=e};class _y extends an{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,wm(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new bl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||_F;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new uF(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Gr(n,"open",function(){r.onopen(),t&&t()}),o=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),t?t(u):this.maybeReconnectOnOpen()},l=Gr(n,"error",o);if(this._timeout!==!1){const u=this._timeout,d=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},u);this.opts.autoUnref&&d.unref(),this.subs.push(()=>{this.clearTimeoutFn(d)})}return this.subs.push(i),this.subs.push(l),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Gr(t,"ping",this.onping.bind(this)),Gr(t,"data",this.ondata.bind(this)),Gr(t,"error",this.onerror.bind(this)),Gr(t,"close",this.onclose.bind(this)),Gr(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){bm(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new lk(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const hc={};function wf(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=dF(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,l=hc[i]&&o in hc[i].nsps,u=t.forceNew||t["force new connection"]||t.multiplex===!1||l;let d;return u?d=new _y(r,t):(hc[i]||(hc[i]=new _y(r,t)),d=hc[i]),n.query&&!t.query&&(t.query=n.queryKey),d.socket(n.path,t)}Object.assign(wf,{Manager:_y,Socket:lk,io:wf,connect:wf});function jS(e,t){var n;const r=wf(e.serverUrl,{path:e.mountPath,transports:e.transports,query:{app_id:e.appId,token:(n=e.token)!==null&&n!==void 0?n:Wc()}});return r.on("connect",async()=>{var i;return console.log("connect",r.id),(i=t.connect)===null||i===void 0?void 0:i.call(t)}),r.on("update_model",async i=>{var o;return(o=t.update_model)===null||o===void 0?void 0:o.call(t,i)}),r.on("error",async i=>{var o;return(o=t.error)===null||o===void 0?void 0:o.call(t,i)}),r.on("connect_error",async i=>{var o;return console.error("connect_error",i),(o=t.error)===null||o===void 0?void 0:o.call(t,i)}),r}function jF({config:e}){let t={...e};const n={},r={connect:async()=>{const x=[];Object.keys(n).forEach(w=>{d(w);const _=p(w);_==null||_.forEach(({connect:N})=>{const C=async()=>N==null?void 0:N();x.push(C())})}),await Promise.all(x)},update_model:async x=>{const _=p(x.room).map(N=>{var C;return(C=N.update_model)===null||C===void 0?void 0:C.call(N,x)});await Promise.all(_)},error:async x=>{console.error("error",x);const w=Object.values(n).flat().map(_=>{var N;return(N=_.error)===null||N===void 0?void 0:N.call(_,x)});await Promise.all(w)}};let i=jS(e,r);function o(){l()}function l(){i&&i.disconnect()}function u(x){o(),t={...t,...x},i=jS(t,r)}function d(x){i.emit("join",x)}function f(x){i.emit("leave",x)}async function h(x,w){var _;const N=JSON.stringify(w);return(_=r.update_model)===null||_===void 0?void 0:_.call(r,{room:x,data:N})}function p(x){var w;return(w=n[x])!==null&&w!==void 0?w:[]}return{socket:i,subscribeToRoom:(x,w)=>{n[x]||(d(x),n[x]=[]),n[x].push(w);let _=!1;return()=>{var N,C;_||(_=!0,n[x]=(C=(N=n[x])===null||N===void 0?void 0:N.filter(k=>k!==w))!==null&&C!==void 0?C:[],n[x].length===0&&(f(x),delete n[x]))}},updateConfig:u,updateModel:h,disconnect:l}}const pc=typeof window<"u"?window:{base44SharedInstances:{}};function NF(e,t){return pc.base44SharedInstances||(pc.base44SharedInstances={}),pc.base44SharedInstances[e]||(pc.base44SharedInstances[e]={instance:t()}),pc.base44SharedInstances[e].instance}const CF="__user_heartbeat_event__",kF="__initialization_event__",PF="__session_duration_event__",NS="analytics-enable",CS="base44_analytics_session_id",EF={enabled:!0,maxQueueSize:1e3,throttleTime:1e3,batchSize:30,heartBeatInterval:60*1e3},TF="analytics",kt=NF(TF,()=>({requestsQueue:[],isProcessing:!1,isHeartBeatProcessing:!1,wasInitializationTracked:!1,sessionContext:null,sessionStartTime:null,config:{...EF,...qF()}})),AF=({axiosClient:e,serverUrl:t,appId:n,userAuthModule:r})=>{var i;const{maxQueueSize:o,throttleTime:l,batchSize:u}=kt.config;if(!(!((i=kt.config)===null||i===void 0)&&i.enabled))return{track:()=>{},cleanup:()=>{}};let d;const f=`${t}/api/apps/${n}/analytics/track/batch`,h=async P=>{await e.request({method:"POST",url:`/apps/${n}/analytics/track/batch`,data:{events:P}})},p=P=>{try{const T=JSON.stringify({events:P}),S=new Blob([T],{type:"application/json"});return typeof navigator>"u"||T.length>6e4||!navigator.sendBeacon(f,S)}catch{return!1}},g=async(P,T={})=>{if(P.length===0)return;const S=await LF(r),E=P.map(DF(S));try{(!T.isBeacon||!p(E))&&await h(E)}catch{}},x=()=>{PS(g,{throttleTime:l,batchSize:u})},w=P=>{if(kt.requestsQueue.length>=o)return;const T=IF();kt.requestsQueue.push({...P,...T}),x()},_=()=>{PS(g,{throttleTime:l,batchSize:u}),d=ES(w),RF()},N=()=>{kS(),d==null||d(),OF(w);const P=kt.requestsQueue.splice(0);g(P,{isBeacon:!0})},C=()=>{typeof window>"u"||(document.visibilityState==="hidden"?N():document.visibilityState==="visible"&&_())},k=()=>{kS(),d==null||d(),typeof window<"u"&&window.removeEventListener("visibilitychange",C)};return x(),d=ES(w),MF(w),typeof window<"u"&&window.addEventListener("visibilitychange",C),{track:w,cleanup:k}};function kS(){kt.isProcessing=!1}async function PS(e,t){if(kt.isProcessing)return;kt.isProcessing=!0;const{throttleTime:n=1e3,batchSize:r=30}=t??{};for(;kt.isProcessing&&kt.requestsQueue.length>0;){const i=kt.requestsQueue.splice(0,r);i.length&&await e(i),await new Promise(o=>setTimeout(o,n))}kt.isProcessing=!1}function ES(e){var t;if(kt.isHeartBeatProcessing||((t=kt.config.heartBeatInterval)!==null&&t!==void 0?t:0)<10)return()=>{};kt.isHeartBeatProcessing=!0;const n=setInterval(()=>{e({eventName:CF})},kt.config.heartBeatInterval);return()=>{clearInterval(n),kt.isHeartBeatProcessing=!1}}function MF(e){typeof window>"u"||kt.wasInitializationTracked||(kt.wasInitializationTracked=!0,e({eventName:kF,properties:{referrer:document==null?void 0:document.referrer}}))}function RF(){typeof window>"u"||kt.sessionStartTime!==null||(kt.sessionStartTime=new Date().toISOString())}function OF(e){if(typeof window>"u"||kt.sessionStartTime===null)return;const t=new Date().getTime()-new Date(kt.sessionStartTime).getTime();kt.sessionStartTime=null,e({eventName:PF,properties:{sessionDuration:t}})}function IF(){return{timestamp:new Date().toISOString(),pageUrl:typeof window<"u"?window.location.pathname:null}}function DF(e){return t=>({event_name:t.eventName,properties:t.properties,timestamp:t.timestamp,page_url:t.pageUrl,...e})}let ag=null;async function LF(e){if(!kt.sessionContext){if(!ag){const t=FF();ag=e.me().then(n=>({user_id:n.id,session_id:t})).catch(()=>({user_id:null,session_id:t}))}kt.sessionContext=await ag}return kt.sessionContext}function qF(){if(typeof window>"u")return;const t=new URLSearchParams(window.location.search).get(NS);if(t==null||!t.length)return;const n=new URLSearchParams(window.location.search);n.delete(NS);const r=window.location.pathname+(n.toString()?"?"+n.toString():"");return window.history.replaceState({},"",r),{enabled:t==="true"}}function FF(){if(typeof window>"u")return eg();try{const e=localStorage.getItem(CS);if(!e){const t=eg();return localStorage.setItem(CS,t),t}return e}catch{return eg()}}function zF(e){var t,n;const{serverUrl:r="https://base44.app",appId:i,token:o,serviceToken:l,requiresAuth:u=!1,appBaseUrl:d,options:f,functionsVersion:h,headers:p}=e,g=typeof d=="string"?d:"",x={serverUrl:r,mountPath:"/ws-user-apps/socket.io/",transports:["websocket"],appId:i,token:o};let w=null;const _=()=>(w||(w=jF({config:x})),w),N={...p,"X-App-Id":String(i)},C=h?{...N,"Base44-Functions-Version":h}:N,k=Nc({baseURL:`${r}/api`,headers:N,token:o,onError:f==null?void 0:f.onError}),P=Nc({baseURL:`${r}/api`,headers:C,token:o,interceptResponses:!1,onError:f==null?void 0:f.onError}),T={...N,...o?{"on-behalf-of":`Bearer ${o}`}:{}},S=Nc({baseURL:`${r}/api`,headers:T,token:l,onError:f==null?void 0:f.onError}),E=Nc({baseURL:`${r}/api`,headers:C,token:l,interceptResponses:!1}),z=Nq(k,P,i,{appBaseUrl:g});if(typeof window<"u"){const W=o||Wc();W&&z.setToken(W)}const D={entities:hS({axios:k,appId:i,getSocket:_}),integrations:pS(k,i),connectors:Pq(k,i),auth:z,functions:gS(P,i,{getAuthHeaders:()=>{const W={},G=o||Wc();return G&&(W.Authorization=`Bearer ${G}`),W},baseURL:(t=P.defaults)===null||t===void 0?void 0:t.baseURL}),agents:yS({axios:k,getSocket:_,appId:i,serverUrl:r,token:o}),appLogs:xS(k,i),users:Tq(k,i),analytics:AF({axiosClient:k,serverUrl:r,appId:i,userAuthModule:z}),cleanup:()=>{D.analytics.cleanup(),w&&w.disconnect()}},K={entities:hS({axios:S,appId:i,getSocket:_}),integrations:pS(S,i),sso:Cq(S,i),connectors:kq(S,i),functions:gS(E,i,{getAuthHeaders:()=>{const W={};return l&&(W.Authorization=`Bearer ${l}`),W},baseURL:(n=E.defaults)===null||n===void 0?void 0:n.baseURL}),agents:yS({axios:S,getSocket:_,appId:i,serverUrl:r,token:o}),appLogs:xS(S,i),cleanup:()=>{w&&w.disconnect()}};return u&&typeof window<"u"&&setTimeout(async()=>{try{await D.auth.isAuthenticated()||D.auth.redirectToLogin(window.location.href)}catch(W){console.error("Authentication check failed:",W),D.auth.redirectToLogin(window.location.href)}},0),{...D,setToken(W){D.auth.setToken(W),w&&w.updateConfig({token:W}),x.token=W},getConfig(){return{serverUrl:r,appId:i,requiresAuth:u}},get asServiceRole(){if(!l)throw new Error("Service token is required to use asServiceRole. Please provide a serviceToken when creating the client.");return K}}}const ck=typeof window>"u",BF=ck?{localStorage:new Map}:window,Oc=BF.localStorage,VF=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase(),ko=(e,{defaultValue:t=void 0,removeFromUrl:n=!1}={})=>{if(ck)return t;const r=`base44_${VF(e)}`,i=new URLSearchParams(window.location.search),o=i.get(e);if(n){i.delete(e);const u=`${window.location.pathname}${i.toString()?`?${i.toString()}`:""}${window.location.hash}`;window.history.replaceState({},document.title,u)}if(o)return Oc.setItem(r,o),o;if(t)return Oc.setItem(r,t),t;const l=Oc.getItem(r);return l||null},$F=()=>(ko("clear_access_token")==="true"&&(Oc.removeItem("base44_access_token"),Oc.removeItem("token")),{appId:ko("app_id",{defaultValue:"695be2905c0b4866dfb21265"}),token:ko("access_token",{removeFromUrl:!0}),fromUrl:ko("from_url",{defaultValue:window.location.href}),functionsVersion:ko("functions_version",{defaultValue:"prod"}),appBaseUrl:ko("app_base_url",{defaultValue:void 0})}),kc={...$F()},{appId:UF,token:WF,functionsVersion:HF,appBaseUrl:KF}=kc,O=zF({appId:UF,token:WF,functionsVersion:HF,serverUrl:"",requiresAuth:!1,appBaseUrl:KF}),uk=v.createContext(),GF=({children:e})=>{const[t,n]=v.useState(null),[r,i]=v.useState(!1),[o,l]=v.useState(!0),[u,d]=v.useState(!0),[f,h]=v.useState(null),[p,g]=v.useState(null);v.useEffect(()=>{x()},[]);const x=async()=>{var C,k;try{d(!0),h(null);const P=Nc({baseURL:"/api/apps/public",headers:{"X-App-Id":kc.appId},token:kc.token,interceptResponses:!0});try{const T=await P.get(`/prod/public-settings/by-id/${kc.appId}`);g(T),kc.token?await w():(l(!1),i(!1)),d(!1)}catch(T){if(console.error("App state check failed:",T),T.status===403&&((k=(C=T.data)==null?void 0:C.extra_data)!=null&&k.reason)){const S=T.data.extra_data.reason;h(S==="auth_required"?{type:"auth_required",message:"Authentication required"}:S==="user_not_registered"?{type:"user_not_registered",message:"User not registered for this app"}:{type:S,message:T.message})}else h({type:"unknown",message:T.message||"Failed to load app"});d(!1),l(!1)}}catch(P){console.error("Unexpected error:",P),h({type:"unknown",message:P.message||"An unexpected error occurred"}),d(!1),l(!1)}},w=async()=>{try{l(!0);const C=await O.auth.me();n(C),i(!0),l(!1)}catch(C){console.error("User auth check failed:",C),l(!1),i(!1),(C.status===401||C.status===403)&&h({type:"auth_required",message:"Authentication required"})}},_=(C=!0)=>{n(null),i(!1),C?O.auth.logout(window.location.href):O.auth.logout()},N=()=>{O.auth.redirectToLogin(window.location.href)};return a.jsx(uk.Provider,{value:{user:t,isAuthenticated:r,isLoadingAuth:o,isLoadingPublicSettings:u,authError:f,appPublicSettings:p,logout:_,navigateToLogin:N,checkAppState:x},children:e})},dk=()=>{const e=v.useContext(uk);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e};function TS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _m(...e){return t=>{let n=!1;const r=e.map(i=>{const o=TS(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():TS(e[i],null)}}}}function ct(...e){return v.useCallback(_m(...e),e)}function Vs(e){const t=YF(e),n=v.forwardRef((r,i)=>{const{children:o,...l}=r,u=v.Children.toArray(o),d=u.find(XF);if(d){const f=d.props.children,h=u.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return a.jsx(t,{...l,ref:i,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return a.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var QF=Vs("Slot");function YF(e){const t=v.forwardRef((n,r)=>{const{children:i,...o}=n;if(v.isValidElement(i)){const l=ZF(i),u=JF(o,i.props);return i.type!==v.Fragment&&(u.ref=r?_m(r,l):l),v.cloneElement(i,u)}return v.Children.count(i)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fk=Symbol("radix.slottable");function mk(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=fk,t}function XF(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fk}function JF(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...u)=>{const d=o(...u);return i(...u),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function ZF(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const q0=uu("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),oe=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const l=r?QF:"button";return a.jsx(l,{className:Fe(q0({variant:t,size:n,className:e})),ref:o,...i})});oe.displayName="Button";const e3=uu("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function zt({className:e,variant:t,...n}){return a.jsx("div",{className:Fe(e3({variant:t}),e),...n})}const Be=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Fe("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Be.displayName="Card";const vt=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Fe("flex flex-col space-y-1.5 p-6",e),...t}));vt.displayName="CardHeader";const wt=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Fe("font-semibold leading-none tracking-tight",e),...t}));wt.displayName="CardTitle";const mi=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Fe("text-sm text-muted-foreground",e),...t}));mi.displayName="CardDescription";const $e=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Fe("p-6 pt-0",e),...t}));$e.displayName="CardContent";const t3=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Fe("flex items-center p-6 pt-0",e),...t}));t3.displayName="CardFooter";function Ce(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function n3(e,t){const n=v.createContext(t),r=o=>{const{children:l,...u}=o,d=v.useMemo(()=>u,Object.values(u));return a.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function i(o){const l=v.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function vr(e,t=[]){let n=[];function r(o,l){const u=v.createContext(l),d=n.length;n=[...n,l];const f=p=>{var C;const{scope:g,children:x,...w}=p,_=((C=g==null?void 0:g[e])==null?void 0:C[d])||u,N=v.useMemo(()=>w,Object.values(w));return a.jsx(_.Provider,{value:N,children:x})};f.displayName=o+"Provider";function h(p,g){var _;const x=((_=g==null?void 0:g[e])==null?void 0:_[d])||u,w=v.useContext(x);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[f,h]}const i=()=>{const o=n.map(l=>v.createContext(l));return function(u){const d=(u==null?void 0:u[e])||o;return v.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return i.scopeName=e,[r,r3(i,...t)]}function r3(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const p=d(o)[`__scope${f}`];return{...u,...p}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function F0(e){const t=e+"CollectionProvider",[n,r]=vr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=_=>{const{scope:N,children:C}=_,k=Tn.useRef(null),P=Tn.useRef(new Map).current;return a.jsx(i,{scope:N,itemMap:P,collectionRef:k,children:C})};l.displayName=t;const u=e+"CollectionSlot",d=Vs(u),f=Tn.forwardRef((_,N)=>{const{scope:C,children:k}=_,P=o(u,C),T=ct(N,P.collectionRef);return a.jsx(d,{ref:T,children:k})});f.displayName=u;const h=e+"CollectionItemSlot",p="data-radix-collection-item",g=Vs(h),x=Tn.forwardRef((_,N)=>{const{scope:C,children:k,...P}=_,T=Tn.useRef(null),S=ct(N,T),E=o(h,C);return Tn.useEffect(()=>(E.itemMap.set(T,{ref:T,...P}),()=>void E.itemMap.delete(T))),a.jsx(g,{[p]:"",ref:S,children:k})});x.displayName=h;function w(_){const N=o(e+"CollectionConsumer",_);return Tn.useCallback(()=>{const k=N.collectionRef.current;if(!k)return[];const P=Array.from(k.querySelectorAll(`[${p}]`));return Array.from(N.itemMap.values()).sort((E,z)=>P.indexOf(E.ref.current)-P.indexOf(z.ref.current))},[N.collectionRef,N.itemMap])}return[{Provider:l,Slot:f,ItemSlot:x},w,r]}var jn=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},i3=p0[" useId ".trim().toString()]||(()=>{}),a3=0;function Qr(e){const[t,n]=v.useState(i3());return jn(()=>{n(r=>r??String(a3++))},[e]),t?`radix-${t}`:""}var s3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xe=s3.reduce((e,t)=>{const n=Vs(`Primitive.${t}`),r=v.forwardRef((i,o)=>{const{asChild:l,...u}=i,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function hk(e,t){e&&mu.flushSync(()=>e.dispatchEvent(t))}function _n(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var o3=p0[" useInsertionEffect ".trim().toString()]||jn;function Va({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=l3({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:i;{const h=v.useRef(e!==void 0);v.useEffect(()=>{const p=h.current;p!==u&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=u},[u,r])}const f=v.useCallback(h=>{var p;if(u){const g=c3(h)?h(e):h;g!==e&&((p=l.current)==null||p.call(l,g))}else o(h)},[u,e,o,l]);return[d,f]}function l3({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),i=v.useRef(n),o=v.useRef(t);return o3(()=>{o.current=t},[t]),v.useEffect(()=>{var l;i.current!==n&&((l=o.current)==null||l.call(o,n),i.current=n)},[n,i]),[n,r,o]}function c3(e){return typeof e=="function"}var u3=v.createContext(void 0);function vu(e){const t=v.useContext(u3);return e||t||"ltr"}var sg="rovingFocusGroup.onEntryFocus",d3={bubbles:!1,cancelable:!0},bu="RovingFocusGroup",[Sy,pk,f3]=F0(bu),[m3,Sm]=vr(bu,[f3]),[h3,p3]=m3(bu),gk=v.forwardRef((e,t)=>a.jsx(Sy.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Sy.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(g3,{...e,ref:t})})}));gk.displayName=bu;var g3=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...p}=e,g=v.useRef(null),x=ct(t,g),w=vu(o),[_,N]=Va({prop:l,defaultProp:u??null,onChange:d,caller:bu}),[C,k]=v.useState(!1),P=_n(f),T=pk(n),S=v.useRef(!1),[E,z]=v.useState(0);return v.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(sg,P),()=>D.removeEventListener(sg,P)},[P]),a.jsx(h3,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:_,onItemFocus:v.useCallback(D=>N(D),[N]),onItemShiftTab:v.useCallback(()=>k(!0),[]),onFocusableItemAdd:v.useCallback(()=>z(D=>D+1),[]),onFocusableItemRemove:v.useCallback(()=>z(D=>D-1),[]),children:a.jsx(Xe.div,{tabIndex:C||E===0?-1:0,"data-orientation":r,...p,ref:x,style:{outline:"none",...e.style},onMouseDown:Ce(e.onMouseDown,()=>{S.current=!0}),onFocus:Ce(e.onFocus,D=>{const K=!S.current;if(D.target===D.currentTarget&&K&&!C){const U=new CustomEvent(sg,d3);if(D.currentTarget.dispatchEvent(U),!U.defaultPrevented){const W=T().filter(ae=>ae.focusable),G=W.find(ae=>ae.active),R=W.find(ae=>ae.id===_),J=[G,R,...W].filter(Boolean).map(ae=>ae.ref.current);vk(J,h)}}S.current=!1}),onBlur:Ce(e.onBlur,()=>k(!1))})})}),yk="RovingFocusGroupItem",xk=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...u}=e,d=Qr(),f=o||d,h=p3(yk,n),p=h.currentTabStopId===f,g=pk(n),{onFocusableItemAdd:x,onFocusableItemRemove:w,currentTabStopId:_}=h;return v.useEffect(()=>{if(r)return x(),()=>w()},[r,x,w]),a.jsx(Sy.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:a.jsx(Xe.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...u,ref:t,onMouseDown:Ce(e.onMouseDown,N=>{r?h.onItemFocus(f):N.preventDefault()}),onFocus:Ce(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Ce(e.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){h.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const C=v3(N,h.orientation,h.dir);if(C!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let P=g().filter(T=>T.focusable).map(T=>T.ref.current);if(C==="last")P.reverse();else if(C==="prev"||C==="next"){C==="prev"&&P.reverse();const T=P.indexOf(N.currentTarget);P=h.loop?b3(P,T+1):P.slice(T+1)}setTimeout(()=>vk(P))}}),children:typeof l=="function"?l({isCurrentTabStop:p,hasTabStop:_!=null}):l})})});xk.displayName=yk;var y3={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function x3(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function v3(e,t,n){const r=x3(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return y3[r]}function vk(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function b3(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var bk=gk,wk=xk;function w3(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Fn=e=>{const{present:t,children:n}=e,r=_3(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=ct(r.ref,S3(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};Fn.displayName="Presence";function _3(e){const[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),o=v.useRef("none"),l=e?"mounted":"unmounted",[u,d]=w3(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const f=Xd(r.current);o.current=u==="mounted"?f:"none"},[u]),jn(()=>{const f=r.current,h=i.current;if(h!==e){const g=o.current,x=Xd(f);e?d("MOUNT"):x==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(h&&g!==x?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),jn(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=x=>{const _=Xd(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&_&&(d("ANIMATION_END"),!i.current)){const N=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=N)})}},g=x=>{x.target===t&&(o.current=Xd(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:v.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Xd(e){return(e==null?void 0:e.animationName)||"none"}function S3(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jm="Tabs",[j3]=vr(jm,[Sm]),_k=Sm(),[N3,z0]=j3(jm),Sk=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:u,activationMode:d="automatic",...f}=e,h=vu(u),[p,g]=Va({prop:r,onChange:i,defaultProp:o??"",caller:jm});return a.jsx(N3,{scope:n,baseId:Qr(),value:p,onValueChange:g,orientation:l,dir:h,activationMode:d,children:a.jsx(Xe.div,{dir:h,"data-orientation":l,...f,ref:t})})});Sk.displayName=jm;var jk="TabsList",Nk=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=z0(jk,n),l=_k(n);return a.jsx(bk,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:a.jsx(Xe.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});Nk.displayName=jk;var Ck="TabsTrigger",kk=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=z0(Ck,n),u=_k(n),d=Tk(l.baseId,r),f=Ak(l.baseId,r),h=r===l.value;return a.jsx(wk,{asChild:!0,...u,focusable:!i,active:h,children:a.jsx(Xe.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:d,...o,ref:t,onMouseDown:Ce(e.onMouseDown,p=>{!i&&p.button===0&&p.ctrlKey===!1?l.onValueChange(r):p.preventDefault()}),onKeyDown:Ce(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&l.onValueChange(r)}),onFocus:Ce(e.onFocus,()=>{const p=l.activationMode!=="manual";!h&&!i&&p&&l.onValueChange(r)})})})});kk.displayName=Ck;var Pk="TabsContent",Ek=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,u=z0(Pk,n),d=Tk(u.baseId,r),f=Ak(u.baseId,r),h=r===u.value,p=v.useRef(h);return v.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),a.jsx(Fn,{present:i||h,children:({present:g})=>a.jsx(Xe.div,{"data-state":h?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&o})})});Ek.displayName=Pk;function Tk(e,t){return`${e}-trigger-${t}`}function Ak(e,t){return`${e}-content-${t}`}var C3=Sk,Mk=Nk,Rk=kk,Ok=Ek;const Qi=C3,Si=v.forwardRef(({className:e,...t},n)=>a.jsx(Mk,{ref:n,className:Fe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Si.displayName=Mk.displayName;const ht=v.forwardRef(({className:e,...t},n)=>a.jsx(Rk,{ref:n,className:Fe("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));ht.displayName=Rk.displayName;const sn=v.forwardRef(({className:e,...t},n)=>a.jsx(Ok,{ref:n,className:Fe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));sn.displayName=Ok.displayName;var B0="Progress",V0=100,[k3]=vr(B0),[P3,E3]=k3(B0),Ik=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:o=T3,...l}=e;(i||i===0)&&!AS(i)&&console.error(A3(`${i}`,"Progress"));const u=AS(i)?i:V0;r!==null&&!MS(r,u)&&console.error(M3(`${r}`,"Progress"));const d=MS(r,u)?r:null,f=qf(d)?o(d,u):void 0;return a.jsx(P3,{scope:n,value:d,max:u,children:a.jsx(Xe.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":qf(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":qk(d,u),"data-value":d??void 0,"data-max":u,...l,ref:t})})});Ik.displayName=B0;var Dk="ProgressIndicator",Lk=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=E3(Dk,n);return a.jsx(Xe.div,{"data-state":qk(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});Lk.displayName=Dk;function T3(e,t){return`${Math.round(e/t*100)}%`}function qk(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function qf(e){return typeof e=="number"}function AS(e){return qf(e)&&!isNaN(e)&&e>0}function MS(e,t){return qf(e)&&!isNaN(e)&&e<=t&&e>=0}function A3(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${V0}\`.`}function M3(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
||
- a positive number
|
||
- less than the value passed to \`max\` (or ${V0} if no \`max\` prop is set)
|
||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||
|
||
Defaulting to \`null\`.`}var Fk=Ik,R3=Lk;const O3=v.forwardRef(({className:e,value:t,...n},r)=>a.jsx(Fk,{ref:r,className:Fe("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:a.jsx(R3,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));O3.displayName=Fk.displayName;function nt(e){return"/"+e.replace(/ /g,"-")}const Nm=v.createContext(null);function $0(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const U0=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class I3 extends v.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function D3({children:e,isPresent:t}){const n=v.useId(),r=v.useRef(null),i=v.useRef({width:0,height:0,top:0,left:0}),{nonce:o}=v.useContext(U0);return v.useInsertionEffect(()=>{const{width:l,height:u,top:d,left:f}=i.current;if(t||!r.current||!l||!u)return;r.current.dataset.motionPopId=n;const h=document.createElement("style");return o&&(h.nonce=o),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`
|
||
[data-motion-pop-id="${n}"] {
|
||
position: absolute !important;
|
||
width: ${l}px !important;
|
||
height: ${u}px !important;
|
||
top: ${d}px !important;
|
||
left: ${f}px !important;
|
||
}
|
||
`),()=>{document.head.removeChild(h)}},[t]),a.jsx(I3,{isPresent:t,childRef:r,sizeRef:i,children:v.cloneElement(e,{ref:r})})}const L3=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:l})=>{const u=$0(q3),d=v.useId(),f=v.useCallback(p=>{u.set(p,!0);for(const g of u.values())if(!g)return;r&&r()},[u,r]),h=v.useMemo(()=>({id:d,initial:t,isPresent:n,custom:i,onExitComplete:f,register:p=>(u.set(p,!1),()=>u.delete(p))}),o?[Math.random(),f]:[n,f]);return v.useMemo(()=>{u.forEach((p,g)=>u.set(g,!1))},[n]),v.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),l==="popLayout"&&(e=a.jsx(D3,{isPresent:n,children:e})),a.jsx(Nm.Provider,{value:h,children:e})};function q3(){return new Map}const W0=v.createContext({}),hr=e=>e;let zk=hr;function H0(e){let t;return()=>(t===void 0&&(t=e()),t)}const sl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Wi=e=>e*1e3,Hi=e=>e/1e3,Jd=e=>e.key||"";function RS(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const K0=typeof window<"u",Bk=K0?v.useLayoutEffect:v.useEffect,Cm=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:o=!0,mode:l="sync"})=>{const u=v.useMemo(()=>RS(e),[e]),d=u.map(Jd),f=v.useRef(!0),h=v.useRef(u),p=$0(()=>new Map),[g,x]=v.useState(u),[w,_]=v.useState(u);Bk(()=>{f.current=!1,h.current=u;for(let k=0;k<w.length;k++){const P=Jd(w[k]);d.includes(P)?p.delete(P):p.get(P)!==!0&&p.set(P,!1)}},[w,d.length,d.join("-")]);const N=[];if(u!==g){let k=[...u];for(let P=0;P<w.length;P++){const T=w[P],S=Jd(T);d.includes(S)||(k.splice(P,0,T),N.push(T))}l==="wait"&&N.length&&(k=N),_(RS(k)),x(u);return}const{forceRender:C}=v.useContext(W0);return a.jsx(a.Fragment,{children:w.map(k=>{const P=Jd(k),T=u===w||d.includes(P),S=()=>{if(p.has(P))p.set(P,!0);else return;let E=!0;p.forEach(z=>{z||(E=!1)}),E&&(C==null||C(),_(h.current),i&&i())};return a.jsx(L3,{isPresent:T,initial:!f.current||r?void 0:!1,custom:T?void 0:n,presenceAffectsLayout:o,mode:l,onExitComplete:T?void 0:S,children:k},P)})})},F3={useManualTiming:!1};function z3(e){let t=new Set,n=new Set,r=!1,i=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function u(f){o.has(f)&&(d.schedule(f),e()),f(l)}const d={schedule:(f,h=!1,p=!1)=>{const x=p&&r?t:n;return h&&o.add(f),x.has(f)||x.add(f),f},cancel:f=>{n.delete(f),o.delete(f)},process:f=>{if(l=f,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(u),t.clear(),r=!1,i&&(i=!1,d.process(f))}};return d}const Zd=["read","resolveKeyframes","update","preRender","render","postRender"],B3=40;function Vk(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,l=Zd.reduce((C,k)=>(C[k]=z3(o),C),{}),{read:u,resolveKeyframes:d,update:f,preRender:h,render:p,postRender:g}=l,x=()=>{const C=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(C-i.timestamp,B3),1),i.timestamp=C,i.isProcessing=!0,u.process(i),d.process(i),f.process(i),h.process(i),p.process(i),g.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(x))},w=()=>{n=!0,r=!0,i.isProcessing||e(x)};return{schedule:Zd.reduce((C,k)=>{const P=l[k];return C[k]=(T,S=!1,E=!1)=>(n||w(),P.schedule(T,S,E)),C},{}),cancel:C=>{for(let k=0;k<Zd.length;k++)l[Zd[k]].cancel(C)},state:i,steps:l}}const{schedule:Lt,cancel:$a,state:wn,steps:og}=Vk(typeof requestAnimationFrame<"u"?requestAnimationFrame:hr,!0),$k=v.createContext({strict:!1}),OS={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ol={};for(const e in OS)ol[e]={isEnabled:t=>OS[e].some(n=>!!t[n])};function V3(e){for(const t in e)ol[t]={...ol[t],...e[t]}}const $3=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Ff(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||$3.has(e)}let Uk=e=>!Ff(e);function U3(e){e&&(Uk=t=>t.startsWith("on")?!Ff(t):e(t))}try{U3(require("@emotion/is-prop-valid").default)}catch{}function W3(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Uk(i)||n===!0&&Ff(i)||!t&&!Ff(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function H3(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const km=v.createContext({});function Hc(e){return typeof e=="string"||Array.isArray(e)}function Pm(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const G0=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Q0=["initial",...G0];function Em(e){return Pm(e.animate)||Q0.some(t=>Hc(e[t]))}function Wk(e){return!!(Em(e)||e.variants)}function K3(e,t){if(Em(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Hc(n)?n:void 0,animate:Hc(r)?r:void 0}}return e.inherit!==!1?t:{}}function G3(e){const{initial:t,animate:n}=K3(e,v.useContext(km));return v.useMemo(()=>({initial:t,animate:n}),[IS(t),IS(n)])}function IS(e){return Array.isArray(e)?e.join(" "):e}const Q3=Symbol.for("motionComponentSymbol");function Oo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Y3(e,t,n){return v.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Oo(n)&&(n.current=r))},[t])}const Y0=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),X3="framerAppearId",Hk="data-"+Y0(X3),{schedule:X0}=Vk(queueMicrotask,!1),Kk=v.createContext({});function J3(e,t,n,r,i){var o,l;const{visualElement:u}=v.useContext(km),d=v.useContext($k),f=v.useContext(Nm),h=v.useContext(U0).reducedMotion,p=v.useRef(null);r=r||d.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:u,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:h}));const g=p.current,x=v.useContext(Kk);g&&!g.projection&&i&&(g.type==="html"||g.type==="svg")&&Z3(p.current,n,i,x);const w=v.useRef(!1);v.useInsertionEffect(()=>{g&&w.current&&g.update(n,f)});const _=n[Hk],N=v.useRef(!!_&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,_))&&((l=window.MotionHasOptimisedAnimation)===null||l===void 0?void 0:l.call(window,_)));return Bk(()=>{g&&(w.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),X0.render(g.render),N.current&&g.animationState&&g.animationState.animateChanges())}),v.useEffect(()=>{g&&(!N.current&&g.animationState&&g.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)===null||C===void 0||C.call(window,_)}),N.current=!1))}),g}function Z3(e,t,n,r){const{layoutId:i,layout:o,drag:l,dragConstraints:u,layoutScroll:d,layoutRoot:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Gk(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!l||u&&Oo(u),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,layoutScroll:d,layoutRoot:f})}function Gk(e){if(e)return e.options.allowProjection!==!1?e.projection:Gk(e.parent)}function ez({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var o,l;e&&V3(e);function u(f,h){let p;const g={...v.useContext(U0),...f,layoutId:tz(f)},{isStatic:x}=g,w=G3(f),_=r(f,x);if(!x&&K0){nz();const N=rz(g);p=N.MeasureLayout,w.visualElement=J3(i,_,g,t,N.ProjectionNode)}return a.jsxs(km.Provider,{value:w,children:[p&&w.visualElement?a.jsx(p,{visualElement:w.visualElement,...g}):null,n(i,f,Y3(_,w.visualElement,h),_,x,w.visualElement)]})}u.displayName=`motion.${typeof i=="string"?i:`create(${(l=(o=i.displayName)!==null&&o!==void 0?o:i.name)!==null&&l!==void 0?l:""})`}`;const d=v.forwardRef(u);return d[Q3]=i,d}function tz({layoutId:e}){const t=v.useContext(W0).id;return t&&e!==void 0?t+"-"+e:e}function nz(e,t){v.useContext($k).strict}function rz(e){const{drag:t,layout:n}=ol;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const iz=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function J0(e){return typeof e!="string"||e.includes("-")?!1:!!(iz.indexOf(e)>-1||/[A-Z]/u.test(e))}function Qk(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const Yk=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Xk(e,t,n,r){Qk(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Yk.has(i)?i:Y0(i),t.attrs[i])}const Mn=e=>!!(e&&e.getVelocity),zf={};function az(e){Object.assign(zf,e)}const wu=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Xs=new Set(wu);function Jk(e,{layout:t,layoutId:n}){return Xs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!zf[e]||e==="opacity")}function Z0(e,t,n){var r;const{style:i}=e,o={};for(const l in i)(Mn(i[l])||t.style&&Mn(t.style[l])||Jk(l,e)||((r=n==null?void 0:n.getValue(l))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(o[l]=i[l]);return o}function Zk(e,t,n){const r=Z0(e,t,n);for(const i in e)if(Mn(e[i])||Mn(t[i])){const o=wu.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}function DS(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ex(e,t,n,r){if(typeof t=="function"){const[i,o]=DS(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=DS(r);t=t(n!==void 0?n:e.custom,i,o)}return t}const jy=e=>Array.isArray(e),sz=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),oz=e=>jy(e)?e[e.length-1]||0:e;function _f(e){const t=Mn(e)?e.get():e;return sz(t)?t.toValue():t}function lz({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const l={latestValues:cz(r,i,o,e),renderState:t()};return n&&(l.mount=u=>n(r,u,l)),l}const eP=e=>(t,n)=>{const r=v.useContext(km),i=v.useContext(Nm),o=()=>lz(e,t,r,i);return n?o():$0(o)};function cz(e,t,n,r){const i={},o=r(e,{});for(const g in o)i[g]=_f(o[g]);let{initial:l,animate:u}=e;const d=Em(e),f=Wk(e);t&&f&&!d&&e.inherit!==!1&&(l===void 0&&(l=t.initial),u===void 0&&(u=t.animate));let h=n?n.initial===!1:!1;h=h||l===!1;const p=h?u:l;if(p&&typeof p!="boolean"&&!Pm(p)){const g=Array.isArray(p)?p:[p];for(let x=0;x<g.length;x++){const w=ex(e,g[x]);if(w){const{transitionEnd:_,transition:N,...C}=w;for(const k in C){let P=C[k];if(Array.isArray(P)){const T=h?P.length-1:0;P=P[T]}P!==null&&(i[k]=P)}for(const k in _)i[k]=_[k]}}}return i}const tx=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),tP=()=>({...tx(),attrs:{}}),nP=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Yi=(e,t,n)=>n>t?t:n<e?e:n,wl={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Kc={...wl,transform:e=>Yi(0,1,e)},ef={...wl,default:1},_u=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Na=_u("deg"),xi=_u("%"),Qe=_u("px"),uz=_u("vh"),dz=_u("vw"),LS={...xi,parse:e=>xi.parse(e)/100,transform:e=>xi.transform(e*100)},fz={borderWidth:Qe,borderTopWidth:Qe,borderRightWidth:Qe,borderBottomWidth:Qe,borderLeftWidth:Qe,borderRadius:Qe,radius:Qe,borderTopLeftRadius:Qe,borderTopRightRadius:Qe,borderBottomRightRadius:Qe,borderBottomLeftRadius:Qe,width:Qe,maxWidth:Qe,height:Qe,maxHeight:Qe,top:Qe,right:Qe,bottom:Qe,left:Qe,padding:Qe,paddingTop:Qe,paddingRight:Qe,paddingBottom:Qe,paddingLeft:Qe,margin:Qe,marginTop:Qe,marginRight:Qe,marginBottom:Qe,marginLeft:Qe,backgroundPositionX:Qe,backgroundPositionY:Qe},mz={rotate:Na,rotateX:Na,rotateY:Na,rotateZ:Na,scale:ef,scaleX:ef,scaleY:ef,scaleZ:ef,skew:Na,skewX:Na,skewY:Na,distance:Qe,translateX:Qe,translateY:Qe,translateZ:Qe,x:Qe,y:Qe,z:Qe,perspective:Qe,transformPerspective:Qe,opacity:Kc,originX:LS,originY:LS,originZ:Qe},qS={...wl,transform:Math.round},nx={...fz,...mz,zIndex:qS,size:Qe,fillOpacity:Kc,strokeOpacity:Kc,numOctaves:qS},hz={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},pz=wu.length;function gz(e,t,n){let r="",i=!0;for(let o=0;o<pz;o++){const l=wu[o],u=e[l];if(u===void 0)continue;let d=!0;if(typeof u=="number"?d=u===(l.startsWith("scale")?1:0):d=parseFloat(u)===0,!d||n){const f=nP(u,nx[l]);if(!d){i=!1;const h=hz[l]||l;r+=`${h}(${f}) `}n&&(t[l]=f)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}const rP=e=>t=>typeof t=="string"&&t.startsWith(e),iP=rP("--"),yz=rP("var(--"),rx=e=>yz(e)?xz.test(e.split("/*")[0].trim()):!1,xz=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ix(e,t,n){const{style:r,vars:i,transformOrigin:o}=e;let l=!1,u=!1;for(const d in t){const f=t[d];if(Xs.has(d)){l=!0;continue}else if(iP(d)){i[d]=f;continue}else{const h=nP(f,nx[d]);d.startsWith("origin")?(u=!0,o[d]=h):r[d]=h}}if(t.transform||(l||n?r.transform=gz(t,e.transform,n):r.transform&&(r.transform="none")),u){const{originX:d="50%",originY:f="50%",originZ:h=0}=o;r.transformOrigin=`${d} ${f} ${h}`}}function FS(e,t,n){return typeof e=="string"?e:Qe.transform(t+n*e)}function vz(e,t,n){const r=FS(t,e.x,e.width),i=FS(n,e.y,e.height);return`${r} ${i}`}const bz={offset:"stroke-dashoffset",array:"stroke-dasharray"},wz={offset:"strokeDashoffset",array:"strokeDasharray"};function _z(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?bz:wz;e[o.offset]=Qe.transform(-r);const l=Qe.transform(t),u=Qe.transform(n);e[o.array]=`${l} ${u}`}function ax(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:l,pathSpacing:u=1,pathOffset:d=0,...f},h,p){if(ix(e,f,p),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:x,dimensions:w}=e;g.transform&&(w&&(x.transform=g.transform),delete g.transform),w&&(i!==void 0||o!==void 0||x.transform)&&(x.transformOrigin=vz(w,i!==void 0?i:.5,o!==void 0?o:.5)),t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),r!==void 0&&(g.scale=r),l!==void 0&&_z(g,l,u,d,!1)}const sx=e=>typeof e=="string"&&e.toLowerCase()==="svg",Sz={useVisualState:eP({scrapeMotionValuesFromProps:Zk,createRenderState:tP,onMount:(e,t,{renderState:n,latestValues:r})=>{Lt.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Lt.render(()=>{ax(n,r,sx(t.tagName),e.transformTemplate),Xk(t,n)})}})},jz={useVisualState:eP({scrapeMotionValuesFromProps:Z0,createRenderState:tx})};function aP(e,t,n){for(const r in t)!Mn(t[r])&&!Jk(r,n)&&(e[r]=t[r])}function Nz({transformTemplate:e},t){return v.useMemo(()=>{const n=tx();return ix(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Cz(e,t){const n=e.style||{},r={};return aP(r,n,e),Object.assign(r,Nz(e,t)),r}function kz(e,t){const n={},r=Cz(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function Pz(e,t,n,r){const i=v.useMemo(()=>{const o=tP();return ax(o,t,sx(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};aP(o,e.style,e),i.style={...o,...i.style}}return i}function Ez(e=!1){return(n,r,i,{latestValues:o},l)=>{const d=(J0(n)?Pz:kz)(r,o,l,n),f=W3(r,typeof n=="string",e),h=n!==v.Fragment?{...f,...d,ref:i}:{},{children:p}=r,g=v.useMemo(()=>Mn(p)?p.get():p,[p]);return v.createElement(n,{...h,children:g})}}function Tz(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const l={...J0(r)?Sz:jz,preloadedFeatures:e,useRender:Ez(i),createVisualElement:t,Component:r};return ez(l)}}function sP(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Tm(e,t,n){const r=e.getProps();return ex(r,t,n!==void 0?n:r.custom,e)}const Az=H0(()=>window.ScrollTimeline!==void 0);class Mz{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(Az()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,o)=>{i&&i(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Rz extends Mz{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function ox(e,t){return e?e[t]||e.default||e:void 0}const Ny=2e4;function oP(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Ny;)t+=n,r=e.next(t);return t>=Ny?1/0:t}function lx(e){return typeof e=="function"}function zS(e,t){e.timeline=t,e.onfinish=null}const cx=e=>Array.isArray(e)&&typeof e[0]=="number",Oz={linearEasing:void 0};function Iz(e,t){const n=H0(e);return()=>{var r;return(r=Oz[t])!==null&&r!==void 0?r:n()}}const Bf=Iz(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),lP=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let o=0;o<i;o++)r+=e(sl(0,i-1,o))+", ";return`linear(${r.substring(0,r.length-2)})`};function cP(e){return!!(typeof e=="function"&&Bf()||!e||typeof e=="string"&&(e in Cy||Bf())||cx(e)||Array.isArray(e)&&e.every(cP))}const Pc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Cy={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Pc([0,.65,.55,1]),circOut:Pc([.55,0,1,.45]),backIn:Pc([.31,.01,.66,-.59]),backOut:Pc([.33,1.53,.69,.99])};function uP(e,t){if(e)return typeof e=="function"&&Bf()?lP(e,t):cx(e)?Pc(e):Array.isArray(e)?e.map(n=>uP(n,t)||Cy.easeOut):Cy[e]}const Ur={x:!1,y:!1};function dP(){return Ur.x||Ur.y}function Dz(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const o=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function fP(e,t){const n=Dz(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function BS(e){return t=>{t.pointerType==="touch"||dP()||e(t)}}function Lz(e,t,n={}){const[r,i,o]=fP(e,n),l=BS(u=>{const{target:d}=u,f=t(u);if(typeof f!="function"||!d)return;const h=BS(p=>{f(p),d.removeEventListener("pointerleave",h)});d.addEventListener("pointerleave",h,i)});return r.forEach(u=>{u.addEventListener("pointerenter",l,i)}),o}const mP=(e,t)=>t?e===t?!0:mP(e,t.parentElement):!1,ux=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,qz=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Fz(e){return qz.has(e.tagName)||e.tabIndex!==-1}const Ec=new WeakSet;function VS(e){return t=>{t.key==="Enter"&&e(t)}}function lg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const zz=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=VS(()=>{if(Ec.has(n))return;lg(n,"down");const i=VS(()=>{lg(n,"up")}),o=()=>lg(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function $S(e){return ux(e)&&!dP()}function Bz(e,t,n={}){const[r,i,o]=fP(e,n),l=u=>{const d=u.currentTarget;if(!$S(u)||Ec.has(d))return;Ec.add(d);const f=t(u),h=(x,w)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",g),!(!$S(x)||!Ec.has(d))&&(Ec.delete(d),typeof f=="function"&&f(x,{success:w}))},p=x=>{h(x,n.useGlobalTarget||mP(d,x.target))},g=x=>{h(x,!1)};window.addEventListener("pointerup",p,i),window.addEventListener("pointercancel",g,i)};return r.forEach(u=>{!Fz(u)&&u.getAttribute("tabindex")===null&&(u.tabIndex=0),(n.useGlobalTarget?window:u).addEventListener("pointerdown",l,i),u.addEventListener("focus",f=>zz(f,i),i)}),o}function Vz(e){return e==="x"||e==="y"?Ur[e]?null:(Ur[e]=!0,()=>{Ur[e]=!1}):Ur.x||Ur.y?null:(Ur.x=Ur.y=!0,()=>{Ur.x=Ur.y=!1})}let Sf;function $z(){Sf=void 0}const vi={now:()=>(Sf===void 0&&vi.set(wn.isProcessing||F3.useManualTiming?wn.timestamp:performance.now()),Sf),set:e=>{Sf=e,queueMicrotask($z)}};function dx(e,t){e.indexOf(t)===-1&&e.push(t)}function fx(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class mx{constructor(){this.subscriptions=[]}add(t){return dx(this.subscriptions,t),()=>fx(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o<i;o++){const l=this.subscriptions[o];l&&l(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function hP(e,t){return t?e*(1e3/t):0}const US=30,Uz=e=>!isNaN(parseFloat(e));class Wz{constructor(t,n={}){this.version="11.16.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const o=vi.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=vi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Uz(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new mx);const r=this.events[t].add(n);return t==="change"?()=>{r(),Lt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=vi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>US)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,US);return hP(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Gc(e,t){return new Wz(e,t)}function Hz(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Gc(n))}function Kz(e,t){const n=Tm(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const l in o){const u=oz(o[l]);Hz(e,l,u)}}function Gz(e){return!!(Mn(e)&&e.add)}function ky(e,t){const n=e.getValue("willChange");if(Gz(n))return n.add(t)}function pP(e){return e.props[Hk]}const gP=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Qz=1e-7,Yz=12;function Xz(e,t,n,r,i){let o,l,u=0;do l=t+(n-t)/2,o=gP(l,r,i)-e,o>0?n=l:t=l;while(Math.abs(o)>Qz&&++u<Yz);return l}function Su(e,t,n,r){if(e===t&&n===r)return hr;const i=o=>Xz(o,0,1,e,n);return o=>o===0||o===1?o:gP(i(o),t,r)}const yP=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,xP=e=>t=>1-e(1-t),vP=Su(.33,1.53,.69,.99),hx=xP(vP),bP=yP(hx),wP=e=>(e*=2)<1?.5*hx(e):.5*(2-Math.pow(2,-10*(e-1))),px=e=>1-Math.sin(Math.acos(e)),_P=xP(px),SP=yP(px),jP=e=>/^0[^.\s]+$/u.test(e);function Jz(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||jP(e):!0}const NP=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Zz=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function eB(e){const t=Zz.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function CP(e,t,n=1){const[r,i]=eB(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const l=o.trim();return NP(l)?parseFloat(l):l}return rx(i)?CP(i,t,n+1):i}const tB=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),WS=e=>e===wl||e===Qe,HS=(e,t)=>parseFloat(e.split(", ")[t]),KS=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return HS(i[1],t);{const o=r.match(/^matrix\((.+)\)$/u);return o?HS(o[1],e):0}},nB=new Set(["x","y","z"]),rB=wu.filter(e=>!nB.has(e));function iB(e){const t=[];return rB.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const ll={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:KS(4,13),y:KS(5,14)};ll.translateX=ll.x;ll.translateY=ll.y;const kP=e=>t=>t.test(e),aB={test:e=>e==="auto",parse:e=>e},PP=[wl,Qe,xi,Na,dz,uz,aB],GS=e=>PP.find(kP(e)),As=new Set;let Py=!1,Ey=!1;function EP(){if(Ey){const e=Array.from(As).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=iB(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([o,l])=>{var u;(u=r.getValue(o))===null||u===void 0||u.set(l)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Ey=!1,Py=!1,As.forEach(e=>e.complete()),As.clear()}function TP(){As.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ey=!0)})}function sB(){TP(),EP()}class gx{constructor(t,n,r,i,o,l=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=o,this.isAsync=l}scheduleResolve(){this.isScheduled=!0,this.isAsync?(As.add(this),Py||(Py=!0,Lt.read(TP),Lt.resolveKeyframes(EP))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let o=0;o<t.length;o++)if(t[o]===null)if(o===0){const l=i==null?void 0:i.get(),u=t[t.length-1];if(l!==void 0)t[0]=l;else if(r&&n){const d=r.readValue(n,u);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=u),i&&l===void 0&&i.set(t[0])}else t[o]=t[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),As.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,As.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Ic=e=>Math.round(e*1e5)/1e5,yx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function oB(e){return e==null}const lB=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,xx=(e,t)=>n=>!!(typeof n=="string"&&lB.test(n)&&n.startsWith(e)||t&&!oB(n)&&Object.prototype.hasOwnProperty.call(n,t)),AP=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,o,l,u]=r.match(yx);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(l),alpha:u!==void 0?parseFloat(u):1}},cB=e=>Yi(0,255,e),cg={...wl,transform:e=>Math.round(cB(e))},bs={test:xx("rgb","red"),parse:AP("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+cg.transform(e)+", "+cg.transform(t)+", "+cg.transform(n)+", "+Ic(Kc.transform(r))+")"};function uB(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Ty={test:xx("#"),parse:uB,transform:bs.transform},Io={test:xx("hsl","hue"),parse:AP("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+xi.transform(Ic(t))+", "+xi.transform(Ic(n))+", "+Ic(Kc.transform(r))+")"},En={test:e=>bs.test(e)||Ty.test(e)||Io.test(e),parse:e=>bs.test(e)?bs.parse(e):Io.test(e)?Io.parse(e):Ty.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?bs.transform(e):Io.transform(e)},dB=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function fB(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(yx))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(dB))===null||n===void 0?void 0:n.length)||0)>0}const MP="number",RP="color",mB="var",hB="var(",QS="${}",pB=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Qc(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const u=t.replace(pB,d=>(En.test(d)?(r.color.push(o),i.push(RP),n.push(En.parse(d))):d.startsWith(hB)?(r.var.push(o),i.push(mB),n.push(d)):(r.number.push(o),i.push(MP),n.push(parseFloat(d))),++o,QS)).split(QS);return{values:n,split:u,indexes:r,types:i}}function OP(e){return Qc(e).values}function IP(e){const{split:t,types:n}=Qc(e),r=t.length;return i=>{let o="";for(let l=0;l<r;l++)if(o+=t[l],i[l]!==void 0){const u=n[l];u===MP?o+=Ic(i[l]):u===RP?o+=En.transform(i[l]):o+=i[l]}return o}}const gB=e=>typeof e=="number"?0:e;function yB(e){const t=OP(e);return IP(e)(t.map(gB))}const Ua={test:fB,parse:OP,createTransformer:IP,getAnimatableNone:yB},xB=new Set(["brightness","contrast","saturate","opacity"]);function vB(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(yx)||[];if(!r)return e;const i=n.replace(r,"");let o=xB.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const bB=/\b([a-z-]*)\(.*?\)/gu,Ay={...Ua,getAnimatableNone:e=>{const t=e.match(bB);return t?t.map(vB).join(" "):e}},wB={...nx,color:En,backgroundColor:En,outlineColor:En,fill:En,stroke:En,borderColor:En,borderTopColor:En,borderRightColor:En,borderBottomColor:En,borderLeftColor:En,filter:Ay,WebkitFilter:Ay},vx=e=>wB[e];function DP(e,t){let n=vx(e);return n!==Ay&&(n=Ua),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const _B=new Set(["auto","none","0"]);function SB(e,t,n){let r=0,i;for(;r<e.length&&!i;){const o=e[r];typeof o=="string"&&!_B.has(o)&&Qc(o).values.length&&(i=e[r]),r++}if(i&&n)for(const o of t)e[o]=DP(n,i)}class LP extends gx{constructor(t,n,r,i,o){super(t,n,r,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let f=t[d];if(typeof f=="string"&&(f=f.trim(),rx(f))){const h=CP(f,n.current);h!==void 0&&(t[d]=h),d===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!tB.has(r)||t.length!==2)return;const[i,o]=t,l=GS(i),u=GS(o);if(l!==u)if(WS(l)&&WS(u))for(let d=0;d<t.length;d++){const f=t[d];typeof f=="string"&&(t[d]=parseFloat(f))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)Jz(t[i])&&r.push(i);r.length&&SB(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ll[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const o=n.getValue(r);o&&o.jump(this.measuredOrigin,!1);const l=i.length-1,u=i[l];i[l]=ll[r](n.measureViewportBox(),window.getComputedStyle(n.current)),u!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=u),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([d,f])=>{n.getValue(d).set(f)}),this.resolveNoneKeyframes()}}const YS=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ua.test(e)||e==="0")&&!e.startsWith("url("));function jB(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function NB(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],l=YS(i,t),u=YS(o,t);return!l||!u?!1:jB(e)||(n==="spring"||lx(n))&&r}const CB=e=>e!==null;function Am(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(CB),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return!o||r===void 0?i[o]:r}const kB=40;class qP{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:l="loop",...u}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=vi.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:o,repeatType:l,...u},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>kB?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&sB(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=vi.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:o,delay:l,onComplete:u,onUpdate:d,isGenerator:f}=this.options;if(!f&&!NB(t,r,i,o))if(l)this.options.duration=0;else{d==null||d(Am(t,this.options,n)),u==null||u(),this.resolveFinishedPromise();return}const h=this.initPlayback(t,n);h!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...h},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Ut=(e,t,n)=>e+(t-e)*n;function ug(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function PB({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,l=0;if(!t)i=o=l=n;else{const u=n<.5?n*(1+t):n+t-n*t,d=2*n-u;i=ug(d,u,e+1/3),o=ug(d,u,e),l=ug(d,u,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(l*255),alpha:r}}function Vf(e,t){return n=>n>0?t:e}const dg=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},EB=[Ty,bs,Io],TB=e=>EB.find(t=>t.test(e));function XS(e){const t=TB(e);if(!t)return!1;let n=t.parse(e);return t===Io&&(n=PB(n)),n}const JS=(e,t)=>{const n=XS(e),r=XS(t);if(!n||!r)return Vf(e,t);const i={...n};return o=>(i.red=dg(n.red,r.red,o),i.green=dg(n.green,r.green,o),i.blue=dg(n.blue,r.blue,o),i.alpha=Ut(n.alpha,r.alpha,o),bs.transform(i))},AB=(e,t)=>n=>t(e(n)),ju=(...e)=>e.reduce(AB),My=new Set(["none","hidden"]);function MB(e,t){return My.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function RB(e,t){return n=>Ut(e,t,n)}function bx(e){return typeof e=="number"?RB:typeof e=="string"?rx(e)?Vf:En.test(e)?JS:DB:Array.isArray(e)?FP:typeof e=="object"?En.test(e)?JS:OB:Vf}function FP(e,t){const n=[...e],r=n.length,i=e.map((o,l)=>bx(o)(o,t[l]));return o=>{for(let l=0;l<r;l++)n[l]=i[l](o);return n}}function OB(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=bx(e[i])(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}}function IB(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const l=t.types[o],u=e.indexes[l][i[l]],d=(n=e.values[u])!==null&&n!==void 0?n:0;r[o]=d,i[l]++}return r}const DB=(e,t)=>{const n=Ua.createTransformer(t),r=Qc(e),i=Qc(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?My.has(e)&&!i.values.length||My.has(t)&&!r.values.length?MB(e,t):ju(FP(IB(r,i),i.values),n):Vf(e,t)};function zP(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ut(e,t,n):bx(e)(e,t)}const LB=5;function BP(e,t,n){const r=Math.max(t-LB,0);return hP(n-e(r),t-r)}const Kt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},fg=.001;function qB({duration:e=Kt.duration,bounce:t=Kt.bounce,velocity:n=Kt.velocity,mass:r=Kt.mass}){let i,o,l=1-t;l=Yi(Kt.minDamping,Kt.maxDamping,l),e=Yi(Kt.minDuration,Kt.maxDuration,Hi(e)),l<1?(i=f=>{const h=f*l,p=h*e,g=h-n,x=Ry(f,l),w=Math.exp(-p);return fg-g/x*w},o=f=>{const p=f*l*e,g=p*n+n,x=Math.pow(l,2)*Math.pow(f,2)*e,w=Math.exp(-p),_=Ry(Math.pow(f,2),l);return(-i(f)+fg>0?-1:1)*((g-x)*w)/_}):(i=f=>{const h=Math.exp(-f*e),p=(f-n)*e+1;return-fg+h*p},o=f=>{const h=Math.exp(-f*e),p=(n-f)*(e*e);return h*p});const u=5/e,d=zB(i,o,u);if(e=Wi(e),isNaN(d))return{stiffness:Kt.stiffness,damping:Kt.damping,duration:e};{const f=Math.pow(d,2)*r;return{stiffness:f,damping:l*2*Math.sqrt(r*f),duration:e}}}const FB=12;function zB(e,t,n){let r=n;for(let i=1;i<FB;i++)r=r-e(r)/t(r);return r}function Ry(e,t){return e*Math.sqrt(1-t*t)}const BB=["duration","bounce"],VB=["stiffness","damping","mass"];function ZS(e,t){return t.some(n=>e[n]!==void 0)}function $B(e){let t={velocity:Kt.velocity,stiffness:Kt.stiffness,damping:Kt.damping,mass:Kt.mass,isResolvedFromDuration:!1,...e};if(!ZS(e,VB)&&ZS(e,BB))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,o=2*Yi(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Kt.mass,stiffness:i,damping:o}}else{const n=qB(e);t={...t,...n,mass:Kt.mass},t.isResolvedFromDuration=!0}return t}function VP(e=Kt.visualDuration,t=Kt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const o=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],u={done:!1,value:o},{stiffness:d,damping:f,mass:h,duration:p,velocity:g,isResolvedFromDuration:x}=$B({...n,velocity:-Hi(n.velocity||0)}),w=g||0,_=f/(2*Math.sqrt(d*h)),N=l-o,C=Hi(Math.sqrt(d/h)),k=Math.abs(N)<5;r||(r=k?Kt.restSpeed.granular:Kt.restSpeed.default),i||(i=k?Kt.restDelta.granular:Kt.restDelta.default);let P;if(_<1){const S=Ry(C,_);P=E=>{const z=Math.exp(-_*C*E);return l-z*((w+_*C*N)/S*Math.sin(S*E)+N*Math.cos(S*E))}}else if(_===1)P=S=>l-Math.exp(-C*S)*(N+(w+C*N)*S);else{const S=C*Math.sqrt(_*_-1);P=E=>{const z=Math.exp(-_*C*E),D=Math.min(S*E,300);return l-z*((w+_*C*N)*Math.sinh(D)+S*N*Math.cosh(D))/S}}const T={calculatedDuration:x&&p||null,next:S=>{const E=P(S);if(x)u.done=S>=p;else{let z=0;_<1&&(z=S===0?Wi(w):BP(P,S,E));const D=Math.abs(z)<=r,K=Math.abs(l-E)<=i;u.done=D&&K}return u.value=u.done?l:E,u},toString:()=>{const S=Math.min(oP(T),Ny),E=lP(z=>T.next(S*z).value,S,30);return S+"ms "+E}};return T}function ej({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:l,min:u,max:d,restDelta:f=.5,restSpeed:h}){const p=e[0],g={done:!1,value:p},x=D=>u!==void 0&&D<u||d!==void 0&&D>d,w=D=>u===void 0?d:d===void 0||Math.abs(u-D)<Math.abs(d-D)?u:d;let _=n*t;const N=p+_,C=l===void 0?N:l(N);C!==N&&(_=C-p);const k=D=>-_*Math.exp(-D/r),P=D=>C+k(D),T=D=>{const K=k(D),U=P(D);g.done=Math.abs(K)<=f,g.value=g.done?C:U};let S,E;const z=D=>{x(g.value)&&(S=D,E=VP({keyframes:[g.value,w(g.value)],velocity:BP(P,D,g.value),damping:i,stiffness:o,restDelta:f,restSpeed:h}))};return z(0),{calculatedDuration:null,next:D=>{let K=!1;return!E&&S===void 0&&(K=!0,T(D),z(D)),S!==void 0&&D>=S?E.next(D-S):(!K&&T(D),g)}}}const UB=Su(.42,0,1,1),WB=Su(0,0,.58,1),$P=Su(.42,0,.58,1),HB=e=>Array.isArray(e)&&typeof e[0]!="number",KB={linear:hr,easeIn:UB,easeInOut:$P,easeOut:WB,circIn:px,circInOut:SP,circOut:_P,backIn:hx,backInOut:bP,backOut:vP,anticipate:wP},tj=e=>{if(cx(e)){zk(e.length===4);const[t,n,r,i]=e;return Su(t,n,r,i)}else if(typeof e=="string")return KB[e];return e};function GB(e,t,n){const r=[],i=n||zP,o=e.length-1;for(let l=0;l<o;l++){let u=i(e[l],e[l+1]);if(t){const d=Array.isArray(t)?t[l]||hr:t;u=ju(d,u)}r.push(u)}return r}function QB(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(zk(o===t.length),o===1)return()=>t[0];if(o===2&&e[0]===e[1])return()=>t[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=GB(t,r,i),u=l.length,d=f=>{let h=0;if(u>1)for(;h<e.length-2&&!(f<e[h+1]);h++);const p=sl(e[h],e[h+1],f);return l[h](p)};return n?f=>d(Yi(e[0],e[o-1],f)):d}function YB(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=sl(0,t,r);e.push(Ut(n,1,i))}}function XB(e){const t=[0];return YB(t,e.length-1),t}function JB(e,t){return e.map(n=>n*t)}function ZB(e,t){return e.map(()=>t||$P).splice(0,e.length-1)}function $f({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=HB(r)?r.map(tj):tj(r),o={done:!1,value:t[0]},l=JB(n&&n.length===t.length?n:XB(t),e),u=QB(l,t,{ease:Array.isArray(i)?i:ZB(t,i)});return{calculatedDuration:e,next:d=>(o.value=u(d),o.done=d>=e,o)}}const e6=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Lt.update(t,!0),stop:()=>$a(t),now:()=>wn.isProcessing?wn.timestamp:vi.now()}},t6={decay:ej,inertia:ej,tween:$f,keyframes:$f,spring:VP},n6=e=>e/100;class wx extends qP{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:d}=this.options;d&&d()};const{name:n,motionValue:r,element:i,keyframes:o}=this.options,l=(i==null?void 0:i.KeyframeResolver)||gx,u=(d,f)=>this.onKeyframesResolved(d,f);this.resolver=new l(o,u,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o,velocity:l=0}=this.options,u=lx(n)?n:t6[n]||$f;let d,f;u!==$f&&typeof t[0]!="number"&&(d=ju(n6,zP(t[0],t[1])),t=[0,100]);const h=u({...this.options,keyframes:t});o==="mirror"&&(f=u({...this.options,keyframes:[...t].reverse(),velocity:-l})),h.calculatedDuration===null&&(h.calculatedDuration=oP(h));const{calculatedDuration:p}=h,g=p+i,x=g*(r+1)-i;return{generator:h,mirroredGenerator:f,mapPercentToKeyframes:d,calculatedDuration:p,resolvedDuration:g,totalDuration:x}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:D}=this.options;return{done:!0,value:D[D.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:l,mapPercentToKeyframes:u,keyframes:d,calculatedDuration:f,totalDuration:h,resolvedDuration:p}=r;if(this.startTime===null)return o.next(0);const{delay:g,repeat:x,repeatType:w,repeatDelay:_,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-h/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const C=this.currentTime-g*(this.speed>=0?1:-1),k=this.speed>=0?C<0:C>h;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=h);let P=this.currentTime,T=o;if(x){const D=Math.min(this.currentTime,h)/p;let K=Math.floor(D),U=D%1;!U&&D>=1&&(U=1),U===1&&K--,K=Math.min(K,x+1),!!(K%2)&&(w==="reverse"?(U=1-U,_&&(U-=_/p)):w==="mirror"&&(T=l)),P=Yi(0,1,U)*p}const S=k?{done:!1,value:d[0]}:T.next(P);u&&(S.value=u(S.value));let{done:E}=S;!k&&f!==null&&(E=this.speed>=0?this.currentTime>=h:this.currentTime<=0);const z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return z&&i!==void 0&&(S.value=Am(d,this.options,i)),N&&N(S.value),z&&this.finish(),S}get duration(){const{resolved:t}=this;return t?Hi(t.calculatedDuration):0}get time(){return Hi(this.currentTime)}set time(t){t=Wi(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Hi(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=e6,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const r6=new Set(["opacity","clipPath","filter","transform"]);function i6(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:l="loop",ease:u="easeInOut",times:d}={}){const f={[t]:n};d&&(f.offset=d);const h=uP(u,i);return Array.isArray(h)&&(f.easing=h),e.animate(f,{delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:l==="reverse"?"alternate":"normal"})}const a6=H0(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Uf=10,s6=2e4;function o6(e){return lx(e.type)||e.type==="spring"||!cP(e.ease)}function l6(e,t){const n=new wx({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let o=0;for(;!r.done&&o<s6;)r=n.sample(o),i.push(r.value),o+=Uf;return{times:void 0,keyframes:i,duration:o-Uf,ease:"linear"}}const UP={anticipate:wP,backInOut:bP,circInOut:SP};function c6(e){return e in UP}class nj extends qP{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:o}=this.options;this.resolver=new LP(o,(l,u)=>this.onKeyframesResolved(l,u),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){var r;let{duration:i=300,times:o,ease:l,type:u,motionValue:d,name:f,startTime:h}=this.options;if(!(!((r=d.owner)===null||r===void 0)&&r.current))return!1;if(typeof l=="string"&&Bf()&&c6(l)&&(l=UP[l]),o6(this.options)){const{onComplete:g,onUpdate:x,motionValue:w,element:_,...N}=this.options,C=l6(t,N);t=C.keyframes,t.length===1&&(t[1]=t[0]),i=C.duration,o=C.times,l=C.ease,u="keyframes"}const p=i6(d.owner.current,f,t,{...this.options,duration:i,times:o,ease:l});return p.startTime=h??this.calcStartTime(),this.pendingTimeline?(zS(p,this.pendingTimeline),this.pendingTimeline=void 0):p.onfinish=()=>{const{onComplete:g}=this.options;d.set(Am(t,this.options,n)),g&&g(),this.cancel(),this.resolveFinishedPromise()},{animation:p,duration:i,times:o,type:u,ease:l,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Hi(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Hi(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Wi(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return hr;const{animation:r}=n;zS(r,t)}return hr}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:o,ease:l,times:u}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:f,onUpdate:h,onComplete:p,element:g,...x}=this.options,w=new wx({...x,keyframes:r,duration:i,type:o,ease:l,times:u,isGenerator:!0}),_=Wi(this.time);f.setWithVelocity(w.sample(_-Uf).value,w.sample(_).value,Uf)}const{onStop:d}=this.options;d&&d(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:o,damping:l,type:u}=t;return a6()&&r&&r6.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&o!=="mirror"&&l!==0&&u!=="inertia"}}const u6={type:"spring",stiffness:500,damping:25,restSpeed:10},d6=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),f6={type:"keyframes",duration:.8},m6={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},h6=(e,{keyframes:t})=>t.length>2?f6:Xs.has(e)?e.startsWith("scale")?d6(t[1]):u6:m6;function p6({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:l,repeatDelay:u,from:d,elapsed:f,...h}){return!!Object.keys(h).length}const _x=(e,t,n,r={},i,o)=>l=>{const u=ox(r,e)||{},d=u.delay||r.delay||0;let{elapsed:f=0}=r;f=f-Wi(d);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-f,onUpdate:g=>{t.set(g),u.onUpdate&&u.onUpdate(g)},onComplete:()=>{l(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:o?void 0:i};p6(u)||(h={...h,...h6(e,h)}),h.duration&&(h.duration=Wi(h.duration)),h.repeatDelay&&(h.repeatDelay=Wi(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let p=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(h.duration=0,h.delay===0&&(p=!0)),p&&!o&&t.get()!==void 0){const g=Am(h.keyframes,u);if(g!==void 0)return Lt.update(()=>{h.onUpdate(g),h.onComplete()}),new Rz([])}return!o&&nj.supports(h)?new nj(h):new wx(h)};function g6({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function WP(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:l=e.getDefaultTransition(),transitionEnd:u,...d}=t;r&&(l=r);const f=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const p in d){const g=e.getValue(p,(o=e.latestValues[p])!==null&&o!==void 0?o:null),x=d[p];if(x===void 0||h&&g6(h,p))continue;const w={delay:n,...ox(l||{},p)};let _=!1;if(window.MotionHandoffAnimation){const C=pP(e);if(C){const k=window.MotionHandoffAnimation(C,p,Lt);k!==null&&(w.startTime=k,_=!0)}}ky(e,p),g.start(_x(p,g,x,e.shouldReduceMotion&&Xs.has(p)?{type:!1}:w,e,_));const N=g.animation;N&&f.push(N)}return u&&Promise.all(f).then(()=>{Lt.update(()=>{u&&Kz(e,u)})}),f}function Oy(e,t,n={}){var r;const i=Tm(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const l=i?()=>Promise.all(WP(e,i,n)):()=>Promise.resolve(),u=e.variantChildren&&e.variantChildren.size?(f=0)=>{const{delayChildren:h=0,staggerChildren:p,staggerDirection:g}=o;return y6(e,t,h+f,p,g,n)}:()=>Promise.resolve(),{when:d}=o;if(d){const[f,h]=d==="beforeChildren"?[l,u]:[u,l];return f().then(()=>h())}else return Promise.all([l(),u(n.delay)])}function y6(e,t,n=0,r=0,i=1,o){const l=[],u=(e.variantChildren.size-1)*r,d=i===1?(f=0)=>f*r:(f=0)=>u-f*r;return Array.from(e.variantChildren).sort(x6).forEach((f,h)=>{f.notify("AnimationStart",t),l.push(Oy(f,t,{...o,delay:n+d(h)}).then(()=>f.notify("AnimationComplete",t)))}),Promise.all(l)}function x6(e,t){return e.sortNodePosition(t)}function v6(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>Oy(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=Oy(e,t,n);else{const i=typeof t=="function"?Tm(e,t,n.custom):t;r=Promise.all(WP(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const b6=Q0.length;function HP(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?HP(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<b6;n++){const r=Q0[n],i=e.props[r];(Hc(i)||i===!1)&&(t[r]=i)}return t}const w6=[...G0].reverse(),_6=G0.length;function S6(e){return t=>Promise.all(t.map(({animation:n,options:r})=>v6(e,n,r)))}function j6(e){let t=S6(e),n=rj(),r=!0;const i=d=>(f,h)=>{var p;const g=Tm(e,h,d==="exit"?(p=e.presenceContext)===null||p===void 0?void 0:p.custom:void 0);if(g){const{transition:x,transitionEnd:w,..._}=g;f={...f,..._,...w}}return f};function o(d){t=d(e)}function l(d){const{props:f}=e,h=HP(e.parent)||{},p=[],g=new Set;let x={},w=1/0;for(let N=0;N<_6;N++){const C=w6[N],k=n[C],P=f[C]!==void 0?f[C]:h[C],T=Hc(P),S=C===d?k.isActive:null;S===!1&&(w=N);let E=P===h[C]&&P!==f[C]&&T;if(E&&r&&e.manuallyAnimateOnMount&&(E=!1),k.protectedKeys={...x},!k.isActive&&S===null||!P&&!k.prevProp||Pm(P)||typeof P=="boolean")continue;const z=N6(k.prevProp,P);let D=z||C===d&&k.isActive&&!E&&T||N>w&&T,K=!1;const U=Array.isArray(P)?P:[P];let W=U.reduce(i(C),{});S===!1&&(W={});const{prevResolvedValues:G={}}=k,R={...G,...W},q=re=>{D=!0,g.has(re)&&(K=!0,g.delete(re)),k.needsAnimating[re]=!0;const L=e.getValue(re);L&&(L.liveStyle=!1)};for(const re in R){const L=W[re],Y=G[re];if(x.hasOwnProperty(re))continue;let M=!1;jy(L)&&jy(Y)?M=!sP(L,Y):M=L!==Y,M?L!=null?q(re):g.add(re):L!==void 0&&g.has(re)?q(re):k.protectedKeys[re]=!0}k.prevProp=P,k.prevResolvedValues=W,k.isActive&&(x={...x,...W}),r&&e.blockInitialAnimation&&(D=!1),D&&(!(E&&z)||K)&&p.push(...U.map(re=>({animation:re,options:{type:C}})))}if(g.size){const N={};g.forEach(C=>{const k=e.getBaseTarget(C),P=e.getValue(C);P&&(P.liveStyle=!0),N[C]=k??null}),p.push({animation:N})}let _=!!p.length;return r&&(f.initial===!1||f.initial===f.animate)&&!e.manuallyAnimateOnMount&&(_=!1),r=!1,_?t(p):Promise.resolve()}function u(d,f){var h;if(n[d].isActive===f)return Promise.resolve();(h=e.variantChildren)===null||h===void 0||h.forEach(g=>{var x;return(x=g.animationState)===null||x===void 0?void 0:x.setActive(d,f)}),n[d].isActive=f;const p=l(d);for(const g in n)n[g].protectedKeys={};return p}return{animateChanges:l,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=rj(),r=!0}}}function N6(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!sP(t,e):!1}function hs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function rj(){return{animate:hs(!0),whileInView:hs(),whileHover:hs(),whileTap:hs(),whileDrag:hs(),whileFocus:hs(),exit:hs()}}class Qa{constructor(t){this.isMounted=!1,this.node=t}update(){}}class C6 extends Qa{constructor(t){super(t),t.animationState||(t.animationState=j6(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Pm(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let k6=0;class P6 extends Qa{constructor(){super(...arguments),this.id=k6++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const E6={animation:{Feature:C6},exit:{Feature:P6}};function Yc(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Nu(e){return{point:{x:e.pageX,y:e.pageY}}}const T6=e=>t=>ux(t)&&e(t,Nu(t));function Dc(e,t,n,r){return Yc(e,t,T6(n),r)}const ij=(e,t)=>Math.abs(e-t);function A6(e,t){const n=ij(e.x,t.x),r=ij(e.y,t.y);return Math.sqrt(n**2+r**2)}class KP{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=hg(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,x=A6(p.offset,{x:0,y:0})>=3;if(!g&&!x)return;const{point:w}=p,{timestamp:_}=wn;this.history.push({...w,timestamp:_});const{onStart:N,onMove:C}=this.handlers;g||(N&&N(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,p)},this.handlePointerMove=(p,g)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=mg(g,this.transformPagePoint),Lt.update(this.updatePoint,!0)},this.handlePointerUp=(p,g)=>{this.end();const{onEnd:x,onSessionEnd:w,resumeAnimation:_}=this.handlers;if(this.dragSnapToOrigin&&_&&_(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=hg(p.type==="pointercancel"?this.lastMoveEventInfo:mg(g,this.transformPagePoint),this.history);this.startEvent&&x&&x(p,N),w&&w(p,N)},!ux(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const l=Nu(t),u=mg(l,this.transformPagePoint),{point:d}=u,{timestamp:f}=wn;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=n;h&&h(t,hg(u,this.history)),this.removeListeners=ju(Dc(this.contextWindow,"pointermove",this.handlePointerMove),Dc(this.contextWindow,"pointerup",this.handlePointerUp),Dc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),$a(this.updatePoint)}}function mg(e,t){return t?{point:t(e.point)}:e}function aj(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hg({point:e},t){return{point:e,delta:aj(e,GP(t)),offset:aj(e,M6(t)),velocity:R6(t,.1)}}function M6(e){return e[0]}function GP(e){return e[e.length-1]}function R6(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=GP(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Wi(t)));)n--;if(!r)return{x:0,y:0};const o=Hi(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const l={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}const QP=1e-4,O6=1-QP,I6=1+QP,YP=.01,D6=0-YP,L6=0+YP;function yr(e){return e.max-e.min}function q6(e,t,n){return Math.abs(e-t)<=n}function sj(e,t,n,r=.5){e.origin=r,e.originPoint=Ut(t.min,t.max,e.origin),e.scale=yr(n)/yr(t),e.translate=Ut(n.min,n.max,e.origin)-e.originPoint,(e.scale>=O6&&e.scale<=I6||isNaN(e.scale))&&(e.scale=1),(e.translate>=D6&&e.translate<=L6||isNaN(e.translate))&&(e.translate=0)}function Lc(e,t,n,r){sj(e.x,t.x,n.x,r?r.originX:void 0),sj(e.y,t.y,n.y,r?r.originY:void 0)}function oj(e,t,n){e.min=n.min+t.min,e.max=e.min+yr(t)}function F6(e,t,n){oj(e.x,t.x,n.x),oj(e.y,t.y,n.y)}function lj(e,t,n){e.min=t.min-n.min,e.max=e.min+yr(t)}function qc(e,t,n){lj(e.x,t.x,n.x),lj(e.y,t.y,n.y)}function z6(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ut(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ut(n,e,r.max):Math.min(e,n)),e}function cj(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function B6(e,{top:t,left:n,bottom:r,right:i}){return{x:cj(e.x,n,i),y:cj(e.y,t,r)}}function uj(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function V6(e,t){return{x:uj(e.x,t.x),y:uj(e.y,t.y)}}function $6(e,t){let n=.5;const r=yr(e),i=yr(t);return i>r?n=sl(t.min,t.max-r,e.min):r>i&&(n=sl(e.min,e.max-i,t.min)),Yi(0,1,n)}function U6(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Iy=.35;function W6(e=Iy){return e===!1?e=0:e===!0&&(e=Iy),{x:dj(e,"left","right"),y:dj(e,"top","bottom")}}function dj(e,t,n){return{min:fj(e,t),max:fj(e,n)}}function fj(e,t){return typeof e=="number"?e:e[t]||0}const mj=()=>({translate:0,scale:1,origin:0,originPoint:0}),Do=()=>({x:mj(),y:mj()}),hj=()=>({min:0,max:0}),Jt=()=>({x:hj(),y:hj()});function kr(e){return[e("x"),e("y")]}function XP({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function H6({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function K6(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function pg(e){return e===void 0||e===1}function Dy({scale:e,scaleX:t,scaleY:n}){return!pg(e)||!pg(t)||!pg(n)}function ps(e){return Dy(e)||JP(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function JP(e){return pj(e.x)||pj(e.y)}function pj(e){return e&&e!=="0%"}function Wf(e,t,n){const r=e-n,i=t*r;return n+i}function gj(e,t,n,r,i){return i!==void 0&&(e=Wf(e,i,r)),Wf(e,n,r)+t}function Ly(e,t=0,n=1,r,i){e.min=gj(e.min,t,n,r,i),e.max=gj(e.max,t,n,r,i)}function ZP(e,{x:t,y:n}){Ly(e.x,t.translate,t.scale,t.originPoint),Ly(e.y,n.translate,n.scale,n.originPoint)}const yj=.999999999999,xj=1.0000000000001;function G6(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,l;for(let u=0;u<i;u++){o=n[u],l=o.projectionDelta;const{visualElement:d}=o.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&qo(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,ZP(e,l)),r&&ps(o.latestValues)&&qo(e,o.latestValues))}t.x<xj&&t.x>yj&&(t.x=1),t.y<xj&&t.y>yj&&(t.y=1)}function Lo(e,t){e.min=e.min+t,e.max=e.max+t}function vj(e,t,n,r,i=.5){const o=Ut(e.min,e.max,i);Ly(e,t,n,o,r)}function qo(e,t){vj(e.x,t.x,t.scaleX,t.scale,t.originX),vj(e.y,t.y,t.scaleY,t.scale,t.originY)}function eE(e,t){return XP(K6(e.getBoundingClientRect(),t))}function Q6(e,t,n){const r=eE(e,n),{scroll:i}=t;return i&&(Lo(r.x,i.offset.x),Lo(r.y,i.offset.y)),r}const tE=({current:e})=>e?e.ownerDocument.defaultView:null,Y6=new WeakMap;class X6{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Jt(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=h=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Nu(h).point)},o=(h,p)=>{const{drag:g,dragPropagation:x,onDragStart:w}=this.getProps();if(g&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Vz(g),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),kr(N=>{let C=this.getAxisMotionValue(N).get()||0;if(xi.test(C)){const{projection:k}=this.visualElement;if(k&&k.layout){const P=k.layout.layoutBox[N];P&&(C=yr(P)*(parseFloat(C)/100))}}this.originPoint[N]=C}),w&&Lt.postRender(()=>w(h,p)),ky(this.visualElement,"transform");const{animationState:_}=this.visualElement;_&&_.setActive("whileDrag",!0)},l=(h,p)=>{const{dragPropagation:g,dragDirectionLock:x,onDirectionLock:w,onDrag:_}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:N}=p;if(x&&this.currentDirection===null){this.currentDirection=J6(N),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",p.point,N),this.updateAxis("y",p.point,N),this.visualElement.render(),_&&_(h,p)},u=(h,p)=>this.stop(h,p),d=()=>kr(h=>{var p;return this.getAnimationState(h)==="paused"&&((p=this.getAxisMotionValue(h).animation)===null||p===void 0?void 0:p.play())}),{dragSnapToOrigin:f}=this.getProps();this.panSession=new KP(t,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,contextWindow:tE(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&Lt.postRender(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!tf(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=z6(l,this.constraints[t],this.elastic[t])),o.set(l)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,o=this.constraints;n&&Oo(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=B6(i.layoutBox,n):this.constraints=!1,this.elastic=W6(r),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&kr(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=U6(i.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Oo(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Q6(r,i.root,this.visualElement.getTransformPagePoint());let l=V6(i.layout.layoutBox,o);if(n){const u=n(H6(l));this.hasMutatedConstraints=!!u,u&&(l=XP(u))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:l,onDragTransitionEnd:u}=this.getProps(),d=this.constraints||{},f=kr(h=>{if(!tf(h,n,this.currentDirection))return;let p=d&&d[h]||{};l&&(p={min:0,max:0});const g=i?200:1e6,x=i?40:1e7,w={type:"inertia",velocity:r?t[h]:0,bounceStiffness:g,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...o,...p};return this.startAxisValueAnimation(h,w)});return Promise.all(f).then(u)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ky(this.visualElement,t),r.start(_x(t,r,0,n,this.visualElement,!1))}stopAnimation(){kr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){kr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){kr(n=>{const{drag:r}=this.getProps();if(!tf(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:l,max:u}=i.layout.layoutBox[n];o.set(t[n]-Ut(l,u,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Oo(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};kr(l=>{const u=this.getAxisMotionValue(l);if(u&&this.constraints!==!1){const d=u.get();i[l]=$6({min:d,max:d},this.constraints[l])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),kr(l=>{if(!tf(l,t,null))return;const u=this.getAxisMotionValue(l),{min:d,max:f}=this.constraints[l];u.set(Ut(d,f,i[l]))})}addListeners(){if(!this.visualElement.current)return;Y6.set(this.visualElement,this);const t=this.visualElement.current,n=Dc(t,"pointerdown",d=>{const{drag:f,dragListener:h=!0}=this.getProps();f&&h&&this.start(d)}),r=()=>{const{dragConstraints:d}=this.getProps();Oo(d)&&d.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Lt.read(r);const l=Yc(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(kr(h=>{const p=this.getAxisMotionValue(h);p&&(this.originPoint[h]+=d[h].translate,p.set(p.get()+d[h].translate))}),this.visualElement.render())}));return()=>{l(),n(),o(),u&&u()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:l=Iy,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:l,dragMomentum:u}}}function tf(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function J6(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Z6 extends Qa{constructor(t){super(t),this.removeGroupControls=hr,this.removeListeners=hr,this.controls=new X6(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||hr}unmount(){this.removeGroupControls(),this.removeListeners()}}const bj=e=>(t,n)=>{e&&Lt.postRender(()=>e(t,n))};class e8 extends Qa{constructor(){super(...arguments),this.removePointerDownListener=hr}onPointerDown(t){this.session=new KP(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tE(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:bj(t),onStart:bj(n),onMove:r,onEnd:(o,l)=>{delete this.session,i&&Lt.postRender(()=>i(o,l))}}}mount(){this.removePointerDownListener=Dc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function t8(){const e=v.useContext(Nm);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=v.useId();v.useEffect(()=>r(i),[]);const o=v.useCallback(()=>n&&n(i),[i,n]);return!t&&n?[!1,o]:[!0]}const jf={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function wj(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const gc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Qe.test(e))e=parseFloat(e);else return e;const n=wj(e,t.target.x),r=wj(e,t.target.y);return`${n}% ${r}%`}},n8={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Ua.parse(e);if(i.length>5)return r;const o=Ua.createTransformer(e),l=typeof i[0]!="number"?1:0,u=n.x.scale*t.x,d=n.y.scale*t.y;i[0+l]/=u,i[1+l]/=d;const f=Ut(u,d,.5);return typeof i[2+l]=="number"&&(i[2+l]/=f),typeof i[3+l]=="number"&&(i[3+l]/=f),o(i)}};class r8 extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;az(i8),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),jf.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,l=r.projection;return l&&(l.isPresent=o,i||t.layoutDependency!==n||n===void 0?l.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?l.promote():l.relegate()||Lt.postRender(()=>{const u=l.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),X0.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function nE(e){const[t,n]=t8(),r=v.useContext(W0);return a.jsx(r8,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(Kk),isPresent:t,safeToRemove:n})}const i8={borderRadius:{...gc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gc,borderTopRightRadius:gc,borderBottomLeftRadius:gc,borderBottomRightRadius:gc,boxShadow:n8};function a8(e,t,n){const r=Mn(e)?e:Gc(e);return r.start(_x("",r,t,n)),r.animation}function s8(e){return e instanceof SVGElement&&e.tagName!=="svg"}const o8=(e,t)=>e.depth-t.depth;class l8{constructor(){this.children=[],this.isDirty=!1}add(t){dx(this.children,t),this.isDirty=!0}remove(t){fx(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(o8),this.isDirty=!1,this.children.forEach(t)}}function c8(e,t){const n=vi.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&($a(r),e(o-t))};return Lt.read(r,!0),()=>$a(r)}const rE=["TopLeft","TopRight","BottomLeft","BottomRight"],u8=rE.length,_j=e=>typeof e=="string"?parseFloat(e):e,Sj=e=>typeof e=="number"||Qe.test(e);function d8(e,t,n,r,i,o){i?(e.opacity=Ut(0,n.opacity!==void 0?n.opacity:1,f8(r)),e.opacityExit=Ut(t.opacity!==void 0?t.opacity:1,0,m8(r))):o&&(e.opacity=Ut(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let l=0;l<u8;l++){const u=`border${rE[l]}Radius`;let d=jj(t,u),f=jj(n,u);if(d===void 0&&f===void 0)continue;d||(d=0),f||(f=0),d===0||f===0||Sj(d)===Sj(f)?(e[u]=Math.max(Ut(_j(d),_j(f),r),0),(xi.test(f)||xi.test(d))&&(e[u]+="%")):e[u]=f}(t.rotate||n.rotate)&&(e.rotate=Ut(t.rotate||0,n.rotate||0,r))}function jj(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const f8=iE(0,.5,_P),m8=iE(.5,.95,hr);function iE(e,t,n){return r=>r<e?0:r>t?1:n(sl(e,t,r))}function Nj(e,t){e.min=t.min,e.max=t.max}function Cr(e,t){Nj(e.x,t.x),Nj(e.y,t.y)}function Cj(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function kj(e,t,n,r,i){return e-=t,e=Wf(e,1/n,r),i!==void 0&&(e=Wf(e,1/i,r)),e}function h8(e,t=0,n=1,r=.5,i,o=e,l=e){if(xi.test(t)&&(t=parseFloat(t),t=Ut(l.min,l.max,t/100)-l.min),typeof t!="number")return;let u=Ut(o.min,o.max,r);e===o&&(u-=t),e.min=kj(e.min,t,n,u,i),e.max=kj(e.max,t,n,u,i)}function Pj(e,t,[n,r,i],o,l){h8(e,t[n],t[r],t[i],t.scale,o,l)}const p8=["x","scaleX","originX"],g8=["y","scaleY","originY"];function Ej(e,t,n,r){Pj(e.x,t,p8,n?n.x:void 0,r?r.x:void 0),Pj(e.y,t,g8,n?n.y:void 0,r?r.y:void 0)}function Tj(e){return e.translate===0&&e.scale===1}function aE(e){return Tj(e.x)&&Tj(e.y)}function Aj(e,t){return e.min===t.min&&e.max===t.max}function y8(e,t){return Aj(e.x,t.x)&&Aj(e.y,t.y)}function Mj(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function sE(e,t){return Mj(e.x,t.x)&&Mj(e.y,t.y)}function Rj(e){return yr(e.x)/yr(e.y)}function Oj(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class x8{constructor(){this.members=[]}add(t){dx(this.members,t),t.scheduleRender()}remove(t){if(fx(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function v8(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,l=(n==null?void 0:n.z)||0;if((i||o||l)&&(r=`translate3d(${i}px, ${o}px, ${l}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:f,rotate:h,rotateX:p,rotateY:g,skewX:x,skewY:w}=n;f&&(r=`perspective(${f}px) ${r}`),h&&(r+=`rotate(${h}deg) `),p&&(r+=`rotateX(${p}deg) `),g&&(r+=`rotateY(${g}deg) `),x&&(r+=`skewX(${x}deg) `),w&&(r+=`skewY(${w}deg) `)}const u=e.x.scale*t.x,d=e.y.scale*t.y;return(u!==1||d!==1)&&(r+=`scale(${u}, ${d})`),r||"none"}const gs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Tc=typeof window<"u"&&window.MotionDebug!==void 0,gg=["","X","Y","Z"],b8={visibility:"hidden"},Ij=1e3;let w8=0;function yg(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function oE(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=pP(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Lt,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&oE(r)}function lE({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(l={},u=t==null?void 0:t()){this.id=w8++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Tc&&(gs.totalNodes=gs.resolvedTargetDeltas=gs.recalculatedProjection=0),this.nodes.forEach(j8),this.nodes.forEach(E8),this.nodes.forEach(T8),this.nodes.forEach(N8),Tc&&window.MotionDebug.record(gs)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new l8)}addEventListener(l,u){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new mx),this.eventHandlers.get(l).add(u)}notifyListeners(l,...u){const d=this.eventHandlers.get(l);d&&d.notify(...u)}hasListeners(l){return this.eventHandlers.has(l)}mount(l,u=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=s8(l),this.instance=l;const{layoutId:d,layout:f,visualElement:h}=this.options;if(h&&!h.current&&h.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),u&&(f||d)&&(this.isLayoutDirty=!0),e){let p;const g=()=>this.root.updateBlockedByResize=!1;e(l,()=>{this.root.updateBlockedByResize=!0,p&&p(),p=c8(g,250),jf.hasAnimatedSinceResize&&(jf.hasAnimatedSinceResize=!1,this.nodes.forEach(Lj))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&h&&(d||f)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:g,hasRelativeTargetChanged:x,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||h.getDefaultTransition()||I8,{onLayoutAnimationStart:N,onLayoutAnimationComplete:C}=h.getProps(),k=!this.targetLayout||!sE(this.targetLayout,w)||x,P=!g&&x;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||P||g&&(k||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(p,P);const T={...ox(_,"layout"),onPlay:N,onComplete:C};(h.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T)}else g||Lj(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,$a(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(A8),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&oE(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const p=this.path[h];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:u,layout:d}=this.options;if(u===void 0&&!d)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Dj);return}this.isUpdating||this.nodes.forEach(k8),this.isUpdating=!1,this.nodes.forEach(P8),this.nodes.forEach(_8),this.nodes.forEach(S8),this.clearAllSnapshots();const u=vi.now();wn.delta=Yi(0,1e3/60,u-wn.timestamp),wn.timestamp=u,wn.isProcessing=!0,og.update.process(wn),og.preRender.process(wn),og.render.process(wn),wn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,X0.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(C8),this.sharedNodes.forEach(M8)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Lt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Lt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Jt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(u=!1),u){const d=r(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:d,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!i)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!aE(this.projectionDelta),d=this.getTransformTemplate(),f=d?d(this.latestValues,""):void 0,h=f!==this.prevTransformTemplateValue;l&&(u||ps(this.latestValues)||h)&&(i(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const u=this.measurePageBox();let d=this.removeElementScroll(u);return l&&(d=this.removeTransform(d)),D8(d),{animationId:this.root.animationId,measuredBox:u,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:u}=this.options;if(!u)return Jt();const d=u.measureViewportBox();if(!(((l=this.scroll)===null||l===void 0?void 0:l.wasRoot)||this.path.some(L8))){const{scroll:h}=this.root;h&&(Lo(d.x,h.offset.x),Lo(d.y,h.offset.y))}return d}removeElementScroll(l){var u;const d=Jt();if(Cr(d,l),!((u=this.scroll)===null||u===void 0)&&u.wasRoot)return d;for(let f=0;f<this.path.length;f++){const h=this.path[f],{scroll:p,options:g}=h;h!==this.root&&p&&g.layoutScroll&&(p.wasRoot&&Cr(d,l),Lo(d.x,p.offset.x),Lo(d.y,p.offset.y))}return d}applyTransform(l,u=!1){const d=Jt();Cr(d,l);for(let f=0;f<this.path.length;f++){const h=this.path[f];!u&&h.options.layoutScroll&&h.scroll&&h!==h.root&&qo(d,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),ps(h.latestValues)&&qo(d,h.latestValues)}return ps(this.latestValues)&&qo(d,this.latestValues),d}removeTransform(l){const u=Jt();Cr(u,l);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!f.instance||!ps(f.latestValues))continue;Dy(f.latestValues)&&f.updateSnapshot();const h=Jt(),p=f.measurePageBox();Cr(h,p),Ej(u,f.latestValues,f.snapshot?f.snapshot.layoutBox:void 0,h)}return ps(this.latestValues)&&Ej(u,this.latestValues),u}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==wn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){var u;const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==d;if(!(l||f&&this.isSharedProjectionDirty||this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:g}=this.options;if(!(!this.layout||!(p||g))){if(this.resolvedRelativeTargetAt=wn.timestamp,!this.targetDelta&&!this.relativeTarget){const x=this.getClosestProjectingParent();x&&x.layout&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Jt(),this.relativeTargetOrigin=Jt(),qc(this.relativeTargetOrigin,this.layout.layoutBox,x.layout.layoutBox),Cr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Jt(),this.targetWithTransforms=Jt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),F6(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Cr(this.target,this.layout.layoutBox),ZP(this.target,this.targetDelta)):Cr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const x=this.getClosestProjectingParent();x&&!!x.resumingFrom==!!this.resumingFrom&&!x.options.layoutScroll&&x.target&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Jt(),this.relativeTargetOrigin=Jt(),qc(this.relativeTargetOrigin,this.target,x.target),Cr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Tc&&gs.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Dy(this.parent.latestValues)||JP(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var l;const u=this.getLead(),d=!!this.resumingFrom||this!==u;let f=!0;if((this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty)&&(f=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===wn.timestamp&&(f=!1),f)return;const{layout:h,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||p))return;Cr(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,x=this.treeScale.y;G6(this.layoutCorrected,this.treeScale,this.path,d),u.layout&&!u.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(u.target=u.layout.layoutBox,u.targetWithTransforms=Jt());const{target:w}=u;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Cj(this.prevProjectionDelta.x,this.projectionDelta.x),Cj(this.prevProjectionDelta.y,this.projectionDelta.y)),Lc(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==x||!Oj(this.projectionDelta.x,this.prevProjectionDelta.x)||!Oj(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",w)),Tc&&gs.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){var u;if((u=this.options.visualElement)===null||u===void 0||u.scheduleRender(),l){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Do(),this.projectionDelta=Do(),this.projectionDeltaWithTransform=Do()}setAnimationOrigin(l,u=!1){const d=this.snapshot,f=d?d.latestValues:{},h={...this.latestValues},p=Do();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const g=Jt(),x=d?d.source:void 0,w=this.layout?this.layout.source:void 0,_=x!==w,N=this.getStack(),C=!N||N.members.length<=1,k=!!(_&&!C&&this.options.crossfade===!0&&!this.path.some(O8));this.animationProgress=0;let P;this.mixTargetDelta=T=>{const S=T/1e3;qj(p.x,l.x,S),qj(p.y,l.y,S),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qc(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox),R8(this.relativeTarget,this.relativeTargetOrigin,g,S),P&&y8(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=Jt()),Cr(P,this.relativeTarget)),_&&(this.animationValues=h,d8(h,f,this.latestValues,S,k,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&($a(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Lt.update(()=>{jf.hasAnimatedSinceResize=!0,this.currentAnimation=a8(0,Ij,{...l,onUpdate:u=>{this.mixTargetDelta(u),l.onUpdate&&l.onUpdate(u)},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ij),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:u,target:d,layout:f,latestValues:h}=l;if(!(!u||!d||!f)){if(this!==l&&this.layout&&f&&cE(this.options.animationType,this.layout.layoutBox,f.layoutBox)){d=this.target||Jt();const p=yr(this.layout.layoutBox.x);d.x.min=l.target.x.min,d.x.max=d.x.min+p;const g=yr(this.layout.layoutBox.y);d.y.min=l.target.y.min,d.y.max=d.y.min+g}Cr(u,d),qo(u,h),Lc(this.projectionDeltaWithTransform,this.layoutCorrected,u,h)}}registerSharedNode(l,u){this.sharedNodes.has(l)||this.sharedNodes.set(l,new x8),this.sharedNodes.get(l).add(u);const f=u.options.initialPromotionConfig;u.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(u):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var l;const{layoutId:u}=this.options;return u?((l=this.getStack())===null||l===void 0?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:u}=this.options;return u?(l=this.getStack())===null||l===void 0?void 0:l.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:u,preserveFollowOpacity:d}={}){const f=this.getStack();f&&f.promote(this,d),l&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let u=!1;const{latestValues:d}=l;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(u=!0),!u)return;const f={};d.z&&yg("z",l,f,this.animationValues);for(let h=0;h<gg.length;h++)yg(`rotate${gg[h]}`,l,f,this.animationValues),yg(`skew${gg[h]}`,l,f,this.animationValues);l.render();for(const h in f)l.setStaticValue(h,f[h]),this.animationValues&&(this.animationValues[h]=f[h]);l.scheduleRender()}getProjectionStyles(l){var u,d;if(!this.instance||this.isSVG)return;if(!this.isVisible)return b8;const f={visibility:""},h=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,f.opacity="",f.pointerEvents=_f(l==null?void 0:l.pointerEvents)||"",f.transform=h?h(this.latestValues,""):"none",f;const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){const _={};return this.options.layoutId&&(_.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,_.pointerEvents=_f(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!ps(this.latestValues)&&(_.transform=h?h({},""):"none",this.hasProjected=!1),_}const g=p.animationValues||p.latestValues;this.applyTransformsToTarget(),f.transform=v8(this.projectionDeltaWithTransform,this.treeScale,g),h&&(f.transform=h(g,f.transform));const{x,y:w}=this.projectionDelta;f.transformOrigin=`${x.origin*100}% ${w.origin*100}% 0`,p.animationValues?f.opacity=p===this?(d=(u=g.opacity)!==null&&u!==void 0?u:this.latestValues.opacity)!==null&&d!==void 0?d:1:this.preserveOpacity?this.latestValues.opacity:g.opacityExit:f.opacity=p===this?g.opacity!==void 0?g.opacity:"":g.opacityExit!==void 0?g.opacityExit:0;for(const _ in zf){if(g[_]===void 0)continue;const{correct:N,applyTo:C}=zf[_],k=f.transform==="none"?g[_]:N(g[_],p);if(C){const P=C.length;for(let T=0;T<P;T++)f[C[T]]=k}else f[_]=k}return this.options.layoutId&&(f.pointerEvents=p===this?_f(l==null?void 0:l.pointerEvents)||"":"none"),f}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var u;return(u=l.currentAnimation)===null||u===void 0?void 0:u.stop()}),this.root.nodes.forEach(Dj),this.root.sharedNodes.clear()}}}function _8(e){e.updateLayout()}function S8(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,l=n.source!==e.layout.source;o==="size"?kr(p=>{const g=l?n.measuredBox[p]:n.layoutBox[p],x=yr(g);g.min=r[p].min,g.max=g.min+x}):cE(o,n.layoutBox,r)&&kr(p=>{const g=l?n.measuredBox[p]:n.layoutBox[p],x=yr(r[p]);g.max=g.min+x,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+x)});const u=Do();Lc(u,r,n.layoutBox);const d=Do();l?Lc(d,e.applyTransform(i,!0),n.measuredBox):Lc(d,r,n.layoutBox);const f=!aE(u);let h=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:g,layout:x}=p;if(g&&x){const w=Jt();qc(w,n.layoutBox,g.layoutBox);const _=Jt();qc(_,r,x.layoutBox),sE(w,_)||(h=!0),p.options.layoutRoot&&(e.relativeTarget=_,e.relativeTargetOrigin=w,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:d,layoutDelta:u,hasLayoutChanged:f,hasRelativeTargetChanged:h})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function j8(e){Tc&&gs.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function N8(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function C8(e){e.clearSnapshot()}function Dj(e){e.clearMeasurements()}function k8(e){e.isLayoutDirty=!1}function P8(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Lj(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function E8(e){e.resolveTargetDelta()}function T8(e){e.calcProjection()}function A8(e){e.resetSkewAndRotation()}function M8(e){e.removeLeadSnapshot()}function qj(e,t,n){e.translate=Ut(t.translate,0,n),e.scale=Ut(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Fj(e,t,n,r){e.min=Ut(t.min,n.min,r),e.max=Ut(t.max,n.max,r)}function R8(e,t,n,r){Fj(e.x,t.x,n.x,r),Fj(e.y,t.y,n.y,r)}function O8(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const I8={duration:.45,ease:[.4,0,.1,1]},zj=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Bj=zj("applewebkit/")&&!zj("chrome/")?Math.round:hr;function Vj(e){e.min=Bj(e.min),e.max=Bj(e.max)}function D8(e){Vj(e.x),Vj(e.y)}function cE(e,t,n){return e==="position"||e==="preserve-aspect"&&!q6(Rj(t),Rj(n),.2)}function L8(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const q8=lE({attachResizeListener:(e,t)=>Yc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xg={current:void 0},uE=lE({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!xg.current){const e=new q8({});e.mount(window),e.setOptions({layoutScroll:!0}),xg.current=e}return xg.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),F8={pan:{Feature:e8},drag:{Feature:Z6,ProjectionNode:uE,MeasureLayout:nE}};function $j(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&Lt.postRender(()=>o(t,Nu(t)))}class z8 extends Qa{mount(){const{current:t}=this.node;t&&(this.unmount=Lz(t,n=>($j(this.node,n,"Start"),r=>$j(this.node,r,"End"))))}unmount(){}}class B8 extends Qa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ju(Yc(this.node.current,"focus",()=>this.onFocus()),Yc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Uj(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=r[i];o&&Lt.postRender(()=>o(t,Nu(t)))}class V8 extends Qa{mount(){const{current:t}=this.node;t&&(this.unmount=Bz(t,n=>(Uj(this.node,n,"Start"),(r,{success:i})=>Uj(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const qy=new WeakMap,vg=new WeakMap,$8=e=>{const t=qy.get(e.target);t&&t(e)},U8=e=>{e.forEach($8)};function W8({root:e,...t}){const n=e||document;vg.has(n)||vg.set(n,{});const r=vg.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(U8,{root:e,...t})),r[i]}function H8(e,t,n){const r=W8(t);return qy.set(e,n),r.observe(e),()=>{qy.delete(e),r.unobserve(e)}}const K8={some:0,all:1};class G8 extends Qa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:K8[i]},u=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,o&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:h,onViewportLeave:p}=this.node.getProps(),g=f?h:p;g&&g(d)};return H8(this.node.current,l,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Q8(t,n))&&this.startObserver()}unmount(){}}function Q8({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Y8={inView:{Feature:G8},tap:{Feature:V8},focus:{Feature:B8},hover:{Feature:z8}},X8={layout:{ProjectionNode:uE,MeasureLayout:nE}},Fy={current:null},dE={current:!1};function J8(){if(dE.current=!0,!!K0)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Fy.current=e.matches;e.addListener(t),t()}else Fy.current=!1}function Z8(e,t,n){for(const r in t){const i=t[r],o=n[r];if(Mn(i))e.addValue(r,i);else if(Mn(o))e.addValue(r,Gc(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const l=e.getValue(r);l.liveStyle===!0?l.jump(i):l.hasAnimated||l.set(i)}else{const l=e.getStaticValue(r);e.addValue(r,Gc(l!==void 0?l:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Wj=new WeakMap,eV=[...PP,En,Ua],tV=e=>eV.find(kP(e)),Hj=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class nV{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:l},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=gx,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const g=vi.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,Lt.render(this.render,!1,!0))};const{latestValues:d,renderState:f}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=f,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=Em(n),this.isVariantNode=Wk(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const g in p){const x=p[g];d[g]!==void 0&&Mn(x)&&x.set(d[g],!1)}}mount(t){this.current=t,Wj.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),dE.current||J8(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Fy.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Wj.delete(this.current),this.projection&&this.projection.unmount(),$a(this.notifyUpdate),$a(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Xs.has(t),i=n.on("change",u=>{this.latestValues[t]=u,this.props.onUpdate&&Lt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let l;window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o(),l&&l(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ol){const n=ol[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Jt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Hj.length;r++){const i=Hj[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,l=t[o];l&&(this.propEventSubscriptions[i]=this.on(i,l))}this.prevMotionValues=Z8(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Gc(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(NP(i)||jP(i))?i=parseFloat(i):!tV(i)&&Ua.test(n)&&(i=DP(t,n)),this.setBaseTarget(t,Mn(i)?i.get():i)),Mn(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const l=ex(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);l&&(i=l[t])}if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Mn(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new mx),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class fE extends nV{constructor(){super(...arguments),this.KeyframeResolver=LP}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Mn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function rV(e){return window.getComputedStyle(e)}class iV extends fE{constructor(){super(...arguments),this.type="html",this.renderInstance=Qk}readValueFromInstance(t,n){if(Xs.has(n)){const r=vx(n);return r&&r.default||0}else{const r=rV(t),i=(iP(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return eE(t,n)}build(t,n,r){ix(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Z0(t,n,r)}}class aV extends fE{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Jt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Xs.has(n)){const r=vx(n);return r&&r.default||0}return n=Yk.has(n)?n:Y0(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Zk(t,n,r)}build(t,n,r){ax(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){Xk(t,n,r,i)}mount(t){this.isSVGTag=sx(t.tagName),super.mount(t)}}const sV=(e,t)=>J0(e)?new aV(t):new iV(t,{allowProjection:e!==v.Fragment}),oV=Tz({...E6,...Y8,...F8,...X8},sV),bt=H3(oV);function zy(e,[t,n]){return Math.min(n,Math.max(t,e))}function lV(e,t=globalThis==null?void 0:globalThis.document){const n=_n(e);v.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var cV="DismissableLayer",By="dismissableLayer.update",uV="dismissableLayer.pointerDownOutside",dV="dismissableLayer.focusOutside",Kj,mE=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Cu=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...d}=e,f=v.useContext(mE),[h,p]=v.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=v.useState({}),w=ct(t,z=>p(z)),_=Array.from(f.layers),[N]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),C=_.indexOf(N),k=h?_.indexOf(h):-1,P=f.layersWithOutsidePointerEventsDisabled.size>0,T=k>=C,S=hV(z=>{const D=z.target,K=[...f.branches].some(U=>U.contains(D));!T||K||(i==null||i(z),l==null||l(z),z.defaultPrevented||u==null||u())},g),E=pV(z=>{const D=z.target;[...f.branches].some(U=>U.contains(D))||(o==null||o(z),l==null||l(z),z.defaultPrevented||u==null||u())},g);return lV(z=>{k===f.layers.size-1&&(r==null||r(z),!z.defaultPrevented&&u&&(z.preventDefault(),u()))},g),v.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Kj=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),Gj(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Kj)}},[h,g,n,f]),v.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),Gj())},[h,f]),v.useEffect(()=>{const z=()=>x({});return document.addEventListener(By,z),()=>document.removeEventListener(By,z)},[]),a.jsx(Xe.div,{...d,ref:w,style:{pointerEvents:P?T?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,S.onPointerDownCapture)})});Cu.displayName=cV;var fV="DismissableLayerBranch",mV=v.forwardRef((e,t)=>{const n=v.useContext(mE),r=v.useRef(null),i=ct(t,r);return v.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),a.jsx(Xe.div,{...e,ref:i})});mV.displayName=fV;function hV(e,t=globalThis==null?void 0:globalThis.document){const n=_n(e),r=v.useRef(!1),i=v.useRef(()=>{});return v.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let d=function(){hE(uV,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function pV(e,t=globalThis==null?void 0:globalThis.document){const n=_n(e),r=v.useRef(!1);return v.useEffect(()=>{const i=o=>{o.target&&!r.current&&hE(dV,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Gj(){const e=new CustomEvent(By);document.dispatchEvent(e)}function hE(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?hk(i,o):i.dispatchEvent(o)}var bg=0;function Sx(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Qj()),document.body.insertAdjacentElement("beforeend",e[1]??Qj()),bg++,()=>{bg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),bg--}},[])}function Qj(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var wg="focusScope.autoFocusOnMount",_g="focusScope.autoFocusOnUnmount",Yj={bubbles:!1,cancelable:!0},gV="FocusScope",Mm=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[u,d]=v.useState(null),f=_n(i),h=_n(o),p=v.useRef(null),g=ct(t,_=>d(_)),x=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let _=function(P){if(x.paused||!u)return;const T=P.target;u.contains(T)?p.current=T:Ca(p.current,{select:!0})},N=function(P){if(x.paused||!u)return;const T=P.relatedTarget;T!==null&&(u.contains(T)||Ca(p.current,{select:!0}))},C=function(P){if(document.activeElement===document.body)for(const S of P)S.removedNodes.length>0&&Ca(u)};document.addEventListener("focusin",_),document.addEventListener("focusout",N);const k=new MutationObserver(C);return u&&k.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",N),k.disconnect()}}},[r,u,x.paused]),v.useEffect(()=>{if(u){Jj.add(x);const _=document.activeElement;if(!u.contains(_)){const C=new CustomEvent(wg,Yj);u.addEventListener(wg,f),u.dispatchEvent(C),C.defaultPrevented||(yV(_V(pE(u)),{select:!0}),document.activeElement===_&&Ca(u))}return()=>{u.removeEventListener(wg,f),setTimeout(()=>{const C=new CustomEvent(_g,Yj);u.addEventListener(_g,h),u.dispatchEvent(C),C.defaultPrevented||Ca(_??document.body,{select:!0}),u.removeEventListener(_g,h),Jj.remove(x)},0)}}},[u,f,h,x]);const w=v.useCallback(_=>{if(!n&&!r||x.paused)return;const N=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,C=document.activeElement;if(N&&C){const k=_.currentTarget,[P,T]=xV(k);P&&T?!_.shiftKey&&C===T?(_.preventDefault(),n&&Ca(P,{select:!0})):_.shiftKey&&C===P&&(_.preventDefault(),n&&Ca(T,{select:!0})):C===k&&_.preventDefault()}},[n,r,x.paused]);return a.jsx(Xe.div,{tabIndex:-1,...l,ref:g,onKeyDown:w})});Mm.displayName=gV;function yV(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ca(r,{select:t}),document.activeElement!==n)return}function xV(e){const t=pE(e),n=Xj(t,e),r=Xj(t.reverse(),e);return[n,r]}function pE(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Xj(e,t){for(const n of e)if(!vV(n,{upTo:t}))return n}function vV(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function bV(e){return e instanceof HTMLInputElement&&"select"in e}function Ca(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bV(e)&&t&&e.select()}}var Jj=wV();function wV(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Zj(e,t),e.unshift(t)},remove(t){var n;e=Zj(e,t),(n=e[0])==null||n.resume()}}}function Zj(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function _V(e){return e.filter(t=>t.tagName!=="A")}const SV=["top","right","bottom","left"],Wa=Math.min,fr=Math.max,Hf=Math.round,nf=Math.floor,bi=e=>({x:e,y:e}),jV={left:"right",right:"left",bottom:"top",top:"bottom"},NV={start:"end",end:"start"};function Vy(e,t,n){return fr(e,Wa(t,n))}function Xi(e,t){return typeof e=="function"?e(t):e}function Ji(e){return e.split("-")[0]}function _l(e){return e.split("-")[1]}function jx(e){return e==="x"?"y":"x"}function Nx(e){return e==="y"?"height":"width"}const CV=new Set(["top","bottom"]);function gi(e){return CV.has(Ji(e))?"y":"x"}function Cx(e){return jx(gi(e))}function kV(e,t,n){n===void 0&&(n=!1);const r=_l(e),i=Cx(e),o=Nx(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Kf(l)),[l,Kf(l)]}function PV(e){const t=Kf(e);return[$y(e),t,$y(t)]}function $y(e){return e.replace(/start|end/g,t=>NV[t])}const e1=["left","right"],t1=["right","left"],EV=["top","bottom"],TV=["bottom","top"];function AV(e,t,n){switch(e){case"top":case"bottom":return n?t?t1:e1:t?e1:t1;case"left":case"right":return t?EV:TV;default:return[]}}function MV(e,t,n,r){const i=_l(e);let o=AV(Ji(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map($y)))),o}function Kf(e){return e.replace(/left|right|bottom|top/g,t=>jV[t])}function RV(e){return{top:0,right:0,bottom:0,left:0,...e}}function gE(e){return typeof e!="number"?RV(e):{top:e,right:e,bottom:e,left:e}}function Gf(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function n1(e,t,n){let{reference:r,floating:i}=e;const o=gi(t),l=Cx(t),u=Nx(l),d=Ji(t),f=o==="y",h=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,g=r[u]/2-i[u]/2;let x;switch(d){case"top":x={x:h,y:r.y-i.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-i.width,y:p};break;default:x={x:r.x,y:r.y}}switch(_l(t)){case"start":x[l]-=g*(n&&f?-1:1);break;case"end":x[l]+=g*(n&&f?-1:1);break}return x}const OV=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,u=o.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:p}=n1(f,r,d),g=r,x={},w=0;for(let _=0;_<u.length;_++){const{name:N,fn:C}=u[_],{x:k,y:P,data:T,reset:S}=await C({x:h,y:p,initialPlacement:r,placement:g,strategy:i,middlewareData:x,rects:f,platform:l,elements:{reference:e,floating:t}});h=k??h,p=P??p,x={...x,[N]:{...x[N],...T}},S&&w<=50&&(w++,typeof S=="object"&&(S.placement&&(g=S.placement),S.rects&&(f=S.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:h,y:p}=n1(f,g,d)),_=-1)}return{x:h,y:p,placement:g,strategy:i,middlewareData:x}};async function Xc(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:l,elements:u,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:g=!1,padding:x=0}=Xi(t,e),w=gE(x),N=u[g?p==="floating"?"reference":"floating":p],C=Gf(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(N)))==null||n?N:N.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:f,rootBoundary:h,strategy:d})),k=p==="floating"?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,P=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),T=await(o.isElement==null?void 0:o.isElement(P))?await(o.getScale==null?void 0:o.getScale(P))||{x:1,y:1}:{x:1,y:1},S=Gf(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:k,offsetParent:P,strategy:d}):k);return{top:(C.top-S.top+w.top)/T.y,bottom:(S.bottom-C.bottom+w.bottom)/T.y,left:(C.left-S.left+w.left)/T.x,right:(S.right-C.right+w.right)/T.x}}const IV=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:u,middlewareData:d}=t,{element:f,padding:h=0}=Xi(e,t)||{};if(f==null)return{};const p=gE(h),g={x:n,y:r},x=Cx(i),w=Nx(x),_=await l.getDimensions(f),N=x==="y",C=N?"top":"left",k=N?"bottom":"right",P=N?"clientHeight":"clientWidth",T=o.reference[w]+o.reference[x]-g[x]-o.floating[w],S=g[x]-o.reference[x],E=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let z=E?E[P]:0;(!z||!await(l.isElement==null?void 0:l.isElement(E)))&&(z=u.floating[P]||o.floating[w]);const D=T/2-S/2,K=z/2-_[w]/2-1,U=Wa(p[C],K),W=Wa(p[k],K),G=U,R=z-_[w]-W,q=z/2-_[w]/2+D,J=Vy(G,q,R),ae=!d.arrow&&_l(i)!=null&&q!==J&&o.reference[w]/2-(q<G?U:W)-_[w]/2<0,re=ae?q<G?q-G:q-R:0;return{[x]:g[x]+re,data:{[x]:J,centerOffset:q-J-re,...ae&&{alignmentOffset:re}},reset:ae}}}),DV=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:l,initialPlacement:u,platform:d,elements:f}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:_=!0,...N}=Xi(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const C=Ji(i),k=gi(u),P=Ji(u)===u,T=await(d.isRTL==null?void 0:d.isRTL(f.floating)),S=g||(P||!_?[Kf(u)]:PV(u)),E=w!=="none";!g&&E&&S.push(...MV(u,_,w,T));const z=[u,...S],D=await Xc(t,N),K=[];let U=((r=o.flip)==null?void 0:r.overflows)||[];if(h&&K.push(D[C]),p){const q=kV(i,l,T);K.push(D[q[0]],D[q[1]])}if(U=[...U,{placement:i,overflows:K}],!K.every(q=>q<=0)){var W,G;const q=(((W=o.flip)==null?void 0:W.index)||0)+1,J=z[q];if(J&&(!(p==="alignment"?k!==gi(J):!1)||U.every(L=>gi(L.placement)===k?L.overflows[0]>0:!0)))return{data:{index:q,overflows:U},reset:{placement:J}};let ae=(G=U.filter(re=>re.overflows[0]<=0).sort((re,L)=>re.overflows[1]-L.overflows[1])[0])==null?void 0:G.placement;if(!ae)switch(x){case"bestFit":{var R;const re=(R=U.filter(L=>{if(E){const Y=gi(L.placement);return Y===k||Y==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(Y=>Y>0).reduce((Y,M)=>Y+M,0)]).sort((L,Y)=>L[1]-Y[1])[0])==null?void 0:R[0];re&&(ae=re);break}case"initialPlacement":ae=u;break}if(i!==ae)return{reset:{placement:ae}}}return{}}}};function r1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function i1(e){return SV.some(t=>e[t]>=0)}const LV=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Xi(e,t);switch(r){case"referenceHidden":{const o=await Xc(t,{...i,elementContext:"reference"}),l=r1(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:i1(l)}}}case"escaped":{const o=await Xc(t,{...i,altBoundary:!0}),l=r1(o,n.floating);return{data:{escapedOffsets:l,escaped:i1(l)}}}default:return{}}}}},yE=new Set(["left","top"]);async function qV(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=Ji(n),u=_l(n),d=gi(n)==="y",f=yE.has(l)?-1:1,h=o&&d?-1:1,p=Xi(t,e);let{mainAxis:g,crossAxis:x,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof w=="number"&&(x=u==="end"?w*-1:w),d?{x:x*h,y:g*f}:{x:g*f,y:x*h}}const FV=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:u}=t,d=await qV(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:o+d.y,data:{...d,placement:l}}}}},zV=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:N=>{let{x:C,y:k}=N;return{x:C,y:k}}},...d}=Xi(e,t),f={x:n,y:r},h=await Xc(t,d),p=gi(Ji(i)),g=jx(p);let x=f[g],w=f[p];if(o){const N=g==="y"?"top":"left",C=g==="y"?"bottom":"right",k=x+h[N],P=x-h[C];x=Vy(k,x,P)}if(l){const N=p==="y"?"top":"left",C=p==="y"?"bottom":"right",k=w+h[N],P=w-h[C];w=Vy(k,w,P)}const _=u.fn({...t,[g]:x,[p]:w});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[g]:o,[p]:l}}}}}},BV=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=Xi(e,t),h={x:n,y:r},p=gi(i),g=jx(p);let x=h[g],w=h[p];const _=Xi(u,t),N=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(d){const P=g==="y"?"height":"width",T=o.reference[g]-o.floating[P]+N.mainAxis,S=o.reference[g]+o.reference[P]-N.mainAxis;x<T?x=T:x>S&&(x=S)}if(f){var C,k;const P=g==="y"?"width":"height",T=yE.has(Ji(i)),S=o.reference[p]-o.floating[P]+(T&&((C=l.offset)==null?void 0:C[p])||0)+(T?0:N.crossAxis),E=o.reference[p]+o.reference[P]+(T?0:((k=l.offset)==null?void 0:k[p])||0)-(T?N.crossAxis:0);w<S?w=S:w>E&&(w=E)}return{[g]:x,[p]:w}}}},VV=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:u}=t,{apply:d=()=>{},...f}=Xi(e,t),h=await Xc(t,f),p=Ji(i),g=_l(i),x=gi(i)==="y",{width:w,height:_}=o.floating;let N,C;p==="top"||p==="bottom"?(N=p,C=g===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(C=p,N=g==="end"?"top":"bottom");const k=_-h.top-h.bottom,P=w-h.left-h.right,T=Wa(_-h[N],k),S=Wa(w-h[C],P),E=!t.middlewareData.shift;let z=T,D=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=P),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(z=k),E&&!g){const U=fr(h.left,0),W=fr(h.right,0),G=fr(h.top,0),R=fr(h.bottom,0);x?D=w-2*(U!==0||W!==0?U+W:fr(h.left,h.right)):z=_-2*(G!==0||R!==0?G+R:fr(h.top,h.bottom))}await d({...t,availableWidth:D,availableHeight:z});const K=await l.getDimensions(u.floating);return w!==K.width||_!==K.height?{reset:{rects:!0}}:{}}}};function Rm(){return typeof window<"u"}function Sl(e){return xE(e)?(e.nodeName||"").toLowerCase():"#document"}function pr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ci(e){var t;return(t=(xE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xE(e){return Rm()?e instanceof Node||e instanceof pr(e).Node:!1}function Xr(e){return Rm()?e instanceof Element||e instanceof pr(e).Element:!1}function ji(e){return Rm()?e instanceof HTMLElement||e instanceof pr(e).HTMLElement:!1}function a1(e){return!Rm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pr(e).ShadowRoot}const $V=new Set(["inline","contents"]);function ku(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Jr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!$V.has(i)}const UV=new Set(["table","td","th"]);function WV(e){return UV.has(Sl(e))}const HV=[":popover-open",":modal"];function Om(e){return HV.some(t=>{try{return e.matches(t)}catch{return!1}})}const KV=["transform","translate","scale","rotate","perspective"],GV=["transform","translate","scale","rotate","perspective","filter"],QV=["paint","layout","strict","content"];function kx(e){const t=Px(),n=Xr(e)?Jr(e):e;return KV.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||GV.some(r=>(n.willChange||"").includes(r))||QV.some(r=>(n.contain||"").includes(r))}function YV(e){let t=Ha(e);for(;ji(t)&&!cl(t);){if(kx(t))return t;if(Om(t))return null;t=Ha(t)}return null}function Px(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const XV=new Set(["html","body","#document"]);function cl(e){return XV.has(Sl(e))}function Jr(e){return pr(e).getComputedStyle(e)}function Im(e){return Xr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ha(e){if(Sl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||a1(e)&&e.host||Ci(e);return a1(t)?t.host:t}function vE(e){const t=Ha(e);return cl(t)?e.ownerDocument?e.ownerDocument.body:e.body:ji(t)&&ku(t)?t:vE(t)}function Jc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=vE(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=pr(i);if(o){const u=Uy(l);return t.concat(l,l.visualViewport||[],ku(i)?i:[],u&&n?Jc(u):[])}return t.concat(i,Jc(i,[],n))}function Uy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bE(e){const t=Jr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ji(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,u=Hf(n)!==o||Hf(r)!==l;return u&&(n=o,r=l),{width:n,height:r,$:u}}function Ex(e){return Xr(e)?e:e.contextElement}function zo(e){const t=Ex(e);if(!ji(t))return bi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=bE(t);let l=(o?Hf(n.width):n.width)/r,u=(o?Hf(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const JV=bi(0);function wE(e){const t=pr(e);return!Px()||!t.visualViewport?JV:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZV(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==pr(e)?!1:t}function $s(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Ex(e);let l=bi(1);t&&(r?Xr(r)&&(l=zo(r)):l=zo(e));const u=ZV(o,n,r)?wE(o):bi(0);let d=(i.left+u.x)/l.x,f=(i.top+u.y)/l.y,h=i.width/l.x,p=i.height/l.y;if(o){const g=pr(o),x=r&&Xr(r)?pr(r):r;let w=g,_=Uy(w);for(;_&&r&&x!==w;){const N=zo(_),C=_.getBoundingClientRect(),k=Jr(_),P=C.left+(_.clientLeft+parseFloat(k.paddingLeft))*N.x,T=C.top+(_.clientTop+parseFloat(k.paddingTop))*N.y;d*=N.x,f*=N.y,h*=N.x,p*=N.y,d+=P,f+=T,w=pr(_),_=Uy(w)}}return Gf({width:h,height:p,x:d,y:f})}function Dm(e,t){const n=Im(e).scrollLeft;return t?t.left+n:$s(Ci(e)).left+n}function _E(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Dm(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function e$(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=Ci(r),u=t?Om(t.floating):!1;if(r===l||u&&o)return n;let d={scrollLeft:0,scrollTop:0},f=bi(1);const h=bi(0),p=ji(r);if((p||!p&&!o)&&((Sl(r)!=="body"||ku(l))&&(d=Im(r)),ji(r))){const x=$s(r);f=zo(r),h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}const g=l&&!p&&!o?_E(l,d):bi(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+g.x,y:n.y*f.y-d.scrollTop*f.y+h.y+g.y}}function t$(e){return Array.from(e.getClientRects())}function n$(e){const t=Ci(e),n=Im(e),r=e.ownerDocument.body,i=fr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=fr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Dm(e);const u=-n.scrollTop;return Jr(r).direction==="rtl"&&(l+=fr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:u}}const s1=25;function r$(e,t){const n=pr(e),r=Ci(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,u=0,d=0;if(i){o=i.width,l=i.height;const h=Px();(!h||h&&t==="fixed")&&(u=i.offsetLeft,d=i.offsetTop)}const f=Dm(r);if(f<=0){const h=r.ownerDocument,p=h.body,g=getComputedStyle(p),x=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,w=Math.abs(r.clientWidth-p.clientWidth-x);w<=s1&&(o-=w)}else f<=s1&&(o+=f);return{width:o,height:l,x:u,y:d}}const i$=new Set(["absolute","fixed"]);function a$(e,t){const n=$s(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=ji(e)?zo(e):bi(1),l=e.clientWidth*o.x,u=e.clientHeight*o.y,d=i*o.x,f=r*o.y;return{width:l,height:u,x:d,y:f}}function o1(e,t,n){let r;if(t==="viewport")r=r$(e,n);else if(t==="document")r=n$(Ci(e));else if(Xr(t))r=a$(t,n);else{const i=wE(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Gf(r)}function SE(e,t){const n=Ha(e);return n===t||!Xr(n)||cl(n)?!1:Jr(n).position==="fixed"||SE(n,t)}function s$(e,t){const n=t.get(e);if(n)return n;let r=Jc(e,[],!1).filter(u=>Xr(u)&&Sl(u)!=="body"),i=null;const o=Jr(e).position==="fixed";let l=o?Ha(e):e;for(;Xr(l)&&!cl(l);){const u=Jr(l),d=kx(l);!d&&u.position==="fixed"&&(i=null),(o?!d&&!i:!d&&u.position==="static"&&!!i&&i$.has(i.position)||ku(l)&&!d&&SE(e,l))?r=r.filter(h=>h!==l):i=u,l=Ha(l)}return t.set(e,r),r}function o$(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?Om(t)?[]:s$(t,this._c):[].concat(n),r],u=l[0],d=l.reduce((f,h)=>{const p=o1(t,h,i);return f.top=fr(p.top,f.top),f.right=Wa(p.right,f.right),f.bottom=Wa(p.bottom,f.bottom),f.left=fr(p.left,f.left),f},o1(t,u,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function l$(e){const{width:t,height:n}=bE(e);return{width:t,height:n}}function c$(e,t,n){const r=ji(t),i=Ci(t),o=n==="fixed",l=$s(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const d=bi(0);function f(){d.x=Dm(i)}if(r||!r&&!o)if((Sl(t)!=="body"||ku(i))&&(u=Im(t)),r){const x=$s(t,!0,o,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else i&&f();o&&!r&&i&&f();const h=i&&!r&&!o?_E(i,u):bi(0),p=l.left+u.scrollLeft-d.x-h.x,g=l.top+u.scrollTop-d.y-h.y;return{x:p,y:g,width:l.width,height:l.height}}function Sg(e){return Jr(e).position==="static"}function l1(e,t){if(!ji(e)||Jr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ci(e)===n&&(n=n.ownerDocument.body),n}function jE(e,t){const n=pr(e);if(Om(e))return n;if(!ji(e)){let i=Ha(e);for(;i&&!cl(i);){if(Xr(i)&&!Sg(i))return i;i=Ha(i)}return n}let r=l1(e,t);for(;r&&WV(r)&&Sg(r);)r=l1(r,t);return r&&cl(r)&&Sg(r)&&!kx(r)?n:r||YV(e)||n}const u$=async function(e){const t=this.getOffsetParent||jE,n=this.getDimensions,r=await n(e.floating);return{reference:c$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function d$(e){return Jr(e).direction==="rtl"}const f$={convertOffsetParentRelativeRectToViewportRelativeRect:e$,getDocumentElement:Ci,getClippingRect:o$,getOffsetParent:jE,getElementRects:u$,getClientRects:t$,getDimensions:l$,getScale:zo,isElement:Xr,isRTL:d$};function NE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function m$(e,t){let n=null,r;const i=Ci(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:h,top:p,width:g,height:x}=f;if(u||t(),!g||!x)return;const w=nf(p),_=nf(i.clientWidth-(h+g)),N=nf(i.clientHeight-(p+x)),C=nf(h),P={rootMargin:-w+"px "+-_+"px "+-N+"px "+-C+"px",threshold:fr(0,Wa(1,d))||1};let T=!0;function S(E){const z=E[0].intersectionRatio;if(z!==d){if(!T)return l();z?l(!1,z):r=setTimeout(()=>{l(!1,1e-7)},1e3)}z===1&&!NE(f,e.getBoundingClientRect())&&l(),T=!1}try{n=new IntersectionObserver(S,{...P,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,P)}n.observe(e)}return l(!0),o}function h$(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=Ex(e),h=i||o?[...f?Jc(f):[],...Jc(t)]:[];h.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),o&&C.addEventListener("resize",n)});const p=f&&u?m$(f,n):null;let g=-1,x=null;l&&(x=new ResizeObserver(C=>{let[k]=C;k&&k.target===f&&x&&(x.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var P;(P=x)==null||P.observe(t)})),n()}),f&&!d&&x.observe(f),x.observe(t));let w,_=d?$s(e):null;d&&N();function N(){const C=$s(e);_&&!NE(_,C)&&n(),_=C,w=requestAnimationFrame(N)}return n(),()=>{var C;h.forEach(k=>{i&&k.removeEventListener("scroll",n),o&&k.removeEventListener("resize",n)}),p==null||p(),(C=x)==null||C.disconnect(),x=null,d&&cancelAnimationFrame(w)}}const p$=FV,g$=zV,y$=DV,x$=VV,v$=LV,c1=IV,b$=BV,w$=(e,t,n)=>{const r=new Map,i={platform:f$,...n},o={...i.platform,_c:r};return OV(e,t,{...i,platform:o})};var _$=typeof document<"u",S$=function(){},Nf=_$?v.useLayoutEffect:S$;function Qf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Qf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Qf(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function CE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function u1(e,t){const n=CE(e);return Math.round(t*n)/n}function jg(e){const t=v.useRef(e);return Nf(()=>{t.current=e}),t}function j$(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:d,open:f}=e,[h,p]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,x]=v.useState(r);Qf(g,r)||x(r);const[w,_]=v.useState(null),[N,C]=v.useState(null),k=v.useCallback(L=>{L!==E.current&&(E.current=L,_(L))},[]),P=v.useCallback(L=>{L!==z.current&&(z.current=L,C(L))},[]),T=o||w,S=l||N,E=v.useRef(null),z=v.useRef(null),D=v.useRef(h),K=d!=null,U=jg(d),W=jg(i),G=jg(f),R=v.useCallback(()=>{if(!E.current||!z.current)return;const L={placement:t,strategy:n,middleware:g};W.current&&(L.platform=W.current),w$(E.current,z.current,L).then(Y=>{const M={...Y,isPositioned:G.current!==!1};q.current&&!Qf(D.current,M)&&(D.current=M,mu.flushSync(()=>{p(M)}))})},[g,t,n,W,G]);Nf(()=>{f===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,p(L=>({...L,isPositioned:!1})))},[f]);const q=v.useRef(!1);Nf(()=>(q.current=!0,()=>{q.current=!1}),[]),Nf(()=>{if(T&&(E.current=T),S&&(z.current=S),T&&S){if(U.current)return U.current(T,S,R);R()}},[T,S,R,U,K]);const J=v.useMemo(()=>({reference:E,floating:z,setReference:k,setFloating:P}),[k,P]),ae=v.useMemo(()=>({reference:T,floating:S}),[T,S]),re=v.useMemo(()=>{const L={position:n,left:0,top:0};if(!ae.floating)return L;const Y=u1(ae.floating,h.x),M=u1(ae.floating,h.y);return u?{...L,transform:"translate("+Y+"px, "+M+"px)",...CE(ae.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:M}},[n,u,ae.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:R,refs:J,elements:ae,floatingStyles:re}),[h,R,J,ae,re])}const N$=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?c1({element:r.current,padding:i}).fn(n):{}:r?c1({element:r,padding:i}).fn(n):{}}}},C$=(e,t)=>({...p$(e),options:[e,t]}),k$=(e,t)=>({...g$(e),options:[e,t]}),P$=(e,t)=>({...b$(e),options:[e,t]}),E$=(e,t)=>({...y$(e),options:[e,t]}),T$=(e,t)=>({...x$(e),options:[e,t]}),A$=(e,t)=>({...v$(e),options:[e,t]}),M$=(e,t)=>({...N$(e),options:[e,t]});var R$="Arrow",kE=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return a.jsx(Xe.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});kE.displayName=R$;var O$=kE;function PE(e){const[t,n]=v.useState(void 0);return jn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,u;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,u=f.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Tx="Popper",[EE,jl]=vr(Tx),[I$,TE]=EE(Tx),AE=e=>{const{__scopePopper:t,children:n}=e,[r,i]=v.useState(null);return a.jsx(I$,{scope:t,anchor:r,onAnchorChange:i,children:n})};AE.displayName=Tx;var ME="PopperAnchor",RE=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=TE(ME,n),l=v.useRef(null),u=ct(t,l),d=v.useRef(null);return v.useEffect(()=>{const f=d.current;d.current=(r==null?void 0:r.current)||l.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:a.jsx(Xe.div,{...i,ref:u})});RE.displayName=ME;var Ax="PopperContent",[D$,L$]=EE(Ax),OE=v.forwardRef((e,t)=>{var le,we,je,Se,se,be;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:x="optimized",onPlaced:w,..._}=e,N=TE(Ax,n),[C,k]=v.useState(null),P=ct(t,ce=>k(ce)),[T,S]=v.useState(null),E=PE(T),z=(E==null?void 0:E.width)??0,D=(E==null?void 0:E.height)??0,K=r+(o!=="center"?"-"+o:""),U=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},W=Array.isArray(f)?f:[f],G=W.length>0,R={padding:U,boundary:W.filter(F$),altBoundary:G},{refs:q,floatingStyles:J,placement:ae,isPositioned:re,middlewareData:L}=j$({strategy:"fixed",placement:K,whileElementsMounted:(...ce)=>h$(...ce,{animationFrame:x==="always"}),elements:{reference:N.anchor},middleware:[C$({mainAxis:i+D,alignmentAxis:l}),d&&k$({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?P$():void 0,...R}),d&&E$({...R}),T$({...R,apply:({elements:ce,rects:Pe,availableWidth:Mt,availableHeight:Rt})=>{const{width:pe,height:Ye}=Pe.reference,rt=ce.floating.style;rt.setProperty("--radix-popper-available-width",`${Mt}px`),rt.setProperty("--radix-popper-available-height",`${Rt}px`),rt.setProperty("--radix-popper-anchor-width",`${pe}px`),rt.setProperty("--radix-popper-anchor-height",`${Ye}px`)}}),T&&M$({element:T,padding:u}),z$({arrowWidth:z,arrowHeight:D}),g&&A$({strategy:"referenceHidden",...R})]}),[Y,M]=LE(ae),B=_n(w);jn(()=>{re&&(B==null||B())},[re,B]);const Z=(le=L.arrow)==null?void 0:le.x,I=(we=L.arrow)==null?void 0:we.y,de=((je=L.arrow)==null?void 0:je.centerOffset)!==0,[Ne,_e]=v.useState();return jn(()=>{C&&_e(window.getComputedStyle(C).zIndex)},[C]),a.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:re?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ne,"--radix-popper-transform-origin":[(Se=L.transformOrigin)==null?void 0:Se.x,(se=L.transformOrigin)==null?void 0:se.y].join(" "),...((be=L.hide)==null?void 0:be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(D$,{scope:n,placedSide:Y,onArrowChange:S,arrowX:Z,arrowY:I,shouldHideArrow:de,children:a.jsx(Xe.div,{"data-side":Y,"data-align":M,..._,ref:P,style:{..._.style,animation:re?void 0:"none"}})})})});OE.displayName=Ax;var IE="PopperArrow",q$={top:"bottom",right:"left",bottom:"top",left:"right"},DE=v.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=L$(IE,r),l=q$[o.placedSide];return a.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:a.jsx(O$,{...i,ref:n,style:{...i.style,display:"block"}})})});DE.displayName=IE;function F$(e){return e!==null}var z$=e=>({name:"transformOrigin",options:e,fn(t){var N,C,k;const{placement:n,rects:r,middlewareData:i}=t,l=((N=i.arrow)==null?void 0:N.centerOffset)!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[f,h]=LE(n),p={start:"0%",center:"50%",end:"100%"}[h],g=(((C=i.arrow)==null?void 0:C.x)??0)+u/2,x=(((k=i.arrow)==null?void 0:k.y)??0)+d/2;let w="",_="";return f==="bottom"?(w=l?p:`${g}px`,_=`${-d}px`):f==="top"?(w=l?p:`${g}px`,_=`${r.floating.height+d}px`):f==="right"?(w=`${-d}px`,_=l?p:`${x}px`):f==="left"&&(w=`${r.floating.width+d}px`,_=l?p:`${x}px`),{data:{x:w,y:_}}}});function LE(e){const[t,n="center"]=e.split("-");return[t,n]}var Mx=AE,Rx=RE,Ox=OE,Ix=DE,B$="Portal",Pu=v.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[i,o]=v.useState(!1);jn(()=>o(!0),[]);const l=n||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?OD.createPortal(a.jsx(Xe.div,{...r,ref:t}),l):null});Pu.displayName=B$;function qE(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var FE=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),V$="VisuallyHidden",zE=v.forwardRef((e,t)=>a.jsx(Xe.span,{...e,ref:t,style:{...FE,...e.style}}));zE.displayName=V$;var $$=zE,U$=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Po=new WeakMap,rf=new WeakMap,af={},Ng=0,BE=function(e){return e&&(e.host||BE(e.parentNode))},W$=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=BE(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},H$=function(e,t,n,r){var i=W$(t,Array.isArray(e)?e:[e]);af[n]||(af[n]=new WeakMap);var o=af[n],l=[],u=new Set,d=new Set(i),f=function(p){!p||u.has(p)||(u.add(p),f(p.parentNode))};i.forEach(f);var h=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(g){if(u.has(g))h(g);else try{var x=g.getAttribute(r),w=x!==null&&x!=="false",_=(Po.get(g)||0)+1,N=(o.get(g)||0)+1;Po.set(g,_),o.set(g,N),l.push(g),_===1&&w&&rf.set(g,!0),N===1&&g.setAttribute(n,"true"),w||g.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",g,C)}})};return h(t),u.clear(),Ng++,function(){l.forEach(function(p){var g=Po.get(p)-1,x=o.get(p)-1;Po.set(p,g),o.set(p,x),g||(rf.has(p)||p.removeAttribute(r),rf.delete(p)),x||p.removeAttribute(n)}),Ng--,Ng||(Po=new WeakMap,Po=new WeakMap,rf=new WeakMap,af={})}},Dx=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=U$(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),H$(r,i,n,"aria-hidden")):function(){return null}},hi=function(){return hi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},hi.apply(this,arguments)};function VE(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function K$(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Cf="right-scroll-bar-position",kf="width-before-scroll-bar",G$="with-scroll-bars-hidden",Q$="--removed-body-scroll-bar-size";function Cg(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Y$(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var X$=typeof window<"u"?v.useLayoutEffect:v.useEffect,d1=new WeakMap;function J$(e,t){var n=Y$(null,function(r){return e.forEach(function(i){return Cg(i,r)})});return X$(function(){var r=d1.get(n);if(r){var i=new Set(r),o=new Set(e),l=n.current;i.forEach(function(u){o.has(u)||Cg(u,null)}),o.forEach(function(u){i.has(u)||Cg(u,l)})}d1.set(n,e)},[e]),n}function Z$(e){return e}function eU(e,t){t===void 0&&(t=Z$);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var l=t(o,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(o){for(r=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(o),l=n}var d=function(){var h=l;l=[],h.forEach(o)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(h){l.push(h),f()},filter:function(h){return l=l.filter(h),n}}}};return i}function tU(e){e===void 0&&(e={});var t=eU(null);return t.options=hi({async:!0,ssr:!1},e),t}var $E=function(e){var t=e.sideCar,n=VE(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,hi({},n))};$E.isSideCarExport=!0;function nU(e,t){return e.useMedium(t),$E}var UE=tU(),kg=function(){},Lm=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:kg,onWheelCapture:kg,onTouchMoveCapture:kg}),i=r[0],o=r[1],l=e.forwardProps,u=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,g=e.sideCar,x=e.noRelative,w=e.noIsolation,_=e.inert,N=e.allowPinchZoom,C=e.as,k=C===void 0?"div":C,P=e.gapMode,T=VE(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=g,E=J$([n,t]),z=hi(hi({},T),i);return v.createElement(v.Fragment,null,h&&v.createElement(S,{sideCar:UE,removeScrollBar:f,shards:p,noRelative:x,noIsolation:w,inert:_,setCallbacks:o,allowPinchZoom:!!N,lockRef:n,gapMode:P}),l?v.cloneElement(v.Children.only(u),hi(hi({},z),{ref:E})):v.createElement(k,hi({},z,{className:d,ref:E}),u))});Lm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Lm.classNames={fullWidth:kf,zeroRight:Cf};var rU=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function iU(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=rU();return t&&e.setAttribute("nonce",t),e}function aU(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function sU(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var oU=function(){var e=0,t=null;return{add:function(n){e==0&&(t=iU())&&(aU(t,n),sU(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},lU=function(){var e=oU();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},WE=function(){var e=lU(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},cU={left:0,top:0,right:0,gap:0},Pg=function(e){return parseInt(e||"",10)||0},uU=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Pg(n),Pg(r),Pg(i)]},dU=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return cU;var t=uU(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},fU=WE(),Bo="data-scroll-locked",mU=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
||
.`.concat(G$,` {
|
||
overflow: hidden `).concat(r,`;
|
||
padding-right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
body[`).concat(Bo,`] {
|
||
overflow: hidden `).concat(r,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
||
padding-left: `.concat(i,`px;
|
||
padding-top: `).concat(o,`px;
|
||
padding-right: `).concat(l,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(u,"px ").concat(r,`;
|
||
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(Cf,` {
|
||
right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(kf,` {
|
||
margin-right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Cf," .").concat(Cf,` {
|
||
right: 0 `).concat(r,`;
|
||
}
|
||
|
||
.`).concat(kf," .").concat(kf,` {
|
||
margin-right: 0 `).concat(r,`;
|
||
}
|
||
|
||
body[`).concat(Bo,`] {
|
||
`).concat(Q$,": ").concat(u,`px;
|
||
}
|
||
`)},f1=function(){var e=parseInt(document.body.getAttribute(Bo)||"0",10);return isFinite(e)?e:0},hU=function(){v.useEffect(function(){return document.body.setAttribute(Bo,(f1()+1).toString()),function(){var e=f1()-1;e<=0?document.body.removeAttribute(Bo):document.body.setAttribute(Bo,e.toString())}},[])},pU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;hU();var o=v.useMemo(function(){return dU(i)},[i]);return v.createElement(fU,{styles:mU(o,!t,i,n?"":"!important")})},Wy=!1;if(typeof window<"u")try{var sf=Object.defineProperty({},"passive",{get:function(){return Wy=!0,!0}});window.addEventListener("test",sf,sf),window.removeEventListener("test",sf,sf)}catch{Wy=!1}var Eo=Wy?{passive:!1}:!1,gU=function(e){return e.tagName==="TEXTAREA"},HE=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!gU(e)&&n[t]==="visible")},yU=function(e){return HE(e,"overflowY")},xU=function(e){return HE(e,"overflowX")},m1=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=KE(e,r);if(i){var o=GE(e,r),l=o[1],u=o[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},vU=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},bU=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},KE=function(e,t){return e==="v"?yU(t):xU(t)},GE=function(e,t){return e==="v"?vU(t):bU(t)},wU=function(e,t){return e==="h"&&t==="rtl"?-1:1},_U=function(e,t,n,r,i){var o=wU(e,window.getComputedStyle(t).direction),l=o*r,u=n.target,d=t.contains(u),f=!1,h=l>0,p=0,g=0;do{if(!u)break;var x=GE(e,u),w=x[0],_=x[1],N=x[2],C=_-N-o*w;(w||C)&&KE(e,u)&&(p+=C,g+=w);var k=u.parentNode;u=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(h&&Math.abs(p)<1||!h&&Math.abs(g)<1)&&(f=!0),f},of=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},h1=function(e){return[e.deltaX,e.deltaY]},p1=function(e){return e&&"current"in e?e.current:e},SU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jU=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},NU=0,To=[];function CU(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(NU++)[0],o=v.useState(WE)[0],l=v.useRef(e);v.useEffect(function(){l.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var _=K$([e.lockRef.current],(e.shards||[]).map(p1),!0).filter(Boolean);return _.forEach(function(N){return N.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),_.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=v.useCallback(function(_,N){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!l.current.allowPinchZoom;var C=of(_),k=n.current,P="deltaX"in _?_.deltaX:k[0]-C[0],T="deltaY"in _?_.deltaY:k[1]-C[1],S,E=_.target,z=Math.abs(P)>Math.abs(T)?"h":"v";if("touches"in _&&z==="h"&&E.type==="range")return!1;var D=m1(z,E);if(!D)return!0;if(D?S=z:(S=z==="v"?"h":"v",D=m1(z,E)),!D)return!1;if(!r.current&&"changedTouches"in _&&(P||T)&&(r.current=S),!S)return!0;var K=r.current||S;return _U(K,N,_,K==="h"?P:T)},[]),d=v.useCallback(function(_){var N=_;if(!(!To.length||To[To.length-1]!==o)){var C="deltaY"in N?h1(N):of(N),k=t.current.filter(function(S){return S.name===N.type&&(S.target===N.target||N.target===S.shadowParent)&&SU(S.delta,C)})[0];if(k&&k.should){N.cancelable&&N.preventDefault();return}if(!k){var P=(l.current.shards||[]).map(p1).filter(Boolean).filter(function(S){return S.contains(N.target)}),T=P.length>0?u(N,P[0]):!l.current.noIsolation;T&&N.cancelable&&N.preventDefault()}}},[]),f=v.useCallback(function(_,N,C,k){var P={name:_,delta:N,target:C,should:k,shadowParent:kU(C)};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(T){return T!==P})},1)},[]),h=v.useCallback(function(_){n.current=of(_),r.current=void 0},[]),p=v.useCallback(function(_){f(_.type,h1(_),_.target,u(_,e.lockRef.current))},[]),g=v.useCallback(function(_){f(_.type,of(_),_.target,u(_,e.lockRef.current))},[]);v.useEffect(function(){return To.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",d,Eo),document.addEventListener("touchmove",d,Eo),document.addEventListener("touchstart",h,Eo),function(){To=To.filter(function(_){return _!==o}),document.removeEventListener("wheel",d,Eo),document.removeEventListener("touchmove",d,Eo),document.removeEventListener("touchstart",h,Eo)}},[]);var x=e.removeScrollBar,w=e.inert;return v.createElement(v.Fragment,null,w?v.createElement(o,{styles:jU(i)}):null,x?v.createElement(pU,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function kU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const PU=nU(UE,CU);var qm=v.forwardRef(function(e,t){return v.createElement(Lm,hi({},e,{ref:t,sideCar:PU}))});qm.classNames=Lm.classNames;var EU=[" ","Enter","ArrowUp","ArrowDown"],TU=[" ","Enter"],Us="Select",[Fm,zm,AU]=F0(Us),[Nl]=vr(Us,[AU,jl]),Bm=jl(),[MU,Ya]=Nl(Us),[RU,OU]=Nl(Us),QE=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:u,onValueChange:d,dir:f,name:h,autoComplete:p,disabled:g,required:x,form:w}=e,_=Bm(t),[N,C]=v.useState(null),[k,P]=v.useState(null),[T,S]=v.useState(!1),E=vu(f),[z,D]=Va({prop:r,defaultProp:i??!1,onChange:o,caller:Us}),[K,U]=Va({prop:l,defaultProp:u,onChange:d,caller:Us}),W=v.useRef(null),G=N?w||!!N.closest("form"):!0,[R,q]=v.useState(new Set),J=Array.from(R).map(ae=>ae.props.value).join(";");return a.jsx(Mx,{..._,children:a.jsxs(MU,{required:x,scope:t,trigger:N,onTriggerChange:C,valueNode:k,onValueNodeChange:P,valueNodeHasChildren:T,onValueNodeHasChildrenChange:S,contentId:Qr(),value:K,onValueChange:U,open:z,onOpenChange:D,dir:E,triggerPointerDownPosRef:W,disabled:g,children:[a.jsx(Fm.Provider,{scope:t,children:a.jsx(RU,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(ae=>{q(re=>new Set(re).add(ae))},[]),onNativeOptionRemove:v.useCallback(ae=>{q(re=>{const L=new Set(re);return L.delete(ae),L})},[]),children:n})}),G?a.jsxs(vT,{"aria-hidden":!0,required:x,tabIndex:-1,name:h,autoComplete:p,value:K,onChange:ae=>U(ae.target.value),disabled:g,form:w,children:[K===void 0?a.jsx("option",{value:""}):null,Array.from(R)]},J):null]})})};QE.displayName=Us;var YE="SelectTrigger",XE=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Bm(n),l=Ya(YE,n),u=l.disabled||r,d=ct(t,l.onTriggerChange),f=zm(n),h=v.useRef("touch"),[p,g,x]=wT(_=>{const N=f().filter(P=>!P.disabled),C=N.find(P=>P.value===l.value),k=_T(N,_,C);k!==void 0&&l.onValueChange(k.value)}),w=_=>{u||(l.onOpenChange(!0),x()),_&&(l.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return a.jsx(Rx,{asChild:!0,...o,children:a.jsx(Xe.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":bT(l.value)?"":void 0,...i,ref:d,onClick:Ce(i.onClick,_=>{_.currentTarget.focus(),h.current!=="mouse"&&w(_)}),onPointerDown:Ce(i.onPointerDown,_=>{h.current=_.pointerType;const N=_.target;N.hasPointerCapture(_.pointerId)&&N.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(w(_),_.preventDefault())}),onKeyDown:Ce(i.onKeyDown,_=>{const N=p.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&g(_.key),!(N&&_.key===" ")&&EU.includes(_.key)&&(w(),_.preventDefault())})})})});XE.displayName=YE;var JE="SelectValue",ZE=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...u}=e,d=Ya(JE,n),{onValueNodeHasChildrenChange:f}=d,h=o!==void 0,p=ct(t,d.onValueNodeChange);return jn(()=>{f(h)},[f,h]),a.jsx(Xe.span,{...u,ref:p,style:{pointerEvents:"none"},children:bT(d.value)?a.jsx(a.Fragment,{children:l}):o})});ZE.displayName=JE;var IU="SelectIcon",eT=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return a.jsx(Xe.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});eT.displayName=IU;var DU="SelectPortal",tT=e=>a.jsx(Pu,{asChild:!0,...e});tT.displayName=DU;var Ws="SelectContent",nT=v.forwardRef((e,t)=>{const n=Ya(Ws,e.__scopeSelect),[r,i]=v.useState();if(jn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?mu.createPortal(a.jsx(rT,{scope:e.__scopeSelect,children:a.jsx(Fm.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),o):null}return a.jsx(iT,{...e,ref:t})});nT.displayName=Ws;var Wr=10,[rT,Xa]=Nl(Ws),LU="SelectContentImpl",qU=Vs("SelectContent.RemoveScroll"),iT=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:u,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:w,hideWhenDetached:_,avoidCollisions:N,...C}=e,k=Ya(Ws,n),[P,T]=v.useState(null),[S,E]=v.useState(null),z=ct(t,le=>T(le)),[D,K]=v.useState(null),[U,W]=v.useState(null),G=zm(n),[R,q]=v.useState(!1),J=v.useRef(!1);v.useEffect(()=>{if(P)return Dx(P)},[P]),Sx();const ae=v.useCallback(le=>{const[we,...je]=G().map(be=>be.ref.current),[Se]=je.slice(-1),se=document.activeElement;for(const be of le)if(be===se||(be==null||be.scrollIntoView({block:"nearest"}),be===we&&S&&(S.scrollTop=0),be===Se&&S&&(S.scrollTop=S.scrollHeight),be==null||be.focus(),document.activeElement!==se))return},[G,S]),re=v.useCallback(()=>ae([D,P]),[ae,D,P]);v.useEffect(()=>{R&&re()},[R,re]);const{onOpenChange:L,triggerPointerDownPosRef:Y}=k;v.useEffect(()=>{if(P){let le={x:0,y:0};const we=Se=>{var se,be;le={x:Math.abs(Math.round(Se.pageX)-(((se=Y.current)==null?void 0:se.x)??0)),y:Math.abs(Math.round(Se.pageY)-(((be=Y.current)==null?void 0:be.y)??0))}},je=Se=>{le.x<=10&&le.y<=10?Se.preventDefault():P.contains(Se.target)||L(!1),document.removeEventListener("pointermove",we),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",we),document.addEventListener("pointerup",je,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",je,{capture:!0})}}},[P,L,Y]),v.useEffect(()=>{const le=()=>L(!1);return window.addEventListener("blur",le),window.addEventListener("resize",le),()=>{window.removeEventListener("blur",le),window.removeEventListener("resize",le)}},[L]);const[M,B]=wT(le=>{const we=G().filter(se=>!se.disabled),je=we.find(se=>se.ref.current===document.activeElement),Se=_T(we,le,je);Se&&setTimeout(()=>Se.ref.current.focus())}),Z=v.useCallback((le,we,je)=>{const Se=!J.current&&!je;(k.value!==void 0&&k.value===we||Se)&&(K(le),Se&&(J.current=!0))},[k.value]),I=v.useCallback(()=>P==null?void 0:P.focus(),[P]),de=v.useCallback((le,we,je)=>{const Se=!J.current&&!je;(k.value!==void 0&&k.value===we||Se)&&W(le)},[k.value]),Ne=r==="popper"?Hy:aT,_e=Ne===Hy?{side:u,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:w,hideWhenDetached:_,avoidCollisions:N}:{};return a.jsx(rT,{scope:n,content:P,viewport:S,onViewportChange:E,itemRefCallback:Z,selectedItem:D,onItemLeave:I,itemTextRefCallback:de,focusSelectedItem:re,selectedItemText:U,position:r,isPositioned:R,searchRef:M,children:a.jsx(qm,{as:qU,allowPinchZoom:!0,children:a.jsx(Mm,{asChild:!0,trapped:k.open,onMountAutoFocus:le=>{le.preventDefault()},onUnmountAutoFocus:Ce(i,le=>{var we;(we=k.trigger)==null||we.focus({preventScroll:!0}),le.preventDefault()}),children:a.jsx(Cu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:le=>le.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:a.jsx(Ne,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:le=>le.preventDefault(),...C,..._e,onPlaced:()=>q(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:Ce(C.onKeyDown,le=>{const we=le.ctrlKey||le.altKey||le.metaKey;if(le.key==="Tab"&&le.preventDefault(),!we&&le.key.length===1&&B(le.key),["ArrowUp","ArrowDown","Home","End"].includes(le.key)){let Se=G().filter(se=>!se.disabled).map(se=>se.ref.current);if(["ArrowUp","End"].includes(le.key)&&(Se=Se.slice().reverse()),["ArrowUp","ArrowDown"].includes(le.key)){const se=le.target,be=Se.indexOf(se);Se=Se.slice(be+1)}setTimeout(()=>ae(Se)),le.preventDefault()}})})})})})})});iT.displayName=LU;var FU="SelectItemAlignedPosition",aT=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Ya(Ws,n),l=Xa(Ws,n),[u,d]=v.useState(null),[f,h]=v.useState(null),p=ct(t,z=>h(z)),g=zm(n),x=v.useRef(!1),w=v.useRef(!0),{viewport:_,selectedItem:N,selectedItemText:C,focusSelectedItem:k}=l,P=v.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&f&&_&&N&&C){const z=o.trigger.getBoundingClientRect(),D=f.getBoundingClientRect(),K=o.valueNode.getBoundingClientRect(),U=C.getBoundingClientRect();if(o.dir!=="rtl"){const se=U.left-D.left,be=K.left-se,ce=z.left-be,Pe=z.width+ce,Mt=Math.max(Pe,D.width),Rt=window.innerWidth-Wr,pe=zy(be,[Wr,Math.max(Wr,Rt-Mt)]);u.style.minWidth=Pe+"px",u.style.left=pe+"px"}else{const se=D.right-U.right,be=window.innerWidth-K.right-se,ce=window.innerWidth-z.right-be,Pe=z.width+ce,Mt=Math.max(Pe,D.width),Rt=window.innerWidth-Wr,pe=zy(be,[Wr,Math.max(Wr,Rt-Mt)]);u.style.minWidth=Pe+"px",u.style.right=pe+"px"}const W=g(),G=window.innerHeight-Wr*2,R=_.scrollHeight,q=window.getComputedStyle(f),J=parseInt(q.borderTopWidth,10),ae=parseInt(q.paddingTop,10),re=parseInt(q.borderBottomWidth,10),L=parseInt(q.paddingBottom,10),Y=J+ae+R+L+re,M=Math.min(N.offsetHeight*5,Y),B=window.getComputedStyle(_),Z=parseInt(B.paddingTop,10),I=parseInt(B.paddingBottom,10),de=z.top+z.height/2-Wr,Ne=G-de,_e=N.offsetHeight/2,le=N.offsetTop+_e,we=J+ae+le,je=Y-we;if(we<=de){const se=W.length>0&&N===W[W.length-1].ref.current;u.style.bottom="0px";const be=f.clientHeight-_.offsetTop-_.offsetHeight,ce=Math.max(Ne,_e+(se?I:0)+be+re),Pe=we+ce;u.style.height=Pe+"px"}else{const se=W.length>0&&N===W[0].ref.current;u.style.top="0px";const ce=Math.max(de,J+_.offsetTop+(se?Z:0)+_e)+je;u.style.height=ce+"px",_.scrollTop=we-de+_.offsetTop}u.style.margin=`${Wr}px 0`,u.style.minHeight=M+"px",u.style.maxHeight=G+"px",r==null||r(),requestAnimationFrame(()=>x.current=!0)}},[g,o.trigger,o.valueNode,u,f,_,N,C,o.dir,r]);jn(()=>P(),[P]);const[T,S]=v.useState();jn(()=>{f&&S(window.getComputedStyle(f).zIndex)},[f]);const E=v.useCallback(z=>{z&&w.current===!0&&(P(),k==null||k(),w.current=!1)},[P,k]);return a.jsx(BU,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:x,onScrollButtonChange:E,children:a.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:a.jsx(Xe.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});aT.displayName=FU;var zU="SelectPopperPosition",Hy=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Wr,...o}=e,l=Bm(n);return a.jsx(Ox,{...l,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Hy.displayName=zU;var[BU,Lx]=Nl(Ws,{}),Ky="SelectViewport",sT=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Xa(Ky,n),l=Lx(Ky,n),u=ct(t,o.onViewportChange),d=v.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),a.jsx(Fm.Slot,{scope:n,children:a.jsx(Xe.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ce(i.onScroll,f=>{const h=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=l;if(g!=null&&g.current&&p){const x=Math.abs(d.current-h.scrollTop);if(x>0){const w=window.innerHeight-Wr*2,_=parseFloat(p.style.minHeight),N=parseFloat(p.style.height),C=Math.max(_,N);if(C<w){const k=C+x,P=Math.min(w,k),T=k-P;p.style.height=P+"px",p.style.bottom==="0px"&&(h.scrollTop=T>0?T:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});sT.displayName=Ky;var oT="SelectGroup",[VU,$U]=Nl(oT),UU=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Qr();return a.jsx(VU,{scope:n,id:i,children:a.jsx(Xe.div,{role:"group","aria-labelledby":i,...r,ref:t})})});UU.displayName=oT;var lT="SelectLabel",cT=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=$U(lT,n);return a.jsx(Xe.div,{id:i.id,...r,ref:t})});cT.displayName=lT;var Yf="SelectItem",[WU,uT]=Nl(Yf),dT=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,u=Ya(Yf,n),d=Xa(Yf,n),f=u.value===r,[h,p]=v.useState(o??""),[g,x]=v.useState(!1),w=ct(t,k=>{var P;return(P=d.itemRefCallback)==null?void 0:P.call(d,k,r,i)}),_=Qr(),N=v.useRef("touch"),C=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(WU,{scope:n,value:r,disabled:i,textId:_,isSelected:f,onItemTextChange:v.useCallback(k=>{p(P=>P||((k==null?void 0:k.textContent)??"").trim())},[]),children:a.jsx(Fm.ItemSlot,{scope:n,value:r,disabled:i,textValue:h,children:a.jsx(Xe.div,{role:"option","aria-labelledby":_,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:Ce(l.onFocus,()=>x(!0)),onBlur:Ce(l.onBlur,()=>x(!1)),onClick:Ce(l.onClick,()=>{N.current!=="mouse"&&C()}),onPointerUp:Ce(l.onPointerUp,()=>{N.current==="mouse"&&C()}),onPointerDown:Ce(l.onPointerDown,k=>{N.current=k.pointerType}),onPointerMove:Ce(l.onPointerMove,k=>{var P;N.current=k.pointerType,i?(P=d.onItemLeave)==null||P.call(d):N.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(l.onPointerLeave,k=>{var P;k.currentTarget===document.activeElement&&((P=d.onItemLeave)==null||P.call(d))}),onKeyDown:Ce(l.onKeyDown,k=>{var T;((T=d.searchRef)==null?void 0:T.current)!==""&&k.key===" "||(TU.includes(k.key)&&C(),k.key===" "&&k.preventDefault())})})})})});dT.displayName=Yf;var Ac="SelectItemText",fT=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=Ya(Ac,n),u=Xa(Ac,n),d=uT(Ac,n),f=OU(Ac,n),[h,p]=v.useState(null),g=ct(t,C=>p(C),d.onItemTextChange,C=>{var k;return(k=u.itemTextRefCallback)==null?void 0:k.call(u,C,d.value,d.disabled)}),x=h==null?void 0:h.textContent,w=v.useMemo(()=>a.jsx("option",{value:d.value,disabled:d.disabled,children:x},d.value),[d.disabled,d.value,x]),{onNativeOptionAdd:_,onNativeOptionRemove:N}=f;return jn(()=>(_(w),()=>N(w)),[_,N,w]),a.jsxs(a.Fragment,{children:[a.jsx(Xe.span,{id:d.textId,...o,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?mu.createPortal(o.children,l.valueNode):null]})});fT.displayName=Ac;var mT="SelectItemIndicator",hT=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return uT(mT,n).isSelected?a.jsx(Xe.span,{"aria-hidden":!0,...r,ref:t}):null});hT.displayName=mT;var Gy="SelectScrollUpButton",pT=v.forwardRef((e,t)=>{const n=Xa(Gy,e.__scopeSelect),r=Lx(Gy,e.__scopeSelect),[i,o]=v.useState(!1),l=ct(t,r.onScrollButtonChange);return jn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollTop>0;o(f)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?a.jsx(yT,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});pT.displayName=Gy;var Qy="SelectScrollDownButton",gT=v.forwardRef((e,t)=>{const n=Xa(Qy,e.__scopeSelect),r=Lx(Qy,e.__scopeSelect),[i,o]=v.useState(!1),l=ct(t,r.onScrollButtonChange);return jn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)<f;o(h)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?a.jsx(yT,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});gT.displayName=Qy;var yT=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Xa("SelectScrollButton",n),l=v.useRef(null),u=zm(n),d=v.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return v.useEffect(()=>()=>d(),[d]),jn(()=>{var h;const f=u().find(p=>p.ref.current===document.activeElement);(h=f==null?void 0:f.ref.current)==null||h.scrollIntoView({block:"nearest"})},[u]),a.jsx(Xe.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ce(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Ce(i.onPointerMove,()=>{var f;(f=o.onItemLeave)==null||f.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Ce(i.onPointerLeave,()=>{d()})})}),HU="SelectSeparator",xT=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(Xe.div,{"aria-hidden":!0,...r,ref:t})});xT.displayName=HU;var Yy="SelectArrow",KU=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Bm(n),o=Ya(Yy,n),l=Xa(Yy,n);return o.open&&l.position==="popper"?a.jsx(Ix,{...i,...r,ref:t}):null});KU.displayName=Yy;var GU="SelectBubbleInput",vT=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=v.useRef(null),o=ct(r,i),l=qE(t);return v.useEffect(()=>{const u=i.current;if(!u)return;const d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&h){const p=new Event("change",{bubbles:!0});h.call(u,t),u.dispatchEvent(p)}},[l,t]),a.jsx(Xe.select,{...n,style:{...FE,...n.style},ref:o,defaultValue:t})});vT.displayName=GU;function bT(e){return e===""||e===void 0}function wT(e){const t=_n(e),n=v.useRef(""),r=v.useRef(0),i=v.useCallback(l=>{const u=n.current+l;t(u),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(u)},[t]),o=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function _T(e,t,n){const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=QU(e,Math.max(o,0));i.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.textValue.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function QU(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var YU=QE,ST=XE,XU=ZE,JU=eT,ZU=tT,jT=nT,e9=sT,NT=cT,CT=dT,t9=fT,n9=hT,kT=pT,PT=gT,ET=xT;const en=YU,tn=XU,Gt=v.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(ST,{ref:r,className:Fe("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,a.jsx(JU,{asChild:!0,children:a.jsx(RN,{className:"h-4 w-4 opacity-50"})})]}));Gt.displayName=ST.displayName;const TT=v.forwardRef(({className:e,...t},n)=>a.jsx(kT,{ref:n,className:Fe("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(hO,{className:"h-4 w-4"})}));TT.displayName=kT.displayName;const AT=v.forwardRef(({className:e,...t},n)=>a.jsx(PT,{ref:n,className:Fe("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(RN,{className:"h-4 w-4"})}));AT.displayName=PT.displayName;const Qt=v.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>a.jsx(ZU,{children:a.jsxs(jT,{ref:i,className:Fe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[a.jsx(TT,{}),a.jsx(e9,{className:Fe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(AT,{})]})}));Qt.displayName=jT.displayName;const r9=v.forwardRef(({className:e,...t},n)=>a.jsx(NT,{ref:n,className:Fe("px-2 py-1.5 text-sm font-semibold",e),...t}));r9.displayName=NT.displayName;const st=v.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(CT,{ref:r,className:Fe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[a.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(n9,{children:a.jsx(dm,{className:"h-4 w-4"})})}),a.jsx(t9,{children:t})]}));st.displayName=CT.displayName;const i9=v.forwardRef(({className:e,...t},n)=>a.jsx(ET,{ref:n,className:Fe("-mx-1 my-1 h-px bg-muted",e),...t}));i9.displayName=ET.displayName;const Eu=[{name:"Testudo Set Clanguard",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/308cb963a_Tustedosetclanguard.png"},{name:"Palatino Mark I",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/19462bc89_PalatinoMarkI.png"},{name:'Geist "Snow Camo" Armor Set',image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/d784dc798_GeistSnowCamoArmorSet.jpg"},{name:'Bokto Armor "Glowy"',image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/d6349a7c7_BoktoArmorGlowy.png"},{name:"Ana Endro Armor",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/f35983613_AnaEndroArmor.jpg"},{name:"Corbel Crush",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/fb84ad2fc_CorbelCrush.png"},{name:'Strata "Heatwave" Armor',image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/73bd130d5_Heatwave.jpg"},{name:'Monde "Crimson Camo" Armor',image:"https://media.base44.com/images/public/695be2905c0b4866dfb21265/710e0bc7a_ScreenShot-2026-04-15_10-13-23-169.jpg"}],ul={"Testudo Set Clanguard":[{material_name:"Vanduul Plating",quantity_needed:15,quantity_collected:0},{material_name:"Vanduul Metal",quantity_needed:15,quantity_collected:0},{material_name:"Testudo Helmet Turfwar",quantity_needed:1,quantity_collected:0},{material_name:"Testudo Arms Turfwar",quantity_needed:1,quantity_collected:0},{material_name:"Testudo Legs Turfwar",quantity_needed:1,quantity_collected:0},{material_name:"Testudo Core Turfwar",quantity_needed:1,quantity_collected:0},{material_name:"Testudo Backpack Turfwar",quantity_needed:1,quantity_collected:0}],"Palatino Mark I":[{material_name:"Yormandi Eye",quantity_needed:14,quantity_collected:0},{material_name:"Yormandi Tongue",quantity_needed:7,quantity_collected:0},{material_name:"Palatino Helmet",quantity_needed:1,quantity_collected:0},{material_name:"Palatino Arms",quantity_needed:1,quantity_collected:0},{material_name:"Palatino Legs",quantity_needed:1,quantity_collected:0},{material_name:"Palatino Core",quantity_needed:1,quantity_collected:0},{material_name:"Palatino Backpack",quantity_needed:1,quantity_collected:0}],'Geist "Snow Camo" Armor Set':[{material_name:"ASD Secure Drive",quantity_needed:4,quantity_collected:0},{material_name:"Geist Armor Arms ASD Edition",quantity_needed:1,quantity_collected:0},{material_name:"Geist Armor Core ASD Edition",quantity_needed:1,quantity_collected:0},{material_name:"Geist Armor Helmet ASD Edition",quantity_needed:1,quantity_collected:0},{material_name:"Geist Armor Legs ASD Edition",quantity_needed:1,quantity_collected:0},{material_name:"Geist Armor Backpack ASD Edition",quantity_needed:1,quantity_collected:0}],'Bokto Armor "Glowy"':[{material_name:"Irradiated Valakkar Pearl (Grade AAA)",quantity_needed:1,quantity_collected:0},{material_name:"Antium Arms",quantity_needed:1,quantity_collected:0},{material_name:"Antium Legs",quantity_needed:1,quantity_collected:0},{material_name:"Antium Core",quantity_needed:1,quantity_collected:0},{material_name:"Antium Helmet",quantity_needed:1,quantity_collected:0}],"Ana Endro Armor":[{material_name:"Carinite (Pure)",quantity_needed:1,quantity_collected:0},{material_name:"Antium Arms",quantity_needed:1,quantity_collected:0},{material_name:"Antium Legs",quantity_needed:1,quantity_collected:0},{material_name:"Antium Core",quantity_needed:1,quantity_collected:0},{material_name:"Antium Helmet",quantity_needed:1,quantity_collected:0}],"Corbel Crush":[{material_name:"ASD Secure Drive",quantity_needed:10,quantity_collected:0},{material_name:"Corbel Mire Helmet",quantity_needed:1,quantity_collected:0},{material_name:"Corbel Mire Core",quantity_needed:1,quantity_collected:0},{material_name:"Corbel Mire Legs",quantity_needed:1,quantity_collected:0},{material_name:"Corbel Mire Arms",quantity_needed:1,quantity_collected:0},{material_name:"Novikov Backpack Mire",quantity_needed:1,quantity_collected:0},{material_name:"RCMBNT-RGL-1",quantity_needed:3,quantity_collected:0},{material_name:"RCMBNT-RGL-2",quantity_needed:3,quantity_collected:0},{material_name:"RCMBNT-RGL-3",quantity_needed:3,quantity_collected:0}],'Monde "Crimson Camo" Armor':[{material_name:"Wikelo Favor",quantity_needed:3,quantity_collected:0},{material_name:"Sadaryx",quantity_needed:10,quantity_collected:0},{material_name:"Monde Helmet",quantity_needed:1,quantity_collected:0},{material_name:"Monde Core",quantity_needed:1,quantity_collected:0},{material_name:"Monde Arms",quantity_needed:1,quantity_collected:0},{material_name:"Monde Legs",quantity_needed:1,quantity_collected:0},{material_name:"Warden Backpack Epoque",quantity_needed:1,quantity_collected:0}],'Strata "Heatwave" Armor':[{material_name:"Carinite",quantity_needed:30,quantity_collected:0},{material_name:"RCMBNT-PWL-1",quantity_needed:4,quantity_collected:0},{material_name:"RCMBNT-PWL-2",quantity_needed:4,quantity_collected:0},{material_name:"RCMBNT-PWL-3",quantity_needed:4,quantity_collected:0},{material_name:"Strata Arms",quantity_needed:1,quantity_collected:0},{material_name:"Strata Legs",quantity_needed:1,quantity_collected:0},{material_name:"Strata Helmet",quantity_needed:1,quantity_collected:0},{material_name:"Strata Backpack",quantity_needed:1,quantity_collected:0},{material_name:"Strata Core",quantity_needed:1,quantity_collected:0}]};function a9({value:e,onChange:t,showCustomOption:n=!1,disabled:r=!1}){return a.jsxs(en,{value:e,onValueChange:t,disabled:r,children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white disabled:opacity-50",children:a.jsx(tn,{placeholder:"Select an armor..."})}),a.jsxs(Qt,{className:"bg-slate-800 border-slate-700 max-h-[300px]",children:[Eu.map(i=>a.jsx(st,{value:i.name,className:"text-white hover:bg-slate-700 hover:text-white",children:i.name},i.name)),n&&a.jsx(st,{value:"custom",className:"text-white hover:bg-slate-700 hover:text-white",children:"Custom / Other Armor"})]})]})}const g1={RSI:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/8278fd7d0_RSI_COLOR.png","Aegis Dynamics":"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/92445e114_AEGIS_DYNAMICS_WHITE.png","Anvil Aerospace":"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/db0a27279_ANVIL_AEROSPACE_WHITE.png",Esperia:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/0f34c8b45_ESPERIA_WHITE.png",MISC:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/6941e739b_MISC_Logo_SecondaryMark_white.png","Crusader Industries":"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/833a8f72d_CRUSADER_INDUSTRIES_WHITE.png",Mirai:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/14eef7f05_MISC_Mirai_Logo_IconMark_4k.png",Kruger:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/d1ea927f6_KRUGER_INTERGALACTIC_WHITE.png",Argo:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/60b93b0d0_Argo_Logo_Main_Light.png",Drake:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/3d91e80f2_DRAKE_INTERPLANETARY_WHITE.png",Aopoa:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/787654994_Aopoa_Logo_Main_Light.png"},qx=[{name:"Polaris Wikelo Special",image:"https://media.starcitizen.tools/d/d2/Polaris_flying_through_asteroid_field_firing_torpedoes_and_missiles_-_cropped.png",manufacturer:"RSI"},{name:"Idris-P",image:"https://media.starcitizen.tools/8/8d/Idris-P_fighting_group_of_Buccaneers_-_cropped.jpg",manufacturer:"Aegis Dynamics"},{name:"Asgard",image:"https://media.starcitizen.tools/1/17/Asgard_flying_through_debris_shooting_back_at_ships_-_cropped.jpg",manufacturer:"Anvil Aerospace"},{name:"Prowler Utility",image:"https://media.starcitizen.tools/a/a4/Prowler_-_Hovering_over_landscape.jpg",manufacturer:"Esperia"},{name:"Starlancer TAC",image:"https://media.starcitizen.tools/a/a8/Starlancer_TAC_attacks_surrounding_ships_2_-_cropped.png",manufacturer:"MISC"},{name:"A2 Hercules",image:"https://media.starcitizen.tools/9/9b/Hercules_A2_-_Flying_and_firing_over_bombed_Area_18.jpg",manufacturer:"Crusader Industries"},{name:"F8C Lightning Military",image:"https://media.starcitizen.tools/2/2f/F8C_flying_over_river_through_forest_-_Cropped.png",manufacturer:"Anvil Aerospace"},{name:"F8C Lightning Stealth",image:"https://media.starcitizen.tools/2/2f/F8C_flying_over_river_through_forest_-_Cropped.png",manufacturer:"Anvil Aerospace"},{name:"Starlancer MAX",image:"https://media.starcitizen.tools/1/10/SC-3.24_20241115_110052_StarlancerMax-Clouds_f.png",manufacturer:"MISC"},{name:"Constellation Taurus",image:"https://media.starcitizen.tools/9/9d/Constellation_Taurus_-_Flying_through_clouds.jpg",manufacturer:"RSI"},{name:"Guardian QI",image:"https://media.starcitizen.tools/2/22/Guardian_QI_over_world_firing_weapons_-_cropped_and_adjusted.jpg",manufacturer:"Mirai"},{name:"Zeus CL",image:"https://media.starcitizen.tools/d/d6/Zeus_mkII_CL_landed_loading_cargo_-_cropped.png",manufacturer:"RSI"},{name:"Super Hornet Mk II",image:"https://media.starcitizen.tools/e/e7/F7C-M_MkII_flying_over_mountains_-_cropped.png",manufacturer:"Anvil Aerospace"},{name:"Terrapin Medic",image:"https://media.starcitizen.tools/4/48/SC-3.24_20241206_133812_Terrapin-Medic-over-Hurston.png",manufacturer:"Anvil Aerospace"},{name:"Sabre Firebird",image:"https://media.starcitizen.tools/6/61/Sabre_Firebird_flying_through_clouds_with_sun_behind_-_Cropped.jpg",manufacturer:"Aegis Dynamics"},{name:"Scorpius",image:"https://media.starcitizen.tools/3/30/RSI_Scorpius_on_ArcCorp.png",manufacturer:"RSI"},{name:"Ares Ion",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/fdd51aa10_eumw2dk.jpg",manufacturer:"Crusader Industries"},{name:"Ares Inferno",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/7a8131a92_AresInferno.jpg",manufacturer:"Crusader Industries"},{name:"Mirai Guardian MX",image:"https://media.starcitizen.tools/e/e5/Guardian_MX_x2_flying_low_and_fast_over_world_-_cropped.png",manufacturer:"Mirai"},{name:"RSI Meteor",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/c65cc6a24_RSIMeteor.png",manufacturer:"RSI"},{name:"Zeus ES",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/265c55e16_ZeusES.png",manufacturer:"RSI"},{name:"Guardian",image:"https://media.starcitizen.tools/2/22/Guardian_QI_over_world_firing_weapons_-_cropped_and_adjusted.jpg",manufacturer:"Mirai"},{name:"L-21 Wolf Stealth",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/26b404954_L-21WolfStealth.jpg",manufacturer:"Kruger"},{name:"L-21 Wolf Military",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/8d7a81815_L-21WolfMilitary.jpg",manufacturer:"Kruger"},{name:"C1 Spirit",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/4ce4cff1a_C1Spirit.png",manufacturer:"Crusader Industries"},{name:"Sabre Peregrine",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/73d0c723b_SabrePeregrine.png",manufacturer:"Aegis Dynamics"},{name:"Prospector",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/c93da6655_Prospector.png",manufacturer:"MISC"},{name:"RAFT",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/e5718204b_RAFT.png",manufacturer:"Argo"},{name:"Golem",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/477fce129_Golem.jpg",manufacturer:"Drake"},{name:"Fortune",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/e2e5a62a7_Fortune.jpg",manufacturer:"MISC"},{name:"Ursa Medivac",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/d0682ccc9_UrsaMedivac.png",manufacturer:"RSI"},{name:"Intrepid",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/32a14e4a0_Intrepid.png",manufacturer:"Crusader Industries"},{name:"Nox",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/64751e49e_Nox.png",manufacturer:"Aopoa"},{name:"Pulse",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/def8cd4c0_Pulse.jpg",manufacturer:"Mirai"},{name:"ATLS IKTI",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/3d5a6b7cf_ATLSIKTI.jpg",manufacturer:"Argo"},{name:"ATLS IKTI GEO",image:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/e9684c6a7_ATLSGEOIKTI.jpg",manufacturer:"Argo"},{name:"Apollo Triage 'Red Fight'",image:"https://media.base44.com/images/public/695be2905c0b4866dfb21265/d88b5b6ca_image.png",manufacturer:"RSI"}],Xf={"Polaris Wikelo Special":[{material_name:"Wikelo Favor",quantity_needed:50,quantity_collected:0},{material_name:"Polaris Bit",quantity_needed:15,quantity_collected:0},{material_name:"DCHS-05 Orbital Positioning Comp-Board",quantity_needed:10,quantity_collected:0},{material_name:"Carinite",quantity_needed:20,quantity_collected:0},{material_name:"Irradiated Valakkar Fang (Apex)",quantity_needed:20,quantity_collected:0},{material_name:"MG Scrip",quantity_needed:20,quantity_collected:0},{material_name:"Ace Interceptor Helmet",quantity_needed:15,quantity_collected:0},{material_name:"Irradiated Valakkar Pearl (Grade AAA)",quantity_needed:15,quantity_collected:0},{material_name:"UEE 6th Platoon Medal (Pristine)",quantity_needed:15,quantity_collected:0},{material_name:"Carinite (Pure)",quantity_needed:15,quantity_collected:0},{material_name:"ASD Secure Drive",quantity_needed:15,quantity_collected:0},{material_name:"RCMBNT-PWL-1",quantity_needed:1,quantity_collected:0},{material_name:"RCMBNT-PWL-2",quantity_needed:1,quantity_collected:0},{material_name:"RCMBNT-PWL-3",quantity_needed:1,quantity_collected:0},{material_name:"RCMBNT-RGL-1",quantity_needed:1,quantity_collected:0},{material_name:"RCMBNT-RGL-2",quantity_needed:1,quantity_collected:0},{material_name:"RCMBNT-RGL-3",quantity_needed:1,quantity_collected:0},{material_name:"RCMBNT-XTL-1",quantity_needed:1,quantity_collected:0},{material_name:"RCMBNT-XTL-2",quantity_needed:1,quantity_collected:0},{material_name:"RCMBNT-XTL-3",quantity_needed:1,quantity_collected:0}],"Idris-P":[{material_name:"Wikelo Favor",quantity_needed:50,quantity_collected:0},{material_name:"Polaris Bit",quantity_needed:50,quantity_collected:0},{material_name:"DCHS-05 Orbital Positioning Comp-Board",quantity_needed:50,quantity_collected:0},{material_name:"Carinite",quantity_needed:50,quantity_collected:0},{material_name:"Irradiated Valakkar Fang (Apex)",quantity_needed:50,quantity_collected:0},{material_name:"MG Scrip",quantity_needed:50,quantity_collected:0},{material_name:"Ace Interceptor Helmet",quantity_needed:50,quantity_collected:0},{material_name:"Irradiated Valakkar Pearl (Grade AAA)",quantity_needed:30,quantity_collected:0},{material_name:"UEE 6th Platoon Medal (Pristine)",quantity_needed:30,quantity_collected:0},{material_name:"Carinite (Pure)",quantity_needed:30,quantity_collected:0},{material_name:"ASD Secure Drive",quantity_needed:30,quantity_collected:0},{material_name:"RCMBNT-PWL-1",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-PWL-2",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-PWL-3",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-RGL-1",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-RGL-2",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-RGL-3",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-XTL-1",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-XTL-2",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-XTL-3",quantity_needed:5,quantity_collected:0}],Asgard:[{material_name:"Wikelo Favor",quantity_needed:50,quantity_collected:0},{material_name:"RCMBNT-PWL-1",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-PWL-2",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-PWL-3",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-RGL-1",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-RGL-2",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-RGL-3",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-XTL-1",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-XTL-2",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-XTL-3",quantity_needed:5,quantity_collected:0},{material_name:"ASD Secure Drive",quantity_needed:3,quantity_collected:0}],"Prowler Utility":[{material_name:"Wikelo Favor",quantity_needed:40,quantity_collected:0},{material_name:"Yormandi Tongue",quantity_needed:10,quantity_collected:0},{material_name:"Yormandi Eye",quantity_needed:20,quantity_collected:0},{material_name:"Irradiated Valakkar Pearl (Grade AAA)",quantity_needed:3,quantity_collected:0},{material_name:"Carinite (Pure)",quantity_needed:3,quantity_collected:0}],"Starlancer TAC":[{material_name:"Wikelo Favor",quantity_needed:50,quantity_collected:0},{material_name:"ASD Secure Drive",quantity_needed:30,quantity_collected:0},{material_name:"Ace Interceptor Helmet",quantity_needed:15,quantity_collected:0},{material_name:"Irradiated Valakkar Pearl (Grade AAA)",quantity_needed:3,quantity_collected:0},{material_name:"Tevarin War Service Marker (Pristine)",quantity_needed:3,quantity_collected:0},{material_name:"Carinite (Pure)",quantity_needed:3,quantity_collected:0},{material_name:"DCHS-05 Comp-Board",quantity_needed:3,quantity_collected:0}],"A2 Hercules":[{material_name:"Wikelo Favor",quantity_needed:50,quantity_collected:0},{material_name:"Polaris Bit",quantity_needed:20,quantity_collected:0},{material_name:"MG Scrip",quantity_needed:20,quantity_collected:0},{material_name:"ASD Secure Drive",quantity_needed:6,quantity_collected:0},{material_name:"Irradiated Valakkar Pearl (Grade AAA)",quantity_needed:6,quantity_collected:0},{material_name:"Tevarin War Service Marker (Pristine)",quantity_needed:6,quantity_collected:0},{material_name:"DCHS-05 Comp-Board",quantity_needed:6,quantity_collected:0},{material_name:"Carinite (Pure)",quantity_needed:6,quantity_collected:0}],"F8C Lightning Military":[{material_name:"Wikelo Favor",quantity_needed:40,quantity_collected:0},{material_name:"Carinite (Pure)",quantity_needed:4,quantity_collected:0},{material_name:"Irradiated Valakkar Pearl (Grade AAA)",quantity_needed:4,quantity_collected:0},{material_name:"Tevarin War Service Marker (Pristine)",quantity_needed:4,quantity_collected:0}],"F8C Lightning Stealth":[{material_name:"Wikelo Favor",quantity_needed:40,quantity_collected:0},{material_name:"DCHS-05 Comp-Board",quantity_needed:15,quantity_collected:0},{material_name:"Carinite (Pure)",quantity_needed:3,quantity_collected:0},{material_name:"Irradiated Valakkar Pearl (Grade AAA)",quantity_needed:3,quantity_collected:0}],"Starlancer MAX":[{material_name:"Wikelo Favor",quantity_needed:30,quantity_collected:0},{material_name:"Ace Interceptor Helmet",quantity_needed:10,quantity_collected:0},{material_name:"Carinite (Pure)",quantity_needed:3,quantity_collected:0},{material_name:"Irradiated Valakkar Pearl (Grade AAA)",quantity_needed:3,quantity_collected:0}],"Constellation Taurus":[{material_name:"Wikelo Favor",quantity_needed:30,quantity_collected:0},{material_name:"Carinite (Pure)",quantity_needed:3,quantity_collected:0},{material_name:"Irradiated Valakkar Pearl (Grade AAA)",quantity_needed:3,quantity_collected:0},{material_name:"Goverment Cartography Agency Medal (Pristine)",quantity_needed:3,quantity_collected:0}],"Guardian QI":[{material_name:"Wikelo Favor",quantity_needed:25,quantity_collected:0},{material_name:"DCHS-05 Comp-Board",quantity_needed:15,quantity_collected:0},{material_name:"Irradiated Valakkar Pearl (Grade AA)",quantity_needed:15,quantity_collected:0},{material_name:"UEE 6th Platoon Medal (Pristine)",quantity_needed:2,quantity_collected:0}],"Zeus CL":[{material_name:"Wikelo Favor",quantity_needed:20,quantity_collected:0},{material_name:"Carinite (Pure)",quantity_needed:17,quantity_collected:0},{material_name:"Ace Interceptor Helmet",quantity_needed:10,quantity_collected:0}],"Super Hornet Mk II":[{material_name:"Wikelo Favor",quantity_needed:16,quantity_collected:0},{material_name:"Ace Interceptor Helmet",quantity_needed:5,quantity_collected:0},{material_name:"DCHS-05 Comp-Board",quantity_needed:3,quantity_collected:0},{material_name:"Goverment Cartography Agency Medal (Pristine)",quantity_needed:1,quantity_collected:0}],"Terrapin Medic":[{material_name:"Wikelo Favor",quantity_needed:15,quantity_collected:0},{material_name:"ASD Secure Drive",quantity_needed:10,quantity_collected:0},{material_name:"Tevarin War Service Marker (Pristine)",quantity_needed:1,quantity_collected:0}],"Sabre Firebird":[{material_name:"Wikelo Favor",quantity_needed:15,quantity_collected:0},{material_name:"DCHS-05 Comp-Board",quantity_needed:4,quantity_collected:0},{material_name:"Ace Interceptor Helmet",quantity_needed:3,quantity_collected:0},{material_name:"Goverment Cartography Agency Medal (Pristine)",quantity_needed:1,quantity_collected:0}],Scorpius:[{material_name:"Wikelo Favor",quantity_needed:15,quantity_collected:0},{material_name:"Tevarin War Service Marker (Pristine)",quantity_needed:1,quantity_collected:0},{material_name:"DCHS-05 Comp-Board",quantity_needed:4,quantity_collected:0}],"Ares Ion":[{material_name:"Wikelo Favor",quantity_needed:10,quantity_collected:0},{material_name:"Yormandi Eye",quantity_needed:10,quantity_collected:0},{material_name:"Ace Interceptor Helmet",quantity_needed:5,quantity_collected:0},{material_name:"Tevarin War Service Marker (Pristine)",quantity_needed:1,quantity_collected:0}],"Ares Inferno":[{material_name:"Wikelo Favor",quantity_needed:10,quantity_collected:0},{material_name:"Yormandi Tongue",quantity_needed:5,quantity_collected:0},{material_name:"Ace Interceptor Helmet",quantity_needed:5,quantity_collected:0},{material_name:"UEE 6th Platoon Medal (Pristine)",quantity_needed:1,quantity_collected:0}],"Mirai Guardian MX":[{material_name:"Wikelo Favor",quantity_needed:25,quantity_collected:0},{material_name:"Large Artifact Fragment (Pristine)",quantity_needed:2,quantity_collected:0},{material_name:"Vanduul Plating",quantity_needed:30,quantity_collected:0},{material_name:"Vanduul Metal",quantity_needed:30,quantity_collected:0},{material_name:"Ace Interceptor Helmet",quantity_needed:15,quantity_collected:0}],"RSI Meteor":[{material_name:"Wikelo Favor",quantity_needed:10,quantity_collected:0},{material_name:"Large Artifact Fragment (Pristine)",quantity_needed:1,quantity_collected:0},{material_name:"Vanduul Plating",quantity_needed:10,quantity_collected:0},{material_name:"Vanduul Metal",quantity_needed:10,quantity_collected:0},{material_name:"Ace Interceptor Helmet",quantity_needed:5,quantity_collected:0}],"Zeus ES":[{material_name:"Wikelo Favor",quantity_needed:10,quantity_collected:0},{material_name:"UEE 6th Platoon Medal (Pristine)",quantity_needed:1,quantity_collected:0}],Guardian:[{material_name:"Wikelo Favor",quantity_needed:20,quantity_collected:0},{material_name:"Irradiated Valakkar Pearl (Grade AA)",quantity_needed:15,quantity_collected:0},{material_name:"Ace Interceptor Helmet",quantity_needed:10,quantity_collected:0},{material_name:"Tevarin War Service Marker (Pristine)",quantity_needed:1,quantity_collected:0}],"L-21 Wolf Stealth":[{material_name:"Wikelo Favor",quantity_needed:10,quantity_collected:0},{material_name:"Vanduul Plating",quantity_needed:10,quantity_collected:0},{material_name:"Vanduul Metal",quantity_needed:10,quantity_collected:0},{material_name:"Large Artifact Fragment (Pristine)",quantity_needed:1,quantity_collected:0}],"L-21 Wolf Military":[{material_name:"Wikelo Favor",quantity_needed:5,quantity_collected:0}],"C1 Spirit":[{material_name:"Wikelo Favor",quantity_needed:8,quantity_collected:0},{material_name:"Tevarin War Service Marker (Pristine)",quantity_needed:1,quantity_collected:0}],"Sabre Peregrine":[{material_name:"Wikelo Favor",quantity_needed:4,quantity_collected:0},{material_name:"DCHS-05 Comp-Board",quantity_needed:1,quantity_collected:0}],Prospector:[{material_name:"Wikelo Favor",quantity_needed:6,quantity_collected:0},{material_name:"Carinite",quantity_needed:20,quantity_collected:0},{material_name:"Saldynium (Ore)",quantity_needed:30,quantity_collected:0},{material_name:"Jaclium (Ore)",quantity_needed:40,quantity_collected:0},{material_name:"Carinite (Pure)",quantity_needed:1,quantity_collected:0}],RAFT:[{material_name:"Wikelo Favor",quantity_needed:8,quantity_collected:0},{material_name:"Irradiated Valakkar Fang (Adult)",quantity_needed:10,quantity_collected:0},{material_name:"Irradiated Valakkar Fang (Juvenile)",quantity_needed:20,quantity_collected:0},{material_name:"Irradiated Kopion Horn",quantity_needed:5,quantity_collected:0},{material_name:"Irradiated Valakkar Pearl (Grade AAA)",quantity_needed:1,quantity_collected:0}],Golem:[{material_name:"Wikelo Favor",quantity_needed:2,quantity_collected:0},{material_name:"ASD Secure Drive",quantity_needed:15,quantity_collected:0}],Fortune:[{material_name:"Wikelo Favor",quantity_needed:3,quantity_collected:0},{material_name:"Carinite (Pure)",quantity_needed:1,quantity_collected:0}],"Ursa Medivac":[{material_name:"Wikelo Favor",quantity_needed:4,quantity_collected:0},{material_name:"Saldynium (Ore)",quantity_needed:20,quantity_collected:0},{material_name:"Jaclium (Ore)",quantity_needed:20,quantity_collected:0}],Intrepid:[{material_name:"Wikelo Favor",quantity_needed:3,quantity_collected:0},{material_name:"Government Cartography Agency Medal (Pristine)",quantity_needed:1,quantity_collected:0}],Nox:[{material_name:"Wikelo Favor",quantity_needed:4,quantity_collected:0}],Pulse:[{material_name:"Wikelo Favor",quantity_needed:4,quantity_collected:0}],"ATLS IKTI":[{material_name:"Argo ATLS",quantity_needed:1,quantity_collected:0},{material_name:"NN-13 Cannon",quantity_needed:2,quantity_collected:0},{material_name:"Irradiated Valakkar Fang (Apex)",quantity_needed:5,quantity_collected:0},{material_name:"Wikelo Favor",quantity_needed:2,quantity_collected:0}],"ATLS IKTI GEO":[{material_name:"Argo ATLS GEO",quantity_needed:1,quantity_collected:0},{material_name:"Argo ATLS IKTI",quantity_needed:1,quantity_collected:0},{material_name:"NN-13 Cannon",quantity_needed:2,quantity_collected:0},{material_name:"Wikelo Favor",quantity_needed:1,quantity_collected:0}],"Apollo Triage 'Red Fight'":[{material_name:"Wikelo Favor",quantity_needed:30,quantity_collected:0},{material_name:"SCU Savrilium",quantity_needed:48,quantity_collected:0}]},Jf={},y1={...Xf,...ul};function s9({value:e,onChange:t,showCustomOption:n=!1,disabled:r=!1,includeArmors:i=!1}){return a.jsxs(en,{value:e,onValueChange:t,disabled:r,children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white disabled:opacity-50",children:a.jsx(tn,{placeholder:"Select a project..."})}),a.jsxs(Qt,{className:"bg-slate-800 border-slate-700 max-h-[300px]",children:[a.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-slate-400",children:"SHIPS"}),qx.map(o=>a.jsx(st,{value:o.name,className:"text-white hover:bg-slate-700 hover:text-white",children:o.name},o.name)),i&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-slate-400 border-t border-slate-600 mt-2",children:"ARMORS"}),Eu.map(o=>a.jsx(st,{value:o.name,className:"text-white hover:bg-slate-700 hover:text-white",children:o.name},o.name))]}),n&&a.jsx(st,{value:"custom",className:"text-white hover:bg-slate-700 hover:text-white",children:"Custom / Other"})]})]})}const Xy=[{title:"Now make Polaris. Short Time Deal.",reputation_reward:1e3,reputation_required:0},{title:"Starlifter A2 War Mod",reputation_reward:500,reputation_required:0},{title:"Asgard Fight Mod",reputation_reward:250,reputation_required:0},{title:"F8 War Mod",reputation_reward:250,reputation_required:0},{title:"More than a Max (Starlancer MAX)",reputation_reward:250,reputation_required:0},{title:"New Move Big Starlancer Ship (Starlancer TAC)",reputation_reward:250,reputation_required:0},{title:"Prowler More Utility",reputation_reward:250,reputation_required:0},{title:"Sneaky Stabber",reputation_reward:250,reputation_required:0},{title:"Want Taurus ship",reputation_reward:250,reputation_required:0},{title:"Build a Mod Scorpius",reputation_reward:100,reputation_required:0},{title:"Firebird Mod",reputation_reward:100,reputation_required:0},{title:"Guardian Fight Mod",reputation_reward:100,reputation_required:0},{title:"Guardian take down ship (Guardian QI)",reputation_reward:100,reputation_required:0},{title:"Guardian WiK-X (Guardian MX)",reputation_reward:100,reputation_required:0},{title:"Sneaky Starfighter Ion",reputation_reward:100,reputation_required:0},{title:"Starfighter Inferno Special",reputation_reward:100,reputation_required:0},{title:"What is Terrapin? (Terrapin Medic)",reputation_reward:100,reputation_required:0},{title:"Wikelo Navy F7",reputation_reward:100,reputation_required:0},{title:"Zeus Cargo Special (Zeus Mk II CL)",reputation_reward:100,reputation_required:0},{title:"Fortune ship for you",reputation_reward:30,reputation_required:0},{title:"Golem Rocks",reputation_reward:30,reputation_required:0},{title:"Peregrine Wikelo Mod",reputation_reward:30,reputation_required:0},{title:"Prospects Look Good",reputation_reward:30,reputation_required:0},{title:"Ready for RAFT?",reputation_reward:30,reputation_required:0},{title:"RSI Meteor Mod",reputation_reward:30,reputation_required:0},{title:"Spirit Cargo mod",reputation_reward:30,reputation_required:0},{title:"Upgrade Intrepid",reputation_reward:30,reputation_required:0},{title:"Where Wolf? Here Wolf (L-21 Wolf Stealth)",reputation_reward:30,reputation_required:0},{title:"Zeus Special (Zeus Mk II ES)",reputation_reward:30,reputation_required:0},{title:"Armor with horn and string",reputation_reward:25,reputation_required:0},{title:"Armor with Vanduul",reputation_reward:25,reputation_required:0},{title:"Do Lava Suit",reputation_reward:25,reputation_required:0},{title:"Hide Snow Suit",reputation_reward:25,reputation_required:0},{title:"Make glowy armor",reputation_reward:25,reputation_required:0},{title:"Test Armor",reputation_reward:25,reputation_required:0},{title:"ATLS Cool Metal Color",reputation_reward:20,reputation_required:0},{title:"ATLS Orange Line",reputation_reward:20,reputation_required:0},{title:"ATLS Snowland Color",reputation_reward:20,reputation_required:0},{title:"Make a Ursa Mod",reputation_reward:20,reputation_required:0},{title:"Make ATLS shoot",reputation_reward:20,reputation_required:0},{title:"Make jumpy ATLS shoot",reputation_reward:20,reputation_required:0},{title:"Noxy Mod",reputation_reward:20,reputation_required:0},{title:"Pulse Plus",reputation_reward:20,reputation_required:0},{title:'Most Special Wolf (L-21 Wolf Military + Antium Midnight Sun & Fresnel "Deepwater" Energy LMG)',reputation_reward:0,reputation_required:340},{title:"Shiny Builder Suit",reputation_reward:0,reputation_required:0},{title:"Special Idris For Killing",reputation_reward:0,reputation_required:999}],o9={"Polaris Wikelo Special":"Now make Polaris. Short Time Deal.","A2 Hercules":"Starlifter A2 War Mod",Asgard:"Asgard Fight Mod","F8C Lightning Military":"F8 War Mod","Starlancer MAX":"More than a Max (Starlancer MAX)","Starlancer TAC":"New Move Big Starlancer Ship (Starlancer TAC)","Prowler Utility":"Prowler More Utility","F8C Lightning Stealth":"Sneaky Stabber","Constellation Taurus":"Want Taurus ship",Scorpius:"Build a Mod Scorpius","Sabre Firebird":"Firebird Mod",Guardian:"Guardian Fight Mod","Guardian QI":"Guardian take down ship (Guardian QI)","Mirai Guardian MX":"Guardian WiK-X (Guardian MX)","Ares Ion":"Sneaky Starfighter Ion","Ares Inferno":"Starfighter Inferno Special","Terrapin Medic":"What is Terrapin? (Terrapin Medic)","Super Hornet Mk II":"Wikelo Navy F7","Zeus CL":"Zeus Cargo Special (Zeus Mk II CL)",Fortune:"Fortune ship for you",Golem:"Golem Rocks","Sabre Peregrine":"Peregrine Wikelo Mod",Prospector:"Prospects Look Good",RAFT:"Ready for RAFT?","RSI Meteor":"RSI Meteor Mod","C1 Spirit":"Spirit Cargo mod",Intrepid:"Upgrade Intrepid","L-21 Wolf Stealth":"Where Wolf? Here Wolf (L-21 Wolf Stealth)","Zeus ES":"Zeus Special (Zeus Mk II ES)","Ana Endro Armor":"Armor with horn and string","Testudo Set Clanguard":"Armor with Vanduul",'Strata "Heatwave" Armor':"Do Lava Suit",'Geist "Snow Camo" Armor Set':"Hide Snow Suit",'Bokto Armor "Glowy"':"Make glowy armor","Palatino Mark I":"Test Armor","Ursa Medivac":"Make a Ursa Mod","ATLS IKTI":"Make ATLS shoot","ATLS IKTI GEO":"Make jumpy ATLS shoot",Nox:"Noxy Mod",Pulse:"Pulse Plus","L-21 Wolf Military":'Most Special Wolf (L-21 Wolf Military + Antium Midnight Sun & Fresnel "Deepwater" Energy LMG)',"Corbel Crush":"Shiny Builder Suit","Idris-P":"Special Idris For Killing"},Zf=[{name:"New Customer",min:0,max:339,color:"text-slate-300",bgColor:"bg-slate-700",borderColor:"border-slate-600"},{name:"Very Good Customer",min:340,max:998,color:"text-blue-300",bgColor:"bg-blue-900/40",borderColor:"border-blue-600"},{name:"Very Best Customer",min:999,max:1/0,color:"text-yellow-300",bgColor:"bg-yellow-900/40",borderColor:"border-yellow-600"}];function l9(e){return Zf.find(t=>e>=t.min&&e<=t.max)||Zf[0]}function c9(e){return Xy.find(t=>t.title===e)}function Ka(e){const t=o9[e];return t?c9(t):null}const dt=v.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:Fe("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));dt.displayName="Input";var[Vm]=vr("Tooltip",[jl]),$m=jl(),MT="TooltipProvider",u9=700,Jy="tooltip.open",[d9,Fx]=Vm(MT),RT=e=>{const{__scopeTooltip:t,delayDuration:n=u9,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,l=v.useRef(!0),u=v.useRef(!1),d=v.useRef(0);return v.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),a.jsx(d9,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:v.useCallback(f=>{u.current=f},[]),disableHoverableContent:i,children:o})};RT.displayName=MT;var Zc="Tooltip",[f9,Tu]=Vm(Zc),OT=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:l,delayDuration:u}=e,d=Fx(Zc,e.__scopeTooltip),f=$m(t),[h,p]=v.useState(null),g=Qr(),x=v.useRef(0),w=l??d.disableHoverableContent,_=u??d.delayDuration,N=v.useRef(!1),[C,k]=Va({prop:r,defaultProp:i??!1,onChange:z=>{z?(d.onOpen(),document.dispatchEvent(new CustomEvent(Jy))):d.onClose(),o==null||o(z)},caller:Zc}),P=v.useMemo(()=>C?N.current?"delayed-open":"instant-open":"closed",[C]),T=v.useCallback(()=>{window.clearTimeout(x.current),x.current=0,N.current=!1,k(!0)},[k]),S=v.useCallback(()=>{window.clearTimeout(x.current),x.current=0,k(!1)},[k]),E=v.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{N.current=!0,k(!0),x.current=0},_)},[_,k]);return v.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),a.jsx(Mx,{...f,children:a.jsx(f9,{scope:t,contentId:g,open:C,stateAttribute:P,trigger:h,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{d.isOpenDelayedRef.current?E():T()},[d.isOpenDelayedRef,E,T]),onTriggerLeave:v.useCallback(()=>{w?S():(window.clearTimeout(x.current),x.current=0)},[S,w]),onOpen:T,onClose:S,disableHoverableContent:w,children:n})})};OT.displayName=Zc;var Zy="TooltipTrigger",IT=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Tu(Zy,n),o=Fx(Zy,n),l=$m(n),u=v.useRef(null),d=ct(t,u,i.onTriggerChange),f=v.useRef(!1),h=v.useRef(!1),p=v.useCallback(()=>f.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),a.jsx(Rx,{asChild:!0,...l,children:a.jsx(Xe.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:d,onPointerMove:Ce(e.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:Ce(e.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:Ce(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Ce(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:Ce(e.onBlur,i.onClose),onClick:Ce(e.onClick,i.onClose)})})});IT.displayName=Zy;var zx="TooltipPortal",[m9,h9]=Vm(zx,{forceMount:void 0}),DT=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=Tu(zx,t);return a.jsx(m9,{scope:t,forceMount:n,children:a.jsx(Fn,{present:n||o.open,children:a.jsx(Pu,{asChild:!0,container:i,children:r})})})};DT.displayName=zx;var dl="TooltipContent",LT=v.forwardRef((e,t)=>{const n=h9(dl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,l=Tu(dl,e.__scopeTooltip);return a.jsx(Fn,{present:r||l.open,children:l.disableHoverableContent?a.jsx(qT,{side:i,...o,ref:t}):a.jsx(p9,{side:i,...o,ref:t})})}),p9=v.forwardRef((e,t)=>{const n=Tu(dl,e.__scopeTooltip),r=Fx(dl,e.__scopeTooltip),i=v.useRef(null),o=ct(t,i),[l,u]=v.useState(null),{trigger:d,onClose:f}=n,h=i.current,{onPointerInTransitChange:p}=r,g=v.useCallback(()=>{u(null),p(!1)},[p]),x=v.useCallback((w,_)=>{const N=w.currentTarget,C={x:w.clientX,y:w.clientY},k=b9(C,N.getBoundingClientRect()),P=w9(C,k),T=_9(_.getBoundingClientRect()),S=j9([...P,...T]);u(S),p(!0)},[p]);return v.useEffect(()=>()=>g(),[g]),v.useEffect(()=>{if(d&&h){const w=N=>x(N,h),_=N=>x(N,d);return d.addEventListener("pointerleave",w),h.addEventListener("pointerleave",_),()=>{d.removeEventListener("pointerleave",w),h.removeEventListener("pointerleave",_)}}},[d,h,x,g]),v.useEffect(()=>{if(l){const w=_=>{const N=_.target,C={x:_.clientX,y:_.clientY},k=(d==null?void 0:d.contains(N))||(h==null?void 0:h.contains(N)),P=!S9(C,l);k?g():P&&(g(),f())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[d,h,l,f,g]),a.jsx(qT,{...e,ref:o})}),[g9,y9]=Vm(Zc,{isInside:!1}),x9=mk("TooltipContent"),qT=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:l,...u}=e,d=Tu(dl,n),f=$m(n),{onClose:h}=d;return v.useEffect(()=>(document.addEventListener(Jy,h),()=>document.removeEventListener(Jy,h)),[h]),v.useEffect(()=>{if(d.trigger){const p=g=>{const x=g.target;x!=null&&x.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),a.jsx(Cu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:a.jsxs(Ox,{"data-state":d.stateAttribute,...f,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(x9,{children:r}),a.jsx(g9,{scope:n,isInside:!0,children:a.jsx($$,{id:d.contentId,role:"tooltip",children:i||r})})]})})});LT.displayName=dl;var FT="TooltipArrow",v9=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=$m(n);return y9(FT,n).isInside?null:a.jsx(Ix,{...i,...r,ref:t})});v9.displayName=FT;function b9(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function w9(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function _9(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function S9(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const u=t[o],d=t[l],f=u.x,h=u.y,p=d.x,g=d.y;h>r!=g>r&&n<(p-f)*(r-h)/(g-h)+f&&(i=!i)}return i}function j9(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),N9(t)}function N9(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],l=n[n.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var C9=RT,k9=OT,P9=IT,E9=DT,zT=LT;const BT=C9,VT=k9,$T=P9,Bx=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(E9,{children:a.jsx(zT,{ref:r,sideOffset:t,className:Fe("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Bx.displayName=zT.displayName;const x1={"Wikelo Favor":"Primary currency for Wikelo shop, earned by turning in 50x Scripts, 40x carinite or 12x pearls (AA)","Polaris Bit":"Acquired by mining 24 SCU of Quantanium and turning into Wikelo","DCHS-05 Orbital Positioning Comp-Board":"Found in the contested zone at Ruin station in Pyro","DCHS-05 Comp-Board":"Found in the contested zone at Ruin station in Pyro",Carinite:"Acquired by aligning the PAF sites on Daymar and Aberdeen. Once you power the OLP it will open a cave where you can mine it","Carinite (Pure)":"Acquired by aligning the PAF sites on Daymar and Aberdeen. Once you power the OLP it will open a cave where you can mine it","Irradiated Valakkar Fang (Apex)":"Acquired by killing the apex irradiated valakkar at the stormbreaker ASD facilities in Pyro","Irradiated Valakkar Fang (Adult)":"Harvested from adult Valakkar","Irradiated Valakkar Fang (Juvenile)":"Harvested from juvenile Valakkar creatures","Irradiated Valakkar Pearl (Grade AAA)":"Acquired by killing the apex irradiated valakkar at the stormbreaker ASD facilities","Irradiated Valakkar Pearl (Grade AA)":"Acquired by killing the apex irradiated valakkar at the stormbreaker ASD facilities","Irradiated Kopion Horn":"Harvested from Irradiated Kopion's found mostly at stormbreaker and Onyx facilities","MG Scrip":"Earned through mercenary patrol missions from Foxwell Enforcment","Ace Interceptor Helmet":"Can find them on ace pilots after you destroy their ship during foxwell mercenary missions","UEE 6th Platoon Medal (Pristine)":"Found on Ace pilots and in blue loot boxes throughout the verse","Tevarin War Service Marker (Pristine)":"Found on Ace pilots and in blue loot boxes throughout the verse","Government Cartography Agency Medal (Pristine)":"Found on Ace pilots and in blue loot boxes throughout the verse","Goverment Cartography Agency Medal (Pristine)":"Found on Ace pilots and in blue loot boxes throughout the verse","ASD Secure Drive":"Reward for Onyx missions in Stanton","RCMBNT-PWL-1":"Reward for Onyx Hyperion missions in Stanton","RCMBNT-PWL-2":"Reward for Onyx Hyperion missions in Stanton","RCMBNT-PWL-3":"Reward for Onyx Hyperion missions in Stanton","RCMBNT-RGL-1":"Reward for Onyx Hyperion missions in Stanton","RCMBNT-RGL-2":"Reward for Onyx Hyperion missions in Stanton","RCMBNT-RGL-3":"Reward for Onyx Hyperion missions in Stanton","RCMBNT-XTL-1":"Reward for Onyx Hyperion missions in Stanton","RCMBNT-XTL-2":"Reward for Onyx Hyperion missions in Stanton","RCMBNT-XTL-3":"Reward for Onyx Hyperion missions in Stanton","Yormandi Tongue":"Can be gathered from the Yormandi cave in the Onyx facilities","Yormandi Eye":"Can be gathered from the Yormandi cave in the Onyx facilities","Large Artifact Fragment (Pristine)":"Found in large blue boxes throughout the verse. Especially the Warehouse at Smuggler QV stations in Nyx","Vanduul Plating":"Acquired at the Vanduul smuggler mission auxiliary base. Can also be looted from the Vanduul Pilots around that area","Vanduul Metal":"Acquired at the Vanduul smuggler mission auxiliary base. Can also be looted from the Vanduul Pilots around that area","Saldynium (Ore)":"Acquired by aligning the PAF sites on Daymar and Aberdeen. Once you power the OLP it will open a cave where you can mine it","Jaclium (Ore)":"Acquired by aligning the PAF sites on Daymar and Aberdeen. Once you power the OLP it will open a cave where you can mine it","Argo ATLS":"Purchased from ship dealerships around the verse","Argo ATLS GEO":"Purchased from ship dealerships around the verse","Argo ATLS IKTI":"Custom variant - From Wikelo mission","NN-13 Cannon":"Can loot from the contested zone at Orbituary in Pyro","Morozov-SH Torso (Black)":"Available at armor shops and loot boxes","Morozov-SH Arms (Black)":"Available at armor shops and loot boxes","Morozov-SH Legs (Black)":"Available at armor shops and loot boxes","Morozov-SH Helmet (Black)":"Available at armor shops and loot boxes","Novikov Torso (Green)":"Available at armor shops and loot boxes","Novikov Arms (Green)":"Available at armor shops and loot boxes","Novikov Legs (Green)":"Available at armor shops and loot boxes","Novikov Helmet (Green)":"Available at armor shops and loot boxes","Pembroke Torso":"Available at armor shops and loot boxes","Pembroke Arms":"Available at armor shops and loot boxes","Pembroke Legs":"Available at armor shops and loot boxes","Pembroke Helmet":"Available at armor shops and loot boxes","RSI Venture Torso":"Available at armor shops and loot boxes","RSI Venture Arms":"Available at armor shops and loot boxes","RSI Venture Legs":"Available at armor shops and loot boxes","RSI Venture Helmet":"Available at armor shops and loot boxes","Paladin Torso":"Available by looting orange boxes at distribution centers","Paladin Arms":"Available by looting orange boxes at distribution centers","Paladin Legs":"Available by looting orange boxes at distribution centers","Paladin Helmet":"Available by looting orange boxes at distribution centers","SAR Heavy Torso":"","SAR Heavy Arms":"","SAR Heavy Legs":"","SAR Heavy Helmet":"","Arden-SL Torso":"Available at armor shops and loot boxes","Arden-SL Arms":"Available at armor shops and loot boxes","Arden-SL Legs":"Available at armor shops and loot boxes","Arden-SL Helmet":"Available at armor shops and loot boxes"};function Vx({materials:e,onUpdateQuantity:t,isOwner:n=!1,onFindOnUEX:r,onMaterialClick:i,user:o,pendingContributions:l=[]}){const[u,d]=v.useState(null),[f,h]=v.useState("");if(!e||e.length===0)return a.jsxs("div",{className:"text-center py-8 text-slate-400",children:[a.jsx(Nt,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),a.jsx("p",{children:"No materials added yet"})]});const p=g=>{const x=parseInt(f);if(!isNaN(x)&&x>=0){const _=Math.min(x,g.quantity_needed)-(g.quantity_collected||0);t(g.material_name,_)}d(null),h("")};return a.jsx("div",{className:"space-y-4",children:e.map((g,x)=>{const w=g.quantity_collected||0,_=l.filter(E=>E.material_name===g.material_name&&E.status==="pending").reduce((E,z)=>E+(z.quantity||0),0),N=g.quantity_needed-w,C=Math.min(_,N),k=g.quantity_needed>0?Math.min(w/g.quantity_needed*100,100):0,P=g.quantity_needed>0?Math.min(C/g.quantity_needed*100,100-k):0,T=w>=g.quantity_needed,S=u===g.material_name;return a.jsxs(bt.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:x*.05},onClick:()=>{o&&!n&&!T&&i&&i(g.material_name)},className:`p-4 rounded-lg border ${T?"bg-emerald-500/10 border-emerald-500/30":o&&!n&&i?"bg-slate-800/50 border-slate-700/50 cursor-pointer hover:bg-slate-700/50 hover:border-cyan-500/30 transition-all":"bg-slate-800/50 border-slate-700/50"}`,children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[T?a.jsx(Or,{className:"w-4 h-4 text-emerald-400"}):a.jsx(Nt,{className:"w-4 h-4 text-slate-400"}),a.jsx("span",{className:`font-medium ${T?"text-emerald-400":"text-white"}`,children:g.material_name}),x1[g.material_name]&&a.jsx(BT,{children:a.jsxs(VT,{children:[a.jsx($T,{asChild:!0,children:a.jsx(x0,{className:"w-4 h-4 text-slate-500 hover:text-cyan-400 cursor-help transition-colors"})}),a.jsx(Bx,{className:"bg-slate-800 border-slate-700 text-white max-w-xs",children:a.jsx("p",{className:"text-sm",children:x1[g.material_name]})})]})}),r&&!T&&a.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>r(g.material_name),className:"h-6 px-2 text-xs border-orange-500/50 text-orange-400 hover:bg-orange-500 hover:text-white hover:border-orange-500 ml-2 transition-all",children:[a.jsx(FN,{className:"w-3 h-3 mr-1"})," Find on UEX"]})]}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs("span",{className:`text-sm font-mono ${T?"text-emerald-400":"text-cyan-400"}`,children:[g.quantity_collected||0," / ",g.quantity_needed]})})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"flex-1 h-2 bg-slate-700 rounded-full overflow-hidden flex",children:[a.jsx("div",{className:`h-full transition-all duration-500 ${T?"bg-emerald-400":"bg-cyan-400"}`,style:{width:`${k}%`}}),P>0&&a.jsx("div",{className:"h-full bg-amber-400/70 transition-all duration-500",style:{width:`${P}%`},title:`${C} pending contribution(s)`})]}),t&&n&&a.jsx("div",{className:"flex items-center gap-1",children:S?a.jsxs(a.Fragment,{children:[a.jsx(dt,{type:"number",min:"0",max:g.quantity_needed,value:f,onChange:E=>h(E.target.value),onKeyDown:E=>{E.key==="Enter"&&p(g),E.key==="Escape"&&(d(null),h(""))},placeholder:String(g.quantity_collected||0),className:"h-7 w-16 bg-slate-800 border-slate-700 text-white text-xs",autoFocus:!0}),a.jsx(oe,{size:"icon",variant:"ghost",className:"h-7 w-7 text-cyan-400 hover:text-cyan-300 hover:bg-cyan-500/10",onClick:()=>p(g),children:a.jsx(er,{className:"w-3 h-3"})})]}):a.jsxs(a.Fragment,{children:[a.jsx(oe,{size:"icon",variant:"ghost",className:"h-7 w-7 text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>t(g.material_name,-1),disabled:(g.quantity_collected||0)===0,children:a.jsx(VO,{className:"w-3 h-3"})}),a.jsx(oe,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs text-slate-400 hover:text-cyan-300 hover:bg-cyan-500/10",onClick:()=>{d(g.material_name),h(String(g.quantity_collected||0))},children:"Set"}),a.jsx(oe,{size:"icon",variant:"ghost",className:"h-7 w-7 text-cyan-400 hover:text-cyan-300 hover:bg-cyan-500/10",onClick:()=>t(g.material_name,1),disabled:(g.quantity_collected||0)>=g.quantity_needed,children:a.jsx(er,{className:"w-3 h-3"})})]})})]})]},x)})})}function Pt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Ga(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const UT=6048e5,T9=864e5,lf=43200,v1=1440;let A9={};function Au(){return A9}function eu(e,t){var u,d,f,h;const n=Au(),r=(t==null?void 0:t.weekStartsOn)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??n.weekStartsOn??((h=(f=n.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,i=Pt(e),o=i.getDay(),l=(o<r?7:0)+o-r;return i.setDate(i.getDate()-l),i.setHours(0,0,0,0),i}function em(e){return eu(e,{weekStartsOn:1})}function WT(e){const t=Pt(e),n=t.getFullYear(),r=Ga(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=em(r),o=Ga(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const l=em(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=l.getTime()?n:n-1}function b1(e){const t=Pt(e);return t.setHours(0,0,0,0),t}function tm(e){const t=Pt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function M9(e,t){const n=b1(e),r=b1(t),i=+n-tm(n),o=+r-tm(r);return Math.round((i-o)/T9)}function R9(e){const t=WT(e),n=Ga(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),em(n)}function Pf(e,t){const n=Pt(e),r=Pt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function O9(e){return Ga(e,Date.now())}function I9(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function D9(e){if(!I9(e)&&typeof e!="number")return!1;const t=Pt(e);return!isNaN(Number(t))}function L9(e,t){const n=Pt(e),r=Pt(t),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return i*12+o}function q9(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function F9(e,t){return+Pt(e)-+Pt(t)}function z9(e){const t=Pt(e);return t.setHours(23,59,59,999),t}function B9(e){const t=Pt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function V9(e){const t=Pt(e);return+z9(t)==+B9(t)}function $9(e,t){const n=Pt(e),r=Pt(t),i=Pf(n,r),o=Math.abs(L9(n,r));let l;if(o<1)l=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*o);let u=Pf(n,r)===-i;V9(Pt(e))&&o===1&&Pf(e,r)===1&&(u=!1),l=i*(o-Number(u))}return l===0?0:l}function U9(e,t,n){const r=F9(e,t)/1e3;return q9(n==null?void 0:n.roundingMethod)(r)}function W9(e){const t=Pt(e),n=Ga(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const H9={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},K9=(e,t,n)=>{let r;const i=H9[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Eg(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const G9={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Q9={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Y9={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},X9={date:Eg({formats:G9,defaultWidth:"full"}),time:Eg({formats:Q9,defaultWidth:"full"}),dateTime:Eg({formats:Y9,defaultWidth:"full"})},J9={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Z9=(e,t,n,r)=>J9[e];function yc(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,u=n!=null&&n.width?String(n.width):l;i=e.formattingValues[u]||e.formattingValues[l]}else{const l=e.defaultWidth,u=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[u]||e.values[l]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const eW={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tW={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nW={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},rW={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},iW={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},aW={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},sW=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},oW={ordinalNumber:sW,era:yc({values:eW,defaultWidth:"wide"}),quarter:yc({values:tW,defaultWidth:"wide",argumentCallback:e=>e-1}),month:yc({values:nW,defaultWidth:"wide"}),day:yc({values:rW,defaultWidth:"wide"}),dayPeriod:yc({values:iW,defaultWidth:"wide",formattingValues:aW,defaultFormattingWidth:"wide"})};function xc(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const l=o[0],u=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?cW(u,p=>p.test(l)):lW(u,p=>p.test(l));let f;f=e.valueCallback?e.valueCallback(d):d,f=n.valueCallback?n.valueCallback(f):f;const h=t.slice(l.length);return{value:f,rest:h}}}function lW(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function cW(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function uW(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let l=e.valueCallback?e.valueCallback(o[0]):o[0];l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(i.length);return{value:l,rest:u}}}const dW=/^(\d+)(th|st|nd|rd)?/i,fW=/\d+/i,mW={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},hW={any:[/^b/i,/^(a|c)/i]},pW={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},gW={any:[/1/i,/2/i,/3/i,/4/i]},yW={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},xW={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},vW={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},bW={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},wW={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},_W={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},SW={ordinalNumber:uW({matchPattern:dW,parsePattern:fW,valueCallback:e=>parseInt(e,10)}),era:xc({matchPatterns:mW,defaultMatchWidth:"wide",parsePatterns:hW,defaultParseWidth:"any"}),quarter:xc({matchPatterns:pW,defaultMatchWidth:"wide",parsePatterns:gW,defaultParseWidth:"any",valueCallback:e=>e+1}),month:xc({matchPatterns:yW,defaultMatchWidth:"wide",parsePatterns:xW,defaultParseWidth:"any"}),day:xc({matchPatterns:vW,defaultMatchWidth:"wide",parsePatterns:bW,defaultParseWidth:"any"}),dayPeriod:xc({matchPatterns:wW,defaultMatchWidth:"any",parsePatterns:_W,defaultParseWidth:"any"})},HT={code:"en-US",formatDistance:K9,formatLong:X9,formatRelative:Z9,localize:oW,match:SW,options:{weekStartsOn:0,firstWeekContainsDate:1}};function jW(e){const t=Pt(e);return M9(t,W9(t))+1}function NW(e){const t=Pt(e),n=+em(t)-+R9(t);return Math.round(n/UT)+1}function KT(e,t){var h,p,g,x;const n=Pt(e),r=n.getFullYear(),i=Au(),o=(t==null?void 0:t.firstWeekContainsDate)??((p=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??i.firstWeekContainsDate??((x=(g=i.locale)==null?void 0:g.options)==null?void 0:x.firstWeekContainsDate)??1,l=Ga(e,0);l.setFullYear(r+1,0,o),l.setHours(0,0,0,0);const u=eu(l,t),d=Ga(e,0);d.setFullYear(r,0,o),d.setHours(0,0,0,0);const f=eu(d,t);return n.getTime()>=u.getTime()?r+1:n.getTime()>=f.getTime()?r:r-1}function CW(e,t){var u,d,f,h;const n=Au(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(f=n.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,i=KT(e,t),o=Ga(e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),eu(o,t)}function kW(e,t){const n=Pt(e),r=+eu(n,t)-+CW(n,t);return Math.round(r/UT)+1}function jt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const wa={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return jt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):jt(n+1,2)},d(e,t){return jt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return jt(e.getHours()%12||12,t.length)},H(e,t){return jt(e.getHours(),t.length)},m(e,t){return jt(e.getMinutes(),t.length)},s(e,t){return jt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return jt(i,t.length)}},Ao={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},w1={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return wa.y(e,t)},Y:function(e,t,n,r){const i=KT(e,r),o=i>0?i:1-i;if(t==="YY"){const l=o%100;return jt(l,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):jt(o,t.length)},R:function(e,t){const n=WT(e);return jt(n,t.length)},u:function(e,t){const n=e.getFullYear();return jt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return jt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return jt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return wa.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return jt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=kW(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):jt(i,t.length)},I:function(e,t,n){const r=NW(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):jt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):wa.d(e,t)},D:function(e,t,n){const r=jW(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):jt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return jt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return jt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return jt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Ao.noon:r===0?i=Ao.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Ao.evening:r>=12?i=Ao.afternoon:r>=4?i=Ao.morning:i=Ao.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return wa.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):wa.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):jt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):jt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):wa.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):wa.s(e,t)},S:function(e,t){return wa.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return S1(r);case"XXXX":case"XX":return ys(r);case"XXXXX":case"XXX":default:return ys(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return S1(r);case"xxxx":case"xx":return ys(r);case"xxxxx":case"xxx":default:return ys(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+_1(r,":");case"OOOO":default:return"GMT"+ys(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+_1(r,":");case"zzzz":default:return"GMT"+ys(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return jt(r,t.length)},T:function(e,t,n){const r=e.getTime();return jt(r,t.length)}};function _1(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+jt(o,2)}function S1(e,t){return e%60===0?(e>0?"-":"+")+jt(Math.abs(e)/60,2):ys(e,t)}function ys(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=jt(Math.trunc(r/60),2),o=jt(r%60,2);return n+i+t+o}const j1=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},GT=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},PW=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return j1(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",j1(r,t)).replace("{{time}}",GT(i,t))},EW={p:GT,P:PW},TW=/^D+$/,AW=/^Y+$/,MW=["D","DD","YY","YYYY"];function RW(e){return TW.test(e)}function OW(e){return AW.test(e)}function IW(e,t,n){const r=DW(e,t,n);if(console.warn(r),MW.includes(e))throw new RangeError(r)}function DW(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const LW=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qW=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,FW=/^'([^]*?)'?$/,zW=/''/g,BW=/[a-zA-Z]/;function QT(e,t,n){var h,p,g,x;const r=Au(),i=r.locale??HT,o=r.firstWeekContainsDate??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,l=r.weekStartsOn??((x=(g=r.locale)==null?void 0:g.options)==null?void 0:x.weekStartsOn)??0,u=Pt(e);if(!D9(u))throw new RangeError("Invalid time value");let d=t.match(qW).map(w=>{const _=w[0];if(_==="p"||_==="P"){const N=EW[_];return N(w,i.formatLong)}return w}).join("").match(LW).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const _=w[0];if(_==="'")return{isToken:!1,value:VW(w)};if(w1[_])return{isToken:!0,value:w};if(_.match(BW))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:w}});i.localize.preprocessor&&(d=i.localize.preprocessor(u,d));const f={firstWeekContainsDate:o,weekStartsOn:l,locale:i};return d.map(w=>{if(!w.isToken)return w.value;const _=w.value;(OW(_)||RW(_))&&IW(_,t,String(e));const N=w1[_[0]];return N(u,_,i.localize,f)}).join("")}function VW(e){const t=e.match(FW);return t?t[1].replace(zW,"'"):e}function $W(e,t,n){const r=Au(),i=(n==null?void 0:n.locale)??r.locale??HT,o=2520,l=Pf(e,t);if(isNaN(l))throw new RangeError("Invalid time value");const u=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:l});let d,f;l>0?(d=Pt(t),f=Pt(e)):(d=Pt(e),f=Pt(t));const h=U9(f,d),p=(tm(f)-tm(d))/1e3,g=Math.round((h-p)/60);let x;if(g<2)return n!=null&&n.includeSeconds?h<5?i.formatDistance("lessThanXSeconds",5,u):h<10?i.formatDistance("lessThanXSeconds",10,u):h<20?i.formatDistance("lessThanXSeconds",20,u):h<40?i.formatDistance("halfAMinute",0,u):h<60?i.formatDistance("lessThanXMinutes",1,u):i.formatDistance("xMinutes",1,u):g===0?i.formatDistance("lessThanXMinutes",1,u):i.formatDistance("xMinutes",g,u);if(g<45)return i.formatDistance("xMinutes",g,u);if(g<90)return i.formatDistance("aboutXHours",1,u);if(g<v1){const w=Math.round(g/60);return i.formatDistance("aboutXHours",w,u)}else{if(g<o)return i.formatDistance("xDays",1,u);if(g<lf){const w=Math.round(g/v1);return i.formatDistance("xDays",w,u)}else if(g<lf*2)return x=Math.round(g/lf),i.formatDistance("aboutXMonths",x,u)}if(x=$9(f,d),x<12){const w=Math.round(g/lf);return i.formatDistance("xMonths",w,u)}else{const w=x%12,_=Math.trunc(x/12);return w<3?i.formatDistance("aboutXYears",_,u):w<9?i.formatDistance("overXYears",_,u):i.formatDistance("almostXYears",_+1,u)}}function Um(e,t){return $W(e,O9(e),t)}function $x({userEmail:e,userName:t,userAvatar:n=null,children:r,className:i="text-cyan-400 hover:underline cursor-pointer"}){const o=yl(),l=Bt(),{data:u}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),d=async f=>{if(f.preventDefault(),f.stopPropagation(),!(!u||u.email===e||!t))try{const p=(await O.entities.Conversation.list()).find(g=>{var x,w;return((x=g.participant_emails)==null?void 0:x.includes(u.email))&&((w=g.participant_emails)==null?void 0:w.includes(e))});if(p)o(nt("Messages")+`?conv=${p.id}`);else{const g=await O.entities.Conversation.create({participant_emails:[u.email,e],participant_names:[u.alias||u.full_name,t],participant_avatars:[u.avatar_url,n],unread_count:{[u.email]:0,[e]:0}});await l.invalidateQueries({queryKey:["conversations"]}),o(nt("Messages")+`?conv=${g.id}`)}}catch(h){console.error("Failed to start conversation:",h),alert("Unable to start conversation. Please try again.")}};return a.jsx("span",{onClick:d,className:i,children:r||t})}function Ux({contributions:e,contributorReputation:t={},isOwner:n,currentUserEmail:r,onMarkDelivered:i,onDecline:o,onDelete:l,onEdit:u}){return!e||e.length===0?a.jsxs("div",{className:"text-center py-8 text-slate-400",children:[a.jsx(Rf,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),a.jsx("p",{children:"No contributions yet. Be the first!"})]}):a.jsx("div",{className:"space-y-3",children:e.map((d,f)=>{const h=d.status==="pending",p=d.status==="declined",g=d.contributor_email===r;return a.jsxs(bt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:f*.05},className:"flex items-center justify-between p-4 rounded-lg bg-slate-800/50 border border-slate-700/50",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-cyan-500 to-purple-500 flex items-center justify-center overflow-hidden",children:d.contributor_avatar?a.jsx("img",{src:d.contributor_avatar,alt:"",className:"w-full h-full object-cover"}):a.jsx("span",{className:"text-white font-medium text-sm",children:(d.contributor_name||"A")[0].toUpperCase()})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($x,{userEmail:d.contributor_email,userName:d.contributor_name,userAvatar:d.contributor_avatar,children:a.jsx("span",{className:"font-medium text-white hover:text-cyan-400 cursor-pointer transition-colors",children:d.contributor_name||"Anonymous"})}),a.jsx(zt,{className:h?"bg-amber-500/20 text-amber-400 border-amber-500/30":p?"bg-red-500/20 text-red-400 border-red-500/30":"bg-green-500/20 text-green-400 border-green-500/30",children:h?"Pending":p?"Declined":"Delivered"})]}),d.in_game_name&&a.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:["In-game: ",d.in_game_name]}),a.jsx("p",{className:"text-sm text-slate-400",children:d.created_date&&QT(new Date(d.created_date),"MMM d, yyyy")}),a.jsxs("p",{className:"text-xs text-slate-500",children:[d.delivery_type==="dropoff"?"📦 Drop-off":"📍 Pickup",": ",d.location||"Not specified"]})]})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"text-right",children:[a.jsxs("div",{className:"flex items-center gap-2 text-cyan-400",children:[a.jsx(Nt,{className:"w-4 h-4"}),a.jsxs("span",{className:"font-mono font-medium",children:["+",d.quantity]})]}),a.jsx("p",{className:"text-sm text-slate-400",children:d.material_name})]}),a.jsxs("div",{className:"flex gap-2",children:[n&&h&&a.jsxs(a.Fragment,{children:[a.jsx(oe,{size:"sm",onClick:()=>i(d.id),className:"bg-green-500 hover:bg-green-600",children:a.jsx(Or,{className:"w-4 h-4"})}),a.jsx(oe,{size:"sm",onClick:()=>o(d),className:"bg-red-500 hover:bg-red-600",children:a.jsx(ON,{className:"w-4 h-4"})})]}),g&&h&&a.jsxs(a.Fragment,{children:[a.jsx(oe,{size:"sm",variant:"ghost",onClick:()=>u(d),className:"text-cyan-400 hover:text-cyan-300 hover:bg-cyan-500/10",children:a.jsx(b0,{className:"w-4 h-4"})}),a.jsx(oe,{size:"sm",variant:"ghost",onClick:()=>l(d.id,d),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:a.jsx(wi,{className:"w-4 h-4"})})]})]})]})]},d.id)})})}var Wm="Dialog",[YT,XT]=vr(Wm),[UW,ei]=YT(Wm),JT=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,u=v.useRef(null),d=v.useRef(null),[f,h]=Va({prop:r,defaultProp:i??!1,onChange:o,caller:Wm});return a.jsx(UW,{scope:t,triggerRef:u,contentRef:d,contentId:Qr(),titleId:Qr(),descriptionId:Qr(),open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),modal:l,children:n})};JT.displayName=Wm;var ZT="DialogTrigger",eA=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ei(ZT,n),o=ct(t,i.triggerRef);return a.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Kx(i.open),...r,ref:o,onClick:Ce(e.onClick,i.onOpenToggle)})});eA.displayName=ZT;var Wx="DialogPortal",[WW,tA]=YT(Wx,{forceMount:void 0}),nA=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=ei(Wx,t);return a.jsx(WW,{scope:t,forceMount:n,children:v.Children.map(r,l=>a.jsx(Fn,{present:n||o.open,children:a.jsx(Pu,{asChild:!0,container:i,children:l})}))})};nA.displayName=Wx;var nm="DialogOverlay",rA=v.forwardRef((e,t)=>{const n=tA(nm,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=ei(nm,e.__scopeDialog);return o.modal?a.jsx(Fn,{present:r||o.open,children:a.jsx(KW,{...i,ref:t})}):null});rA.displayName=nm;var HW=Vs("DialogOverlay.RemoveScroll"),KW=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ei(nm,n);return a.jsx(qm,{as:HW,allowPinchZoom:!0,shards:[i.contentRef],children:a.jsx(Xe.div,{"data-state":Kx(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Hs="DialogContent",iA=v.forwardRef((e,t)=>{const n=tA(Hs,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=ei(Hs,e.__scopeDialog);return a.jsx(Fn,{present:r||o.open,children:o.modal?a.jsx(GW,{...i,ref:t}):a.jsx(QW,{...i,ref:t})})});iA.displayName=Hs;var GW=v.forwardRef((e,t)=>{const n=ei(Hs,e.__scopeDialog),r=v.useRef(null),i=ct(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return Dx(o)},[]),a.jsx(aA,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault())})}),QW=v.forwardRef((e,t)=>{const n=ei(Hs,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return a.jsx(aA,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((f=n.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),aA=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,u=ei(Hs,n),d=v.useRef(null),f=ct(t,d);return Sx(),a.jsxs(a.Fragment,{children:[a.jsx(Mm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:a.jsx(Cu,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Kx(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(XW,{titleId:u.titleId}),a.jsx(ZW,{contentRef:d,descriptionId:u.descriptionId})]})]})}),Hx="DialogTitle",sA=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ei(Hx,n);return a.jsx(Xe.h2,{id:i.titleId,...r,ref:t})});sA.displayName=Hx;var oA="DialogDescription",lA=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ei(oA,n);return a.jsx(Xe.p,{id:i.descriptionId,...r,ref:t})});lA.displayName=oA;var cA="DialogClose",uA=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ei(cA,n);return a.jsx(Xe.button,{type:"button",...r,ref:t,onClick:Ce(e.onClick,()=>i.onOpenChange(!1))})});uA.displayName=cA;function Kx(e){return e?"open":"closed"}var dA="DialogTitleWarning",[YW,fA]=n3(dA,{contentName:Hs,titleName:Hx,docsSlug:"dialog"}),XW=({titleId:e})=>{const t=fA(dA),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
||
|
||
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||
|
||
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},JW="DialogDescriptionWarning",ZW=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${fA(JW).contentName}}.`;return v.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},mA=JT,hA=eA,pA=nA,Gx=rA,Qx=iA,Yx=sA,Xx=lA,Jx=uA;const xr=mA,e7=hA,t7=pA,gA=v.forwardRef(({className:e,...t},n)=>a.jsx(Gx,{ref:n,className:Fe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));gA.displayName=Gx.displayName;const tr=v.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(t7,{children:[a.jsx(gA,{}),a.jsxs(Qx,{ref:r,className:Fe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,a.jsxs(Jx,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(mm,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));tr.displayName=Qx.displayName;const nr=({className:e,...t})=>a.jsx("div",{className:Fe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});nr.displayName="DialogHeader";const rr=v.forwardRef(({className:e,...t},n)=>a.jsx(Yx,{ref:n,className:Fe("text-lg font-semibold leading-none tracking-tight",e),...t}));rr.displayName=Yx.displayName;const yA=v.forwardRef(({className:e,...t},n)=>a.jsx(Xx,{ref:n,className:Fe("text-sm text-muted-foreground",e),...t}));yA.displayName=Xx.displayName;var n7="Label",xA=v.forwardRef((e,t)=>a.jsx(Xe.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));xA.displayName=n7;var vA=xA;const r7=uu("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ge=v.forwardRef(({className:e,...t},n)=>a.jsx(vA,{ref:n,className:Fe(r7(),e),...t}));Ge.displayName=vA.displayName;function Zx({open:e,onClose:t,onSubmit:n,materials:r,isLoading:i,editMode:o=!1,contribution:l=null,projectOwnerId:u,preSelectedMaterial:d=null}){const[f,h]=v.useState([]),[p,g]=v.useState(""),[x,w]=v.useState("pickup"),[_,N]=v.useState(""),{data:C}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),k=(C==null?void 0:C.email)===u,{data:P=[]}=me({queryKey:["materials"],queryFn:()=>O.entities.Material.list()}),{data:T=[]}=me({queryKey:["inventory",C==null?void 0:C.email],queryFn:()=>O.entities.UserMaterialInventory.filter({user_email:C==null?void 0:C.email}),enabled:!!(C!=null&&C.email)}),S=Tn.useMemo(()=>{const U={};return P.forEach(W=>{U[W.name]=W.reputation_value||10}),U},[P]);v.useEffect(()=>{e&&(o&&l?(h([{material_name:l.material_name,quantity:l.quantity}]),g(l.in_game_name||""),w(l.delivery_type||"pickup"),N(l.location||"")):(h(d?[{material_name:d,quantity:1}]:[]),g((C==null?void 0:C.alias)||""),w("pickup"),N((C==null?void 0:C.default_home_port)||"")))},[C,e,o,l,d]);const E=U=>{!U||f.findIndex(G=>G.material_name===U)>=0||h([...f,{material_name:U,quantity:1}])},z=(U,W)=>{h(f.map(G=>G.material_name===U?{...G,quantity:Number(W)}:G))},D=U=>{h(f.filter(W=>W.material_name!==U))},K=async U=>{if(U.preventDefault(),k&&!o){alert("Project owners cannot contribute to their own projects");return}if(f.length>0){if(o)await n({material_name:f[0].material_name,quantity:f[0].quantity,in_game_name:p,delivery_type:x,location:_});else for(const W of f)await n({material_name:W.material_name,quantity:W.quantity,in_game_name:p,delivery_type:x,location:_});h([]),g(""),w("pickup"),N("")}};return a.jsx(xr,{open:e,onOpenChange:t,children:a.jsxs(tr,{className:"bg-slate-900 border-slate-700 text-white",children:[a.jsx(nr,{children:a.jsxs(rr,{className:"flex items-center gap-2",children:[a.jsx(Nt,{className:"w-5 h-5 text-cyan-400"}),o?"Edit Contribution":"Contribute Materials"]})}),a.jsxs("form",{onSubmit:K,className:"space-y-6 mt-4",children:[!o&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Add Materials"}),a.jsxs(en,{onValueChange:E,value:"",children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{placeholder:"Choose materials to add..."})}),a.jsx(Qt,{className:"bg-slate-800 border-slate-700",children:r==null?void 0:r.filter(U=>{const W=U.quantity_needed-(U.quantity_collected||0),G=f.some(R=>R.material_name===U.material_name);return W>0&&!G}).map((U,W)=>{const G=S[U.material_name]||10;return a.jsxs(st,{value:U.material_name,className:"text-white hover:bg-slate-700 hover:text-white",children:[U.material_name," (",U.quantity_needed-(U.quantity_collected||0)," needed) - ",G," pts/ea"]},W)})})]})]}),f.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Selected Materials"}),a.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:f.map(U=>{const W=r==null?void 0:r.find(J=>J.material_name===U.material_name),G=W?W.quantity_needed-(W.quantity_collected||0):100,R=T.find(J=>J.material_name===U.material_name),q=(R==null?void 0:R.quantity)||0;return a.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-800/50 rounded-lg border border-slate-700",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-sm font-medium text-white",children:U.material_name}),a.jsxs("p",{className:"text-xs text-slate-400",children:["Max needed: ",G]}),q>0&&a.jsxs("p",{className:"text-xs text-cyan-400",children:["💼 In inventory: ",q]})]}),a.jsx(dt,{type:"number",min:"1",max:G,value:U.quantity,onChange:J=>z(U.material_name,J.target.value),className:"w-24 bg-slate-800 border-slate-700 text-white"}),a.jsx(oe,{type:"button",variant:"ghost",size:"sm",onClick:()=>D(U.material_name),className:"text-red-400 hover:text-red-300",children:"Remove"})]},U.material_name)})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"In-Game Name (Optional)"}),a.jsx(dt,{placeholder:"Your Star Citizen handle...",value:p,onChange:U=>g(U.target.value),className:"bg-slate-800 border-slate-700 text-white placeholder:text-slate-500"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Delivery Method"}),a.jsxs(en,{value:x,onValueChange:w,children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{})}),a.jsxs(Qt,{className:"bg-slate-800 border-slate-700",children:[a.jsx(st,{value:"pickup",className:"text-white hover:bg-slate-700 hover:text-white",children:"Pickup - Materials need to be picked up"}),a.jsx(st,{value:"dropoff",className:"text-white hover:bg-slate-700 hover:text-white",children:"Drop-off - I will deliver materials"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Ge,{className:"text-slate-300",children:[x==="pickup"?"Pickup Location":"Drop-off Location"," (Optional)"]}),a.jsx(dt,{placeholder:x==="pickup"?"e.g., Port Olisar, Lorville...":"e.g., Project home port...",value:_,onChange:U=>N(U.target.value),className:"bg-slate-800 border-slate-700 text-white placeholder:text-slate-500"})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(oe,{type:"button",variant:"ghost",onClick:t,className:"text-slate-400",children:"Cancel"}),a.jsxs(oe,{type:"submit",disabled:i||f.length===0,className:"bg-cyan-500 hover:bg-cyan-600 text-white",children:[i?a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}):null,o?"Update Contribution":`Contribute (${f.length})`]})]})]})]})})}function i7(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var ev="ScrollArea",[bA]=vr(ev),[a7,Ir]=bA(ev),wA=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...l}=e,[u,d]=v.useState(null),[f,h]=v.useState(null),[p,g]=v.useState(null),[x,w]=v.useState(null),[_,N]=v.useState(null),[C,k]=v.useState(0),[P,T]=v.useState(0),[S,E]=v.useState(!1),[z,D]=v.useState(!1),K=ct(t,W=>d(W)),U=vu(i);return a.jsx(a7,{scope:n,type:r,dir:U,scrollHideDelay:o,scrollArea:u,viewport:f,onViewportChange:h,content:p,onContentChange:g,scrollbarX:x,onScrollbarXChange:w,scrollbarXEnabled:S,onScrollbarXEnabledChange:E,scrollbarY:_,onScrollbarYChange:N,scrollbarYEnabled:z,onScrollbarYEnabledChange:D,onCornerWidthChange:k,onCornerHeightChange:T,children:a.jsx(Xe.div,{dir:U,...l,ref:K,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":P+"px",...e.style}})})});wA.displayName=ev;var _A="ScrollAreaViewport",SA=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,l=Ir(_A,n),u=v.useRef(null),d=ct(t,u,l.onViewportChange);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),a.jsx(Xe.div,{"data-radix-scroll-area-viewport":"",...o,ref:d,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:a.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});SA.displayName=_A;var ki="ScrollAreaScrollbar",tv=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ir(ki,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:l}=i,u=e.orientation==="horizontal";return v.useEffect(()=>(u?o(!0):l(!0),()=>{u?o(!1):l(!1)}),[u,o,l]),i.type==="hover"?a.jsx(s7,{...r,ref:t,forceMount:n}):i.type==="scroll"?a.jsx(o7,{...r,ref:t,forceMount:n}):i.type==="auto"?a.jsx(jA,{...r,ref:t,forceMount:n}):i.type==="always"?a.jsx(nv,{...r,ref:t}):null});tv.displayName=ki;var s7=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ir(ki,e.__scopeScrollArea),[o,l]=v.useState(!1);return v.useEffect(()=>{const u=i.scrollArea;let d=0;if(u){const f=()=>{window.clearTimeout(d),l(!0)},h=()=>{d=window.setTimeout(()=>l(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",f),u.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",f),u.removeEventListener("pointerleave",h)}}},[i.scrollArea,i.scrollHideDelay]),a.jsx(Fn,{present:n||o,children:a.jsx(jA,{"data-state":o?"visible":"hidden",...r,ref:t})})}),o7=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ir(ki,e.__scopeScrollArea),o=e.orientation==="horizontal",l=Km(()=>d("SCROLL_END"),100),[u,d]=i7("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return v.useEffect(()=>{if(u==="idle"){const f=window.setTimeout(()=>d("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(f)}},[u,i.scrollHideDelay,d]),v.useEffect(()=>{const f=i.viewport,h=o?"scrollLeft":"scrollTop";if(f){let p=f[h];const g=()=>{const x=f[h];p!==x&&(d("SCROLL"),l()),p=x};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[i.viewport,o,d,l]),a.jsx(Fn,{present:n||u!=="hidden",children:a.jsx(nv,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ce(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Ce(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),jA=v.forwardRef((e,t)=>{const n=Ir(ki,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,l]=v.useState(!1),u=e.orientation==="horizontal",d=Km(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;l(u?f:h)}},10);return fl(n.viewport,d),fl(n.content,d),a.jsx(Fn,{present:r||o,children:a.jsx(nv,{"data-state":o?"visible":"hidden",...i,ref:t})})}),nv=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=Ir(ki,e.__scopeScrollArea),o=v.useRef(null),l=v.useRef(0),[u,d]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=EA(u.viewport,u.content),h={...r,sizes:u,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:g=>o.current=g,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:g=>l.current=g};function p(g,x){return m7(g,l.current,u,x)}return n==="horizontal"?a.jsx(l7,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const g=i.viewport.scrollLeft,x=N1(g,u,i.dir);o.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollLeft=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollLeft=p(g,i.dir))}}):n==="vertical"?a.jsx(c7,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const g=i.viewport.scrollTop,x=N1(g,u);o.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollTop=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollTop=p(g))}}):null}),l7=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=Ir(ki,e.__scopeScrollArea),[l,u]=v.useState(),d=v.useRef(null),f=ct(t,d,o.onScrollbarXChange);return v.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),a.jsx(CA,{"data-orientation":"horizontal",...i,ref:f,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Hm(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(o.viewport){const g=o.viewport.scrollLeft+h.deltaX;e.onWheelScroll(g),AA(g,p)&&h.preventDefault()}},onResize:()=>{d.current&&o.viewport&&l&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:im(l.paddingLeft),paddingEnd:im(l.paddingRight)}})}})}),c7=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=Ir(ki,e.__scopeScrollArea),[l,u]=v.useState(),d=v.useRef(null),f=ct(t,d,o.onScrollbarYChange);return v.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),a.jsx(CA,{"data-orientation":"vertical",...i,ref:f,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Hm(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(o.viewport){const g=o.viewport.scrollTop+h.deltaY;e.onWheelScroll(g),AA(g,p)&&h.preventDefault()}},onResize:()=>{d.current&&o.viewport&&l&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:im(l.paddingTop),paddingEnd:im(l.paddingBottom)}})}})}),[u7,NA]=bA(ki),CA=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:l,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:p,...g}=e,x=Ir(ki,n),[w,_]=v.useState(null),N=ct(t,K=>_(K)),C=v.useRef(null),k=v.useRef(""),P=x.viewport,T=r.content-r.viewport,S=_n(h),E=_n(d),z=Km(p,10);function D(K){if(C.current){const U=K.clientX-C.current.left,W=K.clientY-C.current.top;f({x:U,y:W})}}return v.useEffect(()=>{const K=U=>{const W=U.target;(w==null?void 0:w.contains(W))&&S(U,T)};return document.addEventListener("wheel",K,{passive:!1}),()=>document.removeEventListener("wheel",K,{passive:!1})},[P,w,T,S]),v.useEffect(E,[r,E]),fl(w,z),fl(x.content,z),a.jsx(u7,{scope:n,scrollbar:w,hasThumb:i,onThumbChange:_n(o),onThumbPointerUp:_n(l),onThumbPositionChange:E,onThumbPointerDown:_n(u),children:a.jsx(Xe.div,{...g,ref:N,style:{position:"absolute",...g.style},onPointerDown:Ce(e.onPointerDown,K=>{K.button===0&&(K.target.setPointerCapture(K.pointerId),C.current=w.getBoundingClientRect(),k.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),D(K))}),onPointerMove:Ce(e.onPointerMove,D),onPointerUp:Ce(e.onPointerUp,K=>{const U=K.target;U.hasPointerCapture(K.pointerId)&&U.releasePointerCapture(K.pointerId),document.body.style.webkitUserSelect=k.current,x.viewport&&(x.viewport.style.scrollBehavior=""),C.current=null})})})}),rm="ScrollAreaThumb",kA=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=NA(rm,e.__scopeScrollArea);return a.jsx(Fn,{present:n||i.hasThumb,children:a.jsx(d7,{ref:t,...r})})}),d7=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=Ir(rm,n),l=NA(rm,n),{onThumbPositionChange:u}=l,d=ct(t,p=>l.onThumbChange(p)),f=v.useRef(void 0),h=Km(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const p=o.viewport;if(p){const g=()=>{if(h(),!f.current){const x=h7(p,u);f.current=x,u()}};return u(),p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[o.viewport,h,u]),a.jsx(Xe.div,{"data-state":l.hasThumb?"visible":"hidden",...i,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ce(e.onPointerDownCapture,p=>{const x=p.target.getBoundingClientRect(),w=p.clientX-x.left,_=p.clientY-x.top;l.onThumbPointerDown({x:w,y:_})}),onPointerUp:Ce(e.onPointerUp,l.onThumbPointerUp)})});kA.displayName=rm;var rv="ScrollAreaCorner",PA=v.forwardRef((e,t)=>{const n=Ir(rv,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(f7,{...e,ref:t}):null});PA.displayName=rv;var f7=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Ir(rv,n),[o,l]=v.useState(0),[u,d]=v.useState(0),f=!!(o&&u);return fl(i.scrollbarX,()=>{var p;const h=((p=i.scrollbarX)==null?void 0:p.offsetHeight)||0;i.onCornerHeightChange(h),d(h)}),fl(i.scrollbarY,()=>{var p;const h=((p=i.scrollbarY)==null?void 0:p.offsetWidth)||0;i.onCornerWidthChange(h),l(h)}),f?a.jsx(Xe.div,{...r,ref:t,style:{width:o,height:u,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function im(e){return e?parseInt(e,10):0}function EA(e,t){const n=e/t;return isNaN(n)?0:n}function Hm(e){const t=EA(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function m7(e,t,n,r="ltr"){const i=Hm(n),o=i/2,l=t||o,u=i-l,d=n.scrollbar.paddingStart+l,f=n.scrollbar.size-n.scrollbar.paddingEnd-u,h=n.content-n.viewport,p=r==="ltr"?[0,h]:[h*-1,0];return TA([d,f],p)(e)}function N1(e,t,n="ltr"){const r=Hm(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,l=t.content-t.viewport,u=o-r,d=n==="ltr"?[0,l]:[l*-1,0],f=zy(e,d);return TA([0,l],[0,u])(f)}function TA(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function AA(e,t){return e>0&&e<t}var h7=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){const o={left:e.scrollLeft,top:e.scrollTop},l=n.left!==o.left,u=n.top!==o.top;(l||u)&&t(),n=o,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function Km(e,t){const n=_n(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function fl(e,t){const n=_n(t);jn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var MA=wA,p7=SA,g7=PA;const Cl=v.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(MA,{ref:r,className:Fe("relative overflow-hidden",e),...n,children:[a.jsx(p7,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsx(RA,{}),a.jsx(g7,{})]}));Cl.displayName=MA.displayName;const RA=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>a.jsx(tv,{ref:r,orientation:t,className:Fe("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:a.jsx(kA,{className:"relative flex-1 rounded-full bg-border"})}));RA.displayName=tv.displayName;function iv({open:e,onClose:t,materialName:n,listings:r,isLoading:i,error:o}){return a.jsx(xr,{open:e,onOpenChange:t,children:a.jsxs(tr,{className:"bg-slate-900 border-slate-700 text-white max-w-2xl",children:[a.jsxs(nr,{children:[a.jsxs(rr,{className:"flex items-center gap-2 text-white",children:[a.jsx(FN,{className:"w-5 h-5 text-cyan-400"}),"UEX Marketplace: ",n]}),a.jsx(yA,{className:"text-slate-400",children:"Browse available listings on UEX Corp marketplace"})]}),i&&a.jsx("div",{className:"flex justify-center py-12",children:a.jsx(tt,{className:"w-8 h-8 text-cyan-400 animate-spin"})}),o&&a.jsxs("div",{className:"text-red-400 text-center py-8 bg-red-500/10 rounded-lg border border-red-500/30",children:["Error: ",o.message||"Failed to fetch listings"]}),!i&&!o&&a.jsx(Cl,{className:"h-[400px] pr-4",children:r&&r.data&&r.data.length>0?a.jsx("div",{className:"space-y-3",children:r.data.map((l,u)=>a.jsxs("div",{className:"p-4 border border-slate-700 rounded-lg bg-slate-800/50 hover:bg-slate-800 transition-colors",children:[a.jsxs("div",{className:"flex items-start justify-between mb-2",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-base font-semibold text-white mb-1",children:l.title}),a.jsxs("p",{className:"text-lg text-cyan-400 font-bold",children:[parseInt(l.price).toLocaleString()," aUEC"]})]}),a.jsxs("a",{href:`https://uexcorp.space/marketplace/item/info/${l.slug}/`,target:"_blank",rel:"noopener noreferrer",className:"text-cyan-400 hover:text-cyan-300 flex items-center text-sm gap-1 border border-cyan-500/30 px-3 py-1 rounded hover:bg-cyan-500/10 transition-colors",children:["View ",a.jsx(y0,{className:"w-3 h-3"})]})]}),a.jsxs("div",{className:"space-y-1 text-sm",children:[a.jsxs("p",{className:"text-slate-300",children:["Seller: ",a.jsx("span",{className:"text-white",children:l.user_username})]}),l.location&&a.jsxs("p",{className:"text-slate-400",children:["📍 ",l.location]}),l.description&&l.description!==l.title&&a.jsx("p",{className:"text-slate-500 text-xs mt-1",children:l.description})]})]},u))}):a.jsxs("div",{className:"text-center text-slate-500 py-12",children:["No listings found for ",n,"."]})})]})})}function av({open:e,onClose:t,onSubmit:n,isLoading:r,organizations:i}){const[o,l]=v.useState(""),u=f=>{f.preventDefault();const h=i.find(p=>p.id===o);h&&n(h)},d=()=>{l(""),t()};return a.jsx(xr,{open:e,onOpenChange:d,children:a.jsxs(tr,{className:"bg-slate-900 border-slate-700 max-w-md",children:[a.jsx(nr,{children:a.jsx(rr,{className:"text-white text-xl",children:"Link to Organization"})}),a.jsxs("form",{onSubmit:u,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Select Organization"}),a.jsxs(en,{value:o,onValueChange:l,children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{placeholder:"Choose an organization..."})}),a.jsx(Qt,{className:"bg-slate-800 border-slate-700",children:i.map(f=>a.jsx(st,{value:f.id,className:"text-white hover:bg-slate-700",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Sn,{className:"w-4 h-4 text-cyan-400"}),a.jsx("span",{children:f.name}),a.jsxs("span",{className:"text-slate-400 text-sm font-mono",children:["(",f.tag,")"]})]})},f.id))})]}),a.jsx("p",{className:"text-xs text-slate-500",children:"This project will be associated with the selected organization"})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(oe,{type:"button",variant:"outline",onClick:d,className:"border-slate-700 text-slate-300 hover:bg-slate-800",children:"Cancel"}),a.jsx(oe,{type:"submit",disabled:!o||r,className:"bg-cyan-500 hover:bg-cyan-600",children:r?a.jsxs(a.Fragment,{children:[a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"Linking..."]}):"Link to Organization"})]})]})]})})}const Pi=v.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:Fe("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Pi.displayName="Textarea";function y7({open:e,onClose:t,onSubmit:n,project:r,isLoading:i}){const{data:o}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),{data:l=[]}=me({queryKey:["my-memberships",o==null?void 0:o.email],queryFn:()=>O.entities.OrganizationMember.filter({user_email:o==null?void 0:o.email,status:"active",role:"admin"}),enabled:!!(o!=null&&o.email)}),{data:u=[]}=me({queryKey:["my-admin-orgs",l],queryFn:async()=>{if(l.length===0)return[];const p=l.map(x=>x.org_id);return(await Promise.all(p.map(x=>O.entities.Organization.filter({id:x})))).flat()},enabled:l.length>0}),[d,f]=v.useState({description:"",home_port:"",org_id:"",privacy:"public"});v.useEffect(()=>{if(r&&u.length>=0){const p=u.find(g=>g.tag===r.org_tag);f({description:r.description||"",home_port:r.home_port||"",org_id:(p==null?void 0:p.id)||"",privacy:r.privacy||"public"})}},[r,u]);const h=p=>{p.preventDefault();const g=u.find(w=>w.id===d.org_id),x={...d,org_name:(g==null?void 0:g.name)||null,org_tag:(g==null?void 0:g.tag)||null};delete x.org_id,n(x)};return a.jsx(xr,{open:e,onOpenChange:t,children:a.jsxs(tr,{className:"bg-slate-900 border-slate-700 text-white max-w-lg",children:[a.jsx(nr,{children:a.jsxs(rr,{className:"flex items-center gap-2 text-xl",children:[a.jsx(Sn,{className:"w-5 h-5 text-cyan-400"}),"Edit Armor Project"]})}),a.jsxs("form",{onSubmit:h,className:"space-y-6 mt-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Description"}),a.jsx(Pi,{placeholder:"Add notes about your project...",value:d.description,onChange:p=>f({...d,description:p.target.value}),className:"bg-slate-800 border-slate-700 text-white placeholder:text-slate-500",rows:3})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Home Port / Drop Off Location"}),a.jsx(dt,{placeholder:"e.g., Port Olisar, Lorville, Area18...",value:d.home_port,onChange:p=>f({...d,home_port:p.target.value}),className:"bg-slate-800 border-slate-700 text-white placeholder:text-slate-500"})]}),u.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Organization (Optional)"}),a.jsxs(en,{value:d.org_id,onValueChange:p=>f({...d,org_id:p}),children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{placeholder:"Select organization..."})}),a.jsxs(Qt,{className:"bg-slate-800 border-slate-700",children:[a.jsx(st,{value:null,children:"None"}),u.map(p=>a.jsxs(st,{value:p.id,className:"text-white",children:[p.name," (",p.tag,")"]},p.id))]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Privacy"}),a.jsxs(en,{value:d.privacy,onValueChange:p=>f({...d,privacy:p}),children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{})}),a.jsxs(Qt,{className:"bg-slate-800 border-slate-700",children:[a.jsx(st,{value:"public",className:"text-white",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(du,{className:"w-4 h-4"}),a.jsx("span",{children:"Public - Everyone can see"})]})}),a.jsx(st,{value:"private",className:"text-white",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(fu,{className:"w-4 h-4"}),a.jsx("span",{children:"Private - Only me"})]})}),d.org_id&&a.jsx(st,{value:"org_only",className:"text-white",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(gr,{className:"w-4 h-4"}),a.jsx("span",{children:"Organization - Only org members"})]})})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(oe,{type:"button",variant:"ghost",onClick:t,className:"text-slate-400",children:"Cancel"}),a.jsxs(oe,{type:"submit",disabled:i,className:"bg-cyan-500 hover:bg-cyan-600 text-white",children:[i?a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}):null,"Save Changes"]})]})]})]})})}function sv({projectId:e,currentUser:t}){const n=Bt(),{data:r=[]}=me({queryKey:["project-presence",e],queryFn:()=>O.entities.ProjectPresence.filter({project_id:e}),refetchInterval:3e3}),i=Ae({mutationFn:async()=>{const u=r.find(d=>d.user_email===(t==null?void 0:t.email));u?await O.entities.ProjectPresence.update(u.id,{last_seen:new Date().toISOString()}):await O.entities.ProjectPresence.create({project_id:e,user_email:t==null?void 0:t.email,user_name:(t==null?void 0:t.alias)||(t==null?void 0:t.full_name),user_avatar:t==null?void 0:t.avatar_url,last_seen:new Date().toISOString()})},onSuccess:()=>{n.invalidateQueries({queryKey:["project-presence",e]})}});v.useEffect(()=>{if(!t)return;i.mutate();const u=setInterval(()=>{i.mutate()},1e4);return()=>clearInterval(u)},[e,t==null?void 0:t.email]);const l=r.filter(u=>{const d=new Date(u.last_seen);return(new Date-d)/1e3/60<2}).filter(u=>u.user_email!==(t==null?void 0:t.email));return l.length===0?null:a.jsx(BT,{children:a.jsxs("div",{className:"flex items-center gap-2 bg-slate-800/50 rounded-lg px-3 py-2 border border-slate-700",children:[a.jsx(PO,{className:"w-4 h-4 text-cyan-400"}),a.jsxs("span",{className:"text-sm text-slate-300",children:[l.length," viewing"]}),a.jsxs("div",{className:"flex -space-x-2 ml-2",children:[a.jsx(Cm,{children:l.slice(0,5).map(u=>a.jsxs(VT,{children:[a.jsx($T,{children:a.jsx(bt.div,{initial:{scale:0},animate:{scale:1},exit:{scale:0},className:"w-8 h-8 rounded-full bg-gradient-to-br from-cyan-500 to-purple-500 flex items-center justify-center border-2 border-slate-900 overflow-hidden",children:u.user_avatar?a.jsx("img",{src:u.user_avatar,alt:"",className:"w-full h-full object-cover"}):a.jsx("span",{className:"text-white text-xs font-medium",children:(u.user_name||u.user_email||"U")[0].toUpperCase()})})}),a.jsxs(Bx,{className:"bg-slate-800 border-slate-700 text-white",children:[a.jsx("p",{className:"text-sm",children:u.user_name||u.user_email}),a.jsx("p",{className:"text-xs text-slate-400",children:"Viewing now"})]})]},u.id))}),l.length>5&&a.jsx("div",{className:"w-8 h-8 rounded-full bg-slate-700 flex items-center justify-center border-2 border-slate-900",children:a.jsxs("span",{className:"text-white text-xs font-medium",children:["+",l.length-5]})})]})]})})}function x7(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Array(12).fill(0);let e0=1;class v7{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:e0++,l=this.toasts.find(d=>d.id===o),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(d=>d.id===o?(this.publish({...d,...t,id:o,title:r}),{...d,...t,id:o,dismissible:u,title:r}):d):this.addToast({title:r,...i,dismissible:u,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,l;const u=i.then(async f=>{if(l=["resolve",f],Tn.isValidElement(f))o=!1,this.create({id:r,type:"default",message:f});else if(w7(f)&&!f.ok){o=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,w=typeof p=="object"&&!Tn.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...w})}else if(f instanceof Error){o=!1;const p=typeof n.error=="function"?await n.error(f):n.error,g=typeof n.description=="function"?await n.description(f):n.description,w=typeof p=="object"&&!Tn.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...w})}else if(n.success!==void 0){o=!1;const p=typeof n.success=="function"?await n.success(f):n.success,g=typeof n.description=="function"?await n.description(f):n.description,w=typeof p=="object"&&!Tn.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:g,...w})}}).catch(async f=>{if(l=["reject",f],n.error!==void 0){o=!1;const h=typeof n.error=="function"?await n.error(f):n.error,p=typeof n.description=="function"?await n.description(f):n.description,x=typeof h=="object"&&!Tn.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,...x})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,h)=>u.then(()=>l[0]==="reject"?h(l[1]):f(l[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||e0++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Pr=new v7,b7=(e,t)=>{const n=(t==null?void 0:t.id)||e0++;return Pr.addToast({title:e,...t,id:n}),n},w7=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",_7=b7,S7=()=>Pr.toasts,j7=()=>Pr.getActiveToasts(),Yn=Object.assign(_7,{success:Pr.success,info:Pr.info,warning:Pr.warning,error:Pr.error,custom:Pr.custom,message:Pr.message,promise:Pr.promise,dismiss:Pr.dismiss,loading:Pr.loading},{getHistory:S7,getToasts:j7});x7("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");const Tg={en:{appTitle:"Wikelo Project Tracker",allShips:"All Ships",organizations:"Organizations",notifications:"Notifications",profile:"Profile Settings",signOut:"Sign Out",trackMaterials:"Track materials, collaborate with citizens, and build your Wikelo ship",startNewProject:"Start New Project",searchShips:"Search ships...",all:"All",myProjects:"My Projects",orgProjects:"Org Projects",inProgress:"In Progress",completed:"Completed",noProjectsFound:"No projects found",beFirst:"Be the first to start a ship building project!",createProject:"Create Project",backToProjects:"Back to Projects",createdBy:"Created by",organization:"Organization",homePort:"Home Port",markComplete:"Mark Complete",startBuilding:"Start Building",edit:"Edit",linkToOrg:"Link to Org",overallProgress:"Overall Progress",materials:"Materials",contributions:"Contributions",contributors:"Contributors",chat:"Chat",activity:"Activity",contribute:"Contribute",profileAvatar:"Profile Avatar",uploadAvatar:"Upload Avatar",displayName:"Star Citizen Name / Display Name",email:"Email",fullName:"Full Name",saveChanges:"Save Changes",language:"Language",selectLanguage:"Select your preferred language",markAllRead:"Mark all as read",unread:"unread",noNotifications:"No notifications yet",notificationsDesc:"You'll see notifications here when people message your projects",sentMessage:"sent a message",madeContribution:"made a contribution",browseOrganizations:"Browse Organizations",createOrganization:"Create Organization",searchOrgs:"Search organizations...",members:"Members",projects:"Projects",requestToJoin:"Request to Join",cancel:"Cancel",delete:"Delete",save:"Save",loading:"Loading...",submit:"Submit",viewDetails:"View Details",progress:"Progress",requiredMaterials:"Required Materials",recentContributions:"Recent Contributions",discussWithTeam:"Discuss with your team",projectActivity:"Project Activity",deleteProject:"Delete Project?",deleteProjectDesc:"This will permanently delete this project and all its contributions. This action cannot be undone.",projectNotFound:"Project not found",shipsAndMaterials:"Wikelo Ships & Materials",armorsAndMaterials:"Wikelo Armors & Materials",browseShipsDesc:"Browse all available ships and their required materials",browseArmorsDesc:"Browse all available armors and their required materials",searchArmors:"Search armors...",startProject:"Start Project",noMaterialsData:"No materials data available",noShipsFound:"No ships found matching",noArmorsFound:"No armors found matching",backToArmors:"Back to Armors",projectCreatedSuccess:"Project created successfully!",armorProjectCreatedSuccess:"Armor project created successfully!",guideTitle:"Site Guide",guideSubtitle:"Learn how to use the Wikelo Project Tracker to collaborate and build ships",gettingStarted:"Getting Started with Projects",creatingProject:"Creating a Project",managingProject:"Managing Your Project",contributingMaterials:"Contributing Materials",howToContribute:"How to Contribute",contributionStatus:"Contribution Status",joiningCreatingOrgs:"Joining & Creating Orgs",organizationBenefits:"Organization Benefits",communicationCollaboration:"Communication & Collaboration",projectChat:"Project Chat",notificationsSection:"Notifications",reputationSystem:"Reputation System",earningReputation:"Earning Reputation",reputationBenefits:"Reputation Benefits",tipsBestPractices:"Tips & Best Practices",guideStep1_1:"Click the 'Start New Project' button on the home page",guideStep1_2:"Select a ship from the Wikelo ship list or choose 'Custom'",guideStep1_3:"Add a description and specify your home port (drop-off location)",guideStep1_4:"Review the required materials - these are automatically populated for Wikelo ships",guideStep1_5:"Submit to create your project",guideStep2_1:"Edit project details using the Edit button on your project page",guideStep2_2:"Update material quantities as you collect resources",guideStep2_3:"Mark contributions as 'Delivered' when you receive materials",guideStep2_4:"Change project status from Planning → In Progress → Completed",guideStep2_5:"Link your project to an organization if you're an admin",guideStep3_1:"Browse projects on the home page or visit a specific project",guideStep3_2:"Click the 'Contribute' button on a project with needed materials",guideStep3_3:"Select one or multiple materials you can provide",guideStep3_4:"Enter quantities for each material (max: remaining needed)",guideStep3_5:"Choose delivery method: Pickup (materials need collecting) or Drop-off (you'll deliver)",guideStep3_6:"Specify the location for pickup or drop-off coordination",guideStep3_7:"Optionally add your in-game name",guideStep3_8:"Submit - each material becomes a separate contribution",guideStep4_1:"Pending: Waiting for project owner to accept and collect",guideStep4_2:"Delivered: Owner confirmed receipt of your materials",guideStep4_3:"Each material has a point value (e.g., Wikelo Favor = 25 points)",guideStep4_4:"Build your reputation by making successful contributions",guideStep5_1:"Browse organizations on the Organizations page",guideStep5_2:"Click 'Request to Join' to join an existing org (requires admin approval)",guideStep5_3:"Create your own organization with a unique tag/abbreviation",guideStep5_4:"Organizations can have multiple admins and members",guideStep5_5:"Admin members can link projects to the organization",guideStep6_1:"Filter home page to view only your org's projects",guideStep6_2:"Projects show org tag badges for easy identification",guideStep6_3:"Coordinate efforts with your org members",guideStep6_4:"Track all org projects from the organization details page",guideStep7_1:"Each project has a dedicated chat tab",guideStep7_2:"Discuss plans, coordinate pickups, and ask questions",guideStep7_3:"All project participants can see chat messages",guideStep7_4:"You'll get notifications for new messages (unless you're actively in the chat)",guideStep8_1:"Receive notifications for chat messages on your projects",guideStep8_2:"Get notified when contributions are accepted",guideStep8_3:"Filter notifications by type: Chat or Contributions",guideStep8_4:"Click on a notification to jump directly to the project",guideStep8_5:"Mark notifications as read individually or all at once",guideStep9_1:"Contribute materials to projects",guideStep9_2:"Wait for the project owner to mark your contribution as 'Delivered'",guideStep9_3:"Earn points based on material value (shown in contribute modal)",guideStep9_4:"Your reputation is displayed on your profile and contributions",guideStep10_1:"Higher reputation builds trust in the community",guideStep10_2:"Visible to others when you make contributions",guideStep10_3:"Shows your track record of reliable deliveries",guideStep10_4:"Helps project owners decide which contributions to accept",guideTip1:"Set your default home port in Profile settings to auto-fill contribution forms",guideTip2:"Use the Ships page to browse all available Wikelo ships and their material requirements",guideTip3:"Check the Activity tab on projects to see all recent updates and changes",guideTip4:"Presence indicators show who's currently viewing a project in real-time",leaderboard:"Leaderboard",topByReputation:"Top by Reputation",topContributors:"Top Contributors",reputationLeaders:"Reputation Leaders",noUsersWithReputation:"No users with reputation yet",reputationLabel:"reputation",topMaterialContributors:"Top Material Contributors",noContributionsYet:"No contributions yet",contributionsCount:"contributions",projectsCount:"projects",anonymous:"Anonymous",starCitizenNameRequired:"Star Citizen Name Required",starCitizenNameRequiredDesc:"Please set your Star Citizen name to continue using the app",reputationPoints:"Reputation Points",pointsLabel:"points",starCitizenNameDisplay:"Star Citizen Name / Display Name",nameVisibleDesc:"The name other users will see across the platform",starCitizenName:"Star Citizen Name",yourStarCitizenName:"Your Star Citizen name",fieldRequired:"⚠️ This field is required",defaultHomePort:"Default Home Port",homePortPlaceholder:"e.g., Port Olisar, Lorville, Area18...",achievements:"Achievements",badgesEarned:"Badges you've earned through contributions",noBadgesYet:"No badges yet. Start contributing to earn achievements!",manageOrgMemberships:"Manage your organization memberships",notInAnyOrg:"You're not a member of any organization yet",defaultOrg:"Default Organization",selectDefaultOrg:"Select default organization",manageOrganizations:"Manage Organizations",notificationSettings:"Notification Settings",manageNotifications:"Manage how you receive notifications",materialInventory:"Material Inventory",trackMaterialsDesc:"Track your materials and find projects to contribute to",addMaterial:"Add Material",addMaterialToInventory:"Add Material to Inventory",materialLabel:"Material",selectMaterial:"Select material...",quantityLabel:"Quantity",addToInventory:"Add to Inventory",myInventory:"My Inventory",projectsToStart:"Projects to Start",closestContribution:"Closest Contribution",totalMaterialsCount:"Total Materials",loadingInventory:"Loading inventory...",inventoryEmpty:"Your inventory is empty",addFirstMaterial:"Add Your First Material",calculatingProjects:"Calculating projects you can start...",noProjectsWithInventory:"No projects available with your current inventory",addMaterialsToStart:"Add materials to see which projects you can start",completionFromInventory:"Completion from your inventory:",youHaveMaterials:"You have materials:",matchingMaterials:"matching materials",startThisProject:"Start This Project",calculatingClosest:"Calculating closest projects...",noMatchingProjects:"No matching projects found",addMaterialsToContribute:"Add materials to your inventory to see projects you can contribute to",youCanProvide:"You can provide:",unitsNeeded:"units needed",viewProjectContribute:"View Project & Contribute",newShipProject:"Start a new ship project",newArmorProject:"Start a new armor project",selectConversation:"Select a conversation",chooseDMDesc:"Choose a DM, org channel, or project thread to start messaging",allMessages:"All",dmsLabel:"DMs",orgsLabel:"Orgs",projectsTabLabel:"Projects",newDirectMessage:"New Direct Message",searchConversations:"Search conversations...",directMessagesLabel:"DIRECT MESSAGES",organizationChannels:"ORGANIZATION CHANNELS",projectThreadsLabel:"PROJECT THREADS",noMessagesYet:"No messages yet",unknownOwner:"Unknown owner",messageDeleted:"Message deleted",edited:"edited",adminLabel:"Admin",typeMessagePlaceholder:"Type a message... (Enter to send, Shift+Enter for new line)",supportsMarkdown:"Supports markdown formatting",materialReputationValues:"Material Reputation Values",legendaryLabel:"Legendary",epicLabel:"Epic",rareLabel:"Rare",commonLabel:"Common",updateBannerTitle:"4.8 Update Incoming to Wikelo-Projects!",updateBannerText:"Some ship and item crafting requirements may change.",updateBannerLink:"More info",updateInfoTitle:"4.8 Update — What's Changing",updateInfoP1:"As many of you know, Star Citizen recently went through a wipe alongside a number of major gameplay changes. I'm currently working on updating the site to reflect the latest Wikelo changes and other updates introduced with patch 4.8.",updateInfoP2:"I know I'm a bit behind on getting these updates live, and I want to sincerely apologize for the delay. I appreciate everyone's patience while I work through the changes and improve the site.",updateInfoP3:"In addition to the current updates, I'm also developing tools to data mine information directly from the game files. The goal is to have content updated much faster in the future — ideally even before new patches officially launch.",updateInfoP4:"As we continue moving forward, I also want this amazing community to know how much I value your feedback. Your suggestions, bug reports, and ideas genuinely help make the site better, and I truly appreciate all of the support you've given along the way. Thank you!"},es:{appTitle:"Rastreador de Proyectos Wikelo",allShips:"Todas las Naves",organizations:"Organizaciones",notifications:"Notificaciones",profile:"Configuración de Perfil",signOut:"Cerrar Sesión",trackMaterials:"Rastrea materiales, colabora con ciudadanos y construye tu nave Wikelo",startNewProject:"Iniciar Nuevo Proyecto",searchShips:"Buscar naves...",all:"Todos",myProjects:"Mis Proyectos",orgProjects:"Proyectos de Org",inProgress:"En Progreso",completed:"Completado",noProjectsFound:"No se encontraron proyectos",beFirst:"¡Sé el primero en iniciar un proyecto de construcción de naves!",createProject:"Crear Proyecto",backToProjects:"Volver a Proyectos",createdBy:"Creado por",organization:"Organización",homePort:"Puerto Base",markComplete:"Marcar Completo",startBuilding:"Comenzar Construcción",edit:"Editar",linkToOrg:"Vincular a Org",overallProgress:"Progreso General",materials:"Materiales",contributions:"Contribuciones",contributors:"Contribuidores",chat:"Chat",activity:"Actividad",contribute:"Contribuir",profileAvatar:"Avatar de Perfil",uploadAvatar:"Subir Avatar",displayName:"Nombre Star Citizen / Nombre de Visualización",email:"Correo",fullName:"Nombre Completo",saveChanges:"Guardar Cambios",language:"Idioma",selectLanguage:"Selecciona tu idioma preferido",markAllRead:"Marcar todo como leído",unread:"sin leer",noNotifications:"Aún no hay notificaciones",notificationsDesc:"Verás notificaciones aquí cuando la gente envíe mensajes a tus proyectos",sentMessage:"envió un mensaje",madeContribution:"hizo una contribución",browseOrganizations:"Explorar Organizaciones",createOrganization:"Crear Organización",searchOrgs:"Buscar organizaciones...",members:"Miembros",projects:"Proyectos",requestToJoin:"Solicitar Unirse",cancel:"Cancelar",delete:"Eliminar",save:"Guardar",loading:"Cargando...",submit:"Enviar",viewDetails:"Ver Detalles",progress:"Progreso",requiredMaterials:"Materiales Requeridos",recentContributions:"Contribuciones Recientes",discussWithTeam:"Discute con tu equipo",projectActivity:"Actividad del Proyecto",deleteProject:"¿Eliminar Proyecto?",deleteProjectDesc:"Esto eliminará permanentemente este proyecto y todas sus contribuciones. Esta acción no se puede deshacer.",projectNotFound:"Proyecto no encontrado",shipsAndMaterials:"Naves y Materiales de Wikelo",armorsAndMaterials:"Armaduras y Materiales de Wikelo",browseShipsDesc:"Explora todas las naves disponibles y sus materiales requeridos",browseArmorsDesc:"Explora todas las armaduras disponibles y sus materiales requeridos",searchArmors:"Buscar armaduras...",startProject:"Iniciar Proyecto",noMaterialsData:"No hay datos de materiales disponibles",noShipsFound:"No se encontraron naves que coincidan con",noArmorsFound:"No se encontraron armaduras que coincidan con",backToArmors:"Volver a Armaduras",projectCreatedSuccess:"¡Proyecto creado exitosamente!",armorProjectCreatedSuccess:"¡Proyecto de armadura creado exitosamente!",guideTitle:"Guía del Sitio",guideSubtitle:"Aprende a usar el Rastreador de Proyectos Wikelo para colaborar y construir naves",gettingStarted:"Comenzando con Proyectos",creatingProject:"Crear un Proyecto",managingProject:"Gestionar tu Proyecto",contributingMaterials:"Contribuir Materiales",howToContribute:"Cómo Contribuir",contributionStatus:"Estado de Contribución",joiningCreatingOrgs:"Unirse y Crear Organizaciones",organizationBenefits:"Beneficios de la Organización",communicationCollaboration:"Comunicación y Colaboración",projectChat:"Chat del Proyecto",notificationsSection:"Notificaciones",reputationSystem:"Sistema de Reputación",earningReputation:"Ganar Reputación",reputationBenefits:"Beneficios de la Reputación",tipsBestPractices:"Consejos y Mejores Prácticas",guideStep1_1:"Haz clic en el botón 'Iniciar Nuevo Proyecto' en la página principal",guideStep1_2:"Selecciona una nave de la lista de naves Wikelo o elige 'Personalizado'",guideStep1_3:"Agrega una descripción y especifica tu puerto base (ubicación de entrega)",guideStep1_4:"Revisa los materiales requeridos - se completan automáticamente para naves Wikelo",guideStep1_5:"Envía para crear tu proyecto",guideStep2_1:"Edita los detalles del proyecto usando el botón Editar en tu página de proyecto",guideStep2_2:"Actualiza las cantidades de materiales a medida que recopilas recursos",guideStep2_3:"Marca las contribuciones como 'Entregadas' cuando recibas materiales",guideStep2_4:"Cambia el estado del proyecto de Planificación → En Progreso → Completado",guideStep2_5:"Vincula tu proyecto a una organización si eres administrador",guideStep3_1:"Explora proyectos en la página principal o visita un proyecto específico",guideStep3_2:"Haz clic en el botón 'Contribuir' en un proyecto con materiales necesarios",guideStep3_3:"Selecciona uno o varios materiales que puedas proporcionar",guideStep3_4:"Ingresa cantidades para cada material (máximo: restante necesario)",guideStep3_5:"Elige el método de entrega: Recoger o Dejar",guideStep3_6:"Especifica la ubicación para coordinar la recogida o entrega",guideStep3_7:"Opcionalmente agrega tu nombre en el juego",guideStep3_8:"Envía - cada material se convierte en una contribución separada",guideStep4_1:"Pendiente: Esperando que el propietario del proyecto acepte y recolecte",guideStep4_2:"Entregado: Propietario confirmó recepción de tus materiales",guideStep4_3:"Cada material tiene un valor en puntos (ej., Favor de Wikelo = 25 puntos)",guideStep4_4:"Construye tu reputación haciendo contribuciones exitosas",guideStep5_1:"Explora organizaciones en la página de Organizaciones",guideStep5_2:"Haz clic en 'Solicitar Unirse' para unirte a una org existente",guideStep5_3:"Crea tu propia organización con una etiqueta/abreviatura única",guideStep5_4:"Las organizaciones pueden tener múltiples administradores y miembros",guideStep5_5:"Los miembros administradores pueden vincular proyectos a la organización",guideStep6_1:"Filtra la página principal para ver solo los proyectos de tu org",guideStep6_2:"Los proyectos muestran insignias de etiqueta de org",guideStep6_3:"Coordina esfuerzos con los miembros de tu org",guideStep6_4:"Rastrea todos los proyectos de org desde la página de detalles",guideStep7_1:"Cada proyecto tiene una pestaña de chat dedicada",guideStep7_2:"Discute planes, coordina recolecciones y haz preguntas",guideStep7_3:"Todos los participantes del proyecto pueden ver los mensajes de chat",guideStep7_4:"Recibirás notificaciones para nuevos mensajes",guideStep8_1:"Recibe notificaciones para mensajes de chat en tus proyectos",guideStep8_2:"Recibe notificaciones cuando se acepten contribuciones",guideStep8_3:"Filtra notificaciones por tipo: Chat o Contribuciones",guideStep8_4:"Haz clic en una notificación para ir directamente al proyecto",guideStep8_5:"Marca notificaciones como leídas individualmente o todas a la vez",guideStep9_1:"Contribuye materiales a proyectos",guideStep9_2:"Espera a que el propietario del proyecto marque tu contribución como 'Entregada'",guideStep9_3:"Gana puntos basados en el valor del material",guideStep9_4:"Tu reputación se muestra en tu perfil y contribuciones",guideStep10_1:"Mayor reputación genera confianza en la comunidad",guideStep10_2:"Visible para otros cuando haces contribuciones",guideStep10_3:"Muestra tu historial de entregas confiables",guideStep10_4:"Ayuda a los propietarios de proyectos a decidir qué contribuciones aceptar",guideTip1:"Establece tu puerto base predeterminado en Configuración de perfil",guideTip2:"Usa la página de Naves para explorar todas las naves Wikelo disponibles",guideTip3:"Verifica la pestaña Actividad en proyectos para ver todas las actualizaciones recientes",guideTip4:"Los indicadores de presencia muestran quién está viendo actualmente un proyecto en tiempo real",leaderboard:"Clasificación",topByReputation:"Top por Reputación",topContributors:"Mejores Contribuidores",reputationLeaders:"Líderes de Reputación",noUsersWithReputation:"Sin usuarios con reputación aún",reputationLabel:"reputación",topMaterialContributors:"Mejores Contribuidores de Materiales",noContributionsYet:"Sin contribuciones aún",contributionsCount:"contribuciones",projectsCount:"proyectos",anonymous:"Anónimo",starCitizenNameRequired:"Nombre de Star Citizen Requerido",starCitizenNameRequiredDesc:"Por favor establezca su nombre de Star Citizen para continuar usando la app",reputationPoints:"Puntos de Reputación",pointsLabel:"puntos",starCitizenNameDisplay:"Nombre Star Citizen / Nombre de Visualización",nameVisibleDesc:"El nombre que otros usuarios verán en toda la plataforma",starCitizenName:"Nombre Star Citizen",yourStarCitizenName:"Tu nombre Star Citizen",fieldRequired:"⚠️ Este campo es obligatorio",defaultHomePort:"Puerto Base Predeterminado",homePortPlaceholder:"ej., Puerto Olisar, Lorville, Area18...",achievements:"Logros",badgesEarned:"Insignias ganadas por tus contribuciones",noBadgesYet:"Sin insignias aún. ¡Empieza a contribuir para ganar logros!",manageOrgMemberships:"Gestiona tus membresías de organización",notInAnyOrg:"Aún no eres miembro de ninguna organización",defaultOrg:"Organización Predeterminada",selectDefaultOrg:"Seleccionar organización predeterminada",manageOrganizations:"Gestionar Organizaciones",notificationSettings:"Configuración de Notificaciones",manageNotifications:"Gestiona cómo recibes notificaciones",materialInventory:"Inventario de Materiales",trackMaterialsDesc:"Rastrea tus materiales y encuentra proyectos donde contribuir",addMaterial:"Añadir Material",addMaterialToInventory:"Añadir Material al Inventario",materialLabel:"Material",selectMaterial:"Seleccionar material...",quantityLabel:"Cantidad",addToInventory:"Añadir al Inventario",myInventory:"Mi Inventario",projectsToStart:"Proyectos para Iniciar",closestContribution:"Contribución más Cercana",totalMaterialsCount:"Total de Materiales",loadingInventory:"Cargando inventario...",inventoryEmpty:"Tu inventario está vacío",addFirstMaterial:"Añade tu Primer Material",calculatingProjects:"Calculando proyectos que puedes iniciar...",noProjectsWithInventory:"No hay proyectos disponibles con tu inventario actual",addMaterialsToStart:"Añade materiales para ver qué proyectos puedes iniciar",completionFromInventory:"Finalización desde tu inventario:",youHaveMaterials:"Tienes materiales:",matchingMaterials:"materiales coincidentes",startThisProject:"Iniciar Este Proyecto",calculatingClosest:"Calculando proyectos más cercanos...",noMatchingProjects:"No se encontraron proyectos coincidentes",addMaterialsToContribute:"Añade materiales a tu inventario para ver proyectos donde puedes contribuir",youCanProvide:"Puedes proporcionar:",unitsNeeded:"unidades necesarias",viewProjectContribute:"Ver Proyecto y Contribuir",newShipProject:"Iniciar un nuevo proyecto de nave",newArmorProject:"Iniciar un nuevo proyecto de armadura",selectConversation:"Seleccionar una conversación",chooseDMDesc:"Elige un DM, canal de organización o hilo de proyecto para empezar a mensajear",allMessages:"Todo",dmsLabel:"MDs",orgsLabel:"Orgs",projectsTabLabel:"Proyectos",newDirectMessage:"Nuevo Mensaje Directo",searchConversations:"Buscar conversaciones...",directMessagesLabel:"MENSAJES DIRECTOS",organizationChannels:"CANALES DE ORGANIZACIÓN",projectThreadsLabel:"HILOS DE PROYECTO",noMessagesYet:"Sin mensajes aún",unknownOwner:"Propietario desconocido",messageDeleted:"Mensaje eliminado",edited:"editado",adminLabel:"Admin",typeMessagePlaceholder:"Escribe un mensaje... (Enter para enviar, Shift+Enter para nueva línea)",supportsMarkdown:"Admite formato markdown",materialReputationValues:"Valores de Reputación de Materiales",legendaryLabel:"Legendario",epicLabel:"Épico",rareLabel:"Raro",commonLabel:"Común",updateBannerTitle:"¡Actualización 4.8 en camino para Wikelo-Projects!",updateBannerText:"Algunos requisitos de fabricación de naves y objetos pueden cambiar.",updateBannerLink:"Más información",updateInfoTitle:"Actualización 4.8 — Qué está cambiando",updateInfoP1:"Como muchos de ustedes saben, Star Citizen recientemente pasó por un wipe junto con una serie de cambios importantes en el juego. Actualmente estoy trabajando para actualizar el sitio y reflejar los últimos cambios de Wikelo y otras actualizaciones introducidas con el parche 4.8.",updateInfoP2:"Sé que me he retrasado un poco en poner estas actualizaciones en vivo, y quiero disculparme sinceramente por la demora. Agradezco la paciencia de todos mientras trabajo en los cambios y mejoro el sitio.",updateInfoP3:"Además de las actualizaciones actuales, también estoy desarrollando herramientas para extraer información directamente de los archivos del juego. El objetivo es tener el contenido actualizado mucho más rápido en el futuro, idealmente incluso antes de que se lancen oficialmente nuevos parches.",updateInfoP4:"A medida que continuamos avanzando, también quiero que esta increíble comunidad sepa cuánto valoro sus comentarios. Sus sugerencias, reportes de errores e ideas realmente ayudan a mejorar el sitio, y verdaderamente aprecio todo el apoyo que me han dado. ¡Gracias!"},fr:{appTitle:"Suivi des Projets Wikelo",allShips:"Tous les Vaisseaux",organizations:"Organisations",notifications:"Notifications",profile:"Paramètres du Profil",signOut:"Se Déconnecter",trackMaterials:"Suivez les matériaux, collaborez avec les citoyens et construisez votre vaisseau Wikelo",startNewProject:"Démarrer un Nouveau Projet",searchShips:"Rechercher des vaisseaux...",all:"Tous",myProjects:"Mes Projets",orgProjects:"Projets d'Org",inProgress:"En Cours",completed:"Terminé",noProjectsFound:"Aucun projet trouvé",beFirst:"Soyez le premier à démarrer un projet de construction de vaisseau!",createProject:"Créer un Projet",backToProjects:"Retour aux Projets",createdBy:"Créé par",organization:"Organisation",homePort:"Port d'Attache",markComplete:"Marquer comme Terminé",startBuilding:"Commencer la Construction",edit:"Modifier",linkToOrg:"Lier à l'Org",overallProgress:"Progression Globale",materials:"Matériaux",contributions:"Contributions",contributors:"Contributeurs",chat:"Chat",activity:"Activité",contribute:"Contribuer",profileAvatar:"Avatar de Profil",uploadAvatar:"Télécharger l'Avatar",displayName:"Nom Star Citizen / Nom d'Affichage",email:"Email",fullName:"Nom Complet",saveChanges:"Enregistrer les Modifications",language:"Langue",selectLanguage:"Sélectionnez votre langue préférée",markAllRead:"Tout marquer comme lu",unread:"non lu",noNotifications:"Pas encore de notifications",notificationsDesc:"Vous verrez les notifications ici lorsque les gens enverront des messages à vos projets",sentMessage:"a envoyé un message",madeContribution:"a fait une contribution",browseOrganizations:"Parcourir les Organisations",createOrganization:"Créer une Organisation",searchOrgs:"Rechercher des organisations...",members:"Membres",projects:"Projets",requestToJoin:"Demander à Rejoindre",cancel:"Annuler",delete:"Supprimer",save:"Enregistrer",loading:"Chargement...",submit:"Soumettre",viewDetails:"Voir les Détails",progress:"Progression",requiredMaterials:"Matériaux Requis",recentContributions:"Contributions Récentes",discussWithTeam:"Discutez avec votre équipe",projectActivity:"Activité du Projet",deleteProject:"Supprimer le Projet?",deleteProjectDesc:"Cela supprimera définitivement ce projet et toutes ses contributions.",projectNotFound:"Projet non trouvé",shipsAndMaterials:"Vaisseaux et Matériaux Wikelo",armorsAndMaterials:"Armures et Matériaux Wikelo",browseShipsDesc:"Parcourir tous les vaisseaux disponibles et leurs matériaux requis",browseArmorsDesc:"Parcourir toutes les armures disponibles et leurs matériaux requis",searchArmors:"Rechercher des armures...",startProject:"Démarrer le Projet",noMaterialsData:"Aucune donnée de matériaux disponible",noShipsFound:"Aucun vaisseau trouvé correspondant à",noArmorsFound:"Aucune armure trouvée correspondant à",backToArmors:"Retour aux Armures",projectCreatedSuccess:"Projet créé avec succès!",armorProjectCreatedSuccess:"Projet d'armure créé avec succès!",guideTitle:"Guide du Site",guideSubtitle:"Apprenez à utiliser le Suivi des Projets Wikelo pour collaborer et construire des vaisseaux",gettingStarted:"Débuter avec les Projets",creatingProject:"Créer un Projet",managingProject:"Gérer votre Projet",contributingMaterials:"Contribuer des Matériaux",howToContribute:"Comment Contribuer",contributionStatus:"Statut de Contribution",joiningCreatingOrgs:"Rejoindre et Créer des Organisations",organizationBenefits:"Avantages de l'Organisation",communicationCollaboration:"Communication et Collaboration",projectChat:"Chat du Projet",notificationsSection:"Notifications",reputationSystem:"Système de Réputation",earningReputation:"Gagner de la Réputation",reputationBenefits:"Avantages de la Réputation",tipsBestPractices:"Conseils et Bonnes Pratiques",guideStep1_1:"Cliquez sur le bouton 'Démarrer un Nouveau Projet' sur la page d'accueil",guideStep1_2:"Sélectionnez un vaisseau de la liste Wikelo ou choisissez 'Personnalisé'",guideStep1_3:"Ajoutez une description et spécifiez votre port d'attache",guideStep1_4:"Examinez les matériaux requis - ils sont remplis automatiquement pour les vaisseaux Wikelo",guideStep1_5:"Soumettez pour créer votre projet",guideStep2_1:"Modifiez les détails du projet en utilisant le bouton Modifier",guideStep2_2:"Mettez à jour les quantités de matériaux au fur et à mesure",guideStep2_3:"Marquez les contributions comme 'Livrées' quand vous recevez des matériaux",guideStep2_4:"Changez le statut du projet de Planification → En Cours → Terminé",guideStep2_5:"Liez votre projet à une organisation si vous êtes administrateur",guideStep3_1:"Parcourez les projets sur la page d'accueil ou visitez un projet spécifique",guideStep3_2:"Cliquez sur le bouton 'Contribuer' sur un projet avec des matériaux nécessaires",guideStep3_3:"Sélectionnez un ou plusieurs matériaux que vous pouvez fournir",guideStep3_4:"Entrez les quantités pour chaque matériau",guideStep3_5:"Choisissez la méthode de livraison: Ramassage ou Dépôt",guideStep3_6:"Spécifiez l'emplacement pour la coordination",guideStep3_7:"Ajoutez éventuellement votre nom dans le jeu",guideStep3_8:"Soumettez - chaque matériau devient une contribution séparée",guideStep4_1:"En attente: En attente d'acceptation par le propriétaire",guideStep4_2:"Livré: Propriétaire a confirmé la réception de vos matériaux",guideStep4_3:"Chaque matériau a une valeur en points",guideStep4_4:"Construisez votre réputation en faisant des contributions réussies",guideStep5_1:"Parcourez les organisations sur la page Organisations",guideStep5_2:"Cliquez sur 'Demander à Rejoindre' pour rejoindre une org existante",guideStep5_3:"Créez votre propre organisation avec une étiquette unique",guideStep5_4:"Les organisations peuvent avoir plusieurs administrateurs et membres",guideStep5_5:"Les membres administrateurs peuvent lier des projets à l'organisation",guideStep6_1:"Filtrez la page d'accueil pour ne voir que les projets de votre org",guideStep6_2:"Les projets affichent des badges d'étiquette d'org",guideStep6_3:"Coordonnez les efforts avec les membres de votre org",guideStep6_4:"Suivez tous les projets d'org depuis la page de détails",guideStep7_1:"Chaque projet a un onglet de chat dédié",guideStep7_2:"Discutez des plans, coordonnez les ramassages et posez des questions",guideStep7_3:"Tous les participants au projet peuvent voir les messages de chat",guideStep7_4:"Vous recevrez des notifications pour les nouveaux messages",guideStep8_1:"Recevez des notifications pour les messages de chat sur vos projets",guideStep8_2:"Soyez notifié lorsque les contributions sont acceptées",guideStep8_3:"Filtrez les notifications par type: Chat ou Contributions",guideStep8_4:"Cliquez sur une notification pour accéder directement au projet",guideStep8_5:"Marquez les notifications comme lues individuellement ou toutes en même temps",guideStep9_1:"Contribuez des matériaux aux projets",guideStep9_2:"Attendez que le propriétaire marque votre contribution comme 'Livrée'",guideStep9_3:"Gagnez des points en fonction de la valeur du matériau",guideStep9_4:"Votre réputation est affichée sur votre profil et vos contributions",guideStep10_1:"Une réputation plus élevée renforce la confiance dans la communauté",guideStep10_2:"Visible par les autres lorsque vous faites des contributions",guideStep10_3:"Montre votre historique de livraisons fiables",guideStep10_4:"Aide les propriétaires de projets à décider quelles contributions accepter",guideTip1:"Définissez votre port d'attache par défaut dans les paramètres de profil",guideTip2:"Utilisez la page Vaisseaux pour parcourir tous les vaisseaux Wikelo disponibles",guideTip3:"Consultez l'onglet Activité sur les projets pour voir toutes les mises à jour récentes",guideTip4:"Les indicateurs de présence montrent qui consulte actuellement un projet en temps réel",leaderboard:"Classement",topByReputation:"Top par Réputation",topContributors:"Meilleurs Contributeurs",reputationLeaders:"Leaders de Réputation",noUsersWithReputation:"Aucun utilisateur avec de la réputation",reputationLabel:"réputation",topMaterialContributors:"Meilleurs Contributeurs en Matériaux",noContributionsYet:"Aucune contribution pour l'instant",contributionsCount:"contributions",projectsCount:"projets",anonymous:"Anonyme",starCitizenNameRequired:"Nom Star Citizen Requis",starCitizenNameRequiredDesc:"Veuillez définir votre nom Star Citizen pour continuer à utiliser l'application",reputationPoints:"Points de Réputation",pointsLabel:"points",starCitizenNameDisplay:"Nom Star Citizen / Nom d'Affichage",nameVisibleDesc:"Le nom que les autres utilisateurs verront sur la plateforme",starCitizenName:"Nom Star Citizen",yourStarCitizenName:"Votre nom Star Citizen",fieldRequired:"⚠️ Ce champ est obligatoire",defaultHomePort:"Port d'Attache par Défaut",homePortPlaceholder:"ex., Port Olisar, Lorville, Zone18...",achievements:"Succès",badgesEarned:"Badges gagnés grâce à vos contributions",noBadgesYet:"Aucun badge pour l'instant. Commencez à contribuer pour gagner des succès!",manageOrgMemberships:"Gérez vos adhésions aux organisations",notInAnyOrg:"Vous n'êtes encore membre d'aucune organisation",defaultOrg:"Organisation par Défaut",selectDefaultOrg:"Sélectionner l'organisation par défaut",manageOrganizations:"Gérer les Organisations",notificationSettings:"Paramètres de Notification",manageNotifications:"Gérez comment vous recevez les notifications",materialInventory:"Inventaire de Matériaux",trackMaterialsDesc:"Suivez vos matériaux et trouvez des projets auxquels contribuer",addMaterial:"Ajouter un Matériau",addMaterialToInventory:"Ajouter un Matériau à l'Inventaire",materialLabel:"Matériau",selectMaterial:"Sélectionner un matériau...",quantityLabel:"Quantité",addToInventory:"Ajouter à l'Inventaire",myInventory:"Mon Inventaire",projectsToStart:"Projets à Démarrer",closestContribution:"Contribution la Plus Proche",totalMaterialsCount:"Total des Matériaux",loadingInventory:"Chargement de l'inventaire...",inventoryEmpty:"Votre inventaire est vide",addFirstMaterial:"Ajouter Votre Premier Matériau",calculatingProjects:"Calcul des projets que vous pouvez démarrer...",noProjectsWithInventory:"Aucun projet disponible avec votre inventaire actuel",addMaterialsToStart:"Ajoutez des matériaux pour voir quels projets vous pouvez démarrer",completionFromInventory:"Complétion depuis votre inventaire:",youHaveMaterials:"Vous avez des matériaux:",matchingMaterials:"matériaux correspondants",startThisProject:"Démarrer ce Projet",calculatingClosest:"Calcul des projets les plus proches...",noMatchingProjects:"Aucun projet correspondant trouvé",addMaterialsToContribute:"Ajoutez des matériaux à votre inventaire pour voir les projets auxquels vous pouvez contribuer",youCanProvide:"Vous pouvez fournir:",unitsNeeded:"unités nécessaires",viewProjectContribute:"Voir le Projet et Contribuer",newShipProject:"Démarrer un nouveau projet de vaisseau",newArmorProject:"Démarrer un nouveau projet d'armure",selectConversation:"Sélectionner une conversation",chooseDMDesc:"Choisissez un DM, un canal d'organisation ou un fil de projet pour commencer à envoyer des messages",allMessages:"Tout",dmsLabel:"MPs",orgsLabel:"Orgs",projectsTabLabel:"Projets",newDirectMessage:"Nouveau Message Direct",searchConversations:"Rechercher des conversations...",directMessagesLabel:"MESSAGES DIRECTS",organizationChannels:"CANAUX D'ORGANISATION",projectThreadsLabel:"FILS DE PROJET",noMessagesYet:"Aucun message encore",unknownOwner:"Propriétaire inconnu",messageDeleted:"Message supprimé",edited:"modifié",adminLabel:"Admin",typeMessagePlaceholder:"Écrivez un message... (Entrée pour envoyer, Maj+Entrée pour nouvelle ligne)",supportsMarkdown:"Supporte le formatage Markdown",materialReputationValues:"Valeurs de Réputation des Matériaux",legendaryLabel:"Légendaire",epicLabel:"Épique",rareLabel:"Rare",commonLabel:"Commun",updateBannerTitle:"Mise à jour 4.8 en approche pour Wikelo-Projects !",updateBannerText:"Certaines exigences de fabrication de vaisseaux et d'objets peuvent changer.",updateBannerLink:"Plus d'infos",updateInfoTitle:"Mise à jour 4.8 — Ce qui change",updateInfoP1:"Comme beaucoup d'entre vous le savent, Star Citizen a récemment subi un wipe ainsi que plusieurs changements majeurs de gameplay. Je travaille actuellement à la mise à jour du site pour refléter les dernières modifications de Wikelo et les autres mises à jour introduites avec le patch 4.8.",updateInfoP2:"Je sais que je prends un peu de retard pour mettre ces mises à jour en ligne, et je tiens à m'excuser sincèrement pour le délai. J'apprécie la patience de tous pendant que je travaille sur les changements et améliore le site.",updateInfoP3:"En plus des mises à jour actuelles, je développe également des outils pour extraire des informations directement depuis les fichiers du jeu. L'objectif est de mettre à jour le contenu beaucoup plus rapidement à l'avenir — idéalement même avant le lancement officiel de nouveaux patchs.",updateInfoP4:"À mesure que nous avançons, je veux également que cette incroyable communauté sache à quel point je valorise vos retours. Vos suggestions, rapports de bugs et idées aident vraiment à améliorer le site, et j'apprécie sincèrement tout le soutien que vous m'avez apporté. Merci !"},de:{appTitle:"Wikelo Projekt-Tracker",allShips:"Alle Schiffe",organizations:"Organisationen",notifications:"Benachrichtigungen",profile:"Profileinstellungen",signOut:"Abmelden",trackMaterials:"Verfolgen Sie Materialien, arbeiten Sie mit Bürgern zusammen und bauen Sie Ihr Wikelo-Schiff",startNewProject:"Neues Projekt Starten",searchShips:"Schiffe suchen...",all:"Alle",myProjects:"Meine Projekte",orgProjects:"Org-Projekte",inProgress:"In Bearbeitung",completed:"Abgeschlossen",noProjectsFound:"Keine Projekte gefunden",beFirst:"Seien Sie der Erste, der ein Schiffbauprojekt startet!",createProject:"Projekt Erstellen",backToProjects:"Zurück zu Projekten",createdBy:"Erstellt von",organization:"Organisation",homePort:"Heimathafen",markComplete:"Als Abgeschlossen Markieren",startBuilding:"Bau Beginnen",edit:"Bearbeiten",linkToOrg:"Mit Org Verknüpfen",overallProgress:"Gesamtfortschritt",materials:"Materialien",contributions:"Beiträge",contributors:"Mitwirkende",chat:"Chat",activity:"Aktivität",contribute:"Beitragen",profileAvatar:"Profil-Avatar",uploadAvatar:"Avatar Hochladen",displayName:"Star Citizen Name / Anzeigename",email:"E-Mail",fullName:"Vollständiger Name",saveChanges:"Änderungen Speichern",language:"Sprache",selectLanguage:"Wählen Sie Ihre bevorzugte Sprache",markAllRead:"Alle als gelesen markieren",unread:"ungelesen",noNotifications:"Noch keine Benachrichtigungen",notificationsDesc:"Sie sehen hier Benachrichtigungen, wenn Leute Nachrichten an Ihre Projekte senden",sentMessage:"hat eine Nachricht gesendet",madeContribution:"hat einen Beitrag geleistet",browseOrganizations:"Organisationen Durchsuchen",createOrganization:"Organisation Erstellen",searchOrgs:"Organisationen suchen...",members:"Mitglieder",projects:"Projekte",requestToJoin:"Beitrittsanfrage",cancel:"Abbrechen",delete:"Löschen",save:"Speichern",loading:"Lädt...",submit:"Absenden",viewDetails:"Details Anzeigen",progress:"Fortschritt",requiredMaterials:"Erforderliche Materialien",recentContributions:"Aktuelle Beiträge",discussWithTeam:"Diskutieren Sie mit Ihrem Team",projectActivity:"Projektaktivität",deleteProject:"Projekt Löschen?",deleteProjectDesc:"Dies wird dieses Projekt und alle seine Beiträge dauerhaft löschen.",projectNotFound:"Projekt nicht gefunden",shipsAndMaterials:"Wikelo-Schiffe und Materialien",armorsAndMaterials:"Wikelo-Rüstungen und Materialien",browseShipsDesc:"Durchsuchen Sie alle verfügbaren Schiffe und ihre benötigten Materialien",browseArmorsDesc:"Durchsuchen Sie alle verfügbaren Rüstungen und ihre benötigten Materialien",searchArmors:"Rüstungen suchen...",startProject:"Projekt Starten",noMaterialsData:"Keine Materialdaten verfügbar",noShipsFound:"Keine Schiffe gefunden, die übereinstimmen mit",noArmorsFound:"Keine Rüstungen gefunden, die übereinstimmen mit",backToArmors:"Zurück zu Rüstungen",projectCreatedSuccess:"Projekt erfolgreich erstellt!",armorProjectCreatedSuccess:"Rüstungsprojekt erfolgreich erstellt!",guideTitle:"Website-Anleitung",guideSubtitle:"Erfahren Sie, wie Sie den Wikelo-Projekt-Tracker verwenden",gettingStarted:"Erste Schritte mit Projekten",creatingProject:"Ein Projekt Erstellen",managingProject:"Ihr Projekt Verwalten",contributingMaterials:"Materialien Beitragen",howToContribute:"Wie man Beiträgt",contributionStatus:"Beitragsstatus",joiningCreatingOrgs:"Organisationen Beitreten und Erstellen",organizationBenefits:"Organisationsvorteile",communicationCollaboration:"Kommunikation und Zusammenarbeit",projectChat:"Projekt-Chat",notificationsSection:"Benachrichtigungen",reputationSystem:"Reputationssystem",earningReputation:"Reputation Verdienen",reputationBenefits:"Reputationsvorteile",tipsBestPractices:"Tipps und Best Practices",guideStep1_1:"Klicken Sie auf 'Neues Projekt Starten' auf der Startseite",guideStep1_2:"Wählen Sie ein Schiff aus der Wikelo-Schiffsliste oder wählen Sie 'Benutzerdefiniert'",guideStep1_3:"Fügen Sie eine Beschreibung und Ihren Heimathafen hinzu",guideStep1_4:"Überprüfen Sie die erforderlichen Materialien",guideStep1_5:"Einreichen, um Ihr Projekt zu erstellen",guideStep2_1:"Bearbeiten Sie Projektdetails mit der Schaltfläche Bearbeiten",guideStep2_2:"Aktualisieren Sie Materialmengen, während Sie Ressourcen sammeln",guideStep2_3:"Markieren Sie Beiträge als 'Geliefert', wenn Sie Materialien erhalten",guideStep2_4:"Ändern Sie den Projektstatus von Planung → In Bearbeitung → Abgeschlossen",guideStep2_5:"Verknüpfen Sie Ihr Projekt mit einer Organisation, wenn Sie Administrator sind",guideStep3_1:"Durchsuchen Sie Projekte auf der Startseite oder besuchen Sie ein bestimmtes Projekt",guideStep3_2:"Klicken Sie auf 'Beitragen' bei einem Projekt mit benötigten Materialien",guideStep3_3:"Wählen Sie ein oder mehrere Materialien aus",guideStep3_4:"Geben Sie Mengen für jedes Material ein",guideStep3_5:"Wählen Sie die Liefermethode: Abholung oder Abgabe",guideStep3_6:"Geben Sie den Ort für die Koordination an",guideStep3_7:"Fügen Sie optional Ihren Spielnamen hinzu",guideStep3_8:"Einreichen - jedes Material wird zu einem separaten Beitrag",guideStep4_1:"Ausstehend: Wartet auf Projektbesitzer",guideStep4_2:"Geliefert: Besitzer hat Empfang der Materialien bestätigt",guideStep4_3:"Jedes Material hat einen Punktwert",guideStep4_4:"Bauen Sie Ihre Reputation durch erfolgreiche Beiträge auf",guideStep5_1:"Durchsuchen Sie Organisationen auf der Organisationsseite",guideStep5_2:"Klicken Sie auf 'Beitrittsanfrage', um einer bestehenden Org beizutreten",guideStep5_3:"Erstellen Sie Ihre eigene Organisation mit einem eindeutigen Tag",guideStep5_4:"Organisationen können mehrere Administratoren und Mitglieder haben",guideStep5_5:"Admin-Mitglieder können Projekte mit der Organisation verknüpfen",guideStep6_1:"Filtern Sie die Startseite, um nur die Projekte Ihrer Org anzuzeigen",guideStep6_2:"Projekte zeigen Org-Tag-Abzeichen",guideStep6_3:"Koordinieren Sie Bemühungen mit Ihren Org-Mitgliedern",guideStep6_4:"Verfolgen Sie alle Org-Projekte von der Organisationsdetailseite aus",guideStep7_1:"Jedes Projekt hat einen dedizierten Chat-Tab",guideStep7_2:"Besprechen Sie Pläne, koordinieren Sie Abholungen und stellen Sie Fragen",guideStep7_3:"Alle Projektteilnehmer können Chat-Nachrichten sehen",guideStep7_4:"Sie erhalten Benachrichtigungen für neue Nachrichten",guideStep8_1:"Erhalten Sie Benachrichtigungen für Chat-Nachrichten zu Ihren Projekten",guideStep8_2:"Werden Sie benachrichtigt, wenn Beiträge akzeptiert werden",guideStep8_3:"Filtern Sie Benachrichtigungen nach Typ: Chat oder Beiträge",guideStep8_4:"Klicken Sie auf eine Benachrichtigung, um direkt zum Projekt zu springen",guideStep8_5:"Markieren Sie Benachrichtigungen einzeln oder alle auf einmal als gelesen",guideStep9_1:"Tragen Sie Materialien zu Projekten bei",guideStep9_2:"Warten Sie, bis der Projektbesitzer Ihren Beitrag als 'Geliefert' markiert",guideStep9_3:"Verdienen Sie Punkte basierend auf dem Materialwert",guideStep9_4:"Ihre Reputation wird in Ihrem Profil angezeigt",guideStep10_1:"Höhere Reputation schafft Vertrauen in der Community",guideStep10_2:"Für andere sichtbar, wenn Sie Beiträge leisten",guideStep10_3:"Zeigt Ihre Erfolgsbilanz zuverlässiger Lieferungen",guideStep10_4:"Hilft Projektbesitzern zu entscheiden, welche Beiträge akzeptiert werden",guideTip1:"Legen Sie Ihren Standard-Heimathafen in den Profileinstellungen fest",guideTip2:"Verwenden Sie die Schiffsseite, um alle verfügbaren Wikelo-Schiffe zu durchsuchen",guideTip3:"Überprüfen Sie den Aktivitäts-Tab bei Projekten für aktuelle Updates",guideTip4:"Präsenzindikatoren zeigen, wer gerade ein Projekt in Echtzeit ansieht",leaderboard:"Rangliste",topByReputation:"Top nach Reputation",topContributors:"Top-Mitwirkende",reputationLeaders:"Reputationsführer",noUsersWithReputation:"Noch keine Benutzer mit Reputation",reputationLabel:"Reputation",topMaterialContributors:"Top-Materialmitwirkende",noContributionsYet:"Noch keine Beiträge",contributionsCount:"Beiträge",projectsCount:"Projekte",anonymous:"Anonym",starCitizenNameRequired:"Star Citizen Name Erforderlich",starCitizenNameRequiredDesc:"Bitte setzen Sie Ihren Star Citizen Namen, um die App weiter zu nutzen",reputationPoints:"Reputationspunkte",pointsLabel:"Punkte",starCitizenNameDisplay:"Star Citizen Name / Anzeigename",nameVisibleDesc:"Der Name, den andere Benutzer auf der Plattform sehen werden",starCitizenName:"Star Citizen Name",yourStarCitizenName:"Ihr Star Citizen Name",fieldRequired:"⚠️ Dieses Feld ist erforderlich",defaultHomePort:"Standard-Heimathafen",homePortPlaceholder:"z.B., Port Olisar, Lorville, Area18...",achievements:"Erfolge",badgesEarned:"Abzeichen durch Beiträge verdient",noBadgesYet:"Noch keine Abzeichen. Fangen Sie an beizutragen!",manageOrgMemberships:"Verwalten Sie Ihre Organisationsmitgliedschaften",notInAnyOrg:"Sie sind noch kein Mitglied einer Organisation",defaultOrg:"Standardorganisation",selectDefaultOrg:"Standardorganisation auswählen",manageOrganizations:"Organisationen Verwalten",notificationSettings:"Benachrichtigungseinstellungen",manageNotifications:"Verwalten Sie, wie Sie Benachrichtigungen erhalten",materialInventory:"Materiallager",trackMaterialsDesc:"Verfolgen Sie Ihre Materialien und finden Sie Projekte",addMaterial:"Material Hinzufügen",addMaterialToInventory:"Material zum Lager Hinzufügen",materialLabel:"Material",selectMaterial:"Material auswählen...",quantityLabel:"Menge",addToInventory:"Zum Lager Hinzufügen",myInventory:"Mein Lager",projectsToStart:"Zu Startende Projekte",closestContribution:"Nächster Beitrag",totalMaterialsCount:"Gesamtmaterialien",loadingInventory:"Lager wird geladen...",inventoryEmpty:"Ihr Lager ist leer",addFirstMaterial:"Erstes Material Hinzufügen",calculatingProjects:"Berechnung startbarer Projekte...",noProjectsWithInventory:"Keine Projekte mit aktuellem Lager verfügbar",addMaterialsToStart:"Materialien hinzufügen, um startbare Projekte zu sehen",completionFromInventory:"Fertigstellung aus Ihrem Lager:",youHaveMaterials:"Sie haben Materialien:",matchingMaterials:"übereinstimmende Materialien",startThisProject:"Dieses Projekt Starten",calculatingClosest:"Nächste Projekte werden berechnet...",noMatchingProjects:"Keine übereinstimmenden Projekte gefunden",addMaterialsToContribute:"Materialien zum Lager hinzufügen, um beitragsgeeignete Projekte zu sehen",youCanProvide:"Sie können bereitstellen:",unitsNeeded:"Einheiten benötigt",viewProjectContribute:"Projekt Ansehen und Beitragen",newShipProject:"Neues Schiffprojekt starten",newArmorProject:"Neues Rüstungsprojekt starten",selectConversation:"Konversation auswählen",chooseDMDesc:"Wählen Sie eine DM, einen Org-Kanal oder einen Projekt-Thread",allMessages:"Alle",dmsLabel:"DMs",orgsLabel:"Orgs",projectsTabLabel:"Projekte",newDirectMessage:"Neue Direktnachricht",searchConversations:"Konversationen suchen...",directMessagesLabel:"DIREKTNACHRICHTEN",organizationChannels:"ORGANISATIONSKANÄLE",projectThreadsLabel:"PROJEKT-THREADS",noMessagesYet:"Noch keine Nachrichten",unknownOwner:"Unbekannter Besitzer",messageDeleted:"Nachricht gelöscht",edited:"bearbeitet",adminLabel:"Admin",typeMessagePlaceholder:"Nachricht eingeben... (Enter zum Senden, Shift+Enter für neue Zeile)",supportsMarkdown:"Unterstützt Markdown-Formatierung",materialReputationValues:"Materiell-Reputationswerte",legendaryLabel:"Legendär",epicLabel:"Episch",rareLabel:"Selten",commonLabel:"Gewöhnlich",updateBannerTitle:"4.8-Update kommt für Wikelo-Projects!",updateBannerText:"Einige Herstellungsanforderungen für Schiffe und Gegenstände können sich ändern.",updateBannerLink:"Mehr Infos",updateInfoTitle:"4.8-Update — Was sich ändert",updateInfoP1:"Wie viele von euch wissen, hat Star Citizen kürzlich einen Wipe zusammen mit einer Reihe wichtiger Gameplay-Änderungen durchgeführt. Ich arbeite derzeit daran, die Website zu aktualisieren, um die neuesten Wikelo-Änderungen und andere mit Patch 4.8 eingeführte Updates widerzuspiegeln.",updateInfoP2:"Ich weiß, dass ich mit diesen Updates etwas in Rückstand geraten bin, und ich möchte mich aufrichtig für die Verzögerung entschuldigen. Ich schätze die Geduld aller, während ich die Änderungen durcharbeite und die Website verbessere.",updateInfoP3:"Neben den aktuellen Updates entwickle ich auch Tools, um Informationen direkt aus den Spieldateien zu extrahieren. Das Ziel ist, Inhalte in Zukunft viel schneller zu aktualisieren — idealerweise sogar bevor neue Patches offiziell erscheinen.",updateInfoP4:"Während wir weitermachen, möchte ich dieser großartigen Community auch wissen lassen, wie sehr ich euer Feedback schätze. Eure Vorschläge, Fehlerberichte und Ideen helfen wirklich dabei, die Website zu verbessern, und ich schätze die gesamte Unterstützung, die ihr mir gegeben habt, sehr. Danke!"},zh:{appTitle:"Wikelo 项目追踪器",allShips:"所有飞船",organizations:"组织",notifications:"通知",profile:"个人资料设置",signOut:"退出",trackMaterials:"追踪材料,与公民协作,建造您的 Wikelo 飞船",startNewProject:"开始新项目",searchShips:"搜索飞船...",all:"全部",myProjects:"我的项目",orgProjects:"组织项目",inProgress:"进行中",completed:"已完成",noProjectsFound:"未找到项目",beFirst:"成为第一个开始飞船建造项目的人!",createProject:"创建项目",backToProjects:"返回项目",createdBy:"创建者",organization:"组织",homePort:"母港",markComplete:"标记完成",startBuilding:"开始建造",edit:"编辑",linkToOrg:"链接到组织",overallProgress:"总体进度",materials:"材料",contributions:"贡献",contributors:"贡献者",chat:"聊天",activity:"活动",contribute:"贡献",profileAvatar:"个人头像",uploadAvatar:"上传头像",displayName:"Star Citizen 名称 / 显示名称",email:"邮箱",fullName:"全名",saveChanges:"保存更改",language:"语言",selectLanguage:"选择您的首选语言",markAllRead:"全部标记为已读",unread:"未读",noNotifications:"暂无通知",notificationsDesc:"当有人向您的项目发送消息时,您会在这里看到通知",sentMessage:"发送了消息",madeContribution:"做出了贡献",browseOrganizations:"浏览组织",createOrganization:"创建组织",searchOrgs:"搜索组织...",members:"成员",projects:"项目",requestToJoin:"请求加入",cancel:"取消",delete:"删除",save:"保存",loading:"加载中...",submit:"提交",viewDetails:"查看详情",progress:"进度",requiredMaterials:"所需材料",recentContributions:"最近贡献",discussWithTeam:"与团队讨论",projectActivity:"项目活动",deleteProject:"删除项目?",deleteProjectDesc:"这将永久删除此项目及其所有贡献。此操作无法撤消。",projectNotFound:"未找到项目",shipsAndMaterials:"Wikelo 飞船和材料",armorsAndMaterials:"Wikelo 装甲和材料",browseShipsDesc:"浏览所有可用的飞船及其所需材料",browseArmorsDesc:"浏览所有可用的装甲及其所需材料",searchArmors:"搜索装甲...",startProject:"开始项目",noMaterialsData:"没有材料数据可用",noShipsFound:"未找到匹配的飞船",noArmorsFound:"未找到匹配的装甲",backToArmors:"返回装甲",projectCreatedSuccess:"项目创建成功!",armorProjectCreatedSuccess:"装甲项目创建成功!",guideTitle:"网站指南",guideSubtitle:"学习如何使用 Wikelo 项目追踪器进行协作和建造飞船",gettingStarted:"项目入门",creatingProject:"创建项目",managingProject:"管理您的项目",contributingMaterials:"贡献材料",howToContribute:"如何贡献",contributionStatus:"贡献状态",joiningCreatingOrgs:"加入和创建组织",organizationBenefits:"组织优势",communicationCollaboration:"沟通与协作",projectChat:"项目聊天",notificationsSection:"通知",reputationSystem:"声誉系统",earningReputation:"获得声誉",reputationBenefits:"声誉优势",tipsBestPractices:"提示和最佳实践",guideStep1_1:'点击主页上的"开始新项目"按钮',guideStep1_2:'从 Wikelo 飞船列表中选择一艘飞船或选择"自定义"',guideStep1_3:"添加描述并指定您的母港",guideStep1_4:"查看所需材料",guideStep1_5:"提交以创建您的项目",guideStep2_1:"使用项目页面上的编辑按钮编辑项目详细信息",guideStep2_2:"随着收集资源更新材料数量",guideStep2_3:'收到材料时将贡献标记为"已交付"',guideStep2_4:"将项目状态从规划 → 进行中 → 已完成",guideStep2_5:"如果您是管理员,将项目链接到组织",guideStep3_1:"在主页上浏览项目或访问特定项目",guideStep3_2:'点击需要材料的项目上的"贡献"按钮',guideStep3_3:"选择一个或多个您可以提供的材料",guideStep3_4:"为每种材料输入数量",guideStep3_5:"选择交付方式:取货或送货",guideStep3_6:"指定取货或送货协调的位置",guideStep3_7:"可选添加您的游戏内名称",guideStep3_8:"提交 - 每种材料成为单独的贡献",guideStep4_1:"待处理:等待项目所有者接受和收集",guideStep4_2:"已交付:所有者确认收到您的材料",guideStep4_3:"每种材料都有点数值",guideStep4_4:"通过成功贡献建立您的声誉",guideStep5_1:"在组织页面上浏览组织",guideStep5_2:'点击"请求加入"以加入现有组织',guideStep5_3:"使用唯一标签/缩写创建您自己的组织",guideStep5_4:"组织可以有多个管理员和成员",guideStep5_5:"管理员成员可以将项目链接到组织",guideStep6_1:"过滤主页以仅查看您组织的项目",guideStep6_2:"项目显示组织标签徽章",guideStep6_3:"与您的组织成员协调工作",guideStep6_4:"从组织详细信息页面跟踪所有组织项目",guideStep7_1:"每个项目都有专用的聊天标签",guideStep7_2:"讨论计划、协调取货并提出问题",guideStep7_3:"所有项目参与者都可以看到聊天消息",guideStep7_4:"您将收到新消息的通知",guideStep8_1:"接收项目聊天消息的通知",guideStep8_2:"当贡献被接受时收到通知",guideStep8_3:"按类型过滤通知:聊天或贡献",guideStep8_4:"点击通知直接跳转到项目",guideStep8_5:"单独或一次性将通知标记为已读",guideStep9_1:"向项目贡献材料",guideStep9_2:'等待项目所有者将您的贡献标记为"已交付"',guideStep9_3:"根据材料价值赚取积分",guideStep9_4:"您的声誉显示在您的个人资料和贡献中",guideStep10_1:"更高的声誉在社区中建立信任",guideStep10_2:"在您做出贡献时对他人可见",guideStep10_3:"显示您可靠交付的记录",guideStep10_4:"帮助项目所有者决定接受哪些贡献",guideTip1:"在个人资料设置中设置您的默认母港",guideTip2:"使用飞船页面浏览所有可用的 Wikelo 飞船",guideTip3:"查看项目上的活动标签以查看所有最近的更新",guideTip4:"在线指示器显示谁正在实时查看项目",leaderboard:"排行榜",topByReputation:"声誉排行",topContributors:"顶级贡献者",reputationLeaders:"声誉领袖",noUsersWithReputation:"暂无有声誉的用户",reputationLabel:"声誉",topMaterialContributors:"顶级材料贡献者",noContributionsYet:"暂无贡献",contributionsCount:"贡献",projectsCount:"项目",anonymous:"匿名",starCitizenNameRequired:"需要Star Citizen名称",starCitizenNameRequiredDesc:"请设置您的Star Citizen名称以继续使用应用",reputationPoints:"声誉积分",pointsLabel:"分",starCitizenNameDisplay:"Star Citizen名称 / 显示名称",nameVisibleDesc:"其他用户在平台上看到的名称",starCitizenName:"Star Citizen名称",yourStarCitizenName:"您的Star Citizen名称",fieldRequired:"⚠️ 此字段为必填项",defaultHomePort:"默认母港",homePortPlaceholder:"例如,奥利萨港、洛维尔、18区...",achievements:"成就",badgesEarned:"通过贡献获得的徽章",noBadgesYet:"暂无徽章。开始贡献以赢得成就!",manageOrgMemberships:"管理您的组织成员资格",notInAnyOrg:"您还不是任何组织的成员",defaultOrg:"默认组织",selectDefaultOrg:"选择默认组织",manageOrganizations:"管理组织",notificationSettings:"通知设置",manageNotifications:"管理您接收通知的方式",materialInventory:"材料库存",trackMaterialsDesc:"追踪您的材料并找到可以贡献的项目",addMaterial:"添加材料",addMaterialToInventory:"添加材料到库存",materialLabel:"材料",selectMaterial:"选择材料...",quantityLabel:"数量",addToInventory:"添加到库存",myInventory:"我的库存",projectsToStart:"可启动的项目",closestContribution:"最近贡献",totalMaterialsCount:"总材料",loadingInventory:"加载库存...",inventoryEmpty:"您的库存为空",addFirstMaterial:"添加您的第一个材料",calculatingProjects:"计算您可以启动的项目...",noProjectsWithInventory:"当前库存没有可用的项目",addMaterialsToStart:"添加材料以查看您可以启动的项目",completionFromInventory:"从您的库存完成:",youHaveMaterials:"您有材料:",matchingMaterials:"匹配材料",startThisProject:"启动此项目",calculatingClosest:"计算最近的项目...",noMatchingProjects:"未找到匹配项目",addMaterialsToContribute:"向库存添加材料以查看您可以贡献的项目",youCanProvide:"您可以提供:",unitsNeeded:"所需单位",viewProjectContribute:"查看项目并贡献",newShipProject:"启动新飞船项目",newArmorProject:"启动新装甲项目",selectConversation:"选择一个对话",chooseDMDesc:"选择一个DM、组织频道或项目线程开始发消息",allMessages:"全部",dmsLabel:"私信",orgsLabel:"组织",projectsTabLabel:"项目",newDirectMessage:"新私信",searchConversations:"搜索对话...",directMessagesLabel:"私信",organizationChannels:"组织频道",projectThreadsLabel:"项目线程",noMessagesYet:"暂无消息",unknownOwner:"未知所有者",messageDeleted:"消息已删除",edited:"已编辑",adminLabel:"管理员",typeMessagePlaceholder:"输入消息...(Enter发送,Shift+Enter换行)",supportsMarkdown:"支持Markdown格式",materialReputationValues:"材料声誉值",legendaryLabel:"传奇",epicLabel:"史诗",rareLabel:"稀有",commonLabel:"普通",updateBannerTitle:"4.8 更新即将到来 Wikelo-Projects!",updateBannerText:"一些飞船和物品的制造要求可能会发生变化。",updateBannerLink:"了解更多",updateInfoTitle:"4.8 更新 — 即将发生的变化",updateInfoP1:"正如你们许多人所知,Star Citizen 最近经历了一次清档,同时还进行了一些重大的游戏玩法更改。我目前正在努力更新网站,以反映 Wikelo 的最新变化以及 4.8 补丁引入的其他更新。",updateInfoP2:"我知道这些更新上线有些延迟,在此我真诚地道歉。感谢大家在我处理这些变更和改进网站期间的耐心等待。",updateInfoP3:"除了当前的更新外,我还在开发直接从游戏文件中挖掘信息的工具。目标是在未来更快地更新内容——理想情况下甚至在新补丁正式发布之前就完成更新。",updateInfoP4:"在我们继续前进的过程中,我也希望这个了不起的社区知道我多么重视你们的反馈。你们的建议、错误报告和想法真的帮助改善了网站,我真诚地感谢你们一路以来给予的所有支持。谢谢!"},ja:{appTitle:"Wikelo プロジェクトトラッカー",allShips:"すべての船",organizations:"組織",notifications:"通知",profile:"プロフィール設定",signOut:"サインアウト",trackMaterials:"マテリアルを追跡し、市民と協力して Wikelo 船を建造しましょう",startNewProject:"新しいプロジェクトを開始",searchShips:"船を検索...",all:"すべて",myProjects:"マイプロジェクト",orgProjects:"組織プロジェクト",inProgress:"進行中",completed:"完了",noProjectsFound:"プロジェクトが見つかりません",beFirst:"最初の船舶建造プロジェクトを開始しましょう!",createProject:"プロジェクトを作成",backToProjects:"プロジェクトに戻る",createdBy:"作成者",organization:"組織",homePort:"ホームポート",markComplete:"完了としてマーク",startBuilding:"建造開始",edit:"編集",linkToOrg:"組織にリンク",overallProgress:"全体の進捗",materials:"マテリアル",contributions:"貢献",contributors:"貢献者",chat:"チャット",activity:"アクティビティ",contribute:"貢献する",profileAvatar:"プロフィールアバター",uploadAvatar:"アバターをアップロード",displayName:"Star Citizen 名 / 表示名",email:"メール",fullName:"フルネーム",saveChanges:"変更を保存",language:"言語",selectLanguage:"希望する言語を選択してください",markAllRead:"すべて既読にする",unread:"未読",noNotifications:"通知はまだありません",notificationsDesc:"プロジェクトにメッセージが届くと、ここに通知が表示されます",sentMessage:"がメッセージを送信しました",madeContribution:"が貢献しました",browseOrganizations:"組織を閲覧",createOrganization:"組織を作成",searchOrgs:"組織を検索...",members:"メンバー",projects:"プロジェクト",requestToJoin:"参加をリクエスト",cancel:"キャンセル",delete:"削除",save:"保存",loading:"読み込み中...",submit:"送信",viewDetails:"詳細を見る",progress:"進捗",requiredMaterials:"必要な材料",recentContributions:"最近の貢献",discussWithTeam:"チームと話し合う",projectActivity:"プロジェクトアクティビティ",deleteProject:"プロジェクトを削除?",deleteProjectDesc:"これにより、このプロジェクトとすべての貢献が完全に削除されます。",projectNotFound:"プロジェクトが見つかりません",shipsAndMaterials:"Wikelo 船舶と材料",armorsAndMaterials:"Wikelo アーマーと材料",browseShipsDesc:"利用可能なすべての船舶と必要な材料を閲覧",browseArmorsDesc:"利用可能なすべてのアーマーと必要な材料を閲覧",searchArmors:"アーマーを検索...",startProject:"プロジェクトを開始",noMaterialsData:"材料データがありません",noShipsFound:"一致する船舶が見つかりません",noArmorsFound:"一致するアーマーが見つかりません",backToArmors:"アーマーに戻る",projectCreatedSuccess:"プロジェクトが正常に作成されました!",armorProjectCreatedSuccess:"アーマープロジェクトが正常に作成されました!",guideTitle:"サイトガイド",guideSubtitle:"Wikelo プロジェクトトラッカーの使い方を学びましょう",gettingStarted:"プロジェクトの開始",creatingProject:"プロジェクトの作成",managingProject:"プロジェクトの管理",contributingMaterials:"材料の貢献",howToContribute:"貢献方法",contributionStatus:"貢献ステータス",joiningCreatingOrgs:"組織への参加と作成",organizationBenefits:"組織の利点",communicationCollaboration:"コミュニケーションとコラボレーション",projectChat:"プロジェクトチャット",notificationsSection:"通知",reputationSystem:"評判システム",earningReputation:"評判の獲得",reputationBenefits:"評判の利点",tipsBestPractices:"ヒントとベストプラクティス",guideStep1_1:"ホームページの「新しいプロジェクトを開始」ボタンをクリックします",guideStep1_2:"Wikelo船リストから船を選択するか、「カスタム」を選択します",guideStep1_3:"説明を追加し、ホームポートを指定します",guideStep1_4:"必要な材料を確認します",guideStep1_5:"送信してプロジェクトを作成します",guideStep2_1:"プロジェクトページの編集ボタンを使用してプロジェクトの詳細を編集します",guideStep2_2:"リソースを収集するにつれて材料の数量を更新します",guideStep2_3:"材料を受け取ったら、貢献を「配達済み」としてマークします",guideStep2_4:"プロジェクトのステータスを計画中 → 進行中 → 完了に変更します",guideStep2_5:"管理者の場合、プロジェクトを組織にリンクします",guideStep3_1:"ホームページでプロジェクトを閲覧するか、特定のプロジェクトにアクセスします",guideStep3_2:"必要な材料があるプロジェクトの「貢献」ボタンをクリックします",guideStep3_3:"提供できる材料を選択します",guideStep3_4:"各材料の数量を入力します",guideStep3_5:"配達方法を選択:受け取りまたは配達",guideStep3_6:"受け取りまたは配達の調整の場所を指定します",guideStep3_7:"オプションでゲーム内の名前を追加します",guideStep3_8:"送信 - 各材料は個別の貢献になります",guideStep4_1:"保留中:プロジェクト所有者が承認して収集するのを待っています",guideStep4_2:"配達済み:所有者が材料の受領を確認しました",guideStep4_3:"各材料にはポイント値があります",guideStep4_4:"成功した貢献で評判を築きます",guideStep5_1:"組織ページで組織を閲覧します",guideStep5_2:"「参加をリクエスト」をクリックして組織に参加します",guideStep5_3:"ユニークなタグで独自の組織を作成します",guideStep5_4:"組織には複数の管理者とメンバーがいることができます",guideStep5_5:"管理者メンバーはプロジェクトを組織にリンクできます",guideStep6_1:"ホームページをフィルタリングして、組織のプロジェクトのみを表示します",guideStep6_2:"プロジェクトは組織タグバッジを表示します",guideStep6_3:"組織のメンバーと協力して作業を調整します",guideStep6_4:"組織の詳細ページからすべての組織プロジェクトを追跡します",guideStep7_1:"各プロジェクトには専用のチャットタブがあります",guideStep7_2:"計画について話し合い、受け取りを調整し、質問します",guideStep7_3:"すべてのプロジェクト参加者がチャットメッセージを見ることができます",guideStep7_4:"新しいメッセージの通知を受け取ります",guideStep8_1:"プロジェクトのチャットメッセージの通知を受け取ります",guideStep8_2:"貢献が承認されたときに通知を受け取ります",guideStep8_3:"タイプ別に通知をフィルタリング:チャットまたは貢献",guideStep8_4:"通知をクリックしてプロジェクトに直接ジャンプします",guideStep8_5:"通知を個別にまたは一度にすべて既読としてマークします",guideStep9_1:"プロジェクトに材料を貢献します",guideStep9_2:"プロジェクト所有者があなたの貢献を「配達済み」としてマークするのを待ちます",guideStep9_3:"材料の価値に基づいてポイントを獲得します",guideStep9_4:"あなたの評判はプロフィールと貢献に表示されます",guideStep10_1:"より高い評判はコミュニティでの信頼を築きます",guideStep10_2:"貢献する際に他の人に表示されます",guideStep10_3:"信頼できる配達の実績を示します",guideStep10_4:"プロジェクト所有者がどの貢献を受け入れるかを決定するのに役立ちます",guideTip1:"プロフィール設定でデフォルトのホームポートを設定します",guideTip2:"船舶ページを使用して、利用可能なすべてのWikelo船を閲覧します",guideTip3:"プロジェクトのアクティビティタブをチェックして最近の更新を確認します",guideTip4:"プレゼンスインジケーターは、誰が現在プロジェクトをリアルタイムで表示しているかを示します",leaderboard:"リーダーボード",topByReputation:"評判トップ",topContributors:"トップ貢献者",reputationLeaders:"評判リーダー",noUsersWithReputation:"まだ評判のあるユーザーがいません",reputationLabel:"評判",topMaterialContributors:"トップマテリアル貢献者",noContributionsYet:"まだ貢献がありません",contributionsCount:"貢献",projectsCount:"プロジェクト",anonymous:"匿名",starCitizenNameRequired:"Star Citizen名が必要",starCitizenNameRequiredDesc:"アプリを引き続き使用するためにStar Citizen名を設定してください",reputationPoints:"評判ポイント",pointsLabel:"ポイント",starCitizenNameDisplay:"Star Citizen名 / 表示名",nameVisibleDesc:"他のユーザーがプラットフォームで見る名前",starCitizenName:"Star Citizen名",yourStarCitizenName:"あなたのStar Citizen名",fieldRequired:"⚠️ このフィールドは必須です",defaultHomePort:"デフォルトホームポート",homePortPlaceholder:"例: Port Olisar, Lorville, Area18...",achievements:"実績",badgesEarned:"貢献によって獲得したバッジ",noBadgesYet:"まだバッジがありません。貢献して実績を獲得しましょう!",manageOrgMemberships:"組織メンバーシップを管理する",notInAnyOrg:"まだどの組織のメンバーでもありません",defaultOrg:"デフォルト組織",selectDefaultOrg:"デフォルト組織を選択",manageOrganizations:"組織を管理",notificationSettings:"通知設定",manageNotifications:"通知の受け取り方を管理する",materialInventory:"マテリアルインベントリ",trackMaterialsDesc:"マテリアルを追跡し、貢献できるプロジェクトを見つける",addMaterial:"マテリアルを追加",addMaterialToInventory:"インベントリにマテリアルを追加",materialLabel:"マテリアル",selectMaterial:"マテリアルを選択...",quantityLabel:"数量",addToInventory:"インベントリに追加",myInventory:"マイインベントリ",projectsToStart:"開始するプロジェクト",closestContribution:"最も近い貢献",totalMaterialsCount:"総マテリアル",loadingInventory:"インベントリを読み込み中...",inventoryEmpty:"インベントリが空です",addFirstMaterial:"最初のマテリアルを追加",calculatingProjects:"開始できるプロジェクトを計算中...",noProjectsWithInventory:"現在のインベントリで利用可能なプロジェクトがありません",addMaterialsToStart:"マテリアルを追加して開始できるプロジェクトを確認",completionFromInventory:"インベントリからの完成度:",youHaveMaterials:"お持ちのマテリアル:",matchingMaterials:"一致するマテリアル",startThisProject:"このプロジェクトを開始",calculatingClosest:"最も近いプロジェクトを計算中...",noMatchingProjects:"一致するプロジェクトが見つかりません",addMaterialsToContribute:"インベントリにマテリアルを追加して貢献できるプロジェクトを確認",youCanProvide:"提供できるもの:",unitsNeeded:"必要な単位",viewProjectContribute:"プロジェクトを見て貢献",newShipProject:"新しい船プロジェクトを開始",newArmorProject:"新しいアーマープロジェクトを開始",selectConversation:"会話を選択",chooseDMDesc:"DM、組織チャンネル、またはプロジェクトスレッドを選択してメッセージを開始",allMessages:"すべて",dmsLabel:"DM",orgsLabel:"組織",projectsTabLabel:"プロジェクト",newDirectMessage:"新しいダイレクトメッセージ",searchConversations:"会話を検索...",directMessagesLabel:"ダイレクトメッセージ",organizationChannels:"組織チャンネル",projectThreadsLabel:"プロジェクトスレッド",noMessagesYet:"まだメッセージがありません",unknownOwner:"不明なオーナー",messageDeleted:"メッセージが削除されました",edited:"編集済み",adminLabel:"管理者",typeMessagePlaceholder:"メッセージを入力...(Enterで送信、Shift+Enterで改行)",supportsMarkdown:"Markdownフォーマットをサポート",materialReputationValues:"マテリアル評判値",legendaryLabel:"レジェンダリー",epicLabel:"エピック",rareLabel:"レア",commonLabel:"コモン",updateBannerTitle:"Wikelo-Projects に 4.8 アップデートが来ます!",updateBannerText:"一部の船とアイテムのクラフト要件が変更される可能性があります。",updateBannerLink:"詳細",updateInfoTitle:"4.8 アップデート — 変更点について",updateInfoP1:"皆さんもご存知のように、Star Citizen は最近ワイプとともに多くの重要なゲームプレイ変更が行われました。現在、Wikelo の最新の変更とパッチ 4.8 で導入された他のアップデートを反映するためにサイトを更新しています。",updateInfoP2:"これらのアップデートの公開が遅れていることは承知しており、遅延について心からお詫び申し上げます。変更を処理してサイトを改善する間、皆さんのご辛抱に感謝します。",updateInfoP3:"現在のアップデートに加えて、ゲームファイルから直接情報をデータマイニングするツールも開発しています。目標は、将来的にコンテンツをより迅速に更新することです — 理想的には新しいパッチが正式にリリースされる前に更新できるようにすることです。",updateInfoP4:"これからも前進していく中で、この素晴らしいコミュニティの皆さんに、皆さんのフィードバックをどれほど大切にしているかをお伝えしたいと思います。皆さんのご提案、バグ報告、アイデアはサイトの改善に本当に役立っており、これまでいただいたすべてのサポートに心から感謝しています。ありがとうございます!"},pt:{appTitle:"Rastreador de Projetos Wikelo",allShips:"Todos os Navios",organizations:"Organizações",notifications:"Notificações",profile:"Configurações do Perfil",signOut:"Sair",trackMaterials:"Rastreie materiais, colabore com cidadãos e construa sua nave Wikelo",startNewProject:"Iniciar Novo Projeto",searchShips:"Pesquisar navios...",all:"Todos",myProjects:"Meus Projetos",orgProjects:"Projetos da Org",inProgress:"Em Progresso",completed:"Concluído",noProjectsFound:"Nenhum projeto encontrado",beFirst:"Seja o primeiro a iniciar um projeto de construção de nave!",createProject:"Criar Projeto",backToProjects:"Voltar aos Projetos",createdBy:"Criado por",organization:"Organização",homePort:"Porto Base",markComplete:"Marcar como Concluído",startBuilding:"Iniciar Construção",edit:"Editar",linkToOrg:"Vincular à Org",overallProgress:"Progresso Geral",materials:"Materiais",contributions:"Contribuições",contributors:"Contribuidores",chat:"Chat",activity:"Atividade",contribute:"Contribuir",profileAvatar:"Avatar do Perfil",uploadAvatar:"Enviar Avatar",displayName:"Nome Star Citizen / Nome de Exibição",email:"E-mail",fullName:"Nome Completo",saveChanges:"Salvar Alterações",language:"Idioma",selectLanguage:"Selecione seu idioma preferido",markAllRead:"Marcar tudo como lido",unread:"não lido",noNotifications:"Nenhuma notificação ainda",notificationsDesc:"Você verá notificações aqui quando pessoas enviarem mensagens para seus projetos",sentMessage:"enviou uma mensagem",madeContribution:"fez uma contribuição",browseOrganizations:"Explorar Organizações",createOrganization:"Criar Organização",searchOrgs:"Pesquisar organizações...",members:"Membros",projects:"Projetos",requestToJoin:"Solicitar Entrada",cancel:"Cancelar",delete:"Excluir",save:"Salvar",loading:"Carregando...",submit:"Enviar",viewDetails:"Ver Detalhes",progress:"Progresso",requiredMaterials:"Materiais Necessários",recentContributions:"Contribuições Recentes",discussWithTeam:"Discuta com sua equipe",projectActivity:"Atividade do Projeto",deleteProject:"Excluir Projeto?",deleteProjectDesc:"Isso excluirá permanentemente este projeto e todas as suas contribuições.",projectNotFound:"Projeto não encontrado",shipsAndMaterials:"Navios e Materiais Wikelo",armorsAndMaterials:"Armaduras e Materiais Wikelo",browseShipsDesc:"Explore todos os navios disponíveis e seus materiais necessários",browseArmorsDesc:"Explore todas as armaduras disponíveis e seus materiais necessários",searchArmors:"Pesquisar armaduras...",startProject:"Iniciar Projeto",noMaterialsData:"Nenhum dado de materiais disponível",noShipsFound:"Nenhum navio encontrado correspondente a",noArmorsFound:"Nenhuma armadura encontrada correspondente a",backToArmors:"Voltar às Armaduras",projectCreatedSuccess:"Projeto criado com sucesso!",armorProjectCreatedSuccess:"Projeto de armadura criado com sucesso!",guideTitle:"Guia do Site",guideSubtitle:"Aprenda a usar o Rastreador de Projetos Wikelo para colaborar e construir naves",gettingStarted:"Começando com Projetos",creatingProject:"Criando um Projeto",managingProject:"Gerenciando Seu Projeto",contributingMaterials:"Contribuindo Materiais",howToContribute:"Como Contribuir",contributionStatus:"Status da Contribuição",joiningCreatingOrgs:"Entrando e Criando Organizações",organizationBenefits:"Benefícios da Organização",communicationCollaboration:"Comunicação e Colaboração",projectChat:"Chat do Projeto",notificationsSection:"Notificações",reputationSystem:"Sistema de Reputação",earningReputation:"Ganhando Reputação",reputationBenefits:"Benefícios da Reputação",tipsBestPractices:"Dicas e Melhores Práticas",guideStep1_1:"Clique no botão 'Iniciar Novo Projeto' na página inicial",guideStep1_2:"Selecione um navio da lista de navios Wikelo ou escolha 'Personalizado'",guideStep1_3:"Adicione uma descrição e especifique seu porto base",guideStep1_4:"Revise os materiais necessários",guideStep1_5:"Envie para criar seu projeto",guideStep2_1:"Edite os detalhes do projeto usando o botão Editar",guideStep2_2:"Atualize as quantidades de materiais conforme coleta recursos",guideStep2_3:"Marque contribuições como 'Entregue' quando receber materiais",guideStep2_4:"Altere o status do projeto de Planejamento → Em Progresso → Concluído",guideStep2_5:"Vincule seu projeto a uma organização se você for administrador",guideStep3_1:"Navegue pelos projetos na página inicial ou visite um projeto específico",guideStep3_2:"Clique no botão 'Contribuir' em um projeto com materiais necessários",guideStep3_3:"Selecione um ou vários materiais que você pode fornecer",guideStep3_4:"Insira quantidades para cada material",guideStep3_5:"Escolha o método de entrega: Retirada ou Entrega",guideStep3_6:"Especifique o local para coordenação",guideStep3_7:"Opcionalmente adicione seu nome no jogo",guideStep3_8:"Envie - cada material se torna uma contribuição separada",guideStep4_1:"Pendente: Aguardando o proprietário do projeto aceitar e coletar",guideStep4_2:"Entregue: Proprietário confirmou o recebimento dos seus materiais",guideStep4_3:"Cada material tem um valor em pontos",guideStep4_4:"Construa sua reputação fazendo contribuições bem-sucedidas",guideStep5_1:"Explore organizações na página Organizações",guideStep5_2:"Clique em 'Solicitar Entrada' para entrar em uma org existente",guideStep5_3:"Crie sua própria organização com uma tag/abreviação única",guideStep5_4:"Organizações podem ter múltiplos administradores e membros",guideStep5_5:"Membros administradores podem vincular projetos à organização",guideStep6_1:"Filtre a página inicial para ver apenas os projetos da sua org",guideStep6_2:"Projetos mostram emblemas de tag de org",guideStep6_3:"Coordene esforços com os membros da sua org",guideStep6_4:"Acompanhe todos os projetos da org na página de detalhes",guideStep7_1:"Cada projeto tem uma aba de chat dedicada",guideStep7_2:"Discuta planos, coordene retiradas e faça perguntas",guideStep7_3:"Todos os participantes do projeto podem ver mensagens de chat",guideStep7_4:"Você receberá notificações para novas mensagens",guideStep8_1:"Receba notificações para mensagens de chat em seus projetos",guideStep8_2:"Seja notificado quando contribuições forem aceitas",guideStep8_3:"Filtre notificações por tipo: Chat ou Contribuições",guideStep8_4:"Clique em uma notificação para ir diretamente ao projeto",guideStep8_5:"Marque notificações como lidas individualmente ou todas de uma vez",guideStep9_1:"Contribua materiais para projetos",guideStep9_2:"Aguarde o proprietário do projeto marcar sua contribuição como 'Entregue'",guideStep9_3:"Ganhe pontos com base no valor do material",guideStep9_4:"Sua reputação é exibida no seu perfil e contribuições",guideStep10_1:"Maior reputação constrói confiança na comunidade",guideStep10_2:"Visível para outros quando você faz contribuições",guideStep10_3:"Mostra seu histórico de entregas confiáveis",guideStep10_4:"Ajuda os proprietários de projetos a decidir quais contribuições aceitar",guideTip1:"Defina seu porto base padrão nas configurações de Perfil",guideTip2:"Use a página Navios para explorar todos os navios Wikelo disponíveis",guideTip3:"Verifique a aba Atividade nos projetos para ver todas as atualizações recentes",guideTip4:"Indicadores de presença mostram quem está visualizando um projeto em tempo real",leaderboard:"Classificação",topByReputation:"Top por Reputação",topContributors:"Melhores Contribuidores",reputationLeaders:"Líderes de Reputação",noUsersWithReputation:"Nenhum usuário com reputação ainda",reputationLabel:"reputação",topMaterialContributors:"Melhores Contribuidores de Materiais",noContributionsYet:"Nenhuma contribuição ainda",contributionsCount:"contribuições",projectsCount:"projetos",anonymous:"Anônimo",starCitizenNameRequired:"Nome Star Citizen Necessário",starCitizenNameRequiredDesc:"Por favor defina seu nome Star Citizen para continuar usando o app",reputationPoints:"Pontos de Reputação",pointsLabel:"pontos",starCitizenNameDisplay:"Nome Star Citizen / Nome de Exibição",nameVisibleDesc:"O nome que outros usuários verão na plataforma",starCitizenName:"Nome Star Citizen",yourStarCitizenName:"Seu nome Star Citizen",fieldRequired:"⚠️ Este campo é obrigatório",defaultHomePort:"Porto Base Padrão",homePortPlaceholder:"ex., Porto Olisar, Lorville, Area18...",achievements:"Conquistas",badgesEarned:"Emblemas ganhos através de contribuições",noBadgesYet:"Nenhum emblema ainda. Comece a contribuir para ganhar conquistas!",manageOrgMemberships:"Gerencie suas associações a organizações",notInAnyOrg:"Você ainda não é membro de nenhuma organização",defaultOrg:"Organização Padrão",selectDefaultOrg:"Selecionar organização padrão",manageOrganizations:"Gerenciar Organizações",notificationSettings:"Configurações de Notificação",manageNotifications:"Gerencie como você recebe notificações",materialInventory:"Inventário de Materiais",trackMaterialsDesc:"Rastreie seus materiais e encontre projetos para contribuir",addMaterial:"Adicionar Material",addMaterialToInventory:"Adicionar Material ao Inventário",materialLabel:"Material",selectMaterial:"Selecionar material...",quantityLabel:"Quantidade",addToInventory:"Adicionar ao Inventário",myInventory:"Meu Inventário",projectsToStart:"Projetos para Iniciar",closestContribution:"Contribuição mais Próxima",totalMaterialsCount:"Total de Materiais",loadingInventory:"Carregando inventário...",inventoryEmpty:"Seu inventário está vazio",addFirstMaterial:"Adicione Seu Primeiro Material",calculatingProjects:"Calculando projetos que você pode iniciar...",noProjectsWithInventory:"Nenhum projeto disponível com seu inventário atual",addMaterialsToStart:"Adicione materiais para ver quais projetos você pode iniciar",completionFromInventory:"Conclusão do seu inventário:",youHaveMaterials:"Você tem materiais:",matchingMaterials:"materiais correspondentes",startThisProject:"Iniciar Este Projeto",calculatingClosest:"Calculando projetos mais próximos...",noMatchingProjects:"Nenhum projeto correspondente encontrado",addMaterialsToContribute:"Adicione materiais ao inventário para ver projetos para contribuir",youCanProvide:"Você pode fornecer:",unitsNeeded:"unidades necessárias",viewProjectContribute:"Ver Projeto e Contribuir",newShipProject:"Iniciar novo projeto de nave",newArmorProject:"Iniciar novo projeto de armadura",selectConversation:"Selecionar uma conversa",chooseDMDesc:"Escolha um DM, canal de organização ou tópico de projeto para começar",allMessages:"Tudo",dmsLabel:"MDs",orgsLabel:"Orgs",projectsTabLabel:"Projetos",newDirectMessage:"Nova Mensagem Direta",searchConversations:"Pesquisar conversas...",directMessagesLabel:"MENSAGENS DIRETAS",organizationChannels:"CANAIS DE ORGANIZAÇÃO",projectThreadsLabel:"TÓPICOS DE PROJETO",noMessagesYet:"Nenhuma mensagem ainda",unknownOwner:"Proprietário desconhecido",messageDeleted:"Mensagem excluída",edited:"editado",adminLabel:"Admin",typeMessagePlaceholder:"Digite uma mensagem... (Enter para enviar, Shift+Enter para nova linha)",supportsMarkdown:"Suporta formatação Markdown",materialReputationValues:"Valores de Reputação de Materiais",legendaryLabel:"Lendário",epicLabel:"Épico",rareLabel:"Raro",commonLabel:"Comum",updateBannerTitle:"Atualização 4.8 chegando ao Wikelo-Projects!",updateBannerText:"Alguns requisitos de fabricação de naves e itens podem mudar.",updateBannerLink:"Mais informações",updateInfoTitle:"Atualização 4.8 — O que está mudando",updateInfoP1:"Como muitos de vocês sabem, Star Citizen passou recentemente por um wipe juntamente com uma série de grandes mudanças no gameplay. Atualmente estou trabalhando para atualizar o site para refletir as últimas mudanças do Wikelo e outras atualizações introduzidas com o patch 4.8.",updateInfoP2:"Sei que estou um pouco atrasado em colocar essas atualizações no ar, e quero me desculpar sinceramente pelo atraso. Agradeço a paciência de todos enquanto trabalho nas mudanças e melhoro o site.",updateInfoP3:"Além das atualizações atuais, também estou desenvolvendo ferramentas para extrair informações diretamente dos arquivos do jogo. O objetivo é ter o conteúdo atualizado muito mais rapidamente no futuro — idealmente até mesmo antes de novos patches serem lançados oficialmente.",updateInfoP4:"À medida que continuamos avançando, também quero que esta incrível comunidade saiba o quanto valorizo o feedback de vocês. Suas sugestões, relatórios de bugs e ideias genuinamente ajudam a melhorar o site, e sou muito grato por todo o suporte que vocês têm dado ao longo do caminho. Obrigado!"},uk:{appTitle:"Трекер Проектів Wikelo",allShips:"Всі Кораблі",organizations:"Організації",notifications:"Сповіщення",profile:"Налаштування Профілю",signOut:"Вийти",trackMaterials:"Відстежуйте матеріали, співпрацюйте з громадянами та будуйте свій корабель Wikelo",startNewProject:"Розпочати Новий Проект",searchShips:"Шукати кораблі...",all:"Всі",myProjects:"Мої Проекти",orgProjects:"Проекти Організації",inProgress:"У Процесі",completed:"Завершено",noProjectsFound:"Проектів не знайдено",beFirst:"Будьте першим, хто розпочне проект будівництва корабля!",createProject:"Створити Проект",backToProjects:"Повернутися до Проектів",createdBy:"Створено",organization:"Організація",homePort:"Домашній Порт",markComplete:"Позначити як Завершене",startBuilding:"Почати Будівництво",edit:"Редагувати",linkToOrg:"Пов'язати з Організацією",overallProgress:"Загальний Прогрес",materials:"Матеріали",contributions:"Внески",contributors:"Учасники",chat:"Чат",activity:"Активність",contribute:"Внести",profileAvatar:"Аватар Профілю",uploadAvatar:"Завантажити Аватар",displayName:"Ім'я Star Citizen / Відображуване Ім'я",email:"Електронна Пошта",fullName:"Повне Ім'я",saveChanges:"Зберегти Зміни",language:"Мова",selectLanguage:"Виберіть бажану мову",markAllRead:"Позначити все як прочитане",unread:"непрочитано",noNotifications:"Поки що немає сповіщень",notificationsDesc:"Ви побачите сповіщення тут, коли люди надсилатимуть повідомлення до ваших проектів",sentMessage:"надіслав повідомлення",madeContribution:"зробив внесок",browseOrganizations:"Переглянути Організації",createOrganization:"Створити Організацію",searchOrgs:"Шукати організації...",members:"Члени",projects:"Проекти",requestToJoin:"Запит на Приєднання",cancel:"Скасувати",delete:"Видалити",save:"Зберегти",loading:"Завантаження...",submit:"Надіслати",viewDetails:"Переглянути Деталі",progress:"Прогрес",requiredMaterials:"Необхідні Матеріали",recentContributions:"Останні Внески",discussWithTeam:"Обговоріть зі своєю командою",projectActivity:"Активність Проекту",deleteProject:"Видалити Проект?",deleteProjectDesc:"Це назавжди видалить цей проект та всі його внески.",projectNotFound:"Проект не знайдено",shipsAndMaterials:"Кораблі та Матеріали Wikelo",armorsAndMaterials:"Броня та Матеріали Wikelo",browseShipsDesc:"Перегляньте всі доступні кораблі та необхідні матеріали",browseArmorsDesc:"Перегляньте всю доступну броню та необхідні матеріали",searchArmors:"Шукати броню...",startProject:"Розпочати Проект",noMaterialsData:"Немає даних про матеріали",noShipsFound:"Не знайдено кораблів, що відповідають",noArmorsFound:"Не знайдено броні, що відповідає",backToArmors:"Повернутися до Броні",projectCreatedSuccess:"Проект успішно створено!",armorProjectCreatedSuccess:"Проект броні успішно створено!",guideTitle:"Довідка Сайту",guideSubtitle:"Дізнайтеся, як використовувати Трекер Проектів Wikelo для співпраці та будівництва кораблів",gettingStarted:"Початок Роботи з Проектами",creatingProject:"Створення Проекту",managingProject:"Керування Вашим Проектом",contributingMaterials:"Внесення Матеріалів",howToContribute:"Як Внести Вклад",contributionStatus:"Статус Внеску",joiningCreatingOrgs:"Приєднання та Створення Організацій",organizationBenefits:"Переваги Організації",communicationCollaboration:"Спілкування та Співпраця",projectChat:"Чат Проекту",notificationsSection:"Сповіщення",reputationSystem:"Система Репутації",earningReputation:"Заробіток Репутації",reputationBenefits:"Переваги Репутації",tipsBestPractices:"Поради та Найкращі Практики",guideStep1_1:"Натисніть кнопку 'Розпочати Новий Проект' на головній сторінці",guideStep1_2:"Виберіть корабель зі списку кораблів Wikelo або оберіть 'Власний'",guideStep1_3:"Додайте опис та вкажіть свій домашній порт",guideStep1_4:"Перегляньте необхідні матеріали",guideStep1_5:"Надішліть для створення вашого проекту",guideStep2_1:"Редагуйте деталі проекту за допомогою кнопки Редагувати",guideStep2_2:"Оновлюйте кількість матеріалів у міру збору ресурсів",guideStep2_3:"Позначайте внески як 'Доставлено', коли отримуєте матеріали",guideStep2_4:"Змінюйте статус проекту з Планування → У Процесі → Завершено",guideStep2_5:"Пов'яжіть свій проект з організацією, якщо ви адміністратор",guideStep3_1:"Переглядайте проекти на головній сторінці або відвідайте конкретний проект",guideStep3_2:"Натисніть кнопку 'Внести' на проекті з необхідними матеріалами",guideStep3_3:"Виберіть один або кілька матеріалів, які ви можете надати",guideStep3_4:"Введіть кількість для кожного матеріалу",guideStep3_5:"Виберіть спосіб доставки: Забрати або Доставка",guideStep3_6:"Вкажіть місце для координації",guideStep3_7:"За бажанням додайте своє ігрове ім'я",guideStep3_8:"Надішліть - кожен матеріал стає окремим внеском",guideStep4_1:"Очікує: Чекаємо, поки власник проекту прийме та зберіть",guideStep4_2:"Доставлено: Власник підтвердив отримання ваших матеріалів",guideStep4_3:"Кожен матеріал має значення в очках",guideStep4_4:"Будуйте свою репутацію, роблячи успішні внески",guideStep5_1:"Переглядайте організації на сторінці Організації",guideStep5_2:"Натисніть 'Запит на Приєднання', щоб приєднатися до існуючої організації",guideStep5_3:"Створіть власну організацію з унікальним тегом/абревіатурою",guideStep5_4:"Організації можуть мати кількох адміністраторів та членів",guideStep5_5:"Члени-адміністратори можуть пов'язувати проекти з організацією",guideStep6_1:"Відфільтруйте головну сторінку, щоб побачити лише проекти вашої організації",guideStep6_2:"Проекти показують значки тегів організації",guideStep6_3:"Координуйте зусилля з членами вашої організації",guideStep6_4:"Відстежуйте всі проекти організації зі сторінки деталей організації",guideStep7_1:"Кожен проект має виділену вкладку чату",guideStep7_2:"Обговорюйте плани, координуйте забір та ставте питання",guideStep7_3:"Всі учасники проекту можуть бачити повідомлення чату",guideStep7_4:"Ви отримаєте сповіщення про нові повідомлення",guideStep8_1:"Отримуйте сповіщення про повідомлення чату у ваших проектах",guideStep8_2:"Отримуйте сповіщення, коли внески приймаються",guideStep8_3:"Фільтруйте сповіщення за типом: Чат або Внески",guideStep8_4:"Натисніть на сповіщення, щоб перейти безпосередньо до проекту",guideStep8_5:"Позначайте сповіщення як прочитані окремо або всі одразу",guideStep9_1:"Вносьте матеріали до проектів",guideStep9_2:"Зачекайте, поки власник проекту позначить ваш внесок як 'Доставлено'",guideStep9_3:"Заробляйте очки на основі вартості матеріалу",guideStep9_4:"Ваша репутація відображається у вашому профілі та внесках",guideStep10_1:"Вища репутація будує довіру в спільноті",guideStep10_2:"Видима для інших, коли ви робите внески",guideStep10_3:"Показує ваш послужний список надійних доставок",guideStep10_4:"Допомагає власникам проектів вирішити, які внески прийняти",guideTip1:"Встановіть свій домашній порт за замовчуванням у налаштуваннях Профілю",guideTip2:"Використовуйте сторінку Кораблі для перегляду всіх доступних кораблів Wikelo",guideTip3:"Перевіряйте вкладку Активність у проектах, щоб побачити всі останні оновлення",guideTip4:"Індикатори присутності показують, хто зараз переглядає проект у реальному часі",leaderboard:"Рейтинг",topByReputation:"Топ за Репутацією",topContributors:"Кращі Учасники",reputationLeaders:"Лідери Репутації",noUsersWithReputation:"Ще немає користувачів з репутацією",reputationLabel:"репутація",topMaterialContributors:"Кращі Учасники з Матеріалами",noContributionsYet:"Ще немає внесків",contributionsCount:"внески",projectsCount:"проекти",anonymous:"Анонім",starCitizenNameRequired:"Потрібне Ім'я Star Citizen",starCitizenNameRequiredDesc:"Будь ласка, встановіть своє ім'я Star Citizen, щоб продовжити використання додатку",reputationPoints:"Очки Репутації",pointsLabel:"очки",starCitizenNameDisplay:"Ім'я Star Citizen / Відображуване Ім'я",nameVisibleDesc:"Ім'я, яке інші користувачі побачать на платформі",starCitizenName:"Ім'я Star Citizen",yourStarCitizenName:"Ваше ім'я Star Citizen",fieldRequired:"⚠️ Це поле є обов'язковим",defaultHomePort:"Домашній Порт за Замовчуванням",homePortPlaceholder:"напр., Порт Олізар, Лорвіль, Район 18...",achievements:"Досягнення",badgesEarned:"Значки, зароблені завдяки вашим внескам",noBadgesYet:"Ще немає значків. Почніть вносити вклад, щоб заробляти досягнення!",manageOrgMemberships:"Керуйте своїм членством в організаціях",notInAnyOrg:"Ви ще не є членом жодної організації",defaultOrg:"Організація за Замовчуванням",selectDefaultOrg:"Вибрати організацію за замовчуванням",manageOrganizations:"Управління Організаціями",notificationSettings:"Налаштування Сповіщень",manageNotifications:"Керуйте тим, як ви отримуєте сповіщення",materialInventory:"Склад Матеріалів",trackMaterialsDesc:"Відстежуйте свої матеріали та знаходьте проекти для внеску",addMaterial:"Додати Матеріал",addMaterialToInventory:"Додати Матеріал до Складу",materialLabel:"Матеріал",selectMaterial:"Оберіть матеріал...",quantityLabel:"Кількість",addToInventory:"Додати до Складу",myInventory:"Мій Склад",projectsToStart:"Проекти для Запуску",closestContribution:"Найближчий Внесок",totalMaterialsCount:"Всього Матеріалів",loadingInventory:"Завантаження складу...",inventoryEmpty:"Ваш склад порожній",addFirstMaterial:"Додайте Свій Перший Матеріал",calculatingProjects:"Розрахунок проектів, які ви можете запустити...",noProjectsWithInventory:"Немає доступних проектів з вашим поточним складом",addMaterialsToStart:"Додайте матеріали, щоб побачити, які проекти ви можете запустити",completionFromInventory:"Завершення з вашого складу:",youHaveMaterials:"У вас є матеріали:",matchingMaterials:"відповідних матеріалів",startThisProject:"Запустити Цей Проект",calculatingClosest:"Розрахунок найближчих проектів...",noMatchingProjects:"Відповідних проектів не знайдено",addMaterialsToContribute:"Додайте матеріали до складу, щоб побачити проекти для внеску",youCanProvide:"Ви можете надати:",unitsNeeded:"необхідних одиниць",viewProjectContribute:"Переглянути Проект та Внести Вклад",newShipProject:"Запустити новий проект корабля",newArmorProject:"Запустити новий проект броні",selectConversation:"Вибрати розмову",chooseDMDesc:"Оберіть ДП, канал організації або гілку проекту, щоб почати спілкування",allMessages:"Всі",dmsLabel:"ДП",orgsLabel:"Орги",projectsTabLabel:"Проекти",newDirectMessage:"Нове Пряме Повідомлення",searchConversations:"Шукати розмови...",directMessagesLabel:"ПРЯМІ ПОВІДОМЛЕННЯ",organizationChannels:"КАНАЛИ ОРГАНІЗАЦІЙ",projectThreadsLabel:"ГІЛКИ ПРОЕКТІВ",noMessagesYet:"Ще немає повідомлень",unknownOwner:"Невідомий власник",messageDeleted:"Повідомлення видалено",edited:"відредаговано",adminLabel:"Адмін",typeMessagePlaceholder:"Введіть повідомлення... (Enter для надсилання, Shift+Enter для нового рядка)",supportsMarkdown:"Підтримує форматування Markdown",materialReputationValues:"Значення Репутації Матеріалів",legendaryLabel:"Легендарний",epicLabel:"Епічний",rareLabel:"Рідкісний",commonLabel:"Звичайний",updateBannerTitle:"Оновлення 4.8 наближається до Wikelo-Projects!",updateBannerText:"Деякі вимоги до виготовлення кораблів та предметів можуть змінитися.",updateBannerLink:"Детальніше",updateInfoTitle:"Оновлення 4.8 — Що змінюється",updateInfoP1:"Як багато хто з вас знає, Star Citizen нещодавно пройшов через вайп разом із низкою важливих змін геймплею. Зараз я працюю над оновленням сайту, щоб відобразити останні зміни Wikelo та інші оновлення, введені з патчем 4.8.",updateInfoP2:"Я розумію, що трохи запізнився з публікацією цих оновлень, і хочу щиро вибачитися за затримку. Я ціную терпіння всіх, поки я працюю над змінами та покращую сайт.",updateInfoP3:"Окрім поточних оновлень, я також розробляю інструменти для видобутку даних безпосередньо з файлів гри. Мета — оновлювати контент набагато швидше в майбутньому — в ідеалі навіть до офіційного виходу нових патчів.",updateInfoP4:"Продовжуючи рухатися вперед, я також хочу, щоб ця дивовижна спільнота знала, наскільки я ціную ваші відгуки. Ваші пропозиції, звіти про помилки та ідеї справді допомагають покращити сайт, і я щиро вдячний за всю підтримку, яку ви надавали. Дякую!"}},N7={en:"English",es:"Español",fr:"Français",de:"Deutsch",zh:"中文",ja:"日本語",pt:"Português",uk:"Українська"},C7={en:"🇬🇧",es:"🇪🇸",fr:"🇫🇷",de:"🇩🇪",zh:"🇨🇳",ja:"🇯🇵",pt:"🇵🇹",uk:"🇺🇦"},OA=v.createContext(),gn=()=>{const e=v.useContext(OA);if(!e)throw new Error("useLanguage must be used within a LanguageProvider");return e},k7=({children:e})=>{const{data:t}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),[n,r]=v.useState("en");v.useEffect(()=>{t!=null&&t.language&&r(t.language)},[t]);const i=l=>{var u;return((u=Tg[n])==null?void 0:u[l])||Tg.en[l]||l},o=async l=>{r(l),t&&await O.auth.updateMe({language:l})};return a.jsx(OA.Provider,{value:{language:n,changeLanguage:o,t:i,languageNames:N7,languageFlags:C7,availableLanguages:Object.keys(Tg)},children:e})};function ov({projectId:e,currentUser:t}){const{t:n}=gn(),[r,i]=v.useState(""),[o,l]=v.useState(!1),u=v.useRef(null),d=Bt(),f=v.useRef(null),h=v.useRef(0),{data:p=[]}=me({queryKey:["project-messages",e],queryFn:()=>O.entities.ProjectMessage.filter({project_id:e},"-created_date",100),refetchInterval:2e3});v.useEffect(()=>{if(p.length>h.current&&h.current>0){const C=p[0];C.user_email!==(t==null?void 0:t.email)&&Yn.info(`${C.user_name}: ${C.message}`,{duration:4e3})}h.current=p.length},[p,t]);const{data:g}=me({queryKey:["project",e],queryFn:()=>O.entities.ShipProject.filter({id:e}),select:C=>C[0],enabled:!!e}),x=Ae({mutationFn:async C=>{const k=await O.integrations.Core.InvokeLLM({prompt:`Analyze this message for inappropriate content (hate speech, harassment, spam, explicit content). Message: "${C.message}". Reply with "safe" if appropriate, or "unsafe: [reason]" if inappropriate.`,response_json_schema:{type:"object",properties:{status:{type:"string",enum:["safe","unsafe"]},reason:{type:"string"}}}});if(k.status==="unsafe")throw new Error(k.reason);const P=C.message.match(/@(\w+)/g)||[],T=[];if(P.length>0){const R=await O.entities.User.list();for(const q of P){const J=q.substring(1),ae=R.find(re=>re.alias&&re.alias.toLowerCase()===J.toLowerCase()||re.full_name&&re.full_name.toLowerCase()===J.toLowerCase());ae&&T.push(ae)}}const S=await O.entities.ProjectMessage.create(C),z=(await O.entities.ProjectPresence.filter({project_id:e})).filter(R=>{const q=new Date(R.last_seen);return new Date-q<3e4}).map(R=>R.user_email),K=[...new Set(p.map(R=>R.user_email))].filter(R=>R!==(t==null?void 0:t.email)&&!z.includes(R)),W=(await O.entities.UserNotificationPreferences.list()).reduce((R,q)=>(R[q.user_email]=q,R),{}),G=async()=>{try{if(g!=null&&g.org_tag){const q=(await O.entities.Organization.list()).find(J=>J.tag===g.org_tag);q!=null&&q.discord_notifications_enabled&&(q!=null&&q.discord_notify_on_chat)&&(q!=null&&q.discord_webhook_url)&&await fetch(q.discord_webhook_url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({embeds:[{title:"💬 New message in project",description:C.message,color:440020,fields:[{name:"From",value:t.alias||t.full_name,inline:!0},{name:"Project",value:(g==null?void 0:g.ship_name)||"Project",inline:!0},{name:"Organization",value:g.org_tag,inline:!0}],timestamp:new Date().toISOString()}]})})}}catch(R){console.error("Failed to send Discord notification:",R)}};for(const R of T){if(R.email===(t==null?void 0:t.email))continue;const q=W[R.email];if(!(!q||!q.notify_on_mention)){if(await O.entities.UserNotification.create({user_email:R.email,project_id:e,message_id:S.id,sender_email:t.email,sender_name:t.alias||t.full_name,message_preview:`mentioned you: ${C.message.substring(0,100)}`,notification_type:"chat",is_read:!1}),q.email_notifications_enabled)try{await O.integrations.Core.SendEmail({to:R.email,subject:`You were mentioned in ${(g==null?void 0:g.ship_name)||"a project"}`,body:`${t.alias||t.full_name} mentioned you in ${g==null?void 0:g.ship_name}:
|
||
|
||
"${C.message}"
|
||
|
||
View project: https://app.base44.com/your-app`})}catch(J){console.error("Failed to send email:",J)}if(q.discord_notifications_enabled&&q.discord_webhook_url)try{await fetch(q.discord_webhook_url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({embeds:[{title:"💬 You were mentioned!",description:C.message,color:440020,fields:[{name:"From",value:t.alias||t.full_name,inline:!0},{name:"Project",value:(g==null?void 0:g.ship_name)||"Project",inline:!0}],timestamp:new Date().toISOString()}]})})}catch(J){console.error("Failed to send Discord notification:",J)}}}for(const R of K){const q=W[R];if(!(!q||!q.notify_on_chat_message)&&(await O.entities.UserNotification.create({user_email:R,project_id:e,message_id:S.id,sender_email:t.email,sender_name:t.alias||t.full_name,message_preview:C.message.substring(0,100),notification_type:"chat",is_read:!1}),q.email_notifications_enabled))try{await O.integrations.Core.SendEmail({to:R,subject:`New message in ${(g==null?void 0:g.ship_name)||"project"}`,body:`${t.alias||t.full_name} sent a message in ${g==null?void 0:g.ship_name}:
|
||
|
||
"${C.message}"`})}catch(J){console.error("Failed to send email:",J)}}if(g&&!K.includes(g.owner_email)&&g.owner_email!==(t==null?void 0:t.email)&&!z.includes(g.owner_email)){const R=W[g.owner_email];if(R&&R.notify_on_chat_message&&(await O.entities.UserNotification.create({user_email:g.owner_email,project_id:e,message_id:S.id,sender_email:t.email,sender_name:t.alias||t.full_name,message_preview:C.message.substring(0,100),notification_type:"chat",is_read:!1}),R.email_notifications_enabled))try{await O.integrations.Core.SendEmail({to:g.owner_email,subject:`New message in ${(g==null?void 0:g.ship_name)||"your project"}`,body:`${t.alias||t.full_name} sent a message in ${g==null?void 0:g.ship_name}:
|
||
|
||
"${C.message}"`})}catch(q){console.error("Failed to send email:",q)}}return await G(),S},onSuccess:()=>{d.invalidateQueries({queryKey:["project-messages",e]}),d.invalidateQueries({queryKey:["notifications"]}),i(""),l(!1),setTimeout(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},100)},onError:C=>{Yn.error(`Message blocked: ${C.message}`)}}),w=C=>{C.preventDefault(),!(!r.trim()||!t)&&x.mutate({project_id:e,user_email:t.email,user_name:t.alias||t.full_name,user_avatar:t.avatar_url,message:r.trim()})},_=C=>{i(C.target.value),l(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{l(!1)},1e3)};v.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[p]);const N=[...p].reverse();return a.jsxs("div",{className:"flex flex-col h-[500px] bg-slate-900/50 rounded-lg border border-slate-700",children:[a.jsxs("div",{className:"p-4 border-b border-slate-700",children:[a.jsx("h3",{className:"text-lg font-semibold text-white",children:n("chat")}),a.jsx("p",{className:"text-sm text-slate-400",children:n("discussWithTeam")})]}),a.jsx(Cl,{className:"flex-1 p-4",ref:u,children:a.jsxs("div",{className:"space-y-4",children:[a.jsx(Cm,{children:N.map(C=>{const k=C.user_email===(t==null?void 0:t.email);return a.jsxs(bt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0},className:`flex gap-3 ${k?"flex-row-reverse":""}`,children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-cyan-500 to-purple-500 flex items-center justify-center flex-shrink-0 overflow-hidden",children:C.user_avatar?a.jsx("img",{src:C.user_avatar,alt:"",className:"w-full h-full object-cover"}):a.jsx("span",{className:"text-white text-sm font-medium",children:(C.user_name||"A")[0].toUpperCase()})}),a.jsxs("div",{className:`flex-1 max-w-[70%] ${k?"items-end":"items-start"}`,children:[a.jsxs("div",{className:`flex items-baseline gap-2 mb-1 ${k?"flex-row-reverse":""}`,children:[k?a.jsx("span",{className:"text-sm font-medium text-slate-300",children:C.user_name||"Anonymous"}):a.jsx($x,{userEmail:C.user_email,userName:C.user_name,userAvatar:C.user_avatar,children:a.jsx("span",{className:"text-sm font-medium text-slate-300 hover:text-cyan-400 cursor-pointer transition-colors",children:C.user_name||"Anonymous"})}),a.jsx("span",{className:"text-xs text-slate-500",children:QT(new Date(C.created_date),"HH:mm")})]}),a.jsx("div",{className:`rounded-lg px-4 py-2 ${k?"bg-cyan-600 text-white":"bg-slate-800 text-slate-200"}`,children:a.jsx("p",{className:"text-sm break-words",children:C.message})})]})]},C.id)})}),N.length===0&&a.jsx("div",{className:"text-center py-8",children:a.jsx("p",{className:"text-slate-500 text-sm",children:"No messages yet. Start the conversation!"})})]})}),a.jsx("form",{onSubmit:w,className:"p-4 border-t border-slate-700",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx(dt,{value:r,onChange:_,placeholder:"Type a message...",className:"bg-slate-800 border-slate-700 text-white placeholder:text-slate-500",disabled:x.isPending}),a.jsx(oe,{type:"submit",disabled:!r.trim()||x.isPending,className:"bg-cyan-500 hover:bg-cyan-600",children:x.isPending?a.jsx(tt,{className:"w-4 h-4 animate-spin"}):a.jsx(fm,{className:"w-4 h-4"})})]})})]})}const P7={material_update:Sc,contribution:Nt,status_change:Or,project_update:nI},E7={material_update:"text-blue-400",contribution:"text-green-400",status_change:"text-purple-400",project_update:"text-cyan-400"};function lv({projectId:e}){const{t}=gn(),{data:n=[]}=me({queryKey:["project-activity",e],queryFn:()=>O.entities.ProjectActivity.filter({project_id:e},"-created_date",50),refetchInterval:3e3});return a.jsxs("div",{className:"bg-slate-900/50 rounded-lg border border-slate-700",children:[a.jsxs("div",{className:"p-4 border-b border-slate-700",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Fo,{className:"w-5 h-5 text-cyan-400"}),a.jsx("h3",{className:"text-lg font-semibold text-white",children:t("projectActivity")})]}),a.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Live updates from your team"})]}),a.jsx(Cl,{className:"h-[500px]",children:a.jsxs("div",{className:"p-4 space-y-3",children:[a.jsx(Cm,{children:n.map((r,i)=>{const o=P7[r.action_type]||Fo,l=E7[r.action_type]||"text-slate-400";return a.jsxs(bt.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{delay:i*.05},className:"flex gap-3 p-3 bg-slate-800/50 rounded-lg hover:bg-slate-800 transition-colors",children:[a.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 ${r.action_type==="contribution"?"bg-green-500/20":r.action_type==="material_update"?"bg-blue-500/20":r.action_type==="status_change"?"bg-purple-500/20":"bg-cyan-500/20"}`,children:a.jsx(o,{className:`w-5 h-5 ${l}`})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-6 h-6 rounded-full bg-gradient-to-br from-cyan-500 to-purple-500 flex items-center justify-center overflow-hidden",children:r.user_avatar?a.jsx("img",{src:r.user_avatar,alt:"",className:"w-full h-full object-cover"}):a.jsx("span",{className:"text-white text-xs font-medium",children:(r.user_name||"A")[0].toUpperCase()})}),a.jsx($x,{userEmail:r.user_email,userName:r.user_name,userAvatar:r.user_avatar,children:a.jsx("span",{className:"text-sm font-medium text-slate-300 hover:text-cyan-400 cursor-pointer transition-colors",children:r.user_name||"Anonymous"})})]}),a.jsx("span",{className:"text-xs text-slate-500 flex-shrink-0",children:Um(new Date(r.created_date),{addSuffix:!0})})]}),a.jsx("p",{className:"text-sm text-slate-400 mt-1",children:r.description})]})]},r.id)})}),n.length===0&&a.jsxs("div",{className:"text-center py-8",children:[a.jsx(Fo,{className:"w-12 h-12 text-slate-600 mx-auto mb-3"}),a.jsx("p",{className:"text-slate-500 text-sm",children:"No activity yet"}),a.jsx("p",{className:"text-slate-600 text-xs mt-1",children:"Actions will appear here in real-time"})]})]})})]})}var IA="AlertDialog",[T7]=vr(IA,[XT]),Zi=XT(),DA=e=>{const{__scopeAlertDialog:t,...n}=e,r=Zi(t);return a.jsx(mA,{...r,...n,modal:!0})};DA.displayName=IA;var A7="AlertDialogTrigger",M7=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Zi(n);return a.jsx(hA,{...i,...r,ref:t})});M7.displayName=A7;var R7="AlertDialogPortal",LA=e=>{const{__scopeAlertDialog:t,...n}=e,r=Zi(t);return a.jsx(pA,{...r,...n})};LA.displayName=R7;var O7="AlertDialogOverlay",qA=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Zi(n);return a.jsx(Gx,{...i,...r,ref:t})});qA.displayName=O7;var Vo="AlertDialogContent",[I7,D7]=T7(Vo),L7=mk("AlertDialogContent"),FA=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=Zi(n),l=v.useRef(null),u=ct(t,l),d=v.useRef(null);return a.jsx(YW,{contentName:Vo,titleName:zA,docsSlug:"alert-dialog",children:a.jsx(I7,{scope:n,cancelRef:d,children:a.jsxs(Qx,{role:"alertdialog",...o,...i,ref:u,onOpenAutoFocus:Ce(i.onOpenAutoFocus,f=>{var h;f.preventDefault(),(h=d.current)==null||h.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[a.jsx(L7,{children:r}),a.jsx(F7,{contentRef:l})]})})})});FA.displayName=Vo;var zA="AlertDialogTitle",BA=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Zi(n);return a.jsx(Yx,{...i,...r,ref:t})});BA.displayName=zA;var VA="AlertDialogDescription",$A=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Zi(n);return a.jsx(Xx,{...i,...r,ref:t})});$A.displayName=VA;var q7="AlertDialogAction",UA=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Zi(n);return a.jsx(Jx,{...i,...r,ref:t})});UA.displayName=q7;var WA="AlertDialogCancel",HA=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=D7(WA,n),o=Zi(n),l=ct(t,i);return a.jsx(Jx,{...o,...r,ref:l})});HA.displayName=WA;var F7=({contentRef:e})=>{const t=`\`${Vo}\` requires a description for the component to be accessible for screen reader users.
|
||
|
||
You can add a description to the \`${Vo}\` by passing a \`${VA}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
||
|
||
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Vo}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
||
|
||
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},z7=DA,B7=LA,KA=qA,GA=FA,QA=UA,YA=HA,XA=BA,JA=$A;const $o=z7,V7=B7,ZA=v.forwardRef(({className:e,...t},n)=>a.jsx(KA,{className:Fe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));ZA.displayName=KA.displayName;const Ms=v.forwardRef(({className:e,...t},n)=>a.jsxs(V7,{children:[a.jsx(ZA,{}),a.jsx(GA,{ref:n,className:Fe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Ms.displayName=GA.displayName;const Rs=({className:e,...t})=>a.jsx("div",{className:Fe("flex flex-col space-y-2 text-center sm:text-left",e),...t});Rs.displayName="AlertDialogHeader";const Os=({className:e,...t})=>a.jsx("div",{className:Fe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Os.displayName="AlertDialogFooter";const Is=v.forwardRef(({className:e,...t},n)=>a.jsx(XA,{ref:n,className:Fe("text-lg font-semibold",e),...t}));Is.displayName=XA.displayName;const Ds=v.forwardRef(({className:e,...t},n)=>a.jsx(JA,{ref:n,className:Fe("text-sm text-muted-foreground",e),...t}));Ds.displayName=JA.displayName;const Ls=v.forwardRef(({className:e,...t},n)=>a.jsx(QA,{ref:n,className:Fe(q0(),e),...t}));Ls.displayName=QA.displayName;const qs=v.forwardRef(({className:e,...t},n)=>a.jsx(YA,{ref:n,className:Fe(q0({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));qs.displayName=YA.displayName;const $7={planning:"bg-amber-500/20 text-amber-400 border-amber-500/30",in_progress:"bg-cyan-500/20 text-cyan-400 border-cyan-500/30",completed:"bg-emerald-500/20 text-emerald-400 border-emerald-500/30"};function U7(){var be,ce,Pe,Mt,Rt;const{t:e}=gn(),t=new URLSearchParams(window.location.search),n=t.get("id"),r=t.get("tab")||"materials",[i,o]=v.useState(!1),[l,u]=v.useState(!1),[d,f]=v.useState(!1),[h,p]=v.useState(!1),[g,x]=v.useState(null),[w,_]=v.useState(!1),[N,C]=v.useState(null),[k,P]=v.useState(null),T=Bt(),{data:S}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),{data:E,isLoading:z}=me({queryKey:["armorProject",n],queryFn:()=>O.entities.ArmorProject.filter({id:n}),select:pe=>pe[0],enabled:!!n,refetchInterval:3e3}),{data:D=[],isLoading:K}=me({queryKey:["armorContributions",n],queryFn:()=>O.entities.Contribution.filter({project_id:n},"-created_date"),enabled:!!n,refetchInterval:3e3}),{data:U={}}=me({queryKey:["armor-contributor-reputation",n],queryFn:async()=>{const pe=[...new Set(D.map(rt=>rt.contributor_email).filter(Boolean))];return(await Promise.all(pe.map(rt=>O.entities.User.filter({email:rt})))).reduce((rt,te,xe)=>(te[0]&&(rt[pe[xe]]=te[0].reputation||0),rt),{})},enabled:D.length>0,refetchInterval:3e3}),{data:W=[]}=me({queryKey:["my-memberships",S==null?void 0:S.email],queryFn:()=>O.entities.OrganizationMember.filter({user_email:S==null?void 0:S.email,status:"active",role:"admin"}),enabled:!!(S!=null&&S.email)}),{data:G=[]}=me({queryKey:["my-admin-orgs",W],queryFn:async()=>{if(W.length===0)return[];const pe=W.map(rt=>rt.org_id);return(await Promise.all(pe.map(rt=>O.entities.Organization.filter({id:rt})))).flat()},enabled:W.length>0}),{data:R}=me({queryKey:["armor-project-org",E==null?void 0:E.org_tag],queryFn:async()=>(await O.entities.Organization.filter({tag:E.org_tag}))[0],enabled:!!(E!=null&&E.org_tag)}),q=Ae({mutationFn:async pe=>(await O.functions.invoke("getUEXListings",{materialName:pe})).data}),J=pe=>{C(pe),_(!0),q.mutate(pe)},ae=Ae({mutationFn:async({material_name:pe,change:Ye})=>{const rt=E.required_materials.map(te=>{if(te.material_name===pe){const xe=Math.max(0,Math.min((te.quantity_collected||0)+Ye,te.quantity_needed));return{...te,quantity_collected:xe}}return te});await O.entities.ArmorProject.update(n,{required_materials:rt}),await O.entities.ProjectActivity.create({project_id:n,user_email:S==null?void 0:S.email,user_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),user_avatar:S==null?void 0:S.avatar_url,action_type:"material_update",description:`Updated ${pe}: ${Ye>0?"+":""}${Ye}`,metadata:{material_name:pe,change:Ye}})},onSuccess:()=>{T.invalidateQueries({queryKey:["armorProject",n]}),T.invalidateQueries({queryKey:["project-activity",n]})}}),re=Ae({mutationFn:async({material_name:pe,quantity:Ye,in_game_name:rt,delivery_type:te,location:xe})=>{const Je=await O.entities.Contribution.filter({contributor_email:S==null?void 0:S.email}),We=await O.entities.Contribution.create({project_id:n,contributor_email:S==null?void 0:S.email,contributor_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),contributor_avatar:S==null?void 0:S.avatar_url,contributor_reputation:(S==null?void 0:S.reputation)||0,material_name:pe,quantity:Ye,in_game_name:rt,delivery_type:te,location:xe});if(Je.length===0&&(await O.entities.UserBadge.filter({user_email:S==null?void 0:S.email,badge_type:"first_contribution"})).length===0&&await O.entities.UserBadge.create({user_email:S==null?void 0:S.email,badge_type:"first_contribution",badge_name:"First Steps",badge_description:"Made your first contribution to a project",earned_at:new Date().toISOString()}),await O.entities.ProjectActivity.create({project_id:n,user_email:S==null?void 0:S.email,user_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),user_avatar:S==null?void 0:S.avatar_url,action_type:"contribution",description:`Contributed ${Ye}x ${pe}`,metadata:{material_name:pe,quantity:Ye}}),E.owner_email!==(S==null?void 0:S.email)){const gt=(await O.entities.UserNotificationPreferences.filter({user_email:E.owner_email}))[0];(!gt||gt.notify_on_contribution)&&await O.entities.UserNotification.create({user_email:E.owner_email,project_id:n,message_id:We.id,sender_email:S==null?void 0:S.email,sender_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),message_preview:`Contributed ${Ye}x ${pe}`,notification_type:"contribution",is_read:!1})}},onSuccess:()=>{T.invalidateQueries({queryKey:["armorProject",n]}),T.invalidateQueries({queryKey:["armorContributions",n]}),T.invalidateQueries({queryKey:["project-activity",n]}),T.invalidateQueries({queryKey:["notifications"]}),o(!1)}}),L=Ae({mutationFn:async pe=>{if(await O.entities.ArmorProject.update(n,{status:pe}),await O.entities.ProjectActivity.create({project_id:n,user_email:S==null?void 0:S.email,user_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),user_avatar:S==null?void 0:S.avatar_url,action_type:"status_change",description:`Changed project status to ${pe.replace("_"," ")}`,metadata:{status:pe}}),pe==="completed"&&(S!=null&&S.email)){const Ye=Ka(E.armor_name);if(Ye&&Ye.reputation_reward>0){const rt=await O.entities.User.filter({email:S.email});if(rt.length>0){const te=rt[0],xe=(te.wikelo_reputation||0)+Ye.reputation_reward;await O.entities.User.update(te.id,{wikelo_reputation:xe})}}}},onSuccess:()=>{T.invalidateQueries({queryKey:["armorProject",n]}),T.invalidateQueries({queryKey:["armorProjects"]}),T.invalidateQueries({queryKey:["project-activity",n]})}}),Y=Ae({mutationFn:async()=>{for(const pe of D)await O.entities.Contribution.delete(pe.id);await O.entities.ArmorProject.delete(n)},onSuccess:()=>{window.location.href=nt("Armors")}}),M=Ae({mutationFn:async pe=>{await O.entities.ArmorProject.update(n,{org_name:pe.name,org_tag:pe.tag}),await O.entities.ProjectActivity.create({project_id:n,user_email:S==null?void 0:S.email,user_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),user_avatar:S==null?void 0:S.avatar_url,action_type:"project_update",description:`Linked project to organization ${pe.tag}`,metadata:{org_name:pe.name,org_tag:pe.tag}})},onSuccess:()=>{T.invalidateQueries({queryKey:["armorProject",n]}),T.invalidateQueries({queryKey:["armorProjects"]}),T.invalidateQueries({queryKey:["project-activity",n]}),f(!1)}}),B=Ae({mutationFn:async pe=>{await O.entities.ArmorProject.update(n,pe),await O.entities.ProjectActivity.create({project_id:n,user_email:S==null?void 0:S.email,user_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),user_avatar:S==null?void 0:S.avatar_url,action_type:"project_update",description:"Updated project details",metadata:pe})},onSuccess:()=>{T.invalidateQueries({queryKey:["armorProject",n]}),T.invalidateQueries({queryKey:["armorProjects"]}),T.invalidateQueries({queryKey:["project-activity",n]}),p(!1)}}),Z=Ae({mutationFn:async pe=>{const Ye=D.find(rt=>rt.id===pe);if(await O.entities.Contribution.update(pe,{status:"delivered"}),Ye){const rt=E.required_materials.map(te=>te.material_name===Ye.material_name?{...te,quantity_collected:(te.quantity_collected||0)+Ye.quantity}:te);if(await O.entities.ArmorProject.update(n,{required_materials:rt}),Ye.contributor_email){const te=await O.entities.User.filter({email:Ye.contributor_email});if(te.length>0){const xe=te[0],Je=Jf[Ye.material_name]||10,We=Ye.quantity*Je,Ct=(xe.reputation||0)+We;await O.entities.User.update(xe.id,{reputation:Ct})}}}},onSuccess:()=>{T.invalidateQueries({queryKey:["armorContributions",n]}),T.invalidateQueries({queryKey:["armorProject",n]}),T.invalidateQueries({queryKey:["notifications"]})}}),I=Ae({mutationFn:async({contributionId:pe,contribution:Ye})=>{if(await O.entities.Contribution.delete(pe),Ye.status==="delivered"){const rt=E.required_materials.map(te=>te.material_name===Ye.material_name?{...te,quantity_collected:Math.max(0,(te.quantity_collected||0)-Ye.quantity)}:te);await O.entities.ArmorProject.update(n,{required_materials:rt})}},onSuccess:()=>{T.invalidateQueries({queryKey:["armorContributions",n]}),T.invalidateQueries({queryKey:["armorProject",n]})}}),de=Ae({mutationFn:async pe=>{await O.entities.Contribution.update(g.id,{material_name:pe.material_name,quantity:pe.quantity,in_game_name:pe.in_game_name,delivery_type:pe.delivery_type,location:pe.location})},onSuccess:()=>{T.invalidateQueries({queryKey:["armorContributions",n]}),T.invalidateQueries({queryKey:["armorProject",n]}),x(null),o(!1)}});if(z)return a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 flex items-center justify-center",children:a.jsx(tt,{className:"w-8 h-8 text-cyan-400 animate-spin"})});if(!E)return a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 flex items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx(Yr,{className:"w-16 h-16 text-slate-600 mx-auto mb-4"}),a.jsx("h2",{className:"text-xl text-white mb-2",children:e("projectNotFound")}),a.jsx(Ft,{to:nt("Armors"),children:a.jsx(oe,{variant:"outline",className:"border-cyan-500/50 text-cyan-400",children:e("backToArmors")})})]})});const Ne=(S==null?void 0:S.email)===E.owner_email;E.org_tag&&W.some(pe=>pe.org_tag===E.org_tag);const _e=((be=E.required_materials)==null?void 0:be.reduce((pe,Ye)=>pe+(Ye.quantity_needed||0),0))||0,le=((ce=E.required_materials)==null?void 0:ce.reduce((pe,Ye)=>pe+(Ye.quantity_collected||0),0))||0,we=_e>0?Math.round(le/_e*100):0,je=(Pe=E.required_materials)==null?void 0:Pe.some(pe=>pe.quantity_needed-(pe.quantity_collected||0)>0),Se=Ka(E.armor_name),se=(S==null?void 0:S.wikelo_reputation)||0;return a.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950",children:[a.jsxs("div",{className:"relative",children:[E.armor_image&&a.jsx(a.Fragment,{children:a.jsxs("div",{className:"absolute inset-0 h-80",children:[a.jsx("img",{src:E.armor_image,alt:E.armor_name,className:"w-full h-full object-cover opacity-30"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-slate-950/50 to-slate-950"})]})}),a.jsxs("div",{className:"relative max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 pt-8 pb-12",children:[a.jsx(Ft,{to:nt("Armors"),children:a.jsxs(oe,{variant:"ghost",className:"text-slate-400 hover:text-white mb-6",children:[a.jsx(um,{className:"w-4 h-4 mr-2"}),e("backToArmors")]})}),a.jsxs(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-start md:justify-between gap-4 mb-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx(Sn,{className:"w-8 h-8 text-cyan-400"}),a.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-white",children:E.armor_name}),E.org_tag&&a.jsxs(zt,{variant:"outline",className:"border-cyan-500/50 text-cyan-400",children:[a.jsx(Sn,{className:"w-4 h-4 mr-2"}),E.org_tag]})]}),a.jsxs("p",{className:"text-slate-400",children:[e("createdBy")," ",E.owner_name||"Unknown"]}),E.org_name&&a.jsxs("p",{className:"text-slate-500 text-sm",children:[e("organization"),": ",E.org_name]}),E.home_port&&a.jsxs("p",{className:"text-slate-500 text-sm mt-1",children:["📍 ",e("homePort"),": ",E.home_port]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx(sv,{projectId:n,currentUser:S}),a.jsx(zt,{className:`${$7[E.status]} border text-sm px-3 py-1`,children:(Mt=E.status)==null?void 0:Mt.replace("_"," ")}),Ne&&a.jsxs("div",{className:"flex gap-2",children:[E.status==="completed"&&a.jsxs(oe,{onClick:()=>L.mutate("in_progress"),variant:"outline",className:"border-amber-500/50 text-amber-400 hover:bg-amber-500/10",disabled:L.isPending,children:[a.jsx(Yr,{className:"w-4 h-4 mr-2"}),"Revert to In Progress"]}),E.status!=="completed"&&we>=100&&a.jsxs(oe,{onClick:()=>L.mutate("completed"),className:"bg-emerald-500 hover:bg-emerald-600",disabled:L.isPending,children:[a.jsx(Or,{className:"w-4 h-4 mr-2"}),e("markComplete")]}),E.status==="planning"&&a.jsx(oe,{onClick:()=>L.mutate("in_progress"),variant:"outline",className:"border-cyan-500/50 text-cyan-400 hover:bg-cyan-500/10",disabled:L.isPending,children:e("startBuilding")}),a.jsxs(oe,{onClick:()=>p(!0),variant:"outline",className:"border-cyan-500/50 text-cyan-400 hover:bg-cyan-500/10",children:[a.jsx(b0,{className:"w-4 h-4 mr-2"}),e("edit")]}),!E.org_tag&&G.length>0&&a.jsxs(oe,{onClick:()=>f(!0),variant:"outline",className:"border-cyan-500/50 text-cyan-400 hover:bg-cyan-500/10",children:[a.jsx(v0,{className:"w-4 h-4 mr-2"}),e("linkToOrg")]}),a.jsx(oe,{variant:"ghost",size:"icon",onClick:()=>u(!0),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:a.jsx(wi,{className:"w-4 h-4"})})]})]})]}),E.description&&a.jsx("p",{className:"text-slate-300 mb-8 max-w-2xl",children:E.description}),Se&&Se.reputation_required>0&&a.jsx("div",{className:`mb-6 p-4 rounded-lg border ${se>=Se.reputation_required?"bg-emerald-900/30 border-emerald-600/50":"bg-amber-900/30 border-amber-600/50"}`,children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"text-2xl",children:se>=Se.reputation_required?"✅":"⚠️"}),a.jsxs("div",{children:[a.jsx("p",{className:`font-bold ${se>=Se.reputation_required?"text-emerald-300":"text-amber-300"}`,children:Se.reputation_required>=999?"Very Best Customer Required":"Very Good Customer Required"}),a.jsxs("p",{className:"text-sm text-slate-300 mt-1",children:["This mission requires ",a.jsxs("span",{className:"font-semibold text-white",children:[Se.reputation_required,"+ Wikelo reputation"]})," (",Se.reputation_required>=999?"Very Best Customer":"Very Good Customer"," tier) to complete.",se<Se.reputation_required&&a.jsxs("span",{className:"text-amber-400",children:[" You currently have ",se," rep — ",Se.reputation_required-se," more needed."]})]})]})]})}),Se&&Se.reputation_reward>0&&a.jsxs("div",{className:"mb-6 p-3 rounded-lg bg-cyan-900/20 border border-cyan-700/40 flex items-center gap-2",children:[a.jsx("span",{className:"text-yellow-400",children:"⭐"}),a.jsxs("p",{className:"text-sm text-cyan-300",children:["Completing this project awards ",a.jsxs("span",{className:"font-bold text-white",children:["+",Se.reputation_reward," Wikelo reputation"]})]})]}),a.jsx(Be,{className:"bg-slate-900/80 border-slate-700/50 backdrop-blur-sm",children:a.jsx($e,{className:"p-6",children:a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-slate-300 font-medium",children:e("overallProgress")}),a.jsxs("span",{className:"text-2xl font-bold text-cyan-400",children:[we,"%"]})]}),(()=>{const pe=D.filter(rt=>rt.status==="pending").reduce((rt,te)=>rt+(te.quantity||0),0),Ye=_e>0?Math.min(pe/_e*100,100-we):0;return a.jsxs("div",{className:"h-3 bg-slate-800 rounded-full overflow-hidden flex",children:[a.jsx("div",{className:"h-full bg-cyan-400 transition-all duration-500",style:{width:`${we}%`}}),Ye>0&&a.jsx("div",{className:"h-full bg-amber-400/70 transition-all duration-500",style:{width:`${Ye}%`}})]})})()]}),a.jsxs("div",{className:"flex gap-6",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-2xl font-bold text-white",children:((Rt=E.required_materials)==null?void 0:Rt.length)||0}),a.jsx("p",{className:"text-sm text-slate-400",children:e("materials")})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-2xl font-bold text-white",children:D.length}),a.jsx("p",{className:"text-sm text-slate-400",children:e("contributions")})]})]}),a.jsx("div",{className:"flex gap-2",children:je&&!Ne&&a.jsxs(oe,{onClick:()=>S?o(!0):O.auth.redirectToLogin(),className:"bg-cyan-500 hover:bg-cyan-600",children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),S?e("contribute"):"Sign in to Contribute"]})})]})})})]})]})]}),a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pb-16",children:a.jsxs(Qi,{defaultValue:r,className:"w-full",children:[a.jsxs(Si,{className:"bg-slate-800 mb-6",children:[a.jsxs(ht,{value:"materials",className:"data-[state=active]:bg-cyan-500",children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),e("materials")]}),a.jsxs(ht,{value:"contributions",className:"data-[state=active]:bg-cyan-500",children:[a.jsx(gr,{className:"w-4 h-4 mr-2"}),e("contributors")," (",D.length,")"]}),a.jsxs(ht,{value:"chat",className:"data-[state=active]:bg-cyan-500",children:[a.jsx(Gi,{className:"w-4 h-4 mr-2"}),e("chat")]}),a.jsxs(ht,{value:"activity",className:"data-[state=active]:bg-cyan-500",children:[a.jsx(Fo,{className:"w-4 h-4 mr-2"}),e("activity")]})]}),a.jsx(sn,{value:"materials",children:a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsx(vt,{children:a.jsx(wt,{className:"text-white",children:e("requiredMaterials")})}),a.jsx($e,{children:a.jsx(Vx,{materials:E.required_materials,onUpdateQuantity:(pe,Ye)=>ae.mutate({material_name:pe,change:Ye}),isOwner:Ne,onFindOnUEX:J,onMaterialClick:pe=>{o(!0),P(pe)},user:S,pendingContributions:D})})]})}),a.jsx(sn,{value:"contributions",children:a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsx(vt,{children:a.jsx(wt,{className:"text-white",children:e("recentContributions")})}),a.jsx($e,{children:K?a.jsx("div",{className:"flex justify-center py-8",children:a.jsx(tt,{className:"w-6 h-6 text-orange-400 animate-spin"})}):a.jsx(Ux,{contributions:D,contributorReputation:U,isOwner:Ne,currentUserEmail:S==null?void 0:S.email,onMarkDelivered:pe=>Z.mutate(pe),onDelete:(pe,Ye)=>I.mutate({contributionId:pe,contribution:Ye}),onEdit:pe=>{x(pe),o(!0)}})})]})}),a.jsx(sn,{value:"chat",children:a.jsx(ov,{projectId:n,currentUser:S})}),a.jsx(sn,{value:"activity",children:a.jsx(lv,{projectId:n})})]})}),a.jsx(Zx,{open:i,onClose:()=>{o(!1),x(null),P(null)},onSubmit:pe=>g?de.mutate(pe):re.mutate(pe),materials:E.required_materials,isLoading:g?de.isPending:re.isPending,editMode:!!g,contribution:g,projectOwnerId:E.owner_email,preSelectedMaterial:k}),a.jsx(av,{open:d,onClose:()=>f(!1),onSubmit:pe=>M.mutate(pe),organizations:G,isLoading:M.isPending}),a.jsx(y7,{open:h,onClose:()=>p(!1),onSubmit:pe=>B.mutate(pe),project:E,isLoading:B.isPending}),a.jsx(iv,{open:w,onClose:()=>_(!1),materialName:N,listings:q.data,isLoading:q.isPending,error:q.isError?q.error:null}),a.jsx($o,{open:l,onOpenChange:u,children:a.jsxs(Ms,{className:"bg-slate-900 border-slate-700",children:[a.jsxs(Rs,{children:[a.jsx(Is,{className:"text-white",children:e("deleteProject")}),a.jsx(Ds,{className:"text-slate-400",children:e("deleteProjectDesc")})]}),a.jsxs(Os,{children:[a.jsx(qs,{className:"bg-slate-800 border-slate-700 text-white hover:bg-slate-700",children:e("cancel")}),a.jsx(Ls,{onClick:()=>Y.mutate(),className:"bg-red-500 hover:bg-red-600",children:Y.isPending?a.jsx(tt,{className:"w-4 h-4 animate-spin"}):e("delete")})]})]})})]})}function W7({open:e,onClose:t,onSubmit:n,isLoading:r,preselectedArmor:i}){const{data:o}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),{data:l=[]}=me({queryKey:["my-memberships",o==null?void 0:o.email],queryFn:()=>O.entities.OrganizationMember.filter({user_email:o==null?void 0:o.email,status:"active",role:"admin"}),enabled:!!(o!=null&&o.email)}),{data:u=[]}=me({queryKey:["my-admin-orgs",l],queryFn:async()=>{if(l.length===0)return[];const g=l.map(w=>w.org_id);return(await Promise.all(g.map(w=>O.entities.Organization.filter({id:w})))).flat()},enabled:l.length>0}),[d,f]=v.useState({armor_name:"",description:"",armor_image:"",home_port:"",required_materials:[],org_id:"",privacy:"public"});v.useEffect(()=>{if(i){const g=ul[i.name]||[];f({armor_name:i.name,armor_image:i.image,description:"",home_port:(o==null?void 0:o.default_home_port)||"",required_materials:g})}else e?e&&!i&&f(g=>({...g,home_port:(o==null?void 0:o.default_home_port)||""})):f({armor_name:"",description:"",armor_image:"",home_port:"",required_materials:[]})},[i,e,o]);const h=g=>{const x=Eu.find(_=>_.name===g),w=ul[g]||[];f({armor_name:g,armor_image:(x==null?void 0:x.image)||"",description:d.description,home_port:d.home_port,required_materials:w})},p=g=>{g.preventDefault();const x=u.find(_=>_.id===d.org_id),w={...d,org_name:(x==null?void 0:x.name)||null,org_tag:(x==null?void 0:x.tag)||null};delete w.org_id,n(w)};return a.jsx(xr,{open:e,onOpenChange:t,children:a.jsxs(tr,{className:"bg-slate-900 border-slate-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsx(nr,{children:a.jsxs(rr,{className:"flex items-center gap-2 text-xl",children:[a.jsx(Sn,{className:"w-5 h-5 text-cyan-400"}),"Create New Armor Project"]})}),a.jsxs("form",{onSubmit:p,className:"space-y-6 mt-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Select Armor *"}),a.jsx(a9,{value:d.armor_name,onChange:h,showCustomOption:!1,disabled:!!i})]}),d.armor_name&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Description (Optional)"}),a.jsx(Pi,{placeholder:"Add notes about your project...",value:d.description,onChange:g=>f({...d,description:g.target.value}),className:"bg-slate-800 border-slate-700 text-white placeholder:text-slate-500",rows:3})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Home Port / Drop Off Location (Optional)"}),a.jsx(dt,{placeholder:"e.g., Port Olisar, Lorville, Area18...",value:d.home_port,onChange:g=>f({...d,home_port:g.target.value}),className:"bg-slate-800 border-slate-700 text-white placeholder:text-slate-500"})]}),u.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Organization (Optional)"}),a.jsxs(en,{value:d.org_id,onValueChange:g=>f({...d,org_id:g}),children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{placeholder:"Select organization..."})}),a.jsxs(Qt,{className:"bg-slate-800 border-slate-700",children:[a.jsx(st,{value:null,children:"None"}),u.map(g=>a.jsxs(st,{value:g.id,className:"text-white",children:[g.name," (",g.tag,")"]},g.id))]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Privacy"}),a.jsxs(en,{value:d.privacy,onValueChange:g=>f({...d,privacy:g}),children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{})}),a.jsxs(Qt,{className:"bg-slate-800 border-slate-700",children:[a.jsx(st,{value:"public",className:"text-white",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(du,{className:"w-4 h-4"}),a.jsx("span",{children:"Public - Everyone can see"})]})}),a.jsx(st,{value:"private",className:"text-white",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(fu,{className:"w-4 h-4"}),a.jsx("span",{children:"Private - Only me"})]})}),d.org_id&&a.jsx(st,{value:"org_only",className:"text-white",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(gr,{className:"w-4 h-4"}),a.jsx("span",{children:"Organization - Only org members"})]})})]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs(Ge,{className:"text-slate-300",children:["Required Materials (",d.required_materials.length," items)"]}),a.jsx("div",{className:"max-h-64 overflow-y-auto space-y-2 p-3 bg-slate-800/50 rounded-lg border border-slate-700/50",children:d.required_materials.map((g,x)=>a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Nt,{className:"w-3 h-3 text-slate-400"}),a.jsx("span",{className:"text-slate-300",children:g.material_name})]}),a.jsx("span",{className:"text-cyan-400 font-mono",children:g.quantity_needed})]},x))})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(oe,{type:"button",variant:"ghost",onClick:t,className:"text-slate-400",children:"Cancel"}),a.jsxs(oe,{type:"submit",disabled:r||!d.armor_name,className:"bg-cyan-500 hover:bg-cyan-600 text-white",children:[r?a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}):null,"Create Project"]})]})]})]})})}const C1={"Testudo Set Clanguard":"Armor with Vanduul","Palatino Mark I":"Test Armor",'Geist "Snow Camo" Armor Set':"Hide Snow Suit",'Bokto Armor "Glowy"':"Make glowy armor","Ana Endro Armor":"Armor with horn and string","Corbel Crush":"Shiny Builder Suit",'Strata "Heatwave" Armor':"Do Lava Suit"};function H7(){const{t:e}=gn(),[t,n]=v.useState(""),[r,i]=v.useState(null),[o,l]=v.useState(!1),u=Bt(),d=yl(),{data:f}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),h=Ae({mutationFn:x=>O.entities.ArmorProject.create({...x,owner_email:f==null?void 0:f.email,owner_name:(f==null?void 0:f.alias)||(f==null?void 0:f.full_name),owner_avatar:f==null?void 0:f.avatar_url,status:"planning"}),onSuccess:x=>{u.invalidateQueries({queryKey:["armorProjects"]}),Yn.success(e("armorProjectCreatedSuccess")),l(!1),d(nt("ArmorProjectDetails")+"?id="+x.id)}}),p=x=>{if(!f){O.auth.redirectToLogin();return}i(x),l(!0)},g=Eu.filter(x=>{const w=t.toLowerCase();return!w||x.name.toLowerCase().includes(w)?!0:(ul[x.name]||[]).some(N=>N.material_name.toLowerCase().includes(w))});return a.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 py-12 px-4",children:[a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsxs(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:[a.jsx("h1",{className:"text-4xl font-bold text-white mb-4",children:e("armorsAndMaterials")}),a.jsx("p",{className:"text-slate-400 mb-6",children:e("browseArmorsDesc")}),a.jsxs("div",{className:"relative max-w-md",children:[a.jsx(Ks,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400"}),a.jsx(dt,{placeholder:"Search armors or materials...",value:t,onChange:x=>n(x.target.value),className:"pl-10 bg-slate-800 border-slate-700 text-white placeholder:text-slate-500"})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:g.map((x,w)=>{const _=ul[x.name]||[];return a.jsxs(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:w*.05},className:"bg-slate-900/50 backdrop-blur-sm rounded-xl border border-slate-700/50 overflow-hidden hover:border-cyan-500/50 transition-colors group cursor-pointer",onClick:()=>p(x),children:[a.jsxs("div",{className:"relative h-64 bg-slate-800",children:[a.jsx("img",{src:x.image,alt:x.name,className:"w-full h-full object-contain"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-900 to-transparent"}),a.jsx("div",{className:"absolute inset-0 bg-cyan-500/0 group-hover:bg-cyan-500/10 transition-colors flex items-center justify-center",children:a.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity bg-cyan-500 text-white px-4 py-2 rounded-lg flex items-center gap-2",children:[a.jsx(er,{className:"w-4 h-4"}),a.jsx("span",{className:"font-medium",children:e("startProject")})]})}),a.jsx("h3",{className:"absolute bottom-4 left-4 text-xl font-bold text-white",children:x.name})]}),a.jsxs("div",{className:"p-4",children:[C1[x.name]&&a.jsx("p",{className:"text-cyan-400 text-xs font-bold uppercase tracking-wide mb-3",children:C1[x.name]}),a.jsxs("div",{className:"flex items-center gap-2 text-slate-300 mb-3",children:[a.jsx(Nt,{className:"w-4 h-4 text-cyan-400"}),a.jsx("span",{className:"text-sm font-medium",children:e("requiredMaterials")})]}),_.length>0?a.jsx("div",{className:"space-y-2",children:_.map((N,C)=>a.jsxs("div",{className:"flex items-center justify-between text-sm bg-slate-800/50 rounded px-3 py-2",children:[a.jsx("span",{className:"text-slate-300",children:N.material_name}),a.jsxs("span",{className:"text-cyan-400 font-mono font-medium",children:[N.quantity_needed,"x"]})]},C))}):a.jsx("p",{className:"text-sm text-slate-500 italic",children:e("noMaterialsData")})]})]},x.name)})}),g.length===0&&a.jsx("div",{className:"text-center py-20",children:a.jsxs("p",{className:"text-slate-400",children:[e("noArmorsFound"),' "',t,'"']})})]}),a.jsx(W7,{open:o,onClose:()=>{l(!1),i(null)},onSubmit:x=>h.mutate(x),isLoading:h.isPending,preselectedArmor:r})]})}function K7(){const[e,t]=v.useState([]),[n,r]=v.useState(!1),{data:i}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),{data:o=[]}=me({queryKey:["materials"],queryFn:()=>O.entities.Material.list()}),l=Ae({mutationFn:async()=>{r(!0),t([]);const u=new Set;Object.values(Xf).forEach(h=>{h.forEach(p=>u.add(p.material_name))}),Object.values(ul).forEach(h=>{h.forEach(p=>u.add(p.material_name))});const d=[];d.push({type:"info",message:`Found ${u.size} unique materials used in projects`});const f=o.filter(h=>!u.has(h.name));d.push({type:"info",message:`Found ${f.length} unused materials in database`});for(const h of f)try{await O.entities.Material.delete(h.id),d.push({type:"success",message:`Deleted: ${h.name} (${h.reputation_value} pts)`})}catch(p){d.push({type:"error",message:`Failed to delete ${h.name}: ${p.message}`})}return d.push({type:"success",message:`✓ Cleanup complete! Deleted ${f.length} unused materials`}),t(d),r(!1),d}});return!i||i.role!=="admin"?a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 flex items-center justify-center p-4",children:a.jsx(Be,{className:"bg-slate-900/50 border-slate-700/50 max-w-md",children:a.jsx($e,{className:"p-8 text-center",children:a.jsx("p",{className:"text-slate-400",children:"Admin access required"})})})}):a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950",children:a.jsx("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 pt-8 pb-16",children:a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsx(vt,{children:a.jsxs(wt,{className:"text-white flex items-center gap-3",children:[a.jsx(wi,{className:"w-6 h-6 text-cyan-400"}),"Cleanup Unused Materials"]})}),a.jsxs($e,{className:"space-y-6",children:[a.jsxs("div",{className:"text-slate-300",children:[a.jsx("p",{className:"mb-4",children:"This will remove all materials from the database that are not used by any ship or armor projects."}),a.jsx("div",{className:"bg-slate-800/50 rounded-lg p-4 space-y-2",children:a.jsxs("p",{className:"text-sm",children:[a.jsx("strong",{className:"text-cyan-400",children:"Total Materials in Database:"})," ",o.length]})})]}),a.jsx(oe,{onClick:()=>l.mutate(),disabled:n,className:"w-full bg-red-500 hover:bg-red-600 text-white",children:n?a.jsxs(a.Fragment,{children:[a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"Processing..."]}):a.jsxs(a.Fragment,{children:[a.jsx(wi,{className:"w-4 h-4 mr-2"}),"Clean Up Unused Materials"]})}),e.length>0&&a.jsx("div",{className:"bg-slate-800/50 rounded-lg p-4 space-y-2 max-h-96 overflow-y-auto",children:e.map((u,d)=>a.jsxs("div",{className:`text-sm flex items-start gap-2 ${u.type==="error"?"text-red-400":u.type==="success"?"text-green-400":"text-slate-300"}`,children:[u.type==="success"&&a.jsx(Or,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),a.jsx("span",{children:u.message})]},d))})]})]})})})}function G7(){const{t:e}=gn(),t=[{icon:Ba,title:e("gettingStarted"),content:[{subtitle:e("creatingProject"),steps:[e("guideStep1_1"),e("guideStep1_2"),e("guideStep1_3"),e("guideStep1_4"),e("guideStep1_5")]},{subtitle:e("managingProject"),steps:[e("guideStep2_1"),e("guideStep2_2"),e("guideStep2_3"),e("guideStep2_4"),e("guideStep2_5")]}]},{icon:Nt,title:e("contributingMaterials"),content:[{subtitle:e("howToContribute"),steps:[e("guideStep3_1"),e("guideStep3_2"),e("guideStep3_3"),e("guideStep3_4"),e("guideStep3_5"),e("guideStep3_6"),e("guideStep3_7"),e("guideStep3_8")]},{subtitle:e("contributionStatus"),steps:[e("guideStep4_1"),e("guideStep4_2")]}]},{icon:Sn,title:e("organizations"),content:[{subtitle:e("joiningCreatingOrgs"),steps:[e("guideStep5_1"),e("guideStep5_2"),e("guideStep5_3"),e("guideStep5_4"),e("guideStep5_5")]},{subtitle:e("organizationBenefits"),steps:[e("guideStep6_1"),e("guideStep6_2"),e("guideStep6_3"),e("guideStep6_4")]}]},{icon:Gi,title:e("communicationCollaboration"),content:[{subtitle:e("projectChat"),steps:[e("guideStep7_1"),e("guideStep7_2"),e("guideStep7_3"),e("guideStep7_4")]},{subtitle:e("notificationsSection"),steps:[e("guideStep8_1"),e("guideStep8_2"),e("guideStep8_3"),e("guideStep8_4"),e("guideStep8_5")]}]}];return a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950",children:a.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 pt-8 pb-16",children:[a.jsxs("div",{className:"text-center mb-12",children:[a.jsx("h1",{className:"text-4xl font-bold text-white mb-4",children:e("guideTitle")}),a.jsx("p",{className:"text-slate-400 text-lg",children:e("guideSubtitle")})]}),a.jsx("div",{className:"space-y-8",children:t.map((n,r)=>a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsx(vt,{children:a.jsxs(wt,{className:"flex items-center gap-3 text-white",children:[a.jsx(n.icon,{className:"w-6 h-6 text-cyan-400"}),n.title]})}),a.jsx($e,{className:"space-y-6",children:n.content.map((i,o)=>a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-cyan-400 mb-3",children:i.subtitle}),a.jsx("ol",{className:"space-y-2",children:i.steps.map((l,u)=>a.jsxs("li",{className:"flex gap-3 text-slate-300",children:[a.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-cyan-500/20 text-cyan-400 flex items-center justify-center text-sm font-medium",children:u+1}),a.jsx("span",{className:"pt-0.5",children:l})]},u))})]},o))})]},r))}),a.jsx(Be,{className:"bg-slate-900/50 border-slate-700/50 mt-8",children:a.jsxs($e,{className:"p-6",children:[a.jsx("h3",{className:"text-lg font-semibold text-white mb-3",children:e("tipsBestPractices")}),a.jsxs("ul",{className:"space-y-2 text-slate-300",children:[a.jsxs("li",{className:"flex gap-2",children:[a.jsx("span",{className:"text-cyan-400",children:"•"}),a.jsx("span",{children:e("guideTip1")})]}),a.jsxs("li",{className:"flex gap-2",children:[a.jsx("span",{className:"text-cyan-400",children:"•"}),a.jsx("span",{children:e("guideTip2")})]}),a.jsxs("li",{className:"flex gap-2",children:[a.jsx("span",{className:"text-cyan-400",children:"•"}),a.jsx("span",{children:e("guideTip3")})]}),a.jsxs("li",{className:"flex gap-2",children:[a.jsx("span",{className:"text-cyan-400",children:"•"}),a.jsx("span",{children:e("guideTip4")})]})]})]})})]})})}const Q7={"Polaris Wikelo Special":"Now make Polaris. Short Time Deal","A2 Hercules":"Starlifter A2 War Mod",Asgard:"Asgard Fight Mod","F8C Lightning Military":"F8 War Mod","Starlancer MAX":"More than a Max","Starlancer TAC":"New Move Big Starlancer Ship","Prowler Utility":"Prowler More Utility","F8C Lightning Stealth":"Sneaky Stabber","Constellation Taurus":"Want Taurus ship",Scorpius:"Build a Mod Scorpius","Sabre Firebird":"Firebird Mod",Guardian:"Guardian Fight Mod","Guardian QI":"Guardian take down ship","Mirai Guardian MX":"Guardian WiK-X","Ares Ion":"Sneaky Starfighter Ion","Ares Inferno":"Starfighter Inferno Special","Terrapin Medic":"What is Terrapin?","Super Hornet Mk II":"Wikelo Navy F7","Zeus CL":"Zeus Cargo Special",Fortune:"Fortune ship for you",Golem:"Golem Rocks","Sabre Peregrine":"Peregrine Wikelo Mod",Prospector:"Prospects Look Good",RAFT:"Ready for RAFT?","RSI Meteor":"RSI Meteor Mod","C1 Spirit":"Spirit Cargo mod",Intrepid:"Upgrade Intrepid","L-21 Wolf Stealth":"Where Wolf? Here Wolf","Zeus ES":"Zeus Special","Ana Endro Armor":"Armor with horn and string","Testudo Set Clangurd":"Armor with Vanduul",'Strata "Heatwave" Armor':"Do Lava Suit",'Geist " Snow Camo" Armor Set':"Hide Snow Suit",'Bokto Armor "Glowy"':"Make glowy armor","Palatino Mark I":"Test Armor","Ursa Medivac":"Make a Ursa Mod","ATLS IKTI":"Make ATLS shoot","ATLS IKTI GEO":"Make jumpy ATLS shoot",Nox:"Noxy Mod",Pulse:"Pulse Plus","L-21 Wolf Military":"Most Special Wolf","Corbel Crush":"Shiny Builder Suit","Idris-P":"Special Idris For Killing"},Y7={planning:"bg-amber-500/20 text-amber-400 border-amber-500/30",in_progress:"bg-cyan-500/20 text-cyan-400 border-cyan-500/30",completed:"bg-emerald-500/20 text-emerald-400 border-emerald-500/30"};function eM({project:e,index:t=0,pendingContributions:n=[]}){var _,N,C,k;const{t:r}=gn(),i=((_=e.required_materials)==null?void 0:_.reduce((P,T)=>P+(T.quantity_needed||0),0))||0,o=((N=e.required_materials)==null?void 0:N.reduce((P,T)=>P+(T.quantity_collected||0),0))||0,l=i>0?Math.round(o/i*100):0,u=n.filter(P=>P.project_id===e.id&&P.status==="pending").reduce((P,T)=>P+(T.quantity||0),0),d=i>0?Math.min(u/i*100,100-l):0,f=2*Math.PI*40,h=e.projectType==="armor",p=e.displayName||e.ship_name||e.armor_name,g=e.displayImage||e.ship_image||e.armor_image,x=Q7[p],w=()=>{const P=h?"ArmorProjectDetails":"ProjectDetails";window.location.href=nt(`${P}?id=${e.id}`)};return a.jsx(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:t*.1},children:a.jsxs(Be,{className:"relative bg-slate-900/50 border-slate-700/50 backdrop-blur-sm hover:border-cyan-500/30 transition-all duration-300 overflow-hidden group cursor-pointer",onClick:w,children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-cyan-500/5 to-purple-500/5 opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none"}),x&&a.jsx("div",{className:"px-4 pt-3 pb-0",children:a.jsx("span",{className:"text-cyan-400 text-xs font-bold uppercase tracking-wide",children:x})}),g&&a.jsx("div",{className:"h-40 overflow-hidden mt-2",children:a.jsx("img",{src:g,alt:p,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"})}),a.jsx(vt,{className:"pb-3",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-cyan-500 to-purple-500 flex items-center justify-center overflow-hidden flex-shrink-0",children:e.owner_avatar?a.jsx("img",{src:e.owner_avatar,alt:e.owner_name,className:"w-full h-full object-cover"}):a.jsx("span",{className:"text-white font-medium text-sm",children:(e.owner_name||"U")[0].toUpperCase()})}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h3",{className:"font-semibold text-lg text-white",children:p}),e.org_tag&&a.jsxs(zt,{variant:"outline",className:"border-cyan-500/50 text-cyan-400 text-xs",children:[a.jsx(Sn,{className:"w-3 h-3 mr-1"}),e.org_tag]})]}),a.jsxs("p",{className:"text-sm text-slate-400",children:[h&&a.jsx("span",{className:"text-cyan-400 mr-1",children:"🛡️"}),!h&&a.jsx("span",{className:"text-cyan-400 mr-1",children:"🚀"}),"by ",e.owner_name||"Unknown"]})]})]}),a.jsx(zt,{className:`${Y7[e.status]} border flex-shrink-0`,children:(C=e.status)==null?void 0:C.replace("_"," ")})]})}),a.jsxs($e,{className:"space-y-4",children:[e.description&&a.jsx("p",{className:"text-slate-400 text-sm line-clamp-2",children:e.description}),a.jsx("div",{className:"flex items-center justify-center py-2",children:a.jsxs("div",{className:"relative w-24 h-24",children:[a.jsxs("svg",{className:"w-24 h-24 transform -rotate-90",children:[a.jsx("circle",{cx:"48",cy:"48",r:"40",stroke:"currentColor",strokeWidth:"8",fill:"none",className:"text-slate-800"}),a.jsx("circle",{cx:"48",cy:"48",r:"40",stroke:"currentColor",strokeWidth:"8",fill:"none",strokeDasharray:`${f}`,strokeDashoffset:`${f*(1-l/100)}`,className:"text-cyan-400 transition-all duration-500",strokeLinecap:"round"}),d>0&&a.jsx("circle",{cx:"48",cy:"48",r:"40",stroke:"currentColor",strokeWidth:"8",fill:"none",strokeDasharray:`0 ${f*l/100} ${f*d/100} ${f}`,strokeDashoffset:"0",className:"text-amber-400/70 transition-all duration-500",strokeLinecap:"butt"})]}),a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a.jsxs("span",{className:"text-2xl font-bold text-cyan-400",children:[l,"%"]})})]})}),a.jsxs("div",{className:"flex items-center justify-between pt-2",children:[a.jsx("div",{className:"flex items-center gap-4 text-sm text-slate-400",children:a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Nt,{className:"w-4 h-4"}),((k=e.required_materials)==null?void 0:k.length)||0," materials"]})}),a.jsxs(oe,{variant:"ghost",size:"sm",className:"text-cyan-400 hover:text-cyan-300 hover:bg-cyan-500/10",onClick:P=>{P.stopPropagation(),w()},children:[r("viewDetails")," ",a.jsx(Tf,{className:"w-4 h-4 ml-1"})]})]})]})]})})}const X7=uu("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),tM=v.forwardRef(({className:e,variant:t,...n},r)=>a.jsx("div",{ref:r,role:"alert",className:Fe(X7({variant:t}),e),...n}));tM.displayName="Alert";const J7=v.forwardRef(({className:e,...t},n)=>a.jsx("h5",{ref:n,className:Fe("mb-1 font-medium leading-none tracking-tight",e),...t}));J7.displayName="AlertTitle";const nM=v.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Fe("text-sm [&_p]:leading-relaxed",e),...t}));nM.displayName="AlertDescription";function rM({open:e,onClose:t,onSubmit:n,isLoading:r,preselectedShip:i}){const{data:o}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),{data:l=[]}=me({queryKey:["my-memberships",o==null?void 0:o.email],queryFn:()=>O.entities.OrganizationMember.filter({user_email:o==null?void 0:o.email,status:"active",role:"admin"}),enabled:!!(o!=null&&o.email)}),{data:u=[]}=me({queryKey:["my-admin-orgs",l],queryFn:async()=>{if(l.length===0)return[];const g=l.map(w=>w.org_id);return(await Promise.all(g.map(w=>O.entities.Organization.filter({id:w})))).flat()},enabled:l.length>0}),[d,f]=v.useState({ship_name:"",description:"",ship_image:"",home_port:"",required_materials:[],org_id:"",privacy:"public"});v.useEffect(()=>{if(i){const g=y1[i.name]||[];f({ship_name:i.name,ship_image:i.image,description:"",home_port:(o==null?void 0:o.default_home_port)||"",required_materials:g})}else e?e&&!i&&f(g=>({...g,home_port:(o==null?void 0:o.default_home_port)||""})):f({ship_name:"",description:"",ship_image:"",home_port:"",required_materials:[]})},[i,e,o]);const h=g=>{const x=qx.find(N=>N.name===g),w=Eu.find(N=>N.name===g),_=y1[g]||[];f({ship_name:g,ship_image:(x==null?void 0:x.image)||(w==null?void 0:w.image)||"",description:d.description,home_port:d.home_port,required_materials:_})},p=g=>{g.preventDefault();const x=u.find(_=>_.id===d.org_id),w={...d,org_name:(x==null?void 0:x.name)||null,org_tag:(x==null?void 0:x.tag)||null};delete w.org_id,n(w)};return a.jsx(xr,{open:e,onOpenChange:t,children:a.jsxs(tr,{className:"bg-slate-900 border-slate-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsx(nr,{children:a.jsxs(rr,{className:"flex items-center gap-2 text-xl",children:[a.jsx(Ba,{className:"w-5 h-5 text-cyan-400"}),"Create New Project"]})}),a.jsxs("form",{onSubmit:p,className:"space-y-6 mt-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Select Project *"}),a.jsx(s9,{value:d.ship_name,onChange:h,showCustomOption:!1,disabled:!!i,includeArmors:!0}),(()=>{if(!d.ship_name)return null;const g=Ka(d.ship_name);if(!g||g.reputation_required<=0)return null;const x=(o==null?void 0:o.wikelo_reputation)||0,w=x>=g.reputation_required,_=g.reputation_required>=999?"Very Best Customer":"Very Good Customer";return a.jsxs(tM,{className:w?"bg-emerald-500/10 border-emerald-500/50":"bg-red-500/10 border-red-500/50",children:[a.jsx(Yr,{className:`h-4 w-4 ${w?"text-emerald-400":"text-red-400"}`}),a.jsx(nM,{className:`text-sm ${w?"text-emerald-400":"text-red-400"}`,children:w?`✅ You qualify! This mission requires "${_}" reputation (${g.reputation_required}+ rep).`:a.jsxs(a.Fragment,{children:[`⚠️ This mission requires "${_}" reputation (${g.reputation_required}+ rep). You have ${x} — ${g.reputation_required-x} more needed. `,a.jsx("a",{href:"/Reputation",className:"underline font-semibold hover:opacity-80",onClick:t,children:"View your Wikelo Reputation →"})]})})]})})()]}),d.ship_name&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Description (Optional)"}),a.jsx(Pi,{placeholder:"Add notes about your project...",value:d.description,onChange:g=>f({...d,description:g.target.value}),className:"bg-slate-800 border-slate-700 text-white placeholder:text-slate-500",rows:3})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Home Port / Drop Off Location (Optional)"}),a.jsx(dt,{placeholder:"e.g., Port Olisar, Lorville, Area18...",value:d.home_port,onChange:g=>f({...d,home_port:g.target.value}),className:"bg-slate-800 border-slate-700 text-white placeholder:text-slate-500"})]}),u.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Organization (Optional)"}),a.jsxs(en,{value:d.org_id,onValueChange:g=>f({...d,org_id:g}),children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{placeholder:"Select organization..."})}),a.jsxs(Qt,{className:"bg-slate-800 border-slate-700",children:[a.jsx(st,{value:null,children:"None"}),u.map(g=>a.jsxs(st,{value:g.id,className:"text-white",children:[g.name," (",g.tag,")"]},g.id))]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Privacy"}),a.jsxs(en,{value:d.privacy,onValueChange:g=>f({...d,privacy:g}),children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{})}),a.jsxs(Qt,{className:"bg-slate-800 border-slate-700",children:[a.jsx(st,{value:"public",className:"text-white",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(du,{className:"w-4 h-4"}),a.jsx("span",{children:"Public - Everyone can see"})]})}),a.jsx(st,{value:"private",className:"text-white",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(fu,{className:"w-4 h-4"}),a.jsx("span",{children:"Private - Only me"})]})}),d.org_id&&a.jsx(st,{value:"org_only",className:"text-white",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(gr,{className:"w-4 h-4"}),a.jsx("span",{children:"Organization - Only org members"})]})})]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs(Ge,{className:"text-slate-300",children:["Required Materials (",d.required_materials.length," items)"]}),a.jsx("div",{className:"max-h-64 overflow-y-auto space-y-2 p-3 bg-slate-800/50 rounded-lg border border-slate-700/50",children:d.required_materials.map((g,x)=>a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Nt,{className:"w-3 h-3 text-slate-400"}),a.jsx("span",{className:"text-slate-300",children:g.material_name})]}),a.jsx("span",{className:"text-cyan-400 font-mono",children:g.quantity_needed})]},x))})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(oe,{type:"button",variant:"ghost",onClick:t,className:"text-slate-400",children:"Cancel"}),a.jsxs(oe,{type:"submit",disabled:r||!d.ship_name||(()=>{const g=Ka(d.ship_name);return g&&g.reputation_required>0&&((o==null?void 0:o.wikelo_reputation)||0)<g.reputation_required})(),className:"bg-cyan-500 hover:bg-cyan-600 text-white disabled:opacity-50",children:[r?a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}):null,"Create Project"]})]})]})]})})}function Z7(){const{t:e}=gn(),[t,n]=v.useState(!1),[r,i]=v.useState(""),[o,l]=v.useState("all"),[u,d]=v.useState("active"),f=Bt(),{data:h}=me({queryKey:["user"],queryFn:()=>O.auth.me(),onSuccess:E=>{E&&l("mine")}}),{data:p=[],isLoading:g}=me({queryKey:["projects"],queryFn:()=>O.entities.ShipProject.list("-created_date")}),{data:x=[],isLoading:w}=me({queryKey:["armorProjects"],queryFn:()=>O.entities.ArmorProject.list("-created_date")}),_=g||w,N=[...p.map(E=>({...E,projectType:"ship",displayName:E.ship_name,displayImage:E.ship_image})),...x.map(E=>({...E,projectType:"armor",displayName:E.armor_name,displayImage:E.armor_image}))].sort((E,z)=>new Date(z.created_date)-new Date(E.created_date)),{data:C=[]}=me({queryKey:["all-contributions"],queryFn:()=>O.entities.Contribution.filter({status:"pending"})}),{data:k=[]}=me({queryKey:["my-memberships",h==null?void 0:h.email],queryFn:()=>O.entities.OrganizationMember.filter({user_email:h==null?void 0:h.email,status:"active"}),enabled:!!(h!=null&&h.email)}),P=Ae({mutationFn:E=>{const z=k.find(D=>D.role==="admin")||k[0];return O.entities.ShipProject.create({...E,owner_email:h==null?void 0:h.email,owner_name:(h==null?void 0:h.alias)||(h==null?void 0:h.full_name),owner_avatar:h==null?void 0:h.avatar_url,org_name:(z==null?void 0:z.org_tag)||null,org_tag:(z==null?void 0:z.org_tag)||null,status:"planning"})},onSuccess:()=>{f.invalidateQueries({queryKey:["projects"]}),n(!1)}}),T=k.map(E=>E.org_tag),S=N.filter(E=>{var q,J;const z=E.owner_email===(h==null?void 0:h.email),D=E.org_tag&&T.includes(E.org_tag);if(E.privacy==="private"&&!z||E.privacy==="org_only"&&!z&&!D)return!1;const K=r.toLowerCase(),U=((q=E.displayName)==null?void 0:q.toLowerCase().includes(K))||((J=E.owner_name)==null?void 0:J.toLowerCase().includes(K)),G=!(o==="mine"||o==="org_projects")||(u==="completed"?E.status==="completed":E.status!=="completed"),R=o==="all"||o==="mine"&&z||o==="org_projects"&&D||o===E.status;return U&&R&&G});return a.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950",children:[a.jsxs("div",{className:"relative overflow-hidden",children:[a.jsx("div",{className:"absolute inset-0 bg-[url('https://images.unsplash.com/photo-1534796636912-3b95b3ab5986?w=1920')] bg-cover bg-center opacity-10"}),a.jsx("div",{className:"bg-gradient-to-b opacity-100 absolute inset-0 from-transparent via-slate-950/50 to-slate-950"}),a.jsx("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-16 pb-24",children:a.jsxs(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[a.jsx(Ba,{className:"w-10 h-10 text-cyan-400"}),a.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-white",children:e("appTitle")})]}),a.jsx("p",{className:"text-lg text-slate-400 max-w-2xl mx-auto mb-8",children:e("trackMaterials")}),a.jsxs("div",{className:"flex items-center justify-center gap-8 mb-8",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-3xl font-bold text-cyan-400",children:N.filter(E=>E.status==="in_progress").length}),a.jsx("div",{className:"text-sm text-slate-400",children:"In Progress"})]}),a.jsx("div",{className:"w-px h-10 bg-slate-700"}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-3xl font-bold text-green-400",children:N.filter(E=>E.status==="completed").length}),a.jsx("div",{className:"text-sm text-slate-400",children:"Completed"})]}),a.jsx("div",{className:"w-px h-10 bg-slate-700"}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-3xl font-bold text-slate-300",children:N.length}),a.jsx("div",{className:"text-sm text-slate-400",children:"Total Projects"})]})]}),a.jsxs(oe,{onClick:()=>h?n(!0):O.auth.redirectToLogin(),className:"bg-cyan-500 hover:bg-cyan-600 text-white px-6 py-6 text-lg",children:[a.jsx(er,{className:"w-5 h-5 mr-2"}),h?e("startNewProject"):"Sign in to Start Project"]})]})})]}),a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pb-16 -mt-8",children:[a.jsx(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"bg-slate-900/80 backdrop-blur-xl rounded-2xl border border-slate-700/50 p-6 mb-8",children:a.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-center justify-between",children:[a.jsxs("div",{className:"relative flex-1 w-full md:max-w-md",children:[a.jsx(Ks,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400"}),a.jsx(dt,{placeholder:e("searchShips"),value:r,onChange:E=>i(E.target.value),className:"pl-10 bg-slate-800 border-slate-700 text-white placeholder:text-slate-500"})]}),a.jsxs("div",{className:"flex flex-col items-end gap-2",children:[a.jsx(Qi,{value:o,onValueChange:E=>{l(E),d("active")},children:a.jsxs(Si,{className:"bg-slate-800",children:[a.jsx(ht,{value:"all",className:"data-[state=active]:bg-cyan-500",children:e("all")}),a.jsx(ht,{value:"mine",className:"data-[state=active]:bg-cyan-500",children:e("myProjects")}),k.length>0&&a.jsx(ht,{value:"org_projects",className:"data-[state=active]:bg-cyan-500",children:e("orgProjects")}),a.jsx(ht,{value:"in_progress",className:"data-[state=active]:bg-cyan-500",children:e("inProgress")}),a.jsx(ht,{value:"completed",className:"data-[state=active]:bg-cyan-500",children:e("completed")})]})}),(o==="mine"||o==="org_projects")&&a.jsx(Qi,{value:u,onValueChange:d,children:a.jsxs(Si,{className:"bg-slate-800/60 h-7",children:[a.jsx(ht,{value:"active",className:"data-[state=active]:bg-cyan-700 text-xs h-5 px-3",children:"Active"}),a.jsx(ht,{value:"completed",className:"data-[state=active]:bg-emerald-600 text-xs h-5 px-3",children:"Completed"})]})})]})]})}),_?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx(tt,{className:"w-8 h-8 text-cyan-400 animate-spin"})}):S.length===0?a.jsxs(bt.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center py-20",children:[a.jsx(Ba,{className:"w-16 h-16 text-slate-600 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl font-medium text-slate-400 mb-2",children:e("noProjectsFound")}),a.jsx("p",{className:"text-slate-500 mb-6",children:e("beFirst")}),a.jsxs(oe,{onClick:()=>h?n(!0):O.auth.redirectToLogin(),variant:"outline",className:"border-cyan-500/50 text-cyan-400 hover:bg-cyan-500/10",children:[a.jsx(er,{className:"w-4 h-4 mr-2"}),h?e("createProject"):"Sign in to Create"]})]}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:S.map((E,z)=>a.jsx(eM,{project:E,index:z,pendingContributions:C},E.id))})]}),a.jsx(rM,{open:t,onClose:()=>n(!1),onSubmit:E=>P.mutate(E),isLoading:P.isPending})]})}function eH(){var k,P;const{t:e}=gn(),[t,n]=v.useState(!1),[r,i]=v.useState({material_name:"",quantity:0}),o=Bt(),{data:l}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),{data:u=[],isLoading:d}=me({queryKey:["inventory",l==null?void 0:l.email],queryFn:()=>O.entities.UserMaterialInventory.filter({user_email:l==null?void 0:l.email}),enabled:!!(l!=null&&l.email)}),{data:f=[]}=me({queryKey:["materials"],queryFn:()=>O.entities.Material.list()}),{data:h,isLoading:p}=me({queryKey:["closest-projects",l==null?void 0:l.email],queryFn:async()=>(await O.functions.invoke("getClosestProjects",{})).data,enabled:!!(l!=null&&l.email)}),{data:g,isLoading:x}=me({queryKey:["startable-projects",l==null?void 0:l.email],queryFn:async()=>(await O.functions.invoke("getStartableProjects",{})).data,enabled:!!(l!=null&&l.email)}),w=Ae({mutationFn:async T=>{const S=u.find(E=>E.material_name===T.material_name);return S?O.entities.UserMaterialInventory.update(S.id,{quantity:S.quantity+T.quantity}):O.entities.UserMaterialInventory.create({user_email:l.email,material_name:T.material_name,quantity:T.quantity})},onSuccess:()=>{o.invalidateQueries({queryKey:["inventory"]}),o.invalidateQueries({queryKey:["closest-projects"]}),n(!1),i({material_name:"",quantity:0})}}),_=Ae({mutationFn:({id:T,quantity:S})=>O.entities.UserMaterialInventory.update(T,{quantity:S}),onSuccess:()=>{o.invalidateQueries({queryKey:["inventory"]}),o.invalidateQueries({queryKey:["closest-projects"]})}}),N=Ae({mutationFn:T=>O.entities.UserMaterialInventory.delete(T),onSuccess:()=>{o.invalidateQueries({queryKey:["inventory"]}),o.invalidateQueries({queryKey:["closest-projects"]})}}),C=u.reduce((T,S)=>T+S.quantity,0);return a.jsx("div",{className:"min-h-screen bg-slate-950 p-6",children:a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsxs("div",{className:"flex items-center justify-between mb-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-bold text-white mb-2",children:e("materialInventory")}),a.jsx("p",{className:"text-slate-400",children:e("trackMaterialsDesc")})]}),a.jsxs(xr,{open:t,onOpenChange:n,children:[a.jsx(e7,{asChild:!0,children:a.jsxs(oe,{className:"bg-cyan-500 hover:bg-cyan-600",children:[a.jsx(er,{className:"w-4 h-4 mr-2"}),e("addMaterial")]})}),a.jsxs(tr,{className:"bg-slate-900 border-slate-700",children:[a.jsx(nr,{children:a.jsx(rr,{className:"text-white",children:e("addMaterialToInventory")})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Ge,{className:"text-slate-300",children:e("materialLabel")}),a.jsxs(en,{value:r.material_name,onValueChange:T=>i({...r,material_name:T}),children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{placeholder:e("selectMaterial")})}),a.jsx(Qt,{className:"bg-slate-800 border-slate-700",children:f.map(T=>a.jsx(st,{value:T.name,className:"text-white hover:bg-slate-700",children:T.name},T.name))})]})]}),a.jsxs("div",{children:[a.jsx(Ge,{className:"text-slate-300",children:e("quantityLabel")}),a.jsx(dt,{type:"number",min:"1",value:r.quantity,onChange:T=>i({...r,quantity:parseInt(T.target.value)||0}),className:"bg-slate-800 border-slate-700 text-white"})]}),a.jsx(oe,{onClick:()=>w.mutate(r),disabled:!r.material_name||r.quantity<=0,className:"w-full bg-cyan-500 hover:bg-cyan-600",children:e("addToInventory")})]})]})]})]}),a.jsxs(Qi,{defaultValue:"inventory",className:"space-y-6",children:[a.jsxs(Si,{className:"bg-slate-900 border-slate-700",children:[a.jsxs(ht,{value:"inventory",className:"data-[state=active]:bg-slate-800",children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),e("myInventory")]}),a.jsxs(ht,{value:"startable",className:"data-[state=active]:bg-slate-800",children:[a.jsx(Sc,{className:"w-4 h-4 mr-2"}),e("projectsToStart")]}),a.jsxs(ht,{value:"closest",className:"data-[state=active]:bg-slate-800",children:[a.jsx(k_,{className:"w-4 h-4 mr-2"}),e("closestContribution")]})]}),a.jsxs(sn,{value:"inventory",className:"space-y-4",children:[a.jsx(Be,{className:"bg-slate-900 border-slate-700",children:a.jsx(vt,{children:a.jsxs(wt,{className:"text-white flex items-center gap-2",children:[a.jsx(Nt,{className:"w-5 h-5"}),e("totalMaterialsCount"),": ",C]})})}),d?a.jsx("div",{className:"text-center text-slate-400 py-12",children:e("loadingInventory")}):u.length===0?a.jsx(Be,{className:"bg-slate-900 border-slate-700",children:a.jsxs($e,{className:"text-center py-12",children:[a.jsx(Nt,{className:"w-16 h-16 mx-auto mb-4 text-slate-600"}),a.jsx("p",{className:"text-slate-400 mb-4",children:e("inventoryEmpty")}),a.jsxs(oe,{onClick:()=>n(!0),className:"bg-cyan-500 hover:bg-cyan-600",children:[a.jsx(er,{className:"w-4 h-4 mr-2"}),e("addFirstMaterial")]})]})}):a.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:u.map(T=>a.jsx(Be,{className:"bg-slate-900 border-slate-700",children:a.jsxs($e,{className:"p-4",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsx("h3",{className:"text-white font-medium",children:T.material_name}),a.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>N.mutate(T.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:a.jsx(wi,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(dt,{type:"number",min:"0",value:T.quantity,onChange:S=>{const E=parseInt(S.target.value)||0;E>=0&&_.mutate({id:T.id,quantity:E})},className:"bg-slate-800 border-slate-700 text-white"}),a.jsx("span",{className:"text-slate-400 text-sm whitespace-nowrap",children:"units"})]})]})},T.id))})]}),a.jsx(sn,{value:"startable",className:"space-y-4",children:x?a.jsx("div",{className:"text-center text-slate-400 py-12",children:e("calculatingProjects")}):(k=g==null?void 0:g.startableProjects)!=null&&k.length?a.jsx("div",{className:"space-y-4",children:g.startableProjects.map((T,S)=>{const E=T.type==="ship";return a.jsx(Be,{className:"bg-slate-900 border-slate-700 hover:border-cyan-500/50 transition-colors",children:a.jsx($e,{className:"p-6",children:a.jsxs("div",{className:"flex items-start gap-4",children:[T.image&&a.jsx("img",{src:T.image,alt:T.name,className:"w-24 h-24 object-cover rounded-lg"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-start justify-between mb-2",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:T.name}),a.jsx("p",{className:"text-slate-400 text-sm mt-1",children:e(E?"newShipProject":"newArmorProject")})]}),a.jsx(zt,{className:"bg-purple-500/20 text-purple-400 border-purple-500/30",children:E?"Ship":"Armor"})]}),a.jsxs("div",{className:"space-y-2 mt-4",children:[a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("span",{className:"text-slate-400",children:e("completionFromInventory")}),a.jsxs("span",{className:"text-white font-bold",children:[T.completionPercentage.toFixed(1),"%"]})]}),a.jsx("div",{className:"w-full bg-slate-800 rounded-full h-2",children:a.jsx("div",{className:"bg-gradient-to-r from-purple-500 to-pink-500 h-2 rounded-full transition-all",style:{width:`${Math.min(T.completionPercentage,100)}%`}})}),a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("span",{className:"text-slate-400",children:e("youHaveMaterials")}),a.jsxs("span",{className:"text-purple-400",children:[T.totalMaterialsAvailable," / ",T.totalMaterialsNeeded," ",e("unitsNeeded")]})]}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Sc,{className:"w-4 h-4 text-green-400"}),a.jsxs("span",{className:"text-slate-400",children:[T.matchedMaterials," ",e("matchingMaterials")]})]})]}),a.jsx(Ft,{to:nt(E?"Ships":"Armors"),children:a.jsx(oe,{className:"mt-4 bg-purple-500 hover:bg-purple-600",children:e("startThisProject")})})]})]})})},S)})}):a.jsx(Be,{className:"bg-slate-900 border-slate-700",children:a.jsxs($e,{className:"text-center py-12",children:[a.jsx(Sc,{className:"w-16 h-16 mx-auto mb-4 text-slate-600"}),a.jsx("p",{className:"text-slate-400 mb-4",children:e("noProjectsWithInventory")}),a.jsx("p",{className:"text-slate-500 text-sm",children:e("addMaterialsToStart")})]})})}),a.jsx(sn,{value:"closest",className:"space-y-4",children:p?a.jsx("div",{className:"text-center text-slate-400 py-12",children:e("calculatingClosest")}):(P=h==null?void 0:h.closestProjects)!=null&&P.length?a.jsx("div",{className:"space-y-4",children:h.closestProjects.map(T=>{const{project:S,completionPercentage:E,matchedMaterials:z,totalMaterialsAvailable:D,totalMaterialsNeeded:K}=T,U=T.project.type==="ship",W=nt(U?`ProjectDetails?id=${S.id}`:`ArmorProjectDetails?id=${S.id}`);return a.jsx(Be,{className:"bg-slate-900 border-slate-700 hover:border-cyan-500/50 transition-colors",children:a.jsx($e,{className:"p-6",children:a.jsxs("div",{className:"flex items-start gap-4",children:[(S.ship_image||S.armor_image)&&a.jsx("img",{src:S.ship_image||S.armor_image,alt:S.ship_name||S.armor_name,className:"w-24 h-24 object-cover rounded-lg"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-start justify-between mb-2",children:[a.jsxs("div",{children:[a.jsx(Ft,{to:W,className:"text-xl font-bold text-white hover:text-cyan-400 transition-colors",children:S.ship_name||S.armor_name}),a.jsx("p",{className:"text-slate-400 text-sm mt-1",children:S.description})]}),a.jsx(zt,{className:"bg-cyan-500/20 text-cyan-400 border-cyan-500/30",children:U?"Ship":"Armor"})]}),a.jsxs("div",{className:"space-y-2 mt-4",children:[a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("span",{className:"text-slate-400",children:e("completionFromInventory")}),a.jsxs("span",{className:"text-white font-bold",children:[E.toFixed(1),"%"]})]}),a.jsx("div",{className:"w-full bg-slate-800 rounded-full h-2",children:a.jsx("div",{className:"bg-gradient-to-r from-cyan-500 to-purple-500 h-2 rounded-full transition-all",style:{width:`${Math.min(E,100)}%`}})}),a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("span",{className:"text-slate-400",children:e("youCanProvide")}),a.jsxs("span",{className:"text-cyan-400",children:[D," / ",K," ",e("unitsNeeded")]})]}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Sc,{className:"w-4 h-4 text-green-400"}),a.jsxs("span",{className:"text-slate-400",children:[z," ",e("matchingMaterials")]})]})]}),a.jsx(Ft,{to:W,children:a.jsx(oe,{className:"mt-4 bg-cyan-500 hover:bg-cyan-600",children:e("viewProjectContribute")})})]})]})})},S.id)})}):a.jsx(Be,{className:"bg-slate-900 border-slate-700",children:a.jsxs($e,{className:"text-center py-12",children:[a.jsx(k_,{className:"w-16 h-16 mx-auto mb-4 text-slate-600"}),a.jsx("p",{className:"text-slate-400 mb-4",children:e("noMatchingProjects")}),a.jsx("p",{className:"text-slate-500 text-sm",children:e("addMaterialsToContribute")})]})})})]})]})})}function tH({conversations:e,orgChannels:t,projectThreads:n,activeConversation:r,onSelectConversation:i,currentUserEmail:o,searchQuery:l,onSearchChange:u,filter:d,onNewConversation:f}){const{t:h}=gn(),p=_=>{var C,k;const N=_.participant_emails.findIndex(P=>P!==o);return{name:((C=_.participant_names)==null?void 0:C[N])||"Unknown",avatar:(k=_.participant_avatars)==null?void 0:k[N],email:_.participant_emails[N]}},g=e.filter(_=>p(_).name.toLowerCase().includes(l.toLowerCase())),x=t.filter(_=>_.name.toLowerCase().includes(l.toLowerCase())),w=n.filter(_=>{var N,C;return((N=_.ship_name)==null?void 0:N.toLowerCase().includes(l.toLowerCase()))||((C=_.armor_name)==null?void 0:C.toLowerCase().includes(l.toLowerCase()))});return a.jsxs("div",{className:"w-80 border-r border-slate-700 bg-slate-900/50 flex flex-col",children:[a.jsxs("div",{className:"p-4 border-b border-slate-700 space-y-3",children:[a.jsxs("button",{onClick:f,className:"w-full bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg px-4 py-2 flex items-center justify-center gap-2 transition-colors",children:[a.jsx(Gi,{className:"w-4 h-4"}),a.jsx("span",{className:"font-medium",children:h("newDirectMessage")})]}),a.jsxs("div",{className:"relative",children:[a.jsx(Ks,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400"}),a.jsx(dt,{placeholder:h("searchConversations"),value:l,onChange:_=>u(_.target.value),className:"pl-10 bg-slate-800 border-slate-700 text-white"})]})]}),a.jsxs(Cl,{className:"flex-1",children:[d==="all"||d==="dms"?a.jsx(a.Fragment,{children:g.length>0&&a.jsxs("div",{className:"p-2",children:[a.jsx("div",{className:"text-xs font-semibold text-slate-400 px-2 mb-2",children:h("directMessagesLabel")}),g.map(_=>{var P,T;const N=p(_),C=((P=_.unread_count)==null?void 0:P[o])||0,k=(r==null?void 0:r.type)==="dm"&&(r==null?void 0:r.id)===_.id;return a.jsxs("button",{onClick:()=>i({type:"dm",id:_.id,data:_}),className:`w-full p-3 rounded-lg flex items-start gap-3 hover:bg-slate-800 transition-colors mb-1 ${k?"bg-slate-800":""}`,children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-cyan-500 to-purple-500 flex items-center justify-center flex-shrink-0 overflow-hidden",children:N.avatar?a.jsx("img",{src:N.avatar,alt:"",className:"w-full h-full object-cover"}):a.jsx("span",{className:"text-white font-medium",children:(T=N.name[0])==null?void 0:T.toUpperCase()})}),a.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("span",{className:"font-medium text-white truncate",children:N.name}),_.last_message_at&&a.jsx("span",{className:"text-xs text-slate-400 flex-shrink-0 ml-2",children:Um(new Date(_.last_message_at),{addSuffix:!1})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-sm text-slate-400 truncate",children:_.last_message||h("noMessagesYet")}),C>0&&a.jsx(zt,{className:"ml-2 bg-cyan-500 text-white",children:C})]})]})]},_.id)})]})}):null,d==="all"||d==="orgs"?a.jsx(a.Fragment,{children:x.length>0&&a.jsxs("div",{className:"p-2",children:[a.jsx("div",{className:"text-xs font-semibold text-slate-400 px-2 mb-2",children:h("organizationChannels")}),x.map(_=>{const N=(r==null?void 0:r.type)==="org"&&(r==null?void 0:r.id)===_.org_id;return a.jsxs("button",{onClick:()=>i({type:"org",id:_.org_id,data:_}),className:`w-full p-3 rounded-lg flex items-start gap-3 hover:bg-slate-800 transition-colors mb-1 ${N?"bg-slate-800":""}`,children:[a.jsx("div",{className:"w-10 h-10 rounded-lg bg-slate-800 flex items-center justify-center flex-shrink-0 overflow-hidden",children:_.logo_url?a.jsx("img",{src:_.logo_url,alt:"",className:"w-full h-full object-cover"}):a.jsx(gr,{className:"w-5 h-5 text-cyan-400"})}),a.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"font-medium text-white truncate",children:_.name}),a.jsx(zt,{variant:"outline",className:"text-xs",children:_.tag})]}),a.jsxs("p",{className:"text-sm text-slate-400",children:[_.memberCount||0," members"]})]})]},_.org_id)})]})}):null,d==="all"||d==="projects"?a.jsx(a.Fragment,{children:w.length>0&&a.jsxs("div",{className:"p-2",children:[a.jsx("div",{className:"text-xs font-semibold text-slate-400 px-2 mb-2",children:h("projectThreadsLabel")}),w.map(_=>{const N=(r==null?void 0:r.type)==="project"&&(r==null?void 0:r.id)===_.id,C=_.ship_name||_.armor_name||"Unknown Project";return a.jsxs("button",{onClick:()=>i({type:"project",id:_.id,data:_}),className:`w-full p-3 rounded-lg flex items-start gap-3 hover:bg-slate-800 transition-colors mb-1 ${N?"bg-slate-800":""}`,children:[a.jsx("div",{className:"w-10 h-10 rounded-lg bg-slate-800 flex items-center justify-center flex-shrink-0 overflow-hidden",children:_.ship_image||_.armor_image?a.jsx("img",{src:_.ship_image||_.armor_image,alt:"",className:"w-full h-full object-cover"}):a.jsx(Ba,{className:"w-5 h-5 text-cyan-400"})}),a.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[a.jsx("span",{className:"font-medium text-white truncate block",children:C}),a.jsx("p",{className:"text-sm text-slate-400",children:_.owner_name||h("unknownOwner")})]})]},_.id)})]})}):null]})]})}function nH(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const rH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iH=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,aH={};function k1(e,t){return(aH.jsx?iH:rH).test(e)}const sH=/[ \t\n\f\r]/g;function oH(e){return typeof e=="object"?e.type==="text"?P1(e.value):!1:P1(e)}function P1(e){return e.replace(sH,"")===""}class Mu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Mu.prototype.normal={};Mu.prototype.property={};Mu.prototype.space=void 0;function iM(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Mu(n,r,t)}function t0(e){return e.toLowerCase()}class ir{constructor(t,n){this.attribute=n,this.property=t}}ir.prototype.attribute="";ir.prototype.booleanish=!1;ir.prototype.boolean=!1;ir.prototype.commaOrSpaceSeparated=!1;ir.prototype.commaSeparated=!1;ir.prototype.defined=!1;ir.prototype.mustUseProperty=!1;ir.prototype.number=!1;ir.prototype.overloadedBoolean=!1;ir.prototype.property="";ir.prototype.spaceSeparated=!1;ir.prototype.space=void 0;let lH=0;const at=Js(),rn=Js(),n0=Js(),ye=Js(),Tt=Js(),Uo=Js(),dr=Js();function Js(){return 2**++lH}const r0=Object.freeze(Object.defineProperty({__proto__:null,boolean:at,booleanish:rn,commaOrSpaceSeparated:dr,commaSeparated:Uo,number:ye,overloadedBoolean:n0,spaceSeparated:Tt},Symbol.toStringTag,{value:"Module"})),Ag=Object.keys(r0);class cv extends ir{constructor(t,n,r,i){let o=-1;if(super(t,n),E1(this,"space",i),typeof r=="number")for(;++o<Ag.length;){const l=Ag[o];E1(this,Ag[o],(r&r0[l])===r0[l])}}}cv.prototype.defined=!0;function E1(e,t,n){n&&(e[t]=n)}function kl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new cv(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[t0(r)]=r,n[t0(o.attribute)]=r}return new Mu(t,n,e.space)}const aM=kl({properties:{ariaActiveDescendant:null,ariaAtomic:rn,ariaAutoComplete:null,ariaBusy:rn,ariaChecked:rn,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:Tt,ariaCurrent:null,ariaDescribedBy:Tt,ariaDetails:null,ariaDisabled:rn,ariaDropEffect:Tt,ariaErrorMessage:null,ariaExpanded:rn,ariaFlowTo:Tt,ariaGrabbed:rn,ariaHasPopup:null,ariaHidden:rn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Tt,ariaLevel:ye,ariaLive:null,ariaModal:rn,ariaMultiLine:rn,ariaMultiSelectable:rn,ariaOrientation:null,ariaOwns:Tt,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:rn,ariaReadOnly:rn,ariaRelevant:null,ariaRequired:rn,ariaRoleDescription:Tt,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:rn,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function sM(e,t){return t in e?e[t]:t}function oM(e,t){return sM(e,t.toLowerCase())}const cH=kl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Uo,acceptCharset:Tt,accessKey:Tt,action:null,allow:null,allowFullScreen:at,allowPaymentRequest:at,allowUserMedia:at,alt:null,as:null,async:at,autoCapitalize:null,autoComplete:Tt,autoFocus:at,autoPlay:at,blocking:Tt,capture:null,charSet:null,checked:at,cite:null,className:Tt,cols:ye,colSpan:null,content:null,contentEditable:rn,controls:at,controlsList:Tt,coords:ye|Uo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:at,defer:at,dir:null,dirName:null,disabled:at,download:n0,draggable:rn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:at,formTarget:null,headers:Tt,height:ye,hidden:n0,high:ye,href:null,hrefLang:null,htmlFor:Tt,httpEquiv:Tt,id:null,imageSizes:null,imageSrcSet:null,inert:at,inputMode:null,integrity:null,is:null,isMap:at,itemId:null,itemProp:Tt,itemRef:Tt,itemScope:at,itemType:Tt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:at,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:at,muted:at,name:null,nonce:null,noModule:at,noValidate:at,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:at,optimum:ye,pattern:null,ping:Tt,placeholder:null,playsInline:at,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:at,referrerPolicy:null,rel:Tt,required:at,reversed:at,rows:ye,rowSpan:ye,sandbox:Tt,scope:null,scoped:at,seamless:at,selected:at,shadowRootClonable:at,shadowRootDelegatesFocus:at,shadowRootMode:null,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:rn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:at,useMap:null,value:rn,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Tt,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:at,declare:at,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:at,noHref:at,noShade:at,noWrap:at,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:rn,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:at,disableRemotePlayback:at,prefix:null,property:null,results:ye,security:null,unselectable:null},space:"html",transform:oM}),uH=kl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:dr,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:Tt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:at,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Uo,g2:Uo,glyphName:Uo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:dr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ye,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Tt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:dr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:dr,rev:dr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:dr,requiredFeatures:dr,requiredFonts:dr,requiredFormats:dr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:dr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:dr,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:dr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sM}),lM=kl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),cM=kl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:oM}),uM=kl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),dH={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},fH=/[A-Z]/g,T1=/-[a-z]/g,mH=/^data[-\w.:]+$/i;function hH(e,t){const n=t0(t);let r=t,i=ir;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&mH.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(T1,gH);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!T1.test(o)){let l=o.replace(fH,pH);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=cv}return new i(r,t)}function pH(e){return"-"+e.toLowerCase()}function gH(e){return e.charAt(1).toUpperCase()}const yH=iM([aM,cH,lM,cM,uM],"html"),uv=iM([aM,uH,lM,cM,uM],"svg");function xH(e){return e.join(" ").trim()}var Mo={},Mg,A1;function vH(){if(A1)return Mg;A1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
|
||
`,f="/",h="*",p="",g="comment",x="declaration";Mg=function(_,N){if(typeof _!="string")throw new TypeError("First argument must be a string");if(!_)return[];N=N||{};var C=1,k=1;function P(R){var q=R.match(t);q&&(C+=q.length);var J=R.lastIndexOf(d);k=~J?R.length-J:k+R.length}function T(){var R={line:C,column:k};return function(q){return q.position=new S(R),D(),q}}function S(R){this.start=R,this.end={line:C,column:k},this.source=N.source}S.prototype.content=_;function E(R){var q=new Error(N.source+":"+C+":"+k+": "+R);if(q.reason=R,q.filename=N.source,q.line=C,q.column=k,q.source=_,!N.silent)throw q}function z(R){var q=R.exec(_);if(q){var J=q[0];return P(J),_=_.slice(J.length),q}}function D(){z(n)}function K(R){var q;for(R=R||[];q=U();)q!==!1&&R.push(q);return R}function U(){var R=T();if(!(f!=_.charAt(0)||h!=_.charAt(1))){for(var q=2;p!=_.charAt(q)&&(h!=_.charAt(q)||f!=_.charAt(q+1));)++q;if(q+=2,p===_.charAt(q-1))return E("End of comment missing");var J=_.slice(2,q-2);return k+=2,P(J),_=_.slice(q),k+=2,R({type:g,comment:J})}}function W(){var R=T(),q=z(r);if(q){if(U(),!z(i))return E("property missing ':'");var J=z(o),ae=R({type:x,property:w(q[0].replace(e,p)),value:J?w(J[0].replace(e,p)):p});return z(l),ae}}function G(){var R=[];K(R);for(var q;q=W();)q!==!1&&(R.push(q),K(R));return R}return D(),G()};function w(_){return _?_.replace(u,p):p}return Mg}var M1;function bH(){if(M1)return Mo;M1=1;var e=Mo&&Mo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.default=n;var t=e(vH());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var l=(0,t.default)(r),u=typeof i=="function";return l.forEach(function(d){if(d.type==="declaration"){var f=d.property,h=d.value;u?i(f,h,d):h&&(o=o||{},o[f]=h)}}),o}return Mo}var vc={},R1;function wH(){if(R1)return vc;R1=1,Object.defineProperty(vc,"__esModule",{value:!0}),vc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(f){return!f||n.test(f)||e.test(f)},l=function(f,h){return h.toUpperCase()},u=function(f,h){return"".concat(h,"-")},d=function(f,h){return h===void 0&&(h={}),o(f)?f:(f=f.toLowerCase(),h.reactCompat?f=f.replace(i,u):f=f.replace(r,u),f.replace(t,l))};return vc.camelCase=d,vc}var bc,O1;function _H(){if(O1)return bc;O1=1;var e=bc&&bc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(bH()),n=wH();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(u,d){u&&d&&(l[(0,n.camelCase)(u,o)]=d)}),l}return r.default=r,bc=r,bc}var SH=_H();const jH=cu(SH),dM=fM("end"),dv=fM("start");function fM(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function NH(e){const t=dv(e),n=dM(e);if(t&&n)return{start:t,end:n}}function Fc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?I1(e.position):"start"in e||"end"in e?I1(e):"line"in e||"column"in e?i0(e):""}function i0(e){return D1(e&&e.line)+":"+D1(e&&e.column)}function I1(e){return i0(e&&e.start)+"-"+i0(e&&e.end)}function D1(e){return e&&typeof e=="number"?e:1}class Rn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=Fc(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Rn.prototype.file="";Rn.prototype.name="";Rn.prototype.reason="";Rn.prototype.message="";Rn.prototype.stack="";Rn.prototype.column=void 0;Rn.prototype.line=void 0;Rn.prototype.ancestors=void 0;Rn.prototype.cause=void 0;Rn.prototype.fatal=void 0;Rn.prototype.place=void 0;Rn.prototype.ruleId=void 0;Rn.prototype.source=void 0;const fv={}.hasOwnProperty,CH=new Map,kH=/[A-Z]/g,PH=new Set(["table","tbody","thead","tfoot","tr"]),EH=new Set(["td","th"]),mM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function TH(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=qH(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=LH(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?uv:yH,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=hM(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function hM(e,t,n){if(t.type==="element")return AH(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return MH(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return OH(e,t,n);if(t.type==="mdxjsEsm")return RH(e,t);if(t.type==="root")return IH(e,t,n);if(t.type==="text")return DH(e,t)}function AH(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=uv,e.schema=i),e.ancestors.push(t);const o=gM(e,t.tagName,!1),l=FH(e,t);let u=hv(e,t);return PH.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!oH(d):!0})),pM(e,l,o,t),mv(l,u),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function MH(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tu(e,t.position)}function RH(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tu(e,t.position)}function OH(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=uv,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:gM(e,t.name,!0),l=zH(e,t),u=hv(e,t);return pM(e,l,o,t),mv(l,u),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function IH(e,t,n){const r={};return mv(r,hv(e,t)),e.create(t,e.Fragment,r,n)}function DH(e,t){return t.value}function pM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function mv(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function LH(e,t,n){return r;function r(i,o,l,u){const f=Array.isArray(l.children)?n:t;return u?f(o,l,u):f(o,l)}}function qH(e,t){return n;function n(r,i,o,l){const u=Array.isArray(o.children),d=dv(r);return t(i,o,l,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function FH(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&fv.call(t.properties,i)){const o=BH(e,i,t.properties[i]);if(o){const[l,u]=o;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&EH.has(t.tagName)?r=u:n[l]=u}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function zH(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else tu(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,o=e.evaluater.evaluateExpression(u.expression)}else tu(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function hv(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:CH;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const f=i.get(d)||0;l=d+"-"+f,i.set(d,f+1)}}const u=hM(e,o,l);u!==void 0&&n.push(u)}return n}function BH(e,t,n){const r=hH(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?nH(n):xH(n)),r.property==="style"){let i=typeof n=="object"?n:VH(e,String(n));return e.stylePropertyNameCase==="css"&&(i=$H(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?dH[r.property]||r.property:r.attribute,n]}}function VH(e,t){try{return jH(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Rn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=mM+"#cannot-parse-style-attribute",i}}function gM(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,l;for(;++o<i.length;){const u=k1(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(o&&u.type==="Literal"),optional:!1}:u}r=l}else r=k1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return fv.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);tu(e)}function tu(e,t){const n=new Rn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=mM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function $H(e){const t={};let n;for(n in e)fv.call(e,n)&&(t[UH(n)]=e[n]);return t}function UH(e){let t=e.replace(kH,WH);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function WH(e){return"-"+e.toLowerCase()}const Rg={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},HH={};function KH(e,t){const n=HH,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return yM(e,r,i)}function yM(e,t,n){if(GH(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return L1(e.children,t,n)}return Array.isArray(e)?L1(e,t,n):""}function L1(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=yM(e[i],t,n);return r.join("")}function GH(e){return!!(e&&typeof e=="object")}const q1=document.createElement("i");function pv(e){const t="&"+e+";";q1.innerHTML=t;const n=q1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ni(e,t,n,r){const i=e.length;let o=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function Mr(e,t){return e.length>0?(Ni(e,e.length,0,t),e):t}const F1={}.hasOwnProperty;function QH(e){const t={};let n=-1;for(;++n<e.length;)YH(t,e[n]);return t}function YH(e,t){let n;for(n in t){const i=(F1.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){F1.call(i,l)||(i[l]=[]);const u=o[l];XH(i[l],Array.isArray(u)?u:u?[u]:[])}}}function XH(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ni(e,0,0,r)}function xM(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Wo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pi=Ja(/[A-Za-z]/),mr=Ja(/[\dA-Za-z]/),JH=Ja(/[#-'*+\--9=?A-Z^-~]/);function a0(e){return e!==null&&(e<32||e===127)}const s0=Ja(/\d/),ZH=Ja(/[\dA-Fa-f]/),eK=Ja(/[!-/:-@[-`{-~]/);function et(e){return e!==null&&e<-2}function Zn(e){return e!==null&&(e<0||e===32)}function xt(e){return e===-2||e===-1||e===32}const tK=Ja(new RegExp("\\p{P}|\\p{S}","u")),nK=Ja(/\s/);function Ja(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Pl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&mr(e.charCodeAt(n+1))&&mr(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const u=e.charCodeAt(n+1);o<56320&&u>56319&&u<57344?(l=String.fromCharCode(o,u),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function At(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(d){return xt(d)?(e.enter(n),u(d)):t(d)}function u(d){return xt(d)&&o++<i?(e.consume(d),u):(e.exit(n),t(d))}}const rK={tokenize:iK};function iK(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),At(e,t,"linePrefix")}function i(u){return e.enter("paragraph"),o(u)}function o(u){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return et(u)?(e.consume(u),e.exit("chunkText"),o):(e.consume(u),l)}}const aK={tokenize:sK},z1={tokenize:oK};function sK(e){const t=this,n=[];let r=0,i,o,l;return u;function u(P){if(r<n.length){const T=n[r];return t.containerState=T[1],e.attempt(T[0].continuation,d,f)(P)}return f(P)}function d(P){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&k();const T=t.events.length;let S=T,E;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){E=t.events[S][1].end;break}C(r);let z=T;for(;z<t.events.length;)t.events[z][1].end={...E},z++;return Ni(t.events,S+1,0,t.events.slice(T)),t.events.length=z,f(P)}return u(P)}function f(P){if(r===n.length){if(!i)return g(P);if(i.currentConstruct&&i.currentConstruct.concrete)return w(P);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(z1,h,p)(P)}function h(P){return i&&k(),C(r),g(P)}function p(P){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,w(P)}function g(P){return t.containerState={},e.attempt(z1,x,w)(P)}function x(P){return r++,n.push([t.currentConstruct,t.containerState]),g(P)}function w(P){if(P===null){i&&k(),C(0),e.consume(P);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),_(P)}function _(P){if(P===null){N(e.exit("chunkFlow"),!0),C(0),e.consume(P);return}return et(P)?(e.consume(P),N(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(P),_)}function N(P,T){const S=t.sliceStream(P);if(T&&S.push(null),P.previous=o,o&&(o.next=P),o=P,i.defineSkip(P.start),i.write(S),t.parser.lazy[P.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<l&&(!i.events[E][1].end||i.events[E][1].end.offset>l))return;const z=t.events.length;let D=z,K,U;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(K){U=t.events[D][1].end;break}K=!0}for(C(r),E=z;E<t.events.length;)t.events[E][1].end={...U},E++;Ni(t.events,D+1,0,t.events.slice(z)),t.events.length=E}}function C(P){let T=n.length;for(;T-- >P;){const S=n[T];t.containerState=S[1],S[0].exit.call(t,e)}n.length=P}function k(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function oK(e,t,n){return At(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function B1(e){if(e===null||Zn(e)||nK(e))return 1;if(tK(e))return 2}function gv(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const o0={name:"attention",resolveAll:lK,tokenize:cK};function lK(e,t){let n=-1,r,i,o,l,u,d,f,h;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},g={...e[n][1].start};V1(p,-d),V1(g,d),l={type:d>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},o={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Mr(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Mr(f,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),f=Mr(f,gv(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Mr(f,[["exit",o,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,f=Mr(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Ni(e,r-1,n-r+3,f),n=r+f.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function cK(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=B1(r);let o;return l;function l(d){return o=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===o)return e.consume(d),u;const f=e.exit("attentionSequence"),h=B1(d),p=!h||h===2&&i||n.includes(d),g=!i||i===2&&h||n.includes(r);return f._open=!!(o===42?p:p&&(i||!g)),f._close=!!(o===42?g:g&&(h||!p)),t(d)}}function V1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const uK={name:"autolink",tokenize:dK};function dK(e,t,n){let r=0;return i;function i(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(x){return pi(x)?(e.consume(x),l):x===64?n(x):f(x)}function l(x){return x===43||x===45||x===46||mr(x)?(r=1,u(x)):f(x)}function u(x){return x===58?(e.consume(x),r=0,d):(x===43||x===45||x===46||mr(x))&&r++<32?(e.consume(x),u):(r=0,f(x))}function d(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||a0(x)?n(x):(e.consume(x),d)}function f(x){return x===64?(e.consume(x),h):JH(x)?(e.consume(x),f):n(x)}function h(x){return mr(x)?p(x):n(x)}function p(x){return x===46?(e.consume(x),r=0,h):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):g(x)}function g(x){if((x===45||mr(x))&&r++<63){const w=x===45?g:p;return e.consume(x),w}return n(x)}}const Gm={partial:!0,tokenize:fK};function fK(e,t,n){return r;function r(o){return xt(o)?At(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||et(o)?t(o):n(o)}}const vM={continuation:{tokenize:hK},exit:pK,name:"blockQuote",tokenize:mK};function mK(e,t,n){const r=this;return i;function i(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return xt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function hK(e,t,n){const r=this;return i;function i(l){return xt(l)?At(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(vM,t,n)(l)}}function pK(e){e.exit("blockQuote")}const bM={name:"characterEscape",tokenize:gK};function gK(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return eK(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const wM={name:"characterReference",tokenize:yK};function yK(e,t,n){const r=this;let i=0,o,l;return u;function u(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),d}function d(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),o=31,l=mr,h(p))}function f(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=ZH,h):(e.enter("characterReferenceValue"),o=7,l=s0,h(p))}function h(p){if(p===59&&i){const g=e.exit("characterReferenceValue");return l===mr&&!pv(r.sliceSerialize(g))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&i++<o?(e.consume(p),h):n(p)}}const $1={partial:!0,tokenize:vK},U1={concrete:!0,name:"codeFenced",tokenize:xK};function xK(e,t,n){const r=this,i={partial:!0,tokenize:S};let o=0,l=0,u;return d;function d(E){return f(E)}function f(E){const z=r.events[r.events.length-1];return o=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,u=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(E)}function h(E){return E===u?(l++,e.consume(E),h):l<3?n(E):(e.exit("codeFencedFenceSequence"),xt(E)?At(e,p,"whitespace")(E):p(E))}function p(E){return E===null||et(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check($1,_,T)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===null||et(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(E)):xt(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),At(e,x,"whitespace")(E)):E===96&&E===u?n(E):(e.consume(E),g)}function x(E){return E===null||et(E)?p(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(E))}function w(E){return E===null||et(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(E)):E===96&&E===u?n(E):(e.consume(E),w)}function _(E){return e.attempt(i,T,N)(E)}function N(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),C}function C(E){return o>0&&xt(E)?At(e,k,"linePrefix",o+1)(E):k(E)}function k(E){return E===null||et(E)?e.check($1,_,T)(E):(e.enter("codeFlowValue"),P(E))}function P(E){return E===null||et(E)?(e.exit("codeFlowValue"),k(E)):(e.consume(E),P)}function T(E){return e.exit("codeFenced"),t(E)}function S(E,z,D){let K=0;return U;function U(J){return E.enter("lineEnding"),E.consume(J),E.exit("lineEnding"),W}function W(J){return E.enter("codeFencedFence"),xt(J)?At(E,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(J):G(J)}function G(J){return J===u?(E.enter("codeFencedFenceSequence"),R(J)):D(J)}function R(J){return J===u?(K++,E.consume(J),R):K>=l?(E.exit("codeFencedFenceSequence"),xt(J)?At(E,q,"whitespace")(J):q(J)):D(J)}function q(J){return J===null||et(J)?(E.exit("codeFencedFence"),z(J)):D(J)}}}function vK(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Og={name:"codeIndented",tokenize:wK},bK={partial:!0,tokenize:_K};function wK(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),At(e,o,"linePrefix",5)(f)}function o(f){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):et(f)?e.attempt(bK,l,d)(f):(e.enter("codeFlowValue"),u(f))}function u(f){return f===null||et(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),u)}function d(f){return e.exit("codeIndented"),t(f)}}function _K(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):et(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):At(e,o,"linePrefix",5)(l)}function o(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):et(l)?i(l):n(l)}}const SK={name:"codeText",previous:NK,resolve:jK,tokenize:CK};function jK(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function NK(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function CK(e,t,n){let r=0,i,o;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),u(p)}function u(p){return p===96?(e.consume(p),r++,u):(e.exit("codeTextSequence"),d(p))}function d(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),d):p===96?(o=e.enter("codeTextSequence"),i=0,h(p)):et(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(p))}function f(p){return p===null||p===32||p===96||et(p)?(e.exit("codeTextData"),d(p)):(e.consume(p),f)}function h(p){return p===96?(e.consume(p),i++,h):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(o.type="codeTextData",f(p))}}class kK{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&wc(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),wc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),wc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);wc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);wc(this.left,n.reverse())}}}function wc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function _M(e){const t={};let n=-1,r,i,o,l,u,d,f;const h=new kK(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,PK(h,n)),n=t[n],f=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(l=h.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},u=h.slice(i,n),u.unshift(r),h.splice(i,n-i+1,u))}}return Ni(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!f}function PK(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,d=[],f={};let h,p,g=-1,x=n,w=0,_=0;const N=[_];for(;x;){for(;e.get(++i)[1]!==x;);o.push(i),x._tokenizer||(h=r.sliceStream(x),x.next||h.push(null),p&&l.defineSkip(x.start),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(h),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=x,x=x.next}for(x=n;++g<u.length;)u[g][0]==="exit"&&u[g-1][0]==="enter"&&u[g][1].type===u[g-1][1].type&&u[g][1].start.line!==u[g][1].end.line&&(_=g+1,N.push(_),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(l.events=[],x?(x._tokenizer=void 0,x.previous=void 0):N.pop(),g=N.length;g--;){const C=u.slice(N[g],N[g+1]),k=o.pop();d.push([k,k+C.length-1]),e.splice(k,2,C)}for(d.reverse(),g=-1;++g<d.length;)f[w+d[g][0]]=w+d[g][1],w+=d[g][1]-d[g][0]-1;return f}const EK={resolve:AK,tokenize:MK},TK={partial:!0,tokenize:RK};function AK(e){return _M(e),e}function MK(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?o(u):et(u)?e.check(TK,l,o)(u):(e.consume(u),i)}function o(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function RK(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),At(e,o,"linePrefix")}function o(l){if(l===null||et(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function SM(e,t,n,r,i,o,l,u,d){const f=d||Number.POSITIVE_INFINITY;let h=0;return p;function p(C){return C===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(C),e.exit(o),g):C===null||C===32||C===41||a0(C)?n(C):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),_(C))}function g(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),x(C))}function x(C){return C===62?(e.exit("chunkString"),e.exit(u),g(C)):C===null||C===60||et(C)?n(C):(e.consume(C),C===92?w:x)}function w(C){return C===60||C===62||C===92?(e.consume(C),x):x(C)}function _(C){return!h&&(C===null||C===41||Zn(C))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(C)):h<f&&C===40?(e.consume(C),h++,_):C===41?(e.consume(C),h--,_):C===null||C===32||C===40||a0(C)?n(C):(e.consume(C),C===92?N:_)}function N(C){return C===40||C===41||C===92?(e.consume(C),_):_(C)}}function jM(e,t,n,r,i,o){const l=this;let u=0,d;return f;function f(x){return e.enter(r),e.enter(i),e.consume(x),e.exit(i),e.enter(o),h}function h(x){return u>999||x===null||x===91||x===93&&!d||x===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(x):x===93?(e.exit(o),e.enter(i),e.consume(x),e.exit(i),e.exit(r),t):et(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===null||x===91||x===93||et(x)||u++>999?(e.exit("chunkString"),h(x)):(e.consume(x),d||(d=!xt(x)),x===92?g:p)}function g(x){return x===91||x===92||x===93?(e.consume(x),u++,p):p(x)}}function NM(e,t,n,r,i,o){let l;return u;function u(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),l=g===40?41:g,d):n(g)}function d(g){return g===l?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(o),f(g))}function f(g){return g===l?(e.exit(o),d(l)):g===null?n(g):et(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),At(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===l||g===null||et(g)?(e.exit("chunkString"),f(g)):(e.consume(g),g===92?p:h)}function p(g){return g===l||g===92?(e.consume(g),h):h(g)}}function zc(e,t){let n;return r;function r(i){return et(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):xt(i)?At(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const OK={name:"definition",tokenize:DK},IK={partial:!0,tokenize:LK};function DK(e,t,n){const r=this;let i;return o;function o(x){return e.enter("definition"),l(x)}function l(x){return jM.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function u(x){return i=Wo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),d):n(x)}function d(x){return Zn(x)?zc(e,f)(x):f(x)}function f(x){return SM(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function h(x){return e.attempt(IK,p,p)(x)}function p(x){return xt(x)?At(e,g,"whitespace")(x):g(x)}function g(x){return x===null||et(x)?(e.exit("definition"),r.parser.defined.push(i),t(x)):n(x)}}function LK(e,t,n){return r;function r(u){return Zn(u)?zc(e,i)(u):n(u)}function i(u){return NM(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return xt(u)?At(e,l,"whitespace")(u):l(u)}function l(u){return u===null||et(u)?t(u):n(u)}}const qK={name:"hardBreakEscape",tokenize:FK};function FK(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return et(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const zK={name:"headingAtx",resolve:BK,tokenize:VK};function BK(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ni(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function VK(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),o(h)}function o(h){return e.enter("atxHeadingSequence"),l(h)}function l(h){return h===35&&r++<6?(e.consume(h),l):h===null||Zn(h)?(e.exit("atxHeadingSequence"),u(h)):n(h)}function u(h){return h===35?(e.enter("atxHeadingSequence"),d(h)):h===null||et(h)?(e.exit("atxHeading"),t(h)):xt(h)?At(e,u,"whitespace")(h):(e.enter("atxHeadingText"),f(h))}function d(h){return h===35?(e.consume(h),d):(e.exit("atxHeadingSequence"),u(h))}function f(h){return h===null||h===35||Zn(h)?(e.exit("atxHeadingText"),u(h)):(e.consume(h),f)}}const $K=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],W1=["pre","script","style","textarea"],UK={concrete:!0,name:"htmlFlow",resolveTo:KK,tokenize:GK},WK={partial:!0,tokenize:YK},HK={partial:!0,tokenize:QK};function KK(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function GK(e,t,n){const r=this;let i,o,l,u,d;return f;function f(I){return h(I)}function h(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),p}function p(I){return I===33?(e.consume(I),g):I===47?(e.consume(I),o=!0,_):I===63?(e.consume(I),i=3,r.interrupt?t:M):pi(I)?(e.consume(I),l=String.fromCharCode(I),N):n(I)}function g(I){return I===45?(e.consume(I),i=2,x):I===91?(e.consume(I),i=5,u=0,w):pi(I)?(e.consume(I),i=4,r.interrupt?t:M):n(I)}function x(I){return I===45?(e.consume(I),r.interrupt?t:M):n(I)}function w(I){const de="CDATA[";return I===de.charCodeAt(u++)?(e.consume(I),u===de.length?r.interrupt?t:G:w):n(I)}function _(I){return pi(I)?(e.consume(I),l=String.fromCharCode(I),N):n(I)}function N(I){if(I===null||I===47||I===62||Zn(I)){const de=I===47,Ne=l.toLowerCase();return!de&&!o&&W1.includes(Ne)?(i=1,r.interrupt?t(I):G(I)):$K.includes(l.toLowerCase())?(i=6,de?(e.consume(I),C):r.interrupt?t(I):G(I)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):o?k(I):P(I))}return I===45||mr(I)?(e.consume(I),l+=String.fromCharCode(I),N):n(I)}function C(I){return I===62?(e.consume(I),r.interrupt?t:G):n(I)}function k(I){return xt(I)?(e.consume(I),k):U(I)}function P(I){return I===47?(e.consume(I),U):I===58||I===95||pi(I)?(e.consume(I),T):xt(I)?(e.consume(I),P):U(I)}function T(I){return I===45||I===46||I===58||I===95||mr(I)?(e.consume(I),T):S(I)}function S(I){return I===61?(e.consume(I),E):xt(I)?(e.consume(I),S):P(I)}function E(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),d=I,z):xt(I)?(e.consume(I),E):D(I)}function z(I){return I===d?(e.consume(I),d=null,K):I===null||et(I)?n(I):(e.consume(I),z)}function D(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Zn(I)?S(I):(e.consume(I),D)}function K(I){return I===47||I===62||xt(I)?P(I):n(I)}function U(I){return I===62?(e.consume(I),W):n(I)}function W(I){return I===null||et(I)?G(I):xt(I)?(e.consume(I),W):n(I)}function G(I){return I===45&&i===2?(e.consume(I),ae):I===60&&i===1?(e.consume(I),re):I===62&&i===4?(e.consume(I),B):I===63&&i===3?(e.consume(I),M):I===93&&i===5?(e.consume(I),Y):et(I)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(WK,Z,R)(I)):I===null||et(I)?(e.exit("htmlFlowData"),R(I)):(e.consume(I),G)}function R(I){return e.check(HK,q,Z)(I)}function q(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),J}function J(I){return I===null||et(I)?R(I):(e.enter("htmlFlowData"),G(I))}function ae(I){return I===45?(e.consume(I),M):G(I)}function re(I){return I===47?(e.consume(I),l="",L):G(I)}function L(I){if(I===62){const de=l.toLowerCase();return W1.includes(de)?(e.consume(I),B):G(I)}return pi(I)&&l.length<8?(e.consume(I),l+=String.fromCharCode(I),L):G(I)}function Y(I){return I===93?(e.consume(I),M):G(I)}function M(I){return I===62?(e.consume(I),B):I===45&&i===2?(e.consume(I),M):G(I)}function B(I){return I===null||et(I)?(e.exit("htmlFlowData"),Z(I)):(e.consume(I),B)}function Z(I){return e.exit("htmlFlow"),t(I)}}function QK(e,t,n){const r=this;return i;function i(l){return et(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function YK(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Gm,t,n)}}const XK={name:"htmlText",tokenize:JK};function JK(e,t,n){const r=this;let i,o,l;return u;function u(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),d}function d(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),S):M===63?(e.consume(M),P):pi(M)?(e.consume(M),D):n(M)}function f(M){return M===45?(e.consume(M),h):M===91?(e.consume(M),o=0,w):pi(M)?(e.consume(M),k):n(M)}function h(M){return M===45?(e.consume(M),x):n(M)}function p(M){return M===null?n(M):M===45?(e.consume(M),g):et(M)?(l=p,re(M)):(e.consume(M),p)}function g(M){return M===45?(e.consume(M),x):p(M)}function x(M){return M===62?ae(M):M===45?g(M):p(M)}function w(M){const B="CDATA[";return M===B.charCodeAt(o++)?(e.consume(M),o===B.length?_:w):n(M)}function _(M){return M===null?n(M):M===93?(e.consume(M),N):et(M)?(l=_,re(M)):(e.consume(M),_)}function N(M){return M===93?(e.consume(M),C):_(M)}function C(M){return M===62?ae(M):M===93?(e.consume(M),C):_(M)}function k(M){return M===null||M===62?ae(M):et(M)?(l=k,re(M)):(e.consume(M),k)}function P(M){return M===null?n(M):M===63?(e.consume(M),T):et(M)?(l=P,re(M)):(e.consume(M),P)}function T(M){return M===62?ae(M):P(M)}function S(M){return pi(M)?(e.consume(M),E):n(M)}function E(M){return M===45||mr(M)?(e.consume(M),E):z(M)}function z(M){return et(M)?(l=z,re(M)):xt(M)?(e.consume(M),z):ae(M)}function D(M){return M===45||mr(M)?(e.consume(M),D):M===47||M===62||Zn(M)?K(M):n(M)}function K(M){return M===47?(e.consume(M),ae):M===58||M===95||pi(M)?(e.consume(M),U):et(M)?(l=K,re(M)):xt(M)?(e.consume(M),K):ae(M)}function U(M){return M===45||M===46||M===58||M===95||mr(M)?(e.consume(M),U):W(M)}function W(M){return M===61?(e.consume(M),G):et(M)?(l=W,re(M)):xt(M)?(e.consume(M),W):K(M)}function G(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),i=M,R):et(M)?(l=G,re(M)):xt(M)?(e.consume(M),G):(e.consume(M),q)}function R(M){return M===i?(e.consume(M),i=void 0,J):M===null?n(M):et(M)?(l=R,re(M)):(e.consume(M),R)}function q(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||Zn(M)?K(M):(e.consume(M),q)}function J(M){return M===47||M===62||Zn(M)?K(M):n(M)}function ae(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function re(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),L}function L(M){return xt(M)?At(e,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):Y(M)}function Y(M){return e.enter("htmlTextData"),l(M)}}const yv={name:"labelEnd",resolveAll:nG,resolveTo:rG,tokenize:iG},ZK={tokenize:aG},eG={tokenize:sG},tG={tokenize:oG};function nG(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Ni(e,0,e.length,n),e}function rG(e,t){let n=e.length,r=0,i,o,l,u;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const d={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},h={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",d,t],["enter",f,t]],u=Mr(u,e.slice(o+1,o+r+3)),u=Mr(u,[["enter",h,t]]),u=Mr(u,gv(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),u=Mr(u,[["exit",h,t],e[l-2],e[l-1],["exit",f,t]]),u=Mr(u,e.slice(l+1)),u=Mr(u,[["exit",d,t]]),Ni(e,o,e.length,u),e}function iG(e,t,n){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return u;function u(g){return o?o._inactive?p(g):(l=r.parser.defined.includes(Wo(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),d):n(g)}function d(g){return g===40?e.attempt(ZK,h,l?h:p)(g):g===91?e.attempt(eG,h,l?f:p)(g):l?h(g):p(g)}function f(g){return e.attempt(tG,h,p)(g)}function h(g){return t(g)}function p(g){return o._balanced=!0,n(g)}}function aG(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return Zn(p)?zc(e,o)(p):o(p)}function o(p){return p===41?h(p):SM(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return Zn(p)?zc(e,d)(p):h(p)}function u(p){return n(p)}function d(p){return p===34||p===39||p===40?NM(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):h(p)}function f(p){return Zn(p)?zc(e,h)(p):h(p)}function h(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function sG(e,t,n){const r=this;return i;function i(u){return jM.call(r,e,o,l,"reference","referenceMarker","referenceString")(u)}function o(u){return r.parser.defined.includes(Wo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function oG(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const lG={name:"labelStartImage",resolveAll:yv.resolveAll,tokenize:cG};function cG(e,t,n){const r=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),o}function o(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const uG={name:"labelStartLink",resolveAll:yv.resolveAll,tokenize:dG};function dG(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Ig={name:"lineEnding",tokenize:fG};function fG(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),At(e,t,"linePrefix")}}const Ef={name:"thematicBreak",tokenize:mG};function mG(e,t,n){let r=0,i;return o;function o(f){return e.enter("thematicBreak"),l(f)}function l(f){return i=f,u(f)}function u(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||et(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),xt(f)?At(e,u,"whitespace")(f):u(f))}}const Kn={continuation:{tokenize:yG},exit:vG,name:"list",tokenize:gG},hG={partial:!0,tokenize:bG},pG={partial:!0,tokenize:xG};function gG(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return u;function u(x){const w=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:s0(x)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(Ef,n,f)(x):f(x);if(!r.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(x)}return n(x)}function d(x){return s0(x)&&++l<10?(e.consume(x),d):(!r.interrupt||l<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),f(x)):n(x)}function f(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,e.check(Gm,r.interrupt?n:h,e.attempt(hG,g,p))}function h(x){return r.containerState.initialBlankLine=!0,o++,g(x)}function p(x){return xt(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),g):n(x)}function g(x){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function yG(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Gm,i,o);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,At(e,t,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!xt(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(pG,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,At(e,e.attempt(Kn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function xG(e,t,n){const r=this;return At(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function vG(e){e.exit(this.containerState.type)}function bG(e,t,n){const r=this;return At(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!xt(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const H1={name:"setextUnderline",resolveTo:wG,tokenize:_G};function wG(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function _G(e,t,n){const r=this;let i;return o;function o(f){let h=r.events.length,p;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){p=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),u(f)}function u(f){return f===i?(e.consume(f),u):(e.exit("setextHeadingLineSequence"),xt(f)?At(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||et(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const SG={tokenize:jG};function jG(e){const t=this,n=e.attempt(Gm,r,e.attempt(this.parser.constructs.flowInitial,i,At(e,e.attempt(this.parser.constructs.flow,i,e.attempt(EK,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const NG={resolveAll:kM()},CG=CM("string"),kG=CM("text");function CM(e){return{resolveAll:kM(e==="text"?PG:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,u);return l;function l(h){return f(h)?o(h):u(h)}function u(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),d}function d(h){return f(h)?(n.exit("data"),o(h)):(n.consume(h),d)}function f(h){if(h===null)return!0;const p=i[h];let g=-1;if(p)for(;++g<p.length;){const x=p[g];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function kM(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function PG(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,l=-1,u=0,d;for(;o--;){const f=i[o];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(f===-2)d=!0,u++;else if(f!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const f={type:n===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const EG={42:Kn,43:Kn,45:Kn,48:Kn,49:Kn,50:Kn,51:Kn,52:Kn,53:Kn,54:Kn,55:Kn,56:Kn,57:Kn,62:vM},TG={91:OK},AG={[-2]:Og,[-1]:Og,32:Og},MG={35:zK,42:Ef,45:[H1,Ef],60:UK,61:H1,95:Ef,96:U1,126:U1},RG={38:wM,92:bM},OG={[-5]:Ig,[-4]:Ig,[-3]:Ig,33:lG,38:wM,42:o0,60:[uK,XK],91:uG,92:[qK,bM],93:yv,95:o0,96:SK},IG={null:[o0,NG]},DG={null:[42,95]},LG={null:[]},qG=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:DG,contentInitial:TG,disable:LG,document:EG,flow:MG,flowInitial:AG,insideSpan:IG,string:RG,text:OG},Symbol.toStringTag,{value:"Module"}));function FG(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let l=[],u=[];const d={attempt:z(S),check:z(E),consume:k,enter:P,exit:T,interrupt:z(E,{interrupt:!0})},f={code:null,containerState:{},defineSkip:_,events:[],now:w,parser:e,previous:null,sliceSerialize:g,sliceStream:x,write:p};let h=t.tokenize.call(f,d);return t.resolveAll&&o.push(t),f;function p(W){return l=Mr(l,W),N(),l[l.length-1]!==null?[]:(D(t,0),f.events=gv(o,f.events,f),f.events)}function g(W,G){return BG(x(W),G)}function x(W){return zG(l,W)}function w(){const{_bufferIndex:W,_index:G,line:R,column:q,offset:J}=r;return{_bufferIndex:W,_index:G,line:R,column:q,offset:J}}function _(W){i[W.line]=W.column,U()}function N(){let W;for(;r._index<l.length;){const G=l[r._index];if(typeof G=="string")for(W=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===W&&r._bufferIndex<G.length;)C(G.charCodeAt(r._bufferIndex));else C(G)}}function C(W){h=h(W)}function k(W){et(W)?(r.line++,r.column=1,r.offset+=W===-3?2:1,U()):W!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=W}function P(W,G){const R=G||{};return R.type=W,R.start=w(),f.events.push(["enter",R,f]),u.push(R),R}function T(W){const G=u.pop();return G.end=w(),f.events.push(["exit",G,f]),G}function S(W,G){D(W,G.from)}function E(W,G){G.restore()}function z(W,G){return R;function R(q,J,ae){let re,L,Y,M;return Array.isArray(q)?Z(q):"tokenize"in q?Z([q]):B(q);function B(_e){return le;function le(we){const je=we!==null&&_e[we],Se=we!==null&&_e.null,se=[...Array.isArray(je)?je:je?[je]:[],...Array.isArray(Se)?Se:Se?[Se]:[]];return Z(se)(we)}}function Z(_e){return re=_e,L=0,_e.length===0?ae:I(_e[L])}function I(_e){return le;function le(we){return M=K(),Y=_e,_e.partial||(f.currentConstruct=_e),_e.name&&f.parser.constructs.disable.null.includes(_e.name)?Ne():_e.tokenize.call(G?Object.assign(Object.create(f),G):f,d,de,Ne)(we)}}function de(_e){return W(Y,M),J}function Ne(_e){return M.restore(),++L<re.length?I(re[L]):ae}}}function D(W,G){W.resolveAll&&!o.includes(W)&&o.push(W),W.resolve&&Ni(f.events,G,f.events.length-G,W.resolve(f.events.slice(G),f)),W.resolveTo&&(f.events=W.resolveTo(f.events,f))}function K(){const W=w(),G=f.previous,R=f.currentConstruct,q=f.events.length,J=Array.from(u);return{from:q,restore:ae};function ae(){r=W,f.previous=G,f.currentConstruct=R,f.events.length=q,u=J,U()}}function U(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function zG(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,o)];else{if(l=e.slice(n,i),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function BG(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
||
`;break}case-3:{l=`\r
|
||
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function VG(e){const r={constructs:QH([qG,...(e||{}).extensions||[]]),content:i(rK),defined:[],document:i(aK),flow:i(SG),lazy:{},string:i(CG),text:i(kG)};return r;function i(o){return l;function l(u){return FG(r,o,u)}}}function $G(e){for(;!_M(e););return e}const K1=/[\0\t\n\r]/g;function UG(){let e=1,t="",n=!0,r;return i;function i(o,l,u){const d=[];let f,h,p,g,x;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),p=0,t="",n&&(o.charCodeAt(0)===65279&&p++,n=void 0);p<o.length;){if(K1.lastIndex=p,f=K1.exec(o),g=f&&f.index!==void 0?f.index:o.length,x=o.charCodeAt(g),!f){t=o.slice(p);break}if(x===10&&p===g&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),p<g&&(d.push(o.slice(p,g)),e+=g-p),x){case 0:{d.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,d.push(-2);e++<h;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}p=g+1}return u&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const WG=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function HG(e){return e.replace(WG,KG)}function KG(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return xM(n.slice(o?2:1),o?16:10)}return pv(n)||e}const PM={}.hasOwnProperty;function GG(e,t,n){return typeof t!="string"&&(n=t,t=void 0),QG(n)($G(VG(n).document().write(UG()(e,t,!0))))}function QG(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(rt),autolinkProtocol:K,autolinkEmail:K,atxHeading:o(Mt),blockQuote:o(Se),characterEscape:K,characterReference:K,codeFenced:o(se),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(se,l),codeText:o(be,l),codeTextData:K,data:K,codeFlowValue:K,definition:o(ce),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Pe),hardBreakEscape:o(Rt),hardBreakTrailing:o(Rt),htmlFlow:o(pe,l),htmlFlowData:K,htmlText:o(pe,l),htmlTextData:K,image:o(Ye),label:l,link:o(rt),listItem:o(xe),listItemValue:g,listOrdered:o(te,p),listUnordered:o(te),paragraph:o(Je),reference:I,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(Mt),strong:o(We),thematicBreak:o(gt)},exit:{atxHeading:d(),atxHeadingSequence:S,autolink:d(),autolinkEmail:je,autolinkProtocol:we,blockQuote:d(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:Ne,characterReferenceMarkerNumeric:Ne,characterReferenceValue:_e,characterReference:le,codeFenced:d(N),codeFencedFence:_,codeFencedFenceInfo:x,codeFencedFenceMeta:w,codeFlowValue:U,codeIndented:d(C),codeText:d(J),codeTextData:U,data:U,definition:d(),definitionDestinationString:T,definitionLabelString:k,definitionTitleString:P,emphasis:d(),hardBreakEscape:d(G),hardBreakTrailing:d(G),htmlFlow:d(R),htmlFlowData:U,htmlText:d(q),htmlTextData:U,image:d(re),label:Y,labelText:L,lineEnding:W,link:d(ae),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:de,resourceDestinationString:M,resourceTitleString:B,resource:Z,setextHeading:d(D),setextHeadingLineSequence:z,setextHeadingText:E,strong:d(),thematicBreak:d()}};EM(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ie){let ge={type:"root",children:[]};const De={stack:[ge],tokenStack:[],config:t,enter:u,exit:f,buffer:l,resume:h,data:n},qe=[];let Ve=-1;for(;++Ve<ie.length;)if(ie[Ve][1].type==="listOrdered"||ie[Ve][1].type==="listUnordered")if(ie[Ve][0]==="enter")qe.push(Ve);else{const Ot=qe.pop();Ve=i(ie,Ot,Ve)}for(Ve=-1;++Ve<ie.length;){const Ot=t[ie[Ve][0]];PM.call(Ot,ie[Ve][1].type)&&Ot[ie[Ve][1].type].call(Object.assign({sliceSerialize:ie[Ve][2].sliceSerialize},De),ie[Ve][1])}if(De.tokenStack.length>0){const Ot=De.tokenStack[De.tokenStack.length-1];(Ot[1]||G1).call(De,void 0,Ot[0])}for(ge.position={start:_a(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:_a(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<t.transforms.length;)ge=t.transforms[Ve](ge)||ge;return ge}function i(ie,ge,De){let qe=ge-1,Ve=-1,Ot=!1,Dr,ar,ea,Za;for(;++qe<=De;){const yn=ie[qe];switch(yn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{yn[0]==="enter"?Ve++:Ve--,Za=void 0;break}case"lineEndingBlank":{yn[0]==="enter"&&(Dr&&!Za&&!Ve&&!ea&&(ea=qe),Za=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Za=void 0}if(!Ve&&yn[0]==="enter"&&yn[1].type==="listItemPrefix"||Ve===-1&&yn[0]==="exit"&&(yn[1].type==="listUnordered"||yn[1].type==="listOrdered")){if(Dr){let ti=qe;for(ar=void 0;ti--;){const sr=ie[ti];if(sr[1].type==="lineEnding"||sr[1].type==="lineEndingBlank"){if(sr[0]==="exit")continue;ar&&(ie[ar][1].type="lineEndingBlank",Ot=!0),sr[1].type="lineEnding",ar=ti}else if(!(sr[1].type==="linePrefix"||sr[1].type==="blockQuotePrefix"||sr[1].type==="blockQuotePrefixWhitespace"||sr[1].type==="blockQuoteMarker"||sr[1].type==="listItemIndent"))break}ea&&(!ar||ea<ar)&&(Dr._spread=!0),Dr.end=Object.assign({},ar?ie[ar][1].start:yn[1].end),ie.splice(ar||qe,0,["exit",Dr,yn[2]]),qe++,De++}if(yn[1].type==="listItemPrefix"){const ti={type:"listItem",_spread:!1,start:Object.assign({},yn[1].start),end:void 0};Dr=ti,ie.splice(qe,0,["enter",ti,yn[2]]),qe++,De++,ea=void 0,Za=!0}}}return ie[ge][1]._spread=Ot,De}function o(ie,ge){return De;function De(qe){u.call(this,ie(qe),qe),ge&&ge.call(this,qe)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(ie,ge,De){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([ge,De||void 0]),ie.position={start:_a(ge.start),end:void 0}}function d(ie){return ge;function ge(De){ie&&ie.call(this,De),f.call(this,De)}}function f(ie,ge){const De=this.stack.pop(),qe=this.tokenStack.pop();if(qe)qe[0].type!==ie.type&&(ge?ge.call(this,ie,qe[0]):(qe[1]||G1).call(this,ie,qe[0]));else throw new Error("Cannot close `"+ie.type+"` ("+Fc({start:ie.start,end:ie.end})+"): it’s not open");De.position.end=_a(ie.end)}function h(){return KH(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function g(ie){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function x(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=ie}function w(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=ie}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ie.replace(/(\r?\n|\r)$/g,"")}function k(ie){const ge=this.resume(),De=this.stack[this.stack.length-1];De.label=ge,De.identifier=Wo(this.sliceSerialize(ie)).toLowerCase()}function P(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ie}function T(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ie}function S(ie){const ge=this.stack[this.stack.length-1];if(!ge.depth){const De=this.sliceSerialize(ie).length;ge.depth=De}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function z(ie){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function K(ie){const De=this.stack[this.stack.length-1].children;let qe=De[De.length-1];(!qe||qe.type!=="text")&&(qe=Ct(),qe.position={start:_a(ie.start),end:void 0},De.push(qe)),this.stack.push(qe)}function U(ie){const ge=this.stack.pop();ge.value+=this.sliceSerialize(ie),ge.position.end=_a(ie.end)}function W(ie){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=ge.children[ge.children.length-1];De.position.end=_a(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ge.type)&&(K.call(this,ie),U.call(this,ie))}function G(){this.data.atHardBreak=!0}function R(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ie}function q(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ie}function J(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.value=ie}function ae(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ge,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function re(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ge,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function L(ie){const ge=this.sliceSerialize(ie),De=this.stack[this.stack.length-2];De.label=HG(ge),De.identifier=Wo(ge).toLowerCase()}function Y(){const ie=this.stack[this.stack.length-1],ge=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const qe=ie.children;De.children=qe}else De.alt=ge}function M(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.url=ie}function B(){const ie=this.resume(),ge=this.stack[this.stack.length-1];ge.title=ie}function Z(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function de(ie){const ge=this.resume(),De=this.stack[this.stack.length-1];De.label=ge,De.identifier=Wo(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function Ne(ie){this.data.characterReferenceType=ie.type}function _e(ie){const ge=this.sliceSerialize(ie),De=this.data.characterReferenceType;let qe;De?(qe=xM(ge,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):qe=pv(ge);const Ve=this.stack[this.stack.length-1];Ve.value+=qe}function le(ie){const ge=this.stack.pop();ge.position.end=_a(ie.end)}function we(ie){U.call(this,ie);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(ie)}function je(ie){U.call(this,ie);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(ie)}function Se(){return{type:"blockquote",children:[]}}function se(){return{type:"code",lang:null,meta:null,value:""}}function be(){return{type:"inlineCode",value:""}}function ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pe(){return{type:"emphasis",children:[]}}function Mt(){return{type:"heading",depth:0,children:[]}}function Rt(){return{type:"break"}}function pe(){return{type:"html",value:""}}function Ye(){return{type:"image",title:null,url:"",alt:null}}function rt(){return{type:"link",title:null,url:"",children:[]}}function te(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function xe(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function Je(){return{type:"paragraph",children:[]}}function We(){return{type:"strong",children:[]}}function Ct(){return{type:"text",value:""}}function gt(){return{type:"thematicBreak"}}}function _a(e){return{line:e.line,column:e.column,offset:e.offset}}function EM(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?EM(e,r):YG(e,r)}}function YG(e,t){let n;for(n in t)if(PM.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function G1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Fc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Fc({start:t.start,end:t.end})+") is still open")}function XG(e){const t=this;t.parser=n;function n(r){return GG(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function JG(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function ZG(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
||
`}]}function eQ(e,t){const n=t.value?t.value+`
|
||
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function tQ(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nQ(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rQ(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Pl(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,u+=1,e.footnoteCounts.set(r,u);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function iQ(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aQ(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function TM(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function sQ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return TM(e,t);const i={src:Pl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function oQ(e,t){const n={src:Pl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function lQ(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function cQ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return TM(e,t);const i={href:Pl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function uQ(e,t){const n={href:Pl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function dQ(e,t,n){const r=e.all(t),i=n?fQ(n):AM(t),o={},l=[];if(typeof t.checked=="boolean"){const h=r[0];let p;h&&h.type==="element"&&h.tagName==="p"?p=h:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const h=r[u];(i||u!==0||h.type!=="element"||h.tagName!=="p")&&l.push({type:"text",value:`
|
||
`}),h.type==="element"&&h.tagName==="p"&&!i?l.push(...h.children):l.push(h)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
||
`});const f={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,f),e.applyData(t,f)}function fQ(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=AM(n[r])}return t}function AM(e){const t=e.spread;return t??e.children.length>1}function mQ(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function hQ(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pQ(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function gQ(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yQ(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=dv(t.children[1]),d=dM(t.children[t.children.length-1]);u&&d&&(l.position={start:u,end:d}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function xQ(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let d=-1;const f=[];for(;++d<u;){const p=t.children[d],g={},x=l?l[d]:void 0;x&&(g.align=x);let w={type:"element",tagName:o,properties:g,children:[]};p&&(w.children=e.all(p),e.patch(p,w),w=e.applyData(p,w)),f.push(w)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,h),e.applyData(t,h)}function vQ(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Q1=9,Y1=32;function bQ(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(X1(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(X1(t.slice(i),i>0,!1)),o.join("")}function X1(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Q1||o===Y1;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Q1||o===Y1;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function wQ(e,t){const n={type:"text",value:bQ(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function _Q(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const SQ={blockquote:JG,break:ZG,code:eQ,delete:tQ,emphasis:nQ,footnoteReference:rQ,heading:iQ,html:aQ,imageReference:sQ,image:oQ,inlineCode:lQ,linkReference:cQ,link:uQ,listItem:dQ,list:mQ,paragraph:hQ,root:pQ,strong:gQ,table:yQ,tableCell:vQ,tableRow:xQ,text:wQ,thematicBreak:_Q,toml:cf,yaml:cf,definition:cf,footnoteDefinition:cf};function cf(){}const MM=-1,Qm=0,Bc=1,am=2,xv=3,vv=4,bv=5,wv=6,RM=7,OM=8,J1=typeof self=="object"?self:globalThis,jQ=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=t[i];switch(o){case Qm:case MM:return n(l,i);case Bc:{const u=n([],i);for(const d of l)u.push(r(d));return u}case am:{const u=n({},i);for(const[d,f]of l)u[r(d)]=r(f);return u}case xv:return n(new Date(l),i);case vv:{const{source:u,flags:d}=l;return n(new RegExp(u,d),i)}case bv:{const u=n(new Map,i);for(const[d,f]of l)u.set(r(d),r(f));return u}case wv:{const u=n(new Set,i);for(const d of l)u.add(r(d));return u}case RM:{const{name:u,message:d}=l;return n(new J1[u](d),i)}case OM:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(new J1[o](l),i)};return r},Z1=e=>jQ(new Map,e)(0),Ro="",{toString:NQ}={},{keys:CQ}=Object,_c=e=>{const t=typeof e;if(t!=="object"||!e)return[Qm,t];const n=NQ.call(e).slice(8,-1);switch(n){case"Array":return[Bc,Ro];case"Object":return[am,Ro];case"Date":return[xv,Ro];case"RegExp":return[vv,Ro];case"Map":return[bv,Ro];case"Set":return[wv,Ro];case"DataView":return[Bc,n]}return n.includes("Array")?[Bc,n]:n.includes("Error")?[RM,n]:[am,n]},uf=([e,t])=>e===Qm&&(t==="function"||t==="symbol"),kQ=(e,t,n,r)=>{const i=(l,u)=>{const d=r.push(l)-1;return n.set(u,d),d},o=l=>{if(n.has(l))return n.get(l);let[u,d]=_c(l);switch(u){case Qm:{let h=l;switch(d){case"bigint":u=OM,h=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);h=null;break;case"undefined":return i([MM],l)}return i([u,h],l)}case Bc:{if(d){let g=l;return d==="DataView"?g=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(g=new Uint8Array(l)),i([d,[...g]],l)}const h=[],p=i([u,h],l);for(const g of l)h.push(o(g));return p}case am:{if(d)switch(d){case"BigInt":return i([d,l.toString()],l);case"Boolean":case"Number":case"String":return i([d,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const h=[],p=i([u,h],l);for(const g of CQ(l))(e||!uf(_c(l[g])))&&h.push([o(g),o(l[g])]);return p}case xv:return i([u,l.toISOString()],l);case vv:{const{source:h,flags:p}=l;return i([u,{source:h,flags:p}],l)}case bv:{const h=[],p=i([u,h],l);for(const[g,x]of l)(e||!(uf(_c(g))||uf(_c(x))))&&h.push([o(g),o(x)]);return p}case wv:{const h=[],p=i([u,h],l);for(const g of l)(e||!uf(_c(g)))&&h.push(o(g));return p}}const{message:f}=l;return i([u,{name:d,message:f}],l)};return o},eN=(e,{json:t,lossy:n}={})=>{const r=[];return kQ(!(t||n),!!t,new Map,r)(e),r},sm=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Z1(eN(e,t)):structuredClone(e):(e,t)=>Z1(eN(e,t));function PQ(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function EQ(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function TQ(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||PQ,r=e.options.footnoteBackLabel||EQ,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const h=e.all(f),p=String(f.identifier).toUpperCase(),g=Pl(p.toLowerCase());let x=0;const w=[],_=e.footnoteCounts.get(p);for(;_!==void 0&&++x<=_;){w.length>0&&w.push({type:"text",value:" "});let k=typeof n=="string"?n:n(d,x);typeof k=="string"&&(k={type:"text",value:k}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,x),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const N=h[h.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const k=N.children[N.children.length-1];k&&k.type==="text"?k.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...w)}else h.push(...w);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(h,!0)};e.patch(f,C),u.push(C)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...sm(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
||
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
||
`}]}}const IM=(function(e){if(e==null)return OQ;if(typeof e=="function")return Ym(e);if(typeof e=="object")return Array.isArray(e)?AQ(e):MQ(e);if(typeof e=="string")return RQ(e);throw new Error("Expected function, string, or object as test")});function AQ(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=IM(e[n]);return Ym(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function MQ(e){const t=e;return Ym(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function RQ(e){return Ym(t);function t(n){return n&&n.type===e}}function Ym(e){return t;function t(n,r,i){return!!(IQ(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function OQ(){return!0}function IQ(e){return e!==null&&typeof e=="object"&&"type"in e}const DM=[],DQ=!0,tN=!1,LQ="skip";function qQ(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=IM(i),l=r?-1:1;u(e,void 0,[])();function u(d,f,h){const p=d&&typeof d=="object"?d:{};if(typeof p.type=="string"){const x=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(d.type+(x?"<"+x+">":""))+")"})}return g;function g(){let x=DM,w,_,N;if((!t||o(d,f,h[h.length-1]||void 0))&&(x=FQ(n(d,h)),x[0]===tN))return x;if("children"in d&&d.children){const C=d;if(C.children&&x[0]!==LQ)for(_=(r?C.children.length:-1)+l,N=h.concat(C);_>-1&&_<C.children.length;){const k=C.children[_];if(w=u(k,_,N)(),w[0]===tN)return w;_=typeof w[1]=="number"?w[1]:_+l}}return x}}}function FQ(e){return Array.isArray(e)?e:typeof e=="number"?[DQ,e]:e==null?DM:[e]}function LM(e,t,n,r){let i,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,i=n):(o=t,l=n,i=r),qQ(e,o,u,i);function u(d,f){const h=f[f.length-1],p=h?h.children.indexOf(d):void 0;return l(d,p,h)}}const l0={}.hasOwnProperty,zQ={};function BQ(e,t){const n=t||zQ,r=new Map,i=new Map,o=new Map,l={...SQ,...n.handlers},u={all:f,applyData:$Q,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:d,options:n,patch:VQ,wrap:WQ};return LM(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const p=h.type==="definition"?r:i,g=String(h.identifier).toUpperCase();p.has(g)||p.set(g,h)}}),u;function d(h,p){const g=h.type,x=u.handlers[g];if(l0.call(u.handlers,g)&&x)return x(u,h,p);if(u.options.passThrough&&u.options.passThrough.includes(g)){if("children"in h){const{children:_,...N}=h,C=sm(N);return C.children=u.all(h),C}return sm(h)}return(u.options.unknownHandler||UQ)(u,h,p)}function f(h){const p=[];if("children"in h){const g=h.children;let x=-1;for(;++x<g.length;){const w=u.one(g[x],h);if(w){if(x&&g[x-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=nN(w.value)),!Array.isArray(w)&&w.type==="element")){const _=w.children[0];_&&_.type==="text"&&(_.value=nN(_.value))}Array.isArray(w)?p.push(...w):p.push(w)}}}return p}}function VQ(e,t){e.position&&(t.position=NH(e))}function $Q(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&o&&Object.assign(n.properties,sm(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function UQ(e,t){const n=t.data||{},r="value"in t&&!(l0.call(n,"hProperties")||l0.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function WQ(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
||
`});++r<e.length;)r&&n.push({type:"text",value:`
|
||
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
||
`}),n}function nN(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function rN(e,t){const n=BQ(e,t),r=n.one(e,void 0),i=TQ(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
||
`},i),o}function HQ(e,t){return e&&"run"in e?async function(n,r){const i=rN(n,{file:r,...t});await e.run(i,r)}:function(n,r){return rN(n,{file:r,...e||t})}}function iN(e){if(e)throw e}var Dg,aN;function KQ(){if(aN)return Dg;aN=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},o=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var h=e.call(f,"constructor"),p=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!h&&!p)return!1;var g;for(g in f);return typeof g>"u"||e.call(f,g)},l=function(f,h){n&&h.name==="__proto__"?n(f,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):f[h.name]=h.newValue},u=function(f,h){if(h==="__proto__")if(e.call(f,h)){if(r)return r(f,h).value}else return;return f[h]};return Dg=function d(){var f,h,p,g,x,w,_=arguments[0],N=1,C=arguments.length,k=!1;for(typeof _=="boolean"&&(k=_,_=arguments[1]||{},N=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});N<C;++N)if(f=arguments[N],f!=null)for(h in f)p=u(_,h),g=u(f,h),_!==g&&(k&&g&&(o(g)||(x=i(g)))?(x?(x=!1,w=p&&i(p)?p:[]):w=p&&o(p)?p:{},l(_,{name:h,newValue:d(k,w,g)})):typeof g<"u"&&l(_,{name:h,newValue:g}));return _},Dg}var GQ=KQ();const Lg=cu(GQ);function c0(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function QQ(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...i);function u(d,...f){const h=e[++o];let p=-1;if(d){l(d);return}for(;++p<i.length;)(f[p]===null||f[p]===void 0)&&(f[p]=i[p]);i=f,h?YQ(h,u)(...f):l(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function YQ(e,t){let n;return r;function r(...l){const u=e.length>l.length;let d;u&&l.push(i);try{d=e.apply(this,l)}catch(f){const h=f;if(u&&n)throw h;return i(h)}u||(d&&d.then&&typeof d.then=="function"?d.then(o,i):d instanceof Error?i(d):o(d))}function i(l,...u){n||(n=!0,t(l,...u))}function o(l){i(null,l)}}const ci={basename:XQ,dirname:JQ,extname:ZQ,join:eY,sep:"/"};function XQ(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ru(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function JQ(e){if(Ru(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function ZQ(e){Ru(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function eY(...e){let t=-1,n;for(;++t<e.length;)Ru(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":tY(n)}function tY(e){Ru(e);const t=e.codePointAt(0)===47;let n=nY(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function nY(e,t){let n="",r=0,i=-1,o=0,l=-1,u,d;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else u===46&&o>-1?o++:o=-1}return n}function Ru(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const rY={cwd:iY};function iY(){return"/"}function u0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function aY(e){if(typeof e=="string")e=new URL(e);else if(!u0(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return sY(e)}function sY(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const qg=["history","path","basename","stem","extname","dirname"];class qM{constructor(t){let n;t?u0(t)?n={path:t}:typeof t=="string"||oY(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":rY.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<qg.length;){const o=qg[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)qg.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ci.basename(this.path):void 0}set basename(t){zg(t,"basename"),Fg(t,"basename"),this.path=ci.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ci.dirname(this.path):void 0}set dirname(t){sN(this.basename,"dirname"),this.path=ci.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ci.extname(this.path):void 0}set extname(t){if(Fg(t,"extname"),sN(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ci.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){u0(t)&&(t=aY(t)),zg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ci.basename(this.path,this.extname):void 0}set stem(t){zg(t,"stem"),Fg(t,"stem"),this.path=ci.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Rn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Fg(e,t){if(e&&e.includes(ci.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ci.sep+"`")}function zg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function sN(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function oY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lY=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),cY={}.hasOwnProperty;class _v extends lY{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=QQ()}copy(){const t=new _v;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Lg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?($g("data",this.frozen),this.namespace[t]=n,this):cY.call(this.namespace,t)&&this.namespace[t]||void 0:t?($g("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=df(t),r=this.parser||this.Parser;return Bg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Bg("process",this.parser||this.Parser),Vg("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,l){const u=df(t),d=r.parse(u);r.run(d,u,function(h,p,g){if(h||!p||!g)return f(h);const x=p,w=r.stringify(x,g);fY(w)?g.value=w:g.result=w,f(h,g)});function f(h,p){h||!p?l(h):o?o(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),Bg("processSync",this.parser||this.Parser),Vg("processSync",this.compiler||this.Compiler),this.process(t,i),lN("processSync","process",n),r;function i(o,l){n=!0,iN(o),r=l}}run(t,n,r){oN(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,u){const d=df(n);i.run(t,d,f);function f(h,p,g){const x=p||t;h?u(h):l?l(x):r(void 0,x,g)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),lN("runSync","run",r),i;function o(l,u){iN(l),i=u,r=!0}}stringify(t,n){this.freeze();const r=df(n),i=this.compiler||this.Compiler;return Vg("stringify",i),oN(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if($g("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[h,...p]=f;d(h,p)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(f.plugins),f.settings&&(i.settings=Lg(!0,i.settings,f.settings))}function u(f){let h=-1;if(f!=null)if(Array.isArray(f))for(;++h<f.length;){const p=f[h];o(p)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,h){let p=-1,g=-1;for(;++p<r.length;)if(r[p][0]===f){g=p;break}if(g===-1)r.push([f,...h]);else if(h.length>0){let[x,...w]=h;const _=r[g][1];c0(_)&&c0(x)&&(x=Lg(!0,_,x)),r[g]=[f,x,...w]}}}}const uY=new _v().freeze();function Bg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Vg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $g(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function oN(e){if(!c0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function lN(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function df(e){return dY(e)?e:new qM(e)}function dY(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function fY(e){return typeof e=="string"||mY(e)}function mY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const hY="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",cN=[],uN={allowDangerousHtml:!0},pY=/^(https?|ircs?|mailto|xmpp)$/i,gY=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function yY(e){const t=xY(e),n=vY(e);return bY(t.runSync(t.parse(n),n),e)}function xY(e){const t=e.rehypePlugins||cN,n=e.remarkPlugins||cN,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...uN}:uN;return uY().use(XG).use(n).use(HQ,r).use(t)}function vY(e){const t=e.children||"",n=new qM;return typeof t=="string"&&(n.value=t),n}function bY(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||wY;for(const h of gY)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+hY+h.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),LM(e,f),TH(e,{Fragment:a.Fragment,components:i,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function f(h,p,g){if(h.type==="raw"&&g&&typeof p=="number")return l?g.children.splice(p,1):g.children[p]={type:"text",value:h.value},p;if(h.type==="element"){let x;for(x in Rg)if(Object.hasOwn(Rg,x)&&Object.hasOwn(h.properties,x)){const w=h.properties[x],_=Rg[x];(_===null||_.includes(h.tagName))&&(h.properties[x]=d(String(w||""),x,h))}}if(h.type==="element"){let x=n?!n.includes(h.tagName):o?o.includes(h.tagName):!1;if(!x&&r&&typeof p=="number"&&(x=!r(h,p,g)),x&&g&&typeof p=="number")return u&&h.children?g.children.splice(p,1,...h.children):g.children.splice(p,1),p}}}function wY(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||pY.test(e.slice(0,t))?e:""}function _Y({messages:e,currentUserEmail:t,conversationType:n}){const{t:r}=gn(),i=v.useRef(null);v.useEffect(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]);const o=l=>{var u;return l.sender_email!==t?!1:(u=l.read_by)==null?void 0:u.some(d=>d!==t)};return a.jsx(Cl,{className:"flex-1 p-4",ref:i,children:a.jsx("div",{className:"space-y-4",children:e.map(l=>{var f;const u=l.sender_email===t,d=o(l);return l.is_deleted?a.jsx("div",{className:"flex justify-center",children:a.jsx("span",{className:"text-xs text-slate-500 italic",children:r("messageDeleted")})},l.id):a.jsxs("div",{className:`flex gap-3 ${u?"flex-row-reverse":""}`,children:[!u&&a.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-cyan-500 to-purple-500 flex items-center justify-center flex-shrink-0 overflow-hidden",children:l.sender_avatar?a.jsx("img",{src:l.sender_avatar,alt:"",className:"w-full h-full object-cover"}):a.jsx("span",{className:"text-white text-sm font-medium",children:(f=(l.sender_name||l.user_name||"U")[0])==null?void 0:f.toUpperCase()})}),a.jsxs("div",{className:`flex-1 max-w-[70%] ${u?"items-end":"items-start"} flex flex-col`,children:[!u&&n!=="dm"&&a.jsxs("span",{className:"text-xs font-medium text-slate-400 mb-1",children:[l.sender_name||l.user_name,l.sender_role==="admin"&&a.jsxs("span",{className:"ml-1 text-cyan-400",children:["• ",r("adminLabel")]})]}),a.jsxs("div",{className:`rounded-2xl px-4 py-2.5 ${u?"bg-cyan-600 text-white":"bg-slate-800 text-white"}`,children:[a.jsx(yY,{className:"text-sm prose prose-sm prose-invert max-w-none [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",components:{p:({children:h})=>a.jsx("p",{className:"my-1 leading-relaxed",children:h}),a:({children:h,...p})=>a.jsx("a",{...p,target:"_blank",rel:"noopener noreferrer",className:"text-cyan-200 hover:underline",children:h}),code:({inline:h,children:p})=>h?a.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900/50 text-xs",children:p}):a.jsx("code",{className:"block p-2 rounded bg-slate-900/50 text-xs my-1",children:p})},children:l.message||l.content}),l.is_edited&&a.jsx("span",{className:"text-xs opacity-70 block mt-1",children:r("edited")})]}),a.jsxs("div",{className:`flex items-center gap-2 mt-1 ${u?"flex-row-reverse":""}`,children:[a.jsx("span",{className:"text-xs text-slate-500",children:Um(new Date(l.created_date),{addSuffix:!0})}),u&&n==="dm"&&a.jsx("span",{className:"text-slate-500",children:d?a.jsx(MN,{className:"w-3 h-3 text-cyan-400"}):a.jsx(dm,{className:"w-3 h-3"})})]})]})]},l.id)})})})}function SY({onSend:e,isLoading:t,placeholder:n}){const{t:r}=gn(),[i,o]=v.useState(""),l=async d=>{d.preventDefault(),!(!i.trim()||t)&&(await e(i),o(""))},u=d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),l(d))};return a.jsxs("form",{onSubmit:l,className:"p-4 border-t border-slate-700 bg-slate-900/50",children:[a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Pi,{value:i,onChange:d=>o(d.target.value),onKeyDown:u,placeholder:n||r("typeMessagePlaceholder"),className:"min-h-[60px] max-h-[200px] bg-slate-800 border-slate-700 text-white resize-none",disabled:t}),a.jsx(oe,{type:"submit",disabled:!i.trim()||t,className:"bg-cyan-600 hover:bg-cyan-700 self-end",children:t?a.jsx(tt,{className:"w-4 h-4 animate-spin"}):a.jsx(fm,{className:"w-4 h-4"})})]}),a.jsx("p",{className:"text-xs text-slate-500 mt-2",children:r("supportsMarkdown")})]})}function jY({open:e,onClose:t,onStartConversation:n,currentUser:r}){const[i,o]=v.useState(""),{data:l=[]}=me({queryKey:["my-memberships",r==null?void 0:r.email],queryFn:()=>O.entities.OrganizationMember.filter({user_email:r==null?void 0:r.email,status:"active"}),enabled:!!(r!=null&&r.email)&&e}),{data:u=[]}=me({queryKey:["org-members-for-dm"],queryFn:async()=>{const p=l.map(x=>x.org_id);return p.length===0?[]:(await O.entities.OrganizationMember.list()).filter(x=>p.includes(x.org_id)&&x.status==="active")},enabled:l.length>0&&e}),{data:d=[]}=me({queryKey:["all-contributions-for-dm"],queryFn:()=>O.entities.Contribution.list(),enabled:e}),h=v.useMemo(()=>{const p=new Map;return u.forEach(g=>{g.user_email!==(r==null?void 0:r.email)&&g.user_name&&p.set(g.user_email,{email:g.user_email,alias:g.user_name,full_name:g.user_name,avatar_url:g.user_avatar})}),d.forEach(g=>{g.contributor_email!==(r==null?void 0:r.email)&&g.contributor_name&&p.set(g.contributor_email,{email:g.contributor_email,alias:g.contributor_name,full_name:g.contributor_name,avatar_url:g.contributor_avatar})}),Array.from(p.values())},[u,d,r==null?void 0:r.email]).filter(p=>{var x,w;if(!i)return!0;const g=i.toLowerCase();return((x=p.alias)==null?void 0:x.toLowerCase().includes(g))||((w=p.full_name)==null?void 0:w.toLowerCase().includes(g))});return a.jsx(xr,{open:e,onOpenChange:t,children:a.jsxs(tr,{className:"bg-slate-900 border-slate-700 text-white max-w-md",children:[a.jsx(nr,{children:a.jsx(rr,{children:"New Direct Message"})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(Ks,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400"}),a.jsx(dt,{placeholder:"Search users...",value:i,onChange:p=>o(p.target.value),className:"pl-10 bg-slate-800 border-slate-700 text-white"})]}),a.jsxs("div",{className:"max-h-[400px] overflow-y-auto space-y-2",children:[h.map(p=>{var g;return a.jsxs("button",{onClick:()=>{n(p),t()},className:"w-full p-3 rounded-lg hover:bg-slate-800 transition-colors flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-cyan-500 to-purple-500 flex items-center justify-center overflow-hidden flex-shrink-0",children:p.avatar_url?a.jsx("img",{src:p.avatar_url,alt:"",className:"w-full h-full object-cover"}):a.jsx("span",{className:"text-white font-medium",children:(g=(p.alias||p.full_name||"U")[0])==null?void 0:g.toUpperCase()})}),a.jsx("div",{className:"flex-1 text-left min-w-0",children:a.jsx("div",{className:"font-medium text-white truncate",children:p.alias||p.full_name||"Unknown"})})]},p.email)}),h.length===0&&a.jsx("p",{className:"text-center text-slate-500 py-8",children:"No users found"})]})]})]})})}function NY(){var G;const{t:e}=gn(),[t]=L5(),[n,r]=v.useState(null),[i,o]=v.useState(""),[l,u]=v.useState("all"),[d,f]=v.useState(!1),h=Bt(),{data:p}=me({queryKey:["user"],queryFn:()=>O.auth.me()});Tn.useEffect(()=>{p===null&&O.auth.redirectToLogin()},[p]);const{data:g=[]}=me({queryKey:["conversations",p==null?void 0:p.email],queryFn:()=>O.entities.Conversation.list(),enabled:!!(p!=null&&p.email),refetchInterval:3e3}),x=g.filter(R=>{var q;return(q=R.participant_emails)==null?void 0:q.includes(p==null?void 0:p.email)});v.useEffect(()=>{const R=t.get("conv");if(R&&x.length>0&&!n){const q=x.find(J=>J.id===R);q&&r({type:"dm",id:q.id,data:q})}},[t,x]);const{data:w=[]}=me({queryKey:["my-memberships",p==null?void 0:p.email],queryFn:()=>O.entities.OrganizationMember.filter({user_email:p==null?void 0:p.email,status:"active"}),enabled:!!(p!=null&&p.email)}),{data:_=[]}=me({queryKey:["organizations"],queryFn:()=>O.entities.Organization.list(),enabled:w.length>0}),N=_.filter(R=>w.some(q=>q.org_id===R.id)).map(R=>({...R,memberCount:w.filter(q=>q.org_id===R.id).length})),{data:C=[]}=me({queryKey:["owned-ship-projects",p==null?void 0:p.email],queryFn:()=>O.entities.ShipProject.filter({owner_email:p==null?void 0:p.email}),enabled:!!(p!=null&&p.email)}),{data:k=[]}=me({queryKey:["owned-armor-projects",p==null?void 0:p.email],queryFn:()=>O.entities.ArmorProject.filter({owner_email:p==null?void 0:p.email}),enabled:!!(p!=null&&p.email)}),{data:P=[]}=me({queryKey:["my-contributions",p==null?void 0:p.email],queryFn:()=>O.entities.Contribution.filter({contributor_email:p==null?void 0:p.email}),enabled:!!(p!=null&&p.email)}),T=[...new Set(P.map(R=>R.project_id))],{data:S=[]}=me({queryKey:["contributed-ship-projects"],queryFn:()=>O.entities.ShipProject.list(),enabled:T.length>0}),{data:E=[]}=me({queryKey:["contributed-armor-projects"],queryFn:()=>O.entities.ArmorProject.list(),enabled:T.length>0}),z=[...C,...k,...S.filter(R=>T.includes(R.id)),...E.filter(R=>T.includes(R.id))].filter((R,q,J)=>q===J.findIndex(ae=>ae.id===R.id)),{data:D=[]}=me({queryKey:["messages",n==null?void 0:n.type,n==null?void 0:n.id],queryFn:async()=>n?n.type==="dm"?O.entities.DirectMessage.filter({conversation_id:n.id},"-created_date",100):n.type==="org"?O.entities.OrgMessage.filter({org_id:n.id},"-created_date",100):n.type==="project"?O.entities.ProjectMessage.filter({project_id:n.id},"-created_date",100):[]:[],enabled:!!n,refetchInterval:2e3});v.useEffect(()=>{if(!n||!(p!=null&&p.email)||D.length===0)return;const q=setTimeout(async()=>{var ae;const J=D.filter(re=>{var L;return re.sender_email!==p.email&&!((L=re.read_by)!=null&&L.includes(p.email))});for(const re of J)try{n.type==="dm"?await O.entities.DirectMessage.update(re.id,{read_by:[...re.read_by||[],p.email],read_at:{...re.read_at||{},[p.email]:new Date().toISOString()}}):n.type==="org"&&await O.entities.OrgMessage.update(re.id,{read_by:[...re.read_by||[],p.email]})}catch(L){console.error("Failed to mark message as read:",L)}if(n.type==="dm"){const re=x.find(L=>L.id===n.id);re&&((ae=re.unread_count)==null?void 0:ae[p.email])>0&&await O.entities.Conversation.update(re.id,{unread_count:{...re.unread_count,[p.email]:0}})}h.invalidateQueries({queryKey:["messages"]}),h.invalidateQueries({queryKey:["conversations"]})},500);return()=>clearTimeout(q)},[n,D,p==null?void 0:p.email]);const K=Ae({mutationFn:async({message:R})=>{var q;if(!(!n||!p))if(n.type==="dm"){const J=n.data.participant_emails.find(ae=>ae!==p.email);await O.entities.DirectMessage.create({conversation_id:n.id,sender_email:p.email,sender_name:p.alias||p.full_name,sender_avatar:p.avatar_url,recipient_email:J,message:R,read_by:[p.email]}),await O.entities.Conversation.update(n.id,{last_message:R.substring(0,100),last_message_at:new Date().toISOString(),unread_count:{...n.data.unread_count,[J]:(((q=n.data.unread_count)==null?void 0:q[J])||0)+1}})}else if(n.type==="org"){const J=w.find(ae=>ae.org_id===n.id);await O.entities.OrgMessage.create({org_id:n.id,org_tag:n.data.tag,sender_email:p.email,sender_name:p.alias||p.full_name,sender_avatar:p.avatar_url,sender_role:(J==null?void 0:J.role)||"member",message:R,read_by:[p.email]})}else n.type==="project"&&await O.entities.ProjectMessage.create({project_id:n.id,user_email:p.email,user_name:p.alias||p.full_name,user_avatar:p.avatar_url,message:R})},onSuccess:()=>{h.invalidateQueries({queryKey:["messages"]}),h.invalidateQueries({queryKey:["conversations"]})},onError:R=>{Yn.error("Failed to send message"),console.error(R)}}),U=async R=>{const q=x.find(J=>J.participant_emails.includes(R.email));if(q){r({type:"dm",id:q.id,data:q});return}try{const J=await O.entities.Conversation.create({participant_emails:[p.email,R.email],participant_names:[p.alias||p.full_name,R.alias||R.full_name],participant_avatars:[p.avatar_url,R.avatar_url],unread_count:{[p.email]:0,[R.email]:0}});h.invalidateQueries({queryKey:["conversations"]}),r({type:"dm",id:J.id,data:J})}catch(J){Yn.error("Failed to create conversation"),console.error(J)}},W=()=>{var R;if(!n)return"";if(n.type==="dm"){const q=n.data.participant_emails.findIndex(J=>J!==(p==null?void 0:p.email));return((R=n.data.participant_names)==null?void 0:R[q])||"Unknown"}else{if(n.type==="org")return`# ${n.data.name}`;if(n.type==="project")return n.data.ship_name||n.data.armor_name||"Project Thread"}return""};return a.jsxs("div",{className:"h-[calc(100vh-4rem)] bg-slate-950 flex",children:[a.jsx(tH,{conversations:x,orgChannels:N,projectThreads:z,activeConversation:n,onSelectConversation:r,currentUserEmail:p==null?void 0:p.email,searchQuery:i,onSearchChange:o,filter:l,onNewConversation:()=>f(!0)}),a.jsx("div",{className:"flex-1 flex flex-col",children:n?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"h-16 border-b border-slate-700 bg-slate-900/50 flex items-center justify-between px-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[n.type==="dm"&&a.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-cyan-500 to-purple-500 flex items-center justify-center overflow-hidden",children:(G=n.data.participant_avatars)!=null&&G[n.data.participant_emails.findIndex(R=>R!==(p==null?void 0:p.email))]?a.jsx("img",{src:n.data.participant_avatars[n.data.participant_emails.findIndex(R=>R!==(p==null?void 0:p.email))],alt:"",className:"w-full h-full object-cover"}):a.jsx("span",{className:"text-white font-medium",children:W()[0]})}),n.type==="org"&&a.jsx(gr,{className:"w-5 h-5 text-cyan-400"}),n.type==="project"&&a.jsx(Ba,{className:"w-5 h-5 text-cyan-400"}),a.jsx("h2",{className:"text-lg font-semibold text-white",children:W()})]}),a.jsx(Qi,{value:l,onValueChange:u,children:a.jsxs(Si,{className:"bg-slate-800",children:[a.jsx(ht,{value:"all",children:e("allMessages")}),a.jsx(ht,{value:"dms",children:e("dmsLabel")}),a.jsx(ht,{value:"orgs",children:e("orgsLabel")}),a.jsx(ht,{value:"projects",children:e("projectsTabLabel")})]})})]}),a.jsx(_Y,{messages:D,currentUserEmail:p==null?void 0:p.email,conversationType:n.type}),a.jsx(SY,{onSend:R=>K.mutate({message:R}),isLoading:K.isPending})]}):a.jsxs("div",{className:"flex-1 flex items-center justify-center flex-col gap-4 text-slate-400",children:[a.jsx(Gi,{className:"w-16 h-16 text-slate-600"}),a.jsxs("div",{className:"text-center",children:[a.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:e("selectConversation")}),a.jsx("p",{className:"text-sm",children:e("chooseDMDesc")})]})]})}),a.jsx(jY,{open:d,onClose:()=>f(!1),onStartConversation:U,currentUser:p})]})}var Xm="Switch",[CY]=vr(Xm),[kY,PY]=CY(Xm),FM=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:l,disabled:u,value:d="on",onCheckedChange:f,form:h,...p}=e,[g,x]=v.useState(null),w=ct(t,P=>x(P)),_=v.useRef(!1),N=g?h||!!g.closest("form"):!0,[C,k]=Va({prop:i,defaultProp:o??!1,onChange:f,caller:Xm});return a.jsxs(kY,{scope:n,checked:C,disabled:u,children:[a.jsx(Xe.button,{type:"button",role:"switch","aria-checked":C,"aria-required":l,"data-state":$M(C),"data-disabled":u?"":void 0,disabled:u,value:d,...p,ref:w,onClick:Ce(e.onClick,P=>{k(T=>!T),N&&(_.current=P.isPropagationStopped(),_.current||P.stopPropagation())})}),N&&a.jsx(VM,{control:g,bubbles:!_.current,name:r,value:d,checked:C,required:l,disabled:u,form:h,style:{transform:"translateX(-100%)"}})]})});FM.displayName=Xm;var zM="SwitchThumb",BM=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=PY(zM,n);return a.jsx(Xe.span,{"data-state":$M(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});BM.displayName=zM;var EY="SwitchBubbleInput",VM=v.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},o)=>{const l=v.useRef(null),u=ct(l,o),d=qE(n),f=PE(t);return v.useEffect(()=>{const h=l.current;if(!h)return;const p=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&x){const w=new Event("click",{bubbles:r});x.call(h,n),h.dispatchEvent(w)}},[d,n,r]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:u,style:{...i.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});VM.displayName=EY;function $M(e){return e?"checked":"unchecked"}var UM=FM,TY=BM;const ka=v.forwardRef(({className:e,...t},n)=>a.jsx(UM,{className:Fe("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:a.jsx(TY,{className:Fe("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));ka.displayName=UM.displayName;function WM({userEmail:e}){const t=Bt(),[n,r]=v.useState(""),{data:i,isLoading:o}=me({queryKey:["notification-preferences",e],queryFn:async()=>{const f=await O.entities.UserNotificationPreferences.filter({user_email:e});return f.length>0?(r(f[0].discord_webhook_url||""),f[0]):await O.entities.UserNotificationPreferences.create({user_email:e,email_notifications_enabled:!0,discord_notifications_enabled:!1,notify_on_contribution:!0,notify_on_chat_message:!0,notify_on_mention:!0,notify_on_status_change:!0,notify_on_contribution_accepted:!0})},enabled:!!e}),l=Ae({mutationFn:f=>O.entities.UserNotificationPreferences.update(i.id,f),onSuccess:()=>{t.invalidateQueries({queryKey:["notification-preferences",e]}),Yn.success("Notification preferences updated")}}),u=(f,h)=>{l.mutate({[f]:h})},d=()=>{l.mutate({discord_webhook_url:n})};return o?a.jsx("div",{className:"flex justify-center py-8",children:a.jsx(tt,{className:"w-6 h-6 text-cyan-400 animate-spin"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsxs(vt,{children:[a.jsxs(wt,{className:"text-white flex items-center gap-2",children:[a.jsx(LN,{className:"w-5 h-5 text-cyan-400"}),"Email Notifications"]}),a.jsx(mi,{className:"text-slate-400",children:"Receive notifications via email"})]}),a.jsx($e,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Ge,{className:"text-slate-300",children:"Enable email notifications"}),a.jsx(ka,{checked:i==null?void 0:i.email_notifications_enabled,onCheckedChange:f=>u("email_notifications_enabled",f)})]})})]}),a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsxs(vt,{children:[a.jsxs(wt,{className:"text-white flex items-center gap-2",children:[a.jsx(Af,{className:"w-5 h-5 text-purple-400"}),"Discord Notifications"]}),a.jsx(mi,{className:"text-slate-400",children:"Receive personal Discord notifications"})]}),a.jsxs($e,{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Ge,{className:"text-slate-300",children:"Enable Discord notifications"}),a.jsx(ka,{checked:i==null?void 0:i.discord_notifications_enabled,onCheckedChange:f=>u("discord_notifications_enabled",f)})]}),(i==null?void 0:i.discord_notifications_enabled)&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Discord Webhook URL"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(dt,{placeholder:"https://discord.com/api/webhooks/...",value:n,onChange:f=>r(f.target.value),className:"bg-slate-800 border-slate-700 text-white"}),a.jsx(oe,{onClick:d,disabled:l.isPending,className:"bg-purple-500 hover:bg-purple-600",children:l.isPending?a.jsx(tt,{className:"w-4 h-4 animate-spin"}):a.jsx(qN,{className:"w-4 h-4"})})]}),a.jsx("p",{className:"text-xs text-slate-500",children:"Create a webhook in your Discord server settings"})]})]})]}),a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsxs(vt,{children:[a.jsxs(wt,{className:"text-white flex items-center gap-2",children:[a.jsx(il,{className:"w-5 h-5 text-cyan-400"}),"Notification Events"]}),a.jsx(mi,{className:"text-slate-400",children:"Choose what events trigger notifications"})]}),a.jsxs($e,{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Ge,{className:"text-slate-300",children:"New contributions"}),a.jsx("p",{className:"text-xs text-slate-500",children:"When someone contributes to your projects"})]}),a.jsx(ka,{checked:i==null?void 0:i.notify_on_contribution,onCheckedChange:f=>u("notify_on_contribution",f)})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Ge,{className:"text-slate-300",children:"Chat messages"}),a.jsx("p",{className:"text-xs text-slate-500",children:"New messages in project chats"})]}),a.jsx(ka,{checked:i==null?void 0:i.notify_on_chat_message,onCheckedChange:f=>u("notify_on_chat_message",f)})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Ge,{className:"text-slate-300",children:"Mentions"}),a.jsx("p",{className:"text-xs text-slate-500",children:"When you're mentioned with @username"})]}),a.jsx(ka,{checked:i==null?void 0:i.notify_on_mention,onCheckedChange:f=>u("notify_on_mention",f)})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Ge,{className:"text-slate-300",children:"Status changes"}),a.jsx("p",{className:"text-xs text-slate-500",children:"When project status is updated"})]}),a.jsx(ka,{checked:i==null?void 0:i.notify_on_status_change,onCheckedChange:f=>u("notify_on_status_change",f)})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Ge,{className:"text-slate-300",children:"Contribution accepted"}),a.jsx("p",{className:"text-xs text-slate-500",children:"When your contribution is accepted"})]}),a.jsx(ka,{checked:i==null?void 0:i.notify_on_contribution_accepted,onCheckedChange:f=>u("notify_on_contribution_accepted",f)})]})]})]})]})}function AY(){const{data:e,isLoading:t}=me({queryKey:["user"],queryFn:()=>O.auth.me()});return t?a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 flex items-center justify-center",children:a.jsx(tt,{className:"w-8 h-8 text-cyan-400 animate-spin"})}):a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950",children:a.jsx("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-16",children:a.jsxs(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:[a.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[a.jsx(il,{className:"w-10 h-10 text-cyan-400"}),a.jsx("h1",{className:"text-4xl font-bold text-white",children:"Notification Settings"})]}),a.jsx(WM,{userEmail:e==null?void 0:e.email})]})})})}function MY(){const{t:e}=gn(),t=Bt(),[n,r]=v.useState("all"),{data:i}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),{data:o=[],isLoading:l}=me({queryKey:["notifications",i==null?void 0:i.email],queryFn:()=>O.entities.UserNotification.filter({user_email:i==null?void 0:i.email},"-created_date",50),enabled:!!(i!=null&&i.email),refetchInterval:3e3}),u=Ae({mutationFn:p=>O.entities.UserNotification.update(p,{is_read:!0}),onSuccess:()=>{t.invalidateQueries({queryKey:["notifications"]})}}),d=Ae({mutationFn:async()=>{const p=o.filter(g=>!g.is_read);await Promise.all(p.map(g=>O.entities.UserNotification.update(g.id,{is_read:!0})))},onSuccess:()=>{t.invalidateQueries({queryKey:["notifications"]})}}),f=n==="all"?o:o.filter(p=>p.notification_type===n),h=o.filter(p=>!p.is_read).length;return l?a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 flex items-center justify-center",children:a.jsx(tt,{className:"w-8 h-8 text-cyan-400 animate-spin"})}):a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 py-12 px-4",children:a.jsx("div",{className:"max-w-3xl mx-auto",children:a.jsxs(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(il,{className:"w-8 h-8 text-cyan-400"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-white",children:e("notifications")}),h>0&&a.jsxs("p",{className:"text-sm text-slate-400",children:[h," ",e("unread")]})]})]}),h>0&&a.jsxs(oe,{onClick:()=>d.mutate(),disabled:d.isPending,variant:"outline",className:"border-cyan-500/50 text-cyan-400 hover:bg-cyan-500/10",children:[a.jsx(MN,{className:"w-4 h-4 mr-2"}),e("markAllRead")]})]}),a.jsx("div",{className:"bg-slate-900/80 backdrop-blur-xl rounded-2xl border border-slate-700/50 p-6 mb-8",children:a.jsx(Qi,{value:n,onValueChange:r,children:a.jsxs(Si,{className:"bg-slate-800",children:[a.jsx(ht,{value:"all",className:"data-[state=active]:bg-cyan-500",children:e("all")}),a.jsxs(ht,{value:"chat",className:"data-[state=active]:bg-cyan-500",children:[a.jsx(Gi,{className:"w-4 h-4 mr-2"}),e("chat")]}),a.jsxs(ht,{value:"contribution",className:"data-[state=active]:bg-cyan-500",children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),e("contributions")]})]})})}),f.length===0?a.jsx(Be,{className:"bg-slate-900/50 border-slate-700/50",children:a.jsxs($e,{className:"p-12 text-center",children:[a.jsx(il,{className:"w-16 h-16 text-slate-600 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl font-medium text-slate-400 mb-2",children:e("noNotifications")}),a.jsx("p",{className:"text-slate-500",children:e("notificationsDesc")})]})}):a.jsx("div",{className:"space-y-3",children:f.map((p,g)=>a.jsx(bt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:g*.05},children:a.jsx(Ft,{to:nt(`ProjectDetails?id=${p.project_id}&tab=${p.notification_type==="contribution"?"contributions":"chat"}`),children:a.jsx(Be,{className:`bg-slate-900/50 border-slate-700/50 hover:border-cyan-500/30 transition-all cursor-pointer ${p.is_read?"":"border-cyan-500/50"}`,onClick:()=>!p.is_read&&u.mutate(p.id),children:a.jsx($e,{className:"p-4",children:a.jsxs("div",{className:"flex items-start gap-4",children:[p.notification_type==="contribution"?a.jsx(Nt,{className:`w-5 h-5 flex-shrink-0 mt-1 ${p.is_read?"text-slate-500":"text-cyan-400"}`}):a.jsx(Gi,{className:`w-5 h-5 flex-shrink-0 mt-1 ${p.is_read?"text-slate-500":"text-cyan-400"}`}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1",children:[a.jsx("p",{className:`font-medium ${p.is_read?"text-slate-400":"text-white"}`,children:p.notification_type==="contribution"?`${p.sender_name} ${e("madeContribution")}`:`${p.sender_name} ${e("sentMessage")}`}),a.jsx("span",{className:"text-xs text-slate-500 whitespace-nowrap",children:Um(new Date(p.created_date),{addSuffix:!0})})]}),a.jsx("p",{className:`text-sm line-clamp-2 ${p.is_read?"text-slate-500":"text-slate-300"}`,children:p.message_preview})]})]})})})})},p.id))})]})})})}function RY({org:e,user:t,isAdmin:n,isMember:r}){const i=Bt(),[o,l]=v.useState(!1),[u,d]=v.useState(null),[f,h]=v.useState(""),[p,g]=v.useState(""),[x,w]=v.useState(""),[_,N]=v.useState(""),[C,k]=v.useState(""),{data:P=[],isLoading:T}=me({queryKey:["org-bank",e.id],queryFn:()=>O.entities.OrgBankItem.filter({org_id:e.id},"-created_date")}),{data:S=[]}=me({queryKey:["org-ship-projects",e.tag],queryFn:()=>O.entities.ShipProject.filter({org_tag:e.tag})}),{data:E=[]}=me({queryKey:["org-armor-projects",e.tag],queryFn:()=>O.entities.ArmorProject.filter({org_tag:e.tag})}),z=v.useMemo(()=>[...S.map(R=>({...R,displayName:R.ship_name,projectType:"ship"})),...E.map(R=>({...R,displayName:R.armor_name,projectType:"armor"}))],[S,E]),D=v.useMemo(()=>{const R={};for(const q of P)R[q.material_name]||(R[q.material_name]=0),R[q.material_name]+=q.transaction_type==="deposit"?q.quantity:-q.quantity;return R},[P]),K=Ae({mutationFn:()=>O.entities.OrgBankItem.create({org_id:e.id,org_tag:e.tag,material_name:f.trim(),quantity:parseFloat(p),transaction_type:"deposit",deposited_by_email:t.email,deposited_by_name:t.alias||t.full_name,notes:x}),onSuccess:()=>{i.invalidateQueries({queryKey:["org-bank",e.id]}),l(!1),h(""),g(""),w("")}}),U=Ae({mutationFn:async()=>{const R=parseFloat(_),q=z.find(re=>re.id===C);if(!q)return;await O.entities.OrgBankItem.create({org_id:e.id,org_tag:e.tag,material_name:u,quantity:R,transaction_type:"allocation",project_id:q.id,project_name:q.displayName,deposited_by_email:t.email,deposited_by_name:t.alias||t.full_name});const J=q.required_materials||[],ae=J.findIndex(re=>{var L;return((L=re.material_name)==null?void 0:L.toLowerCase())===u.toLowerCase()});if(ae>=0){const re=J.map((Y,M)=>M===ae?{...Y,quantity_collected:(Y.quantity_collected||0)+R}:Y),L=q.projectType==="ship"?"ShipProject":"ArmorProject";await O.entities[L].update(q.id,{required_materials:re})}},onSuccess:()=>{i.invalidateQueries({queryKey:["org-bank",e.id]}),i.invalidateQueries({queryKey:["projects"]}),i.invalidateQueries({queryKey:["armorProjects"]}),d(null),N(""),k("")}}),W=u&&D[u]||0,G=z.find(R=>R.id===C);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg font-semibold text-white flex items-center gap-2",children:[a.jsx(Ug,{className:"w-5 h-5 text-cyan-400"}),"Org Bank"]}),a.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Members deposit materials here; admins can allocate them to org projects."})]}),r&&a.jsxs(oe,{onClick:()=>l(!0),className:"bg-cyan-500 hover:bg-cyan-600",children:[a.jsx(er,{className:"w-4 h-4 mr-2"}),"Deposit"]})]}),T?a.jsx("div",{className:"flex justify-center py-10",children:a.jsx(tt,{className:"w-6 h-6 text-cyan-400 animate-spin"})}):Object.keys(D).length===0?a.jsx(Be,{className:"bg-slate-900/50 border-slate-700/50",children:a.jsxs($e,{className:"p-10 text-center",children:[a.jsx(Nt,{className:"w-12 h-12 text-slate-600 mx-auto mb-3"}),a.jsx("p",{className:"text-slate-400",children:"No materials in the bank yet."}),r&&a.jsx(oe,{onClick:()=>l(!0),className:"mt-4 bg-cyan-500 hover:bg-cyan-600",children:"Make First Deposit"})]})}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Object.entries(D).map(([R,q])=>a.jsx(Be,{className:"bg-slate-900/50 border-slate-700/50",children:a.jsxs($e,{className:"p-5 flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-white font-semibold",children:R}),a.jsx("p",{className:`text-2xl font-bold mt-1 ${q<=0?"text-red-400":"text-cyan-400"}`,children:q<=0?0:q}),a.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"units available"})]}),n&&q>0&&a.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>{d(R),N(""),k("")},className:"border-purple-500/50 text-purple-400 hover:bg-purple-500/10",children:[a.jsx(Tf,{className:"w-3 h-3 mr-1"}),"Allocate"]})]})},R))}),P.length>0&&a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsx(vt,{children:a.jsx(wt,{className:"text-white text-sm",children:"Recent Transactions"})}),a.jsx($e,{children:a.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto pr-1",children:P.slice(0,30).map(R=>a.jsxs("div",{className:"flex items-center justify-between text-sm py-2 border-b border-slate-800 last:border-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[R.transaction_type==="deposit"?a.jsx(er,{className:"w-3.5 h-3.5 text-green-400"}):a.jsx(oI,{className:"w-3.5 h-3.5 text-amber-400"}),a.jsx("span",{className:"text-slate-300",children:R.material_name}),R.transaction_type==="allocation"&&R.project_name&&a.jsxs(zt,{variant:"outline",className:"border-purple-500/40 text-purple-400 text-xs px-1.5 py-0",children:["→ ",R.project_name]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:`font-semibold ${R.transaction_type==="deposit"?"text-green-400":"text-amber-400"}`,children:[R.transaction_type==="deposit"?"+":"-",R.quantity]}),a.jsx("span",{className:"text-slate-500 text-xs",children:R.deposited_by_name})]})]},R.id))})})]}),a.jsx(xr,{open:o,onOpenChange:l,children:a.jsxs(tr,{className:"bg-slate-900 border-slate-700 text-white",children:[a.jsx(nr,{children:a.jsxs(rr,{className:"text-white flex items-center gap-2",children:[a.jsx(Ug,{className:"w-5 h-5 text-cyan-400"}),"Deposit to Org Bank"]})}),a.jsxs("div",{className:"space-y-4 mt-2",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-slate-300 mb-1 block",children:"Material Name"}),a.jsx(dt,{placeholder:"e.g. Laranite, Titanium...",value:f,onChange:R=>h(R.target.value),className:"bg-slate-800 border-slate-700 text-white"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-slate-300 mb-1 block",children:"Quantity"}),a.jsx(dt,{type:"number",min:"1",placeholder:"0",value:p,onChange:R=>g(R.target.value),className:"bg-slate-800 border-slate-700 text-white"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-slate-300 mb-1 block",children:"Notes (optional)"}),a.jsx(dt,{placeholder:"Any notes...",value:x,onChange:R=>w(R.target.value),className:"bg-slate-800 border-slate-700 text-white"})]}),a.jsxs("div",{className:"flex gap-3 justify-end pt-2",children:[a.jsx(oe,{variant:"outline",onClick:()=>l(!1),className:"border-slate-700",children:"Cancel"}),a.jsx(oe,{onClick:()=>K.mutate(),disabled:!f.trim()||!p||K.isPending,className:"bg-cyan-500 hover:bg-cyan-600",children:K.isPending?a.jsx(tt,{className:"w-4 h-4 animate-spin"}):"Deposit"})]})]})]})}),a.jsx(xr,{open:!!u,onOpenChange:()=>d(null),children:a.jsxs(tr,{className:"bg-slate-900 border-slate-700 text-white",children:[a.jsx(nr,{children:a.jsxs(rr,{className:"text-white flex items-center gap-2",children:[a.jsx(Tf,{className:"w-5 h-5 text-purple-400"}),"Allocate ",u," to Project"]})}),a.jsxs("div",{className:"space-y-4 mt-2",children:[a.jsxs("p",{className:"text-sm text-slate-400",children:["Available: ",a.jsxs("span",{className:"text-cyan-400 font-semibold",children:[W," units"]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-slate-300 mb-1 block",children:"Select Project"}),a.jsxs(en,{value:C,onValueChange:k,children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{placeholder:"Choose a project..."})}),a.jsx(Qt,{className:"bg-slate-800 border-slate-700",children:z.map(R=>a.jsxs(st,{value:R.id,className:"text-white hover:bg-slate-700",children:["[",R.projectType==="ship"?"Ship":"Armor","] ",R.displayName]},R.id))})]})]}),G&&a.jsxs("div",{className:"p-3 bg-slate-800/50 rounded-lg text-xs text-slate-400",children:[a.jsx("p",{className:"font-medium text-slate-300 mb-1",children:"Matching materials in project:"}),(G.required_materials||[]).filter(R=>{var q;return((q=R.material_name)==null?void 0:q.toLowerCase())===(u==null?void 0:u.toLowerCase())}).map((R,q)=>a.jsxs("p",{children:[R.material_name,": ",R.quantity_collected||0," / ",R.quantity_needed," collected"]},q)),!(G.required_materials||[]).some(R=>{var q;return((q=R.material_name)==null?void 0:q.toLowerCase())===(u==null?void 0:u.toLowerCase())})&&a.jsx("p",{className:"text-amber-400",children:"⚠ This material isn't in the project's requirements. The allocation will still be recorded."})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-slate-300 mb-1 block",children:"Quantity to Allocate"}),a.jsx(dt,{type:"number",min:"1",max:W,placeholder:"0",value:_,onChange:R=>N(R.target.value),className:"bg-slate-800 border-slate-700 text-white"})]}),a.jsxs("div",{className:"flex gap-3 justify-end pt-2",children:[a.jsx(oe,{variant:"outline",onClick:()=>d(null),className:"border-slate-700",children:"Cancel"}),a.jsx(oe,{onClick:()=>U.mutate(),disabled:!C||!_||parseFloat(_)>W||U.isPending,className:"bg-purple-600 hover:bg-purple-700",children:U.isPending?a.jsx(tt,{className:"w-4 h-4 animate-spin"}):"Allocate"})]})]})]})})]})}function OY(){const t=new URLSearchParams(window.location.search).get("id"),[n,r]=v.useState(""),[i,o]=v.useState(null),[l,u]=v.useState(!1),[d,f]=v.useState(!1),[h,p]=v.useState(!1),[g,x]=v.useState(""),[w,_]=v.useState(""),[N,C]=v.useState(""),[k,P]=v.useState(!1),[T,S]=v.useState(!0),[E,z]=v.useState(!0),[D,K]=v.useState(!0),[U,W]=v.useState(!0),G=Bt(),{data:R}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),{data:q,isLoading:J}=me({queryKey:["organization",t],queryFn:async()=>{const Pe=(await O.entities.Organization.filter({id:t}))[0];return Pe&&(x(Pe.name||""),_(Pe.description||""),C(Pe.discord_webhook_url||""),P(Pe.discord_notifications_enabled||!1),S(Pe.discord_notify_on_contribution??!0),z(Pe.discord_notify_on_status_change??!0),K(Pe.discord_notify_on_chat??!0),W(Pe.discord_notify_on_project_complete??!0)),Pe},enabled:!!t}),{data:ae=[]}=me({queryKey:["org-members",t],queryFn:()=>O.entities.OrganizationMember.filter({org_id:t},"-created_date"),enabled:!!t}),{data:re=[]}=me({queryKey:["org-projects",q==null?void 0:q.tag],queryFn:()=>O.entities.ShipProject.filter({org_tag:q.tag},"-created_date"),enabled:!!(q!=null&&q.tag)}),L=ae.find(ce=>ce.user_email===(R==null?void 0:R.email)),Y=(L==null?void 0:L.role)==="admin"&&(L==null?void 0:L.status)==="active",M=!!L,B=(q==null?void 0:q.created_by)===(R==null?void 0:R.email),Z=Ae({mutationFn:async ce=>{await O.entities.OrganizationMember.create({org_id:t,org_tag:q.tag,user_email:ce,role:"member",status:"invited"})},onSuccess:()=>{G.invalidateQueries({queryKey:["org-members",t]}),r("")}}),I=Ae({mutationFn:async()=>{await O.entities.OrganizationMember.create({org_id:t,org_tag:q.tag,user_email:R==null?void 0:R.email,user_name:(R==null?void 0:R.alias)||(R==null?void 0:R.full_name),user_avatar:R==null?void 0:R.avatar_url,role:"member",status:"invited"})},onSuccess:()=>{G.invalidateQueries({queryKey:["org-members",t]})}}),de=Ae({mutationFn:async ce=>{await O.entities.OrganizationMember.delete(ce)},onSuccess:()=>{G.invalidateQueries({queryKey:["org-members",t]}),o(null)}}),Ne=Ae({mutationFn:async()=>{L&&await O.entities.OrganizationMember.delete(L.id)},onSuccess:()=>{G.invalidateQueries({queryKey:["org-members",t]}),G.invalidateQueries({queryKey:["my-memberships",R==null?void 0:R.email]}),window.location.href=nt("Organizations")}}),_e=Ae({mutationFn:async ce=>{await O.entities.OrganizationMember.update(ce.id,{role:"admin"})},onSuccess:()=>{G.invalidateQueries({queryKey:["org-members",t]})}}),le=Ae({mutationFn:async ce=>{await O.entities.OrganizationMember.update(ce.id,{status:"active"})},onSuccess:()=>{G.invalidateQueries({queryKey:["org-members",t]})}}),we=Ae({mutationFn:async ce=>{await O.entities.Organization.update(t,{logo_url:ce})},onSuccess:()=>{G.invalidateQueries({queryKey:["organization",t]})}}),je=Ae({mutationFn:async()=>{await O.entities.Organization.update(t,{name:g,description:w})},onSuccess:()=>{G.invalidateQueries({queryKey:["organization",t]})}}),Se=Ae({mutationFn:async()=>{await O.entities.Organization.update(t,{discord_webhook_url:N,discord_notifications_enabled:k,discord_notify_on_contribution:T,discord_notify_on_status_change:E,discord_notify_on_chat:D,discord_notify_on_project_complete:U})},onSuccess:()=>{G.invalidateQueries({queryKey:["organization",t]})}}),se=Ae({mutationFn:async()=>{const ce=await O.entities.OrganizationMember.filter({org_id:t});for(const Pe of ce)await O.entities.OrganizationMember.delete(Pe.id);await O.entities.Organization.delete(t)},onSuccess:()=>{G.invalidateQueries({queryKey:["organizations"]}),G.invalidateQueries({queryKey:["my-memberships"]}),window.location.href=nt("Organizations")}}),be=async ce=>{var Mt;const Pe=(Mt=ce.target.files)==null?void 0:Mt[0];if(Pe){p(!0);try{const{file_url:Rt}=await O.integrations.Core.UploadFile({file:Pe});await we.mutateAsync(Rt)}catch(Rt){console.error("Logo upload failed:",Rt)}finally{p(!1)}}};return J?a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 flex items-center justify-center",children:a.jsx(tt,{className:"w-8 h-8 text-cyan-400 animate-spin"})}):q?a.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950",children:[a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-8 pb-16",children:[a.jsx(Ft,{to:nt("Organizations"),children:a.jsxs(oe,{variant:"ghost",className:"text-slate-400 hover:text-white mb-6",children:[a.jsx(um,{className:"w-4 h-4 mr-2"}),"Back to Organizations"]})}),a.jsxs(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-start md:justify-between gap-6 mb-6",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsxs("div",{className:"relative group",children:[a.jsx("div",{className:"w-20 h-20 rounded-xl bg-gradient-to-br from-cyan-500 to-purple-500 flex items-center justify-center overflow-hidden flex-shrink-0",children:q.logo_url?a.jsx("img",{src:q.logo_url,alt:q.name,className:"w-full h-full object-cover"}):a.jsx(Sn,{className:"w-10 h-10 text-white"})}),Y&&a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"file",id:"org-logo-upload",accept:"image/*",onChange:be,className:"hidden"}),a.jsx("button",{onClick:()=>document.getElementById("org-logo-upload").click(),disabled:h,className:"absolute inset-0 bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity rounded-xl flex items-center justify-center",children:h?a.jsx(tt,{className:"w-6 h-6 text-white animate-spin"}):a.jsx(_0,{className:"w-6 h-6 text-white"})})]})]}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-white mb-2",children:q.name}),a.jsx(zt,{variant:"outline",className:"border-cyan-500/50 text-cyan-400 font-mono",children:q.tag}),q.description&&a.jsx("p",{className:"text-slate-400 mt-3 max-w-2xl",children:q.description})]})]}),a.jsxs("div",{className:"flex gap-3",children:[!M&&a.jsxs(oe,{onClick:()=>R?I.mutate():O.auth.redirectToLogin(),disabled:I.isPending,className:"bg-cyan-500 hover:bg-cyan-600",children:[I.isPending?a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}):a.jsx(dI,{className:"w-4 h-4 mr-2"}),R?"Request to Join":"Sign in to Join"]}),M&&(L==null?void 0:L.status)==="invited"&&a.jsx(zt,{className:"bg-amber-500/20 text-amber-400 border-amber-500/30 px-4 py-2",children:"Pending Approval"}),M&&(L==null?void 0:L.status)==="active"&&!B&&a.jsxs(oe,{onClick:()=>u(!0),variant:"outline",className:"border-red-500/50 text-red-400 hover:bg-red-500/10",children:[a.jsx(DN,{className:"w-4 h-4 mr-2"}),"Leave"]}),B&&a.jsxs(oe,{onClick:()=>f(!0),variant:"outline",className:"border-red-500/50 text-red-400 hover:bg-red-500/10",children:[a.jsx(wi,{className:"w-4 h-4 mr-2"}),"Delete Organization"]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsx(Be,{className:"bg-slate-900/50 border-slate-700/50",children:a.jsx($e,{className:"p-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(gr,{className:"w-8 h-8 text-cyan-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-bold text-white",children:ae.length}),a.jsx("p",{className:"text-sm text-slate-400",children:"Members"})]})]})})}),a.jsx(Be,{className:"bg-slate-900/50 border-slate-700/50",children:a.jsx($e,{className:"p-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Nt,{className:"w-8 h-8 text-cyan-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-bold text-white",children:re.length}),a.jsx("p",{className:"text-sm text-slate-400",children:"Projects"})]})]})})}),a.jsx(Be,{className:"bg-slate-900/50 border-slate-700/50",children:a.jsx($e,{className:"p-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(C_,{className:"w-8 h-8 text-cyan-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-bold text-white",children:ae.filter(ce=>ce.role==="admin").length}),a.jsx("p",{className:"text-sm text-slate-400",children:"Admins"})]})]})})})]})]}),a.jsxs(Qi,{defaultValue:"members",className:"w-full",children:[a.jsxs(Si,{className:"bg-slate-800 mb-6",children:[a.jsxs(ht,{value:"members",className:"data-[state=active]:bg-cyan-500",children:[a.jsx(gr,{className:"w-4 h-4 mr-2"}),"Members (",ae.length,")"]}),a.jsxs(ht,{value:"projects",className:"data-[state=active]:bg-cyan-500",children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Projects (",re.length,")"]}),a.jsxs(ht,{value:"bank",className:"data-[state=active]:bg-cyan-500",children:[a.jsx(Ug,{className:"w-4 h-4 mr-2"}),"Org Bank"]}),Y&&a.jsxs(ht,{value:"settings",className:"data-[state=active]:bg-cyan-500",children:[a.jsx(Af,{className:"w-4 h-4 mr-2"}),"Settings"]})]}),a.jsxs(sn,{value:"members",children:[Y&&a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50 mb-6",children:[a.jsx(vt,{children:a.jsx(wt,{className:"text-white",children:"Invite Members"})}),a.jsx($e,{children:a.jsxs("form",{onSubmit:ce=>{ce.preventDefault(),n&&Z.mutate(n)},className:"flex gap-3",children:[a.jsx(dt,{type:"email",placeholder:"Enter email address...",value:n,onChange:ce=>r(ce.target.value),className:"bg-slate-800 border-slate-700 text-white"}),a.jsx(oe,{type:"submit",disabled:!n||Z.isPending,className:"bg-cyan-500 hover:bg-cyan-600",children:Z.isPending?a.jsx(tt,{className:"w-4 h-4 animate-spin"}):a.jsxs(a.Fragment,{children:[a.jsx(LN,{className:"w-4 h-4 mr-2"}),"Invite"]})})]})})]}),a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsx(vt,{children:a.jsx(wt,{className:"text-white",children:"Members"})}),a.jsx($e,{children:a.jsx("div",{className:"space-y-3 max-h-[600px] overflow-y-auto pr-2",children:ae.map(ce=>a.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-800/50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-cyan-500 to-purple-500 flex items-center justify-center overflow-hidden",children:ce.user_avatar?a.jsx("img",{src:ce.user_avatar,alt:"",className:"w-full h-full object-cover"}):a.jsx("span",{className:"text-white font-medium text-sm",children:(ce.user_name||"A")[0].toUpperCase()})}),a.jsx("div",{children:a.jsx("p",{className:"text-white font-medium",children:ce.user_name||"Anonymous"})})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(zt,{className:ce.role==="admin"?"bg-cyan-500/20 text-cyan-400 border-cyan-500/30":ce.status==="invited"?"bg-amber-500/20 text-amber-400 border-amber-500/30":"bg-slate-700 text-slate-300",children:ce.status==="invited"?"✉️ Pending":ce.role}),Y&&ce.user_email!==(R==null?void 0:R.email)&&a.jsx("div",{className:"flex gap-2",children:ce.status==="invited"?a.jsxs(a.Fragment,{children:[a.jsxs(oe,{size:"sm",onClick:()=>le.mutate(ce),className:"bg-green-500 hover:bg-green-600",children:[a.jsx(dm,{className:"w-4 h-4 mr-1"}),"Accept"]}),a.jsx(oe,{size:"sm",variant:"ghost",onClick:()=>o(ce),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:a.jsx(mm,{className:"w-4 h-4"})})]}):a.jsxs(a.Fragment,{children:[ce.role==="member"&&a.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>_e.mutate(ce),className:"border-cyan-500/50 text-cyan-400 hover:bg-cyan-500/10",children:[a.jsx(C_,{className:"w-3 h-3 mr-1"}),"Make Admin"]}),a.jsx(oe,{size:"sm",variant:"ghost",onClick:()=>o(ce),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:a.jsx(wi,{className:"w-4 h-4"})})]})})]})]},ce.id))})})]})]}),a.jsx(sn,{value:"projects",children:re.length===0?a.jsx(Be,{className:"bg-slate-900/50 border-slate-700/50",children:a.jsxs($e,{className:"p-12 text-center",children:[a.jsx(Nt,{className:"w-16 h-16 text-slate-600 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl font-medium text-slate-400 mb-2",children:"No projects yet"}),a.jsx("p",{className:"text-slate-500 mb-6",children:"Organization members can create projects associated with this org"}),a.jsx(Ft,{to:nt("Home"),children:a.jsx(oe,{className:"bg-cyan-500 hover:bg-cyan-600",children:"Create Project"})})]})}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:re.map((ce,Pe)=>a.jsx(eM,{project:ce,index:Pe},ce.id))})}),a.jsx(sn,{value:"bank",children:a.jsx(RY,{org:q,user:R,isAdmin:Y,isMember:M&&(L==null?void 0:L.status)==="active"})}),Y&&a.jsx(sn,{value:"settings",children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsx(vt,{children:a.jsxs(wt,{className:"text-white flex items-center gap-2",children:[a.jsx(Sn,{className:"w-5 h-5 text-cyan-400"}),"Organization Details"]})}),a.jsxs($e,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-slate-300 text-sm font-medium",children:"Organization Name"}),a.jsx(dt,{placeholder:"My Awesome Org",value:g,onChange:ce=>x(ce.target.value),className:"bg-slate-800 border-slate-700 text-white"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-slate-300 text-sm font-medium",children:"Description"}),a.jsx(dt,{placeholder:"A brief description of your organization",value:w,onChange:ce=>_(ce.target.value),className:"bg-slate-800 border-slate-700 text-white"})]}),a.jsx("div",{className:"flex justify-end pt-4",children:a.jsx(oe,{onClick:()=>je.mutate(),disabled:je.isPending,className:"bg-cyan-500 hover:bg-cyan-600",children:je.isPending?a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}):"Save Changes"})})]})]}),a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsx(vt,{children:a.jsxs(wt,{className:"text-white flex items-center gap-2",children:[a.jsx(Af,{className:"w-5 h-5 text-cyan-400"}),"Discord Notifications"]})}),a.jsxs($e,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-slate-300 text-sm font-medium",children:"Discord Webhook URL"}),a.jsx(dt,{placeholder:"https://discord.com/api/webhooks/...",value:N,onChange:ce=>C(ce.target.value),className:"bg-slate-800 border-slate-700 text-white"}),a.jsx("p",{className:"text-xs text-slate-500",children:"Create a webhook in your Discord server: Server Settings → Integrations → Webhooks"})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-800/50 rounded-lg",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-slate-300 font-medium",children:"Enable Discord Notifications"}),a.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Master toggle for all Discord notifications"})]}),a.jsx(oe,{type:"button",variant:k?"default":"outline",size:"sm",onClick:()=>P(!k),className:k?"bg-cyan-500 hover:bg-cyan-600":"border-slate-700",children:k?"Enabled":"Disabled"})]}),k&&a.jsxs("div",{className:"space-y-3 p-4 bg-slate-800/30 rounded-lg border border-slate-700/50",children:[a.jsx("h4",{className:"text-sm font-medium text-slate-300 mb-3",children:"Notification Triggers"}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-slate-300",children:"New Contributions"}),a.jsx("p",{className:"text-xs text-slate-500",children:"When someone contributes materials"})]}),a.jsx(oe,{type:"button",variant:T?"default":"outline",size:"sm",onClick:()=>S(!T),className:T?"bg-green-600 hover:bg-green-700":"border-slate-700",children:T?"On":"Off"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-slate-300",children:"Status Changes"}),a.jsx("p",{className:"text-xs text-slate-500",children:"When project status is updated"})]}),a.jsx(oe,{type:"button",variant:E?"default":"outline",size:"sm",onClick:()=>z(!E),className:E?"bg-green-600 hover:bg-green-700":"border-slate-700",children:E?"On":"Off"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-slate-300",children:"Chat Messages"}),a.jsx("p",{className:"text-xs text-slate-500",children:"When someone posts in project chat"})]}),a.jsx(oe,{type:"button",variant:D?"default":"outline",size:"sm",onClick:()=>K(!D),className:D?"bg-green-600 hover:bg-green-700":"border-slate-700",children:D?"On":"Off"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-slate-300",children:"Project Completion"}),a.jsx("p",{className:"text-xs text-slate-500",children:"When a project is marked complete"})]}),a.jsx(oe,{type:"button",variant:U?"default":"outline",size:"sm",onClick:()=>W(!U),className:U?"bg-green-600 hover:bg-green-700":"border-slate-700",children:U?"On":"Off"})]})]}),a.jsx("div",{className:"flex justify-end pt-4",children:a.jsx(oe,{onClick:()=>Se.mutate(),disabled:Se.isPending,className:"bg-cyan-500 hover:bg-cyan-600",children:Se.isPending?a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}):"Save Changes"})})]})]})]})})]})]}),a.jsx($o,{open:!!i,onOpenChange:()=>o(null),children:a.jsxs(Ms,{className:"bg-slate-900 border-slate-700",children:[a.jsxs(Rs,{children:[a.jsx(Is,{className:"text-white",children:"Remove Member?"}),a.jsxs(Ds,{className:"text-slate-400",children:["Are you sure you want to remove ",(i==null?void 0:i.user_name)||"this member"," from this organization?"]})]}),a.jsxs(Os,{children:[a.jsx(qs,{className:"bg-slate-800 border-slate-700 text-white hover:bg-slate-700",children:"Cancel"}),a.jsx(Ls,{onClick:()=>de.mutate(i.id),className:"bg-red-500 hover:bg-red-600",children:"Remove"})]})]})}),a.jsx($o,{open:l,onOpenChange:u,children:a.jsxs(Ms,{className:"bg-slate-900 border-slate-700",children:[a.jsxs(Rs,{children:[a.jsx(Is,{className:"text-white",children:"Leave Organization?"}),a.jsxs(Ds,{className:"text-slate-400",children:["Are you sure you want to leave ",q.name,"? You can rejoin at any time."]})]}),a.jsxs(Os,{children:[a.jsx(qs,{className:"bg-slate-800 border-slate-700 text-white hover:bg-slate-700",children:"Cancel"}),a.jsx(Ls,{onClick:()=>Ne.mutate(),className:"bg-red-500 hover:bg-red-600",children:Ne.isPending?a.jsx(tt,{className:"w-4 h-4 animate-spin"}):"Leave"})]})]})}),a.jsx($o,{open:d,onOpenChange:f,children:a.jsxs(Ms,{className:"bg-slate-900 border-slate-700",children:[a.jsxs(Rs,{children:[a.jsx(Is,{className:"text-white",children:"Delete Organization?"}),a.jsxs(Ds,{className:"text-slate-400",children:["This will permanently delete ",q.name," and remove all ",ae.length," members. This action cannot be undone."]})]}),a.jsxs(Os,{children:[a.jsx(qs,{className:"bg-slate-800 border-slate-700 text-white hover:bg-slate-700",children:"Cancel"}),a.jsx(Ls,{onClick:()=>se.mutate(),className:"bg-red-500 hover:bg-red-600",children:se.isPending?a.jsx(tt,{className:"w-4 h-4 animate-spin"}):"Delete Organization"})]})]})})]}):a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 flex items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx(Sn,{className:"w-16 h-16 text-slate-600 mx-auto mb-4"}),a.jsx("h2",{className:"text-xl text-white mb-2",children:"Organization not found"}),a.jsx(Ft,{to:nt("Organizations"),children:a.jsx(oe,{variant:"outline",className:"border-cyan-500/50 text-cyan-400",children:"Back to Organizations"})})]})})}function IY({open:e,onClose:t,onSubmit:n,isLoading:r}){const[i,o]=v.useState({name:"",tag:"",description:""}),l=d=>{d.preventDefault(),n(i)},u=()=>{o({name:"",tag:"",description:""}),t()};return a.jsx(xr,{open:e,onOpenChange:u,children:a.jsxs(tr,{className:"bg-slate-900 border-slate-700 max-w-lg",children:[a.jsx(nr,{children:a.jsx(rr,{className:"text-white text-xl",children:"Create Organization"})}),a.jsxs("form",{onSubmit:l,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Organization Name *"}),a.jsx(dt,{placeholder:"e.g., Atlas Defense Industries",value:i.name,onChange:d=>o({...i,name:d.target.value}),className:"bg-slate-800 border-slate-700 text-white",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Organization Tag *"}),a.jsx(dt,{placeholder:"e.g., ADI",value:i.tag,onChange:d=>o({...i,tag:d.target.value.toUpperCase()}),maxLength:5,className:"bg-slate-800 border-slate-700 text-white font-mono",required:!0}),a.jsx("p",{className:"text-xs text-slate-500",children:"Short identifier (max 5 characters, will be displayed on projects)"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Description (Optional)"}),a.jsx(Pi,{placeholder:"Describe your organization's mission and goals...",value:i.description,onChange:d=>o({...i,description:d.target.value}),className:"bg-slate-800 border-slate-700 text-white h-24"})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(oe,{type:"button",variant:"outline",onClick:u,className:"border-slate-700 text-slate-300 hover:bg-slate-800",children:"Cancel"}),a.jsx(oe,{type:"submit",disabled:!i.name||!i.tag||r,className:"bg-cyan-500 hover:bg-cyan-600",children:r?a.jsxs(a.Fragment,{children:[a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"Creating..."]}):"Create Organization"})]})]})]})})}function DY(){const[e,t]=v.useState(!1),[n,r]=v.useState(""),i=Bt(),{data:o}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),{data:l=[],isLoading:u}=me({queryKey:["organizations"],queryFn:()=>O.entities.Organization.list("-created_date")}),{data:d=[]}=me({queryKey:["my-memberships",o==null?void 0:o.email],queryFn:()=>O.entities.OrganizationMember.filter({user_email:o==null?void 0:o.email}),enabled:!!(o!=null&&o.email)}),f=Ae({mutationFn:async g=>{if(!(o!=null&&o.email))throw new Error("You must be logged in to create an organization");const x=await O.entities.Organization.create({...g,created_by:o.email});return await O.entities.OrganizationMember.create({org_id:x.id,org_tag:x.tag,user_email:o.email,user_name:o.alias||o.full_name,user_avatar:o.avatar_url,role:"admin",status:"active"}),await O.auth.updateMe({org_name:x.name,org_tag:x.tag}),x},onSuccess:()=>{i.invalidateQueries({queryKey:["organizations"]}),i.invalidateQueries({queryKey:["my-memberships"]}),i.invalidateQueries({queryKey:["user"]}),t(!1)},onError:g=>{console.error("Failed to create organization:",g),alert(g.message||"Failed to create organization")}}),h=d.map(g=>g.org_id),p=l.filter(g=>{var x,w;return((x=g.name)==null?void 0:x.toLowerCase().includes(n.toLowerCase()))||((w=g.tag)==null?void 0:w.toLowerCase().includes(n.toLowerCase()))});return a.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950",children:[a.jsxs("div",{className:"relative overflow-hidden",children:[a.jsx("div",{className:"absolute inset-0 bg-[url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?w=1920')] bg-cover bg-center opacity-10"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent via-slate-950/50 to-slate-950"}),a.jsx("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-16 pb-24",children:a.jsxs(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[a.jsx(Sn,{className:"w-10 h-10 text-cyan-400"}),a.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-white",children:"Organizations"})]}),a.jsx("p",{className:"text-lg text-slate-400 max-w-2xl mx-auto mb-8",children:"Create and manage organizations to collaborate on ship building projects"}),a.jsxs(oe,{onClick:()=>o?t(!0):O.auth.redirectToLogin(),className:"bg-cyan-500 hover:bg-cyan-600 text-white px-6 py-6 text-lg",children:[a.jsx(er,{className:"w-5 h-5 mr-2"}),o?"Create Organization":"Sign in to Create Organization"]})]})})]}),a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pb-16 -mt-8",children:[a.jsx(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"bg-slate-900/80 backdrop-blur-xl rounded-2xl border border-slate-700/50 p-6 mb-8",children:a.jsxs("div",{className:"relative",children:[a.jsx(Ks,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400"}),a.jsx(dt,{placeholder:"Search organizations...",value:n,onChange:g=>r(g.target.value),className:"pl-10 bg-slate-800 border-slate-700 text-white placeholder:text-slate-500"})]})}),u?a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsx(tt,{className:"w-8 h-8 text-cyan-400 animate-spin"})}):p.length===0?a.jsxs(bt.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center py-20",children:[a.jsx(Sn,{className:"w-16 h-16 text-slate-600 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl font-medium text-slate-400 mb-2",children:"No organizations found"}),a.jsx("p",{className:"text-slate-500 mb-6",children:"Be the first to create an organization!"}),a.jsxs(oe,{onClick:()=>o?t(!0):O.auth.redirectToLogin(),variant:"outline",className:"border-cyan-500/50 text-cyan-400 hover:bg-cyan-500/10",children:[a.jsx(er,{className:"w-4 h-4 mr-2"}),o?"Create Organization":"Sign in to Create"]})]}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:p.map((g,x)=>{const w=h.includes(g.id),_=d.find(C=>C.org_id===g.id),N=(_==null?void 0:_.role)==="admin";return a.jsx(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:x*.1},children:a.jsx(Ft,{to:nt(`OrganizationDetails?id=${g.id}`),children:a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50 backdrop-blur-sm hover:border-cyan-500/30 transition-all duration-300 cursor-pointer group",children:[a.jsxs(vt,{children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-xl bg-gradient-to-br from-cyan-500 to-purple-500 flex items-center justify-center overflow-hidden",children:g.logo_url?a.jsx("img",{src:g.logo_url,alt:g.name,className:"w-full h-full object-cover"}):a.jsx(Sn,{className:"w-8 h-8 text-white"})}),w&&a.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${N?"bg-cyan-500/20 text-cyan-400":"bg-slate-700 text-slate-300"}`,children:N?"Admin":"Member"})]}),a.jsx(wt,{className:"text-white group-hover:text-cyan-400 transition-colors",children:g.name}),a.jsx("div",{className:"flex items-center gap-2 text-sm text-slate-400",children:a.jsx("span",{className:"px-2 py-0.5 bg-slate-800 rounded font-mono",children:g.tag})})]}),a.jsxs($e,{children:[g.description&&a.jsx("p",{className:"text-slate-400 text-sm mb-4 line-clamp-2",children:g.description}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-1 text-sm text-slate-400",children:[a.jsx(gr,{className:"w-4 h-4"}),a.jsx("span",{children:"View Details"})]}),a.jsx(Tf,{className:"w-4 h-4 text-cyan-400 group-hover:translate-x-1 transition-transform"})]})]})]})})},g.id)})})]}),a.jsx(IY,{open:e,onClose:()=>t(!1),onSubmit:g=>f.mutate(g),isLoading:f.isPending})]})}function LY(){const{t:e,language:t,changeLanguage:n,availableLanguages:r,languageNames:i}=gn(),o=Bt(),[l,u]=v.useState(""),[d,f]=v.useState(""),[h,p]=v.useState(""),[g,x]=v.useState(!1),{data:w,isLoading:_}=me({queryKey:["user"],queryFn:async()=>{const S=await O.auth.me();return u(S.alias||""),f(S.default_home_port||""),p(S.default_org_id||""),S}}),{data:N=[]}=me({queryKey:["my-memberships",w==null?void 0:w.email],queryFn:()=>O.entities.OrganizationMember.filter({user_email:w==null?void 0:w.email,status:"active"}),enabled:!!(w!=null&&w.email)}),C=Ae({mutationFn:S=>O.auth.updateMe(S),onSuccess:()=>{o.invalidateQueries({queryKey:["user"]}),o.invalidateQueries({queryKey:["projects"]})}}),k=S=>{S.preventDefault(),C.mutate({alias:l,default_home_port:d,default_org_id:h})},P=async S=>{var z;const E=(z=S.target.files)==null?void 0:z[0];if(E){x(!0);try{const{file_url:D}=await O.integrations.Core.UploadFile({file:E});await O.auth.updateMe({avatar_url:D}),o.invalidateQueries({queryKey:["user"]})}catch(D){console.error("Avatar upload failed:",D)}finally{x(!1)}}};if(_)return a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 flex items-center justify-center",children:a.jsx(tt,{className:"w-8 h-8 text-cyan-400 animate-spin"})});const T=w&&!w.alias;return a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 py-12 px-4",children:a.jsx("div",{className:"max-w-2xl mx-auto",children:a.jsxs(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:[a.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[a.jsx(Rf,{className:"w-8 h-8 text-cyan-400"}),a.jsx("h1",{className:"text-3xl font-bold text-white",children:e("profile")})]}),T&&a.jsx(bt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"mb-6 p-4 bg-amber-500/20 border border-amber-500/50 rounded-lg",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Rf,{className:"w-5 h-5 text-amber-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-amber-400 font-semibold",children:e("starCitizenNameRequired")}),a.jsx("p",{className:"text-amber-300/80 text-sm",children:e("starCitizenNameRequiredDesc")})]})]})}),a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsxs(vt,{children:[a.jsx(wt,{className:"text-white",children:e("profileAvatar")}),a.jsx(mi,{className:"text-slate-400",children:e("uploadAvatar")})]}),a.jsx($e,{children:a.jsxs("div",{className:"flex items-center gap-6 mb-6",children:[a.jsxs("div",{className:"w-24 h-24 rounded-full bg-gradient-to-br from-cyan-500 to-purple-500 flex items-center justify-center overflow-hidden cursor-pointer relative group",onClick:()=>document.getElementById("avatar-upload").click(),children:[w!=null&&w.avatar_url?a.jsx("img",{src:w.avatar_url,alt:"Avatar",className:"w-full h-full object-cover"}):a.jsx("span",{className:"text-white font-bold text-3xl",children:((w==null?void 0:w.alias)||(w==null?void 0:w.full_name)||(w==null?void 0:w.email)||"U")[0].toUpperCase()}),a.jsx("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:g?a.jsx(tt,{className:"w-6 h-6 text-white animate-spin"}):a.jsx(_0,{className:"w-6 h-6 text-white"})}),a.jsx("input",{type:"file",id:"avatar-upload",accept:"image/*",onChange:P,className:"hidden"})]}),a.jsx("div",{className:"flex-1",children:a.jsx("div",{className:"bg-slate-800/50 border border-slate-700 rounded-lg px-4 py-3",children:a.jsx("p",{className:"text-slate-400 text-sm",children:(w==null?void 0:w.alias)||(w==null?void 0:w.full_name)||(w==null?void 0:w.email)})})})]})})]}),a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50 mt-6",children:[a.jsxs(vt,{children:[a.jsx(wt,{className:"text-white",children:e("starCitizenNameDisplay")}),a.jsx(mi,{className:"text-slate-400",children:e("nameVisibleDesc")})]}),a.jsx($e,{children:a.jsxs("form",{onSubmit:k,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Ge,{className:"text-slate-300",children:[e("starCitizenName")," ",T&&a.jsx("span",{className:"text-red-400",children:"*"})]}),a.jsx(dt,{placeholder:e("yourStarCitizenName"),value:l,onChange:S=>u(S.target.value),className:"bg-slate-800 border-slate-700 text-white",required:T}),T&&!l&&a.jsx("p",{className:"text-xs text-amber-400",children:e("fieldRequired")})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:e("defaultHomePort")}),a.jsx(dt,{placeholder:e("homePortPlaceholder"),value:d,onChange:S=>f(S.target.value),className:"bg-slate-800 border-slate-700 text-white"})]}),a.jsx("div",{className:"flex justify-end pt-4",children:a.jsxs(oe,{type:"submit",disabled:C.isPending||T&&!l,className:"bg-cyan-500 hover:bg-cyan-600 disabled:opacity-50",children:[C.isPending?a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}):a.jsx(qN,{className:"w-4 h-4 mr-2"}),e("saveChanges")]})})]})})]}),a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50 mt-6",children:[a.jsxs(vt,{children:[a.jsxs(wt,{className:"text-white flex items-center gap-2",children:[a.jsx(RO,{className:"w-5 h-5 text-cyan-400"}),e("language")]}),a.jsx(mi,{className:"text-slate-400",children:e("selectLanguage")})]}),a.jsx($e,{children:a.jsxs(en,{value:t,onValueChange:n,children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{})}),a.jsx(Qt,{className:"bg-slate-900 border-slate-700",children:r.map(S=>a.jsx(st,{value:S,className:"text-slate-300 hover:text-white hover:bg-slate-800",children:i[S]},S))})]})})]}),a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50 mt-6",children:[a.jsxs(vt,{children:[a.jsx(wt,{className:"text-white",children:e("organizations")}),a.jsx(mi,{className:"text-slate-400",children:e("manageOrgMemberships")})]}),a.jsx($e,{children:N.length===0?a.jsxs("div",{className:"text-center py-8",children:[a.jsx(Sn,{className:"w-12 h-12 text-slate-600 mx-auto mb-3"}),a.jsx("p",{className:"text-slate-400 mb-4",children:e("notInAnyOrg")}),a.jsx(Ft,{to:nt("Organizations"),children:a.jsx(oe,{variant:"outline",className:"border-cyan-500/50 text-cyan-400 hover:bg-cyan-500/10",children:e("browseOrganizations")})})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:e("defaultOrg")}),a.jsxs(en,{value:h,onValueChange:p,children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{placeholder:e("selectDefaultOrg")})}),a.jsx(Qt,{className:"bg-slate-900 border-slate-700",children:N.map(S=>a.jsx(st,{value:S.org_id,className:"text-slate-300 hover:text-white hover:bg-slate-800",children:S.org_tag},S.org_id))})]})]}),a.jsx("div",{className:"space-y-3",children:N.map(S=>a.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-800/50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Sn,{className:"w-8 h-8 text-cyan-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-white font-medium",children:S.org_tag}),a.jsx("p",{className:"text-sm text-slate-400",children:S.role})]})]}),a.jsx(Ft,{to:nt(`OrganizationDetails?id=${S.org_id}`),children:a.jsx(oe,{variant:"ghost",className:"text-cyan-400 hover:text-cyan-300",children:"View Details"})})]},S.id))}),a.jsx(Ft,{to:nt("Organizations"),children:a.jsx(oe,{variant:"outline",className:"w-full border-slate-700 text-slate-300 hover:bg-slate-800",children:e("manageOrganizations")})})]})})]}),a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50 mt-6",children:[a.jsxs(vt,{children:[a.jsxs(wt,{className:"text-white flex items-center gap-2",children:[a.jsx(il,{className:"w-5 h-5 text-cyan-400"}),e("notificationSettings")]}),a.jsx(mi,{className:"text-slate-400",children:e("manageNotifications")})]}),a.jsx($e,{children:a.jsx(WM,{userEmail:w==null?void 0:w.email})})]})]})})})}function qY({open:e,onClose:t,onSubmit:n,project:r,isLoading:i}){const{data:o}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),{data:l=[]}=me({queryKey:["my-memberships",o==null?void 0:o.email],queryFn:()=>O.entities.OrganizationMember.filter({user_email:o==null?void 0:o.email,status:"active",role:"admin"}),enabled:!!(o!=null&&o.email)}),{data:u=[]}=me({queryKey:["my-admin-orgs",l],queryFn:async()=>{if(l.length===0)return[];const p=l.map(x=>x.org_id);return(await Promise.all(p.map(x=>O.entities.Organization.filter({id:x})))).flat()},enabled:l.length>0}),[d,f]=v.useState({ship_name:"",description:"",home_port:"",ship_image:"",org_id:"",privacy:"public"});v.useEffect(()=>{if(r&&u.length>=0){const p=u.find(g=>g.tag===r.org_tag);f({ship_name:r.ship_name||"",description:r.description||"",home_port:r.home_port||"",ship_image:r.ship_image||"",org_id:(p==null?void 0:p.id)||"",privacy:r.privacy||"public"})}},[r,u]);const h=p=>{p.preventDefault();const g=u.find(w=>w.id===d.org_id),x={...d,org_name:(g==null?void 0:g.name)||null,org_tag:(g==null?void 0:g.tag)||null};delete x.org_id,n(x)};return a.jsx(xr,{open:e,onOpenChange:t,children:a.jsxs(tr,{className:"bg-slate-900 border-slate-700 max-w-2xl",children:[a.jsx(nr,{children:a.jsx(rr,{className:"text-white text-xl",children:"Edit Project"})}),a.jsxs("form",{onSubmit:h,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Ship Name *"}),a.jsx(dt,{required:!0,value:d.ship_name,onChange:p=>f({...d,ship_name:p.target.value}),className:"bg-slate-800 border-slate-700 text-white",placeholder:"e.g., Javelin"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Description"}),a.jsx(Pi,{value:d.description,onChange:p=>f({...d,description:p.target.value}),className:"bg-slate-800 border-slate-700 text-white h-24",placeholder:"Describe your project..."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Home Port / Drop-off Location"}),a.jsx(dt,{value:d.home_port,onChange:p=>f({...d,home_port:p.target.value}),className:"bg-slate-800 border-slate-700 text-white",placeholder:"e.g., Port Olisar, Lorville"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Ship Image URL"}),a.jsx(dt,{value:d.ship_image,onChange:p=>f({...d,ship_image:p.target.value}),className:"bg-slate-800 border-slate-700 text-white",placeholder:"https://..."})]}),u.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Organization (Optional)"}),a.jsxs(en,{value:d.org_id,onValueChange:p=>f({...d,org_id:p}),children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{placeholder:"Select organization..."})}),a.jsxs(Qt,{className:"bg-slate-800 border-slate-700",children:[a.jsx(st,{value:null,children:"None"}),u.map(p=>a.jsxs(st,{value:p.id,className:"text-white",children:[p.name," (",p.tag,")"]},p.id))]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Privacy"}),a.jsxs(en,{value:d.privacy,onValueChange:p=>f({...d,privacy:p}),children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{})}),a.jsxs(Qt,{className:"bg-slate-800 border-slate-700",children:[a.jsx(st,{value:"public",className:"text-white",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(du,{className:"w-4 h-4"}),a.jsx("span",{children:"Public - Everyone can see"})]})}),a.jsx(st,{value:"private",className:"text-white",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(fu,{className:"w-4 h-4"}),a.jsx("span",{children:"Private - Only me"})]})}),d.org_id&&a.jsx(st,{value:"org_only",className:"text-white",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(gr,{className:"w-4 h-4"}),a.jsx("span",{children:"Organization - Only org members"})]})})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(oe,{type:"button",variant:"outline",onClick:t,className:"border-slate-700 text-slate-300 hover:bg-slate-800",children:"Cancel"}),a.jsx(oe,{type:"submit",disabled:i,className:"bg-cyan-500 hover:bg-cyan-600",children:i?a.jsxs(a.Fragment,{children:[a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):"Save Changes"})]})]})]})})}const FY={planning:"bg-amber-500/20 text-amber-400 border-amber-500/30",in_progress:"bg-cyan-500/20 text-cyan-400 border-cyan-500/30",completed:"bg-emerald-500/20 text-emerald-400 border-emerald-500/30"};function zY(){var Mt,Rt,pe,Ye,rt;const{t:e}=gn(),t=new URLSearchParams(window.location.search),n=t.get("id"),r=t.get("tab")||"materials",[i,o]=v.useState(!1),[l,u]=v.useState(!1),[d,f]=v.useState(!1),[h,p]=v.useState(!1),[g,x]=v.useState(null),[w,_]=v.useState(!1),[N,C]=v.useState(null),[k,P]=v.useState(null),T=Bt(),{data:S}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),{data:E,isLoading:z}=me({queryKey:["project",n],queryFn:()=>O.entities.ShipProject.filter({id:n}),select:te=>te[0],enabled:!!n,refetchInterval:3e3}),{data:D=[],isLoading:K}=me({queryKey:["contributions",n],queryFn:()=>O.entities.Contribution.filter({project_id:n},"-created_date"),enabled:!!n,refetchInterval:3e3}),{data:U={}}=me({queryKey:["contributor-reputation",n],queryFn:async()=>{const te=[...new Set(D.map(Je=>Je.contributor_email).filter(Boolean))];return(await Promise.all(te.map(Je=>O.entities.User.filter({email:Je})))).reduce((Je,We,Ct)=>(We[0]&&(Je[te[Ct]]=We[0].reputation||0),Je),{})},enabled:D.length>0,refetchInterval:3e3}),{data:W=[]}=me({queryKey:["my-memberships",S==null?void 0:S.email],queryFn:()=>O.entities.OrganizationMember.filter({user_email:S==null?void 0:S.email,status:"active"}),enabled:!!(S!=null&&S.email)}),{data:G=[]}=me({queryKey:["my-orgs",W],queryFn:async()=>{if(W.length===0)return[];const te=W.map(Je=>Je.org_id);return(await Promise.all(te.map(Je=>O.entities.Organization.filter({id:Je})))).flat()},enabled:W.length>0}),{data:R}=me({queryKey:["project-org",E==null?void 0:E.org_tag],queryFn:async()=>(await O.entities.Organization.filter({tag:E.org_tag}))[0],enabled:!!(E!=null&&E.org_tag)}),q=Ae({mutationFn:async te=>(await O.functions.invoke("getUEXListings",{materialName:te})).data}),J=te=>{C(te),_(!0),q.mutate(te)},ae=Ae({mutationFn:async({material_name:te,change:xe})=>{const Je=E.required_materials.map(We=>{if(We.material_name===te){const Ct=Math.max(0,Math.min((We.quantity_collected||0)+xe,We.quantity_needed));return{...We,quantity_collected:Ct}}return We});await O.entities.ShipProject.update(n,{required_materials:Je}),await O.entities.ProjectActivity.create({project_id:n,user_email:S==null?void 0:S.email,user_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),user_avatar:S==null?void 0:S.avatar_url,action_type:"material_update",description:`Updated ${te}: ${xe>0?"+":""}${xe}`,metadata:{material_name:te,change:xe}})},onSuccess:()=>{T.invalidateQueries({queryKey:["project",n]}),T.invalidateQueries({queryKey:["project-activity",n]})}}),re=Ae({mutationFn:async({material_name:te,quantity:xe,in_game_name:Je,delivery_type:We,location:Ct})=>{const gt=await O.entities.Contribution.filter({contributor_email:S==null?void 0:S.email}),ie=await O.entities.Contribution.create({project_id:n,contributor_email:S==null?void 0:S.email,contributor_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),contributor_avatar:S==null?void 0:S.avatar_url,contributor_reputation:(S==null?void 0:S.reputation)||0,material_name:te,quantity:xe,in_game_name:Je,delivery_type:We,location:Ct});gt.length===0&&(await O.entities.UserBadge.filter({user_email:S==null?void 0:S.email,badge_type:"first_contribution"})).length===0&&await O.entities.UserBadge.create({user_email:S==null?void 0:S.email,badge_type:"first_contribution",badge_name:"First Steps",badge_description:"Made your first contribution to a project",earned_at:new Date().toISOString()});const ge=new Set(gt.map(qe=>qe.project_id));if(ge.add(n),ge.size>=5&&(await O.entities.UserBadge.filter({user_email:S==null?void 0:S.email,badge_type:"consistent_contributor"})).length===0&&await O.entities.UserBadge.create({user_email:S==null?void 0:S.email,badge_type:"consistent_contributor",badge_name:"Consistent Contributor",badge_description:"Contributed to 5 or more projects",earned_at:new Date().toISOString()}),gt.reduce((qe,Ve)=>qe+(Ve.quantity||0),0)+xe>=1e3&&(await O.entities.UserBadge.filter({user_email:S==null?void 0:S.email,badge_type:"material_master"})).length===0&&await O.entities.UserBadge.create({user_email:S==null?void 0:S.email,badge_type:"material_master",badge_name:"Material Master",badge_description:"Contributed 1000+ materials across all projects",earned_at:new Date().toISOString()}),await O.entities.ProjectActivity.create({project_id:n,user_email:S==null?void 0:S.email,user_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),user_avatar:S==null?void 0:S.avatar_url,action_type:"contribution",description:`Contributed ${xe}x ${te}`,metadata:{material_name:te,quantity:xe}}),E.owner_email!==(S==null?void 0:S.email)){const Ve=(await O.entities.UserNotificationPreferences.filter({user_email:E.owner_email}))[0];if(!Ve||Ve.notify_on_contribution){if(await O.entities.UserNotification.create({user_email:E.owner_email,project_id:n,message_id:ie.id,sender_email:S==null?void 0:S.email,sender_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),message_preview:`Contributed ${xe}x ${te}`,notification_type:"contribution",is_read:!1}),Ve!=null&&Ve.email_notifications_enabled)try{await O.integrations.Core.SendEmail({to:E.owner_email,subject:`New contribution to ${E.ship_name}`,body:`${(S==null?void 0:S.alias)||(S==null?void 0:S.full_name)} contributed ${xe}x ${te} to your project "${E.ship_name}".
|
||
|
||
Delivery: ${We==="pickup"?"Pickup":"Drop-off"}
|
||
Location: ${Ct||"Not specified"}`})}catch(Ot){console.error("Failed to send email:",Ot)}if(Ve!=null&&Ve.discord_notifications_enabled&&(Ve!=null&&Ve.discord_webhook_url))try{await fetch(Ve.discord_webhook_url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({embeds:[{title:"📦 New Contribution",description:`${(S==null?void 0:S.alias)||(S==null?void 0:S.full_name)} contributed to **${E.ship_name}**`,color:1096065,fields:[{name:"Material",value:te,inline:!0},{name:"Quantity",value:`${xe}`,inline:!0}],timestamp:new Date().toISOString()}]})})}catch(Ot){console.error("Failed to send Discord notification:",Ot)}}}if(E!=null&&E.org_tag&&(R!=null&&R.discord_notifications_enabled)&&(R!=null&&R.discord_notify_on_contribution)&&(R!=null&&R.discord_webhook_url))try{await fetch(R.discord_webhook_url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({embeds:[{title:"📦 New Contribution",description:`${(S==null?void 0:S.alias)||(S==null?void 0:S.full_name)} contributed to **${E.ship_name}**`,color:1096065,fields:[{name:"Material",value:te,inline:!0},{name:"Quantity",value:`${xe}`,inline:!0},{name:"Organization",value:E.org_tag,inline:!0}],timestamp:new Date().toISOString()}]})})}catch(qe){console.error("Failed to send Discord notification:",qe)}},onSuccess:()=>{T.invalidateQueries({queryKey:["project",n]}),T.invalidateQueries({queryKey:["contributions",n]}),T.invalidateQueries({queryKey:["project-activity",n]}),T.invalidateQueries({queryKey:["notifications"]}),o(!1)}}),L=Ae({mutationFn:async te=>{if(await O.entities.ShipProject.update(n,{status:te}),await O.entities.ProjectActivity.create({project_id:n,user_email:S==null?void 0:S.email,user_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),user_avatar:S==null?void 0:S.avatar_url,action_type:"status_change",description:`Changed project status to ${te.replace("_"," ")}`,metadata:{status:te}}),te==="completed"&&(S!=null&&S.email)){const We=Ka(E.ship_name);if(We&&We.reputation_reward>0){const Ct=await O.entities.User.filter({email:S.email});if(Ct.length>0){const gt=Ct[0],ie=(gt.wikelo_reputation||0)+We.reputation_reward;await O.entities.User.update(gt.id,{wikelo_reputation:ie})}}}const xe=te==="completed";if((E==null?void 0:E.org_tag)&&(R==null?void 0:R.discord_notifications_enabled)&&(R==null?void 0:R.discord_webhook_url)&&(xe&&(R==null?void 0:R.discord_notify_on_project_complete)||!xe&&(R==null?void 0:R.discord_notify_on_status_change)))try{await fetch(R.discord_webhook_url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({embeds:[{title:xe?"🎉 Project Completed!":"🔄 Status Update",description:`**${E.ship_name}** ${xe?"has been completed!":`status changed to **${te.replace("_"," ")}**`}`,color:xe?1096065:440020,fields:[{name:"Project",value:E.ship_name,inline:!0},{name:"Status",value:te.replace("_"," ").toUpperCase(),inline:!0},{name:"Organization",value:E.org_tag,inline:!0}],timestamp:new Date().toISOString()}]})})}catch(We){console.error("Failed to send Discord notification:",We)}},onSuccess:()=>{T.invalidateQueries({queryKey:["project",n]}),T.invalidateQueries({queryKey:["projects"]}),T.invalidateQueries({queryKey:["project-activity",n]})}}),Y=Ae({mutationFn:async()=>{for(const te of D)await O.entities.Contribution.delete(te.id);await O.entities.ShipProject.delete(n)},onSuccess:()=>{window.location.href=nt("Home")}}),M=Ae({mutationFn:async te=>{await O.entities.ShipProject.update(n,{org_name:te.name,org_tag:te.tag}),await O.entities.ProjectActivity.create({project_id:n,user_email:S==null?void 0:S.email,user_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),user_avatar:S==null?void 0:S.avatar_url,action_type:"project_update",description:`Linked project to organization ${te.tag}`,metadata:{org_name:te.name,org_tag:te.tag}})},onSuccess:()=>{T.invalidateQueries({queryKey:["project",n]}),T.invalidateQueries({queryKey:["projects"]}),T.invalidateQueries({queryKey:["project-activity",n]}),f(!1)}}),B=Ae({mutationFn:async te=>{await O.entities.ShipProject.update(n,te),await O.entities.ProjectActivity.create({project_id:n,user_email:S==null?void 0:S.email,user_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),user_avatar:S==null?void 0:S.avatar_url,action_type:"project_update",description:"Updated project details",metadata:te})},onSuccess:()=>{T.invalidateQueries({queryKey:["project",n]}),T.invalidateQueries({queryKey:["projects"]}),T.invalidateQueries({queryKey:["project-activity",n]}),p(!1)}}),Z=Ae({mutationFn:async te=>{const xe=D.find(Je=>Je.id===te);if(await O.entities.Contribution.update(te,{status:"delivered"}),xe!=null&&xe.contributor_email){const Je=await O.entities.UserMaterialInventory.filter({user_email:xe.contributor_email,material_name:xe.material_name});if(Je.length>0){const We=Je[0],Ct=Math.max(0,We.quantity-xe.quantity);await O.entities.UserMaterialInventory.update(We.id,{quantity:Ct})}}if(xe){const Je=E.required_materials.map(We=>We.material_name===xe.material_name?{...We,quantity_collected:(We.quantity_collected||0)+xe.quantity}:We);if(await O.entities.ShipProject.update(n,{required_materials:Je}),xe.contributor_email){const We=await O.entities.User.filter({email:xe.contributor_email});if(We.length>0){const Ct=We[0],gt=Jf[xe.material_name]||10,ie=xe.quantity*gt,ge=(Ct.reputation||0)+ie;await O.entities.User.update(Ct.id,{reputation:ge});const De=async(qe,Ve,Ot,Dr)=>{ge>=qe&&(Ct.reputation||0)<qe&&(await O.entities.UserBadge.filter({user_email:xe.contributor_email,badge_type:Ve})).length===0&&await O.entities.UserBadge.create({user_email:xe.contributor_email,badge_type:Ve,badge_name:Ot,badge_description:Dr,earned_at:new Date().toISOString()})};await De(100,"reputation_100","Rising Star","Reached 100 reputation"),await De(500,"reputation_500","Elite Member","Reached 500 reputation"),await De(1e3,"reputation_1000","Legend","Reached 1000 reputation")}}}if(xe&&xe.contributor_email!==(S==null?void 0:S.email)){const Je=Jf[xe.material_name]||10,We=xe.quantity*Je,gt=(await O.entities.UserNotificationPreferences.filter({user_email:xe.contributor_email}))[0];if(!gt||gt.notify_on_contribution_accepted){if(await O.entities.UserNotification.create({user_email:xe.contributor_email,project_id:n,message_id:te,sender_email:S==null?void 0:S.email,sender_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),message_preview:`Accepted your contribution: ${xe.quantity}x ${xe.material_name} (+${We} reputation)`,notification_type:"contribution",is_read:!1}),gt!=null&>.email_notifications_enabled)try{await O.integrations.Core.SendEmail({to:xe.contributor_email,subject:`Your contribution was accepted! +${We} reputation`,body:`${(S==null?void 0:S.alias)||(S==null?void 0:S.full_name)} accepted your contribution of ${xe.quantity}x ${xe.material_name} to "${E.ship_name}".
|
||
|
||
You earned ${We} reputation points!`})}catch(ie){console.error("Failed to send email:",ie)}if(gt!=null&>.discord_notifications_enabled&&(gt!=null&>.discord_webhook_url))try{await fetch(gt.discord_webhook_url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({embeds:[{title:"✅ Contribution Accepted!",description:`Your contribution to **${E.ship_name}** was accepted`,color:1096065,fields:[{name:"Material",value:xe.material_name,inline:!0},{name:"Quantity",value:`${xe.quantity}`,inline:!0},{name:"Reputation",value:`+${We}`,inline:!0}],timestamp:new Date().toISOString()}]})})}catch(ie){console.error("Failed to send Discord notification:",ie)}}}},onSuccess:()=>{T.invalidateQueries({queryKey:["contributions",n]}),T.invalidateQueries({queryKey:["project",n]}),T.invalidateQueries({queryKey:["notifications"]})}}),I=Ae({mutationFn:async te=>{if(await O.entities.Contribution.update(te.id,{status:"declined"}),await O.entities.ProjectActivity.create({project_id:n,user_email:S==null?void 0:S.email,user_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),user_avatar:S==null?void 0:S.avatar_url,action_type:"contribution",description:`Declined ${te.quantity}x ${te.material_name} from ${te.contributor_name}`,metadata:{material_name:te.material_name,quantity:te.quantity,contributor_email:te.contributor_email,status:"declined"}}),te&&te.contributor_email!==(S==null?void 0:S.email)){const Je=(await O.entities.UserNotificationPreferences.filter({user_email:te.contributor_email}))[0];if((!Je||Je.notify_on_contribution_accepted)&&(await O.entities.UserNotification.create({user_email:te.contributor_email,project_id:n,message_id:te.id,sender_email:S==null?void 0:S.email,sender_name:(S==null?void 0:S.alias)||(S==null?void 0:S.full_name),message_preview:`Declined your contribution: ${te.quantity}x ${te.material_name}`,notification_type:"contribution",is_read:!1}),Je!=null&&Je.email_notifications_enabled))try{await O.integrations.Core.SendEmail({to:te.contributor_email,subject:`Your contribution to ${E.ship_name} was declined`,body:`${(S==null?void 0:S.alias)||(S==null?void 0:S.full_name)} declined your contribution of ${te.quantity}x ${te.material_name} to "${E.ship_name}".`})}catch(We){console.error("Failed to send email:",We)}}},onSuccess:()=>{T.invalidateQueries({queryKey:["contributions",n]}),T.invalidateQueries({queryKey:["project-activity",n]}),T.invalidateQueries({queryKey:["notifications"]})}}),de=Ae({mutationFn:async({contributionId:te,contribution:xe})=>{if(await O.entities.Contribution.delete(te),xe.status==="delivered"){const Je=E.required_materials.map(We=>We.material_name===xe.material_name?{...We,quantity_collected:Math.max(0,(We.quantity_collected||0)-xe.quantity)}:We);await O.entities.ShipProject.update(n,{required_materials:Je})}},onSuccess:()=>{T.invalidateQueries({queryKey:["contributions",n]}),T.invalidateQueries({queryKey:["project",n]})}}),Ne=Ae({mutationFn:async te=>{await O.entities.Contribution.update(g.id,{material_name:te.material_name,quantity:te.quantity,in_game_name:te.in_game_name,delivery_type:te.delivery_type,location:te.location})},onSuccess:()=>{T.invalidateQueries({queryKey:["contributions",n]}),T.invalidateQueries({queryKey:["project",n]}),x(null),o(!1)}}),_e=Ae({mutationFn:async()=>{var Ct,gt,ie,ge;if(!(R!=null&&R.discord_webhook_url))throw new Error("No Discord webhook configured");const te=((Ct=E.required_materials)==null?void 0:Ct.reduce((De,qe)=>De+(qe.quantity_needed||0),0))||0,xe=((gt=E.required_materials)==null?void 0:gt.reduce((De,qe)=>De+(qe.quantity_collected||0),0))||0,Je=te>0?Math.round(xe/te*100):0,We=((ie=E.required_materials)==null?void 0:ie.map(De=>{const qe=De.quantity_collected||0,Ve=De.quantity_needed||0,Ot=Ve>0?Math.round(qe/Ve*100):0;return`${De.material_name}: ${qe}/${Ve} (${Ot}%)`}).join(`
|
||
`))||"No materials";await fetch(R.discord_webhook_url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({embeds:[{title:`🚀 ${E.ship_name}`,description:E.description||"No description",color:E.status==="completed"?1096065:E.status==="in_progress"?440020:16096779,image:E.ship_image?{url:E.ship_image}:void 0,fields:[{name:"Status",value:(ge=E.status)==null?void 0:ge.replace("_"," ").toUpperCase(),inline:!0},{name:"Progress",value:`${Je}%`,inline:!0},{name:"Organization",value:E.org_tag||"None",inline:!0},{name:"Owner",value:E.owner_name||"Unknown",inline:!0},{name:"Contributors",value:`${D.length}`,inline:!0},{name:"Home Port",value:E.home_port||"Not specified",inline:!0},{name:"Materials Progress",value:We}],timestamp:new Date().toISOString(),footer:{text:"Wikelo Project Tracker"}}]})})},onSuccess:()=>{}});if(z)return a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 flex items-center justify-center",children:a.jsx(tt,{className:"w-8 h-8 text-cyan-400 animate-spin"})});if(!E)return a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 flex items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx(Yr,{className:"w-16 h-16 text-slate-600 mx-auto mb-4"}),a.jsx("h2",{className:"text-xl text-white mb-2",children:e("projectNotFound")}),a.jsx(Ft,{to:nt("Home"),children:a.jsx(oe,{variant:"outline",className:"border-cyan-500/50 text-cyan-400",children:e("backToProjects")})})]})});const le=(S==null?void 0:S.email)===E.owner_email,we=E.org_tag&&W.some(te=>te.org_tag===E.org_tag),je=((Mt=E.required_materials)==null?void 0:Mt.reduce((te,xe)=>te+(xe.quantity_needed||0),0))||0,Se=((Rt=E.required_materials)==null?void 0:Rt.reduce((te,xe)=>te+(xe.quantity_collected||0),0))||0,se=je>0?Math.round(Se/je*100):0,be=(pe=E.required_materials)==null?void 0:pe.some(te=>te.quantity_needed-(te.quantity_collected||0)>0),ce=Ka(E.ship_name),Pe=(S==null?void 0:S.wikelo_reputation)||0;return a.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950",children:[a.jsxs("div",{className:"relative",children:[E.ship_image&&a.jsx(a.Fragment,{children:a.jsxs("div",{className:"absolute inset-0 h-80",children:[a.jsx("img",{src:E.ship_image,alt:E.ship_name,className:"w-full h-full object-cover opacity-30"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-slate-950/50 to-slate-950"})]})}),a.jsxs("div",{className:"relative max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 pt-8 pb-12",children:[a.jsx(Ft,{to:nt("Home"),children:a.jsxs(oe,{variant:"ghost",className:"text-slate-400 hover:text-white mb-6",children:[a.jsx(um,{className:"w-4 h-4 mr-2"}),e("backToProjects")]})}),a.jsxs(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-start md:justify-between gap-4 mb-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx(Ba,{className:"w-8 h-8 text-cyan-400"}),a.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-white",children:E.ship_name}),E.org_tag&&a.jsxs(zt,{variant:"outline",className:"border-cyan-500/50 text-cyan-400",children:[a.jsx(Sn,{className:"w-4 h-4 mr-2"}),E.org_tag]})]}),a.jsxs("p",{className:"text-slate-400",children:[e("createdBy")," ",E.owner_name||"Unknown"]}),E.org_name&&a.jsxs("p",{className:"text-slate-500 text-sm",children:[e("organization"),": ",E.org_name]}),E.home_port&&a.jsxs("p",{className:"text-slate-500 text-sm mt-1",children:["📍 ",e("homePort"),": ",E.home_port]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx(sv,{projectId:n,currentUser:S}),a.jsx(zt,{className:`${FY[E.status]} border text-sm px-3 py-1`,children:(Ye=E.status)==null?void 0:Ye.replace("_"," ")}),le&&a.jsxs("div",{className:"flex gap-2",children:[E.status==="completed"&&a.jsxs(oe,{onClick:()=>L.mutate("in_progress"),variant:"outline",className:"border-amber-500/50 text-amber-400 hover:bg-amber-500/10",disabled:L.isPending,children:[a.jsx(Yr,{className:"w-4 h-4 mr-2"}),"Revert to In Progress"]}),E.status!=="completed"&&se>=100&&a.jsxs(oe,{onClick:()=>L.mutate("completed"),className:"bg-emerald-500 hover:bg-emerald-600",disabled:L.isPending,children:[a.jsx(Or,{className:"w-4 h-4 mr-2"}),e("markComplete")]}),E.status==="planning"&&a.jsx(oe,{onClick:()=>L.mutate("in_progress"),variant:"outline",className:"border-cyan-500/50 text-cyan-400 hover:bg-cyan-500/10",disabled:L.isPending,children:e("startBuilding")}),a.jsxs(oe,{onClick:()=>p(!0),variant:"outline",className:"border-cyan-500/50 text-cyan-400 hover:bg-cyan-500/10",children:[a.jsx(b0,{className:"w-4 h-4 mr-2"}),e("edit")]}),!E.org_tag&&G.length>0&&a.jsxs(oe,{onClick:()=>f(!0),variant:"outline",className:"border-cyan-500/50 text-cyan-400 hover:bg-cyan-500/10",children:[a.jsx(v0,{className:"w-4 h-4 mr-2"}),e("linkToOrg")]}),a.jsx(oe,{variant:"ghost",size:"icon",onClick:()=>u(!0),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:a.jsx(wi,{className:"w-4 h-4"})})]})]})]}),E.description&&a.jsx("p",{className:"text-slate-300 mb-8 max-w-2xl",children:E.description}),ce&&ce.reputation_required>0&&a.jsx("div",{className:`mb-6 p-4 rounded-lg border ${Pe>=ce.reputation_required?"bg-emerald-900/30 border-emerald-600/50":"bg-amber-900/30 border-amber-600/50"}`,children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"text-2xl",children:Pe>=ce.reputation_required?"✅":"⚠️"}),a.jsxs("div",{children:[a.jsx("p",{className:`font-bold ${Pe>=ce.reputation_required?"text-emerald-300":"text-amber-300"}`,children:ce.reputation_required>=999?"Very Best Customer Required":"Very Good Customer Required"}),a.jsxs("p",{className:"text-sm text-slate-300 mt-1",children:["This mission requires ",a.jsxs("span",{className:"font-semibold text-white",children:[ce.reputation_required,"+ Wikelo reputation"]})," (",ce.reputation_required>=999?"Very Best Customer":"Very Good Customer"," tier) to complete.",Pe<ce.reputation_required&&a.jsxs("span",{className:"text-amber-400",children:[" You currently have ",Pe," rep — ",ce.reputation_required-Pe," more needed."]})]})]})]})}),ce&&ce.reputation_reward>0&&a.jsxs("div",{className:"mb-6 p-3 rounded-lg bg-cyan-900/20 border border-cyan-700/40 flex items-center gap-2",children:[a.jsx("span",{className:"text-yellow-400",children:"⭐"}),a.jsxs("p",{className:"text-sm text-cyan-300",children:["Completing this project awards ",a.jsxs("span",{className:"font-bold text-white",children:["+",ce.reputation_reward," Wikelo reputation"]})]})]}),a.jsx(Be,{className:"bg-slate-900/80 border-slate-700/50 backdrop-blur-sm",children:a.jsx($e,{className:"p-6",children:a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-slate-300 font-medium",children:e("overallProgress")}),a.jsxs("span",{className:"text-2xl font-bold text-cyan-400",children:[se,"%"]})]}),(()=>{const te=D.filter(Je=>Je.status==="pending").reduce((Je,We)=>Je+(We.quantity||0),0),xe=je>0?Math.min(te/je*100,100-se):0;return a.jsxs("div",{className:"h-3 bg-slate-800 rounded-full overflow-hidden flex",children:[a.jsx("div",{className:"h-full bg-cyan-400 transition-all duration-500",style:{width:`${se}%`}}),xe>0&&a.jsx("div",{className:"h-full bg-amber-400/70 transition-all duration-500",style:{width:`${xe}%`}})]})})()]}),a.jsxs("div",{className:"flex gap-6",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-2xl font-bold text-white",children:((rt=E.required_materials)==null?void 0:rt.length)||0}),a.jsx("p",{className:"text-sm text-slate-400",children:e("materials")})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-2xl font-bold text-white",children:D.length}),a.jsx("p",{className:"text-sm text-slate-400",children:e("contributions")})]})]}),a.jsxs("div",{className:"flex gap-2",children:[be&&!le&&a.jsxs(oe,{onClick:()=>S?o(!0):O.auth.redirectToLogin(),className:"bg-cyan-500 hover:bg-cyan-600",children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),S?e("contribute"):"Sign in to Contribute"]}),we&&(R==null?void 0:R.discord_webhook_url)&&a.jsxs(oe,{onClick:()=>_e.mutate(),disabled:_e.isPending,variant:"outline",className:"border-purple-500/50 text-purple-400 hover:bg-purple-500/10",children:[_e.isPending?a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}):a.jsx(fm,{className:"w-4 h-4 mr-2"}),"Send to Discord"]})]})]})})})]})]})]}),a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pb-16",children:a.jsxs(Qi,{defaultValue:r,className:"w-full",children:[a.jsxs(Si,{className:"bg-slate-800 mb-6",children:[a.jsxs(ht,{value:"materials",className:"data-[state=active]:bg-cyan-500",children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),e("materials")]}),a.jsxs(ht,{value:"contributions",className:"data-[state=active]:bg-cyan-500",children:[a.jsx(gr,{className:"w-4 h-4 mr-2"}),e("contributors")," (",D.length,")"]}),a.jsxs(ht,{value:"chat",className:"data-[state=active]:bg-cyan-500",children:[a.jsx(Gi,{className:"w-4 h-4 mr-2"}),e("chat")]}),a.jsxs(ht,{value:"activity",className:"data-[state=active]:bg-cyan-500",children:[a.jsx(Fo,{className:"w-4 h-4 mr-2"}),e("activity")]})]}),a.jsx(sn,{value:"materials",children:a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsx(vt,{children:a.jsx(wt,{className:"text-white",children:e("requiredMaterials")})}),a.jsx($e,{children:a.jsx(Vx,{materials:E.required_materials,onUpdateQuantity:(te,xe)=>ae.mutate({material_name:te,change:xe}),isOwner:le,onFindOnUEX:J,onMaterialClick:te=>{o(!0),P(te)},user:S,pendingContributions:D})})]})}),a.jsx(sn,{value:"contributions",children:a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsx(vt,{children:a.jsx(wt,{className:"text-white",children:e("recentContributions")})}),a.jsx($e,{children:K?a.jsx("div",{className:"flex justify-center py-8",children:a.jsx(tt,{className:"w-6 h-6 text-cyan-400 animate-spin"})}):a.jsx(Ux,{contributions:D,contributorReputation:U,isOwner:le,currentUserEmail:S==null?void 0:S.email,onMarkDelivered:te=>Z.mutate(te),onDecline:te=>I.mutate(te),onDelete:(te,xe)=>de.mutate({contributionId:te,contribution:xe}),onEdit:te=>{x(te),o(!0)}})})]})}),a.jsx(sn,{value:"chat",children:a.jsx(ov,{projectId:n,currentUser:S})}),a.jsx(sn,{value:"activity",children:a.jsx(lv,{projectId:n})})]})}),a.jsx(Zx,{open:i,onClose:()=>{o(!1),x(null),P(null)},onSubmit:te=>g?Ne.mutate(te):re.mutate(te),materials:E.required_materials,isLoading:g?Ne.isPending:re.isPending,editMode:!!g,contribution:g,projectOwnerId:E.owner_email,preSelectedMaterial:k}),a.jsx(av,{open:d,onClose:()=>f(!1),onSubmit:te=>M.mutate(te),organizations:G,isLoading:M.isPending}),a.jsx(qY,{open:h,onClose:()=>p(!1),onSubmit:te=>B.mutate(te),project:E,isLoading:B.isPending}),a.jsx(iv,{open:w,onClose:()=>_(!1),materialName:N,listings:q.data,isLoading:q.isPending,error:q.isError?q.error:null}),a.jsx($o,{open:l,onOpenChange:u,children:a.jsxs(Ms,{className:"bg-slate-900 border-slate-700",children:[a.jsxs(Rs,{children:[a.jsx(Is,{className:"text-white",children:e("deleteProject")}),a.jsx(Ds,{className:"text-slate-400",children:e("deleteProjectDesc")})]}),a.jsxs(Os,{children:[a.jsx(qs,{className:"bg-slate-800 border-slate-700 text-white hover:bg-slate-700",children:e("cancel")}),a.jsx(Ls,{onClick:()=>Y.mutate(),className:"bg-red-500 hover:bg-red-600",children:Y.isPending?a.jsx(tt,{className:"w-4 h-4 animate-spin"}):e("delete")})]})]})})]})}function BY(){const[e,t]=v.useState(!1),[n,r]=v.useState(null),i=async()=>{t(!0),r(null);try{const o=await O.entities.Contribution.list();let l=0;for(const u of o)if(u.contributor_email&&u.contributor_reputation===void 0){const d=await O.entities.User.filter({email:u.contributor_email});d.length>0&&(await O.entities.Contribution.update(u.id,{contributor_reputation:d[0].reputation||0}),l++)}r({success:!0,updated:l})}catch(o){r({success:!1,error:o.message})}finally{t(!1)}};return a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 py-12 px-4",children:a.jsx("div",{className:"max-w-2xl mx-auto",children:a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsx(vt,{children:a.jsxs(wt,{className:"text-white flex items-center gap-2",children:[a.jsx(Mf,{className:"w-6 h-6 text-cyan-400"}),"Recalculate Contribution Reputation"]})}),a.jsxs($e,{className:"space-y-4",children:[a.jsx("p",{className:"text-slate-400",children:"This will update all existing contributions to include the contributor's current reputation points."}),a.jsx(oe,{onClick:i,disabled:e,className:"bg-cyan-500 hover:bg-cyan-600 w-full",children:e?a.jsxs(a.Fragment,{children:[a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"Recalculating..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Mf,{className:"w-4 h-4 mr-2"}),"Recalculate Reputation"]})}),n&&a.jsx("div",{className:`p-4 rounded-lg ${n.success?"bg-green-500/20 border border-green-500/30":"bg-red-500/20 border border-red-500/30"}`,children:n.success?a.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[a.jsx(Or,{className:"w-5 h-5"}),a.jsxs("span",{children:["Successfully updated ",n.updated," contributions"]})]}):a.jsxs("div",{className:"text-red-400",children:["Error: ",n.error]})})]})]})})})}function VY(){const[e,t]=v.useState([]),[n,r]=v.useState(!1),{data:i}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),o=Ae({mutationFn:async()=>{var d;r(!0),t([]);const l=await O.entities.ShipProject.list(),u=[];for(const f of l)try{const p=(await O.entities.Contribution.filter({project_id:f.id})).filter(w=>w.status==="delivered"),g={};p.forEach(w=>{g[w.material_name]||(g[w.material_name]=0),g[w.material_name]+=w.quantity});const x=((d=f.required_materials)==null?void 0:d.map(w=>({...w,quantity_collected:g[w.material_name]||0})))||[];await O.entities.ShipProject.update(f.id,{required_materials:x}),u.push({projectName:f.ship_name,success:!0,message:`Updated ${Object.keys(g).length} materials`})}catch(h){u.push({projectName:f.ship_name,success:!1,message:h.message})}return t(u),r(!1),u}});return(i==null?void 0:i.role)!=="admin"?a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 flex items-center justify-center p-4",children:a.jsx(Be,{className:"bg-slate-900/50 border-slate-700/50 max-w-md",children:a.jsxs($e,{className:"p-6 text-center",children:[a.jsx(Yr,{className:"w-12 h-12 text-red-400 mx-auto mb-4"}),a.jsx("p",{className:"text-slate-300",children:"Admin access required"})]})})}):a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 p-4",children:a.jsxs("div",{className:"max-w-4xl mx-auto pt-8",children:[a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50 mb-6",children:[a.jsx(vt,{children:a.jsxs(wt,{className:"text-white flex items-center gap-2",children:[a.jsx(Mf,{className:"w-6 h-6"}),"Recalculate Material Counts"]})}),a.jsxs($e,{children:[a.jsx("p",{className:"text-slate-400 mb-4",children:"This will recalculate material counts for all projects based on delivered contributions only. Pending contributions will not be counted."}),a.jsx(oe,{onClick:()=>o.mutate(),disabled:n,className:"bg-cyan-500 hover:bg-cyan-600",children:n?a.jsxs(a.Fragment,{children:[a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"Processing..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Mf,{className:"w-4 h-4 mr-2"}),"Recalculate All Projects"]})})]})]}),e.length>0&&a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsx(vt,{children:a.jsx(wt,{className:"text-white",children:"Results"})}),a.jsx($e,{children:a.jsx("div",{className:"space-y-2",children:e.map((l,u)=>a.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-800/50 rounded-lg",children:[l.success?a.jsx(Or,{className:"w-5 h-5 text-green-400 flex-shrink-0"}):a.jsx(Yr,{className:"w-5 h-5 text-red-400 flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-white font-medium",children:l.projectName}),a.jsx("p",{className:"text-sm text-slate-400",children:l.message})]})]},u))})})]})]})})}function $Y(){const[e,t]=v.useState([]),{data:n}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),r=Ae({mutationFn:async()=>{const i=await O.entities.Contribution.filter({status:"delivered"}),o=await O.entities.User.list(),l=await O.entities.Material.list(),u={};l.forEach(h=>{u[h.name]=h.reputation_value||10});const d={};i.forEach(h=>{if(h.contributor_email&&h.material_name){const p=u[h.material_name]||10,g=h.quantity||1;d[h.contributor_email]=(d[h.contributor_email]||0)+p*g}});const f=[];for(const h of o){const p=d[h.email]||0,g=h.reputation||0;if(p!==g)try{await O.entities.User.update(h.id,{reputation:p}),f.push({email:h.email,name:h.alias||h.full_name,old:g,new:p,status:"success"})}catch(x){f.push({email:h.email,name:h.alias||h.full_name,status:"error",error:x.message})}}return f},onSuccess:i=>{t(i)}});return(n==null?void 0:n.role)!=="admin"?a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 flex items-center justify-center p-4",children:a.jsx(Be,{className:"bg-slate-900/50 border-slate-700/50 max-w-md",children:a.jsxs($e,{className:"p-12 text-center",children:[a.jsx(Yr,{className:"w-16 h-16 text-red-500 mx-auto mb-4"}),a.jsx("h2",{className:"text-xl text-white mb-2",children:"Admin Access Required"}),a.jsx("p",{className:"text-slate-400",children:"This tool is only available to administrators."})]})})}):a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 py-12 px-4",children:a.jsx("div",{className:"max-w-4xl mx-auto",children:a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsx(vt,{children:a.jsxs(wt,{className:"flex items-center gap-3 text-white",children:[a.jsx(sO,{className:"w-6 h-6 text-cyan-400"}),"Recalculate Reputation Points"]})}),a.jsxs($e,{children:[a.jsx("p",{className:"text-slate-400 mb-6",children:"This will recalculate reputation points for all users based on their delivered contributions. Points are calculated based on material value and quantity contributed."}),a.jsx(oe,{onClick:()=>r.mutate(),disabled:r.isPending,className:"bg-cyan-500 hover:bg-cyan-600 mb-6",children:r.isPending?a.jsxs(a.Fragment,{children:[a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"Recalculating..."]}):"Start Recalculation"}),e.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx("h3",{className:"text-white font-semibold mb-3",children:"Results:"}),e.map((i,o)=>a.jsx("div",{className:`p-3 rounded-lg flex items-center justify-between ${i.status==="success"?"bg-green-500/10 border border-green-500/30":"bg-red-500/10 border border-red-500/30"}`,children:a.jsxs("div",{className:"flex items-center gap-3",children:[i.status==="success"?a.jsx(Or,{className:"w-5 h-5 text-green-400"}):a.jsx(Yr,{className:"w-5 h-5 text-red-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-white font-medium",children:i.name||i.email}),i.status==="success"?a.jsxs("p",{className:"text-sm text-slate-400",children:["Updated: ",i.old," → ",i.new," points"]}):a.jsx("p",{className:"text-sm text-red-400",children:i.error})]})]})},o))]})]})]})})})}const dN={"Polaris Wikelo Special":"Now make Polaris. Short Time Deal","A2 Hercules":"Starlifter A2 War Mod",Asgard:"Asgard Fight Mod","F8C Lightning Military":"F8 War Mod","Starlancer MAX":"More than a Max","Starlancer TAC":"New Move Big Starlancer Ship","Prowler Utility":"Prowler More Utility","F8C Lightning Stealth":"Sneaky Stabber","Constellation Taurus":"Want Taurus ship",Scorpius:"Build a Mod Scorpius","Sabre Firebird":"Firebird Mod",Guardian:"Guardian Fight Mod","Guardian QI":"Guardian take down ship","Mirai Guardian MX":"Guardian WiK-X","Ares Ion":"Sneaky Starfighter Ion","Ares Inferno":"Starfighter Inferno Special","Terrapin Medic":"What is Terrapin?","Super Hornet Mk II":"Wikelo Navy F7","Zeus CL":"Zeus Cargo Special",Fortune:"Fortune ship for you",Golem:"Golem Rocks","Sabre Peregrine":"Peregrine Wikelo Mod",Prospector:"Prospects Look Good",RAFT:"Ready for RAFT?","RSI Meteor":"RSI Meteor Mod","C1 Spirit":"Spirit Cargo mod",Intrepid:"Upgrade Intrepid","L-21 Wolf Stealth":"Where Wolf? Here Wolf","Zeus ES":"Zeus Special","Ursa Medivac":"Make a Ursa Mod","ATLS IKTI":"Make ATLS shoot","ATLS IKTI GEO":"Make jumpy ATLS shoot",Nox:"Noxy Mod",Pulse:"Pulse Plus","L-21 Wolf Military":"Most Special Wolf","Idris-P":"Special Idris For Killing","Apollo Triage 'Red Fight'":"Red Fight Apollo"};function UY(){const{t:e}=gn(),[t,n]=v.useState(""),[r,i]=v.useState(null),[o,l]=v.useState(!1),u=Bt(),d=yl(),{data:f}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),h=Ae({mutationFn:x=>O.entities.ShipProject.create({...x,owner_email:f==null?void 0:f.email,owner_name:(f==null?void 0:f.alias)||(f==null?void 0:f.full_name),owner_avatar:f==null?void 0:f.avatar_url,status:"planning"}),onSuccess:x=>{u.invalidateQueries({queryKey:["projects"]}),Yn.success(e("projectCreatedSuccess")),l(!1),d(nt("ProjectDetails")+"?id="+x.id)}}),p=x=>{if(!f){O.auth.redirectToLogin();return}i(x),l(!0)},g=qx.filter(x=>{const w=t.toLowerCase();return!w||x.name.toLowerCase().includes(w)?!0:(Xf[x.name]||[]).some(N=>N.material_name.toLowerCase().includes(w))});return a.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 py-12 px-4",children:[a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsxs(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:[a.jsx("h1",{className:"text-4xl font-bold text-white mb-4",children:e("shipsAndMaterials")}),a.jsx("p",{className:"text-slate-400 mb-6",children:e("browseShipsDesc")}),a.jsxs("div",{className:"relative max-w-md",children:[a.jsx(Ks,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400"}),a.jsx(dt,{placeholder:"Search ships or materials...",value:t,onChange:x=>n(x.target.value),className:"pl-10 bg-slate-800 border-slate-700 text-white placeholder:text-slate-500"})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:g.map((x,w)=>{const _=Xf[x.name]||[];return a.jsxs(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:w*.05},className:"bg-slate-900/50 backdrop-blur-sm rounded-xl border border-slate-700/50 overflow-hidden hover:border-cyan-500/50 transition-colors group cursor-pointer",onClick:()=>p(x),children:[a.jsxs("div",{className:"relative h-48 bg-slate-800",children:[a.jsx("img",{src:x.image,alt:x.name,className:"w-full h-full object-cover"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-900 to-transparent"}),a.jsx("div",{className:"absolute inset-0 bg-cyan-500/0 group-hover:bg-cyan-500/10 transition-colors flex items-center justify-center",children:a.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity bg-cyan-500 text-white px-4 py-2 rounded-lg flex items-center gap-2",children:[a.jsx(er,{className:"w-4 h-4"}),a.jsx("span",{className:"font-medium",children:e("startProject")})]})}),x.manufacturer&&g1[x.manufacturer]&&a.jsx("img",{src:g1[x.manufacturer],alt:x.manufacturer,className:`absolute bottom-4 right-4 w-auto opacity-70 ${x.manufacturer==="Crusader Industries"?"h-16":"h-8"}`}),a.jsx("h3",{className:"absolute bottom-4 left-4 text-xl font-bold text-white",children:x.name})]}),a.jsxs("div",{className:"p-4",children:[dN[x.name]&&a.jsx("p",{className:"text-cyan-400 text-sm font-bold mb-3",children:dN[x.name]}),a.jsxs("div",{className:"flex items-center gap-2 text-slate-300 mb-3",children:[a.jsx(Nt,{className:"w-4 h-4 text-cyan-400"}),a.jsx("span",{className:"text-sm font-medium",children:e("requiredMaterials")})]}),_.length>0?a.jsx("div",{className:"space-y-2",children:_.map((N,C)=>a.jsxs("div",{className:"flex items-center justify-between text-sm bg-slate-800/50 rounded px-3 py-2",children:[a.jsx("span",{className:"text-slate-300",children:N.material_name}),a.jsxs("span",{className:"text-cyan-400 font-mono font-medium",children:[N.quantity_needed,"x"]})]},C))}):a.jsx("p",{className:"text-sm text-slate-500 italic",children:e("noMaterialsData")})]})]},x.name)})}),g.length===0&&a.jsx("div",{className:"text-center py-20",children:a.jsxs("p",{className:"text-slate-400",children:[e("noShipsFound"),' "',t,'"']})})]}),a.jsx(rM,{open:o,onClose:()=>{l(!1),i(null)},onSubmit:x=>h.mutate(x),isLoading:h.isPending,preselectedShip:r})]})}var d0=["Enter"," "],WY=["ArrowDown","PageUp","Home"],HM=["ArrowUp","PageDown","End"],HY=[...WY,...HM],KY={ltr:[...d0,"ArrowRight"],rtl:[...d0,"ArrowLeft"]},GY={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ou="Menu",[nu,QY,YY]=F0(Ou),[Zs,KM]=vr(Ou,[YY,jl,Sm]),Jm=jl(),GM=Sm(),[XY,eo]=Zs(Ou),[JY,Iu]=Zs(Ou),QM=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:l=!0}=e,u=Jm(t),[d,f]=v.useState(null),h=v.useRef(!1),p=_n(o),g=vu(i);return v.useEffect(()=>{const x=()=>{h.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>h.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),a.jsx(Mx,{...u,children:a.jsx(XY,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:a.jsx(JY,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:g,modal:l,children:r})})})};QM.displayName=Ou;var ZY="MenuAnchor",Sv=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Jm(n);return a.jsx(Rx,{...i,...r,ref:t})});Sv.displayName=ZY;var jv="MenuPortal",[eX,YM]=Zs(jv,{forceMount:void 0}),XM=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=eo(jv,t);return a.jsx(eX,{scope:t,forceMount:n,children:a.jsx(Fn,{present:n||o.open,children:a.jsx(Pu,{asChild:!0,container:i,children:r})})})};XM.displayName=jv;var Rr="MenuContent",[tX,Nv]=Zs(Rr),JM=v.forwardRef((e,t)=>{const n=YM(Rr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=eo(Rr,e.__scopeMenu),l=Iu(Rr,e.__scopeMenu);return a.jsx(nu.Provider,{scope:e.__scopeMenu,children:a.jsx(Fn,{present:r||o.open,children:a.jsx(nu.Slot,{scope:e.__scopeMenu,children:l.modal?a.jsx(nX,{...i,ref:t}):a.jsx(rX,{...i,ref:t})})})})}),nX=v.forwardRef((e,t)=>{const n=eo(Rr,e.__scopeMenu),r=v.useRef(null),i=ct(t,r);return v.useEffect(()=>{const o=r.current;if(o)return Dx(o)},[]),a.jsx(Cv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),rX=v.forwardRef((e,t)=>{const n=eo(Rr,e.__scopeMenu);return a.jsx(Cv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),iX=Vs("MenuContent.ScrollLock"),Cv=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:x,disableOutsideScroll:w,..._}=e,N=eo(Rr,n),C=Iu(Rr,n),k=Jm(n),P=GM(n),T=QY(n),[S,E]=v.useState(null),z=v.useRef(null),D=ct(t,z,N.onContentChange),K=v.useRef(0),U=v.useRef(""),W=v.useRef(0),G=v.useRef(null),R=v.useRef("right"),q=v.useRef(0),J=w?qm:v.Fragment,ae=w?{as:iX,allowPinchZoom:!0}:void 0,re=Y=>{var le,we;const M=U.current+Y,B=T().filter(je=>!je.disabled),Z=document.activeElement,I=(le=B.find(je=>je.ref.current===Z))==null?void 0:le.textValue,de=B.map(je=>je.textValue),Ne=gX(de,M,I),_e=(we=B.find(je=>je.textValue===Ne))==null?void 0:we.ref.current;(function je(Se){U.current=Se,window.clearTimeout(K.current),Se!==""&&(K.current=window.setTimeout(()=>je(""),1e3))})(M),_e&&setTimeout(()=>_e.focus())};v.useEffect(()=>()=>window.clearTimeout(K.current),[]),Sx();const L=v.useCallback(Y=>{var B,Z;return R.current===((B=G.current)==null?void 0:B.side)&&xX(Y,(Z=G.current)==null?void 0:Z.area)},[]);return a.jsx(tX,{scope:n,searchRef:U,onItemEnter:v.useCallback(Y=>{L(Y)&&Y.preventDefault()},[L]),onItemLeave:v.useCallback(Y=>{var M;L(Y)||((M=z.current)==null||M.focus(),E(null))},[L]),onTriggerLeave:v.useCallback(Y=>{L(Y)&&Y.preventDefault()},[L]),pointerGraceTimerRef:W,onPointerGraceIntentChange:v.useCallback(Y=>{G.current=Y},[]),children:a.jsx(J,{...ae,children:a.jsx(Mm,{asChild:!0,trapped:i,onMountAutoFocus:Ce(o,Y=>{var M;Y.preventDefault(),(M=z.current)==null||M.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:a.jsx(Cu,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:x,children:a.jsx(bk,{asChild:!0,...P,dir:C.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:Ce(d,Y=>{C.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(Ox,{role:"menu","aria-orientation":"vertical","data-state":h2(N.open),"data-radix-menu-content":"",dir:C.dir,...k,..._,ref:D,style:{outline:"none",..._.style},onKeyDown:Ce(_.onKeyDown,Y=>{const B=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,Z=Y.ctrlKey||Y.altKey||Y.metaKey,I=Y.key.length===1;B&&(Y.key==="Tab"&&Y.preventDefault(),!Z&&I&&re(Y.key));const de=z.current;if(Y.target!==de||!HY.includes(Y.key))return;Y.preventDefault();const _e=T().filter(le=>!le.disabled).map(le=>le.ref.current);HM.includes(Y.key)&&_e.reverse(),hX(_e)}),onBlur:Ce(e.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(K.current),U.current="")}),onPointerMove:Ce(e.onPointerMove,ru(Y=>{const M=Y.target,B=q.current!==Y.clientX;if(Y.currentTarget.contains(M)&&B){const Z=Y.clientX>q.current?"right":"left";R.current=Z,q.current=Y.clientX}}))})})})})})})});JM.displayName=Rr;var aX="MenuGroup",kv=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Xe.div,{role:"group",...r,ref:t})});kv.displayName=aX;var sX="MenuLabel",ZM=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Xe.div,{...r,ref:t})});ZM.displayName=sX;var om="MenuItem",fN="menu.itemSelect",Zm=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=v.useRef(null),l=Iu(om,e.__scopeMenu),u=Nv(om,e.__scopeMenu),d=ct(t,o),f=v.useRef(!1),h=()=>{const p=o.current;if(!n&&p){const g=new CustomEvent(fN,{bubbles:!0,cancelable:!0});p.addEventListener(fN,x=>r==null?void 0:r(x),{once:!0}),hk(p,g),g.defaultPrevented?f.current=!1:l.onClose()}};return a.jsx(e2,{...i,ref:d,disabled:n,onClick:Ce(e.onClick,h),onPointerDown:p=>{var g;(g=e.onPointerDown)==null||g.call(e,p),f.current=!0},onPointerUp:Ce(e.onPointerUp,p=>{var g;f.current||(g=p.currentTarget)==null||g.click()}),onKeyDown:Ce(e.onKeyDown,p=>{const g=u.searchRef.current!=="";n||g&&p.key===" "||d0.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Zm.displayName=om;var e2=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,l=Nv(om,n),u=GM(n),d=v.useRef(null),f=ct(t,d),[h,p]=v.useState(!1),[g,x]=v.useState("");return v.useEffect(()=>{const w=d.current;w&&x((w.textContent??"").trim())},[o.children]),a.jsx(nu.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:a.jsx(wk,{asChild:!0,...u,focusable:!r,children:a.jsx(Xe.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:f,onPointerMove:Ce(e.onPointerMove,ru(w=>{r?l.onItemLeave(w):(l.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ce(e.onPointerLeave,ru(w=>l.onItemLeave(w))),onFocus:Ce(e.onFocus,()=>p(!0)),onBlur:Ce(e.onBlur,()=>p(!1))})})})}),oX="MenuCheckboxItem",t2=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return a.jsx(s2,{scope:e.__scopeMenu,checked:n,children:a.jsx(Zm,{role:"menuitemcheckbox","aria-checked":lm(n)?"mixed":n,...i,ref:t,"data-state":Ev(n),onSelect:Ce(i.onSelect,()=>r==null?void 0:r(lm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});t2.displayName=oX;var n2="MenuRadioGroup",[lX,cX]=Zs(n2,{value:void 0,onValueChange:()=>{}}),r2=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=_n(r);return a.jsx(lX,{scope:e.__scopeMenu,value:n,onValueChange:o,children:a.jsx(kv,{...i,ref:t})})});r2.displayName=n2;var i2="MenuRadioItem",a2=v.forwardRef((e,t)=>{const{value:n,...r}=e,i=cX(i2,e.__scopeMenu),o=n===i.value;return a.jsx(s2,{scope:e.__scopeMenu,checked:o,children:a.jsx(Zm,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":Ev(o),onSelect:Ce(r.onSelect,()=>{var l;return(l=i.onValueChange)==null?void 0:l.call(i,n)},{checkForDefaultPrevented:!1})})})});a2.displayName=i2;var Pv="MenuItemIndicator",[s2,uX]=Zs(Pv,{checked:!1}),o2=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=uX(Pv,n);return a.jsx(Fn,{present:r||lm(o.checked)||o.checked===!0,children:a.jsx(Xe.span,{...i,ref:t,"data-state":Ev(o.checked)})})});o2.displayName=Pv;var dX="MenuSeparator",l2=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Xe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});l2.displayName=dX;var fX="MenuArrow",c2=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Jm(n);return a.jsx(Ix,{...i,...r,ref:t})});c2.displayName=fX;var mX="MenuSub",[ZJ,u2]=Zs(mX),Mc="MenuSubTrigger",d2=v.forwardRef((e,t)=>{const n=eo(Mc,e.__scopeMenu),r=Iu(Mc,e.__scopeMenu),i=u2(Mc,e.__scopeMenu),o=Nv(Mc,e.__scopeMenu),l=v.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=o,f={__scopeMenu:e.__scopeMenu},h=v.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return v.useEffect(()=>h,[h]),v.useEffect(()=>{const p=u.current;return()=>{window.clearTimeout(p),d(null)}},[u,d]),a.jsx(Sv,{asChild:!0,...f,children:a.jsx(e2,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":h2(n.open),...e,ref:_m(t,i.onTriggerChange),onClick:p=>{var g;(g=e.onClick)==null||g.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ce(e.onPointerMove,ru(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Ce(e.onPointerLeave,ru(p=>{var x,w;h();const g=(x=n.content)==null?void 0:x.getBoundingClientRect();if(g){const _=(w=n.content)==null?void 0:w.dataset.side,N=_==="right",C=N?-5:5,k=g[N?"left":"right"],P=g[N?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+C,y:p.clientY},{x:k,y:g.top},{x:P,y:g.top},{x:P,y:g.bottom},{x:k,y:g.bottom}],side:_}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(e.onKeyDown,p=>{var x;const g=o.searchRef.current!=="";e.disabled||g&&p.key===" "||KY[r.dir].includes(p.key)&&(n.onOpenChange(!0),(x=n.content)==null||x.focus(),p.preventDefault())})})})});d2.displayName=Mc;var f2="MenuSubContent",m2=v.forwardRef((e,t)=>{const n=YM(Rr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=eo(Rr,e.__scopeMenu),l=Iu(Rr,e.__scopeMenu),u=u2(f2,e.__scopeMenu),d=v.useRef(null),f=ct(t,d);return a.jsx(nu.Provider,{scope:e.__scopeMenu,children:a.jsx(Fn,{present:r||o.open,children:a.jsx(nu.Slot,{scope:e.__scopeMenu,children:a.jsx(Cv,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:f,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var p;l.isUsingKeyboardRef.current&&((p=d.current)==null||p.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Ce(e.onFocusOutside,h=>{h.target!==u.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,h=>{l.onClose(),h.preventDefault()}),onKeyDown:Ce(e.onKeyDown,h=>{var x;const p=h.currentTarget.contains(h.target),g=GY[l.dir].includes(h.key);p&&g&&(o.onOpenChange(!1),(x=u.trigger)==null||x.focus(),h.preventDefault())})})})})})});m2.displayName=f2;function h2(e){return e?"open":"closed"}function lm(e){return e==="indeterminate"}function Ev(e){return lm(e)?"indeterminate":e?"checked":"unchecked"}function hX(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function pX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function gX(e,t,n){const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=pX(e,Math.max(o,0));i.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function yX(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const u=t[o],d=t[l],f=u.x,h=u.y,p=d.x,g=d.y;h>r!=g>r&&n<(p-f)*(r-h)/(g-h)+f&&(i=!i)}return i}function xX(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return yX(n,t)}function ru(e){return t=>t.pointerType==="mouse"?e(t):void 0}var vX=QM,bX=Sv,wX=XM,_X=JM,SX=kv,jX=ZM,NX=Zm,CX=t2,kX=r2,PX=a2,EX=o2,TX=l2,AX=c2,MX=d2,RX=m2,eh="DropdownMenu",[OX]=vr(eh,[KM]),zn=KM(),[IX,p2]=OX(eh),g2=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:l,modal:u=!0}=e,d=zn(t),f=v.useRef(null),[h,p]=Va({prop:i,defaultProp:o??!1,onChange:l,caller:eh});return a.jsx(IX,{scope:t,triggerId:Qr(),triggerRef:f,contentId:Qr(),open:h,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(g=>!g),[p]),modal:u,children:a.jsx(vX,{...d,open:h,onOpenChange:p,dir:r,modal:u,children:n})})};g2.displayName=eh;var y2="DropdownMenuTrigger",x2=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=p2(y2,n),l=zn(n);return a.jsx(bX,{asChild:!0,...l,children:a.jsx(Xe.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:_m(t,o.triggerRef),onPointerDown:Ce(e.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:Ce(e.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});x2.displayName=y2;var DX="DropdownMenuPortal",v2=e=>{const{__scopeDropdownMenu:t,...n}=e,r=zn(t);return a.jsx(wX,{...r,...n})};v2.displayName=DX;var b2="DropdownMenuContent",w2=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=p2(b2,n),o=zn(n),l=v.useRef(!1);return a.jsx(_X,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:Ce(e.onCloseAutoFocus,u=>{var d;l.current||(d=i.triggerRef.current)==null||d.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:Ce(e.onInteractOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;(!i.modal||h)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});w2.displayName=b2;var LX="DropdownMenuGroup",qX=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=zn(n);return a.jsx(SX,{...i,...r,ref:t})});qX.displayName=LX;var FX="DropdownMenuLabel",_2=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=zn(n);return a.jsx(jX,{...i,...r,ref:t})});_2.displayName=FX;var zX="DropdownMenuItem",S2=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=zn(n);return a.jsx(NX,{...i,...r,ref:t})});S2.displayName=zX;var BX="DropdownMenuCheckboxItem",j2=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=zn(n);return a.jsx(CX,{...i,...r,ref:t})});j2.displayName=BX;var VX="DropdownMenuRadioGroup",$X=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=zn(n);return a.jsx(kX,{...i,...r,ref:t})});$X.displayName=VX;var UX="DropdownMenuRadioItem",N2=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=zn(n);return a.jsx(PX,{...i,...r,ref:t})});N2.displayName=UX;var WX="DropdownMenuItemIndicator",C2=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=zn(n);return a.jsx(EX,{...i,...r,ref:t})});C2.displayName=WX;var HX="DropdownMenuSeparator",k2=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=zn(n);return a.jsx(TX,{...i,...r,ref:t})});k2.displayName=HX;var KX="DropdownMenuArrow",GX=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=zn(n);return a.jsx(AX,{...i,...r,ref:t})});GX.displayName=KX;var QX="DropdownMenuSubTrigger",P2=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=zn(n);return a.jsx(MX,{...i,...r,ref:t})});P2.displayName=QX;var YX="DropdownMenuSubContent",E2=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=zn(n);return a.jsx(RX,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});E2.displayName=YX;var XX=g2,JX=x2,ZX=v2,T2=w2,A2=_2,M2=S2,R2=j2,O2=N2,I2=C2,D2=k2,L2=P2,q2=E2;const mN=XX,hN=JX,eJ=v.forwardRef(({className:e,inset:t,children:n,...r},i)=>a.jsxs(L2,{ref:i,className:Fe("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,a.jsx(fO,{className:"ml-auto"})]}));eJ.displayName=L2.displayName;const tJ=v.forwardRef(({className:e,...t},n)=>a.jsx(q2,{ref:n,className:Fe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));tJ.displayName=q2.displayName;const f0=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>a.jsx(ZX,{children:a.jsx(T2,{ref:r,sideOffset:t,className:Fe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));f0.displayName=T2.displayName;const Fi=v.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(M2,{ref:r,className:Fe("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));Fi.displayName=M2.displayName;const nJ=v.forwardRef(({className:e,children:t,checked:n,...r},i)=>a.jsxs(R2,{ref:i,className:Fe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(I2,{children:a.jsx(dm,{className:"h-4 w-4"})})}),t]}));nJ.displayName=R2.displayName;const rJ=v.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(O2,{ref:r,className:Fe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(I2,{children:a.jsx(vO,{className:"h-2 w-2 fill-current"})})}),t]}));rJ.displayName=O2.displayName;const iJ=v.forwardRef(({className:e,inset:t,...n},r)=>a.jsx(A2,{ref:r,className:Fe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));iJ.displayName=A2.displayName;const F2=v.forwardRef(({className:e,...t},n)=>a.jsx(D2,{ref:n,className:Fe("-mx-1 my-1 h-px bg-muted",e),...t}));F2.displayName=D2.displayName;function aJ(){const[e,t]=v.useState(!1),[n,r]=v.useState(0),[i,o]=v.useState(0),[l,u]=v.useState(""),d=Bt(),{data:f}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),h=Ae({mutationFn:async g=>{const x=await O.entities.Feedback.create(g);return await O.functions.invoke("sendFeedbackEmail",g),x},onSuccess:()=>{d.invalidateQueries({queryKey:["feedback"]}),Yn.success("Thank you for your feedback!"),r(0),u(""),t(!1)},onError:g=>{Yn.error("Failed to submit feedback. Please try again."),console.error("Feedback submission error:",g)}}),p=g=>{if(g.preventDefault(),!f){O.auth.redirectToLogin();return}if(n===0){Yn.error("Please select a rating");return}if(!l.trim()){Yn.error("Please enter your feedback");return}h.mutate({user_email:f.email,user_name:f.alias||f.full_name,feedback_text:l,rating:n})};return a.jsx("div",{className:"w-full",children:a.jsx(Cm,{children:e?a.jsx(bt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"bg-slate-900 border border-slate-700 rounded-lg p-4",children:a.jsxs("form",{onSubmit:p,className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-slate-300 mb-2 block",children:"Rate your experience"}),a.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(g=>a.jsx("button",{type:"button",onClick:()=>r(g),onMouseEnter:()=>o(g),onMouseLeave:()=>o(0),className:"transition-transform hover:scale-110",children:a.jsx(w0,{className:`w-8 h-8 ${g<=(i||n)?"fill-yellow-400 text-yellow-400":"text-slate-600"}`})},g))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-slate-300 mb-2 block",children:"Your feedback"}),a.jsx(Pi,{value:l,onChange:g=>u(g.target.value),placeholder:"Tell us what you think...",className:"bg-slate-800 border-slate-700 text-white min-h-[100px]",maxLength:1e3}),a.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:[l.length,"/1000"]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(oe,{type:"submit",disabled:h.isPending,className:"flex-1 bg-cyan-600 hover:bg-cyan-700 text-white",children:h.isPending?"Sending...":a.jsxs(a.Fragment,{children:[a.jsx(fm,{className:"w-4 h-4 mr-2"}),"Submit"]})}),a.jsx(oe,{type:"button",variant:"outline",onClick:()=>{t(!1),r(0),u("")},className:"border-slate-700 text-slate-300 hover:bg-slate-800",children:"Cancel"})]})]})}):a.jsx(bt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},children:a.jsxs(oe,{onClick:()=>t(!0),variant:"outline",className:"bg-background text-sky-800 px-4 py-2 text-sm font-medium rounded-md inline-flex items-center justify-center gap-2 whitespace-nowrap transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border shadow-sm h-9 w-auto mx-auto border-slate-700 hover:bg-slate-800 hover:text-white",children:[a.jsx(Af,{className:"w-4 h-4 mr-2"}),"Send Feedback"]})})})})}function sJ(){const[e,t]=v.useState(0),[n,r]=v.useState(!1),{data:i=[]}=me({queryKey:["active-ads"],queryFn:()=>O.entities.Ad.filter({status:"approved",payment_status:"active"}),refetchInterval:6e4});if(v.useEffect(()=>{if(i.length<=1)return;const l=setInterval(()=>{t(u=>(u+1)%i.length)},8e3);return()=>clearInterval(l)},[i.length]),n||i.length===0)return null;const o=i[e];return a.jsx("div",{className:"w-full bg-slate-900 border-b border-slate-700 relative",children:a.jsxs("div",{className:"px-4 py-2 flex flex-col items-center gap-1",children:[a.jsxs("div",{className:"flex items-center justify-center w-full relative",children:[a.jsx("span",{className:"text-[10px] text-slate-500 uppercase tracking-widest",children:"Ad"}),a.jsx("button",{onClick:()=>r(!0),className:"absolute right-0 text-slate-500 hover:text-slate-300 transition-colors",children:a.jsx(mm,{className:"w-4 h-4"})})]}),a.jsx("a",{href:o.target_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center",style:{height:"116px"},children:o.image_url&&a.jsx("img",{src:o.image_url,alt:"Advertisement",style:{height:"116px",width:"auto",maxWidth:"100%",objectFit:"contain",display:"block"}})}),i.length>1&&a.jsx("div",{className:"flex gap-1",children:i.map((l,u)=>a.jsx("button",{onClick:()=>t(u),className:`w-1.5 h-1.5 rounded-full transition-colors ${u===e?"bg-cyan-400":"bg-slate-600"}`},u))})]})})}function oJ({children:e,currentPageName:t}){var x;const{t:n,changeLanguage:r,availableLanguages:i,languageNames:o,language:l,languageFlags:u}=gn(),{data:d}=me({queryKey:["user"],queryFn:()=>O.auth.me()});Tn.useEffect(()=>{d&&!d.alias&&t!=="Profile"&&(window.location.href=nt("Profile"))},[d,t]);const{data:f=[]}=me({queryKey:["my-memberships",d==null?void 0:d.email],queryFn:()=>O.entities.OrganizationMember.filter({user_email:d==null?void 0:d.email,status:"active"}),enabled:!!(d!=null&&d.email)}),{data:h=[]}=me({queryKey:["notifications",d==null?void 0:d.email],queryFn:()=>O.entities.UserNotification.filter({user_email:d==null?void 0:d.email,is_read:!1}),enabled:!!(d!=null&&d.email),refetchInterval:3e3}),p=(d==null?void 0:d.default_org_id)||((x=f[0])==null?void 0:x.org_id),g=h.length;return a.jsxs("div",{className:"min-h-screen bg-slate-950",children:[a.jsx("nav",{className:"fixed top-0 left-0 right-0 z-50 bg-slate-950/80 backdrop-blur-xl border-b border-slate-800",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"flex items-center justify-between h-16",children:[a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsxs(Ft,{to:nt("Home"),className:"flex items-center gap-2",children:[a.jsx(Ba,{className:"w-6 h-6 text-cyan-400"}),a.jsx("span",{className:"font-bold text-white text-lg",children:n("appTitle")})]}),a.jsx(Ft,{to:nt("Ships"),className:"text-slate-300 hover:text-white transition-colors text-sm",children:"Ships"}),a.jsx(Ft,{to:nt("Armors"),className:"text-slate-300 hover:text-white transition-colors text-sm",children:"Armors"}),a.jsx(Ft,{to:nt("Weapons"),className:"text-slate-300 hover:text-white transition-colors text-sm",children:"Weapons"}),a.jsx(Ft,{to:nt("Organizations"),className:"text-slate-300 hover:text-white transition-colors text-sm",children:n("organizations")}),a.jsx(Ft,{to:nt("Guide"),className:"text-slate-300 hover:text-white transition-colors text-sm",children:"Guide"}),a.jsx(Ft,{to:nt("AdvertiseWithUs"),className:"text-cyan-400 hover:text-cyan-300 transition-colors text-sm font-medium",children:"Advertise"})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[d?a.jsxs(mN,{children:[a.jsx(hN,{asChild:!0,children:a.jsxs(oe,{variant:"ghost",className:"flex items-center gap-2 text-slate-300 hover:text-cyan-400 hover:bg-cyan-500/10 relative",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-cyan-500 to-purple-500 flex items-center justify-center overflow-hidden",children:d.avatar_url?a.jsx("img",{src:d.avatar_url,alt:"Avatar",className:"w-full h-full object-cover"}):a.jsx("span",{className:"text-white font-medium text-sm",children:(d.alias||d.full_name||"U")[0].toUpperCase()})}),g>0&&a.jsx(zt,{className:"absolute -top-1 -right-1 h-5 min-w-5 px-1 flex items-center justify-center bg-red-500 text-white text-xs border-2 border-slate-950",children:g>9?"9+":g})]}),a.jsx("span",{className:"hidden md:inline",children:d.alias||d.full_name||"User"})]})}),a.jsxs(f0,{className:"bg-slate-900 border-slate-700",children:[a.jsxs(Fi,{onClick:()=>window.location.href=nt("Reputation"),className:"text-slate-300 hover:text-white hover:bg-slate-800 cursor-pointer",children:[a.jsx(w0,{className:"w-4 h-4 mr-2"}),"Wikelo Reputation"]}),a.jsxs(Fi,{onClick:()=>window.location.href=nt("Inventory"),className:"text-slate-300 hover:text-white hover:bg-slate-800 cursor-pointer",children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Inventory"]}),a.jsxs(Fi,{onClick:()=>window.location.href=nt("Messages"),className:"text-slate-300 hover:text-white hover:bg-slate-800 cursor-pointer",children:[a.jsx(Gi,{className:"w-4 h-4 mr-2"}),"Messages"]}),a.jsxs(Fi,{onClick:()=>window.location.href=nt("Notifications"),className:"text-slate-300 hover:text-white hover:bg-slate-800 cursor-pointer",children:[a.jsx(il,{className:"w-4 h-4 mr-2"}),n("notifications"),g>0&&a.jsx(zt,{className:"ml-auto bg-red-500 text-white",children:g})]}),p&&a.jsxs(Fi,{onClick:()=>window.location.href=nt(`OrganizationDetails?id=${p}`),className:"text-slate-300 hover:text-white hover:bg-slate-800 cursor-pointer",children:[a.jsx(Sn,{className:"w-4 h-4 mr-2"}),"My Org"]}),a.jsxs(Fi,{onClick:()=>window.location.href=nt("Profile"),className:"text-slate-300 hover:text-white hover:bg-slate-800 cursor-pointer",children:[a.jsx(Rf,{className:"w-4 h-4 mr-2"}),n("profile")]}),a.jsx(F2,{className:"bg-slate-700"}),a.jsxs(Fi,{onClick:()=>O.auth.logout(),className:"text-slate-300 hover:text-white hover:bg-slate-800 cursor-pointer",children:[a.jsx(DN,{className:"w-4 h-4 mr-2"}),n("signOut")]})]})]}):a.jsx(oe,{onClick:()=>O.auth.redirectToLogin(),className:"bg-cyan-500 hover:bg-cyan-600 text-white",children:"Sign In"}),a.jsxs(mN,{children:[a.jsx(hN,{asChild:!0,children:a.jsx(oe,{variant:"outline",className:"text-base border-slate-700 hover:bg-slate-800 px-1.5 h-7",children:u[l]})}),a.jsx(f0,{className:"bg-slate-900 border-slate-700",children:i.map(w=>a.jsxs(Fi,{onClick:()=>r(w),className:`${w===l?"text-white bg-slate-800":"text-slate-300"} hover:text-white hover:bg-slate-800 cursor-pointer`,children:[a.jsx("span",{className:"mr-2 text-lg",children:u[w]}),o[w]]},w))})]})]})]})})}),a.jsxs("main",{className:"pt-16 pb-32",children:[a.jsx(sJ,{}),a.jsxs("div",{className:"bg-amber-500/10 border-b border-amber-500/30 px-4 py-2 flex items-center justify-center gap-2",children:[a.jsx(x0,{className:"w-4 h-4 text-amber-400 shrink-0"}),a.jsxs("p",{className:"text-amber-300 text-sm text-center",children:[a.jsx("span",{className:"font-semibold",children:n("updateBannerTitle")})," ",n("updateBannerText")," ",a.jsx("a",{href:"/UpdateInfo",className:"underline text-amber-400 hover:text-amber-300 font-medium",children:n("updateBannerLink")})]})]}),e]}),a.jsx("footer",{className:"fixed bottom-0 left-0 right-0 bg-slate-950/80 backdrop-blur-xl border-t border-slate-800",children:a.jsxs("div",{className:"mx-auto px-4 max-w-7xl sm:px-6 lg:px-8",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 w-full",children:[a.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[a.jsx("img",{src:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/bac919ae7_MadeByTheCommunity_White.png",alt:"Made by the Community",className:"h-16 w-auto opacity-70"}),a.jsx("img",{src:"https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/695be2905c0b4866dfb21265/c16dc6206_STARCITIZEN_HORIZONTAL_WHITE.png",alt:"Star Citizen",className:"h-8 w-auto opacity-70"})]}),a.jsx("div",{className:"flex-1 flex items-center justify-center",children:a.jsxs("div",{className:"flex items-center justify-center gap-4",children:[a.jsxs("a",{href:"https://www.twitch.tv/graewulf30k",target:"_blank",rel:"noopener noreferrer",className:"text-cyan-400 text-xl font-bold hover:text-cyan-300 transition-colors flex items-center gap-2",children:[a.jsx("svg",{className:"w-7 h-7",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z"})}),"GraeWulf30k"]}),a.jsx(aJ,{})]})}),a.jsx("div",{className:"flex-1 flex justify-end",children:a.jsx("a",{href:"https://ko-fi.com/graewulf30k",target:"_blank",rel:"noopener noreferrer",children:a.jsx("img",{src:"https://storage.ko-fi.com/cdn/kofi2.png?v=3",alt:"Buy Me a Coffee at ko-fi.com",height:"36",style:{height:"36px",border:"0px"}})})})]}),a.jsx("div",{className:"py-2 border-t border-slate-800 text-center",children:a.jsx("p",{className:"text-xs text-slate-500",children:"This is an unofficial Star Citizen fansite, not affiliated with the Cloud Imperium group of companies. All content on this site not authored by its host or users are property of their respective owners."})})]})})]})}function lJ({children:e,currentPageName:t}){return a.jsx(k7,{children:a.jsx(oJ,{currentPageName:t,children:e})})}const cJ={ArmorProjectDetails:U7,Armors:H7,CleanupMaterials:K7,Guide:G7,Home:Z7,Inventory:eH,Messages:NY,NotificationSettings:AY,Notifications:MY,OrganizationDetails:OY,Organizations:DY,Profile:LY,ProjectDetails:zY,RecalculateContributionReputation:BY,RecalculateMaterials:VY,RecalculateReputation:$Y,Ships:UY},z2={mainPage:"Home",Pages:cJ,Layout:lJ};function uJ(){const e=Ys(),{isAuthenticated:t}=dk(),{Pages:n,mainPage:r}=z2,i=r;return v.useEffect(()=>{const o=e.pathname;let l;if(o==="/"||o==="")l=i;else{const u=o.replace(/^\//,"").split("/")[0];l=Object.keys(n).find(h=>h.toLowerCase()===u.toLowerCase())||null}t&&l&&O.appLogs.logUserInApp(l).catch(()=>{})},[e,t,n,i]),null}function dJ({}){var i;const t=Ys().pathname.substring(1),{data:n,isFetched:r}=me({queryKey:["user"],queryFn:async()=>{try{return{user:await O.auth.me(),isAuthenticated:!0}}catch{return{user:null,isAuthenticated:!1}}}});return a.jsx("div",{className:"min-h-screen flex items-center justify-center p-6 bg-slate-50",children:a.jsx("div",{className:"max-w-md w-full",children:a.jsxs("div",{className:"text-center space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("h1",{className:"text-7xl font-light text-slate-300",children:"404"}),a.jsx("div",{className:"h-0.5 w-16 bg-slate-200 mx-auto"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("h2",{className:"text-2xl font-medium text-slate-800",children:"Page Not Found"}),a.jsxs("p",{className:"text-slate-600 leading-relaxed",children:["The page ",a.jsxs("span",{className:"font-medium text-slate-700",children:['"',t,'"']})," could not be found in this application."]})]}),r&&n.isAuthenticated&&((i=n.user)==null?void 0:i.role)==="admin"&&a.jsx("div",{className:"mt-8 p-4 bg-slate-100 rounded-lg border border-slate-200",children:a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"flex-shrink-0 w-5 h-5 rounded-full bg-orange-100 flex items-center justify-center mt-0.5",children:a.jsx("div",{className:"w-2 h-2 rounded-full bg-orange-400"})}),a.jsxs("div",{className:"text-left space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-slate-700",children:"Admin Note"}),a.jsx("p",{className:"text-sm text-slate-600 leading-relaxed",children:"This could mean that the AI hasn't implemented this page yet. Ask it to implement it in the chat."})]})]})}),a.jsx("div",{className:"pt-6",children:a.jsxs("button",{onClick:()=>window.location.href="/",className:"inline-flex items-center px-4 py-2 text-sm font-medium text-slate-700 bg-white border border-slate-200 rounded-lg hover:bg-slate-50 hover:border-slate-300 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-slate-500",children:[a.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),"Go Home"]})})]})})})}const fJ=()=>a.jsx("div",{className:"flex flex-col items-center justify-center min-h-screen bg-gradient-to-b from-white to-slate-50",children:a.jsx("div",{className:"max-w-md w-full p-8 bg-white rounded-lg shadow-lg border border-slate-100",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 mb-6 rounded-full bg-orange-100",children:a.jsx("svg",{className:"w-8 h-8 text-orange-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),a.jsx("h1",{className:"text-3xl font-bold text-slate-900 mb-4",children:"Access Restricted"}),a.jsx("p",{className:"text-slate-600 mb-8",children:"You are not registered to use this application. Please contact the app administrator to request access."}),a.jsxs("div",{className:"p-4 bg-slate-50 rounded-md text-sm text-slate-600",children:[a.jsx("p",{children:"If you believe this is an error, you can:"}),a.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[a.jsx("li",{children:"Verify you are logged in with the correct account"}),a.jsx("li",{children:"Contact the app administrator for access"}),a.jsx("li",{children:"Try logging out and back in again"})]})]})]})})});function mJ({user:e}){const t=Bt(),[n,r]=v.useState(""),i=(e==null?void 0:e.wikelo_reputation)||0,o=l9(i),l=Zf.find(h=>h.min>i),u=l?Math.round((i-o.min)/(l.min-o.min)*100):100,d=Ae({mutationFn:async h=>{const p=Xy.find(x=>x.title===h);if(!p||p.reputation_reward<=0)throw new Error("No reputation reward for this mission");const g=i+p.reputation_reward;await O.auth.updateMe({wikelo_reputation:g})},onSuccess:()=>{t.invalidateQueries({queryKey:["user"]}),r(""),Yn.success("Reputation added!")},onError:h=>{Yn.error(h.message||"Failed to add reputation")}}),f=Xy.filter(h=>h.reputation_reward>0);return a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50 mt-6",children:[a.jsxs(vt,{children:[a.jsxs(wt,{className:"text-white flex items-center gap-2",children:[a.jsx(w0,{className:"w-5 h-5 text-yellow-400"}),"Wikelo Reputation"]}),a.jsx(mi,{className:"text-slate-400",children:"Your standing with Wikelo based on completed missions"})]}),a.jsxs($e,{className:"space-y-6",children:[a.jsxs("div",{className:`p-4 rounded-lg border ${o.bgColor} ${o.borderColor}`,children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{children:[a.jsx("p",{className:`font-bold text-lg ${o.color}`,children:o.name}),a.jsxs("p",{className:"text-slate-400 text-sm",children:[i," reputation points"]})]}),a.jsxs("div",{className:"text-right",children:[l&&a.jsxs("p",{className:"text-slate-400 text-xs",children:[l.min-i," pts to ",l.name]}),!l&&a.jsx(zt,{className:"bg-yellow-500/20 text-yellow-300 border-yellow-600",children:"Max Tier"})]})]}),l&&a.jsx("div",{className:"h-2 bg-slate-800 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-cyan-400 transition-all duration-500",style:{width:`${u}%`}})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-slate-400 text-xs font-semibold uppercase tracking-wide",children:"Reputation Tiers"}),Zf.map(h=>a.jsxs("div",{className:`flex items-center justify-between px-3 py-2 rounded-lg border ${i>=h.min?h.bgColor+" "+h.borderColor:"bg-slate-800/30 border-slate-700"}`,children:[a.jsx("span",{className:`text-sm font-medium ${i>=h.min?h.color:"text-slate-500"}`,children:h.name}),a.jsxs("span",{className:"text-xs text-slate-400",children:[h.min,h.max===1/0?"+":`–${h.max}`," pts"]})]},h.name))]}),a.jsxs("div",{className:"border-t border-slate-700 pt-4",children:[a.jsx("p",{className:"text-slate-300 text-sm font-medium mb-1",children:"Add Retroactive Reputation"}),a.jsx("p",{className:"text-slate-500 text-xs mb-3",children:"Completed a mission before joining? Select it to add its rep reward."}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("div",{className:"flex-1",children:a.jsxs(en,{value:n,onValueChange:r,children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{placeholder:"Select a completed mission..."})}),a.jsx(Qt,{className:"bg-slate-800 border-slate-700 max-h-[300px]",children:f.map(h=>a.jsx(st,{value:h.title,className:"text-white hover:bg-slate-700",children:a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{children:h.title}),a.jsxs("span",{className:"text-cyan-400 text-xs ml-auto",children:["+",h.reputation_reward," rep"]})]})},h.title))})]})}),a.jsxs(oe,{onClick:()=>n&&d.mutate(n),disabled:!n||d.isPending,className:"bg-cyan-500 hover:bg-cyan-600 shrink-0",children:[a.jsx(er,{className:"w-4 h-4 mr-1"}),"Add Rep"]})]})]})]})]})}function hJ(){const{data:e,isLoading:t}=me({queryKey:["user"],queryFn:()=>O.auth.me()});return t?a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 flex items-center justify-center",children:a.jsx(tt,{className:"w-8 h-8 text-cyan-400 animate-spin"})}):a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 py-12 px-4",children:a.jsx("div",{className:"max-w-2xl mx-auto",children:a.jsx(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:a.jsx(mJ,{user:e})})})})}const B2=[{name:"Tripledown 'Heatwave' Pistol",image:"https://media.base44.com/images/public/695be2905c0b4866dfb21265/3b01b3973_ScreenShot-2026-01-28_20-05-32-652.jpg"},{name:"Fresnel Deepwater",image:""},{name:"R97 'Crimson Camo' Shotgun",image:""},{name:'Boomtube "Clanguard" Rocket Launcher',image:""},{name:'Fresnel "Yormandi" Energy LMG',image:""},{name:'Zenith "Snow Camo" Laser Sniper Rifle',image:""},{name:'Prism "Irradiated" Laser Shotgun',image:""},{name:'Parallax "Fun Kopion Skull" Energy Assault Rifle',image:""},{name:'Parallax "Fun Military Skull" Energy Assault Rifle',image:""}],cm={"Tripledown 'Heatwave' Pistol":[{material_name:"Carinite",quantity_needed:15,quantity_collected:0},{material_name:"RCMBNT-PWL-1",quantity_needed:2,quantity_collected:0},{material_name:"RCMBNT-PWL-2",quantity_needed:2,quantity_collected:0},{material_name:"RCMBNT-PWL-3",quantity_needed:2,quantity_collected:0}],"Fresnel Deepwater":[{material_name:"ASD Secure Drive",quantity_needed:5,quantity_collected:0},{material_name:"Fresnel Energy LMG",quantity_needed:1,quantity_collected:0},{material_name:"RCMBNT-XTL-1",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-XTL-2",quantity_needed:5,quantity_collected:0},{material_name:"RCMBNT-XTL-3",quantity_needed:5,quantity_collected:0}],'Boomtube "Clanguard" Rocket Launcher':[{material_name:"Boomtube Rocket Launcher",quantity_needed:1,quantity_collected:0},{material_name:"Vanduul Plating",quantity_needed:2,quantity_collected:0},{material_name:"Vanduul Metal",quantity_needed:2,quantity_collected:0}],'Fresnel "Yormandi" Energy LMG':[{material_name:"Fresnel Energy LMG",quantity_needed:1,quantity_collected:0},{material_name:"Yormandi Eye",quantity_needed:6,quantity_collected:0},{material_name:"Yormandi Tongue",quantity_needed:3,quantity_collected:0}],'Zenith "Snow Camo" Laser Sniper Rifle':[{material_name:"ASD Secure Drive",quantity_needed:7,quantity_collected:0},{material_name:"Zenith Laser Sniper Rifle",quantity_needed:1,quantity_collected:0}],'Prism "Irradiated" Laser Shotgun':[{material_name:"Irradiated Valakkar Fang (Adult)",quantity_needed:10,quantity_collected:0},{material_name:"Irradiated Valakkar Fang (Juvenile)",quantity_needed:5,quantity_collected:0},{material_name:"Prism Laser Shotgun",quantity_needed:1,quantity_collected:0}],'Parallax "Fun Military Skull" Energy Assault Rifle':[{material_name:"Jaclium (Ore)",quantity_needed:20,quantity_collected:0},{material_name:"Parallax Energy Assault Rifle",quantity_needed:1,quantity_collected:0},{material_name:"Irradiated Valakkar Fang (Juvenile)",quantity_needed:20,quantity_collected:0},{material_name:"Saldynium (Ore)",quantity_needed:15,quantity_collected:0},{material_name:"Carinite (Ore)",quantity_needed:10,quantity_collected:0}],'Parallax "Fun Kopion Skull" Energy Assault Rifle':[{material_name:"Jaclium (Ore)",quantity_needed:20,quantity_collected:0},{material_name:"Parallax Energy Assault Rifle",quantity_needed:1,quantity_collected:0},{material_name:"Tundra Kopion Horn",quantity_needed:20,quantity_collected:0},{material_name:"Saldynium (Ore)",quantity_needed:15,quantity_collected:0},{material_name:"Carinite (Ore)",quantity_needed:10,quantity_collected:0}],"R97 'Crimson Camo' Shotgun":[{material_name:"Carinite",quantity_needed:20,quantity_collected:0},{material_name:"Bluemoon Fungus",quantity_needed:20,quantity_collected:0},{material_name:"Tripledown Pistol",quantity_needed:1,quantity_collected:0}]};function pJ({value:e,onChange:t,disabled:n=!1}){return a.jsxs(en,{value:e,onValueChange:t,disabled:n,children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white disabled:opacity-50",children:a.jsx(tn,{placeholder:"Select a weapon..."})}),a.jsx(Qt,{className:"bg-slate-800 border-slate-700 max-h-[300px]",children:B2.map(r=>a.jsx(st,{value:r.name,className:"text-white hover:bg-slate-700 hover:text-white",children:r.name},r.name))})]})}function gJ({open:e,onClose:t,onSubmit:n,isLoading:r,preselectedWeapon:i}){const{data:o}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),{data:l=[]}=me({queryKey:["my-memberships",o==null?void 0:o.email],queryFn:()=>O.entities.OrganizationMember.filter({user_email:o==null?void 0:o.email,status:"active",role:"admin"}),enabled:!!(o!=null&&o.email)}),{data:u=[]}=me({queryKey:["my-admin-orgs",l],queryFn:async()=>{if(l.length===0)return[];const g=l.map(w=>w.org_id);return(await Promise.all(g.map(w=>O.entities.Organization.filter({id:w})))).flat()},enabled:l.length>0}),[d,f]=v.useState({weapon_name:"",description:"",weapon_image:"",home_port:"",required_materials:[],org_id:"",privacy:"public"});v.useEffect(()=>{if(i){const g=cm[i.name]||[];f({weapon_name:i.name,weapon_image:i.image||"",description:"",home_port:(o==null?void 0:o.default_home_port)||"",required_materials:g,org_id:"",privacy:"public"})}else e?e&&!i&&f(g=>({...g,home_port:(o==null?void 0:o.default_home_port)||""})):f({weapon_name:"",description:"",weapon_image:"",home_port:"",required_materials:[],org_id:"",privacy:"public"})},[i,e,o]);const h=g=>{const x=cm[g]||[];f({...d,weapon_name:g,weapon_image:"",required_materials:x})},p=g=>{g.preventDefault();const x=u.find(_=>_.id===d.org_id),w={...d,org_name:(x==null?void 0:x.name)||null,org_tag:(x==null?void 0:x.tag)||null};delete w.org_id,n(w)};return a.jsx(xr,{open:e,onOpenChange:t,children:a.jsxs(tr,{className:"bg-slate-900 border-slate-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsx(nr,{children:a.jsxs(rr,{className:"flex items-center gap-2 text-xl",children:[a.jsx(IN,{className:"w-5 h-5 text-orange-400"}),"Create Weapon Project"]})}),a.jsxs("form",{onSubmit:p,className:"space-y-6 mt-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Select Weapon *"}),a.jsx(pJ,{value:d.weapon_name,onChange:h,disabled:!!i})]}),d.weapon_name&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Description (Optional)"}),a.jsx(Pi,{placeholder:"Add notes about your project...",value:d.description,onChange:g=>f({...d,description:g.target.value}),className:"bg-slate-800 border-slate-700 text-white placeholder:text-slate-500",rows:3})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Home Port / Drop Off Location (Optional)"}),a.jsx(dt,{placeholder:"e.g., Port Olisar, Lorville, Area18...",value:d.home_port,onChange:g=>f({...d,home_port:g.target.value}),className:"bg-slate-800 border-slate-700 text-white placeholder:text-slate-500"})]}),u.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Organization (Optional)"}),a.jsxs(en,{value:d.org_id,onValueChange:g=>f({...d,org_id:g}),children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{placeholder:"Select organization..."})}),a.jsxs(Qt,{className:"bg-slate-800 border-slate-700",children:[a.jsx(st,{value:null,children:"None"}),u.map(g=>a.jsxs(st,{value:g.id,className:"text-white",children:[g.name," (",g.tag,")"]},g.id))]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ge,{className:"text-slate-300",children:"Privacy"}),a.jsxs(en,{value:d.privacy,onValueChange:g=>f({...d,privacy:g}),children:[a.jsx(Gt,{className:"bg-slate-800 border-slate-700 text-white",children:a.jsx(tn,{})}),a.jsxs(Qt,{className:"bg-slate-800 border-slate-700",children:[a.jsx(st,{value:"public",className:"text-white",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(du,{className:"w-4 h-4"}),a.jsx("span",{children:"Public - Everyone can see"})]})}),a.jsx(st,{value:"private",className:"text-white",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(fu,{className:"w-4 h-4"}),a.jsx("span",{children:"Private - Only me"})]})}),d.org_id&&a.jsx(st,{value:"org_only",className:"text-white",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(gr,{className:"w-4 h-4"}),a.jsx("span",{children:"Organization - Only org members"})]})})]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs(Ge,{className:"text-slate-300",children:["Required Materials (",d.required_materials.length," items)"]}),a.jsx("div",{className:"max-h-64 overflow-y-auto space-y-2 p-3 bg-slate-800/50 rounded-lg border border-slate-700/50",children:d.required_materials.map((g,x)=>a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Nt,{className:"w-3 h-3 text-slate-400"}),a.jsx("span",{className:"text-slate-300",children:g.material_name})]}),a.jsx("span",{className:"text-orange-400 font-mono",children:g.quantity_needed})]},x))})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(oe,{type:"button",variant:"ghost",onClick:t,className:"text-slate-400",children:"Cancel"}),a.jsxs(oe,{type:"submit",disabled:r||!d.weapon_name,className:"bg-orange-500 hover:bg-orange-600 text-white disabled:opacity-50",children:[r?a.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}):null,"Create Project"]})]})]})]})})}const pN={'Boomtube "Clanguard" Rocket Launcher':"Curious Weapon",'Fresnel "Yormandi" Energy LMG':"Yormandi Gun",'Zenith "Snow Camo" Laser Sniper Rifle':"Snow Snipe",'Prism "Irradiated" Laser Shotgun':"Make VOLT shotgun angier",'Parallax "Fun Kopion Skull" Energy Assault Rifle':"Fun Koption Skull Gun",'Parallax "Fun Military Skull" Energy Assault Rifle':"Fun Military Skull Gun"};function yJ(){const[e,t]=v.useState(""),[n,r]=v.useState(null),[i,o]=v.useState(!1),l=Bt(),u=yl(),{data:d}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),f=Ae({mutationFn:g=>O.entities.WeaponProject.create({...g,owner_email:d==null?void 0:d.email,owner_name:(d==null?void 0:d.alias)||(d==null?void 0:d.full_name),owner_avatar:d==null?void 0:d.avatar_url,status:"planning"}),onSuccess:g=>{l.invalidateQueries({queryKey:["weaponProjects"]}),Yn.success("Weapon project created!"),o(!1),u(nt("WeaponProjectDetails")+"?id="+g.id)}}),h=g=>{if(!d){O.auth.redirectToLogin();return}r(g),o(!0)},p=B2.filter(g=>{const x=e.toLowerCase();return!x||g.name.toLowerCase().includes(x)?!0:(cm[g.name]||[]).some(_=>_.material_name.toLowerCase().includes(x))});return a.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 py-12 px-4",children:[a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsxs(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"mb-8",children:[a.jsx("h1",{className:"text-4xl font-bold text-white mb-4",children:"Weapons & Materials"}),a.jsx("p",{className:"text-slate-400 mb-6",children:"Browse Wikelo weapon projects and track your material collection progress."}),a.jsxs("div",{className:"relative max-w-md",children:[a.jsx(Ks,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400"}),a.jsx(dt,{placeholder:"Search weapons or materials...",value:e,onChange:g=>t(g.target.value),className:"pl-10 bg-slate-800 border-slate-700 text-white placeholder:text-slate-500"})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:p.map((g,x)=>{const w=cm[g.name]||[];return a.jsxs(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:x*.05},className:"bg-slate-900/50 backdrop-blur-sm rounded-xl border border-slate-700/50 overflow-hidden hover:border-orange-500/50 transition-colors group cursor-pointer",onClick:()=>h(g),children:[a.jsxs("div",{className:"relative h-48 bg-slate-800 flex items-center justify-center",children:[g.image?a.jsx("img",{src:g.image,alt:g.name,className:"w-full h-full object-contain"}):a.jsx("div",{className:"text-slate-600 text-6xl",children:"🔫"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-900 to-transparent"}),a.jsx("div",{className:"absolute inset-0 bg-orange-500/0 group-hover:bg-orange-500/10 transition-colors flex items-center justify-center",children:a.jsxs("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity bg-orange-500 text-white px-4 py-2 rounded-lg flex items-center gap-2",children:[a.jsx(er,{className:"w-4 h-4"}),a.jsx("span",{className:"font-medium",children:"Start Project"})]})}),a.jsx("h3",{className:"absolute bottom-4 left-4 text-xl font-bold text-white",children:g.name})]}),a.jsxs("div",{className:"p-4",children:[pN[g.name]&&a.jsx("p",{className:"text-orange-400 text-xs font-bold uppercase tracking-wide mb-3",children:pN[g.name]}),a.jsxs("div",{className:"flex items-center gap-2 text-slate-300 mb-3",children:[a.jsx(Nt,{className:"w-4 h-4 text-orange-400"}),a.jsx("span",{className:"text-sm font-medium",children:"Required Materials"})]}),w.length>0?a.jsx("div",{className:"space-y-2",children:w.map((_,N)=>a.jsxs("div",{className:"flex items-center justify-between text-sm bg-slate-800/50 rounded px-3 py-2",children:[a.jsx("span",{className:"text-slate-300",children:_.material_name}),a.jsxs("span",{className:"text-orange-400 font-mono font-medium",children:[_.quantity_needed,"x"]})]},N))}):a.jsx("p",{className:"text-sm text-slate-500 italic",children:"No materials data yet"})]})]},g.name)})}),p.length===0&&a.jsx("div",{className:"text-center py-20",children:a.jsxs("p",{className:"text-slate-400",children:['No weapons found for "',e,'"']})})]}),a.jsx(gJ,{open:i,onClose:()=>{o(!1),r(null)},onSubmit:g=>f.mutate(g),isLoading:f.isPending,preselectedWeapon:n})]})}const xJ={planning:"bg-amber-500/20 text-amber-400 border-amber-500/30",in_progress:"bg-cyan-500/20 text-cyan-400 border-cyan-500/30",completed:"bg-emerald-500/20 text-emerald-400 border-emerald-500/30"};function vJ(){var _e,le,we,je,Se;const e=new URLSearchParams(window.location.search),t=e.get("id"),n=e.get("tab")||"materials",[r,i]=v.useState(!1),[o,l]=v.useState(!1),[u,d]=v.useState(!1),[f,h]=v.useState(null),[p,g]=v.useState(!1),[x,w]=v.useState(null),[_,N]=v.useState(null),C=Bt(),{data:k}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),{data:P,isLoading:T}=me({queryKey:["weaponProject",t],queryFn:()=>O.entities.WeaponProject.filter({id:t}),select:se=>se[0],enabled:!!t,refetchInterval:3e3}),{data:S=[],isLoading:E}=me({queryKey:["weaponContributions",t],queryFn:()=>O.entities.Contribution.filter({project_id:t},"-created_date"),enabled:!!t,refetchInterval:3e3}),{data:z=[]}=me({queryKey:["my-memberships",k==null?void 0:k.email],queryFn:()=>O.entities.OrganizationMember.filter({user_email:k==null?void 0:k.email,status:"active"}),enabled:!!(k!=null&&k.email)}),{data:D=[]}=me({queryKey:["my-orgs-weapon",z],queryFn:async()=>{if(z.length===0)return[];const se=z.map(ce=>ce.org_id);return(await Promise.all(se.map(ce=>O.entities.Organization.filter({id:ce})))).flat()},enabled:z.length>0}),K=Ae({mutationFn:async se=>(await O.functions.invoke("getUEXListings",{materialName:se})).data}),U=se=>{w(se),g(!0),K.mutate(se)},W=Ae({mutationFn:async({material_name:se,change:be})=>{const ce=P.required_materials.map(Pe=>Pe.material_name===se?{...Pe,quantity_collected:Math.max(0,Math.min((Pe.quantity_collected||0)+be,Pe.quantity_needed))}:Pe);await O.entities.WeaponProject.update(t,{required_materials:ce}),await O.entities.ProjectActivity.create({project_id:t,user_email:k==null?void 0:k.email,user_name:(k==null?void 0:k.alias)||(k==null?void 0:k.full_name),user_avatar:k==null?void 0:k.avatar_url,action_type:"material_update",description:`Updated ${se}: ${be>0?"+":""}${be}`,metadata:{material_name:se,change:be}})},onSuccess:()=>{C.invalidateQueries({queryKey:["weaponProject",t]}),C.invalidateQueries({queryKey:["project-activity",t]})}}),G=Ae({mutationFn:async({material_name:se,quantity:be,in_game_name:ce,delivery_type:Pe,location:Mt})=>{const Rt=await O.entities.Contribution.create({project_id:t,contributor_email:k==null?void 0:k.email,contributor_name:(k==null?void 0:k.alias)||(k==null?void 0:k.full_name),contributor_avatar:k==null?void 0:k.avatar_url,contributor_reputation:(k==null?void 0:k.reputation)||0,material_name:se,quantity:be,in_game_name:ce,delivery_type:Pe,location:Mt});await O.entities.ProjectActivity.create({project_id:t,user_email:k==null?void 0:k.email,user_name:(k==null?void 0:k.alias)||(k==null?void 0:k.full_name),user_avatar:k==null?void 0:k.avatar_url,action_type:"contribution",description:`Contributed ${be}x ${se}`,metadata:{material_name:se,quantity:be}}),P.owner_email!==(k==null?void 0:k.email)&&await O.entities.UserNotification.create({user_email:P.owner_email,project_id:t,message_id:Rt.id,sender_email:k==null?void 0:k.email,sender_name:(k==null?void 0:k.alias)||(k==null?void 0:k.full_name),message_preview:`Contributed ${be}x ${se}`,notification_type:"contribution",is_read:!1})},onSuccess:()=>{C.invalidateQueries({queryKey:["weaponProject",t]}),C.invalidateQueries({queryKey:["weaponContributions",t]}),C.invalidateQueries({queryKey:["project-activity",t]}),C.invalidateQueries({queryKey:["notifications"]}),i(!1)}}),R=Ae({mutationFn:async se=>{if(await O.entities.WeaponProject.update(t,{status:se}),await O.entities.ProjectActivity.create({project_id:t,user_email:k==null?void 0:k.email,user_name:(k==null?void 0:k.alias)||(k==null?void 0:k.full_name),user_avatar:k==null?void 0:k.avatar_url,action_type:"status_change",description:`Changed project status to ${se.replace("_"," ")}`,metadata:{status:se}}),se==="completed"&&(k!=null&&k.email)){const be=Ka(P.weapon_name);if(be&&be.reputation_reward>0){const ce=await O.entities.User.filter({email:k.email});if(ce.length>0){const Pe=ce[0];await O.entities.User.update(Pe.id,{wikelo_reputation:(Pe.wikelo_reputation||0)+be.reputation_reward})}}}},onSuccess:()=>{C.invalidateQueries({queryKey:["weaponProject",t]}),C.invalidateQueries({queryKey:["weaponProjects"]}),C.invalidateQueries({queryKey:["project-activity",t]})}}),q=Ae({mutationFn:async()=>{for(const se of S)await O.entities.Contribution.delete(se.id);await O.entities.WeaponProject.delete(t)},onSuccess:()=>{window.location.href=nt("Weapons")}}),J=Ae({mutationFn:async se=>{await O.entities.WeaponProject.update(t,{org_name:se.name,org_tag:se.tag})},onSuccess:()=>{C.invalidateQueries({queryKey:["weaponProject",t]}),d(!1)}}),ae=Ae({mutationFn:async se=>{const be=S.find(ce=>ce.id===se);if(await O.entities.Contribution.update(se,{status:"delivered"}),be){const ce=P.required_materials.map(Pe=>Pe.material_name===be.material_name?{...Pe,quantity_collected:(Pe.quantity_collected||0)+be.quantity}:Pe);if(await O.entities.WeaponProject.update(t,{required_materials:ce}),be.contributor_email){const Pe=await O.entities.User.filter({email:be.contributor_email});if(Pe.length>0){const Mt=Pe[0],Rt=Jf[be.material_name]||10,pe=be.quantity*Rt;await O.entities.User.update(Mt.id,{reputation:(Mt.reputation||0)+pe})}}}},onSuccess:()=>{C.invalidateQueries({queryKey:["weaponContributions",t]}),C.invalidateQueries({queryKey:["weaponProject",t]})}}),re=Ae({mutationFn:async({contributionId:se,contribution:be})=>{if(await O.entities.Contribution.delete(se),be.status==="delivered"){const ce=P.required_materials.map(Pe=>Pe.material_name===be.material_name?{...Pe,quantity_collected:Math.max(0,(Pe.quantity_collected||0)-be.quantity)}:Pe);await O.entities.WeaponProject.update(t,{required_materials:ce})}},onSuccess:()=>{C.invalidateQueries({queryKey:["weaponContributions",t]}),C.invalidateQueries({queryKey:["weaponProject",t]})}}),L=Ae({mutationFn:async se=>{await O.entities.Contribution.update(f.id,{material_name:se.material_name,quantity:se.quantity,in_game_name:se.in_game_name,delivery_type:se.delivery_type,location:se.location})},onSuccess:()=>{C.invalidateQueries({queryKey:["weaponContributions",t]}),C.invalidateQueries({queryKey:["weaponProject",t]}),h(null),i(!1)}});if(T)return a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 flex items-center justify-center",children:a.jsx(tt,{className:"w-8 h-8 text-orange-400 animate-spin"})});if(!P)return a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950 flex items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx(Yr,{className:"w-16 h-16 text-slate-600 mx-auto mb-4"}),a.jsx("h2",{className:"text-xl text-white mb-2",children:"Project not found"}),a.jsx(Ft,{to:nt("Weapons"),children:a.jsx(oe,{variant:"outline",className:"border-orange-500/50 text-orange-400",children:"Back to Weapons"})})]})});const Y=(k==null?void 0:k.email)===P.owner_email,M=((_e=P.required_materials)==null?void 0:_e.reduce((se,be)=>se+(be.quantity_needed||0),0))||0,B=((le=P.required_materials)==null?void 0:le.reduce((se,be)=>se+(be.quantity_collected||0),0))||0,Z=M>0?Math.round(B/M*100):0,I=(we=P.required_materials)==null?void 0:we.some(se=>se.quantity_needed-(se.quantity_collected||0)>0),de=Ka(P.weapon_name),Ne=(k==null?void 0:k.wikelo_reputation)||0;return a.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950",children:[a.jsxs("div",{className:"relative",children:[P.weapon_image&&a.jsxs("div",{className:"absolute inset-0 h-80",children:[a.jsx("img",{src:P.weapon_image,alt:P.weapon_name,className:"w-full h-full object-cover opacity-30"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-slate-950/50 to-slate-950"})]}),a.jsxs("div",{className:"relative max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 pt-8 pb-12",children:[a.jsx(Ft,{to:nt("Weapons"),children:a.jsxs(oe,{variant:"ghost",className:"text-slate-400 hover:text-white mb-6",children:[a.jsx(um,{className:"w-4 h-4 mr-2"}),"Back to Weapons"]})}),a.jsxs(bt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-start md:justify-between gap-4 mb-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx(IN,{className:"w-8 h-8 text-orange-400"}),a.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-white",children:P.weapon_name}),P.org_tag&&a.jsx(zt,{variant:"outline",className:"border-orange-500/50 text-orange-400",children:P.org_tag})]}),a.jsxs("p",{className:"text-slate-400",children:["Created by ",P.owner_name||"Unknown"]}),P.org_name&&a.jsxs("p",{className:"text-slate-500 text-sm",children:["Organization: ",P.org_name]}),P.home_port&&a.jsxs("p",{className:"text-slate-500 text-sm mt-1",children:["📍 Home Port: ",P.home_port]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx(sv,{projectId:t,currentUser:k}),a.jsx(zt,{className:`${xJ[P.status]} border text-sm px-3 py-1`,children:(je=P.status)==null?void 0:je.replace("_"," ")}),Y&&a.jsxs("div",{className:"flex gap-2",children:[P.status==="completed"&&a.jsxs(oe,{onClick:()=>R.mutate("in_progress"),variant:"outline",className:"border-amber-500/50 text-amber-400 hover:bg-amber-500/10",disabled:R.isPending,children:[a.jsx(Yr,{className:"w-4 h-4 mr-2"}),"Revert to In Progress"]}),P.status!=="completed"&&Z>=100&&a.jsxs(oe,{onClick:()=>R.mutate("completed"),className:"bg-emerald-500 hover:bg-emerald-600",disabled:R.isPending,children:[a.jsx(Or,{className:"w-4 h-4 mr-2"}),"Mark Complete"]}),P.status==="planning"&&a.jsx(oe,{onClick:()=>R.mutate("in_progress"),variant:"outline",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/10",disabled:R.isPending,children:"Start Building"}),!P.org_tag&&D.length>0&&a.jsxs(oe,{onClick:()=>d(!0),variant:"outline",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/10",children:[a.jsx(v0,{className:"w-4 h-4 mr-2"}),"Link to Org"]}),a.jsx(oe,{variant:"ghost",size:"icon",onClick:()=>l(!0),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:a.jsx(wi,{className:"w-4 h-4"})})]})]})]}),P.description&&a.jsx("p",{className:"text-slate-300 mb-8 max-w-2xl",children:P.description}),de&&de.reputation_required>0&&a.jsx("div",{className:`mb-6 p-4 rounded-lg border ${Ne>=de.reputation_required?"bg-emerald-900/30 border-emerald-600/50":"bg-amber-900/30 border-amber-600/50"}`,children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"text-2xl",children:Ne>=de.reputation_required?"✅":"⚠️"}),a.jsxs("div",{children:[a.jsx("p",{className:`font-bold ${Ne>=de.reputation_required?"text-emerald-300":"text-amber-300"}`,children:de.reputation_required>=999?"Very Best Customer Required":"Very Good Customer Required"}),a.jsxs("p",{className:"text-sm text-slate-300 mt-1",children:["This mission requires ",a.jsxs("span",{className:"font-semibold text-white",children:[de.reputation_required,"+ Wikelo reputation"]}),".",Ne<de.reputation_required&&a.jsxs("span",{className:"text-amber-400",children:[" You currently have ",Ne," rep — ",de.reputation_required-Ne," more needed."]})]})]})]})}),de&&de.reputation_reward>0&&a.jsxs("div",{className:"mb-6 p-3 rounded-lg bg-orange-900/20 border border-orange-700/40 flex items-center gap-2",children:[a.jsx("span",{className:"text-yellow-400",children:"⭐"}),a.jsxs("p",{className:"text-sm text-orange-300",children:["Completing this project awards ",a.jsxs("span",{className:"font-bold text-white",children:["+",de.reputation_reward," Wikelo reputation"]})]})]}),a.jsx(Be,{className:"bg-slate-900/80 border-slate-700/50 backdrop-blur-sm",children:a.jsx($e,{className:"p-6",children:a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-slate-300 font-medium",children:"Overall Progress"}),a.jsxs("span",{className:"text-2xl font-bold text-orange-400",children:[Z,"%"]})]}),(()=>{const se=S.filter(ce=>ce.status==="pending").reduce((ce,Pe)=>ce+(Pe.quantity||0),0),be=M>0?Math.min(se/M*100,100-Z):0;return a.jsxs("div",{className:"h-3 bg-slate-800 rounded-full overflow-hidden flex",children:[a.jsx("div",{className:"h-full bg-orange-400 transition-all duration-500",style:{width:`${Z}%`}}),be>0&&a.jsx("div",{className:"h-full bg-amber-400/70 transition-all duration-500",style:{width:`${be}%`}})]})})()]}),a.jsxs("div",{className:"flex gap-6",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-2xl font-bold text-white",children:((Se=P.required_materials)==null?void 0:Se.length)||0}),a.jsx("p",{className:"text-sm text-slate-400",children:"Materials"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-2xl font-bold text-white",children:S.length}),a.jsx("p",{className:"text-sm text-slate-400",children:"Contributions"})]})]}),a.jsx("div",{className:"flex gap-2",children:I&&!Y&&a.jsxs(oe,{onClick:()=>k?i(!0):O.auth.redirectToLogin(),className:"bg-orange-500 hover:bg-orange-600",children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),k?"Contribute":"Sign in to Contribute"]})})]})})})]})]})]}),a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pb-16",children:a.jsxs(Qi,{defaultValue:n,className:"w-full",children:[a.jsxs(Si,{className:"bg-slate-800 mb-6",children:[a.jsxs(ht,{value:"materials",className:"data-[state=active]:bg-orange-500",children:[a.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Materials"]}),a.jsxs(ht,{value:"contributions",className:"data-[state=active]:bg-orange-500",children:[a.jsx(gr,{className:"w-4 h-4 mr-2"}),"Contributors (",S.length,")"]}),a.jsxs(ht,{value:"chat",className:"data-[state=active]:bg-orange-500",children:[a.jsx(Gi,{className:"w-4 h-4 mr-2"}),"Chat"]}),a.jsxs(ht,{value:"activity",className:"data-[state=active]:bg-orange-500",children:[a.jsx(Fo,{className:"w-4 h-4 mr-2"}),"Activity"]})]}),a.jsx(sn,{value:"materials",children:a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsx(vt,{children:a.jsx(wt,{className:"text-white",children:"Required Materials"})}),a.jsx($e,{children:a.jsx(Vx,{materials:P.required_materials,onUpdateQuantity:(se,be)=>W.mutate({material_name:se,change:be}),isOwner:Y,onFindOnUEX:U,onMaterialClick:se=>{i(!0),N(se)},user:k,pendingContributions:S})})]})}),a.jsx(sn,{value:"contributions",children:a.jsxs(Be,{className:"bg-slate-900/50 border-slate-700/50",children:[a.jsx(vt,{children:a.jsx(wt,{className:"text-white",children:"Recent Contributions"})}),a.jsx($e,{children:E?a.jsx("div",{className:"flex justify-center py-8",children:a.jsx(tt,{className:"w-6 h-6 text-orange-400 animate-spin"})}):a.jsx(Ux,{contributions:S,contributorReputation:{},isOwner:Y,currentUserEmail:k==null?void 0:k.email,onMarkDelivered:se=>ae.mutate(se),onDelete:(se,be)=>re.mutate({contributionId:se,contribution:be}),onEdit:se=>{h(se),i(!0)}})})]})}),a.jsx(sn,{value:"chat",children:a.jsx(ov,{projectId:t,currentUser:k})}),a.jsx(sn,{value:"activity",children:a.jsx(lv,{projectId:t})})]})}),a.jsx(Zx,{open:r,onClose:()=>{i(!1),h(null),N(null)},onSubmit:se=>f?L.mutate(se):G.mutate(se),materials:P.required_materials,isLoading:f?L.isPending:G.isPending,editMode:!!f,contribution:f,projectOwnerId:P.owner_email,preSelectedMaterial:_}),a.jsx(av,{open:u,onClose:()=>d(!1),onSubmit:se=>J.mutate(se),organizations:D,isLoading:J.isPending}),a.jsx(iv,{open:p,onClose:()=>g(!1),materialName:x,listings:K.data,isLoading:K.isPending,error:K.isError?K.error:null}),a.jsx($o,{open:o,onOpenChange:l,children:a.jsxs(Ms,{className:"bg-slate-900 border-slate-700",children:[a.jsxs(Rs,{children:[a.jsx(Is,{className:"text-white",children:"Delete Project"}),a.jsx(Ds,{className:"text-slate-400",children:"This will permanently delete the project and all contributions."})]}),a.jsxs(Os,{children:[a.jsx(qs,{className:"bg-slate-800 border-slate-700 text-white hover:bg-slate-700",children:"Cancel"}),a.jsx(Ls,{onClick:()=>q.mutate(),className:"bg-red-500 hover:bg-red-600",children:q.isPending?a.jsx(tt,{className:"w-4 h-4 animate-spin"}):"Delete"})]})]})})]})}const bJ={pending:"bg-yellow-500/20 text-yellow-400",approved:"bg-green-500/20 text-green-400",rejected:"bg-red-500/20 text-red-400",paused:"bg-slate-500/20 text-slate-400"},wJ={unpaid:"bg-red-500/20 text-red-400",active:"bg-green-500/20 text-green-400",cancelled:"bg-slate-500/20 text-slate-400",failed:"bg-red-500/20 text-red-400"};function _J(){const{toast:e}=g0(),t=Bt(),[n,r]=v.useState(!1),[i,o]=v.useState(!1),[l,u]=v.useState({image_url:"",target_url:""}),[d,f]=v.useState(""),{data:h}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),{data:p=[]}=me({queryKey:["my-ads",h==null?void 0:h.email],queryFn:()=>O.entities.Ad.filter({user_email:h==null?void 0:h.email}),enabled:!!(h!=null&&h.email)}),g=Ae({mutationFn:P=>O.entities.Ad.create(P),onSuccess:()=>{t.invalidateQueries({queryKey:["my-ads"]})}}),x=async P=>{const T=P.target.files[0];if(!T)return;const S=await new Promise(z=>{const D=new Image;D.onload=()=>z({width:D.width,height:D.height}),D.src=URL.createObjectURL(T)});if(S.width!==1880||S.height!==116){e({title:`Invalid image size: ${S.width}×${S.height}px`,description:"Your banner must be exactly 1880×116px.",variant:"destructive"}),P.target.value="";return}r(!0);const{file_url:E}=await O.integrations.Core.UploadFile({file:T});u(z=>({...z,image_url:E})),f(E),r(!1)},w=async P=>{var E;if(P.preventDefault(),!h){O.auth.redirectToLogin();return}if(!l.image_url||!l.target_url){e({title:"Please upload an image and provide a target URL.",variant:"destructive"});return}const T=await g.mutateAsync({...l,user_email:h.email,user_name:h.full_name||h.email,status:"pending",payment_status:"unpaid"});o(!0);const S=await O.functions.invoke("createPaypalSubscription",{adId:T.id,returnUrl:`${window.location.origin}/AdvertiseWithUs?success=true`,cancelUrl:`${window.location.origin}/AdvertiseWithUs?cancelled=true`});o(!1),(E=S.data)!=null&&E.approvalUrl?window.location.href=S.data.approvalUrl:e({title:"Failed to initiate PayPal subscription. Please try again.",variant:"destructive"})},_=async P=>{var S;o(!0);const T=await O.functions.invoke("createPaypalSubscription",{adId:P.id,returnUrl:`${window.location.origin}/AdvertiseWithUs?success=true`,cancelUrl:`${window.location.origin}/AdvertiseWithUs?cancelled=true`});o(!1),(S=T.data)!=null&&S.approvalUrl&&(window.location.href=T.data.approvalUrl)},N=new URLSearchParams(window.location.search),C=N.get("success")==="true",k=N.get("cancelled")==="true";return a.jsx("div",{className:"min-h-screen bg-slate-950 py-12 px-4",children:a.jsxs("div",{className:"max-w-3xl mx-auto space-y-8",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-3xl font-bold text-white mb-2",children:"Advertise on Wikelo"}),a.jsx("p",{className:"text-slate-400",children:"Reach the Star Citizen community. $25/month — rotating banner on all pages."})]}),C&&a.jsxs("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 text-green-400 flex items-center gap-3",children:[a.jsx(Or,{className:"w-5 h-5"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Subscription activated!"}),a.jsx("p",{className:"text-sm text-green-400/70",children:"Your ad has been submitted and is pending approval. We'll review it shortly."})]})]}),k&&a.jsxs("div",{className:"bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-4 text-yellow-400 flex items-center gap-3",children:[a.jsx(wO,{className:"w-5 h-5"}),a.jsx("p",{children:"PayPal subscription was cancelled. You can try again below."})]}),a.jsx(Be,{className:"bg-slate-900 border-slate-700",children:a.jsx($e,{className:"pt-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"w-12 h-12 bg-cyan-500/20 rounded-full flex items-center justify-center",children:a.jsx(NO,{className:"w-6 h-6 text-cyan-400"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-white font-semibold text-lg",children:"$25 / month"}),a.jsx("p",{className:"text-slate-400 text-sm",children:"Rotating banner displayed to all Wikelo visitors"})]})]}),a.jsxs("div",{className:"text-right text-sm text-slate-400",children:[a.jsx("p",{children:"✓ Image banner ad (1880×116px)"}),a.jsx("p",{children:"✓ Clickable link"}),a.jsx("p",{children:"✓ Admin reviewed"})]})]})})}),h?a.jsxs(Be,{className:"bg-slate-900 border-slate-700",children:[a.jsx(vt,{children:a.jsx(wt,{className:"text-white",children:"Submit Your Ad"})}),a.jsx($e,{children:a.jsxs("form",{onSubmit:w,className:"space-y-5",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-2",children:"Ad Banner Image *"}),a.jsxs("div",{className:"border-2 border-dashed border-slate-600 rounded-lg p-4 text-center hover:border-slate-500 transition-colors",children:[d?a.jsxs("div",{className:"space-y-2",children:[a.jsx("img",{src:d,alt:"Ad preview",className:"max-h-24 mx-auto object-contain rounded"}),a.jsx("p",{className:"text-xs text-slate-400",children:"Click to replace"})]}):a.jsxs("div",{className:"space-y-2",children:[a.jsx(_0,{className:"w-8 h-8 text-slate-500 mx-auto"}),a.jsx("p",{className:"text-slate-400 text-sm",children:"Upload your banner image"}),a.jsx("p",{className:"text-slate-500 text-xs",children:"Required: 1880×116px"})]}),a.jsx("input",{type:"file",accept:"image/*",onChange:x,className:"absolute inset-0 opacity-0 cursor-pointer",style:{position:"relative",marginTop:"8px"}}),a.jsx("input",{type:"file",accept:"image/*",onChange:x,disabled:n,className:"mt-2 text-xs text-slate-400 block w-full cursor-pointer"}),n&&a.jsx("p",{className:"text-cyan-400 text-xs mt-1",children:"Uploading..."})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-2",children:"Destination URL *"}),a.jsx(dt,{value:l.target_url,onChange:P=>u(T=>({...T,target_url:P.target.value})),placeholder:"https://your-website.com",className:"bg-slate-800 border-slate-700 text-white",type:"url",required:!0})]}),a.jsx(oe,{type:"submit",disabled:n||i||g.isPending,className:"w-full bg-cyan-500 hover:bg-cyan-600 text-white font-semibold py-3",children:i?"Redirecting to PayPal...":"Submit Ad & Pay $25/month via PayPal"}),a.jsx("p",{className:"text-xs text-slate-500 text-center",children:"You will be redirected to PayPal to complete payment. Your ad will go live after admin approval."})]})})]}):a.jsx(Be,{className:"bg-slate-900 border-slate-700",children:a.jsxs($e,{className:"pt-6 text-center",children:[a.jsx("p",{className:"text-slate-400 mb-4",children:"You must be signed in to submit an ad."}),a.jsx(oe,{onClick:()=>O.auth.redirectToLogin(),className:"bg-cyan-500 hover:bg-cyan-600",children:"Sign In"})]})}),p.length>0&&a.jsxs("div",{children:[a.jsx("h2",{className:"text-white font-semibold text-lg mb-4",children:"My Ads"}),a.jsx("div",{className:"space-y-4",children:p.map(P=>a.jsx(Be,{className:"bg-slate-900 border-slate-700",children:a.jsxs($e,{className:"pt-4 flex items-center gap-4",children:[P.image_url&&a.jsx("img",{src:P.image_url,alt:"Ad",className:"h-16 w-auto max-w-[120px] object-contain rounded"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-white text-sm font-medium truncate",children:P.target_url}),a.jsxs("a",{href:P.target_url,target:"_blank",rel:"noopener noreferrer",className:"text-cyan-400 text-xs flex items-center gap-1 hover:underline truncate",children:[a.jsx(y0,{className:"w-3 h-3"})," ",P.target_url]}),P.admin_notes&&a.jsxs("p",{className:"text-slate-400 text-xs mt-1",children:["Note: ",P.admin_notes]})]}),a.jsxs("div",{className:"flex flex-col gap-2 items-end shrink-0",children:[a.jsx(zt,{className:bJ[P.status],children:P.status}),a.jsx(zt,{className:wJ[P.payment_status],children:P.payment_status}),P.payment_status==="unpaid"&&a.jsx(oe,{size:"sm",onClick:()=>_(P),disabled:i,className:"bg-cyan-500 hover:bg-cyan-600 text-xs",children:"Pay Now"})]})]})},P.id))})]})]})})}const SJ={pending:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30",approved:"bg-green-500/20 text-green-400 border-green-500/30",rejected:"bg-red-500/20 text-red-400 border-red-500/30",paused:"bg-slate-500/20 text-slate-400 border-slate-500/30"},jJ={unpaid:"bg-red-500/20 text-red-400",active:"bg-green-500/20 text-green-400",cancelled:"bg-slate-500/20 text-slate-400",failed:"bg-red-500/20 text-red-400",expired:"bg-slate-500/20 text-slate-400"};function NJ(){const{toast:e}=g0(),t=Bt(),[n,r]=v.useState({}),[i,o]=v.useState("all"),{data:l}=me({queryKey:["user"],queryFn:()=>O.auth.me()}),{data:u=[],isLoading:d}=me({queryKey:["all-ads"],queryFn:()=>O.entities.Ad.list("-created_date",100),enabled:(l==null?void 0:l.role)==="admin"}),f=Ae({mutationFn:({id:x,data:w})=>O.entities.Ad.update(x,w),onSuccess:()=>{t.invalidateQueries({queryKey:["all-ads"]}),t.invalidateQueries({queryKey:["active-ads"]}),e({title:"Ad updated."})}}),h=Ae({mutationFn:x=>O.entities.Ad.delete(x),onSuccess:()=>{t.invalidateQueries({queryKey:["all-ads"]}),e({title:"Ad deleted."})}});if(!l||l.role!=="admin")return a.jsx("div",{className:"min-h-screen bg-slate-950 flex items-center justify-center",children:a.jsx("p",{className:"text-slate-400",children:"Access denied. Admin only."})});const p=i==="all"?u:u.filter(x=>x.status===i),g=(x,w)=>{const _=n[x.id]||"";f.mutate({id:x.id,data:{status:w,admin_notes:_}})};return a.jsx("div",{className:"min-h-screen bg-slate-950 py-12 px-4",children:a.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-2xl font-bold text-white",children:"Ad Management"}),a.jsx("div",{className:"flex gap-2",children:["all","pending","approved","rejected","paused"].map(x=>a.jsx(oe,{size:"sm",variant:i===x?"default":"outline",onClick:()=>o(x),className:i===x?"bg-cyan-500 text-white":"border-slate-700 text-slate-400 hover:text-white",children:x},x))})]}),d&&a.jsx("p",{className:"text-slate-400",children:"Loading ads..."}),p.length===0&&!d&&a.jsx("p",{className:"text-slate-500 text-center py-12",children:"No ads found."}),a.jsx("div",{className:"space-y-4",children:p.map(x=>a.jsx(Be,{className:"bg-slate-900 border-slate-700",children:a.jsx($e,{className:"pt-5",children:a.jsxs("div",{className:"flex gap-4",children:[x.image_url&&a.jsx("img",{src:x.image_url,alt:"Ad",className:"h-20 w-auto max-w-[200px] object-contain rounded border border-slate-700 shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-white font-medium",children:x.user_name||x.user_email}),a.jsx("p",{className:"text-slate-500 text-xs",children:x.user_email})]}),a.jsxs("div",{className:"flex gap-2 shrink-0",children:[a.jsx(zt,{className:SJ[x.status],children:x.status}),a.jsx(zt,{className:jJ[x.payment_status],children:x.payment_status})]})]}),x.ad_text&&a.jsx("p",{className:"text-slate-300 text-sm",children:x.ad_text}),a.jsxs("a",{href:x.target_url,target:"_blank",rel:"noopener noreferrer",className:"text-cyan-400 text-xs flex items-center gap-1 hover:underline",children:[a.jsx(y0,{className:"w-3 h-3"})," ",x.target_url]}),x.paypal_subscription_id&&a.jsxs("p",{className:"text-slate-500 text-xs",children:["PayPal: ",x.paypal_subscription_id]}),x.admin_notes&&a.jsxs("p",{className:"text-slate-400 text-xs bg-slate-800 rounded px-2 py-1",children:["Note: ",x.admin_notes]}),a.jsx(Pi,{placeholder:"Admin notes (optional, sent to user)",value:n[x.id]||"",onChange:w=>r(_=>({..._,[x.id]:w.target.value})),className:"bg-slate-800 border-slate-700 text-white text-xs resize-none",rows:2}),a.jsxs("div",{className:"flex gap-2 flex-wrap",children:[x.status!=="approved"&&a.jsxs(oe,{size:"sm",onClick:()=>g(x,"approved"),className:"bg-green-600 hover:bg-green-700 text-white gap-1",children:[a.jsx(Or,{className:"w-3 h-3"})," Approve"]}),x.status!=="rejected"&&a.jsxs(oe,{size:"sm",onClick:()=>g(x,"rejected"),className:"bg-red-600 hover:bg-red-700 text-white gap-1",children:[a.jsx(ON,{className:"w-3 h-3"})," Reject"]}),x.status==="approved"&&a.jsxs(oe,{size:"sm",onClick:()=>g(x,"paused"),className:"bg-slate-600 hover:bg-slate-700 text-white gap-1",children:[a.jsx(WO,{className:"w-3 h-3"})," Pause"]}),a.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>h.mutate(x.id),className:"border-red-700 text-red-400 hover:bg-red-900 gap-1",children:[a.jsx(wi,{className:"w-3 h-3"})," Delete"]})]})]})]})})},x.id))})]})})}function CJ(){const{t:e}=gn();return a.jsxs("div",{className:"max-w-3xl mx-auto px-4 py-12",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[a.jsx(x0,{className:"w-6 h-6 text-amber-400"}),a.jsx("h1",{className:"text-2xl font-bold text-white",children:e("updateInfoTitle")})]}),a.jsxs("div",{className:"bg-slate-900 border border-slate-700 rounded-xl p-8 text-slate-300 text-base leading-relaxed",children:[a.jsx("p",{children:e("updateInfoP1")}),a.jsx("p",{className:"mt-4",children:e("updateInfoP2")}),a.jsx("p",{className:"mt-4",children:e("updateInfoP3")}),a.jsx("p",{className:"mt-4",children:e("updateInfoP4")})]})]})}const{Pages:V2,Layout:gN,mainPage:kJ}=z2,$2=kJ,PJ=V2[$2],Sa=({children:e,currentPageName:t})=>gN?a.jsx(gN,{currentPageName:t,children:e}):a.jsx(a.Fragment,{children:e}),EJ=()=>{const{isLoadingAuth:e,isLoadingPublicSettings:t,authError:n,navigateToLogin:r}=dk();if(t||e)return a.jsx("div",{className:"fixed inset-0 flex items-center justify-center",children:a.jsx("div",{className:"w-8 h-8 border-4 border-slate-200 border-t-slate-800 rounded-full animate-spin"})});if(n){if(n.type==="user_not_registered")return a.jsx(fJ,{});if(n.type==="auth_required")return r(),null}return a.jsxs(N5,{children:[a.jsx(li,{path:"/",element:a.jsx(Sa,{currentPageName:$2,children:a.jsx(PJ,{})})}),Object.entries(V2).map(([i,o])=>a.jsx(li,{path:`/${i}`,element:a.jsx(Sa,{currentPageName:i,children:a.jsx(o,{})})},i)),a.jsx(li,{path:"/Reputation",element:a.jsx(Sa,{currentPageName:"Reputation",children:a.jsx(hJ,{})})}),a.jsx(li,{path:"/Weapons",element:a.jsx(Sa,{currentPageName:"Weapons",children:a.jsx(yJ,{})})}),a.jsx(li,{path:"/WeaponProjectDetails",element:a.jsx(Sa,{currentPageName:"WeaponProjectDetails",children:a.jsx(vJ,{})})}),a.jsx(li,{path:"/AdvertiseWithUs",element:a.jsx(Sa,{currentPageName:"AdvertiseWithUs",children:a.jsx(_J,{})})}),a.jsx(li,{path:"/AdminAds",element:a.jsx(Sa,{currentPageName:"AdminAds",children:a.jsx(NJ,{})})}),a.jsx(li,{path:"/UpdateInfo",element:a.jsx(Sa,{currentPageName:"UpdateInfo",children:a.jsx(CJ,{})})}),a.jsx(li,{path:"*",element:a.jsx(dJ,{})})]})};function TJ(){return a.jsx(GF,{children:a.jsxs(wD,{client:RD,children:[a.jsxs(R5,{children:[a.jsx(uJ,{}),a.jsx(EJ,{})]}),a.jsx(XI,{})]})})}K4.createRoot(document.getElementById("root")).render(a.jsx(TJ,{}));
|
||
|