1/*! For license information please see main.09c80a24.js.LICENSE.txt */ 2 3!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ef733b3a-75f9-5a1c-be3f-4e8cfe734711")}catch(e){}}(); 4(()=>{"use strict";var e={4:(e,t,n)=>{var r=n(853),a=n(43),s=n(950);function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}var l=Symbol.for("react.element"),c=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),f=Symbol.for("react.consumer"),g=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),w=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var j=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.tracing_marker");var N=Symbol.for("react.memo_cache_sentinel"),S=Symbol.iterator;function k(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=S&&e[S]||e["@@iterator"])?e:null}var E=Symbol.for("react.client.reference");function _(e){if(null==e)return null;if("function"===typeof e)return e.$$typeof===E?null:e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case d:return"Fragment";case u:return"Portal";case p:return"Profiler";case h:return"StrictMode";case y:return"Suspense";case b:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case g:return(e.displayName||"Context")+".Provider";case f:return(e._context.displayName||"Context")+".Consumer";case v:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case x:return null!==(t=e.displayName||null)?t:_(e.type)||"Memo";case w:t=e._payload,e=e._init;try{return _(e(t))}catch(n){}}return null}var C,A,T=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=Object.assign;function P(e){if(void 0===C)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);C=t&&t[1]||"",A=-1<n.stack.indexOf("\n at")?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+C+e+A}var O=!1;function I(e,t){if(!e||O)return"";O=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(a){var r=a}Reflect.construct(e,[],n)}
vendor: 5,108 bytes, line 4
4else{try{n.call()}catch(s){r=s}e.call(n.prototype)}}else{try{throw Error()}catch(i){r=i}(n=e())&&"function"===typeof n.catch&&n.catch((function(){}))}}catch(o){if(o&&r&&"string"===typeof o.stack)return[o.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=r.DetermineComponentFrameRoot(),i=s[0],o=s[1];if(i&&o){var l=i.split("\n"),c=o.split("\n");for(a=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;a<c.length&&!c[a].includes("DetermineComponentFrameRoot");)a++;if(r===l.length||a===c.length)for(r=l.length-1,a=c.length-1;1<=r&&0<=a&&l[r]!==c[a];)a--;for(;1<=r&&0<=a;r--,a--)if(l[r]!==c[a]){if(1!==r||1!==a)do{if(r--,0>--a||l[r]!==c[a]){var u="\n"+l[r].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=r&&0<=a);break}}}finally{O=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?P(n):""}function $(e){switch(e.tag){case 26:case 27:case 5:return P(e.type);case 16:return P("Lazy");case 13:return P("Suspense");case 19:return P("SuspenseList");case 0:case 15:return e=I(e.type,!1);case 11:return e=I(e.type.render,!1);case 1:return e=I(e.type,!0);default:return""}}function L(e){try{var t="";do{t+=$(e),e=e.return}while(e);return t}catch(n){return"\nError generating stack: "+n.message+"\n"+n.stack}}function F(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function M(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function D(e){if(F(e)!==e)throw Error(i(188))}function U(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=U(e)))return t;e=e.sibling}return null}var z=Array.isArray,q=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},H=[],Q=-1;function W(e){return{current:e}}function V(e){0>Q||(e.current=H[Q],H[Q]=null,Q--)}function K(e,t){Q++,H[Q]=e.current,e.current=t}var G=W(null),Y=W(null),J=W(null),X=W(null);function Z(e,t){switch(K(J,t),K(Y,e),K(G,null),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?Yu(t):0;break;default:if(t=(e=8===e?t.parentNode:t).tagName,e=e.namespaceURI)t=Ju(e=Yu(e),t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}V(G),K(G,t)}function ee(){V(G),V(Y),V(J)}function te(e){null!==e.memoizedState&&K(X,e);var t=G.current,n=Ju(t,e.type);t!==n&&(K(Y,e),K(G,n))}function ne(e){Y.current===e&&(V(G),V(Y)),X.current===e&&(V(X),Ld._currentValue=B)}var re=Object.prototype.hasOwnProperty,ae=r.unstable_scheduleCallback,se=r.unstable_cancelCallback,ie=r.unstable_shouldYield,oe=r.unstable_requestPaint,le=r.unstable_now,ce=r.unstable_getCurrentPriorityLevel,ue=r.unstable_ImmediatePriority,de=r.unstable_UserBlockingPriority,he=r.unstable_NormalPriority,pe=r.unstable_LowPriority,me=r.unstable_IdlePriority,fe=r.log,ge=r.unstable_setDisableYieldValue,ve=null,ye=null;function be(e){if("function"===typeof fe&&ge(e),ye&&"function"===typeof ye.setStrictMode)try{ye.setStrictMode(ve,e)}catch(t){}}var xe=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(we(e)/je|0)|0},we=Math.log,je=Math.LN2;var Ne=128,Se=4194304;function ke(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128: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 4194176&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ee(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,a=e.suspendedLanes,s=e.pingedLanes,i=e.warmLanes;e=0!==e.finishedLanes;var o=134217727&n;return 0!==o?0!==(n=o&~a)?r=ke(n):0!==(s&=o)?r=ke(s):e||0!==(i=o&~i)&&(r=ke(i)):0!==(o=n&~a)?r=ke(o):0!==s?r=ke(s):e||0!==(i=n&~i)&&(r=ke(i)),0===r?0:0!==t&&t!==r&&0===(t&a)&&((a=r&-r)>=(i=t&-t)||32===a&&0!==(4194176&i))?t:r}function _e(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function Ce(e,t){switch(e){case 1:case 2:case 4:case 8:return t+250;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 t+5e3;default:return-1}}function Ae(){var e=Ne;return 0===(4194176&(Ne<<=1))&&(Ne=128),e}function Te(){var e=Se;return 0===(62914560&(Se<<=1))&&(Se=4194304),e}function Re(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}
4function Pe(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Oe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-xe(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|4194218&n}function Ie(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-xe(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}function $e(e){return 2<(e&=-e)?8<e?0!==(134217727&e)?32:268435456:8:2}function Le(){var e=q.p;return 0!==e?e:void 0===(e=window.event)?32:Jd(e.type)}var Fe=Math.random().toString(36).slice(2),Me="__reactFiber$"+Fe,De="__reactProps$"+Fe,Ue="__reactContainer$"+Fe,ze="__reactEvents$"+Fe,qe="__reactListeners$"+Fe,Be="__reactHandles$"+Fe,He="__reactResources$"+Fe,Qe="__reactMarker$"+Fe;function We(e){delete e[Me],delete e[De],delete e[ze],delete e[qe],delete e[Be]}function Ve(e){var t=e[Me];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ue]||n[Me]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=ld(e);null!==e;){if(n=e[Me])return n;e=ld(e)}return t}n=(e=n).parentNode}return null}function Ke(e){if(e=e[Me]||e[Ue]){var t=e.tag;if(5===t||6===t||13===t||26===t||27===t||3===t)return e}return null}function Ge(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(i(33))}function Ye(e){var t=e[He];return t||(t=e[He]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Je(e){e[Qe]=!0}var Xe=new Set,Ze={};function et(e,t){tt(e,t),tt(e+"Capture",t)}function tt(e,t){for(Ze[e]=t,e=0;e<t.length;e++)Xe.add(t[e])}var nt=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),rt=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),at={},st={};function it(e,t,n){if(a=t,re.call(st,a)||!re.call(at,a)&&(rt.test(a)?st[a]=!0:(at[a]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var r=t.toLowerCase().slice(0,5);if("data-"!==r&&"aria-"!==r)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}var a}function ot(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function lt(e,t,n,r){if(null===r)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,""+r)}}function ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function ut(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function dt(e){e._valueTracker||(e._valueTracker=function(e){var t=ut(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var a=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){r=""+e,s.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function ht(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ut(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function pt(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(gh){return e.body}}var mt=/[\n"\\]/g;function ft(e){return e.replace(mt,(function(e){return"\\"+e.charCodeAt(0).toString(16)+" "}))}function gt(e,t,n,r,a,s,i,o){e.name="",null!=i&&"function"!==typeof i&&"symbol"!==typeof i&&"boolean"!==typeof i?e.type=i:e.removeAttribute("type"),null!=t?"number"===i?(0===t&&""===e.value||e.value!=t)&&(e.value=""+ct(t)):e.value!==""+ct(t)&&(e.value=""+ct(t)):"submit"!==i&&"reset"!==i||e.removeAttribute("value"),null!=t?yt(e,i,ct(t)):null!=n?yt(e,i,ct(n)):null!=r&&e.removeAttribute("value"),null==a&&null!=s&&(e.defaultChecked=!!s),null!=a&&(e.checked=a&&"function"!==typeof a&&"symbol"!==typeof a),null!=o&&"function"!==typeof o&&"symbol"!==typeof o&&"boolean"!==typeof o?e.name=""+ct(o):e.removeAttribute("name")}function vt(e,t,n,r,a,s,i,o){if(null!=s&&"function"!==typeof s&&"symbol"!==typeof s&&"boolean"!==typeof s&&(e.type=s),null!=t||null!=n){if(!("submit"!==s&&"reset"!==s||void 0!==t&&null!==t))return;n=null!=n?""+ct(n):"",t=null!=t?""+ct(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}r="function"!==typeof(r=null!=r?r:a)&&"symbol"!==typeof r&&!!r,e.checked=o?e.checked:!!r,e.defaultChecked=!!r,null!=i&&"function"!==typeof i&&"symbol"!==typeof i&&"boolean"!==typeof i&&(e.name=i)}function yt(e,t,n){"number"===t&&pt(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function bt(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ct(n),t=null,a=0;a<e.length;a++){if(e[a].value===n)return e[a].selected=!0,void(r&&(e[a].defaultSelected=!0));null!==t||e[a].disabled||(t=e[a])}null!==t&&(t.selected=!0)}}function xt(e,t,n){null==t||((t=""+ct(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+ct(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function wt(e,t,n,r){if(null==t){if(null!=r){if(null!=n)throw Error(i(92));if(z(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}null==n&&(n=""),t=n}n=ct(t),e.defaultValue=n,(r=e.textContent)===n&&""!==r&&null!==r&&(e.value=r)}function jt(e,t){if(t){var n=e.firstChild;
4if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Nt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function St(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"===typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!==typeof n||0===n||Nt.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function kt(e,t,n){if(null!=t&&"object"!==typeof t)throw Error(i(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&St(e,a,r)}else for(var s in t)t.hasOwnProperty(s)&&St(e,s,t[s])}function Et(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _t=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode
4-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ct=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function At(e){return Ct.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Tt=null;function Rt(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Pt=null,Ot=null;function It(e){var t=Ke(e);if(t&&(e=t.stateNode)){var n=e[De]||null;e:switch(e=t.stateNode,t.type){case"input":if(gt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+ft(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[De]||null;if(!a)throw Error(i(90));gt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)(r=n[t]).form===e.form&&ht(r)}break e;case"textarea":xt(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&bt(e,!!n.multiple,t,!1)}}}var $t=!1;function Lt(e,t,n){if($t)return e(t,n);$t=!0;try{return e(t)}finally{if($t=!1,(null!==Pt||null!==Ot)&&(Mc(),Pt&&(t=Pt,e=Ot,Ot=Pt=null,It(t),e)))for(t=0;t<e.length;t++)It(e[t])}}function Ft(e,t){var n=e.stateNode;if(null===n)return null;var r=n[De]||null;if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(i(231,t,typeof n));return n}var Mt=!1;if(nt)try{var Dt={};Object.defineProperty(Dt,"passive",{get:function(){Mt=!0}}),window.addEventListener("test",Dt,Dt),window.removeEventListener("test",Dt,Dt)}catch(gh){Mt=!1}var Ut=null,zt=null,qt=null;function Bt(){if(qt)return qt;var e,t,n=zt,r=n.length,a="value"in Ut?Ut.value:Ut.textContent,s=a.length;for(e=0;e<r&&n[e]===a[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===a[s-t];t++);return qt=a.slice(e,1<t?1-t:void 0)}function Ht(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Qt(){return!0}function Wt(){return!1}function Vt(e){function t(t,n,r,a,s){for(var i in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=a,this.target=s,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(a):a[i]);return this.isDefaultPrevented=(null!=a.defaultPrevented?a.defaultPrevented:!1===a.returnValue)?Qt:Wt,this.isPropagationStopped=Wt,this}return R(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Qt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Qt)},persist:function(){},isPersistent:Qt}),t}var Kt,Gt,Yt,Jt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xt=Vt(Jt),Zt=R({},Jt,{view:0,detail:0}),en=Vt(Zt),tn=R({},Zt,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Yt&&(Yt&&"mousemove"===e.type?(Kt=e.screenX-Yt.screenX,Gt=e.screenY-Yt.screenY):Gt=Kt=0,Yt=e),Kt)},movementY:function(e){return"movementY"in e?e.movementY:Gt}}),nn=Vt(tn),rn=Vt(R({},tn,{dataTransfer:0})),an=Vt(R({},Zt,{relatedTarget:0})),sn=Vt(R({},Jt,{animationName:0,elapsedTime:0,pseudoElement:0})),on=Vt(R({},Jt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),ln=Vt(R({},Jt,{data:0})),cn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},un={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"},dn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=dn[e])&&!!t[e]}function pn(){return hn}var mn=Vt(R({},Zt,{key:function(e){if(e.key){var t=cn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Ht(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"ke
4yup"===e.type?un[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pn,charCode:function(e){return"keypress"===e.type?Ht(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Ht(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),fn=Vt(R({},tn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),gn=Vt(R({},Zt,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pn})),vn=Vt(R({},Jt,{propertyName:0,elapsedTime:0,pseudoElement:0})),yn=Vt(R({},tn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),bn=Vt(R({},Jt,{newState:0,oldState:0})),xn=[9,13,27,32],wn=nt&&"CompositionEvent"in window,jn=null;nt&&"documentMode"in document&&(jn=document.documentMode);var Nn=nt&&"TextEvent"in window&&!jn,Sn=nt&&(!wn||jn&&8<jn&&11>=jn),kn=String.fromCharCode(32),En=!1;function _n(e,t){switch(e){case"keyup":return-1!==xn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var An=!1;var Tn={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 Rn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Tn[e.type]:"textarea"===t}function Pn(e,t,n,r){Pt?Ot?Ot.push(r):Ot=[r]:Pt=r,0<(t=Lu(t,"onChange")).length&&(n=new Xt("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var On=null,In=null;function $n(e){Cu(e,0)}function Ln(e){if(ht(Ge(e)))return e}function Fn(e,t){if("change"===e)return t}var Mn=!1;if(nt){var Dn;if(nt){var Un="oninput"in document;if(!Un){var zn=document.createElement("div");zn.setAttribute("oninput","return;"),Un="function"===typeof zn.oninput}Dn=Un}else Dn=!1;Mn=Dn&&(!document.documentMode||9<document.documentMode)}function qn(){On&&(On.detachEvent("onpropertychange",Bn),In=On=null)}function Bn(e){if("value"===e.propertyName&&Ln(In)){var t=[];Pn(t,In,e,Rt(e)),Lt($n,t)}}function Hn(e,t,n){"focusin"===e?(qn(),In=n,(On=t).attachEvent("onpropertychange",Bn)):"focusout"===e&&qn()}function Qn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Ln(In)}function Wn(e,t){if("click"===e)return Ln(t)}function Vn(e,t){if("input"===e||"change"===e)return Ln(t)}var Kn="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function Gn(e,t){if(Kn(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!re.call(t,a)||!Kn(e[a],t[a]))return!1}return!0}function Yn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jn(e,t){var n,r=Yn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Yn(r)}}function Xn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Xn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Zn(e){for(var t=pt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=pt((e=t.contentWindow).document)}return t}function er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function tr(e,t){var n=Zn(t);t=e.focusedElem;var r=e.selectionRange;if(n!==t&&t&&t.ownerDocument&&Xn(t.ownerDocument.documentElement,t)){if(null!==r&&er(t))if(e=r.start,void 0===(n=r.end)&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if((n=(e=t.ownerDocument||document)&&e.defaultView||window).getSelection){n=n.getSelection();var a=t.textContent.length,s=Math.min(r.start,a);r=void 0===r.end?s:Math.min(r.end,a),!n.extend&&s>
vendor: 30,738 bytes, line 4
4r&&(a=r,r=s,s=a),a=Jn(t,s);var i=Jn(t,r);a&&i&&(1!==n.rangeCount||n.anchorNode!==a.node||n.anchorOffset!==a.offset||n.focusNode!==i.node||n.focusOffset!==i.offset)&&((e=e.createRange()).setStart(a.node,a.offset),n.removeAllRanges(),s>r?(n.addRange(e),n.extend(i.node,i.offset)):(e.setEnd(i.node,i.offset),n.addRange(e)))}for(e=[],n=t;n=n.parentNode;)1===n.nodeType&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for("function"===typeof t.focus&&t.focus(),t=0;t<e.length;t++)(n=e[t]).element.scrollLeft=n.left,n.element.scrollTop=n.top}}var nr=nt&&"documentMode"in document&&11>=document.documentMode,rr=null,ar=null,sr=null,ir=!1;function or(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;ir||null==rr||rr!==pt(r)||("selectionStart"in(r=rr)&&er(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},sr&&Gn(sr,r)||(sr=r,0<(r=Lu(ar,"onSelect")).length&&(t=new Xt("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=rr)))}function lr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var cr={animationend:lr("Animation","AnimationEnd"),animationiteration:lr("Animation","AnimationIteration"),animationstart:lr("Animation","AnimationStart"),transitionrun:lr("Transition","TransitionRun"),transitionstart:lr("Transition","TransitionStart"),transitioncancel:lr("Transition","TransitionCancel"),transitionend:lr("Transition","TransitionEnd")},ur={},dr={};function hr(e){if(ur[e])return ur[e];if(!cr[e])return e;var t,n=cr[e];for(t in n)if(n.hasOwnProperty(t)&&t in dr)return ur[e]=n[t];return e}nt&&(dr=document.createElement("div").style,"AnimationEvent"in window||(delete cr.animationend.animation,delete cr.animationiteration.animation,delete cr.animationstart.animation),"TransitionEvent"in window||delete cr.transitionend.transition);var pr=hr("animationend"),mr=hr("animationiteration"),fr=hr("animationstart"),gr=hr("transitionrun"),vr=hr("transitionstart"),yr=hr("transitioncancel"),br=hr("transitionend"),xr=new Map,wr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function jr(e,t){xr.set(e,t),et(t,[e])}var Nr=[],Sr=0,kr=0;function Er(){for(var e=Sr,t=kr=Sr=0;t<e;){var n=Nr[t];Nr[t++]=null;var r=Nr[t];Nr[t++]=null;var a=Nr[t];Nr[t++]=null;var s=Nr[t];if(Nr[t++]=null,null!==r&&null!==a){var i=r.pending;null===i?a.next=a:(a.next=i.next,i.next=a),r.pending=a}0!==s&&Tr(n,a,s)}}function _r(e,t,n,r){Nr[Sr++]=e,Nr[Sr++]=t,Nr[Sr++]=n,Nr[Sr++]=r,kr|=r,e.lanes|=r,null!==(e=e.alternate)&&(e.lanes|=r)}function Cr(e,t,n,r){return _r(e,t,n,r),Rr(e)}function Ar(e,t){return _r(e,null,null,t),Rr(e)}function Tr(e,t,n){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n);for(var a=!1,s=e.return;null!==s;)s.childLanes|=n,null!==(r=s.alternate)&&(r.childLanes|=n),22===s.tag&&(null===(e=s.stateNode)||1&e._visibility||(a=!0)),e=s,s=s.return;a&&null!==t&&3===e.tag&&(s=e.stateNode,a=31-xe(n),null===(e=(s=s.hiddenUpdates)[a])?s[a]=[t]:e.push(t),t.lane=536870912|n)}function Rr(e){if(50<Cc)throw Cc=0,Ac=null,Error(i(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var Pr={},Or=new WeakMap;function Ir(e,t){if("object"===typeof e&&null!==e){var n=Or.get(e);return void 0!==n?n:(t={value:e,source:t,stack:L(t)},Or.set(e,t),t)}return{value:e,source:t,stack:L(t)}}var $r=[],Lr=0,Fr=null,Mr=0,Dr=[],Ur=0,zr=null,qr=1,Br="";function Hr(e,t){$r[Lr++]=Mr,$r[Lr++]=Fr,Fr=e,Mr=t}function Qr(e,t,n){Dr[Ur++]=qr,Dr[Ur++]=Br,Dr[Ur++]=zr,zr=e;var r=qr;e=Br;var a=32-xe(r)-1;r&=~(1<<a),n+=1;var s=32-xe(t)+a;if(30<s){var i=a-a%5;s=(r&(1<<i)-1).toString(32),r>>=i,a-=i,qr=1<<32-xe(t)+a|n<<a|r,Br=s+e}else qr=1<<s|n<<a|r,Br=e}function Wr(e){null!==e.return&&(Hr(e,1),Qr(e,1,0))}function Vr(e){for(;e===Fr;)Fr=$r[--Lr],$r[Lr]=null,Mr=$r[--Lr],$r[Lr]=null;for(;e===zr;)zr=Dr[--Ur],Dr[Ur]=null,Br=Dr[--Ur],Dr[Ur]=null,qr=Dr[--Ur],Dr[Ur]=null}var Kr=null,Gr=null,Yr=!1,Jr=null,Xr=!1,Zr=Error(i(519));function ea(e){throw sa(Ir(Error(i(418,"")),e)),Zr}function ta(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Me]=e,t[De]=r,n){case"dialog":Au("cancel",t),Au("close",t);break;case"iframe":case"object":case"embed":Au("load",t);break;case"video":case"audio":for(n=0;n<Eu.length;n++)Au(Eu[n],t);break;case"source":Au("error",t);break;case"img":case"image":case"link":Au("error",t),Au("load",t);break;case"details":Au("toggle",t);break;case"input":Au("invalid",t),vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0),dt(t);break;case"select":Au("invalid",t);break;case"textarea":Au("invalid",t),wt(t,r.value,r.defaultValue,r.children),dt(t)}"string"!==typeof(n=r.children)&&"number"!==typeof n&&"bigint"!==typeof n||t.textContent===""+n||!0===r.suppressHydrationWarning||qu(t.textContent,n)?(null!=r.popover&&(Au("beforetoggle",t),Au("toggle",t)),null!=r.onScroll&&Au("scroll",t),null!=r.onScrollEnd&&Au("scrollend",t),null!=r.onClick&&(t.onclick=Bu),t=!0):t=!1,t||ea(e)}function na(e){for(Kr=e.return;Kr;)switch(Kr.tag){case 3:case 27:return void(Xr=!0);case 5:case 13:return void(Xr=!1);default:Kr=Kr.return}}function ra(e){if(e!==Kr)return!1;if(!Yr)return na(e),Yr=!0,!1;var t,n=!1;if((t=3!==e.tag&&27!==e.tag)&&((t=5===e.tag)&&(t=!("form"!==(t=e.type)&&"button"!==t)||Xu(e.type,e.memoizedProps)),t=!t),t&&(n=!0),n&&Gr&&ea(e),na(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));e:{for(e=e.nextSibling,n=0;e;){if(8===e.nodeType)if("/$"===(t=e.data)){if(0===n){Gr=od(e.nextSibling);break e}n--}else"$"!==t&&"$!"!==t&&"$?"!==t||n++;e=e.nextSibling}Gr=null}}else Gr=Kr?od(e.stateNode.nextSibling):null;return!0}function aa(){Gr=Kr=null,Yr=!1}function sa(e){null===Jr?Jr=[e]:Jr.push(e)}var ia=Error(i(460)),oa=Error(i(474)),la={then:function(){}};function ca(e){return"fulfilled"===(e=e.status)||"rejected"===e}function ua(){}function da(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(ua,ua),t=n),t.status){case"fulfilled":return t.value;case"rejected":if((e=t.reason)===ia)throw Error(i(483));throw e;default:if("string"===typeof t.status)t.then(ua,ua);else{if(null!==(e=tc)&&100<e.shellSuspendCounter)throw Error(i(482));(e=t).status="pending",e.then((function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}}),(function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}}))}switch(t.status){case"fulfilled":return t.value;case"rejected":if((e=t.reason)===ia)throw Error(i(483));throw e}throw ha=t,ia}}var ha=null;function pa(){if(null===ha)throw Error(i(459));var e=ha;return ha=null,e}var ma=null,fa=0;function ga(e){var t=fa;return fa+=1,null===ma&&(ma=[]),da(ma,e,t)}function va(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function ya(e,t){if(t.$$typeof===l)throw Error(i(525));throw e=Object.prototype.toString.call(t),Error(i(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ba(e){return(0,e._init)(e._payload)}function xa(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function a(e,t){return(e=Fl(e,t)).index=0,e.sibling=null,e}function s(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=33554434,n):r:(t.flags|=33554434,n):(t.flags|=1048576,n)}function o(t){return e&&null===t.alternate&&(t.flags|=33554434),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=ql(n,e.mode,r)).return=e,t):((t=a(t,n)).return=e,t)}function h(e,t,n,r){var s=n.type;return s===d?m(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===s||"object"===typeof s&&null!==s&&s.$$typeof===w&&ba(s)===t.type)?(va(t=a(t,n.props),n),t.return=e,t):(va(t=Dl(n.type,n.key,n.props,null,e.mode,r),n),t.return=e,t)}function p(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Bl(n,e.mode,r)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function m(e,t,n,r,s){return null===t||7!==t.tag?((t=Ul(n,e.mode,r,s)).return=e,t):((t=a(t,n)).return=e,t)}function f(e,t,n){if("string"===typeof t&&""!==t||"number"===typeof t||"bigint"===typeof t)return(t=ql(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case c:return va(n=Dl(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case u:return(t=Bl(t,e.mode,n)).return=e,t;case w:return f(e,t=(0,t._init)(t._payload),n)}if(z(t)||k(t))return(t=Ul(t,e.mode,n,null)).return=e,t;if("function"===typeof t.then)return f(e,ga(t),n);if(t.$$typeof===g)return f(e,Eo(e,t),n);ya(e,t)}return null}function v(e,t,n,r){var a=null!==t?t.key:null;if("string"===typeof n&&""!==n||"number"===typeof n||"bigint"===typeof n)return null!==a?null:l(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case c:return n.key===a?h(e,t,n,r):null;case u:return n.key===a?p(e,t,n,r):null;case w:return v(e,t,n=(a=n._init)(n._payload),r)}if(z(n)||k(n))return null!==a?null:m(e,t,n,r,null);if("function"===typeof n.then)return v(e,t,ga(n),r);if(n.$$typeof===g)return v(e,t,Eo(e,n),r);ya(e,n)}return null}function y(e,t,n,r,a){if("string"===typeof r&&""!==r||"number"===typeof r||"bigint"===typeof r)return l(t,e=e.get(n)||null,""+r,a);if("object"===typeof r&&null!==r){switch(r.$$typeof){case c:return h(t,e=e.get(null===r.key?n:r.key)||null,r,a);case u:return p(t,e=e.get(null===r.key?n:r.key)||null,r,a);case w:return y(e,t,n,r=(0,r._init)(r._payload),a)}if(z(r)||k(r))return m(t,e=e.get(n)||null,r,a,null);if("function"===typeof r.then)return y(e,t,n,ga(r),a);if(r.$$typeof===g)return y(e,t,n,Eo(t,r),a);ya(t,r)}return null}function b(l,h,p,m){if("object"===typeof p&&null!==p&&p.type===d&&null===p.key&&(p=p.props.children),"object"===typeof p&&null!==p){switch(p.$$typeof){case c:e:{for(var x=p.key;null!==h;){if(h.key===x){if((x=p.type)===d){if(7===h.tag){n(l,h.sibling),(m=a(h,p.props.children)).return=l,l=m;break e}}else if(h.elementType===x||"object"===typeof x&&null!==x&&x.$$typeof===w&&ba(x)===h.type){n(l,h.sibling),va(m=a(h,p.props),p),m.return=l,l=m;break e}n(l,h);break}t(l,h),h=h.sibling}p.type===d?((m=Ul(p.props.children,l.mode,m,p.key)).return=l,l=m):(va(m=Dl(p.type,p.key,p.props,null,l.mode,m),p),m.return=l,l=m)}return o(l);case u:e:{for(x=p.key;null!==h;){if(h.key===x){if(4===h.tag&&h.stateNode.containerInfo===p.containerInfo&&h.stateNode.implementation===p.implementation){n(l,h.sibling),(m=a(h,p.children||[])).return=l,l=m;break e}n(l,h);break}t(l,h),h=h.sibling}(m=Bl(p,l.mode,m)).return=l,l=m}return o(l);case w:return b(l,h,p=(x=p._init)(p._payload),m)}if(z(p))return function(a,i,o,l){for(var c=null,u=null,d=i,h=i=0,p=null;null!==d&&h<o.length;h++){d.index>h?(p=d,d=null):p=d.sibling;var m=v(a,d,o[h],l);if(null===m){null===d&&(d=p);break}e&&d&&null===m.alternate&&t(a,d),i=s(m,i,h),null===u?c=m:u.sibling=m,u=m,d=p}if(h===o.length)return n(a,d),Yr&&Hr(a,h),c;if(null===d){for(;h<o.length;h++)null!==(d=f(a,o[h],l))&&(i=s(d,i,h),null===u?c=d:u.sibling=d,u=d);return Yr&&Hr(a,h),c}for(d=r(d);h<o.length;h++)null!==(p=y(d,a,h,o[h],l))&&(e&&null!==p.alternate&&d.delete(null===p.key?h:p.key),i=s(p,i,h),null===u?c=p:u.sibling=p,u=p);return e&&d.forEach((function(e){return t(a,e)})),Yr&&Hr(a,h),c}(l,h,p,m);if(k(p)){if("function"!==typeof(x=k(p)))throw Error(i(150));return function(a,o,l,c){if(null==l)throw Error(i(151));for(var u=null,d=null,h=o,p=o=0,m=null,g=l.next();null!==h&&!g.done;p++,g=l.next()){h.index>p?(m=h,h=null):m=h.sibling;var b=v(a,h,g.value,c);if(null===b){null===h&&(h=m);break}e&&h&&null===b.alternate&&t(a,h),o=s(b,o,p),null===d?u=b:d.sibling=b,d=b,h=m}if(g.done)return n(a,h),Yr&&Hr(a,p),u;if(null===h){for(;!g.done;p++,g=l.next())null!==(g=f(a,g.value,c))&&(o=s(g,o,p),null===d?u=g:d.sibling=g,d=g);return Yr&&Hr(a,p),u}for(h=r(h);!g.done;p++,g=l.next())null!==(g=y(h,a,p,g.value,c))&&(e&&null!==g.alternate&&h.delete(null===g.key?p:g.key),o=s(g,o,p),null===d?u=g:d.sibling=g,d=g);return e&&h.forEach((function(e){return t(a,e)})),Yr&&Hr(a,p),u}(l,h,p=x.call(p),m)}if("function"===typeof p.then)return b(l,h,ga(p),m);if(p.$$typeof===g)return b(l,h,Eo(l,p),m);ya(l,p)}return"string"===typeof p&&""!==p||"number"===typeof p||"bigint"===typeof p?(p=""+p,null!==h&&6===h.tag?(n(l,h.sibling),(m=a(h,p)).return=l,l=m):(n(l,h),(m=ql(p,l.mode,m)).return=l,l=m),o(l)):n(l,h)}return function(e,t,n,r){try{fa=0;var a=b(e,t,n,r);return ma=null,a}catch(i){if(i===ia)throw i;var s=$l(29,i,null,e.mode);return s.lanes=r,s.return=e,s}}}var wa=xa(!0),ja=xa(!1),Na=W(null),Sa=W(0);function ka(e,t){K(Sa,e=cc),K(Na,t),cc=e|t.baseLanes}function Ea(){K(Sa,cc),K(Na,Na.current)}function _a(){cc=Sa.current,V(Na),V(Sa)}var Ca=W(null),Aa=null;function Ta(e){var t=e.alternate;K(Ia,1&Ia.current),K(Ca,e),null===Aa&&(null===t||null!==Na.current||null!==t.memoizedState)&&(Aa=e)}function Ra(e){if(22===e.tag){if(K(Ia,Ia.current),K(Ca,e),null===Aa){var t=e.alternate;null!==t&&null!==t.memoizedState&&(Aa=e)}}else Pa()}function Pa(){K(Ia,Ia.current),K(Ca,Ca.current)}function Oa(e){V(Ca),Aa===e&&(Aa=null),V(Ia)}var Ia=W(0);function $a(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var La="undefined"!==typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach((function(e){return e()}))}},Fa=r.unstable_scheduleCallback,Ma=r.unstable_NormalPriority,Da={$$typeof:g,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ua(){return{controller:new La,data:new Map,refCount:0}}function za(e){e.refCount--,0===e.refCount&&Fa(Ma,(function(){e.controller.abort()}))}var qa=null,Ba=0,Ha=0,Qa=null;function Wa(){if(0===--Ba&&null!==qa){null!==Qa&&(Qa.status="fulfilled");var e=qa;qa=null,Ha=0,Qa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var Va=T.S;T.S=function(e,t){"object"===typeof t&&null!==t&&"function"===typeof t.then&&function(e,t){if(null===qa){var n=qa=[];Ba=0,Ha=wu(),Qa={status:"pending",value:void 0,then:function(e){n.push(e)}}}Ba++,t.then(Wa,Wa)}(0,t),null!==Va&&Va(e,t)};var Ka=W(null);function Ga(){var e=Ka.current;return null!==e?e:tc.pooledCache}function Ya(e,t){K(Ka,null===t?Ka.current:t.pool)}function Ja(){var e=Ga();return null===e?null:{parent:Da._currentValue,pool:e}}var Xa=0,Za=null,es=null,ts=null,ns=!1,rs=!1,as=!1,ss=0,is=0,os=null,ls=0;function cs(){throw Error(i(321))}function us(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Kn(e[n],t[n]))return!1;return!0}function ds(e,t,n,r,a,s){return Xa=s,Za=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,T.H=null===e||null===e.memoizedState?ki:Ei,as=!1,s=n(r,a),as=!1,rs&&(s=ps(t,n,r,a)),hs(e),s}function hs(e){T.H=Si;var t=null!==es&&null!==es.next;if(Xa=0,ts=es=Za=null,ns=!1,is=0,os=null,t)throw Error(i(300));null===e||Bi||null!==(e=e.dependencies)&&No(e)&&(Bi=!0)}function ps(e,t,n,r){Za=e;var a=0;do{if(rs&&(os=null),is=0,rs=!1,25<=a)throw Error(i(301));if(a+=1,ts=es=null,null!=e.updateQueue){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,null!=s.memoCache&&(s.memoCache.index=0)}T.H=_i,s=t(n,r)}while(rs);return s}function ms(){var e=T.H,t=e.useState()[0];return t="function"===typeof t.then?xs(t):t,e=e.useState()[0],(null!==es?es.memoizedState:null)!==e&&(Za.flags|=1024),t}function fs(){var e=0!==ss;return ss=0,e}function gs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function vs(e){if(ns){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}ns=!1}Xa=0,ts=es=Za=null,rs=!1,is=ss=0,os=null}function ys(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ts?Za.memoizedState=ts=e:ts=ts.next=e,ts}function bs(){if(null===es){var e=Za.alternate;e=null!==e?e.memoizedState:null}else e=es.next;var t=null===ts?Za.memoizedState:ts.next;if(null!==t)ts=t,es=e;else{if(null===e){if(null===Za.alternate)throw Error(i(467));throw Error(i(310))}e={memoizedState:(es=e).memoizedState,baseState:es.baseState,baseQueue:es.baseQueue,queue:es.queue,next:null},null===ts?Za.memoizedState=ts=e:ts=ts.next=e}return ts}function xs(e){var t=is;return is+=1,null===os&&(os=[]),e=da(os,e,t),t=Za,null===(null===ts?t.memoizedState:ts.next)&&(t=t.alternate,T.H=null===t||null===t.memoizedState?ki:Ei),e}function ws(e){if(null!==e&&"object"===typeof e){if("function"===typeof e.then)return xs(e);if(e.$$typeof===g)return ko(e)}throw Error(i(438,String(e)))}function js(e){var t=null,n=Za.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var r=Za.alternate;null!==r&&(null!==(r=r.updateQueue)&&(null!=(r=r.memoCache)&&(t={data:r.data.map((function(e){return e.slice()})),index:0})))}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},Za.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=N;return t.index++,n}function Ns(e,t){return"function"===typeof t?t(e):t}function Ss(e){return ks(bs(),es,e)}function ks(e,t,n){var r=e.queue;if(null===r)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,s=r.pending;if(null!==s){if(null!==a){var o=a.next;a.next=s.next,s.next=o}t.baseQueue=a=s,r.pending=null}if(s=e.baseState,null===a)e.memoizedState=s;else{var l=o=null,c=null,u=t=a.next,d=!1;do{var h=-536870913&u.lane;if(h!==u.lane?(rc&h)===h:(Xa&h)===h){var p=u.revertLane;if(0===p)null!==c&&(c=c.next={lane:0,revertLane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),h===Ha&&(d=!0);else{if((Xa&p)===p){u=u.next,p===Ha&&(d=!0);continue}h={lane:0,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=h,o=s):c=c.next=h,Za.lanes|=p,dc|=p}h=u.action,as&&n(s,h),s=u.hasEagerState?u.eagerState:n(s,h)}else p={lane:h,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=p,o=s):c=c.next=p,Za.lanes|=h,dc|=h;u=u.next}while(null!==u&&u!==t);if(null===c?o=s:c.next=l,!Kn(s,e.memoizedState)&&(Bi=!0,d&&null!==(n=Qa)))throw n;e.memoizedState=s,e.baseState=o,e.baseQueue=c,r.lastRenderedState=s}return null===a&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Es(e){var t=bs(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,s=t.memoizedState;if(null!==a){n.pending=null;var o=a=a.next;do{s=e(s,o.action),o=o.next}while(o!==a);Kn(s,t.memoizedState)||(Bi=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function _s(e,t,n){var r=Za,a=bs(),s=Yr;if(s){if(void 0===n)throw Error(i(407));n=n()}else n=t();var o=!Kn((es||a).memoizedState,n);if(o&&(a.memoizedState=n,Bi=!0),a=a.queue,Xs(Ts.bind(null,r,a,e),[e]),a.getSnapshot!==t||o||null!==ts&&1&ts.memoizedState.tag){if(r.flags|=2048,Vs(9,As.bind(null,r,a,n,t),{destroy:void 0},null),null===tc)throw Error(i(349));s||0!==(60&Xa)||Cs(r,t,n)}return n}function Cs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=Za.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},Za.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function As(e,t,n,r){t.value=n,t.getSnapshot=r,Rs(t)&&Ps(e)}function Ts(e,t,n){return n((function(){Rs(t)&&Ps(e)}))}function Rs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Kn(e,n)}catch(r){return!0}}function Ps(e){var t=Ar(e,2);null!==t&&Pc(t,e,2)}function Os(e){var t=ys();if("function"===typeof e){var n=e;if(e=n(),as){be(!0);try{n()}finally{be(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ns,lastRenderedState:e},t}function Is(e,t,n,r){return e.baseState=n,ks(e,es,"function"===typeof r?r:Ns)}function $s(e,t,n,r,a){if(wi(e))throw Error(i(485));if(null!==(e=t.action)){var s={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){s.listeners.push(e)}};null!==T.T?n(!0):s.isTransition=!1,r(s),null===(n=t.pending)?(s.next=t.pending=s,Ls(t,s)):(s.next=n.next,t.pending=n.next=s)}}function Ls(e,t){var n=t.action,r=t.payload,a=e.state;if(t.isTransition){var s=T.T,i={};T.T=i;try{var o=n(a,r),l=T.S;null!==l&&l(i,o),Fs(e,t,o)}catch(c){Ds(e,t,c)}finally{T.T=s}}else try{Fs(e,t,s=n(a,r))}catch(u){Ds(e,t,u)}}function Fs(e,t,n){null!==n&&"object"===typeof n&&"function"===typeof n.then?n.then((function(n){Ms(e,t,n)}),(function(n){return Ds(e,t,n)})):Ms(e,t,n)}function Ms(e,t,n){t.status="fulfilled",t.value=n,Us(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,Ls(e,n)))}function Ds(e,t,n){var r=e.pending;if(e.pending=null,null!==r){r=r.next;do{t.status="rejected",t.reason=n,Us(t),t=t.next}while(t!==r)}e.action=null}function Us(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function zs(e,t){return t}function qs(e,t){if(Yr){var n=tc.formState;if(null!==n){e:{var r=Za;if(Yr){if(Gr){t:{for(var a=Gr,s=Xr;8!==a.nodeType;){if(!s){a=null;break t}if(null===(a=od(a.nextSibling))){a=null;break t}}a="F!"===(s=a.data)||"F"===s?a:null}if(a){Gr=od(a.nextSibling),r="F!"===a.data;break e}}ea(r)}r=!1}r&&(t=n[0])}}return(n=ys()).memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zs,lastRenderedState:t},n.queue=r,n=yi.bind(null,Za,r),r.dispatch=n,r=Os(!1),s=xi.bind(null,Za,!1,r.queue),a={state:t,dispatch:null,action:e,pending:null},(r=ys()).queue=a,n=$s.bind(null,Za,a,s,n),a.dispatch=n,r.memoizedState=e,[t,n,!1]}function Bs(e){return Hs(bs(),es,e)}function Hs(e,t,n){t=ks(e,t,zs)[0],e=Ss(Ns)[0],t="object"===typeof t&&null!==t&&"function"===typeof t.then?xs(t):t;var r=bs(),a=r.queue,s=a.dispatch;return n!==r.memoizedState&&(Za.flags|=2048,Vs(9,Qs.bind(null,a,n),{destroy:void 0},null)),[t,s,e]}function Qs(e,t){e.action=t}function Ws(e){var t=bs(),n=es;if(null!==n)return Hs(t,n,e);bs(),t=t.memoizedState;var r=(n=bs()).queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Vs(e,t,n,r){return e={tag:e,create:t,inst:n,deps:r,next:null},null===(t=Za.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},Za.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ks(){return bs().memoizedState}function Gs(e,t,n,r){var a=ys();Za.flags|=e,a.memoizedState=Vs(1|t,n,{destroy:void 0},void 0===r?null:r)}function Ys(e,t,n,r){var a=bs();r=void 0===r?null:r;var s=a.memoizedState.inst;null!==es&&null!==r&&us(r,es.memoizedState.deps)?a.memoizedState=Vs(t,n,s,r):(Za.flags|=e,a.memoizedState=Vs(1|t,n,s,r))}function Js(e,t){Gs(8390656,8,e,t)}function Xs(e,t){Ys(2048,8,e,t)}function Zs(e,t){return Ys(4,2,e,t)}function ei(e,t){return Ys(4,4,e,t)}function ti(e,t){if("function"===typeof t){e=e();var n=t(e);return function(){"function"===typeof n?n():t(null)}}if(null!==t&&void 0!==t)return e=e(),t.current=e,function(){t.current=null}}function ni(e,t,n){n=null!==n&&void 0!==n?n.concat([e]):null,Ys(4,4,ti.bind(null,t,e),n)}function ri(){}function ai(e,t){var n=bs();t=void 0===t?null:t;var r=n.memoizedState;return null!==t&&us(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function si(e,t){var n=bs();t=void 0===t?null:t;var r=n.memoizedState;if(null!==t&&us(t,r[1]))return r[0];if(r=e(),as){be(!0);try{e()}finally{be(!1)}}return n.memoizedState=[r,t],r}function ii(e,t,n){return void 0===n||0!==(1073741824&Xa)?e.memoizedState=t:(e.memoizedState=n,e=Rc(),Za.lanes|=e,dc|=e,n)}function oi(e,t,n,r){return Kn(n,t)?n:null!==Na.current?(e=ii(e,n,r),Kn(e,t)||(Bi=!0),e):0===(42&Xa)?(Bi=!0,e.memoizedState=n):(e=Rc(),Za.lanes|=e,dc|=e,t)}function li(e,t,n,r,a){var s=q.p;q.p=0!==s&&8>s?s:8;var i=T.T,o={};T.T=o,xi(e,!1,t,n);try{var l=a(),c=T.S;if(null!==c&&c(o,l),null!==l&&"object"===typeof l&&"function"===typeof l.then)bi(e,t,function(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(e){n.push(e)}};return e.then((function(){r.status="fulfilled",r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)}),(function(e){for(r.status="rejected",r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)})),r}(l,r),Tc());else bi(e,t,r,Tc())}catch(u){bi(e,t,{then:function(){},status:"rejected",reason:u},Tc())}finally{q.p=s,T.T=i}}function ci(){}function ui(e,t,n,r){if(5!==e.tag)throw Error(i(476));var a=di(e).queue;li(e,a,t,B,null===n?ci:function(){return hi(e),n(r)})}function di(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ns,lastRenderedState:B},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ns,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function hi(e){bi(e,di(e).next.queue,{},Tc())}function pi(){return ko(Ld)}function mi(){return bs().memoizedState}function fi(){return bs().memoizedState}function gi(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=Tc(),r=Po(t,e=Ro(n),n);return null!==r&&(Pc(r,t,n),Oo(r,t,n)),t={cache:Ua()},void(e.payload=t)}t=t.return}}function vi(e,t,n){var r=Tc();n={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},wi(e)?ji(t,n):null!==(n=Cr(e,t,n,r))&&(Pc(n,e,r),Ni(n,t,r))}function yi(e,t,n){bi(e,t,n,Tc())}function bi(e,t,n,r){var a={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(wi(e))ji(t,a);else{var s=e.alternate;if(0===e.lanes&&(null===s||0===s.lanes)&&null!==(s=t.lastRenderedReducer))try{var i=t.lastRenderedState,o=s(i,n);if(a.hasEagerState=!0,a.eagerState=o,Kn(o,i))return _r(e,t,a,0),null===tc&&Er(),!1}catch(l){}if(null!==(n=Cr(e,t,a,r)))return Pc(n,e,r),Ni(n,t,r),!0}return!1}function xi(e,t,n,r){if(r={lane:2,revertLane:wu(),action:r,hasEagerState:!1,eagerState:null,next:null},wi(e)){if(t)throw Error(i(479))}else null!==(t=Cr(e,n,r,2))&&Pc(t,e,2)}function wi(e){var t=e.alternate;return e===Za||null!==t&&t===Za}function ji(e,t){rs=ns=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ni(e,t,n){if(0!==(4194176&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Ie(e,n)}}var Si={readContext:ko,use:ws,useCallback:cs,useContext:cs,useEffect:cs,useImperativeHandle:cs,useLayoutEffect:cs,useInsertionEffect:cs,useMemo:cs,useReducer:cs,useRef:cs,useState:cs,useDebugValue:cs,useDeferredValue:cs,useTransition:cs,useSyncExternalStore:cs,useId:cs};Si.useCacheRefresh=cs,Si.useMemoCache=cs,Si.useHostTransitionStatus=cs,Si.useFormState=cs,Si.useActionState=cs,Si.useOptimistic=cs;var ki={readContext:ko,use:ws,useCallback:function(e,t){return ys().memoizedState=[e,void 0===t?null:t],e},useContext:ko,useEffect:Js,useImperativeHandle:function(e,t,n){n=null!==n&&void 0!==n?n.concat([e]):null,Gs(4194308,4,ti.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gs(4194308,4,e,t)},useInsertionEffect:function(e,t){Gs(4,2,e,t)},useMemo:function(e,t){var n=ys();t=void 0===t?null:t;var r=e();if(as){be(!0);try{e()}finally{be(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ys();if(void 0!==n){var a=n(t);if(as){be(!0);try{n(t)}finally{be(!1)}}}else a=t;return r.memoizedState=r.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},r.queue=e,e=e.dispatch=vi.bind(null,Za,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},ys().memoizedState=e},useState:function(e){var t=(e=Os(e)).queue,n=yi.bind(null,Za,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ri,useDeferredValue:function(e,t){return ii(ys(),e,t)},useTransition:function(){var e=Os(!1);return e=li.bind(null,Za,e.queue,!0,!1),ys().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Za,a=ys();if(Yr){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===tc)throw Error(i(349));0!==(60&rc)||Cs(r,t,n)}a.memoizedState=n;var s={value:n,getSnapshot:t};return a.queue=s,Js(Ts.bind(null,r,s,e),[e]),r.flags|=2048,Vs(9,As.bind(null,r,s,n,t),{destroy:void 0},null),n},useId:function(){var e=ys(),t=tc.identifierPrefix;if(Yr){var n=Br;t=":"+t+"R"+(n=(qr&~(1<<32-xe(qr)-1)).toString(32)+n),0<(n=ss++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ls++).toString(32)+":";return e.memoizedState=t},useCacheRefresh:function(){return ys().memoizedState=gi.bind(null,Za)}};ki.useMemoCache=js,ki.useHostTransitionStatus=pi,ki.useFormState=qs,ki.useActionState=qs,ki.useOptimistic=function(e){var t=ys();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=xi.bind(null,Za,!0,n),n.dispatch=t,[e,t]};var Ei={readContext:ko,use:ws,useCallback:ai,useContext:ko,useEffect:Xs,useImperativeHandle:ni,useInsertionEffect:Zs,useLayoutEffect:ei,useMemo:si,useReducer:Ss,useRef:Ks,useState:function(){return Ss(Ns)},useDebugValue:ri,useDeferredValue:function(e,t){return oi(bs(),es.memoizedState,e,t)},useTransition:function(){var e=Ss(Ns)[0],t=bs().memoizedState;return["boolean"===typeof e?e:xs(e),t]},useSyncExternalStore:_s,useId:mi};Ei.useCacheRefresh=fi,Ei.useMemoCache=js,Ei.useHostTransitionStatus=pi,Ei.useFormState=Bs,Ei.useActionState=Bs,Ei.useOptimistic=function(e,t){return Is(bs(),0,e,t)};var _i={readContext:ko,use:ws,useCallback:ai,useContext:ko,useEffect:Xs,useImperativeHandle:ni,useInsertionEffect:Zs,useLayoutEffect:ei,useMemo:si,useReducer:Es,useRef:Ks,useState:function(){return Es(Ns)},useDebugValue:ri,useDeferredValue:function(e,t){var n=bs();return null===es?ii(n,e,t):oi(n,es.memoizedState,e,t)},useTransition:function(){var e=Es(Ns)[0],t=bs().memoizedState;
4return["boolean"===typeof e?e:xs(e),t]},useSyncExternalStore:_s,useId:mi};function Ci(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:R({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}_i.useCacheRefresh=fi,_i.useMemoCache=js,_i.useHostTransitionStatus=pi,_i.useFormState=Ws,_i.useActionState=Ws,_i.useOptimistic=function(e,t){var n=bs();return null!==es?Is(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])};var Ai={isMounted:function(e){return!!(e=e._reactInternals)&&F(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Tc(),a=Ro(r);a.payload=t,void 0!==n&&null!==n&&(a.callback=n),null!==(t=Po(e,a,r))&&(Pc(t,e,r),Oo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Tc(),a=Ro(r);a.tag=1,a.payload=t,void 0!==n&&null!==n&&(a.callback=n),null!==(t=Po(e,a,r))&&(Pc(t,e,r),Oo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tc(),r=Ro(n);r.tag=2,void 0!==t&&null!==t&&(r.callback=t),null!==(t=Po(e,r,n))&&(Pc(t,e,n),Oo(t,e,n))}};function Ti(e,t,n,r,a,s,i){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,s,i):!t.prototype||!t.prototype.isPureReactComponent||(!Gn(n,r)||!Gn(a,s))}function Ri(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ai.enqueueReplaceState(t,t.state,null)}function Pi(e,t){var n=t;if("ref"in t)for(var r in n={},t)"ref"!==r&&(n[r]=t[r]);if(e=e.defaultProps)for(var a in n===t&&(n=R({},n)),e)void 0===n[a]&&(n[a]=e[a]);return n}var Oi="function"===typeof reportError?reportError:function(e){if("object"===typeof window&&"function"===typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"===typeof e&&null!==e&&"string"===typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"===typeof process&&"function"===typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function Ii(e){Oi(e)}function $i(e){console.error(e)}function Li(e){Oi(e)}function Fi(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(n){setTimeout((function(){throw n}))}}function Mi(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(r){setTimeout((function(){throw r}))}}function Di(e,t,n){return(n=Ro(n)).tag=3,n.payload={element:null},n.callback=function(){Fi(e,t)},n}function Ui(e){return(e=Ro(e)).tag=3,e}function zi(e,t,n,r){var a=n.type.getDerivedStateFromError;if("function"===typeof a){var s=r.value;e.payload=function(){return a(s)},e.callback=function(){Mi(t,n,r)}}var i=n.stateNode;null!==i&&"function"===typeof i.componentDidCatch&&(e.callback=function(){Mi(t,n,r),"function"!==typeof a&&(null===jc?jc=new Set([this]):jc.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:null!==e?e:""})})}var qi=Error(i(461)),Bi=!1;function Hi(e,t,n,r){t.child=null===e?ja(t,null,n,r):wa(t,e.child,n,r)}function Qi(e,t,n,r,a){n=n.render;var s=t.ref;if("ref"in r){var i={};for(var o in r)"ref"!==o&&(i[o]=r[o])}else i=r;return So(t),r=ds(e,t,n,i,s,a),o=fs(),null===e||Bi?(Yr&&o&&Wr(t),t.flags|=1,Hi(e,t,r,a),t.child):(gs(e,t,a),ho(e,t,a))}function Wi(e,t,n,r,a){if(null===e){var s=n.type;return"function"!==typeof s||Ll(s)||void 0!==s.defaultProps||null!==n.compare?((e=Dl(n.type,null,r,t,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=s,Vi(e,t,s,r,a))}if(s=e.child,!po(e,a)){var i=s.memoizedProps;if((n=null!==(n=n.compare)?n:Gn)(i,r)&&e.ref===t.ref)return ho(e,t,a)}return t.flags|=1,(e=Fl(s,r)).ref=t.ref,e.return=t,t.child=e}function Vi(e,t,n,r,a){if(null!==e){var s=e.memoizedProps;if(Gn(s,r)&&e.ref===t.ref){if(Bi=!1,t.pendingProps=r=s,!po(e,a))return t.lanes=e.lanes,ho(e,t,a);0!==(131072&e.flags)&&(Bi=!0)}}return Ji(e,t,n,r,a)}function Ki(e,t,n){var r=t.pendingProps,a=r.children,s=0!==(2&t.stateNode._pendingVisibility),i=null!==e?e.memoizedState:null;if(Yi(e,t),"hidden"===r.mode||s){if(0!==(128&t.flags)){if(r=null!==i?i.baseLanes|n:n,null!==e){for(a=t.child=e.child,s=0;null!==a;)s=s|a.lanes|a.childLanes,a=a.sibling;t.childLanes=s&~r}else t.childLanes=0,t.child=null;return Gi(e,t,r,n)}if(0===(536870912&n))return t.lanes=t.childLanes=536870912,Gi(e,t,null!==i?i.baseLanes|n:n,n);t.memoizedState={baseLanes:0,cachePool:null}
4,null!==e&&Ya(0,null!==i?i.cachePool:null),null!==i?ka(t,i):Ea(),Ra(t)}else null!==i?(Ya(0,i.cachePool),ka(t,i),Pa(),t.memoizedState=null):(null!==e&&Ya(0,null),Ea(),Pa());return Hi(e,t,a,n),t.child}function Gi(e,t,n,r){var a=Ga();return a=null===a?null:{parent:Da._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},null!==e&&Ya(0,null),Ea(),Ra(t),null!==e&&jo(e,t,r,!0),null}function Yi(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=2097664);else{if("function"!==typeof n&&"object"!==typeof n)throw Error(i(284));null!==e&&e.ref===n||(t.flags|=2097664)}}function Ji(e,t,n,r,a){return So(t),n=ds(e,t,n,r,void 0,a),r=fs(),null===e||Bi?(Yr&&r&&Wr(t),t.flags|=1,Hi(e,t,n,a),t.child):(gs(e,t,a),ho(e,t,a))}function Xi(e,t,n,r,a,s){return So(t),t.updateQueue=null,n=ps(t,r,n,a),hs(e),r=fs(),null===e||Bi?(Yr&&r&&Wr(t),t.flags|=1,Hi(e,t,n,s),t.child):(gs(e,t,s),ho(e,t,s))}function Zi(e,t,n,r,a){if(So(t),null===t.stateNode){var s=Pr,i=n.contextType;"object"===typeof i&&null!==i&&(s=ko(i)),s=new n(r,s),t.memoizedState=null!==s.state&&void 0!==s.state?s.state:null,s.updater=Ai,t.stateNode=s,s._reactInternals=t,(s=t.stateNode).props=r,s.state=t.memoizedState,s.refs={},Ao(t),i=n.contextType,s.context="object"===typeof i&&null!==i?ko(i):Pr,s.state=t.memoizedState,"function"===typeof(i=n.getDerivedStateFromProps)&&(Ci(t,n,i,r),s.state=t.memoizedState),"function"===typeof n.getDerivedStateFromProps||"function"===typeof s.getSnapshotBeforeUpdate||"function"!==typeof s.UNSAFE_componentWillMount&&"function"!==typeof s.componentWillMount||(i=s.state,"function"===typeof s.componentWillMount&&s.componentWillMount(),"function"===typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount(),i!==s.state&&Ai.enqueueReplaceState(s,s.state,null),Fo(t,r,s,a),Lo(),s.state=t.memoizedState),"function"===typeof s.componentDidMount&&(t.flags|=4194308),r=!0}else if(null===e){s=t.stateNode;var o=t.memoizedProps,l=Pi(n,o);s.props=l;var c=s.context,u=n.contextType;i=Pr,"object"===typeof u&&null!==u&&(i=ko(u));var d=n.getDerivedStateFromProps;u="function"===typeof d||"function"===typeof s.getSnapshotBeforeUpdate,o=t.pendingProps!==o,u||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(o||c!==i)&&Ri(t,s,r,i),Co=!1;var h=t.memoizedState;s.state=h,Fo(t,r,s,a),Lo(),c=t.memoizedState,o||h!==c||Co?("function"===typeof d&&(Ci(t,n,d,r),c=t.memoizedState),(l=Co||Ti(t,n,l,r,h,c,i))?(u||"function"!==typeof s.UNSAFE_componentWillMount&&"function"!==typeof s.componentWillMount||("function"===typeof s.componentWillMount&&s.componentWillMount(),"function"===typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"===typeof s.componentDidMount&&(t.flags|=4194308)):("function"===typeof s.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=i,r=l):("function"===typeof s.componentDidMount&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,To(e,t),u=Pi(n,i=t.memoizedProps),s.props=u,d=t.pendingProps,h=s.context,c=n.contextType,l=Pr,"object"===typeof c&&null!==c&&(l=ko(c)),(c="function"===typeof(o=n.getDerivedStateFromProps)||"function"===typeof s.getSnapshotBeforeUpdate)||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(i!==d||h!==l)&&Ri(t,s,r,l),Co=!1,h=t.memoizedState,s.state=h,Fo(t,r,s,a),Lo();var p=t.memoizedState;i!==d||h!==p||Co||null!==e&&null!==e.dependencies&&No(e.dependencies)?("function"===typeof o&&(Ci(t,n,o,r),p=t.memoizedState),(u=Co||Ti(t,n,u,r,h,p,l)||null!==e&&null!==e.dependencies&&No(e.dependencies))?(c||"function"!==typeof s.UNSAFE_componentWillUpdate&&"function"!==typeof s.componentWillUpdate||("function"===typeof s.componentWillUpdate&&s.componentWillUpdate(r,p,l),"function"===typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(r,p,l)),"function"===typeof s.componentDidUpdate&&(t.flags|=4),"function"===typeof s.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof s.componentDidUpdate||i===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||i===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),s.props=r,s.state=p,s.context=l,r=u):("function"!==typeof s.componentDidUpdate||i===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||i===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return s=r,Yi(e,t),r=0!==(128&t.flags),s||r?(s=t.stateNode,n=r&&"function"!==typeof n.getDerivedStateFromError?null:s.render(),t.flags|=1,null!==e&&r?(t.child=wa(t,e.child,null,a),t.child=wa(t,null,n,a)):Hi(e,t,n,a),t.memoizedState=s.state,e=t.child):e=ho(e,t,a),e}function eo(e,t,n,r){return aa(),t.flags|=256,Hi(e,t,n,r),t.child}var to={dehydrated:null,treeContext:null,retryLane:0};function no(e){return{baseLanes:e,cachePool:Ja()}}function ro(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=mc),e}
vendor: 4,532 bytes, line 4
4function ao(e,t,n){var r,a=t.pendingProps,s=!1,o=0!==(128&t.flags);if((r=o)||(r=(null===e||null!==e.memoizedState)&&0!==(2&Ia.current)),r&&(s=!0,t.flags&=-129),r=0!==(32&t.flags),t.flags&=-33,null===e){if(Yr){if(s?Ta(t):Pa(),Yr){var l,c=Gr;if(l=c){e:{for(l=c,c=Xr;8!==l.nodeType;){if(!c){c=null;break e}if(null===(l=od(l.nextSibling))){c=null;break e}}c=l}null!==c?(t.memoizedState={dehydrated:c,treeContext:null!==zr?{id:qr,overflow:Br}:null,retryLane:536870912},(l=$l(18,null,null,0)).stateNode=c,l.return=t,t.child=l,Kr=t,Gr=null,l=!0):l=!1}l||ea(t)}if(null!==(c=t.memoizedState)&&null!==(c=c.dehydrated))return"$!"===c.data?t.lanes=16:t.lanes=536870912,null;Oa(t)}return c=a.children,a=a.fallback,s?(Pa(),c=io({mode:"hidden",children:c},s=t.mode),a=Ul(a,s,n,null),c.return=t,a.return=t,c.sibling=a,t.child=c,(s=t.child).memoizedState=no(n),s.childLanes=ro(e,r,n),t.memoizedState=to,a):(Ta(t),so(t,c))}if(null!==(l=e.memoizedState)&&null!==(c=l.dehydrated)){if(o)256&t.flags?(Ta(t),t.flags&=-257,t=oo(e,t,n)):null!==t.memoizedState?(Pa(),t.child=e.child,t.flags|=128,t=null):(Pa(),s=a.fallback,c=t.mode,a=io({mode:"visible",children:a.children},c),(s=Ul(s,c,n,null)).flags|=2,a.return=t,s.return=t,a.sibling=s,t.child=a,wa(t,e.child,null,n),(a=t.child).memoizedState=no(n),a.childLanes=ro(e,r,n),t.memoizedState=to,t=s);else if(Ta(t),"$!"===c.data){if(r=c.nextSibling&&c.nextSibling.dataset)var u=r.dgst;r=u,(a=Error(i(419))).stack="",a.digest=r,sa({value:a,source:null,stack:null}),t=oo(e,t,n)}else if(Bi||jo(e,t,n,!1),r=0!==(n&e.childLanes),Bi||r){if(null!==(r=tc)){if(0!==(42&(a=n&-n)))a=1;else switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;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:a=64;break;case 268435456:a=134217728;break;default:a=0}if(0!==(a=0!==(a&(r.suspendedLanes|n))?0:a)&&a!==l.retryLane)throw l.retryLane=a,Ar(e,a),Pc(r,e,a),qi}"$?"===c.data||Hc(),t=oo(e,t,n)}else"$?"===c.data?(t.flags|=128,t.child=e.child,t=ou.bind(null,e),c._reactRetry=t,t=null):(e=l.treeContext,Gr=od(c.nextSibling),Kr=t,Yr=!0,Jr=null,Xr=!1,null!==e&&(Dr[Ur++]=qr,Dr[Ur++]=Br,Dr[Ur++]=zr,qr=e.id,Br=e.overflow,zr=t),(t=so(t,a.children)).flags|=4096);return t}return s?(Pa(),s=a.fallback,c=t.mode,u=(l=e.child).sibling,(a=Fl(l,{mode:"hidden",children:a.children})).subtreeFlags=31457280&l.subtreeFlags,null!==u?s=Fl(u,s):(s=Ul(s,c,n,null)).flags|=2,s.return=t,a.return=t,a.sibling=s,t.child=a,a=s,s=t.child,null===(c=e.child.memoizedState)?c=no(n):(null!==(l=c.cachePool)?(u=Da._currentValue,l=l.parent!==u?{parent:u,pool:u}:l):l=Ja(),c={baseLanes:c.baseLanes|n,cachePool:l}),s.memoizedState=c,s.childLanes=ro(e,r,n),t.memoizedState=to,a):(Ta(t),e=(n=e.child).sibling,(n=Fl(n,{mode:"visible",children:a.children})).return=t,n.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n)}function so(e,t){return(t=io({mode:"visible",children:t},e.mode)).return=e,e.child=t}function io(e,t){return zl(e,t,0,null)}function oo(e,t,n){return wa(t,e.child,null,n),(e=so(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function lo(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),xo(e.return,t,n)}function co(e,t,n,r,a){var s=e.memoizedState;null===s?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=a)}function uo(e,t,n){var r=t.pendingProps,a=r.revealOrder,s=r.tail;if(Hi(e,t,r.children,n),0!==(2&(r=Ia.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&lo(e,n,t);else if(19===e.tag)lo(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}switch(K(Ia,r),a){case"forwards":for(n=t.child,a=null;null!==n;)null!==(e=n.alternate)&&null===$a(e)&&(a=n),n=n.sibling;null===(n=a)?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),co(t,!1,a,n,s);break;case"backwards":for(n=null,a=t.child,t.child=null;null!==a;){if(null!==(e=a.alternate)&&null===$a(e)){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}co(t,!0,n,null,s);break;case"together":co(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}
vendor: 1,355 bytes, line 4
4function ho(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),dc|=t.lanes,0===(n&t.childLanes)){if(null===e)return null;if(jo(e,t,n,!1),0===(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=Fl(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Fl(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function po(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!No(e))}function mo(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)Bi=!0;else{if(!po(e,n)&&0===(128&t.flags))return Bi=!1,function(e,t,n){switch(t.tag){case 3:Z(t,t.stateNode.containerInfo),yo(t,Da,e.memoizedState.cache),aa();break;case 27:case 5:te(t);break;case 4:Z(t,t.stateNode.containerInfo);break;case 10:yo(t,t.type,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(null!==r)return null!==r.dehydrated?(Ta(t),t.flags|=128,null):0!==(n&t.child.childLanes)?ao(e,t,n):(Ta(t),null!==(e=ho(e,t,n))?e.sibling:null);Ta(t);break;case 19:var a=0!==(128&e.flags);if((r=0!==(n&t.childLanes))||(jo(e,t,n,!1),r=0!==(n&t.childLanes)),a){if(r)return uo(e,t,n);t.flags|=128}if(null!==(a=t.memoizedState)&&(a.rendering=null,a.tail=null,a.lastEffect=null),K(Ia,Ia.current),r)break;return null;case 22:case 23:return t.lanes=0,Ki(e,t,n);case 24:yo(t,Da,e.memoizedState.cache)}
vendor: 4,820 bytes, line 4
4return ho(e,t,n)}(e,t,n);Bi=0!==(131072&e.flags)}else Bi=!1,Yr&&0!==(1048576&t.flags)&&Qr(t,Mr,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var r=t.elementType,a=r._init;if(r=a(r._payload),t.type=r,"function"!==typeof r){if(void 0!==r&&null!==r){if((a=r.$$typeof)===v){t.tag=11,t=Qi(null,t,r,e,n);break e}if(a===x){t.tag=14,t=Wi(null,t,r,e,n);break e}}throw t=_(r)||r,Error(i(306,t,""))}Ll(r)?(e=Pi(r,e),t.tag=1,t=Zi(null,t,r,e,n)):(t.tag=0,t=Ji(null,t,r,e,n))}return t;case 0:return Ji(e,t,t.type,t.pendingProps,n);case 1:return Zi(e,t,r=t.type,a=Pi(r,t.pendingProps),n);case 3:e:{if(Z(t,t.stateNode.containerInfo),null===e)throw Error(i(387));var s=t.pendingProps;r=(a=t.memoizedState).element,To(e,t),Fo(t,s,null,n);var o=t.memoizedState;if(s=o.cache,yo(t,Da,s),s!==a.cache&&wo(t,[Da],n,!0),Lo(),s=o.element,a.isDehydrated){if(a={element:s,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=eo(e,t,s,n);break e}if(s!==r){sa(r=Ir(Error(i(424)),t)),t=eo(e,t,s,n);break e}for(Gr=od(t.stateNode.containerInfo.firstChild),Kr=t,Yr=!0,Jr=null,Xr=!0,n=ja(t,null,s,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(aa(),s===r){t=ho(e,t,n);break e}Hi(e,t,s,n)}t=t.child}return t;case 26:return Yi(e,t),null===e?(n=gd(t.type,null,t.pendingProps,null))?t.memoizedState=n:Yr||(n=t.type,e=t.pendingProps,(r=Gu(J.current).createElement(n))[Me]=t,r[De]=e,Wu(r,n,e),Je(r),t.stateNode=r):t.memoizedState=gd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return te(t),null===e&&Yr&&(r=t.stateNode=cd(t.type,t.pendingProps,J.current),Kr=t,Xr=!0,Gr=od(r.firstChild)),r=t.pendingProps.children,null!==e||Yr?Hi(e,t,r,n):t.child=wa(t,null,r,n),Yi(e,t),t.child;case 5:return null===e&&Yr&&((a=r=Gr)&&(null!==(r=function(e,t,n,r){for(;1===e.nodeType;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(r){if(!e[Qe])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(s=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(s!==a.rel||e.getAttribute("href")!==(null==a.href?null:a.href)||e.getAttribute("crossorigin")!==(null==a.crossOrigin?null:a.crossOrigin)||e.getAttribute("title")!==(null==a.title?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((s=e.getAttribute("src"))!==(null==a.src?null:a.src)||e.getAttribute("type")!==(null==a.type?null:a.type)||e.getAttribute("crossorigin")!==(null==a.crossOrigin?null:a.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var s=null==a.name?null:""+a.name;if("hidden"===a.type&&e.getAttribute("name")===s)return e}if(null===(e=od(e.nextSibling)))break}return null}(r,t.type,t.pendingProps,Xr))?(t.stateNode=r,Kr=t,Gr=od(r.firstChild),Xr=!1,a=!0):a=!1),a||ea(t)),te(t),a=t.type,s=t.pendingProps,o=null!==e?e.memoizedProps:null,r=s.children,Xu(a,s)?r=null:null!==o&&Xu(a,o)&&(t.flags|=32),null!==t.memoizedState&&(a=ds(e,t,ms,null,null,n),Ld._currentValue=a),Yi(e,t),Hi(e,t,r,n),t.child;case 6:return null===e&&Yr&&((e=n=Gr)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=od(e.nextSibling)))return null}return e}(n,t.pendingProps,Xr))?(t.stateNode=n,Kr=t,Gr=null,e=!0):e=!1),e||ea(t)),null;case 13:return ao(e,t,n);case 4:return Z(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=wa(t,null,r,n):Hi(e,t,r,n),t.child;case 11:return Qi(e,t,t.type,t.pendingProps,n);case 7:return Hi(e,t,t.pendingProps,n),t.child;case 8:case 12:return Hi(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,yo(t,t.type,r.value),Hi(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,So(t),r=r(a=ko(a)),t.flags|=1,Hi(e,t,r,n),t.child;case 14:return Wi(e,t,t.type,t.pendingProps,n);case 15:return Vi(e,t,t.type,t.pendingProps,n);case 19:return uo(e,t,n);case 22:return Ki(e,t,n);case 24:return So(t),r=ko(Da),null===e?(null===(a=Ga())&&(a=tc,s=Ua(),a.pooledCache=s,s.refCount++,null!==s&&(a.pooledCacheLanes|=n),a=s),t.memoizedState={parent:r,cache:a},Ao(t),yo(t,Da,a)):(0!==(e.lanes&n)&&(To(e,t),Fo(t,null,null,n),Lo()),a=e.memoizedState,s=t.memoizedState,a.parent!==r?(a={parent:r,cache:r},t.memoizedState=a,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=a),yo(t,Da,r)):(r=s.cache,yo(t,Da,r),r!==a.cache&&wo(t,[Da],n,!0))),Hi(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}var fo=W(null),go=null,vo=null;function yo(e,t,n){K(fo,t._currentValue),t._currentValue=n}function bo(e){e._currentValue=fo.current,V(fo)}
vendor: 1,419 bytes, line 4
4function xo(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function wo(e,t,n,r){var a=e.child;for(null!==a&&(a.return=e);null!==a;){var s=a.dependencies;if(null!==s){var o=a.child;s=s.firstContext;e:for(;null!==s;){var l=s;s=a;for(var c=0;c<t.length;c++)if(l.context===t[c]){s.lanes|=n,null!==(l=s.alternate)&&(l.lanes|=n),xo(s.return,n,e),r||(o=null);break e}s=l.next}}else if(18===a.tag){if(null===(o=a.return))throw Error(i(341));o.lanes|=n,null!==(s=o.alternate)&&(s.lanes|=n),xo(o,n,e),o=null}else o=a.child;if(null!==o)o.return=a;else for(o=a;null!==o;){if(o===e){o=null;break}if(null!==(a=o.sibling)){a.return=o.return,o=a;break}o=o.return}a=o}}function jo(e,t,n,r){e=null;for(var a=t,s=!1;null!==a;){if(!s)if(0!==(524288&a.flags))s=!0;else if(0!==(262144&a.flags))break;if(10===a.tag){var o=a.alternate;if(null===o)throw Error(i(387));if(null!==(o=o.memoizedProps)){var l=a.type;Kn(a.pendingProps.value,o.value)||(null!==e?e.push(l):e=[l])}}else if(a===X.current){if(null===(o=a.alternate))throw Error(i(387));o.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(null!==e?e.push(Ld):e=[Ld])}a=a.return}null!==e&&wo(t,e,n,r),t.flags|=262144}function No(e){for(e=e.firstContext;null!==e;){if(!Kn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}
vendor: 41,842 bytes, line 4
4function So(e){go=e,vo=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function ko(e){return _o(go,e)}function Eo(e,t){return null===go&&So(e),_o(e,t)}function _o(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===vo){if(null===e)throw Error(i(308));vo=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else vo=vo.next=t;return n}var Co=!1;function Ao(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function To(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ro(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Po(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!==(2&ec)){var a=r.pending;return null===a?t.next=t:(t.next=a.next,a.next=t),r.pending=t,t=Rr(e),Tr(e,null,n),t}return _r(e,r,t,n),Rr(e)}function Oo(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194176&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Ie(e,n)}}function Io(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var a=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===s?a=s=i:s=s.next=i,n=n.next}while(null!==n);null===s?a=s=t:s=s.next=t}else a=s=t;return n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var $o=!1;function Lo(){if($o){if(null!==Qa)throw Qa}}function Fo(e,t,n,r){$o=!1;var a=e.updateQueue;Co=!1;var s=a.firstBaseUpdate,i=a.lastBaseUpdate,o=a.shared.pending;if(null!==o){a.shared.pending=null;var l=o,c=l.next;l.next=null,null===i?s=c:i.next=c,i=l;var u=e.alternate;null!==u&&((o=(u=u.updateQueue).lastBaseUpdate)!==i&&(null===o?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(null!==s){var d=a.baseState;for(i=0,u=c=l=null,o=s;;){var h=-536870913&o.lane,p=h!==o.lane;if(p?(rc&h)===h:(r&h)===h){0!==h&&h===Ha&&($o=!0),null!==u&&(u=u.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var m=e,f=o;h=t;var g=n;switch(f.tag){case 1:if("function"===typeof(m=f.payload)){d=m.call(g,d,h);break e}d=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null===(h="function"===typeof(m=f.payload)?m.call(g,d,h):m)||void 0===h)break e;d=R({},d,h);break e;case 2:Co=!0}}null!==(h=o.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=a.callbacks)?a.callbacks=[h]:p.push(h))}else p={lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===u?(c=u=p,l=d):u=u.next=p,i|=h;if(null===(o=o.next)){if(null===(o=a.shared.pending))break;o=(p=o).next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}null===u&&(l=d),a.baseState=l,a.firstBaseUpdate=c,a.lastBaseUpdate=u,null===s&&(a.shared.lanes=0),dc|=i,e.lanes=i,e.memoizedState=d}}function Mo(e,t){if("function"!==typeof e)throw Error(i(191,e));e.call(t)}function Do(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)Mo(n[e],t)}function Uo(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var a=r.next;n=a;do{if((n.tag&e)===e){r=void 0;var s=n.create,i=n.inst;r=s(),i.destroy=r}n=n.next}while(n!==a)}}catch(o){ru(t,t.return,o)}}function zo(e,t,n){try{var r=t.updateQueue,a=null!==r?r.lastEffect:null;if(null!==a){var s=a.next;r=s;do{if((r.tag&e)===e){var i=r.inst,o=i.destroy;if(void 0!==o){i.destroy=void 0,a=t;var l=n;try{o()}catch(c){ru(a,l,c)}}}r=r.next}while(r!==s)}}catch(c){ru(t,t.return,c)}}function qo(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{Do(t,n)}catch(r){ru(e,e.return,r)}}}function Bo(e,t,n){n.props=Pi(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){ru(e,t,r)}}function Ho(e,t){try{var n=e.ref;if(null!==n){var r=e.stateNode;switch(e.tag){case 26:case 27:case 5:var a=r;break;default:a=r}"function"===typeof n?e.refCleanup=n(a):n.current=a}}catch(s){ru(e,t,s)}}function Qo(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"===typeof r)try{r()}catch(a){ru(e,t,a)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"===typeof n)try{n(null)}catch(s){ru(e,t,s)}else n.current=null}function Wo(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(a){ru(e,e.return,a)}}function Vo(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,s=null,o=null,l=null,c=null,u=null,d=null;for(m in n){var h=n[m];if(n.hasOwnProperty(m)&&null!=h)switch(m){case"checked":case"value":break;case"defaultValue":c=h;default:r.hasOwnProperty(m)||Hu(e,t,m,null,r,h)}}for(var p in r){var m=r[p];if(h=n[p],r.hasOwnProperty(p)&&(null!=m||null!=h))switch(p){case"type":s=m;break;case"name":a=m;break;case"checked":u=m;break;case"defaultChecked":d=m;break;case"value":o=m;break;case"defaultValue":l=m;break;case"children":case"dangerouslySetInnerHTML":if(null!=m)throw Error(i(137,t));break;default:m!==h&&Hu(e,t,p,m,r,h)}}return void gt(e,o,l,c,u,d,s,a);case"select":for(s in m=o=l=p=null,n)if(c=n[s],n.hasOwnProperty(s)&&null!=c)switch(s){case"value":break;case"multiple":m=c;default:r.hasOwnProperty(s)||Hu(e,t,s,null,r,c)}for(a in r)if(s=r[a],c=n[a],r.hasOwnProperty(a)&&(null!=s||null!=c))switch(a){case"value":p=s;break;case"defaultValue":l=s;break;case"multiple":o=s;default:s!==c&&Hu(e,t,a,s,r,c)}return t=l,n=o,r=m,void(null!=p?bt(e,!!n,p,!1):!!r!==!!n&&(null!=t?bt(e,!!n,t,!0):bt(e,!!n,n?[]:"",!1)));case"textarea":for(l in m=p=null,n)if(a=n[l],n.hasOwnProperty(l)&&null!=a&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:Hu(e,t,l,null,r,a)}for(o in r)if(a=r[o],s=n[o],r.hasOwnProperty(o)&&(null!=a||null!=s))switch(o){case"value":p=a;break;case"defaultValue":m=a;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=a)throw Error(i(91));break;default:a!==s&&Hu(e,t,o,a,r,s)}return void xt(e,p,m);case"option":for(var f in n)if(p=n[f],n.hasOwnProperty(f)&&null!=p&&!r.hasOwnProperty(f))if("selected"===f)e.selected=!1;else Hu(e,t,f,null,r,p);for(c in r)if(p=r[c],m=n[c],r.hasOwnProperty(c)&&p!==m&&(null!=p||null!=m))if("selected"===c)e.selected=p&&"function"!==typeof p&&"symbol"!==typeof p;else Hu(e,t,c,p,r,m);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)p=n[g],n.hasOwnProperty(g)&&null!=p&&!r.hasOwnProperty(g)&&Hu(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(null!=p||null!=m))switch(u){case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(i(137,t));break;default:Hu(e,t,u,p,r,m)}return;default:if(Et(t)){for(var v in n)p=n[v],n.hasOwnProperty(v)&&void 0!==p&&!r.hasOwnProperty(v)&&Qu(e,t,v,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||void 0===p&&void 0===m||Qu(e,t,d,p,r,m);return}}for(var y in n)p=n[y],n.hasOwnProperty(y)&&null!=p&&!r.hasOwnProperty(y)&&Hu(e,t,y,null,r,p);for(h in r)p=r[h],m=n[h],!r.hasOwnProperty(h)||p===m||null==p&&null==m||Hu(e,t,h,p,r,m)}(r,e.type,n,t),r[De]=t}catch(a){ru(e,e.return,a)}}function Ko(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag||4===e.tag}function Go(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Ko(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&27!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Yo(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=Bu));else if(4!==r&&27!==r&&null!==(e=e.child))for(Yo(e,t,n),e=e.sibling;null!==e;)Yo(e,t,n),e=e.sibling}function Jo(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&27!==r&&null!==(e=e.child))for(Jo(e,t,n),e=e.sibling;null!==e;)Jo(e,t,n),e=e.sibling}var Xo=!1,Zo=!1,el=!1,tl="function"===typeof WeakSet?WeakSet:Set,nl=null,rl=!1;function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),4&r&&Uo(5,n);break;case 1:if(vl(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(o){ru(n,n.return,o)}else{var a=Pi(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(l){ru(n,n.return,l)}}64&r&&qo(n),512&r&&Ho(n,n.return);break;case 3:if(vl(e,n),64&r&&null!==(r=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:e=n.child.stateNode}try{Do(r,e)}catch(o){ru(n,n.return,o)}}break;case 26:vl(e,n),512&r&&Ho(n,n.return);break;case 27:case 5:vl(e,n),null===t&&4&r&&Wo(n),512&r&&Ho(n,n.return);break;case 12:default:vl(e,n);break;case 13:vl(e,n),4&r&&ul(e,n);break;case 22:if(!(a=null!==n.memoizedState||Xo)){t=null!==t&&null!==t.memoizedState||Zo;var s=Xo,i=Zo;Xo=a,(Zo=t)&&!i?bl(e,n,0!==(8772&n.subtreeFlags)):vl(e,n),Xo=s,Zo=i}512&r&&("manual"===n.memoizedProps.mode?Ho(n,n.return):Qo(n,n.return))}}function sl(e){var t=e.alternate;null!==t&&(e.alternate=null,sl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&We(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var il=null,ol=!1;function ll(e,t,n){for(n=n.child;null!==n;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(ye&&"function"===typeof ye.onCommitFiberUnmount)try{ye.onCommitFiberUnmount(ve,n)}catch(i){}switch(n.tag){case 26:Zo||Qo(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:Zo||Qo(n,t);var r=il,a=ol;for(il=n.stateNode,ll(e,t,n),t=(n=n.stateNode).attributes;t.length;)n.removeAttributeNode(t[0]);We(n),il=r,ol=a;break;case 5:Zo||Qo(n,t);case 6:a=il;var s=ol;if(il=null,ll(e,t,n),ol=s,null!==(il=a))if(ol)try{e=il,r=n.stateNode,8===e.nodeType?e.parentNode.removeChild(r):e.removeChild(r)}catch(o){ru(n,t,o)}else try{il.removeChild(n.stateNode)}catch(o){ru(n,t,o)}break;case 18:null!==il&&(ol?(t=il,n=n.stateNode,8===t.nodeType?sd(t.parentNode,n):1===t.nodeType&&sd(t,n),fh(t)):sd(il,n.stateNode));break;case 4:r=il,a=ol,il=n.stateNode.containerInfo,ol=!0,ll(e,t,n),il=r,ol=a;break;case 0:case 11:case 14:case 15:Zo||zo(2,n,t),Zo||zo(4,n,t),ll(e,t,n);break;case 1:Zo||(Qo(n,t),"function"===typeof(r=n.stateNode).componentWillUnmount&&Bo(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:Zo||Qo(n,t),Zo=(r=Zo)||null!==n.memoizedState,ll(e,t,n),Zo=r;break;default:ll(e,t,n)}}function ul(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{fh(e)}catch(n){ru(t,t.return,n)}}function dl(e,t){var n=function(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new tl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new tl),t;default:throw Error(i(435,e.tag))}}(e);t.forEach((function(t){var r=lu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}function hl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var a=n[r],s=e,o=t,l=o;e:for(;null!==l;){switch(l.tag){case 27:case 5:il=l.stateNode,ol=!1;break e;case 3:case 4:il=l.stateNode.containerInfo,ol=!0;break e}l=l.return}if(null===il)throw Error(i(160));cl(s,o,a),il=null,ol=!1,null!==(s=a.alternate)&&(s.return=null),a.return=null}if(13878&t.subtreeFlags)for(t=t.child;null!==t;)ml(t,e),t=t.sibling}var pl=null;function ml(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),fl(e),4&r&&(zo(3,e,e.return),Uo(3,e),zo(5,e,e.return));break;case 1:hl(t,e),fl(e),512&r&&(Zo||null===n||Qo(n,n.return)),64&r&&Xo&&(null!==(e=e.updateQueue)&&(null!==(r=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?r:n.concat(r))));break;case 26:var a=pl;if(hl(t,e),fl(e),512&r&&(Zo||null===n||Qo(n,n.return)),4&r){var s=null!==n?n.memoizedState:null;if(r=e.memoizedState,null===n)if(null===r)if(null===e.stateNode){e:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(r){case"title":(!(s=a.getElementsByTagName("title")[0])||s[Qe]||s[Me]||"http://www.w3.org/2000/svg"===s.namespaceURI||s.hasAttribute("itemprop"))&&(s=a.createElement(r),a.head.insertBefore(s,a.querySelector("head > title"))),Wu(s,r,n),s[Me]=e,Je(s),r=s;break e;case"link":var o=_d("link","href",a).get(r+(n.href||""));if(o)for(var l=0;l<o.length;l++)if((s=o[l]).getAttribute("href")===(null==n.href?null:n.href)&&s.getAttribute("rel")===(null==n.rel?null:n.rel)&&s.getAttribute("title")===(null==n.title?null:n.title)&&s.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){o.splice(l,1);break t}Wu(s=a.createElement(r),r,n),a.head.appendChild(s);break;case"meta":if(o=_d("meta","content",a).get(r+(n.content||"")))for(l=0;l<o.length;l++)if((s=o[l]).getAttribute("content")===(null==n.content?null:""+n.content)&&s.getAttribute("name")===(null==n.name?null:n.name)&&s.getAttribute("property")===(null==n.property?null:n.property)&&s.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&s.getAttribute("charset")===(null==n.charSet?null:n.charSet)){o.splice(l,1);break t}Wu(s=a.createElement(r),r,n),a.head.appendChild(s);break;default:throw Error(i(468,r))}s[Me]=e,Je(s),r=s}e.stateNode=r}else Cd(a,e.type,e.stateNode);else e.stateNode=jd(a,r,e.memoizedProps);else s!==r?(null===s?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):s.count--,null===r?Cd(a,e.type,e.stateNode):jd(a,r,e.memoizedProps)):null===r&&null!==e.stateNode&&Vo(e,e.memoizedProps,n.memoizedProps)}break;case 27:if(4&r&&null===e.alternate){a=e.stateNode,s=e.memoizedProps;try{for(var c=a.firstChild;c;){var u=c.nextSibling,d=c.nodeName;c[Qe]||"HEAD"===d||"BODY"===d||"SCRIPT"===d||"STYLE"===d||"LINK"===d&&"stylesheet"===c.rel.toLowerCase()||a.removeChild(c),c=u}for(var h=e.type,p=a.attributes;p.length;)a.removeAttributeNode(p[0]);Wu(a,h,s),a[Me]=e,a[De]=s}catch(f){ru(e,e.return,f)}}case 5:if(hl(t,e),fl(e),512&r&&(Zo||null===n||Qo(n,n.return)),32&e.flags){a=e.stateNode;try{jt(a,"")}catch(f){ru(e,e.return,f)}}4&r&&null!=e.stateNode&&Vo(e,a=e.memoizedProps,null!==n?n.memoizedProps:a),1024&r&&(el=!0);break;case 6:if(hl(t,e),fl(e),4&r){if(null===e.stateNode)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(f){ru(e,e.return,f)}}break;case 3:if(Ed=null,a=pl,pl=hd(t.containerInfo),hl(t,e),pl=a,fl(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{fh(t.containerInfo)}catch(f){ru(e,e.return,f)}el&&(el=!1,gl(e));break;case 4:r=pl,pl=hd(e.stateNode.containerInfo),hl(t,e),fl(e),pl=r;break;case 12:hl(t,e),fl(e);break;case 13:hl(t,e),fl(e),8192&e.child.flags&&null!==e.memoizedState!==(null!==n&&null!==n.memoizedState)&&(bc=le()),4&r&&(null!==(r=e.updateQueue)&&(e.updateQueue=null,dl(e,r)));break;case 22:if(512&r&&(Zo||null===n||Qo(n,n.return)),c=null!==e.memoizedState,u=null!==n&&null!==n.memoizedState,Xo=(d=Xo)||c,Zo=(h=Zo)||u,hl(t,e),Zo=h,Xo=d,fl(e),(t=e.stateNode)._current=e,t._visibility&=-3,t._visibility|=2&t._pendingVisibility,8192&r&&(t._visibility=c?-2&t._visibility:1|t._visibility,c&&(t=Xo||Zo,null===n||u||t||yl(e)),null===e.memoizedProps||"manual"!==e.memoizedProps.mode))e:for(n=null,t=e;;){if(5===t.tag||26===t.tag||27===t.tag){if(null===n){u=n=t;try{if(a=u.stateNode,c)"function"===typeof(s=a.style).setProperty?s.setProperty("display","none","important"):s.display="none";else{o=u.stateNode;var m=void 0!==(l=u.memoizedProps.style)&&null!==l&&l.hasOwnProperty("display")?l.display:null;o.style.display=null==m||"boolean"===typeof m?"":(""+m).trim()}}catch(f){ru(u,u.return,f)}}}else if(6===t.tag){if(null===n){u=t;try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(f){ru(u,u.return,f)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&r&&(null!==(r=e.updateQueue)&&(null!==(n=r.retryQueue)&&(r.retryQueue=null,dl(e,n))));break;case 19:hl(t,e),fl(e),4&r&&(null!==(r=e.updateQueue)&&(e.updateQueue=null,dl(e,r)));break;case 21:break;default:hl(t,e),fl(e)}}function fl(e){var t=e.flags;if(2&t){try{if(27!==e.tag){e:{for(var n=e.return;null!==n;){if(Ko(n)){var r=n;break e}n=n.return}throw Error(i(160))}switch(r.tag){case 27:var a=r.stateNode;Jo(e,Go(e),a);break;case 5:var s=r.stateNode;32&r.flags&&(jt(s,""),r.flags&=-33),Jo(e,Go(e),s);break;case 3:case 4:var o=r.stateNode.containerInfo;Yo(e,Go(e),o);break;default:throw Error(i(161))}}}catch(l){ru(e,e.return,l)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function gl(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;gl(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)al(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zo(4,t,t.return),yl(t);break;case 1:Qo(t,t.return);var n=t.stateNode;"function"===typeof n.componentWillUnmount&&Bo(t,t.return,n),yl(t);break;case 26:case 27:case 5:Qo(t,t.return),yl(t);break;case 22:Qo(t,t.return),null===t.memoizedState&&yl(t);break;default:yl(t)}e=e.sibling}}function bl(e,t,n){for(n=n&&0!==(8772&t.subtreeFlags),t=t.child;null!==t;){var r=t.alternate,a=e,s=t,i=s.flags;switch(s.tag){case 0:case 11:case 15:bl(a,s,n),Uo(4,s);break;case 1:if(bl(a,s,n),"function"===typeof(a=(r=s).stateNode).componentDidMount)try{a.componentDidMount()}catch(c){ru(r,r.return,c)}if(null!==(a=(r=s).updateQueue)){var o=r.stateNode;try{var l=a.shared.hiddenCallbacks;if(null!==l)for(a.shared.hiddenCallbacks=null,a=0;a<l.length;a++)Mo(l[a],o)}catch(c){ru(r,r.return,c)}}n&&64&i&&qo(s),Ho(s,s.return);break;case 26:case 27:case 5:bl(a,s,n),n&&null===r&&4&i&&Wo(s),Ho(s,s.return);break;case 12:default:bl(a,s,n);break;case 13:bl(a,s,n),n&&4&i&&ul(a,s);break;case 22:null===s.memoizedState&&bl(a,s,n),Ho(s,s.return)}t=t.sibling}}function xl(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&za(n))}function wl(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&za(e))}function jl(e,t,n,r){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)Nl(e,t,n,r),t=t.sibling}function Nl(e,t,n,r){var a=t.flags;switch(t.tag){case 0:case 11:case 15:jl(e,t,n,r),2048&a&&Uo(9,t);break;case 3:jl(e,t,n,r),2048&a&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&za(e)));break;case 12:if(2048&a){jl(e,t,n,r),e=t.stateNode;try{var s=t.memoizedProps,i=s.id,o=s.onPostCommit;"function"===typeof o&&o(i,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(l){ru(t,t.return,l)}}else jl(e,t,n,r);break;case 23:break;case 22:s=t.stateNode,null!==t.memoizedState?4&s._visibility?jl(e,t,n,r):kl(e,t):4&s._visibility?jl(e,t,n,r):(s._visibility|=4,Sl(e,t,n,r,0!==(10256&t.subtreeFlags))),2048&a&&xl(t.alternate,t);break;case 24:jl(e,t,n,r),2048&a&&wl(t.alternate,t);break;default:jl(e,t,n,r)}}function Sl(e,t,n,r,a){for(a=a&&0!==(10256&t.subtreeFlags),t=t.child;null!==t;){var s=e,i=t,o=n,l=r,c=i.flags;switch(i.tag){case 0:case 11:case 15:Sl(s,i,o,l,a),Uo(8,i);break;case 23:break;case 22:var u=i.stateNode;null!==i.memoizedState?4&u._visibility?Sl(s,i,o,l,a):kl(s,i):(u._visibility|=4,Sl(s,i,o,l,a)),a&&2048&c&&xl(i.alternate,i);break;case 24:Sl(s,i,o,l,a),a&&2048&c&&wl(i.alternate,i);break;default:Sl(s,i,o,l,a)}t=t.sibling}}function kl(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,r=t,a=r.flags;switch(r.tag){case 22:kl(n,r),2048&a&&xl(r.alternate,r);break;case 24:kl(n,r),2048&a&&wl(r.alternate,r);break;default:kl(n,r)}t=t.sibling}}var El=8192;function _l(e){if(e.subtreeFlags&El)for(e=e.child;null!==e;)Cl(e),e=e.sibling}function Cl(e){switch(e.tag){case 26:_l(e),e.flags&El&&null!==e.memoizedState&&function(e,t,n){if(null===Td)throw Error(i(475));var r=Td;if("stylesheet"===t.type&&("string"!==typeof n.media||!1!==matchMedia(n.media).matches)&&0===(4&t.state.loading)){if(null===t.instance){var a=vd(n.href),s=e.querySelector(yd(a));if(s)return null!==(e=s._p)&&"object"===typeof e&&"function"===typeof e.then&&(r.count++,r=Pd.bind(r),e.then(r,r)),t.state.loading|=4,t.instance=s,void Je(s);s=e.ownerDocument||e,n=bd(n),(a=ud.get(a))&&Sd(n,a),Je(s=s.createElement("link"));var o=s;o._p=new Promise((function(e,t){o.onload=e,o.onerror=t})),Wu(s,"link",n),t.instance=s}null===r.stylesheets&&(r.stylesheets=new Map),r.stylesheets.set(t,e),(e=t.state.preload)&&0===(3&t.state.loading)&&(r.count++,t=Pd.bind(r),e.addEventListener("load",t),e.addEventListener("error",t))}}(pl,e.memoizedState,e.memoizedProps);break;case 5:default:_l(e);break;case 3:case 4:var t=pl;pl=hd(e.stateNode.containerInfo),_l(e),pl=t;break;case 22:null===e.memoizedState&&(null!==(t=e.alternate)&&null!==t.memoizedState?(t=El,El=16777216,_l(e),El=t):_l(e))}}function Al(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function Tl(e){var t=e.deletions;if(0!==(16&e.flags)){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Ol(r,e)}Al(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)Rl(e),e=e.sibling}function Rl(e){switch(e.tag){case 0:case 11:case 15:Tl(e),2048&e.flags&&zo(9,e,e.return);break;case 3:case 12:default:Tl(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&4&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-5,Pl(e)):Tl(e)}}function Pl(e){var t=e.deletions;if(0!==(16&e.flags)){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Ol(r,e)}Al(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:zo(8,t,t.return),Pl(t);break;case 22:4&(n=t.stateNode)._visibility&&(n._visibility&=-5,Pl(t));break;default:Pl(t)}e=e.sibling}}function Ol(e,t){for(;null!==nl;){var n=nl;switch(n.tag){case 0:case 11:case 15:zo(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var r=n.memoizedState.cachePool.pool;null!=r&&r.refCount++}break;case 24:za(n.memoizedState.cache)}if(null!==(r=n.child))r.return=n,nl=r;else e:for(n=e;null!==nl;){var a=(r=nl).sibling,s=r.return;if(sl(r),r===n){nl=null;break e}if(null!==a){a.return=s,nl=a;break e}nl=s}}}function Il(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $l(e,t,n,r){return new Il(e,t,n,r)}function Ll(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Fl(e,t){var n=e.alternate;return null===n?((n=$l(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=31457280&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ml(e,t){e.flags&=31457282;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Dl(e,t,n,r,a,s){var o=0;if(r=e,"function"===typeof e)Ll(e)&&(o=1);else if("string"===typeof e)o=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!==typeof t.precedence||"string"!==typeof t.href||""===t.href)break;return!0;case"link":if("string"!==typeof t.rel||"string"!==typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"===typeof t.precedence&&null==e);case"script":if(t.async&&"function"!==typeof t.async&&"symbol"!==typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"===typeof t.src)return!0}return!1}(e,n,G.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case d:return Ul(n.children,a,s,t);case h:o=8,a|=24;break;case p:return(e=$l(12,n,t,2|a)).elementType=p,e.lanes=s,e;case y:return(e=$l(13,n,t,a)).elementType=y,e.lanes=s,e;case b:return(e=$l(19,n,t,a)).elementType=b,e.lanes=s,e;case j:return zl(n,a,s,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case m:case g:o=10;break e;case f:o=9;break e;case v:o=11;break e;case x:o=14;break e;case w:o=16,r=null;break e}o=29,n=Error(i(130,null===e?"null":typeof e,"")),r=null}return(t=$l(o,n,t,a)).elementType=e,t.type=r,t.lanes=s,t}function Ul(e,t,n,r){return(e=$l(7,e,r,t)).lanes=n,e}function zl(e,t,n,r){(e=$l(22,e,r,t)).elementType=j,e.lanes=n;var a={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var e=a._current;if(null===e)throw Error(i(456));if(0===(2&a._pendingVisibility)){var t=Ar(e,2);null!==t&&(a._pendingVisibility|=2,Pc(t,e,2))}},attach:function(){var e=a._current;if(null===e)throw Error(i(456));if(0!==(2&a._pendingVisibility)){var t=Ar(e,2);null!==t&&(a._pendingVisibility&=-3,Pc(t,e,2))}}};return e.stateNode=a,e}function ql(e,t,n){return(e=$l(6,e,null,t)).lanes=n,e}function Bl(e,t,n){return(t=$l(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Hl(e){e.flags|=4}function Ql(e,t){if("stylesheet"!==t.type||0!==(4&t.state.loading))e.flags&=-16777217;else if(e.flags|=16777216,!Ad(t)){if(null!==(t=Ca.current)&&((4194176&rc)===rc?null!==Aa:(62914560&rc)!==rc&&0===(536870912&rc)||t!==Aa))throw ha=la,oa;e.flags|=8192}}function Wl(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?Te():536870912,e.lanes|=t,fc|=t)}function Vl(e,t){if(!Yr)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Kl(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=31457280&a.subtreeFlags,r|=31457280&a.flags,a.return=e,a=a.sibling;else for(a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Gl(e,t,n){var r=t.pendingProps;switch(Vr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return Kl(t),null;case 3:return n=t.stateNode,r=null,null!==e&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),bo(Da),ee(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(ra(t)?Hl(t):null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==Jr&&(Ic(Jr),Jr=null))),Kl(t),null;case 26:return n=t.memoizedState,null===e?(Hl(t),null!==n?(Kl(t),Ql(t,n)):(Kl(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Hl(t),Kl(t),Ql(t,n)):(Kl(t),t.flags&=-16777217):(e.memoizedProps!==r&&Hl(t),Kl(t),t.flags&=-16777217),null;case 27:ne(t),n=J.current;var a=t.type;if(null!==e&&null!=t.stateNode)e.memoizedProps!==r&&Hl(t);else{if(!r){if(null===t.stateNode)throw Error(i(166));return Kl(t),null}e=G.current,ra(t)?ta(t):(e=cd(a,r,n),t.stateNode=e,Hl(t))}return Kl(t),null;case 5:if(ne(t),n=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==r&&Hl(t);else{if(!r){if(null===t.stateNode)throw Error(i(166));return Kl(t),null}if(e=G.current,ra(t))ta(t);else{switch(a=Gu(J.current),e){case 1:e=a.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=a.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=a.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=a.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":(e=a.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e="string"===typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e="string"===typeof r.is?a.createElement(n,{is:r.is}):a.createElement(n)}}e[Me]=t,e[De]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)e.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=e;e:switch(Wu(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Hl(t)}}return Kl(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&Hl(t);else{if("string"!==typeof r&&null===t.stateNode)throw Error(i(166));if(e=J.current,ra(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(a=Kr))switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Me]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||qu(e.nodeValue,n)))||ea(t)}else(e=Gu(e).createTextNode(r))[Me]=t,t.stateNode=e}return Kl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(a=ra(t),null!==r&&null!==r.dehydrated){if(null===e){if(!a)throw Error(i(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(i(317));a[Me]=t}else aa(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Kl(t),a=!1}else null!==Jr&&(Ic(Jr),Jr=null),a=!0;if(!a)return 256&t.flags?(Oa(t),t):(Oa(t),null)}if(Oa(t),0!==(128&t.flags))return t.lanes=n,t;if(n=null!==r,e=null!==e&&null!==e.memoizedState,n){a=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(a=r.alternate.memoizedState.cachePool.pool);var s=null;null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(s=r.memoizedState.cachePool.pool),s!==a&&(r.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),Wl(t,t.updateQueue),Kl(t),null;case 4:return ee(),null===e&&Pu(t.stateNode.containerInfo),Kl(t),null;case 10:return bo(t.type),Kl(t),null;case 19:if(V(Ia),null===(a=t.memoizedState))return Kl(t),null;if(r=0!==(128&t.flags),null===(s=a.rendering))if(r)Vl(a,!1);else{if(0!==uc||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(s=$a(e))){for(t.flags|=128,Vl(a,!1),e=s.updateQueue,t.updateQueue=e,Wl(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)Ml(n,e),n=n.sibling;return K(Ia,1&Ia.current|2),t.child}e=e.sibling}null!==a.tail&&le()>xc&&(t.flags|=128,r=!0,Vl(a,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=$a(s))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Wl(t,e),Vl(a,!0),null===a.tail&&"hidden"===a.tailMode&&!s.alternate&&!Yr)return Kl(t),null}else 2*le()-a.renderingStartTime>xc&&536870912!==n&&(t.flags|=128,r=!0,Vl(a,!1),t.lanes=4194304);a.isBackwards?(s.sibling=t.child,t.child=s):(null!==(e=a.last)?e.sibling=s:t.child=s,a.last=s)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=le(),t.sibling=null,e=Ia.current,K(Ia,r?1&e|2:1&e),t):(Kl(t),null);case 22:case 23:return Oa(t),_a(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?0!==(536870912&n)&&0===(128&t.flags)&&(Kl(t),6&t.subtreeFlags&&(t.flags|=8192)):Kl(t),null!==(n=t.updateQueue)&&Wl(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&V(Ka),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),bo(Da),Kl(t),null;case 25:return null}throw Error(i(156,t.tag))}function Yl(e,t){switch(Vr(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return bo(Da),ee(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return ne(t),null;case 13:if(Oa(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));aa()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return V(Ia),null;case 4:return ee(),null;case 10:return bo(t.type),null;case 22:case 23:return Oa(t),_a(),null!==e&&V(Ka),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return bo(Da),null;default:return null}}function Jl(e,t){switch(Vr(t),t.tag){case 3:bo(Da),ee();break;case 26:case 27:case 5:ne(t);break;case 4:ee();break;case 13:Oa(t);break;case 19:V(Ia);break;case 10:bo(t.type);break;case 22:case 23:Oa(t),_a(),null!==e&&V(Ka);break;case 24:bo(Da)}}var Xl={getCacheForType:function(e){var t=ko(Da),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n}},Zl="function"===typeof WeakMap?WeakMap:Map,ec=0,tc=null,nc=null,rc=0,ac=0,sc=null,ic=!1,oc=!1,lc=!1,cc=0,uc=0,dc=0,hc=0,pc=0,mc=0,fc=0,gc=null,vc=null,yc=!1,bc=0,xc=1/0,wc=null,jc=null,Nc=!1,Sc=null,kc=0,Ec=0,_c=null,Cc=0,Ac=null;function Tc(){if(0!==(2&ec)&&0!==rc)return rc&-rc;if(null!==T.T){return 0!==Ha?Ha:wu()}return Le()}function Rc(){0===mc&&(mc=0===(536870912&rc)||Yr?Ae():536870912);var e=Ca.current;return null!==e&&(e.flags|=32),mc}function Pc(e,t,n){(e===tc&&2===ac||null!==e.cancelPendingCommit)&&(Uc(e,0),Fc(e,rc,mc,!1)),Pe(e,n),0!==(2&ec)&&e===tc||(e===tc&&(0===(2&ec)&&(hc|=n),4===uc&&Fc(e,rc,mc,!1)),fu(e))}function Oc(e,t,n){if(0!==(6&ec))throw Error(i(327));for(var r=!n&&0===(60&t)&&0===(t&e.expiredLanes)||_e(e,t),a=r?function(e,t){var n=ec;ec|=2;var r=qc(),a=Bc();tc!==e||rc!==t?(wc=null,xc=le()+500,Uc(e,t)):oc=_e(e,t);e:for(;;)try{if(0!==ac&&null!==nc){t=nc;var s=sc;t:switch(ac){case 1:ac=0,sc=null,Yc(e,t,s,1);break;case 2:if(ca(s)){ac=0,sc=null,Gc(t);break}t=function(){2===ac&&tc===e&&(ac=7),fu(e)},s.then(t,t);break e;case 3:ac=7;break e;case 4:ac=5;break e;case 7:ca(s)?(ac=0,sc=null,Gc(t)):(ac=0,sc=null,Yc(e,t,s,7));break;case 5:var o=null;switch(nc.tag){case 26:o=nc.memoizedState;case 5:case 27:var l=nc;if(!o||Ad(o)){ac=0,sc=null;var c=l.sibling;if(null!==c)nc=c;else{var u=l.return;null!==u?(nc=u,Jc(u)):nc=null}break t}}ac=0,sc=null,Yc(e,t,s,5);break;case 6:ac=0,sc=null,Yc(e,t,s,6);break;case 8:Dc(),uc=6;break e;default:throw Error(i(462))}}Vc();break}catch(d){zc(e,d)}return vo=go=null,T.H=r,T.A=a,ec=n,null!==nc?0:(tc=null,rc=0,Er(),uc)}(e,t):Qc(e,t,!0),s=r;;){if(0===a){oc&&!r&&Fc(e,t,0,!1);break}if(6===a)Fc(e,t,0,!ic);else{if(n=e.current.alternate,s&&!Lc(n)){a=Qc(e,t,!1),s=!1;continue}if(2===a){if(s=t,e.errorRecoveryDisabledLanes&s)var o=0;else o=0!==(o=-536870913&e.pendingLanes)?o:536870912&o?536870912:0;if(0!==o){t=o;e:{var l=e;a=gc;var c=l.current.memoizedState.isDehydrated;if(c&&(Uc(l,o).flags|=256),2!==(o=Qc(l,o,!1))){if(lc&&!c){l.errorRecoveryDisabledLanes|=s,hc|=s,a=4;break e}s=vc,vc=a,null!==s&&Ic(s)}a=o}if(s=!1,2!==a)continue}}if(1===a){Uc(e,0),Fc(e,t,0,!0);break}e:{switch(r=e,a){case 0:case 1:throw Error(i(345));case 4:if((4194176&t)===t){Fc(r,t,mc,!ic);break e}break;case 2:vc=null;break;case 3:case 5:break;default:throw Error(i(329))}if(r.finishedWork=n,r.finishedLanes=t,(62914560&t)===t&&10<(s=bc+300-le())){if(Fc(r,t,mc,!ic),0!==Ee(r,0))break e;r.timeoutHandle=ed($c.bind(null,r,n,vc,wc,yc,t,mc,hc,fc,ic,2,-0,0),s)}else $c(r,n,vc,wc,yc,t,mc,hc,fc,ic,0,-0,0)}}break}fu(e)}function Ic(e){null===vc?vc=e:vc.push.apply(vc,e)}function $c(e,t,n,r,a,s,o,l,c,u,d,h,p){var m=t.subtreeFlags;if((8192&m||16785408===(16785408&m))&&(Td={stylesheets:null,count:0,unsuspend:Rd},Cl(t),null!==(t=function(){if(null===Td)throw Error(i(475));var e=Td;return e.stylesheets&&0===e.count&&Id(e,e.stylesheets),0<e.count?function(t){var n=setTimeout((function(){if(e.stylesheets&&Id(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}),6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}())))return e.cancelPendingCommit=t(Zc.bind(null,e,n,r,a,o,l,c,1,h,p)),void Fc(e,s,o,!u);Zc(e,n,r,a,o,l,c,d,h,p)}function Lc(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&(null!==(n=t.updateQueue)&&null!==(n=n.stores)))for(var r=0;r<n.length;r++){var a=n[r],s=a.getSnapshot;a=a.value;try{if(!Kn(s(),a))return!1}catch(i){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Fc(e,t,n,r){t&=~pc,t&=~hc,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var a=t;0<a;){var s=31-xe(a),i=1<<s;r[s]=-1,a&=~i}0!==n&&Oe(e,n,t)}function Mc(){return 0!==(6&ec)||(gu(0,!1),!1)}function Dc(){if(null!==nc){if(0===ac)var e=nc.return;else vo=go=null,vs(e=nc),ma=null,fa=0,e=nc;for(;null!==e;)Jl(e.alternate,e),e=e.return;nc=null}}function Uc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,td(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),Dc(),tc=e,nc=n=Fl(e.current,null),rc=t,ac=0,sc=null,ic=!1,oc=_e(e,t),lc=!1,fc=mc=pc=hc=dc=uc=0,vc=gc=null,yc=!1,0!==(8&t)&&(t|=32&t);var r=e.entangledLanes;if(0!==r)for(e=e.entanglements,r&=t;0<r;){var a=31-xe(r),s=1<<a;t|=e[a],r&=~s}return cc=t,Er(),n}function zc(e,t){Za=null,T.H=Si,t===ia?(t=pa(),ac=3):t===oa?(t=pa(),ac=4):ac=t===qi?8:null!==t&&"object"===typeof t&&"function"===typeof t.then?6:1,sc=t,null===nc&&(uc=1,Fi(e,Ir(t,e.current)))}function qc(){var e=T.H;return T.H=Si,null===e?Si:e}function Bc(){var e=T.A;return T.A=Xl,e}function Hc(){uc=4,ic||(4194176&rc)!==rc&&null!==Ca.current||(oc=!0),0===(134217727&dc)&&0===(134217727&hc)||null===tc||Fc(tc,rc,mc,!1)}function Qc(e,t,n){var r=ec;ec|=2;var a=qc(),s=Bc();tc===e&&rc===t||(wc=null,Uc(e,t)),t=!1;var i=uc;e:for(;;)try{if(0!==ac&&null!==nc){var o=nc,l=sc;switch(ac){case 8:Dc(),i=6;break e;case 3:case 2:case 6:null===Ca.current&&(t=!0);var c=ac;if(ac=0,sc=null,Yc(e,o,l,c),n&&oc){i=0;break e}break;default:c=ac,ac=0,sc=null,Yc(e,o,l,c)}}Wc(),i=uc;break}catch(u){zc(e,u)}return t&&e.shellSuspendCounter++,vo=go=null,ec=r,T.H=a,T.A=s,null===nc&&(tc=null,rc=0,Er()),i}function Wc(){for(;null!==nc;)Kc(nc)}function Vc(){for(;null!==nc&&!ie();)Kc(nc)}function Kc(e){var t=mo(e.alternate,e,cc);e.memoizedProps=e.pendingProps,null===t?Jc(e):nc=t}function Gc(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Xi(n,t,t.pendingProps,t.type,void 0,rc);break;case 11:t=Xi(n,t,t.pendingProps,t.type.render,t.ref,rc);break;case 5:vs(t);default:Jl(n,t),t=mo(n,t=nc=Ml(t,cc),cc)}e.memoizedProps=e.pendingProps,null===t?Jc(e):nc=t}function Yc(e,t,n,r){vo=go=null,vs(t),ma=null,fa=0;var a=t.return;try{if(function(e,t,n,r,a){if(n.flags|=32768,null!==r&&"object"===typeof r&&"function"===typeof r.then){if(null!==(t=n.alternate)&&jo(t,n,a,!0),null!==(n=Ca.current)){switch(n.tag){case 13:return null===Aa?Hc():null===n.alternate&&0===uc&&(uc=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===la?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([r]):t.add(r),au(e,r,a)),!1;case 22:return n.flags|=65536,r===la?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([r]):n.add(r),au(e,r,a)),!1}throw Error(i(435,n.tag))}return au(e,r,a),Hc(),!1}if(Yr)return null!==(t=Ca.current)?(0===(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Zr&&sa(Ir(e=Error(i(422),{cause:r}),n))):(r!==Zr&&sa(Ir(t=Error(i(423),{cause:r}),n)),(e=e.current.alternate).flags|=65536,a&=-a,e.lanes|=a,r=Ir(r,n),Io(e,a=Di(e.stateNode,r,a)),4!==uc&&(uc=2)),!1;var s=Error(i(520),{cause:r});if(s=Ir(s,n),null===gc?gc=[s]:gc.push(s),4!==uc&&(uc=2),null===t)return!0;r=Ir(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,Io(n,e=Di(n.stateNode,r,e)),!1;case 1:if(t=n.type,s=n.stateNode,0===(128&n.flags)&&("function"===typeof t.getDerivedStateFromError||null!==s&&"function"===typeof s.componentDidCatch&&(null===jc||!jc.has(s))))return n.flags|=65536,a&=-a,n.lanes|=a,zi(a=Ui(a),e,n,r),Io(n,a),!1}n=n.return}while(null!==n);return!1}(e,a,t,n,rc))return uc=1,Fi(e,Ir(n,e.current)),void(nc=null)}catch(s){if(null!==a)throw nc=a,s;return uc=1,Fi(e,Ir(n,e.current)),void(nc=null)}32768&t.flags?(Yr||1===r?e=!0:oc||0!==(536870912&rc)?e=!1:(ic=e=!0,(2===r||3===r||6===r)&&(null!==(r=Ca.current)&&13===r.tag&&(r.flags|=16384))),Xc(t,e)):Jc(t)}
4function Jc(e){var t=e;do{if(0!==(32768&t.flags))return void Xc(t,ic);e=t.return;var n=Gl(t.alternate,t,cc);if(null!==n)return void(nc=n);if(null!==(t=t.sibling))return void(nc=t);nc=t=e}while(null!==t);0===uc&&(uc=5)}function Xc(e,t){do{var n=Yl(e.alternate,e);if(null!==n)return n.flags&=32767,void(nc=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling))return void(nc=e);nc=e=n}while(null!==e);uc=6,nc=null}function Zc(e,t,n,r,a,s,o,l,c,u){var d=T.T,h=q.p;try{q.p=2,T.T=null,function(e,t,n,r,a,s,o,l){do{tu()}while(null!==Sc);if(0!==(6&ec))throw Error(i(327));var c=e.finishedWork;if(r=e.finishedLanes,null===c)return null;if(e.finishedWork=null,e.finishedLanes=0,c===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var u=c.lanes|c.childLanes;if(function(e,t,n,r,a,s){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=i&~n;0<n;){var u=31-xe(n),d=1<<u;o[u]=0,l[u]=-1;var h=c[u];if(null!==h)for(c[u]=null,u=0;u<h.length;u++){var p=h[u];null!==p&&(p.lane&=-536870913)}n&=~d}0!==r&&Oe(e,r,0),0!==s&&0===a&&0!==e.tag&&(e.suspendedLanes|=s&~(i&~t))}(e,r,u|=kr,s,o,l),e===tc&&(nc=tc=null,rc=0),0===(10256&c.subtreeFlags)&&0===(10256&c.flags)||Nc||(Nc=!0,Ec=u,_c=n,function(e,t){ae(e,t)}(he,(function(){return tu(),null}))),n=0!==(15990&c.flags),0!==(15990&c.subtreeFlags)||n?(n=T.T,T.T=null,s=q.p,q.p=2,o=ec,ec|=4,function(e,t){if(e=e.containerInfo,Vu=Hd,er(e=Zn(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var a=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch(g){n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,h=e,p=null;t:for(;;){for(var m;h!==n||0!==a&&3!==h.nodeType||(l=o+a),h!==s||0!==r&&3!==h.nodeType||(c=o+r),3===h.nodeType&&(o+=h.nodeValue.length),null!==(m=h.firstChild);)p=h,h=m;for(;;){if(h===e)break t;if(p===n&&++u===a&&(l=o),p===s&&++d===r&&(c=o),null!==(m=h.nextSibling))break;
4p=(h=p).parentNode}h=m}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ku={focusedElem:e,selectionRange:n},Hd=!1,nl=t;null!==nl;)if(e=(t=nl).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,nl=e;else for(;null!==nl;){switch(s=(t=nl).alternate,e=t.flags,t.tag){case 0:case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(0!==(1024&e)&&null!==s){e=void 0,n=t,a=s.memoizedProps,s=s.memoizedState,r=n.stateNode;try{var f=Pi(n.type,a,(n.elementType,n.type));e=r.getSnapshotBeforeUpdate(f,s),r.__reactInternalSnapshotBeforeUpdate=e}catch(v){ru(n,n.return,v)}}break;case 3:if(0!==(1024&e))if(9===(n=(e=t.stateNode.containerInfo).nodeType))id(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":id(e);break;default:e.textContent=""}break;default:if(0!==(1024&e))throw Error(i(163))}if(null!==(e=t.sibling)){e.return=t.return,nl=e;break}nl=t.return}f=rl,rl=!1}(e,c),ml(c,e),tr(Ku,e.containerInfo),Hd=!!Vu,Ku=Vu=null,e.current=c,al(e,c.alternate,c),oe(),ec=o,q.p=s,T.T=n):e.current=c,Nc?(Nc=!1,Sc=e,kc=r):eu(e,u),u=e.pendingLanes,0===u&&(jc=null),function(e){if(ye&&"function"===typeof ye.onCommitFiberRoot)try{ye.onCommitFiberRoot(ve,e,void 0,128===(128&e.current.flags))}catch(t){}}(c.stateNode),fu(e),null!==t)for(a=e.onRecoverableError,c=0;c<t.length;c++)u=t[c],a(u.value,{componentStack:u.stack});0!==(3&kc)&&tu(),u=e.pendingLanes,0!==(4194218&r)&&0!==(42&u)?e===Ac?Cc++:(Cc=0,Ac=e):Cc=0,gu(0,!1)}(e,t,n,r,h,a,s,o)}finally{T.T=d,q.p=h}}function eu(e,t){0===(e.pooledCacheLanes&=t)&&(null!=(t=e.pooledCache)&&(e.pooledCache=null,za(t)))}function tu(){if(null!==Sc){var e=Sc,t=Ec;Ec=0;var n=$e(kc),r=T.T,a=q.p;try{if(q.p=32>n?32:n,T.T=null,null===Sc)var s=!1;else{n=_c,_c=null;var o=Sc,l=kc;if(Sc=null,kc=0,0!==(6&ec))throw Error(i(331));var c=ec;if(ec|=4,Rl(o.current),Nl(o,o.current,l,n),ec=c,gu(0,!1),ye&&"function"===typeof ye.onPostCommitFiberRoot)try{ye.onPostCommitFiberRoot(ve,o)}catch(u){}s=!0}return s}finally{q.p=a,T.T=r,eu(e,t)}}return!1}function nu(e,t,n){t=Ir(n,t),null!==(e=Po(e,t=Di(e.stateNode,t,2),2))&&(Pe(e,2),fu(e))}function ru(e,t,n){if(3===e.tag)nu(e,e,n);else for(;null!==t;){if(3===t.tag){nu(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===jc||!jc.has(r))){e=Ir(n,e),null!==(r=Po(t,n=Ui(2),2))&&(zi(n,r,t,e),Pe(r,2),fu(r));break}}t=t.return}}function au(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new Zl;var a=new Set;r.set(t,a)}else void 0===(a=r.get(t))&&(a=new Set,r.set(t,a));a.has(n)||(lc=!0,a.add(n),e=su.bind(null,e,t,n),t.then(e,e))}function su(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,tc===e&&(rc&n)===n&&(4===uc||3===uc&&(62914560&rc)===rc&&300>le()-bc?0===(2&ec)&&Uc(e,0):pc|=n,fc===rc&&(fc=0)),fu(e)}function iu(e,t){0===t&&(t=Te()),null!==(e=Ar(e,t))&&(Pe(e,t),fu(e))}function ou(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),iu(e,n)}function lu(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}null!==r&&r.delete(t),iu(e,n)}var cu=null,uu=null,du=!1,hu=!1,pu=!1,mu=0;function fu(e){var t;e!==uu&&null===e.next&&(null===uu?cu=uu=e:uu=uu.next=e),hu=!0,du||(du=!0,t=vu,rd((function(){0!==(6&ec)?ae(ue,t):t()})))}function gu(e,t){if(!pu&&hu){pu=!0;do{for(var n=!1,r=cu;null!==r;){if(!t)if(0!==e){var a=r.pendingLanes;if(0===a)var s=0;else{var i=r.suspendedLanes,o=r.pingedLanes;s=(1<<31-xe(42|e)+1)-1,s=201326677&(s&=a&~(i&~o))?201326677&s|1:s?2|s:0}0!==s&&(n=!0,xu(r,s))}else s=rc,0===(3&(s=Ee(r,r===tc?s:0)))||_e(r,s)||(n=!0,xu(r,s));r=r.next}}while(n);pu=!1}}function vu(){hu=du=!1;var e=0;0!==mu&&(function(){var e=window.event;if(e&&"popstate"===e.type)return e!==Zu&&(Zu=e,!0);return Zu=null,!1}()&&(e=mu),mu=0);for(var t=le(),n=null,r=cu;null!==r;){var a=r.next,s=yu(r,t);0===s?(r.next=null,null===n?cu=a:n.next=a,null===a&&(uu=n)):(n=r,(0!==e||0!==(3&s))&&(hu=!0)),r=a}gu(e,!1)}function yu(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,s=-62914561&e.pendingLanes;0<s;){var i=31-xe(s),o=1<<i,l=a[i];-1===l?0!==(o&n)&&0===(o&r)||(a[i]=Ce(o,t)):l<=t&&(e.expiredLanes|=o),s&=~o}if(n=rc,n=Ee(e,e===(t=tc)?n:0),r=e.callbackNode,0===n||e===t&&2===ac||null!==e.cancelPendingCommit)return null!==r&&null!==r&&se(r),e.callbackNode=null,e.callbackPriority=0;if(0===(3&n)||_e(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==r&&se(r),$e(n)){case 2:case 8:n=de;break;case 32:default:n=he;break;case 268435456:n=me}return r=bu.bind(null,e),n=ae(n,r),e.callbackPriority=t,e.callbackNode=n,t}return null!==r&&null!==r&&se(r),e.callbackPriority=2,e.callbackNode=null,2}function bu(e,t){var n=e.callbackNode;if(tu()&&e.callbackNode!==n)return null;var r=rc;return 0===(r=Ee(e,e===tc?r:0))?null:(Oc(e,r,t),yu(e,le()),null!=e.callbackNode&&e.callbackNode===n?bu.bind(null,e):null)}function xu(e,t){if(tu())return null;Oc(e,t,!0)}function wu(){return 0===mu&&(mu=Ae()),mu}function ju(e){return null==e||"symbol"===typeof e||"boolean"===typeof e?null:"function"===typeof e?e:At(""+e)}function Nu(e,t){var n=t.ownerDocument.createElement("input");
vendor: 5,145 bytes, line 4
4return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var Su=0;Su<wr.length;Su++){var ku=wr[Su];jr(ku.toLowerCase(),"on"+(ku[0].toUpperCase()+ku.slice(1)))}jr(pr,"onAnimationEnd"),jr(mr,"onAnimationIteration"),jr(fr,"onAnimationStart"),jr("dblclick","onDoubleClick"),jr("focusin","onFocus"),jr("focusout","onBlur"),jr(gr,"onTransitionRun"),jr(vr,"onTransitionStart"),jr(yr,"onTransitionCancel"),jr(br,"onTransitionEnd"),tt("onMouseEnter",["mouseout","mouseover"]),tt("onMouseLeave",["mouseout","mouseover"]),tt("onPointerEnter",["pointerout","pointerover"]),tt("onPointerLeave",["pointerout","pointerover"]),et("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),et("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),et("onBeforeInput",["compositionend","keypress","textInput","paste"]),et("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),et("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),et("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Eu="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(" "),_u=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Eu));function Cu(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var i=r.length-1;0<=i;i--){var o=r[i],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==s&&a.isPropagationStopped())break e;s=o,a.currentTarget=c;try{s(a)}catch(u){Oi(u)}a.currentTarget=null,s=l}else for(i=0;i<r.length;i++){if(l=(o=r[i]).instance,c=o.currentTarget,o=o.listener,l!==s&&a.isPropagationStopped())break e;s=o,a.currentTarget=c;try{s(a)}catch(u){Oi(u)}a.currentTarget=null,s=l}}}}function Au(e,t){var n=t[ze];void 0===n&&(n=t[ze]=new Set);var r=e+"__bubble";n.has(r)||(Ou(t,e,2,!1),n.add(r))}function Tu(e,t,n){var r=0;t&&(r|=4),Ou(n,e,r,t)}var Ru="_reactListening"+Math.random().toString(36).slice(2);function Pu(e){if(!e[Ru]){e[Ru]=!0,Xe.forEach((function(t){"selectionchange"!==t&&(_u.has(t)||Tu(t,!1,e),Tu(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Ru]||(t[Ru]=!0,Tu("selectionchange",!1,t))}}function Ou(e,t,n,r){switch(Jd(t)){case 2:var a=Qd;break;case 8:a=Wd;break;default:a=Vd}n=a.bind(null,t,n,e),a=void 0,!Mt||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(a=!0),r?void 0!==a?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):void 0!==a?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Iu(e,t,n,r,a){var s=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var i=r.tag;if(3===i||4===i){var o=r.stateNode.containerInfo;if(o===a||8===o.nodeType&&o.parentNode===a)break;if(4===i)for(i=r.return;null!==i;){var l=i.tag;if((3===l||4===l)&&((l=i.stateNode.containerInfo)===a||8===l.nodeType&&l.parentNode===a))return;i=i.return}for(;null!==o;){if(null===(i=Ve(o)))return;if(5===(l=i.tag)||6===l||26===l||27===l){r=s=i;continue e}o=o.parentNode}}r=r.return}Lt((function(){var r=s,a=Rt(n),i=[];e:{var o=xr.get(e);if(void 0!==o){var l=Xt,c=e;switch(e){case"keypress":if(0===Ht(n))break e;case"keydown":case"keyup":l=mn;break;case"focusin":c="focus",l=an;break;case"focusout":c="blur",l=an;break;case"beforeblur":case"afterblur":l=an;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=nn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=rn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=gn;break;case pr:case mr:case fr:l=sn;break;case br:l=vn;break;case"scroll":case"scrollend":l=en;break;case"wheel":l=yn;break;case"copy":case"cut":case"paste":l=on;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=fn;break;case"toggle":case"beforetoggle":l=bn}var u=0!==(4&t),d=!u&&("scroll"===e||"scrollend"===e),h=u?null!==o?o+"Capture":null:o;u=[];for(var p,m=r;null!==m;){var f=m;if(p=f.stateNode,5!==(f=f.tag)&&26!==f&&27!==f||null===p||null===h||null!=(f=Ft(m,h))&&u.push($u(m,f,p)),d)break;m=m.return}0<u.length&&(o=new l(o,c,null,n,a),i.push({event:o,listeners:u}))}}if(0===(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(o="mouseover"===e||"pointerover"===e)||n===Tt||!(c=n.relatedTarget||n.fromElement)||!Ve(c)&&!c[Ue])&&(l||o)&&(o=a.window===a?a:(o=a.ownerDocument)?o.defaultView||o.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?Ve(c):null)&&(d=F(c),u=c.tag,c!==d||5!==u&&27!==u&&6!==u)&&(c=null)):(l=null,c=r),l!==c)){if(u=nn,f="onMouseLeave",h="onMouseEnter",m="mou
4se","pointerout"!==e&&"pointerover"!==e||(u=fn,f="onPointerLeave",h="onPointerEnter",m="pointer"),d=null==l?o:Ge(l),p=null==c?o:Ge(c),(o=new u(f,m+"leave",l,n,a)).target=d,o.relatedTarget=p,f=null,Ve(a)===r&&((u=new u(h,m+"enter",c,n,a)).target=p,u.relatedTarget=d,f=u),d=f,l&&c)e:{for(h=c,m=0,p=u=l;p;p=Fu(p))m++;for(p=0,f=h;f;f=Fu(f))p++;for(;0<m-p;)u=Fu(u),m--;for(;0<p-m;)h=Fu(h),p--;for(;m--;){if(u===h||null!==h&&u===h.alternate)break e;u=Fu(u),h=Fu(h)}u=null}else u=null;null!==l&&Mu(i,o,l,u,!1),null!==c&&null!==d&&Mu(i,d,c,u,!0)}if("select"===(l=(o=r?Ge(r):window).nodeName&&o.nodeName.toLowerCase())||"input"===l&&"file"===o.type)var g=Fn;else if(Rn(o))if(Mn)g=Vn;else{g=Qn;var v=Hn}else!(l=o.nodeName)||"input"!==l.toLowerCase()||"checkbox"!==o.type&&"radio"!==o.type?r&&Et(r.elementType)&&(g=Fn):g=Wn;switch(g&&(g=g(e,r))?Pn(i,g,n,a):(v&&v(e,o,r),"focusout"===e&&r&&"number"===o.type&&null!=r.memoizedProps.value&&yt(o,"number",o.value)),v=r?Ge(r):window,e){case"focusin":(Rn(v)||"true"===v.contentEditable)&&(rr=v,ar=r,sr=null);break;case"focusout":sr=ar=rr=null;break;case"mousedown":ir=!0;break;case"contextmenu":case"mouseup":case"dragend":ir=!1,or(i,n,a);break;case"selectionchange":if(nr)break;case"keydown":case"keyup":or(i,n,a)}var y;if(wn)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else An?_n(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(Sn&&"ko"!==n.locale&&(An||"onCompositionStart"!==b?"onCompositionEnd"===b&&An&&(y=Bt()):(zt="value"in(Ut=a)?Ut.value:Ut.textContent,An=!0)),0<(v=Lu(r,b)).length&&(b=new ln(b,e,null,n,a),i.push({event:b,listeners:v}),y?b.data=y:null!==(y=Cn(n))&&(b.data=y))),(y=Nn?function(e,t){switch(e){case"compositionend":return Cn(t);case"keypress":return 32!==t.which?null:(En=!0,kn);case"textInput":return(e=t.data)===kn&&En?null:e;default:return null}}(e,n):function(e,t){if(An)return"compositionend"===e||!wn&&_n(e,t)?(e=Bt(),qt=zt=Ut=null,An=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Sn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(b=Lu(r,"onBeforeInput")).length&&(v=new ln("onBeforeInput","beforeinput",null,n,a),i.push({event:v,listeners:b}),v.data=y)),function(e,t,n,r,a){if("submit"===t&&n&&n.stateNode===a){var s=ju((a[De]||null).action),i=r.submitter;i&&null!==(t=(t=i[De]||null)?ju(t.formAction):i.getAttribute("formAction"))&&(s=t,i=null);var o=new Xt("action","action",null,r,a);e.push({event:o,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(0!==mu){var e=i?Nu(a,i):new FormData(a);ui(n,{pending:!0,data:e,method:a.method,action:s},null,e)}}else"function"===typeof s&&(o.preventDefault(),e=i?Nu(a,i):new FormData(a),ui(n,{pending:!0,data:e,method:a.method,action:s},s,e))},currentTarget:a}]})}}(i,e,r,n,a)}Cu(i,t)}))}function $u(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Lu(e,t){for(var n=t+"Capture",r=[];null!==e;){var a=e,s=a.stateNode;5!==(a=a.tag)&&26!==a&&27!==a||null===s||(null!=(a=Ft(e,n))&&r.unshift($u(e,a,s)),null!=(a=Ft(e,t))&&r.push($u(e,a,s))),e=e.return}return r}function Fu(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function Mu(e,t,n,r,a){for(var s=t._reactName,i=[];null!==n&&n!==r;){var o=n,l=o.alternate,c=o.stateNode;if(o=o.tag,null!==l&&l===r)break;5!==o&&26!==o&&27!==o||null===c||(l=c,a?null!=(c=Ft(n,s))&&i.unshift($u(n,c,l)):a||null!=(c=Ft(n,s))&&i.push($u(n,c,l))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}var Du=/\r\n?/g,Uu=/\u0000|\uFFFD/g;function zu(e){return("string"===typeof e?e:""+e).replace(Du,"\n").replace(Uu,"")}function qu(e,t){return t=zu(t),zu(e)===t}function Bu(){}function Hu(e,t,n,r,a,s){switch(n){case"children":"string"===typeof r?"body"===t||"textarea"===t&&""===r||jt(e,r):("number"===typeof r||"bigint"===typeof r)&&"body"!==t&&jt(e,""+r);break;case"className":ot(e,"class",r);break;case"tabIndex":ot(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":ot(e,n,r);break;case"style":kt(e,r,s);break;case"data":if("object"!==t){ot(e,"data",r);break}case"src":case"href":if(""===r&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==r||"function"===typeof r||"symbol"===typeof r||"boolean"===typeof r){e.removeAttribute(n);break}r=At(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if("function"===typeof r){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"===typeof s&&("formAction"===n?("input"!==t&&Hu(e,t,"name",a.name,a,null),Hu(e,t,"formEncType",a.formEncType,a,null),Hu(e,t,"formMethod",a.formMethod,a,null),Hu(e,t,"formTarget",a.formTarget,a,null)):(Hu(e,t,"encType",a.encType,a,null),Hu(e,t,"method",a.method,a,null),Hu(e,t,"target",a.target,a,null))),null==r||"symbol"===typeof r||"boolean"===typeof r){e.removeAttribute(n);break}r=At(""+r),e.setAttribute(n,r);break;case"onClick":null!=r&&(e.onclick=Bu);break;case"onScroll":null!=r&&Au("scroll",e);break;case"onScrollEnd":null!=r&&Au("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!==typeof r||!("__html"in r))throw Error(i(61));if(null!=(n=r.__html)){if(null!=a.children)throw Error(i(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&"function"!==typeof r&&"symbol"!==typeof r;break;case"muted":e.muted=r&&"function"!==typeof r&&"symbol"!==typeof r;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==r||"function"===typeof r||"boolean"===typeof r||"symbol"===typeof r){e.removeAttribute("xlink:href");break}n=At(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=r&&"function"!==typeof r&&"symbol"!==typeof r?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
4ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&"function"!==typeof r&&"symbol"!==typeof r?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===r?e.setAttribute(n,""):!1!==r&&null!=r&&"function"!==typeof r&&"symbol"!==typeof r?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=r&&"function"!==typeof r&&"symbol"!==typeof r&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":null==r||"function"===typeof r||"symbol"===typeof r||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Au("beforetoggle",e),Au("toggle",e),it(e,"popover",r);break;case"xlinkActuate":lt(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":lt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":lt(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":lt(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":lt(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":lt(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":lt(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":lt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":lt(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":it(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&it(e,n=_t.get(n)||n,r)}}function Qu(e,t,n,r,a,s){switch(n){case"style":kt(e,r,s);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!==typeof r||!("__html"in r))throw Error(i(61));if(null!=(n=r.__html)){if(null!=a.children)throw Error(i(60));e.innerHTML=n}}break;case"children":"string"===typeof r?jt(e,r):("number"===typeof r||"bigint"===typeof r)&&jt(e,""+r);break;case"onScroll":null!=r&&Au("scroll",e);break;case"onScrollEnd":null!=r&&Au("scrollend",e);break;case"onClick":null!=r&&(e.onclick=Bu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:Ze.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),"function"===typeof(s=null!=(s=e[De]||null)?s[n]:null)&&e.removeEventListener(t,s,a),"function"!==typeof r)?n in e?e[n]=r:!0===r?e.setAttribute(n,""):it(e,n,r):("function"!==typeof s&&null!==s&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a)))}}function Wu(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Au("error",e),Au("load",e);var r,a=!1,s=!1;for(r in n)if(n.hasOwnProperty(r)){var o=n[r];if(null!=o)switch(r){case"src":a=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Hu(e,t,r,o,n,null)}}return s&&Hu(e,t,"srcSet",n.srcSet,n,null),void(a&&Hu(e,t,"src",n.src,n,null));case"input":Au("invalid",e);var l=r=o=s=null,c=null,u=null;for(a in n)if(n.hasOwnProperty(a)){var d=n[a];if(null!=d)switch(a){case"name":s=d;break;case"type":o=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":r=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(i(137,t));break;default:Hu(e,t,a,d,n,null)}}return vt(e,r,l,c,u,o,s,!1),void dt(e);case"select":for(s in Au("invalid",e),a=o=r=null,n)if(n.hasOwnProperty(s)&&null!=(l=n[s]))switch(s){case"value":r=l;break;case"defaultValue":o=l;break;case"multiple":a=l;default:Hu(e,t,s,l,n,null)}return t=r,n=o,e.multiple=!!a,void(null!=t?bt(e,!!a,t,!1):null!=n&&bt(e,!!a,n,!0));case"textarea":for(o in Au("invalid",e),r=s=a=null,n)if(n.hasOwnProperty(o)&&null!=(l=n[o]))switch(o){case"value":a=l;break;case"defaultValue":s=l;break;case"children":r=l;break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(i(91));break;default:Hu(e,t,o,l,n,null)}return wt(e,a,s,r),void dt(e);case"option":for(c in n)if(n.hasOwnProperty(c)&&null!=(a=n[c]))if("selected"===c)e.selected=a&&"function"!==typeof a&&"symbol"!==typeof a;else Hu(e,t,c,a,n,null);return;case"dialog":Au("cancel",e),Au("close",e);break;case"iframe":case"object":Au("load",e);break;case"video":case"audio":for(a=0;a<Eu.length;a++)Au(Eu[a],e);break;case"image":Au("error",e),Au("load",e);break;case"details":Au("toggle",e);break;case"embed":case"source":case"link":Au("error",e),Au("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&null!=(a=n[u]))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Hu(e,t,u,a,n,null)}return;default:if(Et(t)){for(d in n)n.hasOwnProperty(d)&&(void 0!==(a=n[d])&&Qu(e,t,d,a,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(null!=(a=n[l])&&Hu(e,t,l,a,n,null))}var Vu=null,Ku=null;
vendor: 19,935 bytes, line 4
4function Gu(e){return 9===e.nodeType?e:e.ownerDocument}function Yu(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ju(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function Xu(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"bigint"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Zu=null;var ed="function"===typeof setTimeout?setTimeout:void 0,td="function"===typeof clearTimeout?clearTimeout:void 0,nd="function"===typeof Promise?Promise:void 0,rd="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof nd?function(e){return nd.resolve(null).then(e).catch(ad)}:ed;function ad(e){setTimeout((function(){throw e}))}function sd(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&8===a.nodeType)if("/$"===(n=a.data)){if(0===r)return e.removeChild(a),void fh(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=a}while(n);fh(t)}function id(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":id(n),We(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function od(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"F!"===t||"F"===t)break;if("/$"===t)return null}}return e}function ld(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}function cd(e,t,n){switch(t=Gu(n),e){case"html":if(!(e=t.documentElement))throw Error(i(452));return e;case"head":if(!(e=t.head))throw Error(i(453));return e;case"body":if(!(e=t.body))throw Error(i(454));return e;default:throw Error(i(451))}}var ud=new Map,dd=new Set;function hd(e){return"function"===typeof e.getRootNode?e.getRootNode():e.ownerDocument}var pd=q.d;q.d={f:function(){var e=pd.f(),t=Mc();return e||t},r:function(e){var t=Ke(e);null!==t&&5===t.tag&&"form"===t.type?hi(t):pd.r(e)},D:function(e){pd.D(e),fd("dns-prefetch",e,null)},C:function(e,t){pd.C(e,t),fd("preconnect",e,t)},L:function(e,t,n){pd.L(e,t,n);var r=md;if(r&&e&&t){var a='link[rel="preload"][as="'+ft(t)+'"]';"image"===t&&n&&n.imageSrcSet?(a+='[imagesrcset="'+ft(n.imageSrcSet)+'"]',"string"===typeof n.imageSizes&&(a+='[imagesizes="'+ft(n.imageSizes)+'"]')):a+='[href="'+ft(e)+'"]';var s=a;switch(t){case"style":s=vd(e);break;case"script":s=xd(e)}ud.has(s)||(e=R({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),ud.set(s,e),null!==r.querySelector(a)||"style"===t&&r.querySelector(yd(s))||"script"===t&&r.querySelector(wd(s))||(Wu(t=r.createElement("link"),"link",e),Je(t),r.head.appendChild(t)))}},m:function(e,t){pd.m(e,t);var n=md;if(n&&e){var r=t&&"string"===typeof t.as?t.as:"script",a='link[rel="modulepreload"][as="'+ft(r)+'"][href="'+ft(e)+'"]',s=a;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=xd(e)}if(!ud.has(s)&&(e=R({rel:"modulepreload",href:e},t),ud.set(s,e),null===n.querySelector(a))){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(wd(s)))return}Wu(r=n.createElement("link"),"link",e),Je(r),n.head.appendChild(r)}}},X:function(e,t){pd.X(e,t);var n=md;if(n&&e){var r=Ye(n).hoistableScripts,a=xd(e),s=r.get(a);s||((s=n.querySelector(wd(a)))||(e=R({src:e,async:!0},t),(t=ud.get(a))&&kd(e,t),Je(s=n.createElement("script")),Wu(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},r.set(a,s))}},S:function(e,t,n){pd.S(e,t,n);var r=md;if(r&&e){var a=Ye(r).hoistableStyles,s=vd(e);t=t||"default";var i=a.get(s);if(!i){var o={loading:0,preload:null};if(i=r.querySelector(yd(s)))o.loading=5;else{e=R({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ud.get(s))&&Sd(e,n);var l=i=r.createElement("link");Je(l),Wu(l,"link",e),l._p=new Promise((function(e,t){l.onload=e,l.onerror=t})),l.addEventListener("load",(function(){o.loading|=1})),l.addEventListener("error",(function(){o.loading|=2})),o.loading|=4,Nd(i,t,r)}i={type:"stylesheet",instance:i,count:1,state:o},a.set(s,i)}}},M:function(e,t){pd.M(e,t);var n=md;if(n&&e){var r=Ye(n).hoistableScripts,a=xd(e),s=r.get(a);s||((s=n.querySelector(wd(a)))||(e=R({src:e,async:!0,type:"module"},t),(t=ud.get(a))&&kd(e,t),Je(s=n.createElement("script")),Wu(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},r.set(a,s))}}};var md="undefined"===typeof document?null:document;function fd(e,t,n){var r=md;if(r&&"string"===typeof t&&t){var a=ft(t);a='link[rel="'+e+'"][href="'+a+'"]',"string"===typeof n&&(a+='[crossorigin="'+n+'"]'),dd.has(a)||(dd.add(a),e={rel:e,crossOrigin:n,href:t},null===r.querySelector(a)&&(Wu(t=r.createElement("link"),"link",e),Je(t),r.head.appendChild(t)))}}function gd(e,t,n,r){var a,s,o,l,c=(c=J.current)?hd(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return"string"===typeof n.precedence&&"string"===typeof n.href?(t=vd(n.href),(r=(n=Ye(c).hoistableStyles).get(t))||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"===typeof n.href&&"string"===typeof n.precedence){e=vd(n.href);var u=Ye(c).hoistableStyles,d=u.get(e);if(d||(c=c.ownerDocument||c,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,d),(u=c.querySelector(yd(e)))&&!u._p&&(d.instance=u,d.state.loading=5),ud.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ud.set(e,n),u||(a=c,s=e,o=n,l=d.state,a.querySelector('link[rel="preload"][as="style"]['+s+"]")?l.loading=1:(s=a.createElement("link"),l.preload=s,s.addEventListener("load",(function(){return l.loading|=1})),s.addEventListener("error",(function(){return l.loading|=2})),Wu(s,"link",o),Je(s),a.head.appendChild(s))))),t&&null===r)throw Error(i(528,""));return d}if(t&&null!==r)throw Error(i(529,""));return null;case"script":return t=n.async,"string"===typeof(n=n.src)&&t&&"function"!==typeof t&&"symbol"!==typeof t?(t=xd(n),(r=(n=Ye(c).hoistableScripts).get(t))||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function vd(e){return'href="'+ft(e)+'"'}function yd(e){return'link[rel="stylesheet"]['+e+"]"}function bd(e){return R({},e,{"data-precedence":e.precedence,precedence:null})}function xd(e){return'[src="'+ft(e)+'"]'}function wd(e){return"script[async]"+e}function jd(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+ft(n.href)+'"]');if(r)return t.instance=r,Je(r),r;var a=R({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return Je(r=(e.ownerDocument||e).createElement("style")),Wu(r,"style",a),Nd(r,n.precedence,e),t.instance=r;case"stylesheet":a=vd(n.href);var s=e.querySelector(yd(a));if(s)return t.state.loading|=4,t.instance=s,Je(s),s;r=bd(n),(a=ud.get(a))&&Sd(r,a),Je(s=(e.ownerDocument||e).createElement("link"));var o=s;return o._p=new Promise((function(e,t){o.onload=e,o.onerror=t})),Wu(s,"link",r),t.state.loading|=4,Nd(s,n.precedence,e),t.instance=s;case"script":return s=xd(n.src),(a=e.querySelector(wd(s)))?(t.instance=a,Je(a),a):(r=n,(a=ud.get(s))&&kd(r=R({},n),a),Je(a=(e=e.ownerDocument||e).createElement("script")),Wu(a,"link",r),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(i(443,t.type))}else"stylesheet"===t.type&&0===(4&t.state.loading)&&(r=t.instance,t.state.loading|=4,Nd(r,n.precedence,e));return t.instance}function Nd(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=r.length?r[r.length-1]:null,s=a,i=0;i<r.length;i++){var o=r[i];if(o.dataset.precedence===t)s=o;else if(s!==a)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function Sd(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function kd(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var Ed=null;function _d(e,t,n){if(null===Ed){var r=new Map,a=Ed=new Map;a.set(n,r)}else(r=(a=Ed).get(n))||(r=new Map,a.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var s=n[a];if(!(s[Qe]||s[Me]||"link"===e&&"stylesheet"===s.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==s.namespaceURI){var i=s.getAttribute(t)||"";i=e+i;var o=r.get(i);o?o.push(s):r.set(i,[s])}}return r}function Cd(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function Ad(e){return"stylesheet"!==e.type||0!==(3&e.state.loading)}var Td=null;function Rd(){}function Pd(){if(this.count--,0===this.count)if(this.stylesheets)Id(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var Od=null;function Id(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,Od=new Map,t.forEach($d,e),Od=null,Pd.call(e))}function $d(e,t){if(!(4&t.state.loading)){var n=Od.get(e);if(n)var r=n.get(null);else{n=new Map,Od.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<a.length;s++){var i=a[s];"LINK"!==i.nodeName&&"not all"===i.getAttribute("media")||(n.set(i.dataset.precedence,i),r=i)}r&&n.set(null,r)}i=(a=t.instance).getAttribute("data-precedence"),(s=n.get(i)||r)===r&&n.set(null,a),n.set(i,a),this.count++,r=Pd.bind(this),a.addEventListener("load",r),a.addEventListener("error",r),s?s.parentNode.insertBefore(a,s.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(a,e.firstChild),t.state.loading|=4}}var Ld={$$typeof:g,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function Fd(e,t,n,r,a,s,i,o){this.tag=1,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Re(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Re(0),this.hiddenUpdates=Re(null),this.identifierPrefix=r,this.onUncaughtError=a,this.onCaughtError=s,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function Md(e,t,n,r,a,s,i,o,l,c,u,d){return e=new Fd(e,t,n,i,o,l,c,d),t=1,!0===s&&(t|=24),s=$l(3,null,null,t),e.current=s,s.stateNode=e,(t=Ua()).refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:r,isDehydrated:n,cache:t},Ao(s),e}function Dd(e){return e?e=Pr:Pr}function Ud(e,t,n,r,a,s){a=Dd(a),null===r.context?r.context=a:r.pendingContext=a,(r=Ro(t)).payload={element:n},null!==(s=void 0===s?null:s)&&(r.callback=s),null!==(n=Po(e,r,t))&&(Pc(n,0,t),Oo(n,e,t))}function zd(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function qd(e,t){zd(e,t),(e=e.alternate)&&zd(e,t)}function Bd(e){if(13===e.tag){var t=Ar(e,67108864);null!==t&&Pc(t,0,67108864),qd(e,67108864)}}var Hd=!0;function Qd(e,t,n,r){var a=T.T;T.T=null;var s=q.p;try{q.p=2,Vd(e,t,n,r)}finally{q.p=s,T.T=a}}function Wd(e,t,n,r){var a=T.T;T.T=null;var s=q.p;try{q.p=8,Vd(e,t,n,r)}finally{q.p=s,T.T=a}}function Vd(e,t,n,r){if(Hd){var a=Kd(r);if(null===a)Iu(e,t,r,Gd,n),ih(e,r);else if(function(e,t,n,r,a){switch(t){case"focusin":return Zd=oh(Zd,e,t,n,r,a),!0;case"dragenter":return eh=oh(eh,e,t,n,r,a),!0;case"mouseover":return th=oh(th,e,t,n,r,a),!0;case"pointerover":var s=a.pointerId;return nh.set(s,oh(nh.get(s)||null,e,t,n,r,a)),!0;case"gotpointercapture":return s=a.pointerId,rh.set(s,oh(rh.get(s)||null,e,t,n,r,a)),!0}return!1}(a,e,t,n,r))r.stopPropagation();else if(ih(e,r),4&t&&-1<sh.indexOf(e)){for(;null!==a;){var s=Ke(a);if(null!==s)switch(s.tag){case 3:if((s=s.stateNode).current.memoizedState.isDehydrated){var i=ke(s.pendingLanes);if(0!==i){var o=s;for(o.pendingLanes|=2,o.entangledLanes|=2;i;){var l=1<<31-xe(i);o.entanglements[1]|=l,i&=~l}fu(s),0===(6&ec)&&(xc=le()+500,gu(0,!1))}}break;case 13:null!==(o=Ar(s,2))&&Pc(o,0,2),Mc(),qd(s,2)}if(null===(s=Kd(r))&&Iu(e,t,r,Gd,n),s===a)break;a=s}null!==a&&r.stopPropagation()}else Iu(e,t,r,null,n)}}function Kd(e){return Yd(e=Rt(e))}var Gd=null;function Yd(e){if(Gd=null,null!==(e=Ve(e))){var t=F(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=M(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Gd=e,null}function Jd(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ce()){case ue:return 2;case de:return 8;case he:case pe:return 32;case me:return 268435456;default:return 32}default:return 32}}var Xd=!1,Zd=null,eh=null,th=null,nh=new Map,rh=new Map,ah=[],sh="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ih(e,t){switch(e){case"focusin":case"focusout":Zd=null;break;case"dragenter":case"dragleave":eh=null;break;case"mouseover":case"mouseout":th=null;break;case"pointerover":case"pointerout":nh.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":rh.delete(t.pointerId)}}function oh(e,t,n,r,a,s){return null===e||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[a]},null!==t&&(null!==(t=Ke(t))&&Bd(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==a&&-1===t.indexOf(a)&&t.push(a),e)}function lh(e){var t=Ve(e.target);if(null!==t){var n=F(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=M(n)))return e.blockedOn=t,void function(e,t){var n=q.p;try{return q.p=e,t()}finally{q.p=n}}(e.priority,(function(){if(13===n.tag){var e=Tc(),t=Ar(n,e);null!==t&&Pc(t,0,e),qd(n,e)}}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function ch(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Kd(e.nativeEvent);if(null!==n)return null!==(t=Ke(n))&&Bd(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);Tt=r,n.target.dispatchEvent(r),Tt=null,t.shift()}return!0}function uh(e,t,n){ch(e)&&n.delete(t)}function dh(){Xd=!1,null!==Zd&&ch(Zd)&&(Zd=null),null!==eh&&ch(eh)&&(eh=null),null!==th&&ch(th)&&(th=null),nh.forEach(uh),rh.forEach(uh)}function hh(e,t){e.blockedOn===t&&(e.blockedOn=null,Xd||(Xd=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,dh)))}var ph=null;function mh(e){ph!==e&&(ph=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,(function(){ph===e&&(ph=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],a=e[t+2];if("function"!==typeof r){if(null===Yd(r||n))continue;break}var s=Ke(n);null!==s&&(e.splice(t,3),t-=3,ui(s,{pending:!0,data:a,method:n.method,action:r},r,a))}})))}function fh(e){function t(t){return hh(t,e)}null!==Zd&&hh(Zd,e),null!==eh&&hh(eh,e),null!==th&&hh(th,e),nh.forEach(t),rh.forEach(t);for(var n=0;n<ah.length;n++){var r=ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<ah.length&&null===(n=ah[0]).blockedOn;)lh(n),null===n.blockedOn&&ah.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(r=0;r<n.length;r+=3){var a=n[r],s=n[r+1],i=a[De]||null;if("function"===typeof s)i||mh(n);else if(i){var o=null;if(s&&s.hasAttribute("formAction")){if(a=s,i=s[De]||null)o=i.formAction;else if(null!==Yd(a))continue}else o=i.action;"function"===typeof o?n[r+1]=o:(n.splice(r,3),r-=3),mh(n)}}}function vh(e){this._internalRoot=e}function yh(e){this._internalRoot=e}yh.prototype.render=vh.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(i(409));Ud(t.current,Tc(),e,t,null,null)},yh.prototype.unmount=vh.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;0===e.tag&&tu(),Ud(e.current,2,null,e,null,null),Mc(),t[Ue]=null}},yh.prototype.unstable_scheduleHydration=function(e){if(e){var t=Le();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ah.length&&0!==t&&t<ah[n].priority;n++);ah.splice(n,0,e),0===n&&lh(e)}};var bh=a.version;if("19.0.0"!==bh)throw Error(i(527,bh,"19.0.0"));q.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(i(188));throw e=Object.keys(e).join(","),Error(i(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=F(e)))throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(null===a)break;var s=a.alternate;if(null===s){if(null!==(r=a.return)){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return D(a),e;if(s===r)return D(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var o=!1,l=a.child;l;){if(l===n){o=!0,n=a,r=s;break}if(l===r){o=!0,r=a,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,r=a;break}if(l===r){o=!0,r=s,n=a;break}l=l.sibling}if(!o)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(3!==n.tag)throw Error(i(188));return n.stateNode.current===n?e:t}(t),e=null===(e=null!==e?U(e):null)?null:e.stateNode};var xh={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:T,findFiberByHostInstance:Ve,reconcilerVersion:"19.0.0"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var wh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wh.isDisabled&&wh.supportsFiber)try{ve=wh.inject(xh),ye=wh}catch(jh){}}t.createRoot=function(e,t){if(!o(e))throw Error(i(299));var n=!1,r="",a=Ii,s=$i,l=Li;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onUncaughtError&&(a=t.onUncaughtError),void 0!==t.onCaughtError&&(s=t.onCaughtError),void 0!==t.onRecoverableError&&(l=t.onRecoverableError),void 0!==t.unstable_transitionCallbacks&&t.unstable_transitionCallbacks),t=Md(e,1,!1,null,0,n,r,a,s,l,0,null),e[
4Ue]=t.current,Pu(8===e.nodeType?e.parentNode:e),new vh(t)},t.hydrateRoot=function(e,t,n){if(!o(e))throw Error(i(299));var r=!1,a="",s=Ii,l=$i,c=Li,u=null;return null!==n&&void 0!==n&&(!0===n.unstable_strictMode&&(r=!0),void 0!==n.identifierPrefix&&(a=n.identifierPrefix),void 0!==n.onUncaughtError&&(s=n.onUncaughtError),void 0!==n.onCaughtError&&(l=n.onCaughtError),void 0!==n.onRecoverableError&&(c=n.onRecoverableError),void 0!==n.unstable_transitionCallbacks&&n.unstable_transitionCallbacks,void 0!==n.formState&&(u=n.formState)),(t=Md(e,1,!0,t,0,r,a,s,l,c,0,u)).context=Dd(null),n=t.current,(a=Ro(r=Tc())).callback=null,Po(n,a,r),t.current.lanes=r,Pe(t,r),fu(t),e[Ue]=t.current,Pu(e),new yh(t)},t.version="19.0.0"},43:(e,t,n)=>{e.exports=n(288)},135:()=>{},175:(e,t)=>{const n=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,r=/^[\u0021-\u003A\u003C-\u007E]*$/,a=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,s=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,o=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function l(e,t,n){do{const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<n);return n}function c(e,t,n){for(;t>n;){const n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return n}function u(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(gh){return e}}},202:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});n(43);var r=n(419),a=(n(688),n(579));const s=e=>{let{animes:t,layout:n="horizontal"}=e;return t&&Array.isArray(t)?(console.log(`AnimeCardsGrid received ${t.length} anime items`),t.length>0&&console.log("First anime item:",t[0]),(0,a.jsx)("div",{className:"anime-cards-grid",children:t.map(((e,t)=>{const s=e&&e.id?e.id:`anime-item-${t}`;return(0,a.jsx)(r.default,{anime:e,layout:n},s)}))})):(console.error("Invalid animes array provided to AnimeCardsGrid:",t),(0,a.jsx)("div",{className:"anime-cards-grid",children:(0,a.jsx)("div",{className:"no-data-card",children:"No anime data available"})}))}},219:(e,t,n)=>{var r=n(763),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},s={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};function l(e){return r.isMemo(e)?i:o[e.$$typeof]||a}o[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(m){var a=p(n);a&&a!==m&&e(t,a,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var o=l(t),f=l(n),g=0;g<i.length;++g){var v=i[g];if(!s[v]&&(!r||!r[v])&&(!f||!f[v])&&(!o||!o[v])){var y=h(n,v);try{c(t,v,y)}catch(gh){}}}}return t}},288:(e,t)=>{var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,g={};function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}function y(){}function b(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=v.prototype;var x=b.prototype=new y;x.constructor=b,f(x,v.prototype),x.isPureReactComponent=!0;var w=Array.isArray,j={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function S(e,t,r,a,s,i){return r=i.ref,{$$typeof:n,type:e,key:t,ref:void 0!==r?r:null,props:i}}function k(e){return"object"===typeof e&&null!==e&&e.$$typeof===n}var E=/\/+/g;function _(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function C(){}function A(e,t,a,s,i){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var l,c,u=!1;if(null===e)u=!0;else switch(o){case"bigint":case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case n:case r:u=!0;break;case h:return A((u=e._init)(e._payload),t,a,s,i)}}if(u)return i=i(e),u=""===s?"."+_(e,0):s,w(i)?(a="",null!=u&&(a=u.replace(E,"$&/")+"/"),A(i,t,a,"",(function(e){return e}))):null!=i&&(k(i)&&(l=i,c=a+(null==i.key||e&&e.key===i.key?"":(""+i.key).replace(E,"$&/")+"/")+u,i=S(l.type,c,void 0,0,0,l.props)),t.push(i)),1;u=0;var d,m=""===s?".":s+":";if(w(e))for(var f=0;f<e.length;f++)u+=A(s=e[f],t,a,o=m+_(s,f),i);else if("function"===typeof(f=null===(d=e)||"object"!==typeof d?null:"function"===typeof(d=p&&d[p]||d["@@iterator"])?d:null))for(e=f.call(e),f=0;!(s=e.next()).done;)u+=A(s=s.value,t,a,o=m+_(s,f++),i);else if("object"===o){if("function"===typeof e.then)return A(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"===typeof e.status?e.then(C,C):(e.status="pending",e.then((function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)}),(function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)}))),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,a,s,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return u}function T(e,t,n){if(null==e)return e;var r=[],a=0;return A(e,r,"","",(function(e){return t.call(n,e,a++)})),r}function R(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var P="function"===typeof reportError?reportError:function(e){if("object"===typeof window&&"function"===typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"===typeof e&&null!==e&&"string"===typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"===typeof process&&"function"===typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function O(){}t.Children={map:T,forEach:function(e,t,n){T(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return T(e,(function(){t++})),t},toArray:function(e){return T(e,(function(e){return e}))||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=v,t.Fragment=a,t.Profiler=i,t.PureComponent=b,t.StrictMode=s,t.Suspense=u,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,t.act=function(){throw Error("act(...) is not supported in production builds of React.")},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error("The argument must be a React element, but you passed "+e+".");var r=f({},e.props),a=e.key;if(null!=t)for(s in void 0!==t.ref&&void 0,void 0!==t.key&&(a=""+t.key),t)!N.call(t,s)||"key"===s||"__self"===s||"__source"===s||"ref"===s&&void 0===t.ref||(r[s]=t[s]);var s=arguments.length-2;if(1===s)r.children=n;else if(1<s){for(var i=Array(s),o=0;o<s;o++)i[o]=arguments[o+2];r.children=i}return S(e.type,a,void 0,0,0,r)},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:o,_context:e},e},t.createElement=function(e,t,n){var r,a={},s=null;
4if(null!=t)for(r in void 0!==t.key&&(s=""+t.key),t)N.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(a[r]=t[r]);var i=arguments.length-2;if(1===i)a.children=n;else if(1<i){for(var o=Array(i),l=0;l<i;l++)o[l]=arguments[l+2];a.children=o}if(e&&e.defaultProps)for(r in i=e.defaultProps)void 0===a[r]&&(a[r]=i[r]);return S(e,s,void 0,0,0,a)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=k,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:R}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=j.T,n={};j.T=n;try{var r=e(),a=j.S;null!==a&&a(n,r),"object"===typeof r&&null!==r&&"function"===typeof r.then&&r.then(O,P)}catch(s){P(s)}finally{j.T=t}},t.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},t.use=function(e){return j.H.use(e)},t.useActionState=function(e,t,n){return j.H.useActionState(e,t,n)},t.useCallback=function(e,t){return j.H.useCallback(e,t)},t.useContext=function(e){return j.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return j.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return j.H.useEffect(e,t)},t.useId=function(){return j.H.useId()},t.useImperativeHandle=function(e,t,n){return j.H.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return j.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return j.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return j.H.useMemo(e,t)},t.useOptimistic=function(e,t){return j.H.useOptimistic(e,t)},t.useReducer=function(e,t,n){return j.H.useReducer(e,t,n)},t.useRef=function(e){return j.H.useRef(e)},t.useState=function(e){return j.H.useState(e)},t.useSyncExternalStore=function(e,t,n){return j.H.useSyncExternalStore(e,t,n)},t.useTransition=function(){return j.H.useTransition()},t.version="19.0.0"},391:(e,t,n)=>{!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(4)},419:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=n(43),a=n(675),s=(n(688),n(914)),i=(n(135),n(579));const o=e=>{var t,n,o,l,c,u,d,h,p,m,f,g,v,y;let{anime:b,layout:x="horizontal"}=e;const w=(0,r.useRef)(null);if(!b||"object"!==typeof b)return console.error("Invalid anime object provided to AnimeCard:",b),(0,i.jsx)("div",{className:"anime-card error-card",children:"Invalid anime data"});const j=b.id||b.mal_id||"unknown";console.log("Anime properties:",Object.keys(b)),"unknown"===j&&console.warn("Anime card missing ID property:",b);const N=null!==(t=b.score)&&void 0!==t?t:0,S=null!==(n=b.episodes)&&void 0!==n?n:"-",k=null!==(o=b.status)&&void 0!==o?o:"N/A",E=null!==(l=b.type)&&void 0!==l?l:"N/A",_=null!==(c=b.rank)&&void 0!==c?c:"N/A",C=null!==(u=b.popularity)&&void 0!==u?u:"N/A",A=b.season?(T=b.season)?T.charAt(0).toUpperCase()+T.slice(1):T:null;var T;const R=null!==(d=b.year)&&void 0!==d?d:"N/A",P=null!==(h=b.rating)&&void 0!==h?h:null,O=P&&(P.includes("R")||P.includes("Rx")||P.includes("Mild Nudity")),I=(null===(p=b.images)||void 0===p||null===(m=p.webp)||void 0===m?void 0:m.large_image_url)||(null===(f=b.images)||void 0===f||null===(g=f.jpg)||void 0===g?void 0:g.large_image_url)||(null===(v=b.images)||void 0===v||null===(y=v.webp)||void 0===y?void 0:y.image_url)||b.image||"/default-anime.jpg";return(0,i.jsx)("div",{className:"anime-card card-horizontal",ref:w,children:(0,i.jsxs)(a.N_,{to:`/anime/${j}`,className:"card-link",children:[(0,i.jsxs)("div",{className:"card-image-container",children:[(0,i.jsx)(s.A,{src:I,alt:b.title||"Anime",className:"card-image",fallbackSrc:"/default-anime.jpg"}),(0,i.jsxs)("div",{className:"rating-badge",children:["\u2b50 ",N]}),O&&(0,i.jsx)("div",{className:"r-badge",title:P,children:"R"})]}),(0,i.jsxs)("div",{className:"card-content",children:[(0,i.jsxs)("div",{className:"metadata-content",children:[(0,i.jsx)("h3",{className:"card-title",children:b.titleEnglish||b.title||"Unknown Title"}),(0,i.jsxs)("div",{className:"metadata-line",children:[(0,i.jsxs)("span",{className:"metadata-item",children:[(0,i.jsx)("span",{className:"metadata-label",children:"Type:"}),(0,i.jsx)("span",{className:"metadata-value",children:E})]}),(0,i.jsx)("span",{className:"metadata-divider",children:"\u2022"}),(0,i.jsxs)("span",{className:"metadata-item",children:[(0,i.jsx)("span",{className:"metadata-label",children:"Episodes:"}),(0,i.jsx)("span",{className:"metadata-value",children:S})]})]}),(0,i.jsxs)("div",{className:"metadata-line mobile-hide",children:[(0,i.jsxs)("span",{className:"metadata-item",children:[(0,i.jsx)("span",{className:"metadata-label",children:"Status:"}),(0,i.jsx)("span",{className:"metadata-value "+("Currently Airing"===k?"live-status":""),children:k})]}),A&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"metadata-divider",children:"\u2022"}),(0,i.jsxs)("span",{className:"metadata-item",children:[(0,i.jsx)("span",{className:"metadata-label",children:"Season:"}),(0,i.jsxs)("span",{className:"metadata-value",children:[A," ",R]})]})]})]})]}),(0,i.jsxs)("div",{className:"metadata-footer mobile-hide",children:[(0,i.jsxs)("span",{className:"rank-badge",children:["Rank #",_]}),(0,i.jsxs)("span",{className:"popularity-badge",children:["Popularity #",C]})]})]})]})})}},486:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=n(43),a=n(675),s=n(914),i=(n(135),n(579));const o=e=>{var t,n,o,l,c,u,d,h,p,m,f;let{character:g,animeStore:v={}}=e;const y=(0,r.useRef)(null);if(!g||"object"!==typeof g)return console.error("Invalid character object provided to CharacterCard:",g),(0,i.jsx)("div",{className:"character-card error-card",children:"Invalid character data"});const b=g._id||g.id||g.mal_id||"unknown";"unknown"===b&&console.warn("Character card missing ID property:",g);const x=null!==(t=g.favorites)&&void 0!==t?t:"N/A",w=null!==(n=g.name_kanji)&&void 0!==n?n:"",j=Array.isArray(g.anime)?g.anime:[],N=Array.isArray(g.manga)?g.manga:[],S=(()=>
4{if(0===j.length)return null;try{let t=j[0],n=Number.MAX_SAFE_INTEGER,r=0,a=0;for(const s of j){var e;if(null===(e=s.anime)||void 0===e||!e.mal_id)continue;const i=v[s.anime.mal_id];i&&(i.popularity&&i.popularity<n?(t=s,n=i.popularity):n===Number.MAX_SAFE_INTEGER&&i.members&&i.members>r?(t=s,r=i.members):n===Number.MAX_SAFE_INTEGER&&0===r&&i.favorites&&i.favorites>a&&(t=s,a=i.favorites))}return t}catch(t){return console.error("Error finding most popular anime:",t),j[0]}})(),k=N.length>0?N[0]:null,E=(()=>{if(S&&S.anime){const e=S.anime;return e.title_english||e.title||"N/A"}return"N/A"})(),_=(()=>{if(k&&k.manga){const e=k.manga;return e.title_english||e.title||"N/A"}return"N/A"})(),C=S&&S.role?S.role:k&&k.role?k.role:"N/A",A=null!==(o=g.age)&&void 0!==o?o:"Unknown",T=g.height?`${g.height} cm`:"Unknown",R=(null===(l=g.images)||void 0===l||null===(c=l.webp)||void 0===c?void 0:c.imageUrl)||(null===(u=g.images)||void 0===u||null===(d=u.webp)||void 0===d?void 0:d.image_url)||(null===(h=g.images)||void 0===h||null===(p=h.jpg)||void 0===p?void 0:p.imageUrl)||(null===(m=g.images)||void 0===m||null===(f=m.jpg)||void 0===f?void 0:f.image_url)||"/default-character.jpg",P="N/A"!==E?E:_,O="N/A"!==E?E:_;return(0,i.jsx)("div",{className:"character-card card-horizontal",ref:y,children:(0,i.jsxs)(a.N_,{to:`/characters/${b}`,className:"card-link",children:[(0,i.jsxs)("div",{className:"card-image-container",children:[(0,i.jsx)(s.A,{src:R,alt:g.name||"Character",className:"card-image",fallbackSrc:"/default-character.jpg"}),(0,i.jsxs)("div",{className:"favorites-badge",children:["\u2764\ufe0f"," ","number"===typeof x?x.toLocaleString():x]})]}),(0,i.jsxs)("div",{className:"card-content",children:[(0,i.jsxs)("div",{className:"metadata-content",children:[(0,i.jsx)("h3",{className:"card-title",children:g.name||"Unknown Character"}),w&&(0,i.jsx)("div",{className:"name-kanji",children:w}),(0,i.jsx)("div",{className:"metadata-line",children:(0,i.jsxs)("span",{className:"metadata-item",children:[(0,i.jsx)("span",{className:"metadata-label",children:"Role:"}),(0,i.jsx)("span",{className:"metadata-value",children:C})]})}),(0,i.jsx)("div",{className:"metadata-line mobile-hide",children:(0,i.jsxs)("span",{className:"metadata-item",children:[(0,i.jsx)("span",{className:"metadata-label",children:"Appears in:"}),(0,i.jsx)("span",{className:"metadata-value",title:O,children:P})]})})]}),(0,i.jsxs)("div",{className:"metadata-footer",children:[(0,i.jsxs)("span",{className:"metadata-item",children:[(0,i.jsx)("span",{className:"metadata-label",children:"Age:"}),(0,i.jsx)("span",{className:"metadata-value",children:A})]}),(0,i.jsx)("span",{className:"metadata-divider",children:"\u2022"}),(0,i.jsxs)("span",{className:"metadata-item",children:[(0,i.jsx)("span",{className:"metadata-label",children:"Height:"}),(0,i.jsx)("span",{className:"metadata-value",children:T})]})]})]})]})})}},579:(e,t,n)=>{e.exports=n(799)},672:(e,t,n)=>{var r=n(43);function a(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var i={d:{f:s,r:function(){throw Error(a(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");var l=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){return"font"===e?"":"string"===typeof t?"use-credentials"===t?t:"":void 0}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(a(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:o,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},t.preconnect=function(e,t){"string"===typeof e&&(t?t="string"===typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,i.d.C(e,t))},t.prefetchDNS=function(e){"string"===typeof e&&i.d.D(e)},t.preinit=function(e,t){if("string"===typeof e&&t&&"string"===typeof t.as){var n=t.as,r=c(n,t.crossOrigin),a="string"===typeof t.integrity?t.integrity:void 0,s="string"===typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?i.d.S(e,"string"===typeof t.precedence?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:s}):"script"===n&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:s,nonce:"string"===typeof t.nonce?t.nonce:void 0})}},t.preinitModule=function(e,t){if("string"===typeof e)if("object"===typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:"string"===typeof t.integrity?t.integrity:void 0,nonce:"string"===typeof t.nonce?t.nonce:void 0})}}else null==t&&i.d.M(e)},t.preload=function(e,t){if("string"===typeof e&&"object"===typeof t&&null!==t&&"string"===typeof t.as){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:"string"===typeof t.integrity?t.integrity:void 0,nonce:"string"===typeof t.nonce?t.nonce:void 0,type:"string"===typeof t.type?t.type:void 0,fetchPriority:"string"===typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"str
4ing"===typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"===typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"===typeof t.imageSizes?t.imageSizes:void 0,media:"string"===typeof t.media?t.media:void 0})}},t.preloadModule=function(e,t){if("string"===typeof e)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:"string"===typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"===typeof t.integrity?t.integrity:void 0})}else i.d.m(e)},t.requestFormReset=function(e){i.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},t.useFormStatus=function(){return l.H.useHostTransitionStatus()},t.version="19.0.0"},675:(e,t,n)=>{n.d(t,{BV:()=>be,C5:()=>ge,Kd:()=>et,N_:()=>nt,Zp:()=>ee,g:()=>te,k2:()=>rt,ok:()=>ot,qh:()=>ve,zy:()=>J});var r=n(43),a=(n(175),"popstate");function s(){return h((function(e,t){let{pathname:n,search:r,hash:a}=e.location;return c("",{pathname:n,search:r,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"===typeof t?t:u(t)}),null,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}function i(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function o(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(gh){}}}function l(e,t){return{usr:e.state,key:e.key,idx:t}}function c(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return{pathname:"string"===typeof e?e:e.pathname,search:"",hash:"",..."string"===typeof t?d(t):t,state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10)}}function u(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 d(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function h(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},{window:s=document.defaultView,v5Compat:o=!1}=r,d=s.history,h="POP",p=null,m=f();function f(){return(d.state||{idx:null}).idx}function g(){h="POP";let e=f(),t=null==e?null:e-m;m=e,p&&p({action:h,location:y.location,delta:t})}function v(e){let t="null"!==s.location.origin?s.location.origin:s.location.href,n="string"===typeof e?e:u(e);return n=n.replace(/ $/,"%20"),i(t,`No window.location.(origin|href) available to create URL for href: ${n}`),new URL(n,t)}null==m&&(m=0,d.replaceState({...d.state,idx:m},""));let y={get action(){return h},get location(){return e(s,d)},listen(e){if(p)throw new Error("A history only accepts one active listener");return s.addEventListener(a,g),p=e,()=>{s.removeEventListener(a,g),p=null}},createHref:e=>t(s,e),createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){h="PUSH";let r=c(y.location,e,t);n&&n(r,e),m=f()+1;let a=l(r,m),i=y.createHref(r);try{d.pushState(a,"",i)}catch(u){if(u instanceof DOMException&&"DataCloneError"===u.name)throw u;s.location.assign(i)}o&&p&&p({action:h,location:y.location,delta:1})},replace:function(e,t){h="REPLACE";let r=c(y.location,e,t);n&&n(r,e),m=f();let a=l(r,m),s=y.createHref(r);d.replaceState(a,"",s),o&&p&&p({action:h,location:y.location,delta:0})},go:e=>d.go(e)};return y}function p(e,t){return m(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/",!1)}function m(e,t,n,r){let a=C(("string"===typeof t?d(t):t).pathname||"/",n);if(null==a)return null;let s=f(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(s);let i=null;for(let o=0;null==i&&o<s.length;++o){let e=_(a);i=k(s[o],e,r)}return i}function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=(e,a,s)=>{let o={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};o.relativePath.startsWith("/")&&(i(o.relativePath.startsWith(r),`Absolute route path "${o.relativePath}" nested under path "${r}
4" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let l=O([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(i(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),f(e.children,t,c,l)),(null!=e.path||e.index)&&t.push({path:l,score:S(l,e.index),routesMeta:c})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of g(e.path))a(e,t,n);else a(e,t)})),t}function g(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,a=n.endsWith("?"),s=n.replace(/\?$/,"");if(0===r.length)return a?[s,""]:[s];let i=g(r.join("/")),o=[];return o.push(...i.map((e=>""===e?s:[s,e].join("/")))),a&&o.push(...i),o.map((t=>e.startsWith("/")&&""===t?"/":t))}var v=/^:[\w-]+$/,y=3,b=2,x=1,w=10,j=-2,N=e=>"*"===e;function S(e,t){let n=e.split("/"),r=n.length;return n.some(N)&&(r+=j),t&&(r+=b),n.filter((e=>!N(e))).reduce(((e,t)=>e+(v.test(t)?y:""===t?x:w)),r)}function k(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],{routesMeta:r}=e,a={},s="/",i=[];for(let o=0;o<r.length;++o){let e=r[o],l=o===r.length-1,c="/"===s?t:t.slice(s.length)||"/",u=E({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=E({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;
4Object.assign(a,u.params),i.push({params:a,pathname:O([s,u.pathname]),pathnameBase:I(O([s,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(s=O([s,u.pathnameBase]))}return i}function E(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];o("*"===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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(r.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))");let s=new RegExp(a,t?void 0:"i");return[s,r]}(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let s=a[0],i=s.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce(((e,t,n)=>{let{paramName:r,isOptional:a}=t;if("*"===r){let e=l[n]||"";i=s.slice(0,s.length-e.length).replace(/(.)\/+$/,"$1")}const o=l[n];return e[r]=a&&!o?void 0:(o||"").replace(/%2F/g,"/"),e}),{}),pathname:s,pathnameBase:i,pattern:e}}function _(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return o(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function C(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 A(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 T(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function R(e){let t=T(e);return t.map(((e,n)=>n===t.length-1?e.pathname:e.pathnameBase))}function P(e,t,n){let r,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];"string"===typeof e?r=d(e):(r={...e},i(!r.pathname||!r.pathname.includes("?"),A("?","pathname","search",r)),i(!r.pathname||!r.pathname.includes("#"),A("#","pathname","hash",r)),i(!r.search||!r.search.includes("#"),A("#","search","hash",r)));let s,o=""===e||""===r.pathname,l=o?"/":r.pathname;if(null==l)s=n;else{let e=t.length-1;if(!a&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}s=e>=0?t[e]:"/"}let c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",{pathname:n,search:r="",hash:a=""}="string"===typeof e?d(e):e,s=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:s,search:$(r),hash:L(a)}}(r,s),u=l&&"/"!==l&&l.endsWith("/"),h=(o||"."===l)&&n.endsWith("/");return c.pathname.endsWith("/")||!u&&!h||(c.pathname+="/"),c}var O=e=>e.join("/").replace(/\/\/+/g,"/"),I=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",L=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";function F(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}var M=["POST","PUT","PATCH","DELETE"],D=(new Set(M),["GET",...M]);new Set(D),Symbol("ResetLoaderData");var U=r.createContext(null);U.displayName="DataRouter";var z=r.createContext(null);z.displayName="DataRouterState";var q=r.createContext({isTransitioning:!1});q.displayName="ViewTransition";var B=r.createContext(new Map);B.displayName="Fetchers";var H=r.createContext(null);H.displayName="Await";var Q=r.createContext(null);Q.displayName="Navigation";var W=r.createContext(null);W.displayName="Location";var V=r.createContext({outlet:null,matches:[],isDataRoute:!1});V.displayName="Route";var K=r.createContext(null);K.displayName="RouteError";var G=!0;function Y(){return null!=r.useContext(W)}function J(){return i(Y(),"useLocation() may be used only in the context of a <Router> component."),r.useContext(W).location}var X="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Z(e){r.useContext(Q).static||r.useLayoutEffect(e)}function ee(){let{isDataRoute:e}=r.useContext(V);return e?function(){let{router:e}=ue("useNavigate"),t=he("useNavigate"),n=r.useRef(!1);Z((()=>{n.current=!0}));let a=r.useCallback((async function(r){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(n.current,X),n.current&&("number"===typeof r?e.navigate(r):await e.navigate(r,{fromRouteId:t,...a}))}),[e,t]);return a}():function(){i(Y(),"useNavigate() may be used only in the context of a <Router> component.");let e=r.useContext(U),{basename:t,navigator:n}=r.useContext(Q),{matches:a}=r.useContext(V),{pathname:s}
4=J(),l=JSON.stringify(R(a)),c=r.useRef(!1);Z((()=>{c.current=!0}));let u=r.useCallback((function(r){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(o(c.current,X),!c.current)return;if("number"===typeof r)return void n.go(r);let i=P(r,JSON.parse(l),s,"path"===a.relative);null==e&&"/"!==t&&(i.pathname="/"===i.pathname?t:O([t,i.pathname])),(a.replace?n.replace:n.push)(i,a.state,a)}),[t,n,l,s,e]);return u}()}r.createContext(null);function te(){let{matches:e}=r.useContext(V),t=e[e.length-1];return t?t.params:{}}function ne(e){let{relative:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{matches:n}=r.useContext(V),{pathname:a}=J(),s=JSON.stringify(R(n));return r.useMemo((()=>P(e,JSON.parse(s),a,"path"===t)),[e,s,a,t])}function re(e,t,n,a){i(Y(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s,static:l}=r.useContext(Q),{matches:c}=r.useContext(V),u=c[c.length-1],h=u?u.params:{},m=u?u.pathname:"/",f=u?u.pathnameBase:"/",g=u&&u.route;if(G){let e=g&&g.path||"";fe(m,!g||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let v,y=J();if(t){let e="string"===typeof t?d(t):t;i("/"===f||e.pathname?.startsWith(f),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${e.pathname}" was given in the \`location\` prop.`),v=e}else v=y;let b=v.pathname||"/",x=b;if("/"!==f){let e=f.replace(/^\//,"").split("/");x="/"+b.replace(/^\//,"").split("/").slice(e.length).join("/")}let w=!l&&n&&n.matches&&n.matches.length>0?n.matches:p(e,{pathname:x});G&&(o(g||null!=w,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),o(null==w||void 0!==w[w.length-1].route.element||void 0!==w[w.length-1].route.Component||void 0!==w[w.length-1].route.lazy,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let j=le(w&&w.map((e=>Object.assign({},e,{params:Object.assign({},h,e.params),pathname:O([f,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?f:O([f,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),c,n,a);return t&&j?r.createElement(W.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},j):j}function ae(){let e=pe(),t=F(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:a},i={padding:"2px 4px",backgroundColor:a},o=null;return G&&(console.error("Error handled by React Router default ErrorBoundary:",e),o=r.createElement(r.Fragment,null,r.createElement("p",null,"\ud83d\udcbf Hey developer \ud83d\udc4b"),r.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",r.createElement("code",{style:i},"ErrorBoundary")," or"," ",r.createElement("code",{style:i},"errorElement")," prop on your route."))),r.createElement(r.Fragment,null,r.createElement("h2",null,"Unexpected Application Error!"),r.createElement("h3",{style:{fontStyle:"italic"}},t),n?r.createElement("pre",{style:s},n):null,o)}var se=r.createElement(ae,null),ie=class extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?r.createElement(V.Provider,{value:this.props.routeContext},r.createElement(K.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};
4function oe(e){let{routeContext:t,match:n,children:a}=e,s=r.useContext(U);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),r.createElement(V.Provider,{value:t},a)}function le(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(null==e){if(!n)return null;if(n.errors)e=n.matches;else{if(0!==t.length||n.initialized||!(n.matches.length>0))return null;e=n.matches}}let a=e,s=n?.errors;if(null!=s){let e=a.findIndex((e=>e.route.id&&void 0!==s?.[e.route.id]));i(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),a=a.slice(0,Math.min(a.length,e+1))}let o=!1,l=-1;if(n)for(let r=0;r<a.length;r++){let e=a[r];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(l=r),e.route.id){let{loaderData:t,errors:r}=n,s=e.route.loader&&!t.hasOwnProperty(e.route.id)&&(!r||void 0===r[e.route.id]);if(e.route.lazy||s){o=!0,a=l>=0?a.slice(0,l+1):[a[0]];break}}}return a.reduceRight(((e,i,c)=>{let u,d=!1,h=null,p=null;n&&(u=s&&i.route.id?s[i.route.id]:void 0,h=i.route.errorElement||se,o&&(l<0&&0===c?(fe("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):l===c&&(d=!0,p=i.route.hydrateFallbackElement||null)));let m=t.concat(a.slice(0,c+1)),f=()=>{let t;return t=u?h:d?p:i.route.Component?r.createElement(i.route.Component,null):i.route.element?i.route.element:e,r.createElement(oe,{match:i,routeContext:{outlet:e,matches:m,isDataRoute:null!=n},children:t})};return n&&(i.route.ErrorBoundary||i.route.errorElement||0===c)?r.createElement(ie,{location:n.location,revalidation:n.revalidation,component:h,error:u,children:f(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):f()}),null)}function ce(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ue(e){let t=r.useContext(U);return i(t,ce(e)),t}function de(e){let t=r.useContext(z);return i(t,ce(e)),t}function he(e){let t=function(e){let t=r.useContext(V);return i(t,ce(e)),t}(e),n=t.matches[t.matches.length-1];return i(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function pe(){let e=r.useContext(K),t=de("useRouteError"),n=he("useRouteError");return void 0!==e?e:t.errors?.[n]}var me={};function fe(e,t,n){t||me[e]||(me[e]=!0,o(!1,n))}r.memo((function(e){let{routes:t,future:n,state:r}=e;return re(t,void 0,r,n)}));function ge(e){let{to:t,replace:n,state:a,relative:s}=e;i(Y(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=r.useContext(Q);o(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:c}=r.useContext(V),{pathname:u}=J(),d=ee(),h=P(t,R(c),u,"path"===s),p=JSON.stringify(h);return r.useEffect((()=>{d(JSON.parse(p),{replace:n,state:a,relative:s})}),[d,p,s,n,a]),null}function ve(e){i(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function ye(e){let{basename:t="/",children:n=null,location:a,navigationType:s="POP",navigator:l,static:c=!1}=e;i(!Y(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=t.replace(/^\/*/,"/"),h=r.useMemo((()=>({basename:u,navigator:l,static:c,future:{}})),[u,l,c]);"string"===typeof a&&(a=d(a));let{pathname:p="/",search:m="",hash:f="",state:g=null,key:v="default"}=a,y=r.useMemo((()=>{let e=C(p,u);return null==e?null:{location:{pathname:e,search:m,hash:f,state:g,key:v},navigationType:s}}),[u,p,m,f,g,v,s]);return o(null!=y,`<Router basename="${u}"> is not able to match the URL "${p}${m}${f}" because it does not start with the basename, so the <Router> won't render anything.`),null==y?null:r.createElement(Q.Provider,{value:h},r.createElement(W.Provider,{children:n,value:y}))}function be(e){let{children:t,location:n}=e;return re(xe(t),n)}r.Component;function xe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[];
4return r.Children.forEach(e,((e,a)=>{if(!r.isValidElement(e))return;let s=[...t,a];if(e.type===r.Fragment)return void n.push.apply(n,xe(e.props.children,s));i(e.type===ve,`[${"string"===typeof e.type?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),i(!e.props.index||!e.props.children,"An index route cannot have child routes.");let o={id:e.props.id||s.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:!0===e.props.hasErrorBoundary||null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(o.children=xe(e.props.children,s)),n.push(o)})),n}var we="get",je="application/x-www-form-urlencoded";function Ne(e){return null!=e&&"string"===typeof e.tagName}function Se(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return new URLSearchParams("string"===typeof e||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((e=>[n,e])):[[n,r]])}),[]))}var ke=null;var Ee=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function _e(e){return null==e||Ee.has(e)?e:(o(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${je}"`),null)}function Ce(e,t){let n,r,a,s,i;if(Ne(o=e)&&"form"===o.tagName.toLowerCase()){let i=e.getAttribute("action");r=i?C(i,t):null,n=e.getAttribute("method")||we,a=_e(e.getAttribute("enctype"))||je,s=new FormData(e)}else if(function(e){return Ne(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Ne(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let o=e.getAttribute("formaction")||i.getAttribute("action");if(r=o?C(o,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||we,a=_e(e.getAttribute("formenctype"))||_e(i.getAttribute("enctype"))||je,s=new FormData(i,e),!function(){if(null===ke)try{new FormData(document.createElement("form"),0),ke=!1}catch(gh){ke=!0}return ke}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";s.append(`${e}x`,"0"),s.append(`${e}y`,"0")}else t&&s.append(t,r)}}else{if(Ne(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=we,r=null,a=je,i=e}var o;return s&&"text/plain"===a&&(i=s,s=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:s,body:i}}function Ae(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}async function Te(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise((()=>{}))}}function Re(e){return null!=e&&"string"===typeof e.page}function Pe(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"===typeof e.imageSrcSet&&"string"===typeof e.imageSizes:"string"===typeof e.rel&&"string"===typeof e.href)}function Oe(e,t,n,r,a,s){let i=(e,t)=>!n[t]||e.route.id!==n[t].route.id,o=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith("*")&&n[t].params["*"]!==e.params["*"];return"assets"===s?t.filter(((e,t)=>i(e,t)||o(e,t))):"data"===s?t.filter(((t,s)=>{let l=r.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(i(t,s)||o(t,s))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"===typeof r)return r}return!0})):[]}function Ie(e,t){let{includeHydrateFallback:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=e.map((e=>{let r=t.routes[e.route.id];if(!r)return[];let a=[r.module];
4return r.clientActionModule&&(a=a.concat(r.clientActionModule)),r.clientLoaderModule&&(a=a.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(a=a.concat(r.hydrateFallbackModule)),r.imports&&(a=a.concat(r.imports)),a})).flat(1),[...new Set(r)];var r}function $e(e,t){let n=new Set,r=new Set(t);return e.reduce(((e,a)=>{if(t&&!Re(a)&&"script"===a.as&&a.href&&r.has(a.href))return e;let s=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(a));return n.has(s)||(n.add(s),e.push({key:s,link:a})),e}),[])}function Le(e){return{__html:e}}Symbol("SingleFetchRedirect");function Fe(e){let t="string"===typeof e?new URL(e,"undefined"===typeof window?"server://singlefetch/":window.location.origin):e;return"/"===t.pathname?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}r.Component;function Me(e){let{error:t,isOutsideRemixApp:n}=e;console.error(t);let a,s=r.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "\ud83d\udcbf Hey developer \ud83d\udc4b. You can provide a way better UX than this when your app throws errors. Check out https://remix.run/guides/errors for more information."\n );\n '}});if(F(t))return r.createElement(De,{title:"Unhandled Thrown Response!"},r.createElement("h1",{style:{fontSize:"24px"}},t.status," ",t.statusText),s);if(t instanceof Error)a=t;else{let e=null==t?"Unknown Error":"object"===typeof t&&"toString"in t?t.toString():JSON.stringify(t);a=new Error(e)}return r.createElement(De,{title:"Application Error!",isOutsideRemixApp:n},r.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),r.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},a.stack),s)}function De(e){let{title:t,renderScripts:n,isOutsideRemixApp:a,children:s}=e,{routeModules:i}=He();return i.root?.Layout&&!a?s:r.createElement("html",{lang:"en"},r.createElement("head",null,r.createElement("meta",{charSet:"utf-8"}),r.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),r.createElement("title",null,t)),r.createElement("body",null,r.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},s,n?r.createElement(Je,null):null)))}function Ue(e){return!0===e}function ze(){let e=r.useContext(U);return Ae(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function qe(){let e=r.useContext(z);return Ae(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Be=r.createContext(void 0);function He(){let e=r.useContext(Be);return Ae(e,"You must render this element inside a <HydratedRouter> element"),e}function Qe(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function We(e,t,n){if(n&&!Ye)return[e[0]];if(t){let n=e.findIndex((e=>void 0!==t[e.route.id]));return e.slice(0,n+1)}return e}function Ve(e){let{page:t,...n}=e,{router:a}=ze(),s=r.useMemo((()=>p(a.routes,t,a.basename)),[a.routes,t,a.basename]);return s?r.createElement(Ge,{page:t,matches:s,...n}):null}function Ke(e){let{manifest:t,routeModules:n}=He(),[a,s]=r.useState([]);return r.useEffect((()=>{let r=!1;return async function(e,t,n){return $e((await Promise.all(e.map((async e=>{let r=t.routes[e.route.id];if(r){let e=await Te(r,n);return e.links?e.links():[]}return[]})))).flat(1).filter(Pe).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}(e,t,n).then((e=>{r||s(e)})),()=>{r=!0}}),[e,t,n]),a}function Ge(e){let{page:t,matches:n,...a}=e,s=J(),{manifest:i,routeModules:o}=He(),{loaderData:l,matches:c}=qe(),u=r.useMemo((()=>Oe(t,n,c,i,s,"data")),[t,n,c,i,s]),d=r.useMemo((()=>Oe(t,n,c,i,s,"assets")),[t,n,c,i,s]),h=r.useMemo((()=>{if(t===s.pathname+s.search+s.hash)return[];let e=new Set,r=!1;if(n.forEach((t=>{let n=i.routes[t.route.id];n&&n.hasLoader&&(!u.some((e=>e.route.id===t.route.id))&&t.route.id in l&&o[t.route.id]?.shouldRevalidate||n.hasClientLoader?r=!0:e.add(t.route.id))})),0===e.size)return[];let a=Fe(t);return r&&e.size>0&&a.searchParams.set("_routes",n.filter((t=>e.has(t.route.id))).map((e=>e.route.id)).join(",")),[a.pathname+a.search]}),[l,s,i,u,n,t,o]),p=r.useMemo((()=>Ie(d,i)),[d,i]),m=Ke(d);return r.createElement(r.Fragment,null,h.map((e=>r.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...a}))),p.map((e=>r.createElement("link",{key:e,rel:"modulepreload",href:e,...a}))),m.map((e=>{let{key:t,link:n}=e;return r.createElement("link",{key:t,...n})})))}Be.displayName="FrameworkContext";var Ye=!1;function Je(e){let{manifest:t,serverHandoffString:n,isSpaMode:a,ssr:s,renderMeta:i}=He(),{router:o,static:l,staticContext:c}=ze(),{matches:u}=qe(),d=Ue(s);i&&(i.didRenderScripts=!0);let h=We(u,null,a);r.useEffect((()=>{Ye=!0}),[]);let m=r.useMemo((()=>{let a=c?`window.__reactRouterContext = ${n};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}
4).pipeThrough(new TextEncoderStream());`:" ",s=l?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${d?"":`import ${JSON.stringify(t.url)}`};\n${h.map(((e,n)=>{let r=`route${n}`,a=t.routes[e.route.id];Ae(a,`Route ${e.route.id} not found in manifest`);let{clientActionModule:s,clientLoaderModule:i,hydrateFallbackModule:o,module:l}=a,c=[...s?[{module:s,varName:`${r}_clientAction`}]:[],...i?[{module:i,varName:`${r}_clientLoader`}]:[],...o?[{module:o,varName:`${r}_HydrateFallback`}]:[],{module:l,varName:`${r}_main`}];return 1===c.length?`import * as ${r} from ${JSON.stringify(l)};`:[c.map((e=>`import * as ${e.varName} from "${e.module}";`)).join("\n"),`const ${r} = {${c.map((e=>`...${e.varName}`)).join(",")}};`].join("\n")})).join("\n")}\n ${d?`window.__reactRouterManifest = ${JSON.stringify(function(e,t){let n=new Set(t.state.matches.map((e=>e.route.id))),r=t.state.location.pathname.split("/").filter(Boolean),a=["/"];for(r.pop();r.length>0;)a.push(`/${r.join("/")}`),r.pop();a.forEach((e=>{let r=p(t.routes,e,t.basename);r&&r.forEach((e=>n.add(e.route.id)))}));let s=[...n].reduce(((t,n)=>Object.assign(t,{[n]:e.routes[n]})),{});return{...e,routes:s}}(t,o),null,2)};`:""}\n window.__reactRouterRouteModules = {${h.map(((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`)).join(",")}};\n\nimport(${JSON.stringify(t.entry.module)});`:" ";return r.createElement(r.Fragment,null,r.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:Le(a),type:void 0}),r.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:Le(s),type:"module",async:!0}))}),[]),f=Ye?[]:t.entry.imports.concat(Ie(h,t,{includeHydrateFallback:!0}));return Ye?null:r.createElement(r.Fragment,null,d?null:r.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin}),r.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin}),(g=f,[...new Set(g)]).map((t=>r.createElement("link",{key:t,rel:"modulepreload",href:t,crossOrigin:e.crossOrigin}))),m);var g}function Xe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{t.forEach((t=>{"function"===typeof t?t(e):null!=t&&(t.current=e)}))}}var Ze="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;try{Ze&&(window.__reactRouterVersion="7.2.0")}catch(gh){}function et(e){let{basename:t,children:n,window:a}=e,i=r.useRef();null==i.current&&(i.current=s({window:a,v5Compat:!0}));let o=i.current,[l,c]=r.useState({action:o.action,location:o.location}),u=r.useCallback((e=>{r.startTransition((()=>c(e)))}),[c]);return r.useLayoutEffect((()=>o.listen(u)),[o,u]),r.createElement(ye,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o})}var tt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nt=r.forwardRef((function(e,t){let n,{onClick:a,discover:s="render",prefetch:l="none",relative:c,reloadDocument:d,replace:h,state:p,target:m,to:f,preventScrollReset:g,viewTransition:v,...y}=e,{basename:b}=r.useContext(Q),x="string"===typeof f&&tt.test(f),w=!1;if("string"===typeof f&&x&&(n=f,Ze))try{let e=new URL(window.location.href),t=f.startsWith("//")?new URL(e.protocol+f):new URL(f),n=C(t.pathname,b);t.origin===e.origin&&null!=n?f=n+t.search+t.hash:w=!0}catch(gh){o(!1,`<Link to="${f}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let j=function(e){let{relative:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(Y(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=r.useContext(Q),{hash:s,pathname:o,search:l}=ne(e,{relative:t}),c=o;return"/"!==n&&(c="/"===o?n:O([n,o])),a.createHref({pathname:c,search:l,hash:s})}(f,{relative:c}
4),[N,S,k]=function(e,t){let n=r.useContext(Be),[a,s]=r.useState(!1),[i,o]=r.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:h}=t,p=r.useRef(null);r.useEffect((()=>{if("render"===e&&o(!0),"viewport"===e){let e=new IntersectionObserver((e=>{e.forEach((e=>{o(e.isIntersecting)}))}),{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}}),[e]),r.useEffect((()=>{if(a){let e=setTimeout((()=>{o(!0)}),100);return()=>{clearTimeout(e)}}}),[a]);let m=()=>{s(!0)},f=()=>{s(!1),o(!1)};return n?"intent"!==e?[i,p,{}]:[i,p,{onFocus:Qe(l,m),onBlur:Qe(c,f),onMouseEnter:Qe(u,m),onMouseLeave:Qe(d,f),onTouchStart:Qe(h,m)}]:[!1,p,{}]}(l,y),E=function(e){let{target:t,replace:n,state:a,preventScrollReset:s,relative:i,viewTransition:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=ee(),c=J(),d=ne(e,{relative:i});return r.useCallback((r=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(r,t)){r.preventDefault();let t=void 0!==n?n:u(c)===u(d);l(e,{replace:t,state:a,preventScrollReset:s,relative:i,viewTransition:o})}}),[c,l,d,n,a,t,e,s,i,o])}(f,{replace:h,state:p,target:m,preventScrollReset:g,relative:c,viewTransition:v});let _=r.createElement("a",{...y,...k,href:n||j,onClick:w||d?a:function(e){a&&a(e),e.defaultPrevented||E(e)},ref:Xe(t,S),target:m,"data-discover":x||"render"!==s?void 0:"true"});return N&&!x?r.createElement(r.Fragment,null,_,r.createElement(Ve,{page:j})):_}));nt.displayName="Link";var rt=r.forwardRef((function(e,t){let{"aria-current":n="page",caseSensitive:a=!1,className:s="",end:o=!1,style:l,to:c,viewTransition:u,children:d,...h}=e,p=ne(c,{relative:h.relative}),m=J(),f=r.useContext(z),{navigator:g,basename:v}=r.useContext(Q),y=null!=f&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.useContext(q);i(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=it("useViewTransitionState"),s=ne(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=C(n.currentLocation.pathname,a)||n.currentLocation.pathname,l=C(n.nextLocation.pathname,a)||n.nextLocation.pathname;return null!=E(s.pathname,l)||null!=E(s.pathname,o)}(p)&&!0===u,b=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,x=m.pathname,w=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;a||(x=x.toLowerCase(),w=w?w.toLowerCase():null,b=b.toLowerCase()),w&&v&&(w=C(w,v)||w);const j="/"!==b&&b.endsWith("/")?b.length-1:b.length;let N,S=x===b||!o&&x.startsWith(b)&&"/"===x.charAt(j),k=null!=w&&(w===b||!o&&w.startsWith(b)&&"/"===w.charAt(b.length)),_={isActive:S,isPending:k,isTransitioning:y},A=S?n:void 0;N="function"===typeof s?s(_):[s,S?"active":null,k?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let T="function"===typeof l?l(_):l;return r.createElement(nt,{...h,"aria-current":A,className:N,ref:t,style:T,to:c,viewTransition:u},"function"===typeof d?d(_):d)}));rt.displayName="NavLink";var at=r.forwardRef(((e,t)=>{let{discover:n="render",fetcherKey:a,navigate:s,reloadDocument:o,replace:l,state:c,method:d=we,action:h,onSubmit:p,relative:m,preventScrollReset:f,viewTransition:g,...v}=e,y=ut(),b=function(e){let{relative:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{basename:n}=r.useContext(Q),a=r.useContext(V);i(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),o={...ne(e||".",{relative:t})},l=J();if(null==e){o.search=l.search;let e=new URLSearchParams(o.search),t=e.getAll("index");if(t.some((e=>""===e))){e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let n=e.toString();o.search=n?`?${n}`:""}}e&&"."!==e||!s.route.index||(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index");"/"!==n&&(o.pathname="/"===o.pathname?n:O([n,o.pathname]));return u(o)}(h,{relative:m}),x="get"===d.toLowerCase()?"get":"post",w="string"===typeof h&&tt.test(h);return r.createElement("form",{ref:t,method:x,action:b,onSubmit:o?p:e=>{if(p&&p(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,n=t?.getAttribute("formmethod")||d;y(t||e.currentTarget,{fetcherKey:a,method:n,navigate:s,replace:l,state:c,relative:m,preventScrollReset:f,viewTransition:g})},...v,"data-discover":w||"render"!==n?void 0:"true"})}));function st(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function it(e){let t=r.useContext(U);return i(t,st(e)),t}function ot(e){o("undefined"!==typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=r.useRef(Se(e)),n=r.useRef(!1),a=J(),s=r.useMemo((()=>function(e,t){let n=Se(e);return t&&t.forEach(((e,r)=>{n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}))}
4)),n}(a.search,n.current?null:t.current)),[a.search]),i=ee(),l=r.useCallback(((e,t)=>{const r=Se("function"===typeof e?e(s):e);n.current=!0,i("?"+r,t)}),[i,s]);return[s,l]}at.displayName="Form";var lt=0,ct=()=>`__${String(++lt)}__`;function ut(){let{router:e}=it("useSubmit"),{basename:t}=r.useContext(Q),n=he("useRouteId");return r.useCallback((async function(r){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{action:s,method:i,encType:o,formData:l,body:c}=Ce(r,t);if(!1===a.navigate){let t=a.fetcherKey||ct();await e.fetch(t,n,a.action||s,{preventScrollReset:a.preventScrollReset,formData:l,body:c,formMethod:a.method||i,formEncType:a.encType||o,flushSync:a.flushSync})}else await e.navigate(a.action||s,{preventScrollReset:a.preventScrollReset,formData:l,body:c,formMethod:a.method||i,formEncType:a.encType||o,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})}),[e,t,n])}new TextEncoder},688:()=>{},751:(e,t,n)=>{n.r(t),n.d(t,{default:()=>o});var r=n(43),a=n(675),s=(n(820),n(914)),i=(n(135),n(579));const o=e=>{var t,n,o,l,c,u,d,h,p,m,f,g,v;let{manga:y,layout:b="horizontal"}=e;const x=(0,r.useRef)(null);if(!y||"object"!==typeof y)return console.error("Invalid manga object provided to MangaCard:",y),(0,i.jsx)("div",{className:"manga-card error-card",children:"Invalid manga data"});const w=y.id||y.mal_id||"unknown";"unknown"===w&&console.warn("Manga card missing ID property:",y);const j=null!==(t=y.score)&&void 0!==t?t:0,N=null!==(n=y.chapters)&&void 0!==n?n:"-",S=null!==(o=y.volumes)&&void 0!==o?o:"-",k=null!==(l=y.status)&&void 0!==l?l:"N/A",E=null!==(c=y.type)&&void 0!==c?c:"N/A",_=null!==(u=y.rank)&&void 0!==u?u:"N/A",C=null!==(d=y.popularity)&&void 0!==d?d:"N/A",A=(y.demographics&&Array.isArray(y.demographics)&&y.demographics.length>0&&y.demographics[0].name,y.serializations&&Array.isArray(y.serializations)&&y.serializations.length>0?y.serializations[0].name:null),T=(null===(h=y.images)||void 0===h||null===(p=h.webp)||void 0===p?void 0:p.large_image_url)||(null===(m=y.images)||void 0===m||null===(f=m.jpg)||void 0===f?void 0:f.large_image_url)||(null===(g=y.images)||void 0===g||null===(v=g.webp)||void 0===v?void 0:v.image_url)||y.image||"/default-manga.jpg";return(0,i.jsx)("div",{className:"manga-card card-horizontal",ref:x,children:(0,i.jsxs)(a.N_,{to:`/manga/${w}`,className:"card-link",children:[(0,i.jsxs)("div",{className:"card-image-container",children:[(0,i.jsx)(s.A,{src:T,alt:y.title_english||"Manga",className:"card-image",fallbackSrc:"/default-manga.jpg"}),(0,i.jsxs)("div",{className:"rating-badge",children:["\u2b50 ",j]})]}),(0,i.jsxs)("div",{className:"card-content",children:[(0,i.jsxs)("div",{className:"metadata-content",children:[(0,i.jsx)("h3",{className:"card-title",children:y.titleEnglish||y.title||"Unknown Title"}),(0,i.jsxs)("div",{className:"metadata-line",children:[(0,i.jsxs)("span",{className:"metadata-item",children:[(0,i.jsx)("span",{className:"metadata-label",children:"Type:"}),(0,i.jsx)("span",{className:"metadata-value",children:E})]}),(0,i.jsx)("span",{className:"metadata-divider",children:"\u2022"}),(0,i.jsxs)("span",{className:"metadata-item",children:[(0,i.jsx)("span",{className:"metadata-label",children:"Chapters:"}),(0,i.jsx)("span",{className:"metadata-value",children:N})]})]}),(0,i.jsxs)("div",{className:"metadata-line mobile-hide",children:[(0,i.jsxs)("span",{className:"metadata-item",children:[(0,i.jsx)("span",{className:"metadata-label",children:"Status:"}),(0,i.jsx)("span",{className:"metadata-value "+("Publishing"===k?"live-status":""),children:k})]}),"-"!==S&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"metadata-divider",children:"\u2022"}),(0,i.jsxs)("span",{className:"metadata-item",children:[(0,i.jsx)("span",{className:"metadata-label",children:"Volumes:"}),(0,i.jsx)("span",{className:"metadata-value",children:S})]})]})]})]}),(0,i.jsxs)("div",{className:"metadata-footer mobile-hide",children:[(0,i.jsxs)("span",{className:"rank-badge",children:["Rank #",_]}),(0,i.jsxs)("span",{className:"popularity-badge",children:["Popularity #",C]}),A&&(0,i.jsx)("span",{className:"serialization-badge",children:A})]})]})]})})}},763:(e,t,n)=>{e.exports=n(983)},799:(e,t)=>
4{var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(e,t,r){var a=null;if(void 0!==r&&(a=""+r),void 0!==t.key&&(a=""+t.key),"key"in t)for(var s in r={},t)"key"!==s&&(r[s]=t[s]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:a,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=a,t.jsxs=a},820:()=>{},838:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});n(43);var r=n(751),a=(n(820),n(579));const s=e=>{let{mangas:t,layout:n="horizontal"}=e;return t&&Array.isArray(t)?(console.log(`MangaCardsGrid received ${t.length} manga items`),t.length>0&&console.log("First manga item:",t[0]),(0,a.jsx)("div",{className:"manga-cards-grid",children:t.map(((e,t)=>{const s=e&&e._id?e._id:`manga-item-${t}`;return(0,a.jsx)(r.default,{manga:e,layout:n},s)}))})):(console.error("Invalid mangas array provided to MangaCardsGrid:",t),(0,a.jsx)("div",{className:"manga-cards-grid",children:(0,a.jsx)("div",{className:"no-data-card",children:"No manga data available"})}))}},853:(e,t,n)=>{e.exports=n(896)},896:(e,t)=>{function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,a=e[r];if(!(0<s(a,t)))break e;e[r]=t,e[n]=a,n=r}}function r(e){return 0===e.length?null:e[0]}function a(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length,i=a>>>1;r<i;){var o=2*(r+1)-1,l=e[o],c=o+1,u=e[c];if(0>s(l,n))c<a&&0>s(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[o]=n,r=o);else{if(!(c<a&&0>s(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"===typeof performance&&"function"===typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,h=null,p=3,m=!1,f=!1,g=!1,v="function"===typeof setTimeout?setTimeout:null,y="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function x(e){for(var t=r(u);null!==t;){if(null===t.callback)a(u);else{if(!(t.startTime<=e))break;a(u),t.sortIndex=t.expirationTime,n(c,t)}t=r(u)}}function w(e){if(g=!1,x(e),!f)if(null!==r(c))f=!0,R();else{var t=r(u);null!==t&&P(w,t.startTime-e)}}var j,N=!1,S=-1,k=5,E=-1;function _(){return!(t.unstable_now()-E<k)}function C(){if(N){var e=t.unstable_now();E=e;var n=!0;try{e:{f=!1,g&&(g=!1,y(S),S=-1),m=!0;var s=p;try{t:{for(x(e),h=r(c);null!==h&&!(h.expirationTime>e&&_());){var i=h.callback;if("function"===typeof i){h.callback=null,p=h.priorityLevel;var o=i(h.expirationTime<=e);if(e=t.unstable_now(),"function"===typeof o){h.callback=o,x(e),n=!0;break t}h===r(c)&&a(c),x(e)}else a(c);h=r(c)}if(null!==h)n=!0;else{var l=r(u);null!==l&&P(w,l.startTime-e),n=!1}}break e}finally{h=null,p=s,m=!1}n=void 0}}finally{n?j():N=!1}}}if("function"===typeof b)j=function(){b(C)};else if("undefined"!==typeof MessageChannel){var A=new MessageChannel,T=A.port2;A.port1.onmessage=C,j=function(){T.postMessage(null)}}else j=function(){v(C,0)};function R(){N||(N=!0,j())}function P(e,n){S=v((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){f||m||(f=!0,R())},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,a,s){var i=t.unstable_now();switch("object"===typeof s&&null!==s?s="number"===typeof(s=s.delay)&&0<s?i+s:i:s=i,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return e={id:d++,callback:a,priorityLevel:e,startTime:s,expirationTime:o=s+o,sortIndex:-1},s>i?(e.sortIndex=s,n(u,e),null===r(c)&&e===r(u)&&(g?(y(S),S=-1):g=!0,P(w,s-i))):(e.sortIndex=o,n(c,e),f||m||(f=!0,R())),e},t.unstable_shouldYield=_,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}}
4,914:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(43),a=n(579);const s=e=>{let{src:t,alt:n,className:s="",fallbackSrc:i="/default-anime.jpg",threshold:o=.1}=e;const[l,c]=(0,r.useState)(null),[u,d]=(0,r.useState)(!1),[h,p]=(0,r.useState)(!1),m=(0,r.useRef)(null);(0,r.useEffect)((()=>{let e,n=!0;return e=new IntersectionObserver((r=>{const[a]=r;a.isIntersecting&&n&&(l||h||!n||c(t),e.disconnect())}),{rootMargin:"200px",threshold:o}),m.current&&e.observe(m.current),()=>{n=!1,e&&e.disconnect()}}),[t,l,h,o]);return(0,a.jsxs)("div",{ref:m,className:`lazy-image-container ${u?"":"lazy-image-loading"} ${s}`,children:[!u&&(0,a.jsx)("div",{className:"lazy-image-placeholder"}),l&&(0,a.jsx)("img",{src:l,alt:n,className:"lazy-image "+(u?"lazy-image-loaded":""),onLoad:()=>{d(!0)},onError:()=>{p(!0),c(i)}})]})}},950:(e,t,n)=>{!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(672)},983:(e,t)=>{var n="function"===typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,a=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,o=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,f=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119;function w(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case s:case o:case i:case p:return e;default:switch(e=e&&e.$$typeof){case c:case h:case g:case f:case l:return e;default:return t}}case a:return t}}}function j(e){return w(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=h,t.Fragment=s,t.Lazy=g,t.Memo=f,t.Portal=a,t.Profiler=o,t.StrictMode=i,t.Suspense=p,t.isAsyncMode=function(e){return j(e)||w(e)===u},t.isConcurrentMode=j,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===h},t.isFragment=function(e){return w(e)===s},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===f},t.isPortal=function(e){return w(e)===a},t.isProfiler=function(e){return w(e)===o},t.isStrictMode=function(e){return w(e)===i},t.isSuspense=function(e){return w(e)===p},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===s||e===d||e===o||e===i||e===p||e===m||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===f||e.$$typeof===l||e.$$typeof===c||e.$$typeof===h||e.$$typeof===y||e.$$typeof===b||e.$$typeof===x||e.$$typeof===v)},t.typeOf=w}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.m=e,(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;n.t=function(r,a){if(1&a&&(r=this(r)),8&a)return r;if("object"===typeof r&&r){if(4&a&&r.__esModule)return r;if(16&a&&"function"===typeof r.then)return r}var s=Object.create(null);n.r(s);var i={};e=e||[null,t({}),t([]),t(t)];for(var o=2&a&&r;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach((e=>i[e]=()=>r[e]));return i.default=()=>r,n.d(s,i),s}})(),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>"static/js/"+e+"."+{20:"8d3d4c2b",120:"00938f3d",199:"779272d3",268:"cd150b98",453:"8ab44547",485:"5fc31dde",519:"e6f2103e",569:"abc7e6c9",787:"e83eddb1",826:"451cd58b"}[e]+".chunk.js",n.miniCssF=e=>
4"static/css/"+e+"."+{120:"773e1dd7",569:"cdc79b0c",826:"3c45d4ff"}[e]+".chunk.css",n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="frontend:";n.l=(r,a,s,i)=>{if(e[r])e[r].push(a);else{var o,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==r||d.getAttribute("data-webpack")==t+s){o=d;break}}o||(l=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,n.nc&&o.setAttribute("nonce",n.nc),o.setAttribute("data-webpack",t+s),o.src=r),e[r]=[a];var h=(t,n)=>{o.onerror=o.onload=null,clearTimeout(p);var a=e[r];if(delete e[r],o.parentNode&&o.parentNode.removeChild(o),a&&a.forEach((e=>e(n))),t)return t(n)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=h.bind(null,o.onerror),o.onload=h.bind(null,o.onload),l&&document.head.appendChild(o)}}})(),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/",(()=>{if("undefined"!==typeof document){var e=e=>new Promise(((t,r)=>{var a=n.miniCssF(e),s=n.p+a;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),r=0;r<n.length;r++){var a=(i=n[r]).getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(a===e||a===t))return i}var s=document.getElementsByTagName("style");for(r=0;r<s.length;r++){var i;if((a=(i=s[r]).getAttribute("data-href"))===e||a===t)return i}})(a,s))return t();((e,t,r,a,s)=>{var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",n.nc&&(i.nonce=n.nc),i.onerror=i.onload=n=>{if(i.onerror=i.onload=null,"load"===n.type)a();else{var r=n&&n.type,o=n&&n.target&&n.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+r+": "+o+")");l.name="ChunkLoadError",l.code="CSS_CHUNK_LOAD_FAILED",l.type=r,l.request=o,i.parentNode&&i.parentNode.removeChild(i),s(l)}},i.href=t,r?r.parentNode.insertBefore(i,r.nextSibling):document.head.appendChild(i)})(e,s,null,t,r)})),t={792:0};n.f.miniCss=(n,r)=>{t[n]?r.push(t[n]):0!==t[n]&&{120:1,569:1,826:1}[n]&&r.push(t[n]=e(n).then((()=>{t[n]=0}),(e=>{throw delete t[n],e})))}}})(),(()=>{var e={792:0};n.f.j=(t,r)=>{var a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else{var s=new Promise(((n,r)=>a=e[t]=[n,r]));r.push(a[2]=s);var i=n.p+n.u(t),o=new Error;n.l(i,(r=>{if(n.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var s=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;o.message="Loading chunk "+t+" failed.\n("+s+": "+i+")",o.name="ChunkLoadError",o.type=s,o.request=i,a[1](o)}}),"chunk-"+t,t)}};var t=(t,r)=>{var a,s,i=r[0],o=r[1],l=r[2],c=0;if(i.some((t=>0!==e[t]))){for(a in o)n.o(o,a)&&(n.m[a]=o[a]);if(l)l(n)}for(t&&t(r);c<i.length;c++)s=i[c],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0},r=self.webpackChunkfrontend=self.webpackChunkfrontend||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var r={};n.r(r),n.d(r,{hasBrowserEnv:()=>Lo,hasStandardBrowserEnv:()=>Mo,hasStandardBrowserWebWorkerEnv:()=>Do,navigator:()=>Fo,origin:()=>Uo});const a="9.10.1",s=globalThis;function i(){return o(s),s}function o(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||a,t[a]=t[a]||{}}function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;const r=n.__SENTRY__=n.__SENTRY__||{},i=r[a]=r[a]||{};return i[e]||(i[e]=t())}function c(){return Date.now()/1e3}const u=function(){const{performance:e}=s;if(!e?.now)return c;const t=Date.now()-e.now(),n=void 0==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/1e3}();let d;function h(){return d||(d=function(){const{performance:e}=s;if(!e?.now)return[void 0,"none"];const t=36e5,n=e.now(),r=Date.now(),a=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,i=a<t,o=e.timing?.navigationStart,l="number"===typeof o?Math.abs(o+n-r):t;return i||l<t?a<=l?[e.timeOrigin,"timeOrigin"]:[o,"navigationStart"]:[r,"dateNow"]}()),d[0]}const p=Object.prototype.toString;function m(e){switch(p.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return S(e,Error)}}function f(e,t){return p.call(e)===`[object ${t}]`}function g(e){return f(e,"ErrorEvent")}function v(e){return f(e,"DOMError")}function y(e){return f(e,"String")}function b(e){return"object"===typeof e&&null!==e&&"__sentry_template_str
4ing__"in e&&"__sentry_template_values__"in e}function x(e){return null===e||b(e)||"object"!==typeof e&&"function"!==typeof e}function w(e){return f(e,"Object")}function j(e){return"undefined"!==typeof Event&&S(e,Event)}function N(e){return Boolean(e?.then&&"function"===typeof e.then)}function S(e,t){try{return e instanceof t}catch(n){return!1}}function k(e){return!("object"!==typeof e||null===e||!e.__isVue&&!e._isVue)}const E=s;function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return"<unknown>";try{let n=e;const r=5,a=[];let s=0,i=0;const o=" > ",l=o.length;let c;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&s++<r&&(c=C(n,u),!("html"===c||s>1&&i+a.length*l+c.length>=d));)a.push(c),i+=c.length,n=n.parentNode;return a.reverse().join(o)}catch(n){return"<unknown>"}}function C(e,t){const n=e,r=[];if(!n?.tagName)return"";if(E.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const a=t?.length?t.filter((e=>n.getAttribute(e))).map((e=>[e,n.getAttribute(e)])):null;if(a?.length)a.forEach((e=>{r.push(`[${e[0]}="${e[1]}"]`)}));else{n.id&&r.push(`#${n.id}`);const e=n.className;if(e&&y(e)){const t=e.split(/\s+/);for(const e of t)r.push(`.${e}`)}}const s=["aria-label","type","name","title","alt"];for(const i of s){const e=n.getAttribute(i);e&&r.push(`[${i}="${e}"]`)}return r.join("")}function A(){try{return E.document.location.href}catch(e){return""}}function T(e){if(!E.HTMLElement)return null;let t=e;for(let n=0;n<5;n++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}const R="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,P=["debug","info","warn","error","log","assert","trace"],O={};function I(e){if(!("console"in s))return e();const t=s.console,n={},r=Object.keys(O);r.forEach((e=>{const r=O[e];n[e]=t[e],t[e]=r}));try{return e()}finally{r.forEach((e=>{t[e]=n[e]}))}}const $=l("logger",(function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return R?P.forEach((n=>{t[n]=function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];e&&I((()=>{s.console[n](`Sentry Logger [${n}]:`,...r)}))}})):P.forEach((e=>{t[e]=()=>{}})),t}));function L(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"string"!==typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function F(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const t=e[r];try{k(t)?n.push("[VueViewModel]"):n.push(String(t))}catch(gh){n.push("[value cannot be serialized]")}}return n.join(t)}function M(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!!y(e)&&(f(t,"RegExp")?t.test(e):!!y(t)&&(n?e===t:e.includes(t)))}function D(e){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).some((n=>M(e,n,t)))}function U(e,t,n){if(!(t in e))return;const r=e[t];if("function"!==typeof r)return;const a=n(r);"function"===typeof a&&q(a,r);try{e[t]=a}catch{R&&$.log(`Failed to replace method "${t}" in object`,e)}}function z(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(r){R&&$.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function q(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,z(e,"__sentry_original__",t)}catch(n){}}function B(e){return e.__sentry_original__}function H(e){if(m(e))return{message:e.message,name:e.name,stack:e.stack,...W(e)};if(j(e)){const t={type:e.type,target:Q(e.target),currentTarget:Q(e.currentTarget),...W(e)};return"undefined"!==typeof CustomEvent&&S(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Q(e){try{return t=e,"undefined"!==typeof Element&&S(t,Element)?_(e):Object.prototype.toString.call(e)}catch(n){return"<unknown>"}var t}function W(e){if("object"===typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function V(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){const e=s;return e.crypto||e.msCrypto}(),t=()=>16*Math.random();try{if(e?.randomUUID)return e.randomUUID().replace(/-/g,"");e?.getRandomValues&&(t=()=>{const t=new Uint8Array(1);return e.getRandomValues(t),t[0]})}catch(n){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^(15&t())>>e/4).toString(16)))}function K(e){return e.exception?.values?.[0]}function G(e){const{message:t,event_id:n}=e;if(t)return t;const r=K(e);return r?r.type&&r.value?`${r.type}: ${r.value}
4`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Y(e,t,n){const r=e.exception=e.exception||{},a=r.values=r.values||[],s=a[0]=a[0]||{};s.value||(s.value=t||""),s.type||(s.type=n||"Error")}function J(e,t){const n=K(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r?.data,...t.data};n.mechanism.data=e}}function X(e){if(function(e){try{return e.__sentry_captured__}catch{}}(e))return!0;try{z(e,"__sentry_captured__",!0)}catch(t){}return!1}function Z(e){const t=u(),n={sid:V(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return{sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"===typeof e.did||"string"===typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}(n)};return e&&ee(n,e),n}function ee(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||u(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:V()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"===typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"===typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"===typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function te(){return V()}function ne(){return V().substring(16)}function re(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(!t||"object"!==typeof t||n<=0)return t;if(e&&0===Object.keys(t).length)return e;const r={...e};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=re(r[a],t[a],n-1));return r}const ae="_sentrySpan";function se(e,t){t?z(e,ae,t):delete e[ae]}function ie(e){return e[ae]}class oe{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:te(),sampleRand:Math.random()}}clone(){const e=new oe;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,se(e,ie(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&ee(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"===typeof e?e(this):e,n=t instanceof oe?t.getScopeData():w(t)?e:void 0,{tags:r,extra:a,user:s,contexts:i,level:o,fingerprint:l=[],propagationContext:c}=n||{};return this._tags={...this._tags,...r},this._extra={...this._extra,...a},this._contexts={...this._contexts,...i},s&&Object.keys(s).length&&(this._user=s),o&&(this._level=o),l.length&&(this._fingerprint=l),c&&
vendor: 4,390 bytes, line 4
4(this._propagationContext=c),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,se(this,void 0),this._attachments=[],this.setPropagationContext({traceId:te(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"===typeof t?t:100;if(n<=0)return this;const r={timestamp:c(),...e,message:e.message?L(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ie(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=re(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t?.event_id||V();if(!this._client)return $.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n?.event_id||V();if(!this._client)return $.warn("No client configured on scope - will not capture message!"),r;const a=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:a,...n,event_id:r},this),r}captureEvent(e,t){const n=t?.event_id||V();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):($.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}class le{constructor(e,t){let n,r;n=e||new oe,r=t||new oe,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(gh){throw this._popScope(),gh}return N(n)?n.then((e=>(this._popScope(),e)),(e=>{throw this._popScope(),e})):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function ce(){const e=o(i());return e.stack=e.stack||new le(l("defaultCurrentScope",(()=>new oe)),l("defaultIsolationScope",(()=>new oe)))}function ue(e){return ce().withScope(e)}function de(e,t){const n=ce();return n.withScope((()=>(n.getStackTop().scope=e,t(e))))}function he(e){return ce().withScope((()=>e(ce().getIsolationScope())))}function pe(e){const t=o(e);return t.acs?t.acs:{withIsolationScope:he,withScope:ue,withSetScope:de,withSetIsolationScope:(e,t)=>he(t),getCurrentScope:()=>ce().getScope(),getIsolationScope:()=>ce().getIsolationScope()}}function me(){return pe(i()).getCurrentScope()}function fe(){return pe(i()).getIsolationScope()}function ge(){const e=pe(i());for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(2===n.length){const[t,r]=n;return t?e.withSetScope(t,r):e.withScope(r)}return e.withScope(n[0])}function ve(){return me().getClient()}function ye(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:a}=t,s={trace_id:n,span_id:a||ne()};return r&&(s.parent_span_id=r),s}const be="production",xe="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;var we;function je(e){return new Se((t=>{t(e)}))}function Ne(e){return new Se(((t,n)=>{n(e)}))}
4!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(we||(we={}));class Se{constructor(e){this._state=we.PENDING,this._handlers=[],this._runExecutor(e)}then(e,t){return new Se(((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(gh){r(gh)}else n(t)},e=>{if(t)try{n(t(e))}catch(gh){r(gh)}else r(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new Se(((t,n)=>{let r,a;return this.then((t=>{a=!1,r=t,e&&e()}),(t=>{a=!0,r=t,e&&e()})).then((()=>{a?n(r):t(r)}))}))}_executeHandlers(){if(this._state===we.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===we.RESOLVED&&e[1](this._value),this._state===we.REJECTED&&e[2](this._value),e[0]=!0)}))}_runExecutor(e){const t=(e,t)=>{this._state===we.PENDING&&(N(t)?t.then(n,r):(this._state=e,this._value=t,this._executeHandlers()))},n=e=>{t(we.RESOLVED,e)},r=e=>{t(we.REJECTED,e)};try{e(n,r)}catch(gh){r(gh)}}}function ke(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return new Se(((a,s)=>{const i=e[r];if(null===t||"function"!==typeof i)a(t);else{const o=i({...t},n);xe&&i.id&&null===o&&$.log(`Event processor "${i.id}" dropped event`),N(o)?o.then((t=>ke(e,t,n,r+1).then(a))).then(null,s):ke(e,o,n,r+1).then(a).then(null,s)}}))}let Ee,_e,Ce;function Ae(e){const t=s._sentryDebugIds;if(!t)return{};const n=Object.keys(t);return Ce&&n.length===_e||(_e=n.length,Ce=n.reduce(((n,r)=>{Ee||(Ee={});const a=Ee[r];if(a)n[a[0]]=a[1];else{const a=e(r);for(let e=a.length-1;e>=0;e--){const s=a[e],i=s?.filename,o=t[r];if(i&&o){n[i]=o,Ee[r]=[i,o];break}}}return n}),{})),Ce}const Te="?",Re=/\(error: (.*)\)/,Pe=/captureMessage|captureException/;function Oe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const a=[],s=e.split("\n");for(let i=t;i<s.length;i++){const e=s[i];if(e.length>1024)continue;const t=Re.test(e)?e.replace(Re,"$1"):e;if(!t.match(/\S*Error: /)){for(const e of r){const n=e(t);if(n){a.push(n);break}}if(a.length>=50+n)break}}return function(e){if(!e.length)return[];const t=Array.from(e);/sentryWrapped/.test(Ie(t).function||"")&&t.pop();t.reverse(),Pe.test(Ie(t).function||"")&&(t.pop(),Pe.test(Ie(t).function||"")&&t.pop());return t.slice(0,50).map((e=>({...e,filename:e.filename||Ie(t).filename,function:e.function||Te})))}(a.slice(n))}}function Ie(e){return e[e.length-1]||{}}const $e="<anonymous>";function Le(e){try{return e&&"function"===typeof e&&e.name||$e}catch(gh){return $e}}function Fe(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach((t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)})),e}catch(n){return}}}function Me(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;try{return Ue("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function De(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:102400;const r=Me(e,t);return a=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(a))>n?De(e,t-1,n):r;var a}function Ue(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){const e=new WeakSet;function t(t){return!!e.has(t)||(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}();const[s,i]=a;if(null==t||["boolean","string"].includes(typeof t)||"number"===typeof t&&Number.isFinite(t))return t;const o=function(e,t){try{if("domain"===e&&t&&"object"===typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if("undefined"!==typeof global&&t===global)return"[Global]";if("undefined"!==typeof window&&t===window)return"[Window]";if("undefined"!==typeof document&&t===document)return"[Document]";if(k(t))return"[VueViewModel]";if(w(n=t)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n)return"[SyntheticEvent]";if("number"===typeof t&&!Number.isFinite(t))return`[${t}]`;if("function"===typeof t)return`[Function: ${Le(t)}]`;if("symbol"===typeof t)return`[${String(t)}]`;if("bigint"===typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}var n}(e,t);if(!o.startsWith("[object "))return o;if(t.__sentry_skip_normalization__)return t;const l="number"===typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:n;if(0===l)return o.replace("object ","");if(s(t))return"[Circular ~]";const c=t;if(c&&"function"===typeof c.toJSON)try{return Ue("",c.toJSON(),l-1,r,a)}catch(p){}const u=Array.isArray(t)?[]:{};let d=0;const h=H(t);for(const m in h){if(!Object.prototype.hasOwnProperty.call(h,m))continue;if(d>=r){u[m]="[MaxProperties ~]";break}const e=h[m];u[m]=Ue(m,e,l-1,r,a),d++}return i(t),u}
4const ze="sentry.source",qe="sentry.sample_rate",Be="sentry.op",He="sentry.origin",Qe="sentry.idle_span_finish_reason",We="sentry.measurement_unit",Ve="sentry.measurement_value",Ke="sentry.custom_span_name",Ge="sentry.profile_id",Ye="sentry.exclusive_time",Je="sentry.link.type",Xe="sentry-",Ze=/^sentry-/;function et(e){const t=function(e){if(!e||!y(e)&&!Array.isArray(e))return;if(Array.isArray(e))return e.reduce(((e,t)=>{const n=nt(t);return Object.entries(n).forEach((t=>{let[n,r]=t;e[n]=r})),e}),{});return nt(e)}(e);if(!t)return;const n=Object.entries(t).reduce(((e,t)=>{let[n,r]=t;if(n.match(Ze)){e[n.slice(7)]=r}return e}),{});return Object.keys(n).length>0?n:void 0}function tt(e){if(!e)return;return function(e){if(0===Object.keys(e).length)return;return Object.entries(e).reduce(((e,t,n)=>{let[r,a]=t;const s=`${encodeURIComponent(r)}=${encodeURIComponent(a)}`,i=0===n?s:`${e},${s}`;return i.length>8192?(R&&$.warn(`Not adding key: ${r} with val: ${a} to baggage header due to exceeding baggage size limits.`),e):i}
4),"")}(Object.entries(e).reduce(((e,t)=>{let[n,r]=t;return r&&(e[`${Xe}${n}`]=r),e}),{}))}function nt(e){return e.split(",").map((e=>e.split("=").map((e=>decodeURIComponent(e.trim()))))).reduce(((e,t)=>{let[n,r]=t;return n&&r&&(e[n]=r),e}),{})}function rt(e){if("boolean"===typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const t=e||ve()?.getOptions();return!!t&&(null!=t.tracesSampleRate||!!t.tracesSampler)}function at(e,t){e.setAttribute("http.response.status_code",t);const n=function(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"unknown_error"}}(t);"unknown_error"!==n.message&&e.setStatus(n)}const st="_sentryScope",it="_sentryIsolationScope";function ot(e){return{scope:e[st],isolationScope:e[it]}}function lt(e){if("boolean"===typeof e)return Number(e);const t="string"===typeof e?parseFloat(e):e;return"number"!==typeof t||isNaN(t)||t<0||t>1?void 0:t}const ct=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function ut(e,t){const n=function(e){if(!e)return;const t=e.match(ct);if(!t)return;let n;return"1"===t[3]?n=!0:"0"===t[3]&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}(e),r=et(t);if(!n?.traceId)return{traceId:te(),sampleRand:Math.random()};const a=function(e,t){const n=lt(t?.sample_rand);if(void 0!==n)return n;const r=lt(t?.sample_rate);return r&&void 0!==e?.parentSampled?e.parentSampled?Math.random()*r:r+Math.random()*(1-r):Math.random()}(n,r);r&&(r.sample_rand=a.toString());const{traceId:s,parentSpanId:i,parentSampled:o}=n;return{traceId:s,parentSpanId:i,sampled:o,dsc:r||{},sampleRand:a}}function dt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:te(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ne(),n=arguments.length>2?arguments[2]:void 0,r="";return void 0!==n&&(r=n?"-1":"-0"),`${e}-${t}${r}`}let ht=!1;function pt(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:a,parent_span_id:s,status:i,origin:o,links:l}=yt(e);return{parent_span_id:s,span_id:t,trace_id:n,data:r,op:a,status:i,origin:o,links:l}}function mt(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),a=r?t:yt(e).parent_span_id,s=ot(e).scope;return{parent_span_id:a,span_id:r?s?.getPropagationContext().propagationSpanId||ne():t,trace_id:n}}function ft(e){return e&&e.length>0?e.map((e=>{let{context:{spanId:t,traceId:n,traceFlags:r,...a},attributes:s}=e;return{span_id:t,trace_id:n,sampled:1===r,attributes:s,...a}})):void 0}function gt(e){return"number"===typeof e?vt(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?vt(e.getTime()):u()}function vt(e){return e>9999999999?e/1e3:e}function yt(e){if(function(e){return"function"===typeof e.getSpanJSON}(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(function(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}(e)){const{attributes:r,startTime:a,name:s,endTime:i,parentSpanId:o,status:l,links:c}=e;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:o,start_timestamp:gt(a),timestamp:gt(i)||void 0,status:xt(l),op:r[Be],origin:r[He],links:ft(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function bt(e){const{traceFlags:t}=e.spanContext();return 1===t}function xt(e){if(e&&0!==e.code)return 1===e.code?"ok":e.message||"unknown_error"}const wt="_sentryChildSpans",jt="_sentryRootSpan";function Nt(e,t){const n=e[jt]||e;z(t,jt,n),e[wt]?e[wt].add(t):z(e,wt,new Set([t]))}function St(e){const t=new Set;return function e(n){if(!t.has(n)&&bt(n)){t.add(n);const r=n[wt]?Array.from(n[wt]):[];for(const t of r)e(t)}}(e),Array.from(t)}function kt(e){return e[jt]||e}function Et(){const e=pe(i());return e.getActiveSpan?e.getActiveSpan():ie(me())}function _t(){ht||(I((()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")})),ht=!0)}const Ct="_frozenDsc";function At(e,t){z(e,Ct,t)}function Tt(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},a={environment:n.environment||be,release:n.release,public_key:r,trace_id:e};return t.emit("createDsc",a),a}function Rt(e,t){const n=t.getPropagationContext();return n.dsc||Tt(n.traceId,e)}function Pt(e){const t=ve();if(!t)return{};const n=kt(e),r=yt(n),a=r.data,s=n.spanContext().traceState,i=s?.get("sentry.sample_rate")??a[qe];function o(e){return"number"!==typeof i&&"string"!==typeof i||(e.sample_rate=`${i}`),e}const l=n[Ct];if(l)return o(l);const c=s?.get("sentry.dsc"),u=c&&et(c);if(u)return o(u);const d=Tt(e.spanContext().traceId,t),h=a[ze],p=r.description;return"url"!==h&&p&&(d.transaction=p),rt()&&(d.sampled=String(bt(n)),d.sample_rand=s?.get("sentry.sample_rand")??ot(n).scope?.getPropagationContext().sampleRand.toString()),o(d),t.emit("createDsc",d,n),d}function Ot(e,t){const{fingerprint:n,span:r,breadcrumbs:a,sdkProcessingMetadata:s}=t;!function(e,t){const{extra:n,tags:r,user:a,contexts:s,level:i,transactionName:o}=t;Object.keys(n).length&&(e.extra={...n,...e.extra});Object.keys(r).length&&(e.tags={...r,...e.tags});Object.keys(a).length&&(e.user={...a,...e.user});Object.keys(s).length&&(e.contexts={...s,...e.contexts});i&&(e.level=i);o&&"transaction"!==e.type&&(e.transaction=o)}(e,t),r&&function(e,t){e.contexts={trace:mt(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Pt(t),...e.sdkProcessingMetadata};const n=kt(t),r=yt(n).description;r&&!e.transaction&&"transaction"===e.type&&(e.transaction=r)}(e,r),function(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t));e.fingerprint.length||delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,a),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}
4(e,s)}function It(e,t){const{extra:n,tags:r,user:a,contexts:s,level:i,sdkProcessingMetadata:o,breadcrumbs:l,fingerprint:c,eventProcessors:u,attachments:d,propagationContext:h,transactionName:p,span:m}=t;$t(e,"extra",n),$t(e,"tags",r),$t(e,"user",a),$t(e,"contexts",s),e.sdkProcessingMetadata=re(e.sdkProcessingMetadata,o,2),i&&(e.level=i),p&&(e.transactionName=p),m&&(e.span=m),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),c.length&&(e.fingerprint=[...e.fingerprint,...c]),u.length&&(e.eventProcessors=[...e.eventProcessors,...u]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...h}}function $t(e,t,n){e[t]=re(e[t],n,1)}function Lt(e,t,n,r,a,s){const{normalizeDepth:i=3,normalizeMaxBreadth:o=1e3}=e,u={...t,event_id:t.event_id||n.event_id||V(),timestamp:t.timestamp||c()},d=n.integrations||e.integrations.map((e=>e.name));!function(e,t){const{environment:n,release:r,dist:a,maxValueLength:s=250}=t;e.environment=e.environment||n||be,!e.release&&r&&(e.release=r);!e.dist&&a&&(e.dist=a);e.message&&(e.message=L(e.message,s));const i=e.exception?.values?.[0];i?.value&&(i.value=L(i.value,s));const o=e.request;o?.url&&(o.url=L(o.url,s))}(u,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(u,d),a&&a.emit("applyFrameMetadata",t),void 0===t.type&&function(e,t){const n=Ae(t);e.exception?.values?.forEach((e=>{e.stacktrace?.frames?.forEach((e=>{e.filename&&(e.debug_id=n[e.filename])}))}))}(u,e.stackParser);const h=function(e,t){if(!t)return e;const n=e?e.clone():new oe;return n.update(t),n}(r,n.captureContext);n.mechanism&&J(u,n.mechanism);const p=a?a.getEventProcessors():[],m=l("globalScope",(()=>new oe)).getScopeData();if(s){It(m,s.getScopeData())}if(h){It(m,h.getScopeData())}const f=[...n.attachments||[],...m.attachments];f.length&&(n.attachments=f),Ot(u,m);return ke([...p,...m.eventProcessors],u,n).then((e=>(e&&function(e){const t={};if(e.exception?.values?.forEach((e=>{e.stacktrace?.frames?.forEach((e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)}))})),0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach((e=>{let[t,r]=e;n.push({type:"sourcemap",code_file:t,debug_id:r})}))}(e),"number"===typeof i&&i>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:Me(e.data,t,n)}})))},...e.user&&{user:Me(e.user,t,n)},...e.contexts&&{contexts:Me(e.contexts,t,n)},...e.extra&&{extra:Me(e.extra,t,n)}};e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Me(e.contexts.trace.data,t,n)));e.spans&&(r.spans=e.spans.map((e=>({...e,...e.data&&{data:Me(e.data,t,n)}}))));e.contexts?.flags&&r.contexts&&(r.contexts.flags=Me(e.contexts.flags,3,n));return r}(e,i,o):e)))}function Ft(e){if(e)return function(e){return e instanceof oe||"function"===typeof e}(e)||function(e){return Object.keys(e).some((e=>Mt.includes(e)))}(e)?{captureContext:e}:e}const Mt=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Dt(e,t){return me().captureException(e,Ft(t))}function Ut(e,t){return me().captureEvent(e,t)}function zt(e){const t=fe(),n=me(),{userAgent:r}=s.navigator||{},a=Z({user:n.getUser()||t.getUser(),...r&&{userAgent:r},...e}),i=t.getSession();return"ok"===i?.status&&ee(i,{status:"exited"}),qt(),t.setSession(a),a}function qt(){const e=fe(),t=me().getSession()||e.getSession();t&&function(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),ee(e,n)}(t),Bt(),e.setSession()}function Bt(){const e=fe(),t=ve(),n=e.getSession();n&&t&&t.captureSession(n)}function Ht(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?qt():Bt()}const Qt=[];function Wt(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;if(t.forEach((e=>{e.isDefaultInstance=!0})),Array.isArray(n))r=[...t,...n];else if("function"===typeof n){const e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return function(e){const t={};return e.forEach((e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)})),Object.values(t)}(r)}function Vt(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Kt(e,t,n){if(n[t.name])xe&&$.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,-1===Qt.indexOf(t.name)&&"function"===typeof t.setupOnce&&(t.setupOnce(),Qt.push(t.name)),t.setup&&"function"===typeof t.setup&&t.setup(e),"function"===typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",((t,r)=>n(t,r,e)))}if("function"===typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign(((t,r)=>n(t,r,e)),{id:t.name});e.addEventProcessor(r)}xe&&$.log(`Integration installed: ${t.name}`)}}function Gt(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch(gh){}return t}const Yt=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,'can\'t redefine non-configurable property "solana"',"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],Jt=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{name:"EventFilters",setup(n){const r=n.getOptions();e=Zt(t,r)},processEvent(n,r,a){if(!e){const n=a.getOptions();e=Zt(t,n)}return function(e,t){if(e.type){if("transaction"===e.type&&function(e,t){if(!t?.length)return!1;const n=e.transaction;return!!n&&D(n,t)}(e,t.ignoreTransactions))return xe&&$.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${G(e)}`),!0}else{if(function(e,t){if(!t?.length)return!1;return Gt(e).some((e=>D(e,t)))}(e,t.ignoreErrors))return xe&&$.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${G(e)}`),!0;if(function(e){if(!e.exception?.values?.length)return!1;return!e.message&&!e.exception.values.some((e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(e))return xe&&$.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${G(e)}`),!0;if(function(e,t){if(!t?.length)return!1;const n=en(e);return!!n&&D(n,t)}(e,t.denyUrls))return xe&&$.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${G(e)}.\nUrl: ${en(e)}`),!0;if(!function(e,t){if(!t?.length)return!0;const n=en(e);return!n||D(n,t)}(e,t.allowUrls))return xe&&$.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${G(e)}.\nUrl: ${en(e)}`),!0}return!1}(n,e)?null:n}}},Xt=function(){return{...Jt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),name:"InboundFilters"}};function Zt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Yt],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function en(e){try{const t=[...e.exception?.values??[]].reverse().find((e=>void 0===e.mechanism?.parent_id&&e.stacktrace?.frames?.length)),n=t?.stacktrace?.frames;return n?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(n):null}catch(t){return xe&&$.error(`Cannot extract url for event ${G(e)}`),null}}let tn;const nn=new WeakMap,rn=()=>({name:"FunctionToString",setupOnce(){tn=Function.prototype.toString;try{Function.prototype.toString=function(){const e=B(this),t=nn.has(ve())&&void 0!==e?e:this;for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return tn.apply(t,r)}}catch{}},setup(e){nn.set(e,!0)}}),an=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(function(e,t){if(!t)return!1;if(function(e,t){const n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!on(e,t))return!1;if(!sn(e,t))return!1;return!0}(e,t))return!0;
4if(function(e,t){const n=ln(t),r=ln(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!on(e,t))return!1;if(!sn(e,t))return!1;return!0}(e,t))return!0;return!1}(t,e))return xe&&$.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(n){}return e=t}}};function sn(e,t){let n=Fe(e),r=Fe(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let a=0;a<r.length;a++){const e=r[a],t=n[a];if(e.filename!==t.filename||e.lineno!==t.lineno||e.colno!==t.colno||e.function!==t.function)return!1}return!0}function on(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(a){return!1}}function ln(e){return e.exception?.values&&e.exception.values[0]}const cn=s;function un(){if(!("fetch"in cn))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(gh){return!1}}function dn(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function hn(e,t){!0===t.debug&&(xe?$.enable():I((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})));me().update(t.initialScope);const n=new e(t);return function(e){me().setClient(e)}(n),n.init(),n}const pn=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function mn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{host:n,path:r,pass:a,port:s,projectId:i,protocol:o,publicKey:l}=e;return`${o}://${l}${t&&a?`:${a}`:""}@${n}${s?`:${s}`:""}/${r?`${r}/`:r}${i}`}function fn(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function gn(e){const t="string"===typeof e?function(e){const t=pn.exec(e);if(!t)return void I((()=>{console.error(`Invalid Sentry Dsn: ${e}`)}));const[n,r,a="",s="",i="",o=""]=t.slice(1);let l="",c=o;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const e=c.match(/^\d+/);e&&(c=e[0])}return fn({host:s,pass:a,path:l,projectId:c,port:i,protocol:n,publicKey:r})}(e):fn(e);if(t&&function(e){if(!R)return!0;const{port:t,projectId:n,protocol:r}=e;return!["protocol","publicKey","host","projectId"].find((t=>!e[t]&&($.error(`Invalid Sentry Dsn: ${t} missing`),!0)))&&(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?!t||!isNaN(parseInt(t,10))||($.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):($.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):($.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1))}(t))return t}function vn(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function yn(e,t,n){return t||`${function(e){return`${vn(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){const n={sentry_version:"7"};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}(e,n)}`}function bn(e){return[e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]]}function xn(e,t){const[n,r]=e;return[n,[...r,t]]}function wn(e,t){const n=e[1];for(const r of n){if(t(r,r[0].type))return!0}return!1}function jn(e){const t=o(s);return t.encodePolyfill?t.encodePolyfill(e):(new TextEncoder).encode(e)}function Nn(e){const[t,n]=e;let r=JSON.stringify(t);function a(e){"string"===typeof r?r="string"===typeof e?r+e:[jn(r),e]:r.push("string"===typeof e?jn(e):e)}for(const s of n){const[e,t]=s;if(a(`\n${JSON.stringify(e)}\n`),"string"===typeof t||t instanceof Uint8Array)a(t);else{let e;try{e=JSON.stringify(t)}catch(gh){e=JSON.stringify(Me(t))}a(e)}}return"string"===typeof r?r:function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;for(const a of e)n.set(a,r),r+=a.length;return n}(r)}function Sn(e){return[{type:"span"},e]}function kn(e){const t="string"===typeof e.data?jn(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const En={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",otel_log:"log_item"};function _n(e){return En[e]}function Cn(e){if(!e?.sdk)return;
4const{name:t,version:n}=e.sdk;return{name:t,version:n}}function An(e,t,n,r){const a=Cn(n),s=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n?.sdk);const i=function(e,t,n,r){const a=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:mn(r)},...a&&{trace:a}}}(e,a,r,t);delete e.sdkProcessingMetadata;return bn(i,[[{type:s},e]])}const Tn="Not capturing exception because it's already been captured.",Rn="Discarded session because of missing or non-string release",Pn=Symbol.for("SentryInternalError"),On=Symbol.for("SentryDoNotSendEventError");function In(e){return{message:e,[Pn]:!0}}function $n(e){return{message:e,[On]:!0}}function Ln(e){return!!e&&"object"===typeof e&&Pn in e}function Fn(e){return!!e&&"object"===typeof e&&On in e}class Mn{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=gn(e.dsn):xe&&$.warn("No DSN provided, client will not send events."),this._dsn){const t=yn(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){const r=V();if(X(e))return xe&&$.log(Tn),r;const a={event_id:r,...t};return this._process(this.eventFromException(e,a).then((e=>this._captureEvent(e,a,n)))),a.event_id}captureMessage(e,t,n,r){const a={event_id:V(),...n},s=b(e)?e:String(e),i=x(e)?this.eventFromMessage(s,t,a):this.eventFromException(e,a);return this._process(i.then((e=>this._captureEvent(e,a,r)))),a.event_id}captureEvent(e,t,n){const r=V();if(t?.originalException&&X(t.originalException))return xe&&$.log(Tn),r;const a={event_id:r,...t},s=e.sdkProcessingMetadata||{},i=s.capturedSpanScope,o=s.capturedSpanIsolationScope;return this._process(this._captureEvent(e,a,i||n,o)),a.event_id}captureSession(e){this.sendSession(e),ee(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;
4return t?(this.emit("flush"),this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e))))):je(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,this.emit("close"),e)))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some((e=>{let{name:t}=e;return t.startsWith("Spotlight")})))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const t=this._integrations[e.name];Kt(this,e,this._integrations),t||Vt(this,[e])}sendEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.emit("beforeSendEvent",e,t);let n=An(e,this._dsn,this._options._metadata,this._options.tunnel);for(const a of t.attachments||[])n=xn(n,kn(a));const r=this.sendEnvelope(n);r&&r.then((t=>this.emit("afterSendEvent",e,t)),null)}sendSession(e){const{release:t,environment:n=be}=this._options;if("aggregates"in e){const r=e.attrs||{};if(!r.release&&!t)return void(xe&&$.warn(Rn));r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t)return void(xe&&$.warn(Rn));e.release=e.release||t,e.environment=e.environment||n}this.emit("beforeSendSession",e);const r=function(e,t,n,r){const a=Cn(n);return bn({sent_at:(new Date).toISOString(),...a&&{sdk:a},...!!r&&t&&{dsn:mn(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(this._options.sendClientReports){const r=`${e}:${t}`;xe&&$.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:""}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){const n=this._hooks[e]=this._hooks[e]||[];return n.push(t),()=>{const e=n.indexOf(t);e>-1&&n.splice(e,1)}}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const a=this._hooks[e];a&&a.forEach((e=>e(...n)))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,(e=>(xe&&$.error("Error while sending envelope:",e),e))):(xe&&$.error("Transport disabled"),je({}))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach((t=>{t&&Kt(e,t,n)})),n}(this,e),Vt(this,e)}_updateSessionFromEvent(e,t){let n="fatal"===t.level,r=!1;const a=t.exception?.values;if(a){r=!0;for(const e of a){const t=e.mechanism;if(!1===t?.handled){n=!0;break}}}const s="ok"===e.status;(s&&0===e.errors||s&&n)&&(ee(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Se((t=>{let n=0;const r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r){const a=this.getOptions(),s=Object.keys(this._integrations);return!t.integrations&&s?.length&&(t.integrations=s),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),Lt(a,e,t,n,this,r).then((e=>{if(null===e)return e;this.emit("postprocessEvent",e,t),e.contexts={trace:ye(n),...e.contexts};const r=Rt(this,n);return e.sdkProcessingMetadata={dynamicSamplingContext:r,...e.sdkProcessingMetadata},e}))}_captureEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:me(),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:fe();return xe&&Dn(e)&&$.log(`Captured error event \`${Gt(e)[0]||"<unknown>"}\``),this._processEvent(e,t,n,r).then((e=>e.event_id),(e=>{xe&&(Fn(e)?$.log(e.message):Ln(e)?$.warn(e.message):$.warn(e))}))}_processEvent(e,t,n,r){const a=this.getOptions(),{sampleRate:s}=a,i=Un(e),o=Dn(e),l=e.type||"error",c=`before send for type \`${l}\``,u="undefined"===typeof s?void 0:lt(s);if(o&&"number"===typeof u&&Math.random()>u)return this.recordDroppedEvent("sample_rate","error"),Ne($n(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));const d="replay_event"===l?"replay":l;return this._prepareEvent(e,t,n,r).then((e=>{if(null===e)throw this.recordDroppedEvent("event_processor",d),$n("An event processor returned `null`, will not send event.");if(t.data&&!0===t.data.__sentry__)return e;const n=function(e,t,n,r){const{beforeSend:a,beforeSendTransaction:s,beforeSendSpan:i}=t;let o=n;if(Dn(o)&&a)return a(o,r);if(Un(o)){if(i){const e=i(function(e){const{trace_id:t,parent_span_id:n,span_id:r,status:a,origin:s,data:i,op:o}=e.contexts?.trace??{};return{data:i??{},description:e.transaction,op:o,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:a,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:i?.[Ge],exclusive_time:i?.[Ye],measurements:e.measurements,is_segment:!0}}(o));if(e?o=re(n,{type:"transaction",timestamp:(l=e).timestamp,start_timestamp:l.start_timestamp,transaction:l.description,contexts:{trace:{trace_id:l.trace_id,span_id:l.span_id,parent_span_id:l.parent_span_id,op:l.op,status:l.status,origin:l.origin,data:{...l.data,...l.profile_id&&{[Ge]:l.profile_id},...l.exclusive_time&&{[Ye]:l.exclusive_time}}}},measurements:l.measurements}):_t(),o.spans){const e=[];for(const t of o.spans){const n=i(t);n?e.push(n):(_t(),e.push(t))}o.spans=e}}if(s){if(o.spans){const e=o.spans.length;o.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return s(o,r)}}var l;return o}(0,a,e,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(N(e))return e.then((e=>{if(!w(e)&&null!==e)throw In(n);return e}),(e=>{throw In(`${t} rejected with ${e}`)}));if(!w(e)&&null!==e)throw In(n);return e}(n,c)}
4)).then((a=>{if(null===a){if(this.recordDroppedEvent("before_send",d),i){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw $n(`${c} returned \`null\`, will not send event.`)}const s=n.getSession()||r.getSession();if(o&&s&&this._updateSessionFromEvent(s,a),i){const e=(a.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(a.spans?a.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const l=a.transaction_info;if(i&&l&&a.transaction!==e.transaction){const e="custom";a.transaction_info={...l,source:e}}return this.sendEvent(a,t),a})).then(null,(e=>{if(Fn(e)||Ln(e))throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),In(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e){this._numProcessing++,e.then((e=>(this._numProcessing--,e)),(e=>(this._numProcessing--,e)))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map((e=>{let[t,n]=e;const[r,a]=t.split(":");return{reason:r,category:a,quantity:n}}))}_flushOutcomes(){xe&&$.log("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(xe&&$.log("No outcomes to send"));if(!this._dsn)return void(xe&&$.log("No dsn provided, will not send outcomes"));xe&&$.log("Sending outcomes:",e);const t=(n=e,bn((r=this._options.tunnel&&mn(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:a||c(),discarded_events:n}]]));var n,r,a;this.sendEnvelope(t)}}function Dn(e){return void 0===e.type}function Un(e){return"transaction"===e.type}function zn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[t],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"npm";const s=e._metadata||{};s.sdk||(s.sdk={name:`sentry.javascript.${t}`,packages:n.map((e=>({name:`${r}:@sentry/${e}`,version:a}))),version:a}),e._metadata=s}function qn(e){void 0===e.user?.ip_address&&(e.user={...e.user,ip_address:"{{auto}}"})}function Bn(e){"aggregates"in e?void 0===e.attrs?.ip_address&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):void 0===e.ipAddress&&(e.ipAddress="{{auto}}")}function Hn(e,t){const n=Vn(e,t),r={type:Yn(t),value:Jn(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Qn(e,t,n,r){const a=ve(),s=a?.getOptions().normalizeDepth,i=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}return}(t),o={__serialized__:De(t,s)};if(i)return{exception:{values:[Hn(e,i)]},extra:o};const l={exception:{values:[{type:j(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:er(t,{isUnhandledRejection:r})}]},extra:o};if(n){const t=Vn(e,n);t.length&&(l.exception.values[0].stacktrace={frames:t})}return l}function Wn(e,t){return{exception:{values:[Hn(e,t)]}}}function Vn(e,t){const n=t.stacktrace||t.stack||"",r=function(e){if(e&&Kn.test(e.message))return 1;return 0}(t),a=function(e){if("number"===typeof e.framesToPop)return e.framesToPop;return 0}(t);try{return e(n,r,a)}catch(gh){}return[]}const Kn=/Minified React error #\d+;/i;function Gn(e){return"undefined"!==typeof WebAssembly&&"undefined"!==typeof WebAssembly.Exception&&e instanceof WebAssembly.Exception}function Yn(e){const t=e?.name;if(!t&&Gn(e)){return e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception"}return t}function Jn(e){const t=e?.message;return Gn(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"===typeof t.error.message?t.error.message:t:"No error message"}function Xn(e,t,n,r,a){let s;if(g(t)&&t.error){return Wn(e,t.error)}if(v(t)||f(t,"DOMException")){const a=t;if("stack"in t)s=Wn(e,t);else{const t=a.name||(v(a)?"DOMError":"DOMException"),i=a.message?`${t}: ${a.message}`:t;s=Zn(e,i,n,r),Y(s,i)}return"code"in a&&(s.tags={...s.tags,"DOMException.code":`${a.code}`}),s}if(m(t))return Wn(e,t);if(w(t)||j(t)){return s=Qn(e,t,n,a),J(s,{synthetic:!0}),s}return s=Zn(e,t,n,r),Y(s,`${t}`,void 0),J(s,{synthetic:!0}),s}function Zn(e,t,n,r){const a={};if(r&&n){const r=Vn(e,n);r.length&&(a.exception={values:[{value:t,stacktrace:{frames:r}}]}),J(a,{synthetic:!0})}
4if(b(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return a.logentry={message:e,params:n},a}return a.message=t,a}function er(e,t){let{isUnhandledRejection:n}=t;const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40;const n=Object.keys(H(e));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=t)return L(r,t);for(let a=n.length;a>0;a--){const e=n.slice(0,a).join(", ");if(!(e.length>t))return a===n.length?e:L(e,t)}return""}(e),a=n?"promise rejection":"exception";if(g(e))return`Event \`ErrorEvent\` captured as ${a} with message \`${e.message}\``;if(j(e)){return`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(gh){}}(e)}\` (type=${e.type}) captured as ${a}`}return`Object captured as ${a} with keys: ${r}`}const tr=s;let nr=0;function rr(){return nr>0}function ar(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!function(e){return"function"===typeof e}(e))return e;try{const t=e.__sentry_wrapped__;if(t)return"function"===typeof t?t:e;if(B(e))return e}catch(gh){return e}const n=function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];try{const n=r.map((e=>ar(e,t)));return e.apply(this,n)}catch(s){throw nr++,setTimeout((()=>{nr--})),ge((e=>{e.addEventProcessor((e=>(t.mechanism&&(Y(e,void 0,void 0),J(e,t.mechanism)),e.extra={...e.extra,arguments:r},e))),Dt(s)})),s}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}q(n,e),z(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}class sr extends Mn{constructor(e){const t={parentSpanIsAlwaysRootSpan:!0,...e};zn(t,"browser",["browser"],tr.SENTRY_SDK_SOURCE||"npm"),super(t),t.sendClientReports&&tr.document&&tr.document.addEventListener("visibilitychange",(()=>{"hidden"===tr.document.visibilityState&&this._flushOutcomes()})),this._options.sendDefaultPii&&(this.on("postprocessEvent",qn),this.on("beforeSendSession",Bn))}eventFromException(e,t){return function(e,t,n,r){const a=Xn(e,t,n?.syntheticException||void 0,r);return J(a),a.level="error",n?.event_id&&(a.event_id=n.event_id),je(a)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",n=arguments.length>2?arguments[2]:void 0;return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info",r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;const s=Zn(e,t,r?.syntheticException||void 0,a);return s.level=n,r?.event_id&&(s.event_id=r.event_id),je(s)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n,r)}}const ir="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,or={},lr={};function cr(e,t){or[e]=or[e]||[],or[e].push(t)}function ur(e,t){if(!lr[e]){lr[e]=!0;try{t()}catch(gh){R&&$.error(`Error while instrumenting ${e}`,gh)}}}function dr(e,t){const n=e&&or[e];if(n)for(const r of n)try{r(t)}catch(gh){R&&$.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Le(r)}\nError:`,gh)}}const hr=s;let pr,mr,fr;function gr(){if(!hr.document)return;const e=dr.bind(null,"dom"),t=vr(e,!0);hr.document.addEventListener("click",t,!1),hr.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const n=hr,r=n[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(U(r,"addEventListener",(function(t){return function(n,r,a){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},s=r[n]=r[n]||{refCount:0};if(!s.handler){const r=vr(e);s.handler=r,t.call(this,n,r,a)}s.refCount++}catch(gh){}return t.call(this,n,r,a)}})),U(r,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},a=n[t];a&&(a.refCount--,a.refCount<=0&&(e.call(this,t,a.handler,r),a.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch(gh){}return e.call(this,t,n,r)}})))}))}function vr(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch(gh){return null}}(n);if(function(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}
4(n.type,r))return;z(n,"_sentryCaptured",!0),r&&!r._sentryId&&z(r,"_sentryId",V());const a="keypress"===n.type?"input":n.type;if(!function(e){if(e.type!==mr)return!1;try{if(!e.target||e.target._sentryId!==fr)return!1}catch(gh){}return!0}(n)){e({event:n,name:a,global:t}),mr=n.type,fr=r?r._sentryId:void 0}clearTimeout(pr),pr=hr.setTimeout((()=>{fr=void 0,mr=void 0}),1e3)}}const yr="__sentry_xhr_v3__";function br(e){cr("xhr",e),ur("xhr",xr)}function xr(){if(!hr.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){const r=new Error,a=1e3*u(),s=y(n[0])?n[0].toUpperCase():void 0,i=function(e){if(y(e))return e;try{return e.toString()}catch{}return}(n[1]);if(!s||!i)return e.apply(t,n);t[yr]={method:s,url:i,request_headers:{}},"POST"===s&&i.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const o=()=>{const e=t[yr];if(e&&4===t.readyState){try{e.status_code=t.status}catch(gh){}dr("xhr",{endTimestamp:1e3*u(),startTimestamp:a,xhr:t,virtualError:r})}};return"onreadystatechange"in t&&"function"===typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(o(),e.apply(t,n))}):t.addEventListener("readystatechange",o),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,a]=n,s=t[yr];return s&&y(r)&&y(a)&&(s.request_headers[r.toLowerCase()]=a),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[yr];if(!r)return e.apply(t,n);void 0!==n[0]&&(r.body=n[0]);return dr("xhr",{startTimestamp:1e3*u(),xhr:t}),e.apply(t,n)}})}let wr;function jr(e){const t="history";cr(t,e),ur(t,Nr)}function Nr(){function e(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const a=n.length>2?n[2]:void 0;if(a){const t=wr,r=String(a);if(wr=r,t===r)return e.apply(this,n);dr("history",{from:t,to:r})}return e.apply(this,n)}}hr.addEventListener("popstate",(()=>{const e=hr.location.href,t=wr;if(wr=e,t===e)return;dr("history",{from:t,to:e})})),"history"in cn&&cn.history&&(U(hr.history,"pushState",e),U(hr.history,"replaceState",e))}function Sr(){"console"in s&&P.forEach((function(e){e in s.console&&U(s.console,e,(function(t){return O[e]=t,function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];dr("console",{args:n,level:e});const a=O[e];a?.apply(s.console,n)}}))}))}function kr(e,t){const n="fetch";cr(n,e),ur(n,(()=>Er(void 0,t)))}function Er(e){arguments.length>
41&&void 0!==arguments[1]&&arguments[1]&&!function(){if("string"===typeof EdgeRuntime)return!0;if(!un())return!1;if(dn(cn.fetch))return!0;let e=!1;const t=cn.document;if(t&&"function"===typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=dn(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){R&&$.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}()||U(s,"fetch",(function(t){return function(){const n=new Error;for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];const{method:o,url:l}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:Ar(t),method:Cr(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Ar(t),method:Cr(t,"method")?String(t.method).toUpperCase():"GET"}}(a),c={args:a,fetchData:{method:o,url:l},startTimestamp:1e3*u(),virtualError:n};return e||dr("fetch",{...c}),t.apply(s,a).then((async t=>(e?e(t):dr("fetch",{...c,endTimestamp:1e3*u(),response:t}),t)),(e=>{if(dr("fetch",{...c,endTimestamp:1e3*u(),error:e}),m(e)&&void 0===e.stack&&(e.stack=n.stack,z(e,"framesToPop",1)),e instanceof TypeError&&("Failed to fetch"===e.message||"Load failed"===e.message||"NetworkError when attempting to fetch resource."===e.message))try{const t=new URL(c.fetchData.url);e.message=`${e.message} (${t.host})`}catch{}throw e}))}}))}function _r(e){let t;try{t=e.clone()}catch{return}!async function(e,t){if(e?.body){const r=e.body,a=r.getReader(),s=setTimeout((()=>{r.cancel().then(null,(()=>{}))}),9e4);let i=!0;for(;i;){let e;try{e=setTimeout((()=>{r.cancel().then(null,(()=>{}))}),5e3);const{done:n}=await a.read();clearTimeout(e),n&&(t(),i=!1)}catch(n){i=!1}finally{clearTimeout(e)}}clearTimeout(s),a.releaseLock(),r.cancel().then(null,(()=>{}))}}(t,(()=>{dr("fetch-body-resolved",{endTimestamp:1e3*u(),response:e})}))}function Cr(e,t){return!!e&&"object"===typeof e&&!!e[t]}function Ar(e){return"string"===typeof e?e:e?Cr(e,"url")?e.url:e.toString?e.toString():"":""}const Tr=100;function Rr(e,t){const n=ve(),r=fe();if(!n)return;const{beforeBreadcrumb:a=null,maxBreadcrumbs:s=Tr}=n.getOptions();if(s<=0)return;const i={timestamp:c(),...e},o=a?I((()=>a(i,t))):i;null!==o&&(n.emit&&n.emit("beforeAddBreadcrumb",o,t),r.addBreadcrumb(o,s))}function Pr(e){return"warn"===e?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}function Or(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}function Ir(e,t){try{if("canParse"in URL&&!URL.canParse(e,t))return;return new URL(e,t)}catch{}}function $r(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Lr(e){return e.split(/[?#]/,1)[0]}const Fr=1024,Mr=function(){const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}};return{name:"Breadcrumbs",setup(t){var n;e.console&&function(e){const t="console";cr(t,e),ur(t,Sr)}(function(e){return function(t){if(ve()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:Pr(t.level),message:F(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${F(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}Rr(n,{input:t.args,level:t.level})}}(t)),e.dom&&(n=function(e,t){return function(n){if(ve()!==e)return;let r,a,s="object"===typeof t?t.serializeAttribute:void 0,i="object"===typeof t&&"number"===typeof t.maxStringLength?t.maxStringLength:void 0;i&&i>Fr&&(ir&&$.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${i} was configured. Sentry will use 1024 instead.`),i=Fr),"string"===typeof s&&(s=[s]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=_(t,{keyAttrs:s,maxStringLength:i}),a=T(t)}catch(gh){r="<unknown>"}if(0===r.length)return;const o={category:`ui.${n.name}`,message:r};a&&(o.data={"ui.component_name":a}),Rr(o,{event:n.event,name:n.name,global:n.global})}}(t,e.dom),cr("dom",n),ur("dom",gr)),e.xhr&&br(function(e){return function(t){if(ve()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,a=t.xhr[yr];if(!n||!r||!a)return;const{method:s,url:i,status_code:o,body:l}=a,c={method:s,url:i,status_code:o},u={xhr:t.xhr,input:l,startTimestamp:n,endTimestamp:r},d={category:"xhr",data:c,type:"http",level:Or(o)};e.emit("beforeOutgoingRequestBreadcrumb",d,u),Rr(d,u)}}(t)),e.fetch&&kr(function(e){return function(t){if(ve()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;
4if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.fetchData.method,t.fetchData.url,t.error){const a=t.fetchData,s={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},i={category:"fetch",data:a,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",i,s),Rr(i,s)}else{const a=t.response,s={...t.fetchData,status_code:a?.status};t.fetchData.request_body_size,t.fetchData.response_body_size;const i={input:t.args,response:a,startTimestamp:n,endTimestamp:r},o={category:"fetch",data:s,type:"http",level:Or(s.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",o,i),Rr(o,i)}}}(t)),e.history&&jr(function(e){return function(t){if(ve()!==e)return;let n=t.from,r=t.to;const a=$r(tr.location.href);let s=n?$r(n):void 0;const i=$r(r);s?.path||(s=a),a.protocol===i.protocol&&a.host===i.host&&(r=i.relative),a.protocol===s.protocol&&a.host===s.host&&(n=s.relative),Rr({category:"navigation",data:{from:n,to:r}})}}(t)),e.sentry&&t.on("beforeSendEvent",function(e){return function(t){ve()===e&&Rr({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:G(t)},{event:t})}}(t))}}};const Dr=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Ur=function(){const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}};return{name:"BrowserApiErrors",setupOnce(){e.setTimeout&&U(tr,"setTimeout",zr),e.setInterval&&U(tr,"setInterval",zr),e.requestAnimationFrame&&U(tr,"requestAnimationFrame",qr),e.XMLHttpRequest&&"XMLHttpRequest"in tr&&U(XMLHttpRequest.prototype,"send",Br);const t=e.eventTarget;if(t){(Array.isArray(t)?t:Dr).forEach(Hr)}}}};function zr(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const a=n[0];return n[0]=ar(a,{mechanism:{data:{function:Le(e)},handled:!1,type:"instrument"}}),e.apply(this,n)}}function qr(e){return function(t){return e.apply(this,[ar(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Le(e)},handled:!1,type:"instrument"}})])}}function Br(e){return function(){const t=this;["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in t&&"function"===typeof t[e]&&U(t,e,(function(t){const n={mechanism:{data:{function:e,handler:Le(t)},handled:!1,type:"instrument"}},r=B(t);return r&&(n.mechanism.data.handler=Le(r)),ar(t,n)}))}));for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.apply(this,r)}}function Hr(e){const t=tr,n=t[e]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(U(n,"addEventListener",(function(t){return function(n,r,a){try{"function"===typeof r.handleEvent&&(r.handleEvent=ar(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Le(r),target:e},handled:!1,type:"instrument"}}))}catch{}return t.apply(this,[n,ar(r,{mechanism:{data:{function:"addEventListener",handler:Le(r),target:e},handled:!1,type:"instrument"}}),a])}})),U(n,"removeEventListener",(function(e){return function(t,n,r){try{const a=n.__sentry_wrapped__;a&&e.call(this,t,a,r)}catch(gh){}return e.call(this,t,n,r)}})))}const Qr=()=>({name:"BrowserSession",setupOnce(){"undefined"!==typeof tr.document?(zt({ignoreDuration:!0}),Ht(),jr((e=>{let{from:t,to:n}=e;void 0!==t&&t!==n&&(zt({ignoreDuration:!0}),Ht())}))):ir&&$.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.")}});let Wr=null;function Vr(e){const t="error";cr(t,e),ur(t,Kr)}function Kr(){Wr=s.onerror,s.onerror=function(e,t,n,r,a){return dr("error",{column:r,error:a,line:n,msg:e,url:t}),!!Wr&&Wr.apply(this,arguments)},s.onerror.__SENTRY_INSTRUMENTED__=!0}let Gr=null;function Yr(e){const t="unhandledrejection";cr(t,e),ur(t,Jr)}function Jr(){Gr=s.onunhandledrejection,s.onunhandledrejection=function(e){return dr("unhandledrejection",e),!Gr||Gr.apply(this,arguments)},s.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Xr=function(){const e={onerror:!0,onunhandledrejection:!0,...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(t){e.onerror&&(!function(e){Vr((t=>{const{stackParser:n,attachStacktrace:r}=ea();if(ve()!==e||rr())return;const{msg:a,url:s,line:i,column:o,error:l}=t,c=function(e,t,n,r){const a=e.exception=e.exception||{},s=a.values=a.values||[],i=s[0]=s[0]||{},o=i.stacktrace=i.stacktrace||{},l=o.frames=o.frames||[],c=r,u=n,d=y(t)&&t.length>0?t:A();0===l.length&&l.push({colno:c,filename:d,function:Te,in_app:!0,lineno:u});return e}(Xn(n,l||a,void 0,r,!1),s,i,o);c.level="error",Ut(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})}))}(t),Zr("onerror")),e.onunhandledrejection&&(!function(e){Yr((t=>{const{stackParser:n,attachStacktrace:r}=ea();if(ve()!==e||rr())return;const a=function(e){if(x(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t),s=x(a)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(a)}`}]}}:Xn(n,a,void 0,r,!0);s.level="error",Ut(s,{originalException:a,mechanism:{handled:!1,type:"onunhandledrejection"}})}))}(t),Zr("onunhandledrejection"))}}};function Zr(e){ir&&$.log(`Global Handler attached: ${e}`)}function ea(){const e=ve();return e?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const ta=()=>({name:"HttpContext",preprocessEvent(e){if(!tr.navigator&&!tr.location&&!tr.document)return;const t=e.request?.url||A(),{referrer:n}=tr.document||{},{userAgent:r}=tr.navigator||{},a={...e.request?.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},s={...e.request,...t&&{url:t},headers:a};e.request=s}});function na(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:250,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0;if(!s.exception?.values||!i||!S(i.originalException,Error))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;var l,c;o&&(s.exception.values=(l=ra(e,t,a,i.originalException,r,s.exception.values,o,0),c=n,l.map((e=>(e.value&&(e.value=L(e.value,c)),e)))))}function ra(e,t,n,r,a,s,i,o){if(s.length>=n+1)return s;let l=[...s];if(S(r[a],Error)){aa(i,o);const s=e(t,r[a]),c=l.length;sa(s,a,c,o),l=ra(e,t,n,r[a],a,[s,...l],s,c)}
4return Array.isArray(r.errors)&&r.errors.forEach(((r,s)=>{if(S(r,Error)){aa(i,o);const c=e(t,r),u=l.length;sa(c,`errors[${s}]`,u,o),l=ra(e,t,n,r,a,[c,...l],c,u)}})),l}function aa(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,..."AggregateError"===e.type&&{is_exception_group:!0},exception_id:t}}function sa(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}const ia=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,a){const s=a.getOptions();na(Hn,s.stackParser,s.maxValueLength,n,t,e,r)}}};function oa(e,t,n,r){const a={filename:e,function:"<anonymous>"===t?Te:t,in_app:!0};return void 0!==n&&(a.lineno=n),void 0!==r&&(a.colno=r),a}const la=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ca=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ua=/\((\S*)(?::(\d+))(?::(\d+))\)/,da=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ha=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,pa=Oe(...[[30,e=>{const t=la.exec(e);if(t){const[,e,n,r]=t;return oa(e,Te,+n,+r)}const n=ca.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=ua.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=ma(n[1]||Te,n[2]);return oa(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{const t=da.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=ha.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||Te;return[n,e]=ma(n,e),oa(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]),ma=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:Te,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},fa="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,ga={};function va(e){const t=ga[e];if(t)return t;let n=hr[e];if(dn(n))return ga[e]=n.bind(hr);const r=hr.document;if(r&&"function"===typeof r.createElement)try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const a=t.contentWindow;a?.[e]&&(n=a[e]),r.head.removeChild(t)}catch(gh){fa&&$.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,gh)}return n?ga[e]=n.bind(hr):n}function ya(e){ga[e]=void 0}const ba=Symbol.for("SentryBufferFullError");function xa(e){const t=[];function n(e){return t.splice(t.indexOf(e),1)[0]||Promise.resolve(void 0)}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return Ne(ba);const a=r();return-1===t.indexOf(a)&&t.push(a),a.then((()=>n(a))).then(null,(()=>n(a).then(null,(()=>{})))),a},drain:function(e){return new Se(((n,r)=>{let a=t.length;if(!a)return n(!0);const s=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{je(e).then((()=>{--a||(clearTimeout(s),n(!0))}),r)}))}))}}}function wa(e,t){let{statusCode:n,headers:r}=t,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now();const s={...e},i=r?.["x-sentry-rate-limits"],o=r?.["retry-after"];if(i)for(const l of i.trim().split(",")){const[e,t,,,n]=l.split(":",5),r=parseInt(e,10),i=1e3*(isNaN(r)?60:r);if(t)for(const o of t.split(";"))"metric_bucket"===o&&n&&!n.split(";").includes("custom")||(s[o]=a+i);else s.all=a+i}else o?s.all=a+function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(o,a):429===n&&(s.all=a+6e4);return s}function ja(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:xa(e.bufferSize||64),r={};return{send:function(a){const s=[];if(wn(a,((t,n)=>{const a=_n(n);!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now();return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,a)?s.push(t):e.recordDroppedEvent("ratelimit_backoff",a)})),0===s.length)return je({});const i=bn(a[0],s),o=t=>{wn(i,((n,r)=>{e.recordDroppedEvent(t,_n(r))}))};return n.add((()=>t({body:Nn(i)}).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&xe&&$.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=wa(r,e),e)),(e=>{throw o("network_error"),e})))).then((e=>e),(e=>{if(e===ba)return xe&&$.error("Skipped sending event because buffer is full."),o("queue_overflow"),je({});throw e}))},flush:e=>n.drain(e)}}function Na(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:va("fetch"),n=0,r=0;return ja(e,(function(a){const s=a.body.length;n+=s,r++;
4const i={body:a.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};if(!t)return ya("fetch"),Ne("No fetch implementation available");try{return t(e.url,i).then((e=>(n-=s,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}catch(gh){return ya("fetch"),n-=s,r--,Ne(gh)}}))}function Sa(e){const t={};for(const n of Object.getOwnPropertyNames(e)){const r=n;void 0!==e[r]&&(t[r]=e[r])}return t}function ka(){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{defaultIntegrations:[Xt(),rn(),Ur(),Mr(),Xr(),ia(),an(),ta(),Qr()],release:"string"===typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:tr.SENTRY_RELEASE?.id,sendClientReports:!0,...Sa(e)}}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});if(!e.skipBrowserExtensionCheck&&function(){const e="undefined"!==typeof tr.window&&tr;if(!e)return!1;const t=e[e.chrome?"chrome":"browser"],n=t?.runtime?.id,r=A()||"",a=!!n&&tr===tr.top&&["chrome-extension:","moz-extension:","ms-browser-extension:","safari-web-extension:"].some((e=>r.startsWith(`${e}//`))),s="undefined"!==typeof e.nw;return!!n&&!a&&!s}())return void(ir&&I((()=>{console.error("[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")})));ir&&!un()&&$.warn("No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill.");const t={...e,stackParser:(n=e.stackParser||pa,Array.isArray(n)?Oe(...n):n),integrations:Wt(e),transport:e.transport||Na};var n;return hn(sr,t)}function Ea(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!tr.document)return void(ir&&$.error("Global document not defined in showReportDialog call"));const t=me(),n=t.getClient(),r=n?.getDsn();if(!r)return void(ir&&$.error("DSN not configured for showReportDialog call"));if(t&&(e.user={...t.getUser(),...e.user}),!e.eventId){const t=fe().lastEventId();t&&(e.eventId=t)}const a=tr.document.createElement("script");a.async=!0,a.crossOrigin="anonymous",a.src=function(e,t){const n=gn(e);if(!n)return"";const r=`${vn(n)}embed/error-page/`;let a=`dsn=${mn(n)}`;for(const s in t)if("dsn"!==s&&"onClose"!==s)if("user"===s){const e=t.user;if(!e)continue;e.name&&(a+=`&name=${encodeURIComponent(e.name)}`),e.email&&(a+=`&email=${encodeURIComponent(e.email)}`)}else a+=`&${encodeURIComponent(s)}=${encodeURIComponent(t[s])}`;return`${r}?${a}`}(r,e),e.onLoad&&(a.onload=e.onLoad);const{onClose:s}=e;if(s){const e=t=>{if("__sentry_reportdialog_closed__"===t.data)try{s()}finally{tr.removeEventListener("message",e)}};tr.addEventListener("message",e)}const i=tr.document.head||tr.document.body;i?i.appendChild(a):ir&&$.error("Not injecting report dialog. No injection point found in HTML")}var _a=n(43);function Ca(e){if(!e||0===e.length)return;const t={};return e.forEach((e=>{const n=e.attributes||{},r=n[We],a=n[Ve];"string"===typeof r&&"number"===typeof a&&(t[e.name]={value:a,unit:r})})),t}const Aa=(e,t,n,r)=>{let a,s;return i=>{t.value>=0&&(i||r)&&(s=t.value-(a||0),(s||void 0===a)&&(a=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)))}},Ta=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=hr.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Ra=()=>{const e=Ta();return e?.activationStart||0},Pa=(e,t)=>{const n=Ta();let r="navigate";n&&(hr.document?.prerendering||Ra()>0?r="prerender":hr.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-")));return{name:e,value:"undefined"===typeof t?-1:t,rating:"good",delta:0,entries:[],id:`v4-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},Oa=(e,t,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(gh){}},Ia=e=>{const t=t=>
4{"pagehide"!==t.type&&"hidden"!==hr.document?.visibilityState||e(t)};hr.document&&(addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0))},$a=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let La=-1;const Fa=e=>{"hidden"===hr.document.visibilityState&&La>-1&&(La="visibilitychange"===e.type?e.timeStamp:0,Ma())},Ma=()=>{removeEventListener("visibilitychange",Fa,!0),removeEventListener("prerenderingchange",Fa,!0)},Da=()=>(hr.document&&La<0&&(La="hidden"!==hr.document.visibilityState||hr.document.prerendering?1/0:0,addEventListener("visibilitychange",Fa,!0),addEventListener("prerenderingchange",Fa,!0)),{get firstHiddenTime(){return La}}),Ua=e=>{hr.document?.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},za=[1800,3e3],qa=[.1,.25],Ba=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ua((()=>{const n=Da(),r=Pa("FCP");let a;const s=Oa("paint",(e=>{e.forEach((e=>{"first-contentful-paint"===e.name&&(s.disconnect(),e.startTime<n.firstHiddenTime&&(r.value=Math.max(e.startTime-Ra(),0),r.entries.push(e),a(!0)))}))}));s&&(a=Aa(e,r,za,t.reportAllChanges))}))}($a((()=>{const n=Pa("CLS",0);let r,a=0,s=[];const i=e=>{e.forEach((e=>{if(!e.hadRecentInput){const t=s[0],n=s[s.length-1];a&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(a+=e.value,s.push(e)):(a=e.value,s=[e])}})),a>n.value&&(n.value=a,n.entries=s,r())},o=Oa("layout-shift",i);o&&(r=Aa(e,n,qa,t.reportAllChanges),Ia((()=>{i(o.takeRecords()),r(!0)})),setTimeout(r,0))})))},Ha=[100,300];let Qa=0,Wa=1/0,Va=0;const Ka=e=>{e.forEach((e=>{e.interactionId&&(Wa=Math.min(Wa,e.interactionId),Va=Math.max(Va,e.interactionId),Qa=Va?(Va-Wa)/7+1:0)}))};let Ga;const Ya=[],Ja=new Map;const Xa=()=>(Ga?Qa:performance.interactionCount||0)-0,Za=[],es=e=>{if(Za.forEach((t=>t(e))),!e.interactionId&&"first-input"!==e.entryType)return;const t=Ya[Ya.length-1],n=Ja.get(e.interactionId);if(n||Ya.length<10||t&&e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0]?.startTime&&n.entries.push(e);else{const t={id:e.interactionId,latency:e.duration,entries:[e]};Ja.set(t.id,t),Ya.push(t)}Ya.sort(((e,t)=>t.latency-e.latency)),Ya.length>10&&Ya.splice(10).forEach((e=>Ja.delete(e.id)))}},ts=e=>{const t=hr.requestIdleCallback||hr.setTimeout;let n=-1;return e=$a(e),"hidden"===hr.document?.visibilityState?e():(n=t(e),Ia(e)),n},ns=[200,500],rs=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"PerformanceEventTiming"in hr&&"interactionId"in PerformanceEventTiming.prototype&&Ua((()=>{"interactionCount"in performance||Ga||(Ga=Oa("event",Ka,{type:"event",buffered:!0,durationThreshold:0}));const n=Pa("INP");let r;const a=e=>{ts((()=>{e.forEach(es);const t=(()=>{const e=Math.min(Ya.length-1,Math.floor(Xa()/50));return Ya[e]})();t&&t.latency!==n.value&&(n.value=t.latency,n.entries=t.entries,r())}))},s=Oa("event",a,{durationThreshold:null!=t.durationThreshold?t.durationThreshold:40});r=Aa(e,n,ns,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Ia((()=>{a(s.takeRecords()),r(!0)})))}))},as=[2500,4e3],ss={},is=[800,1800],os=e=>{hr.document?.prerendering?Ua((()=>os(e))):"complete"!==hr.document?.readyState?addEventListener("load",(()=>os(e)),!0):setTimeout(e,0)},ls={},cs={};let us,ds,hs,ps,ms;function fs(e){return Ns("cls",e,ys,us,arguments.length>1&&void 0!==arguments[1]&&arguments[1])}function gs(e,t){return Ss(e,t),cs[e]||(!function(e){const t={};"event"===e&&(t.durationThreshold=0);Oa(e,(t=>{vs(e,{entries:t})}),t)}(e),cs[e]=!0),ks(e,t)}function vs(e,t){const n=ls[e];if(n?.length)for(const r of n)try{r(t)}catch(gh){fa&&$.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Le(r)}\nError:`,gh)}}function ys(){return Ba((e=>{vs("cls",{metric:e}),us=e}),{reportAllChanges:!0})}function bs(){return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ua((()=>{const n=Da(),r=Pa("FID");let a;const s=e=>{e.startTime<n.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),a(!0))},i=e=>{e.forEach(s)},o=Oa("first-input",i);a=Aa(e,r,Ha,t.reportAllChanges),o&&Ia($a((()=>{i(o.takeRecords()),o.disconnect()})))}))}((e=>{vs("fid",{metric:e}),ds=e}))}function xs(){return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ua((()=>{const n=Da(),r=Pa("LCP");let a;const s=e=>{t.reportAllChanges||(e=e.slice(-1)),e.forEach((e=>{e.startTime<n.firstHiddenTime&&(r.value=Math.max(e.startTime-Ra(),0
4),r.entries=[e],a())}))},i=Oa("largest-contentful-paint",s);if(i){a=Aa(e,r,as,t.reportAllChanges);const n=$a((()=>{ss[r.id]||(s(i.takeRecords()),i.disconnect(),ss[r.id]=!0,a(!0))}));["keydown","click"].forEach((e=>{hr.document&&addEventListener(e,(()=>ts(n)),{once:!0,capture:!0})})),Ia(n)}}))}((e=>{vs("lcp",{metric:e}),hs=e}),{reportAllChanges:!0})}function ws(){return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=Pa("TTFB"),r=Aa(e,n,is,t.reportAllChanges);os((()=>{const e=Ta();e&&(n.value=Math.max(e.responseStart-Ra(),0),n.entries=[e],r(!0))}))}((e=>{vs("ttfb",{metric:e}),ps=e}))}function js(){return rs((e=>{vs("inp",{metric:e}),ms=e}))}function Ns(e,t,n,r){let a,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return Ss(e,t),cs[e]||(a=n(),cs[e]=!0),r&&t({metric:r}),ks(e,t,s?a:void 0)}function Ss(e,t){ls[e]=ls[e]||[],ls[e].push(t)}function ks(e,t,n){return()=>{n&&n();const r=ls[e];if(!r)return;const a=r.indexOf(t);-1!==a&&r.splice(a,1)}}class Es{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._traceId=e.traceId||te(),this._spanId=e.spanId||ne()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}}class _s{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._traceId=e.traceId||te(),this._spanId=e.spanId||ne(),this._startTime=e.startTimestamp||u(),this._links=e.links,this._attributes={},this.setAttributes({[He]:"manual",[Be]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,t){}spanContext(){const{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:n?1:0}}setAttribute(e,t){return void 0===t?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach((t=>this.setAttribute(t,e[t]))),this}updateStartTime(e){this._startTime=gt(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(ze,"custom"),this}end(e){this._endTime||(this._endTime=gt(e),function(e){if(!xe)return;const{description:t="< unknown name >",op:n="< unknown op >"}=yt(e),{spanId:r}=e.spanContext(),a=`[Tracing] Finishing "${n}" ${kt(e)===e?"root ":""}span "${t}" with ID ${r}`;$.log(a)}(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Be],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:xt(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[He],profile_id:this._attributes[Ge],exclusive_time:this._attributes[Ye],measurements:Ca(this._events),is_segment:this._isStandaloneSpan&&kt(this)===this||void 0,segment_id:this._isStandaloneSpan?kt(this).spanContext().spanId:void 0,links:ft(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){xe&&$.log("[Tracing] Adding an event to span:",e);const r=Cs(t)?t:n||u(),a=Cs(t)?{}:t||{},s={name:e,time:gt(r),attributes:a};return this._events.push(s),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const e=ve();e&&e.emit("spanEnd",this);if(!(this._isStandaloneSpan||this===kt(this)))return;if(this._isStandaloneSpan)return void(this._sampled?function(e){const t=ve();if(!t)return;const n=e[1];if(!n||0===n.length)return void t.recordDroppedEvent("before_send","span");t.sendEnvelope(e)}(function(e,t){const n=Pt(e[0]),r=t?.getDsn(),a=t?.getOptions().tunnel,s={sent_at:(new Date).toISOString(),...function(e){return!!e.trace_id&&!!e.public_key}(n)&&{trace:n},...!!a&&r&&{dsn:mn(r)}},i=t?.getOptions().beforeSendSpan,o=i?e=>{const t=yt(e);return i(t)||(_t(),t)}:yt,l=[];for(const c of e){const e=o(c);e&&l.push(Sn(e))}return bn(s,l)}([this],e)):(xe&&$.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span")));const t=this._convertSpanToTransaction();if(t){(ot(this).scope||me()).captureEvent(t)}}_convertSpanToTransaction(){if(!As(yt(this)))return;this._name||(xe&&$.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:e,isolationScope:t}=ot(this);if(!0!==this._sampled)return;const n=St(this).filter((e=>e!==this&&!function(e){return e instanceof _s&&e.isStandaloneSpan()}(e))).map((e=>yt(e))).filter(As),r=this._attributes[ze];
4delete this._attributes[Ke],n.forEach((e=>{delete e.data[Ke]}));const a={contexts:{trace:pt(this)},spans:n.length>1e3?n.sort(((e,t)=>e.start_timestamp-t.start_timestamp)).slice(0,1e3):n,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:t,dynamicSamplingContext:Pt(this)},...r&&{transaction_info:{source:r}}},s=Ca(this._events);return s&&Object.keys(s).length&&(xe&&$.log("[Measurements] Adding measurements to transaction event",JSON.stringify(s,void 0,2)),a.measurements=s),a}}function Cs(e){return e&&"number"===typeof e||e instanceof Date||Array.isArray(e)}function As(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}const Ts="__SENTRY_SUPPRESS_TRACING__";function Rs(e){const t=$s();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=Is(e),{forceTransaction:r,parentSpan:a}=e;return(e.scope?t=>ge(e.scope,t):void 0!==a?e=>Ps(a,e):e=>e())((()=>{const t=me(),a=Fs(t);return e.onlyIfParent&&!a?new Es:Os({parentSpan:a,spanArguments:n,forceTransaction:r,scope:t})}))}function Ps(e,t){const n=$s();return n.withActiveSpan?n.withActiveSpan(e,t):ge((n=>(se(n,e||void 0),t(n))))}function Os(e){let{parentSpan:t,spanArguments:n,forceTransaction:r,scope:a}=e;if(!rt()){const e=new Es;if(r||!t){At(e,{sampled:"false",sample_rate:"0",transaction:n.name,...Pt(e)})}return e}const s=fe();let i;if(t&&!r)i=function(e,t,n){const{spanId:r,traceId:a}=e.spanContext(),s=!t.getScopeData().sdkProcessingMetadata[Ts]&&bt(e),i=s?new _s({...n,parentSpanId:r,traceId:a,sampled:s}):new Es({traceId:a});Nt(e,i);const o=ve();o&&(o.emit("spanStart",i),n.endTimestamp&&o.emit("spanEnd",i));return i}(t,a,n),Nt(t,i);else if(t){const e=Pt(t),{traceId:r,spanId:s}=t.spanContext(),o=bt(t);i=Ls({traceId:r,parentSpanId:s,...n},a,o),At(i,e)}else{const{traceId:e,dsc:t,parentSpanId:r,sampled:o}={...s.getPropagationContext(),...a.getPropagationContext()};i=Ls({traceId:e,parentSpanId:r,...n},a,o),t&&At(i,t)}return function(e){if(!xe)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=yt(e),{spanId:a}=e.spanContext(),s=bt(e),i=kt(e),o=i===e,l=`[Tracing] Starting ${s?"sampled":"unsampled"} ${o?"root ":""}span`,c=[`op: ${n}`,`name: ${t}`,`ID: ${a}`];if(r&&c.push(`parent ID: ${r}`),!o){const{op:e,description:t}=yt(i);c.push(`root ID: ${i.spanContext().spanId}`),e&&c.push(`root op: ${e}`),t&&c.push(`root description: ${t}`)}$.log(`${l}\n ${c.join("\n ")}`)}(i),function(e,t,n){e&&(z(e,it,n),z(e,st,t))}(i,a,s),i}function Is(e){const t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const n={...t};return n.startTimestamp=gt(e.startTime),delete n.startTime,n}return t}function $s(){return pe(i())}function Ls(e,t,n){const r=ve(),a=r?.getOptions()||{},{name:s="",attributes:i}=e,o=t.getPropagationContext(),[l,c,u]=t.getScopeData().sdkProcessingMetadata[Ts]?[!1]:function(e,t,n){if(!rt(e))return[!1];let r,a;"function"===typeof e.tracesSampler?(a=e.tracesSampler({...t,inheritOrSampleWith:e=>"number"===typeof t.parentSampleRate?t.parentSampleRate:"boolean"===typeof t.parentSampled?Number(t.parentSampled):e}),r=!0):void 0!==t.parentSampled?a=t.parentSampled:"undefined"!==typeof e.tracesSampleRate&&(a=e.tracesSampleRate,r=!0);const s=lt(a);if(void 0===s)return xe&&$.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(a)} of type ${JSON.stringify(typeof a)}.`),[!1];if(!s)return xe&&$.log("[Tracing] Discarding transaction because "+("function"===typeof e.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),[!1,s,r];const i=n<s;return i||xe&&$.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(a)})`),[i,s,r]}(a,{name:s,parentSampled:n,attributes:i,parentSampleRate:lt(o.dsc?.sample_rate)},o.sampleRand),d=new _s({...e,attributes:{[ze]:"custom",[qe]:void 0!==c&&u?c:void 0,...e.attributes},sampled:l});return!l&&r&&(xe&&$.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate","transaction")),r&&r.emit("spanStart",d),d}function Fs(e){const t=ie(e);if(!t)return;const n=ve();return(n?n.getOptions():{}).parentSpanIsAlwaysRootSpan?kt(t):t}function Ms(e){return"number"===typeof e&&isFinite(e)}function Ds(e,t,n,r){let{...a}=r;const s=yt(e).start_timestamp;return s&&s>t&&"function"===typeof e.updateStartTime&&e.updateStartTime(t),Ps(e,(()=>{const e=Rs({startTime:t,...a});return e&&e.end(n),e}))}function Us(e){const t=ve();if(!t)return;const{name:n,transaction:r,attributes:a,startTime:s}=e,{release:i,environment:o,sendDefaultPii:l}=t.getOptions(),c=t.getIntegrationByName("Replay"),u=c?.getReplayId(),d=me(),h=d.getUser(),p=void 0!==h?h.email||h.id||h.ip_address:void 0;let m;try{m=d.getScopeData().contexts.profile.profile_id}catch{}return Rs({name:n,attributes:{release:i,environment:o,user:p||void 0,profile_id:m||void 0,replay_id:u||void 0,transaction:r,"user_agent.original":hr.navigator?.userAgent,"client.address":l?"{{auto}}":void 0,...a},startTime:s,experimental:{standalone:!0}})}function zs(){return hr.addEventListener&&hr.performance}function qs(e){return e/1e3}function Bs(e){let t="unknown",n="unknown",r="";for(const a of e){if("/"===a){[t,n]=e.split("/");break}if(!isNaN(Number(a))){t="h"===r?"http":r,n=e.split(r)[1];break}r+=a}
4return r===e&&(t=r),{name:t,version:n}}function Hs(){let e,t,n=0;if(!function(){try{return PerformanceObserver.supportedEntryTypes.includes("layout-shift")}catch{return!1}}())return;let r=!1;function a(){r||(r=!0,t&&function(e,t,n){fa&&$.log(`Sending CLS span (${e})`);const r=qs((h()||0)+(t?.startTime||0)),a=me().getScopeData().transactionName,s=t?_(t.sources[0]?.node):"Layout shift",i={[He]:"auto.http.browser.cls",[Be]:"ui.webvital.cls",[Ye]:t?.duration||0,"sentry.pageload.span_id":n},o=Us({name:s,transaction:a,attributes:i,startTime:r});o&&(o.addEvent("cls",{[We]:"",[Ve]:e}),o.end(r))}(n,e,t),s())}const s=fs((t=>{let{metric:r}=t;const a=r.entries[r.entries.length-1];a&&(n=r.value,e=a)}),!0);Ia((()=>{a()})),setTimeout((()=>{const e=ve();if(!e)return;const n=e.on("startNavigationSpan",(()=>{a(),n?.()})),r=Et();if(r){const e=kt(r);"pageload"===yt(e).op&&(t=e.spanContext().spanId)}}),0)}let Qs,Ws,Vs=0,Ks={};function Gs(e){let{recordClsStandaloneSpans:t}=e;const n=zs();if(n&&h()){n.mark&&hr.performance.mark("sentry-tracing-init");const e=function(){return e=e=>{let{metric:t}=e;const n=t.entries[t.entries.length-1];if(!n)return;const r=qs(h()),a=qs(n.startTime);Ks.fid={value:t.value,unit:"millisecond"},Ks["mark.fid"]={value:r+a,unit:"second"}},Ns("fid",e,bs,ds);var e}(),r=function(e){return Ns("lcp",e,xs,hs,arguments.length>1&&void 0!==arguments[1]&&arguments[1])}((e=>{let{metric:t}=e;const n=t.entries[t.entries.length-1];n&&(Ks.lcp={value:t.value,unit:"millisecond"},Qs=n)}),!0),a=function(){return e=e=>{let{metric:t}=e;t.entries[t.entries.length-1]&&(Ks.ttfb={value:t.value,unit:"millisecond"})},Ns("ttfb",e,ws,ps);var e}(),s=t?Hs():fs((e=>{let{metric:t}=e;const n=t.entries[t.entries.length-1];n&&(Ks.cls={value:t.value,unit:""},Ws=n)}),!0);return()=>{e(),r(),a(),s?.()}}return()=>{}}function Ys(e,t){const n=zs(),r=h();if(!n?.getEntries||!r)return;const a=qs(r),s=n.getEntries(),{op:i,start_timestamp:o}=yt(e);if(s.slice(Vs).forEach((t=>{const n=qs(t.startTime),r=qs(Math.max(0,t.duration));if(!("navigation"===i&&o&&a+n<o))switch(t.entryType){case"navigation":!function(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach((r=>{Js(e,t,r,n)})),Js(e,t,"secureConnection",n,"TLS/SSL"),Js(e,t,"fetch",n,"cache"),Js(e,t,"domainLookup",n,"DNS"),function(e,t,n){const r=n+qs(t.requestStart),a=n+qs(t.responseEnd),s=n+qs(t.responseStart);t.responseEnd&&(Ds(e,r,a,{op:"browser.request",name:t.name,attributes:{[He]:"auto.ui.browser.metrics"}}),Ds(e,s,a,{op:"browser.response",name:t.name,attributes:{[He]:"auto.ui.browser.metrics"}}))}(e,t,n)}(e,t,a);break;case"mark":case"paint":case"measure":{!function(e,t,n,r,a){const s=Ta(!1),i=qs(s?s.requestStart:0),o=a+Math.max(n,i),l=a+n,c=l+r,u={[He]:"auto.resource.browser.metrics"};o!==l&&(u["sentry.browser.measure_happened_before_request"]=!0,u["sentry.browser.measure_start_time"]=o);o<=c&&Ds(e,o,c,{name:t.name,op:t.entryType,attributes:u})}(e,t,n,r,a);const s=Da(),i=t.startTime<s.firstHiddenTime;"first-paint"===t.name&&i&&(Ks.fp={value:t.startTime,unit:"millisecond"}),"first-contentful-paint"===t.name&&i&&(Ks.fcp={value:t.startTime,unit:"millisecond"});break}case"resource":!function(e,t,n,r,a,s){if("xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType)return;const i=$r(n),o={[He]:"auto.resource.browser.metrics"};Xs(o,t,"transferSize","http.response_transfer_size"),Xs(o,t,"encodedBodySize","http.response_content_length"),Xs(o,t,"decodedBodySize","http.decoded_response_content_length");const l=t.deliveryType;null!=l&&(o["http.response_delivery_type"]=l);const c=t.renderBlockingStatus;c&&(o["resource.render_blocking_status"]=c);i.protocol&&(o["url.scheme"]=i.protocol.split(":").pop());i.host&&(o["server.address"]=i.host);o["url.same_origin"]=n.includes(hr.location.origin);const{name:u,version:d}=Bs(t.nextHopProtocol);o["network.protocol.name"]=u,o["network.protocol.version"]=d;const h=s+r,p=h+a;Ds(e,h,p,{name:n.replace(hr.location.origin,""),op:t.initiatorType?`resource.${t.initiatorType}`:"resource.other",attributes:o})}(e,t,t.name,n,r,a)}})),Vs=Math.max(s.length-1,0),function(e){const t=hr.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),Ms(n.rtt)&&(Ks["connection.rtt"]={value:n.rtt,unit:"millisecond"}));Ms(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`);Ms(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}(e),"pageload"===i){!function(e){const t=Ta(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}(Ks);const n=Ks["mark.fid"];n&&Ks.fid&&(Ds(e,n.value,n.value+qs(Ks.fid.value),{name:"first input delay",op:"ui.action",attributes:{[He]:"auto.ui.browser.metrics"}}),delete Ks["mark.fid"]),"fcp"in Ks&&t.recordClsOnPageloadSpan||delete Ks.cls,Object.entries(Ks).forEac
4h((e=>{let[t,n]=e;!function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Et();const a=r&&kt(r);a&&(xe&&$.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),a.addEvent(e,{[Ve]:t,[We]:n}))}(t,n.value,n.unit)})),e.setAttribute("performance.timeOrigin",a),e.setAttribute("performance.activationStart",Ra()),function(e){Qs&&(Qs.element&&e.setAttribute("lcp.element",_(Qs.element)),Qs.id&&e.setAttribute("lcp.id",Qs.id),Qs.url&&e.setAttribute("lcp.url",Qs.url.trim().slice(0,200)),null!=Qs.loadTime&&e.setAttribute("lcp.loadTime",Qs.loadTime),null!=Qs.renderTime&&e.setAttribute("lcp.renderTime",Qs.renderTime),e.setAttribute("lcp.size",Qs.size));Ws?.sources&&Ws.sources.forEach(((t,n)=>e.setAttribute(`cls.source.${n+1}`,_(t.node))))}(e)}Qs=void 0,Ws=void 0,Ks={}}function Js(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n;const s=function(e){if("secureConnection"===e)return"connectEnd";if("fetch"===e)return"domainLookupStart";return`${e}End`}(n),i=t[s],o=t[`${n}Start`];o&&i&&Ds(e,r+qs(o),r+qs(i),{op:`browser.${a}`,name:t.name,attributes:{[He]:"auto.ui.browser.metrics"}})}function Xs(e,t,n,r){const a=t[n];null!=a&&a<2147483647&&(e[r]=a)}const Zs=[],ei=new Map;function ti(){if(zs()&&h()){const e=function(){return e=e=>{let{metric:t}=e;if(void 0==t.value)return;const n=t.entries.find((e=>e.duration===t.value&&ni[e.name]));if(!n)return;const{interactionId:r}=n,a=ni[n.name],s=qs(h()+n.startTime),i=qs(t.value),o=Et(),l=o?kt(o):void 0,c=(null!=r?ei.get(r):void 0)||l,u=c?yt(c).description:me().getScopeData().transactionName,d=Us({name:_(n.target),transaction:u,attributes:{[He]:"auto.http.browser.inp",[Be]:`ui.interaction.${a}`,[Ye]:n.duration},startTime:s});d&&(d.addEvent("inp",{[We]:"millisecond",[Ve]:t.value}),d.end(s+i))},Ns("inp",e,js,ms);var e}();return()=>{e()}}return()=>{}}const ni={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};const ri={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3};function ai(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new Map;let r,a=!1,s="externalFinish",i=!t.disableAutoFinish;const o=[],{idleTimeout:l=ri.idleTimeout,finalTimeout:c=ri.finalTimeout,childSpanTimeout:d=ri.childSpanTimeout,beforeSpanEnd:h}=t,p=ve();if(!p||!rt()){const e=new Es;return At(e,{sample_rate:"0",sampled:"false",...Pt(e)}),e}const m=me(),f=Et(),g=function(e){const t=Rs(e);return se(me(),t),xe&&$.log("[Tracing] Started span is an idle span"),t}(e);function v(){r&&(clearTimeout(r),r=void 0)}function y(e){v(),r=setTimeout((()=>{!a&&0===n.size&&i&&(s="idleTimeout",g.end(e))}),l)}function b(e){r=setTimeout((()=>{!a&&i&&(s="heartbeatFailed",g.end(e))}),d)}function x(e){a=!0,n.clear(),o.forEach((e=>e())),se(m,f);const t=yt(g),{start_timestamp:r}=t;if(!r)return;t.data[Qe]||g.setAttribute(Qe,s),$.log(`[Tracing] Idle span "${t.op}" finished`);const i=St(g).filter((e=>e!==g));let u=0;i.forEach((t=>{t.isRecording()&&(t.setStatus({code:2,message:"cancelled"}),t.end(e),xe&&$.log("[Tracing] Cancelling span since span ended early",JSON.stringify(t,void 0,2)));const n=yt(t),{timestamp:r=0,start_timestamp:a=0}=n,s=a<=e,i=r-a<=(c+l)/1e3;if(xe){const e=JSON.stringify(t,void 0,2);s?i||$.log("[Tracing] Discarding span since it finished after idle span final timeout",e):$.log("[Tracing] Discarding span since it happened after idle span was finished",e)}i&&s||(!function(e,t){e[wt]&&e[wt].delete(t)}(g,t),u++)})),u>0&&g.setAttribute("sentry.idle_span_discarded_spans",u)}return g.end=new Proxy(g.end,{apply(e,t,n){if(h&&h(g),t instanceof Es)return;const[r,...a]=n,s=gt(r||u()),i=St(g).filter((e=>e!==g));if(!i.length)return x(s),Reflect.apply(e,t,[s,...a]);const o=i.map((e=>yt(e).timestamp)).filter((e=>!!e)),l=o.length?Math.max(...o):void 0,d=yt(g).start_timestamp,p=Math.min(d?d+c/1e3:1/0,Math.max(d||-1/0,Math.min(s,l||1/0)));return x(p),Reflect.apply(e,t,[p,...a])}}),o.push(p.on("spanStart",(e=>{if(a||e===g||yt(e).timestamp)return;var t;St(g).includes(e)&&(t=e.spanContext().spanId,v(),n.set(t,!0),b(u()+d/1e3))}))),o.push(p.on("spanEnd",(e=>{var t;a||(t=e.spanContext().spanId,n.has(t)&&n.delete(t),0===n.size&&y(u()+l/1e3))}))),o.push(p.on("idleSpanEnableAutoFinish",(e=>{e===g&&(i=!0,y(),n.size&&b())}))),t.disableAutoFinish||y(),setTimeout((()=>{a||(g.setStatus({code:2,message:"deadline_exceeded"}),s="finalTimeout",g.end())}),c),g}let si=!1;function ii(){const e=Et(),t=e&&kt(e);
4if(t){const e="internal_error";xe&&$.log(`[Tracing] Root span: ${e} -> Global error occurred`),t.setStatus({code:2,message:e})}}function oi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=ve();if(!function(){const e=ve();return!1!==e?.getOptions().enabled&&!!e?.getTransport()}()||!t)return{};const n=pe(i());if(n.getTraceData)return n.getTraceData(e);const r=me(),a=e.span||Et(),s=a?function(e){const{traceId:t,spanId:n}=e.spanContext();return dt(t,n,bt(e))}(a):function(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return dt(t,r,n)}(r),o=tt(a?Pt(a):Rt(t,r));return ct.test(s)?{"sentry-trace":s,baggage:o}:($.warn("Invalid sentry-trace data. Cannot generate trace data"),{})}function li(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"auto.http.browser";if(!e.fetchData)return;const{method:s,url:i}=e.fetchData,o=rt()&&t(i);if(e.endTimestamp&&o){const t=e.fetchData.__span;if(!t)return;const n=r[t];return void(n&&(!function(e,t){if(t.response){at(e,t.response.status);const n=t.response?.headers&&t.response.headers.get("content-length");if(n){const t=parseInt(n);t>0&&e.setAttribute("http.response_content_length",t)}}else t.error&&e.setStatus({code:2,message:"internal_error"});e.end()}(n,e),delete r[t]))}const l=i.startsWith("/")?Ir(i,"thismessage:/"):Ir(i),c=i.startsWith("/")?void 0:l?.href,u=!!Et(),d=o&&u?Rs({name:`${s} ${Lr(i)}`,attributes:{url:i,type:"fetch","http.method":s,"http.url":l?.href,[He]:a,[Be]:"http.client",...c&&{"http.url":c},...c&&l?.host&&{"server.address":l.host},...l?.search&&{"http.query":l.search},...l?.hash&&{"http.fragment":l.hash}}}):new Es;if(e.fetchData.__span=d.spanContext().spanId,r[d.spanContext().spanId]=d,n(e.fetchData.url)){const t=e.args[0],n=e.args[1]||{},r=function(e,t,n){const r=oi({span:n}),a=r["sentry-trace"],s=r.baggage;if(!a)return;const i=t.headers||(function(e){return"undefined"!==typeof Request&&S(e,Request)}(e)?e.headers:void 0);if(i){if(function(e){return"undefined"!==typeof Headers&&S(e,Headers)}(i)){const e=new Headers(i);if(e.set("sentry-trace",a),s){const t=e.get("baggage");if(t){const n=ci(t);e.set("baggage",n?`${n},${s}`:s)}else e.set("baggage",s)}return e}if(Array.isArray(i)){const e=[...i.filter((e=>!(Array.isArray(e)&&"sentry-trace"===e[0]))).map((e=>{if(Array.isArray(e)&&"baggage"===e[0]&&"string"===typeof e[1]){const[t,n,...r]=e;return[t,ci(n),...r]}return e})),["sentry-trace",a]];return s&&e.push(["baggage",s]),e}{const e="baggage"in i?i.baggage:void 0;let t=[];return Array.isArray(e)?t=e.map((e=>"string"===typeof e?ci(e):e)).filter((e=>""===e)):e&&t.push(ci(e)),s&&t.push(s),{...i,"sentry-trace":a,baggage:t.length>0?t.join(","):void 0}}}return{...r}}(t,n,rt()&&u?d:void 0);r&&(e.args[1]=n,n.headers=r)}const h=ve();if(h){const t={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};h.emit("beforeOutgoingRequestSpan",d,t)}return d}function ci(e){return e.split(",").filter((e=>!e.split("=")[0].startsWith(Xe))).join(",")}ii.tag="sentry_tracingErrorCallback";const ui=new WeakMap,di=new Map,hi={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function pi(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:a,shouldCreateSpanForRequest:s,enableHTTPTimings:i,tracePropagationTargets:o}={traceFetch:hi.traceFetch,traceXHR:hi.traceXHR,trackFetchStreamPerformance:hi.trackFetchStreamPerformance,...t},l="function"===typeof s?s:e=>!0,c=e=>function(e,t){const n=A();if(n){let r,a;try{r=new URL(e,n),a=new URL(n).origin}catch(gh){return!1}const s=r.origin===a;return t?D(r.toString(),t)||s&&D(r.pathname,t):s}{const n=!!e.match(/^\/(?!\/)/);return t?D(e,t):n}}(e,o),u={};n&&(e.addEventProcessor((e=>("transaction"===e.type&&e.spans&&e.spans.forEach((e=>{if("http.client"===e.op){const t=di.get(e.span_id);t&&(e.timestamp=t/1e3,di.delete(e.span_id))}})),e))),a&&function(e){const t="fetch-body-resolved";cr(t,e),ur(t,(()=>Er(_r)))}((e=>{if(e.response){const t=ui.get(e.response);t&&e.endTimestamp&&di.set(t,e.endTimestamp)}})),kr((e=>{const t=li(e,l,c,u);if(e.response&&e.fetchData.__span&&ui.set(e.response,e.fetchData.__span),t){const n=gi(e.fetchData.url),r=n?$r(n).host:void 0;t.setAttributes({"http.url":n,"server.address":r})}i&&t&&mi(t)}))),r&&br((e=>{const t=function(e,t,n,r){const a=e.xhr,s=a?.[yr];if(!a||a.__sentry_own_request__||!s)return;const{url:i,method:o}=s,l=rt()&&t(i);if(e.endTimestamp&&l){const e=a.__sentry_xhr_span_id__;if(!e)return;const t=r[e];return void(t&&void 0!==s.status_code&&(at(t,s.status_code),t.end(),delete r[e]))}
4const c=gi(i),u=$r(c||i),d=Lr(i),h=!!Et(),p=l&&h?Rs({name:`${o} ${d}`,attributes:{url:i,type:"xhr","http.method":o,"http.url":c,"server.address":u?.host,[He]:"auto.http.browser",[Be]:"http.client",...u?.search&&{"http.query":u?.search},...u?.hash&&{"http.fragment":u?.hash}}}):new Es;a.__sentry_xhr_span_id__=p.spanContext().spanId,r[a.__sentry_xhr_span_id__]=p,n(i)&&function(e,t){const{"sentry-trace":n,baggage:r}=oi({span:t});n&&function(e,t,n){try{e.setRequestHeader("sentry-trace",t),n&&e.setRequestHeader("baggage",n)}catch(r){}}(e,n,r)}(a,rt()&&h?p:void 0);const m=ve();m&&m.emit("beforeOutgoingRequestSpan",p,e);return p}(e,l,c,u);i&&t&&mi(t)}))}function mi(e){const{url:t}=yt(e).data;if(!t||"string"!==typeof t)return;const n=gs("resource",(r=>{let{entries:a}=r;a.forEach((r=>{if(function(e){return"resource"===e.entryType&&"initiatorType"in e&&"string"===typeof e.nextHopProtocol&&("fetch"===e.initiatorType||"xmlhttprequest"===e.initiatorType)}(r)&&r.name.endsWith(t)){(function(e){const{name:t,version:n}=Bs(e.nextHopProtocol),r=[];if(r.push(["network.protocol.version",n],["network.protocol.name",t]),!h())return r;return[...r,["http.request.redirect_start",fi(e.redirectStart)],["http.request.fetch_start",fi(e.fetchStart)],["http.request.domain_lookup_start",fi(e.domainLookupStart)],["http.request.domain_lookup_end",fi(e.domainLookupEnd)],["http.request.connect_start",fi(e.connectStart)],["http.request.secure_connection_start",fi(e.secureConnectionStart)],["http.request.connection_end",fi(e.connectEnd)],["http.request.request_start",fi(e.requestStart)],["http.request.response_start",fi(e.responseStart)],["http.request.response_end",fi(e.responseEnd)]]})(r).forEach((t=>e.setAttribute(...t))),setTimeout(n)}}))}))}function fi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return((h()||performance.timeOrigin)+e)/1e3}function gi(e){try{return new URL(e,tr.location.origin).href}catch{return}}const vi="sentry_previous_trace";function yi(e,t){const n=yt(t);return e?e.spanContext.traceId===n.trace_id?e:(Date.now()/1e3-e.startTimestamp<=3600&&(ir&&$.info(`Adding previous_trace ${e.spanContext} link to span ${{op:n.op,...t.spanContext()}}`),t.addLink({context:e.spanContext,attributes:{[Je]:"previous_trace"}})),{spanContext:t.spanContext(),startTimestamp:yt(t).start_timestamp}):{spanContext:t.spanContext(),startTimestamp:n.start_timestamp}}const bi={...ri,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,linkPreviousTrace:"in-memory",_experiments:{},...hi};function xi(e){const t=tr.document,n=t?.querySelector(`meta[name=${e}]`);return n?.getAttribute("content")||void 0}const wi="_sentry_idleSpan";function ji(e){return e[wi]}function Ni(e,t){z(e,wi,t)}!function(e){const t={...e};var n,r;zn(t,"react"),n="react",r={version:_a.version},fe().setContext(n,r),ka(t)}({dsn:"https://00c992774c130cb71f4a44e8d1bfe092@o4509074739494912.ingest.us.sentry.io/4509074749587456",integrations:[function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=tr.document;si||(si=!0,Vr(ii),Yr(ii));const{enableInp:n,enableLongTask:r,enableLongAnimationFrame:a,_experiments:{enableInteractions:i,enableStandaloneClsSpans:o},beforeStartSpan:l,idleTimeout:c,finalTimeout:u,childSpanTimeout:d,markBackgroundSpan:p,traceFetch:m,traceXHR:f,trackFetchStreamPerformance:g,shouldCreateSpanForRequest:v,enableHTTPTimings:y,instrumentPageLoad:b,instrumentNavigation:x,linkPreviousTrace:w}={...bi,...e},j=Gs({recordClsStandaloneSpans:o||!1});n&&ti(),a&&s.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?new PerformanceObserver((e=>{const t=Et();if(t)for(const n of e.getEntries()){if(!n.scripts[0])continue;const e=qs(h()+n.startTime),{start_timestamp:r,op:a}=yt(t);if("navigation"===a&&r&&e<r)continue;const s=qs(n.duration),i={[He]:"auto.ui.browser.metrics"},o=n.scripts[0],{invoker:l,invokerType:c,sourceURL:u,sourceFunctionName:d,sourceCharPosition:p}=o;i["browser.script.invoker"]=l,i["browser.script.invoker_type"]=c,u&&(i["code.filepath"]=u),d&&(i["code.function"]=d),-1!==p&&(i["browser.script.source_char_position"]=p),Ds(t,e,e+s,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:i})}})).observe({type:"long-animation-frame",buffered:!0}):r&&gs("longtask",(e=>{let{entries:t}=e;const n=Et();if(!n)return;const{op:r,start_timestamp:a}=yt(n);for(const s of t){const e=qs(h()+s.startTime),t=qs(s.duration);"navigation"===r&&a&&e<a||Ds(n,e,e+t,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[He]:"auto.ui.browser.metrics"}})}})),i&&gs("event",(e=>{let{entries:t}=e;const n=Et();
4if(n)for(const r of t)if("click"===r.name){const e=qs(h()+r.startTime),t=qs(r.duration),a={name:_(r.target),op:`ui.interaction.${r.name}`,startTime:e,attributes:{[He]:"auto.ui.browser.metrics"}},s=T(r.target);s&&(a.attributes["ui.component_name"]=s),Ds(n,e,e+t,a)}}));const N={name:void 0,source:void 0};function S(e,n){const r="pageload"===n.op,a=l?l(n):n,s=a.attributes||{};n.name!==a.name&&(s[ze]="custom",a.attributes=s),N.name=a.name,N.source=s[ze];const i=ai(a,{idleTimeout:c,finalTimeout:u,childSpanTimeout:d,disableAutoFinish:r,beforeSpanEnd:t=>{j(),Ys(t,{recordClsOnPageloadSpan:!o}),Ni(e,void 0);const n=me(),r=n.getPropagationContext();n.setPropagationContext({...r,traceId:i.spanContext().traceId,sampled:bt(i),dsc:Pt(t)})}});function h(){t&&["interactive","complete"].includes(t.readyState)&&e.emit("idleSpanEnableAutoFinish",i)}Ni(e,i),r&&t&&(t.addEventListener("readystatechange",(()=>{h()})),h())}return{name:"BrowserTracing",afterAllSetup(e){let t=A();function r(){const t=ji(e);t&&!yt(t).timestamp&&(ir&&$.log(`[Tracing] Finishing current active span with op: ${yt(t).op}`),t.end())}if(e.on("startNavigationSpan",(t=>{ve()===e&&(r(),fe().setPropagationContext({traceId:te(),sampleRand:Math.random()}),me().setPropagationContext({traceId:te(),sampleRand:Math.random()}),S(e,{op:"navigation",...t}))})),e.on("startPageLoadSpan",(function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(ve()!==e)return;r();const a=ut(n.sentryTrace||xi("sentry-trace"),n.baggage||xi("baggage"));me().setPropagationContext(a),S(e,{op:"pageload",...t})})),"off"!==w){let t;e.on("spanStart",(e=>{if(kt(e)===e)if("session-storage"===w){!function(e){try{tr.sessionStorage.setItem(vi,JSON.stringify(e))}catch(gh){ir&&$.warn("Could not store previous trace in sessionStorage",gh)}}(yi(function(){try{const e=tr.sessionStorage?.getItem(vi);return JSON.parse(e)}catch(gh){return}}(),e))}else t=yi(t,e)}))}if(tr.location){if(b){const t=h();!function(e,t,n){e.emit("startPageLoadSpan",t,n),me().setTransactionName(t.name),ji(e)}(e,{name:tr.location.pathname,startTime:t?t/1e3:void 0,attributes:{[ze]:"url",[He]:"auto.pageload.browser"}})}x&&jr((n=>{let{to:r,from:a}=n;void 0!==a||-1===t?.indexOf(r)?a!==r&&(t=void 0,function(e,t){e.emit("startNavigationSpan",t),me().setTransactionName(t.name),ji(e)}(e,{name:tr.location.pathname,attributes:{[ze]:"url",[He]:"auto.navigation.browser"}})):t=void 0}))}p&&(tr.document?tr.document.addEventListener("visibilitychange",(()=>{const e=Et();if(!e)return;const t=kt(e);if(tr.document.hidden&&t){const e="cancelled",{op:n,status:r}=yt(t);ir&&$.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus({code:2,message:e}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}})):ir&&$.warn("[Tracing] Could not set up background tab detection due to lack of global document")),i&&function(e,t,n,r,a){const s=tr.document;let i;const o=()=>{const s="ui.action.click",o=ji(e);if(o){const e=yt(o).op;if(["navigation","pageload"].includes(e))return void(ir&&$.warn(`[Tracing] Did not create ${s} span because a pageload or navigation span is in progress.`))}i&&(i.setAttribute(Qe,"interactionInterrupted"),i.end(),i=void 0),a.name?i=ai({name:a.name,op:s,attributes:{[ze]:a.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r}):ir&&$.warn(`[Tracing] Did not create ${s} transaction because _latestRouteName is missing.`)};s&&addEventListener("click",o,{once:!1,capture:!0})}(e,c,u,d,N),n&&function(){const e=e=>{let{entries:t}=e;const n=Et(),r=n&&kt(n);t.forEach((e=>{if(!function(e){return"duration"in e}(e)||!r)return;const t=e.interactionId;if(null!=t&&!ei.has(t)){if(Zs.length>10){const e=Zs.shift();ei.delete(e)}Zs.push(t),ei.set(t,r)}}))};gs("event",e),gs("first-input",e)}(),pi(e,{traceFetch:m,traceXHR:f,trackFetchStreamPerformance:g,tracePropagationTargets:e.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:v,enableHTTPTimings:y})}}}()],tracesSampleRate:1,tracePropagationTargets:["localhost",/^https:\/\/yourserver\.io\/api/],environment:"production",debug:!1});var Si=n(391),ki=n(675);const Ei="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;
4function _i(e,t,n){let{componentStack:r}=t;if(function(e){const t=e.match(/^([^.]+)/);return null!==t&&parseInt(t[0])>=17}(_a.version)&&m(e)&&r){const t=new Error(e.message);t.name=`React ErrorBoundary ${e.name}`,t.stack=r,function(e,t){const n=new WeakSet;!function e(t,r){if(!n.has(t))return t.cause?(n.add(t),e(t.cause,r)):void(t.cause=r)}(e,t)}(e,t)}return ge((t=>(t.setContext("react",{componentStack:r}),Dt(e,n))))}const Ci={componentStack:null,error:null,eventId:null};class Ai extends _a.Component{constructor(e){super(e),this.state=Ci,this._openFallbackReportDialog=!0;const t=ve();t&&e.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=t.on("afterSendEvent",(t=>{!t.type&&this._lastEventId&&t.event_id===this._lastEventId&&Ea({...e.dialogOptions,eventId:this._lastEventId})})))}componentDidCatch(e,t){const{componentStack:n}=t,{beforeCapture:r,onError:a,showDialog:s,dialogOptions:i}=this.props;ge((o=>{r&&r(o,e,n);const l=null!=this.props.handled?this.props.handled:!!this.props.fallback,c=_i(e,t,{mechanism:{handled:l}});a&&a(e,n,c),s&&(this._lastEventId=c,this._openFallbackReportDialog&&Ea({...i,eventId:c})),this.setState({error:e,componentStack:n,eventId:c})}))}componentDidMount(){const{onMount:e}=this.props;e&&e()}componentWillUnmount(){const{error:e,componentStack:t,eventId:n}=this.state,{onUnmount:r}=this.props;r&&(this.state===Ci?r(null,null,null):r(e,t,n)),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}resetErrorBoundary(){const{onReset:e}=this.props,{error:t,componentStack:n,eventId:r}=this.state;e&&e(t,n,r),this.setState(Ci)}render(){const{fallback:e,children:t}=this.props,n=this.state;if(null===n.componentStack)return"function"===typeof t?t():t;const r="function"===typeof e?_a.createElement(e,{error:n.error,componentStack:n.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:n.eventId}):e;return _a.isValidElement(r)?r:(e&&Ei&&$.warn("fallback did not produce a valid ReactElement"),null)}}var Ti=n(579);const Ri=e=>{let{error:t,componentStack:n,resetError:r}=e;return(0,Ti.jsxs)("div",{className:"error-boundary",children:[(0,Ti.jsx)("h2",{children:"Something went wrong"}),(0,Ti.jsx)("p",{children:"We've been notified about this issue and are working to fix it!"}),!1,(0,Ti.jsx)("button",{onClick:r,children:"Try again"})]})},Pi=e=>{let{children:t}=e;return(0,Ti.jsx)(Ai,{fallback:Ri,children:t})};function Oi(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ii}=Object.prototype,{getPrototypeOf:$i}=Object,Li=(Fi=Object.create(null),e=>{const t=Ii.call(e);return Fi[t]||(Fi[t]=t.slice(8,-1).toLowerCase())});var Fi;const Mi=e=>(e=e.toLowerCase(),t=>Li(t)===e),Di=e=>t=>typeof t===e,{isArray:Ui}=Array,zi=Di("undefined");const qi=Mi("ArrayBuffer");const Bi=Di("string"),Hi=Di("function"),Qi=Di("number"),Wi=e=>null!==e&&"object"===typeof e,Vi=e=>{if("object"!==Li(e))return!1;const t=$i(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ki=Mi("Date"),Gi=Mi("File"),Yi=Mi("Blob"),Ji=Mi("FileList"),Xi=Mi("URLSearchParams"),[Zi,eo,to,no]=["ReadableStream","Request","Response","Headers"].map(Mi);function ro(e,t){let n,r,{allOwnKeys:a=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),Ui(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{const r=a?Object.getOwnPropertyNames(e):Object.keys(e),s=r.length;let i;for(n=0;n<s;n++)i=r[n],t.call(null,e[i],i,e)}}function ao(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,a=n.length;for(;a-- >0;)if(r=n[a],t===r.toLowerCase())return r;return null}const so="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:global,io=e=>!zi(e)&&e!==so;const oo=(lo="undefined"!==typeof Uint8Array&&$i(Uint8Array),e=>lo&&e instanceof lo);var lo;const co=Mi("HTMLFormElement"),uo=(e=>{let{hasOwnProperty:t}=e;return(e,n)=>t.call(e,n)})(Object.prototype),ho=Mi("RegExp"),po=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ro(n,((n,a)=>{let s;!1!==(s=t(n,a,e))&&(r[a]=s||n)})),Object.defineProperties(e,r)};const mo=Mi("AsyncFunction"),fo=((e,t)=>{return e?setImmediate:t?(n=`axios@${Math.random()}`,r=[],so.addEventListener("message",(e=>{let{source:t,data:a}=e;t===so&&a===n&&r.length&&r.shift()()}),!1),e=>{r.push(e),so.postMessage(n,"*")}):e=>setTimeout(e);var n,r})("function"===typeof setImmediate,Hi(so.postMessage)),go="undefined"!==typeof queueMicrotask?queueMicrotask.bind(so):"undefined"!==typeof process&&process.nextTick||fo,vo={isArray:Ui,isArrayBuffer:qi,isBuffer:function(e){return null!==e&&!zi(e)&&null!==e.constructor&&!zi(e.constructor)&&Hi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"===typeof FormData&&e instanceof FormData||Hi(e.append)&&("formdata"===(t=Li(e))||"object"===t&&Hi(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&qi(e.buffer),t},isString:Bi,isNumber:Qi,isBoolean:e=>!0===e||!1===e,isObject:Wi,isPlainObject:Vi,isReadableStream:Zi,isRequest:eo,isResponse:to,isHeaders:no,isUndefined:zi,isDate:Ki,isFile:Gi,isBlob:Yi,isRegExp:ho,isFunction:Hi,isStream:e=>Wi(e)&&Hi(e.pipe),isURLSearchParams:Xi,isTypedArray:oo,isFileList:Ji,forEac
vendor: 5,589 bytes, line 4
4h:ro,merge:function e(){const{caseless:t}=io(this)&&this||{},n={},r=(r,a)=>{const s=t&&ao(n,a)||a;Vi(n[s])&&Vi(r)?n[s]=e(n[s],r):Vi(r)?n[s]=e({},r):Ui(r)?n[s]=r.slice():n[s]=r};for(let a=0,s=arguments.length;a<s;a++)arguments[a]&&ro(arguments[a],r);return n},extend:function(e,t,n){let{allOwnKeys:r}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return ro(t,((t,r)=>{n&&Hi(t)?e[r]=Oi(t,n):e[r]=t}),{allOwnKeys:r}),e},trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(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)},toFlatObject:(e,t,n,r)=>{let a,s,i;const o={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),s=a.length;s-- >0;)i=a[s],r&&!r(i,e,t)||o[i]||(t[i]=e[i],o[i]=!0);e=!1!==n&&$i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Li,kindOfTest:Mi,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Ui(e))return e;let t=e.length;if(!Qi(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:co,hasOwnProperty:uo,hasOwnProp:uo,reduceDescriptors:po,freezeMethods:e=>{po(e,((t,n)=>{if(Hi(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Hi(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return Ui(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:ao,global:so,isContextDefined:io,isSpecCompliantForm:function(e){return!!(e&&Hi(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Wi(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const a=Ui(e)?[]:{};return ro(e,((e,t)=>{const s=n(e,r+1);!zi(s)&&(a[t]=s)})),t[r]=void 0,a}}return e};return n(e,0)},isAsyncFn:mo,isThenable:e=>e&&(Wi(e)||Hi(e))&&Hi(e.then)&&Hi(e.catch),setImmediate:fo,asap:go};function yo(e,t,n,r,a){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),a&&(this.response=a,this.status=a.status?a.status:null)}vo.inherits(yo,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:vo.toJSONObject(this.config),code:this.code,status:this.status}}});const bo=yo.prototype,xo={};["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=>{xo[e]={value:e}})),Object.defineProperties(yo,xo),Object.defineProperty(bo,"isAxiosError",{value:!0}),yo.from=(e,t,n,r,a,s)=>{const i=Object.create(bo);return vo.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),yo.call(i,e.message,t,n,r,a),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const wo=yo;function jo(e){return vo.isPlainObject(e)||vo.isArray(e)}function No(e){return vo.endsWith(e,"[]")?e.slice(0,-2):e}function So(e,t,n){return e?e.concat(t).map((function(e,t){return e=No(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ko=vo.toFlatObject(vo,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Eo=function(e,t,n){if(!vo.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=vo.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!vo.isUndefined(t[e])}))).metaTokens,a=n.visitor||c,s=n.dots,i=n.indexes,o=(n.Blob||"undefined"!==typeof Blob&&Blob)&&vo.isSpecCompliantForm(t);if(!vo.isFunction(a))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(vo.isDate(e))return e.toISOString();if(!o&&vo.isBlob(e))throw new wo("Blob is not supported. Use a Buffer instead.");return vo.isArrayBuffer(e)||vo.isTypedArray(e)?o&&"function"===typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,a){let o=e;if(e&&!a&&"object"===typeof e)if(vo.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(vo.isArray(e)&&function(e){return vo.isArray(e)&&!e.some(jo)}(e)||(vo.isFileList(e)||vo.endsWith(n,"[]"))&&(o=vo.toArray(e)))return n=No(n),o.forEach((function(e,r){!vo.isUndefined(e)&&null!==e&&t.append(!0===i?So([n],r,s):null===i?n:n+"[]",l(e))})),!1;return!!jo(e)||(t.append(So(a,n,s),l(e)),!1)}const u=[],d=Object.assign(ko,{defaultVisitor:c,convertValue:l,isVisitable:jo});if(!vo.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!vo.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),vo.forEach(n,(function(n,s){!0===(!(vo.isUndefined(n)||null===n)&&a.call(t,n,vo.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])})),u.pop()}}(e),t};
vendor: 6,139 bytes, line 4
4function _o(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Co(e,t){this._pairs=[],e&&Eo(e,this,t)}const Ao=Co.prototype;Ao.append=function(e,t){this._pairs.push([e,t])},Ao.toString=function(e){const t=e?function(t){return e.call(this,t,_o)}:_o;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const To=Co;function Ro(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Po(e,t,n){if(!t)return e;const r=n&&n.encode||Ro;vo.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let s;if(s=a?a(t,n):vo.isURLSearchParams(t)?t.toString():new To(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const Oo=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){vo.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Io={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$o={isBrowser:!0,classes:{URLSearchParams:"undefined"!==typeof URLSearchParams?URLSearchParams:To,FormData:"undefined"!==typeof FormData?FormData:null,Blob:"undefined"!==typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Lo="undefined"!==typeof window&&"undefined"!==typeof document,Fo="object"===typeof navigator&&navigator||void 0,Mo=Lo&&(!Fo||["ReactNative","NativeScript","NS"].indexOf(Fo.product)<0),Do="undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"===typeof self.importScripts,Uo=Lo&&window.location.href||"http://localhost",zo={...r,...$o};const qo=function(e){function t(e,n,r,a){let s=e[a++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),o=a>=e.length;if(s=!s&&vo.isArray(r)?r.length:s,o)return vo.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&vo.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],a)&&vo.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const a=n.length;let s;for(r=0;r<a;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if(vo.isFormData(e)&&vo.isFunction(e.entries)){const n={};return vo.forEachEntry(e,((e,r)=>{t(function(e){return vo.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null};const Bo={transitional:Io,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,a=vo.isObject(e);a&&vo.isHTMLForm(e)&&(e=new FormData(e));if(vo.isFormData(e))return r?JSON.stringify(qo(e)):e;if(vo.isArrayBuffer(e)||vo.isBuffer(e)||vo.isStream(e)||vo.isFile(e)||vo.isBlob(e)||vo.isReadableStream(e))return e;if(vo.isArrayBufferView(e))return e.buffer;if(vo.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Eo(e,new zo.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return zo.isNode&&vo.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=vo.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Eo(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return a||r?(t.setContentType("application/json",!1),function(e,t,n){if(vo.isString(e))try{return(t||JSON.parse)(e),vo.trim(e)}catch(gh){if("SyntaxError"!==gh.name)throw gh}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Bo.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(vo.isResponse(e)||vo.isReadableStream(e))return e;if(e&&vo.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(gh){if(n){if("SyntaxError"===gh.name)throw wo.from(gh,wo.ERR_BAD_RESPONSE,this,null,this.response);throw gh}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:zo.classes.FormData,Blob:zo.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};vo.forEach(["delete","get","head","post","put","patch"],(e=>{Bo.headers[e]={}}));const Ho=Bo,Qo=vo.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"]),Wo=Symbol("internals");function Vo(e){return e&&String(e).trim().toLowerCase()}function Ko(e){return!1===e||null==e?e:vo.isArray(e)?e.map(Ko):String(e)}function Go(e,t,n,r,a){return vo.isFunction(r)?r.call(this,t,n):(a&&(t=n),vo.isString(t)?vo.isString(r)?-1!==t.indexOf(r):vo.isRegExp(r)?r.test(t):void 0:void 0)}class Yo{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function a(e,t,n){const a=Vo(t);if(!a)throw new Error("header name must be a non-empty string");const s=vo.findKey(r,a);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=Ko(e))}const s=(e,t)=>vo.forEach(e,((e,n)=>a(e,n,t)));if(vo.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(vo.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),n=e.substring(0,a).trim().toLowerCase(),r=e.substring(a+1).trim(),!n||t[n]&&Qo[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(vo.isHeaders(e))for(const[i,o]of e.entries())a(o,i,n);else null!=e&&a(t,e,n);return this}get(e,t){if(e=Vo(e)){const n=vo.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;
4=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(vo.isFunction(t))return t.call(this,e,n);if(vo.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Vo(e)){const n=vo.findKey(this,e);return!(!n||void 0===this[n]||t&&!Go(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function a(e){if(e=Vo(e)){const a=vo.findKey(n,e);!a||t&&!Go(0,n[a],a,t)||(delete n[a],r=!0)}}return vo.isArray(e)?e.forEach(a):a(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const a=t[n];e&&!Go(0,this[a],a,e,!0)||(delete this[a],r=!0)}return r}normalize(e){const t=this,n={};return vo.forEach(this,((r,a)=>{const s=vo.findKey(n,a);if(s)return t[s]=Ko(r),void delete t[a];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(a):String(a).trim();i!==a&&delete t[a],t[i]=Ko(r),n[i]=!0})),this}concat(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.constructor.concat(this,...t)}toJSON(e){const t=Object.create(null);return vo.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&vo.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((e=>{let[t,n]=e;return t+": "+n})).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e){const t=new this(e);for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return r.forEach((e=>t.set(e))),t}static accessor(e){const t=(this[Wo]=this[Wo]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Vo(e);t[r]||(!function(e,t){const n=vo.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,a){return this[r].call(this,t,e,n,a)},configurable:!0})}))}(n,e),t[r]=!0)}return vo.isArray(e)?e.forEach(r):r(e),this}}Yo.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),vo.reduceDescriptors(Yo.prototype,((e,t)=>{let{value:n}=e,r=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(e){this[r]=e}}})),vo.freezeMethods(Yo);const Jo=Yo;function Xo(e,t){const n=this||Ho,r=t||n,a=Jo.from(r.headers);let s=r.data;return vo.forEach(e,(function(e){s=e.call(n,s,a.normalize(),t?t.status:void 0)})),a.normalize(),s}function Zo(e){return!(!e||!e.__CANCEL__)}function el(e,t,n){wo.call(this,null==e?"canceled":e,wo.ERR_CANCELED,t,n),this.name="CanceledError"}vo.inherits(el,wo,{__CANCEL__:!0});const tl=el;function nl(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new wo("Request failed with status code "+n.status,[wo.ERR_BAD_REQUEST,wo.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const rl=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a,s=0,i=0;return t=void 0!==t?t:1e3,function(o){const l=Date.now(),c=r[i];a||(a=l),n[s]=o,r[s]=l;let u=i,d=0;for(;u!==s;)d+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-a<t)return;const h=c&&l-c;return h?Math.round(1e3*d/h):void 0}};const al=function(e,t){let n,r,a=0,s=1e3/t;const i=function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();a=s,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[function(){const e=Date.now(),t=e-a;for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];t>=s?i(l,e):(n=l,r||(r=setTimeout((()=>{r=null,i(n)}),s-t)))},()=>n&&i(n)]},sl=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0;const a=rl(50,250);return al((n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,o=s-r,l=a(o);r=s;e({loaded:s,total:i,progress:i?s/i:void 0,bytes:o,rate:l||void 0,estimated:l&&i&&s<=i?(i-s)/l:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})}),n)},il=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ol=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return vo.asap((()=>e(...n)))}
vendor: 14,287 bytes, line 4
4,ll=zo.hasStandardBrowserEnv?(cl=new URL(zo.origin),ul=zo.navigator&&/(msie|trident)/i.test(zo.navigator.userAgent),e=>(e=new URL(e,zo.origin),cl.protocol===e.protocol&&cl.host===e.host&&(ul||cl.port===e.port))):()=>!0;var cl,ul;const dl=zo.hasStandardBrowserEnv?{write(e,t,n,r,a,s){const i=[e+"="+encodeURIComponent(t)];vo.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),vo.isString(r)&&i.push("path="+r),vo.isString(a)&&i.push("domain="+a),!0===s&&i.push("secure"),document.cookie=i.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:()=>null,remove(){}};function hl(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&r||0==n?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const pl=e=>e instanceof Jo?{...e}:e;function ml(e,t){t=t||{};const n={};function r(e,t,n,r){return vo.isPlainObject(e)&&vo.isPlainObject(t)?vo.merge.call({caseless:r},e,t):vo.isPlainObject(t)?vo.merge({},t):vo.isArray(t)?t.slice():t}function a(e,t,n,a){return vo.isUndefined(t)?vo.isUndefined(e)?void 0:r(void 0,e,0,a):r(e,t,0,a)}function s(e,t){if(!vo.isUndefined(t))return r(void 0,t)}function i(e,t){return vo.isUndefined(t)?vo.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function o(n,a,s){return s in t?r(n,a):s in e?r(void 0,n):void 0}const l={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:o,headers:(e,t,n)=>a(pl(e),pl(t),0,!0)};return vo.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=l[r]||a,i=s(e[r],t[r],r);vo.isUndefined(i)&&s!==o||(n[r]=i)})),n}const fl=e=>{const t=ml({},e);let n,{data:r,withXSRFToken:a,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:l}=t;if(t.headers=o=Jo.from(o),t.url=Po(hl(t.baseURL,t.url),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),vo.isFormData(r))if(zo.hasStandardBrowserEnv||zo.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(!1!==(n=o.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}if(zo.hasStandardBrowserEnv&&(a&&vo.isFunction(a)&&(a=a(t)),a||!1!==a&&ll(t.url))){const e=s&&i&&dl.read(i);e&&o.set(s,e)}return t},gl="undefined"!==typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=fl(e);let a=r.data;const s=Jo.from(r.headers).normalize();let i,o,l,c,u,{responseType:d,onUploadProgress:h,onDownloadProgress:p}=r;function m(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let f=new XMLHttpRequest;function g(){if(!f)return;const r=Jo.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());nl((function(e){t(e),m()}),(function(e){n(e),m()}),{data:d&&"text"!==d&&"json"!==d?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:r,config:e,request:f}),f=null}f.open(r.method.toUpperCase(),r.url,!0),f.timeout=r.timeout,"onloadend"in f?f.onloadend=g:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(g)},f.onabort=function(){f&&(n(new wo("Request aborted",wo.ECONNABORTED,e,f)),f=null)},f.onerror=function(){n(new wo("Network Error",wo.ERR_NETWORK,e,f)),f=null},f.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const a=r.transitional||Io;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new wo(t,a.clarifyTimeoutError?wo.ETIMEDOUT:wo.ECONNABORTED,e,f)),f=null},void 0===a&&s.setContentType(null),"setRequestHeader"in f&&vo.forEach(s.toJSON(),(function(e,t){f.setRequestHeader(t,e)})),vo.isUndefined(r.withCredentials)||(f.withCredentials=!!r.withCredentials),d&&"json"!==d&&(f.responseType=r.responseType),p&&([l,u]=sl(p,!0),f.addEventListener("progress",l)),h&&f.upload&&([o,c]=sl(h),f.upload.addEventListener("progress",o),f.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(i=t=>{f&&(n(!t||t.type?new tl(null,e,f):t),f.abort(),f=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const v=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);v&&-1===zo.protocols.indexOf(v)?n(new wo("Unsupported protocol "+v+":",wo.ERR_BAD_REQUEST,e)):f.send(a||null)}))},vl=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const a=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof wo?t:new tl(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,a(new wo(`timeout ${t} of ms exceeded`,wo.ETIMEDOUT))}),t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(a):e.removeEventListener("abort",a)})),e=null)};e.forEach((e=>e.addEventListener("abort",a)));const{signal:o}=r;return o.unsubscribe=()=>vo.asap(i),o}},yl=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,a=0;for(;a<n;)r=a+t,yield e.slice(a,r),a=r},bl=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},xl=(e,t,n,r)=>{const a=async function*(e,t){for await(const n of bl(e))yield*yl(n,t)}(e,t);let s,i=0,o=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await a.next();if(t)return o(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw o(t),t}},cancel:e=>(o(e),a.return())},{highWaterMark:2})},wl="function"===typeof fetch&&"function"===typeof Request&&"function"===typeof Response,jl=wl&&"function"===typeof ReadableStream,Nl=wl&&("function"===typeof TextEncoder?(Sl=new TextEncoder,e=>Sl.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Sl;const kl=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!!e(...n)}catch(gh){return!1}},El=jl&&kl((()=>{let e=!1;const t=new Request(zo.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),_l=jl&&kl((()=>vo.isReadableStream(new Response("").body))),Cl={stream:_l&&(e=>e.body)};var Al;wl&&(Al=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Cl[e]&&(Cl[e]=vo.isFunction(Al[e])?t=>t[e]():(t,n)=>{throw new wo(`Response type '${e}' is not supported`,wo.ERR_NOT_SUPPORT,n)})})));const Tl=async(e,t)=>{const n=vo.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(vo.isBlob(e))return e.size;if(vo.isSpecCompliantForm(e)){const t=new Request(zo.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return vo.isArrayBufferView(e)||vo.isArrayBuffer(e)?e.byteLength:(vo.isURLSearchParams(e)&&(e+=""),vo.isString(e)?(await Nl(e)).byteLength:void 0)})(t):n},Rl={http:null,xhr:gl,fetch:wl&&(async e=>{let{url:t,method:n,data:r,signal:a,cancelToken:s,timeout:i,onDownloadProgress:o,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:h}=fl(e);c=c?(c+"").toLowerCase():"text";let p,m=vl([a,s&&s.toAbortSignal()],i);const f=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let g;try{if(l&&El&&"get"!==n&&"head"!==n&&0!==(g=await Tl(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(vo.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=il(g,sl(ol(l)));r=xl(n.body,65536,e,t)}}vo.isString(d)||(d=d?"include":"omit");const a="credentials"in Request.prototype;p=new Request(t,{...h,signal:m,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:a?d:void 0});let s=await fetch(p);const i=_l&&("stream"===c||"response"===c);if(_l&&(o||i&&f)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=s[t]}));const t=vo.toFiniteNumber(s.headers.get("content-length")),[n,r]=o&&il(t,sl(ol(o),!0))||[];s=new Response(xl(s.body,65536,n,(()=>{r&&r(),f&&f()})),e)}c=c||"text";let v=await Cl[vo.findKey(Cl,c)||"text"](s,e);return!i&&f&&f(),await new Promise(((t,n)=>{nl(t,n,{data:v,headers:Jo.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:p})}))}catch(v){if(f&&f(),v&&"TypeError"===v.name&&/fetch/i.test(v.message))throw Object.assign(new wo("Network Error",wo.ERR_NETWORK,e,p),{cause:v.cause||v});throw wo.from(v,v&&v.code,e,p)}})};vo.forEach(Rl,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(gh){}Object.defineProperty(e,"adapterName",{value:t})}}));const Pl=e=>`- ${e}`,Ol=e=>vo.isFunction(e)||null===e||!1===e,Il=e=>{e=vo.isArray(e)?e:[e];const{length:t}=e;let n,r;const a={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!Ol(n)&&(r=Rl[(t=String(n)).toLowerCase()],void 0===r))throw new wo(`Unknown adapter '${t}'`);if(r)break;a[t||"#"+s]=r}if(!r){const e=Object.entries(a).map((e=>{let[t,n]=e;return`adapter ${t} `+(!1===n?"is not supported by the environment":"is not available in the build")}));let n=t?e.length>1?"since :\n"+e.map(Pl).join("\n"):" "+Pl(e[0]):"as no adapter specified";throw new wo("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function $l(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new tl(null,e)}function Ll(e){$l(e),e.headers=Jo.from(e.headers),e.data=Xo.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Il(e.adapter||Ho.adapter)(e).then((function(t){return $l(e),t.data=Xo.call(e,e.transformResponse,t),t.headers=Jo.from(t.headers),t}),(function(t){return Zo(t)||($l(e),t&&t.response&&(t.response.data=Xo.call(e,e.transformResponse,t.response),t.response.headers=Jo.from(t.response.headers))),Promise.reject(t)}))}const Fl="1.8.1",Ml={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ml[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Dl={};Ml.transitional=function(e,t,n){function r(e,t){return"[Axios v1.8.1] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,a,s)=>{if(!1===e)throw new wo(r(a," has been removed"+(t?" in "+t:"")),wo.ERR_DEPRECATED);return t&&!Dl[a]&&(Dl[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,a,s)}},Ml.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Ul={assertOptions:function(e,t,n){if("object"!==typeof e)throw new wo("options must be an object",wo.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const s=r[a],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new wo("option "+s+" must be "+n,wo.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new wo("Unknown option "+s,wo.ERR_BAD_OPTION)}},validators:Ml},zl=Ul.validators;class ql{constructor(e){this.defaults=e,this.interceptors={request:new Oo,response:new Oo}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(gh){}}throw n}}_request(e,t){"string"===typeof e?(t=t||{}).url=e:t=e||{},t=ml(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:a}=t;void 0!==n&&Ul.assertOptions(n,{silentJSONParsing:zl.transitional(zl.boolean),forcedJSONParsing:zl.transitional(zl.boolean),clarifyTimeoutError:zl.transitional(zl.boolean)},!1),null!=r&&(vo.isFunction(r)?t.paramsSerializer={serialize:r}:Ul.assertOptions(r,{encode:zl.function,serialize:zl.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Ul.assertOptions(t,{baseUrl:zl.spelling("baseURL"),withXsrfToken:zl.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&vo.merge(a.common,a[t.method]);a&&vo.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete a[e]})),t.headers=Jo.concat(s,a);const i=[];let o=!0;this.interceptors.request.forEach((function(e){"function"===typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let u,d=0;if(!o){const e=[Ll.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,l),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=i.length;let h=t;for(d=0;d<u;){const e=i[d++],t=i[d++];try{h=e(h)}catch(p){t.call(this,p);break}}try{c=Ll.call(this,h)}catch(p){return Promise.reject(p)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(e){return Po(hl((e=ml(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}vo.forEach(["delete","get","head","options"],(function(e){ql.prototype[e]=function(t,n){return this.request(ml(n||{},{method:e,url:t,data:(n||{}).data}))}})),vo.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,a){return this.request(ml(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ql.prototype[e]=t(),ql.prototype[e+"Form"]=t(!0)}));const Bl=ql;class Hl{constructor(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r}
4,e((function(e,r,a){n.reason||(n.reason=new tl(e,r,a),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Hl((function(t){e=t})),cancel:e}}}const Ql=Hl;const Wl={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(Wl).forEach((e=>{let[t,n]=e;Wl[n]=t}));const Vl=Wl;const Kl=function e(t){const n=new Bl(t),r=Oi(Bl.prototype.request,n);return vo.extend(r,Bl.prototype,n,{allOwnKeys:!0}),vo.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ml(t,n))},r}(Ho);Kl.Axios=Bl,Kl.CanceledError=tl,Kl.CancelToken=Ql,Kl.isCancel=Zo,Kl.VERSION=Fl,Kl.toFormData=Eo,Kl.AxiosError=wo,Kl.Cancel=Kl.CanceledError,Kl.all=function(e){return Promise.all(e)},Kl.spread=function(e){return function(t){return e.apply(null,t)}},Kl.isAxiosError=function(e){return vo.isObject(e)&&!0===e.isAxiosError},Kl.mergeConfig=ml,Kl.AxiosHeaders=Jo,Kl.formToJSON=e=>qo(vo.isHTMLForm(e)?new FormData(e):e),Kl.getAdapter=Il,Kl.HttpStatusCode=Vl,Kl.default=Kl;const Gl=Kl;class Yl extends Error{}Yl.prototype.name="InvalidTokenError";const Jl="https://animedb-production.up.railway.app",Xl=(0,_a.createContext)(),Zl=e=>{let{children:t}=e;const[n,r]=(0,_a.useState)({isLoggedIn:!1,user:null,loading:!0});(0,_a.useEffect)((()=>{(async()=>{try{const e=localStorage.getItem("token");if(!e)return void r((e=>({...e,loading:!1})));const t=await Gl.get(`${Jl}/api/users/profile`,{headers:{Authorization:`Bearer ${e}`}});r({isLoggedIn:!0,user:t.data.data,loading:!1})}catch(e){console.error("Auth check error:",e),a()}})()}),[]);const a=()=>{localStorage.removeItem("token"),r({isLoggedIn:!1,user:null,loading:!1})};return(0,Ti.jsx)(Xl.Provider,{value:{...n,login:async e=>{try{const t=await Gl.get(`${Jl}/api/users/profile`,{headers:{Authorization:`Bearer ${e}`}});localStorage.setItem("token",e),console.log("User profile response:",t.data),r({isLoggedIn:!0,user:t.data.data,loading:!1})}catch(t){throw a(),t}},logout:a,updateUser:e=>{r((t=>({...t,user:{...t.user,...e}})))}},children:t})},ec=()=>{const e=(0,_a.useContext)(Xl);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},tc=(0,_a.createContext)(),nc=e=>{let{children:t}=e;const[n,r]=(0,_a.useState)("dark");(0,_a.useEffect)((()=>{r(localStorage.getItem("theme")||(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"))}),[]),(0,_a.useEffect)((()=>{localStorage.setItem("theme",n),"dark"===n?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}),[n]);return(0,Ti.jsx)(tc.Provider,{value:{theme:n,toggleTheme:()=>{r((e=>"light"===e?"dark":"light"))}},children:t})};var rc="undefined"===typeof window||"Deno"in globalThis;function ac(){}function sc(e){return"number"===typeof e&&e>=0&&e!==1/0}function ic(e,t){return Math.max(e+(t||0)-Date.now(),0)}function oc(e,t){return"function"===typeof e?e(t):e}function lc(e,t){return"function"===typeof e?e(t):e}function cc(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:s,queryKey:i,stale:o}=e;if(i)if(r){if(t.queryHash!==dc(i,t.options))return!1}else if(!pc(t.queryKey,i))return!1;if("all"!==n){const e=t.isActive();if("active"===n&&!e)return!1;if("inactive"===n&&e)return!1}return("boolean"!==typeof o||t.isStale()===o)&&((!a||a===t.state.fetchStatus)&&!(s&&!s(t)))}function uc(e,t){const{exact:n,status:r,predicate:a,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(hc(t.options.mutationKey)!==hc(s))return!1}else if(!pc(t.options.mutationKey,s))return!1}return(!r||t.state.status===r)&&!(a&&!a(t))}function dc(e,t){return(t?.queryKeyHashFn||hc)(e)}function hc(e){return JSON.stringify(e,((e,t)=>
4vc(t)?Object.keys(t).sort().reduce(((e,n)=>(e[n]=t[n],e)),{}):t))}function pc(e,t){return e===t||typeof e===typeof t&&(!(!e||!t||"object"!==typeof e||"object"!==typeof t)&&!Object.keys(t).some((n=>!pc(e[n],t[n]))))}function mc(e,t){if(e===t)return e;const n=gc(e)&&gc(t);if(n||vc(e)&&vc(t)){const r=n?e:Object.keys(e),a=r.length,s=n?t:Object.keys(t),i=s.length,o=n?[]:{};let l=0;for(let c=0;c<i;c++){const a=n?c:s[c];(!n&&r.includes(a)||n)&&void 0===e[a]&&void 0===t[a]?(o[a]=void 0,l++):(o[a]=mc(e[a],t[a]),o[a]===e[a]&&void 0!==e[a]&&l++)}return a===i&&l===a?e:o}return t}function fc(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 gc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function vc(e){if(!yc(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!yc(n)&&(!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype)}function yc(e){return"[object Object]"===Object.prototype.toString.call(e)}function bc(e,t,n){return"function"===typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?mc(e,t):t}function xc(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=[...e,t];return n&&r.length>n?r.slice(1):r}function wc(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var jc=Symbol();function Nc(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==jc?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}var Sc=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},a=e=>setTimeout(e,0);const s=r=>{t?e.push(r):a((()=>{n(r)}))};return{batch:s=>{let i;t++;try{i=s()}finally{t--,t||(()=>{const t=e;e=[],t.length&&a((()=>{r((()=>{t.forEach((e=>{n(e)}))}))}))})()}return i},batchCalls:e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];s((()=>{e(...n)}))},schedule:s,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{a=e}}}(),kc=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(){}},Ec=new class extends kc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!rc&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e((e=>{"boolean"===typeof e?this.setFocused(e):this.onFocus()}))}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach((t=>{t(e)}))}isFocused(){return"boolean"===typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}},_c=new class extends kc{#r=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!rc&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#r!==e&&(this.#r=e,this.listeners.forEach((t=>{t(e)})))}isOnline(){return this.#r}};function Cc(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch((()=>{})),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}function Ac(e){return Math.min(1e3*2**e,3e4)}function Tc(e){return"online"!==(e??"online")||_c.isOnline()}var Rc=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Pc(e){return e instanceof Rc}function Oc(e){let t,n=!1,r=0,a=!1;const s=Cc(),i=()=>Ec.isFocused()&&("always"===e.networkMode||_c.isOnline())&&e.canRun(),o=()=>Tc(e.networkMode)&&e.canRun(),l=n=>{a||(a=!0,e.onSuccess?.(n),t?.(),s.resolve(n))},c=n=>{a||(a=!0,e.onError?.(n),t?.(),s.reject(n))},u=()=>new Promise((n=>{t=e=>{(a||i())&&n(e)},e.onPause?.()})).then((()=>{t=void 0,a||e.onContinue?.()})),d=()=>
4{if(a)return;let t;const s=0===r?e.initialPromise:void 0;try{t=s??e.fn()}catch(o){t=Promise.reject(o)}Promise.resolve(t).then(l).catch((t=>{if(a)return;const s=e.retry??(rc?0:3),o=e.retryDelay??Ac,l="function"===typeof o?o(r,t):o,h=!0===s||"number"===typeof s&&r<s||"function"===typeof s&&s(r,t);var p;!n&&h?(r++,e.onFail?.(r,t),(p=l,new Promise((e=>{setTimeout(e,p)}))).then((()=>i()?void 0:u())).then((()=>{n?c(t):d()}))):c(t)}))};return{promise:s,cancel:t=>{a||(c(new Rc(t)),e.abort?.())},continue:()=>(t?.(),s),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:o,start:()=>(o()?d():u().then(d),s)}}var Ic=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),sc(this.gcTime)&&(this.#a=setTimeout((()=>{this.optionalRemove()}),this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rc?1/0:3e5))}clearGcTimeout(){this.#a&&(clearTimeout(this.#a),this.#a=void 0)}},$c=class extends Ic{#s;#i;#o;#l;#c;#u;#d;constructor(e){super(),this.#d=!1,this.#u=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#l=e.client,this.#o=this.#l.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#s=function(e){const t="function"===typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"===typeof e.initialDataUpdatedAt?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"}}(this.options),this.state=e.state??this.#s,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#c?.promise}setOptions(e){this.options={...this.#u,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#o.remove(this)}setData(e,t){const n=bc(this.state.data,e,this.options);return this.#h({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#h({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#c?.promise;return this.#c?.cancel(e),t?t.then(ac).catch(ac):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#s)}isActive(){return this.observers.some((e=>!1!==lc(e.options.enabled,this)))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some((e=>e.getCurrentResult().isStale)):void 0===this.state.data)}isStaleByTime(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.state.isInvalidated||void 0===this.state.data||!ic(this.state.dataUpdatedAt,e)}onFocus(){const e=this.observers.find((e=>e.shouldFetchOnWindowFocus()));e?.refetch({cancelRefetch:!1}),this.#c?.continue()}onOnline(){const e=this.observers.find((e=>e.shouldFetchOnReconnect()));e?.refetch({cancelRefetch:!1}),this.#c?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter((t=>t!==e)),this.observers.length||(this.#c&&(this.#d?this.#c.cancel({revert:!0}):this.#c.cancelRetry()),this.scheduleGc()),this.#o.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#h({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus)if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#c)return this.#c.continueRetry(),this.#c.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find((e=>e.options.queryFn));e&&this.setOptions(e.options)}const n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#d=!0,n.signal)})},a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#l,state:this.state,fetchFn:()=>{const e=Nc(this.options,t),n={client:this.#l,queryKey:this.queryKey,meta:this.meta};return r(n),this.#d=!1,this.options.persister?this.options.persister(e,n,this):e(n)}};r(a),this.options.behavior?.onFetch(a,this),this.#i=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===a.fetchOptions?.meta||this.#h({type:"fetch",meta:a.fetchOptions?.meta});const s=e=>{Pc(e)&&e.silent||this.#h({type:"error",error:e}),Pc(e)||(this.#o.config.onError?.(e,this),this.#o.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#c=Oc({initialPromise:t?.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:e=>{if(void 0!==e){try{this.setData(e)}catch(t){return void s(t)}this.#o.config.onSuccess?.(e,this),this.#o.config.onSettled?.(e,this.state.error,this),this.scheduleGc()}else s(new Error(`${this.queryHash} data is undefined`))},onError:s,onFail:(e,t)=>{this.#h({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#h({type:"pause"})},onContinue:()=>{this.#h({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),this.#c.start()}#h(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...Lc(t.data,this.options),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const n=e.error;return Pc(n)&&n.revert&&this.#i?{...this.#i,fetchStatus:"idle"}
4:{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),Sc.batch((()=>{this.observers.forEach((e=>{e.onQueryUpdate()})),this.#o.notify({query:this,type:"updated",action:e})}))}};function Lc(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Tc(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}var Fc=class extends kc{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this.config=e,this.#p=new Map}#p;build(e,t,n){const r=t.queryKey,a=t.queryHash??dc(r,t);let s=this.get(a);return s||(s=new $c({client:e,queryKey:r,queryHash:a,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#p.has(e.queryHash)||(this.#p.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#p.get(e.queryHash);t&&(e.destroy(),t===e&&this.#p.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Sc.batch((()=>{this.getAll().forEach((e=>{this.remove(e)}))}))}get(e){return this.#p.get(e)}getAll(){return[...this.#p.values()]}find(e){const t={exact:!0,...e};return this.getAll().find((e=>cc(t,e)))}findAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this.getAll();return Object.keys(e).length>0?t.filter((t=>cc(e,t))):t}notify(e){Sc.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}onFocus(){Sc.batch((()=>{this.getAll().forEach((e=>{e.onFocus()}))}))}onOnline(){Sc.batch((()=>{this.getAll().forEach((e=>{e.onOnline()}))}))}},Mc=class extends Ic{#m;#f;#c;constructor(e){super(),this.mutationId=e.mutationId,this.#f=e.mutationCache,this.#m=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#m.includes(e)||(this.#m.push(e),this.clearGcTimeout(),this.#f.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#m=this.#m.filter((t=>t!==e)),this.scheduleGc(),this.#f.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#m.length||("pending"===this.state.status?this.scheduleGc():this.#f.remove(this))}continue(){return this.#c?.continue()??this.execute(this.state.variables)}async execute(e){this.#c=Oc({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#h({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#h({type:"pause"})},onContinue:()=>{this.#h({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#f.canRun(this)});const t="pending"===this.state.status,n=!this.#c.canStart();try{if(!t){this.#h({type:"pending",variables:e,isPaused:n}),await(this.#f.config.onMutate?.(e,this));const t=await(this.options.onMutate?.(e));t!==this.state.context&&this.#h({type:"pending",context:t,variables:e,isPaused:n})}const r=await this.#c.start();return await(this.#f.config.onSuccess?.(r,e,this.state.context,this)),await(this.options.onSuccess?.(r,e,this.state.context)),await(this.#f.config.onSettled?.(r,null,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(r,null,e,this.state.context)),this.#h({type:"success",data:r}),r}catch(r){try{throw await(this.#f.config.onError?.(r,e,this.state.context,this)),await(this.options.onError?.(r,e,this.state.context)),await(this.#f.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(void 0,r,e,this.state.context)),r}finally{this.#h({type:"error",error:r})}}finally{this.#f.runNext(this)}}#h(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};
4case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),Sc.batch((()=>{this.#m.forEach((t=>{t.onMutationUpdate(e)})),this.#f.notify({mutation:this,type:"updated",action:e})}))}};var Dc=class extends kc{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this.config=e,this.#g=new Set,this.#v=new Map,this.#y=0}#g;#v;#y;build(e,t,n){const r=new Mc({mutationCache:this,mutationId:++this.#y,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#g.add(e);const t=Uc(e);if("string"===typeof t){const n=this.#v.get(t);n?n.push(e):this.#v.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#g.delete(e)){const t=Uc(e);if("string"===typeof t){const n=this.#v.get(t);if(n)if(n.length>1){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&this.#v.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Uc(e);if("string"===typeof t){const n=this.#v.get(t),r=n?.find((e=>"pending"===e.state.status));return!r||r===e}return!0}runNext(e){const t=Uc(e);if("string"===typeof t){const n=this.#v.get(t)?.find((t=>
4t!==e&&t.state.isPaused));return n?.continue()??Promise.resolve()}return Promise.resolve()}clear(){Sc.batch((()=>{this.#g.forEach((e=>{this.notify({type:"removed",mutation:e})})),this.#g.clear(),this.#v.clear()}))}getAll(){return Array.from(this.#g)}find(e){const t={exact:!0,...e};return this.getAll().find((e=>uc(t,e)))}findAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getAll().filter((t=>uc(e,t)))}notify(e){Sc.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}resumePausedMutations(){const e=this.getAll().filter((e=>e.state.isPaused));return Sc.batch((()=>Promise.all(e.map((e=>e.continue().catch(ac))))))}};function Uc(e){return e.options.scope?.id}function zc(e){return{onFetch:(t,n)=>{const r=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let o={pages:[],pageParams:[]},l=0;const c=async()=>{let n=!1;const c=Nc(t.options,t.fetchOptions),u=async(e,r,a)=>{if(n)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);const s={client:t.client,queryKey:t.queryKey,pageParam:r,direction:a?"backward":"forward",meta:t.options.meta};var i;i=s,Object.defineProperty(i,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener("abort",(()=>{n=!0})),t.signal)});const o=await c(s),{maxPages:l}=t.options,u=a?wc:xc;return{pages:u(e.pages,o,l),pageParams:u(e.pageParams,r,l)}};if(a&&s.length){const e="backward"===a,t={pages:s,pageParams:i},n=(e?Bc:qc)(r,t);o=await u(t,n,e)}else{const t=e??s.length;do{const e=0===l?i[0]??r.initialPageParam:qc(r,o);if(l>0&&null==e)break;o=await u(o,e),l++}while(l<t)}return o};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function qc(e,t){let{pages:n,pageParams:r}=t;const a=n.length-1;return n.length>0?e.getNextPageParam(n[a],n,r[a],r):void 0}function Bc(e,t){let{pages:n,pageParams:r}=t;return n.length>0?e.getPreviousPageParam?.(n[0],n,r[0],r):void 0}var Hc=_a.createContext(void 0),Qc=e=>{const t=_a.useContext(Hc);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Wc=e=>{let{client:t,children:n}=e;return _a.useEffect((()=>(t.mount(),()=>{t.unmount()})),[t]),(0,Ti.jsx)(Hc.Provider,{value:t,children:n})};const Vc=()=>(0,Ti.jsxs)(ki.k2,{to:"/",className:"navbar-logo",children:[(0,Ti.jsx)("span",{className:"logo-text",children:"Anime"}),(0,Ti.jsx)("span",{className:"logo-highlight",children:"Nexus"})]}),Kc=e=>{let{isMobile:t,closeMenu:n}=e;const[r,a]=(0,_a.useState)(!1),s=()=>{t&&n&&n()},i=t?"mobile-nav-item":"nav-item",o=t?"mobile-nav-dropdown":"nav-dropdown",l=t?"mobile-dropdown-toggle":"dropdown-toggle",c=t?"mobile-dropdown-menu":"dropdown-menu",u=t?"mobile-dropdown-item":"dropdown-item";return(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)(ki.k2,{to:"/anime",className:e=>{let{isActive:t}=e;return`${i} ${t?"active":""}`},onClick:s,end:!0,children:"Anime"}),(0,Ti.jsx)(ki.k2,{to:"/manga",className:e=>{let{isActive:t}=e;return`${i} ${t?"active":""}`},onClick:s,end:!0,children:"Manga"}),(0,Ti.jsx)(ki.k2,{to:"/characters",className:e=>{let{isActive:t}=e;return`${i} ${t?"active":""}`},onClick:s,end:!0,children:"Characters"}),(0,Ti.jsx)(ki.k2,{to:"/community",className:e=>{let{isActive:t}=e;return`${i} ${t?"active":""}`},onClick:s,end:!0,children:"Community"}),(0,Ti.jsxs)("div",{className:o,children:[(0,Ti.jsxs)("button",{className:l,onClick:e=>{t&&(e.preventDefault(),a(!r))},"aria-haspopup":"true","aria-expanded":t?r:void 0,children:["More",(0,Ti.jsx)("span",{className:"dropdown-arrow",style:t&&r?{transform:"rotate(180deg)"}:{},children:"\u25bc"})]}),t&&r||!t?(0,Ti.jsxs)("div",{className:c,role:"menu",children:[(0,Ti.jsx)(ki.k2,{to:"/About",className:u,onClick:s,children:"About"}),(0,Ti.jsx)(ki.k2,{to:"/faq",className:u,onClick:s,children:"FAQs"}),(0,Ti.jsx)(ki.k2,{to:"/support",className:u,onClick:s,children:"Support"})]}):null]})]})},Gc=()=>{const{theme:e,toggleTheme:t}=(()=>{const e=(0,_a.useContext)(tc);if(void 0===e)throw new Error("useTheme must be used within a ThemeProvider");return e})();return(0,Ti.jsx)("button",{onClick:t,className:"theme-toggle-btn","aria-label":`Switch to ${"dark"===e?"light":"dark"} mode`,children:"dark"===e?"\u2600\ufe0f":"\ud83c\udf19"})},Yc="https://animedb-production.up.railway.app",Jc={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_PLACEHOLDER_BACKDROP:"https://res.cloudinary.com/dpz6ivjry/image/upload/v1741666344/740446_zkrklo.jpg",REACT_APP_API_BASE_URL:"https://animedb-production.up.railway.app"}.REACT_APP_PLACEHOLDER_IMAGE||"https://via.placeholder.com/50",Xc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{searchManga:n=!0,debounceTime:r=300,resultLimit:a=5}=t,[s,i]=(0,_a.useState)(e),[o,l]=(0,_a.useState)({anime:[],manga:[],characters:[]}),[c,u]=(0,_a.useState)(!1),[d,h]=(0,_a.useState)(!1),[p,m]=(0,_a.useState)(null),f=(0,_a.useRef)(null),g=(0,_a.useRef)(""),v=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.error(`[useSearch] ${e}`,...n),m(e)};(0,_a.useEffect)((()=>()=>{f.current&&clearTimeout(f.current)}),[]);const y=(0,_a.useCallback)((()=>
4{l({anime:[],manga:[],characters:[]}),h(!1),m(null),g.current=""}),[]),b=(0,_a.useCallback)((async e=>{if(g.current=e,e.trim()){h(!0),u(!0),m(null);try{const t=e,r=[fetch(`${Yc}/api/anime/search?query=${encodeURIComponent(e)}`),n?fetch(`${Yc}/api/manga/search?query=${encodeURIComponent(e)}`):Promise.resolve(null),fetch(`${Yc}/api/characters/search?query=${encodeURIComponent(e)}`)],[s,i,o]=await Promise.all(r);if(t!==g.current)return;let c=[];if(s&&s.ok)try{c=await s.json(),c.length}catch(p){v("Error parsing anime search results:",p)}else s&&v(`Anime search failed with status: ${s.status}`);if(t!==g.current)return;let u=[];if(n&&i&&i.ok)try{u=await i.json(),u.length}catch(p){v("Error parsing manga search results:",p)}else n&&i&&v(`Manga search failed with status: ${i.status}`);if(t!==g.current)return;let d=[];if(o&&o.ok)try{d=await o.json(),d.length}catch(p){v("Error parsing character search results:",p)}else o&&v(`Character search failed with status: ${o.status}`);if(t!==g.current)return;l({anime:c.slice(0,a),manga:n?u.slice(0,a):[],characters:d.slice(0,a)})}catch(p){v("Error fetching search results:",p)}finally{e===g.current&&u(!1)}}else y()}),[y,n,a]),x=(0,_a.useCallback)((e=>{f.current&&clearTimeout(f.current),f.current=setTimeout((()=>{b(e)}),r)}),[b,r]),w=(0,_a.useCallback)((e=>{i(e),e&&e.trim()?(g.current=e,x(e)):y()}),[y,x]),j=o.anime.length>0||o.manga.length>0||o.characters.length>0,N=d&&j,S=(0,_a.useCallback)((e=>{e.target.src=Jc}),[]);return{query:s,results:o,isSearching:c,hasTyped:d,hasResults:j,showResults:N,error:p,currentQuery:g.current,setQuery:w,clearResults:y,handleImageError:S,placeholderImage:Jc}},Zc=e=>{var t;let{onExpandedChange:n}=e;const[r,a]=(0,_a.useState)(!1),s=(0,_a.useRef)(null),i=(0,_a.useRef)(null),o=(0,ki.Zp)(),{query:l,setQuery:c,results:u,isSearching:d,hasResults:h,clearResults:p}=Xc();(0,_a.useEffect)((()=>{n&&n(r)}),[r,n]),(0,_a.useEffect)((()=>{r&&s.current&&s.current.focus()}),[r]),(0,_a.useEffect)((()=>{const e=e=>{if(r){var t,n;const r=document.querySelector(".navbar-search-form"),o=null===r||void 0===r?void 0:r.querySelector(".search-toggle");!(null!==(t=s.current)&&void 0!==t&&t.contains(e.target))&&!(null!==(n=i.current)&&void 0!==n&&n.contains(e.target))&&!(null!==r&&void 0!==r&&r.contains(e.target))&&e.target!==o&&!(null!==o&&void 0!==o&&o.contains(e.target))&&(a(!1),p())}};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[r,p]),(0,_a.useEffect)((()=>{const e=e=>{"Escape"===e.key&&r&&(a(!1),p())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[r,p]);const m=e=>{e.preventDefault(),l.trim()&&(o(`/search?query=${encodeURIComponent(l)}`),a(!1),c(""))};return(0,Ti.jsxs)("div",{className:"navbar-search",children:[(0,Ti.jsxs)("form",{className:"navbar-search-form "+(r?"expanded":""),onSubmit:m,children:[(0,Ti.jsx)("div",{className:"search-icon-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:r?"40px":"100%",position:"relative",height:"100%"},children:(0,Ti.jsx)("button",{type:"button",className:"search-toggle","aria-label":"Search",onClick:e=>{e.preventDefault(),a(!r),r||setTimeout((()=>{var e;null===(e=s.current)||void 0===e||e.focus()}),100)},style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:(0,Ti.jsxs)("svg",{className:"search-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{width:"20px",height:"20px",position:r?"absolute":"static",left:r?"10px":"auto",top:r?"50%":"auto",transform:r?"translateY(-50%)":"none"},children:[(0,Ti.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,Ti.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})})}),(0,Ti.jsx)("input",{ref:s,type:"text",placeholder:"Search anime or characters...",className:"navbar-search-input",value:l,onChange:e=>c(e.target.value),"aria-label":"Search anime or characters"}),r&&(0,Ti.jsx)("button",{type:"button",className:"search-close-btn","aria-label":"Close search",onClick:()=>{a(!1),c("")},style:{background:"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:"8px",position:"absolute",right:"5
4px",top:"50%",transform:"translateY(-50%)",zIndex:2},children:(0,Ti.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:[(0,Ti.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,Ti.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),d&&(0,Ti.jsx)("div",{className:"live-search-loading",style:{position:"absolute",right:"1rem",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:"0.5rem",zIndex:2},children:(0,Ti.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{animation:"spin 1s linear infinite"},children:(0,Ti.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})})]}),r&&h&&(0,Ti.jsxs)("div",{className:"navbar-search-dropdown",ref:i,onMouseDown:e=>e.preventDefault(),children:[u.anime.length>0&&(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)("div",{className:"navbar-search-category",children:"Anime"}),u.anime.map((e=>{var t,n;return(0,Ti.jsxs)("div",{className:"navbar-search-item",onClick:()=>{o(`/anime/${e.id}`),a(!1),c("")},role:"button",tabIndex:"0","aria-label":`Go to ${e.title} page`,children:[(0,Ti.jsx)("div",{className:"search-item-thumbnail",children:(0,Ti.jsx)("img",{src:(null===(t=e.images)||void 0===t||null===(n=t.jpg)||void 0===n?void 0:n.small_image_url)||"https://via.placeholder.com/50",alt:e.title,loading:"lazy"})}),(0,Ti.jsxs)("div",{className:"search-item-details",children:[(0,Ti.jsx)("div",{className:"search-item-title",children:e.titleEnglish||e.title}),(0,Ti.jsx)("div",{className:"search-item-type",children:e.type||"Anime"})]})]},`anime-${e.mal_id||e.id}`)}))]}),(null===(t=u.manga)||void 0===t?void 0:t.length)>0&&(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)("div",{className:"navbar-search-category",children:"Manga"}),u.manga.map((e=>{var t,n;return(0,Ti.jsxs)("div",{className:"navbar-search-item",onClick:()=>{o(`/manga/${e.id}`),a(!1),c("")},role:"button",tabIndex:"0","aria-label":`Go to ${e.title} page`,children:[(0,Ti.jsx)("div",{className:"search-item-thumbnail",children:(0,Ti.jsx)("img",{src:(null===(t=e.images)||void 0===t||null===(n=t.jpg)||void 0===n?void 0:n.small_image_url)||"https://via.placeholder.com/50",alt:e.title,loading:"lazy"})}),(0,Ti.jsxs)("div",{className:"search-item-details",children:[(0,Ti.jsx)("div",{className:"search-item-title",children:e.titleEnglish||e.title}),(0,Ti.jsx)("div",{className:"search-item-type",children:e.type||"Manga"})]})]},`manga-${e.mal_id||e.id}`)}))]}),u.characters.length>0&&(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)("div",{className:"navbar-search-category",children:"Characters"}),u.characters.map((e=>{var t,n;return(0,Ti.jsxs)("div",{className:"navbar-search-item",onClick:()=>{o(`/characters/${e._id}`),a(!1),c("")},role:"button",tabIndex:"0","aria-label":`Go to ${e.name} page`,children:[(0,Ti.jsx)("div",{className:"search-item-thumbnail",children:(0,Ti.jsx)("img",{src:(null===(t=e.images)||void 0===t||null===(n=t.webp)||void 0===n?void 0:n.image_url)||"https://via.placeholder.com/50",alt:e.name,loading:"lazy"})}),(0,Ti.jsxs)("div",{className:"search-item-details",children:[(0,Ti.jsx)("div",{className:"search-item-title",children:e.name}),(0,Ti.jsx)("div",{className:"search-item-type",children:"Character"})]})]},`character-${e.mal_id||e.id}`)}))]}),l.trim()&&(0,Ti.jsx)("div",{className:"view-all-results",children:(0,Ti.jsxs)("button",{onClick:m,className:"view-all-button",children:['View All Results for "',l,'"']})})]})]})},eu=e=>{var t;let{isMobile:n}=e;const{isLoggedIn:r,logout:a,user:s}=ec(),i=(0,ki.Zp)(),o=n?"auth-section":"auth-section desktop-auth";return(0,Ti.jsx)("div",{className:o,children:r?(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)(ki.k2,{to:"/profile",className:"profile-button-circle",children:null!==s&&void 0!==s&&s.profilePicture?(0,Ti.jsx)("img",{src:s.profilePicture,alt:"Profile",className:"profile-picture"}):(0,Ti.jsx)("span",{className:"profile-icon-fallback",children:(null===s||void 0===s||null===(t=s.name)||void 0===t?void 0:t.charAt(0).toUpperCase())||"U"})}),(0,Ti.jsx)("button",{onClick:()=>{a(),i("/")},className:"logout-button",children:"Logout"})]}):(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)(ki.k2,{to:"/login",className:"auth-button",children:"Login"}),(0,Ti.jsx)(ki.k2,{to:"/signup",className:"auth-button signup-button",children:"Sign Up"})]})})},tu=()=>{const[e,t]=(0,_a.useState)(!1),n=(0,_a.useRef)(null);return(0,Ti.jsx)("nav",{className:"navbar desktop-navbar "+(e?"search-expanded":""),ref:n,children:(0,Ti.jsxs)("div",{className:"navbar-container",children:[(0,Ti.jsx)(Vc,{}),(0,Ti.jsx)("div",{className:"desktop-nav-links",children:(0,Ti.jsx)(Kc,{isMobile:!1})}),(0,Ti.jsxs)("div",{className:"navbar-right",children:[(0,Ti.jsx)("div",{className:"theme-toggle-wrapper",children:(0,Ti.jsx)(Gc,{})}),(0,Ti.jsx)(Zc,{onExpandedChange:e=>{t(e)}}),(0,Ti.jsx)(eu,{isMobile:!1})]})]})})},nu=()=>{const[e,t]=(0,_a.useState)(!1),[n,r]=(0,_a.useState)(!1),a=(0,_a.useRef)(null),s=(0,_a.useRef)(null),i=(0,ki.zy)();(0,_a.useEffect)((()=>{t(!1)}),[i.pathname]),(0,_a.useEffect)((()=>(document.body.style.overflow=e?"hidden":"",()=>{document.body.style.overflow=""})),[e]),(0,_a.useEffect)((()=>{const n=n=>{!e||!a.current||a.current.contains(n.target)||!s.current||s.current.contains(n.target)||n.target.closest(".menu-toggle")||n.target.closest(".mobile-nav-item")||n.target.closest(".mobile-dropdown-item")||t(!1)};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}}),[e]);const o=()=>{t(!1)};return(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)("nav",{className:"navbar mobile-navbar "+(n?"search-expanded":""),ref:a,children:(0,Ti.jsxs)("div",{className:"navbar-container",children:[!n&&(0,Ti.jsx)(Vc,{}),!n&&(0,Ti.jsx)("button",{className:"menu-toggle",onClick:()=>t(!e),"aria-label":e?"Close menu":"Open menu","aria-expanded":e,children:(0,Ti.jsxs)("div",{className:"hamburger "+(e?"open":""),children:[(0,Ti.jsx)("span",{}),(0,Ti.jsx)("span",{}),(0,Ti.jsx)("span",{})]})}),(0,Ti.jsx)("div",{className:"navbar-right",children:(0,Ti.jsx)(Zc,{onExpandedChange:e=>{r(e)}})})]})}),(0,Ti.jsx)("div",{className:"mobile-menu "+(e?"active":""),onClick:e=>{e.target.classList.contains("mobile-nav-item")||e.target.classList.contains("mobile-dropdown-item")||e.stopPropagation()},ref:s,children:(0,Ti.jsxs)("div",{className:"mobile-menu-content",children:[(0,Ti.jsx)("div",{className:"mobile-nav-links",children:(0,Ti.jsx)(Kc,{isMobile:!0,closeMenu:o})}),(0,Ti.jsxs)("div",{className:"mobile-menu-bottom",children:[(0,Ti.jsx)("div",{className:"mobile-theme-toggle",children:(0,Ti.jsx)(Gc,{})}),(0,Ti.jsx)(eu,{isMobile:!0})]})]})}),(0,Ti.jsx)("div",{className:"menu-backdrop "+(e?"active":""),onClick:o})]})},ru=()=>{const[e,t]=(0,_a.useState)(window.innerWidth<=1024);return(0,_a.useEffect)((()=>{const e=()=>{t(window.innerWidth<=1024)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),e?(0,Ti.jsx)(nu,{}):(0,Ti.jsx)(tu,{})}
4,au=e=>{let{message:t="Loading..."}=e;return(0,Ti.jsxs)("div",{className:"loading-spinner-container",children:[(0,Ti.jsx)("div",{className:"spinner"}),(0,Ti.jsx)("p",{className:"loading-message",children:t})]})},su={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_PLACEHOLDER_BACKDROP:"https://res.cloudinary.com/dpz6ivjry/image/upload/v1741666344/740446_zkrklo.jpg",REACT_APP_API_BASE_URL:"https://animedb-production.up.railway.app"}.REACT_APP_PLACEHOLDER_IMAGE||"https://via.placeholder.com/50",iu=()=>{const e=(0,ki.Zp)(),t=(0,_a.useRef)(null),{query:n,setQuery:r,results:a,isSearching:s,hasTyped:i,hasResults:o,showResults:l,clearResults:c}=Xc();(0,_a.useEffect)((()=>{const e=e=>{t.current&&!t.current.contains(e.target)&&c()};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[c]);const u=t=>{t.preventDefault(),n.trim()&&e(`/search?query=${encodeURIComponent(n)}`)},d=(t,n)=>{if(!t)return;const a=t.id||t.id||t.mal_id;a?("anime"===n?e(`/anime/${a}`):"manga"===n?e(`/manga/${a}`):"character"===n&&e(`/character/${a}`),r(""),c()):console.error(`Cannot navigate: Missing ID for ${n} item`,t)};return(0,Ti.jsx)("section",{className:"search-section",children:(0,Ti.jsxs)("form",{onSubmit:u,className:"search-form",children:[(0,Ti.jsxs)("div",{className:"search-input-container",ref:t,children:[(0,Ti.jsx)("input",{type:"text",placeholder:"Search for anime, manga, or characters...",value:n,onChange:e=>r(e.target.value),onFocus:()=>{n.trim()||c()},className:"search-input"}),s&&(0,Ti.jsx)("div",{className:"live-search-loading",children:(0,Ti.jsx)("div",{className:"search-spinner",children:(0,Ti.jsx)("div",{className:"spinner-mini"})})}),l&&(0,Ti.jsxs)("div",{className:"live-search-dropdown",children:[a.anime.length>0&&(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsxs)("div",{className:"search-category",children:[(0,Ti.jsx)("span",{className:"category-icon anime-icon",children:"\ud83c\udfac"}),"Anime"]}),a.anime.map(((e,t)=>{var n,r;return(0,Ti.jsxs)("div",{className:"search-result-item",onClick:()=>d(e,"anime"),children:[(0,Ti.jsx)("div",{className:"search-result-thumbnail",children:(0,Ti.jsx)("img",{src:(null===(n=e.images)||void 0===n||null===(r=n.jpg)||void 0===r?void 0:r.small_image_url)||su,alt:e.title,onError:e=>{e.target.src=su}})}),(0,Ti.jsxs)("div",{className:"search-result-details",children:[(0,Ti.jsx)("div",{className:"search-result-title",children:e.titleEnglish||e.title}),(0,Ti.jsxs)("div",{className:"search-result-type",children:[(0,Ti.jsx)("span",{className:"result-type-badge",style:{background:"var(--anime-accent-primary)"},children:e.type||"Anime"}),e.score&&(0,Ti.jsxs)("span",{className:"result-score",children:["\u2605 ",e.score]})]})]})]},`anime-${e.id||e.mal_id||t}`)}))]}),a.manga.length>0&&(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsxs)("div",{className:"search-category",children:[(0,Ti.jsx)("span",{className:"category-icon manga-icon",children:"\ud83d\udcda"}),"Manga"]}),a.manga.map(((e,t)=>{var n,r;return(0,Ti.jsxs)("div",{className:"search-result-item",onClick:()=>d(e,"manga"),children:[(0,Ti.jsx)("div",{className:"search-result-thumbnail",children:(0,Ti.jsx)("img",{src:(null===(n=e.images)||void 0===n||null===(r=n.jpg)||void 0===r?void 0:r.small_image_url)||su,alt:e.title,onError:e=>{e.target.src=su}})}),(0,Ti.jsxs)("div",{className:"search-result-details",children:[(0,Ti.jsx)("div",{className:"search-result-title",children:e.titleEnglish||e.title}),(0,Ti.jsxs)("div",{className:"search-result-type",children:[(0,Ti.jsx)("span",{className:"result-type-badge",style:{background:"var(--manga-accent-primary)"},children:e.type||"Manga"}),e.score&&(0,Ti.jsxs)("span",{className:"result-score",children:["\u2605 ",e.score]})]})]})]},`manga-${e.id||e.mal_id||t}`)}))]}),a.characters.length>0&&(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsxs)("div",{className:"search-category",children:[(0,Ti.jsx)("span",{className:"category-icon character-icon",children:"\ud83d\udc64"}),"Characters"]}),a.characters.map(((e,t)=>{var n,r,a,s;return(0,Ti.jsxs)("div",{className:"search-result-item",onClick:()=>d(e,"character"),children:[(0,Ti.jsx)("div",{className:"search-result-thumbnail",children:(0,Ti.jsx)("img",{src:(null===(n=e.images)||void 0===n||null===(r=n.webp)||void 0===r?void 0:r.image_url)||(null===(a=e.images)||void 0===a||null===(s=a.jpg)||void 0===s?void 0:s.image_url)||su,alt:e.name,onError:e=>{e.target.src=su}})}),(0,Ti.jsxs)("div",{className:"search-result-details",children:[(0,Ti.jsx)("div",{className:"search-result-title",children:e.name}),(0,Ti.jsxs)("div",{className:"search-result-type",children:[(0,Ti.jsx)("span",{className:"result-type-badge character-badge",children:"Character"}),e.favorites&&(0,Ti.jsxs)("span",{className:"result-favorites",children:["\u2764 ",e.favorites]})]})]})]},`character-${e.id||e.mal_id||t}`)}))]}),s&&!o&&n.trim()&&(0,Ti.jsx)("div",{className:"search-loading-state",children:(0,Ti.jsx)(au,{})}),!s&&!o&&i&&n.trim()&&(0,Ti.jsx)("div",{className:"no-results-message",children:(0,Ti.jsxs)("p",{children:['No results found for "',n,'"']})}),l&&n.trim()&&o&&(0,Ti.jsx)("div",{className:"view-all-results",children:(0,Ti.jsxs)("button",{onClick:u,className:"view-all-button",children:['View All Results for "',n,'"']})})]})]}),(0,Ti.jsx)("button",{type:"submit",className:"search-button",children:"Search"})]})})},ou=()=>{const[e,t]=(0,_a.useState)(!0);return(0,_a.useEffect)((()=>{"true"===localStorage.getItem("animeAwardsBannerDismissed")&&t(!1)}),[]),e?(0,Ti.jsxs)("div",{className:"anime-awards-banner",children:[(0,Ti.jsxs)("div",{className:"banner-background-elements",children:[(0,Ti.jsx)("div",{className:"circle circle-1"}),(0,Ti.jsx)("div",{className:"circle circle-2"}),(0,Ti.jsx)("div",{className:"star star-1"}),(0,Ti.jsx)("div",{className:"star star-2"}),(0,Ti.jsx)("div",{className:"star star-3"})]}),(0,Ti.jsxs)("div",{className:"banner-content",children:[(0,Ti.jsx)("div",{className:"banner-logo-section",children:(0,Ti.jsxs)("div",{className:"banner-logo",children:[(0,Ti.jsx)("img",{src:"https://upload.wikimedia.org/wikipedia/commons/8/8a/Crunchyroll-Icon-White.svg",alt:"Crunchyroll",width:"40",height:"40",className:"crunchyroll-logo"}),(0,Ti.jsx)("div",{className:"awards-badge",children:"AWARDS"})]})}),(0,Ti.jsxs)("div",{className:"banner-text",children:[(0,Ti.jsx)("h2",{children:"Anime Awards 2025"}),(0,Ti.jsxs)("p",{children:["Vote for your favorite anime of the year!"," ",(0,Ti.jsx)("span",{className:"highlight",children:"Voting ends April 14"})]})]}),(0,Ti.jsxs)("div",{className:"banner-actions",children:[(0,Ti.jsx)("a",{href:"https://www.crunchyroll.com/animeawards/",target:"_blank",rel:"noopener noreferrer",className:"banner-button",children:"Vote Now"}),(0,Ti.jsx)("button",{className:"banner-dismiss",onClick:()=>{t(!1),localStorage.setItem("animeAwardsBannerDismissed","true")},"aria-label":"Dismiss banner",children:(0,Ti.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Ti.jsx)("path",{d:"M18 6L6 18M6 6L18 18",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]})]}):null},lu=(0,_a.lazy)((()=>Promise.resolve().then(n.bind(n,202)))),cu=(0,_a.lazy)((()=>Promise.resolve().then(n.bind(n,838)))),uu=(0,_a.lazy)((()=>n.e(199).then(n.bind(n,199)))),du=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.error(e,...n)},hu=()=>(0,Ti.jsxs)("div",{className:"home",children:[(0,Ti.jsxs)("div",{className:"hero-section",children:[(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"40px",width:"80%",margin:"0 auto"}}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"20px",width:"60%",margin:"15px auto"}})]}),(0,Ti.jsx)("div",{className:"search-skeleton",children:(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"50px",width:"80%",margin:"20px auto"}})}),[1,2,3,4,5].map((e=>(0,Ti.jsxs)("section",{className:"media-section",children:[(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"24px",width:"40%",marginBottom:"15px"}}),(0,Ti.jsx)("div",{className:"cards-container",children:[1,2,3,4].map((e=>(0,Ti.jsxs)("div",{className:"media-card skeleton",children:[(0,Ti.jsx)("div",{className:"skeleton-image"}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"20px",width:"80%",margin:"10px 0"}}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"16px",width:"60%"}})]},e)))})]},e)))]}),pu=e=>{let{title:t,items:n,componentType:r,cardLayout:a}=e;const[s,i]=(0,_a.useState)(!1),o=(0,_a.useRef)(null);if((0,_a.useEffect)((()=>{const e=new IntersectionObserver((t=>{let[n]=t;n.isIntersecting&&(i(!0),e.disconnect())}),{rootMargin:"200px"});return o.current&&e.observe(o.current),()=>{o.current&&e.disconnect()}}),[]),!n||!Array.isArray(n)||0===n.length)return(0,Ti.jsxs)("section",{className:"media-section",ref:o,children:[(0,Ti.jsx)("h2",{className:"section-title",children:(0,Ti.jsx)("span",{children:t})}),(0,Ti.jsxs)("div",{className:"no-data-card",children:["No ",r," data available",!1]})]});const l=n.slice(0,8);return(0,Ti.jsxs)("section",{className:"media-section",ref:o,children:[(0,Ti.jsx)("h2",{className:"section-title",children:(0,Ti.jsx)("span",{children:t})}),s?(0,Ti.jsx)(_a.Suspense,{fallback:(0,Ti.jsx)("div",{className:"cards-container skeleton-container",children:[1,2,3,4].map((e=>(0,Ti.jsxs)("div",{className:"media-card skeleton",children:[(0,Ti.jsx)("div",{className:"skeleton-image"}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"20px",width:"80%",margin:"10px 0"}})]},e)))}),children:"manga"===r?(0,Ti.jsx)(cu,{mangas:l,layout:a}):"character"===r?(0,Ti.jsx)(uu,{characters:l,layout:a}):(0,Ti.jsx)(lu,{animes:l,layout:a})}):(0,Ti.jsx)("div",{className:"cards-container skeleton-container",children:[1,2,3,4].map((e=>(0,Ti.jsxs)("div",{className:"media-card skeleton",children:[(0,Ti.jsx)("div",{className:"skeleton-image"}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"20px",width:"80%",margin:"10px 0"}})]},e)))})]})},mu=()=>{const[e,t]=(0,_a.useState)({topRatedAnime:[],currentlyAiringAnime:[],topRatedManga:[],currentlyPublishingManga:[],topCharacters:[]}),[n,r]=(0,_a.useState)(!0),[a,s]=(0,_a.useState)(null),[i,o]=(0,_a.useState)("horizontal"),[l,c]=(0,_a.useState)(!1),{topRatedAnime:u,currentlyAiringAnime:d,topRatedManga:h,currentlyPublishingManga:p,topCharacters:m}=e,f=((0,_a.useCallback)((()=>{c((e=>!e))}),[]),(0,_a.useCallback)((()=>{o(window.innerWidth<=768?"vertical":"horizontal")}),[]));(0,_a.useEffect)((()=>(f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f))),[f]);(0,_a.useCallback)(((e,t)=>Array.isArray(e)?(e.length,e):e&&e.data&&Array.isArray(e.data)?(e.data.length,e.data):(du(`Unexpected data format for ${t}:`,e),[])),[]);(0,_a.useEffect)((()=>{(async()=>{try{r(!0),await g()}catch(e){du("Error in fetch process:",e),s("Failed to load homepage data. Please try again.")}})()}),[]);const g=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;try{s(null);
4const n=await fetch("https://animedb-production.up.railway.app/api/homepage");if(!n.ok){if(429===n.status&&e>0){const t=1e3*Math.pow(2,3-e);return await new Promise((e=>setTimeout(e,t))),g(e-1)}throw new Error(`Error fetching homepage data: ${n.status}`)}const a=await n.json(),i={topRatedAnime:a.topRatedAnime||[],currentlyAiringAnime:a.currentlyAiringAnime||[],topRatedManga:a.topRatedManga||[],currentlyPublishingManga:a.currentlyPublishingManga||[],topCharacters:a.topCharacters||[]};return t(i),r(!1),localStorage.setItem("homepageData",JSON.stringify(i)),localStorage.setItem("homepageTimestamp",Date.now().toString()),i}catch(n){return du("Error fetching fresh data:",n),s(n.message),r(!1),null}};(0,_a.useMemo)((()=>null),[l,u,h,m]);return n?(0,Ti.jsx)(hu,{}):a?(0,Ti.jsxs)("div",{className:"error-container",children:[(0,Ti.jsx)("h3",{children:"Oops! Something went wrong"}),(0,Ti.jsx)("p",{children:a}),(0,Ti.jsx)("button",{onClick:()=>g(),className:"retry-button",children:"Try Again"})]}):(0,Ti.jsxs)("main",{className:"home",children:[(0,Ti.jsx)(ou,{}),(0,Ti.jsxs)("div",{className:"hero-section",children:[(0,Ti.jsx)("h2",{className:"hero-heading","data-text":"Your Gateway to Anime & Manga",children:"Your Gateway to Anime & Manga"}),(0,Ti.jsx)("p",{className:"hero-text",children:"Discover, track, and explore your favorite anime and manga in one modern platform"})]}),(0,Ti.jsx)(iu,{}),(0,Ti.jsx)(pu,{title:"Top-Rated Anime",items:u,componentType:"anime",cardLayout:i}),(0,Ti.jsx)(pu,{title:"Currently Airing Anime",items:d,componentType:"anime",cardLayout:i}),(0,Ti.jsx)(pu,{title:"Top-Rated Manga",items:h,componentType:"manga",cardLayout:i}),(0,Ti.jsx)(pu,{title:"Currently Publishing Manga",items:p,componentType:"manga",cardLayout:i}),(0,Ti.jsx)(pu,{title:"Popular Characters",items:m,componentType:"character",cardLayout:i}),!1]})},fu=_a.memo(mu);var gu=n(202),vu=n(914);const yu=(0,_a.lazy)((()=>n.e(826).then(n.bind(n,826)))),bu=()=>{const[e,t]=(0,_a.useState)({bestOfYear:[],topRated:[],currentlyAiring:[],upcoming:[],movies:[],genres:{}}),[n,r]=(0,_a.useState)(!0),[a,s]=(0,_a.useState)(null),[i,o]=(0,_a.useState)("horizontal"),l=(new Date).getFullYear();(0,_a.useEffect)((()=>{const e=()=>{window.innerWidth<=768?o("vertical"):o("horizontal")};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]);const c=(0,_a.useCallback)((async()=>{r(!0),s(null);const e=localStorage.getItem("animePageData"),n=localStorage.getItem("animePageTimestamp");if(e&&n){if(Date.now()-parseInt(n)<18e5)try{const n=JSON.parse(e);return t(n),r(!1),void setTimeout((()=>{u().catch((e=>console.error("Background fetch error:",e)))}),1e3)}catch(gh){console.error("Error parsing cached data:",gh)}}try{const e=await u();t(e)}catch(a){console.error("Global fetch error:",a),s("Failed to load anime data. Please try again later.")}finally{r(!1)}}),[]),u=async()=>{const e="https://animedb-production.up.railway.app",t=[{name:"bestOfYear",url:`${e}/api/anime/sections/best-of-year`},{name:"topRated",url:`${e}/api/anime/sections/top-rated`},{name:"currentlyAiring",url:`${e}/api/anime/sections/currently-airing`},{name:"upcoming",url:`${e}/api/anime/sections/upcoming`},{name:"movies",url:`${e}/api/anime/sections/movies`},{name:"genres",url:`${e}/api/anime/genres`}],n=await Promise.all(t.map((async e=>{try{console.log(`Fetching ${e.name} from ${e.url}...`);let n=e.url;"genres"!==e.name&&(n=`${n}?limit=8`);const r=await fetch(n);if(!r.ok)return console.error(`${e.name} failed:`,r.status),{name:e.name,data:null};const a=await r.text();try{const t=JSON.parse(a);return console.log(`${e.name} data received successfully`),{name:e.name,data:t}}catch(t){return console.error(`Error parsing ${e.name} JSON:`,t),{name:e.name,data:null}}}catch(n){return console.error(`Network error fetching ${e.name}:`,n),{name:e.name,data:null}}}))),r={bestOfYear:[],topRated:[],currentlyAiring:[],upcoming:[],movies:[],genres:{}};return n.forEach((e=>{if(e.data)if("genres"===e.name)r.genres=e.data,console.log(`Genres data received: Object with ${Object.keys(e.data).length} genre keys`);else{var t;let n=[];Array.isArray(e.data)?(n=e.data,console.log(`${e.name} data received: Array with ${e.data.length} items`)):null!==(t=e.data)&&void 0!==t&&t.data&&Array.isArray(e.data.data)?(n=e.data.data,console.log(`${e.name} data received: Paginated with ${e.data.data.length} items`)):console.error(`Unexpected data format for ${e.name}:`,e.data),r[e.name]=n,n.length>0&&console.log(`First ${e.name} item:`,{id:n[0].id,title:n[0].title})}})),localStorage.setItem("animePageData",JSON.stringify(r)),localStorage.setItem("animePageTimestamp",Date.now().toString()),r};(0,_a.useEffect)((()=>{c()}),[c]);const d=(e,t,n)=>e&&Array.isArray(e)&&0!==e.length?(0,Ti.jsxs)("section",{className:"anime-section",children:[(0,Ti.jsxs)("div",{className:"section-header",children:[(0,Ti.jsx)("h2",{className:"section-title",children:t}),(0,Ti.jsx)("a",{href:`/anime/category/${n}`,className:"see-more",children:"See More"})]}),(0,Ti.jsx)(gu.default,{animes:e.slice(0,4),layout:i})]}):null,h=()=>{var t,n,r,a,s,i;const o=[];let c;
4if(e.topRated&&e.topRated.length>0&&o.push(...e.topRated.slice(0,10)),e.currentlyAiring&&e.currentlyAiring.length>0&&o.push(...e.currentlyAiring.slice(0,10)),o.length>0){const e=Math.floor(Math.random()*o.length);c=o[e],console.log(`Randomly selected anime #${e} from a pool of ${o.length} animes`)}else c=e.bestOfYear[0]||e.topRated[0]||e.currentlyAiring[0]||e.movies[0],console.log("Using fallback anime for hero section");if(!c)return(0,Ti.jsx)("section",{className:"anime-hero-section",children:(0,Ti.jsxs)("div",{className:"anime-hero-content",children:[(0,Ti.jsxs)("div",{className:"anime-hero-text",children:[(0,Ti.jsx)("h1",{className:"anime-hero-title",children:"Welcome to Anime Universe"}),(0,Ti.jsx)("p",{className:"anime-hero-synopsis",children:"Explore our collection of amazing anime series and movies"}),(0,Ti.jsx)("div",{className:"anime-hero-metadata",children:(0,Ti.jsx)("span",{children:"\u2b50 Start Exploring"})}),(0,Ti.jsx)("a",{href:"/anime",className:"anime-hero-cta",children:"Browse All"})]}),(0,Ti.jsx)("div",{className:"anime-hero-image-container",children:(0,Ti.jsx)("img",{src:"/default-hero.jpg",alt:"Anime Universe",className:"anime-hero-image"})})]})});let u="";return e.topRated.some((e=>e.id===c.id))?u="Top Rated":e.currentlyAiring.some((e=>e.id===c.id))?u="Currently Airing":e.bestOfYear.some((e=>e.id===c.id))&&(u=`Best of ${l}`),(0,Ti.jsx)("section",{className:"anime-hero-section",children:(0,Ti.jsxs)("div",{className:"anime-hero-content",children:[(0,Ti.jsxs)("div",{className:"anime-hero-text",children:[(0,Ti.jsx)("h1",{className:"anime-hero-title",children:c.titleEnglish||c.title}),(0,Ti.jsx)("p",{className:"anime-hero-synopsis",children:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250;return e?e.length<=t?e:e.substring(0,t).trim()+"...":"Explore this amazing anime series..."}(c.synopsis)}),(0,Ti.jsxs)("div",{className:"anime-hero-metadata",children:[c.score&&(0,Ti.jsxs)("span",{children:["\u2b50 ",c.score]}),c.episodes&&(0,Ti.jsxs)("span",{children:[c.episodes," Episodes"]}),c.status&&(0,Ti.jsx)("span",{children:c.status}),c.season&&c.year&&(0,Ti.jsxs)("span",{children:[(d=c.season,d?d.charAt(0).toUpperCase()+d.slice(1):d)," ",c.year]}),u&&(0,Ti.jsx)("span",{className:"featured-source",children:u})]}),(0,Ti.jsx)("a",{href:`/anime/${c.id}`,className:"anime-hero-cta",children:"View Details"})]}),(0,Ti.jsx)("div",{className:"anime-hero-image-container",children:(0,Ti.jsx)(vu.A,{src:(null===(t=c.images)||void 0===t||null===(n=t.webp)||void 0===n?void 0:n.large_image_url)||(null===(r=c.images)||void 0===r||null===(a=r.jpg)||void 0===a?void 0:a.large_image_url)||(null===(s=c.images)||void 0===s||null===(i=s.webp)||void 0===i?void 0:i.image_url)||"/default-hero.jpg",alt:c.title,className:"anime-hero-image",loading:"eager",fallbackSrc:"/default-hero.jpg"})})]})});var d},p=()=>(0,Ti.jsxs)("div",{className:"anime-page",children:[(0,Ti.jsx)("div",{className:"anime-page-title-container",children:(0,Ti.jsx)("h1",{className:"anime-page-title",children:"Anime"})}),(0,Ti.jsx)("div",{className:"anime-hero-section skeleton",children:(0,Ti.jsxs)("div",{className:"anime-hero-content",children:[(0,Ti.jsxs)("div",{className:"anime-hero-text",children:[(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"40px",width:"70%"}}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"100px",width:"90%"}}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"30px",width:"60%"}})]}),(0,Ti.jsx)("div",{className:"anime-hero-image-container skeleton-image"})]})}),(0,Ti.jsx)("main",{className:"anime-main",children:[1,2,3].map((e=>(0,Ti.jsxs)("section",{className:"anime-section skeleton",children:[(0,Ti.jsx)("div",{className:"section-header",children:(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"24px",width:"40%"}})}),(0,Ti.jsx)("div",{className:"cards-container",children:[1,2,3,4].map((e=>(0,Ti.jsxs)("div",{className:"anime-card skeleton",children:[(0,Ti.jsx)("div",{className:"skeleton-image"}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"20px",width:"80%"}})]},e)))})]},e)))})]}),m=e=>{let{children:t,title:n}=e;return(0,Ti.jsx)(_a.Suspense,{fallback:(0,Ti.jsxs)("section",{className:"anime-section skeleton",children:[(0,Ti.jsx)("div",{className:"section-header",children:(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"24px",width:"40%"}})}),(0,Ti.jsx)("div",{className:"cards-container",children:[1,2,3,4].map((e=>(0,Ti.jsxs)("div",{className:"anime-card skeleton",children:[(0,Ti.jsx)("div",{className:"skeleton-image"}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"20px",width:"80%"}}
4)]},e)))})]}),children:t})},f=e=>{let{children:t}=e;const[n,r]=(0,_a.useState)(!1),a=(0,_a.useRef)(null);return(0,_a.useEffect)((()=>{const e=new IntersectionObserver((t=>{let[n]=t;n.isIntersecting&&(r(!0),e.disconnect())}),{rootMargin:"200px"});return a.current&&e.observe(a.current),()=>{a.current&&e.disconnect()}}),[]),n?(0,Ti.jsx)("div",{ref:a,children:(0,Ti.jsx)(m,{children:t})}):(0,Ti.jsx)("div",{ref:a,children:(0,Ti.jsxs)("section",{className:"anime-section skeleton",children:[(0,Ti.jsx)("div",{className:"section-header",children:(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"24px",width:"40%"}})}),(0,Ti.jsx)("div",{className:"cards-container",children:[1,2,3,4].map((e=>(0,Ti.jsxs)("div",{className:"anime-card skeleton",children:[(0,Ti.jsx)("div",{className:"skeleton-image"}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"20px",width:"80%"}})]},e)))})]})})};if(n)return(0,Ti.jsx)(p,{});if(a)return(0,Ti.jsxs)("div",{className:"error-container",children:[(0,Ti.jsx)("h3",{children:"Oops! Something went wrong"}),(0,Ti.jsx)("p",{children:a}),(0,Ti.jsx)("button",{className:"retry-button",onClick:c,children:"Try Again"})]});return e.bestOfYear.length>0||e.topRated.length>0||e.currentlyAiring.length>0||e.upcoming.length>0||e.movies.length>0||e.genres&&Object.keys(e.genres).length>0?(0,Ti.jsxs)("div",{className:"anime-page",children:[(0,Ti.jsx)("div",{className:"anime-page-title-container",children:(0,Ti.jsx)("h1",{className:"anime-page-title",children:"Anime"})}),(0,Ti.jsx)(h,{}),(0,Ti.jsxs)("main",{className:"anime-main",children:[d(e.bestOfYear,`Best of ${l}`,"best-of-year"),(0,Ti.jsx)(f,{children:d(e.topRated,"All-Time Top Rated","top-rated")}),(0,Ti.jsx)(f,{children:d(e.currentlyAiring,"Currently Airing","currently-airing")}),(0,Ti.jsx)(f,{children:d(e.upcoming,"Upcoming Anime","upcoming")}),(0,Ti.jsx)(f,{children:d(e.movies,"Anime Movies","movies")}),(0,Ti.jsx)(_a.Suspense,{fallback:(0,Ti.jsxs)("section",{className:"genres-section skeleton",children:[(0,Ti.jsx)("div",{className:"section-header",children:(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"24px",width:"40%"}})}),(0,Ti.jsx)("div",{className:"skeleton-grid",children:[1,2,3,4,5,6].map((e=>(0,Ti.jsx)("div",{className:"genre-card skeleton",children:(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"100%",width:"100%"}})},e)))})]}),children:(0,Ti.jsxs)("section",{className:"genres-section",children:[(0,Ti.jsxs)("div",{className:"section-header",children:[(0,Ti.jsx)("h2",{className:"section-title",children:"Browse by Genre"}),(0,Ti.jsx)("a",{href:"/genres",className:"see-more",children:"View All Genres"})]}),(0,Ti.jsx)(yu,{genres:e.genres})]})})]})]}):(0,Ti.jsxs)("div",{className:"anime-page",children:[(0,Ti.jsx)(h,{}),(0,Ti.jsx)("div",{className:"no-results",children:(0,Ti.jsx)("p",{children:"No anime content available at the moment. Please check back later."})})]})};var xu=n(838);const wu=(0,_a.lazy)((()=>n.e(569).then(n.bind(n,569)))),ju="https://animedb-production.up.railway.app",Nu={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_PLACEHOLDER_BACKDROP:"https://res.cloudinary.com/dpz6ivjry/image/upload/v1741666344/740446_zkrklo.jpg",REACT_APP_API_BASE_URL:"https://animedb-production.up.railway.app"}.REACT_APP_PLACEHOLDER_IMAGE||"/default-hero.jpg",Su=()=>(0,Ti.jsxs)("div",{className:"manga-page",children:[(0,Ti.jsx)("div",{className:"manga-page-title-container",children:(0,Ti.jsx)("h1",{className:"manga-page-title",children:"Manga"})}),(0,Ti.jsx)("div",{className:"manga-hero-section skeleton",children:(0,Ti.jsxs)("div",{className:"manga-hero-content",children:[(0,Ti.jsxs)("div",{className:"manga-hero-text",children:[(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"40px",width:"70%"}}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"100px",width:"90%"}}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"30px",width:"60%"}})]}),(0,Ti.jsx)("div",{className:"manga-hero-image-container skeleton-image"})]})}),(0,Ti.jsx)("main",{className:"manga-main",children:[1,2,3].map((e=>(0,Ti.jsxs)("section",{className:"manga-section skeleton",children:[(0,Ti.jsx)("div",{className:"section-header",children:(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"24px",width:"40%"}})}),(0,Ti.jsx)("div",{className:"cards-container",children:[1,2,3,4].map((e=>(0,Ti.jsxs)("div",{className:"manga-card skeleton",children:[(0,Ti.jsx)("div",{className:"skeleton-image"}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"20px",width:"80%"}}
4)]},e)))})]},e)))})]}),ku=e=>{let{children:t}=e;return(0,Ti.jsx)(_a.Suspense,{fallback:(0,Ti.jsxs)("section",{className:"manga-section skeleton",children:[(0,Ti.jsx)("div",{className:"section-header",children:(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"24px",width:"40%"}})}),(0,Ti.jsx)("div",{className:"cards-container",children:[1,2,3,4].map((e=>(0,Ti.jsxs)("div",{className:"manga-card skeleton",children:[(0,Ti.jsx)("div",{className:"skeleton-image"}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"20px",width:"80%"}})]},e)))})]}),children:t})},Eu=e=>{let{children:t}=e;const[n,r]=(0,_a.useState)(!1),a=(0,_a.useRef)(null);return(0,_a.useEffect)((()=>{const e=new IntersectionObserver((t=>{let[n]=t;n.isIntersecting&&(r(!0),e.disconnect())}),{rootMargin:"200px"});return a.current&&e.observe(a.current),()=>{a.current&&e.disconnect()}}),[]),n?(0,Ti.jsx)("div",{ref:a,children:(0,Ti.jsx)(ku,{children:t})}):(0,Ti.jsx)("div",{ref:a,children:(0,Ti.jsxs)("section",{className:"manga-section skeleton",children:[(0,Ti.jsx)("div",{className:"section-header",children:(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"24px",width:"40%"}})}),(0,Ti.jsx)("div",{className:"cards-container",children:[1,2,3,4].map((e=>(0,Ti.jsxs)("div",{className:"manga-card skeleton",children:[(0,Ti.jsx)("div",{className:"skeleton-image"}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"20px",width:"80%"}})]},e)))})]})})},_u=()=>{const e=(new Date).getFullYear(),[t,n]=(0,_a.useState)({bestOfYear:[],topRated:[],publishing:[],upcoming:[],oneShots:[],completed:[],genres:{}}),[r,a]=(0,_a.useState)(!0),[s,i]=(0,_a.useState)(null),[o,l]=(0,_a.useState)("horizontal");(0,_a.useEffect)((()=>{const e=()=>{window.innerWidth<=768?l("vertical"):l("horizontal")};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]);const c=(0,_a.useCallback)((async()=>{a(!0),i(null);const e=localStorage.getItem("mangaPageData"),t=localStorage.getItem("mangaPageTimestamp");if(e&&t){if(Date.now()-parseInt(t)<18e5)try{const t=JSON.parse(e);return n(t),a(!1),void setTimeout((()=>{u().catch((e=>{}))}),1e3)}catch(gh){}}try{const e=await u();n(e)}catch(s){i("Failed to load manga data. Please try again later.")}finally{a(!1)}}),[]),u=async()=>{const e=[{name:"bestOfYear",url:`${ju}/api/manga/sections/best-of-year`},{name:"topRated",url:`${ju}/api/manga/sections/top-rated`},{name:"publishing",url:`${ju}/api/manga/sections/publishing`},{name:"upcoming",url:`${ju}/api/manga/sections/upcoming`},{name:"oneShots",url:`${ju}/api/manga/sections/one-shots`},{name:"completed",url:`${ju}/api/manga/sections/completed`},{name:"genres",url:`${ju}/api/manga/genres`}],t=await Promise.all(e.map((async e=>{try{e.name;let t=e.url;"genres"!==e.name&&(t=`${t}?limit=8`);const n=await fetch(t);if(!n.ok)return e.name,n.status,{name:e.name,data:"genres"===e.name?{}:[],error:n.statusText};const r=await n.json();return{name:e.name,data:r,error:null}}catch(s){return e.name,{name:e.name,data:"genres"===e.name?{}:[],error:s.message}}}))),n=t.reduce(((e,t)=>("genres"===t.name?e[t.name]="object"===typeof t.data?t.data:{}:(e[t.name]=Array.isArray(t.data)?t.data:[],t.data&&t.data.data&&Array.isArray(t.data.data)&&(e[t.name]=t.data.data)),e)),{});return localStorage.setItem("mangaPageData",JSON.stringify(n)),localStorage.setItem("mangaPageTimestamp",Date.now().toString()),n};(0,_a.useEffect)((()=>{c()}),[c]);const d=(e,t,n)=>e&&0!==e.length?(0,Ti.jsxs)("section",{className:"manga-section",children:[(0,Ti.jsxs)("div",{className:"section-header",children:[(0,Ti.jsx)("h2",{className:"section-title",children:t}),(0,Ti.jsx)("a",{href:`/manga/${n}`,className:"see-more",children:"See More"})]}),(0,Ti.jsx)(xu.default,{mangas:e.slice(0,4),layout:o})]}):null,h=()=>{var n,r,a,s,i,o;const l=[];let c;if(t.bestOfYear&&t.bestOfYear.length>0&&l.push(...t.bestOfYear.slice(0,5)),t.topRated&&t.topRated.length>0&&l.push(...t.topRated.slice(0,5)),t.publishing&&t.publishing.length>0&&l.push(...t.publishing.slice(0,5)),l.length>0){var u,d,h,p;const e=Math.floor(Math.random()*l.length);c=l[e],l.length,c._id,c.title,(null===(u=c.images)||void 0===u||null===(d=u.webp)||void 0===d?void 0:d.large_image_url)||null===(h=c.images)||void 0===h||null===(p=h.jpg)||void 0===p||p.large_image_url}else c=t.bestOfYear[0]||t.topRated[0]||t.publishing[0]||t.completed[0]||t.oneShots[0];if(!c)return(0,Ti.jsx)("section",{className:"manga-hero-section",children:(0,Ti.jsxs)("div",{className:"manga-hero-content",children:[(0,Ti.jsxs)("div",{className:"manga-hero-text",children:[(0,Ti.jsx)("h1",{className:"manga-hero-title",children:"Welcome to Manga Universe"}),(0,Ti.jsx)("p",{className:"manga-hero-synopsis",children:"Explore our collection of amazing manga series and one-shots"}),(0,Ti.jsx)("div",{className:"manga-hero-metadata",children:(0,Ti.jsx)("span",{children:"\u2b50 Start Exploring"})}),(0,Ti.jsx)("a",{href:"/manga",className:"manga-hero-cta",children:"Browse All"})]}),(0,Ti.jsx)("div",{className:"manga-hero-image-container",children:(0,Ti.jsx)(vu.A,{src:Nu,alt:"Manga Universe",className:"manga-hero-image",loading:"eager",fallbackSrc:Nu})})]})});let m="";const f=(e,t)=>!(!e||!Array.isArray(e))&&e.some((e=>e._id&&e._id.toString()===t.toString()));f(t.bestOfYear,c._id)?m=`Best of ${e}`:f(t.topRated,c._id)?m="Top Rated":f(t.publishing,c._id)&&(m="Currently Publishing");const g=c.published&&c.published.from?new Date(c.published.from).getFullYear():null,v=(e=>e?"Publishing"===e?"Currently Publishing":e:null)(c.status);return(0,Ti.jsx)("section",{className:"manga-hero-section",children:(0,Ti.jsxs)("div",{className:"anime-hero-content",children:[(0,Ti.jsxs)("div",{className:"manga-hero-text",children:[(0,Ti.jsx)("h1",{className:"manga-hero-title",children:c.title_english||c.title}),(0,Ti.jsx)("p",{className:"manga-hero-synopsis",children:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250;return e?e.length<=t?e:e.substring(0,t).trim()+"...":"Explore this amazing manga series..."}(c.synopsis)}),(0,Ti.jsxs)("div",{className:"manga-hero-metadata",children:[c.score&&(0,Ti.jsxs)("span",{children:["\u2b50 ",c.score]}),c.chapters&&(0,Ti.jsxs)("span",{children:[c.chapters," Chapters"]}
4),v&&(0,Ti.jsx)("span",{children:v}),g&&(0,Ti.jsx)("span",{children:g}),m&&(0,Ti.jsx)("span",{className:"manga-featured-source",children:m}),c.type&&!v&&!c.chapters&&(0,Ti.jsx)("span",{children:c.type})]}),(0,Ti.jsx)("a",{href:`/manga/${c._id}`,className:"manga-hero-cta",children:"View Details"})]}),(0,Ti.jsx)("div",{className:"manga-hero-image-container",children:(0,Ti.jsx)(vu.A,{src:(null===(n=c.images)||void 0===n||null===(r=n.webp)||void 0===r?void 0:r.large_image_url)||(null===(a=c.images)||void 0===a||null===(s=a.jpg)||void 0===s?void 0:s.large_image_url)||(null===(i=c.images)||void 0===i||null===(o=i.webp)||void 0===o?void 0:o.image_url)||Nu,alt:c.title,className:"manga-hero-image",loading:"eager",fallbackSrc:Nu})})]})})};if(r)return(0,Ti.jsx)(Su,{});if(s)return(0,Ti.jsxs)("div",{className:"error-container",children:[(0,Ti.jsx)("h3",{children:"Oops! Something went wrong"}),(0,Ti.jsx)("p",{children:s}),(0,Ti.jsx)("button",{className:"retry-button",onClick:c,children:"Try Again"})]});return t.bestOfYear.length>0||t.topRated.length>0||t.publishing.length>0||t.upcoming.length>0||t.oneShots.length>0||t.completed.length>0||t.genres&&Object.keys(t.genres).length>0?(0,Ti.jsxs)("div",{className:"manga-page",children:[(0,Ti.jsx)("div",{className:"manga-page-title-container",children:(0,Ti.jsx)("h1",{className:"manga-page-title",children:"Manga"})}),(0,Ti.jsx)(h,{}),(0,Ti.jsxs)("main",{className:"manga-main",children:[d(t.bestOfYear,`Best of ${e}
4`,"best-of-year"),(0,Ti.jsx)(Eu,{children:d(t.topRated,"All-Time Top Rated","top-rated")}),(0,Ti.jsx)(Eu,{children:d(t.publishing,"Currently Publishing","publishing")}),(0,Ti.jsx)(Eu,{children:d(t.upcoming,"Upcoming Manga","upcoming")}),(0,Ti.jsx)(Eu,{children:d(t.oneShots,"One-Shot Manga","one-shots")}),(0,Ti.jsx)(Eu,{children:d(t.completed,"Completed Series","completed")}),t.genres&&Object.keys(t.genres).length>0&&(0,Ti.jsx)(_a.Suspense,{fallback:(0,Ti.jsxs)("section",{className:"genres-section skeleton",children:[(0,Ti.jsx)("div",{className:"section-header",children:(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"24px",width:"40%"}})}),(0,Ti.jsx)("div",{className:"skeleton-grid",children:[1,2,3,4,5,6].map((e=>(0,Ti.jsx)("div",{className:"genre-card skeleton",children:(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"100%",width:"100%"}})},e)))})]}),children:(0,Ti.jsxs)("section",{className:"genres-section",children:[(0,Ti.jsxs)("div",{className:"section-header",children:[(0,Ti.jsx)("h2",{className:"section-title",children:"Browse by Genre"}),(0,Ti.jsx)("a",{href:"/manga/genres",className:"see-more",children:"View All Genres"})]}),(0,Ti.jsx)(wu,{genres:t.genres})]})})]})]}):(0,Ti.jsxs)("div",{className:"manga-page",children:[(0,Ti.jsx)("div",{className:"manga-page-title-container",children:(0,Ti.jsx)("h1",{className:"manga-page-title",children:"Manga"})}),(0,Ti.jsx)(h,{}),(0,Ti.jsx)("div",{className:"no-results",children:(0,Ti.jsx)("p",{children:"No manga content available at the moment. Please check back later."})})]})};var Cu=n(486);const Au=(0,_a.lazy)((()=>n.e(268).then(n.bind(n,268)))),Tu="https://animedb-production.up.railway.app",Ru=()=>(0,Ti.jsxs)("div",{className:"character-card skeleton",children:[(0,Ti.jsx)("div",{className:"character-image-container",children:(0,Ti.jsx)("div",{className:"skeleton-image"})}),(0,Ti.jsxs)("div",{className:"character-details",children:[(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"24px",width:"70%"}}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"18px",width:"50%"}})]})]}),Pu=()=>(0,Ti.jsxs)("div",{className:"characters-page",children:[(0,Ti.jsx)("div",{className:"characters-page-title-container",children:(0,Ti.jsx)("h1",{className:"characters-page-title",children:"Top 100 Characters"})}),(0,Ti.jsx)("div",{className:"birthday-container skeleton",children:(0,Ti.jsxs)("div",{className:"birthday-display",children:[(0,Ti.jsx)("div",{className:"birthday-header",children:(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"28px",width:"60%"}})}),(0,Ti.jsxs)("div",{className:"birthday-content",children:[(0,Ti.jsx)("div",{className:"skeleton-image",style:{height:"150px",width:"150px"}}),(0,Ti.jsxs)("div",{className:"birthday-details",children:[(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"24px",width:"80%"}}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"18px",width:"60%"}}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"18px",width:"70%"}})]})]})]})}),(0,Ti.jsx)("div",{className:"characters-content",children:(0,Ti.jsx)("div",{className:"characters-grid",children:Array(20).fill(0).map(((e,t)=>(0,Ti.jsxs)("div",{className:"character-item",children:[(0,Ti.jsxs)("div",{className:"character-rank-badge skeleton-badge",children:["#",t+1]}),(0,Ti.jsx)(Ru,{})]},t)))})})]}),Ou=e=>{let{character:t,index:n,indexOfFirstCharacter:r,animeStore:a}=e;const[s,i]=(0,_a.useState)(!1),o=(0,_a.useRef)(null);return(0,_a.useEffect)((()=>{const e=new IntersectionObserver((t=>{let[n]=t;n.isIntersecting&&(i(!0),e.disconnect())}),{rootMargin:"200px"});return o.current&&e.observe(o.current),()=>{o.current&&e.disconnect()}}),[]),(0,Ti.jsxs)("div",{className:"character-item",ref:o,children:[(0,Ti.jsxs)("div",{className:"character-rank-badge",children:["#",r+n+1]}),s?(0,Ti.jsx)(Cu.default,{character:t,animeStore:a}):(0,Ti.jsx)(Ru,{})]})},Iu=()=>{const[e,t]=(0,_a.useState)([]),[n,r]=(0,_a.useState)(null),[a,s]=(0,_a.useState)(!0),[i,o]=(0,_a.useState)(!1),[l,c]=(0,_a.useState)(!1),[u,d]=(0,_a.useState)(null),[h,p]=(0,_a.useState)(1),[m,f]=(0,_a.useState)(0),[g,v]=(0,_a.useState)({}),y=20;(0,_a.useEffect)((()=>{const e=async()=>{try{const e=await fetch(`${Tu}/api/characters/birthdays/today`);if(e.ok){const t=await e.json();if(t&&t.length>0){r(t[0]);const e=localStorage.getItem("charactersPageData");if(e)try{const n=JSON.parse(e);n.birthdayChar=t[0],localStorage.setItem("charactersPageData",JSON.stringify(n))}catch(gh){console.error("Error updating cached birthday data:",gh)}}}}catch(e){console.error("Error fetching birthday data:",e)}};(async()=>{try{s(!0);const n=localStorage.getItem("charactersPageData"),a=localStorage.getItem("charactersPageTimestamp");if(n&&a){const i=Date.now(),o=parseInt(a);if(i-o<216e5)try{const{characters:a,birthdayChar:i,animeData:o}=JSON.parse(n);return t(a),f(Math.ceil(a.length/y)),r(i),v(o||{}),s(!1),void e()}catch(gh){console.error("Error parsing cached data:",gh)}}const[i,o]=await Promise.all([fetch(`${Tu}/api/characters/top?limit=100`),fetch(`${Tu}/api/characters/birthdays/today`)]);if(!i.ok)throw new Error(`Failed to fetch top characters: ${i.statusText}`);const l=await i.json();t(l),f(Math.ceil(l.length/y));let c=null;if(o.ok){const e=await o.json();e&&e.length>0&&(c=e[0],r(c))}localStorage.setItem("charactersPageData",JSON.stringify({characters:l,birthdayChar:c,animeData:g})),localStorage.setItem("charactersPageTimestamp",Date.now().toString())}catch(n){console.error("Error fetching data:",n),d(n.message)}finally{s(!1)}})()}),[]),(0,_a.useEffect)((()=>
4{if(0===e.length||l)return;(async()=>{const e=new Set;b.forEach((t=>{Array.isArray(t.anime)&&t.anime.forEach((t=>{var n;null!==(n=t.anime)&&void 0!==n&&n.mal_id&&e.add(t.anime.mal_id)}))})),n&&Array.isArray(n.anime)&&n.anime.forEach((t=>{var n;null!==(n=t.anime)&&void 0!==n&&n.mal_id&&e.add(t.anime.mal_id)}));const t=Array.from(e).filter((e=>!g[e]));if(t.length>0){c(!0);const e=await w(t),n=localStorage.getItem("charactersPageData");if(n)try{const t=JSON.parse(n);t.animeData={...t.animeData,...e},localStorage.setItem("charactersPageData",JSON.stringify(t))}catch(gh){console.error("Error updating cached anime data:",gh)}c(!1)}})()}),[h,n,e]);const b=(0,_a.useMemo)((()=>{const t=h*y,n=t-y;return e.slice(n,t)}),[e,h,y]),x=(0,_a.useMemo)((()=>(h-1)*y),[h,y]),w=async e=>{try{const n={...g},r=50,a=[];for(let t=0;t<e.length;t+=r)a.push(e.slice(t,t+r));for(const e of a){const r=e.join(",");let a=3,s=!1;for(;a>0&&!s;)try{const e=await fetch(`${Tu}/api/anime/batch?ids=${r}`);if(!e.ok){if(429===e.status){a--;const e=1e3*Math.pow(2,3-a);await new Promise((t=>setTimeout(t,e)));continue}throw new Error(`Batch request failed: ${e.status}`)}const t=await e.json();Object.assign(n,t),s=!0}catch(t){if(console.error("Error processing batch:",t),a--,a>0){const e=1e3*Math.pow(2,3-a);await new Promise((t=>setTimeout(t,e)))}}}return v(n),n}catch(u){return console.error("Error fetching anime data:",u),{}}},j=e=>{o(!0),p(e),window.scrollTo({top:0,behavior:"smooth"}),setTimeout((()=>o(!1)),300)},N=(0,_a.useMemo)((()=>Array.from({length:m},((e,t)=>t+1)).filter((e=>1===e||e===m||e>=h-1&&e<=h+1)).map(((e,t,n)=>(0,Ti.jsxs)(_a.Fragment,{children:[t>0&&n[t-1]!==e-1&&(0,Ti.jsx)("span",{className:"character-page-ellipsis",children:"\u2022\u2022\u2022"}),(0,Ti.jsx)("button",{onClick:()=>j(e),className:"character-page-num "+(h===e?"active":""),children:e})]},e)))),[h,m]);return a?(0,Ti.jsx)(Pu,{}):u?(0,Ti.jsxs)("div",{className:"characters-page error",children:[(0,Ti.jsx)("h2",{children:"Something went wrong"}),(0,Ti.jsx)("p",{children:u}),(0,Ti.jsx)("button",{onClick:()=>window.location.reload(),children:"Try Again"})]}):(0,Ti.jsxs)("div",{className:"characters-page",children:[(0,Ti.jsx)("div",{className:"characters-page-title-container",children:(0,Ti.jsx)("h1",{className:"characters-page-title",children:"Top 100 Characters"})}),n&&(0,Ti.jsx)(_a.Suspense,{fallback:(0,Ti.jsx)("div",{className:"birthday-container skeleton",children:(0,Ti.jsxs)("div",{className:"birthday-display",children:[(0,Ti.jsx)("div",{className:"birthday-header",children:(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"28px",width:"60%"}})}),(0,Ti.jsxs)("div",{className:"birthday-content",children:[(0,Ti.jsx)("div",{className:"skeleton-image",style:{height:"150px",width:"150px"}}),(0,Ti.jsxs)("div",{className:"birthday-details",children:[(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"24px",width:"80%"}}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"18px",width:"60%"}})]})]})]})}),children:(0,Ti.jsx)("div",{className:"birthday-container",children:(0,Ti.jsx)(Au,{character:n,animeStore:g})})}),(l||i)&&(0,Ti.jsxs)("div",{className:"anime-loading-indicator",children:[(0,Ti.jsx)("div",{className:"loading-spinner-small"}),(0,Ti.jsxs)("p",{children:["Loading ",i?"characters":"anime details","..."]})]}),(0,Ti.jsx)("div",{className:"characters-content",children:e.length>0?(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)("div",{className:"characters-grid",children:b.map(((e,t)=>(0,Ti.jsx)(Ou,{character:e,index:t,indexOfFirstCharacter:x,animeStore:g},e._id||e.mal_id)))}),m>1&&(0,Ti.jsxs)("div",{className:"pagination",children:[(0,Ti.jsx)("button",{onClick:()=>{h>1&&j(h-1)},disabled:1===h,className:"page-btn prev",children:"Previous"}),(0,Ti.jsx)("div",{className:"character-page-numbers",children:N}),(0,Ti.jsx)("button",{onClick:()=>{h<m&&j(h+1)},disabled:h===m,className:"page-btn next",children:"Next"})]}),m>1&&(0,Ti.jsx)("div",{className:"pagination-info-container",children:(0,Ti.jsxs)("div",{className:"character-pagination-info",children:["Page ",h," of ",m]})})]}):(0,Ti.jsx)("div",{className:"no-characters",children:(0,Ti.jsx)("p",{children:"No characters found. Try refreshing the page."})})})]})},$u=_a.memo(Iu);var Lu=class extends kc{constructor(e,t){super(),this.options=t,this.#l=e,this.#b=null,this.#x=Cc(),this.options.experimental_prefetchInRender||this.#x.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#l;#w=void 0;#j=void 0;#N=void 0;#S;#k;#x;#b;#E;#_;#C;#A;#T;#R;#P=(()=>new Set)();bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#w.addObserver(this),Fu(this.#w,this.options)?this.#O():this.updateResult(),this.#I())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Mu(this.#w,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Mu(this.#w,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#$(),this.#L(),this.#w.removeObserver(this)}setOptions(e,t){const n=this.options,r=this.#w;if(this.options=this.#l.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!==typeof this.options.enabled&&"function"!==typeof this.options.enabled&&"boolean"!==typeof lc(this.options.enabled,this.#w))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#F(),this.#w.setOptions(this.options),n._defaulted&&!fc(this.options,n)&&this.#l.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#w,observer:this});const a=this.hasListeners();a&&Du(this.#w,r,this.options,n)&&this.#O(),this.updateResult(t),!a||this.#w===r&&lc(this.options.enabled,this.#w)===lc(n.enabled,this.#w)&&oc(this.options.staleTime,this.#w)===oc(n.staleTime,this.#w)||this.#M();const s=this.#D();!a||this.#w===r&&lc(this.options.enabled,this.#w)===lc(n.enabled,this.#w)&&s===this.#R||this.#U(s)}getOptimisticResult(e){const t=this.#l.getQueryCache().build(this.#l,e),n=this.createResult(t,e);return function(e,t){if(!fc(e.getCurrentResult(),t))return!0;return!1}(this,n)&&(this.#N=n,this.#k=this.options,this.#S=this.#w.state),n}getCurrentResult(){return this.#N}trackResult(e,t){const n={};return Object.keys(e).forEach((r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t?.(r),e[r])})})),n}trackProp(e){this.#P.add(e)}getCurrentQuery(){return this.#w}refetch(){let{...e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.fetch({...e})}fetchOptimistic(e){const t=this.#l.defaultQueryOptions(e),n=this.#l.getQueryCache().build(this.#l,t);return n.fetch().then((()=>this.createResult(n,t)))}fetch(e){return this.#O({...e,cancelRefetch:e.cancelRefetch??!0}).then((()=>(this.updateResult(),this.#N)))}#O(e){this.#F();let t=this.#w.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ac)),t}#M(){this.#$();const e=oc(this.options.staleTime,this.#w);if(rc||this.#N.isStale||!sc(e))return;const t=ic(this.#N.dataUpdatedAt,e)+1;this.#A=setTimeout((()=>{this.#N.isStale||this.updateResult()}),t)}#D(){return("function"===typeof this.options.refetchInterval?this.options.refetchInterval(this.#w):this.options.refetchInterval)??!1}#U(e){this.#L(),this.#R=e,!rc&&!1!==lc(this.options.enabled,this.#w)&&sc(this.#R)&&0!==this.#R&&(this.#T=setInterval((()=>
4{(this.options.refetchIntervalInBackground||Ec.isFocused())&&this.#O()}),this.#R))}#I(){this.#M(),this.#U(this.#D())}#$(){this.#A&&(clearTimeout(this.#A),this.#A=void 0)}#L(){this.#T&&(clearInterval(this.#T),this.#T=void 0)}createResult(e,t){const n=this.#w,r=this.options,a=this.#N,s=this.#S,i=this.#k,o=e!==n?e.state:this.#j,{state:l}=e;let c,u={...l},d=!1;if(t._optimisticResults){const a=this.hasListeners(),s=!a&&Fu(e,t),i=a&&Du(e,n,t,r);(s||i)&&(u={...u,...Lc(l.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:h,errorUpdatedAt:p,status:m}=u;if(t.select&&void 0!==u.data)if(a&&u.data===s?.data&&t.select===this.#E)c=this.#_;else try{this.#E=t.select,c=t.select(u.data),c=bc(a?.data,c,t),this.#_=c,this.#b=null}catch(w){this.#b=w}else c=u.data;if(void 0!==t.placeholderData&&void 0===c&&"pending"===m){let e;if(a?.isPlaceholderData&&t.placeholderData===i?.placeholderData)e=a.data;else if(e="function"===typeof t.placeholderData?t.placeholderData(this.#C?.state.data,this.#C):t.placeholderData,t.select&&void 0!==e)try{e=t.select(e),this.#b=null}catch(w){this.#b=w}void 0!==e&&(m="success",c=bc(a?.data,e,t),d=!0)}this.#b&&(h=this.#b,c=this.#_,p=Date.now(),m="error");const f="fetching"===u.fetchStatus,g="pending"===m,v="error"===m,y=g&&f,b=void 0!==c,x={status:m,fetchStatus:u.fetchStatus,isPending:g,isSuccess:"success"===m,isError:v,isInitialLoading:y,isLoading:y,data:c,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>o.dataUpdateCount||u.errorUpdateCount>o.errorUpdateCount,isFetching:f,isRefetching:f&&!g,isLoadingError:v&&!b,isPaused:"paused"===u.fetchStatus,isPlaceholderData:d,isRefetchError:v&&b,isStale:Uu(e,t),refetch:this.refetch,promise:this.#x};if(this.options.experimental_prefetchInRender){const t=e=>{"error"===x.status?e.reject(x.error):void 0!==x.data&&e.resolve(x.data)},r=()=>{const e=this.#x=x.promise=Cc();t(e)},a=this.#x;switch(a.status){case"pending":e.queryHash===n.queryHash&&t(a);break;case"fulfilled":"error"!==x.status&&x.data===a.value||r();break;case"rejected":"error"===x.status&&x.error===a.reason||r()}}return x}updateResult(e){const t=this.#N,n=this.createResult(this.#w,this.options);if(this.#S=this.#w.state,this.#k=this.options,void 0!==this.#S.data&&(this.#C=this.#w),fc(n,t))return;this.#N=n;const r={};!1!==e?.listeners&&(()=>{if(!t)return!0;const{notifyOnChangeProps:e}=this.options,n="function"===typeof e?e():e;if("all"===n||!n&&!this.#P.size)return!0;const r=new Set(n??this.#P);return this.options.throwOnError&&r.add("error"),Object.keys(this.#N).some((e=>{const n=e;return this.#N[n]!==t[n]&&r.has(n)}))})()&&(r.listeners=!0),this.#z({...r,...e})}#F(){const e=this.#l.getQueryCache().build(this.#l,this.options);if(e===this.#w)return;const t=this.#w;this.#w=e,this.#j=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#I()}#z(e){Sc.batch((()=>{e.listeners&&this.listeners.forEach((e=>{e(this.#N)})),this.#l.getQueryCache().notify({query:this.#w,type:"observerResultsUpdated"})}))}};function Fu(e,t){return function(e,t){return!1!==lc(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&Mu(e,t,t.refetchOnMount)}function Mu(e,t,n){if(!1!==lc(t.enabled,e)){const r="function"===typeof n?n(e):n;return"always"===r||!1!==r&&Uu(e,t)}return!1}function Du(e,t,n,r){return(e!==t||!1===lc(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&Uu(e,n)}function Uu(e,t){return!1!==lc(t.enabled,e)&&e.isStaleByTime(oc(t.staleTime,e))}function zu(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var qu=_a.createContext(zu()),Bu=()=>_a.useContext(qu);function Hu(e,t){return"function"===typeof e?e(...t):!!e}function Qu(){}var Wu=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Vu=e=>{_a.useEffect((()=>{e.clearReset()}),[e])},Ku=e=>{let{result:t,errorResetBoundary:n,throwOnError:r,query:a,suspense:s}
4=e;return t.isError&&!n.isReset()&&!t.isFetching&&a&&(s&&void 0===t.data||Hu(r,[t.error,a]))},Gu=_a.createContext(!1),Yu=()=>_a.useContext(Gu),Ju=(Gu.Provider,e=>{const t=e.staleTime;e.suspense&&(e.staleTime="function"===typeof t?function(){return Math.max(t(...arguments),1e3)}:Math.max(t??1e3,1e3),"number"===typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3)))}),Xu=(e,t)=>e.isLoading&&e.isFetching&&!t,Zu=(e,t)=>e?.suspense&&t.isPending,ed=(e,t,n)=>t.fetchOptimistic(e).catch((()=>{n.clearReset()}));function td(e,t){return function(e,t,n){const r=Qc(n),a=Yu(),s=Bu(),i=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(i),i._optimisticResults=a?"isRestoring":"optimistic",Ju(i),Wu(i,s),Vu(s);const o=!r.getQueryCache().get(i.queryHash),[l]=_a.useState((()=>new t(r,i))),c=l.getOptimisticResult(i),u=!a&&!1!==e.subscribed;if(_a.useSyncExternalStore(_a.useCallback((e=>{const t=u?l.subscribe(Sc.batchCalls(e)):Qu;return l.updateResult(),t}),[l,u]),(()=>l.getCurrentResult()),(()=>l.getCurrentResult())),_a.useEffect((()=>{l.setOptions(i,{listeners:!1})}),[i,l]),Zu(i,c))throw ed(i,l,s);if(Ku({result:c,errorResetBoundary:s,throwOnError:i.throwOnError,query:r.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw c.error;if(r.getDefaultOptions().queries?._experimental_afterQuery?.(i,c),i.experimental_prefetchInRender&&!rc&&Xu(c,a)){const e=o?ed(i,l,s):r.getQueryCache().get(i.queryHash)?.promise;e?.catch(Qu).finally((()=>{l.updateResult()}))}return i.notifyOnChangeProps?c:l.trackResult(c)}(e,Lu,t)}var nd=n(219);const rd=nd||n.t(nd,2);class ad extends _a.Component{constructor(e){super(e);const{name:t,disabled:n=!1}=this.props;n||(this._mountSpan=Rs({name:`<${t}>`,onlyIfParent:!0,op:"ui.react.mount",attributes:{[He]:"auto.ui.react.profiler","ui.component_name":t}}))}componentDidMount(){this._mountSpan&&this._mountSpan.end()}shouldComponentUpdate(e){let{updateProps:t,includeUpdates:n=!0}=e;if(n&&this._mountSpan&&t!==this.props.updateProps){const e=Object.keys(t).filter((e=>t[e]!==this.props.updateProps[e]));if(e.length>0){const t=u();this._updateSpan=Ps(this._mountSpan,(()=>Rs({name:`<${this.props.name}>`,onlyIfParent:!0,op:"ui.react.update",startTime:t,attributes:{[He]:"auto.ui.react.profiler","ui.component_name":this.props.name,"ui.react.changed_props":e}})))}}return!0}componentDidUpdate(){this._updateSpan&&(this._updateSpan.end(),this._updateSpan=void 0)}componentWillUnmount(){const e=u(),{name:t,includeRender:n=!0}=this.props;if(this._mountSpan&&n){const n=yt(this._mountSpan).timestamp;Ps(this._mountSpan,(()=>{const r=Rs({onlyIfParent:!0,name:`<${t}>`,op:"ui.react.render",startTime:n,attributes:{[He]:"auto.ui.react.profiler","ui.component_name":t}});r&&r.end(e)}))}}render(){return this.props.children}}Object.assign(ad,{defaultProps:{disabled:!1,includeRender:!0,includeUpdates:!0}});const sd=e=>{let{message:t}=e;return(0,Ti.jsx)("div",{className:"error-container",children:(0,Ti.jsxs)("div",{className:"error-message",children:[(0,Ti.jsx)("h3",{children:"Error"}),(0,Ti.jsx)("p",{children:t||"An unexpected error occurred. Please try again later."})]})})},id=e=>{let{tabs:t,activeTab:n,onTabChange:r}=e;return(0,Ti.jsx)("nav",{className:"tabs",children:t.map((e=>(0,Ti.jsx)("button",{onClick:()=>r(e.id),className:n===e.id?"active":"",children:e.label},e.id)))})},od=e=>{let{backdrops:t=[],children:n}=e;const[r,a]=(0,_a.useState)(0),[s,i]=(0,_a.useState)("visible"),o=(0,_a.useRef)(null);(0,_a.useEffect)((()=>()=>{o.current&&clearTimeout(o.current)}),[]),(0,_a.useEffect)((()=>{if(t.length<=1)return;const e=()=>{o.current=setTimeout((()=>{i("fading-out"),o.current=setTimeout((()=>{const n=(r+1)%t.length;a(n),i("fading-in"),o.current=setTimeout((()=>{i("visible"),e()}),1e3)}),1e3)}),5e3)};return e(),()=>{o.current&&clearTimeout(o.current)}}),[t,r]);return(0,Ti.jsxs)("div",{className:"hero",children:[(0,Ti.jsx)("div",{className:"hero-backdrop",style:(()=>{if(!t.length)return{};const e="fading-out"===s?0:1;return{backgroundImage:`linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), \n url(${t[r]})`,opacity:e,transition:"opacity 1s ease-in-out"}})()}),n]})},ld="https://animedb-production.up.railway.app",cd=e=>{let{itemId:t,itemType:n,totalEpisodes:r,totalChapters:a,totalVolumes:s,onStatusChange:i}=e;const{isLoggedIn:o,user:l}=ec(),[c,u]=(0,_a.useState)(!1),[d,h]=(0,_a.useState)(""),[p,m]=(0,_a.useState)(!1),[f,g]=(0,_a.useState)(!1),[v,y]=(0,_a.useState)(!1),[b,x]=(0,_a.useState)(!1),[w,j]=(0,_a.useState)(!1),[N,S]=(0,_a.useState)(""),[k,E]=(0,_a.useState)(""),[_,C]=(0,_a.useState)(window.innerWidth<=768),[A,T]=(0,_a.useState)(0),[R,P]=(0,_a.useState)(0),[O,I]=(0,_a.useState)(0),[$,L]=(0,_a.useState)(0),[F,M]=(0,_a.useState)(0),[D,U]=(0,_a.useState)(""),z=(0,_a.useRef)(null),q=(0,_a.useRef)(null),B=(0,_a.useRef)(null),H=(0,_a.useRef)(null),Q=e=>{const t={onHold:"On Hold",completed:"Completed",dropped:"Dropped",favorite:"Favorite"};if("manga"===n){return{planning:"Plan to Read",reading:"Reading"}[e]||t[e]||e}return{planning:"Plan to Watch",watching:"Watching"}[e]||t[e]||e};(0,_a.useEffect)((()=>{const e=()=>{C(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),(0,_a.useEffect)((()=>{(async()=>
4{if(!o||!l||!t)return;const e=localStorage.getItem("token");if(e)try{let r;j(!0),r="character"===n?`${ld}/api/user/characters/${t}`:`${ld}/api/user/${n}/${t}`;const a=await Gl.get(r,{headers:{Authorization:`Bearer ${e}`}});if(console.log("CheckStatus full response:",a.data),a.data.success){const e=a.data.data;u(!0),"character"!==n?(h(e.status),"anime"===n?T(e.currentEpisode||0):"manga"===n&&(P(e.currentChapter||0),I(e.currentVolume||0)),void 0!==e.rating&&null!==e.rating&&L(e.rating),e.notes&&U(e.notes)):h("favorite")}}catch(r){console.error("Error checking status:",r),r.response&&404===r.response.status&&(u(!1),h(""))}finally{j(!1)}})()}),[o,l,t,n]),(0,_a.useEffect)((()=>{function e(e){z.current&&!z.current.contains(e.target)&&m(!1),q.current&&!q.current.contains(e.target)&&g(!1),B.current&&!B.current.contains(e.target)&&y(!1),H.current&&!H.current.contains(e.target)&&x(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);const W=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];"anime"===n?e?T((e=>{const t=e+1;return console.log("Incrementing episode from",e,"to",t),r&&t>=r?r:t})):A>0&&T((e=>e-1)):"manga"===n&&(e?P((e=>{const t=e+1;return a&&t>=a?a:t})):R>0&&P((e=>e-1)))},V=function(){"manga"===n&&(!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?I((e=>{const t=e+1;return s&&t>=s?s:t})):O>0&&I((e=>e-1)))},K=(e,t)=>{const n=parseInt(e.target.value);if(!(isNaN(n)||n<0))if("episode"===t){const e=n;T(e),r&&e>=r&&T(r)}else if("chapter"===t){const e=n;P(e),a&&e>=a&&P(a)}else if("volume"===t){const e=n;I(e),s&&e>=s&&I(s)}},G=()=>{c&&"character"!==n&&(x(!b),m(!1),g(!1),y(!1))};if(!o)return(0,Ti.jsx)("button",{className:"add-to-list-button login-prompt",onClick:()=>window.location.href="/login",children:"Login to Add to List"});if(w)return(0,Ti.jsx)("div",{className:"add-to-list-loading",children:"Loading..."});const Y=c?Q(d):"Add to "+("character"===n?"Favorites":"My List");return(0,Ti.jsxs)("div",{className:"add-to-list-container",children:[N&&(0,Ti.jsx)("div",{className:"add-to-list-error",children:N}),k&&(0,Ti.jsx)("div",{className:"add-to-list-success",children:k}),(0,Ti.jsxs)("div",{className:"button-group",children:[(0,Ti.jsx)("button",{className:"add-to-list-button "+(c?"in-list":""),onClick:()=>{m(!p),g(!1),y(!1),x(!1)},children:Y}),c&&"character"!==n&&(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)("button",{className:"progress-button",onClick:()=>{c&&"character"!==n&&(g(!f),m(!1),y(!1),x(!1))},children:"anime"===n?`${A}${r?`/${r}`:""} ep`:"manga"===n?`${R} ch, ${O} vol`:""}),"anime"===n&&"watching"===d||"manga"===n&&"reading"===d?(0,Ti.jsx)("button",{className:"note-button",style:{width:"100%",gridColumn:"2 / 3"},onClick:G,children:D?"Edit Note":"Add Note"}):(0,Ti.jsxs)("div",{className:"extra-buttons",children:["completed"===d&&(0,Ti.jsx)("button",{className:"rating-button",onClick:()=>{c&&"character"!==n&&(y(!v),m(!1),g(!1),x(!1))},children:$>0?`\u2605 ${$}`:"Rate"}),(0,Ti.jsx)("button",{className:"note-button",onClick:G,children:D?"Edit Note":"Add Note"})]})]})]}),p&&(0,Ti.jsxs)("div",{className:"options-panel",ref:z,children:[(0,Ti.jsx)("div",{className:"options-panel-title",children:c?"Update status:":"Add to your list:"}),(0,Ti.jsx)("div",{className:"options-grid",children:("character"===n?["favorite"]:"anime"===n?["planning","watching","completed","onHold","dropped"]:"manga"===n?["planning","reading","completed","onHold","dropped"]:[]).map((e=>(0,Ti.jsx)("button",{className:"option-btn "+(d===e?"active":""),onClick:()=>(async e=>{if(!o)return void(window.location.href="/login");const l=localStorage.getItem("token");if(l){j(!0);try{let o;o="character"===n?`${ld}/api/user/characters`:`${ld}/api/user/${n}`;const d=c?`${o}/${t}`:o,p=c?"patch":"post";let f=A,g=R,v=O;"completed"===e&&("anime"===n&&r?(f=r,T(r)):"manga"===n&&(a&&(g=a,P(a)),s&&(v=s,I(s))));let b={};b="anime"===n?c?{status:e,currentEpisode:f}:{animeId:t,status:e,currentEpisode:"completed"===e&&r?r:0}:"manga"===n?c?{status:e,currentChapter:g,currentVolume:v}:{mangaId:t,status:e,currentChapter:"completed"===e&&a?a:0,currentVolume:"completed"===e&&s?s:0}:{characterId:t,isFavorite:!0},console.log("Sending API request with payload:",b);const x=await Gl({method:p,url:d,headers:{Authorization:`Bearer ${l}`,"Content-Type":"application/json"},data:b});console.log("API response:",x.data),x.data.success&&(u(!0),h(e),i&&i(e),"completed"!==e||c?"completed"===e&&c&&0===$&&(m(!1),setTimeout((()=>{y(!0)}),300)):(m(!1),setTimeout((()=>{y(!0)}),300)),console.log(`Successfully ${c?"updated":"added"} to list with status: ${e}`))}catch(d){console.error("Error:",d),S("Error processing request")}finally{j(!1),m(!1)}}else S("Not logged in")})(e),children:Q(e)},e)))}),c&&(0,Ti.jsx)("button",{className:"remove-btn",onClick:async()=>
4{if(!o||!c)return;const e=localStorage.getItem("token");if(e){j(!0);try{let r;r="character"===n?`${ld}/api/user/characters/${t}`:`${ld}/api/user/${n}/${t}`;(await Gl.delete(r,{headers:{Authorization:`Bearer ${e}`}})).data.success&&(u(!1),h(""),T(0),P(0),I(0),L(0),U(""),i&&i(null),console.log("Successfully removed from list"))}catch(r){console.error("Error removing:",r),S("Error removing from list")}finally{j(!1),m(!1)}}},children:"Remove from List"}),(0,Ti.jsx)("button",{className:"cancel-btn",onClick:()=>m(!1),children:"Cancel"})]}),f&&(0,Ti.jsxs)("div",{className:"progress-panel",ref:q,children:[(0,Ti.jsx)("div",{className:"progress-panel-title",children:"Update progress"}),"anime"===n&&(0,Ti.jsxs)("div",{className:"progress-control",children:[(0,Ti.jsx)("label",{children:"Episodes:"}),(0,Ti.jsxs)("div",{className:"progress-input-group",children:[(0,Ti.jsx)("button",{className:"progress-btn",onClick:()=>W(!1),disabled:A<=0,children:"-"}),(0,Ti.jsx)("input",{type:"number",min:"0",value:A,onChange:e=>K(e,"episode"),className:"progress-input"}),(0,Ti.jsx)("button",{className:"progress-btn",onClick:()=>W(!0),children:"+"})]}),r&&(0,Ti.jsxs)("span",{className:"total-indicator",children:["/ ",r]})]}),"manga"===n&&(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsxs)("div",{className:"progress-control",children:[(0,Ti.jsx)("label",{children:"Chapters:"}),(0,Ti.jsxs)("div",{className:"progress-input-group",children:[(0,Ti.jsx)("button",{className:"progress-btn",onClick:()=>W(!1),disabled:R<=0,children:"-"}),(0,Ti.jsx)("input",{type:"number",min:"0",value:R,onChange:e=>K(e,"chapter"),className:"progress-input"}),(0,Ti.jsx)("button",{className:"progress-btn",onClick:()=>W(!0),children:"+"})]}),a&&(0,Ti.jsxs)("span",{className:"total-indicator",children:["/ ",a]})]}),(0,Ti.jsxs)("div",{className:"progress-control",children:[(0,Ti.jsx)("label",{children:"Volumes:"}),(0,Ti.jsxs)("div",{className:"progress-input-group",children:[(0,Ti.jsx)("button",{className:"progress-btn",onClick:()=>V(!1),disabled:O<=0,children:"-"}),(0,Ti.jsx)("input",{type:"number",min:"0",value:O,onChange:e=>K(e,"volume"),className:"progress-input"}),(0,Ti.jsx)("button",{className:"progress-btn",onClick:()=>V(!0),children:"+"})]}),s&&(0,Ti.jsxs)("span",{className:"total-indicator",children:["/ ",s]})]})]}),(0,Ti.jsxs)("div",{className:"progress-buttons",children:[(0,Ti.jsx)("button",{className:"save-btn",onClick:async()=>{if(!o||!c)return;const e=localStorage.getItem("token");if(e){console.log("Updating progress with:",{itemType:n,currentEpisode:A,currentChapter:R,currentVolume:O}),j(!0);try{let o;o="character"===n?`${ld}/api/user/characters/${t}`:`${ld}/api/user/${n}/${t}`;let l={},c=!1,u="";"anime"===n?(l={currentEpisode:A},r&&A>=r&&(l.status="completed",c=!0,u=`${r} episodes completed! Marked as completed.`)):"manga"===n&&(l={currentChapter:R,currentVolume:O},a&&R>=a&&(l.status="completed",c=!0,u=`${a} chapters completed! Marked as completed.`),s&&O>=s&&(l.status="completed",c?u=`${a} chapters and ${s} volumes completed! Marked as completed.`:(c=!0,u=`${s} volumes completed! Marked as completed.`)));(await Gl.patch(o,l,{headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}})).data.success&&(l.status&&(h(l.status),i&&i(l.status)),c?(console.log("Automatically marked as completed"),E(u),0===$&&setTimeout((()=>{y(!0)}),300),setTimeout((()=>E("")),3e3)):(E("Progress updated successfully!"),setTimeout((()=>E("")),3e3)),console.log("Successfully updated progress"))}catch(l){console.error("Error updating progress:",l),S("Error updating progress")}finally{j(!1),g(!1)}}},children:"Save"}),(0,Ti.jsx)("button",{className:"cancel-btn",onClick:()=>g(!1),children:"Cancel"})]})]}),v&&(0,Ti.jsxs)("div",{className:"rating-panel",ref:B,children:[(0,Ti.jsxs)("div",{className:"rating-panel-title",children:["Rate this ",n]}),_?(0,Ti.jsx)("div",{className:"rating-number-input",children:(0,Ti.jsxs)("div",{className:"progress-input-group",children:[(0,Ti.jsx)("button",{className:"progress-btn",onClick:()=>L((e=>Math.max(1,e-1))),disabled:$<=1,children:"-"}),(0,Ti.jsx)("input",{type:"number",min:"1",max:"10",value:$||"",onChange:e=>{const t=parseInt(e.target.value);!isNaN(t)&&t>=1&&t<=10?L(t):""===e.target.value&&L(0)},className:"progress-input",placeholder:"1-10"}),(0,Ti.jsx)("button",{className:"progress-btn",onClick:()=>L((e=>Math.min(10,e+1))),disabled:$>=10,children:"+"})]})}):(0,Ti.jsx)("div",{className:"rating-stars",children:[...Array(10)].map(((e,t)=>{const n=t+1;return(0,Ti.jsx)("span",{className:"rating-star "+(n<=(F||$)?"filled":""),onClick:()=>L(n),onMouseEnter:()=>M(n),onMouseLeave:()=>M(0),children:"\u2605"},n)}))}),(0,Ti.jsx)("div",{className:"rating-value",children:$>0?`${$}/10`:"Select a rating"}),(0,Ti.jsxs)("div",{className:"rating-buttons",children:[(0,Ti.jsx)("button",{className:"save-btn",onClick:async()=>
4{if(!o||!c||0===$)return;const e=localStorage.getItem("token");if(e){j(!0);try{let r;r="character"===n?`${ld}/api/user/characters/${t}`:`${ld}/api/user/${n}/${t}`;const a={rating:$};(await Gl.patch(r,a,{headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}})).data.success&&(E(`Rating updated: ${$}/10`),setTimeout((()=>E("")),3e3),console.log(`Successfully rated as ${$}/10`))}catch(r){console.error("Error updating rating:",r),S("Error updating rating")}finally{j(!1),y(!1)}}},disabled:0===$,children:"Save"}),(0,Ti.jsx)("button",{className:"cancel-btn",onClick:()=>y(!1),children:"Cancel"})]})]}),b&&(0,Ti.jsxs)("div",{className:"note-panel",ref:H,children:[(0,Ti.jsx)("div",{className:"note-panel-title",children:D?"Edit note":"Add a note"}),(0,Ti.jsx)("textarea",{className:"note-textarea",value:D,onChange:e=>U(e.target.value),placeholder:"Add your personal notes about this title...",rows:5}),(0,Ti.jsxs)("div",{className:"note-buttons",children:[(0,Ti.jsx)("button",{className:"save-btn",onClick:async()=>{if(!o||!c)return;const e=localStorage.getItem("token");if(e){j(!0);try{let r;r="character"===n?`${ld}/api/user/characters/${t}`:`${ld}/api/user/${n}/${t}`;const a={notes:D};(await Gl.patch(r,a,{headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}})).data.success&&(E("Note saved successfully!"),setTimeout((()=>E("")),3e3),console.log("Successfully saved note"))}catch(r){console.error("Error saving note:",r),S("Error saving note")}finally{j(!1),x(!1)}}},children:"Save"}),(0,Ti.jsx)("button",{className:"cancel-btn",onClick:()=>x(!1),children:"Cancel"})]})]})]})},ud=e=>{let{imageUrl:t,alt:n,itemId:r,itemType:a,totalEpisodes:s,totalChapters:i,totalVolumes:o,onStatusChange:l}=e;return(0,Ti.jsxs)("div",{className:"poster",children:[(0,Ti.jsx)("img",{src:t,alt:n}),(0,Ti.jsx)(cd,{itemId:r,itemType:a,totalEpisodes:s,totalChapters:i,totalVolumes:o,onStatusChange:l})]})},dd=e=>{let{title:t,englishTitle:n,japaneseTitle:r,synonyms:a=[]}=e;return(0,Ti.jsxs)("div",{className:"titles",children:[(0,Ti.jsx)("h1",{children:t}),n&&(0,Ti.jsx)("h2",{children:n}),r&&(0,Ti.jsx)("h3",{children:r}),(null===a||void 0===a?void 0:a.length)>0&&(0,Ti.jsxs)("div",{className:"alt-titles",children:["Also known as: ",a.join(", ")]})]})},hd=e=>{let{label:t,value:n}=e;return(0,Ti.jsxs)("div",{className:"stat",children:[(0,Ti.jsx)("span",{className:"label",children:t}),(0,Ti.jsx)("span",{className:"value",children:n})]})},pd=e=>{let{stats:t}=e;return(0,Ti.jsx)("div",{className:"quick-stats",children:t.map(((e,t)=>(0,Ti.jsx)(hd,{label:e.label,value:e.value},t)))})},md=(0,_a.lazy)((()=>n.e(519).then(n.bind(n,519)))),fd=(0,_a.lazy)((()=>n.e(485).then(n.bind(n,485)))),gd=(0,_a.lazy)((()=>n.e(787).then(n.bind(n,787)))),vd=["https://res.cloudinary.com/dpz6ivjry/image/upload/v1741666344/740446_zkrklo.jpg"],yd=e=>{if(!e)return"Present";return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})},bd=[{id:"about",label:"About"},{id:"trailer",label:"Trailer"},{id:"production",label:"Production"}],xd=function(e,t){const n=t?.name||e.displayName||e.name||"unknown",r=r=>_a.createElement(ad,{...t,name:n,updateProps:r},_a.createElement(e,{...r}));return r.displayName=`profiler(${n})`,rd(r,e),r}((()=>{const{id:e}=(0,ki.g)(),[t,n]=(0,_a.useState)("about"),{data:r,isLoading:a,error:s}=td({queryKey:["anime",e],queryFn:async()=>{try{const t=await fetch(`https://animedb-production.up.railway.app/api/anime/${e}`);if(!t.ok)throw new Error(`Failed to fetch anime: ${t.status}`);return t.json()}catch(s){throw Dt(s,{tags:{component:"AnimeDetails",operation:"fetch"},extra:{animeId:e}}),s}},staleTime:3e5,cacheTime:18e5,refetchOnWindowFocus:!1,refetchOnMount:!1}),i=(0,_a.useMemo)((()=>r&&r.backdrops&&Array.isArray(r.backdrops)&&r.backdrops.length>0?r.backdrops:vd),[r]),o=(0,_a.useMemo)((()=>{var e,t,n,a,s;return r?[{label:"Score",value:r.score||"N/A"},{label:"Scored by",value:(null===(e=r.scored_by)||void 0===e?void 0:e.toLocaleString())||"N/A"},{label:"Rank",value:`#${(null===(t=r.rank)||void 0===t?void 0:t.toLocaleString())||"N/A"}`},{label:"Popularity",value:`#${(null===(n=r.popularity)||void 0===n?void 0:n.toLocaleStr
4ing())||"N/A"}`},{label:"Members",value:(null===(a=r.members)||void 0===a?void 0:a.toLocaleString())||"N/A"},{label:"Favorites",value:(null===(s=r.favorites)||void 0===s?void 0:s.toLocaleString())||"N/A"},{label:"MAL ID",value:r.mal_id||"N/A"}]:[]}),[r]),l=(0,_a.useMemo)((()=>{var e,t,n,a;return(null===r||void 0===r||null===(e=r.images)||void 0===e||null===(t=e.webp)||void 0===t?void 0:t.large_image_url)||(null===r||void 0===r||null===(n=r.images)||void 0===n||null===(a=n.jpg)||void 0===a?void 0:a.large_image_url)||""}),[r]),c=(0,_a.useCallback)((t=>{Rr({category:"user.action",message:"Updated anime status",level:"info",data:{animeId:e,newStatus:t}})}),[e]),u=(0,_a.useCallback)((e=>{Rr({category:"ui.interaction",message:`Changed tab to ${e}`,level:"info"}),n(e)}),[]);return a?(0,Ti.jsx)(au,{}):s?(0,Ti.jsx)(sd,{message:s.message}):(0,Ti.jsxs)("div",{className:"anime-details",children:[(0,Ti.jsx)(od,{backdrops:i,children:(0,Ti.jsxs)("div",{className:"hero-content",children:[(0,Ti.jsx)(ud,{imageUrl:l,itemId:r.id,itemType:"anime",totalEpisodes:r.episodes,onStatusChange:c,alt:r.title}),(0,Ti.jsxs)("div",{className:"info",children:[(0,Ti.jsx)(dd,{title:r.title,englishTitle:r.title_english,japaneseTitle:r.title_japanese,synonyms:r.title_synonyms}),(0,Ti.jsx)(pd,{stats:o})]})]})}),(0,Ti.jsxs)("div",{className:"content-wrapper",children:[(0,Ti.jsx)(id,{tabs:bd,activeTab:t,onTabChange:u}),(0,Ti.jsxs)(_a.Suspense,{fallback:(0,Ti.jsx)("div",{className:"tab-loading",children:(0,Ti.jsx)(au,{size:"small"})}),children:["about"===t&&(0,Ti.jsx)(md,{anime:r}),"trailer"===t&&(0,Ti.jsx)(fd,{trailer:r.trailer}),"production"===t&&(0,Ti.jsx)(gd,{anime:r})]})]}),(0,Ti.jsxs)("div",{className:"additional-info",children:[(0,Ti.jsxs)("span",{children:["Added: ",yd(r.created_at)]}),(0,Ti.jsxs)("span",{children:["Last updated: ",yd(r.updated_at)]})]})]})}),{name:"AnimeDetails"}),wd=_a.memo(xd),jd=e=>{let{tags:t,emptyMessage:n="N/A",className:r="tags",tagClassName:a="tag",emptyClassName:s="na"}=e;return(0,Ti.jsx)("div",{className:r,children:(null===t||void 0===t?void 0:t.length)>0?t.map(((e,t)=>(0,Ti.jsx)("span",{className:a,children:e},t))):(0,Ti.jsx)("span",{className:s,children:n})})},Nd=e=>{let{genres:t}=e;const n=Array.isArray(t)?t.map((e=>"string"===typeof e?e:e.name||e)):[];return(0,Ti.jsxs)("div",{className:"manga-tag-group",children:[(0,Ti.jsx)("h4",{children:"Genres"}),(0,Ti.jsx)(jd,{tags:n,emptyMessage:"No genres listed",className:"manga-tags",tagClassName:"manga-tag"})]})},Sd=e=>{let{themes:t}=e;const n=Array.isArray(t)?t.map((e=>"string"===typeof e?e:e.name||e)):[];return(0,Ti.jsxs)("div",{className:"manga-tag-group",children:[(0,Ti.jsx)("h4",{children:"Themes"}),(0,Ti.jsx)(jd,{tags:n,emptyMessage:"N/A",className:"manga-tags",tagClassName:"manga-tag"})]})},kd=e=>{let{manga:t}=e;console.log("Manga data:",t),console.log("Genres:",t.genres),console.log("Themes:",t.themes);const n=[{label:"Type",value:t.type||"N/A"},{label:"Status",value:t.status||"N/A"},{label:"Demographics",value:Array.isArray(t.demographics)?t.demographics.map((e=>"string"===typeof e?e:e.name)).join(", "):"N/A"}];return(0,Ti.jsxs)("div",{className:"manga-tab-content",children:[(0,Ti.jsxs)("div",{className:"manga-left-column",children:[(0,Ti.jsxs)("div",{className:"manga-synopsis",children:[(0,Ti.jsx)("h3",{children:"Synopsis"}),(0,Ti.jsx)("p",{children:t.synopsis||"No synopsis available."}),t.background&&(0,Ti.jsxs)("div",{className:"manga-background-info",children:[(0,Ti.jsx)("h4",{children:"Backgroun
4d"}),(0,Ti.jsx)("p",{children:t.background})]})]}),(0,Ti.jsx)("div",{className:"manga-details-grid",children:(0,Ti.jsxs)("div",{className:"manga-detail-section",children:[(0,Ti.jsx)("h4",{children:"General Information"}),n.map(((e,t)=>(0,Ti.jsxs)("div",{className:"manga-detail-item",children:[(0,Ti.jsx)("span",{className:"manga-label",children:e.label}),(0,Ti.jsx)("span",{className:"manga-value",children:e.value})]},t)))]})})]}),(0,Ti.jsx)("div",{className:"manga-right-column",children:(0,Ti.jsxs)("div",{className:"manga-content-tags",children:[(0,Ti.jsx)(Nd,{genres:t.genres||[]}),(0,Ti.jsx)(Sd,{themes:t.themes||[]})]})})]})},Ed=e=>{var t,n,r;let{manga:a,formatDate:s}=e;return(0,Ti.jsx)("div",{className:"manga-tab-content",children:(0,Ti.jsx)("div",{className:"manga-publication-info",children:(0,Ti.jsxs)("div",{className:"manga-pub-section",children:[(0,Ti.jsx)("h4",{children:"Publication Details"}),(0,Ti.jsxs)("div",{className:"manga-pub-item",children:[(0,Ti.jsx)("span",{className:"manga-label",children:"Start Date"}),(0,Ti.jsx)("span",{className:"manga-value",children:s(null===(t=a.published)||void 0===t?void 0:t.from)})]}),(0,Ti.jsxs)("div",{className:"manga-pub-item",children:[(0,Ti.jsx)("span",{className:"manga-label",children:"End Date"}),(0,Ti.jsx)("span",{className:"manga-value",children:s(null===(n=a.published)||void 0===n?void 0:n.to)||"Ongoing"})]}),(0,Ti.jsxs)("div",{className:"manga-pub-item",children:[(0,Ti.jsx)("span",{className:"manga-label",children:"Serialization"}),(0,Ti.jsx)("span",{className:"manga-value",children:(null===(r=a.serializations)||void 0===r?void 0:r.join(", "))||"N/A"})]}),(0,Ti.jsxs)("div",{className:"manga-pub-item",children:[(0,Ti.jsx)("span",{className:"manga-label",children:"Volumes"}),(0,Ti.jsx)("span",{className:"manga-value",children:a.volumes||"N/A"})]}),(0,Ti.jsxs)("div",{className:"manga-pub-item",children:[(0,Ti.jsx)("span",{className:"manga-label",children:"Chapters"}),(0,Ti.jsx)("span",{className:"manga-value",children:a.chapters||"N/A"})]})]})})})},_d=e=>{var t;let{manga:n}=e;return(0,Ti.jsx)("div",{className:"manga-tab-content",children:(0,Ti.jsxs)("div",{className:"manga-creators-grid",children:[(0,Ti.jsxs)("div",{className:"manga-creator-group",children:[(0,Ti.jsx)("h4",{children:"Authors"}),(0,Ti.jsx)("div",{className:"manga-creator-tags",children:(null===(t=n.authors)||void 0===t?void 0:t.length)>0?n.authors.map(((e,t)=>(0,Ti.jsx)("span",{className:"manga-creator-tag",children:e.name},t))):(0,Ti.jsx)("span",{className:"manga-na",children:"No authors listed"})})]}),n.illustrators&&n.illustrators.length>0&&(0,Ti.jsxs)("div",{className:"manga-creator-group",children:[(0,Ti.jsx)("h4",{children:"Illustrators"}),(0,Ti.jsx)("div",{className:"manga-creator-tags",children:n.illustrators.map(((e,t)=>(0,Ti.jsx)("span",{className:"manga-creator-tag",children:e.name},t)))})]}),n.publishers&&n.publishers.length>0&&(0,Ti.jsxs)("div",{className:"manga-creator-group",children:[(0,Ti.jsx)("h4",{children:"Publishers"}),(0,Ti.jsx)("div",{className:"manga-creator-tags",children:n.publishers.map(((e,t)=>(0,Ti.jsx)("span",{className:"manga-creator-tag",children:e},t)))})]})]})})},Cd=()=>{var e,t,n,r;const{id:a}=(0,ki.g)(),[s,i]=(0,_a.useState)(null),[o,l]=(0,_a.useState)("about"),[c,u]=(0,_a.useState)(!0),[d,h]=(0,_a.useState)(null);(0,_a.useEffect)((()=>{u(!0),h(null),fetch(`https://animedb-production.up.railway.app/api/manga/${a}`).then((e=>{if(!e.ok)throw new Error(`Failed to fetch manga: ${e.status}`);return e.json()})).then((e=>{i(e),u(!1)})).catch((e=>{h(e.message),u(!1)}))}),[a]);const p=e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.toLocaleString())&&void 0!==t?t:"N/A"};if(c)return(0,Ti.jsx)(au,{});if(d)return(0,Ti.jsx)(sd,{message:d});const m=[{label:"Score",value:s.score||"-"},{label:"Rank",value:`#${p(s.rank)}`},{label:"Popularity",value:`#${p(s.popularity)}`},{label:"Members",value:p(s.members)},{label:"Chapters",value:s.chapters||"-"},{label:"Volumes",value:s.volumes||"-"}];return(0,Ti.jsxs)("div",{className:"manga-details",children:[(0,Ti.jsx)("div",{className:"manga-hero",style:{backgroundImage:`url(${null===(e=s.images)||void 0===e||null===(t=e.webp)||void 0===t?void 0:t.large_image_url})`},children:(0,Ti.jsxs)("div",{className:"manga-hero-content",children:[(0,Ti.jsx)(ud,{imageUrl:null===(n=s.images)||void 0===n||null===(r=n.webp)||void 0===r?void 0:r.large_image_url,
4itemId:s.id,itemType:"manga",totalChapters:s.chapters,totalVolumes:s.volumes,onStatusChange:e=>{},alt:s.title}),(0,Ti.jsxs)("div",{className:"manga-info",children:[(0,Ti.jsx)(dd,{title:s.title,englishTitle:s.title_english,japaneseTitle:s.title_japanese,synonyms:s.title_synonyms}),(0,Ti.jsx)(pd,{stats:m})]})]})}),(0,Ti.jsxs)("div",{className:"manga-content-wrapper",children:[(0,Ti.jsx)(id,{tabs:[{id:"about",label:"About"},{id:"publication",label:"Publication"},{id:"creators",label:"Creators"}],activeTab:o,onTabChange:l}),"about"===o&&(0,Ti.jsx)(kd,{manga:s}),"publication"===o&&(0,Ti.jsx)(Ed,{manga:s,formatDate:e=>{if(!e)return"Present";return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}}),"creators"===o&&(0,Ti.jsx)(_d,{manga:s})]}),(0,Ti.jsxs)("div",{className:"manga-additional-info",children:[(0,Ti.jsxs)("span",{children:["Added: ",new Date(s.createdAt).toLocaleDateString()]}),(0,Ti.jsxs)("span",{children:["Last updated: ",new Date(s.updatedAt).toLocaleDateString()]})]})]})},Ad="https://animedb-production.up.railway.app",Td=()=>{const[e,t]=(0,_a.useState)(""),[n,r]=(0,_a.useState)(""),[a,s]=(0,_a.useState)(""),[i,o]=(0,_a.useState)(""),[l,c]=(0,_a.useState)(!1),[u,d]=(0,_a.useState)(!1),[h,p]=(0,_a.useState)(""),[m,f]=(0,_a.useState)(!1),[g,v]=(0,_a.useState)(null),[y,b]=(0,_a.useState)(!1),{login:x}=ec(),w=(0,ki.Zp)(),j=(0,ki.zy)();(0,_a.useEffect)((()=>{const e=new URLSearchParams(j.search);"true"===e.get("verified")?o("Email verified successfully! You can now log in."):"success"===e.get("reset")&&o("Password reset successful! You can now log in with your new password.")}),[j]);return(0,Ti.jsxs)("div",{className:"login",children:[(0,Ti.jsx)("h1",{children:"Login"}),a&&(0,Ti.jsx)("p",{className:"error-message",children:a}),i&&(0,Ti.jsx)("p",{className:"success-message",children:i}),u&&(0,Ti.jsxs)("div",{className:"verification-needed",children:[(0,Ti.jsx)("p",{className:"verification-message",children:"Your email address has not been verified yet. Please check your inbox for a verification link."}),g&&(0,Ti.jsx)("p",{className:`resend-message ${g.type}`,children:g.text}),(0,Ti.jsx)("button",{onClick:async()=>{if(h&&!m){f(!0),v(null);try{const e=await Gl.post(`${Ad}/api/users/resend-verification`,{email:h});v({type:"success",text:e.data.message||"Verification email sent! Please check your inbox."})}catch(n){var e,t;v({type:"error",text:(null===(e=n.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||"Failed to resend verification email"})}finally{f(!1)}}},disabled:m,className:"resend-button "+(m?"loading":""),children:m?"Sending...":"Resend Verification Email"}),(0,Ti.jsx)(ki.N_,{to:"/verification-pending",className:"verification-link",children:"Need help with verification?"})]}),(0,Ti.jsxs)("form",{onSubmit:async t=>{t.preventDefault(),s(""),o(""),c(!0),d(!1);try{const t=await Gl.post(`${Ad}/api/users/login`,{email:e,password:n});await x(t.data.token),w("/")}catch(u){var r,a,i,l;if(null!==(r=u.response)&&void 0!==r&&null!==(a=r.data)&&void 0!==a&&a.needsVerification)d(!0),p(u.response.data.email||e),s("Please verify your email before logging in.");else s((null===(i=u.response)||void 0===i||null===(l=i.data)||void 0===l?void 0:l.error)||"Login failed. Please check your credentials.")}finally{c(!1)}},children:[(0,Ti.jsx)("input",{type:"email",placeholder:"Email",value:e,onChange:e=>t(e.target.value),required:!0,disabled:l}),(0,Ti.jsxs)("div",{className:"password-field",children:[(0,Ti.jsx)("input",{type:y?"text":"password",placeholder:"Password",value:n,onChange:e=>r(e.target.value),required:!0,disabled:l}),(0,Ti.jsx)("button",{type:"button",className:"password-toggle",onClick:()=>{b(!y)},tabIndex:"-1",children:y?"Hide":"Show"})]}),(0,Ti.jsx)("div",{className:"forgot-password-link",children:(0,Ti.jsx)(ki.N_,{to:"/forgot-password",children:"Forgot Password?"})}),(0,Ti.jsx)("button",{type:"submit",disabled:l,className:l?"loading":"",children:l?"Logging in...":"Login"})]})]})},Rd=()=>{const[e,t]=(0,_a.useState)({username:"",email:"",password:"",gender:"prefer not to say"}),[n,r]=(0,_a.useState)(null),[a,s]=(0,_a.useState)(""),[i,o]=(0,_a.useState)(""),[l,c]=(0,_a.useState)(!1),[u,d]=(0,_a.useState)(!1),[h,p]=(0,_a.useState)({length:!0,uppercase:!0,lowercase:!0,number:!0,special:!0}),m=(0,ki.Zp)(),f=e=>{const{name:n,value:r}=e.target;"password"===n&&g(r),t((e=>({...e,[n]:r})))},g=e=>{p({length:e.length<10,uppercase:!/[A-Z]/.test(e),lowercase:!/[a-z]/.test(e),number:!/\d/.test(e),special:!/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(e)})},v=()=>!Object.values(h).some((e=>e));return(0,Ti.jsxs)("div",{className:"signup",children:[(0,Ti.jsx)("h1",{children:"Create Account"}),a&&(0,Ti.jsx)("p",{className:"error-message",children:a}),i&&(0,Ti.jsx)("p",{className:"success-message",children:i}),(0,Ti.jsxs)("form",{onSubmit:async a=>{a.preventDefault(),s(""),o(""),c(!0);const i=Object.values(h).some((e=>e));if(i)return s("Password does not meet all requirements"),void c(!1);const l=new FormData;l.append("username",e.username),l.append("email",e.email),l.append("password",e.password),l.append("gender",e.gender),n&&l.append("profilePicture",n);try{const n=await fetch("https://animedb-production.up.railway.app/
4api/users/signup",{method:"POST",body:l}),a=await n.json();if(!n.ok)throw new Error(a.error||"Signup failed");o(a.message||"Account created successfully! Please check your email to verify your account."),t({username:"",email:"",password:"",gender:"prefer not to say"}),r(null),setTimeout((()=>{m("/verification-pending",{state:{email:e.email,message:a.message}})}),3e3)}catch(u){s(u.message)}finally{c(!1)}},children:[(0,Ti.jsxs)("div",{className:"input-group",children:[(0,Ti.jsx)("input",{type:"text",name:"username",placeholder:"Username",required:!0,minLength:"3",maxLength:"30",value:e.username,onChange:f,disabled:l}),(0,Ti.jsx)("input",{type:"email",name:"email",placeholder:"Email",required:!0,value:e.email,onChange:f,disabled:l}),(0,Ti.jsxs)("div",{className:"password-container",children:[(0,Ti.jsxs)("div",{className:"password-field",children:[(0,Ti.jsx)("input",{type:u?"text":"password",name:"password",placeholder:"Password",required:!0,value:e.password,onChange:f,className:v()?"valid-password":"",disabled:l}),(0,Ti.jsx)("button",{type:"button",className:"password-toggle",onClick:()=>{d(!u)},tabIndex:"-1",children:u?"Hide":"Show"})]}),(0,Ti.jsxs)("div",{className:"password-requirements",children:[(0,Ti.jsx)("p",{className:h.length?"requirement":"requirement met",children:"\u2713 At least 10 characters"}),(0,Ti.jsx)("p",{className:h.uppercase?"requirement":"requirement met",children:"\u2713 At least one uppercase letter"}),(0,Ti.jsx)("p",{className:h.lowercase?"requirement":"requirement met",children:"\u2713 At least one lowercase letter"}),(0,Ti.jsx)("p",{className:h.number?"requirement":"requirement met",children:"\u2713 At least one number"}),(0,Ti.jsx)("p",{className:h.special?"requirement":"requirement met",children:"\u2713 At least one special character"})]})]})]}),(0,Ti.jsxs)("div",{className:"input-group gender-group",children:[(0,Ti.jsx)("h3",{children:"Gender"}),(0,Ti.jsxs)("div",{className:"radio-group",children:[(0,Ti.jsxs)("label",{children:[(0,Ti.jsx)("input",{type:"radio",name:"gender",value:"male",checked:"male"===e.gender,onChange:f,disabled:l}),"Male"]}),(0,Ti.jsxs)("label",{children:[(0,Ti.jsx)("input",{type:"radio",name:"gender",value:"female",checked:"female"===e.gender,onChange:f,disabled:l}),"Female"]}),(0,Ti.jsxs)("label",{children:[(0,Ti.jsx)("input",{type:"radio",name:"gender",value:"other",checked:"other"===e.gender,onChange:f,disabled:l}),"Other"]}),(0,Ti.jsxs)("label",{children:[(0,Ti.jsx)("input",{type:"radio",name:"gender",value:"prefer not to say",checked:"prefer not to say"===e.gender,onChange:f,disabled:l}),"Prefer not to say"]})]})]}),(0,Ti.jsxs)("div",{className:"input-group file-upload",children:[(0,Ti.jsx)("h3",{children:"Profile Picture (Optional)"}),(0,Ti.jsx)("input",{type:"file",name:"profilePicture",accept:"image/*",onChange:e=>{e.target.files&&e.target.files[0]&&r(e.target.files[0])},disabled:l})]}),(0,Ti.jsx)("button",{type:"submit",disabled:!v()||l,className:l?"loading":"",children:l?"Creating Account...":"Create Account"})]})]})},Pd=()=>{var e,t;const n=(0,ki.zy)(),[r,a]=(0,_a.useState)("idle"),[s,i]=(0,_a.useState)(""),o=(null===(e=n.state)||void 0===e?void 0:e.email)||"",l=(null===(t=n.state)||void 0===t?void 0:t.message)||"";return(0,Ti.jsx)("div",{className:"verification-pending",children:(0,Ti.jsxs)("div",{className:"verification-pending-card",children:[(0,Ti.jsx)("div",{className:"icon",children:(0,Ti.jsxs)("svg",{width:"64",height:"64",viewBox:"0 0 24 24",fill:"none",stroke:"#6c5ce7",strokeWidth:"2",children:[(0,Ti.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Ti.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,Ti.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),(0,Ti.jsx)("h1",{children:"Verification Pending"}),(0,Ti.jsx)("p",{className:"main-message",children:l||"We've sent a verification link to your email address. Please check your inbox and click the link to activate your account."}),o&&(0,Ti.jsxs)("div",{className:"email-box",children:[(0,Ti.jsx)("p",{className:"email-sent-to",children:"Verification email sent to:"}),(0,Ti.jsx)("p",{className:"email-address",children:o})]}),"success"===r&&(0,Ti.jsx)("p",{className:"success-message",children:s}),"error"===r&&(0,Ti.jsx)("p",{className:"error-message",children:s}),(0,Ti.jsxs)("div",{className:"verification-actions",children:[(0,Ti.jsx)("button",{onClick:async()=>
4{if(o&&"loading"!==r){a("loading"),i("");try{const e=await fetch("https://animedb-production.up.railway.app/api/users/resend-verification",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:o})}),t=await e.json();if(!e.ok)throw new Error(t.error||"Failed to resend verification email");a("success"),i(t.message||"Verification email sent! Please check your inbox.")}catch(e){a("error"),i(e.message)}}},className:"resend-button "+("loading"===r?"loading":""),disabled:"loading"===r||!o,children:"loading"===r?"Sending...":"Resend Verification Email"}),(0,Ti.jsx)(ki.N_,{to:"/login",className:"login-link",children:"Return to Login"})]}),(0,Ti.jsx)("div",{className:"help-text",children:(0,Ti.jsx)("p",{children:"If you don't see the email in your inbox, please check your spam folder. If you continue to have issues, please contact support."})})]})})},Od=()=>{const{token:e}=(0,ki.g)(),t=(0,ki.Zp)(),[n,r]=(0,_a.useState)("verifying"),[a,s]=(0,_a.useState)("");return(0,_a.useEffect)((()=>{(async()=>{if(!e)return r("error"),void s("Invalid verification link. No token provided.");try{const n=await fetch(`https://animedb-production.up.railway.app/api/users/verify-email/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),a=await n.json();if(!n.ok)throw new Error(a.error||"Verification failed");r("success"),s(a.message||"Your email has been verified successfully!"),setTimeout((()=>{t("/login?verified=true")}),3e3)}catch(n){r("error"),s(n.message||"An error occurred during verification.")}})()}),[e,t]),(0,Ti.jsx)("div",{className:"email-verification",children:(0,Ti.jsxs)("div",{className:"verification-card",children:["verifying"===n&&(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)("div",{className:"icon loading",children:(0,Ti.jsx)("div",{className:"spinner"})}),(0,Ti.jsx)("h1",{children:"Verifying Your Email"}),(0,Ti.jsx)("p",{className:"main-message",children:"Please wait while we verify your email address..."})]}),"success"===n&&(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)("div",{className:"icon success",children:(0,Ti.jsxs)("svg",{width:"64",height:"64",viewBox:"0 0 24 24",fill:"none",stroke:"#2ed573",strokeWidth:"2",children:[(0,Ti.jsx)("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),(0,Ti.jsx)("polyline",{points:"22 4 12 14.01 9 11.01"})]})}),(0,Ti.jsx)("h1",{children:"Email Verified!"}),(0,Ti.jsx)("p",{className:"main-message",children:a}),(0,Ti.jsx)("p",{className:"redirect-message",children:"You'll be redirected to login page shortly..."}),(0,Ti.jsx)("div",{className:"verification-actions",children:(0,Ti.jsx)(ki.N_,{to:"/login",className:"login-button",children:"Go to Login"})})]}),"error"===n&&(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)("div",{className:"icon error",children:(0,Ti.jsxs)("svg",{width:"64",height:"64",viewBox:"0 0 24 24",fill:"none",stroke:"#ff4757",strokeWidth:"2",children:[(0,Ti.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Ti.jsx)("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),(0,Ti.jsx)("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})}),(0,Ti.jsx)("h1",{children:"Verification Failed"}),(0,Ti.jsx)("p",{className:"main-message",children:a}),(0,Ti.jsxs)("div",{className:"verification-actions",children:[(0,Ti.jsx)(ki.N_,{to:"/verification-pending",className:"resend-button",children:"Request New Link"}),(0,Ti.jsx)(ki.N_,{to:"/login",className:"login-link",children:"Return to Login"})]})]})]})})},Id=()=>{const[e,t]=(0,_a.useState)(""),[n,r]=(0,_a.useState)(""),[a,s]=(0,_a.useState)(""),[i,o]=(0,_a.useState)(!1);return(0,Ti.jsxs)("div",{className:"login",children:[(0,Ti.jsx)("h1",{children:"Reset Password"}),a&&(0,Ti.jsx)("p",{className:"error",children:a}),n&&(0,Ti.jsx)("p",{className:"success-message",children:n}),n?(0,Ti.jsx)("div",{className:"back-to-login",children:(0,Ti.jsx)(ki.N_,{to:"/login",children:"Back to Login"})}):(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)("p",{className:"reset-instructions",children:"Enter your email address and we'll send you a link to reset your password."}),(0,Ti.jsxs)("form",{onSubmit:async t=>{t.preventDefault(),o(!0),s(""),r("");try{const t=await Gl.post("https://animedb-production.up.railway.app/
4api/users/forgot-password",{email:e});r(t.data.message)}catch(i){var n,a;0,s((null===(n=i.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.error)||"Something went wrong. Please try again.")}finally{o(!1)}},children:[(0,Ti.jsx)("input",{type:"email",placeholder:"Email",value:e,onChange:e=>t(e.target.value),required:!0,disabled:i}),(0,Ti.jsx)("button",{type:"submit",disabled:i,className:i?"loading":"",children:i?"Sending...":"Send Reset Link"})]}),(0,Ti.jsx)("div",{className:"back-to-login",children:(0,Ti.jsx)(ki.N_,{to:"/login",children:"Back to Login"})})]})]})},$d="https://animedb-production.up.railway.app",Ld=()=>{const{token:e}=(0,ki.g)(),t=(0,ki.Zp)(),[n,r]=(0,_a.useState)(""),[a,s]=(0,_a.useState)(""),[i,o]=(0,_a.useState)(""),[l,c]=(0,_a.useState)(""),[u,d]=(0,_a.useState)(""),[h,p]=(0,_a.useState)(!0),[m,f]=(0,_a.useState)(!1),[g,v]=(0,_a.useState)(!1),[y,b]=(0,_a.useState)(!1);(0,_a.useEffect)((()=>{(async()=>{try{const t=await Gl.get(`${$d}/api/users/reset-password/${e}`);f(!0),o(t.data.email||"")}catch(r){var t,n;0,d((null===(t=r.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Invalid or expired reset link."),f(!1)}finally{p(!1)}})()}),[e]);return h?(0,Ti.jsxs)("div",{className:"login",children:[(0,Ti.jsx)("h1",{children:"Reset Password"}),(0,Ti.jsx)("p",{className:"loading-message",children:"Validating your reset link..."})]}):m?(0,Ti.jsxs)("div",{className:"login",children:[(0,Ti.jsx)("h1",{children:"Set New Password"}),u&&(0,Ti.jsx)("p",{className:"error",children:u}),l&&(0,Ti.jsx)("p",{className:"success-message",children:l}),l?(0,Ti.jsx)("div",{className:"back-to-login",children:(0,Ti.jsx)(ki.N_,{to:"/login",children:"Back to Login"})}):(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsxs)("p",{className:"email-display",children:["Setting a new password for: ",(0,Ti.jsx)("strong",{children:i})]}),(0,Ti.jsxs)("form",{onSubmit:async r=>{if(r.preventDefault(),p(!0),d(""),c(""),n!==a)return d("Passwords do not match."),void p(!1);try{const r=await Gl.post(`${$d}/api/users/reset-password/${e}`,{password:n});c(r.data.message),setTimeout((()=>{t("/login?reset=success")}),3e3)}catch(o){var s,i;0,d((null===(s=o.response)||void 0===s||null===(i=s.data)||void 0===i?void 0:i.error)||"Something went wrong. Please try again.")}finally{p(!1)}},children:[(0,Ti.jsxs)("div",{className:"password-field",children:[(0,Ti.jsx)("input",{type:g?"text":"password",placeholder:"New Password",value:n,onChange:e=>r(e.target.value),required:!0,disabled:h}),(0,Ti.jsx)("button",{type:"button",className:"password-toggle",onClick:()=>{v(!g)},tabIndex:"-1","aria-label":g?"Hide password":"Show password",children:g?(0,Ti.jsxs)("svg",{className:"eye-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:[(0,Ti.jsx)("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),(0,Ti.jsx)("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):(0,Ti.jsxs)("svg",{className:"eye-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:[(0,Ti.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,Ti.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})})]}),(0,Ti.jsx)("p",{className:"password-requirements",children:"Password must be at least 10 characters with uppercase, lowercase, number, and special character."}),(0,Ti.jsxs)("div",{className:"password-field",children:[(0,Ti.jsx)("input",{type:y?"text":"password",placeholder:"Confirm Password",value:a,onChange:e=>s(e.target.value),required:!0,disabled:h}),(0,Ti.jsx)("button",{type:"button",className:"password-toggle",onClick:()=>{b(!y)},tabIndex:"-1","aria-label":y?"Hide password":"Show password",children:y?(0,Ti.jsxs)("svg",{className:"eye-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:[(0,Ti.jsx)("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),(0,Ti.jsx)("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):(0,Ti.jsxs)("svg",{className:"eye-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:[(0,Ti.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,Ti.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})})]}),(0,Ti.jsx)("button",{type:"submit",disabled:h,className:h?"loading":"",children:h?"Resetting...":"Reset Password"})]})]})]}):(0,Ti.jsxs)("div",{className:"login",children:[(0,Ti.jsx)("h1",{children:"Reset Password"}),(0,Ti.jsx)("p",{className:"error",children:u}),(0,Ti.jsx)("div",{className:"back-to-login",children:(0,Ti.jsx)(ki.N_,{to:"/forgot-password",children:"Request a new password reset link"})}),(0,Ti.jsx)("div",{className:"back-to-login",children:(0,Ti.jsx)(ki.N_,{to:"/login",children:"Back to Login"})})]})},Fd="https://animedb-production.up.railway.app",Md=async e=>{const t=localStorage.getItem("token");if(!t)throw new Error("Authentication required");try{return(await Gl.get(`${Fd}/api/user/anime/status/${e}`,{headers:{Authorization:`Bearer ${t}`}})).data.data||[]}catch(n){return console.error(`Error fetching ${e} anime:`,n),[]}},Dd=async e=>{const t=localStorage.getItem("token");if(!t)throw new Error("Authentication required");try{return(await Gl.get(`${Fd}/api/user/manga/status/${e}`,{headers:{Authorization:`Bearer ${t}`}})).data.data||[]}catch(n){return console.error(`Error fetching ${e} manga:`,n),[]}},Ud=async()=>{const e=localStorage.getItem("token");if(!e)throw new Error("Authentication required");try{return(await Gl.get(`${Fd}/api/user/characters/favorites`,{headers:{Authorization:`Bearer ${e}`}})).data.data||[]}catch(t){return console.error("Error fetching favorite characters:",t),[]}},zd=async()=>{const e=localStorage.getItem("token");if(!e)throw new Error("Authentication required");try{const t=await Gl.get(`${Fd}/api/profile/all`,{headers:{Authorization:`Bearer ${e}`}});if(!t.data.success)throw new Error(t.data.error||"Failed to fetch profile data");return t.data.data||{anime:{watching:[],completed:[],planning:[],onHold:[],dropped:[]},manga:{reading:[],completed:[],planning:[],onHold:[],dropped:[]},characters:[]}}catch(t){return console.error("Error fetching profile data:",t),{anime:{watching:[],completed:[],planning:[],onHold:[],dropped:[]},manga:{reading:[],completed:[],planning:[],onHold:[],dropped:[]},characters:[]}}},qd=e=>{let{user:t,isEditingProfile:n,setIsEditingProfile:r,profileFileInputRef:a,handleProfileImageChange:s,triggerProfileFileInput:i}=e;const[o,l]=(0,_a.useState)("108, 92, 231"),c=(0,_a.useRef)(null);(0,_a.useEffect)((()=>
4{if(null!==t&&void 0!==t&&t.profilePicture){const e=new Image;e.crossOrigin="Anonymous",e.onerror=()=>{console.log("Error loading image for color extraction - possibly a CORS issue")},e.onload=()=>{try{const t=u(e);l(t)}catch(t){console.error("Error extracting color:",t)}},e.src=t.profilePicture}}),[null===t||void 0===t?void 0:t.profilePicture]);const u=e=>{const t=document.createElement("canvas"),n=t.getContext("2d");t.width=50,t.height=50,n.drawImage(e,0,0,t.width,t.height);const r=n.getImageData(0,0,t.width,t.height).data;let a=0,s=0,i=0,o=0;for(let l=0;l<r.length;l+=16)r[l+3]>128&&(a+=r[l],s+=r[l+1],i+=r[l+2],o++);if(o>0){a=Math.floor(a/o),s=Math.floor(s/o),i=Math.floor(i/o);const e=1.2;return a=Math.min(255,Math.floor(a*e)),s=Math.min(255,Math.floor(s*e)),i=Math.min(255,Math.floor(i*e)),`${a}, ${s}, ${i}`}return"108, 92, 231"};return(0,Ti.jsxs)("div",{className:"sidebar-header",children:[(0,Ti.jsxs)("div",{className:"profile-photo",style:{"--profile-glow-color":o},ref:c,children:[(0,Ti.jsx)("img",{src:t.profilePicture,alt:t.username}),n&&(0,Ti.jsx)("button",{className:"change-profile-photo-btn",onClick:i,children:"Change Photo"})]}),(0,Ti.jsx)("div",{className:"profile-username",children:(0,Ti.jsx)("h1",{children:t.username})}),(0,Ti.jsx)("input",{type:"file",onChange:s,accept:"image/*",ref:a,style:{display:"none"}})]})},Bd=e=>{let{user:t}=e;return(0,Ti.jsxs)("div",{className:"info-card profile-card",children:[(0,Ti.jsx)("h2",{children:"Profile Details"}),(0,Ti.jsxs)("div",{className:"info-grid",children:[(0,Ti.jsx)("div",{className:"info-item",children:(0,Ti.jsx)("span",{className:"value",children:t.email})}),(0,Ti.jsx)("div",{className:"info-item",children:(0,Ti.jsx)("span",{className:"value",children:t.gender})})]})]})},Hd=e=>{let{animeCollection:t,mangaCollection:n,favoriteCharacters:r}=e;return(0,Ti.jsxs)("div",{className:"info-card profile-card",children:[(0,Ti.jsx)("h2",{children:"Activity Stats"}),(0,Ti.jsxs)("div",{className:"stats-grid",children:[(0,Ti.jsxs)("div",{className:"stat-item",children:[(0,Ti.jsx)("span",{className:"stat-number",children:(()=>{let e=0;return Object.values(t).forEach((t=>{t.forEach((t=>{e+=t.currentEpisode||0}))})),e})()}),(0,Ti.jsx)("span",{className:"stat-label",children:"Episodes Watched"})]}),(0,Ti.jsxs)("div",{className:"stat-item",children:[(0,Ti.jsx)("span",{className:"stat-number",children:(()=>{let e=0;return Object.values(n).forEach((t=>{t.forEach((t=>{e+=t.currentChapter||0}))})),e})()}),(0,Ti.jsx)("span",{className:"stat-label",children:"Chapters Read"})]}),(0,Ti.jsxs)("div",{className:"stat-item",children:[(0,Ti.jsx)("span",{className:"stat-number",children:Object.values(t).reduce(((e,t)=>e+t.length),0)}),(0,Ti.jsx)("span",{className:"stat-label",children:"Total Anime"})]}),(0,Ti.jsxs)("div",{className:"stat-item",children:[(0,Ti.jsx)("span",{className:"stat-number",children:Object.values(n).reduce(((e,t)=>e+t.length),0)}),(0,Ti.jsx)("span",{className:"stat-label",children:"Total Manga"})]}),(0,Ti.jsxs)("div",{className:"stat-item",children:[(0,Ti.jsx)("span",{className:"stat-number",children:r.length}),(0,Ti.jsx)("span",{className:"stat-label",children:"Favorite Characters"})]})]})]})},Qd=e=>{let{heroImage:t,isEditingHero:n,setIsEditingHero:r,heroFile:a,setHeroFile:s,uploading:i,handleHeroImageChange:o,handleHeroUpload:l,fileInputRef:c,triggerFileInput:u}=e;return(0,Ti.jsx)("div",{className:"cover-banner",style:{backgroundImage:`url(${t})`,backgroundSize:"cover",backgroundPosition:"center"},children:(0,Ti.jsx)("input",{type:"file",onChange:o,accept:"image/*",ref:c,style:{display:"none"}})})},Wd=e=>{let{activeCollectionType:t,setActiveCollectionType:n,animeTotalCount:r,mangaTotalCount:a,charactersTotalCount:s}=e;const i=(0,_a.useRef)(null),o=(0,_a.useRef)(null);return(0,_a.useEffect)((()=>{if(o.current&&i.current&&window.innerWidth<=768){const e=i.current,t=o.current,n=t.offsetLeft-e.clientWidth/2+t.clientWidth/2;e.scrollTo({left:Math.max(0,n),behavior:"smooth"})}}),[t]),(0,Ti.jsxs)("div",{ref:i,className:"collection-tabs",children:[(0,Ti.jsxs)("button",{ref:"anime"===t?o:null,onClick:()=>n("anime"),className:"collection-tab "+("anime"===t?"active":""),children:[(0,Ti.jsx)("span",{children:"Anime"}),(0,Ti.jsx)("span",{className:"collection-count",children:r})]}),(0,Ti.jsxs)("button",{ref:"manga"===t?o:null,onClick:()=>n("manga"),className:"collection-tab "+("manga"===t?"active":""),children:[(0,Ti.jsx)("span",{children:"Manga"}),(0,Ti.jsx)("span",{className:"collection-count",children:a})]}),(0,Ti.jsxs)("button",{ref:"characters"===t?o:null,onClick:()=>n("characters"),className:"collection-tab "+("characters"===t?"active":""),children:[(0,Ti.jsx)("span",{children:"Characters"}),(0,Ti.jsx)("span",{className:"collection-count",children:s})]})]})},Vd=e=>{let{statuses:t,activeTab:n,setActiveTab:r,collection:a}=e;return(0,Ti.jsx)("div",{className:"status-tabs",children:t.map((e=>(0,Ti.jsx)("button",{onClick:()=>
4r(e.key),className:"status-tab "+(n===e.key?"active":""),children:(0,Ti.jsxs)("span",{children:[e.label," "]})},e.key)))})},Kd=e=>{var t,n,r,a,s,i,o,l,c,u,d,h,p,m,f,g;let{item:v,mediaType:y,status:b,style:x}=e;const[w,j]=(0,_a.useState)(!1),N=(0,_a.useRef)(null),S="anime"===y?"animeId":"mangaId",k=(null===(t=v[S])||void 0===t||null===(n=t.images)||void 0===n||null===(r=n.webp)||void 0===r?void 0:r.image_url)||(null===(a=v[S])||void 0===a||null===(s=a.images)||void 0===s||null===(i=s.webp)||void 0===i?void 0:i.imageUrl)||(null===(o=v[S])||void 0===o||null===(l=o.images)||void 0===l||null===(c=l.jpg)||void 0===c?void 0:c.image_url)||(null===(u=v[S])||void 0===u||null===(d=u.images)||void 0===d||null===(h=d.jpg)||void 0===h?void 0:h.imageUrl)||"/placeholder.jpg",E=(null===(p=v[S])||void 0===p?void 0:p.title_english)||(null===(m=v[S])||void 0===m?void 0:m.title)||"Unknown "+("anime"===y?"Anime":"Manga"),_=(null===(f=v[S])||void 0===f?void 0:f.type)||y,C=v.notes&&""!==v.notes.trim(),A=null===(g=v[S])||void 0===g?void 0:g.id,T=A?`/${y}/${A}`:"#";(0,_a.useEffect)((()=>{function e(e){N.current&&!N.current.contains(e.target)&&j(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);return(0,Ti.jsxs)(ki.N_,{to:T,className:"favorite-item",style:x,children:[(0,Ti.jsx)("div",{className:"favorite-thumb",children:(0,Ti.jsx)("img",{src:k,alt:E})}),(0,Ti.jsxs)("div",{className:"favorite-details",children:[(0,Ti.jsx)("h4",{className:"favorite-title",children:E}),(0,Ti.jsxs)("div",{className:"favorite-meta",children:[(0,Ti.jsx)("span",{className:"favorite-type",children:_}),(0,Ti.jsx)("div",{className:"favorite-score",children:(()=>{return"completed"===b?(0,Ti.jsxs)("span",{className:"completed-info",children:[(0,Ti.jsx)("span",{className:"rating-display",children:v.rating?`\u2605 ${v.rating}/10`:"Not rated"}),C&&(0,Ti.jsx)("button",{className:"note-toggle-btn",onClick:e=>{e.stopPropagation(),e.preventDefault(),j(!0)},children:"See note"})]}):"anime"===y?`Episode ${v.currentEpisode}/${(null===(e=v[S])||void 0===e?void 0:e.episodes)||"?"}`:`Ch ${v.currentChapter}${null!==(t=v[S])&&void 0!==t&&t.chapters?"/"+v[S].chapters:""}`;var e,t})()})]})]}),w&&C&&(0,Ti.jsx)("div",{className:"note-popup-overlay",onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,Ti.jsxs)("div",{className:"note-popup",ref:N,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:[(0,Ti.jsxs)("div",{className:"note-popup-header",children:[(0,Ti.jsxs)("h4",{children:[E," - Note"]}),(0,Ti.jsx)("button",{className:"close-popup-btn",onClick:e=>{e.preventDefault(),e.stopPropagation(),j(!1)},children:"\xd7"})]}),(0,Ti.jsx)("div",{className:"note-popup-content",children:v.notes})]})})]},S)},Gd=e=>{let{items:t=[],isLoading:n,mediaType:r,activeStatus:a,statusLabel:s,maxHeight:i="700px"}=e;const o="anime"===r?"/my-anime-list":"/my-manga-list";return(0,Ti.jsxs)("div",{className:"favorites-card",children:[(0,Ti.jsxs)("div",{className:"favorites-header",children:[(0,Ti.jsxs)("h3",{children:[s||("anime"===r?"Anime":"Manga"),!n&&(0,Ti.jsx)("span",{className:"item-count",children:` (${t.length})`})]}),(0,Ti.jsx)(ki.N_,{to:o,className:"see-all-link",children:"See All"})]}),(0,Ti.jsx)("div",{className:"favorites-list-container",children:n?(0,Ti.jsxs)("div",{className:"favorites-loading",children:["Loading your ",r," list..."]}):0===t.length?(0,Ti.jsxs)("div",{className:"favorites-loading",children:["No ",r," in your ",(null===s||void 0===s?void 0:s.toLowerCase())||r," list"]}):(0,Ti.jsx)("div",{className:"favorites-list scrollable",style:{maxHeight:i},children:t.map(((e,t)=>(0,Ti.jsx)(Kd,{item:e,mediaType:r,status:a,style:{animationDelay:.05*t+"s"}},e._id)))})})]})},Yd=e=>{var t;let{collection:n,activeTab:r,setActiveTab:a,isLoading:s,statuses:i}=e;const o=(null===(t=i.find((e=>e.key===r)))||void 0===t?void 0:t.label)||"Anime";return(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)(Vd,{statuses:i,activeTab:r,setActiveTab:a,collection:n}),(0,Ti.jsx)(Gd,{items:n[r]||[],isLoading:s,mediaType:"anime",activeStatus:r,statusLabel:o})]})},Jd=e=>{var t;let{collection:n,activeTab:r,setActiveTab:a,isLoading:s,statuses:i}=e;const o=(null===(t=i.find((e=>e.key===r)))||void 0===t?void 0:t.label)||"Manga";return(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)(Vd,{statuses:i,activeTab:r,setActiveTab:a,collection:n}),(0,Ti.jsx)(Gd,{items:n[r]||[],isLoading:s,mediaType:"manga",activeStatus:r,statusLabel:o})]})},Xd=e=>{var t,n,r,a,s,i,o,l,c,u,d,h,p,m,f,g;let{character:v}=e;const y=(null===(t=v.characterId)||void 0===t||null===(n=t.images)||void 0===n||null===(r=n.webp)||void 0===r?void 0:r.image_url)||(null===(a=v.characterId)||void 0===a||null===(s=a.images)||void 0===s||null===(i=s.webp)||void 0===i?void 0:i.imageUrl)||(null===(o=v.characterId)||void 0===o||null===(l=o.images)||void 0===l||null===(c=l.jpg)||void 0===c?void 0:c.image_url)||(null===(u=v.characterId)||void 0===u||null===(d=u.images)||void 0===d||null===(h=d.jpg)||void 0===h?void 0:h.imageUrl)||"/placeholder.jpg",b=(null===(p=v.characterId)||void 0===p?void 0:p.name)||"Unknown Character",x=(null===(m=v.characterId)||void 0===m||null===(f=m.from)||void 0===f?void 0:f.media)||"",w=!!v.notes,j=null===(g=v.characterId)||void 0===g?void 0:g.id;return(0,Ti.jsx)(ki.N_,{to:`/characters/${j}`,className:"favorite-item-link",children:(0,Ti.jsxs)("div",{className:"favorite-item",children:[(0,Ti.jsx)("div",{className:"favorite-thumb",children:(0,Ti.jsx)("img",{src:y,alt:b})}),(0,Ti.jsxs)("div",{className:"favorite-details",children:[(0,Ti.jsx)("h4",{className:"favorite-title",children:b}),(0,Ti.jsxs)("div",{className:"favorite-meta",children:[x&&(0,Ti.jsx)("span",{className:"favorite-type",children:x}),w&&(0,Ti.jsx)("span",{className:"favorite-note",title:v.notes,children:"Has Notes"})]})]})]})})},Zd=e=>{let{characters:t=[],isLoading:n}=e;return(0,Ti.jsxs)("div",{className:"favorites-card",children:[(0,Ti.jsxs)("div",{className:"favorites-header",children:[(0,Ti.jsx)("h3",{children:"Favorite Characters"}),(0,Ti.jsx)(ki.N_,{to:"/characters",className:"see-all-link",children:"See All"})]}),(0,Ti.jsx)("div",{className:"favorites-list",children:n?(0,Ti.jsx)("div",{className:"favorites-loading",children:"Loading your favorite characters..."}):0===t.length?(0,Ti.jsx)("div",{className:"favorites-loading",children:"You haven't added any favorite characters yet"}):t.map((e=>(0,Ti.jsx)(Xd,{character:e},e._id)))})]})},eh=e=>{let{onImportComplete:t}=e;const[n,r]=(0,_a.useState)(null),[a,s]=(0,_a.useState)(!1),[i,o]=(0,_a.useState)(0),[l,c]=(0,_a.useState)(null),[u,d]=(0,_a.useState)(null),h=(0,_a.useRef)(null),p="https://animedb-production.up.railway.app",m=e=>new Promise(((t,n)=>{const r=new FileReader;r.onload=e=>t(e.target.result),r.onerror=e=>n(e),r.readAsText(e)})),f=async e=>{try{return(await fetch(`${p}/api/animes/mal/${e}`)).ok}catch(t){return console.error(`Error checking if anime exists: ${t.message}`),!1}},g=async e=>{try{const t=localStorage.getItem("token");if(!t)throw new Error("Authentication required");const n=await fetch(`${p}/api/import/mal/anime`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({mal_id:e.mal_id,status:e.status_text,score:e.score,watched_episodes:e.watched_episodes,notes:e.notes})});if(!n.ok){const e=await n.json();throw new Error(e.error||"Failed to add anime to list")}return!0}catch(t){throw console.error(`Error adding anime to list: ${t.message}`),t}};return(0,Ti.jsxs)("div",{className:"mal-importer",children:[(0,Ti.jsxs)("div",{className:"mb-4",children:[(0,Ti.jsx)("p",{className:"import-description",style:{marginBottom:"15px",color:"rgba(255, 255, 255, 0.8)"},children:"Export your anime list from MyAnimeList and upload the XML file here. We'll import your anime list with your scores, progress, and status."}),(0,Ti.jsxs)("div",{className:"import-file-select",children:[(0,Ti.jsx)("input",{type:"file",ref:h,onChange:e=>{const t=e.target.files[0];t&&(r(t),d(null),c(null))},accept:".xml",className:"hidden",style:{display:"none"},disabled:a}),(0,Ti.jsx)("button",{onClick:()=>h.current.click(),className:"edit-profile-btn",disabled:a,style:{marginRight:"10px"},children:"Select File"}),(0,Ti.jsx)("span",{style:{color:"rgba(255, 255, 255, 0.6)",fontSize:"0.9rem"},children:n?n.name:"No file selected"})]})]}),u&&(0,Ti.jsx)("div",{style:{marginBottom:"15px",padding:"10px",background:"rgba(229, 62, 62, 0.2)",color:"#FFA5A5",borderRadius:"8px",border:"1px solid rgba(229, 62, 62, 0.3)"},children:u}),(0,Ti.jsx)("button",{onClick:async()=>
4{if(n){s(!0),o(0),d(null);try{const r=await m(n),a=await(async e=>new Promise(((t,n)=>{try{const r=(new DOMParser).parseFromString(e,"text/xml");if(r.querySelector("parsererror"))return n(new Error("XML parsing error"));const a=r.querySelectorAll("anime");if(!a||0===a.length)return n(new Error("No anime entries found in the XML file"));const s=[];a.forEach((e=>{const t=(e,t)=>{const n=e.querySelector(t);return n?n.textContent:null},n={mal_id:parseInt(t(e,"series_animedb_id"),10)||null,title:t(e,"series_title"),status:t(e,"my_status"),score:parseInt(t(e,"my_score"),10)||0,watched_episodes:parseInt(t(e,"my_watched_episodes"),10)||0,total_episodes:parseInt(t(e,"series_episodes"),10)||0,start_date:t(e,"my_start_date"),end_date:t(e,"my_finish_date"),type:t(e,"series_type"),tags:t(e,"my_tags"),notes:t(e,"my_comments"),rewatch_count:parseInt(t(e,"my_times_watched"),10)||0};switch(console.log(`Parsed anime: ${n.title} - Status: "${n.status}"`),n.status_numeric){case 1:n.status_text="Currently Watching";break;case 2:n.status_text="Completed";break;case 3:n.status_text="On Hold";break;case 4:n.status_text="Dropped";break;case 6:n.status_text="Plan to Watch";break;default:n.status_text="Unknown"}s.push(n)})),t(s)}catch(r){n(r)}})))(r);if(o(25),a.length>10){const e=localStorage.getItem("token");if(!e)throw new Error("Authentication required");o(40);const n=await fetch(`${p}/api/import/mal/bulk`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({entries:a})});if(!n.ok){const e=await n.json();throw new Error(e.error||"Bulk import failed")}const r=await n.json();o(90),c(r.results),t&&t(r.results)}else{const n={total:a.length,processed:0,succeeded:0,failed:0,skipped:0,details:[]};for(let t=0;t<a.length;t++){const r=a[t];o(25+Math.floor(t/a.length*60));try{if(!await f(r.mal_id)){n.skipped++,n.details.push({title:r.title,status:"skipped",reason:"Anime not found in database"});continue}await g(r),n.succeeded++,n.details.push({title:r.title,status:"success"})}catch(e){n.failed++,n.details.push({title:r.title,status:"failed",reason:e.message})}n.processed++}o(90),c(n),t&&t(n)}}catch(e){d(`Import failed: ${e.message}`)}finally{s(!1),o(100)}}else d("Please select a file first")},disabled:!n||a,className:"edit-profile-btn",style:{width:"100%",marginBottom:"15px",opacity:!n||a?.7:1},children:a?"Importing...":"Import List"}),a&&(0,Ti.jsxs)("div",{style:{marginBottom:"15px"},children:[(0,Ti.jsx)("div",{style:{width:"100%",height:"6px",background:"rgba(255, 255, 255, 0.1)",borderRadius:"3px",overflow:"hidden"},children:(0,Ti.jsx)("div",{style:{height:"100%",width:`${i}%`,background:"var(--accent)",borderRadius:"3px",transition:"width 0.3s ease"}})}),(0,Ti.jsxs)("p",{style:{textAlign:"center",fontSize:"0.9rem",color:"rgba(255, 255, 255, 0.6)",marginTop:"5px"},children:["Processing... ",i,"%"]})]}),l&&(0,Ti.jsxs)("div",{className:"results-summary",children:[(0,Ti.jsx)("h3",{style:{fontWeight:"bold",fontSize:"1.1rem",marginBottom:"10px"},children:"Import Results"}),(0,Ti.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"8px",textAlign:"center",marginBottom:"15px"},children:[(0,Ti.jsxs)("div",{style:{padding:"10px",background:"rgba(255, 255, 255, 0.05)",borderRadius:"8px"},children:[(0,Ti.jsx)("p",{style:{fontSize:"1.2rem",fontWeight:"bold"},children:l.total}),(0,Ti.jsx)("p",{style:{fontSize:"0.8rem",color:"rgba(255, 255, 255, 0.6)"},children:"Total"})]}),(0,Ti.jsxs)("div",{style:{padding:"10px",background:"rgba(72, 187, 120, 0.1)",borderRadius:"8px"},children:[(0,Ti.jsx)("p",{style:{fontSize:"1.2rem",fontWeight:"bold",color:"#68D391"},children:l.succeeded}),(0,Ti.jsx)("p",{style:{fontSize:"0.8rem",color:"rgba(255, 255, 255, 0.6)"},children:"Imported"})]}),(0,Ti.jsxs)("div",{style:{padding:"10px",background:"rgba(236, 201, 75, 0.1)",borderRadius:"8px"},children:[(0,Ti.jsx)("p",{style:{fontSize:"1.2rem",fontWeight:"bold",color:"#F6E05E"},children:l.skipped}),(0,Ti.jsx)("p",{style:{fontSize:"0.8rem",color:"rgba(255, 255, 255, 0.6)"},children:"Skipped"})]}),(0,Ti.jsxs)("div",{style:{padding:"10px",background:"rgba(229, 62, 62, 0.1)",borderRadius:"8px"},children:[(0,Ti.jsx)("p",{style:{fontSize:"1.2rem",fontWeight:"bold",color:"#FC8181"},children:l.failed}),(0,Ti.jsx)("p",{style:{fontSize:"0.8rem",color:"rgba(255, 255, 255, 0.6)"},children:"Failed"})]})]}),l.failed>
40&&(0,Ti.jsxs)("div",{style:{marginTop:"15px"},children:[(0,Ti.jsx)("h4",{style:{fontWeight:"bold",marginBottom:"8px"},children:"Issues"}),(0,Ti.jsx)("div",{style:{maxHeight:"150px",overflowY:"auto",padding:"5px",background:"rgba(0, 0, 0, 0.2)",borderRadius:"8px"},children:(0,Ti.jsx)("ul",{style:{fontSize:"0.9rem"},children:l.details.filter((e=>"failed"===e.status)).map(((e,t)=>(0,Ti.jsxs)("li",{style:{marginBottom:"5px",paddingBottom:"5px",borderBottom:"1px solid rgba(255, 255, 255, 0.1)"},children:[(0,Ti.jsx)("span",{style:{color:"#FC8181"},children:"\u2022"})," ",e.title,": ",e.reason]},t)))})})]})]}),(0,Ti.jsxs)("div",{style:{marginTop:"20px",fontSize:"0.8rem",color:"rgba(255, 255, 255, 0.5)",background:"rgba(255, 255, 255, 0.05)",padding:"10px",borderRadius:"8px"},children:[(0,Ti.jsx)("p",{children:"Having trouble? Make sure you:"}),(0,Ti.jsxs)("ul",{style:{listStyleType:"disc",marginLeft:"20px",marginTop:"5px"},children:[(0,Ti.jsx)("li",{children:'Export from MAL using "Export as XML" option'}),(0,Ti.jsx)("li",{children:'Select "All Anime" when exporting'}),(0,Ti.jsx)("li",{children:"Don't modify the XML file after downloading"})]})]})]})},th=e=>{let{onClose:t,onImportComplete:n}=e;return(0,Ti.jsx)("div",{className:"note-popup-overlay",onClick:t,children:(0,Ti.jsxs)("div",{className:"note-popup",onClick:e=>{e.stopPropagation()},style:{maxWidth:"600px"},children:[(0,Ti.jsxs)("div",{className:"note-popup-header",children:[(0,Ti.jsx)("h4",{children:"Import from MyAnimeList"}),(0,Ti.jsx)("button",{className:"close-popup-btn",onClick:t,children:"\xd7"})]}),(0,Ti.jsx)("div",{className:"note-popup-content",children:(0,Ti.jsx)(eh,{onImportComplete:n})})]})})},nh=()=>{const[e,t]=(0,_a.useState)(!1);return(0,Ti.jsxs)("div",{className:"profile-actions-container",children:[(0,Ti.jsx)("h3",{className:"profile-actions-title",children:"Quick Actions"}),(0,Ti.jsxs)("div",{className:"profile-actions",children:[(0,Ti.jsxs)(ki.N_,{to:"/anime",className:"action-button discover-button",children:[(0,Ti.jsx)("span",{className:"action-icon","aria-hidden":"true"}),"Discover Anime"]}),(0,Ti.jsxs)(ki.N_,{to:"/manga",className:"action-button discover-button",children:[(0,Ti.jsx)("span",{className:"action-icon","aria-hidden":"true"}),"Discover Manga"]}),(0,Ti.jsxs)("button",{className:"action-button import-button",onClick:()=>t(!0),children:[(0,Ti.jsx)("span",{className:"action-icon","aria-hidden":"true"}),"Import MAL"]}),(0,Ti.jsxs)(ki.N_,{to:"/characters",className:"action-button character-button",children:[(0,Ti.jsx)("span",{className:"action-icon","aria-hidden":"true"}),"Characters"]}),(0,Ti.jsxs)(ki.N_,{to:"/settings",className:"action-button settings-button",children:[(0,Ti.jsx)("span",{className:"action-icon","aria-hidden":"true"}),"Settings"]})]}),e&&(0,Ti.jsx)(th,{onClose:()=>t(!1),onImportComplete:e=>{console.log("Import completed:",e),t(!1)}})]})},rh=e=>{let{children:t,isOpen:n,toggleSidebar:r}=e;return(0,_a.useEffect)((()=>(n&&window.innerWidth<=768?document.body.style.overflow="hidden":document.body.style.overflow="auto",()=>{document.body.style.overflow="auto"})),[n]),(0,_a.useEffect)((()=>{console.log("Sidebar isOpen state changed to:",n)}),[n]),(0,_a.useEffect)((()=>{const e=e=>{if(n&&window.innerWidth<=768){const t=document.querySelector(".profile-sidebar"),n=document.querySelectorAll(".sidebar-toggle"),a=Array.from(n).some((t=>t.contains(e.target)));!t||t.contains(e.target)||a||(console.log("Click outside sidebar detected"),r())}};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[n,r]),(0,_a.useEffect)((()=>{const e=e=>{"Escape"===e.key&&n&&r()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[n,r]),(0,Ti.jsxs)("div",{className:"profile-sidebar "+(n?"open":""),children:[(0,Ti.jsx)("div",{className:"sidebar-toggle-container",children:(0,Ti.jsx)("button",{className:"sidebar-toggle",onClick:e=>{e.stopPropagation(),r()},"aria-label":"Close sidebar",children:"\xd7"})}),t]})},ah="https://animedb-production.up.railway.app",sh=()=>{const{isLoggedIn:e,user:t}=ec(),[n,r]=(0,_a.useState)("friends"),{data:a=[],isLoading:s,refetch:i}=td({queryKey:["friends"],queryFn:async()=>(await Gl.get(`${ah}/api/friends`,{headers:{Authorization:`Bearer ${localStorage.getItem("token")}`}})).data.data||[],enabled:e}),{data:o=[],isLoading:l,refetch:c}
4=td({queryKey:["friendRequests","pending"],queryFn:async()=>(await Gl.get(`${ah}/api/friends/pending`,{headers:{Authorization:`Bearer ${localStorage.getItem("token")}`}})).data.data||[],enabled:e&&"pending"===n}),{data:u=[],isLoading:d,refetch:h}=td({queryKey:["friendRequests","sent"],queryFn:async()=>(await Gl.get(`${ah}/api/friends/sent`,{headers:{Authorization:`Bearer ${localStorage.getItem("token")}`}})).data.data||[],enabled:e&&"sent"===n});return(0,Ti.jsxs)("div",{className:"friends-container",children:[(0,Ti.jsxs)("div",{className:"friends-header",children:[(0,Ti.jsx)("h2",{children:"Friends"}),(0,Ti.jsxs)("div",{className:"friends-tabs",children:[(0,Ti.jsxs)("button",{className:"friends-tab "+("friends"===n?"active":""),onClick:()=>r("friends"),children:[(0,Ti.jsx)("span",{children:"Friends"}),(0,Ti.jsx)("span",{className:"friends-count",children:a.length})]}),(0,Ti.jsxs)("button",{className:"friends-tab "+("pending"===n?"active":""),onClick:()=>r("pending"),children:[(0,Ti.jsx)("span",{children:"Requests"}),(0,Ti.jsx)("span",{className:"friends-count",children:o.length})]}),(0,Ti.jsxs)("button",{className:"friends-tab "+("sent"===n?"active":""),onClick:()=>r("sent"),children:[(0,Ti.jsx)("span",{children:"Sent"}),(0,Ti.jsx)("span",{className:"friends-count",children:u.length})]})]})]}),"friends"===n?s?(0,Ti.jsx)("div",{className:"friends-loading",children:"Loading your friends..."}):0===a.length?(0,Ti.jsxs)("div",{className:"friends-empty",children:[(0,Ti.jsx)("div",{className:"empty-icon",children:"\ud83d\udc65"}),(0,Ti.jsx)("h3",{children:"No Friends Yet"}),(0,Ti.jsx)("p",{children:"Add friends to see their anime and manga collections!"})]}):(0,Ti.jsx)("div",{className:"friends-list",children:a.map((e=>(0,Ti.jsx)("div",{className:"friend-item",children:(0,Ti.jsxs)(ki.N_,{to:`/users/${e.user.id}`,className:"friend-details",children:[(0,Ti.jsx)("div",{className:"friend-avatar",children:(0,Ti.jsx)("img",{src:e.user.profile_picture,alt:e.user.username})}),(0,Ti.jsxs)("div",{className:"friend-info",children:[(0,Ti.jsx)("h3",{className:"friend-name",title:e.user.username,children:e.user.username}),(0,Ti.jsxs)("span",{className:"friend-since",title:`Friends since ${new Date(e.since).toLocaleDateString()}`,children:["Friends since ",new Date(e.since).toLocaleDateString()]})]})]})},e.friendshipId)))}):"pending"===n?l?(0,Ti.jsx)("div",{className:"friends-loading",children:"Loading friend requests..."}):0===o.length?(0,Ti.jsxs)("div",{className:"friends-empty",children:[(0,Ti.jsx)("div",{className:"empty-icon",children:"\ud83d\udced"}),(0,Ti.jsx)("h3",{children:"No Pending Requests"}),(0,Ti.jsx)("p",{children:"You don't have any friend requests to respond to."})]}):(0,Ti.jsx)("div",{className:"friends-list",children:o.map((e=>(0,Ti.jsxs)("div",{className:"friend-item",children:[(0,Ti.jsxs)(ki.N_,{to:`/users/${e.requester._id}`,className:"friend-details",children:[(0,Ti.jsx)("div",{className:"friend-avatar",children:(0,Ti.jsx)("img",{src:e.requester.profilePicture,alt:e.requester.username})}),(0,Ti.jsxs)("div",{className:"friend-info",children:[(0,Ti.jsx)("h3",{className:"friend-name",children:e.requester.username}),(0,Ti.jsxs)("span",{className:"friend-since",children:["Sent ",new Date(e.createdAt).toLocaleDateString()]})]})]}),(0,Ti.jsxs)("div",{className:"friend-actions",children:[(0,Ti.jsx)("button",{className:"friend-action accept-request",onClick:()=>(async e=>{try{await Gl.patch(`${ah}/api/friends/${e}`,{status:"accepted"},{headers:{Authorization:`Bearer ${localStorage.getItem("token")}`}}),c(),i()}catch(t){console.error("Error accepting friend request:",t)}})(e._id),children:"Accept"}),(0,Ti.jsx)("button",{className:"friend-action reject-request",onClick:()=>(async e=>{try{await Gl.patch(`${ah}/api/friends/${e}`,{status:"rejected"},{headers:{Authorization:`Bearer ${localStorage.getItem("token")}`}}),c()}catch(t){console.error("Error rejecting friend request:",t)}})(e._id),children:"Reject"})]})]},e._id)))}):"sent"===n?d?(0,Ti.jsx)("div",{className:"friends-loading",children:"Loading sent requests..."}):0===u.length?(0,Ti.jsxs)("div",{className:"friends-empty",children:[(0,Ti.jsx)("div",{className:"empty-icon",children:"\u2709\ufe0f"}),(0,Ti.jsx)("h3",{children:"No Sent Requests"}),(0,Ti.jsx)("p",{children:"You haven't sent any friend requests that are pending."})]}):(0,Ti.jsx)("div",{className:"friends-list",children:u.map((e=>(0,Ti.jsxs)("div",{className:"friend-item",children:[(0,Ti.jsxs)(ki.N_,{to:`/users/${e.recipient._id}`,className:"friend-details",children:[(0,Ti.jsx)("div",{className:"friend-avatar",children:(0,Ti.jsx)("img",{src:e.recipient.profilePicture,alt:e.recipient.username})}),(0,Ti.jsxs)("div",{className:"friend-info",children:[(0,Ti.jsx)("h3",{className:"friend-name",children:e.recipient.username}),(0,Ti.jsxs)("span",{className:"friend-since",children:["Sent ",new Date(e.createdAt).toLocaleDateString()]})]})]}),(0,Ti.jsx)("button",{className:"friend-action cancel-request",onClick:()=>(async e=>{try{await Gl.delete(`${ah}/api/friends/${e}`,{headers:{Authorization:`Bearer ${localStorage.getItem("token")}`}}),h()}catch(t){console.error("Error canceling friend request:",t)}})(e._id),children:"Cancel"})]},e._id)))}):void 0]})},ih=()=>{const{user:e,loading:t,updateUser:n}=ec(),r=(0,ki.Zp)(),a=(0,_a.useRef)(window.innerWidth<=768),[s,i]=(0,_a.useState)(a.current),[o,l]=(0,_a.useState)(window.innerWidth>768),c=(0,_a.useRef)(0),[u,d]=(0,_a.useState)(""),[h,p]=(0,_a.useState)("anime"),[m,f]=(0,_a.useState)("watching"),[g,v]=(0,_a.useState)("reading"),y=(0,_a.useRef)(null),b=(0,_a.useRef)(null),x=(0,_a.useMemo)((()=>[{key:"watching",label:"Watching"},{key:"completed",label:"Completed"},{key:"planning",label:"Planning"},{key:"onHold",label:"On Hold"},{key:"dropped",label:"Dropped"}]),[]),w=(0,_a.useMemo)((()=>[{key:"reading",label:"Reading"},{key:"completed",label:"Completed"},{key:"planning",label:"Planning"},{key:"onHold",label:"On Hold"},{key:"dropped",label:"Dropped"}]),[]),j=!0,{data:N={anime:{},manga:{},characters:[]},isLoading:S,isError:k}=td({queryKey:["profileAllData"],queryFn:zd,enabled:!!e&&j,staleTime:3e5}),{data:E=[],isLoading:_}
4=td({queryKey:["animeData","watching"],queryFn:()=>Md("watching"),enabled:!!e&&!1,staleTime:3e5}),{data:C=[],isLoading:A}=td({queryKey:["animeData","completed"],queryFn:()=>Md("completed"),enabled:!!e&&!1,staleTime:3e5}),{data:T=[],isLoading:R}=td({queryKey:["animeData","planning"],queryFn:()=>Md("planning"),enabled:!!e&&!1,staleTime:3e5}),{data:P=[],isLoading:O}=td({queryKey:["animeData","onHold"],queryFn:()=>Md("onHold"),enabled:!!e&&!1,staleTime:3e5}),{data:I=[],isLoading:$}=td({queryKey:["animeData","dropped"],queryFn:()=>Md("dropped"),enabled:!!e&&!1,staleTime:3e5}),{data:L=[],isLoading:F}=td({queryKey:["mangaData","reading"],queryFn:()=>Dd("reading"),enabled:!!e&&!1,staleTime:3e5}),{data:M=[],isLoading:D}=td({queryKey:["mangaData","completed"],queryFn:()=>Dd("completed"),enabled:!!e&&!1,staleTime:3e5}),{data:U=[],isLoading:z}=td({queryKey:["mangaData","planning"],queryFn:()=>Dd("planning"),enabled:!!e&&!1,staleTime:3e5}),{data:q=[],isLoading:B}=td({queryKey:["mangaData","onHold"],queryFn:()=>Dd("onHold"),enabled:!!e&&!1,staleTime:3e5}),{data:H=[],isLoading:Q}=td({queryKey:["mangaData","dropped"],queryFn:()=>Dd("dropped"),enabled:!!e&&!1,staleTime:3e5}),{data:W=[],isLoading:V}=td({queryKey:["favoriteCharacters"],queryFn:Ud,enabled:!!e&&!1,staleTime:3e5}),K=(0,_a.useMemo)((()=>{var e,t,n,r,a;return{watching:(null===N||void 0===N||null===(e=N.anime)||void 0===e?void 0:e.watching)||[],completed:(null===N||void 0===N||null===(t=N.anime)||void 0===t?void 0:t.completed)||[],planning:(null===N||void 0===N||null===(n=N.anime)||void 0===n?void 0:n.planning)||[],onHold:(null===N||void 0===N||null===(r=N.anime)||void 0===r?void 0:r.onHold)||[],dropped:(null===N||void 0===N||null===(a=N.anime)||void 0===a?void 0:a.dropped)||[]}}),[j,null===N||void 0===N?void 0:N.anime,E,C,T,P,I]),G=(0,_a.useMemo)((()=>{var e,t,n,r,a;return{reading:(null===N||void 0===N||null===(e=N.manga)||void 0===e?void 0:e.reading)||[],completed:(null===N||void 0===N||null===(t=N.manga)||void 0===t?void 0:t.completed)||[],planning:(null===N||void 0===N||null===(n=N.manga)||void 0===n?void 0:n.planning)||[],onHold:(null===N||void 0===N||null===(r=N.manga)||void 0===r?void 0:r.onHold)||[],dropped:(null===N||void 0===N||null===(a=N.manga)||void 0===a?void 0:a.dropped)||[]}}),[j,null===N||void 0===N?void 0:N.manga,L,M,U,q,H]),Y=(0,_a.useMemo)((()=>(null===N||void 0===N?void 0:N.characters)||[]),[j,null===N||void 0===N?void 0:N.characters,W]),J=S,X=(0,_a.useCallback)((e=>{}),[]),Z=(0,_a.useCallback)((e=>{}),[]);(0,_a.useEffect)((()=>{t||e||r("/login")}),[e,t,r]),(0,_a.useEffect)((()=>{let e,t;const n=()=>{clearTimeout(e),e=setTimeout((()=>{const e=window.innerWidth<=768;a.current=e,i(e),e||l(!0)}),150)},r=()=>{c.current=window.scrollY,clearTimeout(t),t=setTimeout((()=>{const e=c.current>100?"sticky-header":"";e!==u&&d(e)}),100)};return window.addEventListener("resize",n),window.addEventListener("scroll",r),()=>{window.removeEventListener("resize",n),window.removeEventListener("scroll",r),clearTimeout(e),clearTimeout(t)}}),[u]);const ee=(0,_a.useMemo)((()=>{var e,t,n,r,a,s,i,o,l,c;return{anime:((null===(e=K.watching)||void 0===e?void 0:e.length)||0)+((null===(t=K.completed)||void 0===t?void 0:t.length)||0)+((null===(n=K.planning)||void 0===n?void 0:n.length)||0)+((null===(r=K.onHold)||void 0===r?void 0:r.length)||0)+((null===(a=K.dropped)||void 0===a?void 0:a.length)||0),manga:((null===(s=G.reading)||void 0===s?void 0:s.length)||0)+((null===(i=G.completed)||void 0===i?void 0:i.length)||0)+((null===(o=G.planning)||void 0===o?void 0:o.length)||0)+((null===(l=G.onHold)||void 0===l?void 0:l.length)||0)+((null===(c=G.dropped)||void 0===c?void 0:c.length)||0),characters:Y.length}}),[K,G,Y]),te=(0,_a.useCallback)((()=>{l((e=>!e))}),[]);return t||!e?(0,Ti.jsx)("div",{className:"loading-spinner",children:"\ud83c\udf00"}):(0,Ti.jsxs)("div",{className:"profile-container",children:[J&&(0,Ti.jsxs)("div",{className:"loading-collection",style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.7)",zIndex:2e3},children:[(0,Ti.jsx)("div",{className:"loading-spinner"}),(0,Ti.jsx)("p",{children:"Loading your collections..."})]}),s&&(0,Ti.jsxs)("div",{className:`mobile-profile-header ${u}`,children:[(0,Ti.jsx)("button",{className:"sidebar-toggle",onClick:te,"aria-label":o?"Close sidebar":"Open sidebar",children:o?"\xd7":"\u2630"}),(0,Ti.jsx)("div",{className:"mobile-username",children:(0,Ti.jsx)("h1",{children:e.username})})]}),(0,Ti.jsxs)("div",{className:"profile-layout",children:[(0,Ti.jsxs)(rh,{isOpen:o,toggleSidebar:te,children:[(0,Ti.jsx)(qd,{user:e,profileFileInputRef:b,handleProfileImageChange:X}
4),(0,Ti.jsx)(Hd,{animeCollection:K,mangaCollection:G,favoriteCharacters:Y}),(0,Ti.jsx)(Bd,{user:e})]}),(0,Ti.jsxs)("div",{className:"profile-main-content "+(o&&s?"sidebar-open":""),children:[(0,Ti.jsx)(Qd,{heroImage:e.heroImage,fileInputRef:y,handleHeroImageChange:Z}),(0,Ti.jsxs)("div",{className:"favorites-section",children:[(0,Ti.jsx)("h2",{className:"favorites-title",children:"My Collections"}),(0,Ti.jsx)(Wd,{activeCollectionType:h,setActiveCollectionType:p,animeTotalCount:ee.anime,mangaTotalCount:ee.manga,charactersTotalCount:ee.characters}),"anime"===h&&(0,Ti.jsx)(Yd,{collection:K,activeTab:m,setActiveTab:f,isLoading:!1,statuses:x}),"manga"===h&&(0,Ti.jsx)(Jd,{collection:G,activeTab:g,setActiveTab:v,isLoading:!1,statuses:w}),"characters"===h&&(0,Ti.jsx)(Zd,{characters:Y,isLoading:!1})]}),(0,Ti.jsxs)("div",{className:"favorites-section",children:[(0,Ti.jsx)("h2",{className:"favorites-title",children:"My Friends"}),(0,Ti.jsx)(sh,{})]})]})]}),(0,Ti.jsx)(nh,{})]})},oh=_a.memo(ih);function lh(e,t){return e.filter((e=>!t.includes(e)))}var ch=class extends kc{#l;#q;#p;#B;#m;#H;#Q;#W;#V=[];constructor(e,t,n){super(),this.#l=e,this.#B=n,this.#p=[],this.#m=[],this.#q=[],this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.#m.forEach((e=>{e.subscribe((t=>{this.#K(e,t)}))}))}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#m.forEach((e=>{e.destroy()}))}setQueries(e,t,n){this.#p=e,this.#B=t,Sc.batch((()=>{const e=this.#m,t=this.#G(this.#p);this.#V=t,t.forEach((e=>e.observer.setOptions(e.defaultedQueryOptions,n)));const r=t.map((e=>e.observer)),a=r.map((e=>e.getCurrentResult())),s=r.some(((t,n)=>t!==e[n]));(e.length!==r.length||s)&&(this.#m=r,this.#q=a,this.hasListeners()&&(lh(e,r).forEach((e=>{e.destroy()})),lh(r,e).forEach((e=>{e.subscribe((t=>{this.#K(e,t)}))})),this.#z()))}))}getCurrentResult(){return this.#q}getQueries(){return this.#m.map((e=>e.getCurrentQuery()))}getObservers(){return this.#m}getOptimisticResult(e,t){const n=this.#G(e),r=n.map((e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)));return[r,e=>this.#Y(e??r,t),()=>this.#J(r,n)]}#J(e,t){return t.map(((n,r)=>{const a=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?a:n.observer.trackResult(a,(e=>{t.forEach((t=>{t.observer.trackProp(e)}))}))}))}#Y(e,t){return t?(this.#H&&this.#q===this.#W&&t===this.#Q||(this.#Q=t,this.#W=this.#q,this.#H=mc(this.#H,t(e))),this.#H):e}#G(e){const t=new Map(this.#m.map((e=>[e.options.queryHash,e]))),n=[];return e.forEach((e=>{const r=this.#l.defaultQueryOptions(e),a=t.get(r.queryHash);a?n.push({defaultedQueryOptions:r,observer:a}):n.push({defaultedQueryOptions:r,observer:new Lu(this.#l,r)})})),n}#K(e,t){const n=this.#m.indexOf(e);-1!==n&&(this.#q=function(e,t,n){const r=e.slice(0);return r[t]=n,r}(this.#q,n,t),this.#z())}#z(){if(this.hasListeners()){const e=this.#H,t=this.#J(this.#q,this.#V);e!==this.#Y(t,this.#B?.combine)&&Sc.batch((()=>{this.listeners.forEach((e=>{e(this.#q)}))}))}}};const uh=e=>{var t,n;let{anime:r}=e;const[a,s]=(0,_a.useState)(!1),[i,o]=(0,_a.useState)(r.currentEpisode||0),[l,c]=(0,_a.useState)(!1),[u,d]=(0,_a.useState)(null),h=(0,_a.useRef)(null),p=Qc(),m=r.animeId||r,f="object"===typeof m.id?m.id.toString():m.id,g=r.notes&&""!==r.notes.trim();(0,_a.useEffect)((()=>{function e(e){h.current&&!h.current.contains(e.target)&&s(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);const v=async e=>{if(!l&&!(e<0)&&!(m.episodes&&e>m.episodes)){c(!0),d(null);try{o(e);const t=localStorage.getItem("token");if(!t)throw d("No authentication token found"),new Error("No auth token found");const n=`${"https://animedb-production.up.railway.app"}/api/user/anime/${f}`,a={currentEpisode:e};m.episodes&&e===m.episodes&&(a.status="completed"),console.log(`Sending API request to ${n}`,a);const s=await Gl.patch(n,a,{headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});s.data.success?(console.log("Successfully updated episode count on server:",s.data),r.currentEpisode=e,"completed"===a.status&&(r.status="completed",p.invalidateQueries(["animeData","completed"])),p.invalidateQueries(["animeData"]),p.invalidateQueries(["animeData",r.status])):(d("API responded but update failed"),console.error("API update failed:",s.data),o(r.currentEpisode||0))}catch(t){console.error("Error updating episode count:",t),d(t.message||"Update failed"),o(r.currentEpisode||0)}finally{setTimeout((()=>{c(!1)}),300)}}};return(0,Ti.jsxs)("div",{className:"anime-list-item",children:[(0,Ti.jsxs)("div",{className:"anime-poster",children:[(0,Ti.jsx)("img",{src:(null===(t=m.images)||void 0===t||null===(n=t.webp)||void 0===n?void 0:n.large_image_url)||m.image||"/default-poster.jpg",alt:m.title,onError:e=>{e.target.src="/default-poster.jpg"}}),r.isFavorite&&(0,Ti.jsx)("div",{className:"favorite-badge",children:"\u2764\ufe0f"})]}),(0,Ti.jsxs)("div",{className:"anime-list-details",children:[(0,Ti.jsx)("h3",{className:"anime-title",children:m.title_english||m.t
4itle}),(0,Ti.jsxs)("div",{className:"anime-meta",children:[r.rating&&(0,Ti.jsxs)("span",{className:"anime-user-score",children:["Your Rating: \u2b50 ",r.rating,"/10"]}),m.score&&(0,Ti.jsxs)("span",{className:"anime-score",children:["Global Rating: \u2b50 ",m.score,"/10"]}),(0,Ti.jsxs)("span",{className:"anime-status",children:["Status: ",r.status]}),m.episodes&&(0,Ti.jsxs)("span",{className:"anime-episodes",children:[m.episodes," episodes"]}),g&&(0,Ti.jsx)("button",{className:"note-toggle-btn",onClick:e=>{e.preventDefault(),s(!0)},children:"See note"})]}),(0,Ti.jsxs)("div",{className:"anime-progress",children:[u&&(0,Ti.jsxs)("div",{className:"update-error",style:{color:"#ff5252",fontSize:"0.8rem",marginBottom:"0.5rem"},children:["Error: ",u]}),(0,Ti.jsxs)("div",{className:"episode-counter",children:[(0,Ti.jsx)("span",{children:"Progress: "}),(0,Ti.jsxs)("div",{className:"episode-controls",children:[(0,Ti.jsx)("button",{className:"episode-btn minus-btn",onClick:()=>v(i-1),disabled:l||i<=0,"aria-label":"Decrease episode count"}),(0,Ti.jsx)("span",{className:"episode-count "+(l?"updating":""),children:i}),(0,Ti.jsx)("button",{className:"episode-btn plus-btn",onClick:()=>v(i+1),disabled:l||m.episodes&&i>=m.episodes,"aria-label":"Increase episode count"}),(0,Ti.jsxs)("span",{className:"episode-total",children:["/ ",m.episodes||"?"]})]})]}),(0,Ti.jsx)("div",{className:"progress-bar",children:(0,Ti.jsx)("div",{className:"progress-fill",style:{width:`${m.episodes?Math.min(100,i/m.episodes*100):0}%`}})})]})]}),(0,Ti.jsx)("div",{className:"anime-actions",children:(0,Ti.jsx)("a",{href:`/anime/${f}`,className:"view-details",children:"View Details"})}),a&&g&&(0,Ti.jsx)("div",{className:"note-popup-overlay",onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,Ti.jsxs)("div",{className:"note-popup",ref:h,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:[(0,Ti.jsxs)("div",{className:"note-popup-header",children:[(0,Ti.jsxs)("h4",{children:[m.title_english||m.title," - Note"]}),(0,Ti.jsx)("button",{className:"close-popup-btn",onClick:e=>{e.preventDefault(),e.stopPropagation(),s(!1)},children:"\xd7"})]}),(0,Ti.jsx)("div",{className:"note-popup-content",children:r.notes})]})})]})},dh=()=>{const{user:e,loading:t}=ec(),n=(0,ki.Zp)(),[r,a]=(0,ki.ok)(),[s,i]=(Qc(),(0,_a.useState)(r.get("status")||"all")),[o,l]=(0,_a.useState)(r.get("sort")||"title"),[c,u]=(0,_a.useState)(r.get("order")||"asc"),d=[{key:"all",label:"All Anime"},{key:"watching",label:"Watching"},{key:"completed",label:"Completed"},{key:"planning",label:"Planning"},{key:"onHold",label:"On Hold"},{key:"dropped",label:"Dropped"}],h=d.filter((e=>"all"!==e.key)).map((e=>e.key)),p=function(e,t){let{queries:n,...r}=e;const a=Qc(t),s=Yu(),i=Bu(),o=_a.useMemo((()=>n.map((e=>{const t=a.defaultQueryOptions(e);return t._optimisticResults=s?"isRestoring":"optimistic",t}))),[n,a,s]);o.forEach((e=>{Ju(e),Wu(e,i)})),Vu(i);const[l]=_a.useState((()=>new ch(a,o,r))),[c,u,d]=l.getOptimisticResult(o,r.combine),h=!s&&!1!==r.subscribed;_a.useSyncExternalStore(_a.useCallback((e=>h?l.subscribe(Sc.batchCalls(e)):Qu),[l,h]),(()=>l.getCurrentResult()),(()=>l.getCurrentResult())),_a.useEffect((()=>{l.setQueries(o,r,{listeners:!1})}),[o,r,l]);const p=c.some(((e,t)=>Zu(o[t],e)))?c.flatMap(((e,t)=>{const n=o[t];if(n){const t=new Lu(a,n);if(Zu(n,e))return ed(n,t,i);Xu(e,s)&&ed(n,t,i)}return[]})):[];if(p.length>0)throw Promise.all(p);const m=c.find(((e,t)=>{const n=o[t];return n&&Ku({result:e,errorResetBoundary:i,throwOnError:n.throwOnError,query:a.getQueryCache().get(n.queryHash),suspense:n.suspense})}));if(m?.error)throw m.error;return u(d())}({queries:h.map((t=>({queryKey:["animeData",t],queryFn:()=>Md(t),enabled:!!e,staleTime:3e5})))}),m=p.some((e=>e.isLoading)),f=_a.useMemo((()=>{let e;if("all"===s)e=p.filter((e=>e.isSuccess)).flatMap((e=>e.data||[]));else{var t;const n=h.indexOf(s);e=n>=0&&null!==(t=p[n])&&void 0!==t&&t.isSuccess&&p[n].data||[]}return((e,t,n)=>[...e].sort(((e,r)=>{const a=(e,t)=>{if("title"===t){const t=e.animeId||e;return(t.title_english||t.title||"").toLowerCase()}return"score"===t?e.rating||0:"updatedAt"===t?new Date(e.updatedAt||0).getTime():e[t]||0},s=a(e,t),i=a(r,t);return"asc"===n?s>i?1:s<i?-1:0:s<i?1:s>i?-1:0})))(e,o,c)}),[s,p,h,o,c]);return(0,_a.useEffect)((()=>{t||e||n("/login")}),[e,t,n]),t||m?(0,Ti.jsxs)("div",{className:"anime-list-loading",children:[(0,Ti.jsx)("div",{className:"loading-spinner"}),(0,Ti.jsx)("p",{children:"Loading your anime collection..."})]}):(0,Ti.jsxs)("div",{className:"anime-list-page",children:[(0,Ti.jsxs)("div",{className:"anime-list-page-title-container",children:[(0,Ti.jsx)("h1",{className:"anime-list-page-title",children:"My Anime Collection"}),(0,Ti.jsx)("p",{className:"anime-list-page-subtitle",children:"Track, manage, and organize your anime watching journey"})]}),(0,Ti.jsxs)("div",{className:"anime-list-filters",children:[(0,Ti.jsx)("div",{className:"anime-list-tabs",children:d.map((e=>{var t,n;return(0,Ti.jsxs)("button",{className:"anime-list-tab "+(s===e.ke
4y?"active":""),onClick:()=>{return t=e.key,i(t),void a({status:t,sort:o,order:c});var t},children:[(0,Ti.jsx)("span",{className:"tab-label",children:e.label}),(0,Ti.jsx)("span",{className:"anime-count",children:"all"===e.key?p.reduce(((e,t)=>{var n;return e+((null===(n=t.data)||void 0===n?void 0:n.length)||0)}),0):(null===(t=p[h.indexOf(e.key)])||void 0===t||null===(n=t.data)||void 0===n?void 0:n.length)||0})]},e.key)}))}),(0,Ti.jsxs)("div",{className:"sort-controls",children:[(0,Ti.jsx)("span",{className:"sort-label",children:"Sort by:"}),(0,Ti.jsx)("div",{className:"sort-options",children:[{value:"title",label:"Title"},{value:"score",label:"Rating"},{value:"currentEpisode",label:"Progress"},{value:"updatedAt",label:"Last Updated"}].map((e=>(0,Ti.jsxs)("button",{className:"sort-option "+(o===e.value?"active":""),onClick:()=>(e=>{if(e===o){const e="asc"===c?"desc":"asc";u(e),a({status:s,sort:o,order:e})}else l(e),u("asc"),a({status:s,sort:e,order:"asc"})})(e.value),children:[e.label,o===e.value&&(0,Ti.jsx)("span",{className:"sort-direction",children:"asc"===c?"\u2191":"\u2193"})]},e.value)))})]})]}),(0,Ti.jsx)("div",{className:"anime-list-content",children:f.length>0?(0,Ti.jsx)("div",{className:"anime-list-grid",children:f.map((e=>(0,Ti.jsx)(uh,{anime:e},e.id)))}):(0,Ti.jsx)("div",{className:"empty-list",children:(0,Ti.jsx)("p",{children:"No anime found in this category."})})})]})};function hh(e,t){return new Promise((function(n,r){let a;return ph(e).then((function(e){try{return a=e,n(new Blob([t.slice(0,2),a,t.slice(2)],{type:"image/jpeg"}))}catch(e){return r(e)}}),r)}))}const ph=e=>new Promise(((t,n)=>{const r=new FileReader;r.addEventListener("load",(e=>{let{target:{result:r}}=e;const a=new DataView(r);let s=0;if(65496!==a.getUint16(s))return n("not a valid JPEG");for(s+=2;;){const e=a.getUint16(s);if(65498===e)break;const i=a.getUint16(s+2);if(65505===e&&1165519206===a.getUint32(s+4)){const e=s+10;let o;switch(a.getUint16(e)){case 18761:o=!0;break;case 19789:o=!1;break;default:return n("TIFF header contains invalid endian")}if(42!==a.getUint16(e+2,o))return n("TIFF header contains invalid version");const l=a.getUint32(e+4,o),c=e+l+2+12*a.getUint16(e+l,o);for(let t=e+l+2;t<c;t+=12)if(274==a.getUint16(t,o)){if(3!==a.getUint16(t+2,o))return n("Orientation data type is invalid");if(1!==a.getUint32(t+4,o))return n("Orientation data count is invalid");a.setUint16(t+8,1,o);break}return t(r.slice(s,s+2+i))}s+=2+i}return t(new Blob)})),r.readAsArrayBuffer(e)}));var mh={},fh={get exports(){return mh},set exports(e){mh=e}};!function(){var e,t,n={};fh.exports=n,n.parse=function(e,t){for(var r=n.bin.readUshort,a=n.bin.readUint,s=0,i={},o=new Uint8Array(e),l=o.length-4;101010256!=a(o,l);)l--;s=l,s+=4;var c=r(o,s+=4);r(o,s+=2);var u=a(o,s+=2),d=a(o,s+=4);s+=4,s=d;for(var h=0;h<c;h++){a(o,s),s+=4,s+=4,s+=4,a(o,s+=4),u=a(o,s+=4);var p=a(o,s+=4),m=r(o,s+=4),f=r(o,s+2),g=r(o,s+4);s+=6;var v=a(o,s+=8);s+=4,s+=m+f+g,n._readLocal(o,v,i,u,p,t)}return i},n._readLocal=function(e,t,r,a,s,i){var o=n.bin.readUshort,l=n.bin.readUint;l(e,t),o(e,t+=4),o(e,t+=2);var c=o(e,t+=2);l(e,t+=2),l(e,t+=4),t+=4;var u=o(e,t+=8),d=o(e,t+=2);t+=2;var h=n.bin.readUTF8(e,t,u);if(t+=u,t+=d,i)r[h]={size:s,csize:a};else{var p=new Uint8Array(e.buffer,t);if(0==c)r[h]=new Uint8Array(p.buffer.slice(t,t+a));else{if(8!=c)throw"unknown compression method: "+c;var m=new Uint8Array(s);n.inflateRaw(p,m),r[h]=m}}},n.inflateRaw=function(e,t){return n.F.inflate(e,t)},n.inflate=function(e,t){return e[0],e[1],n.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},n.deflate=function(e,t){null==t&&(t={level:6});var r=0,a=new Uint8Array(50+Math.floor(1.1*e.length));a[r]=120,a[r+1]=156,r+=2,r=n.F.deflateRaw(e,a,r,t.level);var s=n.adler(e,0,e.length);return a[r+0]=s>>>24&255,a[r+1]=s>>>16&255,a[r+2]=s>>>8&255,a[r+3]=s>>>0&255,new Uint8Array(a.buffer,0,r+4)},n.deflateRaw=function(e,t){null==t&&(t={level:6});var r=new Uint8Array(50+Math.floor(1.1*e.length)),a=n.F.deflateRaw(e,r,a,t.level);return new Uint8Array(r.buffer,0,a)},n.encode=function(e,t){null==t&&(t=!1);var r=0,a=n.bin.writeUint,s=n.bin.writeUshort,i={};for(var o in e){var l=!n._noNeed(o)&&!t,c=e[o],u=n.crc.crc(c,0,c.length);i[o]={cpr:l,usize:c.length,crc:u,file:l?n.deflateRaw(c):c}}for(var o in i)r+=i[o].file.length+30+46+2*n.bin.sizeUTF8(o);r+=22;var d=new Uint8Array(r),h=0,p=[];for(var o in i){var m=i[o];p.push(h),h=n._writeHeader(d,h,o,m,0)}var f=0,g=h;for(var o in i)m=i[o],p.push(h),h=n._writeHeader(d,h,o,m,1,p[f++]);var v=h-g;return a(d,h,101010256),h+=4,s(d,h+=4,f),s(d,h+=2,f),a(d,h+=2,v),a(d,h+=4,g),h+=4,h+=2,d.buffer},n._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(t)},n._writeHeader=function(e,t,r,a,s,i){var o=n.bin.writeUint,l=n.bin.writeUshort,c=a.file;return o(e,t,0==s?67324752:33639248),t+=4,1==s&&(t+=2),l(e,t,20),l(e,t+=2,0),l(e,t+=2,a.cpr?8:0),o(e,t+=2,0),o(e,t+=4,a.crc),o(e,t+=4,c.length),o(e,t+=4,a.usize),l(e,t+=4,n.bin.sizeUTF8(r)),l(e,t+=2,0),t+=2,1==s&&(t+=2,t+=2,o(e,t+=6,i),t+=4),t+=n.bin.writeUTF8(e,t,r),0==s&&(e.set(c,t),t+=c.length),t},n.crc={table:function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var n=t,r=0;r<8;r++)1&n?n=3988292384^n>>>1:n>>>=1;e[t]=n}return e}(),update:function(e,t,r,a){for(var s=0;s<a;s++)e=n.crc.table[255&(e^t[r+s])]^e>>>8;return e},crc:function(e,t,r){return 4294967295^n.crc.update(4294967295,e,t,r)}},n.adler=function(e,t,n){for(var r=1,a=0,s=t,i=t+n;s<i;){for(var o=Math.min(s+5552,i);s<o;)a+=r+=e[s++];r%=65521,a%=65521}return a<<16|r},n.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,n){e[t]=255&n,e[t+1]=n>>8&255},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,n){e[t]=255&n,e[t+1]=n>>8&255,e[t+2]=n>>16&255,e[t+3]=n>>24&255},readASCII:function(e,t,n){for(var r="",a=0;a<n;a++)r+=String.fromCharCode(e[t+a]);return r},writeASCII:function(e,t,n){for(var r=0;r<n.length;r++)e[t+r]=n.charCodeAt(r)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,r){for(var a,s="",i=0;i<r;i++)s+="%"+n.bin.pad(e[t+i].toString(16));try{a=decodeURIComponent(s)}catch(a){return n.bin.readASCII(e,t,r)}return a},writeUTF8:function(e,t,n){for(var r=n.length,a=0,s=0;s<r;s++){var i=n.charCodeAt(s);if(0==(4294967168&i))e[t+a]=i,a++;else if(0==(4294965248&i))e[t+a]=192|i>>6,e[t+a+1]=128|63&i,a+=2;else if(0==(4294901760&i))e[t+a]=224|i>>12,e[t+a+1]=128|i>>6&63,e[t+a+2]=128|63&i,a+=3;else{if(0!=(4292870144&i))throw"e";e[t+a]=240|i>>18,e[t+a+1]=128|i>>12&63,e[t+a+2]=128|i>>6&63,e[t+a+3]=128|63&i,a+=4}}return a},sizeUTF8:function(e){for(var t=e.length,n=0,r=0;r<t;r++){var a=e.charCodeAt(r);if(0==(4294967168&a))n++;else if(0==(4294965248&a))n+=2;else if(0==(4294901760&a))n+=3;else{if(0!=(4292870144&a))throw"e";n+=4}}return n}},n.F={},n.F.deflateRaw=function(e,t,r,a){var s=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][a],i=n.F.U,o=n.F._goodIndex;n.F._hash;var l=n.F._putsE,c=0,u=r<<3,d=0,h=e.length;if(0==a){for(;c<h;)l(t,u,c+(S=Math.min(65535,h-c))==h?1:0),u=n.F._copyExact(e,c,S,t,u+8),c+=S;return u>>>3}var p=i.lits,m=i.strt,f=i.prev,g=0,v=0,y=0,b=0,x=0,w=0;for(h>2&&(m[w=n.F._hash(e,0)]=0),c=0;c<h;c++){if(x=w,c+1<h-2){w=n.F._hash(e,c+1);var j=c+1&32767;f[j]=m[w],m[w]=j}if(d<=c){(g>14e3||v>26697)&&h-c>100&&(d<c&&(p[g]=c-d,g+=2,d=c),u=n.F._writeBlock(c==h-1||d==h?1:0,p,g,b,e,y,c-y,t,u),g=v=b=0,y=c);var N=0;c<h-2&&(N=n.F._bestMatch(e,c,f,x,Math.min(s[2],h-c),s[3]));var S=N>>>16,k=65535&N;if(0!=N){k=65535&N;var E=o(S=N>>>16,i.of0);i.lhst[257+E]++;var _=o(k,i.df0);i.dhst[_]++,b+=i.exb[E]+i.dxb[_],p[g]=S<<23|c-d,p[g+1]=k<<16|E<<8|_,g+=2,d=c+S}else i.lhst[e[c]]++;v++}}for(y==c&&0!=e.length||(d<c&&(p[g]=c-d,g+=2,d=c),u=n.F._writeBlock(1,p,g,b,e,y,c-y,t,u),g=0,v=0,g=v=b=0,y=c);0!=(7&u);)u++;return u>>>3},n.F._bestMatch=function(e,t,r,a,s,i){var o=32767&t,l=r[o],c=o-l+32768&32767;if(l==o||a!=n.F._hash(e,t-c))return 0;for(var u=0,d=0,h=Math.min(32767,t);c<=h&&0!=--i&&l!=o;){if(0==u||e[t+u]==e[t+u-c]){var p=n.F._howLong(e,t,c);if(p>u){if(d=c,(u=p)>=s)break;c+2<p&&(p=c+2);for(var m=0,f=0;f<p-2;f++){var g=t-c+f+32768&32767,v=g-r[g]+32768&32767;v>m&&(m=v,l=g)}}}c+=(o=l)-(l=r[o])+32768&32767}return u<<16|d}
vendor: 4,264 bytes, line 4
4,n.F._howLong=function(e,t,n){if(e[t]!=e[t-n]||e[t+1]!=e[t+1-n]||e[t+2]!=e[t+2-n])return 0;var r=t,a=Math.min(e.length,t+258);for(t+=3;t<a&&e[t]==e[t-n];)t++;return t-r},n.F._hash=function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},n.saved=0,n.F._writeBlock=function(e,t,r,a,s,i,o,l,c){var u,d,h,p,m,f,g,v,y,b=n.F.U,x=n.F._putsF,w=n.F._putsE;b.lhst[256]++,d=(u=n.F.getTrees())[0],h=u[1],p=u[2],m=u[3],f=u[4],g=u[5],v=u[6],y=u[7];var j=32+(0==(c+3&7)?0:8-(c+3&7))+(o<<3),N=a+n.F.contSize(b.fltree,b.lhst)+n.F.contSize(b.fdtree,b.dhst),S=a+n.F.contSize(b.ltree,b.lhst)+n.F.contSize(b.dtree,b.dhst);S+=14+3*g+n.F.contSize(b.itree,b.ihst)+(2*b.ihst[16]+3*b.ihst[17]+7*b.ihst[18]);for(var k=0;k<286;k++)b.lhst[k]=0;for(k=0;k<30;k++)b.dhst[k]=0;for(k=0;k<19;k++)b.ihst[k]=0;var E=j<N&&j<S?0:N<S?1:2;if(x(l,c,e),x(l,c+1,E),c+=3,0==E){for(;0!=(7&c);)c++;c=n.F._copyExact(s,i,o,l,c)}else{var _,C;if(1==E&&(_=b.fltree,C=b.fdtree),2==E){n.F.makeCodes(b.ltree,d),n.F.revCodes(b.ltree,d),n.F.makeCodes(b.dtree,h),n.F.revCodes(b.dtree,h),n.F.makeCodes(b.itree,p),n.F.revCodes(b.itree,p),_=b.ltree,C=b.dtree,w(l,c,m-257),w(l,c+=5,f-1),w(l,c+=5,g-4),c+=4;for(var A=0;A<g;A++)w(l,c+3*A,b.itree[1+(b.ordr[A]<<1)]);c+=3*g,c=n.F._codeTiny(v,b.itree,l,c),c=n.F._codeTiny(y,b.itree,l,c)}for(var T=i,R=0;R<r;R+=2){for(var P=t[R],O=P>>>23,I=T+(8388607&P);T<I;)c=n.F._writeLit(s[T++],_,l,c);if(0!=O){var $=t[R+1],L=$>>16,F=$>>8&255,M=255&$;w(l,c=n.F._writeLit(257+F,_,l,c),O-b.of0[F]),c+=b.exb[F],x(l,c=n.F._writeLit(M,C,l,c),L-b.df0[M]),c+=b.dxb[M],T+=O}}c=n.F._writeLit(256,_,l,c)}return c},n.F._copyExact=function(e,t,n,r,a){var s=a>>>3;return r[s]=n,r[s+1]=n>>>8,r[s+2]=255-r[s],r[s+3]=255-r[s+1],s+=4,r.set(new Uint8Array(e.buffer,t,n),s),a+(n+4<<3)},n.F.getTrees=function(){for(var e=n.F.U,t=n.F._hufTree(e.lhst,e.ltree,15),r=n.F._hufTree(e.dhst,e.dtree,15),a=[],s=n.F._lenCodes(e.ltree,a),i=[],o=n.F._lenCodes(e.dtree,i),l=0;l<a.length;l+=2)e.ihst[a[l]]++;for(l=0;l<i.length;l+=2)e.ihst[i[l]]++;for(var c=n.F._hufTree(e.ihst,e.itree,7),u=19;u>4&&0==e.itree[1+(e.ordr[u-1]<<1)];)u--;return[t,r,c,s,o,u,a,i]},n.F.getSecond=function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(e[n+1]);return t},n.F.nonZero=function(e){for(var t="",n=0;n<e.length;n+=2)0!=e[n+1]&&(t+=(n>>1)+",");return t},n.F.contSize=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[1+(r<<1)];return n},n.F._codeTiny=function(e,t,r,a){for(var s=0;s<e.length;s+=2){var i=e[s],o=e[s+1];a=n.F._writeLit(i,t,r,a);var l=16==i?2:17==i?3:7;i>15&&(n.F._putsE(r,a,o,l),a+=l)}return a},n.F._lenCodes=function(e,t){for(var n=e.length;2!=n&&0==e[n-1];)n-=2;for(var r=0;r<n;r+=2){var a=e[r+1],s=r+3<n?e[r+3]:-1,i=r+5<n?e[r+5]:-1,o=0==r?-1:e[r-1];if(0==a&&s==a&&i==a){for(var l=r+5;l+2<n&&e[l+2]==a;)l+=2;(c=Math.min(l+1-r>>>1,138))<11?t.push(17,c-3):t.push(18,c-11),r+=2*c-2}else if(a==o&&s==a&&i==a){for(l=r+5;l+2<n&&e[l+2]==a;)l+=2;var c=Math.min(l+1-r>>>1,6);t.push(16,c-3),r+=2*c-2}else t.push(a,0)}return n>>>1},n.F._hufTree=function(e,t,r){var a=[],s=e.length,i=t.length,o=0;for(o=0;o<i;o+=2)t[o]=0,t[o+1]=0;for(o=0;o<s;o++)0!=e[o]&&a.push({lit:o,f:e[o]});var l=a.length,c=a.slice(0);if(0==l)return 0;if(1==l){var u=a[0].lit;return c=0==u?1:0,t[1+(u<<1)]=1,t[1+(c<<1)]=1,1}a.sort((function(e,t){return e.f-t.f}));var d=a[0],h=a[1],p=0,m=1,f=2;for(a[0]={lit:-1,f:d.f+h.f,l:d,r:h,d:0};m!=l-1;)d=p!=m&&(f==l||a[p].f<a[f].f)?a[p++]:a[f++],h=p!=m&&(f==l||a[p].f<a[f].f)?a[p++]:a[f++],a[m++]={lit:-1,f:d.f+h.f,l:d,r:h};var g=n.F.setDepth(a[m-1],0);for(g>r&&(n.F.restrictDepth(c,r,g),g=r),o=0;o<l;o++)t[1+(c[o].lit<<1)]=c[o].d;return g},n.F.setDepth=function(e,t){return-1!=e.lit?(e.d=t,t):Math.max(n.F.setDepth(e.l,t+1),n.F.setDepth(e.r,t+1))},n.F.restrictDepth=function(e,t,n){var r=0,a=1<<n-t,s=0;for(e.sort((function(e,t){return t.d==e.d?e.f-t.f:t.d-e.d})),r=0;r<e.length&&e[r].d>t;r++){var i=e[r].d;e[r].d=t,s+=a-(1<<n-i)}for(s>>>=n-t;s>0;)(i=e[r].d)<t?(e[r].d++,s-=1<<t-i-1):r++;for(;r>=0;r--)e[r].d==t&&s<0&&(e[r].d--,s++);0!=s&&console.log("debt left")},n.F._goodIndex=function(e,t){var n=0;return t[16|n]<=e&&(n|=16),t[8|n]<=e&&(n|=8),t[4|n]<=e&&(n|=4),t[2|n]<=e&&(n|=2),t[1|n]<=e&&(n|=1),n},n.F._writeLit=function(e,t,r,a){return n.F._putsF(r,a,t[e<<1]),a+t[1+(e<<1)]},n.F.inflate=function(e,t){var r=Uint8Array;
vendor: 4,446 bytes, line 4
4if(3==e[0]&&0==e[1])return t||new r(0);var a=n.F,s=a._bitsF,i=a._bitsE,o=a._decodeTiny,l=a.makeCodes,c=a.codes2map,u=a._get17,d=a.U,h=null==t;h&&(t=new r(e.length>>>2<<3));for(var p,m,f=0,g=0,v=0,y=0,b=0,x=0,w=0,j=0,N=0;0==f;)if(f=s(e,N,1),g=s(e,N+1,2),N+=3,0!=g){if(h&&(t=n.F._check(t,j+(1<<17))),1==g&&(p=d.flmap,m=d.fdmap,x=511,w=31),2==g){v=i(e,N,5)+257,y=i(e,N+5,5)+1,b=i(e,N+10,4)+4,N+=14;for(var S=0;S<38;S+=2)d.itree[S]=0,d.itree[S+1]=0;var k=1;for(S=0;S<b;S++){var E=i(e,N+3*S,3);d.itree[1+(d.ordr[S]<<1)]=E,E>k&&(k=E)}N+=3*b,l(d.itree,k),c(d.itree,k,d.imap),p=d.lmap,m=d.dmap,N=o(d.imap,(1<<k)-1,v+y,e,N,d.ttree);var _=a._copyOut(d.ttree,0,v,d.ltree);x=(1<<_)-1;var C=a._copyOut(d.ttree,v,y,d.dtree);w=(1<<C)-1,l(d.ltree,_),c(d.ltree,_,p),l(d.dtree,C),c(d.dtree,C,m)}for(;;){var A=p[u(e,N)&x];N+=15&A;var T=A>>>4;if(T>>>8==0)t[j++]=T;else{if(256==T)break;var R=j+T-254;if(T>264){var P=d.ldef[T-257];R=j+(P>>>3)+i(e,N,7&P),N+=7&P}var O=m[u(e,N)&w];N+=15&O;var I=O>>>4,$=d.ddef[I],L=($>>>4)+s(e,N,15&$);for(N+=15&$,h&&(t=n.F._check(t,j+(1<<17)));j<R;)t[j]=t[j++-L],t[j]=t[j++-L],t[j]=t[j++-L],t[j]=t[j++-L];j=R}}}else{0!=(7&N)&&(N+=8-(7&N));var F=4+(N>>>3),M=e[F-4]|e[F-3]<<8;h&&(t=n.F._check(t,j+M)),t.set(new r(e.buffer,e.byteOffset+F,M),j),N=F+M<<3,j+=M}return t.length==j?t:t.slice(0,j)},n.F._check=function(e,t){var n=e.length;if(t<=n)return e;var r=new Uint8Array(Math.max(n<<1,t));return r.set(e,0),r},n.F._decodeTiny=function(e,t,r,a,s,i){for(var o=n.F._bitsE,l=n.F._get17,c=0;c<r;){var u=e[l(a,s)&t];s+=15&u;var d=u>>>4;if(d<=15)i[c]=d,c++;else{var h=0,p=0;16==d?(p=3+o(a,s,2),s+=2,h=i[c-1]):17==d?(p=3+o(a,s,3),s+=3):18==d&&(p=11+o(a,s,7),s+=7);for(var m=c+p;c<m;)i[c]=h,c++}}return s},n.F._copyOut=function(e,t,n,r){for(var a=0,s=0,i=r.length>>>1;s<n;){var o=e[s+t];r[s<<1]=0,r[1+(s<<1)]=o,o>a&&(a=o),s++}for(;s<i;)r[s<<1]=0,r[1+(s<<1)]=0,s++;return a},n.F.makeCodes=function(e,t){for(var r,a,s,i,o=n.F.U,l=e.length,c=o.bl_count,u=0;u<=t;u++)c[u]=0;for(u=1;u<l;u+=2)c[e[u]]++;var d=o.next_code;for(r=0,c[0]=0,a=1;a<=t;a++)r=r+c[a-1]<<1,d[a]=r;for(s=0;s<l;s+=2)0!=(i=e[s+1])&&(e[s]=d[i],d[i]++)},n.F.codes2map=function(e,t,r){for(var a=e.length,s=n.F.U.rev15,i=0;i<a;i+=2)if(0!=e[i+1])for(var o=i>>1,l=e[i+1],c=o<<4|l,u=t-l,d=e[i]<<u,h=d+(1<<u);d!=h;)r[s[d]>>>15-t]=c,d++},n.F.revCodes=function(e,t){for(var r=n.F.U.rev15,a=15-t,s=0;s<e.length;s+=2){var i=e[s]<<t-e[s+1];e[s]=r[i]>>>a}},n.F._putsE=function(e,t,n){n<<=7&t;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8},n.F._putsF=function(e,t,n){n<<=7&t;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},n.F._bitsE=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<n)-1},n.F._bitsF=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<n)-1},n.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},n.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},n.F.U=(e=Uint16Array,t=Uint32Array,{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new e(65536),prev:new e(32768)}),function(){for(var e=n.F.U,t=0;t<32768;t++){var r=t;r=(4278255360&(r=(4042322160&(r=(3435973836&(r=(2863311530&r)>>>1|(1431655765&r)<<1))>>>2|(858993459&r)<<2))>>>4|(252645135&r)<<4))>>>8|(16711935&r)<<8,e.rev15[t]=(r>>>16|r<<16)>>>17}function a(e,t,n){for(;0!=t--;)e.push(0,n)}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];a(e.fltree,144,8),a(e.fltree,112,9),a(e.fltree,24,7),a(e.fltree,8,8),n.F.makeCodes(e.fltree,9),n.F.codes2map(e.fltree,9,e.flmap),n.F.revCodes(e.fltree,9),a(e.fdtree,32,5),n.F.makeCodes(e.fdtree,5),n.F.codes2map(e.fdtree,5,e.fdmap),n.F.revCodes(e.fdtree,5),a(e.itree,19,0),a(e.ltree,286,0),a(e.dtree,30,0),a(e.ttree,320,0)}()}();var gh,vh=(gh={__proto__:null,default:mh}
vendor: 5,394 bytes, line 4
4,[mh].forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(t){if("default"!==t&&!(t in gh)){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(gh,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}))})),Object.freeze(gh));const yh=function(){var e={nextZero(e,t){for(;0!=e[t];)t++;return t},readUshort:(e,t)=>e[t]<<8|e[t+1],writeUshort(e,t,n){e[t]=n>>8&255,e[t+1]=255&n},readUint:(e,t)=>16777216*e[t]+(e[t+1]<<16|e[t+2]<<8|e[t+3]),writeUint(e,t,n){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n},readASCII(e,t,n){let r="";for(let a=0;a<n;a++)r+=String.fromCharCode(e[t+a]);return r},writeASCII(e,t,n){for(let r=0;r<n.length;r++)e[t+r]=n.charCodeAt(r)},readBytes(e,t,n){const r=[];for(let a=0;a<n;a++)r.push(e[t+a]);return r},pad:e=>e.length<2?`0${e}`:e,readUTF8(t,n,r){let a,s="";for(let i=0;i<r;i++)s+=`%${e.pad(t[n+i].toString(16))}`;try{a=decodeURIComponent(s)}catch(a){return e.readASCII(t,n,r)}return a}};function t(t,n,r,a){const i=n*r,o=s(a),l=Math.ceil(n*o/8),c=new Uint8Array(4*i),u=new Uint32Array(c.buffer),{ctype:d}=a,{depth:h}=a,p=e.readUshort;if(6==d){const e=i<<2;if(8==h)for(var m=0;m<e;m+=4)c[m]=t[m],c[m+1]=t[m+1],c[m+2]=t[m+2],c[m+3]=t[m+3];if(16==h)for(m=0;m<e;m++)c[m]=t[m<<1]}else if(2==d){const e=a.tabs.tRNS;if(null==e){if(8==h)for(m=0;m<i;m++){var f=3*m;u[m]=255<<24|t[f+2]<<16|t[f+1]<<8|t[f]}if(16==h)for(m=0;m<i;m++)f=6*m,u[m]=255<<24|t[f+4]<<16|t[f+2]<<8|t[f]}else{var g=e[0];const n=e[1],r=e[2];if(8==h)for(m=0;m<i;m++){var v=m<<2;f=3*m,u[m]=255<<24|t[f+2]<<16|t[f+1]<<8|t[f],t[f]==g&&t[f+1]==n&&t[f+2]==r&&(c[v+3]=0)}if(16==h)for(m=0;m<i;m++)v=m<<2,f=6*m,u[m]=255<<24|t[f+4]<<16|t[f+2]<<8|t[f],p(t,f)==g&&p(t,f+2)==n&&p(t,f+4)==r&&(c[v+3]=0)}}else if(3==d){const e=a.tabs.PLTE,s=a.tabs.tRNS,o=s?s.length:0;if(1==h)for(var y=0;y<r;y++){var b=y*l,x=y*n;for(m=0;m<n;m++){v=x+m<<2;var w=3*(j=t[b+(m>>3)]>>7-(7&m)&1);c[v]=e[w],c[v+1]=e[w+1],c[v+2]=e[w+2],c[v+3]=j<o?s[j]:255}}if(2==h)for(y=0;y<r;y++)for(b=y*l,x=y*n,m=0;m<n;m++)v=x+m<<2,w=3*(j=t[b+(m>>2)]>>6-((3&m)<<1)&3),c[v]=e[w],c[v+1]=e[w+1],c[v+2]=e[w+2],c[v+3]=j<o?s[j]:255;if(4==h)for(y=0;y<r;y++)for(b=y*l,x=y*n,m=0;m<n;m++)v=x+m<<2,w=3*(j=t[b+(m>>1)]>>4-((1&m)<<2)&15),c[v]=e[w],c[v+1]=e[w+1],c[v+2]=e[w+2],c[v+3]=j<o?s[j]:255;if(8==h)for(m=0;m<i;m++){var j;v=m<<2,w=3*(j=t[m]),c[v]=e[w],c[v+1]=e[w+1],c[v+2]=e[w+2],c[v+3]=j<o?s[j]:255}}else if(4==d){if(8==h)for(m=0;m<i;m++){v=m<<2;var N=t[S=m<<1];c[v]=N,c[v+1]=N,c[v+2]=N,c[v+3]=t[S+1]}if(16==h)for(m=0;m<i;m++){var S;v=m<<2,N=t[S=m<<2],c[v]=N,c[v+1]=N,c[v+2]=N,c[v+3]=t[S+2]}}else if(0==d)for(g=a.tabs.tRNS?a.tabs.tRNS:-1,y=0;y<r;y++){const e=y*l,r=y*n;if(1==h)for(var k=0;k<n;k++){var E=(N=255*(t[e+(k>>>3)]>>>7-(7&k)&1))==255*g?0:255;u[r+k]=E<<24|N<<16|N<<8|N}else if(2==h)for(k=0;k<n;k++)E=(N=85*(t[e+(k>>>2)]>>>6-((3&k)<<1)&3))==85*g?0:255,u[r+k]=E<<24|N<<16|N<<8|N;else if(4==h)for(k=0;k<n;k++)E=(N=17*(t[e+(k>>>1)]>>>4-((1&k)<<2)&15))==17*g?0:255,u[r+k]=E<<24|N<<16|N<<8|N;else if(8==h)for(k=0;k<n;k++)E=(N=t[e+k])==g?0:255,u[r+k]=E<<24|N<<16|N<<8|N;else if(16==h)for(k=0;k<n;k++)N=t[e+(k<<1)],E=p(t,e+(k<<1))==g?0:255,u[r+k]=E<<24|N<<16|N<<8|N}return c}function n(e,t,n,o){const l=s(e),c=Math.ceil(n*l/8),u=new Uint8Array((c+1+e.interlace)*o);return t=e.tabs.CgBI?a(t,u):r(t,u),0==e.interlace?t=i(t,e,0,n,o):1==e.interlace&&(t=function(e,t){const n=t.width,r=t.height,a=s(t),o=a>>3,l=Math.ceil(n*a/8),c=new Uint8Array(r*l);let u=0;const d=[0,0,4,0,2,0,1],h=[0,4,0,2,0,1,0],p=[8,8,8,4,4,2,2],m=[8,8,4,4,2,2,1];let f=0;for(;f<7;){const s=p[f],v=m[f];let y=0,b=0,x=d[f];for(;x<r;)x+=s,b++;let w=h[f];for(;w<n;)w+=v,y++;const j=Math.ceil(y*a/8);i(e,t,u,y,b);let N=0,S=d[f];for(;S<r;){let t=h[f],r=u+N*j<<3;for(;t<n;){var g;if(1==a&&(g=(g=e[r>>3])>>7-(7&r)&1,c[S*l+(t>>3)]|=g<<7-(7&t)),2==a&&(g=(g=e[r>>3])>>6-(7&r)&3,c[S*l+(t>>2)]|=g<<6-((3&t)<<1)),4==a&&(g=(g=e[r>>3])>>4-(7&r)&15,c[S*l+(t>>1)]|=g<<4-((1&t)<<2)),a>=8){const n=S*l+t*o;for(let t=0;t<o;t++)c[n+t]=e[(r>>3)+t]}r+=a,t+=v}N++,S+=s}y*b!=0&&(u+=b*(1+j)),f+=1}return c}(t,e)),t}function r(e,t){return a(new Uint8Array(e.buffer,2,e.length-6),t)}var a=function(){const e={H:{}};return e.H.N=function(t,n){const r=Uint8Array;let a,s,i=0,o=0,l=0,c=0,u=0,d=0,h=0,p=0,m=0;if(3==t[0]&&0==t[1])return n||new r(0);const f=e.H,g=f.b,v=f.e,y=f.R,b=f.n,x=f.A,w=f.Z,j=f.m,N=null==n;for(N&&(n=new r(t.length>>>2<<5));0==i;)if(i=g(t,m,1),o=g(t,m+1,2),m+=3,0!=o){if(N&&(n=e.H.W(n,p+(1<<17))),1==o&&(a=j.J,s=j.h,d=511,h=31),2==o){l=v(t,m,5)+257,c=v(t,m+5,5)+1,u=v(t,m+10,4)+4,m+=14;let e=1;for(var S=0;S<38;S+=2)j.Q[S]=0,j.Q[S+1]=0;for(S=0;S<u;S++){const n=v(t,m+3*S,3);j.Q[1+(j.X[S]<<1)]=n,n>e&&(e=n)}m+=3*u,b(j.Q,e),x(j.Q,e,j.u),a=j.w,s=j.d,m=y(j.u,(1<<e)-1,l+c,t,m,j.v);const n=f.V(j.v,0,l,j.C);d=(1<<n)-1;const r=f.V(j.v,l,c,j.D);h=(1<<r)-1,b(j.C,n),x(j.C,n,a),b(j.D,r),x(j.D,r,s)}for(;;){const e=a[w(t,m)&d];m+=15&e;const r=e>>>4;if(r>>>8==0)n[p++]=r;else{if(256==r)break;{let e=p+r-254;if(r>264){const n=j.q[r-257];e=p+(n>>>3)+v(t,m,7&n),m+=7&n}const a=s[w(t,m)&h];m+=15&a;const i=a>>>4,o=j.c[i],l=(o>>>4)+g(t,m,15&o);for(m+=15&o;p<e;)n[p]=n[p++-l],n[p]=n[p++-l],n[p]=n[p++-l],n[p]=n[p++-l];p=e}}}}else{0!=(7&m)&&(m+=8-(7&m));const a=4+(m>>>3),s=t[a-4]|t[a-3]<<8;N&&(n=e.H.W(n,p+s)),n.set(new r(t.buffer,t.byteOffset+a,s),p),m=a+s<<3,p+=s}return n.length==p?n:n.slice(0,p)},e.H.W=function(e,t){const n=e.length;if(t<=n)return e;
vendor: 16,878 bytes, line 4
4const r=new Uint8Array(n<<1);return r.set(e,0),r},e.H.R=function(t,n,r,a,s,i){const o=e.H.e,l=e.H.Z;let c=0;for(;c<r;){const e=t[l(a,s)&n];s+=15&e;const r=e>>>4;if(r<=15)i[c]=r,c++;else{let e=0,t=0;16==r?(t=3+o(a,s,2),s+=2,e=i[c-1]):17==r?(t=3+o(a,s,3),s+=3):18==r&&(t=11+o(a,s,7),s+=7);const n=c+t;for(;c<n;)i[c]=e,c++}}return s},e.H.V=function(e,t,n,r){let a=0,s=0;const i=r.length>>>1;for(;s<n;){const n=e[s+t];r[s<<1]=0,r[1+(s<<1)]=n,n>a&&(a=n),s++}for(;s<i;)r[s<<1]=0,r[1+(s<<1)]=0,s++;return a},e.H.n=function(t,n){const r=e.H.m,a=t.length;let s,i,o,l;const c=r.j;for(var u=0;u<=n;u++)c[u]=0;for(u=1;u<a;u+=2)c[t[u]]++;const d=r.K;for(s=0,c[0]=0,i=1;i<=n;i++)s=s+c[i-1]<<1,d[i]=s;for(o=0;o<a;o+=2)l=t[o+1],0!=l&&(t[o]=d[l],d[l]++)},e.H.A=function(t,n,r){const a=t.length,s=e.H.m.r;for(let e=0;e<a;e+=2)if(0!=t[e+1]){const a=e>>1,i=t[e+1],o=a<<4|i,l=n-i;let c=t[e]<<l;const u=c+(1<<l);for(;c!=u;)r[s[c]>>>15-n]=o,c++}},e.H.l=function(t,n){const r=e.H.m.r,a=15-n;for(let e=0;e<t.length;e+=2){const s=t[e]<<n-t[e+1];t[e]=r[s]>>>a}},e.H.M=function(e,t,n){n<<=7&t;const r=t>>>3;e[r]|=n,e[r+1]|=n>>>8},e.H.I=function(e,t,n){n<<=7&t;const r=t>>>3;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},e.H.e=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<n)-1},e.H.b=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<n)-1},e.H.Z=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},e.H.i=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},e.H.m=function(){const e=Uint16Array,t=Uint32Array;return{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new e(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new t(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new t(286),Y:new t(30),a:new t(19),t:new t(15e3),k:new e(65536),g:new e(32768)}}(),function(){const t=e.H.m;for(var n=0;n<32768;n++){let e=n;e=(2863311530&e)>>>1|(1431655765&e)<<1,e=(3435973836&e)>>>2|(858993459&e)<<2,e=(4042322160&e)>>>4|(252645135&e)<<4,e=(4278255360&e)>>>8|(16711935&e)<<8,t.r[n]=(e>>>16|e<<16)>>>17}function r(e,t,n){for(;0!=t--;)e.push(0,n)}for(n=0;n<32;n++)t.q[n]=t.S[n]<<3|t.T[n],t.c[n]=t.p[n]<<4|t.z[n];r(t._,144,8),r(t._,112,9),r(t._,24,7),r(t._,8,8),e.H.n(t._,9),e.H.A(t._,9,t.J),e.H.l(t._,9),r(t.$,32,5),e.H.n(t.$,5),e.H.A(t.$,5,t.h),e.H.l(t.$,5),r(t.Q,19,0),r(t.C,286,0),r(t.D,30,0),r(t.v,320,0)}(),e.H.N}();function s(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth}function i(e,t,n,r,a){let i=s(t);const l=Math.ceil(r*i/8);let c,u;i=Math.ceil(i/8);let d=e[n],h=0;if(d>1&&(e[n]=[0,0,1][d-2]),3==d)for(h=i;h<l;h++)e[h+1]=e[h+1]+(e[h+1-i]>>>1)&255;for(let s=0;s<a;s++)if(c=n+s*l,u=c+s+1,d=e[u-1],h=0,0==d)for(;h<l;h++)e[c+h]=e[u+h];else if(1==d){for(;h<i;h++)e[c+h]=e[u+h];for(;h<l;h++)e[c+h]=e[u+h]+e[c+h-i]}else if(2==d)for(;h<l;h++)e[c+h]=e[u+h]+e[c+h-l];else if(3==d){for(;h<i;h++)e[c+h]=e[u+h]+(e[c+h-l]>>>1);for(;h<l;h++)e[c+h]=e[u+h]+(e[c+h-l]+e[c+h-i]>>>1)}else{for(;h<i;h++)e[c+h]=e[u+h]+o(0,e[c+h-l],0);for(;h<l;h++)e[c+h]=e[u+h]+o(e[c+h-i],e[c+h-l],e[c+h-i-l])}return e}function o(e,t,n){const r=e+t-n,a=r-e,s=r-t,i=r-n;return a*a<=s*s&&a*a<=i*i?e:s*s<=i*i?t:n}function l(t,n,r){r.width=e.readUint(t,n),n+=4,r.height=e.readUint(t,n),n+=4,r.depth=t[n],n++,r.ctype=t[n],n++,r.compress=t[n],n++,r.filter=t[n],n++,r.interlace=t[n],n++}function c(e,t,n,r,a,s,i,o,l){const c=Math.min(t,a),u=Math.min(n,s);let d=0,h=0;for(let w=0;w<u;w++)for(let n=0;n<c;n++)if(i>=0&&o>=0?(d=w*t+n<<2,h=(o+w)*a+i+n<<2):(d=(-o+w)*t-i+n<<2,h=w*a+n<<2),0==l)r[h]=e[d],r[h+1]=e[d+1],r[h+2]=e[d+2],r[h+3]=e[d+3];else if(1==l){var p=e[d+3]*(1/255),m=e[d]*p,f=e[d+1]*p,g=e[d+2]*p,v=r[h+3]*(1/255),y=r[h]*v,b=r[h+1]*v,x=r[h+2]*v;const t=1-p,n=p+v*t,a=0==n?0:1/n;r[h+3]=255*n,r[h+0]=(m+y*t)*a,r[h+1]=(f+b*t)*a,r[h+2]=(g+x*t)*a}else if(2==l)p=e[d+3],m=e[d],f=e[d+1],g=e[d+2],v=r[h+3],y=r[h],b=r[h+1],x=r[h+2],p==v&&m==y&&f==b&&g==x?(r[h]=0,r[h+1]=0,r[h+2]=0,r[h+3]=0):(r[h]=m,r[h+1]=f,r[h+2]=g,r[h+3]=p);else if(3==l){if(p=e[d+3],m=e[d],f=e[d+1],g=e[d+2],v=r[h+3],y=r[h],b=r[h+1],x=r[h+2],p==v&&m==y&&f==b&&g==x)continue;if(p<220&&v>20)return!1}return!0}return{decode:function(t){const s=new Uint8Array(t);let i=8;const o=e,c=o.readUshort,u=o.readUint,d={tabs:{},frames:[]},h=new Uint8Array(s.length);let p,m=0,f=0;const g=[137,80,78,71,13,10,26,10];for(var v=0;v<8;v++)if(s[v]!=g[v])throw"The input is not a PNG file!";for(;i<s.length;){const t=o.readUint(s,i);i+=4;const g=o.readASCII(s,i,4);if(i+=4,"IHDR"==g)l(s,i,d);else if("iCCP"==g){for(var y=i;0!=s[y];)y++;o.readASCII(s,i,y-i),s[y+1];const n=s.slice(y+2,i+t);let l=null;try{l=r(n)}catch(e){l=a(n)}d.tabs[g]=l}else if("CgBI"==g)d.tabs[g]=s.slice(i,i+4);else if("IDAT"==g){for(v=0;v<t;v++)h[m+v]=s[i+v];m+=t}else if("acTL"==g)d.tabs[g]={num_frames:u(s,i),num_plays:u(s,i+4)},p=new Uint8Array(s.length);else if("fcTL"==g){0!=f&&((S=d.frames[d.frames.length-1]).data=n(d,p.slice(0,f),S.rect.width,S.rect.height),f=0);const e={x:u(s,i+12),y:u(s,i+16),width:u(s,i+4),height:u(s,i+8)};let t=c(s,i+22);t=c(s,i+20)/(0==t?100:t);const r={rect:e,delay:Math.round(1e3*t),dispose:s[i+24],blend:s[i+25]};d.frames.push(r)}else if("fdAT"==g){for(v=0;v<t-4;v++)p[f+v]=s[i+v+4];f+=t-4}else if("pHYs"==g)d.tabs[g]=[o.readUint(s,i),o.readUint(s,i+4),s[i+8]];else if("cHRM"==g)for(d.tabs[g]=[],v=0;v<8;v++)d.tabs[g].push(o.readUint(s,i+4*v));else if("tEXt"==g||"zTXt"==g){null==d.tabs[g]&&(d.tabs[g]={});var b=o.nextZero(s,i),x=o.readASCII(s,i,b-i),w=i+t-b-1;if("tEXt"==g)N=o.readASCII(s,b+1,w);else{var j=r(s.slice(b+2,b+2+w));N=o.readUTF8(j,0,j.length)}d.tabs[g][x]=N}else if("iTXt"==g){null==d.tabs[g]&&(d.tabs[g]={}),b=0,y=i,b=o.nextZero(s,y),x=o.readASCII(s,y,b-y);const e=s[y=b+1];var N;s[y+1],y+=2,b=o.nextZero(s,y),o.readASCII(s,y,b-y),y=b+1,b=o.nextZero(s,y),o.readUTF8(s,y,b-y),w=t-((y=b+1)-i),0==e?N=o.readUTF8(s,y,w):(j=r(s.slice(y,y+w)),N=o.readUTF8(j,0,j.length)),d.tabs[g][x]=N}else if("PLTE"==g)d.tabs[g]=o.readBytes(s,i,t);else if("hIST"==g){const e=d.tabs.PLTE.length/3;for(d.tabs[g]=[],v=0;v<e;v++)d.tabs[g].push(c(s,i+2*v))}else if("tRNS"==g)3==d.ctype?d.tabs[g]=o.readBytes(s,i,t):0==d.ctype?d.tabs[g]=c(s,i):2==d.ctype&&(d.tabs[g]=[c(s,i),c(s,i+2),c(s,i+4)]);else if("gAMA"==g)d.tabs[g]=o.readUint(s,i)/1e5;else if("sRGB"==g)d.tabs[g]=s[i];else if("bKGD"==g)0==d.ctype||4==d.ctype?d.tabs[g]=[c(s,i)]:2==d.ctype||6==d.ctype?d.tabs[g]=[c(s,i),c(s,i+2),c(s,i+4)]:3==d.ctype&&(d.tabs[g]=s[i]);else if("IEND"==g)break;i+=t,o.readUint(s,i),i+=4}var S;return 0!=f&&((S=d.frames[d.frames.length-1]).data=n(d,p.slice(0,f),S.rect.width,S.rect.height)),d.data=n(d,h,d.width,d.height),delete d.compress,delete d.interlace,delete d.filter,d},toRGBA8:function(e){const n=e.width,r=e.height;if(null==e.tabs.acTL)return[t(e.data,n,r,e).buffer];const a=[];null==e.frames[0].data&&(e.frames[0].data=e.data);const s=n*r*4,i=new Uint8Array(s),o=new Uint8Array(s),l=new Uint8Array(s);for(let d=0;d<e.frames.length;d++){const h=e.frames[d],p=h.rect.x,m=h.rect.y,f=h.rect.width,g=h.rect.height,v=t(h.data,f,g,e);if(0!=d)for(var u=0;u<s;u++)l[u]=i[u];if(0==h.blend?c(v,f,g,i,n,r,p,m,0):1==h.blend&&c(v,f,g,i,n,r,p,m,1),a.push(i.buffer.slice(0)),0==h.dispose);else if(1==h.dispose)c(o,f,g,i,n,r,p,m,0);else if(2==h.dispose)for(u=0;u<s;u++)i[u]=l[u]}return a},_paeth:o,_copyTile:c,_bin:e}}();!function(){const{_copyTile:e}=yh,{_bin:t}=yh,n=yh._paeth;var r={table:function(){const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)1&n?n=3988292384^n>>>1:n>>>=1;e[t]=n}return e}(),update(e,t,n,a){for(let s=0;s<a;s++)e=r.table[255&(e^t[n+s])]^e>>>8;return e},crc:(e,t,n)=>4294967295^r.update(4294967295,e,t,n)};function a(e,t,n,r){t[n]+=e[0]*r>>4,t[n+1]+=e[1]*r>>4,t[n+2]+=e[2]*r>>4,t[n+3]+=e[3]*r>>4}function s(e){return Math.max(0,Math.min(255,e))}function i(e,t){const n=e[0]-t[0],r=e[1]-t[1],a=e[2]-t[2],s=e[3]-t[3];return n*n+r*r+a*a+s*s}function o(e,t,n,r,o,l,c){null==c&&(c=1);const u=r.length,d=[];for(var h=0;h<u;h++){const e=r[h];d.push([e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255])}for(h=0;h<u;h++){let e=4294967295;for(var p=0,m=0;m<u;m++){var f=i(d[h],d[m]);m!=h&&f<e&&(e=f,p=m)}}const g=new Uint32Array(o.buffer),v=new Int16Array(t*n*4),y=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(h=0;h<y.length;h++)y[h]=255*((y[h]+.5)/16-.5);for(let x=0;x<n;x++)for(let o=0;o<t;o++){var b;h=4*(x*t+o),2!=c?b=[s(e[h]+v[h]),s(e[h+1]+v[h+1]),s(e[h+2]+v[h+2]),s(e[h+3]+v[h+3])]:(f=y[4*(3&x)+(3&o)],b=[s(e[h]+f),s(e[h+1]+f),s(e[h+2]+f),s(e[h+3]+f)]),p=0;let w=16777215;for(m=0;m<u;m++){const e=i(b,d[m]);e<w&&(w=e,p=m)}const j=d[p],N=[b[0]-j[0],b[1]-j[1],b[2]-j[2],b[3]-j[3]];1==c&&(o!=t-1&&a(N,v,h+4,7),x!=n-1&&(0!=o&&a(N,v,h+4*t-4,3),a(N,v,h+4*t,5),o!=t-1&&a(N,v,h+4*t+4,1))),l[h>>2]=p,g[h>>2]=r[p]}}function l(e,n,a,s,i){null==i&&(i={});const{crc:o}=r,l=t.writeUint,c=t.writeUshort,u=t.writeASCII;let d=8;const h=e.frames.length>1;let p,m=!1,f=33+(h?20:0);if(null!=i.sRGB&&(f+=13),null!=i.pHYs&&(f+=21),null!=i.iCCP&&(p=pako.deflate(i.iCCP),f+=21+p.length+4),3==e.ctype){for(var g=e.plte.length,v=0;v<g;v++)e.plte[v]>>>24!=255&&(m=!0);f+=8+3*g+4+(m?8+1*g+4:0)}for(var y=0;y<e.frames.length;y++)h&&(f+=38),f+=(j=e.frames[y]).cimg.length+12,0!=y&&(f+=4);f+=12;const b=new Uint8Array(f),x=[137,80,78,71,13,10,26,10];for(v=0;v<8;v++)b[v]=x[v];if(l(b,d,13),d+=4,u(b,d,"IHDR"),d+=4,l(b,d,n),d+=4,l(b,d,a),d+=4,b[d]=e.depth,d++,b[d]=e.ctype,d++,b[d]=0,d++,b[d]=0,d++,b[d]=0,d++,l(b,d,o(b,d-17,17)),d+=4,null!=i.sRGB&&(l(b,d,1),d+=4,u(b,d,"sRGB"),d+=4,b[d]=i.sRGB,d++,l(b,d,o(b,d-5,5)),d+=4),null!=i.iCCP){const e=13+p.length;l(b,d,e),d+=4,u(b,d,"iCCP"),d+=4,u(b,d,"ICC profile"),d+=11,d+=2,b.set(p,d),d+=p.length,l(b,d,o(b,d-(e+4),e+4)),d+=4}if(null!=i.pHYs&&(l(b,d,9),d+=4,u(b,d,"pHYs"),d+=4,l(b,d,i.pHYs[0]),d+=4,l(b,d,i.pHYs[1]),d+=4,b[d]=i.pHYs[2],d++,l(b,d,o(b,d-13,13)),d+=4),h&&(l(b,d,8),d+=4,u(b,d,"acTL"),d+=4,l(b,d,e.frames.length),d+=4,l(b,d,null!=i.loop?i.loop:0),d+=4,l(b,d,o(b,d-12,12)),d+=4),3==e.ctype){for(l(b,d,3*(g=e.plte.length)),d+=4,u(b,d,"PLTE"),d+=4,v=0;v<g;v++){const t=3*v,n=e.plte[v],r=255&n,a=n>>>8&255,s=n>>>16&255;b[d+t+0]=r,b[d+t+1]=a,b[d+t+2]=s}if(d+=3*g,l(b,d,o(b,d-3*g-4,3*g+4)),d+=4,m){for(l(b,d,g),d+=4,u(b,d,"tRNS"),d+=4,v=0;v<g;v++)b[d+v]=e.plte[v]>>>24&255;d+=g,l(b,d,o(b,d-g-4,g+4)),d+=4}}let w=0;for(y=0;y<e.frames.length;y++){var j=e.frames[y];h&&(l(b,d,26),d+=4,u(b,d,"fcTL"),d+=4,l(b,d,w++),d+=4,l(b,d,j.rect.width),d+=4,l(b,d,j.rect.height),d+=4,l(b,d,j.rect.x),d+=4,l(b,d,j.rect.y),d+=4,c(b,d,s[y]),d+=2,c(b,d,1e3),d+=2,b[d]=j.dispose,d++,b[d]=j.blend,d++,l(b,d,o(b,d-30,30)),d+=4);const t=j.cimg;l(b,d,(g=t.length)+(0==y?0:4)),d+=4;const n=d;u(b,d,0==y?"IDAT":"fdAT"),d+=4,0!=y&&(l(b,d,w++),d+=4),b.set(t,d),d+=g,l(b,d,o(b,n,d-n)),d+=4}return l(b,d,0),d+=4,u(b,d,"IEND"),d+=4,l(b,d,o(b,d-4,4)),d+=4,b.buffer}function c(e,t,n){for(let r=0;r<e.frames.length;r++){const a=e.frames[r];a.rect.width;const s=a.rect.height,i=new Uint8Array(s*a.bpl+s);a.cimg=p(a.img,s,a.bpp,a.bpl,i,t,n)}}function u(t,n,r,a,s){const i=s[0],l=s[1],c=s[2],u=s[3],p=s[4],m=s[5];let g=6,v=8,y=255;for(var b=0;b<t.length;b++){const e=new Uint8Array(t[b]);for(var x=e.length,w=0;w<x;w+=4)y&=e[w+3]}const j=255!=y,N=function(t,n,r,a,s,i){const o=[];for(var l=0;l<t.length;l++){const d=new Uint8Array(t[l]),p=new Uint32Array(d.buffer);var c;let f=0,g=0,v=n,y=r,b=a?1:0;if(0!=l){const x=i||a||1==l||0!=o[l-2].dispose?1:2;let w=0,j=1e9;for(let e=0;e<x;e++){var u=new Uint8Array(t[l-1-e]);const a=new Uint32Array(t[l-1-e]);let i=n,o=r,c=-1,d=-1;for(let e=0;e<r;e++)for(let t=0;t<n;t++)p[m=e*n+t]!=a[m]&&(t<i&&(i=t),t>c&&(c=t),e<o&&(o=e),e>d&&(d=e));-1==c&&(i=o=c=d=0),s&&(1==(1&i)&&i--,1==(1&o)&&o--);const h=(c-i+1)*(d-o+1);h<j&&(j=h,w=e,f=i,g=o,v=c-i+1,y=d-o+1)}u=new Uint8Array(t[l-1-w]),1==w&&(o[l-1].dispose=2),c=new Uint8Array(v*y*4),e(u,n,r,c,v,y,-f,-g,0),b=e(d,n,r,c,v,y,-f,-g,3)?1:0,1==b?h(d,n,r,c,{x:f,y:g,width:v,height:y}):e(d,n,r,c,v,y,-f,-g,0)}else c=d.slice(0);o.push({rect:{x:f,y:g,width:v,height:y},img:c,blend:b,dispose:0})}if(a)for(l=0;l<o.length;l++){if(1==(f=o[l]).blend)continue;const e=f.rect,a=o[l-1].rect,i=Math.min(e.x,a.x),c=Math.min(e.y,a.y),u={x:i,y:c,width:Math.max(e.x+e.width,a.x+a.width)-i,height:Math.max(e.y+e.height,a.y+a.height)-c};o[l-1].dispose=1,l-1!=0&&d(t,n,r,o,l-1,u,s),d(t,n,r,o,l,u,s)}let p=0;if(1!=t.length)for(var m=0;m<o.length;m++){var f;p+=(f=o[m]).rect.width*f.rect.height}return o}(t,n,r,i,l,c),S={},k=[],E=[];if(0!=a){const e=[];for(w=0;w<N.length;w++)e.push(N[w].img.buffer);const t=function(e){let t=0;for(var n=0;n<e.length;n++)t+=e[n].byteLength;const r=new Uint8Array(t);let a=0;for(n=0;n<e.length;n++){const t=new Uint8Array(e[n]),s=t.length;for(let e=0;e<s;e+=4){let n=t[e],s=t[e+1],i=t[e+2];const o=t[e+3];0==o&&(n=s=i=0),r[a+e]=n,r[a+e+1]=s,r[a+e+2]=i,r[a+e+3]=o}a+=s}return r.buffer}(e),n=f(t,a);for(w=0;w<n.plte.length;w++)k.push(n.plte[w].est.rgba);let r=0;for(w=0;w<N.length;w++){const e=(C=N[w]).img.length;var _=new Uint8Array(n.inds.buffer,r>>2,e>>2);E.push(_);const t=new Uint8Array(n.abuf,r,e);m&&o(C.img,C.rect.width,C.rect.height,k,t,_),C.img.set(t),r+=e}}else for(b=0;b<N.length;b++){var C=N[b];const e=new Uint32Array(C.img.buffer);var A=C.rect.width;for(x=e.length,_=new Uint8Array(x),E.push(_),w=0;w<x;w++){const t=e[w];if(0!=w&&t==e[w-1])_[w]=_[w-1];else if(w>A&&t==e[w-A])_[w]=_[w-A];else{let e=S[t];if(null==e&&(S[t]=e=k.length,k.push(t),k.length>=300))break;_[w]=e}}}const T=k.length;for(T<=256&&0==p&&(v=T<=2?1:T<=4?2:T<=16?4:8,v=Math.max(v,u)),b=0;b<N.length;b++){(C=N[b]).rect.x,C.rect.y,A=C.rect.width;const e=C.rect.height;let t=C.img;new Uint32Array(t.buffer);let n=4*A,r=4;if(T<=256&&0==p){n=Math.ceil(v*A/8);var R=new Uint8Array(n*e);const a=E[b];for(let t=0;t<e;t++){w=t*n;const e=t*A;if(8==v)for(var P=0;P<A;P++)R[w+P]=a[e+P];else if(4==v)for(P=0;P<A;P++)R[w+(P>>1)]|=a[e+P]<<4-4*(1&P);else if(2==v)for(P=0;P<A;P++)R[w+(P>>2)]|=a[e+P]<<6-2*(3&P);else if(1==v)for(P=0;P<A;P++)R[w+(P>>3)]|=a[e+P]<<7-1*(7&P)}t=R,g=3,r=1}else if(0==j&&1==N.length){R=new Uint8Array(A*e*3);const a=A*e;for(w=0;w<a;w++){const e=3*w,n=4*w;R[e]=t[n],R[e+1]=t[n+1],R[e+2]=t[n+2]}t=R,g=2,r=3,n=3*A}C.img=t,C.bpl=n,C.bpp=r}return{ctype:g,depth:v,plte:k,frames:N}}function d(t,n,r,a,s,i,o){const l=Uint8Array,c=Uint32Array,u=new l(t[s-1]),d=new c(t[s-1]),p=s+1<t.length?new l(t[s+1]):null,m=new l(t[s]),f=new c(m.buffer);let g=n,v=r,y=-1,b=-1;for(let e=0;e<i.height;e++)for(let t=0;t<i.width;t++){const r=i.x+t,o=i.y+e,l=o*n+r,c=f[l];0==c||0==a[s-1].dispose&&d[l]==c&&(null==p||0!=p[4*l+3])||(r<g&&(g=r),r>y&&(y=r),o<v&&(v=o),o>b&&(b=o))}-1==y&&(g=v=y=b=0),o&&(1==(1&g)&&g--,1==(1&v)&&v--),i={x:g,y:v,width:y-g+1,height:b-v+1};const x=a[s];x.rect=i,x.blend=1,x.img=new Uint8Array(i.width*i.height*4),0==a[s-1].dispose?(e(u,n,r,x.img,i.width,i.height,-i.x,-i.y,0),h(m,n,r,x.img,i)):e(m,n,r,x.img,i.width,i.height,-i.x,-i.y,0)}function h(t,n,r,a,s){e(t,n,r,a,s.width,s.height,-s.x,-s.y,2)}function p(e,t,n,r,a,s,i){const o=[];let l,c=[0,1,2,3,4];-1!=s?c=[s]:(t*r>5e5||1==n)&&(c=[0]),i&&(l={level:0});const u=vh;for(var d=0;d<c.length;d++){for(let s=0;s<t;s++)m(a,e,s,r,n,c[d]);o.push(u.deflate(a,l))}let h,p=1e9;for(d=0;d<o.length;d++)o[d].length<p&&(h=d,p=o[d].length);return o[h]}function m(e,t,r,a,s,i){const o=r*a;let l=o+r;if(e[l]=i,l++,0==i)if(a<500)for(var c=0;c<a;c++)e[l+c]=t[o+c];else e.set(new Uint8Array(t.buffer,o,a),l);else if(1==i){for(c=0;c<s;c++)e[l+c]=t[o+c];for(c=s;c<a;c++)e[l+c]=t[o+c]-t[o+c-s]+256&255}else if(0==r){for(c=0;c<s;c++)e[l+c]=t[o+c];if(2==i)for(c=s;c<a;c++)e[l+c]=t[o+c];if(3==i)for(c=s;c<a;c++)e[l+c]=t[o+c]-(t[o+c-s]>>1)+256&255;if(4==i)for(c=s;c<a;c++)e[l+c]=t[o+c]-n(t[o+c-s],0,0)+256&255}else{if(2==i)for(c=0;c<a;c++)e[l+c]=t[o+c]+256-t[o+c-a]&255;if(3==i){for(c=0;c<s;c++)e[l+c]=t[o+c]+256-(t[o+c-a]>>1)&255;for(c=s;c<a;c++)e[l+c]=t[o+c]+256-(t[o+c-a]+t[o+c-s]>>1)&255}if(4==i){for(c=0;c<s;c++)e[l+c]=t[o+c]+256-n(0,t[o+c-a],0)&255;for(c=s;c<a;c++)e[l+c]=t[o+c]+256-n(t[o+c-s],t[o+c-a],t[o+c-s-a])&255}}}function f(e,t){const n=new Uint8Array(e),r=n.slice(0),a=new Uint32Array(r.buffer),s=g(r,t),i=s[0],o=s[1],l=n.length,c=new Uint8Array(l>>2);let u;if(n.length<2e7)for(var d=0;d<l;d+=4)u=v(i,h=n[d]*(1/255),p=n[d+1]*(1/255),m=n[d+2]*(1/255),f=n[d+3]*(1/255)),c[d>>2]=u.ind,a[d>>2]=u.est.rgba;else for(d=0;d<l;d+=4){var h=n[d]*(1/255),p=n[d+1]*(1/255),m=n[d+2]*(1/255),f=n[d+3]*(1/255);for(u=i;u.left;)u=y(u.est,h,p,m,f)<=0?u.left:u.right;c[d>>2]=u.ind,a[d>>2]=u.est.rgba}return{abuf:r.buffer,inds:c,plte:o}}function g(e,t,n){null==n&&(n=1e-4);
vendor: 5,081 bytes, line 4
4const r=new Uint32Array(e.buffer),a={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};a.bst=w(e,a.i0,a.i1),a.est=j(a.bst);const s=[a];for(;s.length<t;){let t=0,a=0;for(var i=0;i<s.length;i++)s[i].est.L>t&&(t=s[i].est.L,a=i);if(t<n)break;const o=s[a],l=b(e,r,o.i0,o.i1,o.est.e,o.est.eMq255);if(o.i0>=l||o.i1<=l){o.est.L=0;continue}const c={i0:o.i0,i1:l,bst:null,est:null,tdst:0,left:null,right:null};c.bst=w(e,c.i0,c.i1),c.est=j(c.bst);const u={i0:l,i1:o.i1,bst:null,est:null,tdst:0,left:null,right:null};for(u.bst={R:[],m:[],N:o.bst.N-c.bst.N},i=0;i<16;i++)u.bst.R[i]=o.bst.R[i]-c.bst.R[i];for(i=0;i<4;i++)u.bst.m[i]=o.bst.m[i]-c.bst.m[i];u.est=j(u.bst),o.left=c,o.right=u,s[a]=c,s.push(u)}for(s.sort(((e,t)=>t.bst.N-e.bst.N)),i=0;i<s.length;i++)s[i].ind=i;return[a,s]}function v(e,t,n,r,a){if(null==e.left)return e.tdst=function(e,t,n,r,a){const s=t-e[0],i=n-e[1],o=r-e[2],l=a-e[3];return s*s+i*i+o*o+l*l}(e.est.q,t,n,r,a),e;const s=y(e.est,t,n,r,a);let i=e.left,o=e.right;s>0&&(i=e.right,o=e.left);const l=v(i,t,n,r,a);if(l.tdst<=s*s)return l;const c=v(o,t,n,r,a);return c.tdst<l.tdst?c:l}function y(e,t,n,r,a){const{e:s}=e;return s[0]*t+s[1]*n+s[2]*r+s[3]*a-e.eMq}function b(e,t,n,r,a,s){for(r-=4;n<r;){for(;x(e,n,a)<=s;)n+=4;for(;x(e,r,a)>s;)r-=4;if(n>=r)break;const i=t[n>>2];t[n>>2]=t[r>>2],t[r>>2]=i,n+=4,r-=4}for(;x(e,n,a)>s;)n-=4;return n+4}function x(e,t,n){return e[t]*n[0]+e[t+1]*n[1]+e[t+2]*n[2]+e[t+3]*n[3]}function w(e,t,n){const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=[0,0,0,0],s=n-t>>2;for(let i=t;i<n;i+=4){const t=e[i]*(1/255),n=e[i+1]*(1/255),s=e[i+2]*(1/255),o=e[i+3]*(1/255);a[0]+=t,a[1]+=n,a[2]+=s,a[3]+=o,r[0]+=t*t,r[1]+=t*n,r[2]+=t*s,r[3]+=t*o,r[5]+=n*n,r[6]+=n*s,r[7]+=n*o,r[10]+=s*s,r[11]+=s*o,r[15]+=o*o}return r[4]=r[1],r[8]=r[2],r[9]=r[6],r[12]=r[3],r[13]=r[7],r[14]=r[11],{R:r,m:a,N:s}}function j(e){const{R:t}=e,{m:n}=e,{N:r}=e,a=n[0],s=n[1],i=n[2],o=n[3],l=0==r?0:1/r,c=[t[0]-a*a*l,t[1]-a*s*l,t[2]-a*i*l,t[3]-a*o*l,t[4]-s*a*l,t[5]-s*s*l,t[6]-s*i*l,t[7]-s*o*l,t[8]-i*a*l,t[9]-i*s*l,t[10]-i*i*l,t[11]-i*o*l,t[12]-o*a*l,t[13]-o*s*l,t[14]-o*i*l,t[15]-o*o*l],u=c,d=N;let h=[Math.random(),Math.random(),Math.random(),Math.random()],p=0,m=0;if(0!=r)for(let g=0;g<16&&(h=d.multVec(u,h),m=Math.sqrt(d.dot(h,h)),h=d.sml(1/m,h),!(0!=g&&Math.abs(m-p)<1e-9));g++)p=m;const f=[a*l,s*l,i*l,o*l];return{Cov:c,q:f,e:h,L:p,eMq255:d.dot(d.sml(255,f),h),eMq:d.dot(h,f),rgba:(Math.round(255*f[3])<<24|Math.round(255*f[2])<<16|Math.round(255*f[1])<<8|Math.round(255*f[0]))>>>0}}var N={multVec:(e,t)=>[e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],e[4]*t[0]+e[5]*t[1]+e[6]*t[2]+e[7]*t[3],e[8]*t[0]+e[9]*t[1]+e[10]*t[2]+e[11]*t[3],e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]*t[3]],dot:(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],sml:(e,t)=>[e*t[0],e*t[1],e*t[2],e*t[3]]};yh.encode=function(e,t,n,r,a,s,i){null==r&&(r=0),null==i&&(i=!1);const o=u(e,t,n,r,[!1,!1,!1,0,i,!1]);return c(o,-1),l(o,t,n,a,s)},yh.encodeLL=function(e,t,n,r,a,s,i,o){const u={ctype:0+(1==r?0:2)+(0==a?0:4),depth:s,frames:[]},d=(r+a)*s,h=d*t;for(let l=0;l<e.length;l++)u.frames.push({rect:{x:0,y:0,width:t,height:n},img:new Uint8Array(e[l]),blend:0,dispose:1,bpp:Math.ceil(d/8),bpl:Math.ceil(h/8)});return c(u,0,!0),l(u,t,n,i,o)},yh.encode.compress=u,yh.encode.dither=o,yh.quantize=f,yh.quantize.getKDtree=g,yh.quantize.getNearest=v}();const bh={toArrayBuffer(e,t){const n=e.width,r=e.height,a=n<<2,s=e.getContext("2d").getImageData(0,0,n,r),i=new Uint32Array(s.data.buffer),o=(32*n+31)/32<<2,l=o*r,c=122+l,u=new ArrayBuffer(c),d=new DataView(u),h=1<<20;let p,m,f,g,v=h,y=0,b=0,x=0;function w(e){d.setUint16(b,e,!0),b+=2}function j(e){d.setUint32(b,e,!0),b+=4}function N(e){b+=e}w(19778),j(c),N(4),j(122),j(108),j(n),j(-r>>>0),w(1),w(32),j(3),j(l),j(2835),j(2835),N(8),j(16711680),j(65280),j(255),j(4278190080),j(1466527264),function e(){for(;y<r&&v>0;){for(g=122+y*o,p=0;p<a;)v--,m=i[x++],f=m>>>24,d.setUint32(g+p,m<<8|f),p+=4;y++}x<i.length?(v=h,setTimeout(e,bh._dly)):t(u)}()},toBlob(e,t){this.toArrayBuffer(e,(e=>{t(new Blob([e],{type:"image/bmp"}))}))},_dly:9};var xh={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},wh={[xh.CHROME]:16384,[xh.FIREFOX]:11180,[xh.DESKTOP_SAFARI]:16384,[xh.IE]:8192,[xh.IOS]:4096,[xh.ETC]:8192};const jh="undefined"!=typeof window,Nh="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,Sh=jh&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),kh=(jh||Nh)&&(Sh&&Sh.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),Eh=(jh||Nh)&&(Sh&&Sh.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function _h(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now();return new Promise((r=>{const a=e.split(","),s=a[0].match(/:(.*?);/)[1],i=globalThis.atob(a[1]);let o=i.length;const l=new Uint8Array(o);for(;o--;)l[o]=i.charCodeAt(o);const c=new Blob([l],{type:s});c.name=t,c.lastModified=n,r(c)}))}function Ch(e){return new Promise(((t,n)=>{const r=new Eh;r.onload=()=>t(r.result),r.onerror=e=>
vendor: 8,972 bytes, line 4
4n(e),r.readAsDataURL(e)}))}function Ah(e){return new Promise(((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=e=>n(e),r.src=e}))}function Th(){if(void 0!==Th.cachedResult)return Th.cachedResult;let e=xh.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=xh.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=xh.IOS:/Safari/i.test(t)?e=xh.DESKTOP_SAFARI:/Firefox/i.test(t)?e=xh.FIREFOX:(/MSIE/i.test(t)||1==!!document.documentMode)&&(e=xh.IE),Th.cachedResult=e,Th.cachedResult}function Rh(e,t){const n=Th(),r=wh[n];let a=e,s=t,i=a*s;const o=a>s?s/a:a/s;for(;i>r*r;){const e=(r+a)/2,t=(r+s)/2;e<t?(s=t,a=t*o):(s=e*o,a=e),i=a*s}return{width:a,height:s}}function Ph(e,t){let n,r;try{if(n=new OffscreenCanvas(e,t),r=n.getContext("2d"),null===r)throw new Error("getContext of OffscreenCanvas returns null")}catch(e){n=document.createElement("canvas"),r=n.getContext("2d")}return n.width=e,n.height=t,[n,r]}function Oh(e,t){const{width:n,height:r}=Rh(e.width,e.height),[a,s]=Ph(n,r);return t&&/jpe?g/.test(t)&&(s.fillStyle="white",s.fillRect(0,0,a.width,a.height)),s.drawImage(e,0,0,a.width,a.height),a}function Ih(){return void 0!==Ih.cachedResult||(Ih.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),Ih.cachedResult}function $h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(n,r){let a,s;var i=function(){try{return s=Oh(a,t.fileType||e.type),n([a,s])}catch(e){return r(e)}},o=function(t){try{var n=function(e){try{throw e}catch(e){return r(e)}};try{let t;return Ch(e).then((function(e){try{return t=e,Ah(t).then((function(e){try{return a=e,function(){try{return i()}catch(e){return r(e)}}()}catch(e){return n(e)}}),n)}catch(e){return n(e)}}),n)}catch(e){n(e)}}catch(e){return r(e)}};try{if(Ih()||[xh.DESKTOP_SAFARI,xh.MOBILE_SAFARI].includes(Th()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(e).then((function(e){try{return a=e,i()}catch(e){return o()}}),o)}catch(e){o()}}))}function Lh(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;return new Promise((function(s,i){let o;if("image/png"===t){let c,u,d;return c=e.getContext("2d"),({data:u}=c.getImageData(0,0,e.width,e.height)),d=yh.encode([u.buffer],e.width,e.height,4096*a),o=new Blob([d],{type:t}),o.name=n,o.lastModified=r,l.call(this)}{if("image/bmp"===t)return new Promise((t=>bh.toBlob(e,t))).then(function(e){try{return o=e,o.name=n,o.lastModified=r,h.call(this)}catch(e){return i(e)}}.bind(this),i);{if("function"==typeof OffscreenCanvas&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:a}).then(function(e){try{return o=e,o.name=n,o.lastModified=r,p.call(this)}catch(e){return i(e)}}.bind(this),i);{let m;return m=e.toDataURL(t,a),_h(m,n,r).then(function(e){try{return o=e,p.call(this)}catch(e){return i(e)}}.bind(this),i)}function p(){return h.call(this)}}function h(){return l.call(this)}}function l(){return s(o)}}))}function Fh(e){e.width=0,e.height=0}function Mh(){return new Promise((function(e,t){let n,r,a,s,i;return void 0!==Mh.cachedResult?e(Mh.cachedResult):(n="data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==",_h("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(n){try{return r=n,$h(r).then((function(n){try{return a=n[1],Lh(a,r.type,r.name,r.lastModified).then((function(n){try{return s=n,Fh(a),$h(s).then((function(n){try{return i=n[0],Mh.cachedResult=1===i.width&&2===i.height,e(Mh.cachedResult)}catch(e){return t(e)}}),t)}catch(e){return t(e)}}),t)}catch(e){return t(e)}}),t)}catch(e){return t(e)}}),t))}))}function Dh(e){return new Promise(((t,n)=>{const r=new Eh;r.onload=e=>{const n=new DataView(e.target.result);if(65496!=n.getUint16(0,!1))return t(-2);const r=n.byteLength;let a=2;for(;a<r;){if(n.getUint16(a+2,!1)<=8)return t(-1);const e=n.getUint16(a,!1);if(a+=2,65505==e){if(1165519206!=n.getUint32(a+=2,!1))return t(-1);const e=18761==n.getUint16(a+=6,!1);a+=n.getUint32(a+4,e);const r=n.getUint16(a,e);a+=2;for(let s=0;s<r;s++)if(274==n.getUint16(a+12*s,e))return t(n.getUint16(a+12*s+8,e))}else{if(65280!=(65280&e))break;a+=n.getUint16(a,!1)}}return t(-1)},r.onerror=e=>n(e),r.readAsArrayBuffer(e)}))}function Uh(e,t){const{width:n}=e,{height:r}=e,{maxWidthOrHeight:a}=t;let s,i=e;return isFinite(a)&&(n>a||r>a)&&([i,s]=Ph(n,r),n>r?(i.width=a,i.height=r/n*a):(i.width=n/r*a,i.height=a),s.drawImage(e,0,0,i.width,i.height),Fh(e)),i}function zh(e,t){const{width:n}=e,{height:r}=e,[a,s]=Ph(n,r);switch(t>4&&t<9?(a.width=r,a.height=n):(a.width=n,a.height=r),t){case 2:s.transform(-1,0,0,1,n,0);break;case 3:s.transform(-1,0,0,-1,n,r);break;case 4:s.transform(1,0,0,-1,0,r);break;case 5:s.transform(0,1,1,0,0,0);break;case 6:s.transform(0,1,-1,0,r,0);break;case 7:s.transform(0,-1,-1,0,r,n);break;case 8:s.transform(0,-1,1,0,0,n)}return s.drawImage(e,0,0,n,r),Fh(e),a}function qh(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return new Promise((function(r,a){let s,i,o,l,c,u,d,h,p,m,f,g,v,y,b,x,w,j,N,S;function k(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;if(t.signal&&t.signal.aborted)throw t.signal.reason;s+=e,t.onProgress(Math.min(s,100))}function E(e){if(t.signal&&t.signal.aborted)throw t.signal.reason;s=Math.min(Math.max(e,s),100),t.onProgress(s)}return s=n,i=t.maxIteration||10,o=1024*t.maxSizeMB*1024,k(),$h(e,t).then(function(n){try{return[,l]=n,k(),c=Uh(l,t),k(),new Promise((function(n,r){var a;if(!(a=t.exifOrientation))return Dh(e).then(function(e){try{return a=e,s.call(this)}catch(e){return r(e)}}.bind(this),r);function s(){return n(a)}return s.call(this)})).then(function(n){try{return u=n,k(),Mh().then(function(n){try{return d=n?c:zh(c,u),k(),h=t.initialQuality||1,p=t.fileType||e.type,Lh(d,p,e.name,e.lastModified,h).then(function(n){try{{if(m=n,k(),f=m.size>o,g=m.size>e.size,!f&&!g)return E(100),r(m);var s;function _(){if(i--&&(b>o||b>v)){let t,n;return t=S?.95*N.width:N.width,n=S?.95*N.height:N.height,[w,j]=Ph(t,n),j.drawImage(N,0,0,t,n),h*="image/png"===p?.85:.95,Lh(w,p,e.name,e.lastModified,h).then((function(e){try{return x=e,Fh(N),N=w,b=x.size,E(Math.min(99,Math.floor((y-b)/(y-o)*100))),_}catch(e){return a(e)}}),a)}return[1]}return v=e.size,y=m.size,b=y,N=d,S=!t.alwaysKeepResolution&&f,(s=function(e){for(;e;){if(e.then)return void e.then(s,a);try{if(e.pop){if(e.length)return e.pop()?C.call(this):e;e=_}else e=e.call(this)}catch(e){return a(e)}}}.bind(this))(_);function C(){return Fh(N),Fh(w),Fh(c),Fh(d),Fh(l),E(100),r(x)}}}catch(u){return a(u)}}.bind(this),a)}catch(e){return a(e)}}.bind(this),a)}catch(e){return a(e)}}.bind(this),a)}catch(e){return a(e)}}.bind(this),a)}))}let Bh;function Hh(e,t){return new Promise((function(n,r){let a,s,i,o,l,c;if(a={...t},i=0,({onProgress:o}=a),a.maxSizeMB=a.maxSizeMB||Number.POSITIVE_INFINITY,l="boolean"!=typeof a.useWebWorker||a.useWebWorker,delete a.useWebWorker,a.onProgress=e=>{i=e,"function"==typeof o&&o(i)},!(e instanceof Blob||e instanceof kh))return r(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return r(new Error("The file given is not an image"));if(c="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,!l||"function"!=typeof Worker||c)return qh(e,a).then(function(e){try{return s=e,h.call(this)}catch(e){return r(e)}}.bind(this),r);var u=function(){try{return h.call(this)}catch(e){return r(e)}}.bind(this),d=function(t){try{return qh(e,a).then((function(e){try{return s=e,u()}catch(e){return r(e)}}),r)}catch(e){return r(e)}};try{return a.libURL=a.libURL||"https://cdn.jsdelivr.net/npm/[email protected]/dist/browser-image-compression.js",function(e,t){return new Promise(((n,r)=>{Bh||(Bh=function(e){const t=[];return"function"==typeof e?t.push(`(${e})()`):t.push(e),URL.createObjectURL(new Blob(t))}("\nlet scriptImported = false\nself.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker]
4importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\n' + e.stack, id })\n }\n})\n"));const a=new Worker(Bh);a.addEventListener("message",(function(e){if(t.signal&&t.signal.aborted)a.terminate();else if(void 0===e.data.progress){if(e.data.error)return r(new Error(e.data.error)),void a.terminate();n(e.data.file),a.terminate()}else t.onProgress(e.data.progress)})),a.addEventListener("error",r),t.signal&&t.signal.addEventListener("abort",(()=>{r(t.signal.reason),a.terminate()})),a.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})}))}(e,a).then((function(e){try{return s=e,u()}catch(e){return d()}}),d)}catch(e){d()}function h(){try{s.name=e.name,s.lastModified=e.lastModified}catch(e){}try{a.preserveExif&&"image/jpeg"===e.type&&(!a.fileType||a.fileType&&a.fileType===e.type)&&(s=hh(e,s))}catch(e){}return n(s)}}))}Hh.getDataUrlFromFile=Ch,Hh.getFilefromDataUrl=_h,Hh.loadImage=Ah,Hh.drawImageInCanvas=Oh,Hh.drawFileInCanvas=$h,Hh.canvasToFile=Lh,Hh.getExifOrientation=Dh,Hh.handleMaxWidthOrHeight=Uh,Hh.followExifOrientation=zh,Hh.cleanupCanvasMemory=Fh,Hh.isAutoOrientationInBrowser=Mh,Hh.approximateBelowMaximumCanvasSizeOfBrowser=Rh,Hh.copyExifWithoutOrientation=hh,Hh.getBrowserName=Th,Hh.version="2.0.2";const Qh="https://animedb-production.up.railway.app",Wh=e=>{let{user:t,updateUser:n,setMessage:r}=e;const[a,s]=(0,_a.useState)({username:(null===t||void 0===t?void 0:t.username)||"",gender:(null===t||void 0===t?void 0:t.gender)||""}),[i,o]=(0,_a.useState)(null),[l,c]=(0,_a.useState)(null),u=(0,_a.useRef)(null),[d,h]=(0,_a.useState)(null),[p,m]=(0,_a.useState)(null),f=(0,_a.useRef)(null),[g,v]=(0,_a.useState)(0),[y,b]=(0,_a.useState)(0),[x,w]=(0,_a.useState)(!1);(0,_a.useEffect)((()=>{t&&s({username:t.username||"",gender:t.gender||""})}),[t]);const j=e=>{const{name:t,value:n}=e.target;s((e=>({...e,[t]:n})))};return(0,Ti.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),w(!0),r({type:"",text:""}),b(0),console.log("Form submission started");try{const e=new FormData;e.append("username",a.username),e.append("gender",a.gender),i&&(console.log("Adding profile image to form data:",i.name),e.append("profilePicture",i)),d&&(console.log("Adding hero image to form data:",d.name,`(${(d.size/1024/1024).toFixed(2)}MB)`),e.append("heroImage",d)),console.log("Sending request to:",`${Qh}/api/users/profile`);const t=await Gl.patch(`${Qh}/api/users/profile`,e,{headers:{"Content-Type":"multipart/form-data",Authorization:`Bearer ${localStorage.getItem("token")}`},timeout:6e4,onUploadProgress:e=>{const t=Math.round(100*e.loaded/e.total);b(t),console.log(`Upload progress: ${t}%`)}});console.log("Response received:",t.data),t.data.success&&(n(t.data.data),o(null),c(null),h(null),m(null),r({type:"success",text:"Profile updated successfully!"}))}catch(s){console.error("Failed to update settings:",s),console.error("Error code:",s.code),console.error("Error message:",s.message);let e="Failed to update settings";if("ECONNABORTED"===s.code)e="Request timed out. The image may be too large or the connection too slow.";else if(s.response){var t;e=(null===(t=s.response.data)||void 0===t?void 0:t.error)||e}r({type:"error",text:e})}finally{console.log("Form submission complete"),w(!1),b(0)}},className:"settings-form",children:[(0,Ti.jsxs)("div",{className:"settings-section",children:[(0,Ti.jsx)("h3",{children:"Profile Pictures"}),(0,Ti.jsxs)("div",{className:"profile-images",children:[(0,Ti.jsxs)("div",{className:"profile-image-section",children:[(0,Ti.jsx)("h4",{children:"Profile Picture"}),(0,Ti.jsxs)("div",{className:"profile-image-container",onClick:()=>{u.current.click()},children:[(0,Ti.jsx)("img",{src:l||(null===t||void 0===t?void 0:t.profilePicture),alt:"Profile",className:"profile-image"}),(0,Ti.jsx)("div",{className:"image-overlay",children:(0,Ti.jsx)("span",{children:"Change"})})]}
4),(0,Ti.jsx)("input",{type:"file",ref:u,onChange:e=>{if(e.target.files&&e.target.files[0]){const t=e.target.files[0];o(t);const n=new FileReader;n.onloadend=()=>{c(n.result)},n.readAsDataURL(t)}},accept:"image/*",style:{display:"none"}}),i&&(0,Ti.jsx)("div",{className:"selected-file",children:(0,Ti.jsx)("span",{children:i.name})})]}),(0,Ti.jsxs)("div",{className:"profile-image-section",children:[(0,Ti.jsx)("h4",{children:"Banner Image"}),(0,Ti.jsxs)("div",{className:"hero-image-container",onClick:()=>{f.current.click()},children:[(0,Ti.jsx)("img",{src:p||(null===t||void 0===t?void 0:t.heroImage),alt:"Banner",className:"hero-image"}),(0,Ti.jsx)("div",{className:"image-overlay",children:(0,Ti.jsx)("span",{children:"Change"})})]}),(0,Ti.jsx)("input",{type:"file",ref:f,onChange:async e=>{if(e.target.files&&e.target.files[0]){const n=e.target.files[0];console.log(`Original file: ${n.name}, size: ${(n.size/1024/1024).toFixed(2)}MB`);const a=new FileReader;a.onloadend=()=>{m(a.result),r({type:"info",text:"Optimizing image..."})},a.readAsDataURL(n);try{if(n.size>1048576){const e={maxSizeMB:.8,maxWidthOrHeight:1920,useWebWorker:!0,onProgress:e=>{v(e)}},t=await Hh(n,e);console.log(`Compressed file size: ${(t.size/1024/1024).toFixed(2)}MB`);const a=n.name.split(".").pop(),s=`hero-image-${Date.now()}.${a}`,i=new File([t],s,{type:t.type});h(i);const o=new FileReader;o.onloadend=()=>{m(o.result),r({type:"success",text:`Image optimized! Original: ${(n.size/1024/1024).toFixed(2)}MB, Compressed: ${(i.size/1024/1024).toFixed(2)}MB`}),setTimeout((()=>{r({type:"",text:""})}),5e3)},o.readAsDataURL(i)}else h(n),r({type:"info",text:"Image already optimized (under 1MB)"}),setTimeout((()=>{r({type:"",text:""})}),3e3)}catch(t){console.error("Error compressing image:",t),h(n),r({type:"warning",text:"Could not optimize image. Using original file."})}}},accept:"image/*",style:{display:"none"}}),d&&(0,Ti.jsxs)("div",{className:"selected-file",children:[(0,Ti.jsxs)("span",{children:[d.name," (",(d.size/1024/1024).toFixed(2),"MB)"]}),g>0&&g<100&&(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)("div",{className:"progress-container",children:(0,Ti.jsx)("div",{className:"progress-bar",style:{width:`${g}%`}})}),(0,Ti.jsxs)("div",{className:"progress-info",children:[(0,Ti.jsx)("span",{children:"Optimizing image..."}),(0,Ti.jsxs)("span",{children:[g,"%"]})]})]})]})]})]})]}),(0,Ti.jsxs)("div",{className:"settings-section",children:[(0,Ti.jsx)("h3",{children:"Personal Information"}),(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsx)("label",{htmlFor:"username",children:"Username"}),(0,Ti.jsx)("input",{type:"text",id:"username",name:"username",value:a.username,onChange:j,required:!0})]}),(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsx)("label",{htmlFor:"gender",children:"Gender"}),(0,Ti.jsxs)("select",{id:"gender",name:"gender",value:a.gender,onChange:j,children:[(0,Ti.jsx)("option",{value:"",children:"Prefer not to say"}),(0,Ti.jsx)("option",{value:"male",children:"Male"}),(0,Ti.jsx)("option",{value:"female",children:"Female"}),(0,Ti.jsx)("option",{value:"other",children:"Other"})]})]})]}),x&&y>0&&(0,Ti.jsxs)("div",{className:"settings-section",children:[(0,Ti.jsx)("h3",{children:"Uploading..."}),(0,Ti.jsx)("div",{className:"progress-container",children:(0,Ti.jsx)("div",{className:"progress-bar",style:{width:`${y}%`}})}),(0,Ti.jsxs)("div",{className:"progress-info",children:[(0,Ti.jsx)("span",{children:"Please wait while we update your profile"}),(0,Ti.jsxs)("span",{children:[y,"%"]})]})]}),(0,Ti.jsx)("div",{className:"form-actions",children:(0,Ti.jsx)("button",{type:"submit",className:"save-settings-btn",disabled:x,children:x?"Saving...":"Save Changes"})})]})},Vh=e=>{let{setMessage:t}=e;const[n,r]=(0,_a.useState)({currentPassword:"",newPassword:"",confirmPassword:""}),[a,s]=(0,_a.useState)(!1),[i,o]=(0,_a.useState)(!1),[l,c]=(0,_a.useState)(""),u=e=>{const{name:t,value:n}=e.target;r((e=>({...e,[t]:n})))};return(0,Ti.jsxs)("div",{className:"security-settings",children:[(0,Ti.jsx)("form",{onSubmit:async e=>{if(e.preventDefault(),s(!0),t({type:"",text:""}),n.newPassword!==n.confirmPassword)return t({type:"error",text:"New passwords do not match"}),void s(!1);
4try{(await Gl.patch("https://animedb-production.up.railway.app/api/users/profile",{password:n.newPassword},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")}`}})).data.success&&(r({currentPassword:"",newPassword:"",confirmPassword:""}),t({type:"success",text:"Password updated successfully!"}))}catch(o){var a,i;console.error("Failed to update password:",o),t({type:"error",text:(null===(a=o.response)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.error)||"Failed to update password"})}finally{s(!1),setTimeout((()=>{t({type:"",text:""})}),5e3)}},className:"settings-form",children:(0,Ti.jsxs)("div",{className:"settings-section",children:[(0,Ti.jsx)("h3",{children:"Change Password"}),(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsx)("label",{htmlFor:"currentPassword",children:"Current Password"}),(0,Ti.jsx)("input",{type:"password",id:"currentPassword",name:"currentPassword",value:n.currentPassword,onChange:u,required:!0})]}),(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsx)("label",{htmlFor:"newPassword",children:"New Password"}),(0,Ti.jsx)("input",{type:"password",id:"newPassword",name:"newPassword",value:n.newPassword,onChange:u,required:!0,minLength:"10"}),(0,Ti.jsx)("small",{className:"form-hint",children:"Password must be at least 10 characters long and include uppercase, lowercase, numbers, and special characters."})]}),(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsx)("label",{htmlFor:"confirmPassword",children:"Confirm New Password"}),(0,Ti.jsx)("input",{type:"password",id:"confirmPassword",name:"confirmPassword",value:n.confirmPassword,onChange:u,required:!0})]}),(0,Ti.jsx)("div",{className:"form-actions",children:(0,Ti.jsx)("button",{type:"submit",className:"save-settings-btn",disabled:a,children:a?"Updating...":"Update Password"})})]})}),(0,Ti.jsxs)("div",{className:"settings-section",children:[(0,Ti.jsx)("h3",{children:"Account Actions"}),(0,Ti.jsxs)("div",{className:"danger-zone",children:[(0,Ti.jsx)("h4",{children:"Delete Account"}),(0,Ti.jsx)("p",{className:"danger-text",children:"Permanently delete your account and all associated data. This action cannot be undone."}),i?(0,Ti.jsxs)("div",{className:"delete-confirmation",children:[(0,Ti.jsx)("p",{children:'To confirm, type "DELETE" in the field below:'}),(0,Ti.jsx)("input",{type:"text",value:l,onChange:e=>c(e.target.value),placeholder:"Type DELETE to confirm"}),(0,Ti.jsxs)("div",{className:"confirmation-actions",children:[(0,Ti.jsx)("button",{type:"button",className:"cancel-delete-btn",onClick:()=>{o(!1),c("")},children:"Cancel"}),(0,Ti.jsx)("button",{type:"button",className:"confirm-delete-btn",disabled:"DELETE"!==l,onClick:()=>{t({type:"warning",text:"This is a demo feature. In a real implementation, your account would be deleted."}),o(!1),c("")},children:"Permanently Delete Account"})]})]}):(0,Ti.jsx)("button",{type:"button",className:"delete-account-btn",onClick:()=>o(!0),children:"Delete Account"})]})]})]})},Kh=e=>{let{setMessage:t}=e;const[n,r]=(0,_a.useState)({publicProfile:!0,showActivity:!0,showLists:!0}),[a,s]=(0,_a.useState)("all"),[i,o]=(0,_a.useState)(!1),l=e=>{const{name:t,checked:n}=e.target;r((e=>({...e,[t]:n})))};return(0,Ti.jsxs)("div",{className:"privacy-settings",children:[(0,Ti.jsxs)("div",{className:"settings-section",children:[(0,Ti.jsx)("h3",{children:"Privacy Settings"}),(0,Ti.jsx)("p",{className:"section-description",children:"Control who can see your profile and activity."}),(0,Ti.jsxs)("div",{className:"checkbox-group",children:[(0,Ti.jsxs)("label",{className:"checkbox-label",children:[(0,Ti.jsx)("input",{type:"checkbox",name:"publicProfile",checked:n.publicProfile,onChange:l}),(0,Ti.jsx)("span",{children:"Public Profile"})]}),(0,Ti.jsx)("small",{children:"Allow other users to view your profile information"})]}),(0,Ti.jsxs)("div",{className:"checkbox-group",children:[(0,Ti.jsxs)("label",{className:"checkbox-label",children:[(0,Ti.jsx)("input",{type:"checkbox",name:"showActivity",checked:n.showActivity,onChange:l}),(0,Ti.jsx)("span",{children:"Show Activity"})]}),(0,Ti.jsx)("small",{children:"Display your recent activity on your profile page"})]}),(0,Ti.jsxs)("div",{className:"checkbox-group",children:[(0,Ti.jsxs)("label",{className:"checkbox-label",children:[(0,Ti.jsx)("input",{type:"checkbox",name:"showLists",checked:n.showLists,onChange:l}),(0,Ti.jsx)("span",{children:"Public Lists"})]}),(0,Ti.jsx)("small",{children:"Make your anime and manga lists visible to other users"})]}),(0,Ti.jsx)("div",{className:"form-actions",children:(0,Ti.jsx)("button",{type:"button",className:"save-settings-btn",onClick:()=>{t({type:"success",text:"Privacy settings saved successfully!"}),setTimeout((()=>{t({type:"",text:""})}),5e3)},children:"Save Privacy Settings"})})]}),(0,Ti.jsxs)("div",{className:"settings-section",children:[(0,Ti.jsx)("h3",{children:"Data Export"}),(0,Ti.jsx)("p",{className:"section-description",children:"Export a copy of your data for personal backup or to use on another platform."}),(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsx)("label",{htmlFor:"exportType",children:"Select data to export"}),(0,Ti.jsxs)("select",{id:"exportType",value:a,onChange:e=>s(e.target.value),children:[(0,Ti.jsx)("option",{value:"all",children:"All my data"}),(0,Ti.jsx)("option",{value:"anime",children:"Anime lists only"}),(0,Ti.jsx)("option",{value:"manga",children:"Manga lists only"}),(0,Ti.jsx)("option",{value:"reviews",children:"Reviews only"})]})]}),(0,Ti.jsx)("div",{className:"export-actions",children:(0,Ti.jsx)("button",{type:"button",className:"export-btn",onClick:()=>{o(!0),setTimeout((()=>{o(!1),t({type:"success",text:`${"all"===a?"All data":a} exported successfully! Check your email.`}),setTimeout((()=>{t({type:"",text:""})}),5e3)}),2e3)},disabled:i,children:i?(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)("span",{className:"loading-spinner-small"}),"Preparing Export..."]}):"Export Data"})})]})]})},Gh=e=>{let{setMessage:t}=e;const[n,r]=(0,_a.useState)({emailNotifications:!0,activityUpdates:!0,newFeatures:!0,commentReplies:!0,listUpdates:!1}),a=e=>{const{name:t,checked:n}=e.target;r((e=>({...e,[t]:n})))};return(0,Ti.jsxs)("div",{className:"notification-settings",children:[(0,Ti.jsxs)("div",{className:"settings-section",children:[(0,Ti.jsx)("h3",{children:"Email Notifications"}),(0,Ti.jsx)("p",{className:"section-description",children:"Control what notifications you receive via email."}),(0,Ti.jsxs)("div",{className:"checkbox-group",children:[(0,Ti.jsxs)("label",{className:"checkbox-label",children:[(0,Ti.jsx)("input",{type:"checkbox",name:"emailNotifications",checked:n.emailNotifications,onChange:a}),(0,Ti.jsx)("span",{children:"Email Notifications"})]}),(0,Ti.jsx)("small",{children:"Receive important updates and announcements via email"})]}),(0,Ti.jsxs)("div",{className:"checkbox-group",children:[(0,Ti.jsxs)("label",{className:"checkbox-label",children:[(0,Ti.jsx)("input",{type:"checkbox",name:"activityUpdates",checked:n.activityUpdates,onChange:a}),(0,Ti.jsx)("span",{children:"Activity Updates"})]}),(0,Ti.jsx)("small",{children:"Get notified about new comments and interactions"})]}),(0,Ti.jsxs)("div",{className:"checkbox-group",children:[(0,Ti.jsxs)("label",{className:"checkbox-label",children:[(0,Ti.jsx)("input",{type:"checkbox",name:"newFeatures",checked:n.newFeatures,onChange:a}),(0,Ti.jsx)("span",{children:"New Features"})]}),(0,Ti.jsx)("small",{children:"Stay updated on new site features and improvements"})]})]}),(0,Ti.jsxs)("div",{className:"settings-section",children:[(0,Ti.jsx)("h3",{children:"Social Notifications"}),(0,Ti.jsx)("p",{className:"section-description",children:"Control notifications about social interactions."}),(0,Ti.jsxs)("div",{className:"checkbox-group",children:[(0,Ti.jsxs)("label",{className:"checkbox-label",children:[(0,Ti.jsx)("input",{type:"checkbox",name:"commentReplies",checked:n.commentReplies,onChange:a}),(0,Ti.jsx)("span",{children:"Comment Replies"})]}),(0,Ti.jsx)("small",{children:"Get notified when someone replies to your comments"})]}),(0,Ti.jsxs)("div",{className:"checkbox-group",children:[(0,Ti.jsxs)("label",{className:"checkbox-label",children:[(0,Ti.jsx)("input",{type:"checkbox",name:"listUpdates",checked:n.listUpdates,onChange:a}),(0,Ti.jsx)("span",{children:"List Updates"})]}),(0,Ti.jsx)("small",{children:"Get notified when friends update their anime/manga lists"})]})]}),(0,Ti.jsxs)("div",{className:"settings-section notification-info",children:[(0,Ti.jsx)("h4",{children:"Coming Soon"}),(0,Ti.jsx)("p",{children:"Push notifications and additional notification options will be available in future updates."})]}),(0,Ti.jsx)("div",{className:"form-actions",children:(0,Ti.jsx)("button",{type:"button",className:"save-settings-btn",onClick:()=>{t({type:"success",text:"Notification preferences updated successfully!"}),setTimeout((()=>{t({type:"",text:""})}),5e3)},children:"Save Notification Settings"})})]})},Yh=()=>{const{user:e,updateUser:t}=ec(),[n,r]=(0,_a.useState)("profile"),[a,s]=(0,_a.useState)({type:"",text:""});return(0,Ti.jsxs)("div",{className:"settings-container",children:[(0,Ti.jsxs)("div",{className:"settings-page-title-container",children:[(0,Ti.jsx)("h1",{className:"settings-page-title",children:"Settings"}),(0,Ti.jsx)("p",{className:"settings-page-subtitle",children:"Customize your account preferences and privacy options"})]}),a.text&&(0,Ti.jsx)("div",{className:`settings-message ${a.type}`,children:a.text}),(0,Ti.jsxs)("div",{className:"settings-layout",children:[(0,Ti.jsx)("div",{className:"settings-sidebar",children:(0,Ti.jsxs)("ul",{className:"settings-menu",children:[(0,Ti.jsx)("li",{className:"profile"===n?"active":"",children:(0,Ti.jsxs)("button",{onClick:()=>r("profile"),children:[(0,Ti.jsx)("span",{className:"icon profile-icon"}),"Profile"]})}),(0,Ti.jsx)("li",{className:"security"===n?"active":"",children:(0,Ti.jsxs)("button",{onClick:()=>r("security"),children:[(0,Ti.jsx)("span",{className:"icon security-icon"}
4),"Security"]})}),(0,Ti.jsx)("li",{className:"privacy"===n?"active":"",children:(0,Ti.jsxs)("button",{onClick:()=>r("privacy"),children:[(0,Ti.jsx)("span",{className:"icon privacy-icon"}),"Privacy & Data"]})}),(0,Ti.jsx)("li",{className:"notifications"===n?"active":"",children:(0,Ti.jsxs)("button",{onClick:()=>r("notifications"),children:[(0,Ti.jsx)("span",{className:"icon notifications-icon"}),"Notifications"]})})]})}),(0,Ti.jsx)("div",{className:"settings-content",children:(()=>{switch(n){case"profile":return(0,Ti.jsx)(Wh,{user:e,updateUser:t,setMessage:s});case"security":return(0,Ti.jsx)(Vh,{setMessage:s});case"privacy":return(0,Ti.jsx)(Kh,{setMessage:s});case"notifications":return(0,Ti.jsx)(Gh,{setMessage:s});default:return(0,Ti.jsx)("div",{className:"settings-default",children:(0,Ti.jsx)("p",{children:"Select a settings category from the left menu."})})}})()})]})]})};var Jh=class extends kc{#l;#N=void 0;#X;#Z;constructor(e,t){super(),this.#l=e,this.setOptions(t),this.bindMethods(),this.#ee()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#l.defaultMutationOptions(e),fc(this.options,t)||this.#l.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#X,observer:this}),t?.mutationKey&&this.options.mutationKey&&hc(t.mutationKey)!==hc(this.options.mutationKey)?this.reset():"pending"===this.#X?.state.status&&this.#X.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#X?.removeObserver(this)}onMutationUpdate(e){this.#ee(),this.#z(e)}getCurrentResult(){return this.#N}reset(){this.#X?.removeObserver(this),this.#X=void 0,this.#ee(),this.#z()}mutate(e,t){return this.#Z=t,this.#X?.removeObserver(this),this.#X=this.#l.getMutationCache().build(this.#l,this.options),this.#X.addObserver(this),this.#X.execute(e)}#ee(){const e=this.#X?.state??{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};this.#N={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#z(e){Sc.batch((()=>{if(this.#Z&&this.hasListeners()){const t=this.#N.variables,n=this.#N.context;"success"===e?.type?(this.#Z.onSuccess?.(e.data,t,n),this.#Z.onSettled?.(e.data,null,t,n)):"error"===e?.type&&(this.#Z.onError?.(e.error,t,n),this.#Z.onSettled?.(void 0,e.error,t,n))}this.listeners.forEach((e=>{e(this.#N)}))}))}};function Xh(e,t){const n=Qc(t),[r]=_a.useState((()=>new Jh(n,e)));_a.useEffect((()=>{r.setOptions(e)}),[r,e]);const a=_a.useSyncExternalStore(_a.useCallback((e=>r.subscribe(Sc.batchCalls(e))),[r]),(()=>r.getCurrentResult()),(()=>r.getCurrentResult())),s=_a.useCallback(((e,t)=>{r.mutate(e,t).catch(Qu)}),[r]);if(a.error&&Hu(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:s,mutateAsync:a.mutate}}const Zh="https://animedb-production.up.railway.app",ep=e=>{let{userId:t}=e;const{isLoggedIn:n,user:r}=ec(),[a,s]=(0,_a.useState)(!1),i=Qc(),o=localStorage.getItem("token"),l=(null===r||void 0===r?void 0:r.id)===t,{data:c,isLoading:u}=td({queryKey:["friendshipStatus",t],queryFn:()=>(async(e,t)=>{try{const n=((await Gl.get(`${Zh}/api/friends`,{headers:{Authorization:`Bearer ${t}`}})).data.data||[]).find((t=>String(t.user.id)===String(e)||t.user._id&&String(t.user._id)===String(e)));if(n)return{status:"friends",friendshipId:n.friendshipId};const r=((await Gl.get(`${Zh}/api/friends/sent`,{headers:{Authorization:`Bearer ${t}`}})).data.data||[]).find((t=>t.recipient.id===e));if(r)return{status:"sent",requestId:r.id};const a=((await Gl.get(`${Zh}/api/friends/pending`,{headers:{Authorization:`Bearer ${t}`}})).data.data||[]).find((t=>t.requester.id===e));return a?{status:"pending",requestId:a.id}:{status:"none"}}catch(n){return console.error("Error checking friendship status:",n),{status:"error"}}})(t,o),enabled:n&&!!t&&!l}),d=Xh({mutationFn:async()=>{s(!0);try{return(await Gl.post(`${Zh}/api/friends/${t}`,{},{headers:{Authorization:`Bearer ${o}`}})).data}catch(e){throw console.error("Error sending friend request:",e),e}finally{s(!1)}},onSuccess:()=>{i.invalidateQueries(["friendshipStatus",t])}}),h=Xh({mutationFn:async e=>{s(!0);try{return(await Gl.patch(`${Zh}/api/friends/${e}`,{status:"accepted"},{headers:{Authorization:`Bearer ${o}`}})).data}catch(t){throw console.error("Error accepting friend request:",t),t}finally{s(!1)}},onSuccess:()=>{i.invalidateQueries(["friendshipStatus",t]),i.invalidateQueries(["friends"]),i.invalidateQueries(["friendRequests","pen
4ding"])}}),p=Xh({mutationFn:async e=>{s(!0);try{return(await Gl.delete(`${Zh}/api/friends/${e}`,{headers:{Authorization:`Bearer ${o}`}})).data}catch(t){throw console.error("Error removing friend/canceling request:",t),t}finally{s(!1)}},onSuccess:()=>{i.invalidateQueries(["friendshipStatus",t]),i.invalidateQueries(["friends"]),i.invalidateQueries(["friendRequests","sent"])}});return!n||l?null:u||a?(0,Ti.jsx)("button",{className:"friend-button loading",disabled:!0,children:"Loading..."}):"friends"===(null===c||void 0===c?void 0:c.status)?(0,Ti.jsx)("div",{className:"friend-status-container",children:(0,Ti.jsx)("button",{className:"friend-button is-friend",onClick:()=>p.mutate(c.friendshipId),children:"\u2713 Friends \u2022 Remove"})}):"sent"===(null===c||void 0===c?void 0:c.status)?(0,Ti.jsx)("button",{className:"friend-button request-sent",onClick:()=>p.mutate(c.requestId),children:"Cancel Request"}):"pending"===(null===c||void 0===c?void 0:c.status)?(0,Ti.jsx)("button",{className:"friend-button accept-request",onClick:()=>h.mutate(c.requestId),children:"Accept Request"}):(0,Ti.jsx)("button",{className:"friend-button add-friend",onClick:()=>d.mutate(),children:"Add Friend"})},tp="https://animedb-production.up.railway.app",np=async e=>{let{userId:t,status:n}=e;if(!t)return[];try{const e=n?`${tp}/api/user/anime/users/${t}/status/${n}`:`${tp}/api/user/anime/users/${t}`,r=await Gl.get(e);return r.data&&r.data.success&&r.data.data||[]}catch(s){var r,a;const e=s.response?`Server responded with ${s.response.status}: ${(null===(r=s.response.data)||void 0===r?void 0:r.error)||"Unknown error"}`:s.message||"Network error";if(console.error(`Error fetching ${n||"all"} anime for user ${t}: ${e}`),404===(null===(a=s.response)||void 0===a?void 0:a.status)&&!n){console.warn("Trying fallback approach for anime data...");try{const e=["watching","completed","planning","onHold","dropped"];let n=[];for(const r of e)try{const e=`${tp}/api/user-anime/users/${t}/status/${r}`,a=await Gl.get(e);a.data&&a.data.success&&(n=[...n,...a.data.data||[]])}catch(i){}return n}catch(o){console.error("Fallback approach for anime data failed:",o)}}return[]}},rp=async e=>{let{userId:t,status:n}=e;if(!t)return[];try{const e=n?`${tp}/api/user/manga/users/${t}/status/${n}`:`${tp}/api/user/manga/users/${t}`,r=await Gl.get(e);return r.data&&r.data.success&&r.data.data||[]}catch(s){var r,a;const e=s.response?`Server responded with ${s.response.status}: ${(null===(r=s.response.data)||void 0===r?void 0:r.error)||"Unknown error"}`:s.message||"Network error";if(console.error(`Error fetching ${n||"all"} manga for user ${t}: ${e}`),404===(null===(a=s.response)||void 0===a?void 0:a.status)&&!n){console.warn("Trying fallback approach for manga data...");try{const e=["reading","completed","planning","onHold","dropped"];let n=[];for(const r of e)try{const e=`${tp}/api/user/manga/users/${t}/status/${r}`,a=await Gl.get(e);a.data&&a.data.success&&(n=[...n,...a.data.data||[]])}catch(i){}return n}catch(o){console.error("Fallback approach for manga data failed:",o)}}return[]}},ap=()=>{const{userId:e}=(0,ki.g)(),t=(0,ki.Zp)(),[n,r]=(0,_a.useState)("108, 92, 231"),[a,s]=(0,_a.useState)("anime"),[i,o]=(0,_a.useState)("watching"),[l,c]=(0,_a.useState)("reading"),[u,d]=(0,_a.useState)(window.innerWidth<=768),[h,p]=(0,_a.useState)(0),[m,f]=(0,_a.useState)(!1),{data:g,isLoading:v,isError:y}=td({queryKey:["publicUserData",e],queryFn:()=>(async e=>{try{return(await Gl.get(`${tp}/api/users/${e}`)).data.data}catch(t){throw console.error("Error fetching user data:",t),t}})(e),enabled:!!e,staleTime:6e5});(0,_a.useEffect)((()=>{if(!g||!g.profilePicture)return;const e=new Image;e.crossOrigin="Anonymous",e.onload=()=>{const t=(e=>{const t=document.createElement("canvas"),n=t.getContext("2d");t.width=e.naturalWidth||e.width,t.height=e.naturalHeight||e.height,n.drawImage(e,0,0,t.width,t.height);try{const e=n.getImageData(0,0,t.width,t.height).data,r={},a=Math.max(1,Math.floor(e.length/4/1e4));for(let t=0;t<e.length;t+=4*a){if(e[t+3]<128)continue;const n=10*Math.floor(e[t]/10),a=`${n},${10*Math.floor(e[t+1]/10)},${10*Math.floor(e[t+2]/10)}`;r[a]=(r[a]||0)+1}let s=0,i="108, 92, 231";for(const t in r)r[t]>s&&(s=r[t],i=t);return i}catch(gh){return console.error("Error extracting dominant color:",gh),"108, 92, 231"}})(e);r(t);const n=document.querySelector(".profile-photo");n&&n.style.setProperty("--profile-glow-color",t)},e.onerror=e=>{console.error("Error loading image for color extraction:",e)},e.src=g.profilePicture}),[g]);const{data:b=[],isLoading:x}=td({queryKey:["publicAnimeData",e,"watching"],queryFn:()=>np({userId:e,status:"watching"}),enabled:!!e&&"anime"===a,staleTime:3e5}),{data:w=[],isLoading:j}=td({queryKey:["publicAnimeData",e,"completed"],queryFn:()=>np({userId:e,status:"completed"}),enabled:!!e&&"anime"===a&&"completed"===i,staleTime:3e5}),{data:N=[],isLoading:S}=td({queryKey:["publicAnimeData",e,"planning"],queryFn:()=>np({userId:e,status:"planning"}),enabled:!!e&&"anime"===a&&"planning"===i,staleTime:3e5}),{data:k=[],isLoading:E}=td({queryKey:["publicAnimeData",e,"onHold"],queryFn:()=>np({userId:e,status:"onHold"}),enabled:!!e&&"anime"===a&&"onHold"===i,staleTime:3e5}),{data:_=[],isLoading:C}=td({queryKey:["publicAnimeData",e,"dropped"],queryFn:()=>np({userId:e,status:"dropped"}),enabled:!!e&&"anime"===a&&"dropped"===i,staleTime:3e5}),{data:A=[],isLoading:T}=td({queryKey:["publicMangaData",e,"reading"],queryFn:()=>rp({userId:e,status:"reading"}),enabled:!!e&&"manga"===a,staleTime:3e5}),{data:R=[],isLoading:P}=td({queryKey:["publicMangaData",e,"completed"],queryFn:()=>rp({userId:e,status:"completed"}),enabled:!!e&&"manga"===a&&"completed"===l,staleTime:3e5}),{data:O=[],isLoading:I}=td({queryKey:["publicMangaData",e,"planning"],queryFn:()=>rp({userId:e,status:"planning"}),enabled:!!e&&"manga"===a&&"planning"===l,staleTime:3e5}),{data:$=[],isLoading:L}=td({queryKey:["publicMangaData",e,"onHold"],queryFn:()=>rp({userId:e,status:"onHold"}),enabled:!!e&&"manga"===a&&"onHold"===l,staleTime:3e5}),{data:F=[],isLoading:M}=td({queryKey:["publicMangaData",e,"dropped"],queryFn:()=>rp({userId:e,status:"dropped"}),enabled:!!e&&"manga"===a&&"dropped"===l,staleTime:3e5}),{data:D=[],isLoading:U}=td({queryKey:["publicFavoriteCharacters",e],queryFn:()=>(async e=>{if(!e)return[];try{const t=await Gl.get(`${tp}/api/user/characters/users/${e}/favorites`);return t.data&&t.data.success&&t.data.data||[]}catch(a){var t,n;const i=a.response?`Server responded with ${a.response.status}: ${(null===(t=a.response.data)||void 0===t?void 0:t.error)||"Unknown error"}`:a.message||"Network error";if(console.error(`Error fetching favorite characters for user ${e}: ${i}`),404===(null===(n=a.response)||void 0===n?void 0:n.status))try{const t=await Gl.get(`${tp}/api/user/characters/users/${e}/favorites`);var r;if(t.data&&t.data.success)return(null===(r=t.data.data)||void 0===r?void 0:r.filter((e=>e.isFavorite)))||[]}catch(s){console.error("Fallback approach for character data failed:",s)}return[]}})(e),enabled:!!e&&"characters"===a,staleTime:3e5}),{data:z}=td({queryKey:["publicAnimeStats",e],queryFn:()=>(async e=>{if(!e)return null;try{var t;return(null===(t=(await Gl.get(`${tp}/api/user/anime/users/${e}/stats`)).data)||void 0===t?void 0:t.data)||null}catch(r){if(r.response&&404===r.response.status){console.warn("Anime stats endpoint not available, calculating basic stats from collections");try{var n;const t=(null===(n=(await Gl.get(`${tp}/api/user-anime/users/${e}`)).data)||void 0===n?void 0:n.data)||[],r=t.length;return{totalAnime:r,completedAnime:t.filter((e=>"completed"===e.status)).length,watchingAnime:t.filter((e=>"watching"===e.status)).length}}catch(a){return console.error(`Failed to calculate fallback anime stats: ${a.message}`),null}}return console.error(`Error fetching anime stats for user ${e}:`,r),null}})(e),enabled:!!e,staleTime:6e5}),{data:q}=td({queryKey:["publicMangaStats",e],queryFn:()=>(async e=>{if(!e)return null;try{var t;return(null===(t=(await Gl.get(`${tp}/api/user/manga/users/${e}/stats`)).data)||void 0===t?void 0:t.data)||null}catch(r){if(r.response&&404===r.response.status){console.warn("Manga stats endpoint not available, calculating basic stats from collections");try{var n;const t=(null===(n=(await Gl.get(`${tp}/api/user/manga/users/${e}`)).data)||void 0===n?void 0:n.data)||[],r=t.length;return{totalManga:r,completedManga:t.filter((e=>"completed"===e.status)).length,readingManga:t.filter((e=>"reading"===e.status)).length}}catch(a){return console.error(`Failed to calculate fallback manga stats: ${a.message}`),null}}return console.error(`Error fetching manga stats for user ${e}:`,r),null}})(e),enabled:!!e,staleTime:6e5}),{data:B}=td({queryKey:["publicCharacterStats",e],queryFn:()=>(async e=>{if(!e)return null;try{var t;return(null===(t=(await Gl.get(`${tp}/api/user/characters/users/${e}/stats`)).data)||void 0===t?void 0:t.data)||null}catch(r){if(r.response&&404===r.response.status){console.warn("Character stats endpoint not available, using character list length");try{var n;const t=(null===(n=(await Gl.get(`${tp}/api/user/characters/users/${e}/favorites`)).data)||void 0===n?void 0:n.data)||[];return{totalCharacters:t.length,favoriteCharacters:t.length}}catch(a){return console.error(`Failed to calculate fallback character stats: ${a.message}`),null}}return console.error(`Error fetching character stats for user ${e}:`,r),null}})(e),enabled:!!e,staleTime:6e5}),H={watching:b,completed:w,planning:N,onHold:k,dropped:_},Q={reading:A,completed:R,planning:O,onHold:$,dropped:F},W=[{key:"watching",label:"Watching"},{key:"completed",label:"Completed"},{key:"planning",label:"Planning"},{key:"onHold",label:"On Hold"},{key:"dropped",label:"Dropped"}],V=[{key:"reading",label:"Reading"},{key:"completed",label:"Completed"},{key:"planning",label:"Planning"},{key:"onHold",label:"On Hold"},{key:"dropped",label:"Dropped"}],K="watching"===i&&x||"completed"===i&&j||"planning"===i&&S||"onHold"===i&&E||"dropped"===i&&C,G="reading"===l&&T||"completed"===l&&P||"planning"===l&&I||"onHold"===l&&L||"dropped"===l&&M,Y=()=>((null===b||void 0===b?void 0:b.length)||0)+((null===w||void 0===w?void 0:w.length)||0)+((null===N||void 0===N?void 0:N.length)||0)+((null===k||void 0===k?void 0:k.length)||0)+((null===_||void 0===_?void 0:_.length)||0),J=()=>((null===A||void 0===A?void 0:A.length)||0)+((null===R||void 0===R?void 0:R.length)||0)+((null===O||void 0===O?void 0:O.length)||0)+((null===$||void 0===$?void 0:$.length)||0)+((null===F||void 0===F?void 0:F.length)||0);(0,_a.useEffect)((()=>{const e=()=>{d(window.innerWidth<=768)},t=()=>{p(window.scrollY)};return window.addEventListener("resize",e),window.addEventListener("scroll",t),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",t)}}),[]);const X=()=>{f((e=>!e))};if(y)return(0,Ti.jsxs)("div",{className:"empty-collection",children:[(0,Ti.jsx)("div",{className:"empty-icon",children:"\ud83d\udd0d"}),(0,Ti.jsx)("h3",{children:"User Not Found"}),(0,Ti.jsx)("p",{children:"We couldn't find a user with that ID. They may have deleted their account or the URL might be incorrect."}),(0,Ti.jsx)("button",{onClick:()=>t(-1),className:"action-button",style:{marginTop:"20px",width:"auto"},children:"Go Back"})]});if(v)return(0,Ti.jsxs)("div",{className:"loading-collection",children:[(0,Ti.jsx)("div",{className:"loading-spinner"}),(0,Ti.jsx)("p",{children:"Loading profile..."})]});const Z=h>100?"sticky-header":"";return(0,Ti.jsxs)("div",{className:"profile-container",children:[u&&(0,Ti.jsxs)("div",{className:`mobile-profile-header ${Z}`,children:[(0,Ti.jsx)("button",{className:"sidebar-toggle",onClick:X,"aria-label":m?"Close sidebar":"Open sidebar",children:m?"\xd7":"\u2630"}),(0,Ti.jsx)("div",{className:"mobile-username",children:(0,Ti.jsxs)("h1",{children:[g.username,"'s Profile"]})})]}),(0,Ti.jsxs)("div",{className:"profile-layout",children:[(0,Ti.jsxs)("div",{className:"profile-sidebar "+(m?"open":""),children:[u&&(0,Ti.jsx)("div",{className:"sidebar-toggle-container",children:(0,Ti.jsx)("button",{className:"sidebar-toggle",onClick:X,"aria-label":"Close sidebar",children:"\xd7"})}),(0,Ti.jsxs)("div",{className:"sidebar-header",children:[(0,Ti.jsx)("div",{className:"profile-photo",children:(0,Ti.jsx)("img",{src:g.profilePicture,alt:g.username})}),(0,Ti.jsxs)("div",{className:"profile-username",children:[(0,Ti.jsx)("h1",{children:g.username}),(0,Ti.jsx)(ep,{userId:e})]})]}),(0,Ti.jsxs)("div",{className:"info-card",children:[(0,Ti.jsx)("h2",{children:"Stats"}),(0,Ti.jsxs)("div",{className:"stats-grid",children:[(0,Ti.jsxs)("div",{className:"stat-item",children:[(0,Ti.jsx)("span",{className:"stat-number",children:(null===z||void 0===z?void 0:z.totalAnime)||Y()}),(0,Ti.jsx)("span",{className:"stat-label",children:"Anime"})]}),(0,Ti.jsxs)("div",{className:"stat-item",children:[(0,Ti.jsx)("span",{className:"stat-number",children:(null===q||void 0===q?void 0:q.totalManga)||J()}),(0,Ti.jsx)("span",{className:"stat-label",children:"Manga"})]}),(0,Ti.jsxs)("div",{className:"stat-item",children:[(0,Ti.jsx)("span",{className:"stat-number",children:(null===z||void 0===z?void 0:z.completedAnime)||(null===w||void 0===w?void 0:w.length)||0}),(0,Ti.jsx)("span",{className:"stat-label",children:"Completed Anime"})]}),(0,Ti.jsxs)("div",{className:"stat-item",children:[(0,Ti.jsx)("span",{className:"stat-number",children:(null===q||void 0===q?void 0:q.completedManga)||(null===R||void 0===R?void 0:R.length)||0}),(0,Ti.jsx)("span",{className:"stat-label",children:"Completed Manga"})]}),(0,Ti.jsxs)("div",{className:"stat-item",children:[(0,Ti.jsx)("span",{className:"stat-number",children:(null===B||void 0===B?void 0:B.totalCharacters)||(null===D||void 0===D?void 0:D.length)||0}),(0,Ti.jsx)("span",{className:"stat-label",children:"Favorite Characters"})]})]})]}),(null===g||void 0===g?void 0:g.socialLinks)&&Object.values(g.socialLinks).some((e=>e))&&(0,Ti.jsxs)("div",{className:"info-card",children:[(0,Ti.jsx)("h2",{children:"Social Links"}),(0,Ti.jsxs)("div",{className:"social-links",children:[g.socialLinks.twitter&&(0,Ti.jsxs)("a",{href:g.socialLinks.twitter,target:"_blank",rel:"noopener noreferrer",className:"social-link",children:[(0,Ti.jsx)("div",{className:"social-icon twitter-icon"}),(0,Ti.jsx)("span",{children:"Twitter"})]}),g.socialLinks.instagram&&(0,Ti.jsxs)("a",{href:g.socialLinks.instagram,target:"_blank",rel:"noopener noreferrer",className:"social-link",children:[(0,Ti.jsx)("div",{className:"social-icon instagram-icon"}),(0,Ti.jsx)("span",{children:"Instagram"})]}),g.socialLinks.mal&&(0,Ti.jsxs)("a",{href:g.socialLinks.mal,target:"_blank",rel:"noopener noreferrer",className:"social-link",children:[(0,Ti.jsx)("div",{className:"social-icon mal-icon"}),(0,Ti.jsx)("span",{children:"MyAnimeList"})]}),g.socialLinks.anilist&&(0,Ti.jsxs)("a",{href:g.socialLinks.anilist,target:"_blank",rel:"noopener noreferrer",className:"social-link",children:[(0,Ti.jsx)("div",{className:"social-icon anilist-icon"}),(0,Ti.jsx)("span",{children:"AniList"})]}),g.socialLinks.website&&(0,Ti.jsxs)("a",{href:g.socialLinks.website,target:"_blank",rel:"noopener noreferrer",className:"social-link",children:[(0,Ti.jsx)("div",{className:"social-icon website-icon"}),(0,Ti.jsx)("span",{children:"Website"})]})]})]})]}),(0,Ti.jsxs)("div",{className:"profile-main-content "+(m&&u?"sidebar-open":""),children:[(0,Ti.jsx)("div",{className:"cover-banner",style:{backgroundImage:null!==g&&void 0!==g&&g.heroImage?`url(${g.heroImage})`:"none",backgroundSize:"cover",backgroundPosition:"center"}}),(0,Ti.jsxs)("div",{className:"favorites-section",children:[(0,Ti.jsxs)("h2",{className:"favorites-title",children:[g.username,"'s Collections"]}),(0,Ti.jsx)("div",{className:"collection-tabs-wrapper",children:(0,Ti.jsxs)("div",{className:"collection-tabs",children:[(0,Ti.jsxs)("button",{className:"collection-tab "+("anime"===a?"active":""),onClick:()=>s("anime"),children:[(0,Ti.jsx)("span",{children:"Anime"}),(0,Ti.jsx)("span",{className:"collection-count",children:Y()})]}),(0,Ti.jsxs)("button",{className:"collection-tab "+("manga"===a?"active":""),onClick:()=>s("manga"),children:[(0,Ti.jsx)("span",{children:"Manga"}),(0,Ti.jsx)("span",{className:"collection-count",children:J()})]}),(0,Ti.jsxs)("button",{className:"collection-tab "+("characters"===a?"active":""),onClick:()=>s("characters"),ch
4ildren:[(0,Ti.jsx)("span",{children:"Characters"}),(0,Ti.jsx)("span",{className:"collection-count",children:D.length})]})]})}),(()=>{var e,t;return"anime"===a?(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)(Vd,{statuses:W,activeTab:i,setActiveTab:o,collection:H}),(0,Ti.jsx)(Gd,{items:H[i]||[],isLoading:K,mediaType:"anime",activeStatus:i,statusLabel:(null===(e=W.find((e=>e.key===i)))||void 0===e?void 0:e.label)||"Anime"})]}):"manga"===a?(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)(Vd,{statuses:V,activeTab:l,setActiveTab:c,collection:Q}),(0,Ti.jsx)(Gd,{items:Q[l]||[],isLoading:G,mediaType:"manga",activeStatus:l,statusLabel:(null===(t=V.find((e=>e.key===l)))||void 0===t?void 0:t.label)||"Manga"})]}):(0,Ti.jsx)(Zd,{characters:D,isLoading:U})})()]})]})]})]})},sp=(0,_a.lazy)((()=>Promise.resolve().then(n.bind(n,419)))),ip=(0,_a.lazy)((()=>Promise.resolve().then(n.bind(n,751)))),op=(0,_a.lazy)((()=>Promise.resolve().then(n.bind(n,486)))),lp=(0,_a.lazy)((()=>n.e(120).then(n.bind(n,120)))),cp="https://animedb-production.up.railway.app",up=()=>(0,Ti.jsxs)("div",{className:"result-card-skeleton",children:[(0,Ti.jsx)("div",{className:"skeleton-image"}),(0,Ti.jsxs)("div",{className:"skeleton-content",children:[(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"20px",width:"80%"}}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"16px",width:"60%"}})]})]}),dp=_a.memo((()=>(0,Ti.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",fill:"currentColor",viewBox:"0 0 16 16",children:[(0,Ti.jsx)("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0-14a8 8 0 1 0 0 16A8 8 0 0 0 8 1z"}),(0,Ti.jsx)("path",{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"})]}))),hp=()=>(0,Ti.jsxs)("div",{className:"search-results-page",children:[(0,Ti.jsxs)("div",{className:"search-results-page-title-container",children:[(0,Ti.jsx)("h1",{className:"search-results-page-title",children:"Search Results"}),(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"20px",width:"40%",marginTop:"10px"}})]}),(0,Ti.jsx)("div",{className:"results-container",children:[1,2,3,4].map((e=>(0,Ti.jsxs)("section",{className:"results-section skeleton",children:[(0,Ti.jsx)("div",{className:"skeleton-block",style:{height:"28px",width:"40%",marginBottom:"20px"}}),(0,Ti.jsx)("div",{className:"results-grid",children:[1,2,3,4].map((e=>(0,Ti.jsx)(up,{},e)))})]},e)))})]}),pp=e=>{let{title:t,results:n,cardType:r,EmptyState:a}=e;const[s,i]=(0,_a.useState)(!1),o=(0,_a.useRef)(null);(0,_a.useEffect)((()=>{const e=new IntersectionObserver((t=>{let[n]=t;n.isIntersecting&&(i(!0),e.disconnect())}),{rootMargin:"100px"});return o.current&&e.observe(o.current),()=>{o.current&&e.disconnect()}}),[]);const l=(0,_a.useMemo)((()=>{switch(r){case"anime":default:return sp;case"manga":return ip;case"character":return op;case"user":return lp}}),[r]);return(0,Ti.jsxs)("section",{className:"results-section",ref:o,children:[(0,Ti.jsxs)("h3",{className:"results-category",children:[t,n.length>0&&(0,Ti.jsx)("span",{className:"section-count",children:n.length})]}),n.length>0?s?(0,Ti.jsx)("div",{className:"results-grid",children:(0,Ti.jsx)(_a.Suspense,{fallback:(0,Ti.jsx)(Ti.Fragment,{children:[1,2,3,4].map((e=>(0,Ti.jsx)(up,{},e)))}),children:n.map((e=>(0,Ti.jsx)(l,{[r]:e},e.mal_id||e._id)))})}):(0,Ti.jsx)("div",{className:"results-grid",children:[1,2,3,4].map((e=>(0,Ti.jsx)(up,{},e)))}):(0,Ti.jsxs)("div",{className:"no-results-column",children:[(0,Ti.jsx)(dp,{}),(0,Ti.jsxs)("div",{className:"no-results-text",children:["No ",t.toLowerCase()," found"]})]})]})},mp=()=>{const[e]=(0,ki.ok)(),[t,n]=(0,_a.useState)({animeResults:[],mangaResults:[],characterResults:[],userResults:[]}),[r,a]=(0,_a.useState)(!0),[s,i]=(0,_a.useState)(null),o=e.get("query")||"",{animeResults:l,mangaResults:c,characterResults:u,userResults:d}=t,h=(0,_a.useCallback)((async e=>{a(!0),i(null);try{const[t,r,a,s]=await Promise.all([fetch(`${cp}/api/anime/search?query=${encodeURIComponent(e)}`),fetch(`${cp}/api/manga/search?query=${encodeURIComponent(e)}`),fetch(`${cp}/api/characters/search?query=${encodeURIComponent(e)}`),fetch(`${cp}/api/users/search?query=${encodeURIComponent(e)}`)]);if(!t.ok||!r.ok||!a.ok||!s.ok)throw new Error("One or more search API requests failed");const i=await t.json(),o=await r.json(),l=await a.json(),c=await s.json(),u={animeResults:Array.isArray(i)?i:i.data||[],mangaResults:Array.isArray(o)?o:o.data||[],characterResults:Array.isArray(l)?l:l.data||[],userResults:Array.isArray(c)?c:c.data||[]};n(u)}catch(s){console.error("Search error:",s),i(s.message||"Failed to fetch search results")}finally{a(!1)}}),[]);(0,_a.useEffect)((()=>{o?h(o):a(!1)}),[o,h]);const p=(0,_a.useMemo)((()=>l.length>0||c.length>0||u.length>0||d.length>0),[l,c,u,d]);return r?(0,Ti.jsx)(hp,{}):s?(0,Ti.jsxs)("div",{className:"search-results-page",children:[(0,Ti.jsx)("div",{className:"search-results-page-title-container",children:(0,Ti.jsx)("h1",{className:"search-results-page-title",children:"Search Results"})}),(0,Ti.jsxs)("div",{className:"error-container",children:[(0,Ti.jsxs)("h3",{children:['Error searching for "',o,'"']}),(0,Ti.jsx)("p",{children:s}),(0,Ti.jsx)("button",{onClick:()=>h(o),className:"retry-button",children:"Try Again"})]})]}):o?(0,Ti.jsxs)("div",{className:"search-results-page",children:[(0,Ti.jsxs)("div",{className:"search-results-page-title-container",children:[(0,Ti.jsx)("h1",{className:"search-results-page-title",children:"Search Results"}),(0,Ti.jsxs)("p",{className:"search-results-page-subtitle",children:['Results for "',o,'"']})]}),p?(0,Ti.jsxs)("div",{className:"results-container",children:[(0,Ti.jsx)(pp,{title:"Users",results:d,cardType:"user"}),(0,Ti.jsx)(pp,{title:"Anime",results:l,cardType:"anime"}),(0,Ti.jsx)(pp,{title:"Characters",results:u,cardType:"character"}),(0,Ti.jsx)(pp,{title:"Manga",results:c,cardType:"manga"})]}):(0,Ti.jsxs)("div",{className:"no-results",children:[(0,Ti.jsx)(dp,{}),(0,Ti.jsxs)("div",{className:"no-results-text",children:['No results found for "',o,'"']})]})]}):(0,Ti.jsxs)("div",{className:"search-results-page",children:[(0,Ti.jsx)("div",{className:"search-results-page-title-container",children:(0,Ti.jsx)("h1",{className:"search-results-page-title",children:"Search"})}),(0,Ti.jsx)("div",{className:"no-results",style:{marginTop:"2rem"},children:(0,Ti.jsx)("div",{className:"no-results-text",children:"Enter a search term to find anime, manga, characters and users"})})]})},fp=_a.memo(mp),gp=e=>{let{label:t,value:n}=e;return(0,Ti.jsxs)("div",{className:"detail-item",children:[(0,Ti.jsx)("span",{className:"label",children:t}
4),(0,Ti.jsx)("span",{className:"value",children:n||"N/A"})]})},vp=e=>{var t;let{character:n}=e;return(0,Ti.jsxs)("div",{className:"tab-content",children:[(0,Ti.jsx)("div",{className:"left-column",children:(0,Ti.jsxs)("div",{className:"synopsis",children:[(0,Ti.jsx)("h3",{children:"Character Details"}),(0,Ti.jsx)("p",{children:n.about||"No description available."})]})}),(0,Ti.jsx)("div",{className:"right-column",children:(0,Ti.jsx)("div",{className:"content-tags",children:(0,Ti.jsxs)("div",{className:"tag-group",children:[(0,Ti.jsx)("h4",{children:"Personal Info"}),(0,Ti.jsxs)("div",{className:"personal-info-grid",children:[(0,Ti.jsx)(gp,{label:"Age",value:n.age}),(0,Ti.jsx)(gp,{label:"Height",value:n.height?`${n.height} cm`:"N/A"}),(0,Ti.jsx)(gp,{label:"Birthday",value:n.birthday}),(0,Ti.jsx)(gp,{label:"Occupation",value:null===(t=n.occupation)||void 0===t?void 0:t.join(", ")})]})]})})})]})},yp=e=>{var t,n,r,a;let{appearance:s,animeId:i,handleAnimeClick:o}=e;return(0,Ti.jsx)(ki.N_,{to:`/anime/${i}`,children:(0,Ti.jsx)("div",{className:"character-appearance-card",onClick:()=>i&&o(i),style:i?{cursor:"pointer"}:{},children:(0,Ti.jsxs)("div",{className:"character-appearance-card-header",children:[(0,Ti.jsx)("div",{className:"appearance-thumbnail",children:(0,Ti.jsx)("img",{src:(null===(t=s.anime.images)||void 0===t||null===(n=t.webp)||void 0===n?void 0:n.small_image_url)||(null===(r=s.anime.images)||void 0===r||null===(a=r.webp)||void 0===a?void 0:a.smallImageUrl),alt:s.anime.title})}),(0,Ti.jsxs)("div",{children:[(0,Ti.jsx)("h4",{children:s.anime.title_english||s.anime.title}),(0,Ti.jsxs)("p",{className:"text-secondary",children:["Role: ",s.role]}),(0,Ti.jsx)("p",{className:"text-secondary",style:{color:i?"#4a90e2":"#888"}})]})]})})})},bp=e=>{var t,n;let{character:r,animeDetails:a,handleAnimeClick:s}=e;return(0,Ti.jsx)("div",{className:"tab-content",children:(0,Ti.jsxs)("div",{className:"left-column",children:[(null===(t=r.anime)||void 0===t?void 0:t.length)>0&&(0,Ti.jsxs)("div",{className:"section",children:[(0,Ti.jsx)("h3",{children:"Anime Appearances"}),r.anime.map(((e,t)=>{const n=a[e.anime.malId||e.anime.mal_id];return(0,Ti.jsx)(yp,{appearance:e,animeId:n,handleAnimeClick:s},t)}))]}),(null===(n=r.manga)||void 0===n?void 0:n.length)>0&&(0,Ti.jsxs)("div",{className:"section",children:[(0,Ti.jsx)("h3",{children:"Manga Appearances"}),r.manga.map(((e,t)=>{var n,r,a,s;return(0,Ti.jsx)("div",{className:"character-appearance-card",children:(0,Ti.jsxs)("div",{className:"character-appearance-card-header",children:[(0,Ti.jsx)("div",{className:"character-appearance-thumbnail",children:(0,Ti.jsx)("img",{src:(null===(n=e.manga.images)||void 0===n||null===(r=n.webp)||void 0===r?void 0:r.small_image_url)||(null===(a=e.manga.images)||void 0===a||null===(s=a.webp)||void 0===s?void 0:s.smallImageUrl),alt:e.manga.title})}),(0,Ti.jsxs)("div",{children:[(0,Ti.jsx)("h4",{children:e.manga.title_english||e.manga.title}),(0,Ti.jsxs)("p",{className:"text-secondary",children:["Role: ",e.role]})]})]})},t)}))]})]})})},xp=e=>{let{voices:t}=e;return t&&0!==t.length?(0,Ti.jsx)("div",{className:"tab-content",children:(0,Ti.jsx)("div",{className:"left-column",children:t.map(((e,t)=>{var n,r;return(0,Ti.jsxs)("div",{className:"voice-actor-card",children:[(0,Ti.jsx)("div",{className:"voice-actor-image",children:(0,Ti.jsx)("img",{src:null===(n=e.person.images)||void 0===n||null===(r=n.jpg)||void 0===r?void 0:r.imageUrl,alt:e.person.name})}),(0,Ti.jsxs)("div",{className:"voice-actor-info",children:[(0,Ti.jsx)("h4",{children:e.person.name}),(0,Ti.jsxs)("p",{className:"text-secondary",children:[e.language," Dub"]})]})]},t)}))})}):(0,Ti.jsx)("div",{className:"tab-content",children:(0,Ti.jsx)("div",{className:"left-column",children:(0,Ti.jsx)("p",{className:"no-content",children:"No voice actor information available."})})})},wp=e=>{let{characterId:t,onStatusChange:n}=e;const[r,a]=(0,_a.useState)(!1),[s,i]=(0,_a.useState)(""),[o,l]=(0,_a.useState)(!0),[c,u]=(0,_a.useState)(!1),{isLoggedIn:d}=ec(),h="https://animedb-production.up.railway.app/api/user/characters";(0,_a.useEffect)((()=>{(async()=>
4{if(d)try{const e=localStorage.getItem("token");if(!e)return void l(!1);console.log(`Checking favorite status for characterId: ${t}`);const n=await Gl.get(`${h}/${t}`,{headers:{Authorization:`Bearer ${e}`}});n.data.success&&n.data.data&&(a(!0),i(n.data.data.notes||""))}catch(e){e.response&&404!==e.response.status&&console.error("Error checking character status:",e)}finally{l(!1)}else l(!1)})()}),[t,d]);return o?(0,Ti.jsx)("button",{className:"favorite-button loading",disabled:!0,children:"Loading..."}):(0,Ti.jsxs)("div",{className:"favorite-character-container",children:[(0,Ti.jsx)("button",{className:"favorite-button "+(r?"favorited":""),onClick:async()=>{if(d)try{l(!0);const e=localStorage.getItem("token");r?(await Gl.delete(`${h}/${t}`,{headers:{Authorization:`Bearer ${e}`}}),a(!1),i(""),n&&n(!1)):(await Gl.post(h,{characterId:t,isFavorite:!0,notes:s},{headers:{Authorization:`Bearer ${e}`}}),a(!0),n&&n(!0))}catch(e){console.error("Error updating favorite status:",e)}finally{l(!1)}else alert("Please log in to favorite characters")},disabled:o,children:r?"\u2764\ufe0f Favorited":"\ud83e\udd0d Add to Favorites"}),r&&(0,Ti.jsxs)("div",{className:"notes-section",children:[(0,Ti.jsx)("button",{className:"notes-toggle-button",onClick:()=>u(!c),children:c?"Hide Notes":"Show/Edit Notes"}),c&&(0,Ti.jsxs)("div",{className:"notes-editor",children:[(0,Ti.jsx)("textarea",{value:s,onChange:e=>i(e.target.value),placeholder:"Add your notes about this character...",rows:4}),(0,Ti.jsx)("button",{className:"save-notes-button",onClick:async()=>{if(d&&r)try{l(!0);const e=localStorage.getItem("token");await Gl.patch(`${h}/${t}`,{notes:s},{headers:{Authorization:`Bearer ${e}`}}),u(!1)}catch(e){console.error("Error updating notes:",e)}finally{l(!1)}},disabled:o,children:"Save Notes"})]})]})]})},jp="https://animedb-production.up.railway.app",Np=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3;try{const a=await fetch(e,t);return 429===a.status&&n>0?(console.log(`Rate limited, retrying in ${r}ms... (${n} retries left)`),await new Promise((e=>setTimeout(e,r))),Np(e,t,n-1,1.5*r)):a}catch(a){if(n>0)return console.log(`Network error, retrying in ${r}ms... (${n} retries left)`),await new Promise((e=>setTimeout(e,r))),Np(e,t,n-1,1.5*r);throw a}},Sp=()=>{var e,t,n,r,a,s,i,o,l,c,u,d,h,p,m;const{id:f}=(0,ki.g)(),g=(0,ki.Zp)(),[v,y]=(0,_a.useState)(null),[b,x]=(0,_a.useState)("about"),[w,j]=(0,_a.useState)({}),[N,S]=(0,_a.useState)(!0),[k,E]=(0,_a.useState)(null),_=e=>!e||Array.isArray(e)||e.data?Array.isArray(e)?e:e&&e.data?e.data:e:e;(0,_a.useEffect)((()=>{let e=!0;return(async()=>{try{if(!e)return;S(!0),E(null);const n=await Np(`${jp}/api/characters/${f}`);if(!n.ok)throw new Error(`Error fetching character: ${n.status}`);const r=await n.json(),a=_(r);if(!e)return;if(y(a),a.anime&&a.anime.length>0){const n=a.anime.slice(0,5),r=n.map((e=>{var t,n;return(null===(t=e.anime)||void 0===t?void 0:t.malId)||(null===(n=e.anime)||void 0===n?void 0:n.mal_id)||e.malId||e.mal_id})).filter(Boolean),s={};for(const e of r)try{var t;const r=await Np(`${jp}/api/anime/mal/${e}`);if(r.ok){const e=await r.json(),t=_(e);t&&t.id&&t.malId&&(s[t.malId]=t.id);continue}const a=n.find((t=>{var n;return(null===(n=t.anime)||void 0===n?void 0:n.malId)===e||t.malId===e})),i=(null===a||void 0===a||null===(t=a.anime)||void 0===t?void 0:t.title)||(null===a||void 0===a?void 0:a.name);if(!i)continue;await new Promise((e=>setTimeout(e,300)));const o=await Np(`${jp}/api/anime/search?query=${encodeURIComponent(i)}`);if(!o.ok)continue;const l=await o.json(),c=_(l),u=Array.isArray(c)?c.find((t=>t.malId===e)):null;u&&u.id&&(s[e]=u.id)}catch(k){console.error(`Error processing anime with MAL ID ${e}:`,k)}if(!e)return;j(s)}if(!e)return;S(!1)}catch(n){console.error("Error loading data:",n),e&&(E(n.message),S(!1))}})(),()=>{e=!1}}),[f]);const C=e=>{if(!e)return"Present";return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})};if(N)return(0,Ti.jsx)(au,{});if(k)return(0,Ti.jsx)(sd,{message:k});const A=[{label:"Favorites",value:(null===(e=v.favorites)||void 0===e?void 0:e.toLocaleStr
4ing())||"N/A"},{label:"Anime Appearances",value:(null===(t=v.anime)||void 0===t||null===(n=t.length)||void 0===n?void 0:n.toLocaleString())||"0"},{label:"Manga Appearances",value:(null===(r=v.manga)||void 0===r||null===(a=r.length)||void 0===a?void 0:a.toLocaleString())||"0"},{label:"Voice Actors",value:(null===(s=v.voices)||void 0===s||null===(i=s.length)||void 0===i?void 0:i.toLocaleString())||"0"}];return(0,Ti.jsxs)("div",{className:"character-details",children:[(0,Ti.jsx)(od,{backdrops:["https://res.cloudinary.com/dpz6ivjry/image/upload/v1741666344/740446_zkrklo.jpg"],children:(0,Ti.jsxs)("div",{className:"hero-content",children:[(0,Ti.jsxs)("div",{className:"poster",children:[(0,Ti.jsx)("img",{src:(null===(o=v.images)||void 0===o||null===(l=o.webp)||void 0===l?void 0:l.image_url)||(null===(c=v.images)||void 0===c||null===(u=c.webp)||void 0===u?void 0:u.imageUrl)||(null===(d=v.images)||void 0===d||null===(h=d.jpg)||void 0===h?void 0:h.image_url)||(null===(p=v.images)||void 0===p||null===(m=p.jpg)||void 0===m?void 0:m.imageUrl),alt:v.name}),(0,Ti.jsx)(wp,{characterId:v.id,onStatusChange:e=>{}})]}),(0,Ti.jsxs)("div",{className:"info",children:[(0,Ti.jsx)(dd,{title:v.name,englishTitle:v.name_kanji,synonyms:v.nicknames}),(0,Ti.jsx)(pd,{stats:A})]})]})}),(0,Ti.jsxs)("div",{className:"content-wrapper",children:[(0,Ti.jsx)(id,{tabs:[{id:"about",label:"About"},{id:"appearances",label:"Appearances"},{id:"voices",label:"Voice Actors"}],activeTab:b,onTabChange:x}),"about"===b&&(0,Ti.jsx)(vp,{character:v}),"appearances"===b&&(0,Ti.jsx)(bp,{character:v,animeDetails:w,handleAnimeClick:e=>{e&&g(`/anime/${e}`)}}),"voices"===b&&(0,Ti.jsx)(xp,{voices:v.voices})]}),(0,Ti.jsxs)("div",{className:"additional-info",children:[(0,Ti.jsxs)("span",{children:["Added: ",C(v.created_at)]}),(0,Ti.jsxs)("span",{children:["Last updated: ",C(v.updated_at)]})]})]})},kp=()=>{const[e,t]=(0,_a.useState)({}),[n,r]=(0,_a.useState)(!0),[a,s]=(0,_a.useState)(null),[i,o]=(0,_a.useState)("all"),l=e=>["Action","Adventure","Shounen","Martial Arts","Military","Sports"].includes(e)?"action":["Drama","Slice of Life","Romance","School","Shoujo","Music","Josei"].includes(e)?"drama":["Fantasy","Sci-Fi","Magic","Supernatural","Super Power","Space","Mecha"].includes(e)?"fantasy":"other",c=e=>["Hentai","Ecchi","Adult"].includes(e);(0,_a.useEffect)((()=>{(async()=>{r(!0),s(null);try{const e="https://animedb-production.up.railway.app",n=await fetch(`${e}/api/anime/genres`);if(!n.ok)throw new Error("Failed to fetch genres");const r=await n.json();t(r)}catch(a){console.error("Error fetching genres:",a),s(a.message)}finally{r(!1)}})()}),[]);const u=(0,_a.useMemo)((()=>e&&"object"===typeof e?Object.keys(e).filter((t=>t&&"string"===typeof t&&"null"!==t&&"undefined"!==t&&Array.isArray(e[t])&&e[t].length>0)).map((t=>{var n,r,a,s,i,o,u;const d=(null===(n=e[t][0])||void 0===n?void 0:n.totalCount)||e[t].length,h=e[t][0]||{};return{name:t,count:d,imageUrl:(null===(r=h.images)||void 0===r||null===(a=r.webp)||void 0===a?void 0:a.large_image_url)||(null===(s=h.images)||void 0===s||null===(i=s.jpg)||void 0===i?void 0:i.large_image_url)||(null===(o=h.images)||void 0===o||null===(u=o.webp)||void 0===u?void 0:u.image_url)||h.image||"/default-anime.jpg",category:l(t),isPopular:d>25,isAdult:c(t)}})).sort(((e,t)=>e.name.localeCompare(t.name))):[]),[e]),d=(0,_a.useMemo)((()=>"all"===i?u:"popular"===i?u.filter((e=>e.isPopular)):u.filter((e=>e.category===i))),[u,i]);return n?(0,Ti.jsxs)("div",{className:"genres-page",children:[(0,Ti.jsxs)("div",{className:"genres-header",children:[(0,Ti.jsx)("h1",{children:"Anime Genres"}),(0,Ti.jsx)("p",{children:"Discover anime by your favorite genres"})]}),(0,Ti.jsxs)("div",{className:"loading-container",children:[(0,Ti.jsx)("div",{className:"loading-spinner"}),(0,Ti.jsx)("p",{children:"Loading genres..."})]})]}):a?(0,Ti.jsxs)("div",{className:"genres-page",children:[(0,Ti.jsx)("div",{className:"genres-header",children:(0,Ti.jsx)("h1",{children:"Anime Genres"})}),(0,Ti.jsxs)("div",{className:"error-container",children:[(0,Ti.jsx)("h3",{children:"Failed to load genres"}),(0,Ti.jsx)("p",{children:a}),(0,Ti.jsx)(ki.N_,{to:"/",className:"action-button",children:"Return to Home"})]})]}
4):u&&0!==u.length?(0,Ti.jsxs)("div",{className:"genres-page",children:[(0,Ti.jsx)("div",{className:"anime-genres-page-title-container",children:(0,Ti.jsx)("h1",{className:"anime-genres-page-title",children:"Anime Genres"})}),(0,Ti.jsx)("div",{className:"genre-categories",children:[{id:"all",name:"All Genres"},{id:"popular",name:"Popular"},{id:"action",name:"Action & Adventure"},{id:"drama",name:"Drama & Slice of Life"},{id:"fantasy",name:"Fantasy & Sci-Fi"},{id:"other",name:"Other"}].map((e=>(0,Ti.jsx)("button",{className:"category-tab "+(i===e.id?"active":""),onClick:()=>o(e.id),children:e.name},e.id)))}),(0,Ti.jsx)("div",{className:"all-genres-grid",children:d.map((e=>(0,Ti.jsxs)(ki.N_,{to:`/genres/${encodeURIComponent(e.name)}`,className:"genre-card "+(e.isAdult?"adult-content":""),children:[(0,Ti.jsxs)("div",{className:"genre-badge",children:[e.count," titles"]}),e.isAdult&&(0,Ti.jsx)("div",{className:"adult-warning",children:"18+"}),(0,Ti.jsxs)("div",{className:"genre-image-container",children:[(0,Ti.jsx)("img",{src:e.imageUrl,alt:e.name,className:"genre-image",onError:e=>{e.target.src="/default-anime.jpg"}}),(0,Ti.jsxs)("div",{className:"genre-overlay",children:[(0,Ti.jsx)("h3",{className:"genre-name",children:e.name}),(0,Ti.jsx)("span",{className:"genre-count",children:"Explore genre"})]})]})]},e.name)))})]}):(0,Ti.jsxs)("div",{className:"genres-page",children:[(0,Ti.jsx)("div",{className:"genres-header",children:(0,Ti.jsx)("h1",{children:"Anime Genres"})}),(0,Ti.jsxs)("div",{className:"no-results",children:[(0,Ti.jsx)("p",{children:"No genres found. Please check back later."}),(0,Ti.jsx)(ki.N_,{to:"/",className:"action-button",children:"Return to Home"})]})]})};var Ep=n(419),_p=n(751);const Cp=e=>{let{items:t,layout:n="horizontal",type:r="anime"}=e;return t&&Array.isArray(t)&&0!==t.length?(0,Ti.jsx)("div",{className:`fixed-genre-grid ${n}-layout`,children:t.map((e=>(0,Ti.jsx)("div",{className:"fixed-card-wrapper",children:"anime"===r?(0,Ti.jsx)(Ep.default,{anime:e,layout:n}):(0,Ti.jsx)(_p.default,{manga:e,layout:n})},e._id||e.id||e.mal_id||"unknown")))}):(0,Ti.jsx)("div",{className:"fixed-genre-empty",children:(0,Ti.jsxs)("p",{children:["No ",r," available in this category."]})})},Ap=()=>{const{genre:e}=(0,ki.g)(),[t,n]=(0,_a.useState)([]),[r,a]=(0,_a.useState)(!0),[s,i]=(0,_a.useState)(null),[o,l]=(0,_a.useState)(1),[c,u]=(0,_a.useState)(1),[d,h]=(0,_a.useState)(0),[p,m]=(0,_a.useState)("horizontal"),[f,g]=(0,_a.useState)("score"),[v,y]=(0,_a.useState)(12),b=decodeURIComponent(e);(0,_a.useEffect)((()=>{const e=()=>{window.innerWidth<=768?m("vertical"):m("horizontal")};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),(0,_a.useEffect)((()=>{(async()=>{a(!0),i(null);try{const e=new URL(`${"https://animedb-production.up.railway.app"}/api/anime/genre/${encodeURIComponent(b)}`);e.searchParams.append("page",o),e.searchParams.append("limit",v),e.searchParams.append("sort",f),console.log(`Fetching: ${e.toString()}`);const t=await fetch(e.toString());if(!t.ok)throw new Error(`Failed to fetch ${b} anime (${t.status})`);const r=await t.json();r.data&&r.pagination?(console.log(`Fetched ${r.data.length} anime for genre: ${b} (page ${r.pagination.page} of ${r.pagination.pages})`),n(r.data),l(r.pagination.page),u(r.pagination.pages),h(r.pagination.total)):(console.log(`Fetched ${r.length} anime for genre: ${b} (old format)`),n(r),u(Math.ceil(r.length/v)),h(r.length))}catch(s){console.error(`Error fetching ${b} anime:`,s),i(s.message)}finally{a(!1)}})()}),[b,o,v,f]);const x=e=>{l(e),window.scrollTo(0,0)};return r?(0,Ti.jsxs)("div",{className:"genre-page",children:[(0,Ti.jsxs)("div",{className:"genre-page-title-container",children:[(0,Ti.jsx)(ki.N_,{to:"/genres",className:"back-button",children:"\u2190 All Genres"}),(0,Ti.jsxs)("h1",{className:"genre-page-title",children:[b," Anime"]})]}),(0,Ti.jsxs)("div",{className:"loading-container",children:[(0,Ti.jsx)("div",{className:"loading-spinner"}),(0,Ti.jsxs)("p",{children:["Loading ",b," anime..."]})]})]}):s?(0,Ti.jsxs)("div",{className:"genre-page",children:[(0,Ti.jsxs)("div",{className:"genre-page-title-container",children:[(0,Ti.jsx)(ki.N_,{to:"/genres",className:"back-button",children:"\u2190 All Genres"}),(0,Ti.jsxs)("h1",{className:"genre-page-title",children:[b," Anime"]})]}),(0,Ti.jsxs)("div",{className:"error-container",children:[(0,Ti.jsxs)("h3",{children:["Failed to load ",b," anime"]}),(0,Ti.jsx)("p",{children:s}),(0,Ti.jsx)(ki.N_,{to:"/genres",className:"back-button",children:"Return to All Genres"})]})]}):t&&0!==t.length?(0,Ti.jsxs)("div",{className:"genre-page",children:[(0,Ti.jsxs)("div",{className:"genre-page-title-container",children:[(0,Ti.jsx)(ki.N_,{to:"/genres",className:"back-button",children:"\u2190 All Genres"}),(0,Ti.jsxs)("h1",{className:"genre-page-title",children:[b," Anime"]}),(0,Ti.jsxs)("p",{className:"genre-page-subtitle",children:["Showing ",t.length," of ",d," anime in this genre"]})]}
4),(0,Ti.jsxs)("div",{className:"genre-controls",children:[(0,Ti.jsxs)("div",{className:"genre-filter",children:[(0,Ti.jsx)("label",{htmlFor:"sort-select",children:"Sort by:"}),(0,Ti.jsxs)("select",{id:"sort-select",value:f,onChange:e=>{g(e.target.value),l(1)},className:"sort-select",children:[(0,Ti.jsx)("option",{value:"score",children:"Score (Highest First)"}),(0,Ti.jsx)("option",{value:"title",children:"Title (A-Z)"}),(0,Ti.jsx)("option",{value:"popularity",children:"Popularity"}),(0,Ti.jsx)("option",{value:"aired.from",children:"Release Date (Newest First)"})]}),(0,Ti.jsx)("label",{htmlFor:"limit-select",style:{marginLeft:"15px"},children:"Show:"}),(0,Ti.jsxs)("select",{id:"limit-select",value:v,onChange:e=>{y(Number(e.target.value)),l(1)},className:"limit-select",children:[(0,Ti.jsx)("option",{value:12,children:"12 per page"}),(0,Ti.jsx)("option",{value:24,children:"24 per page"}),(0,Ti.jsx)("option",{value:48,children:"48 per page"})]})]}),(0,Ti.jsxs)("div",{className:"pagination-info",children:["Page ",o," of ",c]})]}),(0,Ti.jsx)(Cp,{items:t,layout:p,type:"anime"}),c>1&&(0,Ti.jsxs)("div",{className:"pagination",children:[(0,Ti.jsx)("button",{onClick:()=>x(o-1),disabled:1===o,className:"page-btn prev",children:"Previous"}),(0,Ti.jsx)("div",{className:"page-numbers",children:Array.from({length:c},((e,t)=>t+1)).filter((e=>1===e||e===c||e>=o-1&&e<=o+1)).map(((e,t,n)=>(0,Ti.jsxs)(_a.Fragment,{children:[t>0&&n[t-1]!==e-1&&(0,Ti.jsx)("span",{className:"page-ellipsis",children:"\u2022\u2022\u2022"}),(0,Ti.jsx)("button",{onClick:()=>x(e),className:"page-num "+(o===e?"active":""),children:e})]},e)))}),(0,Ti.jsx)("button",{onClick:()=>x(o+1),disabled:o===c,className:"page-btn next",children:"Next"})]})]}):(0,Ti.jsxs)("div",{className:"genre-page",children:[(0,Ti.jsxs)("div",{className:"genre-page-title-container",children:[(0,Ti.jsx)(ki.N_,{to:"/genres",className:"back-button",children:"\u2190 All Genres"}),(0,Ti.jsxs)("h1",{className:"genre-page-title",children:[b," Anime"]})]}),(0,Ti.jsxs)("div",{className:"no-results",children:[(0,Ti.jsx)("p",{children:"No anime found for this genre. Please try another genre."}),(0,Ti.jsx)(ki.N_,{to:"/genres",className:"back-button",children:"Browse Other Genres"})]})]})},Tp=()=>{const[e,t]=(0,_a.useState)({}),[n,r]=(0,_a.useState)(!0),[a,s]=(0,_a.useState)(null),[i,o]=(0,_a.useState)("all"),l=e=>["Action","Adventure","Shounen","Martial Arts","Military","Sports"].includes(e)?"action":["Drama","Slice of Life","Romance","School","Shoujo","Music","Josei"].includes(e)?"drama":["Fantasy","Sci-Fi","Magic","Supernatural","Super Power","Space","Mecha"].includes(e)?"fantasy":"other",c=e=>["Hentai","Ecchi","Adult","Smut"].includes(e);(0,_a.useEffect)((()=>{(async()=>{r(!0),s(null);try{const e="https://animedb-production.up.railway.app",n=await fetch(`${e}/api/manga/genres`);if(!n.ok)throw new Error("Failed to fetch manga genres");const r=await n.json();t(r)}catch(a){console.error("Error fetching manga genres:",a),s(a.message)}finally{r(!1)}})()}),[]);const u=(0,_a.useMemo)((()=>e&&"object"===typeof e?Object.keys(e).filter((t=>t&&"string"===typeof t&&"null"!==t&&"undefined"!==t&&Array.isArray(e[t])&&e[t].length>0)).map((t=>{var n,r,a,s,i,o,u;const d=(null===(n=e[t][0])||void 0===n?void 0:n.totalCount)||e[t].length,h=e[t][0]||{};return{name:t,count:d,imageUrl:(null===(r=h.images)||void 0===r||null===(a=r.webp)||void 0===a?void 0:a.large_image_url)||(null===(s=h.images)||void 0===s||null===(i=s.jpg)||void 0===i?void 0:i.large_image_url)||(null===(o=h.images)||void 0===o||null===(u=o.webp)||void 0===u?void 0:u.image_url)||h.image||"/default-manga.jpg",category:l(t),isPopular:d>25,isAdult:c(t)}})).sort(((e,t)=>e.name.localeCompare(t.name))):[]),[e]),d=(0,_a.useMemo)((()=>"all"===i?u:"popular"===i?u.filter((e=>e.isPopular)):u.filter((e=>e.category===i))),[u,i]);return n?(0,Ti.jsxs)("div",{className:"manga-genres-page",children:[(0,Ti.jsxs)("div",{className:"manga-genres-header",children:[(0,Ti.jsx)("h1",{children:"Manga Genres"}),(0,Ti.jsx)("p",{children:"Discover manga by your favorite genres"})]}),(0,Ti.jsxs)("div",{className:"loading-container",children:[(0,Ti.jsx)("div",{className:"loading-spinner"}),(0,Ti.jsx)("p",{children:"Loading manga genres..."})]})]}):a?(0,Ti.jsxs)("div",{className:"manga-genres-page",children:[(0,Ti.jsx)("div",{className:"manga-genres-header",children:(0,Ti.jsx)("h1",{children:"Manga Genres"})}),(0,Ti.jsxs)("div",{className:"error-container",children:[(0,Ti.jsx)("h3",{children:"Failed to load manga genres"}),(0,Ti.jsx)("p",{children:a}),(0,Ti.jsx)(ki.N_,{to:"/manga",className:"action-button",children:"Return to Manga Home"})]})]}):u&&0!==u.length?(0,Ti.jsxs)("div",{className:"manga-genres-page",children:[(0,Ti.jsx)("div",{className:"manga-genres-page-title-container",children:(0,Ti.jsx)("h1",{className:"manga-genres-page-title",children:"Manga Genres"})}),(0,Ti.jsx)("div",{className:"genre-categories",children:[{id:"all",name:"All Genres"},{id:"popular",name:"Popular"},{id:"action",name:"Action & Adventure"},{id:"drama",name:"Drama & Slice of Life"},{id:"fantasy",name:"Fantasy & Sci-Fi"},{id:"other",name:"Other"}].map((e=>(0,Ti.jsx)("button",{className:"category-tab "+(i===e.id?"active":""),onClick:()=>o(e.id),children:e.name},e.id)))}),(0,Ti.jsx)("div",{className:"all-genres-grid",children:d.map((e=>(0,Ti.jsxs)(ki.N_,{to:`/manga/genres/${encodeURIComponent(e.name)}
4`,className:"genre-card "+(e.isAdult?"adult-content":""),children:[(0,Ti.jsxs)("div",{className:"genre-badge",children:[e.count," titles"]}),e.isAdult&&(0,Ti.jsx)("div",{className:"adult-warning",children:"18+"}),(0,Ti.jsxs)("div",{className:"genre-image-container",children:[(0,Ti.jsx)("img",{src:e.imageUrl,alt:e.name,className:"genre-image",onError:e=>{e.target.src="/default-manga.jpg"}}),(0,Ti.jsxs)("div",{className:"genre-overlay",children:[(0,Ti.jsx)("h3",{className:"genre-name",children:e.name}),(0,Ti.jsx)("span",{className:"genre-count",children:"Explore genre"})]})]})]},e.name)))})]}):(0,Ti.jsxs)("div",{className:"manga-genres-page",children:[(0,Ti.jsx)("div",{className:"manga-genres-header",children:(0,Ti.jsx)("h1",{children:"Manga Genres"})}),(0,Ti.jsxs)("div",{className:"no-results",children:[(0,Ti.jsx)("p",{children:"No manga genres found. Please check back later."}),(0,Ti.jsx)(ki.N_,{to:"/manga",className:"action-button",children:"Return to Manga Home"})]})]})},Rp=()=>{const{genre:e}=(0,ki.g)(),[t,n]=(0,_a.useState)([]),[r,a]=(0,_a.useState)(!0),[s,i]=(0,_a.useState)(null),[o,l]=(0,_a.useState)(1),[c,u]=(0,_a.useState)(1),[d,h]=(0,_a.useState)(0),[p,m]=(0,_a.useState)("horizontal"),[f,g]=(0,_a.useState)("score"),[v,y]=(0,_a.useState)(12),b=decodeURIComponent(e);(0,_a.useEffect)((()=>{const e=()=>{window.innerWidth<=768?m("vertical"):m("horizontal")};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),(0,_a.useEffect)((()=>{(async()=>{a(!0),i(null);try{const e=new URL(`${"https://animedb-production.up.railway.app"}/api/manga/genre/${encodeURIComponent(b)}`);e.searchParams.append("page",o),e.searchParams.append("limit",v),e.searchParams.append("sort",f),console.log(`Fetching: ${e.toString()}`);const t=await fetch(e.toString());if(!t.ok)throw new Error(`Failed to fetch ${b} manga (${t.status})`);const r=await t.json();r.data&&r.pagination?(console.log(`Fetched ${r.data.length} manga for genre: ${b} (page ${r.pagination.page} of ${r.pagination.pages})`),n(r.data),l(r.pagination.page),u(r.pagination.pages),h(r.pagination.total)):(console.log(`Fetched ${r.length} manga for genre: ${b} (old format)`),n(r),u(Math.ceil(r.length/v)),h(r.length))}catch(s){console.error(`Error fetching ${b} manga:`,s),i(s.message)}finally{a(!1)}})()}),[b,o,v,f]);const x=e=>{l(e),window.scrollTo(0,0)};return r?(0,Ti.jsxs)("div",{className:"manga-genre-page",children:[(0,Ti.jsxs)("div",{className:"manga-genre-page-title-container",children:[(0,Ti.jsx)(ki.N_,{to:"/manga/genres",className:"back-button",children:"\u2190 All Genres"}),(0,Ti.jsxs)("h1",{className:"manga-genre-page-title",children:[b," Manga"]})]}),(0,Ti.jsxs)("div",{className:"loading-container",children:[(0,Ti.jsx)("div",{className:"loading-spinner"}),(0,Ti.jsxs)("p",{children:["Loading ",b," manga..."]})]})]}):s?(0,Ti.jsxs)("div",{className:"manga-genre-page",children:[(0,Ti.jsxs)("div",{className:"manga-genre-page-title-container",children:[(0,Ti.jsx)(ki.N_,{to:"/manga/genres",className:"back-button",children:"\u2190 All Genres"}),(0,Ti.jsxs)("h1",{className:"manga-genre-page-title",children:[b," Manga"]})]}),(0,Ti.jsxs)("div",{className:"error-container",children:[(0,Ti.jsxs)("h3",{children:["Failed to load ",b," manga"]}),(0,Ti.jsx)("p",{children:s}),(0,Ti.jsx)(ki.N_,{to:"/manga/genres",className:"back-button",children:"Return to All Genres"})]})]}):t&&0!==t.length?(0,Ti.jsxs)("div",{className:"manga-genre-page",children:[(0,Ti.jsxs)("div",{className:"manga-genre-page-title-container",children:[(0,Ti.jsx)(ki.N_,{to:"/manga/genres",className:"back-button",children:"\u2190 All Genres"}),(0,Ti.jsxs)("h1",{className:"manga-genre-page-title",children:[b," Manga"]}),(0,Ti.jsxs)("p",{className:"manga-genre-page-subtitle",children:["Showing ",t.length," of ",d," manga in this genre"]})]}),(0,Ti.jsxs)("div",{className:"genre-controls",children:[(0,Ti.jsxs)("div",{className:"genre-filter",children:[(0,Ti.jsx)("label",{htmlFor:"sort-select",children:"Sort by:"}),(0,Ti.jsxs)("select",{id:"sort-select",value:f,onChange:e=>{g(e.target.value),l(1)},className:"sort-select",children:[(0,Ti.jsx)("option",{value:"score",children:"Score (Highest First)"}),(0,Ti.jsx)("option",{value:"title",children:"Title (A-Z)"}),(0,Ti.jsx)("option",{value:"popularity",children:"Popularity"}),(0,Ti.jsx)("option",{value:"published.from",children:"Release Date (Newest First)"})]}),(0,Ti.jsx)("label",{htmlFor:"limit-select",style:{marginLeft:"15px"},children:"Show:"}
4),(0,Ti.jsxs)("select",{id:"limit-select",value:v,onChange:e=>{y(Number(e.target.value)),l(1)},className:"limit-select",children:[(0,Ti.jsx)("option",{value:12,children:"12 per page"}),(0,Ti.jsx)("option",{value:24,children:"24 per page"}),(0,Ti.jsx)("option",{value:48,children:"48 per page"})]})]}),(0,Ti.jsxs)("div",{className:"pagination-info",children:["Page ",o," of ",c]})]}),(0,Ti.jsx)(Cp,{items:t,layout:p,type:"manga"}),c>1&&(0,Ti.jsxs)("div",{className:"pagination",children:[(0,Ti.jsx)("button",{onClick:()=>x(o-1),disabled:1===o,className:"page-btn prev",children:"Previous"}),(0,Ti.jsx)("div",{className:"page-numbers",children:Array.from({length:c},((e,t)=>t+1)).filter((e=>1===e||e===c||e>=o-1&&e<=o+1)).map(((e,t,n)=>(0,Ti.jsxs)(_a.Fragment,{children:[t>0&&n[t-1]!==e-1&&(0,Ti.jsx)("span",{className:"page-ellipsis",children:"\u2022\u2022\u2022"}),(0,Ti.jsx)("button",{onClick:()=>x(e),className:"page-num "+(o===e?"active":""),children:e})]},e)))}),(0,Ti.jsx)("button",{onClick:()=>x(o+1),disabled:o===c,className:"page-btn next",children:"Next"})]})]}):(0,Ti.jsxs)("div",{className:"manga-genre-page",children:[(0,Ti.jsxs)("div",{className:"manga-genre-page-title-container",children:[(0,Ti.jsx)(ki.N_,{to:"/manga/genres",className:"back-button",children:"\u2190 All Genres"}),(0,Ti.jsxs)("h1",{className:"manga-genre-page-title",children:[b," Manga"]})]}),(0,Ti.jsxs)("div",{className:"no-results",children:[(0,Ti.jsx)("p",{children:"No manga found for this genre. Please try another genre."}),(0,Ti.jsx)(ki.N_,{to:"/manga/genres",className:"back-button",children:"Browse Other Genres"})]})]})},Pp={"top-rated":{title:"Top Rated Anime",description:"The highest rated anime based on user scores and reviews. These titles represent the very best that anime has to offer.",endpoint:"/api/anime/sections/top-rated",icon:"fa-solid fa-star",bgColor:"linear-gradient(135deg, #6c5ce7, #a29bfe)",defaultSort:"rank",sortOptions:[{value:"rank",label:"Rank (Best to Worst)"},{value:"score",label:"Score (Highest to Lowest)"},{value:"title",label:"Title (A-Z)"},{value:"popularity",label:"Popularity"}]},"best-of-year":{title:"Best Anime of the Year",description:"The top anime releases from this year that have captured audiences with their exceptional quality and storytelling.",endpoint:"/api/anime/sections/best-of-year",icon:"fa-solid fa-trophy",bgColor:"linear-gradient(135deg, #f39c12, #f1c40f)",defaultSort:"score",sortOptions:[{value:"score",label:"Score (Highest to Lowest)"},{value:"rank",label:"Rank (Best to Worst)"},{value:"title",label:"Title (A-Z)"},{value:"popularity",label:"Popularity"}]},"currently-airing":{title:"Currently Airing Anime",description:"Anime series that are broadcasting new episodes right now. Stay up-to-date with the freshest content this season.",endpoint:"/api/anime/sections/currently-airing",icon:"fa-solid fa-calendar-check",bgColor:"linear-gradient(135deg, #2ecc71, #27ae60)",defaultSort:"popularity",sortOptions:[{value:"popularity",label:"Popularity (Most to Least)"},{value:"score",label:"Score (Highest to Lowest)"},{value:"aired.from",label:"Release Date (Newest First)"},{value:"title",label:"Title (A-Z)"}]},upcoming:{title:"Upcoming Anime",description:"Highly anticipated anime that are scheduled for release soon. Get a preview of what's next in the world of anime.",endpoint:"/api/anime/sections/upcoming",icon:"fa-solid fa-clock",bgColor:"linear-gradient(135deg, #e74c3c, #c0392b)",defaultSort:"popularity",sortOptions:[{value:"popularity",label:"Popularity (Most to Least)"},{value:"aired.from",label:"Release Date (Soonest First)"},{value:"title",label:"Title (A-Z)"}]},movies:{title:"Anime Movies",description:"Feature-length anime films that deliver compelling stories in a single spectacular package.",endpoint:"/api/anime/sections/movies",icon:"fa-solid fa-film",bgColor:"linear-gradient(135deg, #3498db, #2980b9)",defaultSort:"score",sortOptions:[{value:"score",label:"Score (Highest to Lowest)"},{value:"title",label:"Title (A-Z)"},{value:"popularity",label:"Popularity"},{value:"aired.from",label:"Release Date (Newest First)"}]}},Op=()=>{const{category:e}=(0,ki.g)(),t=(0,ki.Zp)(),[n,r]=(0,_a.useState)({animes:[],loading:!0,error:null,page:1,itemsPerPage:24,totalPages:1,sortOrder:"rank",cardLayout:window.innerWidth<=768?"vertical":"horizontal"}),a=Pp[e];(0,_a.useEffect)((()=>{const e=()=>{r((e=>({...e,cardLayout:window.innerWidth<=768?"vertical":"horizontal"})))};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),(0,_a.useEffect)((()=>
4{if(!a)return r((e=>({...e,loading:!1}))),void t("/not-found");(async()=>{r((e=>({...e,loading:!0,error:null})));try{const e=new URL(`https://animedb-production.up.railway.app${a.endpoint}`);e.searchParams.append("page",n.page),e.searchParams.append("limit",Math.min(100,n.itemsPerPage)),e.searchParams.append("sort",n.sortOrder);const t=await Gl.get(e.toString());r((e=>{var n;return{...e,animes:t.data.data||[],totalPages:(null===(n=t.data.pagination)||void 0===n?void 0:n.pages)||1,loading:!1}}))}catch(e){r((e=>({...e,error:"Failed to load anime. Please try again later.",loading:!1}))),console.error("Error fetching anime:",e)}})()}),[e,n.page,n.itemsPerPage,n.sortOrder]);const s=e=>{e>0&&e<=n.totalPages&&(r((t=>({...t,page:e}))),window.scrollTo(0,0))},i=()=>(0,Ti.jsx)("div",{className:"category-header",style:{background:a.bgColor},children:(0,Ti.jsxs)("div",{className:"category-header-content",children:[(0,Ti.jsx)("div",{className:"category-icon",children:(0,Ti.jsx)("i",{className:a.icon})}),(0,Ti.jsxs)("div",{className:"category-info",children:[(0,Ti.jsx)("h1",{children:a.title}),(0,Ti.jsx)("p",{children:a.description})]})]})});return!a&&n.loading?(0,Ti.jsx)("div",{className:"loading-spinner"}):a?(0,Ti.jsxs)("div",{className:"category-page",children:[(0,Ti.jsx)(i,{}),(0,Ti.jsxs)("div",{className:"category-content",children:[(0,Ti.jsxs)("div",{className:"category-controls",children:[(0,Ti.jsx)("div",{className:"results-info",children:n.animes.length>0?(0,Ti.jsxs)("div",{className:"result-stats",children:[(0,Ti.jsxs)("span",{className:"result-count",children:[n.animes.length," anime"]}),n.totalPages>1&&(0,Ti.jsxs)("span",{className:"page-info",children:["Page ",n.page," of ",n.totalPages]})]}):(0,Ti.jsx)("span",{children:"No results found"})}),(0,Ti.jsxs)("div",{className:"sort-controls",children:[(0,Ti.jsx)("label",{className:"sort-select",children:"Sort by:"}),(0,Ti.jsx)("select",{className:"sort-select",value:n.sortOrder,onChange:e=>{r((t=>({...t,sortOrder:e.target.value,page:1})))},children:a.sortOptions.map((e=>(0,Ti.jsx)("option",{value:e.value,children:e.label},e.value)))}),(0,Ti.jsx)("label",{className:"limit-select",children:"Show:"}),(0,Ti.jsxs)("select",{className:"limit-select",value:n.itemsPerPage,onChange:e=>{r((t=>({...t,itemsPerPage:Math.min(100,Number(e.target.value)),page:1})))},children:[(0,Ti.jsx)("option",{value:12,children:"12 per page"}),(0,Ti.jsx)("option",{value:24,children:"24 per page"}),(0,Ti.jsx)("option",{value:48,children:"48 per page"}),(0,Ti.jsx)("option",{value:100,children:"100 per page"})]})]})]}),n.loading?(0,Ti.jsx)("div",{className:"loading-spinner"}):n.error?(0,Ti.jsxs)("div",{className:"error-message",children:[n.error,(0,Ti.jsx)("button",{onClick:()=>window.location.reload(),children:"Retry"})]}):(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)(gu.default,{animes:n.animes,layout:n.cardLayout}),n.totalPages>1&&(0,Ti.jsxs)("div",{className:"pagination",children:[(0,Ti.jsx)("button",{className:"page-btn",onClick:()=>s(n.page-1),disabled:1===n.page,children:"Previous"}),(0,Ti.jsx)("div",{className:"page-numbers",children:[...Array(Math.min(n.totalPages,7))].map(((e,t)=>{let r;if(n.totalPages<=7)r=t+1;else if(n.page<=3)if(t<5)r=t+1;else{if(5===t)return(0,Ti.jsx)("span",{children:"..."},"ellipsis1");r=n.totalPages}else if(n.page>=n.totalPages-2)if(0===t)r=1;else{if(1===t)return(0,Ti.jsx)("span",{children:"..."},"ellipsis2");r=n.totalPages-(6-t)}else if(0===t)r=1;else{if(1===t)return(0,Ti.jsx)("span",{children:"..."},"ellipsis3");if(5===t)return(0,Ti.jsx)("span",{children:"..."},"ellipsis4");r=6===t?n.totalPages:n.page+(t-3)}return(0,Ti.jsx)("button",{className:r===n.page?"active":"",onClick:()=>s(r),children:r},r)}))}),(0,Ti.jsx)("button",{className:"page-btn",onClick:()=>s(n.page+1),disabled:n.page===n.totalPages,children:"Next"})]})]})]})]}):null},Ip=Gl.create({baseURL:"https://animedb-production.up.railway.app",headers:{"Content-Type":"application/json"}});Ip.interceptors.request.use((e=>{const t=localStorage.getItem("token");return t&&(e.headers.Authorization=`Bearer ${t}`),e}),(e=>Promise.reject(e)));const $p={getActivityFeed:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20;try{return(await Ip.get(`/api/activities?filter=${e}&page=${t}&limit=${n}`)).data}catch(r){throw console.error("Error fetching activity feed:",r),r}},getUserActivity:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20;try{return(await Ip.get(`/api/activities/user/${e}?page=${t}&limit=${n}`)).data}catch(r){throw console.error(`Error fetching user (${e}) activity:`,r),r}},deleteActivity:async e=>{try{return(await Ip.delete(`/api/activities/${e}`)).data}catch(t){throw console.error("Error deleting activity:",t),t}}},Lp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";const{isLoggedIn:t}=ec(),[n,r]=(0,_a.useState)([]),[a,s]=(0,_a.useState)(!1),[i,o]=(0,_a.useState)(null),[l,c]=(0,_a.useState)(e),[u,d]=(0,_a.useState)(1),[h,p]=(0,_a.useState)(!0),[m,f]=(0,_a.useState)(0),g=(0,_a.useCallback)((async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t)try{s(!0),o(null);const t=e?1:u,n=await $p.getActivityFeed(l,t);if(n.success){const a=n.data;r((t=>e?a:[...t,...a])),f(n.total),p(t<n.totalPages),e&&d(1)}}catch(i){var n,a;o((null===(n=i.response)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.error)||"Failed to load activities"),console.error("Error fetching activity feed:",i)}finally{s(!1)}}),[t,l,u]);(0,_a.useEffect)((()=>{g(!0)}),[l,t]);const v=(0,_a.useCallback)((()=>{!a&&h&&d((e=>e+1))}),[a,h]);(0,_a.useEffect)((()=>{u>1&&g()}),[u,g]);const y=(0,_a.useCallback)((e=>{e!==l&&c(e)}),[l]),b=(0,_a.useCallback)((()=>{g(!0)}),[g]);return{activities:n,loading:a,error:i,filter:l,hasMore:h,totalActivities:m,loadMore:v,changeFilter:y,refresh:b}},Fp=e=>{let{userId:t=null}=e;const{isLoggedIn:n,user:r}=ec(),[a,s]=(0,_a.useState)({}),{activities:i,loading:o,error:l,filter:c,hasMore:u,loadMore:d,changeFilter:h,refresh:p}=Lp(t?null:"all"),m=(0,_a.useRef)(),f=(0,_a.useRef)();(0,_a.useEffect)((()=>
4{if(!o)return m.current&&m.current.disconnect(),m.current=new IntersectionObserver((e=>{e[0].isIntersecting&&u&&d()})),f.current&&m.current.observe(f.current),()=>{m.current&&m.current.disconnect()}}),[o,u,d]);const g=e=>{const t=new Date(e),n=new Date,r=Math.floor((n-t)/1e3);if(r<60)return"Just now";if(r<3600){const e=Math.floor(r/60);return`${e} ${1===e?"minute":"minutes"} ago`}if(r<86400){const e=Math.floor(r/3600);return`${e} ${1===e?"hour":"hours"} ago`}if(r<604800){const e=Math.floor(r/86400);return`${e} ${1===e?"day":"days"} ago`}return t.toLocaleDateString()},v=e=>{var t,n,r,a,s,i;return e?null!==(t=e.images)&&void 0!==t&&null!==(n=t.jpg)&&void 0!==n&&n.image_url?e.images.jpg.image_url:null!==(r=e.images)&&void 0!==r&&null!==(a=r.jpg)&&void 0!==a&&a.small_image_url?e.images.jpg.small_image_url:null!==(s=e.images)&&void 0!==s&&null!==(i=s.webp)&&void 0!==i&&i.image_url?e.images.webp.image_url:null:null},y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e4;if(!e||0===e.length)return[];console.log("Time window is set to",t,"milliseconds");const n=[];let r=[e[0]];for(let a=1;a<e.length;a++){const s=e[a],i=r[0],o=new Date(s.createdAt).getTime(),l=new Date(i.createdAt).getTime(),c=Math.abs(o-l);console.log("Activity time difference:",c,"ms"),console.log("Current activity:",new Date(s.createdAt).toLocaleString()),console.log("First activity in group:",new Date(i.createdAt).toLocaleString());const u=s.userId.id===i.userId.id,d=s.itemId.id===i.itemId.id,h=c<=t;console.log("Same user:",u),console.log("Same item:",d),console.log("Close in time:",h),u&&d&&h?(console.log("Grouping activities"),r.push(s)):(console.log("Starting new group"),n.push(r),r=[s])}return r.length>0&&n.push(r),n},b=e=>{if(1===e.length)return(e=>{const{type:t,itemType:n}=e,r=e.data||{},a=e.itemId.title_english||e.itemId.title||e.itemId.name;let s="";switch(t){case"added":if(r.status)switch(r.status){case"planning":s=`added ${a} to their ${"manga"===n?"plan to read":"plan to watch"} list`;break;case"watching":s=`started watching ${a}`;break;case"reading":s=`started reading ${a}`;break;case"completed":s=`added ${a} to their completed list`;break;case"onHold":s=`added ${a} to their on-hold list`;break;case"dropped":s=`added ${a} to their dropped list`;break;default:s=`added ${a} to their ${r.status} list`}else s=`added ${a} to their list`;break;case"updated":if(r.status)switch(r.status){case"planning":s=`moved ${a} to their ${"manga"===n?"plan to read":"plan to watch"} list`;break;case"watching":s=`started watching ${a}`;break;case"reading":s=`started reading ${a}`;break;case"completed":s=`marked ${a} as completed`;break;case"onHold":s=`put ${a} on hold`;break;case"dropped":s=`dropped ${a}`;break;default:s=`updated ${a} to ${r.status}`}else s=`updated ${a}`;break;case"watched":s=`watched ${r.progress||"an episode"} of ${a}`;break;case"read":s=`read ${r.progress||"a chapter"} of ${a}`;break;case"rated":s=`rated ${a} ${r.rating}/10`;break;case"completed":s=`completed ${a}`;break;case"note":s=`added a note to ${a}`;break;default:s=`updated ${a}`}return s})(e[0]);const t=e[0].itemId.title_english||e[0].itemId.title||e[0].itemId.name,n=e.map((e=>e.type));if(n.includes("watched")&&n.includes("completed")){var r;return`watched ${(null===(r=e.find((e=>"watched"===e.type)).data)||void 0===r?void 0:r.progress)||"the final episode"} and completed ${t}`}if(n.includes("completed")&&n.includes("rated")){var a;return`completed ${t} and rated it ${(null===(a=e.find((e=>"rated"===e.type)).data)||void 0===a?void 0:a.rating)||"?"}/10`}if(n.includes("updated")&&n.includes("note")){var s;const n=null===(s=e.find((e=>"updated"===e.type)).data)||void 0===s?void 0:s.status;if(n){let e="";switch(n){case"onHold":e="put on hold";break;case"dropped":e="dropped";break;default:e=`moved to their ${n} list`}return`${e} ${t} and added a note`}return`updated ${t} and added a note`}if(n.includes("watched")&&n.includes("rated")){var i,o;const n=e.find((e=>"watched"===e.type)),r=e.find((e=>"rated"===e.type));return`watched ${(null===(i=n.data)||void 0===i?void 0:i.progress)||"an episode"} of ${t} and rated it ${(null===(o=r.data)||void 0===o?void 0:o.rating)||"?"}/10`}if(n.includes("read")&&n.includes("rated")){var l,c;const n=e.find((e=>"read"===e.type)),r=e.find((e=>"rated"===e.type));return`read ${(null===(l=n.data)||void 0===l?void 0:l.progress)||"a chapter"} of ${t} and rated it ${(null===(c=r.data)||void 0===c?void 0:c.rating)||"?"}/10`}return`${e.map((e=>{switch(e.type){case"added":return"added";case"updated":default:return"updated";case"watched":return"watched an episode of";case"read":return"read a chapter of";case"rated":return"rated";case"completed":return"completed";case"note":return"added a note to"}})).join(", ")} ${t}`};
4return o&&0===i.length?(0,Ti.jsxs)("div",{className:"activity-feed-loading",children:[(0,Ti.jsx)("div",{className:"spinner"}),(0,Ti.jsx)("p",{children:"Loading activity feed..."})]}):l?(0,Ti.jsxs)("div",{className:"activity-feed-error",children:[(0,Ti.jsx)("p",{children:l}),(0,Ti.jsx)("button",{onClick:p,children:"Try Again"})]}):(0,Ti.jsxs)("div",{className:"activity-feed-container",children:[!t&&(0,Ti.jsxs)("div",{className:"activity-feed-header",children:[(0,Ti.jsx)("h2",{children:"Activity Feed"}),(0,Ti.jsxs)("div",{className:"feed-filters",children:[(0,Ti.jsx)("button",{className:"filter-btn "+("all"===c?"active":""),onClick:()=>h("all"),children:"All Activity"}),(0,Ti.jsx)("button",{className:"filter-btn "+("friends"===c?"active":""),onClick:()=>h("friends"),children:"Friends"}),(0,Ti.jsx)("button",{className:"filter-btn "+("you"===c?"active":""),onClick:()=>h("you"),children:"Your Activity"})]})]}),0===i.length?(0,Ti.jsx)("div",{className:"no-activities",children:(0,Ti.jsx)("p",{children:t?"This user has no recent activity.":"No activities to display. Follow more users to see their updates!"})}):(0,Ti.jsxs)("div",{className:"activities-list",children:[y(i).map(((e,t)=>{const o=e[0],l=t===y(i).length-1;return(0,Ti.jsxs)("div",{className:"activity-card",ref:l?f:null,children:[(0,Ti.jsx)("div",{className:"activity-user-avatar",children:(0,Ti.jsx)("img",{src:o.userId.profilePicture||"https://via.placeholder.com/40",alt:o.userId.username})}),(0,Ti.jsxs)("div",{className:"activity-content",children:[(0,Ti.jsxs)("div",{className:"activity-header",children:[(0,Ti.jsx)("a",{href:`/users/${o.userId.id}`,className:"activity-username",children:o.userId.username}),(0,Ti.jsx)("span",{className:"activity-text",children:b(e)})]}),(0,Ti.jsxs)("a",{href:`/${o.itemType}/${o.itemId.id}`,className:"activity-item",children:[(0,Ti.jsx)("div",{className:"activity-item-image",children:(0,Ti.jsx)("img",{src:v(o.itemId)||"https://via.placeholder.com/50x70",alt:o.itemId.title_english||o.itemId.title||o.itemId.name})}),(0,Ti.jsxs)("div",{className:"activity-item-info",children:[(0,Ti.jsx)("p",{className:"activity-item-title",children:o.itemId.title_english||o.itemId.title||o.itemId.name}),(0,Ti.jsx)("span",{className:"activity-item-type",children:o.itemType})]})]}),e.some((e=>"note"===e.type))&&e.filter((e=>"note"===e.type)).map((e=>{var t,n,r,i;return(0,Ti.jsxs)("div",{className:"activity-note",children:[(0,Ti.jsx)("p",{children:(null===(t=e.data)||void 0===t||null===(n=t.note)||void 0===n?void 0:n.length)>100&&!a[e.id]?`"${e.data.note.substring(0,100)}..."`:`"${e.data.note}"`}),(null===(r=e.data)||void 0===r||null===(i=r.note)||void 0===i?void 0:i.length)>100&&(0,Ti.jsx)("button",{className:"note-toggle",onClick:()=>{return t=e.id,void s((e=>({...e,[t]:!e[t]})));var t},children:a[e.id]?"Show less":"Show more"})]},e.id)})),(0,Ti.jsxs)("div",{className:"activity-footer",children:[(0,Ti.jsx)("span",{className:"activity-timestamp",children:g(o.createdAt)}),n&&(0,Ti.jsxs)("div",{className:"activity-actions",children:[(0,Ti.jsx)("button",{className:"action-btn like-btn",children:"Like"}),(0,Ti.jsx)("button",{className:"action-btn comment-btn",children:"Comment"}),r&&r.id===o.userId.id&&(0,Ti.jsx)("button",{className:"action-btn delete-btn",onClick:()=>(async e=>{if(window.confirm("Delete this activity?"))try{for(const t of e)$p&&$p.deleteActivity?await $p.deleteActivity(t.id):await fetch(`https://animedb-production.up.railway.app/api/activities/${t.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${localStorage.getItem("token")}`,"Content-Type":"application/json"}});p()}catch(t){console.error("Error deleting activities:",t),alert("Failed to delete activity. Please try again.")}})(e),children:"Delete"})]})]})]})]},o.id)})),o&&i.length>0&&(0,Ti.jsxs)("div",{className:"loading-more",children:[(0,Ti.jsx)("div",{className:"spinner small"}),(0,Ti.jsx)("p",{children:"Loading more..."})]})]})]})},Mp="https://animedb-production.up.railway.app",Dp=()=>{const[e,t]=(0,_a.useState)([]),[n,r]=(0,_a.useState)(null),[a,s]=(0,_a.useState)([]),[i,o]=(0,_a.useState)(!1),[l,c]=(0,_a.useState)(null),[u,d]=(0,_a.useState)("all"),[h,p]=(0,_a.useState)(1),[m,f]=(0,_a.useState)(!0),[g,v]=(0,_a.useState)(0),y=(0,_a.useRef)(!0);(0,_a.useEffect)((()=>(y.current=!0,()=>{y.current=!1})),[]);const b=(0,_a.useCallback)((async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(y.current)try{o(!0),c(null);
4const n=e?1:h,r=new URLSearchParams;r.append("page",n),r.append("limit",10),"all"!==u&&r.append("category",u);const a=await Gl.get(`${Mp}/api/threads?${r.toString()}`);a.data.success&&y.current&&(e?(t(a.data.data),p(1)):t((e=>[...e,...a.data.data])),v(a.data.total),f(n<a.data.totalPages))}catch(n){console.error("Error fetching threads:",n),y.current&&c("Failed to load threads. Please try again later.")}finally{y.current&&o(!1)}}),[u,h]);(0,_a.useEffect)((()=>{b(!0)}),[u,b]),(0,_a.useEffect)((()=>{h>1&&b()}),[h,b]);const x=(0,_a.useCallback)((e=>{e!==u&&d(e)}),[u]),w=(0,_a.useCallback)((()=>{!i&&m&&p((e=>e+1))}),[i,m]),j=(0,_a.useCallback)((async e=>{if(y.current)try{o(!0),c(null);const t=await Gl.get(`${Mp}/api/threads/${e}`);t.data.success&&y.current&&(r(t.data.data.thread),s(t.data.data.comments))}catch(t){console.error("Error fetching thread:",t),y.current&&c("Failed to load thread. Please try again later.")}finally{y.current&&o(!1)}}),[]),N=(0,_a.useCallback)((async e=>{if(!y.current)return null;try{o(!0),c(null);const t=localStorage.getItem("token"),n=await Gl.post(`${Mp}/api/threads`,e,{headers:{Authorization:`Bearer ${t}`}});if(n.data.success)return n.data.data}catch(r){var t,n;throw console.error("Error creating thread:",r),new Error((null===(t=r.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Failed to create thread")}finally{y.current&&o(!1)}}),[]),S=(0,_a.useCallback)((async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!y.current)return null;try{o(!0),c(null);const r=localStorage.getItem("token"),a=await Gl.post(`${Mp}/api/comments/thread/${e}`,{content:t,parentId:n},{headers:{Authorization:`Bearer ${r}`}});if(a.data.success&&y.current){const e=a.data.data;return s(n?t=>t.map((t=>t._id===n?{...t,replies:[...t.replies||[],e]}:t)):t=>[...t,{...e,replies:[]}]),e}}catch(i){var r,a;throw console.error("Error adding comment:",i),new Error((null===(r=i.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.error)||"Failed to add comment")}finally{y.current&&o(!1)}}),[]),k=(0,_a.useCallback)((async(e,t)=>{if(!y.current)return null;try{o(!0),c(null);const n=localStorage.getItem("token"),r=await Gl.patch(`${Mp}/api/comments/${e}`,{content:t},{headers:{Authorization:`Bearer ${n}`}});if(r.data.success&&y.current){const t=r.data.data;let n=!1,i=null;return a.forEach((t=>{t._id===e?n=!1:t.replies&&t.replies.forEach((r=>{r._id===e&&(n=!0,i=t._id)}))})),s(n&&i?n=>n.map((n=>n._id===i?{...n,replies:n.replies.map((n=>n._id===e?t:n))}:n)):n=>n.map((n=>n._id===e?{...t,replies:n.replies}:n))),t}}catch(i){var n,r;throw console.error("Error updating comment:",i),new Error((null===(n=i.response)||void 0===n||null===(r=n.data)||void 0===r?void 0:r.error)||"Failed to update comment")}finally{y.current&&o(!1)}}),[a]),E=(0,_a.useCallback)((async e=>{if(!y.current)return!1;try{o(!0),c(null);const t=localStorage.getItem("token");if((await Gl.delete(`${Mp}/api/comments/${e}`,{headers:{Authorization:`Bearer ${t}`}})).data.success&&y.current){let t=!1,n=null;return a.forEach((r=>{r._id===e?t=!1:r.replies&&r.replies.forEach((a=>{a._id===e&&(t=!0,n=r._id)}))})),s(t&&n?t=>t.map((t=>t._id===n?{...t,replies:t.replies.filter((t=>t._id!==e))}:t)):t=>t.filter((t=>t._id!==e))),!0}}catch(r){var t,n;throw console.error("Error deleting comment:",r),new Error((null===(t=r.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||"Failed to delete comment")}finally{y.current&&o(!1)}}),[a]),_=(0,_a.useCallback)((()=>{y.current&&(r(null),s([]),c(null))}),[]);return{threads:e,thread:n,comments:a,loading:i,error:l,category:u,hasMore:m,total:g,fetchThreads:b,fetchThread:j,createThread:N,addComment:S,updateComment:k,deleteComment:E,changeCategory:x,loadMore:w,reset:_}},Up=e=>{let{tags:t,size:n="normal"}=e;return t&&0!==t.length?(0,Ti.jsx)("div",{className:"thread-tags "+("small"===n?"thread-tags-small":""),children:t.map(((e,t)=>(0,Ti.jsxs)("span",{className:"thread-tag",children:["#",e]},`${e}-${t}`)))}):null},zp=e=>{let{thread:t,onClick:n}=e;const r=t.associatedMediaType&&t.associatedMediaId;return(0,Ti.jsxs)("div",{className:"thread-item",onClick:()=>n&&n(t),children:[(0,Ti.jsxs)("div",{className:"thread-item-header",children:[(0,Ti.jsxs)("div",{className:"thread-item-user",children:[(0,Ti.jsx)("img",{src:t.userId.profilePicture||"/default-avatar.png",alt:t.userId.username,className:"thread-user-avatar"}),(0,Ti.jsx)("span",{className:"thread-username",children:t.userId.username})]}),(0,Ti.jsxs)("div",{className:"thread-item-meta",children:[(0,Ti.jsx)("span",{className:"thread-date",children:(s=t.createdAt,new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}),(0,Ti.jsx)("span",{className:"thread-category",children:t.category})]})]}),r&&(0,Ti.jsxs)("div",{className:"thread-associated-media",children:[(0,Ti.jsx)("div",{className:"thread-media-badge",style:{background:`var(--${t.associatedMediaType}-accent-primary)`},children:"anime"===t.associatedMediaType?"Anime":"Manga"}),(0,Ti.jsxs)("div",{className:"thread-media-content",children:[t.associatedMediaImage&&(0,Ti.jsx)("img",{src:t.associatedMediaImage,alt:t.associatedMediaTitle,className:"thread-media-image"}),(0,Ti.jsx)("span",{className:"thread-media-title",children:t.associatedMediaTitle})]})]}),(0,Ti.jsx)("h3",{className:"thread-item-title",children:t.title}),t.content&&(0,Ti.jsx)("div",{className:"thread-item-preview",children:(a=t.content,a?a.length<=150?a:a.substring(0,150)+"...":"")}),t.tags&&t.tags.length>0&&(0,Ti.jsx)(Up,{tags:t.tags,size:"small"}),(0,Ti.jsxs)("div",{className:"thread-item-footer",children:[(0,Ti.jsxs)("div",{className:"thread-stats",children:[(0,Ti.jsxs)("span",{className:"thread-comments",children:[(0,Ti.jsx)("i",{className:"icon-comment"})," ",t.commentCount||0," comments"]}),(0,Ti.jsxs)("span",{className:"thread-views",children:[(0,Ti.jsx)("i",{className:"icon-eye"})," ",t.views," views"]})]}),t.isPinned&&(0,Ti.jsx)("div",{className:"thread-pinned",children:"Pinned"})]})]});var a,s},qp=e=>{let{threads:t,loading:n,error:r,hasMore:a,onLoadMore:s,onThreadClick:i}=e;const o=(0,_a.useRef)(null),l=(0,_a.useRef)(null),c=(0,_a.useRef)(!0);return(0,_a.useEffect)((()=>(c.current=!0,()=>{c.current=!1})),[]),(0,_a.useEffect)((()=>
4{if(!n)return o.current&&o.current.disconnect(),o.current=new IntersectionObserver((e=>{e[0].isIntersecting&&a&&c.current&&s()})),l.current&&o.current.observe(l.current),()=>{o.current&&o.current.disconnect()}}),[n,a,s]),r?(0,Ti.jsxs)("div",{className:"thread-list-error",children:[(0,Ti.jsx)("p",{children:r}),(0,Ti.jsx)("button",{onClick:s,children:"Try Again"})]}):(0,Ti.jsx)("div",{className:"thread-list",children:0!==t.length||n?(0,Ti.jsxs)(Ti.Fragment,{children:[t.map(((e,n)=>(0,Ti.jsx)("div",{ref:n===t.length-1?l:null,children:(0,Ti.jsx)(zp,{thread:e,onClick:i})},e.id))),n&&(0,Ti.jsxs)("div",{className:"loading-threads",children:[(0,Ti.jsx)("div",{className:"spinner"}),(0,Ti.jsx)("p",{children:"Loading threads..."})]}),!n&&a&&t.length>0&&(0,Ti.jsx)("button",{className:"load-more-btn",onClick:()=>c.current&&s(),children:"Load More"})]}):(0,Ti.jsx)("div",{className:"no-threads",children:(0,Ti.jsx)("p",{children:"No discussions found in this category. Start a new thread!"})})})},Bp=e=>{let{onSubmit:t,onCancel:n,initialValue:r="",placeholder:a="Write a comment...",submitButtonText:s="Submit"}=e;const[i,o]=(0,_a.useState)(r),l=(0,_a.useRef)(!0);(0,_a.useEffect)((()=>(l.current=!0,()=>{l.current=!1})),[]),(0,_a.useEffect)((()=>{l.current&&o(r)}),[r]);return(0,Ti.jsxs)("form",{className:"comment-form",onSubmit:e=>{e.preventDefault(),l.current&&i.trim()&&(t(i),!r&&l.current&&o(""))},children:[(0,Ti.jsx)("textarea",{className:"comment-textarea",placeholder:a,value:i,onChange:e=>l.current&&o(e.target.value),required:!0,autoFocus:!!r}),(0,Ti.jsxs)("div",{className:"comment-form-actions",children:[n&&(0,Ti.jsx)("button",{type:"button",className:"cancel-comment",onClick:()=>{l.current&&n&&n()},children:"Cancel"}),(0,Ti.jsx)("button",{type:"submit",className:"submit-comment",disabled:!i.trim(),children:s})]})]})},Hp=e=>{let{comment:t,currentUser:n,onReply:r,isReplying:a,onCancelReply:s,onSubmitReply:i,onEdit:o,isEditing:l,onCancelEdit:c,onSubmitEdit:u,onDelete:d}=e;const h=(0,_a.useRef)(!0);(0,_a.useEffect)((()=>(h.current=!0,()=>{h.current=!1})),[]);const p=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),m="[Comment deleted]"===t.content||!t.userId;return(0,Ti.jsxs)("div",{className:"comment-item",children:[(0,Ti.jsxs)("div",{className:"comment-main",children:[(0,Ti.jsx)("div",{className:"comment-header",children:m?(0,Ti.jsxs)("div",{className:"comment-deleted-user",children:[(0,Ti.jsx)("span",{children:"Deleted User"}),(0,Ti.jsx)("span",{className:"comment-date",children:p(t.createdAt)})]}):(0,Ti.jsxs)("div",{className:"comment-user",children:[(0,Ti.jsx)("img",{src:t.userId.profilePicture||"/default-avatar.png",alt:t.userId.username,className:"comment-user-avatar"}),(0,Ti.jsx)("span",{className:"comment-username",children:t.userId.username}),(0,Ti.jsx)("span",{className:"comment-date",children:p(t.createdAt)}),t.isEdited&&(0,Ti.jsx)("span",{className:"comment-edited",title:((e,t)=>{const n=new Date(e),r=new Date(t);if(r-n<1e3)return"";const a=Math.floor((r-n)/1e3);if(a<60)return"just now";if(a<3600){const e=Math.floor(a/60);return`${e} ${1===e?"minute":"minutes"} after posting`}if(a<86400){const e=Math.floor(a/3600);return`${e} ${1===e?"hour":"hours"} after posting`}{const e=Math.floor(a/86400);return`${e} ${1===e?"day":"days"} after posting`}})(t.createdAt,t.updatedAt),children:"(edited)"})]})}),l?(0,Ti.jsx)(Bp,{initialValue:t.content,onSubmit:e=>{h.current&&u&&u(e)},onCancel:c,submitButtonText:"Update",placeholder:"Edit your comment..."}):(0,Ti.jsx)("div",{className:"comment-content",children:t.content}),!l&&!m&&n&&(0,Ti.jsxs)("div",{className:"comment-actions",children:[(0,Ti.jsx)("button",{className:"reply-button",onClick:()=>{h.current&&r&&r()},children:"Reply"}),n.id===t.userId.id&&(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)("button",{className:"edit-button",onClick:()=>{h.current&&o&&o()},children:"Edit"}),(0,Ti.jsx)("button",{className:"delete-button",onClick:()=>{h.current&&d&&d()},children:"Delete"})]})]}),a&&(0,Ti.jsx)("div",{className:"reply-form",children:(0,Ti.jsx)(Bp,{onSubmit:e=>{h.current&&i&&i(e)},onCancel:s,placeholder:`Reply to ${t.userId.username}...`})})]}),t.replies&&t.replies.length>0&&(0,Ti.jsx)("div",{className:"comment-replies",children:t.replies.map((e=>(0,Ti.jsx)(Hp,{comment:e,currentUser:n,onReply:()=>r(e.id),isReplying:a===e.id,onCancelReply:s,onSubmitReply:t=>i(t,e.id),onEdit:()=>o(e.id),isEditing:l===e.id,onCancelEdit:c,onSubmitEdit:t=>u(e.id,t),onDelete:()=>d(e.id)},e.id)))})]})},Qp=Hp,Wp=e=>{let{threadId:t,thread:n,comments:r,loading:a,error:s,onBack:i}=e;const{isLoggedIn:o,user:l}=ec(),[c,u]=(0,_a.useState)(null),[d,h]=(0,_a.useState)(null),[p,m]=(0,_a.useState)([]),f=(0,_a.useRef)(!0),{addComment:g,updateComment:v,deleteComment:y}=Dp();(0,_a.useEffect)((()=>(f.current=!0,()=>{f.current=!1})),[]),(0,_a.useEffect)((()=>{r&&f.current&&m(r)}),[r]);const b=n&&n.associatedMediaType&&n.associatedMediaId,x=()=>{f.current&&u(null)},w=()=>{f.current&&h(null)};return a?(0,Ti.jsxs)("div",{className:"thread-detail-loading",children:[(0,Ti.jsx)("div",{className:"spinner"}),(0,Ti.jsx)("p",{children:"Loading thread..."})]}):s?(0,Ti.jsxs)("div",{className:"thread-detail-error",children:[(0,Ti.jsx)("p",{children:s}),(0,Ti.jsx)("button",{onClick:i,children:"Go Back"})]}):n?(0,Ti.jsxs)("div",{className:"thread-detail",children:[(0,Ti.jsx)("button",{className:"back-button",onClick:i,children:"\u2190 Back to Discussions"}),(0,Ti.jsxs)("div",{className:"thread-detail-header",children:[(0,Ti.jsx)("h2",{className:"thread-detail-title",children:n.title}),(0,Ti.jsxs)("div",{className:"thread-detail-meta",children:[(0,Ti.jsxs)("div",{className:"thread-detail-user",children:[(0,Ti.jsx)("img",{src:n.userId.profilePicture||"/default-avatar.png",alt:n.userId.username,className:"thread-user-avatar"}),(0,Ti.jsx)("span",{className:"thread-username",children:n.userId.username})]}),(0,Ti.jsxs)("div",{className:"thread-detail-info",children:[(0,Ti.jsx)("span",{className:"thread-date",children:(N=n.createdAt,new Date(N).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}))}),(0,Ti.jsx)("span",{className:"thread-category",children:n.category}),(0,Ti.jsxs)("span",{className:"thread-views",children:[n.views," views"]})]})]}),b&&(0,Ti.jsx)("div",{className:"thread-detail-media",children:(0,Ti.jsxs)("a",{href:`/${n.category}/${n.associatedMediaId}`,children:[(0,Ti.jsx)("div",{className:"thread-detail-media-header",children:(0,Ti.jsxs)("div",{className:"thread-detail-media-badge",style:{background:`var(--${n.associatedMediaType}-accent-primary)`},children:["anime"===n.associatedMediaType?"Anime":"Manga"," Discussion"]})}),(0,Ti.jsxs)("div",{className:"thread-detail-media-content",children:[n.associatedMediaImage&&(0,Ti.jsx)("img",{src:n.associatedMediaImage,alt:n.associatedMediaTitle,className:"thread-detail-media-image"}),(0,Ti.jsxs)("div",{className:"thread-detail-media-info",children:[(0,Ti.jsx)("h3",{className:"thread-detail-media-title",children:n.associatedMediaTitle}),(0,Ti.jsx)("p",{className:"thread-detail-media-type",children:"anime"===n.associatedMediaType?"Anime":"Manga"})]})]})]},n.associatedMediaId)}),n.tags&&n.tags.length>0&&(0,Ti.jsx)(Up,{tags:n.tags})]}),(0,Ti.jsx)("div",{className:"thread-content",children:(j=n.content,j?j.split("\n").map(((e,t)=>(0,Ti.jsx)("p",{children:e},t))):"")}),o&&(0,Ti.jsx)("div",{className:"thread-reply-form",children:(0,Ti.jsxs)("div",{className:"reply-form-container",children:[(0,Ti.jsx)("img",{src:l.profilePicture||"/default-avatar.png",alt:l.username,className:"reply-user-avatar"}),(0,Ti.jsxs)("form",{className:"quick-reply-form",onSubmit:e=>{e.preventDefault();const n=e.target.elements.quickReply;n.value.trim()&&((async e=>{if(f.current)try{const n=await g(t,e);f.current&&n&&m((e=>[...e,{...n,replies:[]}]))}
4catch(n){f.current&&alert("Failed to submit comment. Please try again.")}})(n.value),n.value="")},children:[(0,Ti.jsx)("input",{type:"text",name:"quickReply",className:"quick-reply-input",placeholder:"Write a comment..."}),(0,Ti.jsx)("button",{type:"submit",className:"quick-reply-button",children:"Post"})]})]})}),!o&&(0,Ti.jsx)("div",{className:"comment-login-prompt",children:(0,Ti.jsx)("p",{children:"Please log in to join the discussion."})}),(0,Ti.jsx)("div",{className:"comments-header",children:(0,Ti.jsxs)("div",{className:"comments-count",children:[(0,Ti.jsx)("span",{className:"comments-count-number",children:p.length}),(0,Ti.jsx)("span",{className:"comments-count-text",children:1===p.length?"Comment":"Comments"})]})}),(0,Ti.jsx)("div",{className:"thread-comments",children:0===p.length?(0,Ti.jsx)("div",{className:"no-comments",children:(0,Ti.jsx)("p",{children:"Be the first to comment on this discussion."})}):(0,Ti.jsx)("div",{className:"comments-list",children:p.map((e=>(0,Ti.jsx)(Qp,{comment:e,currentUser:l,onReply:()=>{return t=e.id,void(f.current&&(u(t),h(null)));var t},isReplying:c===e.id,onCancelReply:x,onSubmitReply:n=>(async(e,n)=>{if(f.current)try{const r=await g(t,e,n);f.current&&r&&(m((e=>e.map((e=>e.id===n?{...e,replies:[...e.replies||[],r]}:e)))),u(null))}catch(r){f.current&&alert("Failed to submit reply. Please try again.")}})(n,e.id),onEdit:()=>{return t=e.id,void(f.current&&(h(t),u(null)));var t},isEditing:d===e.id,onCancelEdit:w,onSubmitEdit:t=>(async(e,t)=>{if(f.current)try{const n=await v(e,t);f.current&&n&&(m((t=>{const r=t.findIndex((t=>t.id===e));if(-1!==r){const e=[...t];return e[r]={...n,replies:t[r].replies||[]},e}return t.map((t=>t.replies&&t.replies.some((t=>t.id===e))?{...t,replies:t.replies.map((t=>t.id===e?n:t))}:t))})),h(null))}catch(n){f.current&&alert("Failed to update comment. Please try again.")}})(e.id,t),onDelete:()=>(async e=>{if(f.current&&window.confirm("Are you sure you want to delete this comment?"))try{const t=await y(e);f.current&&t&&m((t=>-1!==t.findIndex((t=>t.id===e))?t.filter((t=>t.id!==e)):t.map((t=>t.replies&&t.replies.some((t=>t.id===e))?{...t,replies:t.replies.filter((t=>t.id!==e))}:t))))}catch(t){f.current&&alert("Failed to delete comment. Please try again.")}})(e.id)},e.id)))})})]}):(0,Ti.jsxs)("div",{className:"thread-detail-error",children:[(0,Ti.jsx)("p",{children:"Thread not found"}),(0,Ti.jsx)("button",{onClick:i,children:"Go Back"})]});var j,N},Vp=e=>{var t,n;let{onSelect:r,mediaType:a,initialValue:s=null}=e;const[i,o]=(0,_a.useState)(""),[l,c]=(0,_a.useState)([]),[u,d]=(0,_a.useState)(!1),[h,p]=(0,_a.useState)(!1),[m,f]=(0,_a.useState)(s),g=(0,_a.useRef)(null),v=(0,_a.useRef)(null);(0,_a.useEffect)((()=>{const e=e=>{v.current&&!v.current.contains(e.target)&&p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);return(0,Ti.jsxs)("div",{className:"media-search relative",children:[(0,Ti.jsxs)("div",{className:"flex items-center",children:[(0,Ti.jsx)("input",{type:"text",value:i,onChange:e=>{const t=e.target.value;o(t),g.current&&clearTimeout(g.current),g.current=setTimeout((()=>{(async e=>{if(e.trim()){d(!0);try{const t=`/api/${a}/search?query=${encodeURIComponent(e)}`;console.log(`Searching ${a} using endpoint: ${t}`);const n=await Gl.get(t),r=Array.isArray(n.data)?n.data:n.data.data||[];console.log(`Found ${r.length} results`),c(r)}catch(t){console.error("Error searching media:",t),c([])}finally{d(!1)}}else c([])})(t)}),300),t.trim()?p(!0):p(!1)},placeholder:`Search for ${a}...`,className:"media-search-input"}),m&&(0,Ti.jsx)("button",{onClick:()=>{f(null),o(""),r(null)},className:"media-clear-btn","aria-label":"Clear selection",children:"\u2715"})]}),h&&(0,Ti.jsx)("div",{ref:v,className:"media-search-dropdown",children:u?(0,Ti.jsx)("div",{className:"media-search-loading",children:"Loading..."}):l.length>0?(0,Ti.jsx)("ul",{className:"media-search-results",children:l.map((e=>{var t,n;return(0,Ti.jsxs)("li",{onClick:()=>(e=>{var t,n;f(e),o(e.title||e.title_english||e.name),p(!1),r({id:e._id,type:a,title:e.title||e.title_english||e.name,image:e.image||(null===(t=e.images)||void 0===t||null===(n=t.jpg)||void 0===n?void 0:n.image_url)})})(e),className:"media-search-item",children:[(null===(t=e.images)||void 0===t||null===(n=t.jpg)||void 0===n?void 0:n.image_url)&&(0,Ti.jsx)("img",{src:e.images.jpg.image_url,alt:e.title,className:"media-item-image"}),(0,Ti.jsxs)("div",{className:"media-item-info",children:[(0,Ti.jsx)("div",{className:"media-item-title",children:e.title||e.title_english||e.name}),(0,Ti.jsx)("div",{className:"media-item-details",children:"anime"===a?`${e.type||"Unknown"} \u2022 Score: ${e.score||"N/A"}`:`${e.type||"Manga"} \u2022 Score: ${e.score||"N/A"}`})]})]},e._id)}))}):i.length>0?(0,Ti.jsx)("div",{className:"media-search-no-results",children:"No results found"}):null}),m&&(0,Ti.jsxs)("div",{className:"media-selected-container",children:[(null===(t=m.images)||void 0===t||null===(n=t.jpg)||void 0===n?void 0:n.image_url)&&(0,Ti.jsx)("img",{src:m.images.jpg.image_url,alt:m.title,className:"media-selected-image"}),(0,Ti.jsxs)("div",{className:"media-selected-info",children:[(0,Ti.jsx)("div",{className:"media-selected-title",children:m.title||m.title_english||m.name}
4),(0,Ti.jsx)("div",{className:"media-selected-details",children:"anime"===a?`${m.type||"Unknown"} \u2022 Score: ${m.score||"N/A"}`:`${m.type||"Manga"} \u2022 Score: ${m.score||"N/A"}`})]})]})]})},Kp=e=>{let{onCancel:t,onSuccess:n}=e;const[r,a]=(0,_a.useState)(""),[s,i]=(0,_a.useState)(""),[o,l]=(0,_a.useState)("general"),[c,u]=(0,_a.useState)(""),[d,h]=(0,_a.useState)(!1),[p,m]=(0,_a.useState)(null),[f,g]=(0,_a.useState)(!1),[v,y]=(0,_a.useState)("anime"),[b,x]=(0,_a.useState)(null),w=(0,_a.useRef)(!0),{createThread:j}=Dp();(0,_a.useEffect)((()=>(w.current=!0,()=>{w.current=!1})),[]);(0,_a.useEffect)((()=>{"anime"===o&&"anime"!==v?y("anime"):"manga"===o&&"manga"!==v&&y("manga")}),[o,v]);return(0,Ti.jsxs)("div",{className:"create-thread",children:[(0,Ti.jsx)("h2",{className:"section-title",children:"Create New Thread"}),p&&(0,Ti.jsx)("div",{className:"create-thread-error",children:p}),(0,Ti.jsxs)("form",{className:"thread-form",onSubmit:async e=>{if(e.preventDefault(),w.current)if(r.trim()&&s.trim()){h(!0),m(null);try{const e=c.split(",").map((e=>e.trim())).filter((e=>e.length>0)),t={title:r,content:s,category:o,tags:e};b&&(t.associatedMediaType=b.type,t.associatedMediaId=b.id,t.associatedMediaTitle=b.title,t.associatedMediaImage=b.image);const a=await j(t);a&&w.current&&n(a)}catch(t){console.error("Error creating thread:",t),w.current&&m(t.message||"Failed to create thread. Please try again.")}finally{w.current&&h(!1)}}else m("Please provide both a title and content for your thread.")},children:[(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsx)("label",{htmlFor:"thread-title",children:"Title"}),(0,Ti.jsx)("input",{type:"text",id:"thread-title",className:"thread-title-input",value:r,onChange:e=>a(e.target.value),placeholder:"Give your thread a title...",maxLength:200,disabled:d,required:!0})]}),(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsx)("label",{htmlFor:"thread-category",children:"Category"}),(0,Ti.jsx)("select",{id:"thread-category",className:"thread-category-select",value:o,onChange:e=>l(e.target.value),disabled:d,children:[{id:"general",name:"General"},{id:"anime",name:"Anime"},{id:"manga",name:"Manga"},{id:"recommendations",name:"Recommendations"},{id:"news",name:"News & Events"},{id:"other",name:"Other"}].map((e=>(0,Ti.jsx)("option",{value:e.id,children:e.name},e.id)))})]}),(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsxs)("div",{className:"media-association-header",children:[(0,Ti.jsxs)("label",{children:["Associate with ","anime"===v?"an Anime":"a Manga",(0,Ti.jsx)("span",{className:"optional",children:" (Optional)"})]}),(0,Ti.jsx)("button",{type:"button",className:"toggle-media-btn "+(f?"active":""),onClick:()=>{g(!f),!f&&b&&x(null)},disabled:d,children:f?"Cancel":"Link "+("anime"===v?"Anime":"Manga")})]}),f&&(0,Ti.jsxs)("div",{className:"media-search-container",children:[(0,Ti.jsxs)("div",{className:"media-type-selector",children:[(0,Ti.jsx)("label",{htmlFor:"media-type",className:"media-type-label",children:"Type:"}),(0,Ti.jsx)("select",{id:"media-type",className:"media-type-select",value:v,onChange:e=>y(e.target.value),disabled:d,children:[{id:"anime",name:"Anime"},{id:"manga",name:"Manga"}].map((e=>(0,Ti.jsx)("option",{value:e.id,children:e.name},e.id)))})]}),(0,Ti.jsx)(Vp,{onSelect:e=>{x(e)},mediaType:v,initialValue:null})]})]}),(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsx)("label",{htmlFor:"thread-content",children:"Content"}),(0,Ti.jsx)("textarea",{id:"thread-content",className:"thread-content-textarea",value:s,onChange:e=>i(e.target.value),placeholder:"Write your thoughts...",rows:10,disabled:d,required:!0})]}),(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsxs)("label",{htmlFor:"thread-tags",children:["Tags ",(0,Ti.jsx)("span",{className:"optional",children:"(Optional, comma-separated)"})]}),(0,Ti.jsx)("input",{type:"text",id:"thread-tags",className:"thread-tags-input",value:c,onChange:e=>u(e.target.value),placeholder:"e.g. shounen, action, recommendations",disabled:d})]}),(0,Ti.jsxs)("div",{className:"thread-form-actions",children:[(0,Ti.jsx)("button",{type:"button",className:"cancel-thread",onClick:()=>{w.current&&t()},disabled:d,children:"Cancel"}),(0,Ti.jsx)("button",{type:"submit",className:"submit-thread",disabled:d||!r.trim()||!s.trim(),children:d?"Creating...":"Create Thread"})]})]})]})},Gp=()=>{const[e,t]=(0,_a.useState)("list"),[n,r]=(0,_a.useState)(null),a=(0,ki.Zp)(),s=(0,ki.zy)(),i=(0,_a.useRef)(!0),{threads:o,thread:l,comments:c,loading:u,error:d,category:h,hasMore:p,fetchThread:m,changeCategory:f,loadMore:g,reset:v}=Dp();(0,_a.useEffect)((()=>(i.current=!0,()=>{i.current=!1,v&&v()})),[v]);const y=()=>{i.current&&(t("list"),r(null),a("/community?tab=discussions",{replace:!0}))};return(0,_a.useEffect)((()=>{(()=>{if(!i.current)return;const e=new URLSearchParams(s.search),n=e.get("thread"),a=e.get("action");n?(r(n),t("detail"),m(n)):"create"===a?t("create"):(t("list"),r(null))})()}),[s,m]),(0,Ti.jsxs)("div",{className:"discussions-container",children:["list"===e&&(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsxs)("div",{className:"discussions-header",children:[(0,Ti.jsx)("h2",{className:"section-title",children:"Discussions"}),(0,Ti.jsx)("button",{className:"create-thread-btn",onClick:()=>{i.current&&(t("create"),a("/community?tab=discussions&action=create",{replace:!0}))},children:"Start a New Thread"})]}),(0,Ti.jsx)("div",{className:"categories-filter",children:[{id:"all",name:"All Discussions"},{id:"general",name:"General"},{id:"anime",name:"Anime"},{id:"manga",name:"Manga"},{id:"recommendations",name:"Recommendations"},{id:"news",name:"News & Events"},{id:"other",name:"Other"}].map((e=>(0,Ti.jsx)("button",{className:"category-btn "+(h===e.id?"active":""),onClick:()=>f(e.id),children:e.name},e.id)))}),(0,Ti.jsx)(qp,{threads:o,loading:u,error:d,hasMore:p,onLoadMore:g,onThreadClick:e=>{i.current&&(r(e.id),t("detail"),a(`/community?tab=discussions&thread=${e.id}`,{replace:!0}),m(e.id))}})]}),"detail"===e&&n&&(0,Ti.jsx)(Wp,{threadId:n,thread:l,comments:c,loading:u,error:d,onBack:y}),"create"===e&&(0,Ti.jsx)(Kp,{onCancel:y,onSuccess:e=>{i.current&&(r(e.id),t("detail"),a(`/community?tab=discussions&thread=${e.id}`,{replace:!0}),m(e.id))}})]})},Yp=()=>{const{isLoggedIn:e}=ec(),[t,n]=(0,_a.useState)(""),[r,a]=(0,_a.useState)([]),[s,i]=(0,_a.useState)(!1),[o,l]=(0,_a.useState)(null),c=(0,_a.useRef)(!0);(0,_a.useEffect)((()=>(c.current=!0,()=>{c.current=!1})),[]);return(0,Ti.jsxs)("div",{className:"user-search-container",children:[(0,Ti.jsx)("h2",{className:"section-title",children:"Find Users"}),(0,Ti.jsx)("form",{className:"search-form",onSubmit:async e=>{if(e.preventDefault(),t.trim()&&c.current)try{i(!0),l(null);const e=await Gl.get(`https://animedb-production.up.railway.app/
4api/users/search?query=${encodeURIComponent(t)}`);c.current&&(e.data.success?a(e.data.data):a(e.data))}catch(n){console.error("Error searching users:",n),c.current&&l("Failed to search users. Please try again.")}finally{c.current&&i(!1)}},children:(0,Ti.jsxs)("div",{className:"search-input-container",children:[(0,Ti.jsx)("input",{type:"text",className:"search-input",placeholder:"Search by username...",value:t,onChange:e=>n(e.target.value)}),(0,Ti.jsx)("button",{className:"search-button",type:"submit",disabled:s||!t.trim(),children:"Search"})]})}),o&&(0,Ti.jsx)("div",{className:"search-error",children:o}),s?(0,Ti.jsxs)("div",{className:"loading-results",children:[(0,Ti.jsx)("div",{className:"spinner"}),(0,Ti.jsx)("p",{children:"Searching users..."})]}):t.trim()?0===r.length?(0,Ti.jsx)("div",{className:"no-users-found",children:(0,Ti.jsx)("p",{children:"No users found matching your search."})}):(0,Ti.jsx)("div",{className:"user-results",children:r.map((e=>(0,Ti.jsx)("a",{href:`/users/${e._id}`,className:"user-card",children:(0,Ti.jsxs)("div",{className:"user-info",children:[(0,Ti.jsx)("div",{className:"user-avatar",children:(0,Ti.jsx)("img",{src:e.profilePicture||"/default-avatar.png",alt:e.username})}),(0,Ti.jsxs)("div",{className:"user-details",children:[(0,Ti.jsx)("p",{className:"username",children:e.username}),e.bio&&(0,Ti.jsx)("p",{className:"user-bio",children:e.bio})]})]})},e._id)))}):(0,Ti.jsx)("div",{className:"search-instructions",children:(0,Ti.jsx)("p",{children:"Search for users by username to find other anime fans in the community."})})]})},Jp=()=>{const{isLoggedIn:e,user:t}=ec(),[n,r]=(0,_a.useState)("feed");(0,_a.useEffect)((()=>{const e=new URLSearchParams(window.location.search).get("tab");e&&["feed","discussions","users"].includes(e)&&r(e)}),[]);const a=e=>{r(e);const t=new URL(window.location.href);t.searchParams.set("tab",e),"discussions"!==e&&(t.searchParams.delete("thread"),t.searchParams.delete("action")),window.history.pushState({},"",t.toString())};return(0,Ti.jsxs)("div",{className:"community-page",children:[(0,Ti.jsxs)("div",{className:"community-page-title-container",children:[(0,Ti.jsx)("h1",{className:"community-page-title",children:"Community"}),(0,Ti.jsx)("p",{className:"community-page-subtitle",children:"Connect with fellow anime and manga enthusiasts"})]}),(0,Ti.jsxs)("div",{className:"community-tabs",children:[(0,Ti.jsx)("button",{className:"tab-button "+("feed"===n?"active":""),onClick:()=>a("feed"),children:"Activity Feed"}),(0,Ti.jsx)("button",{className:"tab-button "+("discussions"===n?"active":""),onClick:()=>a("discussions"),children:"Discussions"}),(0,Ti.jsx)("button",{className:"tab-button "+("users"===n?"active":""),onClick:()=>a("users"),children:"Find Users"})]}),(0,Ti.jsx)("div",{className:"community-content",children:e?"feed"===n?(0,Ti.jsx)(Fp,{}):"discussions"===n?(0,Ti.jsx)(Gp,{}):(0,Ti.jsx)(Yp,{}):(0,Ti.jsx)("div",{className:"login-prompt",children:(0,Ti.jsxs)("div",{className:"login-prompt-content",children:[(0,Ti.jsx)("h2",{children:"Join the Community"}),(0,Ti.jsx)("p",{children:"Log in or create an account to participate in discussions and follow other anime fans!"}),(0,Ti.jsxs)("div",{className:"login-prompt-buttons",children:[(0,Ti.jsx)("a",{href:"/login",className:"login-button",children:"Login"}),(0,Ti.jsx)("a",{href:"/signup",className:"signup-button",children:"Sign Up"})]})]})})})]})},Xp=()=>(_a.useEffect((()=>{const e=document.createElement("style");return e.innerHTML="\n @keyframes gradient-animation {\n 0% { background-position: 0% 50%; }\n 25% { background-position: 50% 100%; }\n 50% { background-position: 100% 50%; }\n 75% { background-position: 50% 0%; }\n 100% { background-position: 0% 50%; }\n }\n ",document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]),(0,Ti.jsx)("div",{className:"development-banner",style:{position:"fixed",top:80,left:0,width:"100%",color:"white",textAlign:"center",padding:"10px 20px",zIndex:999,boxShadow:"0 4px 15px rgba(0, 0, 0, 0.3)",backdropFilter:"blur(5px)",display:"flex",justifyContent:"center",alignItems:"center",background:"linear-gradient(-45deg, #6c5ce7, #a393f5, #5d4ddb, #8e7cf3, #7a66e8, #a393f5)",backgroundSize:"400% 400%",animation:"gradient-animation 8s ease infinite",borderBottom:"1px solid rgba(255, 255, 255, 0.2)",borderTop:"1px solid rgba(255, 255, 255, 0.2)"},children:(0,Ti.jsx)("p",{style:{margin:0,textShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"},children:"\ud83d\udea7 This site is currently under development. Some features may not work as expected. Last updated: April 11, 2025 \ud83d\udea7"})})),Zp=()=>{const e=(0,ki.Zp)(),[t,n]=(0,_a.useState)(""),r=["Not all those who wander are lost, but you definitely are.","Your page may be gone, but your anime journey continues!","Even Zoro from One Piece wouldn't get this lost.","This page has disappeared faster than ninjas in N
4aruto.","Looks like this page went to the Shadow Realm.","This page is more elusive than a legendary Pok\xe9mon.","The page you're looking for has gone beyond Plus Ultra!","You thought it was a valid page, but it was me, 404!","This page has gone on a training arc and will return stronger.","Even the Dragon Balls can't summon this page."];(0,_a.useEffect)((()=>{const e=Math.floor(Math.random()*r.length);n(r[e])}),[]);return(0,Ti.jsx)("div",{className:"not-found",children:(0,Ti.jsxs)("div",{className:"not-found-content",children:[(0,Ti.jsx)("h1",{children:"404"}),(0,Ti.jsx)("div",{className:"character",children:(0,Ti.jsxs)("div",{className:"character-face",children:[(0,Ti.jsx)("div",{className:"eyes"}),(0,Ti.jsx)("div",{className:"mouth"})]})}),(0,Ti.jsx)("h2",{children:"Page Not Found"}),(0,Ti.jsx)("p",{className:"quote",children:t}),(0,Ti.jsx)("p",{className:"subtitle",children:"The page you're looking for doesn't exist or has been moved."}),(0,Ti.jsxs)("div",{className:"not-found-actions",children:[(0,Ti.jsx)("button",{className:"back-button",onClick:()=>{e(-1)},children:"Go Back"}),(0,Ti.jsx)(ki.N_,{to:"/",className:"home-button",children:"Return Home"})]})]})})},em=()=>{const[e,t]=(0,_a.useState)({});return(0,Ti.jsxs)("div",{className:"faq-container",children:[(0,Ti.jsxs)("div",{className:"faq-page-title-container",children:[(0,Ti.jsx)("h1",{className:"faq-page-title",children:"FAQ"}),(0,Ti.jsx)("p",{className:"faq-page-subtitle",children:"Find answers to common questions about our anime community platform"})]}),(0,Ti.jsx)("div",{className:"faq-items",children:[{id:1,question:"What is this site about?",answer:"This site started as a passion project born from a love of anime and its community. It's designed to be versatile and user-driven - you can use it to discover new anime and manga, track your watch/read lists, write reviews, participate in discussions, and connect with other anime enthusiasts. We believe in creating a space that serves the community in whatever way they find most valuable."},{id:2,question:"Do I need an account to use this site?",answer:"No, you don't need an account to browse our extensive collection of anime, manga, and character information. However, creating a free account unlocks all features including personalized tracking lists, the ability to write reviews, participate in discussions, and customize your profile to showcase your anime journey."},{id:3,question:"How do you handle age-restricted or explicit content?",answer:"We display clear content badges to indicate when material contains explicit themes. These warnings appear before you access the content, allowing you to make informed decisions. Additionally, detailed content ratings are available in each title's information page to help you understand what to expect."},{id:4,question:"How extensive is your anime and manga database?",answer:"Our database is comprehensive and growing daily. We currently feature approximately 30,000 anime titles, 75,000 manga series, and 40,000 character profiles. Our team continually adds new content to ensure our library remains up-to-date with the latest releases and discoveries from anime history."},{id:5,question:"Is there a mobile app available?",answer:"We're currently developing a native iOS app that will be available soon. In the meantime, our website is fully responsive and optimized for mobile browsers, allowing you to enjoy a seamless experience on any device."},{id:6,question:"How often is new content added?",answer:"New content is added around the clock. Our team works continuously to update the database with new anime, manga, and character information as it becomes available. This ensures you always have access to the latest releases and information."},{id:7,question:"How can I report bugs or suggest features?",answer:"We value your feedback! You can report issues or suggest improvements through our support form (coming soon). Your input helps us refine the site and create a better experience for the entire anime community."},{id:8,question:"Can I import my anime/manga list from other tracking services?",answer:"Yes! We support importing lists from popular services like MyAnimeList. After creating an account, visit your profile settings to find the import option and follow the simple instructions to bring your existing lists into our platform."}
4,{id:9,question:"How accurate is your anime/manga information?",answer:"We strive for high accuracy in our database. Information is sourced from official channels, verified community contributions, and trusted industry sources. If you notice any inaccuracies, please let us know through our support form so we can correct it."},{id:10,question:"Can I contribute to the site's content?",answer:"Absolutely! Community contributions are welcome and valued. Once you have an account, you can submit reviews, participate in discussions, and suggest edits to anime, manga, or character information. Our moderation team reviews contributions to maintain quality and accuracy."}].map((n=>(0,Ti.jsxs)("div",{className:"faq-item "+(e[n.id]?"expanded":""),children:[(0,Ti.jsxs)("div",{className:"faq-question",onClick:()=>{return e=n.id,void t((t=>({...t,[e]:!t[e]})));var e},children:[(0,Ti.jsx)("h3",{children:n.question}),(0,Ti.jsx)("span",{className:"toggle-icon",children:e[n.id]?"\u2212":"+"})]}),(0,Ti.jsx)("div",{className:"faq-answer",children:(0,Ti.jsx)("p",{children:n.answer})})]},n.id)))}),(0,Ti.jsxs)("div",{className:"faq-footer",children:[(0,Ti.jsx)("h3",{children:"Still have questions?"}),(0,Ti.jsx)("p",{children:"If you couldn't find the answer you were looking for, please reach out to us."}),(0,Ti.jsx)("button",{className:"contact-button",children:"Contact Support"})]})]})},tm=e=>{let{activeSection:t,setActiveSection:n}=e;return(0,Ti.jsx)("nav",{className:"support-navigation",children:(0,Ti.jsx)("ul",{children:[{id:"report",label:"Submit a Report",icon:"fa-solid fa-pen-to-square"},{id:"my-reports",label:"My Reports",icon:"fa-solid fa-clipboard-list"},{id:"faq",label:"FAQ",icon:"fa-solid fa-circle-question"}].map((e=>(0,Ti.jsx)("li",{children:(0,Ti.jsxs)("button",{className:"nav-item "+(t===e.id?"active":""),onClick:()=>n(e.id),children:[(0,Ti.jsx)("i",{className:e.icon}),(0,Ti.jsx)("span",{children:e.label})]})},e.id)))})})},nm={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_PLACEHOLDER_BACKDROP:"https://res.cloudinary.com/dpz6ivjry/image/upload/v1741666344/740446_zkrklo.jpg",REACT_APP_API_BASE_URL:"https://animedb-production.up.railway.app"}.REACT_APP_API_URL||"http://localhost:3000/api",rm=e=>Gl.create({baseURL:nm,headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}),am=e=>({new:"New",under_review:"Under Review",in_progress:"In Progress",fixed:"Fixed",wont_fix:"Won't Fix",duplicate:"Duplicate",closed:"Closed"}[e]||e),sm=()=>{const e=navigator.userAgent;let t="Unknown";return e.includes("Firefox")?t="Firefox":e.includes("Chrome")?t="Chrome":e.includes("Safari")?t="Safari":e.includes("Edge")?t="Edge":e.includes("Opera")&&(t="Opera"),t},im=()=>/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)?"Mobile":"Desktop",om=()=>{const e=navigator.userAgent;let t="Unknown";return e.includes("Win")?t="Windows":e.includes("Mac")?t="MacOS":e.includes("Linux")?t="Linux":e.includes("Android")?t="Android":(e.includes("iPhone")||e.includes("iPad"))&&(t="iOS"),t},lm=()=>{const{user:e}=ec(),t=(0,ki.zy)(),[n,r]=(0,_a.useState)(!1),[a,s]=(0,_a.useState)(!1),[i,o]=(0,_a.useState)(null),[l,c]=(0,_a.useState)([]),[u,d]=(0,_a.useState)([]),h=()=>{let e={url:window.location.href,pageType:"other",itemId:""};const n=t.pathname;return n.includes("/anime/")?(e.pageType="anime",e.itemId=n.split("/anime/")[1]):n.includes("/manga/")?(e.pageType="manga",e.itemId=n.split("/manga/")[1]):n.includes("/character/")?(e.pageType="character",e.itemId=n.split("/character/")[1]):n.includes("/user/")&&(e.pageType="user",e.itemId=n.split("/user/")[1]),e},[p,m]=(0,_a.useState)({reportType:"bug",title:"",description:"",stepsToReproduce:"",location:h(),environment:{browser:sm(),device:im(),operatingSystem:om()},correctInformation:""}),f=e=>{const{name:t,value:n}=e.target;if(t.includes(".")){const[e,r]=t.split(".");m((t=>({...t,[e]:{...t[e],[r]:n}})))}else m((e=>({...e,[t]:n})))};(0,_a.useEffect)((()=>()=>{u.forEach((e=>URL.revokeObjectURL(e)))}),[u]);return a?(0,Ti.jsxs)("div",{className:"report-success",children:[(0,Ti.jsx)("div",{className:"success-icon",children:(0,Ti.jsx)("i",{className:"fa-solid fa-check"})}),(0,Ti.jsx)("h2",{children:"Report Submitted Successfully!"}
4),(0,Ti.jsx)("p",{children:"Thank you for your feedback. Our team will review your report and take appropriate action."}),(0,Ti.jsx)("p",{children:'You will receive a confirmation email shortly, and you can track the status of your report in the "My Reports" section.'}),(0,Ti.jsx)("button",{className:"new-report-btn",onClick:()=>s(!1),children:"Submit Another Report"})]}):(0,Ti.jsxs)("div",{className:"report-form-container",children:[(0,Ti.jsx)("h2",{children:"Submit a Report"}),(0,Ti.jsx)("p",{className:"form-description",children:"Help us improve by reporting bugs, incorrect information, or suggesting new features. Please provide as much detail as possible."}),i&&(0,Ti.jsxs)("div",{className:"error-message",children:[(0,Ti.jsx)("i",{className:"fa-solid fa-circle-exclamation"}),(0,Ti.jsx)("p",{children:i})]}),(0,Ti.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),o(null),s(!1),r(!0);try{if(!p.title.trim())throw new Error("Please enter a title for your report");if(!p.description.trim())throw new Error("Please describe the issue you are reporting");const e=localStorage.getItem("token");if(!e)throw new Error("Authentication error. Please log in again.");await(async(e,t,n)=>{const r=rm(n);if(t&&t.length>0){const n=new FormData;return Object.keys(e).forEach((t=>{"object"===typeof e[t]&&null!==e[t]?n.append(t,JSON.stringify(e[t])):n.append(t,e[t])})),t.forEach((e=>{n.append("attachments",e)})),r.post("/reports",n,{headers:{"Content-Type":"multipart/form-data"}})}return r.post("/reports",e)})(p,l,e),r(!1),s(!0),m({reportType:"bug",title:"",description:"",stepsToReproduce:"",location:h(),environment:{browser:sm(),device:im(),operatingSystem:om()},correctInformation:""}),c([]),d([]),window.scrollTo(0,0)}catch(a){var t,n;r(!1),o((null===(t=a.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error)||a.message||"Failed to submit report. Please try again.")}},children:[(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsx)("label",{htmlFor:"reportType",children:"Report Type"}),(0,Ti.jsxs)("select",{id:"reportType",name:"reportType",value:p.reportType,onChange:f,required:!0,children:[(0,Ti.jsx)("option",{value:"bug",children:"Bug/Technical Issue"}),(0,Ti.jsx)("option",{value:"incorrect_info",children:"Incorrect Information"}),(0,Ti.jsx)("option",{value:"missing_content",children:"Missing Content"}),(0,Ti.jsx)("option",{value:"feature_request",children:"Feature Request"}),(0,Ti.jsx)("option",{value:"other",children:"Other"})]})]}),(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsx)("label",{htmlFor:"title",children:"Title"}),(0,Ti.jsx)("input",{type:"text",id:"title",name:"title",value:p.title,onChange:f,placeholder:"Brief summary of the issue",required:!0})]}),(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsx)("label",{htmlFor:"description",children:"Description"}),(0,Ti.jsx)("textarea",{id:"description",name:"description",value:p.description,onChange:f,placeholder:"Please provide a detailed description of the issue",rows:"5",required:!0})]}),"bug"===p.reportType&&(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsx)("label",{htmlFor:"stepsToReproduce",children:"Steps to Reproduce"}),(0,Ti.jsx)("textarea",{id:"stepsToReproduce",name:"stepsToReproduce",value:p.stepsToReproduce,onChange:f,placeholder:"1. Go to...\\n2. Click on...\\n3. Notice that...",rows:"4"})]}),("incorrect_info"===p.reportType||"missing_content"===p.reportType)&&(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsx)("label",{htmlFor:"correctInformation",children:"Correct Information"}),(0,Ti.jsx)("textarea",{id:"correctInformation",name:"correctInformation",value:p.correctInformation,onChange:f,placeholder:"Please provide the correct information or what content is missing",rows:"4"})]}),(0,Ti.jsxs)("div",{className:"form-group",children:[(0,Ti.jsx)("label",{htmlFor:"location.url",children:"URL (Where did you find this issue?)"}),(0,Ti.jsx)("input",{type:"text",id:"location.url",name:"location.url",value:p.location.url,onChange:f})]}),(0,Ti.jsxs)("div",{className:"form-group file-upload",children:[(0,Ti.jsxs)("label",{children:["Attachments (",l.length,"/5)",(0,Ti.jsx)("input",{type:"file",onChange:e=>{const t=Array.from(e.target.files);if(l.length+t.length>5)return void o("You can only upload up to 5 files");if(t.filter((e=>e.size>5242880)).length>0)return void o("Files must be less than 5MB each");c((e=>[...e,...t]));const n=t.filter((e=>e.type.startsWith("image/"))).map((e=>URL.createObjectURL(e)));d((e=>[...e,...n]))},multiple:!0,accept:"image/*,.pdf,.doc,.docx,.txt",disabled:l.length>=5})]}),(0,Ti.jsx)("p",{className:"file-help",children:"Upload screenshots or relevant files (max 5 files, 5MB each)"}),l.length>0&&(0,Ti.jsx)("div",{className:"attachment-previews",children:l.map(((e,t)=>(0,Ti.jsxs)("div",{className:"attachment-item",children:[e.type.startsWith("image/")&&u[t]?(0,Ti.jsx)("img",{src:u[t],alt:`Preview ${t}`,className:"attachment-preview"}):(0,Ti.jsx)("div",{className:"file-icon",children:e.name.split(".").pop()}),(0,Ti.jsxs)("div",{className:"attachment-info",children:[(0,Ti.jsx)("span",{children:e.name}),(0,Ti.jsx)("button",{type:"button",onClick:()=>(e=>{c((t=>t.filter(((t,n)=>n!==e)))),u[e]&&URL.revokeObjectURL(u[e]),d((t=>t.filter(((t,n)=>n!==e))))})(t),className:"remove-attachment",children:(0,Ti.jsx)("i",{className:"fa-solid fa-xmark"})})]})]},t)))})]}),(0,Ti.jsxs)("div",{className:"form-group environment-info",children:[(0,Ti.jsx)("h3",{children:"System Information"}),(0,Ti.jsxs)("div",{className:"environment-details",children:[(0,Ti.jsxs)("div",{className:"env-item",children:[(0,Ti.jsx)("i",{className:"fa-solid fa-globe"}),(0,Ti.jsx)("span",{children:"Browser:"}),(0,Ti.jsx)("strong",{children:p.environment.browser})]}),(0,Ti.jsxs)("div",{className:"env-item",children:[(0,Ti.jsx)("i",{className:"fa-solid fa-mobile-screen"}),(0,Ti.jsx)("span",{children:"Device:"}),(0,Ti.jsx)("strong",{children:p.environment.device})]}),(0,Ti.jsxs)("div",{className:"env-item",children:[(0,Ti.jsx)("i",{className:"fa-solid fa-desktop"}),(0,Ti.jsx)("span",{children:"OS:"}),(0,Ti.jsx)("strong",{children:p.environment.operatingSystem})]})]})]}),(0,Ti.jsx)("div",{className:"form-actions",children:(0,Ti.jsx)("button",{type:"submit",className:"submit-btn",disabled:n,children:n?(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)("i",{className:"fa-solid fa-spinner fa-spin"}),"Submitting..."]}):(0,Ti.jsxs)(Ti.Fragment,{children:[(0,Ti.jsx)("i",{className:"fa-solid fa-paper-plane"}),"Submit Report"]})})})]})]})},cm=()=>{const{user:e}=ec(),[t,n]=(0,_a.useState)([]),[r,a]=(0,_a.useState)(!0),[s,i]=(0,_a.useState)(null),[o,l]=(0,_a.useState)(1),[c,u]=(0,_a.useState)(1),[d,h]=(0,_a.useState)(null);(0,_a.useEffect)((()=>{(async()=>{try{a(!0);const e=localStorage.getItem("token");if(!e)throw new Error("Authentication error. Please log in again.");const t=await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return rm(e).get(`/reports/my-reports?page=${t}&limit=${n}`)}(e,o);n(t.data.data),u(t.data.pagination.pages),a(!1)}catch(r){var e,t;i((null===(e=r.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.error)||"Failed to load reports"),a(!1)}})()}),[o]);const p=e=>{e>0&&e<=c&&(l(e),window.scrollTo(0,0))};return r&&0===t.length?(0,Ti.jsxs)("div",{className:"loading-reports",children:[(0,Ti.jsx)("div",{className:"loading-spinner"}),(0,Ti.jsx)("p",{children:"Loading your reports..."})]}):s?(0,Ti.jsxs)("div",{className:"reports-error",children:[(0,Ti.jsx)("i",{className:"fa-solid fa-circle-exclamation"}),(0,Ti.jsx)("h3",{children:"Error Loading Reports"}),(0,Ti.jsx)("p",{children:s}),(0,Ti.jsx)("button",{onClick:()=>window.location.reload(),children:"Try Again"})]}):0===t.length?(0,Ti.jsxs)("div",{className:"no-reports",children:[(0,Ti.jsx)("i",{className:"fa-solid fa-clipboard-check"}),(0,Ti.jsx)("h3",{children:"No Reports Found"}),(0,Ti.jsx)("p",{children:'You haven\'t submitted any reports yet. Use the "Submit a Report" section to report any issues or suggest improvements.'})]}):(0,Ti.jsxs)("div",{className:"my-reports-container",children:[(0,Ti.jsx)("h2",{children:"My Reports"}),(0,Ti.jsx)("p",{className:"reports-description",children:"Track the status of your submitted reports and view responses from our team."}),(0,Ti.jsx)("div",{className:"reports-list",children:t.map((e=>{return(0,Ti.jsxs)("div",{className:"report-card "+(d===e._id?"expanded":""),children:[(0,Ti.jsxs)("div",{className:"report-header",onClick:()=>{return t=e._id,void h(d===t?null:t);var t},children:[(0,Ti.jsxs)("div",{className:"report-title-section",children:[(0,Ti.jsx)("h3",{className:"report-title",children:e.title}),(0,Ti.jsxs)("div",{className:"report-meta",children:[(0,Ti.jsx)("span",{className:"report-type",children:(r=e.reportType,{bug:"Bug/Technical Issue",incorrect_info:"Incorrect Information",missing_content:"Missing Content",feature_request:"Feature Request",other:"Other"}[r]||"Report")}),(0,Ti.jsx)("span",{className:"report-date",children:(n=e.createdAt,new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))})]})]}),(0,Ti.jsxs)("div",{className:"report-status-section",children:[(0,Ti.jsx)("span",{className:"report-status",style:{backgroundColor:(t=e.status,{new:"#6c5ce7",under_review:"#fdcb6e",in_progress:"#0984e3",fixed:"#00b894",w
4ont_fix:"#d63031",duplicate:"#636e72",closed:"#2d3436"}[t]||"#6c5ce7")},children:am(e.status)}),(0,Ti.jsx)("button",{className:"expand-btn",children:(0,Ti.jsx)("i",{className:"fa-solid "+(d===e._id?"fa-chevron-up":"fa-chevron-down")})})]})]}),d===e._id&&(0,Ti.jsxs)("div",{className:"report-details",children:[(0,Ti.jsxs)("div",{className:"detail-section",children:[(0,Ti.jsx)("h4",{children:"Description"}),(0,Ti.jsx)("p",{children:e.description})]}),e.stepsToReproduce&&(0,Ti.jsxs)("div",{className:"detail-section",children:[(0,Ti.jsx)("h4",{children:"Steps to Reproduce"}),(0,Ti.jsx)("p",{children:e.stepsToReproduce})]}),e.correctInformation&&(0,Ti.jsxs)("div",{className:"detail-section",children:[(0,Ti.jsx)("h4",{children:"Correct Information"}),(0,Ti.jsx)("p",{children:e.correctInformation})]}),e.adminNotes&&(0,Ti.jsxs)("div",{className:"detail-section admin-notes",children:[(0,Ti.jsx)("h4",{children:"Response from Staff"}),(0,Ti.jsx)("p",{children:e.adminNotes})]}),e.attachments&&e.attachments.length>0&&(0,Ti.jsxs)("div",{className:"detail-section",children:[(0,Ti.jsx)("h4",{children:"Attachments"}),(0,Ti.jsx)("div",{className:"attachments-gallery",children:e.attachments.map(((e,t)=>(0,Ti.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"attachment-link",children:e.match(/\.(jpeg|jpg|gif|png)$/i)?(0,Ti.jsx)("img",{src:e,alt:`Attachment ${t+1}`}):(0,Ti.jsxs)("div",{className:"file-attachment",children:[(0,Ti.jsx)("i",{className:"fa-solid fa-file"}),(0,Ti.jsxs)("span",{children:["Attachment ",t+1]})]})},t)))})]}),(0,Ti.jsxs)("div",{className:"report-id-section",children:[(0,Ti.jsxs)("span",{children:["Report ID: ",e._id]}),(0,Ti.jsxs)("span",{children:["Priority: ",e.priority]})]})]})]},e._id);var t,n,r}))}),c>1&&(0,Ti.jsxs)("div",{className:"pagination",children:[(0,Ti.jsxs)("button",{className:"page-btn prev",onClick:()=>p(o-1),disabled:1===o,children:[(0,Ti.jsx)("i",{className:"fa-solid fa-chevron-left"})," Previous"]}),(0,Ti.jsxs)("div",{className:"page-indicator",children:["Page ",o," of ",c]}),(0,Ti.jsxs)("button",{className:"page-btn next",onClick:()=>p(o+1),disabled:o===c,children:["Next ",(0,Ti.jsx)("i",{className:"fa-solid fa-chevron-right"})]})]})]})},um=()=>{const[e,t]=(0,_a.useState)(null);return(0,Ti.jsxs)("div",{className:"faq-container",children:[(0,Ti.jsx)("h2",{children:"Frequently Asked Questions"}),(0,Ti.jsx)("p",{className:"faq-description",children:"Find answers to common questions about our platform. If you don't see your question here, feel free to submit a report."}),(0,Ti.jsxs)("div",{className:"search-faq",children:[(0,Ti.jsx)("i",{className:"fa-solid fa-magnifying-glass"}),(0,Ti.jsx)("input",{type:"text",placeholder:"Search questions...",onChange:e=>{console.log("Search query:",e.target.value)}})]}),(0,Ti.jsx)("div",{className:"faq-list",children:[{id:1,question:"How do I track my anime/manga watching progress?",answer:"To track y
4our anime or manga progress, add titles to your collection by clicking the 'Add to Collection' button on any anime or manga page. Then, you can update your progress from your profile page or directly from the title page by using the status dropdown and episode/chapter counter."},{id:2,question:"How do I report incorrect information about an anime or manga?",answer:"If you find incorrect information, you can submit a report by using the 'Submit a Report' section in the Support Center. Select 'Incorrect Information' as the report type, provide a clear title and description, and include the correct information. Our team will review your report and make necessary updates."},{id:3,question:"Why can't I find a specific anime or manga?",answer:"Our database is continuously growing, but there might be titles that haven't been added yet. If you can't find a specific anime or manga, you can submit a 'Missing Content' report from the Support Center, and our team will work on adding it to the database."},{id:4,question:"How long does it take for a report to be resolved?",answer:"Report resolution times vary depending on the type and complexity of the issue. Simple corrections are typically processed within 1-3 days, while more complex issues or feature requests may take longer. You can track the status of your reports in the 'My Reports' section."},{id:5,question:"Can I suggest new features for the website?",answer:"Absolutely! We welcome feature suggestions. Use the 'Submit a Report' section in the Support Center and select 'Feature Request' as the report type. Please provide a clear description of the feature you'd like to see and how it would improve your experience."},{id:6,question:"How do I update my account information?",answer:"You can update your account information, including your username, email, profile picture, and preferences by going to your profile and clicking on the 'Settings' option. From there, navigate to the 'Account' tab to make your changes."},{id:7,question:"What should I do if I encounter a bug or technical issue?",answer:"If you encounter a bug or technical issue, please report it through the 'Submit a Report' section in the Support Center. Select 'Bug/Technical Issue' as the report type, describe the problem in detail, and include steps to reproduce the issue if possible. Screenshots or recordings are also helpful."},{id:8,question:"How do I recover my password if I forget it?",answer:"If you forget your password, go to the login page and click on the 'Forgot Password' link. Enter your email address, and you'll receive a password reset link. Follow the instructions in the email to create a new password."},{id:9,question:"Can I connect my account with other anime/manga services?",answer:"We're working on implementing integration with other services. Currently, you can import your anime/manga list from MyAnimeList. More integrations will be available in the future."},{id:10,question:"How can I contact the support team directly?",answer:"The best way to contact our support team is through the report system in the Support Center. For urgent matters, you can email us at [email protected]. Please note that response times may vary depending on the volume of inquiries."}].map((n=>(0,Ti.jsxs)("div",{className:"faq-item "+(e===n.id?"active":""),children:[(0,Ti.jsxs)("div",{className:"faq-question",onClick:()=>{return r=n.id,void t(e===r?null:r);var r},children:[(0,Ti.jsx)("h3",{children:n.question}),(0,Ti.jsx)("button",{className:"toggle-btn",children:(0,Ti.jsx)("i",{className:"fa-solid "+(e===n.id?"fa-minus":"fa-plus")})})]}),(0,Ti.jsx)("div",{className:"faq-answer",children:(0,Ti.jsx)("p",{children:n.answer})})]},n.id)))}),(0,Ti.jsxs)("div",{className:"contact-info",children:[(0,Ti.jsx)("h3",{children:"Still need help?"}),(0,Ti.jsxs)("p",{children:["If you couldn't find an answer to your question, please submit a report or contact our support team directly at ",(0,Ti.jsx)("a",{href:"mailto:[email protected]",children:"[email protected]"}),"."]})]})]})},dm=()=>{(0,ki.Zp)();const[e,t]=(0,_a.useState)("report"),[n,r]=(0,_a.useState)({isLoggedIn:!1,loading:!0});if((0,_a.useEffect)((()=>{(()=>{const e=localStorage.getItem("token");console.log("SupportPage - Token check:",!!e),r(e?{isLoggedIn:!0,loading:!1}:{isLoggedIn:!1,loading:!1})})()}),[]),n.loading)return(0,Ti.jsxs)("div",{className:"loading-container",children:[(0,Ti.jsx)("div",{className:"loading-spinner"}),(0,Ti.jsx)("p",{className:"loading-text",children:"Loading..."})]});if(!n.isLoggedIn)return console.log("SupportPage - Not logged in, redirecting to login page"),(0,Ti.jsx)(ki.C5,{to:"/login",state:{from:"/support"}});console.log("SupportPage - Logged in, showing support page");return(0,Ti.jsxs)("main",{className:"support-page",children:[(0,Ti.jsxs)("div",{className:"support-page-title-container",children:[(0,Ti.jsx)("h1",{className:"support-page-title",children:"Support Center"}),(0,Ti.jsx)("p",{className:"support-page-subtitle",children:"We're here to help! Submit reports, track issues, and find answers to common questions."})]}),(0,Ti.jsxs)("div",{className:"support-container",children:[(0,Ti.jsx)(tm,{activeSection:e,setActiveSection:t}),(0,Ti.jsx)("div",{className:"support-content",children:(()=>{switch(e){case"report":default:return(0,Ti.jsx)(lm,{});case"my-reports":return(0,Ti.jsx)(cm,{});case"faq":return(0,Ti.jsx)(um,{})}})()})]})]})},hm=new class{#te;#f;#u;#ne;#re;#ae;#se;#ie;constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.#te=e.queryCache||new Fc,this.#f=e.mutationCache||new Dc,this.#u=e.defaultOptions||{},this.#ne=new Map,this.#re=new Map,this.#ae=0}mount(){this.#ae++,1===this.#ae&&(this.#se=Ec.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#te.onFocus())})),this.#ie=_c.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#te.onOnline())})))}unmount(){this.#ae--,0===this.#ae&&(this.#se?.(),this.#se=void 0,this.#ie?.(),this.#ie=void 0)}isFetching(e){return this.#te.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#f.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#te.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#te.build(this,t),r=n.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(oc(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#te.findAll(e).map((e=>{let{queryKey:t,state:n}=e;return[t,n.data]}))}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=this.#te.get(r.queryHash),s=a?.state.data,i=function(e,t){return"function"===typeof e?e(t):e}(t,s);if(void 0!==i)return this.#te.build(this,r).setData(i,{...n,manual:!0})}
4setQueriesData(e,t,n){return Sc.batch((()=>this.#te.findAll(e).map((e=>{let{queryKey:r}=e;return[r,this.setQueryData(r,t,n)]}))))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#te.get(t.queryHash)?.state}removeQueries(e){const t=this.#te;Sc.batch((()=>{t.findAll(e).forEach((e=>{t.remove(e)}))}))}resetQueries(e,t){const n=this.#te;return Sc.batch((()=>(n.findAll(e).forEach((e=>{e.reset()})),this.refetchQueries({type:"active",...e},t))))}cancelQueries(e){const t={revert:!0,...arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}},n=Sc.batch((()=>this.#te.findAll(e).map((e=>e.cancel(t)))));return Promise.all(n).then(ac).catch(ac)}invalidateQueries(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Sc.batch((()=>(this.#te.findAll(e).forEach((e=>{e.invalidate()})),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))))}refetchQueries(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Sc.batch((()=>this.#te.findAll(e).filter((e=>!e.isDisabled())).map((e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(ac)),"paused"===e.state.fetchStatus?Promise.resolve():t}))));return Promise.all(r).then(ac)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const n=this.#te.build(this,t);return n.isStaleByTime(oc(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ac).catch(ac)}fetchInfiniteQuery(e){return e.behavior=zc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ac).catch(ac)}ensureInfiniteQueryData(e){return e.behavior=zc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return _c.isOnline()?this.#f.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#te}getMutationCache(){return this.#f}getDefaultOptions(){return this.#u}setDefaultOptions(e){this.#u=e}setQueryDefaults(e,t){this.#ne.set(hc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#ne.values()],n={};return t.forEach((t=>{pc(e,t.queryKey)&&Object.assign(n,t.defaultOptions)})),n}setMutationDefaults(e,t){this.#re.set(hc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#re.values()],n={};return t.forEach((t=>{pc(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)})),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#u.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=dc(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===jc&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#u.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#te.clear(),this.#f.clear()}}({defaultOptions:{queries:{staleTime:3e5,cacheTime:18e5,refetchOnWindowFocus:!1,retry:1}}});const pm=function(){return(0,Ti.jsx)(Pi,{children:(0,Ti.jsx)(Wc,{client:hm,children:(0,Ti.jsx)(Zl,{children:(0,Ti.jsx)(nc,{children:(0,Ti.jsx)(ki.Kd,{children:(0,Ti.jsxs)("div",{className:"App",children:[(0,Ti.jsx)(Xp,{}),(0,Ti.jsx)(ru,{}),(0,Ti.jsxs)(ki.BV,{children:[(0,Ti.jsx)(ki.qh,{path:"/",element:(0,Ti.jsx)(fu,{})}),(0,Ti.jsx)(ki.qh,{path:"/anime/:id",element:(0,Ti.jsx)(wd,{})}),(0,Ti.jsx)(ki.qh,{path:"/manga/:id",element:(0,Ti.jsx)(Cd,{})}),(0,Ti.jsx)(ki.qh,{path:"/anime",element:(0,Ti.jsx)(bu,{})}),(0,Ti.jsx)(ki.qh,{path:"/manga",element:(0,Ti.jsx)(_u,{})}),(0,Ti.jsx)(ki.qh,{path:"/community",element:(0,Ti.jsx)(Jp,{})}),(0,Ti.jsx)(ki.qh,{path:"/characters",element:(0,Ti.jsx)($u,{})}),(0,Ti.jsx)(ki.qh,{path:"/login",element:(0,Ti.jsx)(Td,{})}),(0,Ti.jsx)(ki.qh,{path:"/signup",element:(0,Ti.jsx)(Rd,{})}),(0,Ti.jsx)(ki.qh,{path:"/verification-pending",element:(0,Ti.jsx)(Pd,{})}),(0,Ti.jsx)(ki.qh,{path:"/verify-email/:token",element:(0,Ti.jsx)(Od,{})}),(0,Ti.jsx)(ki.qh,{path:"/forgot-password",element:(0,Ti.jsx)(Id,{})}),(0,Ti.jsx)(ki.qh,{path:"/reset-password/:token",element:(0,Ti.jsx)(Ld,{})}),(0,Ti.jsx)(ki.qh,{path:"/profile",element:(0,Ti.jsx)(oh,{})}),(0,Ti.jsx)(ki.qh,{path:"/my-anime-list",element:(0,Ti.jsx)(dh,{})}),(0,Ti.jsx)(ki.qh,{path:"/settings",element:(0,Ti.jsx)(Yh,{})}),(0,Ti.jsx)(ki.qh,{path:"/users/:userId",element:(0,Ti.jsx)(ap,{})}),(0,Ti.jsx)(ki.qh,{path:"/search",element:(0,Ti.jsx)(fp,{})}),(0,Ti.jsx)(ki.qh,{path:"/characters/:id",element:(0,Ti.jsx)(Sp,{})}),(0,Ti.jsx)(ki.qh,{path:"/genres",element:(0,Ti.jsx)(kp,{})}),(0,Ti.jsx)(ki.qh,{path:"/genres/:genre",element:(0,Ti.jsx)(Ap,{})}),(0,Ti.jsx)(ki.qh,{path:"/manga/genres",element:(0,Ti.jsx)(Tp,{})}),(0,Ti.jsx)(ki.qh,{path:"/manga/genres/:genre",element:(0,Ti.jsx)(Rp,{})}),(0,Ti.jsx)(ki.qh,{path:"/anime/category/:category",element:(0,Ti.jsx)(Op,{})}),(0,Ti.jsx)(ki.qh,{path:"/faq",element:(0,Ti.jsx)(em,{})}),(0,Ti.jsx)(ki.qh,{path:"/support",element:(0,Ti.jsx)(dm,{})}),(0,Ti.jsx)(ki.qh,{path:"*",element:(0,Ti.jsx)(Zp,{})})]})]})})})})})})},mm=e=>{e&&e instanceof Function&&n.e(453).then(n.bind(n,453)).then((t=>{let{getCLS:n,getFID:r,getFCP:a,getLCP:s,getTTFB:i}=t;n(e),r(e),a(e),s(e),i(e)}))};"IntersectionObserver"in window||n.e(20).then(n.t.bind(n,20,23)).then((()=>{console.log("IntersectionObserver polyfill loaded")}));Si.createRoot(document.getElementById("root")).render((0,Ti.jsx)(_a.Str
4ictMode,{children:(0,Ti.jsx)(pm,{})})),mm()})(); 5//# sourceMappingURL=main.09c80a24.js.map 6//# debugId=ef733b3a-75f9-5a1c-be3f-4e8cfe734711
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.