vendor: 6,850 bytes, lines 1-9
1var PW=Object.defineProperty;var AP=e=>{throw TypeError(e)};var kW=(e,t,r)=>t in e?PW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Hs=(e,t,r)=>kW(e,typeof t!="symbol"?t+"":t,r),x0=(e,t,r)=>t.has(e)||AP("Cannot "+r);var X=(e,t,r)=>(x0(e,t,"read from private field"),r?r.call(e):t.get(e)),$e=(e,t,r)=>t.has(e)?AP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Se=(e,t,r,n)=>(x0(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),et=(e,t,r)=>(x0(e,t,"access private method"),r);var Ip=(e,t,r,n)=>({set _(s){Se(e,t,s,r)},get _(){return X(e,t,n)}});function AW(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();var en=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function EW(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var XI={exports:{}},dy={},QI={exports:{}},at={};/** 2 * @license React 3 * react.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var Xm=Symbol.for("react.element"),OW=Symbol.for("react.portal"),TW=Symbol.for("react.fragment"),MW=Symbol.for("react.strict_mode"),IW=Symbol.for("react.profiler"),$W=Symbol.for("react.provider"),RW=Symbol.for("react.context"),DW=Symbol.for("react.forward_ref"),LW=Symbol.for("react.suspense"),FW=Symbol.for("react.memo"),BW=Symbol.for("react.lazy"),EP=Symbol.iterator;function zW(e){return e===null||typeof e!="object"?null:(e=EP&&e[EP]||e["@@iterator"],typeof e=="function"?e:null)}var JI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ZI=Object.assign,e$={};function zu(e,t,r){this.props=e,this.context=t,this.refs=e$,this.updater=r||JI}zu.prototype.isReactComponent={};zu.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};zu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function t$(){}t$.prototype=zu.prototype;function VS(e,t,r){this.props=e,this.context=t,this.refs=e$,this.updater=r||JI}var qS=VS.prototype=new t$;qS.constructor=VS;ZI(qS,zu.prototype);qS.isPureReactComponent=!0;var OP=Array.isArray,r$=Object.prototype.hasOwnProperty,GS={current:null},n$={key:!0,ref:!0,__self:!0,__source:!0};function a$(e,t,r){var n,s={},i=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)r$.call(t,n)&&!n$.hasOwnProperty(n)&&(s[n]=t[n]);var l=arguments.length-2;if(l===1)s.children=r;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];s.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)s[n]===void 0&&(s[n]=l[n]);return{$$typeof:Xm,type:e,key:i,ref:o,props:s,_owner:GS.current}}function UW(e,t){return{$$typeof:Xm,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function KS(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xm}function WW(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var TP=/\/+/g;function y0(e,t){return typeof e=="object"&&e!==null&&e.key!=null?WW(""+e.key):t.toString(36)}function Ag(e,t,r,n,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Xm:case OW:o=!0}}if(o)return o=e,s=s(o),e=n===""?"."+y0(o,0):n,OP(s)?(r="",e!=null&&(r=e.replace(TP,"$&/")+"/"),Ag(s,t,r,"",function(d){return d})):s!=null&&(KS(s)&&(s=UW(s,r+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(TP,"$&/")+"/")+e)),t.push(s)),1;if(o=0,n=n===""?".":n+":",OP(e))for(var l=0;l<e.length;l++){i=e[l];var c=n+y0(i,l);o+=Ag(i,t,r,c,s)}else if(c=zW(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=n+y0(i,l++),o+=Ag(i,t,r,c,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function $p(e,t,r){if(e==null)return e;var n=[],s=0;return Ag(e,n,"","",function(i){return t.call(r,i,s++)}),n}function HW(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var yn={current:null},Eg={transition:null},VW={ReactCurrentDispatcher:yn,ReactCurrentBatchConfig:Eg,ReactCurrentOwner:GS};function s$(){throw Error("act(...) is not supported in production builds of React.")}at.Children={map:$p,forEach:function(e,t,r){$p(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return $p(e,function(){t++}),t},toArray:function(e){return $p(e,function(t){return t})||[]},only:function(e){if(!KS(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};at.Component=zu;at.Fragment=TW;at.Profiler=IW;at.PureComponent=VS;at.StrictMode=MW;at.Suspense=LW;
vendor: 5,773 bytes, lines 9-25
9at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=VW;at.act=s$;at.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=ZI({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=GS.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)r$.call(t,c)&&!n$.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var d=0;d<c;d++)l[d]=arguments[d+2];n.children=l}return{$$typeof:Xm,type:e.type,key:s,ref:i,props:n,_owner:o}};at.createContext=function(e){return e={$$typeof:RW,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:$W,_context:e},e.Consumer=e};at.createElement=a$;at.createFactory=function(e){var t=a$.bind(null,e);return t.type=e,t};at.createRef=function(){return{current:null}};at.forwardRef=function(e){return{$$typeof:DW,render:e}};at.isValidElement=KS;at.lazy=function(e){return{$$typeof:BW,_payload:{_status:-1,_result:e},_init:HW}};at.memo=function(e,t){return{$$typeof:FW,type:e,compare:t===void 0?null:t}};at.startTransition=function(e){var t=Eg.transition;Eg.transition={};try{e()}finally{Eg.transition=t}};at.unstable_act=s$;at.useCallback=function(e,t){return yn.current.useCallback(e,t)};at.useContext=function(e){return yn.current.useContext(e)};at.useDebugValue=function(){};at.useDeferredValue=function(e){return yn.current.useDeferredValue(e)};at.useEffect=function(e,t){return yn.current.useEffect(e,t)};at.useId=function(){return yn.current.useId()};at.useImperativeHandle=function(e,t,r){return yn.current.useImperativeHandle(e,t,r)};at.useInsertionEffect=function(e,t){return yn.current.useInsertionEffect(e,t)};at.useLayoutEffect=function(e,t){return yn.current.useLayoutEffect(e,t)};at.useMemo=function(e,t){return yn.current.useMemo(e,t)};at.useReducer=function(e,t,r){return yn.current.useReducer(e,t,r)};at.useRef=function(e){return yn.current.useRef(e)};at.useState=function(e){return yn.current.useState(e)};at.useSyncExternalStore=function(e,t,r){return yn.current.useSyncExternalStore(e,t,r)};at.useTransition=function(){return yn.current.useTransition()};at.version="18.3.1";QI.exports=at;var g=QI.exports;const I=mt(g),YS=AW({__proto__:null,default:I},[g]);/** 10 * @license React 11 * react-jsx-runtime.production.min.js 12 * 13 * Copyright (c) Facebook, Inc. and its affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var qW=g,GW=Symbol.for("react.element"),KW=Symbol.for("react.fragment"),YW=Object.prototype.hasOwnProperty,XW=qW.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,QW={key:!0,ref:!0,__self:!0,__source:!0};function i$(e,t,r){var n,s={},i=null,o=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)YW.call(t,n)&&!QW.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:GW,type:e,key:i,ref:o,props:s,_owner:XW.current}}dy.Fragment=KW;dy.jsx=i$;dy.jsxs=i$;XI.exports=dy;var a=XI.exports,o$={exports:{}},Zn={},l$={exports:{}},c$={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */(function(e){function t(T,L){var K=T.length;T.push(L);e:for(;0<K;){var H=K-1>>>1,ee=T[H];if(0<s(ee,L))T[H]=L,T[K]=ee,K=H;else break e}}function r(T){return T.length===0?null:T[0]}function n(T){if(T.length===0)return null;var L=T[0],K=T.pop();if(K!==L){T[0]=K;e:for(var H=0,ee=T.length,se=ee>>>1;H<se;){var ne=2*(H+1)-1,W=T[ne],ie=ne+1,R=T[ie];if(0>s(W,K))ie<ee&&0>s(R,W)?(T[H]=R,T[ie]=K,H=ie):(T[H]=W,T[ne]=K,H=ne);else if(ie<ee&&0>s(R,K))T[H]=R,T[ie]=K,H=ie;else break e}}return L}function s(T,L){var K=T.sortIndex-L.sortIndex;return K!==0?K:T.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],d=[],u=1,f=null,h=3,m=!1,v=!1,p=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(T){for(var L=r(d);L!==null;){if(L.callback===null)n(d);else if(L.startTime<=T)n(d),L.sortIndex=L.expirationTime,t(c,L);else break;L=r(d)}}function _(T){if(p=!1,w(T),!v)if(r(c)!==null)v=!0,E(N);else{var L=r(d);L!==null&&M(_,L.startTime-T)}}function N(T,L){v=!1,p&&(p=!1,b(C),C=-1),m=!0;var K=h;try{for(w(L),f=r(c);f!==null&&(!(f.expirationTime>L)||T&&!D());){var H=f.callback;if(typeof H=="function"){f.callback=null,h=f.priorityLevel;var ee=H(f.expirationTime<=L);L=e.unstable_now(),typeof ee=="function"?f.callback=ee:f===r(c)&&n(c),w(L)}else n(c);f=r(c)}if(f!==null)var se=!0;else{var ne=r(d);ne!==null&&M(_,ne.startTime-L),se=!1}return se}finally{f=null,h=K,m=!1}}var j=!1,S=null,C=-1,P=5,A=-1;function D(){return!(e.unstable_now()-A<P)}function F(){if(S!==null){var T=e.unstable_now();A=T;var L=!0;try{L=S(!0,T)}finally{L?q():(j=!1,S=null)}}else j=!1}var q;if(typeof y=="function")q=function(){y(F)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,V=B.port2;B.port1.onmessage=F,q=function(){V.postMessage(null)}}else q=function(){x(F,0)};function E(T){S=T,j||(j=!0,q())}
vendor: 8,460 bytes, lines 25-34
25function M(T,L){C=x(function(){T(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){v||m||(v=!0,E(N))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(T){switch(h){case 1:case 2:case 3:var L=3;break;default:L=h}var K=h;h=L;try{return T()}finally{h=K}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,L){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var K=h;h=T;try{return L()}finally{h=K}},e.unstable_scheduleCallback=function(T,L,K){var H=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?H+K:H):K=H,T){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=K+ee,T={id:u++,callback:L,priorityLevel:T,startTime:K,expirationTime:ee,sortIndex:-1},K>H?(T.sortIndex=K,t(d,T),r(c)===null&&T===r(d)&&(p?(b(C),C=-1):p=!0,M(_,K-H))):(T.sortIndex=ee,t(c,T),v||m||(v=!0,E(N))),T},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(T){var L=h;return function(){var K=h;h=L;try{return T.apply(this,arguments)}finally{h=K}}}})(c$);l$.exports=c$;var JW=l$.exports;/** 26 * @license React 27 * react-dom.production.min.js 28 * 29 * Copyright (c) Facebook, Inc. and its affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var ZW=g,Xn=JW;function ye(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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."}var d$=new Set,kh={};function vc(e,t){qd(e,t),qd(e+"Capture",t)}function qd(e,t){for(kh[e]=t,e=0;e<t.length;e++)d$.add(t[e])}var mi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dj=Object.prototype.hasOwnProperty,eH=/^[: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]*$/,MP={},IP={};function tH(e){return dj.call(IP,e)?!0:dj.call(MP,e)?!1:eH.test(e)?IP[e]=!0:(MP[e]=!0,!1)}function rH(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function nH(e,t,r,n){if(t===null||typeof t>"u"||rH(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function bn(e,t,r,n,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var qr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){qr[e]=new bn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];qr[t]=new bn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){qr[e]=new bn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){qr[e]=new bn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){qr[e]=new bn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){qr[e]=new bn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){qr[e]=new bn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){qr[e]=new bn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){qr[e]=new bn(e,5,!1,e.toLowerCase(),null,!1,!1)});var XS=/[\-:]([a-z])/g;function QS(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(XS,QS);qr[t]=new bn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(XS,QS);qr[t]=new bn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(XS,QS);qr[t]=new bn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){qr[e]=new bn(e,1,!1,e.toLowerCase(),null,!1,!1)});qr.xlinkHref=new bn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){qr[e]=new bn(e,1,!1,e.toLowerCase(),null,!0,!0)});function JS(e,t,r,n){var s=qr.hasOwnProperty(t)?qr[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(nH(t,r,s,n)&&(r=null),n||s===null?tH(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Pi=ZW.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Rp=Symbol.for("react.element"),ed=Symbol.for("react.portal"),td=Symbol.for("react.fragment"),ZS=Symbol.for("react.strict_mode"),uj=Symbol.for("react.profiler"),u$=Symbol.for("react.provider"),f$=Symbol.for("react.context"),e_=Symbol.for("react.forward_ref"),fj=Symbol.for("react.suspense"),hj=Symbol.for("react.suspense_list"),t_=Symbol.for("react.memo"),Yi=Symbol.for("react.lazy"),h$=Symbol.for("react.offscreen"),$P=Symbol.iterator;function xf(e){return e===null||typeof e!="object"?null:(e=$P&&e[$P]||e["@@iterator"],typeof e=="function"?e:null)}var sr=Object.assign,b0;function qf(e){if(b0===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);b0=t&&t[1]||""}return` 34`+b0+e}var w0=!1;function j0(e,t){if(!e||w0)return"";w0=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var n=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){n=d}e.call(t.prototype)}else{try{throw Error()}catch(d){n=d}e()}}
vendor: 14,106 bytes, lines 34-37
34catch(d){if(d&&n&&typeof d.stack=="string"){for(var s=d.stack.split(` 35`),i=n.stack.split(` 36`),o=s.length-1,l=i.length-1;1<=o&&0<=l&&s[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(s[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||s[o]!==i[l]){var c=` 37`+s[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{w0=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?qf(e):""}function aH(e){switch(e.tag){case 5:return qf(e.type);case 16:return qf("Lazy");case 13:return qf("Suspense");case 19:return qf("SuspenseList");case 0:case 2:case 15:return e=j0(e.type,!1),e;case 11:return e=j0(e.type.render,!1),e;case 1:return e=j0(e.type,!0),e;default:return""}}function mj(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case td:return"Fragment";case ed:return"Portal";case uj:return"Profiler";case ZS:return"StrictMode";case fj:return"Suspense";case hj:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case f$:return(e.displayName||"Context")+".Consumer";case u$:return(e._context.displayName||"Context")+".Provider";case e_:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case t_:return t=e.displayName||null,t!==null?t:mj(e.type)||"Memo";case Yi:t=e._payload,e=e._init;try{return mj(e(t))}catch{}}return null}function sH(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return mj(t);case 8:return t===ZS?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Mo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function m$(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function iH(e){var t=m$(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Dp(e){e._valueTracker||(e._valueTracker=iH(e))}function p$(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=m$(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function iv(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function pj(e,t){var r=t.checked;return sr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function RP(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Mo(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function g$(e,t){t=t.checked,t!=null&&JS(e,"checked",t,!1)}function gj(e,t){g$(e,t);var r=Mo(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?vj(e,t.type,r):t.hasOwnProperty("defaultValue")&&vj(e,t.type,Mo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function DP(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function vj(e,t,r){(t!=="number"||iv(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Gf=Array.isArray;function vd(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Mo(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function xj(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ye(91));return sr({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function LP(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(ye(92));if(Gf(r)){if(1<r.length)throw Error(ye(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Mo(r)}}function v$(e,t){var r=Mo(t.value),n=Mo(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function FP(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function x$(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function yj(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?x$(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Lp,y$=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Lp=Lp||document.createElement("div"),Lp.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Lp.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ah(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var nh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},oH=["Webkit","ms","Moz","O"];Object.keys(nh).forEach(function(e){oH.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),nh[t]=nh[e]})});function b$(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||nh.hasOwnProperty(e)&&nh[e]?(""+t).trim():t+"px"}function w$(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=b$(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var lH=sr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bj(e,t){if(t){if(lH[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ye(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ye(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ye(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ye(62))}}function wj(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 jj=null;function r_(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Nj=null,xd=null,yd=null;function BP(e){if(e=Zm(e)){if(typeof Nj!="function")throw Error(ye(280));var t=e.stateNode;t&&(t=py(t),Nj(e.stateNode,e.type,t))}}function j$(e){xd?yd?yd.push(e):yd=[e]:xd=e}function N$(){if(xd){var e=xd,t=yd;if(yd=xd=null,BP(e),t)for(e=0;e<t.length;e++)BP(t[e])}}function S$(e,t){return e(t)}function _$(){}var N0=!1;function C$(e,t,r){if(N0)return e(t,r);N0=!0;try{return S$(e,t,r)}finally{N0=!1,(xd!==null||yd!==null)&&(_$(),N$())}}function Eh(e,t){var r=e.stateNode;if(r===null)return null;var n=py(r);if(n===null)return null;r=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(ye(231,t,typeof r));return r}var Sj=!1;if(mi)try{var yf={};Object.defineProperty(yf,"passive",{get:function(){Sj=!0}}),window.addEventListener("test",yf,yf),window.removeEventListener("test",yf,yf)}catch{Sj=!1}function cH(e,t,r,n,s,i,o,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(r,d)}catch(u){this.onError(u)}}var ah=!1,ov=null,lv=!1,_j=null,dH={onError:function(e){ah=!0,ov=e}};function uH(e,t,r,n,s,i,o,l,c){ah=!1,ov=null,cH.apply(dH,arguments)}function fH(e,t,r,n,s,i,o,l,c){if(uH.apply(this,arguments),ah){if(ah){var d=ov;ah=!1,ov=null}else throw Error(ye(198));lv||(lv=!0,_j=d)}}function xc(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function P$(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function zP(e){if(xc(e)!==e)throw Error(ye(188))}function hH(e){var t=e.alternate;if(!t){if(t=xc(e),t===null)throw Error(ye(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===r)return zP(s),e;if(i===n)return zP(s),t;i=i.sibling}throw Error(ye(188))}if(r.return!==n.return)r=s,n=i;else{for(var o=!1,l=s.child;l;){if(l===r){o=!0,r=s,n=i;break}if(l===n){o=!0,n=s,r=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===r){o=!0,r=i,n=s;break}if(l===n){o=!0,n=i,r=s;break}l=l.sibling}if(!o)throw Error(ye(189))}}if(r.alternate!==n)throw Error(ye(190))}if(r.tag!==3)throw Error(ye(188));return r.stateNode.current===r?e:t}function k$(e){return e=hH(e),e!==null?A$(e):null}function A$(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=A$(e);if(t!==null)return t;e=e.sibling}return null}var E$=Xn.unstable_scheduleCallback,UP=Xn.unstable_cancelCallback,mH=Xn.unstable_shouldYield,pH=Xn.unstable_requestPaint,dr=Xn.unstable_now,gH=Xn.unstable_getCurrentPriorityLevel,n_=Xn.unstable_ImmediatePriority,O$=Xn.unstable_UserBlockingPriority,cv=Xn.unstable_NormalPriority,vH=Xn.unstable_LowPriority,T$=Xn.unstable_IdlePriority,uy=null,ks=null;function xH(e){if(ks&&typeof ks.onCommitFiberRoot=="function")try{ks.onCommitFiberRoot(uy,e,void 0,(e.current.flags&128)===128)}catch{}}var Ja=Math.clz32?Math.clz32:wH,yH=Math.log,bH=Math.LN2;function wH(e){return e>>>=0,e===0?32:31-(yH(e)/bH|0)|0}var Fp=64,Bp=4194304;function Kf(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function dv(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~s;l!==0?n=Kf(l):(i&=o,i!==0&&(n=Kf(i)))}else o=r&~s,o!==0?n=Kf(o):i!==0&&(n=Kf(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Ja(t),s=1<<r,n|=e[r],t&=~s;return n}function jH(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function NH(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-Ja(i),l=1<<o,c=s[o];c===-1?(!(l&r)||l&n)&&(s[o]=jH(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Cj(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function M$(){var e=Fp;return Fp<<=1,!(Fp&4194240)&&(Fp=64),e}function S0(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}
vendor: 4,087 bytes, line 37
37function Qm(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ja(t),e[t]=r}function SH(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-Ja(r),i=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~i}}function a_(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Ja(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var Ct=0;function I$(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var $$,s_,R$,D$,L$,Pj=!1,zp=[],yo=null,bo=null,wo=null,Oh=new Map,Th=new Map,Ji=[],_H="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function WP(e,t){switch(e){case"focusin":case"focusout":yo=null;break;case"dragenter":case"dragleave":bo=null;break;case"mouseover":case"mouseout":wo=null;break;case"pointerover":case"pointerout":Oh.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Th.delete(t.pointerId)}}function bf(e,t,r,n,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Zm(t),t!==null&&s_(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function CH(e,t,r,n,s){switch(t){case"focusin":return yo=bf(yo,e,t,r,n,s),!0;case"dragenter":return bo=bf(bo,e,t,r,n,s),!0;case"mouseover":return wo=bf(wo,e,t,r,n,s),!0;case"pointerover":var i=s.pointerId;return Oh.set(i,bf(Oh.get(i)||null,e,t,r,n,s)),!0;case"gotpointercapture":return i=s.pointerId,Th.set(i,bf(Th.get(i)||null,e,t,r,n,s)),!0}return!1}function F$(e){var t=_l(e.target);if(t!==null){var r=xc(t);if(r!==null){if(t=r.tag,t===13){if(t=P$(r),t!==null){e.blockedOn=t,L$(e.priority,function(){R$(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Og(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=kj(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);jj=n,r.target.dispatchEvent(n),jj=null}else return t=Zm(r),t!==null&&s_(t),e.blockedOn=r,!1;t.shift()}return!0}function HP(e,t,r){Og(e)&&r.delete(t)}function PH(){Pj=!1,yo!==null&&Og(yo)&&(yo=null),bo!==null&&Og(bo)&&(bo=null),wo!==null&&Og(wo)&&(wo=null),Oh.forEach(HP),Th.forEach(HP)}function wf(e,t){e.blockedOn===t&&(e.blockedOn=null,Pj||(Pj=!0,Xn.unstable_scheduleCallback(Xn.unstable_NormalPriority,PH)))}function Mh(e){function t(s){return wf(s,e)}if(0<zp.length){wf(zp[0],e);for(var r=1;r<zp.length;r++){var n=zp[r];n.blockedOn===e&&(n.blockedOn=null)}}for(yo!==null&&wf(yo,e),bo!==null&&wf(bo,e),wo!==null&&wf(wo,e),Oh.forEach(t),Th.forEach(t),r=0;r<Ji.length;r++)n=Ji[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Ji.length&&(r=Ji[0],r.blockedOn===null);)F$(r),r.blockedOn===null&&Ji.shift()}var bd=Pi.ReactCurrentBatchConfig,uv=!0;function kH(e,t,r,n){var s=Ct,i=bd.transition;bd.transition=null;try{Ct=1,i_(e,t,r,n)}finally{Ct=s,bd.transition=i}}function AH(e,t,r,n){var s=Ct,i=bd.transition;bd.transition=null;try{Ct=4,i_(e,t,r,n)}finally{Ct=s,bd.transition=i}}function i_(e,t,r,n){if(uv){var s=kj(e,t,r,n);if(s===null)I0(e,t,n,fv,r),WP(e,n);else if(CH(s,e,t,r,n))n.stopPropagation();else if(WP(e,n),t&4&&-1<_H.indexOf(e)){for(;s!==null;){var i=Zm(s);if(i!==null&&$$(i),i=kj(e,t,r,n),i===null&&I0(e,t,n,fv,r),i===s)break;s=i}s!==null&&n.stopPropagation()}else I0(e,t,n,null,r)}}var fv=null;function kj(e,t,r,n){if(fv=null,e=r_(n),e=_l(e),e!==null)if(t=xc(e),t===null)e=null;else if(r=t.tag,r===13){if(e=P$(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return fv=e,null}
vendor: 10,401 bytes, line 37
37function B$(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(gH()){case n_:return 1;case O$:return 4;case cv:case vH:return 16;case T$:return 536870912;default:return 16}default:return 16}}var ho=null,o_=null,Tg=null;function z$(){if(Tg)return Tg;var e,t=o_,r=t.length,n,s="value"in ho?ho.value:ho.textContent,i=s.length;for(e=0;e<r&&t[e]===s[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===s[i-n];n++);return Tg=s.slice(e,1<n?1-n:void 0)}function Mg(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Up(){return!0}function VP(){return!1}function ea(e){function t(r,n,s,i,o){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Up:VP,this.isPropagationStopped=VP,this}return sr(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Up)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Up)},persist:function(){},isPersistent:Up}),t}var Uu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},l_=ea(Uu),Jm=sr({},Uu,{view:0,detail:0}),EH=ea(Jm),_0,C0,jf,fy=sr({},Jm,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:c_,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==jf&&(jf&&e.type==="mousemove"?(_0=e.screenX-jf.screenX,C0=e.screenY-jf.screenY):C0=_0=0,jf=e),_0)},movementY:function(e){return"movementY"in e?e.movementY:C0}}),qP=ea(fy),OH=sr({},fy,{dataTransfer:0}),TH=ea(OH),MH=sr({},Jm,{relatedTarget:0}),P0=ea(MH),IH=sr({},Uu,{animationName:0,elapsedTime:0,pseudoElement:0}),$H=ea(IH),RH=sr({},Uu,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),DH=ea(RH),LH=sr({},Uu,{data:0}),GP=ea(LH),FH={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},BH={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"},zH={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function UH(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zH[e])?!!t[e]:!1}function c_(){return UH}var WH=sr({},Jm,{key:function(e){if(e.key){var t=FH[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Mg(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?BH[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:c_,charCode:function(e){return e.type==="keypress"?Mg(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Mg(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),HH=ea(WH),VH=sr({},fy,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),KP=ea(VH),qH=sr({},Jm,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:c_}),GH=ea(qH),KH=sr({},Uu,{propertyName:0,elapsedTime:0,pseudoElement:0}),YH=ea(KH),XH=sr({},fy,{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}),QH=ea(XH),JH=[9,13,27,32],d_=mi&&"CompositionEvent"in window,sh=null;mi&&"documentMode"in document&&(sh=document.documentMode);var ZH=mi&&"TextEvent"in window&&!sh,U$=mi&&(!d_||sh&&8<sh&&11>=sh),YP=" ",XP=!1;function W$(e,t){switch(e){case"keyup":return JH.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function H$(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rd=!1;function eV(e,t){switch(e){case"compositionend":return H$(t);case"keypress":return t.which!==32?null:(XP=!0,YP);case"textInput":return e=t.data,e===YP&&XP?null:e;default:return null}}function tV(e,t){if(rd)return e==="compositionend"||!d_&&W$(e,t)?(e=z$(),Tg=o_=ho=null,rd=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return U$&&t.locale!=="ko"?null:t.data;default:return null}}var rV={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 QP(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!rV[e.type]:t==="textarea"}function V$(e,t,r,n){j$(n),t=hv(t,"onChange"),0<t.length&&(r=new l_("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var ih=null,Ih=null;function nV(e){r4(e,0)}function hy(e){var t=sd(e);if(p$(t))return e}function aV(e,t){if(e==="change")return t}var q$=!1;if(mi){var k0;if(mi){var A0="oninput"in document;if(!A0){var JP=document.createElement("div");JP.setAttribute("oninput","return;"),A0=typeof JP.oninput=="function"}k0=A0}else k0=!1;q$=k0&&(!document.documentMode||9<document.documentMode)}function ZP(){ih&&(ih.detachEvent("onpropertychange",G$),Ih=ih=null)}function G$(e){if(e.propertyName==="value"&&hy(Ih)){var t=[];V$(t,Ih,e,r_(e)),C$(nV,t)}}function sV(e,t,r){e==="focusin"?(ZP(),ih=t,Ih=r,ih.attachEvent("onpropertychange",G$)):e==="focusout"&&ZP()}function iV(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return hy(Ih)}function oV(e,t){if(e==="click")return hy(t)}function lV(e,t){if(e==="input"||e==="change")return hy(t)}function cV(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ns=typeof Object.is=="function"?Object.is:cV;function $h(e,t){if(ns(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!dj.call(t,s)||!ns(e[s],t[s]))return!1}return!0}function ek(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tk(e,t){var r=ek(e);e=0;for(var n;r;){if(r.nodeType===3){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=ek(r)}}function K$(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?K$(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Y$(){for(var e=window,t=iv();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=iv(e.document)}return t}function u_(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function dV(e){var t=Y$(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&K$(r.ownerDocument.documentElement,r)){if(n!==null&&u_(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,i=Math.min(n.start,s);n=n.end===void 0?i:Math.min(n.end,s),!e.extend&&i>n&&(s=n,n=i,i=s),s=tk(r,i);var o=tk(r,n);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var uV=mi&&"documentMode"in document&&11>=document.documentMode,nd=null,Aj=null,oh=null,Ej=!1;function rk(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ej||nd==null||nd!==iv(n)||(n=nd,"selectionStart"in n&&u_(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focu
vendor: 4,383 bytes, line 37
37sNode:n.focusNode,focusOffset:n.focusOffset}),oh&&$h(oh,n)||(oh=n,n=hv(Aj,"onSelect"),0<n.length&&(t=new l_("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=nd)))}function Wp(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var ad={animationend:Wp("Animation","AnimationEnd"),animationiteration:Wp("Animation","AnimationIteration"),animationstart:Wp("Animation","AnimationStart"),transitionend:Wp("Transition","TransitionEnd")},E0={},X$={};mi&&(X$=document.createElement("div").style,"AnimationEvent"in window||(delete ad.animationend.animation,delete ad.animationiteration.animation,delete ad.animationstart.animation),"TransitionEvent"in window||delete ad.transitionend.transition);function my(e){if(E0[e])return E0[e];if(!ad[e])return e;var t=ad[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in X$)return E0[e]=t[r];return e}var Q$=my("animationend"),J$=my("animationiteration"),Z$=my("animationstart"),e4=my("transitionend"),t4=new Map,nk="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Wo(e,t){t4.set(e,t),vc(t,[e])}for(var O0=0;O0<nk.length;O0++){var T0=nk[O0],fV=T0.toLowerCase(),hV=T0[0].toUpperCase()+T0.slice(1);Wo(fV,"on"+hV)}Wo(Q$,"onAnimationEnd");Wo(J$,"onAnimationIteration");Wo(Z$,"onAnimationStart");Wo("dblclick","onDoubleClick");Wo("focusin","onFocus");Wo("focusout","onBlur");Wo(e4,"onTransitionEnd");qd("onMouseEnter",["mouseout","mouseover"]);qd("onMouseLeave",["mouseout","mouseover"]);qd("onPointerEnter",["pointerout","pointerover"]);qd("onPointerLeave",["pointerout","pointerover"]);vc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));vc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));vc("onBeforeInput",["compositionend","keypress","textInput","paste"]);vc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));vc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));vc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yf="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(" "),mV=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yf));function ak(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,fH(n,t,void 0,e),e.currentTarget=null}function r4(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==i&&s.isPropagationStopped())break e;ak(s,l,d),i=c}else for(o=0;o<n.length;o++){if(l=n[o],c=l.instance,d=l.currentTarget,l=l.listener,c!==i&&s.isPropagationStopped())break e;ak(s,l,d),i=c}}}if(lv)throw e=_j,lv=!1,_j=null,e}function Ut(e,t){var r=t[$j];r===void 0&&(r=t[$j]=new Set);var n=e+"__bubble";r.has(n)||(n4(t,e,2,!1),r.add(n))}function M0(e,t,r){var n=0;t&&(n|=4),n4(r,e,n,t)}var Hp="_reactListening"+Math.random().toString(36).slice(2);function Rh(e){if(!e[Hp]){e[Hp]=!0,d$.forEach(function(r){r!=="selectionchange"&&(mV.has(r)||M0(r,!1,e),M0(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hp]||(t[Hp]=!0,M0("selectionchange",!1,t))}}function n4(e,t,r,n){switch(B$(t)){case 1:var s=kH;break;case 4:s=AH;break;default:s=i_}r=s.bind(null,t,r,e),s=void 0,!Sj||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function I0(e,t,r,n,s){var i=n;
vendor: 22,759 bytes, lines 37-38
37if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(o===4)for(o=n.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;l!==null;){if(o=_l(l),o===null)return;if(c=o.tag,c===5||c===6){n=i=o;continue e}l=l.parentNode}}n=n.return}C$(function(){var d=i,u=r_(r),f=[];e:{var h=t4.get(e);if(h!==void 0){var m=l_,v=e;switch(e){case"keypress":if(Mg(r)===0)break e;case"keydown":case"keyup":m=HH;break;case"focusin":v="focus",m=P0;break;case"focusout":v="blur",m=P0;break;case"beforeblur":case"afterblur":m=P0;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=qP;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=TH;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=GH;break;case Q$:case J$:case Z$:m=$H;break;case e4:m=YH;break;case"scroll":m=EH;break;case"wheel":m=QH;break;case"copy":case"cut":case"paste":m=DH;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=KP}var p=(t&4)!==0,x=!p&&e==="scroll",b=p?h!==null?h+"Capture":null:h;p=[];for(var y=d,w;y!==null;){w=y;var _=w.stateNode;if(w.tag===5&&_!==null&&(w=_,b!==null&&(_=Eh(y,b),_!=null&&p.push(Dh(y,_,w)))),x)break;y=y.return}0<p.length&&(h=new m(h,v,null,r,u),f.push({event:h,listeners:p}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&r!==jj&&(v=r.relatedTarget||r.fromElement)&&(_l(v)||v[pi]))break e;if((m||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,m?(v=r.relatedTarget||r.toElement,m=d,v=v?_l(v):null,v!==null&&(x=xc(v),v!==x||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=d),m!==v)){if(p=qP,_="onMouseLeave",b="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(p=KP,_="onPointerLeave",b="onPointerEnter",y="pointer"),x=m==null?h:sd(m),w=v==null?h:sd(v),h=new p(_,y+"leave",m,r,u),h.target=x,h.relatedTarget=w,_=null,_l(u)===d&&(p=new p(b,y+"enter",v,r,u),p.target=w,p.relatedTarget=x,_=p),x=_,m&&v)t:{for(p=m,b=v,y=0,w=p;w;w=Mc(w))y++;for(w=0,_=b;_;_=Mc(_))w++;for(;0<y-w;)p=Mc(p),y--;for(;0<w-y;)b=Mc(b),w--;for(;y--;){if(p===b||b!==null&&p===b.alternate)break t;p=Mc(p),b=Mc(b)}p=null}else p=null;m!==null&&sk(f,h,m,p,!1),v!==null&&x!==null&&sk(f,x,v,p,!0)}}e:{if(h=d?sd(d):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var N=aV;else if(QP(h))if(q$)N=lV;else{N=iV;var j=sV}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(N=oV);if(N&&(N=N(e,d))){V$(f,N,r,u);break e}j&&j(e,h,d),e==="focusout"&&(j=h._wrapperState)&&j.controlled&&h.type==="number"&&vj(h,"number",h.value)}switch(j=d?sd(d):window,e){case"focusin":(QP(j)||j.contentEditable==="true")&&(nd=j,Aj=d,oh=null);break;case"focusout":oh=Aj=nd=null;break;case"mousedown":Ej=!0;break;case"contextmenu":case"mouseup":case"dragend":Ej=!1,rk(f,r,u);break;case"selectionchange":if(uV)break;case"keydown":case"keyup":rk(f,r,u)}var S;if(d_)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else rd?W$(e,r)&&(C="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(C="onCompositionStart");C&&(U$&&r.locale!=="ko"&&(rd||C!=="onCompositionStart"?C==="onCompositionEnd"&&rd&&(S=z$()):(ho=u,o_="value"in ho?ho.value:ho.textContent,rd=!0)),j=hv(d,C),0<j.length&&(C=new GP(C,e,null,r,u),f.push({event:C,listeners:j}),S?C.data=S:(S=H$(r),S!==null&&(C.data=S)))),(S=ZH?eV(e,r):tV(e,r))&&(d=hv(d,"onBeforeInput"),0<d.length&&(u=new GP("onBeforeInput","beforeinput",null,r,u),f.push({event:u,listeners:d}),u.data=S))}r4(f,t)})}function Dh(e,t,r){return{instance:e,listener:t,currentTarget:r}}function hv(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Eh(e,r),i!=null&&n.unshift(Dh(e,i,s)),i=Eh(e,t),i!=null&&n.push(Dh(e,i,s))),e=e.return}return n}function Mc(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function sk(e,t,r,n,s){for(var i=t._reactName,o=[];r!==null&&r!==n;){var l=r,c=l.alternate,d=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&d!==null&&(l=d,s?(c=Eh(r,i),c!=null&&o.unshift(Dh(r,c,l))):s||(c=Eh(r,i),c!=null&&o.push(Dh(r,c,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var pV=/\r\n?/g,gV=/\u0000|\uFFFD/g;function ik(e){return(typeof e=="string"?e:""+e).replace(pV,` 38`).replace(gV,"")}function Vp(e,t,r){if(t=ik(t),ik(e)!==t&&r)throw Error(ye(425))}function mv(){}var Oj=null,Tj=null;function Mj(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ij=typeof setTimeout=="function"?setTimeout:void 0,vV=typeof clearTimeout=="function"?clearTimeout:void 0,ok=typeof Promise=="function"?Promise:void 0,xV=typeof queueMicrotask=="function"?queueMicrotask:typeof ok<"u"?function(e){return ok.resolve(null).then(e).catch(yV)}:Ij;function yV(e){setTimeout(function(){throw e})}function $0(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),Mh(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);Mh(t)}function jo(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function lk(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Wu=Math.random().toString(36).slice(2),ws="__reactFiber$"+Wu,Lh="__reactProps$"+Wu,pi="__reactContainer$"+Wu,$j="__reactEvents$"+Wu,bV="__reactListeners$"+Wu,wV="__reactHandles$"+Wu;function _l(e){var t=e[ws];if(t)return t;for(var r=e.parentNode;r;){if(t=r[pi]||r[ws]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=lk(e);e!==null;){if(r=e[ws])return r;e=lk(e)}return t}e=r,r=e.parentNode}return null}function Zm(e){return e=e[ws]||e[pi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function sd(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ye(33))}function py(e){return e[Lh]||null}var Rj=[],id=-1;function Ho(e){return{current:e}}function qt(e){0>id||(e.current=Rj[id],Rj[id]=null,id--)}function Dt(e,t){id++,Rj[id]=e.current,e.current=t}var Io={},nn=Ho(Io),Mn=Ho(!1),Ql=Io;function Gd(e,t){var r=e.type.contextTypes;if(!r)return Io;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in r)s[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function In(e){return e=e.childContextTypes,e!=null}function pv(){qt(Mn),qt(nn)}function ck(e,t,r){if(nn.current!==Io)throw Error(ye(168));Dt(nn,t),Dt(Mn,r)}function a4(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(ye(108,sH(e)||"Unknown",s));return sr({},r,n)}function gv(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Io,Ql=nn.current,Dt(nn,e),Dt(Mn,Mn.current),!0}function dk(e,t,r){var n=e.stateNode;if(!n)throw Error(ye(169));r?(e=a4(e,t,Ql),n.__reactInternalMemoizedMergedChildContext=e,qt(Mn),qt(nn),Dt(nn,e)):qt(Mn),Dt(Mn,r)}var Js=null,gy=!1,R0=!1;function s4(e){Js===null?Js=[e]:Js.push(e)}function jV(e){gy=!0,s4(e)}function Vo(){if(!R0&&Js!==null){R0=!0;var e=0,t=Ct;try{var r=Js;for(Ct=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Js=null,gy=!1}catch(s){throw Js!==null&&(Js=Js.slice(e+1)),E$(n_,Vo),s}finally{Ct=t,R0=!1}}return null}var od=[],ld=0,vv=null,xv=0,ua=[],fa=0,Jl=null,ni=1,ai="";function gl(e,t){od[ld++]=xv,od[ld++]=vv,vv=e,xv=t}function i4(e,t,r){ua[fa++]=ni,ua[fa++]=ai,ua[fa++]=Jl,Jl=e;var n=ni;e=ai;var s=32-Ja(n)-1;n&=~(1<<s),r+=1;var i=32-Ja(t)+s;if(30<i){var o=s-s%5;i=(n&(1<<o)-1).toString(32),n>>=o,s-=o,ni=1<<32-Ja(t)+s|r<<s|n,ai=i+e}else ni=1<<i|r<<s|n,ai=e}function f_(e){e.return!==null&&(gl(e,1),i4(e,1,0))}function h_(e){for(;e===vv;)vv=od[--ld],od[ld]=null,xv=od[--ld],od[ld]=null;for(;e===Jl;)Jl=ua[--fa],ua[fa]=null,ai=ua[--fa],ua[fa]=null,ni=ua[--fa],ua[fa]=null}var Gn=null,qn=null,Xt=!1,qa=null;function o4(e,t){var r=ma(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function uk(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Gn=e,qn=jo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Gn=e,qn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Jl!==null?{id:ni,overflow:ai}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=ma(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Gn=e,qn=null,!0):!1;default:return!1}}function Dj(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Lj(e){if(Xt){var t=qn;if(t){var r=t;if(!uk(e,t)){if(Dj(e))throw Error(ye(418));t=jo(r.nextSibling);var n=Gn;t&&uk(e,t)?o4(n,r):(e.flags=e.flags&-4097|2,Xt=!1,Gn=e)}}else{if(Dj(e))throw Error(ye(418));e.flags=e.flags&-4097|2,Xt=!1,Gn=e}}}function fk(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Gn=e}function qp(e){if(e!==Gn)return!1;if(!Xt)return fk(e),Xt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Mj(e.type,e.memoizedProps)),t&&(t=qn)){if(Dj(e))throw l4(),Error(ye(418));for(;t;)o4(e,t),t=jo(t.nextSibling)}if(fk(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ye(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){qn=jo(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}qn=null}}else qn=Gn?jo(e.stateNode.nextSibling):null;return!0}function l4(){for(var e=qn;e;)e=jo(e.nextSibling)}function Kd(){qn=Gn=null,Xt=!1}function m_(e){qa===null?qa=[e]:qa.push(e)}var NV=Pi.ReactCurrentBatchConfig;function Nf(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(ye(309));var n=r.stateNode}if(!n)throw Error(ye(147,e));var s=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=s.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(ye(284));if(!r._owner)throw Error(ye(290,e))}return e}function Gp(e,t){throw e=Object.prototype.toString.call(t),Error(ye(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function hk(e){var t=e._init;return t(e._payload)}function c4(e){function t(b,y){if(e){var w=b.deletions;w===null?(b.deletions=[y],b.flags|=16):w.push(y)}}function r(b,y){if(!e)return null;for(;y!==null;)t(b,y),y=y.sibling;return null}function n(b,y){for(b=new Map;y!==null;)y.key!==null?b.set(y.key,y):b.set(y.index,y),y=y.sibling;return b}function s(b,y){return b=Co(b,y),b.index=0,b.sibling=null,b}function i(b,y,w){return b.index=w,e?(w=b.alternate,w!==null?(w=w.index,w<y?(b.flags|=2,y):w):(b.flags|=2,y)):(b.flags|=1048576,y)}function o(b){return e&&b.alternate===null&&(b.flags|=2),b}function l(b,y,w,_){return y===null||y.tag!==6?(y=W0(w,b.mode,_),y.return=b,y):(y=s(y,w),y.return=b,y)}function c(b,y,w,_){var N=w.type;return N===td?u(b,y,w.props.children,_,w.key):y!==null&&(y.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Yi&&hk(N)===y.type)?(_=s(y,w.props),_.ref=Nf(b,y,w),_.return=b,_):(_=Bg(w.type,w.key,w.props,null,b.mode,_),_.ref=Nf(b,y,w),_.return=b,_)}function d(b,y,w,_){return y===null||y.tag!==4||y.stateNode.containerInfo!==w.containerInfo||y.stateNode.implementation!==w.implementation?(y=H0(w,b.mode,_),y.return=b,y):(y=s(y,w.children||[]),y.return=b,y)}function u(b,y,w,_,N){return y===null||y.tag!==7?(y=Gl(w,b.mode,_,N),y.return=b,y):(y=s(y,w),y.return=b,y)}function f(b,y,w){if(typeof y=="string"&&y!==""||typeof y=="number")return y=W0(""+y,b.mode,w),y.return=b,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Rp:return w=Bg(y.type,y.key,y.props,null,b.mode,w),w.ref=Nf(b,null,y),w.return=b,w;case ed:return y=H0(y,b.mode,w),y.return=b,y;case Yi:var _=y._init;return f(b,_(y._payload),w)}if(Gf(y)||xf(y))return y=Gl(y,b.mode,w,null),y.return=b,y;Gp(b,y)}return null}function h(b,y,w,_){var N=y!==null?y.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return N!==null?null:l(b,y,""+w,_);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Rp:return w.key===N?c(b,y,w,_):null;case ed:return w.key===N?d(b,y,w,_):null;case Yi:return N=w._init,h(b,y,N(w._payload),_)}if(Gf(w)||xf(w))return N!==null?null:u(b,y,w,_,null);Gp(b,w)}return null}function m(b,y,w,_,N){if(typeof _=="string"&&_!==""||typeof _=="number")return b=b.get(w)||null,l(y,b,""+_,N);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Rp:return b=b.get(_.key===null?w:_.key)||null,c(y,b,_,N);case ed:return b=b.get(_.key===null?w:_.key)||null,d(y,b,_,N);case Yi:var j=_._init;return m(b,y,w,j(_._payload),N)}if(Gf(_)||xf(_))return b=b.get(w)||null,u(y,b,_,N,null);Gp(y,_)}return null}function v(b,y,w,_){for(var N=null,j=null,S=y,C=y=0,P=null;S!==null&&C<w.length;C++){S.index>C?(P=S,S=null):P=S.sibling;var A=h(b,S,w[C],_);if(A===null){S===null&&(S=P);break}e&&S&&A.alternate===null&&t(b,S),y=i(A,y,C),j===null?N=A:j.sibling=A,j=A,S=P}if(C===w.length)return r(b,S),Xt&&gl(b,C),N;if(S===null){for(;C<w.length;C++)S=f(b,w[C],_),S!==null&&(y=i(S,y,C),j===null?N=S:j.sibling=S,j=S);return Xt&&gl(b,C),N}for(S=n(b,S);C<w.length;C++)P=m(S,b,C,w[C],_),P!==null&&(e&&P.alternate!==null&&S.delete(P.key===null?C:P.key),y=i(P,y,C),j===null?N=P:j.sibling=P,j=P);return e&&S.forEach(function(D){return t(b,D)}),Xt&&gl(b,C),N}function p(b,y,w,_){var N=xf(w);if(typeof N!="function")throw Error(ye(150));if(w=N.call(w),w==null)throw Error(ye(151));for(var j=N=null,S=y,C=y=0,P=null,A=w.next();S!==null&&!A.done;C++,A=w.next()){S.index>C?(P=S,S=null):P=S.sibling;var D=h(b,S,A.value,_);if(D===null){S===null&&(S=P);break}e&&S&&D.alternate===null&&t(b,S),y=i(D,y,C),j===null?N=D:j.sibling=D,j=D,S=P}if(A.done)return r(b,S),Xt&&gl(b,C),N;if(S===null){for(;!A.done;C++,A=w.next())A=f(b,A.value,_),A!==null&&(y=i(A,y,C),j===null?N=A:j.sibling=A,j=A);return Xt&&gl(b,C),N}for(S=n(b,S);!A.done;C++,A=w.next())A=m(S,b,C,A.value,_),A!==null&&(e&&A.alternate!==null&&S.delete(A.key===null?C:A.key),y=i(A,y,C),j===null?N=A:j.sibling=A,j=A);return e&&S.forEach(function(F){return t(b,F)}),Xt&&gl(b,C),N}function x(b,y,w,_){if(typeof w=="object"&&w!==null&&w.type===td&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Rp:e:{for(var N=w.key,j=y;j!==null;){if(j.key===N){if(N=w.type,N===td){if(j.tag===7){r(b,j.sibling),y=s(j,w.props.children),y.return=b,b=y;break e}}else if(j.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Yi&&hk(N)===j.type){r(b,j.sibling),y=s(j,w.props),y.ref=Nf(b,j,w),y.return=b,b=y;break e}r(b,j);break}else t(b,j);j=j.sibling}w.type===td?(y=Gl(w.props.children,b.mode,_,w.key),y.return=b,b=y):(_=Bg(w.type,w.key,w.props,null,b.mode,_),_.ref=Nf(b,y,w),_.return=b,b=_)}return o(b);case ed:e:{for(j=w.key;y!==null;){if(y.key===j)if(y.tag===4&&y.stateNode.containerInfo===w.containerInfo&&y.stateNode.implementation===w.implementation){r(b,y.sibling),y=s(y,w.children||[]),y.return=b,b=y;break e}else{r(b,y);break}else t(b,y);y=y.sibling}y=H0(w,b.mode,_),y.return=b,b=y}return o(b);case Yi:return j=w._init,x(b,y,j(w._payload),_)}if(Gf(w))return v(b,y,w,_);if(xf(w))return p(b,y,w,_);Gp(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,y!==null&&y.tag===6?(r(b,y.sibling),y=s(y,w),y.return=b,b=y):(r(b,y),y=W0(w,b.mode,_),y.return=b,b=y),o(b)):r(b,y)}return x}var Yd=c4(!0),d4=c4(!1),yv=Ho(null),bv=null,cd=null,p_=null;function g_(){p_=cd=bv=null}function v_(e){var t=yv.current;qt(yv),e._currentValue=t}function Fj(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function wd(e,t){bv=e,p_=cd=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(An=!0),e.firstContext=null)}function wa(e){var t=e._currentValue;if(p_!==e)if(e={context:e,memoizedValue:t,next:null},cd===null){if(bv===null)throw Error(ye(308));cd=e,bv.dependencies={lanes:0,firstContext:e}}else cd=cd.next=e;return t}var Cl=null;function x_(e){Cl===null?Cl=[e]:Cl.push(e)}function u4(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,x_(t)):(r.next=s.next,s.next=r),t.interleaved=r,gi(e,n)}function gi(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Xi=!1;function y_(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function f4(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function li(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function No(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ht&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,gi(e,r)}return s=n.interleaved,s===null?(t.next=t,x_(n)):(t.next=s.next,s.next=t),n.interleaved=t,gi(e,r)}function Ig(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,a_(e,r)}}function mk(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?s=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?s=i=t:i=i.next=t}else s=i=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function wv(e,t,r,n){var s=e.updateQueue;Xi=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?i=d:o.next=d,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=d:l.next=d,u.lastBaseUpdate=c))}if(i!==null){var f=s.baseState;o=0,u=d=c=null,l=i;do{var h=l.lane,m=l.eventTime;if((n&h)===h){u!==null&&(u=u.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,p=l;switch(h=t,m=r,p.tag){case 1:if(v=p.payload,typeof v=="function"){f=v.call(m,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=p.payload,h=typeof v=="function"?v.call(m,f,h):v,h==null)break e;f=sr({},f,h);break e;case 2:Xi=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=m,c=f):u=u.next=m,o|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(u===null&&(c=f),s.baseState=c,s.firstBaseUpdate=d,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);ec|=o,e.lanes=o,e.memoizedState=f}}function pk(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(ye(191,s));s.call(n)}}}var ep={},As=Ho(ep),Fh=Ho(ep),Bh=Ho(ep);function Pl(e){if(e===ep)throw Error(ye(174));return e}function b_(e,t){switch(Dt(Bh,t),Dt(Fh,e),Dt(As,ep),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:yj(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=yj(t,e)}qt(As),Dt(As,t)}function Xd(){qt(As),qt(Fh),qt(Bh)}function h4(e){Pl(Bh.current);var t=Pl(As.current),r=yj(t,e.type);t!==r&&(Dt(Fh,e),Dt(As,r))}function w_(e){Fh.current===e&&(qt(As),qt(Fh))}var er=Ho(0);function jv(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var D0=[];function j_(){for(var e=0;e<D0.length;e++)D0[e]._workInProgressVersionPrimary=null;D0.length=0}var $g=Pi.ReactCurrentDispatcher,L0=Pi.ReactCurrentBatchConfig,Zl=0,nr=null,wr=null,Pr=null,Nv=!1,lh=!1,zh=0,SV=0;function Kr(){throw Error(ye(321))}function N_(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!ns(e[r],t[r]))return!1;return!0}function S_(e,t,r,n,s,i){if(Zl=i,nr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,$g.current=e===null||e.memoizedState===null?kV:AV,e=r(n,s),lh){i=0;do{if(lh=!1,zh=0,25<=i)throw Error(ye(301));i+=1,Pr=wr=null,t.updateQueue=null,$g.current=EV,e=r(n,s)}while(lh)}if($g.current=Sv,t=wr!==null&&wr.next!==null,Zl=0,Pr=wr=nr=null,Nv=!1,t)throw Error(ye(300));return e}function __(){var e=zh!==0;return zh=0,e}function gs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pr===null?nr.memoizedState=Pr=e:Pr=Pr.next=e,Pr}function ja(){if(wr===null){var e=nr.alternate;e=e!==null?e.memoizedState:null}else e=wr.next;var t=Pr===null?nr.memoizedState:Pr.next;if(t!==null)Pr=t,wr=e;else{if(e===null)throw Error(ye(310));wr=e,e={memoizedState:wr.memoizedState,baseState:wr.baseState,baseQueue:wr.baseQueue,queue:wr.queue,next:null},Pr===null?nr.memoizedState=Pr=e:Pr=Pr.next=e}return Pr}function Uh(e,t){return typeof t=="function"?t(e):t}function F0(e){var t=ja(),r=t.queue;if(r===null)throw Error(ye(311));r.lastRenderedReducer=e;
vendor: 5,690 bytes, line 38
38var n=wr,s=n.baseQueue,i=r.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}n.baseQueue=s=i,r.pending=null}if(s!==null){i=s.next,n=n.baseState;var l=o=null,c=null,d=i;do{var u=d.lane;if((Zl&u)===u)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),n=d.hasEagerState?d.eagerState:e(n,d.action);else{var f={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=f,o=n):c=c.next=f,nr.lanes|=u,ec|=u}d=d.next}while(d!==null&&d!==i);c===null?o=n:c.next=l,ns(n,t.memoizedState)||(An=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do i=s.lane,nr.lanes|=i,ec|=i,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function B0(e){var t=ja(),r=t.queue;if(r===null)throw Error(ye(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,i=t.memoizedState;if(s!==null){r.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);ns(i,t.memoizedState)||(An=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function m4(){}function p4(e,t){var r=nr,n=ja(),s=t(),i=!ns(n.memoizedState,s);if(i&&(n.memoizedState=s,An=!0),n=n.queue,C_(x4.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||Pr!==null&&Pr.memoizedState.tag&1){if(r.flags|=2048,Wh(9,v4.bind(null,r,n,s,t),void 0,null),Or===null)throw Error(ye(349));Zl&30||g4(r,t,s)}return s}function g4(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=nr.updateQueue,t===null?(t={lastEffect:null,stores:null},nr.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function v4(e,t,r,n){t.value=r,t.getSnapshot=n,y4(t)&&b4(e)}function x4(e,t,r){return r(function(){y4(t)&&b4(e)})}function y4(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!ns(e,r)}catch{return!0}}function b4(e){var t=gi(e,1);t!==null&&Za(t,e,1,-1)}function gk(e){var t=gs();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Uh,lastRenderedState:e},t.queue=e,e=e.dispatch=PV.bind(null,nr,e),[t.memoizedState,e]}function Wh(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=nr.updateQueue,t===null?(t={lastEffect:null,stores:null},nr.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function w4(){return ja().memoizedState}function Rg(e,t,r,n){var s=gs();nr.flags|=e,s.memoizedState=Wh(1|t,r,void 0,n===void 0?null:n)}function vy(e,t,r,n){var s=ja();n=n===void 0?null:n;var i=void 0;if(wr!==null){var o=wr.memoizedState;if(i=o.destroy,n!==null&&N_(n,o.deps)){s.memoizedState=Wh(t,r,i,n);return}}nr.flags|=e,s.memoizedState=Wh(1|t,r,i,n)}function vk(e,t){return Rg(8390656,8,e,t)}function C_(e,t){return vy(2048,8,e,t)}function j4(e,t){return vy(4,2,e,t)}function N4(e,t){return vy(4,4,e,t)}function S4(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function _4(e,t,r){return r=r!=null?r.concat([e]):null,vy(4,4,S4.bind(null,t,e),r)}function P_(){}function C4(e,t){var r=ja();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&N_(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function P4(e,t){var r=ja();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&N_(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function k4(e,t,r){return Zl&21?(ns(r,t)||(r=M$(),nr.lanes|=r,ec|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,An=!0),e.memoizedState=r)}function _V(e,t){var r=Ct;Ct=r!==0&&4>r?r:4,e(!0);var n=L0.transition;L0.transition={};try{e(!1),t()}finally{Ct=r,L0.transition=n}}function A4(){return ja().memoizedState}function CV(e,t,r){var n=_o(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},E4(e))O4(t,r);else if(r=u4(e,t,r,n),r!==null){var s=pn();Za(r,e,n,s),T4(r,t,n)}}function PV(e,t,r){var n=_o(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(E4(e))O4(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,r);if(s.hasEagerState=!0,s.eagerState=l,ns(l,o)){var c=t.interleaved;c===null?(s.next=s,x_(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=u4(e,t,s,n),r!==null&&(s=pn(),Za(r,e,n,s),T4(r,t,n))}}function E4(e){var t=e.alternate;return e===nr||t!==null&&t===nr}function O4(e,t){lh=Nv=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function T4(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,a_(e,r)}}var Sv={readContext:wa,useCallback:Kr,useContext:Kr,useEffect:Kr,useImperativeHandle:Kr,useInsertionEffect:Kr,useLayoutEffect:Kr,useMemo:Kr,useReducer:Kr,useRef:Kr,useState:Kr,useDebugValue:Kr,useDeferredValue:Kr,useTransition:Kr,useMutableSource:Kr,useSyncExternalStore:Kr,useId:Kr,unstable_isNewReconciler:!1},kV={readContext:wa,useCallback:function(e,t){return gs().memoizedState=[e,t===void 0?null:t],e},useContext:wa,useEffect:vk,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Rg(4194308,4,S4.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Rg(4194308,4,e,t)},useInsertionEffect:function(e,t){return Rg(4,2,e,t)},useMemo:function(e,t){var r=gs();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=gs();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=CV.bind(null,nr,e),[n.memoizedState,e]}
vendor: 7,433 bytes, lines 38-40
38,useRef:function(e){var t=gs();return e={current:e},t.memoizedState=e},useState:gk,useDebugValue:P_,useDeferredValue:function(e){return gs().memoizedState=e},useTransition:function(){var e=gk(!1),t=e[0];return e=_V.bind(null,e[1]),gs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=nr,s=gs();if(Xt){if(r===void 0)throw Error(ye(407));r=r()}else{if(r=t(),Or===null)throw Error(ye(349));Zl&30||g4(n,t,r)}s.memoizedState=r;var i={value:r,getSnapshot:t};return s.queue=i,vk(x4.bind(null,n,i,e),[e]),n.flags|=2048,Wh(9,v4.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=gs(),t=Or.identifierPrefix;if(Xt){var r=ai,n=ni;r=(n&~(1<<32-Ja(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=zh++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=SV++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},AV={readContext:wa,useCallback:C4,useContext:wa,useEffect:C_,useImperativeHandle:_4,useInsertionEffect:j4,useLayoutEffect:N4,useMemo:P4,useReducer:F0,useRef:w4,useState:function(){return F0(Uh)},useDebugValue:P_,useDeferredValue:function(e){var t=ja();return k4(t,wr.memoizedState,e)},useTransition:function(){var e=F0(Uh)[0],t=ja().memoizedState;return[e,t]},useMutableSource:m4,useSyncExternalStore:p4,useId:A4,unstable_isNewReconciler:!1},EV={readContext:wa,useCallback:C4,useContext:wa,useEffect:C_,useImperativeHandle:_4,useInsertionEffect:j4,useLayoutEffect:N4,useMemo:P4,useReducer:B0,useRef:w4,useState:function(){return B0(Uh)},useDebugValue:P_,useDeferredValue:function(e){var t=ja();return wr===null?t.memoizedState=e:k4(t,wr.memoizedState,e)},useTransition:function(){var e=B0(Uh)[0],t=ja().memoizedState;return[e,t]},useMutableSource:m4,useSyncExternalStore:p4,useId:A4,unstable_isNewReconciler:!1};function Fa(e,t){if(e&&e.defaultProps){t=sr({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Bj(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:sr({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var xy={isMounted:function(e){return(e=e._reactInternals)?xc(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=pn(),s=_o(e),i=li(n,s);i.payload=t,r!=null&&(i.callback=r),t=No(e,i,s),t!==null&&(Za(t,e,s,n),Ig(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=pn(),s=_o(e),i=li(n,s);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=No(e,i,s),t!==null&&(Za(t,e,s,n),Ig(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=pn(),n=_o(e),s=li(r,n);s.tag=2,t!=null&&(s.callback=t),t=No(e,s,n),t!==null&&(Za(t,e,n,r),Ig(t,e,n))}};function xk(e,t,r,n,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,o):t.prototype&&t.prototype.isPureReactComponent?!$h(r,n)||!$h(s,i):!0}function M4(e,t,r){var n=!1,s=Io,i=t.contextType;return typeof i=="object"&&i!==null?i=wa(i):(s=In(t)?Ql:nn.current,n=t.contextTypes,i=(n=n!=null)?Gd(e,s):Io),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=xy,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function yk(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&xy.enqueueReplaceState(t,t.state,null)}function zj(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},y_(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=wa(i):(i=In(t)?Ql:nn.current,s.context=Gd(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Bj(e,t,i,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&xy.enqueueReplaceState(s,s.state,null),wv(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Qd(e,t){try{var r="",n=t;do r+=aH(n),n=n.return;while(n);var s=r}catch(i){s=` 39Error generating stack: `+i.message+` 40`+i.stack}return{value:e,source:t,stack:s,digest:null}}function z0(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Uj(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var OV=typeof WeakMap=="function"?WeakMap:Map;function I4(e,t,r){r=li(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Cv||(Cv=!0,Jj=n),Uj(e,t)},r}function $4(e,t,r){r=li(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){Uj(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Uj(e,t),typeof n!="function"&&(So===null?So=new Set([this]):So.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function bk(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new OV;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=VV.bind(null,e,t,r),t.then(e,e))}function wk(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function jk(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=li(-1,1),t.tag=2,No(r,t,1))),r.lanes|=1),e)}var TV=Pi.ReactCurrentOwner,An=!1;function cn(e,t,r,n){t.child=e===null?d4(t,null,r,n):Yd(t,e.child,r,n)}function Nk(e,t,r,n,s){r=r.render;var i=t.ref;return wd(t,s),n=S_(e,t,r,n,i,s),r=__(),e!==null&&!An?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,vi(e,t,s)):(Xt&&r&&f_(t),t.flags|=1,cn(e,t,n,s),t.child)}function Sk(e,t,r,n,s){if(e===null){var i=r.type;return typeof i=="function"&&!$_(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,R4(e,t,i,n,s)):(e=Bg(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(r=r.compare,r=r!==null?r:$h,r(o,n)&&e.ref===t.ref)return vi(e,t,s)}return t.flags|=1,e=Co(i,n),e.ref=t.ref,e.return=t,t.child=e}function R4(e,t,r,n,s){if(e!==null){var i=e.memoizedProps;if($h(i,n)&&e.ref===t.ref)if(An=!1,t.pendingProps=n=i,(e.lanes&s)!==0)e.flags&131072&&(An=!0);else return t.lanes=e.lanes,vi(e,t,s)}return Wj(e,t,r,n,s)}function D4(e,t,r){var n=t.pendingProps,s=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Dt(ud,Bn),Bn|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Dt(ud,Bn),Bn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,Dt(ud,Bn),Bn|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,Dt(ud,Bn),Bn|=n;return cn(e,t,s,r),t.child}function L4(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}
vendor: 4,711 bytes, line 40
40function Wj(e,t,r,n,s){var i=In(r)?Ql:nn.current;return i=Gd(t,i),wd(t,s),r=S_(e,t,r,n,i,s),n=__(),e!==null&&!An?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,vi(e,t,s)):(Xt&&n&&f_(t),t.flags|=1,cn(e,t,r,s),t.child)}function _k(e,t,r,n,s){if(In(r)){var i=!0;gv(t)}else i=!1;if(wd(t,s),t.stateNode===null)Dg(e,t),M4(t,r,n),zj(t,r,n,s),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,d=r.contextType;typeof d=="object"&&d!==null?d=wa(d):(d=In(r)?Ql:nn.current,d=Gd(t,d));var u=r.getDerivedStateFromProps,f=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||c!==d)&&yk(t,o,n,d),Xi=!1;var h=t.memoizedState;o.state=h,wv(t,n,o,s),c=t.memoizedState,l!==n||h!==c||Mn.current||Xi?(typeof u=="function"&&(Bj(t,r,u,n),c=t.memoizedState),(l=Xi||xk(t,r,l,n,h,c,d))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),o.props=n,o.state=c,o.context=d,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,f4(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:Fa(t.type,l),o.props=d,f=t.pendingProps,h=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=wa(c):(c=In(r)?Ql:nn.current,c=Gd(t,c));var m=r.getDerivedStateFromProps;(u=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||h!==c)&&yk(t,o,n,c),Xi=!1,h=t.memoizedState,o.state=h,wv(t,n,o,s);var v=t.memoizedState;l!==f||h!==v||Mn.current||Xi?(typeof m=="function"&&(Bj(t,r,m,n),v=t.memoizedState),(d=Xi||xk(t,r,d,n,h,v,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,v,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,v,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=v),o.props=n,o.state=v,o.context=c,n=d):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return Hj(e,t,r,n,i,s)}function Hj(e,t,r,n,s,i){L4(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return s&&dk(t,r,!1),vi(e,t,i);n=t.stateNode,TV.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Yd(t,e.child,null,i),t.child=Yd(t,null,l,i)):cn(e,t,l,i),t.memoizedState=n.state,s&&dk(t,r,!0),t.child}function F4(e){var t=e.stateNode;t.pendingContext?ck(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ck(e,t.context,!1),b_(e,t.containerInfo)}function Ck(e,t,r,n,s){return Kd(),m_(s),t.flags|=256,cn(e,t,r,n),t.child}var Vj={dehydrated:null,treeContext:null,retryLane:0};function qj(e){return{baseLanes:e,cachePool:null,transitions:null}}function B4(e,t,r){var n=t.pendingProps,s=er.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Dt(er,s&1),e===null)return Lj(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,i?(n=t.mode,i=t.child,o={mode:"hidden",children:o},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=wy(o,n,0,null),e=Gl(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=qj(r),t.memoizedState=Vj,e):k_(t,o));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return MV(e,t,o,n,l,s,r);if(i){i=n.fallback,o=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=Co(s,c),n.subtreeFlags=s.subtreeFlags&14680064),l!==null?i=Co(l,i):(i=Gl(i,o,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,o=e.child.memoizedState,o=o===null?qj(r):{base
vendor: 4,758 bytes, line 40
40Lanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~r,t.memoizedState=Vj,n}return i=e.child,e=i.sibling,n=Co(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function k_(e,t){return t=wy({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Kp(e,t,r,n){return n!==null&&m_(n),Yd(t,e.child,null,r),e=k_(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function MV(e,t,r,n,s,i,o){if(r)return t.flags&256?(t.flags&=-257,n=z0(Error(ye(422))),Kp(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,s=t.mode,n=wy({mode:"visible",children:n.children},s,0,null),i=Gl(i,s,o,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&Yd(t,e.child,null,o),t.child.memoizedState=qj(o),t.memoizedState=Vj,i);if(!(t.mode&1))return Kp(e,t,o,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(ye(419)),n=z0(i,n,void 0),Kp(e,t,o,n)}if(l=(o&e.childLanes)!==0,An||l){if(n=Or,n!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,gi(e,s),Za(n,e,s,-1))}return I_(),n=z0(Error(ye(421))),Kp(e,t,o,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=qV.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,qn=jo(s.nextSibling),Gn=t,Xt=!0,qa=null,e!==null&&(ua[fa++]=ni,ua[fa++]=ai,ua[fa++]=Jl,ni=e.id,ai=e.overflow,Jl=t),t=k_(t,n.children),t.flags|=4096,t)}function Pk(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Fj(e.return,t,r)}function U0(e,t,r,n,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=s)}function z4(e,t,r){var n=t.pendingProps,s=n.revealOrder,i=n.tail;if(cn(e,t,n.children,r),n=er.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pk(e,r,t);else if(e.tag===19)Pk(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Dt(er,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&jv(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),U0(t,!1,s,r,i);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&jv(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}U0(t,!0,r,null,i);break;case"together":U0(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Dg(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function vi(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),ec|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ye(153));if(t.child!==null){for(e=t.child,r=Co(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Co(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function IV(e,t,r){switch(t.tag){case 3:F4(t),Kd();break;case 5:h4(t);break;case 1:In(t.type)&&gv(t);break;case 4:b_(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;Dt(yv,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Dt(er,er.current&1),t.flags|=128,null):r&t.child.childLanes?B4(e,t,r):(Dt(er,er.current&1),e=vi(e,t,r),e!==null?e.sibling:null);Dt(er,er.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return z4(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Dt(er,er.current),n)break;return null;case 22:case 23:return t.lanes=0,D4(e,t,r)}return vi(e,t,r)}var U4,Gj,W4,H4;U4=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Gj=function(){};W4=function(e,t,r,n){var s=e.memoizedProps;
vendor: 4,165 bytes, line 40
40if(s!==n){e=t.stateNode,Pl(As.current);var i=null;switch(r){case"input":s=pj(e,s),n=pj(e,n),i=[];break;case"select":s=sr({},s,{value:void 0}),n=sr({},n,{value:void 0}),i=[];break;case"textarea":s=xj(e,s),n=xj(e,n),i=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=mv)}bj(r,n);var o;r=null;for(d in s)if(!n.hasOwnProperty(d)&&s.hasOwnProperty(d)&&s[d]!=null)if(d==="style"){var l=s[d];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(kh.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in n){var c=n[d];if(l=s!=null?s[d]:void 0,n.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(i||(i=[]),i.push(d,r)),r=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(kh.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&Ut("scroll",e),i||l===c||(i=[])):(i=i||[]).push(d,c))}r&&(i=i||[]).push("style",r);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};H4=function(e,t,r,n){r!==n&&(t.flags|=4)};function Sf(e,t){if(!Xt)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Yr(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function $V(e,t,r){var n=t.pendingProps;switch(h_(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yr(t),null;case 1:return In(t.type)&&pv(),Yr(t),null;case 3:return n=t.stateNode,Xd(),qt(Mn),qt(nn),j_(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(qp(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,qa!==null&&(t1(qa),qa=null))),Gj(e,t),Yr(t),null;case 5:w_(t);var s=Pl(Bh.current);if(r=t.type,e!==null&&t.stateNode!=null)W4(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(ye(166));return Yr(t),null}if(e=Pl(As.current),qp(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[ws]=t,n[Lh]=i,e=(t.mode&1)!==0,r){case"dialog":Ut("cancel",n),Ut("close",n);break;case"iframe":case"object":case"embed":Ut("load",n);break;case"video":case"audio":for(s=0;s<Yf.length;s++)Ut(Yf[s],n);break;case"source":Ut("error",n);break;case"img":case"image":case"link":Ut("error",n),Ut("load",n);break;case"details":Ut("toggle",n);break;case"input":RP(n,i),Ut("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},Ut("invalid",n);break;case"textarea":LP(n,i),Ut("invalid",n)}bj(r,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&Vp(n.textContent,l,e),s=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Vp(n.textContent,l,e),s=["children",""+l]):kh.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Ut("scroll",n)}switch(r){case"input":Dp(n),DP(n,i,!0);break;case"textarea":Dp(n),FP(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=mv)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=x$(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>
40",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[ws]=t,e[Lh]=n,U4(e,t,!1,!1),t.stateNode=e;e:{switch(o=wj(r,n),r){case"dialog":Ut("cancel",e),Ut("close",e),s=n;break;case"iframe":case"object":case"embed":Ut("load",e),s=n;break;case"video":case"audio":for(s=0;s<Yf.length;s++)Ut(Yf[s],e);s=n;break;case"source":Ut("error",e),s=n;break;case"img":case"image":case"link":Ut("error",e),Ut("load",e),s=n;break;case"details":Ut("toggle",e),s=n;break;case"input":RP(e,n),s=pj(e,n),Ut("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=sr({},n,{value:void 0}),Ut("invalid",e);break;case"textarea":LP(e,n),s=xj(e,n),Ut("invalid",e);break;default:s=n}bj(r,s),l=s;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?w$(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&y$(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Ah(e,c):typeof c=="number"&&Ah(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(kh.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Ut("scroll",e):c!=null&&JS(e,i,c,o))}switch(r){case"input":Dp(e),DP(e,n,!1);break;case"textarea":Dp(e),FP(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Mo(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?vd(e,!!n.multiple,i,!1):n.defaultValue!=null&&vd(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=mv)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Yr(t),null;case 6:if(e&&t.stateNode!=null)H4(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(ye(166));if(r=Pl(Bh.current),Pl(As.current),qp(t)){if(n=t.stateNode,r=t.memoizedProps,n[ws]=t,(i=n.nodeValue!==r)&&(e=Gn,e!==null))switch(e.tag){case 3:Vp(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Vp(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[ws]=t,t.stateNode=n}return Yr(t),null;case 13:if(qt(er),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Xt&&qn!==null&&t.mode&1&&!(t.flags&128))l4(),Kd(),t.flags|=98560,i=!1;else if(i=qp(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(ye(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ye(317));i[ws]=t}else Kd(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Yr(t),i=!1}else qa!==null&&(t1(qa),qa=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||er.current&1?Nr===0&&(Nr=3):I_())),t.updateQueue!==null&&(t.flags|=4),Yr(t),null);case 4:return Xd(),Gj(e,t),e===null&&Rh(t.stateNode.containerInfo),Yr(t),null;case 10:return v_(t.type._context),Yr(t),null;case 17:return In(t.type)&&pv(),Yr(t),null;case 19:if(qt(er),i=t.memoizedState,i===null)return Yr(t),null;if(n=(t.flags&128)!==0,o=i.rendering,o===null)if(n)Sf(i,!1);else{if(Nr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=jv(e),o!==null){for(t.flags|=128,Sf(i,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Dt(er,er.current&1|2),t.child}e=e.sibling}i.tail!==null&&dr()>Jd&&(t.flags|=128,n=!0,Sf(i,!1),t.lanes=4194304)}else{if(!n)if(e=jv(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Sf(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Xt)return Yr(t),null}else 2*dr()-i.renderingStartTime>Jd&&r!==1073741824&&(t.flags|=128,n=!0,Sf(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=dr(),t.sibling=null,r=er.current,Dt(er,n?r&1|2:r&1),t):(Yr(t),null);case 22:case 23:return M_(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Bn&1073741824&&(Yr(t),t.subtreeFlags&6&&(t.flags|=8192)):Yr(t),null;case 24:return null;case 25:return null}throw Error(ye(156,t.tag))}function RV(e,t){switch(h_(t),t.tag){case 1:return In(t.type)&&pv(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;
vendor: 23,856 bytes, line 40
40case 3:return Xd(),qt(Mn),qt(nn),j_(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return w_(t),null;case 13:if(qt(er),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ye(340));Kd()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qt(er),null;case 4:return Xd(),null;case 10:return v_(t.type._context),null;case 22:case 23:return M_(),null;case 24:return null;default:return null}}var Yp=!1,Jr=!1,DV=typeof WeakSet=="function"?WeakSet:Set,Ce=null;function dd(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){lr(e,t,n)}else r.current=null}function Kj(e,t,r){try{r()}catch(n){lr(e,t,n)}}var kk=!1;function LV(e,t){if(Oj=uv,e=Y$(),u_(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,d=0,u=0,f=e,h=null;t:for(;;){for(var m;f!==r||s!==0&&f.nodeType!==3||(l=o+s),f!==i||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===r&&++d===s&&(l=o),h===i&&++u===n&&(c=o),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Tj={focusedElem:e,selectionRange:r},uv=!1,Ce=t;Ce!==null;)if(t=Ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ce=e;else for(;Ce!==null;){t=Ce;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var p=v.memoizedProps,x=v.memoizedState,b=t.stateNode,y=b.getSnapshotBeforeUpdate(t.elementType===t.type?p:Fa(t.type,p),x);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ye(163))}}catch(_){lr(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Ce=e;break}Ce=t.return}return v=kk,kk=!1,v}function ch(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Kj(t,r,i)}s=s.next}while(s!==n)}}function yy(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Yj(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function V4(e){var t=e.alternate;t!==null&&(e.alternate=null,V4(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ws],delete t[Lh],delete t[$j],delete t[bV],delete t[wV])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function q4(e){return e.tag===5||e.tag===3||e.tag===4}function Ak(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||q4(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xj(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=mv));else if(n!==4&&(e=e.child,e!==null))for(Xj(e,t,r),e=e.sibling;e!==null;)Xj(e,t,r),e=e.sibling}function Qj(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Qj(e,t,r),e=e.sibling;e!==null;)Qj(e,t,r),e=e.sibling}var Lr=null,Ua=!1;function Fi(e,t,r){for(r=r.child;r!==null;)G4(e,t,r),r=r.sibling}function G4(e,t,r){if(ks&&typeof ks.onCommitFiberUnmount=="function")try{ks.onCommitFiberUnmount(uy,r)}catch{}switch(r.tag){case 5:Jr||dd(r,t);case 6:var n=Lr,s=Ua;Lr=null,Fi(e,t,r),Lr=n,Ua=s,Lr!==null&&(Ua?(e=Lr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Lr.removeChild(r.stateNode));break;case 18:Lr!==null&&(Ua?(e=Lr,r=r.stateNode,e.nodeType===8?$0(e.parentNode,r):e.nodeType===1&&$0(e,r),Mh(e)):$0(Lr,r.stateNode));break;case 4:n=Lr,s=Ua,Lr=r.stateNode.containerInfo,Ua=!0,Fi(e,t,r),Lr=n,Ua=s;break;case 0:case 11:case 14:case 15:if(!Jr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Kj(r,t,o),s=s.next}while(s!==n)}Fi(e,t,r);break;case 1:if(!Jr&&(dd(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){lr(r,t,l)}Fi(e,t,r);break;case 21:Fi(e,t,r);break;case 22:r.mode&1?(Jr=(n=Jr)||r.memoizedState!==null,Fi(e,t,r),Jr=n):Fi(e,t,r);break;default:Fi(e,t,r)}}function Ek(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new DV),t.forEach(function(n){var s=GV.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function $a(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Lr=l.stateNode,Ua=!1;break e;case 3:Lr=l.stateNode.containerInfo,Ua=!0;break e;case 4:Lr=l.stateNode.containerInfo,Ua=!0;break e}l=l.return}if(Lr===null)throw Error(ye(160));G4(i,o,s),Lr=null,Ua=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(d){lr(s,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)K4(t,e),t=t.sibling}function K4(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if($a(t,e),ms(e),n&4){try{ch(3,e,e.return),yy(3,e)}catch(p){lr(e,e.return,p)}try{ch(5,e,e.return)}catch(p){lr(e,e.return,p)}}break;case 1:$a(t,e),ms(e),n&512&&r!==null&&dd(r,r.return);break;case 5:if($a(t,e),ms(e),n&512&&r!==null&&dd(r,r.return),e.flags&32){var s=e.stateNode;try{Ah(s,"")}catch(p){lr(e,e.return,p)}}if(n&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=r!==null?r.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&g$(s,i),wj(l,o);var d=wj(l,i);for(o=0;o<c.length;o+=2){var u=c[o],f=c[o+1];u==="style"?w$(s,f):u==="dangerouslySetInnerHTML"?y$(s,f):u==="children"?Ah(s,f):JS(s,u,f,d)}switch(l){case"input":gj(s,i);break;case"textarea":v$(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?vd(s,!!i.multiple,m,!1):h!==!!i.multiple&&(i.defaultValue!=null?vd(s,!!i.multiple,i.defaultValue,!0):vd(s,!!i.multiple,i.multiple?[]:"",!1))}s[Lh]=i}catch(p){lr(e,e.return,p)}}break;case 6:if($a(t,e),ms(e),n&4){if(e.stateNode===null)throw Error(ye(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(p){lr(e,e.return,p)}}break;case 3:if($a(t,e),ms(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Mh(t.containerInfo)}catch(p){lr(e,e.return,p)}break;case 4:$a(t,e),ms(e);break;case 13:$a(t,e),ms(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(O_=dr())),n&4&&Ek(e);break;case 22:if(u=r!==null&&r.memoizedState!==null,e.mode&1?(Jr=(d=Jr)||u,$a(t,e),Jr=d):$a(t,e),ms(e),n&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!u&&e.mode&1)for(Ce=e,u=e.child;u!==null;){for(f=Ce=u;Ce!==null;){switch(h=Ce,m=h.child,h.tag){case 0:case 11:case 14:case 15:ch(4,h,h.return);break;case 1:dd(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(p){lr(n,r,p)}}break;case 5:dd(h,h.return);break;case 22:if(h.memoizedState!==null){Tk(f);continue}}m!==null?(m.return=h,Ce=m):Tk(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{s=f.stateNode,d?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=b$("display",o))}catch(p){lr(e,e.return,p)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=d?"":f.memoizedProps}catch(p){lr(e,e.return,p)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:$a(t,e),ms(e),n&4&&Ek(e);break;case 21:break;default:$a(t,e),ms(e)}}function ms(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(q4(r)){var n=r;break e}r=r.return}throw Error(ye(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(Ah(s,""),n.flags&=-33);var i=Ak(e);Qj(e,i,s);break;case 3:case 4:var o=n.stateNode.containerInfo,l=Ak(e);Xj(e,l,o);break;default:throw Error(ye(161))}}catch(c){lr(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function FV(e,t,r){Ce=e,Y4(e)}function Y4(e,t,r){for(var n=(e.mode&1)!==0;Ce!==null;){var s=Ce,i=s.child;if(s.tag===22&&n){var o=s.memoizedState!==null||Yp;if(!o){var l=s.alternate,c=l!==null&&l.memoizedState!==null||Jr;l=Yp;var d=Jr;if(Yp=o,(Jr=c)&&!d)for(Ce=s;Ce!==null;)o=Ce,c=o.child,o.tag===22&&o.memoizedState!==null?Mk(s):c!==null?(c.return=o,Ce=c):Mk(s);for(;i!==null;)Ce=i,Y4(i),i=i.sibling;Ce=s,Yp=l,Jr=d}Ok(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,Ce=i):Ok(e)}}function Ok(e){for(;Ce!==null;){var t=Ce;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Jr||yy(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Jr)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:Fa(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&pk(t,i,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}pk(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var u=d.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&Mh(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ye(163))}Jr||t.flags&512&&Yj(t)}catch(h){lr(t,t.return,h)}}if(t===e){Ce=null;break}if(r=t.sibling,r!==null){r.return=t.return,Ce=r;break}Ce=t.return}}function Tk(e){for(;Ce!==null;){var t=Ce;if(t===e){Ce=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Ce=r;break}Ce=t.return}}function Mk(e){for(;Ce!==null;){var t=Ce;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{yy(4,t)}catch(c){lr(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(c){lr(t,s,c)}}var i=t.return;try{Yj(t)}catch(c){lr(t,i,c)}break;case 5:var o=t.return;try{Yj(t)}catch(c){lr(t,o,c)}}}catch(c){lr(t,t.return,c)}if(t===e){Ce=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Ce=l;break}Ce=t.return}}var BV=Math.ceil,_v=Pi.ReactCurrentDispatcher,A_=Pi.ReactCurrentOwner,ga=Pi.ReactCurrentBatchConfig,ht=0,Or=null,pr=null,zr=0,Bn=0,ud=Ho(0),Nr=0,Hh=null,ec=0,by=0,E_=0,dh=null,Pn=null,O_=0,Jd=1/0,Ys=null,Cv=!1,Jj=null,So=null,Xp=!1,mo=null,Pv=0,uh=0,Zj=null,Lg=-1,Fg=0;function pn(){return ht&6?dr():Lg!==-1?Lg:Lg=dr()}function _o(e){return e.mode&1?ht&2&&zr!==0?zr&-zr:NV.transition!==null?(Fg===0&&(Fg=M$()),Fg):(e=Ct,e!==0||(e=window.event,e=e===void 0?16:B$(e.type)),e):1}function Za(e,t,r,n){if(50<uh)throw uh=0,Zj=null,Error(ye(185));Qm(e,r,n),(!(ht&2)||e!==Or)&&(e===Or&&(!(ht&2)&&(by|=r),Nr===4&&Zi(e,zr)),$n(e,n),r===1&&ht===0&&!(t.mode&1)&&(Jd=dr()+500,gy&&Vo()))}function $n(e,t){var r=e.callbackNode;NH(e,t);var n=dv(e,e===Or?zr:0);if(n===0)r!==null&&UP(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&UP(r),t===1)e.tag===0?jV(Ik.bind(null,e)):s4(Ik.bind(null,e)),xV(function(){!(ht&6)&&Vo()}),r=null;else{switch(I$(n)){case 1:r=n_;break;case 4:r=O$;break;case 16:r=cv;break;case 536870912:r=T$;break;default:r=cv}r=nR(r,X4.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function X4(e,t){if(Lg=-1,Fg=0,ht&6)throw Error(ye(327));var r=e.callbackNode;if(jd()&&e.callbackNode!==r)return null;var n=dv(e,e===Or?zr:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=kv(e,n);else{t=n;var s=ht;ht|=2;var i=J4();(Or!==e||zr!==t)&&(Ys=null,Jd=dr()+500,ql(e,t));do try{WV();break}catch(l){Q4(e,l)}while(!0);g_(),_v.current=i,ht=s,pr!==null?t=0:(Or=null,zr=0,t=Nr)}if(t!==0){if(t===2&&(s=Cj(e),s!==0&&(n=s,t=e1(e,s))),t===1)throw r=Hh,ql(e,0),Zi(e,n),$n(e,dr()),r;if(t===6)Zi(e,n);else{if(s=e.current.alternate,!(n&30)&&!zV(s)&&(t=kv(e,n),t===2&&(i=Cj(e),i!==0&&(n=i,t=e1(e,i))),t===1))throw r=Hh,ql(e,0),Zi(e,n),$n(e,dr()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(ye(345));case 2:vl(e,Pn,Ys);break;case 3:if(Zi(e,n),(n&130023424)===n&&(t=O_+500-dr(),10<t)){if(dv(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){pn(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Ij(vl.bind(null,e,Pn,Ys),t);break}vl(e,Pn,Ys);break;case 4:if(Zi(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var o=31-Ja(n);i=1<<o,o=t[o],o>s&&(s=o),n&=~i}if(n=s,n=dr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*BV(n/1960))-n,10<n){e.timeoutHandle=Ij(vl.bind(null,e,Pn,Ys),n);break}vl(e,Pn,Ys);break;case 5:vl(e,Pn,Ys);break;default:throw Error(ye(329))}}}return $n(e,dr()),e.callbackNode===r?X4.bind(null,e):null}function e1(e,t){var r=dh;return e.current.memoizedState.isDehydrated&&(ql(e,t).flags|=256),e=kv(e,t),e!==2&&(t=Pn,Pn=r,t!==null&&t1(t)),e}function t1(e){Pn===null?Pn=e:Pn.push.apply(Pn,e)}function zV(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],i=s.getSnapshot;s=s.value;try{if(!ns(i(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Zi(e,t){for(t&=~E_,t&=~by,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Ja(t),n=1<<r;e[r]=-1,t&=~n}}function Ik(e){if(ht&6)throw Error(ye(327));jd();var t=dv(e,0);if(!(t&1))return $n(e,dr()),null;var r=kv(e,t);if(e.tag!==0&&r===2){var n=Cj(e);n!==0&&(t=n,r=e1(e,n))}if(r===1)throw r=Hh,ql(e,0),Zi(e,t),$n(e,dr()),r;if(r===6)throw Error(ye(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,vl(e,Pn,Ys),$n(e,dr()),null}function T_(e,t){var r=ht;ht|=1;try{return e(t)}finally{ht=r,ht===0&&(Jd=dr()+500,gy&&Vo())}}function tc(e){mo!==null&&mo.tag===0&&!(ht&6)&&jd();var t=ht;ht|=1;var r=ga.transition,n=Ct;try{if(ga.transition=null,Ct=1,e)return e()}finally{Ct=n,ga.transition=r,ht=t,!(ht&6)&&Vo()}}function M_(){Bn=ud.current,qt(ud)}function ql(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,vV(r)),pr!==null)for(r=pr.return;r!==null;){var n=r;switch(h_(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&pv();break;case 3:Xd(),qt(Mn),qt(nn),j_();break;case 5:w_(n);break;case 4:Xd();break;case 13:qt(er);break;case 19:qt(er);break;case 10:v_(n.type._context);break;case 22:case 23:M_()}r=r.return}if(Or=e,pr=e=Co(e.current,null),zr=Bn=t,Nr=0,Hh=null,E_=by=ec=0,Pn=dh=null,Cl!==null){for(t=0;t<Cl.length;t++)if(r=Cl[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,i=r.pending;if(i!==null){var o=i.next;i.next=s,n.next=o}r.pending=n}Cl=null}return e}function Q4(e,t){do{var r=pr;try{if(g_(),$g.current=Sv,Nv){for(var n=nr.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}Nv=!1}if(Zl=0,Pr=wr=nr=null,lh=!1,zh=0,A_.current=null,r===null||r.return===null){Nr=1,Hh=t,pr=null;break}e:{var i=e,o=r.return,l=r,c=t;if(t=zr,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,u=l,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var m=wk(o);if(m!==null){m.flags&=-257,jk(m,o,l,i,t),m.mode&1&&bk(i,d,t),t=m,c=d;var v=t.updateQueue;if(v===null){var p=new Set;p.add(c),t.updateQueue=p}else v.add(c);break e}else{if(!(t&1)){bk(i,d,t),I_();break e}c=Error(ye(426))}}else if(Xt&&l.mode&1){var x=wk(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),jk(x,o,l,i,t),m_(Qd(c,l));break e}}i=c=Qd(c,l),Nr!==4&&(Nr=2),dh===null?dh=[i]:dh.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var b=I4(i,c,t);mk(i,b);break e;case 1:l=c;var y=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(So===null||!So.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var _=$4(i,l,t);mk(i,_);break e}}i=i.return}while(i!==null)}eR(r)}catch(N){t=N,pr===r&&r!==null&&(pr=r=r.return);continue}break}while(!0)}function J4(){var e=_v.current;return _v.current=Sv,e===null?Sv:e}function I_(){(Nr===0||Nr===3||Nr===2)&&(Nr=4),Or===null||!(ec&268435455)&&!(by&268435455)||Zi(Or,zr)}function kv(e,t){var r=ht;ht|=2;var n=J4();(Or!==e||zr!==t)&&(Ys=null,ql(e,t));do try{UV();break}catch(s){Q4(e,s)}while(!0);if(g_(),ht=r,_v.current=n,pr!==null)throw Error(ye(261));return Or=null,zr=0,Nr}function UV(){for(;pr!==null;)Z4(pr)}function WV(){for(;pr!==null&&!mH();)Z4(pr)}function Z4(e){var t=rR(e.alternate,e,Bn);e.memoizedProps=e.pendingProps,t===null?eR(e):pr=t,A_.current=null}function eR(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=RV(r,t),r!==null){r.flags&=32767,pr=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Nr=6,pr=null;return}}else if(r=$V(r,t,Bn),r!==null){pr=r;return}if(t=t.sibling,t!==null){pr=t;return}pr=t=e}while(t!==null);Nr===0&&(Nr=5)}function vl(e,t,r){var n=Ct,s=ga.transition;try{ga.transition=null,Ct=1,HV(e,t,r,n)}finally{ga.transition=s,Ct=n}return null}function HV(e,t,r,n){do jd();while(mo!==null);if(ht&6)throw Error(ye(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(ye(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(SH(e,i),e===Or&&(pr=Or=null,zr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Xp||(Xp=!0,nR(cv,function(){return jd(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=ga.transition,ga.transition=null;var o=Ct;Ct=1;var l=ht;ht|=4,A_.current=null,LV(e,r),K4(r,e),dV(Tj),uv=!!Oj,Tj=Oj=null,e.current=r,FV(r),pH(),ht=l,Ct=o,ga.transition=i}else e.current=r;if(Xp&&(Xp=!1,mo=e,Pv=s),i=e.pendingLanes,i===0&&(So=null),xH(r.stateNode),$n(e,dr()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(Cv)throw Cv=!1,e=Jj,Jj=null,e;return Pv&1&&e.tag!==0&&jd(),i=e.pendingLanes,i&1?e===Zj?uh++:(uh=0,Zj=e):uh=0,Vo(),null}function jd(){if(mo!==null){var e=I$(Pv),t=ga.transition,r=Ct;try{if(ga.transition=null,Ct=16>e?16:e,mo===null)var n=!1;else{if(e=mo,mo=null,Pv=0,ht&6)throw Error(ye(331));var s=ht;for(ht|=4,Ce=e.current;Ce!==null;){var i=Ce,o=i.child;if(Ce.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(Ce=d;Ce!==null;){var u=Ce;switch(u.tag){case 0:case 11:case 15:ch(8,u,i)}var f=u.child;if(f!==null)f.return=u,Ce=f;else for(;Ce!==null;){u=Ce;var h=u.sibling,m=u.return;if(V4(u),u===d){Ce=null;break}if(h!==null){h.return=m,Ce=h;break}Ce=m}}}var v=i.alternate;if(v!==null){var p=v.child;if(p!==null){v.child=null;do{var x=p.sibling;p.sibling=null,p=x}while(p!==null)}}Ce=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,Ce=o;else e:for(;Ce!==null;){if(i=Ce,i.flags&2048)switch(i.tag){case 0:case 11:case 15:ch(9,i,i.return)}var b=i.sibling;if(b!==null){b.return=i.return,Ce=b;break e}Ce=i.return}}var y=e.current;for(Ce=y;Ce!==null;){o=Ce;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,Ce=w;else e:for(o=y;Ce!==null;){if(l=Ce,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:yy(9,l)}}catch(N){lr(l,l.return,N)}if(l===o){Ce=null;break e}var _=l.sibling;if(_!==null){_.return=l.return,Ce=_;break e}Ce=l.return}}if(ht=s,Vo(),ks&&typeof ks.onPostCommitFiberRoot=="function")try{ks.onPostCommitFiberRoot(uy,e)}catch{}n=!0}return n}finally{Ct=r,ga.transition=t}}return!1}function $k(e,t,r){t=Qd(r,t),t=I4(e,t,1),e=No(e,t,1),t=pn(),e!==null&&(Qm(e,1,t),$n(e,t))}function lr(e,t,r){if(e.tag===3)$k(e,e,r);else for(;t!==null;){if(t.tag===3){$k(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(So===null||!So.has(n))){e=Qd(r,e),e=$4(t,e,1),t=No(t,e,1),e=pn(),t!==null&&(Qm(t,1,e),$n(t,e));break}}t=t.return}}function VV(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=pn(),e.pingedLanes|=e.suspendedLanes&r,Or===e&&(zr&r)===r&&(Nr===4||Nr===3&&(zr&130023424)===zr&&500>dr()-O_?ql(e,0):E_|=r),$n(e,t)}function tR(e,t){t===0&&(e.mode&1?(t=Bp,Bp<<=1,!(Bp&130023424)&&(Bp=4194304)):t=1);var r=pn();e=gi(e,t),e!==null&&(Qm(e,t,r),$n(e,r))}function qV(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),tR(e,r)}function GV(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ye(314))}n!==null&&n.delete(t),tR(e,r)}var rR;rR=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Mn.current)An=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return An=!1,IV(e,t,r);An=!!(e.flags&131072)}else An=!1,Xt&&t.flags&1048576&&i4(t,xv,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Dg(e,t),e=t.pendingProps;var s=Gd(t,nn.current);wd(t,r),s=S_(null,t,n,e,s,r);var i=__();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,In(n)?(i=!0,gv(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,y_(t),s.updater=xy,t.stateNode=s,s._reactInternals=t,zj(t,n,e,r),t=Hj(null,t,n,!0,i,r)):(t.tag=0,Xt&&i&&f_(t),cn(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Dg(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=YV(n),e=Fa(n,e),s){case 0:t=Wj(null,t,n,e,r);break e;case 1:t=_k(null,t,n,e,r);break e;case 11:t=Nk(null,t,n,e,r);break e;case 14:t=Sk(null,t,n,Fa(n.type,e),r);break e}throw Error(ye(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Fa(n,s),Wj(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Fa(n,s),_k(e,t,n,s,r);case 3:e:{if(F4(t),e===null)throw Error(ye(387));n=t.pendingProps,i=t.memoizedState,s=i.element,f4(e,t),wv(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Qd(Error(ye(423)),t),t=Ck(e,t,n,r,s);break e}else if(n!==s){s=Qd(Error(ye(424)),t),t=Ck(e,t,n,r,s);break e}else for(qn=jo(t.stateNode.containerInfo.firstChild),Gn=t,Xt=!0,qa=null,r=d4(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Kd(),n===s){t=vi(e,t,r);break e}cn(e,t,n,r)}t=t.child}return t;
vendor: 5,155 bytes, line 40
40case 5:return h4(t),e===null&&Lj(t),n=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Mj(n,s)?o=null:i!==null&&Mj(n,i)&&(t.flags|=32),L4(e,t),cn(e,t,o,r),t.child;case 6:return e===null&&Lj(t),null;case 13:return B4(e,t,r);case 4:return b_(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Yd(t,null,n,r):cn(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Fa(n,s),Nk(e,t,n,s,r);case 7:return cn(e,t,t.pendingProps,r),t.child;case 8:return cn(e,t,t.pendingProps.children,r),t.child;case 12:return cn(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,Dt(yv,n._currentValue),n._currentValue=o,i!==null)if(ns(i.value,o)){if(i.children===s.children&&!Mn.current){t=vi(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=li(-1,r&-r),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var u=d.pending;u===null?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),Fj(i.return,r,t),l.lanes|=r;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(ye(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Fj(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}cn(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,wd(t,r),s=wa(s),n=n(s),t.flags|=1,cn(e,t,n,r),t.child;case 14:return n=t.type,s=Fa(n,t.pendingProps),s=Fa(n.type,s),Sk(e,t,n,s,r);case 15:return R4(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Fa(n,s),Dg(e,t),t.tag=1,In(n)?(e=!0,gv(t)):e=!1,wd(t,r),M4(t,n,s),zj(t,n,s,r),Hj(null,t,n,!0,e,r);case 19:return z4(e,t,r);case 22:return D4(e,t,r)}throw Error(ye(156,t.tag))};function nR(e,t){return E$(e,t)}function KV(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ma(e,t,r,n){return new KV(e,t,r,n)}function $_(e){return e=e.prototype,!(!e||!e.isReactComponent)}function YV(e){if(typeof e=="function")return $_(e)?1:0;if(e!=null){if(e=e.$$typeof,e===e_)return 11;if(e===t_)return 14}return 2}function Co(e,t){var r=e.alternate;return r===null?(r=ma(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Bg(e,t,r,n,s,i){var o=2;if(n=e,typeof e=="function")$_(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case td:return Gl(r.children,s,i,t);case ZS:o=8,s|=8;break;case uj:return e=ma(12,r,t,s|2),e.elementType=uj,e.lanes=i,e;case fj:return e=ma(13,r,t,s),e.elementType=fj,e.lanes=i,e;case hj:return e=ma(19,r,t,s),e.elementType=hj,e.lanes=i,e;case h$:return wy(r,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case u$:o=10;break e;case f$:o=9;break e;case e_:o=11;break e;case t_:o=14;break e;case Yi:o=16,n=null;break e}throw Error(ye(130,e==null?e:typeof e,""))}return t=ma(o,r,t,s),t.elementType=e,t.type=n,t.lanes=i,t}function Gl(e,t,r,n){return e=ma(7,e,n,t),e.lanes=r,e}function wy(e,t,r,n){return e=ma(22,e,n,t),e.elementType=h$,e.lanes=r,e.stateNode={isHidden:!1},e}function W0(e,t,r){return e=ma(6,e,null,t),e.lanes=r,e}function H0(e,t,r){return t=ma(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function XV(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=S0(0),this.expirationTimes=S0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=S0(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function R_(e,t,r,n,s,i,o,l,c){return e=new XV(e,t,r,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ma(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},y_(i),e}function QV(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;
vendor: 4,370 bytes, line 40
40return{$$typeof:ed,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function aR(e){if(!e)return Io;e=e._reactInternals;e:{if(xc(e)!==e||e.tag!==1)throw Error(ye(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(In(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ye(171))}if(e.tag===1){var r=e.type;if(In(r))return a4(e,r,t)}return t}function sR(e,t,r,n,s,i,o,l,c){return e=R_(r,n,!0,e,s,i,o,l,c),e.context=aR(null),r=e.current,n=pn(),s=_o(r),i=li(n,s),i.callback=t??null,No(r,i,s),e.current.lanes=s,Qm(e,s,n),$n(e,n),e}function jy(e,t,r,n){var s=t.current,i=pn(),o=_o(s);return r=aR(r),t.context===null?t.context=r:t.pendingContext=r,t=li(i,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=No(s,t,o),e!==null&&(Za(e,s,o,i),Ig(e,s,o)),o}function Av(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Rk(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function D_(e,t){Rk(e,t),(e=e.alternate)&&Rk(e,t)}function JV(){return null}var iR=typeof reportError=="function"?reportError:function(e){console.error(e)};function L_(e){this._internalRoot=e}Ny.prototype.render=L_.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ye(409));jy(e,t,null,null)};Ny.prototype.unmount=L_.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;tc(function(){jy(null,e,null,null)}),t[pi]=null}};function Ny(e){this._internalRoot=e}Ny.prototype.unstable_scheduleHydration=function(e){if(e){var t=D$();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Ji.length&&t!==0&&t<Ji[r].priority;r++);Ji.splice(r,0,e),r===0&&F$(e)}};function F_(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Sy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Dk(){}function ZV(e,t,r,n,s){if(s){if(typeof n=="function"){var i=n;n=function(){var d=Av(o);i.call(d)}}var o=sR(t,n,e,0,null,!1,!1,"",Dk);return e._reactRootContainer=o,e[pi]=o.current,Rh(e.nodeType===8?e.parentNode:e),tc(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var l=n;n=function(){var d=Av(c);l.call(d)}}var c=R_(e,0,!1,null,null,!1,!1,"",Dk);return e._reactRootContainer=c,e[pi]=c.current,Rh(e.nodeType===8?e.parentNode:e),tc(function(){jy(t,c,r,n)}),c}function _y(e,t,r,n,s){var i=r._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var l=s;s=function(){var c=Av(o);l.call(c)}}jy(t,o,e,s)}else o=ZV(r,t,e,s,n);return Av(o)}$$=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Kf(t.pendingLanes);r!==0&&(a_(t,r|1),$n(t,dr()),!(ht&6)&&(Jd=dr()+500,Vo()))}break;case 13:tc(function(){var n=gi(e,1);if(n!==null){var s=pn();Za(n,e,1,s)}}),D_(e,1)}};s_=function(e){if(e.tag===13){var t=gi(e,134217728);if(t!==null){var r=pn();Za(t,e,134217728,r)}D_(e,134217728)}};R$=function(e){if(e.tag===13){var t=_o(e),r=gi(e,t);if(r!==null){var n=pn();Za(r,e,t,n)}D_(e,t)}};D$=function(){return Ct};L$=function(e,t){var r=Ct;try{return Ct=e,t()}finally{Ct=r}};Nj=function(e,t,r){switch(t){case"input":if(gj(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=py(n);if(!s)throw Error(ye(90));p$(n),gj(n,s)}}}break;case"textarea":v$(e,r);break;case"select":t=r.value,t!=null&&vd(e,!!r.multiple,t,!1)}};S$=T_;_$=tc;var e7={usingClientEntryPoint:!1,Events:[Zm,sd,py,j$,N$,T_]},_f={findFiberByHostInstance:_l,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},t7={bundleType:_f.bundleType,version:_f.version,rendererPackageName:_f.rendererPackageName,rendererConfig:_f.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Pi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=k$(e),e===null?null:e.stateNode}
40,findFiberByHostInstance:_f.findFiberByHostInstance||JV,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qp.isDisabled&&Qp.supportsFiber)try{uy=Qp.inject(t7),ks=Qp}catch{}}Zn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e7;Zn.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!F_(t))throw Error(ye(200));return QV(e,t,null,r)};Zn.createRoot=function(e,t){if(!F_(e))throw Error(ye(299));var r=!1,n="",s=iR;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=R_(e,1,!1,null,null,r,!1,n,s),e[pi]=t.current,Rh(e.nodeType===8?e.parentNode:e),new L_(t)};Zn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ye(188)):(e=Object.keys(e).join(","),Error(ye(268,e)));return e=k$(t),e=e===null?null:e.stateNode,e};Zn.flushSync=function(e){return tc(e)};Zn.hydrate=function(e,t,r){if(!Sy(t))throw Error(ye(200));return _y(null,e,t,!0,r)};Zn.hydrateRoot=function(e,t,r){if(!F_(e))throw Error(ye(405));var n=r!=null&&r.hydratedSources||null,s=!1,i="",o=iR;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=sR(t,null,e,1,r??null,s,!1,i,o),e[pi]=t.current,Rh(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new Ny(t)};Zn.render=function(e,t,r){if(!Sy(t))throw Error(ye(200));return _y(null,e,t,!1,r)};Zn.unmountComponentAtNode=function(e){if(!Sy(e))throw Error(ye(40));return e._reactRootContainer?(tc(function(){_y(null,null,e,!1,function(){e._reactRootContainer=null,e[pi]=null})}),!0):!1};Zn.unstable_batchedUpdates=T_;Zn.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Sy(r))throw Error(ye(200));if(e==null||e._reactInternals===void 0)throw Error(ye(38));return _y(e,t,r,!1,n)};Zn.version="18.3.1-next-f1338f8080-20240426";function oR(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oR)}catch(e){console.error(e)}}oR(),o$.exports=Zn;var yc=o$.exports;const B_=mt(yc);var lR,Lk=yc;lR=Lk.createRoot,Lk.hydrateRoot;var r7=typeof Element<"u",n7=typeof Map=="function",a7=typeof Set=="function",s7=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function zg(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!zg(e[n],t[n]))return!1;return!0}var i;if(n7&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(n=i.next()).done;)if(!t.has(n.value[0]))return!1;for(i=e.entries();!(n=i.next()).done;)if(!zg(n.value[1],t.get(n.value[0])))return!1;return!0}if(a7&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(n=i.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(s7&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(r7&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!zg(e[s[n]],t[
40s[n]]))return!1;return!0}return e!==e&&t!==t}var i7=function(t,r){try{return zg(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const o7=mt(i7);var l7=function(e,t,r,n,s,i,o,l){if(!e){var c;if(t===void 0)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[r,n,s,i,o,l],u=0;c=new Error(t.replace(/%s/g,function(){return d[u++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}},c7=l7;const Fk=mt(c7);var d7=function(t,r,n,s){var i=n?n.call(s,t,r):void 0;if(i!==void 0)return!!i;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var o=Object.keys(t),l=Object.keys(r);if(o.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(r),d=0;d<o.length;d++){var u=o[d];if(!c(u))return!1;var f=t[u],h=r[u];if(i=n?n.call(s,f,h,u):void 0,i===!1||i===void 0&&f!==h)return!1}return!0};const u7=mt(d7);var cR=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(cR||{}),V0={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},Bk=Object.values(cR),z_={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},f7=Object.entries(z_).reduce((e,[t,r])=>(e[r]=t,e),{}),Ka="data-rh",Nd={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Sd=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},h7=e=>{let t=Sd(e,"title");const r=Sd(e,Nd.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=Sd(e,Nd.DEFAULT_TITLE);return t||n||void 0},m7=e=>Sd(e,Nd.ON_CHANGE_CLIENT_STATE)||(()=>{}),q0=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),p7=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const s=Object.keys(n);for(let i=0;i<s.length;i+=1){const l=s[i].toLowerCase();if(e.indexOf(l)!==-1&&n[l])return r.concat(n)}}return r},[]),g7=e=>console&&typeof console.warn=="function"&&console.warn(e),Cf=(e,t,r)=>{const n={};return r.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&g7(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,i)=>{const o={};i.filter(c=>{let d;const u=Object.keys(c);for(let h=0;h<u.length;h+=1){const m=u[h],v=m.toLowerCase();t.indexOf(v)!==-1&&!(d==="rel"&&c[d].toLowerCase()==="canonical")&&!(v==="rel"&&c[v].toLowerCase()==="stylesheet")&&(d=v),t.indexOf(m)!==-1&&(m==="innerHTML"||m==="cssText"||m==="itemprop")&&(d=m)}if(!d||!c[d])return!1;const f=c[d].toLowerCase();return n[d]||(n[d]={}),o[d]||(o[d]={}),n[d][f]?!1:(o[d][f]=!0,!0)}).reverse().forEach(c=>s.push(c));const l=Object.keys(o);for(let c=0;c<l.length;c+=1){const d=l[c],u={...n[d],...o[d]};n[d]=u}return s},[]).reverse()},v7=(e,t)=>{if(Array.isArray(e)&&e.length){for(let r=0;r<e.length;r+=1)if(e[r][t])return!0}return!1},x7=e=>({baseTag:p7(["href"],e),bodyAttributes:q0("bodyAttributes",e),defer:Sd(e,Nd.DEFER),encode:Sd(e,Nd.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:q0("htmlAttributes",e),linkTags:Cf("link",["rel","href"],e),metaTags:Cf("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:Cf("noscript",["innerHTML"],e),onChangeClientState:m7(e),scriptTags:Cf("script",["src","innerHTML"],e),styleTags:Cf("style",["cssText"],e),title:h7(e),titleAttributes:q0("titleAttributes",e),prioritizeSeoTags:v7(e,Nd.PRIORITIZE_SEO_TAGS)}),dR=e=>Array.isArray(e)?e.join(""):e,y7=(e,t)=>{const r=Object.keys(e);for(let n=0;n<r.length;n+=1)if(t[r[n]]&&t[r[n]].includes(e[r[n]]))return!0;return!1},G0=(e,t)=>Array.isArray(e)?e.reduce((r,n)=>(y7(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},zk=(e,t)=>({...e,[t]:void 0}),b7=["noscript","script","style"],r1=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),uR=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),w7=(e,t,r,n)=>{const s=uR(r),i=dR(t);return s?`<${e} ${Ka}="true" ${s}>${r1(i,n)}</${e}>`:`<${e} ${Ka}="true">${r1(i,n)}</${e}>`},j7=(e,t,r=!0)=>t.reduce((n,s)=>{const i=s,o=Object.keys(i).filter(d=>!(d==="innerHTML"||d==="cssText")).reduce((d,u)=>{const f=typeof i[u]>"u"?u:`${u}="${r1(i[u],r)}"`;return d?`${d} ${f}`:f},""),l=i.innerHTML||i.cssText||"",c=b7.indexOf(e)===-1;return`${n}<${e} ${Ka}="true" ${o}${c?"/>":`>${l}</${e}>`}`},""),fR=(e,t={})=>Object.keys(e).reduce((r,n)=>{const s=z_[n];return r[s||n]=e[n],r},t),N7=(e,t,r)=>{const n={key:t,[Ka]:!0},s=fR(r,n);return[I.createElement("title",s,t)]},Ug=(e,t)=>
40t.map((r,n)=>{const s={key:n,[Ka]:!0};return Object.keys(r).forEach(i=>{const l=z_[i]||i;if(l==="innerHTML"||l==="cssText"){const c=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:c}}else s[l]=r[i]}),I.createElement(e,s)}),oa=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>N7(e,t.title,t.titleAttributes),toString:()=>w7(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>fR(t),toString:()=>uR(t)};default:return{toComponent:()=>Ug(e,t),toString:()=>j7(e,t,r)}}},S7=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const s=G0(e,V0.meta),i=G0(t,V0.link),o=G0(r,V0.script);return{priorityMethods:{toComponent:()=>[...Ug("meta",s.priority),...Ug("link",i.priority),...Ug("script",o.priority)],toString:()=>`${oa("meta",s.priority,n)} ${oa("link",i.priority,n)} ${oa("script",o.priority,n)}`},metaTags:s.default,linkTags:i.default,scriptTags:o.default}},_7=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:i,styleTags:o,title:l="",titleAttributes:c,prioritizeSeoTags:d}=e;let{linkTags:u,metaTags:f,scriptTags:h}=e,m={toComponent:()=>{},toString:()=>""};return d&&({priorityMethods:m,linkTags:u,metaTags:f,scriptTags:h}=S7(e)),{priority:m,base:oa("base",t,n),bodyAttributes:oa("bodyAttributes",r,n),htmlAttributes:oa("htmlAttributes",s,n),link:oa("link",u,n),meta:oa("meta",f,n),noscript:oa("noscript",i,n),script:oa("script",h,n),style:oa("style",o,n),title:oa("title",{title:l,titleAttributes:c},n)}},n1=_7,Jp=[],hR=!!(typeof window<"u"&&window.document&&window.document.createElement),a1=class{constructor(e,t){Hs(this,"instances",[]);Hs(this,"canUseDOM",hR);Hs(this,"context");Hs(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Jp:this.instances,add:e=>{(this.canUseDOM?Jp:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Jp:this.instances).indexOf(e);(this.canUseDOM?Jp:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=n1({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},C7={},mR=I.createContext(C7),Rl,pR=(Rl=class extends g.Component{constructor(r){super(r);Hs(this,"helmetData");this.helmetData=new a1(this.props.context||{},Rl.canUseDOM)}render(){return I.createElement(mR.Provider,{value:this.helmetData.value},this.props.children)}},Hs(Rl,"canUseDOM",hR),Rl),Ic=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${Ka}]`),s=[].slice.call(n),i=[];let o;return t&&t.length&&t.forEach(l=>{const c=document.createElement(e);for(const d in l)if(Object.prototype.hasOwnProperty.call(l,d))if(d==="innerHTML")c.innerHTML=l.innerHTML;else if(d==="cssText")c.styleSheet?c.styleSheet.cssText=l.cssText:c.appendChild(document.createTextNode(l.cssText));else{const u=d,f=typeof l[u]>"u"?"":l[u];c.setAttribute(d,f)}c.setAttribute(Ka,"true"),s.some((d,u)=>(o=u,c.isEqualNode(d)))?s.splice(o,1):i.push(c)}),s.forEach(l=>{var c;return(c=l.parentNode)==null?void 0:c.removeChild(l)}),i.forEach(l=>r.appendChild(l)),{oldTags:s,newTags:i}},s1=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(Ka),s=n?n.split(","):[],i=[...s],o=Object.keys(t);for(const l of o){const c=t[l]||"";r.getAttribute(l)!==c&&r.setAttribute(l,c),s.indexOf(l)===-1&&s.push(l);const d=i.indexOf(l);d!==-1&&i.splice(d,1)}for(let l=i.length-1;l>=0;l-=1)r.removeAttribute(i[l]);s.length===i.length?r.removeAttribute(Ka):r.getAttribute(Ka)!==o.join(",")&&r.setAttribute(Ka,o.join(","))},P7=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=dR(e)),s1("title",t)},Uk=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:i,metaTags:o,noscriptTags:l,onChangeClientState:c,scriptTags:d,styleTags:u,title:f,titleAttributes:h}=e;s1("body",n),s1("html",s),P7(f,h);const m={baseTag:Ic("base",r),linkTags:Ic("link",i),metaTags:Ic("meta",o),noscriptTags:Ic("noscript",l),scriptTags:Ic("script",d),styleTags:Ic("style",u)},v={},p={};Object.keys(m).forEach(x=>{const{newTags:b,oldTags:y}=m[x];b.length&&(v[x]=b),y.length&&(p[x]=m[x].oldTags)}),t&&t(),c(e,v,p)},Pf=null,k7=e=>{Pf&&cancelAnimationFrame(Pf),e.defer?Pf=requestAnimationFrame(()=>{Uk(e,()=>{Pf=null})}):(Uk(e),Pf=null)},A7=k7,Wk=class extends g.Component{constructor(){super(...arguments);Hs(this,"rendered",!1)}shouldComponentUpdate(t){return!u7(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const s=x7(t.get().map(i=>{const o={...i.props};return delete o.context,o}));pR.canUseDOM?A7(s):n1&&(n=n1(s)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},cj,gR=(cj=class extends g.Component{shouldComponentUpdate(e){return!o7(zk(this.props,"helmetData"),zk(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}
40warnOnInvalidChildren(e,t){return Fk(Bk.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${Bk.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),Fk(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return I.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:s,...i}=n.props,o=Object.keys(i).reduce((c,d)=>(c[f7[d]||d]=i[d],c),{});let{type:l}=n;switch(typeof l=="symbol"?l=l.toString():this.warnOnInvalidChildren(n,s),l){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,o,s);break;default:t=this.mapObjectTypeChildren(n,t,o,s);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof a1)){const s=n;n=new a1(s.context,!0),delete r.helmetData}return n?I.createElement(Wk,{...r,context:n.value}):I.createElement(mR.Consumer,null,s=>I.createElement(Wk,{...r,context:s}))}},Hs(cj,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),cj);const E7=1,O7=1e6;let K0=0;function T7(){return K0=(K0+1)%Number.MAX_SAFE_INTEGER,K0.toString()}const Y0=new Map,Hk=e=>{if(Y0.has(e))return;const t=setTimeout(()=>{Y0.delete(e),fh({type:"REMOVE_TOAST",toastId:e})},O7);Y0.set(e,t)},M7=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,E7)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?Hk(r):e.toasts.forEach(n=>{Hk(n.id)}),{...e,toasts:e.toasts.map(n=>
vendor: 13,906 bytes, line 40
40n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Wg=[];let Hg={toasts:[]};function fh(e){Hg=M7(Hg,e),Wg.forEach(t=>{t(Hg)})}function kr({...e}){const t=T7(),r=s=>fh({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>fh({type:"DISMISS_TOAST",toastId:t});return fh({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function dt(){const[e,t]=g.useState(Hg);return g.useEffect(()=>(Wg.push(t),()=>{const r=Wg.indexOf(t);r>-1&&Wg.splice(r,1)}),[e]),{...e,toast:kr,dismiss:r=>fh({type:"DISMISS_TOAST",toastId:r})}}function pe(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function Vk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function tp(...e){return t=>{let r=!1;const n=e.map(s=>{const i=Vk(s,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let s=0;s<n.length;s++){const i=n[s];typeof i=="function"?i():Vk(e[s],null)}}}}function Te(...e){return g.useCallback(tp(...e),e)}function I7(e,t){const r=g.createContext(t),n=i=>{const{children:o,...l}=i,c=g.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:o})};n.displayName=e+"Provider";function s(i){const o=g.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,s]}function ir(e,t=[]){let r=[];function n(i,o){const l=g.createContext(o),c=r.length;r=[...r,o];const d=f=>{var b;const{scope:h,children:m,...v}=f,p=((b=h==null?void 0:h[e])==null?void 0:b[c])||l,x=g.useMemo(()=>v,Object.values(v));return a.jsx(p.Provider,{value:x,children:m})};d.displayName=i+"Provider";function u(f,h){var p;const m=((p=h==null?void 0:h[e])==null?void 0:p[c])||l,v=g.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const s=()=>{const i=r.map(o=>g.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return g.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,$7(s,...t)]}function $7(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function $o(e){const t=R7(e),r=g.forwardRef((n,s)=>{const{children:i,...o}=n,l=g.Children.toArray(i),c=l.find(D7);if(c){const d=c.props.children,u=l.map(f=>f===c?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...o,ref:s,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return a.jsx(t,{...o,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}var Hu=$o("Slot");function R7(e){const t=g.forwardRef((r,n)=>{const{children:s,...i}=r;if(g.isValidElement(s)){const o=F7(s),l=L7(i,s.props);return s.type!==g.Fragment&&(l.ref=n?tp(n,o):o),g.cloneElement(s,l)}return g.Children.count(s)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vR=Symbol("radix.slottable");function xR(e){const t=({children:r})=>a.jsx(a.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=vR,t}function D7(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vR}function L7(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function F7(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function bc(e){const t=e+"CollectionProvider",[r,n]=ir(t),[s,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:x,children:b}=p,y=I.useRef(null),w=I.useRef(new Map).current;return a.jsx(s,{scope:x,itemMap:w,collectionRef:y,children:b})};o.displayName=t;const l=e+"CollectionSlot",c=$o(l),d=I.forwardRef((p,x)=>{const{scope:b,children:y}=p,w=i(l,b),_=Te(x,w.collectionRef);return a.jsx(c,{ref:_,children:y})});d.displayName=l;const u=e+"CollectionItemSlot",f="data-radix-collection-item",h=$o(u),m=I.forwardRef((p,x)=>{const{scope:b,children:y,...w}=p,_=I.useRef(null),N=Te(x,_),j=i(u,b);return I.useEffect(()=>(j.itemMap.set(_,{ref:_,...w}),()=>void j.itemMap.delete(_))),a.jsx(h,{[f]:"",ref:N,children:y})});m.displayName=u;function v(p){const x=i(e+"CollectionConsumer",p);return I.useCallback(()=>{const y=x.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort((j,S)=>w.indexOf(j.ref.current)-w.indexOf(S.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:d,ItemSlot:m},v,n]}var B7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],we=B7.reduce((e,t)=>{const r=$o(`Primitive.${t}`),n=g.forwardRef((s,i)=>{const{asChild:o,...l}=s,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Vh(e,t){e&&yc.flushSync(()=>e.dispatchEvent(t))}function _t(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function z7(e,t=globalThis==null?void 0:globalThis.document){const r=_t(e);g.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var U7="DismissableLayer",i1="dismissableLayer.update",W7="dismissableLayer.pointerDownOutside",H7="dismissableLayer.focusOutside",qk,yR=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qo=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,d=g.useContext(yR),[u,f]=g.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=g.useState({}),v=Te(t,S=>f(S)),p=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=p.indexOf(x),y=u?p.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,_=y>=b,N=q7(S=>{const C=S.target,P=[...d.branches].some(A=>A.contains(C));!_||P||(s==null||s(S),o==null||o(S),S.defaultPrevented||l==null||l())},h),j=G7(S=>{const C=S.target;[...d.branches].some(A=>A.contains(C))||(i==null||i(S),o==null||o(S),S.defaultPrevented||l==null||l())},h);return z7(S=>{y===d.layers.size-1&&(n==null||n(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},h),g.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(qk=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),Gk(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=qk)}},[u,h,r,d]),g.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),Gk())},[u,d]),g.useEffect(()=>{const S=()=>m({});return document.addEventListener(i1,S),()=>document.removeEventListener(i1,S)},[]),a.jsx(we.div,{...c,ref:v,style:{pointerEvents:w?_?"auto":"none":void 0,...e.style},onFocusCapture:pe(e.onFocusCapture,j.onFocusCapture),onBlurCapture:pe(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:pe(e.onPointerDownCapture,N.onPointerDownCapture)})});qo.displayName=U7;var V7="DismissableLayerBranch",bR=g.forwardRef((e,t)=>{const r=g.useContext(yR),n=g.useRef(null),s=Te(t,n);return g.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(we.div,{...e,ref:s})});bR.displayName=V7;function q7(e,t=globalThis==null?void 0:globalThis.document){const r=_t(e),n=g.useRef(!1),s=g.useRef(()=>{});return g.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){wR(W7,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function G7(e,t=globalThis==null?void 0:globalThis.document){const r=_t(e),n=g.useRef(!1);return g.useEffect(()=>{const s=i=>{i.target&&!n.current&&wR(H7,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Gk(){const e=new CustomEvent(i1);document.dispatchEvent(e)}function wR(e,t,r,{discrete:n}){const s=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?Vh(s,i):s.dispatchEvent(i)}var K7=qo,Y7=bR,Kt=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},X7="Portal",Vu=g.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[s,i]=g.useState(!1);Kt(()=>i(!0),[]);const o=r||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?B_.createPortal(a.jsx(we.div,{...n,ref:t}),o):null});Vu.displayName=X7;function Q7(e,t){return g.useReducer((r,n)=>t[r][n]??r,e)}var Zt=e=>{const{present:t,children:r}=e,n=J7(t),s=typeof r=="function"?r({present:n.isPresent}):g.Children.only(r),i=Te(n.ref,Z7(s));return typeof r=="function"||n.isPresent?g.cloneElement(s,{ref:i}):null};Zt.displayName="Presence";function J7(e){const[t,r]=g.useState(),n=g.useRef(null),s=g.useRef(e),i=g.useRef("none"),o=e?"mounted":"unmounted",[l,c]=Q7(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const d=Zp(n.current);i.current=l==="mounted"?d:"none"},[l]),Kt(()=>{const d=n.current,u=s.current;if(u!==e){const h=i.current,m=Zp(d);e?c("MOUNT"):m==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(u&&h!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Kt(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,f=m=>{const p=Zp(n.current).includes(m.animationName);if(m.target===t&&p&&(c("ANIMATION_END"),!s.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=m=>{m.target===t&&(i.current=Zp(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:g.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function Zp(e){return(e==null?void 0:e.animationName)||"none"}function Z7(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var eq=YS[" useInsertionEffect ".trim().toString()]||Kt;function vr({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,i,o]=tq({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:s;{const u=g.useRef(e!==void 0);g.useEffect(()=>{const f=u.current;f!==l&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=g.useCallback(u=>{var f;if(l){const h=rq(u)?u(e):u;h!==e&&((f=o.current)==null||f.call(o,h))}else i(u)},[l,e,i,o]);return[c,d]}function tq({defaultProp:e,onChange:t}){const[r,n]=g.useState(e),s=g.useRef(r),i=g.useRef(t);return eq(()=>{i.current=t},[t]),g.useEffect(()=>{var o;s.current!==r&&((o=i.current)==null||o.call(i,r),s.current=r)},[r,s]),[r,n,i]}function rq(e){return typeof e=="function"}var jR=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),nq="VisuallyHidden",Cy=g.forwardRef((e,t)=>a.jsx(we.span,{...e,ref:t,style:{...jR,...e.style}}));Cy.displayName=nq;var NR=Cy,U_="ToastProvider",[W_,aq,sq]=bc("Toast"),[SR,tRe]=ir("Toast",[sq]),[iq,Py]=SR(U_),_R=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=e,[l,c]=g.useState(null),[d,u]=g.useState(0),f=g.useRef(!1),h=g.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${U_}\`. Expected non-empty \`string\`.`),a.jsx(W_.Provider,{scope:t,children:a.jsx(iq,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:i,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:g.useCallback(()=>u(m=>m+1),[]),onToastRemove:g.useCallback(()=>u(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:h,children:o})})};_R.displayName=U_;var CR="ToastViewport",oq=["F8"],o1="toast.viewportPause",l1="toast.viewportResume",PR=g.forwardRef((e,t)=>
40{const{__scopeToast:r,hotkey:n=oq,label:s="Notifications ({hotkey})",...i}=e,o=Py(CR,r),l=aq(r),c=g.useRef(null),d=g.useRef(null),u=g.useRef(null),f=g.useRef(null),h=Te(t,f,o.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=o.toastCount>0;g.useEffect(()=>{const x=b=>{var w;n.length!==0&&n.every(_=>b[_]||b.code===_)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[n]),g.useEffect(()=>{const x=c.current,b=f.current;if(v&&x&&b){const y=()=>{if(!o.isClosePausedRef.current){const j=new CustomEvent(o1);b.dispatchEvent(j),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const j=new CustomEvent(l1);b.dispatchEvent(j),o.isClosePausedRef.current=!1}},_=j=>{!x.contains(j.relatedTarget)&&w()},N=()=>{x.contains(document.activeElement)||w()};return x.addEventListener("focusin",y),x.addEventListener("focusout",_),x.addEventListener("pointermove",y),x.addEventListener("pointerleave",N),window.addEventListener("blur",y),window.addEventListener("focus",w),()=>{x.removeEventListener("focusin",y),x.removeEventListener("focusout",_),x.removeEventListener("pointermove",y),x.removeEventListener("pointerleave",N),window.removeEventListener("blur",y),window.removeEventListener("focus",w)}}},[v,o.isClosePausedRef]);const p=g.useCallback(({tabbingDirection:x})=>{const y=l().map(w=>{const _=w.ref.current,N=[_,...bq(_)];return x==="forwards"?N:N.reverse()});return(x==="forwards"?y.reverse():y).flat()},[l]);return g.useEffect(()=>{const x=f.current;if(x){const b=y=>{var N,j,S;const w=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!w){const C=document.activeElement,P=y.shiftKey;if(y.target===x&&P){(N=d.current)==null||N.focus();return}const F=p({tabbingDirection:P?"backwards":"forwards"}),q=F.findIndex(B=>B===C);X0(F.slice(q+1))?y.preventDefault():P?(j=d.current)==null||j.focus():(S=u.current)==null||S.focus()}};return x.addEventListener("keydown",b),()=>x.removeEventListener("keydown",b)}},[l,p]),a.jsxs(Y7,{ref:c,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&a.jsx(c1,{ref:d,onFocusFromOutsideViewport:()=>{const x=p({tabbingDirection:"forwards"});X0(x)}}),a.jsx(W_.Slot,{scope:r,children:a.jsx(we.ol,{tabIndex:-1,...i,ref:h})}),v&&a.jsx(c1,{ref:u,onFocusFromOutsideViewport:()=>{const x=p({tabbingDirection:"backwards"});X0(x)}})]})});PR.displayName=CR;var kR="ToastFocusProxy",c1=g.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,i=Py(kR,r);return a.jsx(Cy,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{var d;const l=o.relatedTarget;!((d=i.viewport)!=null&&d.contains(l))&&n()}})});c1.displayName=kR;var rp="Toast",lq="toast.swipeStart",cq="toast.swipeMove",dq="toast.swipeCancel",uq="toast.swipeEnd",AR=g.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:i,...o}=e,[l,c]=vr({prop:n,defaultProp:s??!0,onChange:i,caller:rp});return a.jsx(Zt,{present:r||l,children:a.jsx(mq,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:_t(e.onPause),onResume:_t(e.onResume),onSwipeStart:pe(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:pe(e.onSwipeMove,d=>{const{x:u,y:f}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:pe(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:pe(e.onSwipeEnd,d=>{const{x:u,y:f}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});AR.displayName=rp;var[fq,hq]=SR(rp,{onClose(){}}),mq=g.forwardRef((e,t)=>
40{const{__scopeToast:r,type:n="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:h,onSwipeEnd:m,...v}=e,p=Py(rp,r),[x,b]=g.useState(null),y=Te(t,B=>b(B)),w=g.useRef(null),_=g.useRef(null),N=s||p.duration,j=g.useRef(0),S=g.useRef(N),C=g.useRef(0),{onToastAdd:P,onToastRemove:A}=p,D=_t(()=>{var V;(x==null?void 0:x.contains(document.activeElement))&&((V=p.viewport)==null||V.focus()),o()}),F=g.useCallback(B=>{!B||B===1/0||(window.clearTimeout(C.current),j.current=new Date().getTime(),C.current=window.setTimeout(D,B))},[D]);g.useEffect(()=>{const B=p.viewport;if(B){const V=()=>{F(S.current),d==null||d()},E=()=>{const M=new Date().getTime()-j.current;S.current=S.current-M,window.clearTimeout(C.current),c==null||c()};return B.addEventListener(o1,E),B.addEventListener(l1,V),()=>{B.removeEventListener(o1,E),B.removeEventListener(l1,V)}}},[p.viewport,N,c,d,F]),g.useEffect(()=>{i&&!p.isClosePausedRef.current&&F(N)},[i,N,p.isClosePausedRef,F]),g.useEffect(()=>(P(),()=>A()),[P,A]);const q=g.useMemo(()=>x?RR(x):null,[x]);return p.viewport?a.jsxs(a.Fragment,{children:[q&&a.jsx(pq,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:q}),a.jsx(fq,{scope:r,onClose:D,children:yc.createPortal(a.jsx(W_.ItemSlot,{scope:r,children:a.jsx(K7,{asChild:!0,onEscapeKeyDown:pe(l,()=>{p.isFocusedToastEscapeKeyDownRef.current||D(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:a.jsx(we.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":p.swipeDirection,...v,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:pe(e.onKeyDown,B=>{B.key==="Escape"&&(l==null||l(B.nativeEvent),B.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:pe(e.onPointerDown,B=>{B.button===0&&(w.current={x:B.clientX,y:B.clientY})}),onPointerMove:pe(e.onPointerMove,B=>{if(!w.current)return;const V=B.clientX-w.current.x,E=B.clientY-w.current.y,M=!!_.current,T=["left","right"].includes(p.swipeDirection),L=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,K=T?L(0,V):0,H=T?0:L(0,E),ee=B.pointerType==="touch"?10:2,se={x:K,y:H},ne={originalEvent:B,delta:se};M?(_.current=se,eg(cq,f,ne,{discrete:!1})):Kk(se,p.swipeDirection,ee)?(_.current=se,eg(lq,u,ne,{discrete:!1}),B.target.setPointerCapture(B.pointerId)):(Math.abs(V)>ee||Math.abs(E)>ee)&&(w.current=null)}),onPointerUp:pe(e.onPointerUp,B=>{const V=_.current,E=B.target;if(E.hasPointerCapture(B.pointerId)&&E.releasePointerCapture(B.pointerId),_.current=null,w.current=null,V){const M=B.currentTarget,T={originalEvent:B,delta:V};Kk(V,p.swipeDirection,p.swipeThreshold)?eg(uq,m,T,{discrete:!0}):eg(dq,h,T,{discrete:!0}),M.addEventListener("click",L=>L.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),pq=e=>{const{__scopeToast:t,children:r,...n}=e,s=Py(rp,t),[i,o]=g.useState(!1),[l,c]=g.useState(!1);return xq(()=>o(!0)),g.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:a.jsx(Vu,{asChild:!0,children:a.jsx(Cy,{...n,children:i&&a.jsxs(a.Fragment,{children:[s.label," ",r]})})})},gq="ToastTitle",ER=g.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return a.jsx(we.div,{...n,ref:t})});ER.displayName=gq;var vq="ToastDescription",OR=g.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return a.jsx(we.div,{...n,ref:t})});OR.displayName=vq;var TR="ToastAction",MR=g.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?a.jsx($R,{altText:r,asChild:!0,children:a.jsx(H_,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${TR}\`. Expected non-empty \`string\`.`),null)});MR.displayName=TR;var IR="ToastClose",H_=g.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=hq(IR,r);return a.jsx($R,{asChild:!0,children:a.jsx(we.button,{type:"button",...n,ref:t,onClick:pe(e.onClick,s.onClose)})})});H_.displayName=IR;var $R=g.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return a.jsx(we.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function RR(e){const t=[];
vendor: 4,279 bytes, lines 40-65
40return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),yq(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...RR(n))}}),t}function eg(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?Vh(s,i):s.dispatchEvent(i)}var Kk=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),i=n>s;return t==="left"||t==="right"?i&&n>r:!i&&s>r};function xq(e=()=>{}){const t=_t(e);Kt(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function yq(e){return e.nodeType===e.ELEMENT_NODE}function bq(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function X0(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var wq=_R,DR=PR,LR=AR,FR=ER,BR=OR,zR=MR,UR=H_;function WR(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=WR(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function qe(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=WR(e))&&(n&&(n+=" "),n+=t);return n}const Yk=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Xk=qe,ki=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Xk(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(d=>{const u=r==null?void 0:r[d],f=i==null?void 0:i[d];if(u===null)return null;const h=Yk(u)||Yk(f);return s[d][h]}),l=r&&Object.entries(r).reduce((d,u)=>{let[f,h]=u;return h===void 0||(d[f]=h),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,u)=>{let{class:f,className:h,...m}=u;return Object.entries(m).every(v=>{let[p,x]=v;return Array.isArray(x)?x.includes({...i,...l}[p]):{...i,...l}[p]===x})?[...d,f,h]:d},[]);return Xk(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)};/** 41 * @license lucide-react v0.462.0 - ISC 42 * 43 * This source code is licensed under the ISC license. 44 * See the LICENSE file in the root directory of this source tree. 45 */const jq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),HR=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** 46 * @license lucide-react v0.462.0 - ISC 47 * 48 * This source code is licensed under the ISC license. 49 * See the LICENSE file in the root directory of this source tree. 50 */var Nq={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 51 * @license lucide-react v0.462.0 - ISC 52 * 53 * This source code is licensed under the ISC license. 54 * See the LICENSE file in the root directory of this source tree. 55 */const Sq=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...l},c)=>g.createElement("svg",{ref:c,...Nq,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:HR("lucide",s),...l},[...o.map(([d,u])=>g.createElement(d,u)),...Array.isArray(i)?i:[i]]));/** 56 * @license lucide-react v0.462.0 - ISC 57 * 58 * This source code is licensed under the ISC license. 59 * See the LICENSE file in the root directory of this source tree. 60 */const be=(e,t)=>{const r=g.forwardRef(({className:n,...s},i)=>g.createElement(Sq,{ref:i,iconNode:t,className:HR(`lucide-${jq(e)}`,n),...s}));return r.displayName=`${e}`,r};/** 61 * @license lucide-react v0.462.0 - ISC 62 * 63 * This source code is licensed under the ISC license. 64 * See the LICENSE file in the root directory of this source tree. 65 */const V_=be("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l
65-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** 66 * @license lucide-react v0.462.0 - ISC 67 * 68 * This source code is licensed under the ISC license. 69 * See the LICENSE file in the root directory of this source tree. 70 */const Tr=be("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 71 * @license lucide-react v0.462.0 - ISC 72 * 73 * This source code is licensed under the ISC license. 74 * See the LICENSE file in the root directory of this source tree. 75 */const _q=be("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 76 * @license lucide-react v0.462.0 - ISC 77 * 78 * This source code is licensed under the ISC license. 79 * See the LICENSE file in the root directory of this source tree. 80 */const hh=be("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** 81 * @license lucide-react v0.462.0 - ISC 82 * 83 * This source code is licensed under the ISC license. 84 * See the LICENSE file in the root directory of this source tree. 85 */const d1=be("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** 86 * @license lucide-react v0.462.0 - ISC 87 * 88 * This source code is licensed under the ISC license. 89 * See the LICENSE file in the root directory of this source tree. 90 */const Cq=be("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** 91 * @license lucide-react v0.462.0 - ISC 92 * 93 * This source code is licensed under the ISC license. 94 * See the LICENSE file in the root directory of this source tree. 95 */const Q0=be("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** 96 * @license lucide-react v0.462.0 - ISC 97 * 98 * This source code is licensed under the ISC license. 99 * See the LICENSE file in the root directory of this source tree. 100 */const _d=be("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/** 101 * @license lucide-react v0.462.0 - ISC 102 * 103 * This source code is licensed under the ISC license. 104 * See the LICENSE file in the root directory of this source tree. 105 */const mr=be("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 106 * @license lucide-react v0.462.0 - ISC 107 * 108 * This source code is licensed under the ISC license. 109 * See the LICENSE file in the root directory of this source tree. 110 */const Ev=be("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/** 111 * @license lucide-react v0.462.0 - ISC 112 * 113 * This source code is licensed under the ISC license. 114 * See the LICENSE file in the root directory of this source tree. 115 */const rc=be("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);/** 116 * @license lucide-react v0.462.0 - ISC 117 * 118 * This source code is licensed under the ISC license. 119 * See the LICENSE file in the root directory of this source tree. 120 */const Br=be("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** 121 * @license lucide-react v0.462.0 - ISC 122 * 123 * This source code is licensed under the ISC license. 124 * See the LICENSE file in the root directory of this source tree. 125 */const $s=be("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** 126 * @license lucide-react v0.462.0 - ISC 127 * 128 * This source code is licensed under the ISC license. 129 * See the LICENSE file in the root directory of this source tree. 130 */const Ov=be("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",ke
130y:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/** 131 * @license lucide-react v0.462.0 - ISC 132 * 133 * This source code is licensed under the ISC license. 134 * See the LICENSE file in the root directory of this source tree. 135 */const q_=be("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 136 * @license lucide-react v0.462.0 - ISC 137 * 138 * This source code is licensed under the ISC license. 139 * See the LICENSE file in the root directory of this source tree. 140 */const Go=be("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 141 * @license lucide-react v0.462.0 - ISC 142 * 143 * This source code is licensed under the ISC license. 144 * See the LICENSE file in the root directory of this source tree. 145 */const u1=be("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 146 * @license lucide-react v0.462.0 - ISC 147 * 148 * This source code is licensed under the ISC license. 149 * See the LICENSE file in the root directory of this source tree. 150 */const Zd=be("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 151 * @license lucide-react v0.462.0 - ISC 152 * 153 * This source code is licensed under the ISC license. 154 * See the LICENSE file in the root directory of this source tree. 155 */const VR=be("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 156 * @license lucide-react v0.462.0 - ISC 157 * 158 * This source code is licensed under the ISC license. 159 * See the LICENSE file in the root directory of this source tree. 160 */const qh=be("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** 161 * @license lucide-react v0.462.0 - ISC 162 * 163 * This source code is licensed under the ISC license. 164 * See the LICENSE file in the root directory of this source tree. 165 */const tr=be("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 166 * @license lucide-react v0.462.0 - ISC 167 * 168 * This source code is licensed under the ISC license. 169 * See the LICENSE file in the root directory of this source tree. 170 */const Na=be("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 171 * @license lucide-react v0.462.0 - ISC 172 * 173 * This source code is licensed under the ISC license. 174 * See the LICENSE file in the root directory of this source tree. 175 */const G_=be("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 176 * @license lucide-react v0.462.0 - ISC 177 * 178 * This source code is licensed under the ISC license. 179 * See the LICENSE file in the root directory of this source tree. 180 */const xi=be("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** 181 * @license lucide-react v0.462.0 - ISC 182 * 183 * This source code is licensed under the ISC license. 184 * See the LICENSE file in the root directory of this source tree. 185 */const qR=be("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 186 * @license lucide-react v0.462.0 - ISC 187 * 188 * This source code is licensed under the ISC license. 189 * See the LICENSE file in the root directory of this source tree. 190 */const Pq=be("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/** 191 * @license lucide-react v0.462.0 - ISC 192 * 193 * This source code is licensed under the ISC license. 194 * See the LICENSE file in the root directory of this source tree. 195 */const kq=be("ClipboardType",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M9 12v-1h6v1",key:"iehl6m"}],["path",{d:"M11 17h2",key:"12w5me"}],["path",{d:"M12 11v6",key:"1bwqyc"}]]);/** 196 * @license lucide-react v0.462.0 - ISC 197 * 198 * This source code is licensed under the ISC license. 199 * See the LICENSE file in the root directory of this source tree. 200 */const np=be("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 201 * @license lucide-react v0.462.0 - ISC 202 * 203 * This source code is licensed under the ISC license. 204 * See the LICENSE file in the root directory of this source tree.
205 */const Aq=be("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 206 * @license lucide-react v0.462.0 - ISC 207 * 208 * This source code is licensed under the ISC license. 209 * See the LICENSE file in the root directory of this source tree. 210 */const Kl=be("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** 211 * @license lucide-react v0.462.0 - ISC 212 * 213 * This source code is licensed under the ISC license. 214 * See the LICENSE file in the root directory of this source tree. 215 */const GR=be("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** 216 * @license lucide-react v0.462.0 - ISC 217 * 218 * This source code is licensed under the ISC license. 219 * See the LICENSE file in the root directory of this source tree. 220 */const Jt=be("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** 221 * @license lucide-react v0.462.0 - ISC 222 * 223 * This source code is licensed under the ISC license. 224 * See the LICENSE file in the root directory of this source tree. 225 */const kl=be("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 226 * @license lucide-react v0.462.0 - ISC 227 * 228 * This source code is licensed under the ISC license. 229 * See the LICENSE file in the root directory of this source tree. 230 */const Eq=be("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** 231 * @license lucide-react v0.462.0 - ISC 232 * 233 * This source code is licensed under the ISC license. 234 * See the LICENSE file in the root directory of this source tree. 235 */const ft=be("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 236 * @license lucide-react v0.462.0 - ISC 237 * 238 * This source code is licensed under the ISC license. 239 * See the LICENSE file in the root directory of this source tree. 240 */const ci=be("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 241 * @license lucide-react v0.462.0 - ISC 242 * 243 * This source code is licensed under the ISC license. 244 * See the LICENSE file in the root directory of this source tree. 245 */const Oq=be("FileCheck",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]]);/** 246 * @license lucide-react v0.462.0 - ISC 247 * 248 * This source code is licensed under the ISC license. 249 * See the LICENSE file in the root directory of this source tree. 250 */const Tq=be("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]]);/** 251 * @license lucide-react v0.462.0 - ISC 252 * 253 * This source code is licensed under the ISC license. 254 * See the LICENSE file in the root directory of this source tree. 255 */const gt=be("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 256 * @license lucide-react v0.462.0 - ISC 257 * 258 * This source code is licensed under the ISC license. 259 * See the LICENSE file in the root directory of this source tree. 260 */const qu=be("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** 261 * @license lucide-react v0.462.0 - ISC 262 * 263 * This source code is licensed under the ISC license. 264 * See the LICENSE file in the root directory of this source tree. 265 */const Mq=be("FolderKanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);/** 266 * @license lucide-react v0.462.0 - ISC 267 * 268 * This source code is licensed under the ISC license. 269 * See the LICENSE file in the root directory of this source tree. 270 */const Iq=be("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** 271 * @license lucide-react v0.462.0 - ISC 272 * 273 * This source code is licensed under the ISC license. 274 * See the LICENSE file in the root directory of this source tree. 275 */const $q=be("Handshake",[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]]);/** 276 * @license lucide-react v0.462.0 - ISC 277 * 278 * This source code is licensed under the ISC license. 279 * See the LICENSE file in the root directory of this source tree. 280 */const KR=be("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}
280]]);/** 281 * @license lucide-react v0.462.0 - ISC 282 * 283 * This source code is licensed under the ISC license. 284 * See the LICENSE file in the root directory of this source tree. 285 */const Rq=be("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** 286 * @license lucide-react v0.462.0 - ISC 287 * 288 * This source code is licensed under the ISC license. 289 * See the LICENSE file in the root directory of this source tree. 290 */const Dq=be("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** 291 * @license lucide-react v0.462.0 - ISC 292 * 293 * This source code is licensed under the ISC license. 294 * See the LICENSE file in the root directory of this source tree. 295 */const Lq=be("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** 296 * @license lucide-react v0.462.0 - ISC 297 * 298 * This source code is licensed under the ISC license. 299 * See the LICENSE file in the root directory of this source tree. 300 */const f1=be("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** 301 * @license lucide-react v0.462.0 - ISC 302 * 303 * This source code is licensed under the ISC license. 304 * See the LICENSE file in the root directory of this source tree. 305 */const h1=be("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** 306 * @license lucide-react v0.462.0 - ISC 307 * 308 * This source code is licensed under the ISC license. 309 * See the LICENSE file in the root directory of this source tree. 310 */const Je=be("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 311 * @license lucide-react v0.462.0 - ISC 312 * 313 * This source code is licensed under the ISC license. 314 * See the LICENSE file in the root directory of this source tree. 315 */const Vg=be("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 316 * @license lucide-react v0.462.0 - ISC 317 * 318 * This source code is licensed under the ISC license. 319 * See the LICENSE file in the root directory of this source tree. 320 */const an=be("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** 321 * @license lucide-react v0.462.0 - ISC 322 * 323 * This source code is licensed under the ISC license. 324 * See the LICENSE file in the root directory of this source tree. 325 */const Ya=be("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** 326 * @license lucide-react v0.462.0 - ISC 327 * 328 * This source code is licensed under the ISC license. 329 * See the LICENSE file in the root directory of this source tree. 330 */const K_=be("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 331 * @license lucide-react v0.462.0 - ISC 332 * 333 * This source code is licensed under the ISC license. 334 * See the LICENSE file in the root directory of this source tree. 335 */const Fq=be("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** 336 * @license lucide-react v0.462.0 - ISC 337 * 338 * This source code is licensed under the ISC license. 339 * See the LICENSE file in the root directory of this source tree. 340 */const m1=be("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** 341 * @license lucide-react v0.462.0 - ISC 342 * 343 * This source code is licensed under the ISC license. 344 * See the LICENSE file in the root directory of this source tree. 345 */const Bq=be("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** 346 * @license lucide-react v0.462.0 - ISC 347 * 348 * This source code is licensed under the ISC license. 349 * See the LICENSE file in the root directory of this source tree. 350 */const mh=be("MousePointer",[["path",{d:"M12.586 12.586 19 19",key:"ea5xo7"}],["path",{d:"M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.5
35079a.5.5 0 0 0 .063-.947z",key:"277e5u"}]]);/** 351 * @license lucide-react v0.462.0 - ISC 352 * 353 * This source code is licensed under the ISC license. 354 * See the LICENSE file in the root directory of this source tree. 355 */const zq=be("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** 356 * @license lucide-react v0.462.0 - ISC 357 * 358 * This source code is licensed under the ISC license. 359 * See the LICENSE file in the root directory of this source tree. 360 */const Uq=be("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** 361 * @license lucide-react v0.462.0 - ISC 362 * 363 * This source code is licensed under the ISC license. 364 * See the LICENSE file in the root directory of this source tree. 365 */const Wq=be("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** 366 * @license lucide-react v0.462.0 - ISC 367 * 368 * This source code is licensed under the ISC license. 369 * See the LICENSE file in the root directory of this source tree. 370 */const Hq=be("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** 371 * @license lucide-react v0.462.0 - ISC 372 * 373 * This source code is licensed under the ISC license. 374 * See the LICENSE file in the root directory of this source tree. 375 */const Qk=be("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/** 376 * @license lucide-react v0.462.0 - ISC 377 * 378 * This source code is licensed under the ISC license. 379 * See the LICENSE file in the root directory of this source tree. 380 */const ky=be("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 381 * @license lucide-react v0.462.0 - ISC 382 * 383 * This source code is licensed under the ISC license. 384 * See the LICENSE file in the root directory of this source tree. 385 */const Gh=be("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 386 * @license lucide-react v0.462.0 - ISC 387 * 388 * This source code is licensed under the ISC license. 389 * See the LICENSE file in the root directory of this source tree. 390 */const gn=be("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 391 * @license lucide-react v0.462.0 - ISC 392 * 393 * This source code is licensed under the ISC license. 394 * See the LICENSE file in the root directory of this source tree. 395 */const Ur=be("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** 396 * @license lucide-react v0.462.0 - ISC 397 * 398 * This source code is licensed under the ISC license. 399 * See the LICENSE file in the root directory of this source tree. 400 */const Vq=be("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** 401 * @license lucide-react v0.462.0 - ISC 402 * 403 * This source code is licensed under the ISC license. 404 * See the LICENSE file in the root directory of this source tree. 405 */const YR=be("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** 406 * @license lucide-react v0.462.0 - ISC 407 * 408 * This source code is licensed under the ISC license. 409 * See the LICENSE file in the root directory of this source tree. 410 */const Es=be("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 411 * @license lucide-react v0.462.0 - ISC 412 * 413 * This source code is licensed under the ISC license. 414 * See the LICENSE file in the root directory of this source tree. 415 */const va=be("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** 416 * @license lucide-react v0.462.0 - ISC 417 * 418 * This source code is licensed under the ISC license. 419 * See the LICENSE file in the root directory of this source tree. 420 */const eu=be("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 421 * @license lucide-react v0.462.0 - ISC 422 * 423 * This source code is licensed under the ISC license. 424 * See the LICENSE file in the root directory of this source tree. 425 */const qq=be("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 426 * @license lucide-react v0.462.0 - ISC 427 * 428 * This source code is licensed under the ISC license. 429 * See the LICENSE file in the root directory of this source tree. 430 */const Os=be("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
430y:"oel41y"}]]);/** 431 * @license lucide-react v0.462.0 - ISC 432 * 433 * This source code is licensed under the ISC license. 434 * See the LICENSE file in the root directory of this source tree. 435 */const ph=be("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 436 * @license lucide-react v0.462.0 - ISC 437 * 438 * This source code is licensed under the ISC license. 439 * See the LICENSE file in the root directory of this source tree. 440 */const kf=be("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** 441 * @license lucide-react v0.462.0 - ISC 442 * 443 * This source code is licensed under the ISC license. 444 * See the LICENSE file in the root directory of this source tree. 445 */const Gq=be("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** 446 * @license lucide-react v0.462.0 - ISC 447 * 448 * This source code is licensed under the ISC license. 449 * See the LICENSE file in the root directory of this source tree. 450 */const Kq=be("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** 451 * @license lucide-react v0.462.0 - ISC 452 * 453 * This source code is licensed under the ISC license. 454 * See the LICENSE file in the root directory of this source tree. 455 */const ap=be("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** 456 * @license lucide-react v0.462.0 - ISC 457 * 458 * This source code is licensed under the ISC license. 459 * See the LICENSE file in the root directory of this source tree. 460 */const Yq=be("TestTube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);/** 461 * @license lucide-react v0.462.0 - ISC 462 * 463 * This source code is licensed under the ISC license. 464 * See the LICENSE file in the root directory of this source tree. 465 */const tu=be("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** 466 * @license lucide-react v0.462.0 - ISC 467 * 468 * This source code is licensed under the ISC license. 469 * See the LICENSE file in the root directory of this source tree. 470 */const Ft=be("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 471 * @license lucide-react v0.462.0 - ISC 472 * 473 * This source code is licensed under the ISC license. 474 * See the LICENSE file in the root directory of this source tree. 475 */const yi=be("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 476 * @license lucide-react v0.462.0 - ISC 477 * 478 * This source code is licensed under the ISC license. 479 * See the LICENSE file in the root directory of this source tree. 480 */const Ro=be("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** 481 * @license lucide-react v0.462.0 - ISC 482 * 483 * This source code is licensed under the ISC license. 484 * See the LICENSE file in the root directory of this source tree. 485 */const Jk=be("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}
vendor: 10,001 bytes, lines 485-515
485],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/** 486 * @license lucide-react v0.462.0 - ISC 487 * 488 * This source code is licensed under the ISC license. 489 * See the LICENSE file in the root directory of this source tree. 490 */const XR=be("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]]);/** 491 * @license lucide-react v0.462.0 - ISC 492 * 493 * This source code is licensed under the ISC license. 494 * See the LICENSE file in the root directory of this source tree. 495 */const Xq=be("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** 496 * @license lucide-react v0.462.0 - ISC 497 * 498 * This source code is licensed under the ISC license. 499 * See the LICENSE file in the root directory of this source tree. 500 */const di=be("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 501 * @license lucide-react v0.462.0 - ISC 502 * 503 * This source code is licensed under the ISC license. 504 * See the LICENSE file in the root directory of this source tree. 505 */const Mr=be("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 506 * @license lucide-react v0.462.0 - ISC 507 * 508 * This source code is licensed under the ISC license. 509 * See the LICENSE file in the root directory of this source tree. 510 */const es=be("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 511 * @license lucide-react v0.462.0 - ISC 512 * 513 * This source code is licensed under the ISC license. 514 * See the LICENSE file in the root directory of this source tree. 515 */const Qq=be("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Y_="-",Jq=e=>{const t=eG(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(Y_);return l[0]===""&&l.length!==1&&l.shift(),QR(l,t)||Zq(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},QR=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?QR(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Y_);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},Zk=/^\[(.+)\]$/,Zq=e=>{if(Zk.test(e)){const t=Zk.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},eG=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return rG(Object.entries(e.classGroups),r).forEach(([i,o])=>{p1(o,n,i,t)}),n},p1=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:eA(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(tG(s)){p1(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{p1(o,eA(t,i),r,n)})})},eA=(e,t)=>{let r=e;return t.split(Y_).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},tG=e=>e.isThemeGetter,rG=(e,t)=>t?e.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[r,s]}):e,nG=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return s(i,o),o},set(i,o){r.has(i)?r.set(i,o):s(i,o)}}},JR="!",aG=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],i=t.length,o=l=>{const c=[];let d=0,u=0,f;for(let x=0;x<l.length;x++){let b=l[x];if(d===0){if(b===s&&(n||l.slice(x,x+i)===t)){c.push(l.slice(u,x)),u=x+i;continue}if(b==="/"){f=x;continue}}b==="["?d++:b==="]"&&d--}const h=c.length===0?l:l.substring(u),m=h.startsWith(JR),v=m?h.substring(1):h,p=f&&f>u?f-u:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:p}};return r?l=>r({className:l,parseClassName:o}):o},sG=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},iG=e=>({cache:nG(e.cacheSize),parseClassName:aG(e),...Jq(e)}),oG=/\s+/,lG=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(oG);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:u,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:m}=r(d);let v=!!m,p=n(v?h.substring(0,m):h);if(!p){if(!v){l=d+(l.length>0?" "+l:l);continue}if(p=n(h),!p){l=d+(l.length>0?" "+l:l);continue}v=!1}const x=sG(u).join(":"),b=f?x+JR:x,y=b+p;if(i.includes(y))continue;i.push(y);const w=s(p,v);for(let _=0;_<w.length;++_){const N=w[_];i.push(b+N)}l=d+(l.length>0?" "+l:l)}return l};function cG(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=ZR(t))&&(n&&(n+=" "),n+=r);return n}const ZR=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=ZR(e[n]))&&(r&&(r+=" "),r+=t);return r};function dG(e,...t){let r,n,s,i=o;function o(c){const d=t.reduce((u,f)=>f(u),e());return r=iG(d),n=r.cache.get,s=r.cache.set,i=l,l(c)}function l(c){const d=n(c);if(d)return d;const u=lG(c,r);return s(c,u),u}return function(){return i(cG.apply(null,arguments))}}const zt=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},eD=/^\[(?:([a-z-]+):)?(.+)\]$/i,uG=/^\d+\/\d+$/,fG=new Set(["px","full","screen"]),hG=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mG=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pG=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,gG=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vG=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vs=e=>Cd(e)||fG.has(e)||uG.test(e),Bi=e=>Gu(e,"length",_G),Cd=e=>!!e&&!Number.isNaN(Number(e)),J0=e=>Gu(e,"number",Cd),Af=e=>!!e&&Number.isInteger(Number(e)),xG=e=>e.endsWith("%")&&Cd(e.slice(0,-1)),Qe=e=>eD.test(e),zi=e=>hG.test(e),yG=new Set(["length","size","percentage"]),bG=e=>Gu(e,yG,tD),wG=e=>Gu(e,"position",tD),jG=new Set(["image","url"]),NG=e=>Gu(e,jG,PG),SG=e=>Gu(e,"",CG),Ef=()=>!0,Gu=(e,t,r)=>{const n=eD.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},_G=e=>mG.test(e)&&!pG.test(e),tD=()=>!1,CG=e=>gG.test(e),PG=e=>vG.test(e),kG=()=>{const e=zt("colors"),t=zt("spacing"),r=zt("blur"),n=zt("brightness"),s=zt("borderColor"),i=zt("borderRadius"),o=zt("borderSpacing"),l=zt("borderWidth"),c=zt("contrast"),d=zt("grayscale"),u=zt("hueRotate"),f=zt("invert"),h=zt("gap"),m=zt("gradientColorStops"),v=zt("gradientColorStopPositions"),p=zt("inset"),x=zt("margin"),b=zt("opacity"),y=zt("padding"),w=zt("saturate"),_=zt("scale"),N=zt("sepia"),j=zt("skew"),S=zt("space"),C=zt("translate"),P=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",Qe,t],F=()=>[Qe,t],q=()=>["",Vs,Bi],B=()=>["auto",Cd,Qe],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],E=()=>["solid","dashed","dotted","double","none"],M=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",Qe],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[Cd,Qe];return{cacheSize:500,separator:":",theme:{colors:[Ef],spacing:[Vs,Bi],blur:["none","",zi,Qe],brightness:H(),borderColor:[e],borderRadius:["none","","full",zi,Qe],borderSpacing:F(),borderWidth:q(),contrast:H(),grayscale:L(),hueRotate:H(),invert:L(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[xG,Bi],inset:D(),margin:D(),opacity:H(),padding:F(),saturate:H(),scale:H(),sepia:L(),skew:H(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",Qe]}],container:["container"],columns:[{columns:[zi]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),Qe]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}
vendor: 8,691 bytes, line 515
515],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Af,Qe]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Qe]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",Af,Qe]}],"grid-cols":[{"grid-cols":[Ef]}],"col-start-end":[{col:["auto",{span:["full",Af,Qe]},Qe]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[Ef]}],"row-start-end":[{row:["auto",{span:[Af,Qe]},Qe]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Qe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Qe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Qe,t]}],"min-w":[{"min-w":[Qe,t,"min","max","fit"]}],"max-w":[{"max-w":[Qe,t,"none","full","min","max","fit","prose",{screen:[zi]},zi]}],h:[{h:[Qe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Qe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Qe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Qe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",zi,Bi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",J0]}],"font-family":[{font:[Ef]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Qe]}],"line-clamp":[{"line-clamp":["none",Cd,J0]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Vs,Qe]}],"list-image":[{"list-image":["none",Qe]}],"list-style-type":[{list:["none","disc","decimal",Qe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...E(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Vs,Bi]}],"underline-offset":[{"underline-offset":["auto",Vs,Qe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),wG]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",bG]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},NG]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...E(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:E()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...E()]}],"outline-offset":[{"outline-offset":[Vs,Qe]}],"outline-w":[{outline:[Vs,Bi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Vs,Bi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",zi,SG]}],"shadow-color":[{shadow:[Ef]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...M(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":M()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",zi,Qe]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Qe]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",Qe]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",Qe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[Af,Qe]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Qe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","
515none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Qe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Qe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Vs,Bi,J0]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},AG=dG(kG);function me(...e){return AG(qe(e))}const EG=wq,rD=g.forwardRef(({className:e,...t},r)=>a.jsx(DR,{ref:r,className:me("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));rD.displayName=DR.displayName;const OG=ki("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),nD=g.forwardRef(({className:e,variant:t,...r},n)=>
515a.jsx(LR,{ref:n,className:me(OG({variant:t}),e),...r}));nD.displayName=LR.displayName;const TG=g.forwardRef(({className:e,...t},r)=>a.jsx(zR,{ref:r,className:me("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));TG.displayName=zR.displayName;const aD=g.forwardRef(({className:e,...t},r)=>a.jsx(UR,{ref:r,className:me("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:a.jsx(es,{className:"h-4 w-4"})}));aD.displayName=UR.displayName;const sD=g.forwardRef(({className:e,...t},r)=>a.jsx(FR,{ref:r,className:me("text-sm font-semibold",e),...t}));sD.displayName=FR.displayName;const iD=g.forwardRef(({className:e,...t},r)=>a.jsx(BR,{ref:r,className:me("text-sm opacity-90",e),...t}));iD.displayName=BR.displayName;function MG(){const{toasts:e}=dt();return a.jsxs(EG,{children:[e.map(function({id:t,title:r,description:n,action:s,...i}){return a.jsxs(nD,{...i,children:[a.jsxs("div",{className:"grid gap-1",children:[r&&a.jsx(sD,{children:r}),n&&a.jsx(iD,{children:n})]}),s,a.jsx(aD,{})]},t)}),a.jsx(rD,{})]})}var tA=["light","dark"],IG="(prefers-color-scheme: dark)",$G=g.createContext(void 0),RG={setTheme:e=>{},themes:[]},DG=()=>{var e;return(e=g.useContext($G))!=null?e:RG};g.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:i,value:o,attrs:l,nonce:c})=>{let d=i==="system",u=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(v=>`'${v}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,f=s?tA.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(v,p=!1,x=!0)=>{let b=o?o[v]:v,y=p?v+"|| ''":`'${b}'`,w="";return s&&x&&!p&&tA.includes(v)&&(w+=`d.style.colorScheme = '${v}';`),r==="class"?p||b?w+=`c.add(${y})`:w+="null":b&&(w+=`d[s](n,${y})`),w},m=e?`!function(){${u}${h(e)}}()`:n?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${IG}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}${d?"":"else{"+h(i,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}else{${h(i,!1,!1)};}${f}}catch(t){}}();`;return g.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})});var LG=e=>{switch(e){case"success":return zG;case"info":return WG;case"warning":return UG;case"error":return HG;default:return null}},FG=Array(12).fill(0),BG=({visible:e,className:t})=>I.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},I.createElement("div",{className:"sonner-spinner"},FG.map((r,n)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),zG=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),UG=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),WG=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),HG=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),VG=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),qG=()=>
515{let[e,t]=I.useState(document.hidden);return I.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},g1=1,GG=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:g1++,i=this.toasts.find(l=>l.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:r}),{...l,...e,id:s,dismissible:o,title:r}):l):this.addToast({title:r,...n,dismissible:o,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
515this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,i,o=n.then(async c=>{if(i=["resolve",c],I.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(YG(c)&&!c.ok){s=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:d,description:u})}else if(t.success!==void 0){s=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:d,description:u})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){s=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:d,description:u})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,d)=>o.then(()=>i[0]==="reject"?d(i[1]):c(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||g1++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Cn=new GG,KG=(e,t)=>{let r=(t==null?void 0:t.id)||g1++;return Cn.addToast({title:e,...t,id:r}),r},YG=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",XG=KG,QG=()=>Cn.toasts,JG=()=>Cn.getActiveToasts(),We=Object.assign(XG,{success:Cn.success,info:Cn.info,warning:Cn.warning,error:Cn.error,custom:Cn.custom,message:Cn.message,promise:Cn.promise,dismiss:Cn.dismiss,loading:Cn.loading},{getHistory:QG,getToasts:JG});function ZG(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}ZG(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
515left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
515:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
515--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} 516`);function tg(e){return e.label!==void 0}var eK=3,tK="32px",rK="16px",rA=4e3,nK=356,aK=14,sK=20,iK=200;function Ra(...e){return e.filter(Boolean).join(" ")}function oK(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var lK=e=>{var t,r,n,s,i,o,l,c,d,u,f;let{invert:h,toast:m,unstyled:v,interacting:p,setHeights:x,visibleToasts:b,heights:y,index:w,toasts:_,expanded:N,removeToast:j,defaultRichColors:S,closeButton:C,style:P,cancelButtonStyle:A,actionButtonStyle:D,className:F="",descriptionClassName:q="",duration:B,position:V,gap:E,loadingIcon:M,expandByDefault:T,classNames:L,icons:K,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:ee}
516=e,[se,ne]=I.useState(null),[W,ie]=I.useState(null),[R,O]=I.useState(!1),[k,G]=I.useState(!1),[te,$]=I.useState(!1),[ae,oe]=I.useState(!1),[z,fe]=I.useState(!1),[ue,Ne]=I.useState(0),[He,ke]=I.useState(0),Ze=I.useRef(m.duration||B||rA),Y=I.useRef(null),_e=I.useRef(null),Oe=w===0,Ee=w+1<=b,tt=m.type,jt=m.dismissible!==!1,sn=m.className||"",ta=m.descriptionClassName||"",fs=I.useMemo(()=>y.findIndex(Ke=>Ke.toastId===m.id)||0,[y,m.id]),Mp=I.useMemo(()=>{var Ke;return(Ke=m.closeButton)!=null?Ke:C},[m.closeButton,C]),jn=I.useMemo(()=>m.duration||B||rA,[m.duration,B]),hs=I.useRef(0),Rr=I.useRef(0),ra=I.useRef(0),Oa=I.useRef(null),[kt,st]=V.split("-"),ut=I.useMemo(()=>y.reduce((Ke,At,Yt)=>Yt>=fs?Ke:Ke+At.height,0),[y,fs]),xt=qG(),Gr=m.invert||h,vf=tt==="loading";Rr.current=I.useMemo(()=>fs*E+ut,[fs,ut]),I.useEffect(()=>{Ze.current=jn},[jn]),I.useEffect(()=>{O(!0)},[]),I.useEffect(()=>{let Ke=_e.current;if(Ke){let At=Ke.getBoundingClientRect().height;return ke(At),x(Yt=>[{toastId:m.id,height:At,position:m.position},...Yt]),()=>x(Yt=>Yt.filter(Ta=>Ta.toastId!==m.id))}},[x,m.id]),I.useLayoutEffect(()=>{if(!R)return;let Ke=_e.current,At=Ke.style.height;Ke.style.height="auto";let Yt=Ke.getBoundingClientRect().height;Ke.style.height=At,ke(Yt),x(Ta=>Ta.find(Ma=>Ma.toastId===m.id)?Ta.map(Ma=>Ma.toastId===m.id?{...Ma,height:Yt}:Ma):[{toastId:m.id,height:Yt,position:m.position},...Ta])},[R,m.title,m.description,x,m.id]);let Ri=I.useCallback(()=>{G(!0),Ne(Rr.current),x(Ke=>Ke.filter(At=>At.toastId!==m.id)),setTimeout(()=>{j(m)},iK)},[m,j,x,Rr]);I.useEffect(()=>{if(m.promise&&tt==="loading"||m.duration===1/0||m.type==="loading")return;let Ke;return N||p||ee&&xt?(()=>{if(ra.current<hs.current){let At=new Date().getTime()-hs.current;Ze.current=Ze.current-At}ra.current=new Date().getTime()})():Ze.current!==1/0&&(hs.current=new Date().getTime(),Ke=setTimeout(()=>{var At;(At=m.onAutoClose)==null||At.call(m,m),Ri()},Ze.current)),()=>clearTimeout(Ke)},[N,p,m,tt,ee,xt,Ri]),I.useEffect(()=>{m.delete&&Ri()},[Ri,m.delete]);function CW(){var Ke,At,Yt;return K!=null&&K.loading?I.createElement("div",{className:Ra(L==null?void 0:L.loader,(Ke=m==null?void 0:m.classNames)==null?void 0:Ke.loader,"sonner-loader"),"data-visible":tt==="loading"},K.loading):M?I.createElement("div",{className:Ra(L==null?void 0:L.loader,(At=m==null?void 0:m.classNames)==null?void 0:At.loader,"sonner-loader"),"data-visible":tt==="loading"},M):I.createElement(BG,{className:Ra(L==null?void 0:L.loader,(Yt=m==null?void 0:m.classNames)==null?void 0:Yt.loader),visible:tt==="loading"})}return I.createElement("li",{tabIndex:0,ref:_e,className:Ra(F,sn,L==null?void 0:L.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,L==null?void 0:L.default,L==null?void 0:L[tt],(r=m==null?void 0:m.classNames)==null?void 0:r[tt]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:S,"data-styled":!(m.jsx||m.unstyled||v),"data-mounted":R,"data-promise":!!m.promise,"data-swiped":z,"data-removed":k,"data-visible":Ee,"data-y-position":kt,"data-x-position":st,"data-index":w,"data-front":Oe,"data-swiping":te,"data-dismissible":jt,"data-type":tt,"data-invert":Gr,"data-swipe-out":ae,"data-swipe-direction":W,"data-expanded":!!(N||T&&R),style:{"--index":w,"--toasts-before":w,"--z-index":_.length-w,"--offset":`${k?ue:Rr.current}px`,"--initial-height":T?"auto":`${He}px`,...P,...m.style},onDragEnd:()=>{$(!1),ne(null),Oa.current=null},onPointerDown:Ke=>{vf||!jt||(Y.current=new Date,Ne(Rr.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&($(!0),Oa.current={x:Ke.clientX,y:Ke.clientY}))},onPointerUp:()=>{var Ke,At,Yt,Ta;if(ae||!jt)return;Oa.current=null;let Ma=Number(((Ke=_e.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Di=Number(((At=_e.current)==null?void 0:At.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),dl=new Date().getTime()-((Yt=Y.current)==null?void 0:Yt.getTime()),Ia=se==="x"?Ma:Di,Li=Math.abs(Ia)/dl;if(Math.abs(Ia)>=sK||Li>.11){Ne(Rr.current),(Ta=m.onDismiss)==null||Ta.call(m,m),ie(se==="x"?Ma>0?"right":"left":Di>0?"down":"up"),Ri(),oe(!0),fe(!1);return}$(!1),ne(null)},onPointerMove:Ke=>{var At,Yt,Ta,Ma;if(!Oa.current||!jt||((At=window.getSelection())==null?void 0:At.toString().length)>0)return;let Di=Ke.clientY-Oa.current.y,dl=Ke.clientX-Oa.current.x,Ia=(Yt=e.swipeDirections)!=null?Yt:oK(V);!se&&(Math.abs(dl)>1||Math.abs(Di)>1)&&ne(Math.abs(dl)>Math.abs(Di)?"x":"y");let Li={x:0,y:0};se==="y"?(Ia.includes("top")||Ia.includes("bottom"))&&(Ia.includes("top")&&Di<0||Ia.includes("bottom")&&Di>0)&&(Li.y=Di):se==="x"&&(Ia.includes("left")||Ia.includes("right"))&&(Ia.includes("left")&&dl<0||Ia.includes("right")&&dl>0)&&(Li.x=dl),(Math.abs(Li.x)>0||Math.abs(Li.y)>0)&&fe(!0),(Ta=_e.current)==null||Ta.style.setProperty("--swipe-amount-x",`${Li.x}px`),(Ma=_e.current)==null||Ma.style.setProperty("--swipe-amount-y",`${Li.y}px`)}},Mp&&!m.jsx?I.createElement("button",{"aria-label":H,"data-disabled":vf,"data-close-button":!0,onClick:vf||!jt?()=>{}:()=>{var Ke;Ri(),(Ke=m.onDismiss)==null||Ke.call(m,m)},className:Ra(L==null?void 0:L.closeButton,(s=m==null?void 0:m.classNames)==null?void 0:s.closeButton)},(i=K==null?void 0:K.close)!=null?i:VG):null,m.jsx||g.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:I.createElement(I.Fragment,null,tt||m.icon||m.promise?I.createElement("div",{"data-icon":"",className:Ra(L==null?void 0:L.icon,(o=m==null?void 0:m.classNames)==null?void 0:o.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||CW():null,m.type!=="loading"?m.
516icon||(K==null?void 0:K[tt])||LG(tt):null):null,I.createElement("div",{"data-content":"",className:Ra(L==null?void 0:L.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},I.createElement("div",{"data-title":"",className:Ra(L==null?void 0:L.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?I.createElement("div",{"data-description":"",className:Ra(q,ta,L==null?void 0:L.description,(d=m==null?void 0:m.classNames)==null?void 0:d.description)},typeof m.description=="function"?m.description():m.description):null),g.isValidElement(m.cancel)?m.cancel:m.cancel&&tg(m.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||A,onClick:Ke=>{var At,Yt;tg(m.cancel)&&jt&&((Yt=(At=m.cancel).onClick)==null||Yt.call(At,Ke),Ri())},className:Ra(L==null?void 0:L.cancelButton,(u=m==null?void 0:m.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,g.isValidElement(m.action)?m.action:m.action&&tg(m.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||D,onClick:Ke=>{var At,Yt;tg(m.action)&&((Yt=(At=m.action).onClick)==null||Yt.call(At,Ke),!Ke.defaultPrevented&&Ri())},className:Ra(L==null?void 0:L.actionButton,(f=m==null?void 0:m.classNames)==null?void 0:f.actionButton)},m.action.label):null))};function nA(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function cK(e,t){let r={};return[e,t].forEach((n,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",l=i?rK:tK;function c(d){["top","right","bottom","left"].forEach(u=>{r[`${o}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${o}-${d}`]=l:r[`${o}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):c(l)}),r}var dK=g.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:f,duration:h,style:m,visibleToasts:v=eK,toastOptions:p,dir:x=nA(),gap:b=aK,loadingIcon:y,icons:w,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:N}=e,[j,S]=I.useState([]),C=I.useMemo(()=>Array.from(new Set([n].concat(j.filter(ee=>ee.position).map(ee=>ee.position)))),[j,n]),[P,A]=I.useState([]),[D,F]=I.useState(!1),[q,B]=I.useState(!1),[V,E]=I.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),M=I.useRef(null),T=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=I.useRef(null),K=I.useRef(!1),H=I.useCallback(ee=>{S(se=>{var ne;return(ne=se.find(W=>W.id===ee.id))!=null&&ne.delete||Cn.dismiss(ee.id),se.filter(({id:W})=>W!==ee.id)})},[]);return I.useEffect(()=>Cn.subscribe(ee=>{if(ee.dismiss){S(se=>se.map(ne=>ne.id===ee.id?{...ne,delete:!0}:ne));return}setTimeout(()=>{B_.flushSync(()=>{S(se=>{let ne=se.findIndex(W=>W.id===ee.id);return ne!==-1?[...se.slice(0,ne),{...se[ne],...ee},...se.slice(ne+1)]:[ee,...se]})})})}),[]),I.useEffect(()=>{if(u!=="system"){E(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?E("dark"):E("light")),typeof window>"u")return;let ee=window.matchMedia("(prefers-color-scheme: dark)");try{ee.addEventListener("change",({matches:se})=>{E(se?"dark":"light")})}catch{ee.addListener(({matches:ne})=>{try{E(ne?"dark":"light")}catch(W){console.error(W)}})}},[u]),I.useEffect(()=>{j.length<=1&&F(!1)},[j]),I.useEffect(()=>{let ee=se=>{var ne,W;s.every(ie=>se[ie]||se.code===ie)&&(F(!0),(ne=M.current)==null||ne.focus()),se.code==="Escape"&&(document.activeElement===M.current||(W=M.current)!=null&&W.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[s]),I.useEffect(()=>{if(M.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,K.current=!1)}},[M.current]),I.createElement("section",{ref:t,"aria-label":`${_} ${T}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((ee,se)=>{var ne;let[W,ie]=ee.split("-");return j.length?I.createElement("ol",{key:ee,dir:x==="auto"?nA():x,tabIndex:-1,ref:M,className:l,"data-sonner-toaster":!0,"data-theme":V,"data-y-position":W,"data-lifted":D&&j.length>1&&!i,"data-x-position":ie,style:{"--front-toast-height":`${((ne=P[0])==null?void 0:ne.height)||0}px`,"--width":`${nK}px`,"--gap":`${b}px`,...m,...cK(c,d)},onBlur:R=>{K.current&&!R.currentTarget.contains(R.relatedTarget)&&(K.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:R=>{R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||K.current||(K.current=!0,L.current=R.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{q||F(!1)},onDragEnd:()=>F(!1),onPointerDown:R=>{R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},j.filter(R=>!R.position&&se===0||R.position===ee).map((R,O)=>{var k,G;return I.createElement(lK,{key:R.id,icons:w,index:O,toast:R,defaultRichColors:f,duration:(k=p==null?void 0:p.duration)!=null?k:h,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:r,visibleToasts:v,closeButton:(G=p==null?void 0:p.closeButton)!=null?G:o,interacting:q,position:ee,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:H,toasts:j.filter(te=>te.position==R.position),heights:P.filter(te=>te.position==R.position),setHeights:A,expandByDefault:i,gap:b,loadingIcon:y,expanded:D,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const uK=({...e})=>{const{theme:t="system"}=DG();return a.jsx(dK,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var fK=YS[" useId ".trim().toString()]||(()=>{}),hK=0;function tn(e){const[t,r]=g.useState(fK());return Kt(()=>{r(n=>n??String(hK++))},[e]),t?`radix-${t}`:""}const mK=["top","right","bottom","left"],Do=Math.min,Un=Math.max,Tv=Math.round,rg=Math.floor,Ts=e=>({x:e,y:e}
vendor: 11,917 bytes, line 516
516),pK={left:"right",right:"left",bottom:"top",top:"bottom"},gK={start:"end",end:"start"};function v1(e,t,r){return Un(e,Do(t,r))}function bi(e,t){return typeof e=="function"?e(t):e}function wi(e){return e.split("-")[0]}function Ku(e){return e.split("-")[1]}function X_(e){return e==="x"?"y":"x"}function Q_(e){return e==="y"?"height":"width"}const vK=new Set(["top","bottom"]);function Ss(e){return vK.has(wi(e))?"y":"x"}function J_(e){return X_(Ss(e))}function xK(e,t,r){r===void 0&&(r=!1);const n=Ku(e),s=J_(e),i=Q_(s);let o=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Mv(o)),[o,Mv(o)]}function yK(e){const t=Mv(e);return[x1(e),t,x1(t)]}function x1(e){return e.replace(/start|end/g,t=>gK[t])}const aA=["left","right"],sA=["right","left"],bK=["top","bottom"],wK=["bottom","top"];function jK(e,t,r){switch(e){case"top":case"bottom":return r?t?sA:aA:t?aA:sA;case"left":case"right":return t?bK:wK;default:return[]}}function NK(e,t,r,n){const s=Ku(e);let i=jK(wi(e),r==="start",n);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(x1)))),i}function Mv(e){return e.replace(/left|right|bottom|top/g,t=>pK[t])}function SK(e){return{top:0,right:0,bottom:0,left:0,...e}}function oD(e){return typeof e!="number"?SK(e):{top:e,right:e,bottom:e,left:e}}function Iv(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function iA(e,t,r){let{reference:n,floating:s}=e;const i=Ss(t),o=J_(t),l=Q_(o),c=wi(t),d=i==="y",u=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,h=n[l]/2-s[l]/2;let m;switch(c){case"top":m={x:u,y:n.y-s.height};break;case"bottom":m={x:u,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:f};break;case"left":m={x:n.x-s.width,y:f};break;default:m={x:n.x,y:n.y}}switch(Ku(t)){case"start":m[o]-=h*(r&&d?-1:1);break;case"end":m[o]+=h*(r&&d?-1:1);break}return m}const _K=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:o}=r,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=iA(d,n,c),h=n,m={},v=0;for(let p=0;p<l.length;p++){const{name:x,fn:b}=l[p],{x:y,y:w,data:_,reset:N}=await b({x:u,y:f,initialPlacement:n,placement:h,strategy:s,middlewareData:m,rects:d,platform:o,elements:{reference:e,floating:t}});u=y??u,f=w??f,m={...m,[x]:{...m[x],..._}},N&&v<=50&&(v++,typeof N=="object"&&(N.placement&&(h=N.placement),N.rects&&(d=N.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):N.rects),{x:u,y:f}=iA(d,h,c)),p=-1)}return{x:u,y:f,placement:h,strategy:s,middlewareData:m}};async function Kh(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=bi(t,e),v=oD(m),x=l[h?f==="floating"?"reference":"floating":f],b=Iv(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(x)))==null||r?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),y=f==="floating"?{x:n,y:s,width:o.floating.width,height:o.floating.height}:o.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),_=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},N=Iv(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:c}):y);return{top:(b.top-N.top+v.top)/_.y,bottom:(N.bottom-b.bottom+v.bottom)/_.y,left:(b.left-N.left+v.left)/_.x,right:(N.right-b.right+v.right)/_.x}}const CK=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=bi(e,t)||{};if(d==null)return{};const f=oD(u),h={x:r,y:n},m=J_(s),v=Q_(m),p=await o.getDimensions(d),x=m==="y",b=x?"top":"left",y=x?"bottom":"right",w=x?"clientHeight":"clientWidth",_=i.reference[v]+i.reference[m]-h[m]-i.floating[v],N=h[m]-i.reference[m],j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let S=j?j[w]:0;(!S||!await(o.isElement==null?void 0:o.isElement(j)))&&(S=l.floating[w]||i.floating[v]);const C=_/2-N/2,P=S/2-p[v]/2-1,A=Do(f[b],P),D=Do(f[y],P),F=A,q=S-p[v]-D,B=S/2-p[v]/2+C,V=v1(F,B,q),E=!c.arrow&&Ku(s)!=null&&B!==V&&i.reference[v]/2-(B<F?A:D)-p[v]/2<0,M=E?B<F?B-F:B-q:0;return{[m]:h[m]+M,data:{[m]:V,centerOffset:B-V-M,...E&&{alignmentOffset:M}},reset:E}}}),PK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:p=!0,...x}=bi(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const b=wi(s),y=Ss(l),w=wi(l)===l,_=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=h||(w||!p?[Mv(l)]:yK(l)),j=v!=="none";!h&&j&&N.push(...NK(l,p,v,_));const S=[l,...N],C=await Kh(t,x),P=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&P.push(C[b]),f){const B=xK(s,o,_);P.push(C[B[0]],C[B[1]])}if(A=[...A,{placement:s,overflows:P}],!P.every(B=>B<=0)){var D,F;const B=(((D=i.flip)==null?void 0:D.index)||0)+1,V=S[B];if(V&&(!(f==="alignment"?y!==Ss(V):!1)||A.every(T=>T.overflows[0]>0&&Ss(T.placement)===y)))return{data:{index:B,overflows:A},reset:{placement:V}};let E=(F=A.filter(M=>M.overflows[0]<=0).sort((M,T)=>M.overflows[1]-T.overflows[1])[0])==null?void 0:F.placement;if(!E)switch(m){case"bestFit":{var q;const M=(q=A.filter(T=>{if(j){const L=Ss(T.placement);return L===y||L==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(L=>L>0).reduce((L,K)=>L+K,0)]).sort((T,L)=>T[1]-L[1])[0])==null?void 0:q[0];M&&(E=M);break}case"initialPlacement":E=l;break}if(s!==E)return{reset:{placement:E}}}return{}}}};function oA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function lA(e){return mK.some(t=>e[t]>=0)}const kK=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=bi(e,t);switch(n){case"referenceHidden":{const i=await Kh(t,{...s,elementContext:"reference"}),o=oA(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:lA(o)}}}case"escaped":{const i=await Kh(t,{...s,altBoundary:!0}),o=oA(i,r.floating);return{data:{escapedOffsets:o,escaped:lA(o)}}}default:return{}}}}},lD=new Set(["left","top"]);async function AK(e,t){const{placement:r,platform:n,elements:s}=e,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),o=wi(r),l=Ku(r),c=Ss(r)==="y",d=lD.has(o)?-1:1,u=i&&c?-1:1,f=bi(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof v=="number"&&(m=l==="end"?v*-1:v),c?{x:m*u,y:h*d}:{x:h*d,y:m*u}}const EK=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:i,placement:o,middlewareData:l}=t,c=await AK(t,e);return o===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:o}}}}},OK=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:x=>{let{x:b,y}=x;return{x:b,y}}},...c}=bi(e,t),d={x:r,y:n},u=await Kh(t,c),f=Ss(wi(s)),h=X_(f);let m=d[h],v=d[f];if(i){const x=h==="y"?"top":"left",b=h==="y"?"bottom":"right",y=m+u[x],w=m-u[b];m=v1(y,m,w)}if(o){const x=f==="y"?"top":"left",b=f==="y"?"bottom":"right",y=v+u[x],w=v-u[b];v=v1(y,v,w)}const p=l.fn({...t,[h]:m,[f]:v});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[h]:i,[f]:o}}}}}},TK=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=bi(e,t),u={x:r,y:n},f=Ss(s),h=X_(f);let m=u[h],v=u[f];const p=bi(l,t),x=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const w=h==="y"?"height":"width",_=i.reference[h]-i.floating[w]+x.mainAxis,N=i.reference[h]+i.reference[w]-x.mainAxis;m<_?m=_:m>N&&(m=N)}if(d){var b,y;const w=h==="y"?"width":"height",_=lD.has(wi(s)),N=i.reference[f]-i.floating[w]+(_&&((b=o.offset)==null?void 0:b[f])||0)+(_?0:x.crossAxis),j=i.reference[f]+i.reference[w]+(_?0:((y=o.offset)==null?void 0:y[f])||0)-(_?x.crossAxis:0);v<N?v=N:v>j&&(v=j)}return{[h]:m,[f]:v}}}},MK=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...d}=bi(e,t),u=await Kh(t,d),f=wi(s),h=Ku(s),m=Ss(s)==="y",{width:v,height:p}=i.floating;let x,b;f==="top"||f==="bottom"?(x=f,b=h===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(b=f,x=h==="end"?"top":"bottom");const y=p-u.top-u.bottom,w=v-u.left-u.right,_=Do(p-u[x],y),N=Do(v-u[b],w),j=!t.middlewareData.shift;let S=_,C=N;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(C=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(S=y),j&&!h){const A=Un(u.left,0),D=Un(u.right,0),F=Un(u.top,0),q=Un(u.bottom,0);m?C=v-2*(A!==0||D!==0?A+D:Un(u.left,u.right)):S=p-2*(F!==0||q!==0?F+q:Un(u.top,u.bottom))}await c({...t,availableWidth:C,availableHeight:S});const P=await o.getDimensions(l.floating);return v!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function Ay(){return typeof window<"u"}function Yu(e){return cD(e)?(e.nodeName||"").toLowerCase():"#document"}function Kn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fs(e){var t;return(t=(cD(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function cD(e){return Ay()?e instanceof Node||e instanceof Kn(e).Node:!1}function as(e){return Ay()?e instanceof Element||e instanceof Kn(e).Element:!1}function Rs(e){return Ay()?e instanceof HTMLElement||e instanceof Kn(e).HTMLElement:!1}function cA(e){return!Ay()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Kn(e).ShadowRoot}const IK=new Set(["inline","contents"]);function sp(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=ss(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!IK.has(s)}const $K=new Set(["table","td","th"]);function RK(e){return $K.has(Yu(e))}const DK=[":popover-open",":modal"];function Ey(e){return DK.some(t=>{try{return e.matches(t)}catch{return!1}})}const LK=["transform","translate","scale","rotate","perspective"],FK=["transform","translate","scale","rotate","perspective","filter"],BK=["paint","layout","strict","content"];function Z_(e){const t=eC(),r=as(e)?ss(e):e;return LK.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||FK.some(n=>(r.willChange||"").includes(n))||BK.some(n=>(r.contain||"").includes(n))}function zK(e){let t=Lo(e);for(;Rs(t)&&!ru(t);){if(Z_(t))return t;if(Ey(t))return null;t=Lo(t)}return null}function eC(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const UK=new Set(["html","body","#document"]);function ru(e){return UK.has(Yu(e))}function ss(e){return Kn(e).getComputedStyle(e)}function Oy(e){return as(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Lo(e){if(Yu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||cA(e)&&e.host||Fs(e);return cA(t)?t.host:t}function dD(e){const t=Lo(e);return ru(t)?e.ownerDocument?e.ownerDocument.body:e.body:Rs(t)&&sp(t)?t:dD(t)}function Yh(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=dD(e),i=s===((n=e.ownerDocument)==null?void 0:n.body),o=Kn(s);if(i){const l=y1(o);
vendor: 6,458 bytes, line 516
516return t.concat(o,o.visualViewport||[],sp(s)?s:[],l&&r?Yh(l):[])}return t.concat(s,Yh(s,[],r))}function y1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function uD(e){const t=ss(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Rs(e),i=s?e.offsetWidth:r,o=s?e.offsetHeight:n,l=Tv(r)!==i||Tv(n)!==o;return l&&(r=i,n=o),{width:r,height:n,$:l}}function tC(e){return as(e)?e:e.contextElement}function Pd(e){const t=tC(e);if(!Rs(t))return Ts(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:i}=uD(t);let o=(i?Tv(r.width):r.width)/n,l=(i?Tv(r.height):r.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const WK=Ts(0);function fD(e){const t=Kn(e);return!eC()||!t.visualViewport?WK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function HK(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Kn(e)?!1:t}function nc(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),i=tC(e);let o=Ts(1);t&&(n?as(n)&&(o=Pd(n)):o=Pd(e));const l=HK(i,r,n)?fD(i):Ts(0);let c=(s.left+l.x)/o.x,d=(s.top+l.y)/o.y,u=s.width/o.x,f=s.height/o.y;if(i){const h=Kn(i),m=n&&as(n)?Kn(n):n;let v=h,p=y1(v);for(;p&&n&&m!==v;){const x=Pd(p),b=p.getBoundingClientRect(),y=ss(p),w=b.left+(p.clientLeft+parseFloat(y.paddingLeft))*x.x,_=b.top+(p.clientTop+parseFloat(y.paddingTop))*x.y;c*=x.x,d*=x.y,u*=x.x,f*=x.y,c+=w,d+=_,v=Kn(p),p=y1(v)}}return Iv({width:u,height:f,x:c,y:d})}function rC(e,t){const r=Oy(e).scrollLeft;return t?t.left+r:nc(Fs(e)).left+r}function hD(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-(r?0:rC(e,n)),i=n.top+t.scrollTop;return{x:s,y:i}}function VK(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const i=s==="fixed",o=Fs(n),l=t?Ey(t.floating):!1;if(n===o||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Ts(1);const u=Ts(0),f=Rs(n);if((f||!f&&!i)&&((Yu(n)!=="body"||sp(o))&&(c=Oy(n)),Rs(n))){const m=nc(n);d=Pd(n),u.x=m.x+n.clientLeft,u.y=m.y+n.clientTop}const h=o&&!f&&!i?hD(o,c,!0):Ts(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+h.x,y:r.y*d.y-c.scrollTop*d.y+u.y+h.y}}function qK(e){return Array.from(e.getClientRects())}function GK(e){const t=Fs(e),r=Oy(e),n=e.ownerDocument.body,s=Un(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Un(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+rC(e);const l=-r.scrollTop;return ss(n).direction==="rtl"&&(o+=Un(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:o,y:l}}function KK(e,t){const r=Kn(e),n=Fs(e),s=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,l=0,c=0;if(s){i=s.width,o=s.height;const d=eC();(!d||d&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:i,height:o,x:l,y:c}}const YK=new Set(["absolute","fixed"]);function XK(e,t){const r=nc(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,i=Rs(e)?Pd(e):Ts(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=s*i.x,d=n*i.y;return{width:o,height:l,x:c,y:d}}function dA(e,t,r){let n;if(t==="viewport")n=KK(e,r);else if(t==="document")n=GK(Fs(e));else if(as(t))n=XK(t,r);else{const s=fD(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Iv(n)}function mD(e,t){const r=Lo(e);return r===t||!as(r)||ru(r)?!1:ss(r).position==="fixed"||mD(r,t)}function QK(e,t){const r=t.get(e);if(r)return r;let n=Yh(e,[],!1).filter(l=>as(l)&&Yu(l)!=="body"),s=null;const i=ss(e).position==="fixed";let o=i?Lo(e):e;for(;as(o)&&!ru(o);){const l=ss(o),c=Z_(o);!c&&l.position==="fixed"&&(s=null),(i?!c&&!s:!c&&l.position==="static"&&!!s&&YK.has(s.position)||sp(o)&&!c&&mD(e,o))?n=n.filter(u=>u!==o):s=l,o=Lo(o)}return t.set(e,n),n}function JK(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const o=[...r==="clippingAncestors"?Ey(t)?[]:QK(t,this._c):[].concat(r),n],l=o[0],c=o.reduce((d,u)=>{const f=dA(t,u,s);return d.top=Un(f.top,d.top),d.right=Do(f.right,d.right),d.bottom=Do(f.bottom,d.bottom),d.left=Un(f.left,d.left),d},dA(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ZK(e){const{width:t,height:r}=uD(e);return{width:t,height:r}}function eY(e,t,r){const n=Rs(t),s=Fs(t),i=r==="fixed",o=nc(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Ts(0);function d(){c.x=rC(s)}if(n||!n&&!i)if((Yu(t)!=="body"||sp(s))&&(l=Oy(t)),n){const m=nc(t,!0,i,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else s&&d();i&&!n&&s&&d();const u=s&&!n&&!i?hD(s,l):Ts(0),f=o.left+l.scrollLeft-c.x-u.x,h=o.top+l.scrollTop-c.y-u.y;return{x:f,y:h,width:o.width,height:o.height}}function Z0(e){return ss(e).position==="static"}function uA(e,t){if(!Rs(e)||ss(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Fs(e)===r&&(r=r.ownerDocument.body),r}function pD(e,t){const r=Kn(e);if(Ey(e))return r;if(!Rs(e)){let s=Lo(e);for(;s&&!ru(s);){if(as(s)&&!Z0(s))return s;s=Lo(s)}return r}let n=uA(e,t);for(;n&&RK(n)&&Z0(n);)n=uA(n,t);return n&&ru(n)&&Z0(n)&&!Z_(n)?r:n||zK(e)||r}const tY=async function(e){const t=this.getOffsetParent||pD,r=this.getDimensions,n=await r(e.floating);return{reference:eY(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function rY(e){return ss(e).direction==="rtl"}const nY={convertOffsetParentRelativeRectToViewportRelativeRect:VK,getDocumentElement:Fs,getClippingRect:JK,getOffsetParent:pD,getElementRects:tY,getClientRects:qK,getDimensions:ZK,getScale:Pd,isElement:as,isRTL:rY};function gD(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function aY(e,t){let r=null,n;const s=Fs(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:f,width:h,height:m}=d;if(l||t(),!h||!m)return;const v=rg(f),p=rg(s.clientWidth-(u+h)),x=rg(s.clientHeight-(f+m)),b=rg(u),w={rootMargin:-v+"px "+-p+"px "+-x+"px "+-b+"px",threshold:Un(0,Do(1,c))||1};let _=!0;function N(j){const S=j[0].intersectionRatio;if(S!==c){if(!_)return o();S?o(!1,S):n=setTimeout(()=>{o(!1,1e-7)},1e3)}S===1&&!gD(d,e.getBoundingClientRect())&&o(),_=!1}try{r=new IntersectionObserver(N,{...w,root:s.ownerDocument})}catch{r=new IntersectionObserver(N,w)}r.observe(e)}return o(!0),i}function sY(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}
vendor: 7,950 bytes, line 516
516=n,d=tC(e),u=s||i?[...d?Yh(d):[],...Yh(t)]:[];u.forEach(b=>{s&&b.addEventListener("scroll",r,{passive:!0}),i&&b.addEventListener("resize",r)});const f=d&&l?aY(d,r):null;let h=-1,m=null;o&&(m=new ResizeObserver(b=>{let[y]=b;y&&y.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),r()}),d&&!c&&m.observe(d),m.observe(t));let v,p=c?nc(e):null;c&&x();function x(){const b=nc(e);p&&!gD(p,b)&&r(),p=b,v=requestAnimationFrame(x)}return r(),()=>{var b;u.forEach(y=>{s&&y.removeEventListener("scroll",r),i&&y.removeEventListener("resize",r)}),f==null||f(),(b=m)==null||b.disconnect(),m=null,c&&cancelAnimationFrame(v)}}const iY=EK,oY=OK,lY=PK,cY=MK,dY=kK,fA=CK,uY=TK,fY=(e,t,r)=>{const n=new Map,s={platform:nY,...r},i={...s.platform,_c:n};return _K(e,t,{...s,platform:i})};var hY=typeof document<"u",mY=function(){},qg=hY?g.useLayoutEffect:mY;function $v(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!$v(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const i=s[n];if(!(i==="_owner"&&e.$$typeof)&&!$v(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function vD(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function hA(e,t){const r=vD(e);return Math.round(t*r)/r}function ew(e){const t=g.useRef(e);return qg(()=>{t.current=e}),t}function pY(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,f]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=g.useState(n);$v(h,n)||m(n);const[v,p]=g.useState(null),[x,b]=g.useState(null),y=g.useCallback(T=>{T!==j.current&&(j.current=T,p(T))},[]),w=g.useCallback(T=>{T!==S.current&&(S.current=T,b(T))},[]),_=i||v,N=o||x,j=g.useRef(null),S=g.useRef(null),C=g.useRef(u),P=c!=null,A=ew(c),D=ew(s),F=ew(d),q=g.useCallback(()=>{if(!j.current||!S.current)return;const T={placement:t,strategy:r,middleware:h};D.current&&(T.platform=D.current),fY(j.current,S.current,T).then(L=>{const K={...L,isPositioned:F.current!==!1};B.current&&!$v(C.current,K)&&(C.current=K,yc.flushSync(()=>{f(K)}))})},[h,t,r,D,F]);qg(()=>{d===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(T=>({...T,isPositioned:!1})))},[d]);const B=g.useRef(!1);qg(()=>(B.current=!0,()=>{B.current=!1}),[]),qg(()=>{if(_&&(j.current=_),N&&(S.current=N),_&&N){if(A.current)return A.current(_,N,q);q()}},[_,N,q,A,P]);const V=g.useMemo(()=>({reference:j,floating:S,setReference:y,setFloating:w}),[y,w]),E=g.useMemo(()=>({reference:_,floating:N}),[_,N]),M=g.useMemo(()=>{const T={position:r,left:0,top:0};if(!E.floating)return T;const L=hA(E.floating,u.x),K=hA(E.floating,u.y);return l?{...T,transform:"translate("+L+"px, "+K+"px)",...vD(E.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:L,top:K}},[r,l,E.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:q,refs:V,elements:E,floatingStyles:M}),[u,q,V,E,M])}const gY=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?fA({element:n.current,padding:s}).fn(r):{}:n?fA({element:n,padding:s}).fn(r):{}}}},vY=(e,t)=>({...iY(e),options:[e,t]}),xY=(e,t)=>({...oY(e),options:[e,t]}),yY=(e,t)=>({...uY(e),options:[e,t]}),bY=(e,t)=>({...lY(e),options:[e,t]}),wY=(e,t)=>({...cY(e),options:[e,t]}),jY=(e,t)=>({...dY(e),options:[e,t]}),NY=(e,t)=>({...gY(e),options:[e,t]});var SY="Arrow",xD=g.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...i}=e;return a.jsx(we.svg,{...i,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});xD.displayName=SY;var _Y=xD;function Ty(e){const[t,r]=g.useState(void 0);return Kt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,l=d.blockSize}else o=e.offsetWidth,l=e.offsetHeight;r({width:o,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var nC="Popper",[yD,Ko]=ir(nC),[CY,bD]=yD(nC),wD=e=>{const{__scopePopper:t,children:r}=e,[n,s]=g.useState(null);return a.jsx(CY,{scope:t,anchor:n,onAnchorChange:s,children:r})};wD.displayName=nC;var jD="PopperAnchor",ND=g.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,i=bD(jD,r),o=g.useRef(null),l=Te(t,o);return g.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:a.jsx(we.div,{...s,ref:l})});ND.displayName=jD;var aC="PopperContent",[PY,kY]=yD(aC),SD=g.forwardRef((e,t)=>{var R,O,k,G,te,$;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:v,...p}=e,x=bD(aC,r),[b,y]=g.useState(null),w=Te(t,ae=>y(ae)),[_,N]=g.useState(null),j=Ty(_),S=(j==null?void 0:j.width)??0,C=(j==null?void 0:j.height)??0,P=n+(i!=="center"?"-"+i:""),A=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(d)?d:[d],F=D.length>0,q={padding:A,boundary:D.filter(EY),altBoundary:F},{refs:B,floatingStyles:V,placement:E,isPositioned:M,middlewareData:T}=pY({strategy:"fixed",placement:P,whileElementsMounted:(...ae)=>sY(...ae,{animationFrame:m==="always"}),elements:{reference:x.anchor},middleware:[vY({mainAxis:s+C,alignmentAxis:o}),c&&xY({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?yY():void 0,...q}),c&&bY({...q}),wY({...q,apply:({elements:ae,rects:oe,availableWidth:z,availableHeight:fe})=>{const{width:ue,height:Ne}=oe.reference,He=ae.floating.style;He.setProperty("--radix-popper-available-width",`${z}px`),He.setProperty("--radix-popper-available-height",`${fe}px`),He.setProperty("--radix-popper-anchor-width",`${ue}px`),He.setProperty("--radix-popper-anchor-height",`${Ne}px`)}}),_&&NY({element:_,padding:l}),OY({arrowWidth:S,arrowHeight:C}),h&&jY({strategy:"referenceHidden",...q})]}),[L,K]=PD(E),H=_t(v);Kt(()=>{M&&(H==null||H())},[M,H]);const ee=(R=T.arrow)==null?void 0:R.x,se=(O=T.arrow)==null?void 0:O.y,ne=((k=T.arrow)==null?void 0:k.centerOffset)!==0,[W,ie]=g.useState();return Kt(()=>{b&&ie(window.getComputedStyle(b).zIndex)},[b]),a.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:M?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[(G=T.transformOrigin)==null?void 0:G.x,(te=T.transformOrigin)==null?void 0:te.y].join(" "),...(($=T.hide)==null?void 0:$.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(PY,{scope:r,placedSide:L,onArrowChange:N,arrowX:ee,arrowY:se,shouldHideArrow:ne,children:a.jsx(we.div,{"data-side":L,"data-align":K,...p,ref:w,style:{...p.style,animation:M?void 0:"none"}})})})});SD.displayName=aC;var _D="PopperArrow",AY={top:"bottom",right:"left",bottom:"top",left:"right"},CD=g.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,i=kY(_D,n),o=AY[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0}
vendor: 4,245 bytes, line 516
516,children:a.jsx(_Y,{...s,ref:r,style:{...s.style,display:"block"}})})});CD.displayName=_D;function EY(e){return e!==null}var OY=e=>({name:"transformOrigin",options:e,fn(t){var x,b,y;const{placement:r,rects:n,middlewareData:s}=t,o=((x=s.arrow)==null?void 0:x.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,u]=PD(r),f={start:"0%",center:"50%",end:"100%"}[u],h=(((b=s.arrow)==null?void 0:b.x)??0)+l/2,m=(((y=s.arrow)==null?void 0:y.y)??0)+c/2;let v="",p="";return d==="bottom"?(v=o?f:`${h}px`,p=`${-c}px`):d==="top"?(v=o?f:`${h}px`,p=`${n.floating.height+c}px`):d==="right"?(v=`${-c}px`,p=o?f:`${m}px`):d==="left"&&(v=`${n.floating.width+c}px`,p=o?f:`${m}px`),{data:{x:v,y:p}}}});function PD(e){const[t,r="center"]=e.split("-");return[t,r]}var My=wD,ip=ND,Iy=SD,$y=CD,[Ry,rRe]=ir("Tooltip",[Ko]),Dy=Ko(),kD="TooltipProvider",TY=700,b1="tooltip.open",[MY,sC]=Ry(kD),AD=e=>{const{__scopeTooltip:t,delayDuration:r=TY,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=e,o=g.useRef(!0),l=g.useRef(!1),c=g.useRef(0);return g.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),a.jsx(MY,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:g.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:g.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})};AD.displayName=kD;var Xh="Tooltip",[IY,Ly]=Ry(Xh),ED=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=sC(Xh,e.__scopeTooltip),d=Dy(t),[u,f]=g.useState(null),h=tn(),m=g.useRef(0),v=o??c.disableHoverableContent,p=l??c.delayDuration,x=g.useRef(!1),[b,y]=vr({prop:n,defaultProp:s??!1,onChange:S=>{S?(c.onOpen(),document.dispatchEvent(new CustomEvent(b1))):c.onClose(),i==null||i(S)},caller:Xh}),w=g.useMemo(()=>b?x.current?"delayed-open":"instant-open":"closed",[b]),_=g.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x.current=!1,y(!0)},[y]),N=g.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),j=g.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{x.current=!0,y(!0),m.current=0},p)},[p,y]);return g.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),a.jsx(My,{...d,children:a.jsx(IY,{scope:t,contentId:h,open:b,stateAttribute:w,trigger:u,onTriggerChange:f,onTriggerEnter:g.useCallback(()=>{c.isOpenDelayedRef.current?j():_()},[c.isOpenDelayedRef,j,_]),onTriggerLeave:g.useCallback(()=>{v?N():(window.clearTimeout(m.current),m.current=0)},[N,v]),onOpen:_,onClose:N,disableHoverableContent:v,children:r})})};ED.displayName=Xh;var w1="TooltipTrigger",OD=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Ly(w1,r),i=sC(w1,r),o=Dy(r),l=g.useRef(null),c=Te(t,l,s.onTriggerChange),d=g.useRef(!1),u=g.useRef(!1),f=g.useCallback(()=>d.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),a.jsx(ip,{asChild:!0,...o,children:a.jsx(we.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:pe(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:pe(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:pe(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:pe(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:pe(e.onBlur,s.onClose),onClick:pe(e.onClick,s.onClose)})})});OD.displayName=w1;var $Y="TooltipPortal",[nRe,RY]=Ry($Y,{forceMount:void 0}),nu="TooltipContent",TD=g.forwardRef((e,t)=>{const r=RY(nu,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...i}=e,o=Ly(nu,e.__scopeTooltip);return a.jsx(Zt,{present:n||o.open,children:o.disableHoverableContent?a.jsx(MD,{side:s,...i,ref:t}):a.jsx(DY,{side:s,...i,ref:t})})}),DY=g.forwardRef((e,t)=>{const r=Ly(nu,e.__scopeTooltip),n=sC(nu,e.__scopeTooltip),s=g.useRef(null),i=Te(t,s),[o,l]=g.useState(null),{trigger:c,onClose:d}=r,u=s.current,{onPointerInTransitChange:f}=n,h=g.useCallback(()=>
vendor: 4,196 bytes, line 516
516{l(null),f(!1)},[f]),m=g.useCallback((v,p)=>{const x=v.currentTarget,b={x:v.clientX,y:v.clientY},y=UY(b,x.getBoundingClientRect()),w=WY(b,y),_=HY(p.getBoundingClientRect()),N=qY([...w,..._]);l(N),f(!0)},[f]);return g.useEffect(()=>()=>h(),[h]),g.useEffect(()=>{if(c&&u){const v=x=>m(x,u),p=x=>m(x,c);return c.addEventListener("pointerleave",v),u.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",p)}}},[c,u,m,h]),g.useEffect(()=>{if(o){const v=p=>{const x=p.target,b={x:p.clientX,y:p.clientY},y=(c==null?void 0:c.contains(x))||(u==null?void 0:u.contains(x)),w=!VY(b,o);y?h():w&&(h(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,u,o,d,h]),a.jsx(MD,{...e,ref:i})}),[LY,FY]=Ry(Xh,{isInside:!1}),BY=xR("TooltipContent"),MD=g.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=Ly(nu,r),d=Dy(r),{onClose:u}=c;return g.useEffect(()=>(document.addEventListener(b1,u),()=>document.removeEventListener(b1,u)),[u]),g.useEffect(()=>{if(c.trigger){const f=h=>{const m=h.target;m!=null&&m.contains(c.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,u]),a.jsx(qo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:a.jsxs(Iy,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(BY,{children:n}),a.jsx(LY,{scope:r,isInside:!0,children:a.jsx(NR,{id:c.contentId,role:"tooltip",children:s||n})})]})})});TD.displayName=nu;var ID="TooltipArrow",zY=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Dy(r);return FY(ID,r).isInside?null:a.jsx($y,{...s,...n,ref:t})});zY.displayName=ID;function UY(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,s,i)){case i:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function WY(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function HY(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function VY(e,t){const{x:r,y:n}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],d=l.x,u=l.y,f=c.x,h=c.y;u>n!=h>n&&r<(f-d)*(n-u)/(h-u)+d&&(s=!s)}return s}function qY(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),GY(t)}function GY(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var KY=AD,YY=ED,XY=OD,$D=TD;const iC=KY,RD=YY,DD=XY,oC=g.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx($D,{ref:n,sideOffset:t,className:me("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
516de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));oC.displayName=$D.displayName;var Xu=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(){}},ac=typeof window>"u"||"Deno"in globalThis;function dn(){}function QY(e,t){return typeof e=="function"?e(t):e}function j1(e){return typeof e=="number"&&e>=0&&e!==1/0}function LD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Po(e,t){return typeof e=="function"?e(t):e}function da(e,t){return typeof e=="function"?e(t):e}function mA(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:l}=e;if(o){if(n){if(t.queryHash!==lC(o,t.options))return!1}else if(!Qh(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||i&&!i(t))}function pA(e,t){const{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(sc(t.options.mutationKey)!==sc(i))return!1}else if(!Qh(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function lC(e,t){return((t==null?void 0:t.queryKeyHashFn)||sc)(e)}function sc(e){return JSON.stringify(e,(t,r)=>N1(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Qh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Qh(e[r],t[r])):!1}function FD(e,t){if(e===t)return e;const r=gA(e)&&gA(t);if(r||N1(e)&&N1(t)){const n=r?e:Object.keys(e),s=n.length,i=r?t:Object.keys(t),o=i.length,l=r?[]:{},c=new Set(n);let d=0;for(let u=0;u<o;u++){const f=r?u:i[u];(!r&&c.has(f)||r)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,d++):(l[f]=FD(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&d++)}return s===o&&d===s?e:l}return t}function Rv(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function gA(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function N1(e){if(!vA(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!vA(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function vA(e){return Object.prototype.toString.call(e)==="[object Object]"}function JY(e){return new Promise(t=>{setTimeout(t,e)})}function S1(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?FD(e,t):t}function ZY(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function eX(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var cC=Symbol();function BD(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===cC?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function zD(e,t){return typeof e=="function"?e(...t):!!e}var Dl,ro,Id,BI,tX=(BI=class extends Xu{constructor(){super();$e(this,Dl);$e(this,ro);$e(this,Id);Se(this,Id,t=>{if(!ac&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){X(this,ro)||this.setEventListener(X(this,Id))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,ro))==null||t.call(this),Se(this,ro,void 0))}setEventListener(t){var r;Se(this,Id,t),(r=X(this,ro))==null||r.call(this),Se(this,ro,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){X(this,Dl)!==t&&(Se(this,Dl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof X(this,Dl)=="boolean"?X(this,Dl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Dl=new WeakMap,ro=new WeakMap,Id=new WeakMap,BI),dC=new tX,$d,no,Rd,zI,rX=(zI=class extends Xu{constructor(){super();$e(this,$d,!0);$e(this,no);$e(this,Rd);Se(this,Rd,t=>{if(!ac&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n
vendor: 4,353 bytes, line 516
516)}}})}onSubscribe(){X(this,no)||this.setEventListener(X(this,Rd))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,no))==null||t.call(this),Se(this,no,void 0))}setEventListener(t){var r;Se(this,Rd,t),(r=X(this,no))==null||r.call(this),Se(this,no,t(this.setOnline.bind(this)))}setOnline(t){X(this,$d)!==t&&(Se(this,$d,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return X(this,$d)}},$d=new WeakMap,no=new WeakMap,Rd=new WeakMap,zI),Dv=new rX;function _1(){let e,t;const r=new Promise((s,i)=>{e=s,t=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}function nX(e){return Math.min(1e3*2**e,3e4)}function UD(e){return(e??"online")==="online"?Dv.isOnline():!0}var WD=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function tw(e){return e instanceof WD}function HD(e){let t=!1,r=0,n=!1,s;const i=_1(),o=p=>{var x;n||(h(new WD(p)),(x=e.abort)==null||x.call(e))},l=()=>{t=!0},c=()=>{t=!1},d=()=>dC.isFocused()&&(e.networkMode==="always"||Dv.isOnline())&&e.canRun(),u=()=>UD(e.networkMode)&&e.canRun(),f=p=>{var x;n||(n=!0,(x=e.onSuccess)==null||x.call(e,p),s==null||s(),i.resolve(p))},h=p=>{var x;n||(n=!0,(x=e.onError)==null||x.call(e,p),s==null||s(),i.reject(p))},m=()=>new Promise(p=>{var x;s=b=>{(n||d())&&p(b)},(x=e.onPause)==null||x.call(e)}).then(()=>{var p;s=void 0,n||(p=e.onContinue)==null||p.call(e)}),v=()=>{if(n)return;let p;const x=r===0?e.initialPromise:void 0;try{p=x??e.fn()}catch(b){p=Promise.reject(b)}Promise.resolve(p).then(f).catch(b=>{var j;if(n)return;const y=e.retry??(ac?0:3),w=e.retryDelay??nX,_=typeof w=="function"?w(r,b):w,N=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,b);if(t||!N){h(b);return}r++,(j=e.onFail)==null||j.call(e,r,b),JY(_).then(()=>d()?void 0:m()).then(()=>{t?h(b):v()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:l,continueRetry:c,canStart:u,start:()=>(u()?v():m().then(v),i)}}var aX=e=>setTimeout(e,0);function sX(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=aX;const i=l=>{t?e.push(l):s(()=>{r(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var jr=sX(),Ll,UI,VD=(UI=class{constructor(){$e(this,Ll)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),j1(this.gcTime)&&Se(this,Ll,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ac?1/0:5*60*1e3))}clearGcTimeout(){X(this,Ll)&&(clearTimeout(X(this,Ll)),Se(this,Ll,void 0))}},Ll=new WeakMap,UI),Dd,Fl,ca,Bl,Xr,qm,zl,Ba,Ks,WI,iX=(WI=class extends VD{constructor(t){super();$e(this,Ba);$e(this,Dd);$e(this,Fl);$e(this,ca);$e(this,Bl);$e(this,Xr);$e(this,qm);$e(this,zl);Se(this,zl,!1),Se(this,qm,t.defaultOptions),this.setOptions(t.options),this.observers=[],Se(this,Bl,t.client),Se(this,ca,X(this,Bl).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Se(this,Dd,oX(this.options)),this.state=t.state??X(this,Dd),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=X(this,Xr))==null?void 0:t.promise}setOptions(t){this.options={...X(this,qm),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&X(this,ca).remove(this)}setData(t,r){const n=S1(this.state.data,t,this.options);return et(this,Ba,Ks).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){et(this,Ba,Ks).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=X(this,Xr))==null?void 0:n.promise;return(s=X(this,Xr))==null||s.cancel(t),r?r.then(dn).catch(dn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(X(this,Dd))}isActive(){return this.observers.some(t=>da(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===cC||this.state.dataUpdateCount+this.state.errorUpdate
516Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Po(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!LD(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=X(this,Xr))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=X(this,Xr))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),X(this,ca).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(X(this,Xr)&&(X(this,zl)?X(this,Xr).cancel({revert:!0}):X(this,Xr).cancelRetry()),this.scheduleGc()),X(this,ca).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||et(this,Ba,Ks).call(this,{type:"invalidate"})}fetch(t,r){var d,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(X(this,Xr))return X(this,Xr).continueRetry(),X(this,Xr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(m=>m.options.queryFn);h&&this.setOptions(h.options)}const n=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(Se(this,zl,!0),n.signal)})},i=()=>{const h=BD(this.options,r),v=(()=>{const p={client:X(this,Bl),queryKey:this.queryKey,meta:this.meta};return s(p),p})();return Se(this,zl,!1),this.options.persister?this.options.persister(h,v,this):h(v)},l=(()=>{const h={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:X(this,Bl),state:this.state,fetchFn:i};return s(h),h})();(d=this.options.behavior)==null||d.onFetch(l,this),Se(this,Fl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=l.fetchOptions)==null?void 0:u.meta))&&et(this,Ba,Ks).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const c=h=>{var m,v,p,x;tw(h)&&h.silent||et(this,Ba,Ks).call(this,{type:"error",error:h}),tw(h)||((v=(m=X(this,ca).config).onError)==null||v.call(m,h,this),(x=(p=X(this,ca).config).onSettled)==null||x.call(p,this.state.data,h,this)),this.scheduleGc()};return Se(this,Xr,HD({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,abort:n.abort.bind(n),onSuccess:h=>{var m,v,p,x;if(h===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(b){c(b);return}(v=(m=X(this,ca).config).onSuccess)==null||v.call(m,h,this),(x=(p=X(this,ca).config).onSettled)==null||x.call(p,h,this.state.error,this),this.scheduleGc()},onError:c,onFail:(h,m)=>{et(this,Ba,Ks).call(this,{type:"failed",failureCount:h,error:m})},onPause:()=>{et(this,Ba,Ks).call(this,{type:"pause"})},onContinue:()=>{et(this,Ba,Ks).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),X(this,Xr).start()}},Dd=new WeakMap,Fl=new WeakMap,ca=new WeakMap,Bl=new WeakMap,Xr=new WeakMap,qm=new WeakMap,zl=new WeakMap,Ba=new WeakSet,Ks=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...qD(n.data,this.options),fetchMeta:t.meta??null};case"success":return Se(this,Fl,void 0),{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return tw(s)&&s.revert&&X(this,Fl)?{...X(this,Fl),fetchStatus:"idle"}
vendor: 5,105 bytes, line 516
516:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),jr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),X(this,ca).notify({query:this,type:"updated",action:t})})},WI);function qD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:UD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function oX(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var xs,HI,lX=(HI=class extends Xu{constructor(t={}){super();$e(this,xs);this.config=t,Se(this,xs,new Map)}build(t,r,n){const s=r.queryKey,i=r.queryHash??lC(s,r);let o=this.get(i);return o||(o=new iX({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){X(this,xs).has(t.queryHash)||(X(this,xs).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=X(this,xs).get(t.queryHash);r&&(t.destroy(),r===t&&X(this,xs).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){jr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return X(this,xs).get(t)}getAll(){return[...X(this,xs).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>mA(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>mA(t,n)):r}notify(t){jr.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){jr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){jr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},xs=new WeakMap,HI),ys,on,Ul,bs,Hi,VI,cX=(VI=class extends VD{constructor(t){super();$e(this,bs);$e(this,ys);$e(this,on);$e(this,Ul);this.mutationId=t.mutationId,Se(this,on,t.mutationCache),Se(this,ys,[]),this.state=t.state||GD(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){X(this,ys).includes(t)||(X(this,ys).push(t),this.clearGcTimeout(),X(this,on).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Se(this,ys,X(this,ys).filter(r=>r!==t)),this.scheduleGc(),X(this,on).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){X(this,ys).length||(this.state.status==="pending"?this.scheduleGc():X(this,on).remove(this))}continue(){var t;return((t=X(this,Ul))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,l,c,d,u,f,h,m,v,p,x,b,y,w,_,N,j,S,C;const r=()=>{et(this,bs,Hi).call(this,{type:"continue"})};Se(this,Ul,HD({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,A)=>{et(this,bs,Hi).call(this,{type:"failed",failureCount:P,error:A})},onPause:()=>{et(this,bs,Hi).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>X(this,on).canRun(this)}));const n=this.state.status==="pending",s=!X(this,Ul).canStart();try{if(n)r();else{et(this,bs,Hi).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(i=X(this,on).config).onMutate)==null?void 0:o.call(i,t,this));const A=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));A!==this.state.context&&et(this,bs,Hi).call(this,{type:"pending",context:A,variables:t,isPaused:s})}const P=await X(this,Ul).start();return await((u=(d=X(this,on).config).onSuccess)==null?void 0:u.call(d,P,t,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,P,t,this.state.context)),await((v=(m=X(this,on).config).onSettled)==null?void 0:v.call(m,P,null,this.state.variables,this.state.context,this)),await((x=(p=this.options).onSettled)==null?void 0:x.call(p,P,null,t,this.state.context)),et(this,bs,Hi).call(this,{type:"success",data:P}),P}catch(P){try{throw await((y=(b=X(this,on).config).onError)==null?void 0:y.call(b,P,t,this.state.context,this)),await((_=(w=this.options).onError)==null?void 0:_.call(w,P,t,this.state.context)),await((j=(N=X(this,on).config).onSettled)==null?void 0:j.call(N,void 0,P,this.state.variables,this.state.context,this)),await((C=(S=this.options).onSettled)==null?void 0:C.call(S,void 0,P,t,this.state.context)),P}finally{et(this,bs,Hi).call(this,{type:"error",error:P})}}finally{X(this,on).runNext(this)}}},ys=new WeakMap,on=new WeakMap,Ul=new WeakMap,bs=new WeakSet,Hi=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};
516case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),jr.batch(()=>{X(this,ys).forEach(n=>{n.onMutationUpdate(t)}),X(this,on).notify({mutation:this,type:"updated",action:t})})},VI);function GD(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ti,za,Gm,qI,dX=(qI=class extends Xu{constructor(t={}){super();$e(this,ti);$e(this,za);$e(this,Gm);this.config=t,Se(this,ti,new Set),Se(this,za,new Map),Se(this,Gm,0)}build(t,r,n){const s=new cX({mutationCache:this,mutationId:++Ip(this,Gm)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){X(this,ti).add(t);const r=ng(t);if(typeof r=="string"){const n=X(this,za).get(r);n?n.push(t):X(this,za).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(X(this,ti).delete(t)){const r=ng(t);if(typeof r=="string"){const n=X(this,za).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&X(this,za).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=ng(t);if(typeof r=="string"){const n=X(this,za).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=ng(t);if(typeof r=="string"){const s=(n=X(this,za).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){jr.batch(()=>{X(this,ti).forEach(t=>{this.notify({type:"removed",mutation:t})}),X(this,ti).clear(),X(this,za).clear()})}getAll(){return Array.from(X(this,ti))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>pA(r,n))}findAll(t={}){return this.getAll().filter(r=>pA(t,r))}notify(t){jr.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>
vendor: 9,290 bytes, line 516
516r.state.isPaused);return jr.batch(()=>Promise.all(t.map(r=>r.continue().catch(dn))))}},ti=new WeakMap,za=new WeakMap,Gm=new WeakMap,qI);function ng(e){var t;return(t=e.options.scope)==null?void 0:t.id}function xA(e){return{onFetch:(t,r)=>{var u,f,h,m,v;const n=t.options,s=(h=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,i=((m=t.state.data)==null?void 0:m.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let p=!1;const x=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},b=BD(t.options,t.fetchOptions),y=async(w,_,N)=>{if(p)return Promise.reject();if(_==null&&w.pages.length)return Promise.resolve(w);const S=(()=>{const D={client:t.client,queryKey:t.queryKey,pageParam:_,direction:N?"backward":"forward",meta:t.options.meta};return x(D),D})(),C=await b(S),{maxPages:P}=t.options,A=N?eX:ZY;return{pages:A(w.pages,C,P),pageParams:A(w.pageParams,_,P)}};if(s&&i.length){const w=s==="backward",_=w?uX:yA,N={pages:i,pageParams:o},j=_(n,N);l=await y(N,j,w)}else{const w=e??i.length;do{const _=c===0?o[0]??n.initialPageParam:yA(n,l);if(c>0&&_==null)break;l=await y(l,_),c++}while(c<w)}return l};t.options.persister?t.fetchFn=()=>{var p,x;return(x=(p=t.options).persister)==null?void 0:x.call(p,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function yA(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function uX(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var or,ao,so,Ld,Fd,io,Bd,zd,GI,fX=(GI=class{constructor(e={}){$e(this,or);$e(this,ao);$e(this,so);$e(this,Ld);$e(this,Fd);$e(this,io);$e(this,Bd);$e(this,zd);Se(this,or,e.queryCache||new lX),Se(this,ao,e.mutationCache||new dX),Se(this,so,e.defaultOptions||{}),Se(this,Ld,new Map),Se(this,Fd,new Map),Se(this,io,0)}mount(){Ip(this,io)._++,X(this,io)===1&&(Se(this,Bd,dC.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,or).onFocus())})),Se(this,zd,Dv.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,or).onOnline())})))}unmount(){var e,t;Ip(this,io)._--,X(this,io)===0&&((e=X(this,Bd))==null||e.call(this),Se(this,Bd,void 0),(t=X(this,zd))==null||t.call(this),Se(this,zd,void 0))}isFetching(e){return X(this,or).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return X(this,ao).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=X(this,or).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=X(this,or).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Po(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return X(this,or).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=X(this,or).get(n.queryHash),i=s==null?void 0:s.state.data,o=QY(t,i);if(o!==void 0)return X(this,or).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return jr.batch(()=>X(this,or).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=X(this,or).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=X(this,or);jr.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=X(this,or);return jr.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=jr.batch(()=>X(this,or).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(dn).catch(dn)}invalidateQueries(e,t={}){return jr.batch(()=>(X(this,or).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=jr.batch(()=>X(this,or).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(dn)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(dn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=X(this,or).build(this,t);return r.isStaleByTime(Po(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(dn).catch(dn)}fetchInfiniteQuery(e){return e.behavior=xA(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(dn).catch(dn)}ensureInfiniteQueryData(e){return e.behavior=xA(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Dv.isOnline()?X(this,ao).resumePausedMutations():Promise.resolve()}getQueryCache(){return X(this,or)}getMutationCache(){return X(this,ao)}getDefaultOptions(){return X(this,so)}setDefaultOptions(e){Se(this,so,e)}setQueryDefaults(e,t){X(this,Ld).set(sc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...X(this,Ld).values()],r={};return t.forEach(n=>{Qh(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){X(this,Fd).set(sc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...X(this,Fd).values()],r={};return t.forEach(n=>{Qh(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...X(this,so).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=lC(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===cC&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...X(this,so).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){X(this,or).clear(),X(this,ao).clear()}},or=new WeakMap,ao=new WeakMap,so=new WeakMap,Ld=new WeakMap,Fd=new WeakMap,io=new WeakMap,Bd=new WeakMap,zd=new WeakMap,GI),Sn,ot,Km,ln,Wl,Ud,oo,lo,Ym,Wd,Hd,Hl,Vl,co,Vd,wt,Xf,C1,P1,k1,A1,E1,O1,T1,KD,KI,hX=(KI=class extends Xu{constructor(t,r){super();$e(this,wt);$e(this,Sn);$e(this,ot);$e(this,Km);$e(this,ln);$e(this,Wl);$e(this,Ud);$e(this,oo);$e(this,lo);$e(this,Ym);$e(this,Wd);$e(this,Hd);$e(this,Hl);$e(this,Vl);$e(this,co);$e(this,Vd,new Set);this.options=r,Se(this,Sn,t),Se(this,lo,null),Se(this,oo,_1()),this.options.experimental_prefetchInRender||X(this,oo).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(X(this,ot).addObserver(this),bA(X(this,ot),this.options)?et(this,wt,Xf).call(this):this.updateResult(),et(this,wt,A1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return M1(X(this,ot),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return M1(X(this,ot),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,et(this,wt,E1).call(this),et(this,wt,O1).call(this),X(this,ot).removeObserver(this)}setOptions(t){const r=this.options,n=X(this,ot);if(this.options=X(this,Sn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof da(this.options.enabled,X(this,ot))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");et(this,wt,T1).call(this),X(this,ot).setOptions(this.options),r._defaulted&&!Rv(this.options,r)&&X(this,Sn).getQueryCache().notify({type:"observerOptionsUpdated",query:X(this,ot),observer:this});const s=this.hasListeners();s&&wA(X(this,ot),n,this.options,r)&&et(this,wt,Xf).call(this),this.updateResult(),s&&(X(this,ot)!==n||da(this.options.enabled,X(this,ot))!==da(r.enabled,X(this,ot))||Po(this.options.staleTime,X(this,ot))!==Po(r.staleTime,X(this,ot)))&&et(this,wt,C1).call(this);const i=et(this,wt,P1).call(this);s&&(X(this,ot)!==n||da(this.options.enabled,X(this,ot))!==da(r.enabled,X(this,ot))||i!==X(this,co))&&et(this,wt,k1).call(this,i)}getOptimisticResult(t){const r=X(this,Sn).getQueryCache().build(X(this,Sn),t),n=this.createResult(r,t);return pX(this,n)&&(Se(this,ln,n),Se(this,Ud,this.options),Se(this,Wl,X(this,ot).state)),n}getCurrentResult(){return X(this,ln)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),Reflect.get(n,s))})}trackProp(t){X(this,Vd).add(t)}getCurrentQuery(){return X(this,ot)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=X(this,Sn).defaultQueryOptions(t),n=X(this,Sn).getQueryCache().build(X(this,Sn),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return et(this,wt,Xf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),X(this,ln)))}createResult(t,r){var P;
vendor: 2,385 bytes, line 516
516const n=X(this,ot),s=this.options,i=X(this,ln),o=X(this,Wl),l=X(this,Ud),d=t!==n?t.state:X(this,Km),{state:u}=t;let f={...u},h=!1,m;if(r._optimisticResults){const A=this.hasListeners(),D=!A&&bA(t,r),F=A&&wA(t,n,r,s);(D||F)&&(f={...f,...qD(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:p,status:x}=f;m=f.data;let b=!1;if(r.placeholderData!==void 0&&m===void 0&&x==="pending"){let A;i!=null&&i.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(A=i.data,b=!0):A=typeof r.placeholderData=="function"?r.placeholderData((P=X(this,Hd))==null?void 0:P.state.data,X(this,Hd)):r.placeholderData,A!==void 0&&(x="success",m=S1(i==null?void 0:i.data,A,r),h=!0)}if(r.select&&m!==void 0&&!b)if(i&&m===(o==null?void 0:o.data)&&r.select===X(this,Ym))m=X(this,Wd);else try{Se(this,Ym,r.select),m=r.select(m),m=S1(i==null?void 0:i.data,m,r),Se(this,Wd,m),Se(this,lo,null)}catch(A){Se(this,lo,A)}X(this,lo)&&(v=X(this,lo),m=X(this,Wd),p=Date.now(),x="error");const y=f.fetchStatus==="fetching",w=x==="pending",_=x==="error",N=w&&y,j=m!==void 0,C={status:x,fetchStatus:f.fetchStatus,isPending:w,isSuccess:x==="success",isError:_,isInitialLoading:N,isLoading:N,data:m,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:y,isRefetching:y&&!w,isLoadingError:_&&!j,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:_&&j,isStale:uC(t,r),refetch:this.refetch,promise:X(this,oo),isEnabled:da(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const A=q=>{C.status==="error"?q.reject(C.error):C.data!==void 0&&q.resolve(C.data)},D=()=>{const q=Se(this,oo,C.promise=_1());A(q)},F=X(this,oo);switch(F.status){case"pending":t.queryHash===n.queryHash&&A(F);break;case"fulfilled":(C.status==="error"||C.data!==F.value)&&D();break;case"rejected":(C.status!=="error"||C.error!==F.reason)&&D();break}}return C}updateResult(){const t=X(this,ln),r=this.createResult(X(this,ot),this.options);if(Se(this,Wl,X(this,ot).state),Se(this,Ud,this.options),X(this,Wl).data!==void 0&&Se(this,Hd,X(this,ot)),Rv(r,t))return;Se(this,ln,r);const n=()=>
vendor: 4,713 bytes, line 516
516{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!X(this,Vd).size)return!0;const o=new Set(i??X(this,Vd));return this.options.throwOnError&&o.add("error"),Object.keys(X(this,ln)).some(l=>{const c=l;return X(this,ln)[c]!==t[c]&&o.has(c)})};et(this,wt,KD).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&et(this,wt,A1).call(this)}},Sn=new WeakMap,ot=new WeakMap,Km=new WeakMap,ln=new WeakMap,Wl=new WeakMap,Ud=new WeakMap,oo=new WeakMap,lo=new WeakMap,Ym=new WeakMap,Wd=new WeakMap,Hd=new WeakMap,Hl=new WeakMap,Vl=new WeakMap,co=new WeakMap,Vd=new WeakMap,wt=new WeakSet,Xf=function(t){et(this,wt,T1).call(this);let r=X(this,ot).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(dn)),r},C1=function(){et(this,wt,E1).call(this);const t=Po(this.options.staleTime,X(this,ot));if(ac||X(this,ln).isStale||!j1(t))return;const n=LD(X(this,ln).dataUpdatedAt,t)+1;Se(this,Hl,setTimeout(()=>{X(this,ln).isStale||this.updateResult()},n))},P1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(X(this,ot)):this.options.refetchInterval)??!1},k1=function(t){et(this,wt,O1).call(this),Se(this,co,t),!(ac||da(this.options.enabled,X(this,ot))===!1||!j1(X(this,co))||X(this,co)===0)&&Se(this,Vl,setInterval(()=>{(this.options.refetchIntervalInBackground||dC.isFocused())&&et(this,wt,Xf).call(this)},X(this,co)))},A1=function(){et(this,wt,C1).call(this),et(this,wt,k1).call(this,et(this,wt,P1).call(this))},E1=function(){X(this,Hl)&&(clearTimeout(X(this,Hl)),Se(this,Hl,void 0))},O1=function(){X(this,Vl)&&(clearInterval(X(this,Vl)),Se(this,Vl,void 0))},T1=function(){const t=X(this,Sn).getQueryCache().build(X(this,Sn),this.options);if(t===X(this,ot))return;const r=X(this,ot);Se(this,ot,t),Se(this,Km,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},KD=function(t){jr.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(X(this,ln))}),X(this,Sn).getQueryCache().notify({query:X(this,ot),type:"observerResultsUpdated"})})},KI);function mX(e,t){return da(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function bA(e,t){return mX(e,t)||e.state.data!==void 0&&M1(e,t,t.refetchOnMount)}function M1(e,t,r){if(da(t.enabled,e)!==!1&&Po(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&uC(e,t)}return!1}function wA(e,t,r,n){return(e!==t||da(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&uC(e,r)}function uC(e,t){return da(t.enabled,e)!==!1&&e.isStaleByTime(Po(t.staleTime,e))}function pX(e,t){return!Rv(e.getCurrentResult(),t)}var uo,fo,_n,ri,hi,Gg,I1,YI,gX=(YI=class extends Xu{constructor(r,n){super();$e(this,hi);$e(this,uo);$e(this,fo);$e(this,_n);$e(this,ri);Se(this,uo,r),this.setOptions(n),this.bindMethods(),et(this,hi,Gg).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const n=this.options;this.options=X(this,uo).defaultMutationOptions(r),Rv(this.options,n)||X(this,uo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:X(this,_n),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&sc(n.mutationKey)!==sc(this.options.mutationKey)?this.reset():((s=X(this,_n))==null?void 0:s.state.status)==="pending"&&X(this,_n).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=X(this,_n))==null||r.removeObserver(this)}onMutationUpdate(r){et(this,hi,Gg).call(this),et(this,hi,I1).call(this,r)}getCurrentResult(){return X(this,fo)}reset(){var r;(r=X(this,_n))==null||r.removeObserver(this),Se(this,_n,void 0),et(this,hi,Gg).call(this),et(this,hi,I1).call(this)}mutate(r,n){var s;return Se(this,ri,n),(s=X(this,_n))==null||s.removeObserver(this),Se(this,_n,X(this,uo).getMutationCache().build(X(this,uo),this.options)),X(this,_n).addObserver(this),X(this,_n).execute(r)}},uo=new WeakMap,fo=new WeakMap,_n=new WeakMap,ri=new WeakMap,hi=new WeakSet,Gg=function(){var n;const r=((n=X(this,_n))==null?void 0:n.state)??GD();Se(this,fo,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},I1=function(r){jr.batch(()=>{var n,s,i,o,l,c,d,u;if(X(this,ri)&&this.hasListeners()){const f=X(this,fo).variables,h=X(this,fo).context;(r==null?void 0:r.type)==="success"?((s=(n=X(this,ri)).onSuccess)==null||s.call(n,r.data,f,h),(o=(i=X(this,ri)).onSettled)==null||o.call(i,r.data,null,f,h)):(r==null?void 0:r.type)==="error"&&((c=(l=X(this,ri)).onError)==null||c.call(l,r.error,f,h),(u=(d=X(this,ri)).onSettled)==null||u.call(d,void 0,r.error,f,h))}
516this.listeners.forEach(f=>{f(X(this,fo))})})},YI),YD=g.createContext(void 0),Fy=e=>{const t=g.useContext(YD);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},vX=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(YD.Provider,{value:e,children:t})),XD=g.createContext(!1),xX=()=>g.useContext(XD);XD.Provider;function yX(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var bX=g.createContext(yX()),wX=()=>g.useContext(bX),jX=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},NX=e=>{g.useEffect(()=>{e.clearReset()},[e])},SX=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||zD(r,[e.error,n])),_X=e=>{if(e.suspense){const t=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>t(r(...n)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},CX=(e,t)=>e.isLoading&&e.isFetching&&!t,PX=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,jA=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function kX(e,t,r){var f,h,m,v,p;const n=xX(),s=wX(),i=Fy(),o=i.defaultQueryOptions(e);(h=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||h.call(f,o),o._optimisticResults=n?"isRestoring":"optimistic",_X(o),jX(o,s),NX(s);const l=!i.getQueryCache().get(o.queryHash),[c]=g.useState(()=>new t(i,o)),d=c.getOptimisticResult(o),u=!n&&e.subscribed!==!1;if(g.useSyncExternalStore(g.useCallback(x=>{const b=u?c.subscribe(jr.batchCalls(x)):dn;return c.updateResult(),b},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),g.useEffect(()=>{c.setOptions(o)},[o,c]),PX(o,d))throw jA(o,c,s);if(SX({result:d,errorResetBoundary:s,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw d.error;if((v=(m=i.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||v.call(m,o,d),o.experimental_prefetchInRender&&!ac&&CX(d,n)){const x=l?jA(o,c,s):(p=i.getQueryCache().get(o.queryHash))==null?void 0:p.promise;x==null||x.catch(dn).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?d:c.trackResult(d)}function ic(e,t){return kX(e,hX)}function ag(e,t){const r=Fy(),[n]=g.useState(()=>new gX(r,e));g.useEffect(()=>{n.setOptions(e)},[n,e]);const s=g.useSyncExternalStore(g.useCallback(o=>n.subscribe(jr.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=g.useCallback((o,l)=>{n.mutate(o,l).catch(dn)},[n]);if(s.error&&zD(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}/** 517 * @remix-run/router v1.23.0 518 * 519 * Copyright (c) Remix Software Inc. 520 * 521 * This source code is licensed under the MIT license found in the 522 * LICENSE.md file in the root directory of this source tree. 523 * 524 * @license MIT 525 */function Jh(){return Jh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jh.apply(this,arguments)}var po;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(po||(po={}));const NA="popstate";function AX(e){e===void 0&&(e={});function t(n,s){let{pathname:i,search:o,hash:l}=n.location;return $1("",{pathname:i,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(n,s){return typeof s=="string"?s:Lv(s)}return OX(t,r,null,e)}function ar(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function QD(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function EX(){return Math.random().toString(36).substr(2,8)}function SA(e,t){return{usr:e.state,key:e.key,idx:t}}function $1(e,t,r,n){return r===void 0&&(r=null),Jh({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Qu(t):t,{state:r,key:t&&t.key||n||EX()})}function Lv(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Qu(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function OX(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:i=!1}=n,o=s.history,l=po.Pop,c=null,d=u();d==null&&(d=0,o.replaceState(Jh({},o.state,{idx:d}),""));function u(){return(o.state||{idx:null}).idx}function f(){l=po.Pop;let x=u(),b=x==null?null:x-d;d=x,c&&c({action:l,location:p.location,delta:b})}function h(x,b){l=po.Push;let y=$1(p.location,x,b);d=u()+1;let w=SA(y,d),_=p.createHref(y);try{o.pushState(w,"",_)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;s.location.assign(_)}i&&c&&c({action:l,location:p.location,delta:1})}function m(x,b){l=po.Replace;let y=$1(p.location,x,b);d=u();let w=SA(y,d),_=p.createHref(y);o.replaceState(w,"",_),i&&c&&c({action:l,location:p.location,delta:0})}function v(x){let b=s.location.origin!=="null"?s.location.origin:s.location.href,y=typeof x=="str
525ing"?x:Lv(x);return y=y.replace(/ $/,"%20"),ar(b,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,b)}let p={get action(){return l},get location(){return e(s,o)},listen(x){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(NA,f),c=x,()=>{s.removeEventListener(NA,f),c=null}},createHref(x){return t(s,x)},createURL:v,encodeLocation(x){let b=v(x);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:m,go(x){return o.go(x)}};return p}var _A;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(_A||(_A={}));function TX(e,t,r){return r===void 0&&(r="/"),MX(e,t,r,!1)}function MX(e,t,r,n){let s=typeof t=="string"?Qu(t):t,i=au(s.pathname||"/",r);if(i==null)return null;let o=JD(e);IX(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=VX(i);l=WX(o[c],d,n)}return l}function JD(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let s=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(ar(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let d=ko([n,c.relativePath]),u=r.concat(c);i.children&&i.children.length>0&&(ar(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),JD(i.children,t,u,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:zX(d,i.index),routesMeta:u})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))s(i,o);else for(let c of ZD(i.path))s(i,o,c)}),t}function ZD(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return s?[i,""]:[i];let o=ZD(n.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function IX(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:UX(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const $X=/^:[\w-]+$/,RX=3,DX=2,LX=1,FX=10,BX=-2,CA=e=>e==="*";function zX(e,t){let r=e.split("/"),n=r.length;return r.some(CA)&&(n+=BX),t&&(n+=DX),r.filter(s=>!CA(s)).reduce((s,i)=>s+($X.test(i)?RX:i===""?LX:FX),n)}function UX(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function WX(e,t,r){let{routesMeta:n}=e,s={},i="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],d=l===n.length-1,u=i==="/"?t:t.slice(i.length)||"/",f=Fv({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},u),h=c.route;if(!f&&d&&r&&!n[n.length-1].route.index&&(f=Fv({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!f)return null;
vendor: 9,495 bytes, lines 525-534
525Object.assign(s,f.params),o.push({params:s,pathname:ko([i,f.pathname]),pathnameBase:YX(ko([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=ko([i,f.pathnameBase]))}return o}function Fv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=HX(e.path,e.caseSensitive,e.end),s=t.match(r);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:n.reduce((d,u,f)=>{let{paramName:h,isOptional:m}=u;if(h==="*"){let p=l[f]||"";o=i.slice(0,i.length-p.length).replace(/(.)\/+$/,"$1")}const v=l[f];return m&&!v?d[h]=void 0:d[h]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:e}}function HX(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),QD(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 n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function VX(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return QD(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function au(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function qX(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?Qu(e):e;return{pathname:r?r.startsWith("/")?r:GX(r,t):t,search:XX(n),hash:QX(s)}}function GX(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function rw(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function KX(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function fC(e,t){let r=KX(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function hC(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=Qu(e):(s=Jh({},e),ar(!s.pathname||!s.pathname.includes("?"),rw("?","pathname","search",s)),ar(!s.pathname||!s.pathname.includes("#"),rw("#","pathname","hash",s)),ar(!s.search||!s.search.includes("#"),rw("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,l;if(o==null)l=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;s.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=qX(s,l),d=o&&o!=="/"&&o.endsWith("/"),u=(i||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const ko=e=>e.join("/").replace(/\/\/+/g,"/"),YX=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),XX=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,QX=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function JX(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const e5=["post","put","patch","delete"];new Set(e5);const ZX=["get",...e5];new Set(ZX);/** 526 * React Router v6.30.1 527 * 528 * Copyright (c) Remix Software Inc. 529 * 530 * This source code is licensed under the MIT license found in the 531 * LICENSE.md file in the root directory of this source tree. 532 * 533 * @license MIT 534 */function Zh(){return Zh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zh.apply(this,arguments)}const By=g.createContext(null),t5=g.createContext(null),Ai=g.createContext(null),zy=g.createContext(null),Ei=g.createContext({outlet:null,matches:[],isDataRoute:!1}),r5=g.createContext(null);function eQ(e,t){let{relative:r}=t===void 0?{}:t;Ju()||ar(!1);let{basename:n,navigator:s}=g.useContext(Ai),{hash:i,pathname:o,search:l}=Wy(e,{relative:r}),c=o;return n!=="/"&&(c=o==="/"?n:ko([n,o])),s.createHref({pathname:c,search:l,hash:i})}function Ju(){return g.useContext(zy)!=null}function Bs(){return Ju()||ar(!1),g.useContext(zy).location}function n5(e){g.useContext(Ai).static||g.useLayoutEffect(e)}function vt(){let{isDataRoute:e}=g.useContext(Ei);return e?hQ():tQ()}function tQ(){Ju()||ar(!1);let e=g.useContext(By),{basename:t,future:r,navigator:n}=g.useContext(Ai),{matches:s}=g.useContext(Ei),{pathname:i}=Bs(),o=JSON.stringify(fC(s,r.v7_relativeSplatPath)),l=g.useRef(!1);return n5(()=>{l.current=!0}),g.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let f=hC(d,JSON.parse(o),i,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ko([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,o,i,e])}function Uy(){let{matches:e}=g.useContext(Ei),t=e[e.length-1];return t?t.params:{}}function Wy(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=g.useContext(Ai),{matches:s}=g.useContext(Ei),{pathname:i}=Bs(),o=JSON.stringify(fC(s,n.v7_relativeSplatPath));return g.useMemo(()=>hC(e,JSON.parse(o),i,r==="path"),[e,o,i,r])}function rQ(e,t){return nQ(e,t)}function nQ(e,t,r,n){Ju()||ar(!1);let{navigator:s}=g.useContext(Ai),{matches:i}=g.useContext(Ei),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=Bs(),u;if(t){var f;let x=typeof t=="string"?Qu(t):t;c==="/"||(f=x.pathname)!=null&&f.startsWith(c)||ar(!1),u=x}else u=d;let h=u.pathname||"/",m=h;if(c!=="/"){let x=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(x.length).join("/")}let v=TX(e,{pathname:m}),p=lQ(v&&v.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:ko([c,s.encodeLocation?s.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:ko([c,s.encodeLocation?s.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,r,n);return t&&p?g.createElement(zy.Provider,{value:{location:Zh({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:po.Pop}},p):p}function aQ(){let e=fQ(),t=JX(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),r?g.createElement("pre",{style:s},r):null,null)}const sQ=g.createElement(aQ,null);class iQ extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?g.createElement(Ei.Provider,{value:this.props.routeContext},g.createElement(r5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function oQ(e){let{routeContext:t,match:r,children:n}=e,s=g.useContext(By);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),g.createElement(Ei.Provider,{value:t},n)}function lQ(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(s=r)==null?void 0:s.errors;if(l!=null){let u=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);u>=0||ar(!1),o=o.slice(0,Math.min(o.length,u+1))}let c=!1,d=-1;if(r&&n&&n.v7_partialHydration)for(let u=0;u<o.length;u++){let f=o[u];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(d=u),f.route.id){let{loaderData:h,errors:m}=r,v=f.route.loader&&h[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||v){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((u,f,h)=>{let m,v=!1,p=null,x=null;r&&(m=l&&f.route.id?l[f.route.id]:void 0,p=f.route.errorElement||sQ,c&&(d<0&&h===0?(v=!0,x=null):d===h&&(v=!0,x=f.route.hydrateFallbackElement||null)));let b=t.concat(o.slice(0,h+1)),y=()=>{let w;return m?w=p:v?w=x:f.route.Component?w=g.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=u,g.createElement(oQ,{match:f,routeContext:{outlet:u,matches:b,isDataRoute:r!=null},children:w})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?g.createElement(iQ,{location:r.location,revalidation:r.revalidation,component:p,error:m,children:y(),routeC
534ontext:{outlet:null,matches:b,isDataRoute:!0}}):y()},null)}var a5=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(a5||{}),Bv=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Bv||{});function cQ(e){let t=g.useContext(By);return t||ar(!1),t}function dQ(e){let t=g.useContext(t5);return t||ar(!1),t}function uQ(e){let t=g.useContext(Ei);return t||ar(!1),t}function s5(e){let t=uQ(),r=t.matches[t.matches.length-1];return r.route.id||ar(!1),r.route.id}function fQ(){var e;let t=g.useContext(r5),r=dQ(Bv.UseRouteError),n=s5(Bv.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function hQ(){let{router:e}=cQ(a5.UseNavigateStable),t=s5(Bv.UseNavigateStable),r=g.useRef(!1);return n5(()=>{r.current=!0}),g.useCallback(function(s,i){i===void 0&&(i={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Zh({fromRouteId:t},i)))},[e,t])}function mQ(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Al(e){let{to:t,replace:r,state:n,relative:s}=e;Ju()||ar(!1);let{future:i,static:o}=g.useContext(Ai),{matches:l}=g.useContext(Ei),{pathname:c}=Bs(),d=vt(),u=hC(t,fC(l,i.v7_relativeSplatPath),c,s==="path"),f=JSON.stringify(u);return g.useEffect(()=>d(JSON.parse(f),{replace:r,state:n,relative:s}),[d,f,s,r,n]),null}function ze(e){ar(!1)}function pQ(e){let{basename:t="/",children:r=null,location:n,navigationType:s=po.Pop,navigator:i,static:o=!1,future:l}=e;Ju()&&ar(!1);let c=t.replace(/^\/*/,"/"),d=g.useMemo(()=>({basename:c,navigator:i,static:o,future:Zh({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof n=="string"&&(n=Qu(n));let{pathname:u="/",search:f="",hash:h="",state:m=null,key:v="default"}=n,p=g.useMemo(()=>{let x=au(u,c);return x==null?null:{location:{pathname:x,search:f,hash:h,state:m,key:v},navigationType:s}},[c,u,f,h,m,v,s]);return p==null?null:g.createElement(Ai.Provider,{value:d},g.createElement(zy.Provider,{children:r,value:p}))}function gQ(e){let{children:t,location:r}=e;return rQ(R1(t),r)}new Promise(()=>{});function R1(e,t){t===void 0&&(t=[]);let r=[];return g.Children.forEach(e,(n,s)=>{if(!g.isValidElement(n))return;let i=[...t,s];if(n.type===g.Fragment){r.push.apply(r,R1(n.props.children,i));return}n.type!==ze&&ar(!1),!n.props.index||!n.props.children||ar(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=R1(n.props.children,i)),r.push(o)}),r}/** 535 * React Router DOM v6.30.1 536 * 537 * Copyright (c) Remix Software Inc. 538 * 539 * This source code is licensed under the MIT license found in the 540 * LICENSE.md file in the root directory of this source tree. 541 * 542 * @license MIT 543 */function zv(){return zv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zv.apply(this,arguments)}function i5(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,i;for(i=0;i<n.length;i++)s=n[i],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}function vQ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xQ(e,t){return e.button===0&&(!t||t==="_self")&&!vQ(e)}function D1(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function yQ(e,t){let r=D1(e);return t&&t.forEach((n,s)=>
543{r.has(s)||t.getAll(s).forEach(i=>{r.append(s,i)})}),r}const bQ=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],wQ=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],jQ="6";try{window.__reactRouterVersion=jQ}catch{}const NQ=g.createContext({isTransitioning:!1}),SQ="startTransition",PA=YS[SQ];function _Q(e){let{basename:t,children:r,future:n,window:s}=e,i=g.useRef();i.current==null&&(i.current=AX({window:s,v5Compat:!0}));let o=i.current,[l,c]=g.useState({action:o.action,location:o.location}),{v7_startTransition:d}=n||{},u=g.useCallback(f=>{d&&PA?PA(()=>c(f)):c(f)},[c,d]);return g.useLayoutEffect(()=>o.listen(u),[o,u]),g.useEffect(()=>mQ(n),[n]),g.createElement(pQ,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const CQ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",PQ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,je=g.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:i,replace:o,state:l,target:c,to:d,preventScrollReset:u,viewTransition:f}=t,h=i5(t,bQ),{basename:m}=g.useContext(Ai),v,p=!1;if(typeof d=="string"&&PQ.test(d)&&(v=d,CQ))try{let w=new URL(window.location.href),_=d.startsWith("//")?new URL(w.protocol+d):new URL(d),N=au(_.pathname,m);_.origin===w.origin&&N!=null?d=N+_.search+_.hash:p=!0}catch{}let x=eQ(d,{relative:s}),b=AQ(d,{replace:o,state:l,target:c,preventScrollReset:u,relative:s,viewTransition:f});function y(w){n&&n(w),w.defaultPrevented||b(w)}return g.createElement("a",zv({},h,{href:v||x,onClick:p||i?n:y,ref:r,target:c}))}),nw=g.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:s=!1,className:i="",end:o=!1,style:l,to:c,viewTransition:d,children:u}=t,f=i5(t,wQ),h=Wy(c,{relative:f.relative}),m=Bs(),v=g.useContext(t5),{navigator:p,basename:x}=g.useContext(Ai),b=v!=null&&EQ(h)&&d===!0,y=p.encodeLocation?p.encodeLocation(h).pathname:h.pathname,w=m.pathname,_=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;s||(w=w.toLowerCase(),_=_?_.toLowerCase():null,y=y.toLowerCase()),_&&x&&(_=au(_,x)||_);const N=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let j=w===y||!o&&w.startsWith(y)&&w.charAt(N)==="/",S=_!=null&&(_===y||!o&&_.startsWith(y)&&_.charAt(y.length)==="/"),C={isActive:j,isPending:S,isTransitioning:b},P=j?n:void 0,A;typeof i=="function"?A=i(C):A=[i,j?"active":null,S?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let D=typeof l=="function"?l(C):l;return g.createElement(je,zv({},f,{"aria-current":P,className:A,ref:r,style:D,to:c,viewTransition:d}),typeof u=="function"?u(C):u)});var L1;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(L1||(L1={}));var kA;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(kA||(kA={}));function kQ(e){let t=g.useContext(By);return t||ar(!1),t}function AQ(e,t){let{target:r,replace:n,state:s,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=vt(),d=Bs(),u=Wy(e,{relative:o});return g.useCallback(f=>{if(xQ(f,r)){f.preventDefault();let h=n!==void 0?n:Lv(d)===Lv(u);c(e,{replace:h,state:s,preventScrollReset:i,relative:o,viewTransition:l})}},[d,c,u,n,s,r,e,i,o,l])}function mC(e){let t=g.useRef(D1(e)),r=g.useRef(!1),n=Bs(),s=g.useMemo(()=>yQ(n.search,r.current?null:t.current),[n.search]),i=vt(),o=g.useCallback((l,c)=>{const d=D1(typeof l=="function"?l(s):l);r.current=!0,i("?"+d,c)},[i,s]);return[s,o]}function EQ(e,t){t===void 0&&(t={});let r=g.useContext(NQ);r==null&&ar(!1);let{basename:n}=kQ(L1.useViewTransitionState),s=Wy(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=au(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=au(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Fv(s.pathname,o)!=null||Fv(s.pathname,i)!=null}const OQ="modulepreload",TQ=function(e){return"/"+e},AA={},Fo=function(t,r,n){let s=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(r.map(c=>{if(c=TQ(c),c in AA)return;AA[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":OQ,d||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),d)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},MQ=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...r)=>Fo(async()=>{const{default:n}=await Promise.resolve().then(()=>Zu);return{default:n}},void 0).then(({default:n})=>n(...r)):t=fetch,(...r)=>t(...r)};
543class pC extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}}class EA extends pC{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class OA extends pC{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class TA extends pC{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var F1;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(F1||(F1={}));var IQ=function(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(u){try{d(n.next(u))}catch(f){o(f)}}function c(u){try{d(n.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):s(u.value).then(l,c)}d((n=n.apply(e,t||[])).next())})};class $Q{constructor(t,{headers:r={},customFetch:n,region:s=F1.Any}={}){this.url=t,this.headers=r,this.region=s,this.fetch=MQ(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,r={}){var n;return IQ(this,void 0,void 0,function*(){try{const{headers:s,method:i,body:o,signal:l}=r;let c={},{region:d}=r;d||(d=this.region);const u=new URL(`${this.url}/${t}`);d&&d!=="any"&&(c["x-region"]=d,u.searchParams.set("forceFunctionRegion",d));let f;o&&(s&&!Object.prototype.hasOwnProperty.call(s,"Content-Type")||!s)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(c["Content-Type"]="application/octet-stream",f=o):typeof o=="string"?(c["Content-Type"]="text/plain",f=o):typeof FormData<"u"&&o instanceof FormData?f=o:(c["Content-Type"]="application/json",f=JSON.stringify(o)));const h=yield this.fetch(u.toString(),{method:i||"POST",headers:Object.assign(Object.assign(Object.assign({},c),this.headers),s),body:f,signal:l}).catch(x=>{throw x.name==="AbortError"?x:new EA(x)}),m=h.headers.get("x-relay-error");if(m&&m==="true")throw new OA(h);if(!h.ok)throw new TA(h);let v=((n=h.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),p;return v==="application/json"?p=yield h.json():v==="application/octet-stream"?p=yield h.blob():v==="text/event-stream"?p=h:v==="multipart/form-data"?p=yield h.formData():p=yield h.text(),{data:p,error:null,response:h}}catch(s){return s instanceof Error&&s.name==="AbortError"?{data:null,error:new EA(s)}:{data:null,error:s,response:s instanceof TA||s instanceof OA?s.context:void 0}}})}}var kn={},gC={},Hy={},op={},Vy={},qy={},RQ=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},su=RQ();const DQ=su.fetch,o5=su.fetch.bind(su),l5=su.Headers,LQ=su.Request,FQ=su.Response,Zu=Object.freeze(Object.defineProperty({__proto__:null,Headers:l5,Request:LQ,Response:FQ,default:o5,fetch:DQ},Symbol.toStringTag,{value:"Module"})),BQ=EW(Zu);var Gy={};Object.defineProperty(Gy,"__esModule",{value:!0});let zQ=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
543de=t.code}};Gy.default=zQ;var c5=en&&en.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qy,"__esModule",{value:!0});const UQ=c5(BQ),WQ=c5(Gy);let HQ=class{constructor(t){var r,n;this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(r=t.shouldThrowOnError)!==null&&r!==void 0?r:!1,this.signal=t.signal,this.isMaybeSingle=(n=t.isMaybeSingle)!==null&&n!==void 0?n:!1,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=UQ.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,r){return this.headers=new Headers(this.headers),this.headers.set(t,r),this}then(t,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const n=this.fetch;let s=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{var o,l,c,d;let u=null,f=null,h=null,m=i.status,v=i.statusText;if(i.ok){if(this.method!=="HEAD"){const y=await i.text();y===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((o=this.headers.get("Accept"))===null||o===void 0)&&o.includes("application/vnd.pgrst.plan+text"))?f=y:f=JSON.parse(y))}const x=(l=this.headers.get("Prefer"))===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),b=(c=i.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");x&&b&&b.length>1&&(h=parseInt(b[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(f)&&(f.length>1?(u={code:"PGRST116",details:`Results contain ${f.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},f=null,h=null,m=406,v="Not Acceptable"):f.length===1?f=f[0]:f=null)}else{const x=await i.text();try{u=JSON.parse(x),Array.isArray(u)&&i.status===404&&(f=[],u=null,m=200,v="OK")}catch{i.status===404&&x===""?(m=204,v="No Content"):u={message:x}}if(u&&this.isMaybeSingle&&(!((d=u==null?void 0:u.details)===null||d===void 0)&&d.includes("0 rows"))&&(u=null,m=200,v="OK"),u&&this.shouldThrowOnError)throw new WQ.default(u)}return{error:u,data:f,count:h,status:m,statusText:v}});return this.shouldThrowOnError||(s=s.catch(i=>{var o,l,c;return{error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:`${(l=i==null?void 0:i.stack)!==null&&l!==void 0?l:""}`,hint:"",code:`${(c=i==null?void 0:i.code)!==null&&c!==void 0?c:""}`},data:null,count:null,status:0,statusText:""}})),s.then(t,r)}returns(){return this}overrideTypes(){return this}};qy.default=HQ;var VQ=en&&en.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vy,"__esModule",{value:!0});const qQ=VQ(qy);let GQ=class extends qQ.default{select(t){let r=!1;const n=(t??"*").split("").map(s=>/\s/.test(s)&&!r?"":(s==='"'&&(r=!r),s)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:r=!0,nullsFirst:n,foreignTable:s,referencedTable:i=s}={}){const o=i?`${i}.order`:"order",l=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${l?`${l},`:""}${t}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:r,referencedTable:n=r}={}){const s=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${t}`),this}range(t,r,{foreignTable:n,referencedTable:s=n}={}){const i=typeof s>"u"?"offset":`${s}.offset`,o=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(i,`${t}`),this.url.searchParams.set(o,`${r-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
543explain({analyze:t=!1,verbose:r=!1,settings:n=!1,buffers:s=!1,wal:i=!1,format:o="text"}={}){var l;const c=[t?"analyze":null,r?"verbose":null,n?"settings":null,s?"buffers":null,i?"wal":null].filter(Boolean).join("|"),d=(l=this.headers.get("Accept"))!==null&&l!==void 0?l:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${d}"; options=${c};`),o==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};Vy.default=GQ;var KQ=en&&en.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(op,"__esModule",{value:!0});const YQ=KQ(Vy);let XQ=class extends YQ.default{eq(t,r){return this.url.searchParams.append(t,`eq.${r}`),this}neq(t,r){return this.url.searchParams.append(t,`neq.${r}`),this}gt(t,r){return this.url.searchParams.append(t,`gt.${r}`),this}gte(t,r){return this.url.searchParams.append(t,`gte.${r}`),this}lt(t,r){return this.url.searchParams.append(t,`lt.${r}`),this}lte(t,r){return this.url.searchParams.append(t,`lte.${r}`),this}like(t,r){return this.url.searchParams.append(t,`like.${r}`),this}likeAllOf(t,r){return this.url.searchParams.append(t,`like(all).{${r.join(",")}}`),this}likeAnyOf(t,r){return this.url.searchParams.append(t,`like(any).{${r.join(",")}}`),this}ilike(t,r){return this.url.searchParams.append(t,`ilike.${r}`),this}ilikeAllOf(t,r){return this.url.searchParams.append(t,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(t,r){return this.url.searchParams.append(t,`ilike(any).{${r.join(",")}}`),this}is(t,r){return this.url.searchParams.append(t,`is.${r}`),this}in(t,r){const n=Array.from(new Set(r)).map(s=>typeof s=="string"&&new RegExp("[,()]").test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(t,`in.(${n})`),this}contains(t,r){return typeof r=="string"?this.url.searchParams.append(t,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(t,`cs.{${r.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(r)}`),this}containedBy(t,r){return typeof r=="string"?this.url.searchParams.append(t,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(t,`cd.{${r.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(r)}`),this}rangeGt(t,r){return this.url.searchParams.append(t,`sr.${r}`),this}rangeGte(t,r){return this.url.searchParams.append(t,`nxl.${r}`),this}rangeLt(t,r){return this.url.searchParams.append(t,`sl.${r}`),this}rangeLte(t,r){return this.url.searchParams.append(t,`nxr.${r}`),this}rangeAdjacent(t,r){return this.url.searchParams.append(t,`adj.${r}`),this}overlaps(t,r){return typeof r=="string"?this.url.searchParams.append(t,`ov.${r}`):this.url.searchParams.append(t,`ov.{${r.join(",")}}`),this}textSearch(t,r,{config:n,type:s}={}){let i="";s==="plain"?i="pl":s==="phrase"?i="ph":s==="websearch"&&(i="w");const o=n===void 0?"":`(${n})`;return this.url.searchParams.append(t,`${i}fts${o}.${r}`),this}match(t){return Object.entries(t).forEach(([r,n])=>{this.url.searchParams.append(r,`eq.${n}`)}),this}not(t,r,n){return this.url.searchParams.append(t,`not.${r}.${n}`),this}or(t,{foreignTable:r,referencedTable:n=r}={}){const s=n?`${n}.or`:"or";return this.url.searchParams.append(s,`(${t})`),this}filter(t,r,n){return this.url.searchParams.append(t,`${r}.${n}`),this}};op.default=XQ;var QQ=en&&en.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hy,"__esModule",{value:!0});const Of=QQ(op);let JQ=class{constructor(t,{headers:r={},schema:n,fetch:s}){this.url=t,this.headers=new Headers(r),this.schema=n,this.fetch=s}select(t,{head:r=!1,count:n}={}){const s=r?"HEAD":"GET";let i=!1;const o=(t??"*").split("").map(l=>/\s/.test(l)&&!i?"":(l==='"'&&(i=!i),l)).join("");return this.url.searchParams.set("select",o),n&&this.headers.append("Prefer",`count=${n}`),new Of.default({method:s,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(t,{count:r,defaultToNull:n=!0}={}){var s;const i="POST";if(r&&this.headers.append("Prefer",`count=${r}`),n||this.headers.append("Prefer","missing=default"),Array.isArray(t)){const o=t.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(o.length>0){const l=[...new Set(o)].map(c=>`"${c}"`);this.url.searchParams.set("columns",l.join(","))}}return new Of.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}upsert(t,{onConflict:r,ignoreDuplicates:n=!1,count:s,defaultToNull:i=!0}={}){var o;const l="POST";if(this.headers.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),r!==void 0&&this.url.searchParams.set("on_conflict",r),s&&this.headers.append("Prefer",`count=${s}`),i||this.headers.append("Prefer","missing=default"),Array.isArray(t)){const c=t.reduce((d,u)=>d.concat(Object.keys(u)),[]);if(c.length>0){const d=[...new Set(c)].map(u=>`"${u}"`);this.url.searchParams.set("columns",d.join(","))}}return new Of.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}update(t,{count:r}={}){var n;const s="PATCH";return r&&this.headers.append("Prefer",`count=${r}`),new Of.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:t}={}){var r;const n="DELETE";return t&&this.headers.append("Prefer",`count=${t}`),new Of.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}};Hy.default=JQ;
543var d5=en&&en.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gC,"__esModule",{value:!0});const ZQ=d5(Hy),eJ=d5(op);let tJ=class u5{constructor(t,{headers:r={},schema:n,fetch:s}={}){this.url=t,this.headers=new Headers(r),this.schemaName=n,this.fetch=s}from(t){const r=new URL(`${this.url}/${t}`);return new ZQ.default(r,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new u5(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,r={},{head:n=!1,get:s=!1,count:i}={}){var o;let l;const c=new URL(`${this.url}/rpc/${t}`);let d;n||s?(l=n?"HEAD":"GET",Object.entries(r).filter(([f,h])=>h!==void 0).map(([f,h])=>[f,Array.isArray(h)?`{${h.join(",")}}`:`${h}`]).forEach(([f,h])=>{c.searchParams.append(f,h)})):(l="POST",d=r);const u=new Headers(this.headers);return i&&u.set("Prefer",`count=${i}`),new eJ.default({method:l,url:c,headers:u,schema:this.schemaName,body:d,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}};gC.default=tJ;var ef=en&&en.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kn,"__esModule",{value:!0});kn.PostgrestError=kn.PostgrestBuilder=kn.PostgrestTransformBuilder=kn.PostgrestFilterBuilder=kn.PostgrestQueryBuilder=kn.PostgrestClient=void 0;const f5=ef(gC);kn.PostgrestClient=f5.default;const h5=ef(Hy);kn.PostgrestQueryBuilder=h5.default;const m5=ef(op);kn.PostgrestFilterBuilder=m5.default;const p5=ef(Vy);kn.PostgrestTransformBuilder=p5.default;const g5=ef(qy);kn.PostgrestBuilder=g5.default;const v5=ef(Gy);kn.PostgrestError=v5.default;var rJ=kn.default={PostgrestClient:f5.default,PostgrestQueryBuilder:h5.default,PostgrestFilterBuilder:m5.default,PostgrestTransformBuilder:p5.default,PostgrestBuilder:g5.default,PostgrestError:v5.default};const{PostgrestClient:nJ,PostgrestQueryBuilder:dRe,PostgrestFilterBuilder:uRe,PostgrestTransformBuilder:fRe,PostgrestBuilder:hRe,PostgrestError:mRe}=rJ;class aJ{static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"){const r=process.versions;if(r&&r.node){const n=r.node,s=parseInt(n.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 544import ws from "ws" 545new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=` 546 547Suggested solution: ${t.workaround}`),new Error(r)}static createWebSocket(t,r){const n=this.getWebSocketConstructor();return new n(t,r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const sJ="2.15.5",iJ=`realtime-js/${sJ}`,oJ="1.0.0",B1=1e4,lJ=1e3,cJ=100;var gh;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(gh||(gh={}));var br;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(br||(br={}));var Wa;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(Wa||(Wa={}));var z1;(function(e){e.websocket="websocket"})(z1||(z1={}));var Nl;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Nl||(Nl={}));class dJ{constructor(){this.HEADER_LENGTH=1}decode(t,r){return t.constructor===ArrayBuffer?r(this._binaryDecode(t)):r(typeof t=="string"?JSON.parse(t):{})}_binaryDecode(t){const r=new DataView(t),n=new TextDecoder;return this._decodeBroadcast(t,r,n)}_decodeBroadcast(t,r,n){const s=r.getUint8(1),i=r.getUint8(2);let o=this.HEADER_LENGTH+2;const l=n.decode(t.slice(o,o+s));o=o+s;const c=n.decode(t.slice(o,o+i));o=o+i;const d=JSON.parse(n.decode(t.slice(o,t.byteLength)));return{ref:null,topic:l,event:c,payload:d}}}class x5{constructor(t,r){this.callback=t,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Mt;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(Mt||(Mt={}));const MA=(e,t,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return Object.keys(t).reduce((i,o)=>(i[o]=uJ(o,e,t,s),i),{})},uJ=(e,t,r,n)=>{const s=t.find(l=>
547l.name===e),i=s==null?void 0:s.type,o=r[e];return i&&!n.includes(i)?y5(i,o):U1(o)},y5=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return pJ(t,r)}switch(e){case Mt.bool:return fJ(t);case Mt.float4:case Mt.float8:case Mt.int2:case Mt.int4:case Mt.int8:case Mt.numeric:case Mt.oid:return hJ(t);case Mt.json:case Mt.jsonb:return mJ(t);case Mt.timestamp:return gJ(t);case Mt.abstime:case Mt.date:case Mt.daterange:case Mt.int4range:case Mt.int8range:case Mt.money:case Mt.reltime:case Mt.text:case Mt.time:case Mt.timestamptz:case Mt.timetz:case Mt.tsrange:case Mt.tstzrange:return U1(t);default:return U1(t)}},U1=e=>e,fJ=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},hJ=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},mJ=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},pJ=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let i;const o=e.slice(1,r);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(l=>y5(t,l))}return e},gJ=e=>typeof e=="string"?e.replace(" ","T"):e,b5=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")+"/api/broadcast"};class aw{constructor(t,r,n={},s=B1){this.channel=t,this.event=r,this.payload=n,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,r){var n;return this._hasReceived(t)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:t,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(r))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var IA;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(IA||(IA={}));class vh{constructor(t,r){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},s=>{const{onJoin:i,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=vh.syncState(this.state,s,i,o),this.pendingDiffs.forEach(c=>{this.state=vh.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],l()}),this.channel._on(n.diff,{},s=>{const{onJoin:i,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=vh.syncDiff(this.state,s,i,o),l())}),this.onJoin((s,i,o)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:i,newPresences:o})}),this.onLeave((s,i,o)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,n,s){const i=this.cloneDeep(t),o=this.transformState(r),l={},c={};return this.map(i,(d,u)=>{o[d]||(c[d]=u)}),this.map(o,(d,u)=>{const f=i[d];if(f){const h=u.map(x=>x.presence_ref),m=f.map(x=>x.presence_ref),v=u.filter(x=>m.indexOf(x.presence_ref)<0),p=f.filter(x=>h.indexOf(x.presence_ref)<0);v.length>0&&(l[d]=v),p.length>0&&(c[d]=p)}else l[d]=u}),this.syncDiff(i,{joins:l,leaves:c},n,s)}static syncDiff(t,r,n,s){const{joins:i,leaves:o}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),s||(s=()=>{}),this.map(i,(l,c)=>{var d;const u=(d=t[l])!==null&&d!==void 0?d:[];if(t[l]=this.cloneDeep(c),u.length>0){const f=t[l].map(m=>m.presence_ref),h=u.filter(m=>f.indexOf(m.presence_ref)<0);t[l].unshift(...h)}n(l,u,c)}),this.map(o,(l,c)=>{let d=t[l];if(!d)return;const u=c.map(f=>f.presence_ref);d=d.filter(f=>u.indexOf(f.presence_ref)<0),t[l]=d,s(l,d,c),d.length===0&&delete t[l]}),t}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const s=t[n];return"metas"in s?r[n]=s.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):r[n]=s,r},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var $A;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})($A||($A={}));var xh;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(xh||(xh={}));var Xs;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Xs||(Xs={}));class vC{constructor(t,r={config:{}},n){this.topic=t,this.params=r,this.socket=n,this.bindings={},this.state=br.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new aw(this,Wa.join,this.params,this.timeout),this.rejoinTimer=new x5(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=br.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=br.closed,this.socket._remove(this)}),this._onError(s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=br.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=br.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=br.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Wa.reply,{},(s,i)=>{this._trigger(this._replyEventName(i),s)}),this.presence=new vh(this),this.broadcastEndpointURL=b5(this.socket.endPoint),this.private=this.params.config.private||!1}subscribe(t,r=this.timeout){var n,s,i;if(this.socket.isConnected()||this.socket.connect(),this.state==br.closed){const{config:{broadcast:o,presence:l,private:c}}=this.params,d=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(m=>m.filter))!==null&&s!==void 0?s:[],u=!!this.bindings[xh.PRESENCE]&&this.bindings[xh.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,f={},h={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:u}),postgres_changes:d,private:c};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(m=>t==null?void 0:t(Xs.CHANNEL_ERROR,m)),this._onClose(()=>t==null?void 0:t(Xs.CLOSED)),this.updateJoinPayload(Object.assign({config:h},f)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:m})=>{var v;if(this.socket.setAuth(),m===void 0){t==null||t(Xs.SUBSCRIBED);return}else{const p=this.bindings.postgres_changes,x=(v=p==null?void 0:p.length)!==null&&v!==void 0?v:0,b=[];for(let y=0;y<x;y++){const w=p[y],{filter:{event:_,schema:N,table:j,filter:S}}=w,C=m&&m[y];if(C&&C.event===_&&C.schema===N&&C.table===j&&C.filter===S)b.push(Object.assign(Object.assign({},w),{id:C.id}));else{this.unsubscribe(),this.state=br.errored,t==null||t(Xs.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=b,t&&t(Xs.SUBSCRIBED);return}}).receive("error",m=>{this.state=br.errored,t==null||t(Xs.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(m).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Xs.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){return this.state===br.joined&&t===xh.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(t,r,n)}async send(t,r={}){var n,s;if(!this._canPush()&&t.type==="broadcast"){const{event:i,payload:o}=t,c={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const d=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=d.body)===null||s===void 0?void 0:s.cancel()),d.ok?"ok":"error"}catch(d){return d.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,l,c;const d=this._push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(o=this.params)===null||o===void 0?void 0:o.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),d.receive("ok",()=>i("ok")),d.receive("error",()=>i("error")),d.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=br.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Wa.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(s=>{n=new aw(this,Wa.leave,{},t),n.receive("ok",()=>{r(),s("ok")}).receive("timeout",()=>{r(),s("timed out")}).receive("error",()=>{s("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=br.closed,this.bindings={}}async _fetchWithTimeout(t,r,n){const s=new AbortController,i=setTimeout(()=>s.abort(),n),o=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(i),o}_push(t,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new aw(this,t,r,n);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>cJ){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(t,r,n){return r}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,r,n){var s,i;const o=t.toLocaleLowerCase(),{close:l,error:c,leave:d,join:u}=Wa;if(n&&[l,c,d,u].indexOf(o)>=0&&n!==this._joinRef())return;let h=this._onMessage(o,r,n);if(r&&!h)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(m=>{var v,p,x;return((v=m.filter)===null||v===void 0?void 0:v.event)==="*"||((x=(p=m.filter)===null||p===void 0?void 0:p.event)===null||x===void 0?void 0:x.toLocaleLowerCase())===o}).map(m=>m.callback(h,n)):(i=this.bindings[o])===null||i===void 0||i.filter(m=>{var v,p,x,b,y,w;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in m){const _=m.id,N=(v=m.filter)===null||v===void 0?void 0:v.event;return _&&((p=r.ids)===null||p===void 0?void 0:p.includes(_))&&(N==="*"||(N==null?void 0:N.toLocaleLowerCase())===((x=r.data)===null||x===void 0?void 0:x.type.toLocaleLowerCase()))}else{const _=(y=(b=m==null?void 0:m.filter)===null||b===void 0?void 0:b.event)===null||y===void 0?void 0:y.toLocaleLowerCase();return _==="*"||_===((w=r==null?void 0:r.event)===null||w===void 0?void 0:w.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===o}).map(m=>{if(typeof h=="object"&&"ids"in h){const v=h.data,{schema:p,table:
547x,commit_timestamp:b,type:y,errors:w}=v;h=Object.assign(Object.assign({},{schema:p,table:x,commit_timestamp:b,eventType:y,new:{},old:{},errors:w}),this._getPayloadRecords(v))}m.callback(h,n)})}_isClosed(){return this.state===br.closed}_isJoined(){return this.state===br.joined}_isJoining(){return this.state===br.joining}_isLeaving(){return this.state===br.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,r,n){const s=t.toLocaleLowerCase(),i={type:s,filter:r,callback:n};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],this}_off(t,r){const n=t.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(s=>{var i;return!(((i=s.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===n&&vC.isEqual(s.filter,r))})),this}static isEqual(t,r){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(const n in t)if(t[n]!==r[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Wa.close,{},t)}_onError(t){this._on(Wa.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=br.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=MA(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=MA(t.columns,t.old_record)),r}}const sw=()=>{},sg={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},vJ=[1e3,2e3,5e3,1e4],xJ=1e4,yJ=` 548 addEventListener("message", (e) => { 549 if (e.data.event === "start") { 550 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 551 } 552 });`;class bJ{constructor(t,r){var n;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=B1,this.transport=null,this.heartbeatIntervalMs=sg.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=sw,this.ref=0,this.reconnectTimer=null,this.logger=sw,this.conn=null,this.sendBuffer=[],this.serializer=new dJ,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=s=>{let i;return s?i=s:typeof fetch>"u"?i=(...o)=>Fo(async()=>{const{default:l}=await Promise.resolve().then(()=>Zu);return{default:l}},void 0).then(({default:l})=>l(...o)).catch(l=>{throw new Error(`Failed to load @supabase/node-fetch: ${l.message}. This is required for HTTP requests in Node.js environments without native fetch.`)}):i=fetch,(...o)=>i(...o)},!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${t}/${z1.websocket}`,this.httpEndpoint=b5(t),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=aJ.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const r=t.message;throw r.includes("Node.js")?new Error(`${r} 553 554To use Realtime in Node.js, you need to provide a WebSocket implementation: 555 556Option 1: Use Node.js 22+ which has native WebSocket support 557Option 2: Install and provide the "ws" package: 558 559 npm install ws 560 561 import ws from "ws" 562 const client = new RealtimeClient(url, { 563 ...options, 564 transport: ws 565 })`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:oJ}))}disconnect(t,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);
565this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},t?this.conn.close(t,r??""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,r,n){this.logger(t,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case gh.connecting:return Nl.Connecting;case gh.open:return Nl.Open;case gh.closing:return Nl.Closing;default:return Nl.Closed}}isConnected(){return this.connectionState()===Nl.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,r={config:{}}){const n=`realtime:${t}`,s=this.getChannels().find(i=>i.topic===n);if(s)return s;{const i=new vC(`realtime:${t}`,r,this);return this.channels.push(i),i}}push(t){const{topic:r,event:n,payload:s,ref:i}=t,o=()=>{this.encode(t,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${r} ${n} (${i})`,s),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(lJ,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.sc
565heduleTimeout()},sg.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let r=this.channels.find(n=>n.topic===t&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${t}"`),r.unsubscribe())}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply")try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error")}catch(d){this.log("error","error in heartbeat callback",d)}r.ref&&r.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:n,event:s,payload:i,ref:o}=r,l=o?`(${o})`:"",c=i.status||"";this.log("receive",`${c} ${n} ${s} ${l}`.trim(),i),this.channels.filter(d=>d._isMember(n)).forEach(d=>d._trigger(s,i,o)),this._triggerStateCallbacks("message",r)})}_clearTimer(t){var r;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this.workerRef.terminate()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(t){var r;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.sc
565heduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t)}_triggerChanError(){this.channels.forEach(t=>t._trigger(Wa.error))}_appendParams(t,r){if(Object.keys(r).length===0)return t;const n=t.match(/\?/)?"&":"?",s=new URLSearchParams(r);return`${t}${n}${s}`}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([yJ],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(t,r=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(t=null){let r;t?r=t:this.accessToken?r=await this.accessToken():r=this.accessTokenValue,this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(n=>{const s={access_token:r,version:iJ};r&&n.updateJoinPayload(s),n.joinedOnce&&n._isJoined()&&n._push(Wa.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this.setAuth().catch(r=>{this.log("error",`error setting auth in ${t}`,r)})}_triggerStateCallbacks(t,r){try{this.stateChangeCallbacks[t].forEach(n=>{try{n(r)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new x5(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},sg.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,n,s,i,o,l,c,d,u;if(this.transport=(r=t==null?void 0:t.transport)!==null&&r!==void 0?r:null,this.timeout=(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:B1,this.heartbeatIntervalMs=(s=t==null?void 0:t.heartbeatIntervalMs)!==null&&s!==void 0?s:sg.HEARTBEAT_INTERVAL,this.worker=(i=t==null?void 0:t.worker)!==null&&i!==void 0?i:!1,this.accessToken=(o=t==null?void 0:t.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(l=t==null?void 0:t.heartbeatCallback)!==null&&l!==void 0?l:sw,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(c=t==null?void 0:t.reconnectAfterMs)!==null&&c!==void 0?c:f=>vJ[f-1]||xJ,this.encode=(d=t==null?void 0:t.encode)!==null&&d!==void 0?d:(f,h)=>h(JSON.stringify(f)),this.decode=(u=t==null?void 0:t.decode)!==null&&u!==void 0?u:this.serializer.decode.bind(this.serializer),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}
565class xC extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}}function hr(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}class wJ extends xC{constructor(t,r,n){super(t),this.name="StorageApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class W1 extends xC{constructor(t,r){super(t),this.name="StorageUnknownError",this.originalError=r}}var jJ=function(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(u){try{d(n.next(u))}catch(f){o(f)}}function c(u){try{d(n.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):s(u.value).then(l,c)}d((n=n.apply(e,t||[])).next())})};const w5=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...r)=>Fo(async()=>{const{default:n}=await Promise.resolve().then(()=>Zu);return{default:n}},void 0).then(({default:n})=>n(...r)):t=fetch,(...r)=>t(...r)},NJ=()=>jJ(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Fo(()=>Promise.resolve().then(()=>Zu),void 0)).Response:Response}),H1=e=>{if(Array.isArray(e))return e.map(r=>H1(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[s]=H1(n)}),t},SJ=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var wc=function(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(u){try{d(n.next(u))}catch(f){o(f)}}function c(u){try{d(n.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):s(u.value).then(l,c)}d((n=n.apply(e,t||[])).next())})};const iw=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),_J=(e,t,r)=>wc(void 0,void 0,void 0,function*(){const n=yield NJ();e instanceof n&&!(r!=null&&r.noResolveJson)?e.json().then(s=>{const i=e.status||500,o=(s==null?void 0:s.statusCode)||i+"";t(new wJ(iw(s),i,o))}).catch(s=>{t(new W1(iw(s),s))}):t(new W1(iw(e),e))}),CJ=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!n?s:(SJ(n)?(s.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),s.body=JSON.stringify(n)):s.body=n,t!=null&&t.duplex&&(s.duplex=t.duplex),Object.assign(Object.assign({},s),r))};function lp(e,t,r,n,s,i){return wc(this,void 0,void 0,function*(){return new Promise((o,l)=>{e(r,CJ(t,n,s,i)).then(c=>{if(!c.ok)throw c;return n!=null&&n.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>_J(c,l,n))})})}function Uv(e,t,r,n){return wc(this,void 0,void 0,function*(){return lp(e,"GET",t,r,n)})}function vs(e,t,r,n,s){return wc(this,void 0,void 0,function*(){return lp(e,"POST",t,n,s,r)})}function V1(e,t,r,n,s){return wc(this,void 0,void 0,function*(){return lp(e,"PUT",t,n,s,r)})}function PJ(e,t,r,n){return wc(this,void 0,void 0,function*(){return lp(e,"HEAD",t,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}function j5(e,t,r,n,s){return wc(this,void 0,void 0,function*(){return lp(e,"DELETE",t,n,s,r)})}var kJ=function(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(u){try{d(n.next(u))}catch(f){o(f)}}function c(u){try{d(n.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):s(u.value).then(l,c)}d((n=n.apply(e,t||[])).next())})};class AJ{constructor(t,r){this.downloadFn=t,this.shouldThrowOnError=r}then(t,r){return this.execute().then(t,r)}execute(){return kJ(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(hr(t))return{data:null,error:t};throw t}})}}var EJ=function(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(u){try{d(n.next(u))}catch(f){o(f)}}function c(u){try{d(n.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):s(u.value).then(l,c)}d((n=n.apply(e,t||[])).next())})};class OJ{constructor(t,r){this.downloadFn=t,this.shouldThrowOnError=r}asStream(){return new AJ(this.downloadFn,this.shouldThrowOnError)}then(t,r){return this.execute().then(t,r)}execute(){return EJ(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(hr(t))return{data:null,error:t};throw t}})}}var Nn=function(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(u){try{d(n.next(u))}catch(f){o(f)}}function c(u){try{d(n.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):s(u.value).then(l,c)}d((n=n.apply(e,t||[])).next())})};const TJ={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},RA={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class MJ{constructor(t,r={},n,s){this.shouldThrowOnError=!1,this.url=t,this.headers=r,this.bucketId=n,this.fetch=w5(s)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(t,r,n,s){return Nn(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},RA),s);let l=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c))):(i=n,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=this.toBase64(this.encodeMetadata(c)))),s!=null&&s.headers&&(l=Object.assign(Object.assign({},l),s.headers));const d=this._removeEmptyFolders(r),u=this._getFinalPath(d),f=yield(t=="PUT"?V1:vs)(this.fetch,`${this.url}/object/${u}`,i,Object.assign({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:d,id:f.Id,fullPath:f.Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(hr(i))return{data:null,error:i};throw i}})}upload(t,r,n){return Nn(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,r,n)})}uploadToSignedUrl(t,r,n,s){return Nn(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(t),o=this._getFinalPath(i),l=new URL(this.url+`/object/upload/sign/${o}`);l.searchParams.set("token",r);try{let c;const d=Object.assign({upsert:RA.upsert},s),u=Object.assign(Object.assign({},this.headers),{"x-upsert":String(d.upsert)});typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",d.cacheControl),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.append("cacheControl",d.cacheControl)):(c=n,u["cache-control"]=`max-age=${d.cacheControl}`,u["content-type"]=d.contentType);const f=yield V1(this.fetch,l.toString(),c,{headers:u});return{data:{path:i,fullPath:f.Key},error:null}}catch(c){if(this.shouldThrowOnError)throw c;if(hr(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(t,r){return Nn(this,void 0,void 0,function*(){try{let n=this._getFinalPath(t);const s=Object.assign({},this.headers);r!=null&&r.upsert&&(s["x-upsert"]="true");const i=yield vs(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:s}),o=new URL(this.url+i.url),l=o.searchParams.get("token");if(!l)throw new xC("No token returned by API");return{data:{signedUrl:o.toString(),path:t,token:l},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(hr(n))return{data:null,error:n};throw n}})}update(t,r,n){return Nn(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,r,n)})}move(t,r,n){return Nn(this,void 0,void 0,function*(){try{return{data:yield vs(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(hr(s))return{data:null,error:s};throw s}})}copy(t,r,n){return Nn(this,void 0,void 0,function*(){try{return{data:{path:(yield vs(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers})).Key},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(hr(s))return{data:null,error:s};throw s}})}createSignedUrl(t,r,n){return Nn(this,void 0,void 0,function*(){try{let s=this._getFinalPath(t),i=yield vs(this.fetch,`${this.url}/object/sign/${s}
565`,Object.assign({expiresIn:r},n!=null&&n.transform?{transform:n.transform}:{}),{headers:this.headers});const o=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(hr(s))return{data:null,error:s};throw s}})}createSignedUrls(t,r,n){return Nn(this,void 0,void 0,function*(){try{const s=yield vs(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:t},{headers:this.headers}),i=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{data:s.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(hr(s))return{data:null,error:s};throw s}})}download(t,r){const s=typeof(r==null?void 0:r.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((r==null?void 0:r.transform)||{}),o=i?`?${i}`:"",l=this._getFinalPath(t),c=()=>Uv(this.fetch,`${this.url}/${s}/${l}${o}`,{headers:this.headers,noResolveJson:!0});return new OJ(c,this.shouldThrowOnError)}info(t){return Nn(this,void 0,void 0,function*(){const r=this._getFinalPath(t);try{const n=yield Uv(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:H1(n),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(hr(n))return{data:null,error:n};throw n}})}exists(t){return Nn(this,void 0,void 0,function*(){const r=this._getFinalPath(t);try{return yield PJ(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(hr(n)&&n instanceof W1){const s=n.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:n}}throw n}})}getPublicUrl(t,r){const n=this._getFinalPath(t),s=[],i=r!=null&&r.download?`download=${r.download===!0?"":r.download}`:"";i!==""&&s.push(i);const l=typeof(r==null?void 0:r.transform)<"u"?"render/image":"object",c=this.transformOptsToQueryString((r==null?void 0:r.transform)||{});c!==""&&s.push(c);let d=s.join("&");return d!==""&&(d=`?${d}`),{data:{publicUrl:encodeURI(`${this.url}/${l}/public/${n}${d}`)}}}remove(t){return Nn(this,void 0,void 0,function*(){try{return{data:yield j5(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(hr(r))return{data:null,error:r};throw r}})}list(t,r,n){return Nn(this,void 0,void 0,function*(){try{const s=Object.assign(Object.assign(Object.assign({},TJ),r),{prefix:t||""});return{data:yield vs(this.fetch,`${this.url}/object/list/${this.bucketId}`,s,{headers:this.headers},n),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(hr(s))return{data:null,error:s};throw s}})}listV2(t,r){return Nn(this,void 0,void 0,function*(){try{const n=Object.assign({},t);return{data:yield vs(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,n,{headers:this.headers},r),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(hr(n))return{data:null,error:n};throw n}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const r=[];return t.width&&r.push(`width=${t.width}`),t.height&&r.push(`height=${t.height}`),t.resize&&r.push(`resize=${t.resize}`),t.format&&r.push(`format=${t.format}`),t.quality&&r.push(`quality=${t.quality}`),r.join("&")}}const IJ="2.12.2",$J={"X-Client-Info":`storage-js/${IJ}`};var $c=function(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(u){try{d(n.next(u))}catch(f){o(f)}}function c(u){try{d(n.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):s(u.value).then(l,c)}d((n=n.apply(e,t||[])).next())})};class RJ{constructor(t,r={},n,s){this.shouldThrowOnError=!1;const i=new URL(t);s!=null&&s.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href,this.headers=Object.assign(Object.assign({},$J),r),this.fetch=w5(n)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(){return $c(this,void 0,void 0,function*(){try{return{data:yield Uv(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(hr(t))return{data:null,error:t};throw t}})}getBucket(t){return $c(this,void 0,void 0,function*(){try{return{data:yield Uv(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(hr(r))return{data:null,error:r};throw r}})}createBucket(t,r={public:!1}){return $c(this,void 0,void 0,function*(){try{return{data:yield vs(this.fetch,`${this.url}/bucket`,{id:t,name:t,type:r.type,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(hr(n))return{data:null,error:n};throw n}})}updateBucket(t,r){return $c(this,void 0,void 0,function*(){try{return{data:yield V1(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(hr(n))return{data:null,error:n};throw n}})}emptyBucket(t){return $c(this,void 0,void 0,function*(){try{return{data:yield vs(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(hr(r))return{data:null,error:r};throw r}})}deleteBucket(t){return $c(this,void 0,void 0,function*(){try{return{data:yield j5(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(hr(r))return{data:null,error:r};throw r}})}}class DJ extends RJ{constructor(t,r={},n,s){super(t,r,n,s)}from(t){return new MJ(this.url,this.headers,t,this.fetch)}}const LJ="2.58.0";let Qf="";typeof Deno<"u"?Qf="deno":typeof document<"u"?Qf="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Qf="react-native":Qf="node";const FJ={"X-Client-Info":`supabase-js-${Qf}/${LJ}`},BJ={headers:FJ},zJ={schema:"public"},UJ={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},WJ={};var HJ=function(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(u){try{d(n.next(u))}catch(f){o(f)}}function c(u){try{d(n.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):s(u.value).then(l,c)}d((n=n.apply(e,t||[])).next())})};const VJ=e=>{let t;return e?t=e:typeof fetch>"u"?t=o5:t=fetch,(...r)=>t(...r)},qJ=()=>typeof Headers>"u"?l5:Headers,GJ=(e,t,r)=>{const n=VJ(r),s=qJ();return(i,o)=>HJ(void 0,void 0,void 0,function*(){var l;const c=(l=yield t())!==null&&l!==void 0?l:e;let d=new s(o==null?void 0:o.headers);return d.has("apikey")||d.set("apikey",e),d.has("Authorization")||d.set("Authorization",`Bearer ${c}`),n(i,Object.assign(Object.assign({},o),{headers:d}))})};var KJ=function(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(u){try{d(n.next(u))}catch(f){o(f)}}function c(u){try{d(n.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):s(u.value).then(l,c)}d((n=n.apply(e,t||[])).next())})};function YJ(e){return e.endsWith("/")?e:e+"/"}function XJ(e,t){var r,n;const{db:s,auth:i,realtime:o,global:l}=e,{db:c,auth:d,realtime:u,global:f}=t,h={db:Object.assign(Object.assign({},c),s),auth:Object.assign(Object.assign({},d),i),realtime:Object.assign(Object.assign({},u),o),storage:{},global:Object.assign(Object.assign(Object.assign({},f),l),{headers:Object.assign(Object.assign({},(r=f==null?void 0:f.headers)!==null&&r!==void 0?r:{}),(n=l==null?void 0:l.headers)!==null&&n!==void 0?n:{})}),accessToken:()=>KJ(this,void 0,void 0,function*(){return""})};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}function QJ(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");
565if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(YJ(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const N5="2.72.0",Yc=30*1e3,q1=3,ow=q1*Yc,JJ="http://localhost:9999",ZJ="supabase.auth.token",eZ={"X-Client-Info":`gotrue-js/${N5}`},G1="X-Supabase-Api-Version",S5={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},tZ=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,rZ=10*60*1e3;class yC extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function Ye(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class nZ extends yC{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function aZ(e){return Ye(e)&&e.name==="AuthApiError"}class _5 extends yC{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class Yo extends yC{constructor(t,r,n,s){super(t,n,s),this.name=r,this.status=n}}class Vi extends Yo{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function sZ(e){return Ye(e)&&e.name==="AuthSessionMissingError"}class Tf extends Yo{constructor(){super("Auth session or user missing","AuthInvalidToken
565ResponseError",500,void 0)}}class ig extends Yo{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class og extends Yo{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function iZ(e){return Ye(e)&&e.name==="AuthImplicitGrantRedirectError"}class DA extends Yo{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class K1 extends Yo{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function lw(e){return Ye(e)&&e.name==="AuthRetryableFetchError"}class LA extends Yo{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class Y1 extends Yo{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Wv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),FA=` 566\r=`.split(""),oZ=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<FA.length;t+=1)e[FA[t].charCodeAt(0)]=-2;for(let t=0;t<Wv.length;t+=1)e[Wv[t].charCodeAt(0)]=t;return e})();function BA(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(Wv[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(Wv[n]),t.queuedBits-=6}}function C5(e,t,r){const n=oZ[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function zA(e){const t=[],r=o=>{t.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{dZ(o,n,r)};for(let o=0;o<e.length;o+=1)C5(e.charCodeAt(o),s,i);return t.join("")}function lZ(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function cZ(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}lZ(n,t)}}function dZ(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function uZ(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};for(let s=0;s<e.length;s+=1)C5(e.charCodeAt(s),r,n);return new Uint8Array(t)}function fZ(e){const t=[];return cZ(e,r=>t.push(r)),new Uint8Array(t)}function hZ(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};return e.forEach(s=>BA(s,r,n)),BA(null,r,n),t.join("")}function mZ(e){return Math.round(Date.now()/1e3)+e}function pZ(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}const ia=()=>typeof window<"u"&&typeof document<"u",ul={tested:!1,writable:!1},P5=()=>{if(!ia())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ul.tested)return ul.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),ul.tested=!0,ul.writable=!0}catch{ul.tested=!0,ul.writable=!1}return ul.writable};function gZ(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((s,i)=>{t[i]=s})}catch{}return r.searchParams.forEach((n,s)=>{t[s]=n}),t}const k5=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...r)=>Fo(async()=>{const{default:n}=await Promise.resolve().then(()=>Zu);return{default:n}},void 0).then(({default:n})=>n(...r)):t=fetch,(...r)=>t(...r)},vZ=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Xc=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},fl=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},Ui=async(e,t)=>{await e.removeItem(t)};class Ky{constructor(){this.promise=new Ky.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}Ky.promiseConstructor=Promise;function cw(e){const t=e.split(".");if(t.length!==3)throw new Y1("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!tZ.test(t[n]))throw new Y1("JWT not in base64url format");
566return{header:JSON.parse(zA(t[0])),payload:JSON.parse(zA(t[1])),signature:uZ(t[2]),raw:{header:t[0],payload:t[1]}}}async function xZ(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function yZ(e,t){return new Promise((n,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)){n(o);return}}catch(o){if(!t(i,o)){s(o);return}}})()})}function bZ(e){return("0"+e.toString(16)).substr(-2)}function wZ(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let i=0;i<56;i++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(t),Array.from(t,bZ).join("")}async function jZ(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function NZ(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const r=await jZ(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Rc(e,t,r=!1){const n=wZ();let s=n;r&&(s+="/PASSWORD_RECOVERY"),await Xc(e,`${t}-code-verifier`,s);const i=await NZ(n);return[i,n===i?"plain":"s256"]}const SZ=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function _Z(e){const t=e.headers.get(G1);if(!t||!t.match(SZ))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function CZ(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function PZ(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const kZ=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Dc(e){if(!kZ.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function dw(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function UA(e){return JSON.parse(JSON.stringify(e))}var AZ=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};const xl=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),EZ=[502,503,504];async function WA(e){var t;if(!vZ(e))throw new K1(xl(e),0);if(EZ.includes(e.status))throw new K1(xl(e),e.status);let r;try{r=await e.json()}catch(i){throw new _5(xl(i),i)}let n;const s=_Z(e);if(s&&s.getTime()>=S5["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new LA(xl(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new Vi}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((i,o)=>
566i&&typeof o=="string",!0))throw new LA(xl(r),e.status,r.weak_password.reasons);throw new nZ(xl(r),e.status||500,n)}const OZ=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),r))};async function rt(e,t,r,n){var s;const i=Object.assign({},n==null?void 0:n.headers);i[G1]||(i[G1]=S5["2024-01-01"].name),n!=null&&n.jwt&&(i.Authorization=`Bearer ${n.jwt}`);const o=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await TZ(e,t,r+l,{headers:i,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(c):{data:Object.assign({},c),error:null}}async function TZ(e,t,r,n,s,i){const o=OZ(t,n,s,i);let l;try{l=await e(r,Object.assign({},o))}catch(c){throw console.error(c),new K1(xl(c),0)}if(l.ok||await WA(l),n!=null&&n.noResolveJson)return l;try{return await l.json()}catch(c){await WA(c)}}function ps(e){var t;let r=null;RZ(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=mZ(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:n},error:null}}function HA(e){const t=ps(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function eo(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function MZ(e){return{data:e,error:null}}function IZ(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i}=e,o=AZ(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function $Z(e){return e}function RZ(e){return e.access_token&&e.refresh_token&&e.expires_in}const uw=["global","local","others"];var DZ=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};class LZ{constructor({url:t="",headers:r={},fetch:n}){this.url=t,this.headers=r,this.fetch=k5(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(t,r=uw[0]){if(uw.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${uw.join(", ")}`);try{return await rt(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Ye(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await rt(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:eo})}catch(n){if(Ye(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=DZ(t,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await rt(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:IZ,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(Ye(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await rt(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:eo})}catch(r){if(Ye(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,s,i,o,l,c;try{const d={nextPage:null,lastPage:0,total:0},u=await rt(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:$Z});if(u.error)throw u.error;const f=await u.json(),h=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,m=(c=(l=u.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(v=>{const p=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(v.split(";")[1].split("=")[1]);d[`${x}Page`]=p}),d.total=parseInt(h)),{data:Object.assign(Object.assign({},f),d),error:null}}catch(d){if(Ye(d))return{data:{users:[]},error:d};throw d}}async getUserById(t){Dc(t);try{return await rt(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:eo})}catch(r){if(Ye(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){Dc(t);try{return await rt(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:eo})}catch(n){if(Ye(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){Dc(t);
566try{return await rt(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:eo})}catch(n){if(Ye(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){Dc(t.userId);try{const{data:r,error:n}=await rt(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(Ye(r))return{data:null,error:r};throw r}}async _deleteFactor(t){Dc(t.userId),Dc(t.id);try{return{data:await rt(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(Ye(r))return{data:null,error:r};throw r}}}function VA(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}function FZ(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}const Lc={debug:!!(globalThis&&P5()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class A5 extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class BZ extends A5{}async function zZ(e,t,r){Lc.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const n=new globalThis.AbortController;return t>0&&setTimeout(()=>{n.abort(),Lc.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async s=>{if(s){Lc.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,s.name);try{return await r()}finally{Lc.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,s.name)}}else{if(t===0)throw Lc.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new BZ(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Lc.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}function E5(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function UZ(e){return parseInt(e,16)}function WZ(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function HZ(e){var t;const{chainId:r,domain:n,expirationTime:s,issuedAt:i=new Date,nonce:o,notBefore:l,requestId:c,resources:d,scheme:u,uri:f,version:h}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(h!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${h}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(` 567`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const m=E5(e.address),v=u?`${u}://${n}`:n,p=e.statement?`${e.statement} 568`:"",x=`${v} wants you to sign in with your Ethereum account: 569${m} 570 571${p}`;let b=`URI: ${f} 572Version: ${h} 573Chain ID: ${r}${o?` 574Nonce: ${o}`:""} 575Issued At: ${i.toISOString()}`;if(s&&(b+=` 576Expiration Time: ${s.toISOString()}`),l&&(b+=` 577Not Before: ${l.toISOString()}
577`),c&&(b+=` 578Request ID: ${c}`),d){let y=` 579Resources:`;for(const w of d){if(!w||typeof w!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${w}`);y+=` 580- ${w}`}b+=y}return`${x} 581${b}`}FZ();const VZ={url:JJ,storageKey:ZJ,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:eZ,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function qA(e,t,r){return await r()}const Fc={};class em{constructor(t){var r,n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=em.nextInstanceID,em.nextInstanceID+=1,this.instanceID>0&&ia()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const s=Object.assign(Object.assign({},VZ),t);if(this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.persistSession=s.persistSession,this.storageKey=s.storageKey,this.autoRefreshToken=s.autoRefreshToken,this.admin=new LZ({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=k5(s.fetch),this.lock=s.lock||qA,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,s.lock?this.lock=s.lock:ia()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=zZ:this.lock=qA,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:P5()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=VA(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=VA(this.memoryStorage)),ia()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}get jwks(){var t,r;return(r=(t=Fc[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){Fc[this.storageKey]=Object.assign(Object.assign({},Fc[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=Fc[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Fc[this.storageKey]=Object.assign(Object.assign({},Fc[this.storageKey]),{cachedAt:t})}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${N5}) ${new Date().toISOString()}`,...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{const r=gZ(window.location.href);let n="none";if(this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce"),ia()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:i}=await this._getSessionFromURL(r,n);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),iZ(i)){const c=(t=i.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:o,redirectType:l}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return Ye(r)?{error:r}:{error:new _5("Unexpected error during initialization",r)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,s;try{const i=await rt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:ps}),{data:o,error:l}=i;if(l||!o)return{data:{user:null,session:null},error:l};const c=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:d,session:c},error:null}}catch(i){if(Ye(i))return{data:{user:null,session:null},error:i};throw i}}async signUp(t){var r,n,s;try{let i;if("email"in t){const{email:u,password:f,options:h}=t;let m=null,v=null;this.flowType==="pkce"&&([m,v]=await Rc(this.storage,this.storageKey)),i=await rt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:u,password:f,data:(r=h==null?void 0:h.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:m,code_challenge_method:v},xform:ps})}else if("phone"in t){const{phone:u,password:f,options:h}=t;i=await rt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:f,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},channel:(s=h==null?void 0:h.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:ps})}else throw new ig("You must provide either an email or phone number and a password");const{data:o,error:l}=i;if(l||!o)return{data:{user:null,session:null},error:l};const c=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:d,session:c},error:null}}catch(i){if(Ye(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithPassword(t){try{let r;if("email"in t){const{email:i,password:o,options:l}=t;r=await rt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:HA})}else if("phone"in t){const{phone:i,password:o,options:l}=t;r=await rt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:HA})}else throw new ig("You must provide either an email or phone number and a password");const{data:n,error:s}=r;return s?{data:{user:null,session:null},error:s}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new Tf}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(r){if(Ye(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(t){var r,n,s,i;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,n,s,i,o,l,c,d,u,f,h;let m,v;if("message"in t)m=t.message,v=t.signature;else{const{chain:p,wallet:x,statement:b,options:y}=t;let w;if(ia())if(typeof x=="object")w=x;else{const P=window;if("ethereum"in P&&typeof P.ethereum=="object"&&"request"in P.ethereum&&typeof P.ethereum.request=="function")w=P.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof x!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=x}const _=new URL((r=y==null?void 0:y.url)!==null&&r!==void 0?r:window.location.href),N=await w.request({method:"eth_requestAccounts"}).then(P=>P).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!N||N.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const j=E5(N[0]);let S=(n=y==null?void 0:y.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!S){const P=await w.request({method:"eth_chainId"});S=UZ(P)}const C={domain:_.host,address:j,statement:b,uri:_.href,version:"1",chainId:S,nonce:(s=y==null?void 0:y.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(i=y==null?void 0:y.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=y==null?void 0:y.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=y==null?void 0:y.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(d=y==null?void 0:y.signInWithEthereum)===null||d===void 0?void 0:d.requestId,resources:(u=y==null?void 0:y.signInWithEthereum)===null||u===void 0?void 0:u.resources};m=HZ(C),v=await w.request({method:"personal_sign",params:[WZ(m),j]})}try{const{data:p,error:x}=await rt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:m,signature:v},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:ps});if(x)throw x;return!p||!p.session||!p.user?{data:{user:null,session:null},error:new Tf}:(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("SIGNED_IN",p.session)),{data:Object.assign({},p),error:x})}catch(p){if(Ye(p))return{data:{user:null,session:null},error:p};throw p}}async signInWithSolana(t){var r,n,s,i,o,l,c,d,u,f,h,m;let v,p;if("message"in t)v=t.message,p=t.signature;else{const{chain:x,wallet:b,statement:y,options:w}=t;let _;if(ia())if(typeof b=="object")_=b;else{const j=window;if("solana"in j&&typeof j.solana=="object"&&("signIn"in j.solana&&typeof j.solana.signIn=="function"||"signMessage"in j.solana&&typeof j.solana.signMessage=="function"))_=j.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");_=b}const N=new URL((r=w==null?void 0:w.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in _&&_.signIn){const j=await _.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:N.host,uri:N.href}),y?{statement:y}:null));let S;if(Array.isArray(j)&&j[0]&&typeof j[0]=="object")S=j[0];else if(j&&typeof j=="object"&&"signedMessage"in j&&"signature"in j)S=j;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in S&&"signature"in S&&(typeof S.signedMessage=="string"||S.signedMessage instanceof Uint8Array)&&S.signature instanceof Uint8Array)v=typeof S.signedMessage=="string"?S.signedMessage:new TextDecoder().decode(S.signedMessage),p=S.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in _)||typeof _.signMessage!="function"||!("publicKey"in _)||typeof _!="object"||!_.publicKey||!("toBase58"in _.publicKey)||typeof _.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");v=[`${N.host} wants you to sign in with your Solana account:`,_.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${N.href}`,`Issued At: ${(s=(n=w==null?void 0:w.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=w==null?void 0:w.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${w.signInWithSolana.notBefore}`]:[],...!((o=w==null?void 0:w.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${w.signInWithSolana.expirationTime}`]:[],...!((l=w==null?void 0:w.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${w.signInWithSolana.chainId}`]:[],...!((c=w==null?void 0:w.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${w.signInWithSolana.nonce}`]:[],...!((d=w==null?void 0:w.signInWithSolana)===null||d===void 0)&&d.requestId?[`Request ID: ${w.signInWithSolana.requestId}`]:[],...!((f=(u=w==null?void 0:w.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||f===void 0)&&f.length?["Resources",...w.sign
581InWithSolana.resources.map(S=>`- ${S}`)]:[]].join(` 582`);const j=await _.signMessage(new TextEncoder().encode(v),"utf8");if(!j||!(j instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");p=j}}try{const{data:x,error:b}=await rt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:v,signature:hZ(p)},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:ps});if(b)throw b;return!x||!x.session||!x.user?{data:{user:null,session:null},error:new Tf}:(x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),{data:Object.assign({},x),error:b})}catch(x){if(Ye(x))return{data:{user:null,session:null},error:x};throw x}}async _exchangeCodeForSession(t){const r=await fl(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{const{data:i,error:o}=await rt(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:ps});if(await Ui(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!i||!i.session||!i.user?{data:{user:null,session:null,redirectType:null},error:new Tf}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:o})}catch(i){if(Ye(i))return{data:{user:null,session:null,redirectType:null},error:i};throw i}}async signInWithIdToken(t){try{const{options:r,provider:n,token:s,access_token:i,nonce:o}=t,l=await rt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:ps}),{data:c,error:d}=l;return d?{data:{user:null,session:null},error:d}:!c||!c.session||!c.user?{data:{user:null,session:null},error:new Tf}:(c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),{data:c,error:d})}catch(r){if(Ye(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(t){var r,n,s,i,o;try{if("email"in t){const{email:l,options:c}=t;let d=null,u=null;this.flowType==="pkce"&&([d,u]=await Rc(this.storage,this.storageKey));const{error:f}=await rt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(r=c==null?void 0:c.data)!==null&&r!==void 0?r:{},create_user:(n=c==null?void 0:c.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:d,code_challenge_method:u},redirectTo:c==null?void 0:c.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in t){const{phone:l,options:c}=t,{data:d,error:u}=await rt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(s=c==null?void 0:c.data)!==null&&s!==void 0?s:{},create_user:(i=c==null?void 0:c.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:d==null?void 0:d.message_id},error:u}}throw new ig("You must provide either an email or phone number.")}catch(l){if(Ye(l))return{data:{user:null,session:null},error:l};throw l}}async verifyOtp(t){var r,n;try{let s,i;"options"in t&&(s=(r=t.options)===null||r===void 0?void 0:r.redirectTo,i=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:o,error:l}=await rt(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:ps});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,d=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),{data:{user:d,session:c},error:null}}catch(s){if(Ye(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithSSO(t){var r,n,s;try{let i=null,o=null;return this.flowType==="pkce"&&([i,o]=await Rc(this.storage,this.storageKey)),await rt(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(n=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:o}),headers:this.headers,xform:MZ})}catch(i){if(Ye(i))return{data:null,error:i};throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)throw n;if(!r)throw new Vi;const{error:s}=await rt(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:s}})}catch(t){if(Ye(t))return{data:{user:null,session:null},error:t};throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:n,type:s,options:i}=t,{error:o}=await rt(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in t){const{phone:n,type:s,options:i}=t,{data:o,error:l}=await rt(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l}}throw new ig("You must provide either an email or phone number and a type")}catch(r){if(Ye(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await fl(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not val
582id"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<ow:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){const o=await fl(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=dw()}if(this.storage.isServer&&t.user){let o=this.suppressGetSessionWarning;t=new Proxy(t,{get:(c,d,u)=>(!o&&d==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),o=!0,this.suppressGetSessionWarning=!0),Reflect.get(c,d,u))})}return{data:{session:t},error:null}}const{session:s,error:i}=await this._callRefreshToken(t.refresh_token);return i?{data:{session:null},error:i}:{data:{session:s},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await rt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:eo}):await this._useSession(async r=>{var n,s,i;const{data:o,error:l}=r;if(l)throw l;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Vi}:await rt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:eo})})}catch(r){if(Ye(r))return sZ(r)&&(await this._removeSession(),await Ui(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:s,error:i}=n;if(i)throw i;if(!s.session)throw new Vi;const o=s.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await Rc(this.storage,this.storageKey));const{data:d,error:u}=await rt(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:o.access_token,xform:eo});if(u)throw u;return o.user=d.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(n){if(Ye(n))return{data:{user:null},error:n};throw n}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Vi;const r=Date.now()/1e3;let n=r,s=!0,i=null;const{payload:o}=cw(t.access_token);if(o.exp&&(n=o.exp,s=n<=r),s){const{session:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return{data:{user:null,session:null},error:c};if(!l)return{data:{user:null,session:null},error:null};i=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)throw c;i={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(r){if(Ye(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var n;if(!t){const{data:o,error:l}=r;if(l)throw l;t=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new Vi;const{session:s,error:i}=await this._callRefreshToken(t.refresh_token);return i?{data:{user:null,session:null},error:i}:s?{data:{user:s.user,session:s},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if(Ye(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(t,r){try{if(!ia())throw new og("No browser detected.");
582if(t.error||t.error_description||t.error_code)throw new og(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new DA("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new og("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new DA("No code detected.");const{data:y,error:w}=await this._exchangeCodeForSession(t.code);if(w)throw w;const _=new URL(window.location.href);return _.searchParams.delete("code"),window.history.replaceState(window.history.state,"",_.toString()),{data:{session:y.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:s,access_token:i,refresh_token:o,expires_in:l,expires_at:c,token_type:d}=t;if(!i||!l||!o||!d)throw new og("No session defined in URL");const u=Math.round(Date.now()/1e3),f=parseInt(l);let h=u+f;c&&(h=parseInt(c));const m=h-u;m*1e3<=Yc&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${m}s, should have been closer to ${f}s`);const v=h-f;u-v>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",v,h,u):u-v<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",v,h,u);const{data:p,error:x}=await this._getUser(i);if(x)throw x;const b={provider_token:n,provider_refresh_token:s,access_token:i,expires_in:f,expires_at:h,refresh_token:o,token_type:d,user:p.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:b,redirectType:t.type},error:null}}catch(n){if(Ye(n))return{data:{session:null,redirectType:null},error:n};throw n}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await fl(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return{error:i};const o=(n=s.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!(aZ(l)&&(l.status===404||l.status===401||l.status===403)))return{error:l}}return t!=="others"&&(await this._removeSession(),await Ui(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){const r=pZ(),n={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,s;try{const{data:{session:i},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),console.error(i)}})}async resetPasswordForEmail(t,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await Rc(this.storage,this.storageKey,!0));try{return await rt(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(i){if(Ye(i))return{data:null,error:i};throw i}}async getUserIdentities(){var t;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null}}catch(r){if(Ye(r))return{data:null,error:r};throw r}}async linkIdentity(t){var r;try{const{data:n,error:s}=await this._useSession(async i=>{var o,l,c,d,u;const{data:f,error:h}=i;if(h)throw h;const m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await rt(this.fetch,"GET",m,{headers:this.headers,jwt:(u=(d=f.session)===null||d===void 0?void 0:d.access_token)!==null&&u!==void 0?u:void 0})});if(s)throw s;return ia()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),{data:{provider:t.provider,url:n==null?void 0:n.url},error:null}}catch(n){if(Ye(n))return{data:{provider:t.provider,url:null},error:n};throw n}}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,s;const{data:i,error:o}=r;if(o)throw o;
582return await rt(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(n=i.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(Ye(r))return{data:null,error:r};throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await yZ(async s=>(s>0&&await xZ(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await rt(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:ps})),(s,i)=>{const o=200*Math.pow(2,s);return i&&lw(i)&&Date.now()+o-n<Yc})}catch(n){if(this._debug(r,"error",n),Ye(n))return{data:{session:null,user:null},error:n};throw n}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",n),ia()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:t,url:n},error:null}}async _recoverAndRefresh(){var t,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await fl(this.storage,this.storageKey);if(s&&this.userStorage){let o=await fl(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await Xc(this.userStorage,this.storageKey+"-user",o)),s.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:dw()}else if(s&&!s.user&&!s.user){const o=await fl(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await Ui(this.storage,this.storageKey+"-user"),await Xc(this.storage,this.storageKey,s)):s.user=dw()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const i=((r=s.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<ow;if(this._debug(n,`session has${i?"":" not"} expired with margin of ${ow}
582s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),lw(o)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(s.access_token);!l&&(o!=null&&o.user)?(s.user=o.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(n,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var r,n;if(!t)throw new Vi;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Ky;const{data:i,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!i.session)throw new Vi;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const l={session:i.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(i){if(this._debug(s,"error",i),Ye(i)){const o={session:null,error:i};return lw(i)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,r,n=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:t,session:r});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,r)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let l=0;l<i.length;l+=1)console.error(i[l]);throw i[0]}}finally{this._debug(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;const r=Object.assign({},t),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await Xc(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const i=UA(s);await Xc(this.storage,this.storageKey,i)}else{const s=UA(r);await Xc(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),await Ui(this.storage,this.storageKey),await Ui(this.storage,this.storageKey+"-code-verifier"),await Ui(this.storage,this.storageKey+"-user"),this.userStorage&&await Ui(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ia()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Yc);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-t)/Yc);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Yc}ms, refresh threshold is ${q1} ticks`),s<=q1&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof A5)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ia()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(-1,async()=>
582{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[i,o]=await Rc(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(l.toString())}if(n!=null&&n.queryParams){const i=new URLSearchParams(n.queryParams);s.push(i.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;return i?{data:null,error:i}:await rt(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(Ye(r))return{data:null,error:r};throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,s;const{data:i,error:o}=r;if(o)return{data:null,error:o};const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:{issuer:t.issuer}),{data:c,error:d}=await rt(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return d?{data:null,error:d}:(t.factorType==="totp"&&(!((s=c==null?void 0:c.totp)===null||s===void 0)&&s.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),{data:c,error:null})})}catch(r){if(Ye(r))return{data:null,error:r};throw r}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return{data:null,error:i};const{data:o,error:l}=await rt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:{code:t.code,challenge_id:t.challengeId},headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return l?{data:null,error:l}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:l})})}catch(r){if(Ye(r))return{data:null,error:r};throw r}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;return i?{data:null,error:i}:await rt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:{channel:t.channel},headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(Ye(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?{data:null,error:n}:await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){const{data:{user:t},error:r}=await this.getUser();if(r)return{data:null,error:r};const n=(t==null?void 0:t.factors)||[],s=n.filter(o=>o.factor_type==="totp"&&o.status==="verified"),i=n.filter(o=>o.factor_type==="phone"&&o.status==="verified");return{data:{all:n,totp:s,phone:i},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async t=>{var r,n;const{data:{session:s},error:i}=t;if(i)return{data:null,error:i};if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:o}=cw(s.access_token);let l=null;o.aal&&(l=o.aal);let c=l;((n=(r=s.user.factors)===null||r===void 0?void 0:r.filter(f=>f.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(c="aal2");const u=o.amr||[];return{data:{currentLevel:l,nextLevel:c,currentAuthenticationMethods:u},error:null}}))}async fetchJwk(t,r={keys:[]}){let n=r.keys.find(l=>l.kid===t);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(l=>l.kid===t),n&&this.jwks_cached_at+rZ>s)return n;const{data:i,error:o}=await rt(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=s,n=i.keys.find(l=>l.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:m,error:v}
582=await this.getSession();if(v||!m.session)return{data:null,error:v};n=m.session.access_token}const{header:s,payload:i,signature:o,raw:{header:l,payload:c}}=cw(n);r!=null&&r.allowExpired||CZ(i.exp);const d=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!d){const{error:m}=await this.getUser(n);if(m)throw m;return{data:{claims:i,header:s,signature:o},error:null}}const u=PZ(s.alg),f=await crypto.subtle.importKey("jwk",d,u,!0,["verify"]);if(!await crypto.subtle.verify(u,f,o,fZ(`${l}.${c}`)))throw new Y1("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(n){if(Ye(n))return{data:null,error:n};throw n}}}em.nextInstanceID=0;const qZ=em;class GZ extends qZ{constructor(t){super(t)}}var KZ=function(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(u){try{d(n.next(u))}catch(f){o(f)}}function c(u){try{d(n.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):s(u.value).then(l,c)}d((n=n.apply(e,t||[])).next())})};class YZ{constructor(t,r,n){var s,i,o;this.supabaseUrl=t,this.supabaseKey=r;const l=QJ(t);if(!r)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",l),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",l),this.storageUrl=new URL("storage/v1",l),this.functionsUrl=new URL("functions/v1",l);const c=`sb-${l.hostname.split(".")[0]}-auth-token`,d={db:zJ,realtime:WJ,auth:Object.assign(Object.assign({},UJ),{storageKey:c}),global:BJ},u=XJ(n??{},d);this.storageKey=(s=u.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(i=u.global.headers)!==null&&i!==void 0?i:{},u.accessToken?(this.accessToken=u.accessToken,this.auth=new Proxy({},{get:(f,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=u.auth)!==null&&o!==void 0?o:{},this.headers,u.global.fetch),this.fetch=GJ(r,this._getAccessToken.bind(this),u.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},u.realtime)),this.rest=new nJ(new URL("rest/v1",l).href,{headers:this.headers,schema:u.db.schema,fetch:this.fetch}),this.storage=new DJ(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),u.accessToken||this._listenForAuthEvents()}get functions(){return new $Q(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,r={},n={}){return this.rest.rpc(t,r,n)}channel(t,r={config:{}}){return this.realtime.channel(t,r)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var t,r;return KZ(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:n}=yield this.auth.getSession();return(r=(t=n.session)===null||t===void 0?void 0:t.access_token)!==null&&r!==void 0?r:this.supabaseKey})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:r,detectSessionInUrl:n,storage:s,userStorage:i,storageKey:o,flowType:l,lock:c,debug:d},u,f){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new GZ({url:this.authUrl.href,headers:Object.assign(Object.assign({},h),u),storageKey:o,autoRefreshToken:t,persistSession:r,detectSessionInUrl:n,storage:s,userStorage:i,flowType:l,lock:c,debug:d,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(m=>m.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new bJ(this.realtimeUrl.href,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n==null?void 0:n.access_token)})}_handleTokenChanged(t,r,n){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const O5=(e,t,r)=>new YZ(e,t,r);function XZ(){if(typeof window<"u"||typeof process>"u")return!1;const e=process.version;if(e==null)return!1;const t=e.match(/^v(\d+)\./);return t?parseInt(t[1],10)<=18:!1}XZ()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to N
582ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const QZ="https://inmykxarbjptsgqibnbs.supabase.co",JZ="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImlubXlreGFyYmpwdHNncWlibmJzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTg4MzM0OTcsImV4cCI6MjA3NDQwOTQ5N30.1Iui3SJ147OrAZ7DJfhVoW_KUQmr5aGoFugJJVEEtaM",Z=O5(QZ,JZ),ZZ=Object.freeze(Object.defineProperty({__proto__:null,supabase:Z},Symbol.toStringTag,{value:"Module"})),T5=g.createContext(void 0),eee=({children:e})=>{const[t,r]=g.useState(null),[n,s]=g.useState(null),[i,o]=g.useState(!0);g.useEffect(()=>{let u=!0;const{data:{subscription:f}}=Z.auth.onAuthStateChange((m,v)=>{var p;if(u){if(console.log("Auth state changed:",m,(p=v==null?void 0:v.user)==null?void 0:p.email),m==="TOKEN_REFRESHED"&&!v){console.warn("Token refresh failed - clearing corrupted session"),setTimeout(async()=>{await Z.auth.signOut(),u&&(s(null),r(null),o(!1))},0);return}if(m==="SIGNED_OUT"||m==="USER_DELETED"){console.log("User signed out or deleted - clearing session"),s(null),r(null),o(!1);return}s(v),r((v==null?void 0:v.user)??null),o(!1),m==="TOKEN_REFRESHED"&&v&&console.log("Token refreshed successfully")}});return(async()=>{var m,v;try{const{data:{session:p},error:x}=await Z.auth.getSession();u&&(x?(console.error("Error getting session:",x),((m=x.message)!=null&&m.includes("invalid")||(v=x.message)!=null&&v.includes("JWT"))&&(console.warn("Clearing corrupted session due to JWT error"),await Z.auth.signOut(),s(null),r(null))):(s(p),r((p==null?void 0:p.user)??null)),o(!1))}catch(p){console.error("Exception getting session:",p),u&&(s(null),r(null),o(!1))}})(),()=>{u=!1,f.unsubscribe()}},[]);const l=async(u,f,h,m)=>{const v=`${window.location.origin}/`,{error:p}=await Z.auth.signUp({email:u,password:f,options:{emailRedirectTo:v,data:{company_name:h,role:m}}});return{error:p}},c=async(u,f)=>{var h,m;try{const{error:v}=await Z.auth.getSession();((h=v==null?void 0:v.message)!=null&&h.includes("invalid")||(m=v==null?void 0:v.message)!=null&&m.includes("JWT"))&&(console.warn("Clearing corrupted session before login"),await Z.auth.signOut());const{data:p,error:x}=await Z.auth.signInWithPassword({email:u,password:f});return x?console.error("Sign in error:",x.message):p.session&&console.log("Sign in successful, session established"),{error:x}}catch(v){return console.error("Sign in exception:",v),{error:v}}},d=async()=>{try{await Z.auth.signOut(),console.log("Sign out successful")}catch(u){console.error("Sign out error:",u),s(null),r(null)}};return a.jsx(T5.Provider,{value:{user:t,session:n,loading:i,signUp:l,signIn:c,signOut:d},children:e})},it=()=>{const e=g.useContext(T5);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e},J=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:me("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));J.displayName="Card";const de=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:me("flex flex-col space-y-1.5 p-6",e),...t}));de.displayName="CardHeader";const le=g.forwardRef(({className:e,...t},r)=>a.jsx("h3",{ref:r,className:me("text-2xl font-semibold leading-none tracking-tight",e),...t}));le.displayName="CardTitle";const nt=g.forwardRef(({className:e,...t},r)=>a.jsx("p",{ref:r,className:me("text-sm text-muted-foreground",e),...t}));nt.displayName="CardDescription";const re=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:me("p-6 pt-0",e),...t}));re.displayName="CardContent";const M5=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:me("flex items-center p-6 pt-0",e),...t}));M5.displayName="CardFooter";function lg({title:e,value:t,change:r,changeType:n="neutral",icon:s}){const i={positive:"text-success",negative:"text-error",neutral:"text-muted-foreground"}[n];return a.jsxs(J,{className:"glass-card hover-lift transition-all duration-300",children:[a.jsxs(de,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(le,{className:"text-sm font-medium text-muted-foreground",children:e}),a.jsx(s,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(re,{children:[a.jsx("div",{className:"text-2xl font-bold",children:t}),r&&a.jsx("p",{className:`text-xs ${i} mt-1`,children:r})]})]})}var tee=Array.isArray,Dn=tee,ree=typeof en=="object"&&en&&en.Object===Object&&en,I5=ree,nee=I5,aee=typeof self=="object"&&self&&self.Object===Object&&self,see=nee||aee||Function("return this")(),zs=see,iee=zs,oee=iee.Symbol,cp=oee,GA=cp,$5=Object.prototype,lee=$5.hasOwnProperty,cee=$5.toString,Mf=GA?GA.toStringTag:void 0;function dee(e){var t=lee.call(e,Mf),r=e[Mf];try{e[Mf]=void 0;var n=!0}catch{}var s=cee.call(e);return n&&(t?e[Mf]=r:delete e[Mf]),s}var uee=dee,fee=Object.prototype,hee=fee.toString;function mee(e){return hee.call(e)}var pee=mee,KA=cp,gee=uee,vee=pee,xee="[object Null]",yee="[object Undef
582ined]",YA=KA?KA.toStringTag:void 0;function bee(e){return e==null?e===void 0?yee:xee:YA&&YA in Object(e)?gee(e):vee(e)}var Oi=bee;function wee(e){return e!=null&&typeof e=="object"}var Ti=wee,jee=Oi,Nee=Ti,See="[object Symbol]";function _ee(e){return typeof e=="symbol"||Nee(e)&&jee(e)==See}var tf=_ee,Cee=Dn,Pee=tf,kee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Aee=/^\w*$/;function Eee(e,t){if(Cee(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Pee(e)?!0:Aee.test(e)||!kee.test(e)||t!=null&&e in Object(t)}var bC=Eee;function Oee(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Xo=Oee;const rf=mt(Xo);var Tee=Oi,Mee=Xo,Iee="[object AsyncFunction]",$ee="[object Function]",Ree="[object GeneratorFunction]",Dee="[object Proxy]";function Lee(e){if(!Mee(e))return!1;var t=Tee(e);return t==$ee||t==Ree||t==Iee||t==Dee}var wC=Lee;const Fe=mt(wC);var Fee=zs,Bee=Fee["__core-js_shared__"],zee=Bee,fw=zee,XA=function(){var e=/[^.]+$/.exec(fw&&fw.keys&&fw.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Uee(e){return!!XA&&XA in e}var Wee=Uee,Hee=Function.prototype,Vee=Hee.toString;function qee(e){if(e!=null){try{return Vee.call(e)}catch{}try{return e+""}catch{}}return""}var R5=qee,Gee=wC,Kee=Wee,Yee=Xo,Xee=R5,Qee=/[\\^$.*+?()[\]{}|]/g,Jee=/^\[object .+?Constructor\]$/,Zee=Function.prototype,ete=Object.prototype,tte=Zee.toString,rte=ete.hasOwnProperty,nte=RegExp("^"+tte.call(rte).replace(Qee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ate(e){if(!Yee(e)||Kee(e))return!1;var t=Gee(e)?nte:Jee;return t.test(Xee(e))}var ste=ate;function ite(e,t){return e==null?void 0:e[t]}var ote=ite,lte=ste,cte=ote;function dte(e,t){var r=cte(e,t);return lte(r)?r:void 0}var jc=dte,ute=jc,fte=ute(Object,"create"),Yy=fte,QA=Yy;function hte(){this.__data__=QA?QA(null):{},this.size=0}var mte=hte;function pte(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var gte=pte,vte=Yy,xte="__lodash_hash_undefined__",yte=Object.prototype,bte=yte.hasOwnProperty;function wte(e){var t=this.__data__;if(vte){var r=t[e];return r===xte?void 0:r}return bte.call(t,e)?t[e]:void 0}var jte=wte,Nte=Yy,Ste=Object.prototype,_te=Ste.hasOwnProperty;function Cte(e){var t=this.__data__;return Nte?t[e]!==void 0:_te.call(t,e)}var Pte=Cte,kte=Yy,Ate="__lodash_hash_undefined__";function Ete(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=kte&&t===void 0?Ate:t,this}var Ote=Ete,Tte=mte,Mte=gte,Ite=jte,$te=Pte,Rte=Ote;function nf(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}nf.prototype.clear=Tte;nf.prototype.delete=Mte;nf.prototype.get=Ite;nf.prototype.has=$te;nf.prototype.set=Rte;var Dte=nf;function Lte(){this.__data__=[],this.size=0}var Fte=Lte;function Bte(e,t){return e===t||e!==e&&t!==t}var jC=Bte,zte=jC;function Ute(e,t){for(var r=e.length;r--;)if(zte(e[r][0],t))return r;return-1}var Xy=Ute,Wte=Xy,Hte=Array.prototype,Vte=Hte.splice;function qte(e){var t=this.__data__,r=Wte(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Vte.call(t,r,1),--this.size,!0}var Gte=qte,Kte=Xy;function Yte(e){var t=this.__data__,r=Kte(t,e);return r<0?void 0:t[r][1]}var Xte=Yte,Qte=Xy;function Jte(e){return Qte(this.__data__,e)>-1}var Zte=Jte,ere=Xy;function tre(e,t){var r=this.__data__,n=ere(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var rre=tre,nre=Fte,are=Gte,sre=Xte,ire=Zte,ore=rre;function af(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}af.prototype.clear=nre;af.prototype.delete=are;af.prototype.get=sre;af.prototype.has=ire;af.prototype.set=ore;var Qy=af,lre=jc,cre=zs,dre=lre(cre,"Map"),NC=dre,JA=Dte,ure=Qy,fre=NC;function hre(){this.size=0,this.__data__={hash:new JA,map:new(fre||ure),string:new JA}}var mre=hre;function pre(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var gre=pre,vre=gre;function xre(e,t){var r=e.__data__;return vre(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Jy=xre,yre=Jy;function bre(e){var t=yre(this,e).delete(e);return this.size-=t?1:0,t}var wre=bre,jre=Jy;function Nre(e){return jre(this,e).get(e)}var Sre=Nre,_re=Jy;function Cre(e){return _re(this,e).has(e)}var Pre=Cre,kre=Jy;function Are(e,t){var r=kre(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var Ere=Are,Ore=mre,Tre=wre,Mre=Sre,Ire=Pre,$re=Ere;function sf(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}sf.prototype.clear=Ore;sf.prototype.delete=Tre;sf.prototype.get=Mre;sf.prototype.has=Ire;sf.prototype.set=$re;var SC=sf,D5=SC,Rre="Expected a function";function _C(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Rre);var r=function(){var n=arguments,s=t?t.apply(this,n):n[0],i=r.cache;if(i.has(s))return i.get(s);var o=e.apply(this,n);return r.cache=i.set(s,o)||i,o};return r.cache=new(_C.Cache||D5),r}_C.Cache=D5;var L5=_C;const Dre=mt(L5);var Lre=L5,Fre=500;function Bre(e){var t=Lre(e,function(n){return r.size===Fre&&r.clear(),n}
vendor: 7,022 bytes, lines 582-590
582),r=t.cache;return t}var zre=Bre,Ure=zre,Wre=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Hre=/\\(\\)?/g,Vre=Ure(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Wre,function(r,n,s,i){t.push(s?i.replace(Hre,"$1"):n||r)}),t}),qre=Vre;function Gre(e,t){for(var r=-1,n=e==null?0:e.length,s=Array(n);++r<n;)s[r]=t(e[r],r,e);return s}var CC=Gre,ZA=cp,Kre=CC,Yre=Dn,Xre=tf,Qre=1/0,eE=ZA?ZA.prototype:void 0,tE=eE?eE.toString:void 0;function F5(e){if(typeof e=="string")return e;if(Yre(e))return Kre(e,F5)+"";if(Xre(e))return tE?tE.call(e):"";var t=e+"";return t=="0"&&1/e==-Qre?"-0":t}var Jre=F5,Zre=Jre;function ene(e){return e==null?"":Zre(e)}var B5=ene,tne=Dn,rne=bC,nne=qre,ane=B5;function sne(e,t){return tne(e)?e:rne(e,t)?[e]:nne(ane(e))}var z5=sne,ine=tf,one=1/0;function lne(e){if(typeof e=="string"||ine(e))return e;var t=e+"";return t=="0"&&1/e==-one?"-0":t}var Zy=lne,cne=z5,dne=Zy;function une(e,t){t=cne(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[dne(t[r++])];return r&&r==n?e:void 0}var PC=une,fne=PC;function hne(e,t,r){var n=e==null?void 0:fne(e,t);return n===void 0?r:n}var U5=hne;const Yn=mt(U5);function mne(e){return e==null}var pne=mne;const Le=mt(pne);var gne=Oi,vne=Dn,xne=Ti,yne="[object String]";function bne(e){return typeof e=="string"||!vne(e)&&xne(e)&&gne(e)==yne}var wne=bne;const oc=mt(wne);var W5={exports:{}},Pt={};/** 583 * @license React 584 * react-is.production.min.js 585 * 586 * Copyright (c) Facebook, Inc. and its affiliates. 587 * 588 * This source code is licensed under the MIT license found in the 589 * LICENSE file in the root directory of this source tree. 590 */var kC=Symbol.for("react.element"),AC=Symbol.for("react.portal"),eb=Symbol.for("react.fragment"),tb=Symbol.for("react.strict_mode"),rb=Symbol.for("react.profiler"),nb=Symbol.for("react.provider"),ab=Symbol.for("react.context"),jne=Symbol.for("react.server_context"),sb=Symbol.for("react.forward_ref"),ib=Symbol.for("react.suspense"),ob=Symbol.for("react.suspense_list"),lb=Symbol.for("react.memo"),cb=Symbol.for("react.lazy"),Nne=Symbol.for("react.offscreen"),H5;H5=Symbol.for("react.module.reference");function Ca(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case kC:switch(e=e.type,e){case eb:case rb:case tb:case ib:case ob:return e;default:switch(e=e&&e.$$typeof,e){case jne:case ab:case sb:case cb:case lb:case nb:return e;default:return t}}case AC:return t}}}Pt.ContextConsumer=ab;Pt.ContextProvider=nb;Pt.Element=kC;Pt.ForwardRef=sb;Pt.Fragment=eb;Pt.Lazy=cb;Pt.Memo=lb;Pt.Portal=AC;Pt.Profiler=rb;Pt.StrictMode=tb;Pt.Suspense=ib;Pt.SuspenseList=ob;Pt.isAsyncMode=function(){return!1};Pt.isConcurrentMode=function(){return!1};Pt.isContextConsumer=function(e){return Ca(e)===ab};Pt.isContextProvider=function(e){return Ca(e)===nb};Pt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===kC};Pt.isForwardRef=function(e){return Ca(e)===sb};Pt.isFragment=function(e){return Ca(e)===eb};Pt.isLazy=function(e){return Ca(e)===cb};Pt.isMemo=function(e){return Ca(e)===lb};Pt.isPortal=function(e){return Ca(e)===AC};Pt.isProfiler=function(e){return Ca(e)===rb};Pt.isStrictMode=function(e){return Ca(e)===tb};Pt.isSuspense=function(e){return Ca(e)===ib};Pt.isSuspenseList=function(e){return Ca(e)===ob};Pt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===eb||e===rb||e===tb||e===ib||e===ob||e===Nne||typeof e=="object"&&e!==null&&(e.$$typeof===cb||e.$$typeof===lb||e.$$typeof===nb||e.$$typeof===ab||e.$$typeof===sb||e.$$typeof===H5||e.getModuleId!==void 0)};Pt.typeOf=Ca;W5.exports=Pt;var Sne=W5.exports,_ne=Oi,Cne=Ti,Pne="[object Number]";function kne(e){return typeof e=="number"||Cne(e)&&_ne(e)==Pne}var V5=kne;const Ane=mt(V5);var Ene=V5;function One(e){return Ene(e)&&e!=+e}var Tne=One;const of=mt(Tne);var fn=function(t){return t===0?0:t>0?1:-1},El=function(t){return oc(t)&&t.indexOf("%")===t.length-1},xe=function(t){return Ane(t)&&!of(t)},Mne=function(t){return Le(t)},Sr=function(t){return xe(t)||oc(t)},Ine=0,Qo=function(t){var r=++Ine;return"".concat(t||"").concat(r)},hn=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!xe(t)&&!oc(t))return n;var i;if(El(t)){var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return of(i)&&(i=n),s&&i>r&&(i=r),i},to=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},$ne=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},s=0;s<r;s++)if(!n[t[s]])n[t[s]]=!0;else return!0;return!1},rr=function(t,r){return xe(t)&&xe(r)?function(n){return t+n*(r-t)}:function(){return r}};function Hv(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):Yn(n,t))===r})}var Rne=function(t){if(!t||!t.length)return null;for(var r=t.length,n=0,s=0,i=0,o=0,l=1/0,c=-1/0,d=0,u=0,f=0;f<r;f++)d=t[f].cx||0,u=t[f].cy||0,n+=d,s+=u,i+=d*u,o+=d*d,l=Math.min(l,d),c=Math.max(c,d);var h=r*o!==n*n?(r*i-n*s)/(r*o-n*n):0;return{xmin:l,xmax:c,a:h,b:(s-h*n)/r}},Dne=function(t,r){return xe(t)&&xe(r)?t-r:oc(t)&&oc(r)?t.localeCompare(r):t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():String(t).localeCompare(String(r))};function kd(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function X1(e){"@babel/helpers - typeof";return X1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},X1(e)}var Lne=["viewBox","children"],Fne=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRen
590dering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],rE=["points","pathLength"],hw={svg:Lne,polygon:rE,polyline:rE},EC=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDrag
590Capture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Vv=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(g.isValidElement(t)&&(n=t.props),!rf(n))return null;var s={};return Object.keys(n).forEach(function(i){EC.includes(i)&&(s[i]=r||function(o){return n[i](n,o)})}),s},Bne=function(t,r,n){return function(s){return t(r,n,s),null}},Bo=function(t,r,n){if(!rf(t)||X1(t)!=="object")return null;var s=null;return Object.keys(t).forEach(function(i){var o=t[i];EC.includes(i)&&typeof o=="function"&&(s||(s={}),s[i]=Bne(o,r,n))}),s},zne=["children"],Une=["children"];function nE(e,t){if(e==null)return{};var r=Wne(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Wne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Q1(e){"@babel/helpers - typeof";return Q1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q1(e)}var aE={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},ui=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},sE=null,mw=null,OC=function e(t){if(t===sE&&Array.isArray(mw))return mw;var r=[];return g.Children.forEach(t,function(n){Le(n)||(Sne.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),mw=r,sE=t,r};function vn(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(s){return ui(s)}):n=[ui(t)],OC(e).forEach(function(s){var i=Yn(s,"type.displayName")||Yn(s,"type.name");n.indexOf(i)!==-1&&r.push(s)}),r}function zn(e,t){var r=vn(e,t);return r&&r[0]}var iE=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,s=r.height;return!(!xe(n)||n<=0||!xe(s)||s<=0)},Hne=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Vne=function(t){return t&&t.type&&oc(t.type)&&Hne.indexOf(t.type)>=0},q5=function(t){return t&&Q1(t)==="object"&&"clipDot"in t},qne=function(t,r,n,s){var i,o=(i=hw==null?void 0:hw[s])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!Fe(t)&&(s&&o.includes(r)||Fne.includes(r))||n&&EC.includes(r)},Ae=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(g.isValidElement(t)&&(s=t.props),!rf(s))return null;var i={};
590return Object.keys(s).forEach(function(o){var l;qne((l=s)===null||l===void 0?void 0:l[o],o,r,n)&&(i[o]=s[o])}),i},J1=function e(t,r){if(t===r)return!0;var n=g.Children.count(t);if(n!==g.Children.count(r))return!1;if(n===0)return!0;if(n===1)return oE(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var s=0;s<n;s++){var i=t[s],o=r[s];if(Array.isArray(i)||Array.isArray(o)){if(!e(i,o))return!1}else if(!oE(i,o))return!1}return!0},oE=function(t,r){if(Le(t)&&Le(r))return!0;if(!Le(t)&&!Le(r)){var n=t.props||{},s=n.children,i=nE(n,zne),o=r.props||{},l=o.children,c=nE(o,Une);return s&&l?kd(i,c)&&J1(s,l):!s&&!l?kd(i,c):!1}return!1},lE=function(t,r){var n=[],s={};return OC(t).forEach(function(i,o){if(Vne(i))n.push(i);else if(i){var l=ui(i.type),c=r[l]||{},d=c.handler,u=c.once;if(d&&(!u||!s[l])){var f=d(i,l,o);n.push(f),s[l]=!0}}}),n},Gne=function(t){var r=t&&t.type;return r&&aE[r]?aE[r]:null},Kne=function(t,r){return OC(r).indexOf(t)},Yne=["children","width","height","viewBox","className","style","title","desc"];function Z1(){return Z1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Z1.apply(this,arguments)}function Xne(e,t){if(e==null)return{};var r=Qne(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Qne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function eN(e){var t=e.children,r=e.width,n=e.height,s=e.viewBox,i=e.className,o=e.style,l=e.title,c=e.desc,d=Xne(e,Yne),u=s||{width:r,height:n,x:0,y:0},f=qe("recharts-surface",i);return I.createElement("svg",Z1({},Ae(d,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),I.createElement("title",null,l),I.createElement("desc",null,c),t)}var Jne=["children","className"];function tN(){return tN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tN.apply(this,arguments)}function Zne(e,t){if(e==null)return{};var r=eae(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function eae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Xe=I.forwardRef(function(e,t){var r=e.children,n=e.className,s=Zne(e,Jne),i=qe("recharts-layer",n);return I.createElement("g",tN({className:i},Ae(s,!0),{ref:t}),r)}),ts=function(t,r){for(var n=arguments.length,s=new Array(n>2?n-2:0),i=2;i<n;i++)s[i-2]=arguments[i]};function tae(e,t,r){var n=-1,s=e.length;t<0&&(t=-t>s?0:s+t),r=r>s?s:r,r<0&&(r+=s),s=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(s);++n<s;)i[n]=e[n+t];return i}var rae=tae,nae=rae;function aae(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:nae(e,t,r)}var sae=aae,iae="\\ud800-\\udfff",oae="\\u0300-\\u036f",lae="\\ufe20-\\ufe2f",cae="\\u20d0-\\u20ff",dae=oae+lae+cae,uae="\\ufe0e\\ufe0f",fae="\\u200d",hae=RegExp("["+fae+iae+dae+uae+"]");function mae(e){return hae.test(e)}var G5=mae;function pae(e){return e.split("")}var gae=pae,K5="\\ud800-\\udfff",vae="\\u0300-\\u036f",xae="\\ufe20-\\ufe2f",yae="\\u20d0-\\u20ff",bae=vae+xae+yae,wae="\\ufe0e\\ufe0f",jae="["+K5+"]",rN="["+bae+"]",nN="\\ud83c[\\udffb-\\udfff]",Nae="(?:"+rN+"|"+nN+")",Y5="[^"+K5+"]",X5="(?:\\ud83c[\\udde6-\\uddff]){2}",Q5="[\\ud800-\\udbff][\\udc00-\\udfff]",Sae="\\u200d",J5=Nae+"?",Z5="["+wae+"]?",_ae="(?:"+Sae+"(?:"+[Y5,X5,Q5].join("|")+")"+Z5+J5+")*",Cae=Z5+J5+_ae,Pae="(?:"+[Y5+rN+"?",rN,X5,Q5,jae].join("|")+")",kae=RegExp(nN+"(?="+nN+")|"+Pae+Cae,"g");function Aae(e){return e.match(kae)||[]}var Eae=Aae,Oae=gae,Tae=G5,Mae=Eae;function Iae(e){return Tae(e)?Mae(e):Oae(e)}var $ae=Iae,Rae=sae,Dae=G5,Lae=$ae,Fae=B5;function Bae(e){return function(t){t=Fae(t);var r=Dae(t)?Lae(t):void 0,n=r?r[0]:t.charAt(0),s=r?Rae(r,1).join(""):t.slice(1);return n[e]()+s}}var zae=Bae,Uae=zae,Wae=Uae("toUpperCase"),Hae=Wae;const db=mt(Hae);function $t(e){return function(){return e}}const e3=Math.cos,qv=Math.sin,cs=Math.sqrt,Gv=Math.PI,ub=2*Gv,aN=Math.PI,sN=2*aN,yl=1e-6,Vae=sN-yl;function t3(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function qae(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return t3;const r=10**t;return function(n){this._+=n[0];for(let s=1,i=n.length;s<i;++s)this._+=Math.round(arguments[s]*r)/r+n[s]}}class Gae{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?t3:qae(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,s){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+s}`}bezierCurveTo(t,r,n,s,i,o){this._append`C${+t},${+r},${+n}
590,${+s},${this._x1=+i},${this._y1=+o}`}arcTo(t,r,n,s,i){if(t=+t,r=+r,n=+n,s=+s,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,l=this._y1,c=n-t,d=s-r,u=o-t,f=l-r,h=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>yl)if(!(Math.abs(f*c-d*u)>yl)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let m=n-o,v=s-l,p=c*c+d*d,x=m*m+v*v,b=Math.sqrt(p),y=Math.sqrt(h),w=i*Math.tan((aN-Math.acos((p+h-x)/(2*b*y)))/2),_=w/y,N=w/b;Math.abs(_-1)>yl&&this._append`L${t+_*u},${r+_*f}`,this._append`A${i},${i},0,0,${+(f*m>u*v)},${this._x1=t+N*c},${this._y1=r+N*d}`}}arc(t,r,n,s,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(s),c=n*Math.sin(s),d=t+l,u=r+c,f=1^o,h=o?s-i:i-s;this._x1===null?this._append`M${d},${u}`:(Math.abs(this._x1-d)>yl||Math.abs(this._y1-u)>yl)&&this._append`L${d},${u}`,n&&(h<0&&(h=h%sN+sN),h>Vae?this._append`A${n},${n},0,1,${f},${t-l},${r-c}A${n},${n},0,1,${f},${this._x1=d},${this._y1=u}`:h>yl&&this._append`A${n},${n},0,${+(h>=aN)},${f},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+s}h${-n}Z`}toString(){return this._}}function TC(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Gae(t)}function MC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function r3(e){this._context=e}r3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function fb(e){return new r3(e)}function n3(e){return e[0]}function a3(e){return e[1]}function s3(e,t){var r=$t(!0),n=null,s=fb,i=null,o=TC(l);e=typeof e=="function"?e:e===void 0?n3:$t(e),t=typeof t=="function"?t:t===void 0?a3:$t(t);function l(c){var d,u=(c=MC(c)).length,f,h=!1,m;
590for(n==null&&(i=s(m=o())),d=0;d<=u;++d)!(d<u&&r(f=c[d],d,c))===h&&((h=!h)?i.lineStart():i.lineEnd()),h&&i.point(+e(f,d,c),+t(f,d,c));if(m)return i=null,m+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:$t(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:$t(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:$t(!!c),l):r},l.curve=function(c){return arguments.length?(s=c,n!=null&&(i=s(n)),l):s},l.context=function(c){return arguments.length?(c==null?n=i=null:i=s(n=c),l):n},l}function cg(e,t,r){var n=null,s=$t(!0),i=null,o=fb,l=null,c=TC(d);e=typeof e=="function"?e:e===void 0?n3:$t(+e),t=typeof t=="function"?t:$t(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?a3:$t(+r);function d(f){var h,m,v,p=(f=MC(f)).length,x,b=!1,y,w=new Array(p),_=new Array(p);for(i==null&&(l=o(y=c())),h=0;h<=p;++h){if(!(h<p&&s(x=f[h],h,f))===b)if(b=!b)m=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),v=h-1;v>=m;--v)l.point(w[v],_[v]);l.lineEnd(),l.areaEnd()}b&&(w[h]=+e(x,h,f),_[h]=+t(x,h,f),l.point(n?+n(x,h,f):w[h],r?+r(x,h,f):_[h]))}if(y)return l=null,y+""||null}function u(){return s3().defined(s).curve(o).context(i)}return d.x=function(f){return arguments.length?(e=typeof f=="function"?f:$t(+f),n=null,d):e},d.x0=function(f){return arguments.length?(e=typeof f=="function"?f:$t(+f),d):e},d.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:$t(+f),d):n},d.y=function(f){return arguments.length?(t=typeof f=="function"?f:$t(+f),r=null,d):t},d.y0=function(f){return arguments.length?(t=typeof f=="function"?f:$t(+f),d):t},d.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:$t(+f),d):r},d.lineX0=d.lineY0=function(){return u().x(e).y(t)},d.lineY1=function(){return u().x(e).y(r)},d.lineX1=function(){return u().x(n).y(t)},d.defined=function(f){return arguments.length?(s=typeof f=="function"?f:$t(!!f),d):s},d.curve=function(f){return arguments.length?(o=f,i!=null&&(l=o(i)),d):o},d.context=function(f){return arguments.length?(f==null?i=l=null:l=o(i=f),d):i},d}class i3{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Kae(e){return new i3(e,!0)}function Yae(e){return new i3(e,!1)}const IC={draw(e,t){const r=cs(t/Gv);e.moveTo(r,0),e.arc(0,0,r,0,ub)}},Xae={draw(e,t){const r=cs(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},o3=cs(1/3),Qae=o3*2,Jae={draw(e,t){const r=cs(t/Qae),n=r*o3;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Zae={draw(e,t){const r=cs(t),n=-r/2;e.rect(n,n,r,r)}},ese=.8908130915292852,l3=qv(Gv/10)/qv(7*Gv/10),tse=qv(ub/10)*l3,rse=-e3(ub/10)*l3,nse={draw(e,t){const r=cs(t*ese),n=tse*r,s=rse*r;e.moveTo(0,-r),e.lineTo(n,s);for(let i=1;i<5;++i){const o=ub*i/5,l=e3(o),c=qv(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*s,c*n+l*s)}e.closePath()}},pw=cs(3),ase={draw(e,t){const r=-cs(t/(pw*3));e.moveTo(0,r*2),e.lineTo(-pw*r,-r),e.lineTo(pw*r,-r),e.closePath()}},na=-.5,aa=cs(3)/2,iN=1/cs(12),sse=(iN/2+1)*3,ise={draw(e,t){const r=cs(t/sse),n=r/2,s=r*iN,i=n,o=r*iN+r,l=-i,c=o;e.moveTo(n,s),e.lineTo(i,o),e.lineTo(l,c),e.lineTo(na*n-aa*s,aa*n+na*s),e.lineTo(na*i-aa*o,aa*i+na*o),e.lineTo(na*l-aa*c,aa*l+na*c),e.lineTo(na*n+aa*s,na*s-aa*n),e.lineTo(na*i+aa*o,na*o-aa*i),e.lineTo(na*l+aa*c,na*c-aa*l),e.closePath()}};function ose(e,t){let r=null,n=TC(s);e=typeof e=="function"?e:$t(e||IC),t=typeof t=="function"?t:$t(t===void 0?64:+t);function s(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return s.type=function(i){return arguments.length?(e=typeof i=="function"?i:$t(i),s):e},s.size=function(i){return arguments.length?(t=typeof i=="function"?i:$t(+i),s):t},s.context=function(i){return arguments.length?(r=i??null,s):r},s}function Kv(){}function Yv(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function c3(e){this._context=e}c3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0}
vendor: 5,940 bytes, line 590
590,lineEnd:function(){switch(this._point){case 3:Yv(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Yv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function lse(e){return new c3(e)}function d3(e){this._context=e}d3.prototype={areaStart:Kv,areaEnd:Kv,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Yv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cse(e){return new d3(e)}function u3(e){this._context=e}u3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Yv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function dse(e){return new u3(e)}function f3(e){this._context=e}f3.prototype={areaStart:Kv,areaEnd:Kv,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function use(e){return new f3(e)}function cE(e){return e<0?-1:1}function dE(e,t,r){var n=e._x1-e._x0,s=t-e._x1,i=(e._y1-e._y0)/(n||s<0&&-0),o=(r-e._y1)/(s||n<0&&-0),l=(i*s+o*n)/(n+s);return(cE(i)+cE(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function uE(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function gw(e,t,r){var n=e._x0,s=e._y0,i=e._x1,o=e._y1,l=(i-n)/3;e._context.bezierCurveTo(n+l,s+l*t,i-l,o-l*r,i,o)}function Xv(e){this._context=e}Xv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:gw(this,this._t0,uE(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,gw(this,uE(this,r=dE(this,e,t)),r);break;default:gw(this,this._t0,r=dE(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function h3(e){this._context=new m3(e)}(h3.prototype=Object.create(Xv.prototype)).point=function(e,t){Xv.prototype.point.call(this,t,e)};function m3(e){this._context=e}m3.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,s,i){this._context.bezierCurveTo(t,e,n,r,i,s)}};function fse(e){return new Xv(e)}function hse(e){return new h3(e)}function p3(e){this._context=e}p3.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=fE(e),s=fE(t),i=0,o=1;o<r;++i,++o)this._context.bezierCurveTo(n[0][i],s[0][i],n[1][i],s[1][i],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function fE(e){var t,r=e.length-1,n,s=new Array(r),i=new Array(r),o=new Array(r);for(s[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)s[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(s[r-1]=2,i[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=s[t]/i[t-1],i[t]-=n,o[t]-=n*o[t-1];for(s[r-1]=o[r-1]/i[r-1],t=r-2;t>=0;--t)s[t]=(o[t]-s[t+1])/i[t];for(i[r-1]=(e[r]+s[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-s[t+1];return[s,i]}function mse(e){return new p3(e)}function hb(e,t){this._context=e,this._t=t}hb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;
vendor: 9,187 bytes, lines 590-593
590default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function pse(e){return new hb(e,.5)}function gse(e){return new hb(e,0)}function vse(e){return new hb(e,1)}function iu(e,t){if((o=e.length)>1)for(var r=1,n,s,i=e[t[0]],o,l=i.length;r<o;++r)for(s=i,i=e[t[r]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(s[n][1])?s[n][0]:s[n][1]}function oN(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function xse(e,t){return e[t]}function yse(e){const t=[];return t.key=e,t}function bse(){var e=$t([]),t=oN,r=iu,n=xse;function s(i){var o=Array.from(e.apply(this,arguments),yse),l,c=o.length,d=-1,u;for(const f of i)for(l=0,++d;l<c;++l)(o[l][d]=[0,+n(f,o[l].key,d,i)]).data=f;for(l=0,u=MC(t(o));l<c;++l)o[u[l]].index=l;return r(o,u),o}return s.keys=function(i){return arguments.length?(e=typeof i=="function"?i:$t(Array.from(i)),s):e},s.value=function(i){return arguments.length?(n=typeof i=="function"?i:$t(+i),s):n},s.order=function(i){return arguments.length?(t=i==null?oN:typeof i=="function"?i:$t(Array.from(i)),s):t},s.offset=function(i){return arguments.length?(r=i??iu,s):r},s}function wse(e,t){if((n=e.length)>0){for(var r,n,s=0,i=e[0].length,o;s<i;++s){for(o=r=0;r<n;++r)o+=e[r][s][1]||0;if(o)for(r=0;r<n;++r)e[r][s][1]/=o}iu(e,t)}}function jse(e,t){if((s=e.length)>0){for(var r=0,n=e[t[0]],s,i=n.length;r<i;++r){for(var o=0,l=0;o<s;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}iu(e,t)}}function Nse(e,t){if(!(!((o=e.length)>0)||!((i=(s=e[t[0]]).length)>0))){for(var r=0,n=1,s,i,o;n<i;++n){for(var l=0,c=0,d=0;l<o;++l){for(var u=e[t[l]],f=u[n][1]||0,h=u[n-1][1]||0,m=(f-h)/2,v=0;v<l;++v){var p=e[t[v]],x=p[n][1]||0,b=p[n-1][1]||0;m+=x-b}c+=f,d+=m*f}s[n-1][1]+=s[n-1][0]=r,c&&(r-=d/c)}s[n-1][1]+=s[n-1][0]=r,iu(e,t)}}function tm(e){"@babel/helpers - typeof";return tm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tm(e)}var Sse=["type","size","sizeType"];function lN(){return lN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lN.apply(this,arguments)}function hE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function mE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hE(Object(r),!0).forEach(function(n){_se(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _se(e,t,r){return t=Cse(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cse(e){var t=Pse(e,"string");return tm(t)=="symbol"?t:t+""}function Pse(e,t){if(tm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(tm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kse(e,t){if(e==null)return{};var r=Ase(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ase(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var g3={symbolCircle:IC,symbolCross:Xae,symbolDiamond:Jae,symbolSquare:Zae,symbolStar:nse,symbolTriangle:ase,symbolWye:ise},Ese=Math.PI/180,Ose=function(t){var r="symbol".concat(db(t));return g3[r]||IC},Tse=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var s=18*Ese;return 1.25*t*t*(Math.tan(s)-Math.tan(s*2)*Math.pow(Math.tan(s),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},Mse=function(t,r){g3["symbol".concat(db(t))]=r},mb=function(t){var r=t.type,n=r===void 0?"circle":r,s=t.size,i=s===void 0?64:s,o=t.sizeType,l=o===void 0?"area":o,c=kse(t,Sse),d=mE(mE({},c),{},{type:n,size:i,sizeType:l}),u=function(){var x=Ose(n),b=ose().type(x).size(Tse(i,l,n));return b()},f=d.className,h=d.cx,m=d.cy,v=Ae(d,!0);return h===+h&&m===+m&&i===+i?I.createElement("path",lN({},v,{className:qe("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(m,")"),d:u()})):null};mb.registerSymbol=Mse;function ou(e){"@babel/helpers - typeof";return ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ou(e)}function cN(){return cN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cN.apply(this,arguments)}function pE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ise(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pE(Object(r),!0).forEach(function(n){rm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rse(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,x3(n.key),n)}}function Dse(e,t,r){return t&&Rse(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lse(e,t,r){return t=Qv(t),Fse(e,v3()?Reflect.construct(t,r||[],Qv(e).constructor):t.apply(e,r))}function Fse(e,t){if(t&&(ou(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bse(e)}function Bse(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(v3=function(){return!!e})()}function Qv(e){return Qv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qv(e)}function zse(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dN(e,t)}function dN(e,t){return dN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},dN(e,t)}function rm(e,t,r){return t=x3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function x3(e){var t=Use(e,"string");return ou(t)=="symbol"?t:t+""}function Use(e,t){if(ou(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ou(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sa=32,$C=function(e){function t(){return $se(this,t),Lse(this,t,arguments)}return zse(t,e),Dse(t,[{key:"renderIcon",value:function(n){var s=this.props.inactiveColor,i=sa/2,o=sa/6,l=sa/3,c=n.inactive?s:n.color;if(n.type==="plainline")return I.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:i,x2:sa,y2:i,className:"recharts-legend-icon"});if(n.type==="line")return I.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,` 591 A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(i,` 592 H`).concat(sa,"M").concat(2*l,",").concat(i,` 593 A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(n.type==="rect")return I.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(sa/8,"h").concat(sa,"v").concat(sa*3/4,"h").concat(-sa,"z"),className:"recharts-legend-icon"});if(I.isValidElement(n.legendIcon)){var d=Ise({},n);return delete d.legendIcon,I.cloneElement(n.legendIcon,d)}return I.createElement(mb,{fill:c,cx:i,cy:i,size:sa,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,s=this.props,i=s.payload,o=s.iconSize,l=s.layout,c=s.formatter,d=s.inactiveColor,u={x:0,y:0,width:sa,height:sa}
593,f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(m,v){var p=m.formatter||c,x=qe(rm(rm({"recharts-legend-item":!0},"legend-item-".concat(v),!0),"inactive",m.inactive));if(m.type==="none")return null;var b=Fe(m.value)?null:m.value;ts(!Fe(m.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var y=m.inactive?d:m.color;return I.createElement("li",cN({className:x,style:f,key:"legend-item-".concat(v)},Bo(n.props,m,v)),I.createElement(eN,{width:o,height:o,viewBox:u,style:h},n.renderIcon(m)),I.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},p?p(b,m,v):b))})}},{key:"render",value:function(){var n=this.props,s=n.payload,i=n.layout,o=n.align;if(!s||!s.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return I.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(g.PureComponent);rm($C,"displayName","Legend");rm($C,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Wse=Qy;function Hse(){this.__data__=new Wse,this.size=0}var Vse=Hse;function qse(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Gse=qse;function Kse(e){return this.__data__.get(e)}var Yse=Kse;function Xse(e){return this.__data__.has(e)}var Qse=Xse,Jse=Qy,Zse=NC,eie=SC,tie=200;function rie(e,t){var r=this.__data__;if(r instanceof Jse){var n=r.__data__;if(!Zse||n.length<tie-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new eie(n)}return r.set(e,t),this.size=r.size,this}var nie=rie,aie=Qy,sie=Vse,iie=Gse,oie=Yse,lie=Qse,cie=nie;function lf(e){var t=this.__data__=new aie(e);this.size=t.size}lf.prototype.clear=sie;lf.prototype.delete=iie;lf.prototype.get=oie;lf.prototype.has=lie;lf.prototype.set=cie;var y3=lf,die="__lodash_hash_undefined__";function uie(e){return this.__data__.set(e,die),this}var fie=uie;function hie(e){return this.__data__.has(e)}var mie=hie,pie=SC,gie=fie,vie=mie;function Jv(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new pie;++t<r;)this.add(e[t])}Jv.prototype.add=Jv.prototype.push=gie;Jv.prototype.has=vie;var b3=Jv;function xie(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var w3=xie;function yie(e,t){return e.has(t)}var j3=yie,bie=b3,wie=w3,jie=j3,Nie=1,Sie=2;function _ie(e,t,r,n,s,i){var o=r&Nie,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var d=i.get(e),u=i.get(t);if(d&&u)return d==t&&u==e;var f=-1,h=!0,m=r&Sie?new bie:void 0;for(i.set(e,t),i.set(t,e);++f<l;){var v=e[f],p=t[f];if(n)var x=o?n(p,v,f,t,e,i):n(v,p,f,e,t,i);if(x!==void 0){if(x)continue;h=!1;break}if(m){if(!wie(t,function(b,y){if(!jie(m,y)&&(v===b||s(v,b,r,n,i)))return m.push(y)})){h=!1;break}}else if(!(v===p||s(v,p,r,n,i))){h=!1;break}}return i.delete(e),i.delete(t),h}var N3=_ie,Cie=zs,Pie=Cie.Uint8Array,kie=Pie;function Aie(e){var t=-1,r=Array(e.size);return e.forEach(function(n,s){r[++t]=[s,n]}),r}var Eie=Aie;function Oie(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var RC=Oie,gE=cp,vE=kie,Tie=jC,Mie=N3,Iie=Eie,$ie=RC,Rie=1,Die=2,Lie="[object Boolean]",Fie="[object Date]",Bie="[object Error]",zie="[object Map]",Uie="[object Number]",Wie="[object RegExp]",Hie="[object Set]",Vie="[object String]",qie="[object Symbol]",Gie="[object ArrayBuffer]",Kie="[object DataView]",xE=gE?gE.prototype:void 0,vw=xE?xE.valueOf:void 0;function Yie(e,t,r,n,s,i,o){switch(r){case Kie:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Gie:return!(e.byteLength!=t.byteLength||!i(new vE(e),new vE(t)));case Lie:case Fie:case Uie:return Tie(+e,+t);case Bie:return e.name==t.name&&e.message==t.message;case Wie:case Vie:return e==t+"";case zie:var l=Iie;case Hie:var c=n&Rie;if(l||(l=$ie),e.size!=t.size&&!c)return!1;var d=o.get(e);if(d)return d==t;n|=Die,o.set(e,t);var u=Mie(l(e),l(t),n,s,i,o);return o.delete(e),u;
vendor: 5,783 bytes, line 593
593case qie:if(vw)return vw.call(e)==vw.call(t)}return!1}var Xie=Yie;function Qie(e,t){for(var r=-1,n=t.length,s=e.length;++r<n;)e[s+r]=t[r];return e}var S3=Qie,Jie=S3,Zie=Dn;function eoe(e,t,r){var n=t(e);return Zie(e)?n:Jie(n,r(e))}var toe=eoe;function roe(e,t){for(var r=-1,n=e==null?0:e.length,s=0,i=[];++r<n;){var o=e[r];t(o,r,e)&&(i[s++]=o)}return i}var noe=roe;function aoe(){return[]}var soe=aoe,ioe=noe,ooe=soe,loe=Object.prototype,coe=loe.propertyIsEnumerable,yE=Object.getOwnPropertySymbols,doe=yE?function(e){return e==null?[]:(e=Object(e),ioe(yE(e),function(t){return coe.call(e,t)}))}:ooe,uoe=doe;function foe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var hoe=foe,moe=Oi,poe=Ti,goe="[object Arguments]";function voe(e){return poe(e)&&moe(e)==goe}var xoe=voe,bE=xoe,yoe=Ti,_3=Object.prototype,boe=_3.hasOwnProperty,woe=_3.propertyIsEnumerable,joe=bE(function(){return arguments}())?bE:function(e){return yoe(e)&&boe.call(e,"callee")&&!woe.call(e,"callee")},DC=joe,Zv={exports:{}};function Noe(){return!1}var Soe=Noe;Zv.exports;(function(e,t){var r=zs,n=Soe,s=t&&!t.nodeType&&t,i=s&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===s,l=o?r.Buffer:void 0,c=l?l.isBuffer:void 0,d=c||n;e.exports=d})(Zv,Zv.exports);var C3=Zv.exports,_oe=9007199254740991,Coe=/^(?:0|[1-9]\d*)$/;function Poe(e,t){var r=typeof e;return t=t??_oe,!!t&&(r=="number"||r!="symbol"&&Coe.test(e))&&e>-1&&e%1==0&&e<t}var LC=Poe,koe=9007199254740991;function Aoe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=koe}var FC=Aoe,Eoe=Oi,Ooe=FC,Toe=Ti,Moe="[object Arguments]",Ioe="[object Array]",$oe="[object Boolean]",Roe="[object Date]",Doe="[object Error]",Loe="[object Function]",Foe="[object Map]",Boe="[object Number]",zoe="[object Object]",Uoe="[object RegExp]",Woe="[object Set]",Hoe="[object String]",Voe="[object WeakMap]",qoe="[object ArrayBuffer]",Goe="[object DataView]",Koe="[object Float32Array]",Yoe="[object Float64Array]",Xoe="[object Int8Array]",Qoe="[object Int16Array]",Joe="[object Int32Array]",Zoe="[object Uint8Array]",ele="[object Uint8ClampedArray]",tle="[object Uint16Array]",rle="[object Uint32Array]",Wt={};Wt[Koe]=Wt[Yoe]=Wt[Xoe]=Wt[Qoe]=Wt[Joe]=Wt[Zoe]=Wt[ele]=Wt[tle]=Wt[rle]=!0;Wt[Moe]=Wt[Ioe]=Wt[qoe]=Wt[$oe]=Wt[Goe]=Wt[Roe]=Wt[Doe]=Wt[Loe]=Wt[Foe]=Wt[Boe]=Wt[zoe]=Wt[Uoe]=Wt[Woe]=Wt[Hoe]=Wt[Voe]=!1;function nle(e){return Toe(e)&&Ooe(e.length)&&!!Wt[Eoe(e)]}var ale=nle;function sle(e){return function(t){return e(t)}}var P3=sle,ex={exports:{}};ex.exports;(function(e,t){var r=I5,n=t&&!t.nodeType&&t,s=n&&!0&&e&&!e.nodeType&&e,i=s&&s.exports===n,o=i&&r.process,l=function(){try{var c=s&&s.require&&s.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(ex,ex.exports);var ile=ex.exports,ole=ale,lle=P3,wE=ile,jE=wE&&wE.isTypedArray,cle=jE?lle(jE):ole,k3=cle,dle=hoe,ule=DC,fle=Dn,hle=C3,mle=LC,ple=k3,gle=Object.prototype,vle=gle.hasOwnProperty;function xle(e,t){var r=fle(e),n=!r&&ule(e),s=!r&&!n&&hle(e),i=!r&&!n&&!s&&ple(e),o=r||n||s||i,l=o?dle(e.length,String):[],c=l.length;for(var d in e)(t||vle.call(e,d))&&!(o&&(d=="length"||s&&(d=="offset"||d=="parent")||i&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||mle(d,c)))&&l.push(d);return l}var yle=xle,ble=Object.prototype;function wle(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ble;return e===r}var jle=wle;function Nle(e,t){return function(r){return e(t(r))}}var A3=Nle,Sle=A3,_le=Sle(Object.keys,Object),Cle=_le,Ple=jle,kle=Cle,Ale=Object.prototype,Ele=Ale.hasOwnProperty;function Ole(e){if(!Ple(e))return kle(e);var t=[];for(var r in Object(e))Ele.call(e,r)&&r!="constructor"&&t.push(r);return t}var Tle=Ole,Mle=wC,Ile=FC;function $le(e){return e!=null&&Ile(e.length)&&!Mle(e)}var dp=$le,Rle=yle,Dle=Tle,Lle=dp;function Fle(e){return Lle(e)?Rle(e):Dle(e)}var pb=Fle,Ble=toe,zle=uoe,Ule=pb;function Wle(e){return Ble(e,Ule,zle)}var Hle=Wle,NE=Hle,Vle=1,qle=Object.prototype,Gle=qle.hasOwnProperty;function Kle(e,t,r,n,s,i){var o=r&Vle,l=NE(e),c=l.length,d=NE(t),u=d.length;if(c!=u&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in t:Gle.call(t,h)))return!1}var m=i.get(e),v=i.get(t);if(m&&v)return m==t&&v==e;var p=!0;i.set(e,t),i.set(t,e);for(var x=o;++f<c;){h=l[f];var b=e[h],y=t[h];if(n)var w=o?n(y,b,h,t,e,i):n(b,y,h,e,t,i);if(!(w===void 0?b===y||s(b,y,r,n,i):w)){p=!1;break}x||(x=h=="constructor")}if(p&&!x){var _=e.constructor,N=t.constructor;_!=N&&"constructor"in e&&"constructor"in t&&!(typeof _=="function"&&_ instanceof _&&typeof N=="function"&&N instanceof N)&&(p=!1)}return i.delete(e),i.delete(t),p}var Yle=Kle,Xle=jc,Qle=zs,Jle=Xle(Qle,"DataView"),Zle=Jle,ece=jc,tce=zs,rce=ece(tce,"Promise"),nce=rce,ace=jc,sce=zs,ice=ace(sce,"Set"),E3=ice,oce=jc,lce=zs,cce=oce(lce,"WeakMap"),dce=cce,uN=Zle,fN=NC,hN=nce,mN=E3,pN=dce,O3=Oi,cf=R5,SE="[object Map]",uce="[object Object]",_E="[object Promise]",CE="[object Set]",PE="[object WeakMap]",kE="[object DataView]",fce=cf(uN),hce=cf(fN),mce=cf(hN),pce=cf(mN),gce=cf(pN),bl=O3;(uN&&bl(new uN(new ArrayBuffer(1)))!=kE||fN&&bl(new fN)!=SE||hN&&bl(hN.resolve())!=_E||mN&&bl(new mN)!=CE||pN&&bl(new pN)!=PE)&&(bl=function(e){var t=O3(e),r=t==uce?e.constructor:void 0,n=r?cf(r):"";if(n)switch(n){case fce:return kE;case hce:return SE;case mce:return _E;case pce:return CE;case gce:return PE}return t});var vce=bl,xw=y3,xce=N3,yce=Xie,bce=Yle,AE=vce,EE=Dn,OE=C3,wce=k3,jce=1,TE="[object Arguments]",ME="[object Array]",dg="[object Object]",Nce=Object.prototype,IE=Nce.hasOwnProperty;function Sce(e,t,r,n,s,i){var o=EE(e),l=EE(t),c=o?ME:AE(e),d=l?ME:AE(t);c=c==TE?dg:c,d=d==TE?dg:d;var u=c==dg,f=d==dg,h=c==d;if(h&&OE(e)){if(!OE(t))return!1;o=!0,u=!1}if(h&&!u)return i||(i=new xw),o||wce(e)?xce(e,t,r,n,s,i):yce(e,t,c,r,n,s,i);if(!(r&jce)){var m=u&&IE.call(e,"__wrapped__"),v=f&&IE.call(t,"__wrapped__");
vendor: 4,112 bytes, line 593
593if(m||v){var p=m?e.value():e,x=v?t.value():t;return i||(i=new xw),s(p,x,r,n,i)}}return h?(i||(i=new xw),bce(e,t,r,n,s,i)):!1}var _ce=Sce,Cce=_ce,$E=Ti;function T3(e,t,r,n,s){return e===t?!0:e==null||t==null||!$E(e)&&!$E(t)?e!==e&&t!==t:Cce(e,t,r,n,T3,s)}var BC=T3,Pce=y3,kce=BC,Ace=1,Ece=2;function Oce(e,t,r,n){var s=r.length,i=s,o=!n;if(e==null)return!i;for(e=Object(e);s--;){var l=r[s];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++s<i;){l=r[s];var c=l[0],d=e[c],u=l[1];if(o&&l[2]){if(d===void 0&&!(c in e))return!1}else{var f=new Pce;if(n)var h=n(d,u,c,e,t,f);if(!(h===void 0?kce(u,d,Ace|Ece,n,f):h))return!1}}return!0}var Tce=Oce,Mce=Xo;function Ice(e){return e===e&&!Mce(e)}var M3=Ice,$ce=M3,Rce=pb;function Dce(e){for(var t=Rce(e),r=t.length;r--;){var n=t[r],s=e[n];t[r]=[n,s,$ce(s)]}return t}var Lce=Dce;function Fce(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var I3=Fce,Bce=Tce,zce=Lce,Uce=I3;function Wce(e){var t=zce(e);return t.length==1&&t[0][2]?Uce(t[0][0],t[0][1]):function(r){return r===e||Bce(r,e,t)}}var Hce=Wce;function Vce(e,t){return e!=null&&t in Object(e)}var qce=Vce,Gce=z5,Kce=DC,Yce=Dn,Xce=LC,Qce=FC,Jce=Zy;function Zce(e,t,r){t=Gce(t,e);for(var n=-1,s=t.length,i=!1;++n<s;){var o=Jce(t[n]);if(!(i=e!=null&&r(e,o)))break;e=e[o]}return i||++n!=s?i:(s=e==null?0:e.length,!!s&&Qce(s)&&Xce(o,s)&&(Yce(e)||Kce(e)))}var ede=Zce,tde=qce,rde=ede;function nde(e,t){return e!=null&&rde(e,t,tde)}var ade=nde,sde=BC,ide=U5,ode=ade,lde=bC,cde=M3,dde=I3,ude=Zy,fde=1,hde=2;function mde(e,t){return lde(e)&&cde(t)?dde(ude(e),t):function(r){var n=ide(r,e);return n===void 0&&n===t?ode(r,e):sde(t,n,fde|hde)}}var pde=mde;function gde(e){return e}var df=gde;function vde(e){return function(t){return t==null?void 0:t[e]}}var xde=vde,yde=PC;function bde(e){return function(t){return yde(t,e)}}var wde=bde,jde=xde,Nde=wde,Sde=bC,_de=Zy;function Cde(e){return Sde(e)?jde(_de(e)):Nde(e)}var Pde=Cde,kde=Hce,Ade=pde,Ede=df,Ode=Dn,Tde=Pde;function Mde(e){return typeof e=="function"?e:e==null?Ede:typeof e=="object"?Ode(e)?Ade(e[0],e[1]):kde(e):Tde(e)}var Us=Mde;function Ide(e,t,r,n){for(var s=e.length,i=r+(n?1:-1);n?i--:++i<s;)if(t(e[i],i,e))return i;return-1}var $3=Ide;function $de(e){return e!==e}var Rde=$de;function Dde(e,t,r){for(var n=r-1,s=e.length;++n<s;)if(e[n]===t)return n;return-1}var Lde=Dde,Fde=$3,Bde=Rde,zde=Lde;function Ude(e,t,r){return t===t?zde(e,t,r):Fde(e,Bde,r)}var Wde=Ude,Hde=Wde;function Vde(e,t){var r=e==null?0:e.length;return!!r&&Hde(e,t,0)>-1}var qde=Vde;function Gde(e,t,r){for(var n=-1,s=e==null?0:e.length;++n<s;)if(r(t,e[n]))return!0;return!1}var Kde=Gde;function Yde(){}var Xde=Yde,yw=E3,Qde=Xde,Jde=RC,Zde=1/0,eue=yw&&1/Jde(new yw([,-0]))[1]==Zde?function(e){return new yw(e)}:Qde,tue=eue,rue=b3,nue=qde,aue=Kde,sue=j3,iue=tue,oue=RC,lue=200;function cue(e,t,r){var n=-1,s=nue,i=e.length,o=!0,l=[],c=l;if(r)o=!1,s=aue;else if(i>=lue){var d=t?null:iue(e);if(d)return oue(d);o=!1,s=sue,c=new rue}else c=t?[]:l;e:for(;++n<i;){var u=e[n],f=t?t(u):u;if(u=r||u!==0?u:0,o&&f===f){for(var h=c.length;h--;)if(c[h]===f)continue e;t&&c.push(f),l.push(u)}else s(c,f,r)||(c!==l&&c.push(f),l.push(u))}return l}var due=cue,uue=Us,fue=due;function hue(e,t){return e&&e.length?fue(e,uue(t)):[]}var mue=hue;const RE=mt(mue);function R3(e,t,r){return t===!0?RE(e,r):Fe(t)?RE(e,t):e}function lu(e){"@babel/helpers - typeof";return lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lu(e)}var pue=["ref"];function DE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function qs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DE(Object(r),!0).forEach(function(n){gb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DE(Object(r)).forEac
vendor: 19,718 bytes, lines 593-594
593h(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,L3(n.key),n)}}function vue(e,t,r){return t&&LE(e.prototype,t),r&&LE(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function xue(e,t,r){return t=tx(t),yue(e,D3()?Reflect.construct(t,r||[],tx(e).constructor):t.apply(e,r))}function yue(e,t){if(t&&(lu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bue(e)}function bue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(D3=function(){return!!e})()}function tx(e){return tx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},tx(e)}function wue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gN(e,t)}function gN(e,t){return gN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},gN(e,t)}function gb(e,t,r){return t=L3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function L3(e){var t=jue(e,"string");return lu(t)=="symbol"?t:t+""}function jue(e,t){if(lu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(lu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nue(e,t){if(e==null)return{};var r=Sue(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Sue(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _ue(e){return e.value}function Cue(e,t){if(I.isValidElement(e))return I.cloneElement(e,t);if(typeof e=="function")return I.createElement(e,t);t.ref;var r=Nue(t,pue);return I.createElement($C,r)}var FE=1,Ao=function(e){function t(){var r;gue(this,t);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return r=xue(this,t,[].concat(s)),gb(r,"lastBoundingBox",{width:-1,height:-1}),r}return wue(t,e),vue(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,s=this.getBBox();s?(Math.abs(s.width-this.lastBoundingBox.width)>FE||Math.abs(s.height-this.lastBoundingBox.height)>FE)&&(this.lastBoundingBox.width=s.width,this.lastBoundingBox.height=s.height,n&&n(s)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?qs({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var s=this.props,i=s.layout,o=s.align,l=s.verticalAlign,c=s.margin,d=s.chartWidth,u=s.chartHeight,f,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&i==="vertical"){var m=this.getBBoxSnapshot();f={left:((d||0)-m.width)/2}}else f=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var v=this.getBBoxSnapshot();h={top:((u||0)-v.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return qs(qs({},f),h)}},{key:"render",value:function(){var n=this,s=this.props,i=s.content,o=s.width,l=s.height,c=s.wrapperStyle,d=s.payloadUniqBy,u=s.payload,f=qs(qs({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return I.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(m){n.wrapperNode=m}},Cue(i,qs(qs({},this.props),{},{payload:R3(u,d,_ue)})))}}],[{key:"getWithHeight",value:function(n,s){var i=qs(qs({},this.defaultProps),n.props),o=i.layout;return o==="vertical"&&xe(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||s}:null}}])}(g.PureComponent);gb(Ao,"displayName","Legend");gb(Ao,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var BE=cp,Pue=DC,kue=Dn,zE=BE?BE.isConcatSpreadable:void 0;function Aue(e){return kue(e)||Pue(e)||!!(zE&&e&&e[zE])}var Eue=Aue,Oue=S3,Tue=Eue;function F3(e,t,r,n,s){var i=-1,o=e.length;for(r||(r=Tue),s||(s=[]);++i<o;){var l=e[i];t>0&&r(l)?t>1?F3(l,t-1,r,n,s):Oue(s,l):n||(s[s.length]=l)}return s}var B3=F3;function Mue(e){return function(t,r,n){for(var s=-1,i=Object(t),o=n(t),l=o.length;l--;){var c=o[e?l:++s];if(r(i[c],c,i)===!1)break}return t}}var Iue=Mue,$ue=Iue,Rue=$ue(),Due=Rue,Lue=Due,Fue=pb;function Bue(e,t){return e&&Lue(e,t,Fue)}var z3=Bue,zue=dp;function Uue(e,t){return function(r,n){if(r==null)return r;if(!zue(r))return e(r,n);for(var s=r.length,i=t?s:-1,o=Object(r);(t?i--:++i<s)&&n(o[i],i,o)!==!1;);return r}}var Wue=Uue,Hue=z3,Vue=Wue,que=Vue(Hue),zC=que,Gue=zC,Kue=dp;function Yue(e,t){var r=-1,n=Kue(e)?Array(e.length):[];return Gue(e,function(s,i,o){n[++r]=t(s,i,o)}),n}var U3=Yue;function Xue(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var Que=Xue,UE=tf;function Jue(e,t){if(e!==t){var r=e!==void 0,n=e===null,s=e===e,i=UE(e),o=t!==void 0,l=t===null,c=t===t,d=UE(t);if(!l&&!d&&!i&&e>t||i&&o&&c&&!l&&!d||n&&o&&c||!r&&c||!s)return 1;if(!n&&!i&&!d&&e<t||d&&r&&s&&!n&&!i||l&&r&&s||!o&&s||!c)return-1}return 0}var Zue=Jue,efe=Zue;function tfe(e,t,r){for(var n=-1,s=e.criteria,i=t.criteria,o=s.length,l=r.length;++n<o;){var c=efe(s[n],i[n]);if(c){if(n>=l)return c;var d=r[n];return c*(d=="desc"?-1:1)}}return e.index-t.index}var rfe=tfe,bw=CC,nfe=PC,afe=Us,sfe=U3,ife=Que,ofe=P3,lfe=rfe,cfe=df,dfe=Dn;function ufe(e,t,r){t.length?t=bw(t,function(i){return dfe(i)?function(o){return nfe(o,i.length===1?i[0]:i)}:i}):t=[cfe];var n=-1;t=bw(t,ofe(afe));var s=sfe(e,function(i,o,l){var c=bw(t,function(d){return d(i)});return{criteria:c,index:++n,value:i}});return ife(s,function(i,o){return lfe(i,o,r)})}var ffe=ufe;function hfe(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var mfe=hfe,pfe=mfe,WE=Math.max;function gfe(e,t,r){return t=WE(t===void 0?e.length-1:t,0),function(){for(var n=arguments,s=-1,i=WE(n.length-t,0),o=Array(i);++s<i;)o[s]=n[t+s];s=-1;for(var l=Array(t+1);++s<t;)l[s]=n[s];return l[t]=r(o),pfe(e,this,l)}}var vfe=gfe;function xfe(e){return function(){return e}}var yfe=xfe,bfe=jc,wfe=function(){try{var e=bfe(Object,"defineProperty");return e({},"",{}),e}catch{}}(),W3=wfe,jfe=yfe,HE=W3,Nfe=df,Sfe=HE?function(e,t){return HE(e,"toString",{configurable:!0,enumerable:!1,value:jfe(t),writable:!0})}:Nfe,_fe=Sfe,Cfe=800,Pfe=16,kfe=Date.now;function Afe(e){var t=0,r=0;return function(){var n=kfe(),s=Pfe-(n-r);if(r=n,s>0){if(++t>=Cfe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Efe=Afe,Ofe=_fe,Tfe=Efe,Mfe=Tfe(Ofe),Ife=Mfe,$fe=df,Rfe=vfe,Dfe=Ife;function Lfe(e,t){return Dfe(Rfe(e,t,$fe),e+"")}var Ffe=Lfe,Bfe=jC,zfe=dp,Ufe=LC,Wfe=Xo;function Hfe(e,t,r){if(!Wfe(r))return!1;var n=typeof t;return(n=="number"?zfe(r)&&Ufe(t,r.length):n=="string"&&t in r)?Bfe(r[t],e):!1}var vb=Hfe,Vfe=B3,qfe=ffe,Gfe=Ffe,VE=vb,Kfe=Gfe(function(e,t){if(e==null)return[];var r=t.length;return r>1&&VE(e,t[0],t[1])?t=[]:r>2&&VE(t[0],t[1],t[2])&&(t=[t[0]]),qfe(e,Vfe(t,1),[])}),Yfe=Kfe;const UC=mt(Yfe);function nm(e){"@babel/helpers - typeof";return nm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nm(e)}function vN(){return vN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vN.apply(this,arguments)}function Xfe(e,t){return ehe(e)||Zfe(e,t)||Jfe(e,t)||Qfe()}function Qfe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 594In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jfe(e,t){if(e){if(typeof e=="string")return qE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qE(e,t)}}function qE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Zfe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,d=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function ehe(e){if(Array.isArray(e))return e}function GE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ww(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?GE(Object(r),!0).forEach(function(n){the(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):GE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function the(e,t,r){return t=rhe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rhe(e){var t=nhe(e,"string");return nm(t)=="symbol"?t:t+""}function nhe(e,t){if(nm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(nm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ahe(e){return Array.isArray(e)&&Sr(e[0])&&Sr(e[1])?e.join(" ~ "):e}var she=function(t){var r=t.separator,n=r===void 0?" : ":r,s=t.contentStyle,i=s===void 0?{}:s,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,d=c===void 0?{}:c,u=t.payload,f=t.formatter,h=t.itemSorter,m=t.wrapperClassName,v=t.labelClassName,p=t.label,x=t.labelFormatter,b=t.accessibilityLayer,y=b===void 0?!1:b,w=function(){if(u&&u.length){var F={padding:0,margin:0},q=(h?UC(u,h):u).map(function(B,V){if(B.type==="none")return null;var E=ww({display:"block",paddingTop:4,paddingBottom:4,color:B.color||"#000"},l),M=B.formatter||f||ahe,T=B.value,L=B.name,K=T,H=L;if(M&&K!=null&&H!=null){var ee=M(T,L,B,V,u);if(Array.isArray(ee)){var se=Xfe(ee,2);K=se[0],H=se[1]}else K=ee}return I.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(V),style:E},Sr(H)?I.createElement("span",{className:"recharts-tooltip-item-name"},H):null,Sr(H)?I.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,I.createElement("span",{className:"recharts-tooltip-item-value"},K),I.createElement("span",{className:"recharts-tooltip-item-unit"},B.unit||""))});return I.createElement("ul",{className:"recharts-tooltip-item-list",style:F},q)}return null},_=ww({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),N=ww({margin:0},d),j=!Le(p),S=j?p:"",C=qe("recharts-default-tooltip",m),P=qe("recharts-tooltip-label",v);j&&x&&u!==void 0&&u!==null&&(S=x(p,u));var A=y?{role:"status","aria-live":"assertive"}:{};return I.createElement("div",vN({className:C,style:_},A),I.createElement("p",{className:P,style:N},I.isValidElement(S)?S:"".concat(S)),w())};function am(e){"@babel/helpers - typeof";return am=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},am(e)}function ug(e,t,r){return t=ihe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ihe(e){var t=ohe(e,"string");return am(t)=="symbol"?t:t+""}function ohe(e,t){if(am(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(am(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var If="recharts-tooltip-wrapper",lhe={visibility:"hidden"};function che(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return qe(If,ug(ug(ug(ug({},"".concat(If,"-right"),xe(r)&&t&&xe(t.x)&&r>=t.x),"".concat(If,"-left"),xe(r)&&t&&xe(t.x)&&r<t.x),"".concat(If,"-bottom"),xe(n)&&t&&xe(t.y)&&n>=t.y),"".concat(If,"-top"),xe(n)&&t&&xe(t.y)&&n<t.y))}function KE(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,s=e.offsetTopLeft,i=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,d=e.viewBoxDimension;if(i&&xe(i[n]))return i[n];var u=r[n]-l-s,f=r[n]+s;if(t[n])return o[n]?u:f;if(o[n]){var h=u,m=c[n];return h<m?Math.max(f,c[n]):Math.max(u,c[n])}var v=f+l,p=c[n]+d;return v>p?Math.max(u,c[n]):Math.max(f,c[n])}function dhe(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function uhe(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,s=e.position,i=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,d,u,f;return o.height>0&&o.width>0&&r?(u=KE({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:s,reverseDirection:i,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=KE({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:s,reverseDirection:i,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),d=dhe({translateX:u,translateY:f,useTranslate3d:l})):d=lhe,{cssProperties:d,cssClasses:che({translateX:u,translateY:f,coordinate:r})}}function cu(e){"@babel/helpers - typeof";return cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cu(e)}function YE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function XE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YE(Object(r),!0).forEach(function(n){yN(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fhe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hhe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,V3(n.key),n)}}function mhe(e,t,r){return t&&hhe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function phe(e,t,r){return t=rx(t),ghe(e,H3()?Reflect.construct(t,r||[],rx(e).constructor):t.apply(e,r))}function ghe(e,t){if(t&&(cu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vhe(e)}function vhe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function H3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(H3=function(){return!!e})()}function rx(e){return rx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},rx(e)}function xhe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xN(e,t)}function xN(e,t){return xN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},xN(e,t)}function yN(e,t,r){return t=V3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function V3(e){var t=yhe(e,"string");return cu(t)=="symbol"?t:t+""}function yhe(e,t){if(cu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(cu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var QE=1,bhe=function(e){function t(){var r;fhe(this,t);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return r=phe(this,t,[].concat(s)),yN(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),yN(r,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,d,u;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(d=(u=r.props.coordinate)===null||u===void 0?void 0:u.y)!==null&&d!==void 0?d:0}})}}),r}return xhe(t,e),mhe(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>QE||Math.abs(n.height-this.state.lastBoundingBox.height)>QE)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,s;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,s=this.props,i=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,d=s.children,u=s.coordinate,f=s.hasPayload,h=s.isAnimationActive,m=s.offset,v=s.position,p=s.reverseDirection,x=s.useTranslate3d,b=s.viewBox,y=s.wrapperStyle,w=uhe({allowEscapeViewBox:o,coordinate:u,offsetTopLeft:m,position:v,reverseDirection:p,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewB
594ox:b}),_=w.cssClasses,N=w.cssProperties,j=XE(XE({transition:h&&i?"transform ".concat(l,"ms ").concat(c):void 0},N),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&f?"visible":"hidden",position:"absolute",top:0,left:0},y);return I.createElement("div",{tabIndex:-1,className:_,style:j,ref:function(C){n.wrapperNode=C}},d)}}])}(g.PureComponent),whe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},xa={isSsr:whe(),get:function(t){return xa[t]},set:function(t,r){if(typeof t=="string")xa[t]=r;else{var n=Object.keys(t);n&&n.length&&n.forEach(function(s){xa[s]=t[s]})}}};function du(e){"@babel/helpers - typeof";return du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},du(e)}function JE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ZE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?JE(Object(r),!0).forEach(function(n){WC(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):JE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jhe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nhe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,G3(n.key),n)}}function She(e,t,r){return t&&Nhe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _he(e,t,r){return t=nx(t),Che(e,q3()?Reflect.construct(t,r||[],nx(e).constructor):t.apply(e,r))}function Che(e,t){if(t&&(du(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Phe(e)}function Phe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(q3=function(){return!!e})()}function nx(e){return nx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},nx(e)}function khe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bN(e,t)}
vendor: 15,444 bytes, lines 594-600
594function bN(e,t){return bN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},bN(e,t)}function WC(e,t,r){return t=G3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function G3(e){var t=Ahe(e,"string");return du(t)=="symbol"?t:t+""}function Ahe(e,t){if(du(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(du(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ehe(e){return e.dataKey}function Ohe(e,t){return I.isValidElement(e)?I.cloneElement(e,t):typeof e=="function"?I.createElement(e,t):I.createElement(she,t)}var Ar=function(e){function t(){return jhe(this,t),_he(this,t,arguments)}return khe(t,e),She(t,[{key:"render",value:function(){var n=this,s=this.props,i=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,d=s.content,u=s.coordinate,f=s.filterNull,h=s.isAnimationActive,m=s.offset,v=s.payload,p=s.payloadUniqBy,x=s.position,b=s.reverseDirection,y=s.useTranslate3d,w=s.viewBox,_=s.wrapperStyle,N=v??[];f&&N.length&&(N=R3(v.filter(function(S){return S.value!=null&&(S.hide!==!0||n.props.includeHidden)}),p,Ehe));var j=N.length>0;return I.createElement(bhe,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:i,coordinate:u,hasPayload:j,offset:m,position:x,reverseDirection:b,useTranslate3d:y,viewBox:w,wrapperStyle:_},Ohe(d,ZE(ZE({},this.props),{},{payload:N})))}}])}(g.PureComponent);WC(Ar,"displayName","Tooltip");WC(Ar,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!xa.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var The=zs,Mhe=function(){return The.Date.now()},Ihe=Mhe,$he=/\s/;function Rhe(e){for(var t=e.length;t--&&$he.test(e.charAt(t)););return t}var Dhe=Rhe,Lhe=Dhe,Fhe=/^\s+/;function Bhe(e){return e&&e.slice(0,Lhe(e)+1).replace(Fhe,"")}var zhe=Bhe,Uhe=zhe,eO=Xo,Whe=tf,tO=NaN,Hhe=/^[-+]0x[0-9a-f]+$/i,Vhe=/^0b[01]+$/i,qhe=/^0o[0-7]+$/i,Ghe=parseInt;function Khe(e){if(typeof e=="number")return e;if(Whe(e))return tO;if(eO(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=eO(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Uhe(e);var r=Vhe.test(e);return r||qhe.test(e)?Ghe(e.slice(2),r?2:8):Hhe.test(e)?tO:+e}var K3=Khe,Yhe=Xo,jw=Ihe,rO=K3,Xhe="Expected a function",Qhe=Math.max,Jhe=Math.min;function Zhe(e,t,r){var n,s,i,o,l,c,d=0,u=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(Xhe);t=rO(t)||0,Yhe(r)&&(u=!!r.leading,f="maxWait"in r,i=f?Qhe(rO(r.maxWait)||0,t):i,h="trailing"in r?!!r.trailing:h);function m(j){var S=n,C=s;return n=s=void 0,d=j,o=e.apply(C,S),o}function v(j){return d=j,l=setTimeout(b,t),u?m(j):o}function p(j){var S=j-c,C=j-d,P=t-S;return f?Jhe(P,i-C):P}function x(j){var S=j-c,C=j-d;return c===void 0||S>=t||S<0||f&&C>=i}function b(){var j=jw();if(x(j))return y(j);l=setTimeout(b,p(j))}function y(j){return l=void 0,h&&n?m(j):(n=s=void 0,o)}function w(){l!==void 0&&clearTimeout(l),d=0,n=c=s=l=void 0}function _(){return l===void 0?o:y(jw())}function N(){var j=jw(),S=x(j);if(n=arguments,s=this,c=j,S){if(l===void 0)return v(c);if(f)return clearTimeout(l),l=setTimeout(b,t),m(c)}return l===void 0&&(l=setTimeout(b,t)),o}return N.cancel=w,N.flush=_,N}var eme=Zhe,tme=eme,rme=Xo,nme="Expected a function";function ame(e,t,r){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(nme);return rme(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),tme(e,t,{leading:n,maxWait:t,trailing:s})}var sme=ame;const Y3=mt(sme);function sm(e){"@babel/helpers - typeof";return sm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sm(e)}function nO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function fg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nO(Object(r),!0).forEach(function(n){ime(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ime(e,t,r){return t=ome(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ome(e){var t=lme(e,"string");return sm(t)=="symbol"?t:t+""}function lme(e,t){if(sm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(sm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cme(e,t){return hme(e)||fme(e,t)||ume(e,t)||dme()}function dme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 595In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ume(e,t){if(e){if(typeof e=="string")return aO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return aO(e,t)}}function aO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fme(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,d=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function hme(e){if(Array.isArray(e))return e}var js=g.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,s=n===void 0?{width:-1,height:-1}:n,i=e.width,o=i===void 0?"100%":i,l=e.height,c=l===void 0?"100%":l,d=e.minWidth,u=d===void 0?0:d,f=e.minHeight,h=e.maxHeight,m=e.children,v=e.debounce,p=v===void 0?0:v,x=e.id,b=e.className,y=e.onResize,w=e.style,_=w===void 0?{}:w,N=g.useRef(null),j=g.useRef();j.current=y,g.useImperativeHandle(t,function(){return Object.defineProperty(N.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),N.current},configurable:!0})});var S=g.useState({containerWidth:s.width,containerHeight:s.height}),C=cme(S,2),P=C[0],A=C[1],D=g.useCallback(function(q,B){A(function(V){var E=Math.round(q),M=Math.round(B);return V.containerWidth===E&&V.containerHeight===M?V:{containerWidth:E,containerHeight:M}})},[]);g.useEffect(function(){var q=function(L){var K,H=L[0].contentRect,ee=H.width,se=H.height;D(ee,se),(K=j.current)===null||K===void 0||K.call(j,ee,se)};p>0&&(q=Y3(q,p,{trailing:!0,leading:!1}));var B=new ResizeObserver(q),V=N.current.getBoundingClientRect(),E=V.width,M=V.height;return D(E,M),B.observe(N.current),function(){B.disconnect()}},[D,p]);var F=g.useMemo(function(){var q=P.containerWidth,B=P.containerHeight;if(q<0||B<0)return null;ts(El(o)||El(c),`The width(%s) and height(%s) are both fixed numbers, 596 maybe you don't need to use a ResponsiveContainer.`,o,c),ts(!r||r>0,"The aspect(%s) must be greater than zero.",r);var V=El(o)?q:o,E=El(c)?B:c;r&&r>0&&(V?E=V/r:E&&(V=E*r),h&&E>h&&(E=h)),ts(V>0||E>0,`The width(%s) and height(%s) of chart should be greater than 0, 597 please check the style of container, or the props width(%s) and height(%s), 598 or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the 599 height and width.`,V,E,o,c,u,f,r);var M=!Array.isArray(m)&&ui(m.type).endsWith("Chart");return I.Children.map(m,function(T){return I.isValidElement(T)?g.cloneElement(T,fg({width:V,height:E},M?{style:fg({height:"100%",width:"100%",maxHeight:E,maxWidth:V},T.props.style)}:{})):T})},[r,m,c,h,f,u,P,o]);return I.createElement("div",{id:x?"".concat(x):void 0,className:qe("recharts-responsive-container",b),style:fg(fg({},_),{},{width:o,height:c,minWidth:u,minHeight:f,maxHeight:h}),ref:N},F)}),Jo=function(t){return null};Jo.displayName="Cell";function im(e){"@babel/helpers - typeof";return im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},im(e)}function sO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function wN(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sO(Object(r),!0).forEach(function(n){mme(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mme(e,t,r){return t=pme(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pme(e){var t=gme(e,"string");return im(t)=="symbol"?t:t+""}function gme(e,t){if(im(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(im(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bc={widthCache:{},cacheCount:0},vme=2e3,xme={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},iO="recharts_measurement_span";function yme(e){var t=wN({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var yh=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||xa.isSsr)return{width:0,height:0};var n=yme(r),s=JSON.stringify({text:t,copyStyle:n});if(Bc.widthCache[s])return Bc.widthCache[s];try{var i=document.getElementById(iO);i||(i=document.createElement("span"),i.setAttribute("id",iO),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=wN(wN({},xme),n);Object.assign(i.style,o),i.textContent="".concat(t);var l=i.getBoundingClientRect(),c={width:l.width,height:l.height};return Bc.widthCache[s]=c,++Bc.cacheCount>vme&&(Bc.cacheCount=0,Bc.widthCache={}),c}catch{return{width:0,height:0}}},bme=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function om(e){"@babel/helpers - typeof";return om=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},om(e)}function ax(e,t){return Sme(e)||Nme(e,t)||jme(e,t)||wme()}function wme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 600In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jme(e,t){if(e){if(typeof e=="string")return oO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oO(e,t)}}function oO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Nme(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,d=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function Sme(e){if(Array.isArray(e))return e}function _me(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lO(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Pme(n.key),n)}}function Cme(e,t,r){return t&&lO(e.prototype,t),r&&lO(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pme(e){var t=kme(e,"string");return om(t)=="symbol"?t:t+""}function kme(e,t){if(om(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(om(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var cO=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,dO=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Ame=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Eme=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,X3={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Ome=Object.keys(X3),fd="NaN";function Tme(e,t){return e*X3[t]}var hg=function(){function e(t,r){_me(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!Ame.test(r)&&(this.num=NaN,this.unit=""),Ome.includes(r)&&(this.num=Tme(t,r),this.unit="px")}return Cme(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,s=(n=Eme.exec(r))!==null&&n!==void 0?n:[],i=ax(s,3),o=i[1],l=i[2];return new e(parseFloat(o),l??"")}}])}();function Q3(e){if(e.includes(fd))return fd;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=cO.exec(t))!==null&&r!==void 0?r:[],s=ax(n,4),i=s[1],o=s[2],l=s[3],c=hg.parse(i??""),d=hg.parse(l??""),u=o==="*"?c.multiply(d):c.divide(d);if(u.isNaN())return fd;t=t.replace(cO,u.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=dO.exec(t))!==null&&f!==void 0?f:[],m=ax(h,4),v=m[1],p=m[2],x=m[3],b=hg.parse(v??""),y=hg.parse(x??""),w=p==="+"?b.add(y):b.subtract(y);if(w.isNaN())return fd;t=t.replace(dO,w.toString())}return t}var uO=/\(([^()]*)\)/;function Mme(e){for(var t=e;t.includes("(");){var r=uO.exec(t),n=ax(r,2),s=n[1];t=t.replace(uO,Q3(s))}return t}function Ime(e){var t=e.replace(/\s+/g,"");return t=Mme(t),t=Q3(t),t}function $me(e){try{return Ime(e)}catch{return fd}}function Nw(e){var t=$me(e.slice(5,-1));return t===fd?"":t}var Rme=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],Dme=["dx","dy","angle","className","breakAll"];function jN(){return jN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
vendor: 1,578 bytes, lines 600-601
600for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jN.apply(this,arguments)}function fO(e,t){if(e==null)return{};var r=Lme(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Lme(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function hO(e,t){return Ume(e)||zme(e,t)||Bme(e,t)||Fme()}function Fme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 601In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bme(e,t){if(e){if(typeof e=="string")return mO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mO(e,t)}}function mO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function zme(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,d=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function Ume(e){if(Array.isArray(e))return e}
601var J3=/[ \f\n\r\t\v\u2028\u2029]+/,Z3=function(t){var r=t.children,n=t.breakAll,s=t.style;try{var i=[];Le(r)||(n?i=r.toString().split(""):i=r.toString().split(J3));var o=i.map(function(c){return{word:c,width:yh(c,s).width}}),l=n?0:yh(" ",s).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},Wme=function(t,r,n,s,i){var o=t.maxLines,l=t.children,c=t.style,d=t.breakAll,u=xe(o),f=l,h=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return V.reduce(function(E,M){var T=M.word,L=M.width,K=E[E.length-1];if(K&&(s==null||i||K.width+L+n<Number(s)))K.words.push(T),K.width+=L+n;else{var H={words:[T],width:L};E.push(H)}return E},[])},m=h(r),v=function(V){return V.reduce(function(E,M){return E.width>M.width?E:M})};if(!u)return m;for(var p="â¦",x=function(V){var E=f.slice(0,V),M=Z3({breakAll:d,style:c,children:E+p}).wordsWithComputedWidth,T=h(M),L=T.length>o||v(T).width>Number(s);return[L,T]},b=0,y=f.length-1,w=0,_;b<=y&&w<=f.length-1;){var N=Math.floor((b+y)/2),j=N-1,S=x(j),C=hO(S,2),P=C[0],A=C[1],D=x(N),F=hO(D,1),q=F[0];if(!P&&!q&&(b=N+1),P&&q&&(y=N-1),!P&&q){_=A;break}w++}return _||m},pO=function(t){var r=Le(t)?[]:t.toString().split(J3);return[{words:r}]},Hme=function(t){var r=t.width,n=t.scaleToFit,s=t.children,i=t.style,o=t.breakAll,l=t.maxLines;if((r||n)&&!xa.isSsr){var c,d,u=Z3({breakAll:o,children:s,style:i});if(u){var f=u.wordsWithComputedWidth,h=u.spaceWidth;c=f,d=h}else return pO(s);return Wme({breakAll:o,children:s,maxLines:l,style:i},c,d,r,n)}return pO(s)},gO="#808080",lc=function(t){var r=t.x,n=r===void 0?0:r,s=t.y,i=s===void 0?0:s,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,d=c===void 0?"0.71em":c,u=t.scaleToFit,f=u===void 0?!1:u,h=t.textAnchor,m=h===void 0?"start":h,v=t.verticalAnchor,p=v===void 0?"end":v,x=t.fill,b=x===void 0?gO:x,y=fO(t,Rme),w=g.useMemo(function(){return Hme({breakAll:y.breakAll,children:y.children,maxLines:y.maxLines,scaleToFit:f,style:y.style,width:y.width})},[y.breakAll,y.children,y.maxLines,f,y.style,y.width]),_=y.dx,N=y.dy,j=y.angle,S=y.className,C=y.breakAll,P=fO(y,Dme);if(!Sr(n)||!Sr(i))return null;var A=n+(xe(_)?_:0),D=i+(xe(N)?N:0),F;switch(p){case"start":F=Nw("calc(".concat(d,")"));break;case"middle":F=Nw("calc(".concat((w.length-1)/2," * -").concat(l," + (").concat(d," / 2))"));break;default:F=Nw("calc(".concat(w.length-1," * -").concat(l,")"));break}var q=[];if(f){var B=w[0].width,V=y.width;q.push("scale(".concat((xe(V)?V/B:1)/B,")"))}return j&&q.push("rotate(".concat(j,", ").concat(A,", ").concat(D,")")),q.length&&(P.transform=q.join(" ")),I.createElement("text",jN({},Ae(P,!0),{x:A,y:D,className:qe("recharts-text",S),textAnchor:m,fill:b.includes("url")?gO:b}),w.map(function(E,M){var T=E.words.join(C?"":" ");return I.createElement("tspan",{x:A,dy:M===0?F:l,key:"".concat(T,"-").concat(M)},T)}))};function Eo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Vme(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function HC(e){let t,r,n;e.length!==2?(t=Eo,r=(l,c)=>Eo(e(l),c),n=(l,c)=>e(l)-c):(t=e===Eo||e===Vme?e:qme,r=e,n=e);function s(l,c,d=0,u=l.length){if(d<u){if(t(c,c)!==0)return u;do{const f=d+u>>>1;r(l[f],c)<0?d=f+1:u=f}while(d<u)}return d}function i(l,c,d=0,u=l.length){if(d<u){if(t(c,c)!==0)return u;do{const f=d+u>>>1;r(l[f],c)<=0?d=f+1:u=f}while(d<u)}return d}function o(l,c,d=0,u=l.length){const f=s(l,c,d,u-1);return f>d&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:s,center:o,right:i}}function qme(){return 0}function eL(e){return e===null?NaN:+e}function*Gme(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const Kme=HC(Eo),up=Kme.right;HC(eL).center;class vO extends Map{constructor(t,r=Qme){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,s]of t)this.set(n,s)}get(t){return super.get(xO(this,t))}has(t){return super.has(xO(this,t))}set(t,r){return super.set(Yme(this,t),r)}delete(t){return super.delete(Xme(this,t))}}function xO({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function Yme({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function Xme({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Qme(e){return e!==null&&typeof e=="object"?e.valueOf():e}
601function Jme(e=Eo){if(e===Eo)return tL;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function tL(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Zme=Math.sqrt(50),epe=Math.sqrt(10),tpe=Math.sqrt(2);function sx(e,t,r){const n=(t-e)/Math.max(0,r),s=Math.floor(Math.log10(n)),i=n/Math.pow(10,s),o=i>=Zme?10:i>=epe?5:i>=tpe?2:1;let l,c,d;return s<0?(d=Math.pow(10,-s)/o,l=Math.round(e*d),c=Math.round(t*d),l/d<e&&++l,c/d>t&&--c,d=-d):(d=Math.pow(10,s)*o,l=Math.round(e/d),c=Math.round(t/d),l*d<e&&++l,c*d>t&&--c),c<l&&.5<=r&&r<2?sx(e,t,r*2):[l,c,d]}function NN(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[s,i,o]=n?sx(t,e,r):sx(e,t,r);if(!(i>=s))return[];const l=i-s+1,c=new Array(l);if(n)if(o<0)for(let d=0;d<l;++d)c[d]=(i-d)/-o;else for(let d=0;d<l;++d)c[d]=(i-d)*o;else if(o<0)for(let d=0;d<l;++d)c[d]=(s+d)/-o;else for(let d=0;d<l;++d)c[d]=(s+d)*o;return c}function SN(e,t,r){return t=+t,e=+e,r=+r,sx(e,t,r)[2]}function _N(e,t,r){t=+t,e=+e,r=+r;const n=t<e,s=n?SN(t,e,r):SN(e,t,r);return(n?-1:1)*(s<0?1/-s:s)}function yO(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function bO(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function rL(e,t,r=0,n=1/0,s){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(s=s===void 0?tL:Jme(s);n>r;){if(n-r>600){const c=n-r+1,d=t-r+1,u=Math.log(c),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(c-f)/c)*(d-c/2<0?-1:1),m=Math.max(r,Math.floor(t-d*f/c+h)),v=Math.min(n,Math.floor(t+(c-d)*f/c+h));rL(e,t,m,v,s)}const i=e[t];let o=r,l=n;for($f(e,r,t),s(e[n],i)>0&&$f(e,r,n);o<l;){for($f(e,o,l),++o,--l;s(e[o],i)<0;)++o;for(;s(e[l],i)>0;)--l}s(e[r],i)===0?$f(e,r,l):(++l,$f(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function $f(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function rpe(e,t,r){if(e=Float64Array.from(Gme(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return bO(e);if(t>=1)return yO(e);var n,s=(n-1)*t,i=Math.floor(s),o=yO(rL(e,i).subarray(0,i+1)),l=bO(e.subarray(i+1));return o+(l-o)*(s-i)}}function npe(e,t,r=eL){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,s=(n-1)*t,i=Math.floor(s),o=+r(e[i],i,e),l=+r(e[i+1],i+1,e);return o+(l-o)*(s-i)}}function ape(e,t,r){e=+e,t=+t,r=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+r;for(var n=-1,s=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(s);++n<s;)i[n]=e+n*r;return i}function Pa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Mi(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const CN=Symbol("implicit");function VC(){var e=new vO,t=[],r=[],n=CN;function s(i){let o=e.get(i);if(o===void 0){if(n!==CN)return n;e.set(i,o=t.push(i)-1)}return r[o%r.length]}return s.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new vO;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return s},s.range=function(i){return arguments.length?(r=Array.from(i),s):r.slice()},s.unknown=function(i){return arguments.length?(n=i,s):n},s.copy=function(){return VC(t,r).unknown(n)},Pa.apply(s,arguments),s}function lm(){var e=VC().unknown(void 0),t=e.domain,r=e.range,n=0,s=1,i,o,l=!1,c=0,d=0,u=.5;delete e.unknown;function f(){var h=t().length,m=s<n,v=m?s:n,p=m?n:s;i=(p-v)/Math.max(1,h-c+d*2),l&&(i=Math.floor(i)),v+=(p-v-i*(h-c))*u,o=i*(1-c),l&&(v=Math.round(v),o=Math.round(o));var x=ape(h).map(function(b){return v+i*b});return r(m?x.reverse():x)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([n,s]=h,n=+n,s=+s,f()):[n,s]},e.rangeRound=function(h){return[n,s]=h,n=+n,s=+s,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(h){return arguments.length?(l=!!h,f()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,d=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(d=+h,f()):d},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),f()):u},e.copy=function(){return lm(t(),[n,s]).round(l).paddingInner(c).paddingOuter(d).align(u)},Pa.apply(f(),arguments)}function nL(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return nL(t())},e}function bh(){return nL(lm.apply(null,arguments).paddingInner(1))}function qC(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function aL(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function fp(){}var cm=.7,ix=1/cm,Ad="\\s*([+-]?\\d+)\\s*",dm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ms="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",spe=/^#([0-9a-f]{3,8})$/,ipe=new RegExp(`^rgb\\(${Ad},${Ad},${Ad}\\)$`),ope=new RegExp(`^rgb\\(${Ms},${Ms},${Ms}\\)$`),lpe=new RegExp(`^rgba\\(${Ad},${Ad},${Ad},${dm}\\)$`),cpe=new RegExp(`^rgba\\(${Ms},${Ms},${Ms},${dm}\\)$`),dpe=new RegExp(`^hsl\\(${dm},${Ms},${Ms}\\)$`),upe=new RegExp(`^hsla\\(${dm},${Ms},${Ms},${dm}\\)$`),wO={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};qC(fp,um,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jO,formatHex:jO,formatHex8:fpe,formatHsl:hpe,formatRgb:NO,toString:NO});function jO(){return this.rgb().formatHex()}function fpe(){return this.rgb().formatHex8()}function hpe(){return sL(this).formatHsl()}function NO(){return this.rgb().formatRgb()}function um(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=spe.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?SO(t):r===3?new En(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?mg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?mg(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ipe.exec(e))?new En(t[1],t[2],t[3],1):(t=ope.exec(e))?new En(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lpe.exec(e))?mg(t[1],t[2],t[3],t[4]):(t=cpe.exec(e))?mg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dpe.exec(e))?PO(t[1],t[2]/100,t[3]/100,1):(t=upe.exec(e))?PO(t[1],t[2]/100,t[3]/100,t[4]):wO.hasOwnProperty(e)?SO(wO[e]):e==="transparent"?new En(NaN,NaN,NaN,0):null}function SO(e){return new En(e>>16&255,e>>8&255,e&255,1)}function mg(e,t,r,n){return n<=0&&(e=t=r=NaN),new En(e,t,r,n)}function mpe(e){return e instanceof fp||(e=um(e)),e?(e=e.rgb(),new En(e.r,e.g,e.b,e.opacity)):new En}function PN(e,t,r,n){return arguments.length===1?mpe(e):new En(e,t,r,n??1)}function En(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}qC(En,PN,aL(fp,{brighter(e){return e=e==null?ix:Math.pow(ix,e),new En(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?cm:Math.pow(cm,e),new En(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new En(Yl(this.r),Yl(this.g),Yl(this.b),ox(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:_O,formatHex:_O,formatHex8:ppe,formatRgb:CO,toString:CO}));function _O(){return`#${Ol(this.r)}${Ol(this.g)}${Ol(this.b)}`}function ppe(){return`#${Ol(this.r)}${Ol(this.g)}${Ol(this.b)}${Ol((isNaN(this.opacity)?1:this.opacity)*255)}`}function CO(){const e=ox(this.opacity);return`${e===1?"rgb(":"rgba("}${Yl(this.r)}, ${Yl(this.g)}, ${Yl(this.b)}${e===1?")":`, ${e})`}`}function ox(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Yl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ol(e){return e=Yl(e),(e<16?"0":"")+e.toString(16)}function PO(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ga(e,t,r,n)}function sL(e){if(e instanceof Ga)return new Ga(e.h,e.s,e.l,e.opacity);if(e instanceof fp||(e=um(e)),!e)return new Ga;if(e instanceof Ga)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,s=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,l=i-s,c=(i+s)/2;return l?(t===i?o=(r-n)/l+(r<n)*6:r===i?o=(n-t)/l+2:o=(t-r)/l+4,l/=c<.5?i+s:2-i-s,o*=60):l=c>0&&c<1?0:o,new Ga(o,l,c,e.opacity)}function gpe(e,t,r,n){return arguments.length===1?sL(e):new Ga(e,t,r,n??1)}function Ga(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}qC(Ga,gpe,aL(fp,{brighter(e){return e=e==null?ix:Math.pow(ix,e),new Ga(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cm:Math.pow(cm,e),new Ga(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,s=2*r-n;return new En(Sw(e>=240?e-240:e+120,s,n),Sw(e,s,n),Sw(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new Ga(kO(this.h),pg(this.s),pg(this.l),ox(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ox(this.opacity);return`${e===1?"hsl(":"hsla("}${kO(this.h)}, ${pg(this.s)*100}%, ${pg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kO(e){return e=(e||0)%360,e<0?e+360:e}function pg(e){return Math.max(0,Math.min(1,e||0))}function Sw(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const GC=e=>()=>e;function vpe(e,t){return function(r){return e+r*t}}function xpe(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function ype(e){return(e=+e)==1?iL:function(t,r){return r-t?xpe(t,r,e):GC(isNaN(t)?r:t)}}function iL(e,t){var r=t-e;return r?vpe(e,r):GC(isNaN(e)?t:e)}const AO=function e(t){var r=ype(t);function n(s,i){var o=r((s=PN(s)).r,(i=PN(i)).r),l=r(s.g,i.g),c=r(s.b,i.b),d=iL(s.opacity,i.opacity);return function(u){return s.r=o(u),s.g=l(u),s.b=c(u),s.opacity=d(u),s+""}}return n.gamma=e,n}(1);function bpe(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),s;return function(i){for(s=0;s<r;++s)n[s]=e[s]*(1-i)+t[s]*i;return n}}function wpe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function jpe(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,s=new Array(n),i=new Array(r),o;for(o=0;o<n;++o)s[o]=uf(e[o],t[o]);for(;o<r;
vendor: 5,216 bytes, line 601
601++o)i[o]=t[o];return function(l){for(o=0;o<n;++o)i[o]=s[o](l);return i}}function Npe(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function lx(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function Spe(e,t){var r={},n={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?r[s]=uf(e[s],t[s]):n[s]=t[s];return function(i){for(s in r)n[s]=r[s](i);return n}}var kN=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_w=new RegExp(kN.source,"g");function _pe(e){return function(){return e}}function Cpe(e){return function(t){return e(t)+""}}function Ppe(e,t){var r=kN.lastIndex=_w.lastIndex=0,n,s,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=kN.exec(e))&&(s=_w.exec(t));)(i=s.index)>r&&(i=t.slice(r,i),l[o]?l[o]+=i:l[++o]=i),(n=n[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:lx(n,s)})),r=_w.lastIndex;return r<t.length&&(i=t.slice(r),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?Cpe(c[0].x):_pe(t):(t=c.length,function(d){for(var u=0,f;u<t;++u)l[(f=c[u]).i]=f.x(d);return l.join("")})}function uf(e,t){var r=typeof t,n;return t==null||r==="boolean"?GC(t):(r==="number"?lx:r==="string"?(n=um(t))?(t=n,AO):Ppe:t instanceof um?AO:t instanceof Date?Npe:wpe(t)?bpe:Array.isArray(t)?jpe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Spe:lx)(e,t)}function KC(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function kpe(e,t){t===void 0&&(t=e,e=uf);for(var r=0,n=t.length-1,s=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(s,s=t[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return i[l](o-l)}}function Ape(e){return function(){return e}}function cx(e){return+e}var EO=[0,1];function mn(e){return e}function AN(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Ape(isNaN(t)?NaN:.5)}function Epe(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Ope(e,t,r){var n=e[0],s=e[1],i=t[0],o=t[1];return s<n?(n=AN(s,n),i=r(o,i)):(n=AN(n,s),i=r(i,o)),function(l){return i(n(l))}}function Tpe(e,t,r){var n=Math.min(e.length,t.length)-1,s=new Array(n),i=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)s[o]=AN(e[o],e[o+1]),i[o]=r(t[o],t[o+1]);return function(l){var c=up(e,l,1,n)-1;return i[c](s[c](l))}}function hp(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function xb(){var e=EO,t=EO,r=uf,n,s,i,o=mn,l,c,d;function u(){var h=Math.min(e.length,t.length);return o!==mn&&(o=Epe(e[0],e[h-1])),l=h>2?Tpe:Ope,c=d=null,f}function f(h){return h==null||isNaN(h=+h)?i:(c||(c=l(e.map(n),t,r)))(n(o(h)))}return f.invert=function(h){return o(s((d||(d=l(t,e.map(n),lx)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,cx),u()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=KC,u()},f.clamp=function(h){return arguments.length?(o=h?!0:mn,u()):o!==mn},f.interpolate=function(h){return arguments.length?(r=h,u()):r},f.unknown=function(h){return arguments.length?(i=h,f):i},function(h,m){return n=h,s=m,u()}}function YC(){return xb()(mn,mn)}function Mpe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function dx(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function uu(e){return e=dx(Math.abs(e)),e?e[1]:NaN}function Ipe(e,t){return function(r,n){for(var s=r.length,i=[],o=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),i.push(r.substring(s-=l,s+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return i.reverse().join(t)}}function $pe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Rpe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function fm(e){if(!(t=Rpe.exec(e)))throw new Error("invalid format: "+e);var t;return new XC({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}fm.prototype=XC.prototype;function XC(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}XC.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Dpe(e){e:for(var t=e.length,r=1,n=-1,s;r<t;++r)switch(e[r]){case".":n=s=r;break;case"0":n===0&&(n=r),s=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(s+1):e}var oL;function Lpe(e,t){var r=dx(e,t);if(!r)return e+"";var n=r[0],s=r[1],i=s-(oL=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>
vendor: 5,101 bytes, line 601
6010?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+dx(e,Math.max(0,t+i-1))[0]}function OO(e,t){var r=dx(e,t);if(!r)return e+"";var n=r[0],s=r[1];return s<0?"0."+new Array(-s).join("0")+n:n.length>s+1?n.slice(0,s+1)+"."+n.slice(s+1):n+new Array(s-n.length+2).join("0")}const TO={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Mpe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>OO(e*100,t),r:OO,s:Lpe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function MO(e){return e}var IO=Array.prototype.map,$O=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Fpe(e){var t=e.grouping===void 0||e.thousands===void 0?MO:Ipe(IO.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?MO:$pe(IO.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"â":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function d(f){f=fm(f);var h=f.fill,m=f.align,v=f.sign,p=f.symbol,x=f.zero,b=f.width,y=f.comma,w=f.precision,_=f.trim,N=f.type;N==="n"?(y=!0,N="g"):TO[N]||(w===void 0&&(w=12),_=!0,N="g"),(x||h==="0"&&m==="=")&&(x=!0,h="0",m="=");var j=p==="$"?r:p==="#"&&/[boxX]/.test(N)?"0"+N.toLowerCase():"",S=p==="$"?n:/[%p]/.test(N)?o:"",C=TO[N],P=/[defgprs%]/.test(N);w=w===void 0?6:/[gprs]/.test(N)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function A(D){var F=j,q=S,B,V,E;if(N==="c")q=C(D)+q,D="";else{D=+D;var M=D<0||1/D<0;if(D=isNaN(D)?c:C(Math.abs(D),w),_&&(D=Dpe(D)),M&&+D==0&&v!=="+"&&(M=!1),F=(M?v==="("?v:l:v==="-"||v==="("?"":v)+F,q=(N==="s"?$O[8+oL/3]:"")+q+(M&&v==="("?")":""),P){for(B=-1,V=D.length;++B<V;)if(E=D.charCodeAt(B),48>E||E>57){q=(E===46?s+D.slice(B+1):D.slice(B))+q,D=D.slice(0,B);break}}}y&&!x&&(D=t(D,1/0));var T=F.length+D.length+q.length,L=T<b?new Array(b-T+1).join(h):"";switch(y&&x&&(D=t(L+D,L.length?b-q.length:1/0),L=""),m){case"<":D=F+D+q+L;break;case"=":D=F+L+D+q;break;case"^":D=L.slice(0,T=L.length>>1)+F+D+q+L.slice(T);break;default:D=L+F+D+q;break}return i(D)}return A.toString=function(){return f+""},A}function u(f,h){var m=d((f=fm(f),f.type="f",f)),v=Math.max(-8,Math.min(8,Math.floor(uu(h)/3)))*3,p=Math.pow(10,-v),x=$O[8+v/3];return function(b){return m(p*b)+x}}return{format:d,formatPrefix:u}}var gg,QC,lL;Bpe({thousands:",",grouping:[3],currency:["$",""]});function Bpe(e){return gg=Fpe(e),QC=gg.format,lL=gg.formatPrefix,gg}function zpe(e){return Math.max(0,-uu(Math.abs(e)))}function Upe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(uu(t)/3)))*3-uu(Math.abs(e)))}function Wpe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,uu(t)-uu(e))+1}function cL(e,t,r,n){var s=_N(e,t,r),i;switch(n=fm(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=Upe(s,o))&&(n.precision=i),lL(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=Wpe(s,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=zpe(s))&&(n.precision=i-(n.type==="%")*2);break}}return QC(n)}function Zo(e){var t=e.domain;return e.ticks=function(r){var n=t();return NN(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var s=t();return cL(s[0],s[s.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),s=0,i=n.length-1,o=n[s],l=n[i],c,d,u=10;for(l<o&&(d=o,o=l,l=d,d=s,s=i,i=d);u-- >0;){if(d=SN(o,l,r),d===c)return n[s]=o,n[i]=l,t(n);if(d>0)o=Math.floor(o/d)*d,l=Math.ceil(l/d)*d;else if(d<0)o=Math.ceil(o*d)/d,l=Math.floor(l*d)/d;else break;c=d}return e},e}function ux(){var e=YC();return e.copy=function(){return hp(e,ux())},Pa.apply(e,arguments),Zo(e)}function dL(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,cx),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return dL(e).unknown(t)},e=arguments.length?Array.from(e,cx):[0,1],Zo(r)}function uL(e,t){e=e.slice();var r=0,n=e.length-1,s=e[r],i=e[n],o;return i<s&&(o=r,r=n,n=o,o=s,s=i,i=o),e[r]=t.floor(s),e[n]=t.ceil(i),e}function RO(e){return Math.log(e)}function DO(e){return Math.exp(e)}function Hpe(e){return-Math.log(-e)}function Vpe(e){return-Math.exp(-e)}function qpe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Gpe(e){return e===10?qpe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Kpe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function LO(e){return(t,r)=>-e(-t,r)}function JC(e){const t=e(RO,DO),r=t.domain;let n=10,s,i;function o(){return s=Kpe(n),i=Gpe(n),r()[0]<0?(s=LO(s),i=LO(i),e(Hpe,Vpe)):e(RO,DO),t}return t.base=function(l){return arguments.length?(n=+l,o()):n},t.domain=function(l){return arguments.length?(r(l),o()):r()},t.ticks=l=>{const c=r();let d=c[0],u=c[c.length-1];const f=u<d;f&&([d,u]=[u,d]);let h=s(d),m=s(u),v,p;const x=l==null?10:+l;let b=[];
vendor: 4,386 bytes, line 601
601if(!(n%1)&&m-h<x){if(h=Math.floor(h),m=Math.ceil(m),d>0){for(;h<=m;++h)for(v=1;v<n;++v)if(p=h<0?v/i(-h):v*i(h),!(p<d)){if(p>u)break;b.push(p)}}else for(;h<=m;++h)for(v=n-1;v>=1;--v)if(p=h>0?v/i(-h):v*i(h),!(p<d)){if(p>u)break;b.push(p)}b.length*2<x&&(b=NN(d,u,x))}else b=NN(h,m,Math.min(m-h,x)).map(i);return f?b.reverse():b},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=fm(c)).precision==null&&(c.trim=!0),c=QC(c)),l===1/0)return c;const d=Math.max(1,n*l/t.ticks().length);return u=>{let f=u/i(Math.round(s(u)));return f*n<n-.5&&(f*=n),f<=d?c(u):""}},t.nice=()=>r(uL(r(),{floor:l=>i(Math.floor(s(l))),ceil:l=>i(Math.ceil(s(l)))})),t}function fL(){const e=JC(xb()).domain([1,10]);return e.copy=()=>hp(e,fL()).base(e.base()),Pa.apply(e,arguments),e}function FO(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function BO(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function ZC(e){var t=1,r=e(FO(t),BO(t));return r.constant=function(n){return arguments.length?e(FO(t=+n),BO(t)):t},Zo(r)}function hL(){var e=ZC(xb());return e.copy=function(){return hp(e,hL()).constant(e.constant())},Pa.apply(e,arguments)}function zO(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Ype(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Xpe(e){return e<0?-e*e:e*e}function e2(e){var t=e(mn,mn),r=1;function n(){return r===1?e(mn,mn):r===.5?e(Ype,Xpe):e(zO(r),zO(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,n()):r},Zo(t)}function t2(){var e=e2(xb());return e.copy=function(){return hp(e,t2()).exponent(e.exponent())},Pa.apply(e,arguments),e}function Qpe(){return t2.apply(null,arguments).exponent(.5)}function UO(e){return Math.sign(e)*e*e}function Jpe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function mL(){var e=YC(),t=[0,1],r=!1,n;function s(i){var o=Jpe(e(i));return isNaN(o)?n:r?Math.round(o):o}return s.invert=function(i){return e.invert(UO(i))},s.domain=function(i){return arguments.length?(e.domain(i),s):e.domain()},s.range=function(i){return arguments.length?(e.range((t=Array.from(i,cx)).map(UO)),s):t.slice()},s.rangeRound=function(i){return s.range(i).round(!0)},s.round=function(i){return arguments.length?(r=!!i,s):r},s.clamp=function(i){return arguments.length?(e.clamp(i),s):e.clamp()},s.unknown=function(i){return arguments.length?(n=i,s):n},s.copy=function(){return mL(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Pa.apply(s,arguments),Zo(s)}function pL(){var e=[],t=[],r=[],n;function s(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o<l;)r[o-1]=npe(e,o/l);return i}function i(o){return o==null||isNaN(o=+o)?n:t[up(r,o)]}return i.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Eo),s()},i.range=function(o){return arguments.length?(t=Array.from(o),s()):t.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return pL().domain(e).range(t).unknown(n)},Pa.apply(i,arguments)}function gL(){var e=0,t=1,r=1,n=[.5],s=[0,1],i;function o(c){return c!=null&&c<=c?s[up(n,c,0,r)]:i}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(r=(s=Array.from(c)).length-1,l()):s.slice()},o.invertExtent=function(c){var d=s.indexOf(c);return d<0?[NaN,NaN]:d<1?[e,n[0]]:d>=r?[n[r-1],t]:[n[d-1],n[d]]},o.unknown=function(c){return arguments.length&&(i=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return gL().domain([e,t]).range(s).unknown(i)},Pa.apply(Zo(o),arguments)}function vL(){var e=[.5],t=[0,1],r,n=1;function s(i){return i!=null&&i<=i?t[up(e,i,0,n)]:r}return s.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},s.unknown=function(i){return arguments.length?(r=i,s):r},s.copy=function(){return vL().domain(e).range(t).unknown(r)},Pa.apply(s,arguments)}
vendor: 5,151 bytes, line 601
601const Cw=new Date,Pw=new Date;function _r(e,t,r,n){function s(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return s.floor=i=>(e(i=new Date(+i)),i),s.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),s.round=i=>{const o=s(i),l=s.ceil(i);return i-o<l-i?o:l},s.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),s.range=(i,o,l)=>{const c=[];if(i=s.ceil(i),l=l==null?1:Math.floor(l),!(i<o)||!(l>0))return c;let d;do c.push(d=new Date(+i)),t(i,l),e(i);while(d<i&&i<o);return c},s.filter=i=>_r(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!i(o););else for(;--l>=0;)for(;t(o,1),!i(o););}),r&&(s.count=(i,o)=>(Cw.setTime(+i),Pw.setTime(+o),e(Cw),e(Pw),Math.floor(r(Cw,Pw))),s.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?s.filter(n?o=>n(o)%i===0:o=>s.count(0,o)%i===0):s)),s}const fx=_r(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);fx.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?_r(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):fx);fx.range;const si=1e3,pa=si*60,ii=pa*60,ji=ii*24,r2=ji*7,WO=ji*30,kw=ji*365,Tl=_r(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*si)},(e,t)=>(t-e)/si,e=>e.getUTCSeconds());Tl.range;const n2=_r(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*si)},(e,t)=>{e.setTime(+e+t*pa)},(e,t)=>(t-e)/pa,e=>e.getMinutes());n2.range;const a2=_r(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*pa)},(e,t)=>(t-e)/pa,e=>e.getUTCMinutes());a2.range;const s2=_r(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*si-e.getMinutes()*pa)},(e,t)=>{e.setTime(+e+t*ii)},(e,t)=>(t-e)/ii,e=>e.getHours());s2.range;const i2=_r(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ii)},(e,t)=>(t-e)/ii,e=>e.getUTCHours());i2.range;const mp=_r(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pa)/ji,e=>e.getDate()-1);mp.range;const yb=_r(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ji,e=>e.getUTCDate()-1);yb.range;const xL=_r(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ji,e=>Math.floor(e/ji));xL.range;function Nc(e){return _r(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*pa)/r2)}const bb=Nc(0),hx=Nc(1),Zpe=Nc(2),ege=Nc(3),fu=Nc(4),tge=Nc(5),rge=Nc(6);bb.range;hx.range;Zpe.range;ege.range;fu.range;tge.range;rge.range;function Sc(e){return _r(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/r2)}const wb=Sc(0),mx=Sc(1),nge=Sc(2),age=Sc(3),hu=Sc(4),sge=Sc(5),ige=Sc(6);wb.range;mx.range;nge.range;age.range;hu.range;sge.range;ige.range;const o2=_r(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());o2.range;const l2=_r(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());l2.range;const Ni=_r(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ni.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_r(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Ni.range;const Si=_r(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Si.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:_r(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Si.range;function yL(e,t,r,n,s,i){const o=[[Tl,1,si],[Tl,5,5*si],[Tl,15,15*si],[Tl,30,30*si],[i,1,pa],[i,5,5*pa],[i,15,15*pa],[i,30,30*pa],[s,1,ii],[s,3,3*ii],[s,6,6*ii],[s,12,12*ii],[n,1,ji],[n,2,2*ji],[r,1,r2],[t,1,WO],[t,3,3*WO],[e,1,kw]];function l(d,u,f){const h=u<d;h&&([d,u]=[u,d]);const m=f&&typeof f.range=="function"?f:c(d,u,f),v=m?m.range(d,+u+1):[];return h?v.reverse():v}function c(d,u,f){const h=Math.abs(u-d)/f,m=HC(([,,x])=>x).right(o,h);if(m===o.length)return e.every(_N(d/kw,u/kw,f));if(m===0)return fx.every(Math.max(_N(d,u,f),1));const[v,p]=o[h/o[m-1][2]<o[m][2]/h?m-1:m];return v.every(p)}return[l,c]}const[oge,lge]=yL(Si,l2,wb,xL,i2,a2),[cge,dge]=yL(Ni,o2,bb,mp,s2,n2);function Aw(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ew(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Rf(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function uge(e){var t=e.dateTime,r=e.date,n=e.time,s=e.periods,i=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,d=Df(s),u=Lf(s),f=Df(i),h=Lf(i),m=Df
vendor: 6,492 bytes, line 601
601(o),v=Lf(o),p=Df(l),x=Lf(l),b=Df(c),y=Lf(c),w={a:M,A:T,b:L,B:K,c:null,d:YO,e:YO,f:Ige,g:Hge,G:qge,H:Oge,I:Tge,j:Mge,L:bL,m:$ge,M:Rge,p:H,q:ee,Q:JO,s:ZO,S:Dge,u:Lge,U:Fge,V:Bge,w:zge,W:Uge,x:null,X:null,y:Wge,Y:Vge,Z:Gge,"%":QO},_={a:se,A:ne,b:W,B:ie,c:null,d:XO,e:XO,f:Qge,g:ove,G:cve,H:Kge,I:Yge,j:Xge,L:jL,m:Jge,M:Zge,p:R,q:O,Q:JO,s:ZO,S:eve,u:tve,U:rve,V:nve,w:ave,W:sve,x:null,X:null,y:ive,Y:lve,Z:dve,"%":QO},N={a:A,A:D,b:F,B:q,c:B,d:GO,e:GO,f:Pge,g:qO,G:VO,H:KO,I:KO,j:Nge,L:Cge,m:jge,M:Sge,p:P,q:wge,Q:Age,s:Ege,S:_ge,u:gge,U:vge,V:xge,w:pge,W:yge,x:V,X:E,y:qO,Y:VO,Z:bge,"%":kge};w.x=j(r,w),w.X=j(n,w),w.c=j(t,w),_.x=j(r,_),_.X=j(n,_),_.c=j(t,_);function j(k,G){return function(te){var $=[],ae=-1,oe=0,z=k.length,fe,ue,Ne;for(te instanceof Date||(te=new Date(+te));++ae<z;)k.charCodeAt(ae)===37&&($.push(k.slice(oe,ae)),(ue=HO[fe=k.charAt(++ae)])!=null?fe=k.charAt(++ae):ue=fe==="e"?" ":"0",(Ne=G[fe])&&(fe=Ne(te,ue)),$.push(fe),oe=ae+1);return $.push(k.slice(oe,ae)),$.join("")}}function S(k,G){return function(te){var $=Rf(1900,void 0,1),ae=C($,k,te+="",0),oe,z;if(ae!=te.length)return null;if("Q"in $)return new Date($.Q);if("s"in $)return new Date($.s*1e3+("L"in $?$.L:0));if(G&&!("Z"in $)&&($.Z=0),"p"in $&&($.H=$.H%12+$.p*12),$.m===void 0&&($.m="q"in $?$.q:0),"V"in $){if($.V<1||$.V>53)return null;"w"in $||($.w=1),"Z"in $?(oe=Ew(Rf($.y,0,1)),z=oe.getUTCDay(),oe=z>4||z===0?mx.ceil(oe):mx(oe),oe=yb.offset(oe,($.V-1)*7),$.y=oe.getUTCFullYear(),$.m=oe.getUTCMonth(),$.d=oe.getUTCDate()+($.w+6)%7):(oe=Aw(Rf($.y,0,1)),z=oe.getDay(),oe=z>4||z===0?hx.ceil(oe):hx(oe),oe=mp.offset(oe,($.V-1)*7),$.y=oe.getFullYear(),$.m=oe.getMonth(),$.d=oe.getDate()+($.w+6)%7)}else("W"in $||"U"in $)&&("w"in $||($.w="u"in $?$.u%7:"W"in $?1:0),z="Z"in $?Ew(Rf($.y,0,1)).getUTCDay():Aw(Rf($.y,0,1)).getDay(),$.m=0,$.d="W"in $?($.w+6)%7+$.W*7-(z+5)%7:$.w+$.U*7-(z+6)%7);return"Z"in $?($.H+=$.Z/100|0,$.M+=$.Z%100,Ew($)):Aw($)}}function C(k,G,te,$){for(var ae=0,oe=G.length,z=te.length,fe,ue;ae<oe;){if($>=z)return-1;if(fe=G.charCodeAt(ae++),fe===37){if(fe=G.charAt(ae++),ue=N[fe in HO?G.charAt(ae++):fe],!ue||($=ue(k,te,$))<0)return-1}else if(fe!=te.charCodeAt($++))return-1}return $}function P(k,G,te){var $=d.exec(G.slice(te));return $?(k.p=u.get($[0].toLowerCase()),te+$[0].length):-1}function A(k,G,te){var $=m.exec(G.slice(te));return $?(k.w=v.get($[0].toLowerCase()),te+$[0].length):-1}function D(k,G,te){var $=f.exec(G.slice(te));return $?(k.w=h.get($[0].toLowerCase()),te+$[0].length):-1}function F(k,G,te){var $=b.exec(G.slice(te));return $?(k.m=y.get($[0].toLowerCase()),te+$[0].length):-1}function q(k,G,te){var $=p.exec(G.slice(te));return $?(k.m=x.get($[0].toLowerCase()),te+$[0].length):-1}function B(k,G,te){return C(k,t,G,te)}function V(k,G,te){return C(k,r,G,te)}function E(k,G,te){return C(k,n,G,te)}function M(k){return o[k.getDay()]}function T(k){return i[k.getDay()]}function L(k){return c[k.getMonth()]}function K(k){return l[k.getMonth()]}function H(k){return s[+(k.getHours()>=12)]}function ee(k){return 1+~~(k.getMonth()/3)}function se(k){return o[k.getUTCDay()]}function ne(k){return i[k.getUTCDay()]}function W(k){return c[k.getUTCMonth()]}function ie(k){return l[k.getUTCMonth()]}function R(k){return s[+(k.getUTCHours()>=12)]}function O(k){return 1+~~(k.getUTCMonth()/3)}return{format:function(k){var G=j(k+="",w);return G.toString=function(){return k},G},parse:function(k){var G=S(k+="",!1);return G.toString=function(){return k},G},utcFormat:function(k){var G=j(k+="",_);return G.toString=function(){return k},G},utcParse:function(k){var G=S(k+="",!0);return G.toString=function(){return k},G}}}var HO={"-":"",_:" ",0:"0"},Ir=/^\s*\d+/,fge=/^%/,hge=/[\\^$*+?|[\]().{}]/g;function pt(e,t,r){var n=e<0?"-":"",s=(n?-e:e)+"",i=s.length;return n+(i<r?new Array(r-i+1).join(t)+s:s)}function mge(e){return e.replace(hge,"\\$&")}function Df(e){return new RegExp("^(?:"+e.map(mge).join("|")+")","i")}function Lf(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function pge(e,t,r){var n=Ir.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function gge(e,t,r){var n=Ir.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function vge(e,t,r){var n=Ir.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function xge(e,t,r){var n=Ir.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function yge(e,t,r){var n=Ir.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function VO(e,t,r){var n=Ir.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function qO(e,t,r){var n=Ir.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function bge(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function wge(e,t,r){var n=Ir.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function jge(e,t,r){var n=Ir.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function GO(e,t,r){var n=Ir.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Nge(e,t,r){var n=Ir.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function KO(e,t,r){var n=Ir.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Sge(e,t,r){var n=Ir.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function _ge(e,t,r){var n=Ir.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Cge(e,t,r){var n=Ir.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function Pge(e,t,r){var n=Ir.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function kge(e,t,r){var n=fge.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function Age(e,t,r){var n=Ir.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function Ege(e,t,r){var n=Ir.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function YO(e,t){return pt(e.getDate(),t,2)}function Oge(e,t){return pt(e.getHours(),t,2)}function Tge(e,t){return pt(e.getHours()%12||12,t,2)}function Mge(e,t){return pt(1+mp.count(Ni(e),e),t,3)}function bL(e,t){return pt(e.getMilliseconds(),t,3)}function Ige(e,t){return bL(e,t)+"000"}function $ge(e,t){return pt(e.getMonth()+1,t,2)}function Rge(e,t){return pt(e.getMinutes(),t,2)}function Dge(e,t){return pt(e.getSeconds(),t,2)}function Lge(e){var t=e.getDay();return t===0?7:t}function Fge(e,t){return pt(bb.count(Ni(e)-1,e),t,2)}function wL(e){var t=e.getDay();return t>=4||t===0?fu(e):fu.ceil(e)}function Bge(e,t){return e=wL(e),pt(fu.count(Ni(e),e)+(Ni(e).getDay()===4),t,2)}
601function zge(e){return e.getDay()}function Uge(e,t){return pt(hx.count(Ni(e)-1,e),t,2)}function Wge(e,t){return pt(e.getFullYear()%100,t,2)}function Hge(e,t){return e=wL(e),pt(e.getFullYear()%100,t,2)}function Vge(e,t){return pt(e.getFullYear()%1e4,t,4)}function qge(e,t){var r=e.getDay();return e=r>=4||r===0?fu(e):fu.ceil(e),pt(e.getFullYear()%1e4,t,4)}function Gge(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+pt(t/60|0,"0",2)+pt(t%60,"0",2)}function XO(e,t){return pt(e.getUTCDate(),t,2)}function Kge(e,t){return pt(e.getUTCHours(),t,2)}function Yge(e,t){return pt(e.getUTCHours()%12||12,t,2)}function Xge(e,t){return pt(1+yb.count(Si(e),e),t,3)}function jL(e,t){return pt(e.getUTCMilliseconds(),t,3)}function Qge(e,t){return jL(e,t)+"000"}function Jge(e,t){return pt(e.getUTCMonth()+1,t,2)}function Zge(e,t){return pt(e.getUTCMinutes(),t,2)}function eve(e,t){return pt(e.getUTCSeconds(),t,2)}function tve(e){var t=e.getUTCDay();return t===0?7:t}function rve(e,t){return pt(wb.count(Si(e)-1,e),t,2)}function NL(e){var t=e.getUTCDay();return t>=4||t===0?hu(e):hu.ceil(e)}function nve(e,t){return e=NL(e),pt(hu.count(Si(e),e)+(Si(e).getUTCDay()===4),t,2)}function ave(e){return e.getUTCDay()}function sve(e,t){return pt(mx.count(Si(e)-1,e),t,2)}function ive(e,t){return pt(e.getUTCFullYear()%100,t,2)}function ove(e,t){return e=NL(e),pt(e.getUTCFullYear()%100,t,2)}function lve(e,t){return pt(e.getUTCFullYear()%1e4,t,4)}function cve(e,t){var r=e.getUTCDay();return e=r>=4||r===0?hu(e):hu.ceil(e),pt(e.getUTCFullYear()%1e4,t,4)}function dve(){return"+0000"}function QO(){return"%"}function JO(e){return+e}function ZO(e){return Math.floor(+e/1e3)}var zc,SL,_L;uve({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function uve(e){return zc=uge(e),SL=zc.format,zc.parse,_L=zc.utcFormat,zc.utcParse,zc}function fve(e){return new Date(e)}function hve(e){return e instanceof Date?+e:+new Date(+e)}function c2(e,t,r,n,s,i,o,l,c,d){var u=YC(),f=u.invert,h=u.domain,m=d(".%L"),v=d(":%S"),p=d("%I:%M"),x=d("%I %p"),b=d("%a %d"),y=d("%b %d"),w=d("%B"),_=d("%Y");function N(j){return(c(j)<j?m:l(j)<j?v:o(j)<j?p:i(j)<j?x:n(j)<j?s(j)<j?b:y:r(j)<j?w:_)(j)}return u.invert=function(j){return new Date(f(j))},u.domain=function(j){return arguments.length?h(Array.from(j,hve)):h().map(fve)},u.ticks=function(j){var S=h();return e(S[0],S[S.length-1],j??10)},u.tickFormat=function(j,S){return S==null?N:d(S)},u.nice=function(j){var S=h();return(!j||typeof j.range!="function")&&(j=t(S[0],S[S.length-1],j??10)),j?h(uL(S,j)):u},u.copy=function(){return hp(u,c2(e,t,r,n,s,i,o,l,c,d))},u}function mve(){return Pa.apply(c2(cge,dge,Ni,o2,bb,mp,s2,n2,Tl,SL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function pve(){return Pa.apply(c2(oge,lge,Si,l2,wb,yb,i2,a2,Tl,_L).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function jb(){var e=0,t=1,r,n,s,i,o=mn,l=!1,c;function d(f){return f==null||isNaN(f=+f)?c:o(s===0?.5:(f=(i(f)-r)*s,l?Math.max(0,Math.min(1,f)):f))}d.domain=function(f){return arguments.length?([e,t]=f,r=i(e=+e),n=i(t=+t),s=r===n?0:1/(n-r),d):[e,t]},d.clamp=function(f){return arguments.length?(l=!!f,d):l},d.interpolator=function(f){return arguments.length?(o=f,d):o};function u(f){return function(h){var m,v;return arguments.length?([m,v]=h,o=f(m,v),d):[o(0),o(1)]}}return d.range=u(uf),d.rangeRound=u(KC),d.unknown=function(f){return arguments.length?(c=f,d):c},function(f){return i=f,r=f(e),n=f(t),s=r===n?0:1/(n-r),d}}function el(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function CL(){var e=Zo(jb()(mn));return e.copy=function(){return el(e,CL())},Mi.apply(e,arguments)}function PL(){var e=JC(jb()).domain([1,10]);return e.copy=function(){return el(e,PL()).base(e.base())},Mi.apply(e,arguments)}function kL(){var e=ZC(jb());return e.copy=function(){return el(e,kL()).constant(e.constant())},Mi.apply(e,arguments)}function d2(){var e=e2(jb());return e.copy=function(){return el(e,d2()).exponent(e.exponent())},Mi.apply(e,arguments)}function gve(){return d2.apply(null,arguments).exponent(.5)}function AL(){var e=[],t=mn;function r(n){if(n!=null&&!isNaN(n=+n))return t((up(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let s of n)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Eo),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,s)=>t(s/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(s,i)=>rpe(e,i/n))},r.copy=function(){return AL(t).domain(e)},Mi.apply(r,arguments)}function Nb(){var e=0,t=.5,r=1,n=1,s,i,o,l,c,d=mn,u,f=!1,h;function m(p){return isNaN(p=+p)?h:(p=.5+((p=+u(p))-i)*(n*p<n*i?l:c),d(f?Math.max(0,Math.min(1,p)):p))}m.domain=function(p){return arguments.length?([e,t,r]=p,s=u(e=+e),i=u(t=+t),o=u(r=+r),l=s===i?0:.5/(i-s),c=i===o?0:.5/(o-i),n=i<s?-1:1,m):[e,t,r]},m.clamp=function(p){return arguments.length?(f=!!p,m):f},m.interpolator=function(p){return arguments.length?(d=p,m):d};function v(p){return function(x){var b,y,w;return arguments.length?([b,y,w]=x,d=kpe(p,[b,y,w]),m):[d(0),d(.5),d(1)]}}return m.range=v(uf),m.rangeRound=v(KC),m.unknown=function(p){return arguments.length?(h=p,m):h},function(p){return u=p,s=p(e),i=p(t),o=p(r),l=s===i?0:.5/(i-s),c=i===o?0:.5/(o-i),n=i<s?-1:1,m}}function EL(){var e=Zo(Nb()(mn));return e.copy=function(){return el(e,EL())},Mi.apply(e,arguments)}function OL(){var e=JC(Nb()).domain([.1,1,10]);return e.copy=function(){return el(e,OL()).base(e.base())},Mi.apply(e,arguments)}function TL(){var e=ZC(Nb());return e.copy=function(){return el(e,TL()).constant(e.constant())},Mi.apply(e,arguments)}function u2(){var e=e2(Nb());return e.copy=function(){return el(e,u2()).exponent(e.exponent())},Mi.apply(e,arguments)}function vve(){return u2.apply(null,arguments).exponent(.5)}const eT=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:lm,scaleDiverging:EL,scaleDivergingLog:OL,scaleDivergingPow:u2,scaleDivergingSqrt:vve,scaleDivergingSymlog:TL,scaleIdentity:dL,scaleImplicit:CN,scaleLinear:ux,scaleLog:fL,scaleOrdinal:VC,scalePoint:bh,scalePow:t2,scaleQuantile:pL,scaleQuantize:gL,scaleRadial:mL,scaleSequential:CL,scaleSequentialLog:PL,scaleSequentialPow:d2,scaleSequentialQuantile:AL,scaleSequentialSqrt:gve,scaleSequentialSymlog:kL,scaleSqrt:Qpe,scaleSymlog:hL,scaleThreshold:vL,scaleTime:mve,scaleUtc:pve,tickFormat:cL},Symbol.toStringTag,{value:"Module"}));var xve=tf;function yve(e,t,r){for(var n=-1,s=e.length;++n<s;){var i=e[n],o=t(i);if(o!=null&&(l===void 0?o===o&&!xve(o):r(o,l)))var l=o,c=i}return c}var Sb=yve;function bve(e,t){return e>t}var ML=bve,wve=Sb,jve=ML,Nve=df;function Sve(e){return e&&e.length?wve(e,Nve,jve):void 0}var _ve=Sve;const go=mt(_ve);function Cve(e,t){return e<t}var IL=Cve,Pve=Sb,kve=IL,Ave=df;function Eve(e){return e&&e.length?Pve(e,Ave,kve):void 0}var Ove=Eve;const _b=mt(Ove);var Tve=CC,Mve=Us,Ive=U3,$ve=Dn;function Rve(e,t){var r=$ve(e)?Tve:Ive;
vendor: 64,146 bytes, lines 601-628
601return r(e,Mve(t))}var Dve=Rve,Lve=B3,Fve=Dve;function Bve(e,t){return Lve(Fve(e,t),1)}var zve=Bve;const Uve=mt(zve);var Wve=BC;function Hve(e,t){return Wve(e,t)}var Vve=Hve;const zo=mt(Vve);var ff=1e9,qve={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},h2,Qt=!0,Sa="[DecimalError] ",Xl=Sa+"Invalid argument: ",f2=Sa+"Exponent out of range: ",hf=Math.floor,wl=Math.pow,Gve=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Vn,Cr=1e7,Ht=7,$L=9007199254740991,px=hf($L/Ht),Pe={};Pe.absoluteValue=Pe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Pe.comparedTo=Pe.cmp=function(e){var t,r,n,s,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,s=e.d.length,t=0,r=n<s?n:s;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===s?0:n>s^i.s<0?1:-1};Pe.decimalPlaces=Pe.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Ht;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Pe.dividedBy=Pe.div=function(e){return fi(this,new this.constructor(e))};Pe.dividedToIntegerBy=Pe.idiv=function(e){var t=this,r=t.constructor;return Tt(fi(t,new r(e),0,1),r.precision)};Pe.equals=Pe.eq=function(e){return!this.cmp(e)};Pe.exponent=function(){return gr(this)};Pe.greaterThan=Pe.gt=function(e){return this.cmp(e)>0};Pe.greaterThanOrEqualTo=Pe.gte=function(e){return this.cmp(e)>=0};Pe.isInteger=Pe.isint=function(){return this.e>this.d.length-2};Pe.isNegative=Pe.isneg=function(){return this.s<0};Pe.isPositive=Pe.ispos=function(){return this.s>0};Pe.isZero=function(){return this.s===0};Pe.lessThan=Pe.lt=function(e){return this.cmp(e)<0};Pe.lessThanOrEqualTo=Pe.lte=function(e){return this.cmp(e)<1};Pe.logarithm=Pe.log=function(e){var t,r=this,n=r.constructor,s=n.precision,i=s+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Vn))throw Error(Sa+"NaN");if(r.s<1)throw Error(Sa+(r.s?"NaN":"-Infinity"));return r.eq(Vn)?new n(0):(Qt=!1,t=fi(hm(r,i),hm(e,i),i),Qt=!0,Tt(t,s))};Pe.minus=Pe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?LL(t,e):RL(t,(e.s=-e.s,e))};Pe.modulo=Pe.mod=function(e){var t,r=this,n=r.constructor,s=n.precision;if(e=new n(e),!e.s)throw Error(Sa+"NaN");return r.s?(Qt=!1,t=fi(r,e,0,1).times(e),Qt=!0,r.minus(t)):Tt(new n(r),s)};Pe.naturalExponential=Pe.exp=function(){return DL(this)};Pe.naturalLogarithm=Pe.ln=function(){return hm(this)};Pe.negated=Pe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Pe.plus=Pe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?RL(t,e):LL(t,(e.s=-e.s,e))};Pe.precision=Pe.sd=function(e){var t,r,n,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Xl+e);if(t=gr(s)+1,n=s.d.length-1,r=n*Ht+1,n=s.d[n],n){for(;n%10==0;n/=10)r--;for(n=s.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Pe.squareRoot=Pe.sqrt=function(){var e,t,r,n,s,i,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Sa+"NaN")}for(e=gr(l),Qt=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=_s(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=hf((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(s.toString()),r=c.precision,s=o=r+3;;)if(i=n,n=i.plus(fi(l,i,o+2)).times(.5),_s(i.d).slice(0,o)===(t=_s(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(Tt(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(t!="9999")break;o+=4}return Qt=!0,Tt(n,r)};Pe.times=Pe.mul=function(e){var t,r,n,s,i,o,l,c,d,u=this,f=u.constructor,h=u.d,m=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,r=u.e+e.e,c=h.length,d=m.length,c<d&&(i=h,h=m,m=i,o=c,c=d,d=o),i=[],o=c+d,n=o;n--;)i.push(0);for(n=d;--n>=0;){for(t=0,s=c+n;s>n;)l=i[s]+m[n]*h[s-n-1]+t,i[s--]=l%Cr|0,t=l/Cr|0;i[s]=(i[s]+t)%Cr|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,Qt?Tt(e,f.precision):e};Pe.toDecimalPlaces=Pe.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Ds(e,0,ff),t===void 0?t=n.rounding:Ds(t,0,8),Tt(r,e+gr(r)+1,t))};Pe.toExponential=function(e,t){var r,n=this,s=n.constructor;return e===void 0?r=cc(n,!0):(Ds(e,0,ff),t===void 0?t=s.rounding:Ds(t,0,8),n=Tt(new s(n),e+1,t),r=cc(n,!0,e+1)),r};Pe.toFixed=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?cc(s):(Ds(e,0,ff),t===void 0?t=i.rounding:Ds(t,0,8),n=Tt(new i(s),e+gr(s)+1,t),r=cc(n.abs(),!1,e+gr(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};Pe.toInteger=Pe.toint=function(){var e=this,t=e.constructor;return Tt(new t(e),gr(e)+1,t.rounding)};Pe.toNumber=function(){return+this};Pe.toPower=Pe.pow=function(e){var t,r,n,s,i,o,l=this,c=l.constructor,d=12,u=+(e=new c(e));if(!e.s)return new c(Vn);if(l=new c(l),!l.s){if(e.s<1)throw Error(Sa+"Infinity");return l}if(l.eq(Vn))return l;if(n=c.precision,e.eq(Vn))return Tt(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=l.s,o){if((r=u<0?-u:u)<=$L){for(s=new c(Vn),t=Math.ceil(n/Ht+4),Qt=!1;r%2&&(s=s.times(l),rT(s.d,t)),r=hf(r/2),r!==0;)l=l.times(l),rT(l.d,t);return Qt=!0,e.s<0?new c(Vn).div(s):Tt(s,n)}}else if(i<0)throw Error(Sa+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,Qt=!1,s=e.times(hm(l,n+d)),Qt=!0,s=DL(s),s.s=i,s};Pe.toPrecision=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?(r=gr(s),n=cc(s,r<=i.toExpNeg||r>=i.toExpPos)):(Ds(e,1,ff),t===void 0?t=i.rounding:Ds(t,0,8),s=Tt(new i(s),e,t),r=gr(s),n=cc(s,e<=r||r<=i.toExpNeg,e)),n};Pe.toSignificantDigits=Pe.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Ds(e,1,ff),t===void 0?t=n.rounding:Ds(t,0,8)),Tt(new n(r),e,t)};Pe.toString=Pe.valueOf=Pe.val=Pe.toJSON=Pe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=gr(e),r=e.constructor;return cc(e,t<=r.toExpNeg||t>=r.toExpPos)};function RL(e,t){var r,n,s,i,o,l,c,d,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),Qt?Tt(t,f):t;if(c=e.d,d=t.d,o=e.e,s=t.e,c=c.slice(),i=o-s,i){for(i<0?(n=c,i=-i,l=d.length):(n=d,s=o,l=c.length),o=Math.ceil(f/Ht),l=o>l?o+1:l+1,i>l&&(i=l,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(l=c.length,i=d.length,l-i<0&&(i=l,n=d,d=c,c=n),r=0;i;)r=(c[--i]=c[i]+d[i]+r)/Cr|0,c[i]%=Cr;for(r&&(c.unshift(r),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,Qt?Tt(t,f):t}function Ds(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Xl+e)}function _s(e){var t,r,n,s=e.length-1,i="",o=e[0];if(s>0){for(i+=o,t=1;t<s;t++)n=e[t]+"",r=Ht-n.length,r&&(i+=Qi(r)),i+=n;o=e[t],n=o+"",r=Ht-n.length,r&&(i+=Qi(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var fi=function(){function e(n,s){var i,o=0,l=n.length;for(n=n.slice();l--;)i=n[l]*s+o,n[l]=i%Cr|0,o=i/Cr|0;return o&&n.unshift(o),n}function t(n,s,i,o){var l,c;if(i!=o)c=i>o?1:-1;else for(l=c=0;l<i;l++)if(n[l]!=s[l]){c=n[l]>s[l]?1:-1;break}return c}function r(n,s,i){for(var o=0;i--;)n[i]-=o,o=n[i]<s[i]?1:0,n[i]=o*Cr+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,i,o){var l,c,d,u,f,h,m,v,p,x,b,y,w,_,N,j,S,C,P=n.constructor,A=n.s==s.s?1:-1,D=n.d,F=s.d;if(!n.s)return new P(n);if(!s.s)throw Error(Sa+"Division by zero");for(c=n.e-s.e,S=F.length,N=D.length,m=new P(A),v=m.d=[],d=0;F[d]==(D[d]||0);)++d;if(F[d]>(D[d]||0)&&--c,i==null?y=i=P.precision:o?y=i+(gr(n)-gr(s))+1:y=i,y<0)return new P(0);if(y=y/Ht+2|0,d=0,S==1)for(u=0,F=F[0],y++;(d<N||u)&&y--;d++)w=u*Cr+(D[d]||0),v[d]=w/F|0,u=w%F|0;else{for(u=Cr/(F[0]+1)|0,u>1&&(F=e(F,u),D=e(D,u),S=F.length,N=D.length),_=S,p=D.slice(0,S),x=p.length;x<S;)p[x++]=0;C=F.slice(),C.unshift(0),j=F[0],F[1]>=Cr/2&&++j;do u=0,l=t(F,p,S,x),l<0?(b=p[0],S!=x&&(b=b*Cr+(p[1]||0)),u=b/j|0,u>1?(u>=Cr&&(u=Cr-1),f=e(F,u),h=f.length,x=p.length,l=t(f,p,h,x),l==1&&(u--,r(f,S<h?C:F,h))):(u==0&&(l=u=1),f=F.slice()),h=f.length,h<x&&f.unshift(0),r(p,f,x),l==-1&&(x=p.length,l=t(F,p,S,x),l<1&&(u++,r(p,S<x?C:F,x))),x=p.length):l===0&&(u++,p=[0]),v[d++]=u,l&&p[0]?p[x++]=D[_]||0:(p=[D[_]],x=1);while((_++<N||p[0]!==void 0)&&y--)}return v[0]||v.shift(),m.e=c,Tt(m,o?i+gr(m)+1:i)}}();function DL(e,t){var r,n,s,i,o,l,c=0,d=0,u=e.constructor,f=u.precision;if(gr(e)>16)throw Error(f2+gr(e));if(!e.s)return new u(Vn);for(t==null?(Qt=!1,l=f):l=t,o=new u(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(n=Math.log(wl(2,d))/Math.LN10*2+5|0,l+=n,r=s=i=new u(Vn),u.precision=l;;){if(s=Tt(s.times(e),l),r=r.times(++c),o=i.plus(fi(s,r,l)),_s(o.d).slice(0,l)===_s(i.d).slice(0,l)){for(;d--;)i=Tt(i.times(i),l);return u.precision=f,t==null?(Qt=!0,Tt(i,f)):i}i=o}}function gr(e){for(var t=e.e*Ht,r=e.d[0];r>=10;r/=10)t++;return t}function Ow(e,t,r){if(t>e.LN10.sd())throw Qt=!0,r&&(e.precision=r),Error(Sa+"LN10 precision limit exceeded");return Tt(new e(e.LN10),t)}function Qi(e){for(var t="";e--;)t+="0";return t}function hm(e,t){var r,n,s,i,o,l,c,d,u,f=1,h=10,m=e,v=m.d,p=m.constructor,x=p.precision;if(m.s<1)throw Error(Sa+(m.s?"NaN":"-Infinity"));if(m.eq(Vn))return new p(0);if(t==null?(Qt=!1,d=x):d=t,m.eq(10))return t==null&&(Qt=!0),Ow(p,d);if(d+=h,p.precision=d,r=_s(v),n=r.charAt(0),i=gr(m),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(e),r=_s(m.d),n=r.charAt(0),f++;i=gr(m),n>1?(m=new p("0."+r),i++):m=new p(n+"."+r.slice(1))}else return c=Ow(p,d+2,x).times(i+""),m=hm(new p(n+"."+r.slice(1)),d-h).plus(c),p.precision=x,t==null?(Qt=!0,Tt(m,x)):m;for(l=o=m=fi(m.minus(Vn),m.plus(Vn),d),u=Tt(m.times(m),d),s=3;;){if(o=Tt(o.times(u),d),c=l.plus(fi(o,new p(s),d)),_s(c.d).slice(0,d)===_s(l.d).slice(0,d))return l=l.times(2),i!==0&&(l=l.plus(Ow(p,d+2,x).times(i+""))),l=fi(l,new p(f),d),p.precision=x,t==null?(Qt=!0,Tt(l,x)):l;l=c,s+=2}}function tT(e,t){var r,n,s;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(n,s),t){if(s-=n,r=r-n-1,e.e=hf(r/Ht),e.d=[],n=(r+1)%Ht,r<0&&(n+=Ht),n<s){for(n&&e.d.push(+t.slice(0,n)),s-=Ht;n<s;)e.d.push(+t.slice(n,n+=Ht));t=t.slice(n),n=Ht-t.length}else n-=s;for(;n--;)t+="0";if(e.d.push(+t),Qt&&(e.e>px||e.e<-px))throw Error(f2+r)}else e.s=0,e.e=0,e.d=[0];return e}function Tt(e,t,r){var n,s,i,o,l,c,d,u,f=e.d;for(o=1,i=f[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=Ht,s=t,d=f[u=0];else{if(u=Math.ceil((n+1)/Ht),i=f.length,u>=i)return e;for(d=i=f[u],o=1;i>=10;i/=10)o++;n%=Ht,s=n-Ht+o}if(r!==void 0&&(i=wl(10,o-s-1),l=d/i%10|0,c=t<0||f[u+1]!==void 0||d%i,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?s>0?d/wl(10,o-s):0:f[u-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(i=gr(e),f.length=1,t=t-i-1,f[0]=wl(10,(Ht-t%Ht)%Ht),e.e=hf(-t/Ht)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=u,i=1,u--):(f.length=u+1,i=wl(10,Ht-n),f[u]=s>0?(d/wl(10,o-s)%wl(10,s)|0)*i:0),c)for(;;)if(u==0){(f[0]+=i)==Cr&&(f[0]=1,++e.e);break}else{if(f[u]+=i,f[u]!=Cr)break;f[u--]=0,i=1}for(n=f.length;f[--n]===0;)f.pop();if(Qt&&(e.e>px||e.e<-px))throw Error(f2+gr(e));return e}function LL(e,t){var r,n,s,i,o,l,c,d,u,f,h=e.constructor,m=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),Qt?Tt(t,m):t;if(c=e.d,f=t.d,n=t.e,d=e.e,c=c.slice(),o=d-n,o){for(u=o<0,u?(r=c,o=-o,l=f.length):(r=f,n=d,l=c.length),s=Math.max(Math.ceil(m/Ht),l)+2,o>s&&(o=s,r.length=1),r.reverse(),s=o;s--;)r.push(0);r.reverse()}else{for(s=c.length,l=f.length,u=s<l,u&&(l=s),s=0;s<l;s++)if(c[s]!=f[s]){u=c[s]<f[s];break}o=0}for(u&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,s=f.length-l;s>0;--s)c[l++]=0;for(s=f.length;s>o;){if(c[--s]<f[s]){for(i=s;i&&c[--i]===0;)c[i]=Cr-1;--c[i],c[s]+=Cr}c[s]-=f[s]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,Qt?Tt(t,m):t):new h(0)}function cc(e,t,r){var n,s=gr(e),i=_s(e.d),o=i.length;return t?(r&&(n=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+Qi(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+Qi(-s-1)+i,r&&(n=r-o)>0&&(i+=Qi(n))):s>=o?(i+=Qi(s+1-o),r&&(n=r-s-1)>0&&(i=i+"."+Qi(n))):((n=s+1)<o&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-o)>0&&(s+1===o&&(i+="."),i+=Qi(n))),e.s<0?"-"+i:i}function rT(e,t){if(e.length>t)return e.length=t,!0}function FL(e){var t,r,n;function s(i){var o=this;if(!(o instanceof s))return new s(i);if(o.constructor=s,i instanceof s){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Xl+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return tT(o,i.toString())}else if(typeof i!="string")throw Error(Xl+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,Gve.test(i))tT(o,i);else throw Error(Xl+i)}if(s.prototype=Pe,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=FL,s.config=s.set=Kve,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return s.config(e),s}function Kve(e){if(!e||typeof e!="object")throw Error(Sa+"Object expected");var t,r,n,s=["precision",1,ff,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((n=e[r=s[t]])!==void 0)if(hf(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(Xl+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Xl+r+": "+n);return this}var h2=FL(qve);Vn=new h2(1);const Et=h2;function Yve(e){return Zve(e)||Jve(e)||Qve(e)||Xve()}function Xve(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 602In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qve(e,t){if(e){if(typeof e=="string")return EN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return EN(e,t)}}function Jve(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Zve(e){if(Array.isArray(e))return EN(e)}function EN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var exe=function(t){return t},BL={"@@functional/placeholder":!0},zL=function(t){return t===BL},nT=function(t){return function r(){return arguments.length===0||arguments.length===1&&zL(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},txe=function e(t,r){return t===1?r:nT(function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];var o=s.filter(function(l){return l!==BL}).length;return o>=t?r.apply(void 0,s):e(t-o,nT(function(){for(var l=arguments.length,c=new Array(l),d=0;d<l;d++)c[d]=arguments[d];var u=s.map(function(f){return zL(f)?c.shift():f});return r.apply(void 0,Yve(u).concat(c))}))})},Cb=function(t){return txe(t.length,t)},ON=function(t,r){for(var n=[],s=t;s<r;++s)n[s-t]=s;return n},rxe=Cb(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),nxe=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return exe;var s=r.reverse(),i=s[0],o=s.slice(1);return function(){return o.reduce(function(l,c){return c(l)},i.apply(void 0,arguments))}},TN=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},UL=function(t){var r=null,n=null;return function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];return r&&i.every(function(l,c){return l===r[c]})||(r=i,n=t.apply(void 0,i)),n}};function axe(e){var t;return e===0?t=1:t=Math.floor(new Et(e).abs().log(10).toNumber())+1,t}function sxe(e,t,r){for(var n=new Et(e),s=0,i=[];n.lt(t)&&s<1e5;)i.push(n.toNumber()),n=n.add(r),s++;return i}var ixe=Cb(function(e,t,r){var n=+e,s=+t;return n+r*(s-n)}),oxe=Cb(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),lxe=Cb(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const Pb={rangeStep:sxe,getDigitCount:axe,interpolateNumber:ixe,uninterpolateNumber:oxe,uninterpolateTruncation:lxe};function MN(e){return uxe(e)||dxe(e)||WL(e)||cxe()}function cxe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 603In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dxe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function uxe(e){if(Array.isArray(e))return IN(e)}function mm(e,t){return mxe(e)||hxe(e,t)||WL(e,t)||fxe()}function fxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 604In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WL(e,t){if(e){if(typeof e=="string")return IN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return IN(e,t)}}function IN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hxe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,s=!1,i=void 0;try{for(var o=e[Symbol.iterator](),l;!(n=(l=o.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){s=!0,i=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(s)throw i}}return r}}function mxe(e){if(Array.isArray(e))return e}function HL(e){var t=mm(e,2),r=t[0],n=t[1],s=r,i=n;return r>n&&(s=n,i=r),[s,i]}function VL(e,t,r){if(e.lte(0))return new Et(0);var n=Pb.getDigitCount(e.toNumber()),s=new Et(10).pow(n),i=e.div(s),o=n!==1?.05:.1,l=new Et(Math.ceil(i.div(o).toNumber())).add(r).mul(o),c=l.mul(s);return t?c:new Et(Math.ceil(c))}function pxe(e,t,r){var n=1,s=new Et(e);if(!s.isint()&&r){var i=Math.abs(e);i<1?(n=new Et(10).pow(Pb.getDigitCount(e)-1),s=new Et(Math.floor(s.div(n).toNumber())).mul(n)):i>1&&(s=new Et(Math.floor(e)))}else e===0?s=new Et(Math.floor((t-1)/2)):r||(s=new Et(Math.floor(e)));var o=Math.floor((t-1)/2),l=nxe(rxe(function(c){return s.add(new Et(c-o).mul(n)).toNumber()}),ON);return l(0,t)}function qL(e,t,r,n){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Et(0),tickMin:new Et(0),tickMax:new Et(0)};var i=VL(new Et(t).sub(e).div(r-1),n,s),o;e<=0&&t>=0?o=new Et(0):(o=new Et(e).add(t).div(2),o=o.sub(new Et(o).mod(i)));var l=Math.ceil(o.sub(e).div(i).toNumber()),c=Math.ceil(new Et(t).sub(o).div(i).toNumber()),d=l+c+1;return d>r?qL(e,t,r,n,s+1):(d<r&&(c=t>0?c+(r-d):c,l=t>0?l:l+(r-d)),{step:i,tickMin:o.sub(new Et(l).mul(i)),tickMax:o.add(new Et(c).mul(i))})}function gxe(e){var t=mm(e,2),r=t[0],n=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),l=HL([r,n]),c=mm(l,2),d=c[0],u=c[1];if(d===-1/0||u===1/0){var f=u===1/0?[d].concat(MN(ON(0,s-1).map(function(){return 1/0}))):[].concat(MN(ON(0,s-1).map(function(){return-1/0})),[u]);return r>n?TN(f):f}if(d===u)return pxe(d,s,i);var h=qL(d,u,o,i),m=h.step,v=h.tickMin,p=h.tickMax,x=Pb.rangeStep(v,p.add(new Et(.1).mul(m)),m);return r>n?TN(x):x}function vxe(e,t){var r=mm(e,2),n=r[0],s=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=HL([n,s]),l=mm(o,2),c=l[0],d=l[1];if(c===-1/0||d===1/0)return[n,s];if(c===d)return[c];var u=Math.max(t,2),f=VL(new Et(d).sub(c).div(u-1),i,0),h=[].concat(MN(Pb.rangeStep(new Et(c),new Et(d).sub(new Et(.99).mul(f)),f)),[d]);return n>s?TN(h):h}var xxe=UL(gxe),yxe=UL(vxe),bxe="Invariant failed";function dc(e,t){throw new Error(bxe)}var wxe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function mu(e){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mu(e)}function gx(){return gx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gx.apply(this,arguments)}function jxe(e,t){return Cxe(e)||_xe(e,t)||Sxe(e,t)||Nxe()}function Nxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 605In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sxe(e,t){if(e){if(typeof e=="string")return aT(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return aT(e,t)}}function aT(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _xe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,d=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function Cxe(e){if(Array.isArray(e))return e}function Pxe(e,t){if(e==null)return{};var r=kxe(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kxe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Axe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Exe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,YL(n.key),n)}}function Oxe(e,t,r){return t&&Exe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Txe(e,t,r){return t=vx(t),Mxe(e,GL()?Reflect.construct(t,r||[],vx(e).constructor):t.apply(e,r))}function Mxe(e,t){if(t&&(mu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ixe(e)}function Ixe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GL=function(){return!!e})()}function vx(e){return vx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vx(e)}function $xe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$N(e,t)}function $N(e,t){return $N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},$N(e,t)}function KL(e,t,r){return t=YL(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YL(e){var t=Rxe(e,"string");return mu(t)=="symbol"?t:t+""}function Rxe(e,t){if(mu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(mu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mf=function(e){function t(){return Axe(this,t),Txe(this,t,arguments)}return $xe(t,e),Oxe(t,[{key:"render",value:function(){var n=this.props,s=n.offset,i=n.layout,o=n.width,l=n.dataKey,c=n.data,d=n.dataPointFormatter,u=n.xAxis,f=n.yAxis,h=Pxe(n,wxe),m=Ae(h,!1);this.props.direction==="x"&&u.type!=="number"&&dc();var v=c.map(function(p){var x=d(p,l),b=x.x,y=x.y,w=x.value,_=x.errorVal;if(!_)return null;var N=[],j,S;if(Array.isArray(_)){var C=jxe(_,2);j=C[0],S=C[1]}else j=S=_;if(i==="vertical"){var P=u.scale,A=y+s,D=A+o,F=A-o,q=P(w-j),B=P(w+S);N.push({x1:B,y1:D,x2:B,y2:F}),N.push({x1:q,y1:A,x2:B,y2:A}),N.push({x1:q,y1:D,x2:q,y2:F})}else if(i==="horizontal"){var V=f.scale,E=b+s,M=E-o,T=E+o,L=V(w-j),K=V(w+S);N.push({x1:M,y1:K,x2:T,y2:K}),N.push({x1:E,y1:L,x2:E,y2:K}),N.push({x1:M,y1:L,x2:T,y2:L})}return I.createElement(Xe,gx({className:"recharts-errorBar",key:"bar-".concat(N.map(function(H){return"".concat(H.x1,"-").concat(H.x2,"-").concat(H.y1,"-").concat(H.y2)}))},m),N.map(function(H){return I.createElement("line",gx({},H,{key:"line-".concat(H.x1,"-").concat(H.x2,"-").concat(H.y1,"-").concat(H.y2)}))}))});return I.createElement(Xe,{className:"recharts-errorBars"},v)}}])}(I.Component);KL(mf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});KL(mf,"displayName","ErrorBar");function pm(e){"@babel/helpers - typeof";return pm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pm(e)}function sT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function hl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sT(Object(r),!0).forEach(function(n){Dxe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Dxe(e,t,r){return t=Lxe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lxe(e){var t=Fxe(e,"string");return pm(t)=="symbol"?t:t+""}function Fxe(e,t){if(pm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(pm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var XL=function(t){var r=t.children,n=t.formattedGraphicalItems,s=t.legendWidth,i=t.legendContent,o=zn(r,Ao);if(!o)return null;var l=Ao.defaultProps,c=l!==void 0?hl(hl({},l),o.props):{},d;return o.props&&o.props.payload?d=o.props&&o.props.payload:i==="children"?d=(n||[]).reduce(function(u,f){var h=f.item,m=f.props,v=m.sectors||m.data||[];return u.concat(v.map(function(p){return{type:o.props.iconType||h.props.legendType,value:p.name,color:p.fill,payload:p}}))},[]):d=(n||[]).map(function(u){var f=u.item,h=f.type.defaultProps,m=h!==void 0?hl(hl({},h),f.props):{},v=m.dataKey,p=m.name,x=m.legendType,b=m.hide;return{inactive:b,dataKey:v,type:c.iconType||x||"square",color:m2(f),value:p||v,payload:m}}),hl(hl(hl({},c),Ao.getWithHeight(o,s)),{},{payload:d,item:o})};function gm(e){"@babel/helpers - typeof";return gm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gm(e)}function iT(e){return Wxe(e)||Uxe(e)||zxe(e)||Bxe()}function Bxe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 606In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zxe(e,t){if(e){if(typeof e=="string")return RN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return RN(e,t)}}function Uxe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Wxe(e){if(Array.isArray(e))return RN(e)}function RN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function oT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function cr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oT(Object(r),!0).forEach(function(n){Ed(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ed(e,t,r){return t=Hxe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hxe(e){var t=Vxe(e,"string");return gm(t)=="symbol"?t:t+""}function Vxe(e,t){if(gm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(gm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vt(e,t,r){return Le(e)||Le(t)?r:Sr(t)?Yn(e,t,r):Fe(t)?t(e):r}function wh(e,t,r,n){var s=Uve(e,function(l){return Vt(l,t)});if(r==="number"){var i=s.filter(function(l){return xe(l)||parseFloat(l)});return i.length?[_b(i),go(i)]:[1/0,-1/0]}var o=n?s.filter(function(l){return!Le(l)}):s;return o.map(function(l){return Sr(l)||l instanceof Date?l:""})}var qxe=function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,d=0;d<l;d++){var u=d>0?s[d-1].coordinate:s[l-1].coordinate,f=s[d].coordinate,h=d>=l-1?s[0].coordinate:s[d+1].coordinate,m=void 0;if(fn(f-u)!==fn(h-f)){var v=[];if(fn(h-f)===fn(c[1]-c[0])){m=h;var p=f+c[1]-c[0];v[0]=Math.min(p,(p+u)/2),v[1]=Math.max(p,(p+u)/2)}else{m=u;var x=h+c[1]-c[0];v[0]=Math.min(f,(x+f)/2),v[1]=Math.max(f,(x+f)/2)}var b=[Math.min(f,(m+f)/2),Math.max(f,(m+f)/2)];if(t>b[0]&&t<=b[1]||t>=v[0]&&t<=v[1]){o=s[d].index;break}}else{var y=Math.min(u,h),w=Math.max(u,h);if(t>(y+f)/2&&t<=(w+f)/2){o=s[d].index;break}}}else for(var _=0;_<l;_++)if(_===0&&t<=(n[_].coordinate+n[_+1].coordinate)/2||_>0&&_<l-1&&t>(n[_].coordinate+n[_-1].coordinate)/2&&t<=(n[_].coordinate+n[_+1].coordinate)/2||_===l-1&&t>(n[_].coordinate+n[_-1].coordinate)/2){o=n[_].index;break}return o},m2=function(t){var r,n=t,s=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?cr(cr({},t.type.defaultProps),t.props):t.props,o=i.stroke,l=i.fill,c;switch(s){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},Gxe=function(t){var r=t.barSize,n=t.totalSize,s=t.stackGroups,i=s===void 0?{}:s;if(!i)return{};for(var o={},l=Object.keys(i),c=0,d=l.length;c<d;c++)for(var u=i[l[c]].stackGroups,f=Object.keys(u),h=0,m=f.length;h<m;h++){var v=u[f[h]],p=v.items,x=v.cateAxisId,b=p.filter(function(S){return ui(S.type).indexOf("Bar")>=0});if(b&&b.length){var y=b[0].type.defaultProps,w=y!==void 0?cr(cr({},y),b[0].props):b[0].props,_=w.barSize,N=w[x];o[N]||(o[N]=[]);var j=Le(_)?r:_;o[N].push({item:b[0],stackList:b.slice(1),barSize:Le(j)?void 0:hn(j,n,0)})}}return o},Kxe=function(t){var r=t.barGap,n=t.barCategoryGap,s=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,l=t.maxBarSize,c=o.length;if(c<1)return null;var d=hn(r,s,0,!0),u,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,m=s/c,v=o.reduce(function(_,N){return _+N.barSize||0},0);v+=(c-1)*d,v>=s&&(v-=(c-1)*d,d=0),v>=s&&m>0&&(h=!0,m*=.9,v=c*m);var p=(s-v)/2>>0,x={offset:p-d,size:0};u=o.reduce(function(_,N){var j={item:N.item,position:{offset:x.offset+x.size+d,size:h?m:N.barSize}},S=[].concat(iT(_),[j]);return x=S[S.length-1].position,N.stackList&&N.stackList.length&&N.stackList.forEach(function(C){S.push({item:C,position:x})}),S},f)}else{var b=hn(n,s,0,!0);s-2*b-(c-1)*d<=0&&(d=0);var y=(s-2*b-(c-1)*d)/c;y>1&&(y>>=0);var w=l===+l?Math.min(y,l):y;u=o.reduce(function(_,N,j){var S=[].concat(iT(_),[{item:N.item,position:{offset:b+(y+d)*j+(y-w)/2,size:w}}]);return N.stackList&&N.stackList.length&&N.stackList.forEach(function(C){S.push({item:C,position:S[S.length-1].position})}),S},f)}return u},Yxe=function(t,r,n,s){var i=n.children,o=n.width,l=n.margin,c=o-(l.left||0)-(l.right||0),d=XL({children:i,legendWidth:c});if(d){var u=s||{},f=u.width,h=u.height,m=d.align,v=d.verticalAlign,p=d.layout;if((p==="vertical"||p==="horizontal"&&v==="middle")&&m!=="center"&&xe(t[m]))return cr(cr({},t),{},Ed({},m,t[m]+(f||0)));if((p==="horizontal"||p==="vertical"&&m==="center")&&v!=="middle"&&xe(t[v]))return cr(cr({},t),{},Ed({},v,t[v]+(h||0)))}return t},Xxe=function(t,r,n){return Le(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},QL=function(t,r,n,s,i){var o=r.props.children,l=vn(o,mf).filter(function(d){return Xxe(s,i,d.props.direction)});if(l&&l.length){var c=l.map(function(d){return d.props.dataKey});return t.reduce(function(d,u){var f=Vt(u,n);if(Le(f))return d;var h=Array.isArray(f)?[_b(f),go(f)]:[f,f],m=c.reduce(function(v,p){var x=Vt(u,p,0),b=h[0]-Math.abs(Array.isArray(x)?x[0]:x),y=h[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(b,v[0]),Math.max(y,v[1])]},[1/0,-1/0]);return[Math.min(m[0],d[0]),Math.max(m[1],d[1])]},[1/0,-1/0])}return null},Qxe=function(t,r,n,s,i){var o=r.map(function(l){return QL(t,l,n,i,s)}).filter(function(l){return!Le(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},JL=function(t,r,n,s,i){var o=r.map(function(c){var d=c.props.dataKey;return n==="number"&&d&&QL(t,c,d,s)||wh(t,d,n,i)});if(n==="number")return o.reduce(function(c,d){return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,d){for(var u=0,f=d.length;u<f;u++)l[d[u]]||(l[d[u]]=!0,c.push(d[u]));return c},[])},ZL=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},eF=function(t,r,n,s){if(s)return t.map(function(c){return c.coordinate});var i,o,l=t.map(function(c){return c.coordinate===r&&(i=!0),c.coordinate===n&&(o=!0),c.coordinate});return i||l.push(r),o||l.push(n),l},oi=function(t,r,n){if(!t)return null;var s=t.scale,i=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?s.bandwidth()/2:2,d=(r||n)&&o==="category"&&s.bandwidth?s.bandwidth()/c:0;if(d=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?fn(l[0]-l[1])*2*d:d,r&&(t.ticks||t.niceTicks)){var u=(t.ticks||t.niceTicks).map(function(f){var h=i?i.indexOf(f):f;return{coordinate:s(h)+d,value:f,offset:d}});return u.filter(function(f){return!of(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:s(f)+d,value:f,index:h,offset:d}}):s.ticks&&!n?s.ticks(t.tickCount).map(function(f){return{coordinate:s(f)+d,value:f,offset:d}}):s.domain().map(function(f,h){return{coordinate:s(f)+d,value:i?i[f]:f,index:h,offset:d}})},Tw=new WeakMap,vg=function(t,r){if(typeof r!="function")return t;Tw.has(t)||Tw.set(t,new WeakMap);var n=Tw.get(t);if(n.has(r))return n.get(r);var s=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,s),s},tF=function(t,r,n){var s=t.scale,i=t.type,o=t.layout,l=t.axisType;if(s==="auto")return o==="radial"&&l==="radiusAxis"?{scale:lm(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:ux(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:bh(),realScaleType:"point"}:i==="category"?{scale:lm(),realScaleType:"band"}:{scale:ux(),realScaleType:"linear"};if(oc(s)){var c="scale".concat(db(s));return{scale:(eT[c]||bh)(),realScaleType:eT[c]?c:"point"}}return Fe(s)?{scale:s}:{scale:bh(),realScaleType:"point"}},lT=1e-4,rF=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,s=t.range(),i=Math.min(s[0],s[1])-lT,o=Math.max(s[0],s[1])+lT,l=t(r[0]),c=t(r[n-1]);(l<i||l>o||c<i||c>o)&&t.domain([r[0],r[n-1]])}},Jxe=function(t,r){if(!t)return null;for(var n=0,s=t.length;n<s;n++)if(t[n].item===r)return t[n].position;return null},Zxe=function(t,r){if(!r||r.length!==2||!xe(r[0])||!xe(r[1]))return t;var n=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]),i=[t[0],t[1]];return(!xe(t[0])||t[0]<n)&&(i[0]=n),(!xe(t[1])||t[1]>s)&&(i[1]=s),i[0]>s&&(i[0]=s),i[1]<n&&(i[1]=n),i},eye=function(t){var r=t.length;if(!(r<=0))for(var n=0,s=t[0].length;n<s;++n)for(var i=0,o=0,l=0;l<r;++l){var c=of(t[l][n][1])?t[l][n][0]:t[l][n][1];c>=0?(t[l][n][0]=i,t[l][n][1]=i+c,i=t[l][n][1]):(t[l][n][0]=o,t[l][n][1]=o+c,o=t[l][n][1])}},tye=function(t){var r=t.length;if(!(r<=0))for(var n=0,s=t[0].length;n<s;++n)for(var i=0,o=0;o<r;++o){var l=of(t[o][n][1])?t[o][n][0]:t[o][n][1];l>=0?(t[o][n][0]=i,t[o][n][1]=i+l,i=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},rye={sign:eye,expand:wse,none:iu,silhouette:jse,wiggle:Nse,positive:tye},nye=function(t,r,n){var s=r.map(function(l){return l.props.dataKey}),i=rye[n],o=bse().keys(s).value(function(l,c){return+Vt(l,c,0)}).order(oN).offset(i);return o(t)},aye=function(t,r,n,s,i,o){if(!t)return null;var l=o?r.reverse():r,c={},d=l.reduce(function(f,h){var m,v=(m=h.type)!==null&&m!==void 0&&m.defaultProps?cr(cr({},h.type.defaultProps),h.props):h.props,p=v.stackId,x=v.hide;if(x)return f;var b=v[n],y=f[b]||{hasStack:!1,stackGroups:{}};if(Sr(p)){var w=y.stackGroups[p]||{numericAxisId:n,cateAxisId:s,items:[]};w.items.push(h),y.hasStack=!0,y.stackGroups[p]=w}else y.stackGroups[Qo("_stackId_")]={numericAxisId:n,cateAxisId:s,items:[h]};return cr(cr({},f),{},Ed({},b,y))},c),u={};return Object.keys(d).reduce(function(f,h){var m=d[h];if(m.hasStack){var v={};m.stackGroups=Object.keys(m.stackGroups).reduce(function(p,x){var b=m.stackGroups[x];return cr(cr({},p),{},Ed({},x,{numericAxisId:n,cateAxisId:s,items:b.items,stackedData:nye(t,b.items,i)}))},v)}return cr(cr({},f),{},Ed({},h,m))},u)},nF=function(t,r){var n=r.realScaleType,s=r.type,i=r.tickCount,o=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(i&&s==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var d=t.domain();if(!d.length)return null;var u=xxe(d,i,l);return t.domain([_b(u),go(u)]),{niceTicks:u}}if(i&&s==="number"){var f=t.domain(),h=yxe(f,i,l);return{niceTicks:h}}return null};function pu(e){var t=e.axis,r=e.ticks,n=e.bandSize,s=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Le(s[t.dataKey])){var l=Hv(r,"value",s[t.dataKey]);if(l)return l.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var c=Vt(s,Le(o)?t.dataKey:o);return Le(c)?null:t.scale(c)}var cT=function(t){var r=t.axis,n=t.ticks,s=t.offset,i=t.bandSize,o=t.entry,l=t.index;if(r.type==="category")return n[l]?n[l].coordinate+s:null;var c=Vt(o,r.dataKey,r.domain[l]);return Le(c)?null:r.scale(c)-i/2+s},sye=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var s=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return s<=0&&i>=0?0:i<0?i:s}return n[0]},iye=function(t,r){var n,s=(n=t.type)!==null&&n!==void 0&&n.defaultProps?cr(cr({},t.type.defaultProps),t.props):t.props,i=s.stackId;if(Sr(i)){var o=r[i];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},oye=function(t){return t.reduce(function(r,n){return[_b(n.concat([r[0]]).filter(xe)),go(n.concat([r[1]]).filter(xe))]},[1/0,-1/0])},aF=function(t,r,n){return Object.keys(t).reduce(function(s,i){var o=t[i],l=o.stackedData,c=l.reduce(function(d,u){var f=oye(u.slice(r,n+1));return[Math.min(d[0],f[0]),Math.max(d[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],s[0]),Math.max(c[1],s[1])]},[1/0,-1/0]).map(function(s){return s===1/0||s===-1/0?0:s})},dT=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,uT=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,DN=function(t,r,n){if(Fe(t))return t(r,n);if(!Array.isArray(t))return r;var s=[];if(xe(t[0]))s[0]=n?t[0]:Math.min(t[0],r[0]);else if(dT.test(t[0])){var i=+dT.exec(t[0])[1];s[0]=r[0]-i}else Fe(t[0])?s[0]=t[0](r[0]):s[0]=r[0];if(xe(t[1]))s[1]=n?t[1]:Math.max(t[1],r[1]);else if(uT.test(t[1])){var o=+uT.exec(t[1])[1];s[1]=r[1]+o}else Fe(t[1])?s[1]=t[1](r[1]):s[1]=r[1];return s},xx=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var s=t.scale.bandwidth();if(!n||s>0)return s}if(t&&r&&r.length>=2){for(var i=UC(r,function(f){return f.coordinate}),o=1/0,l=1,c=i.length;l<c;l++){var d=i[l],u=i[l-1];o=Math.min((d.coordinate||0)-(u.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},fT=function(t,r,n){return!t||!t.length||zo(t,Yn(n,"type.defaultProps.domain"))?r:t},sF=function(t,r){var n=t.type.defaultProps?cr(cr({},t.type.defaultProps),t.props):t.props,s=n.dataKey,i=n.name,o=n.unit,l=n.formatter,c=n.tooltipType,d=n.chartType,u=n.hide;return cr(cr({},Ae(t,!1)),{},{dataKey:s,unit:o,formatter:l,name:i||s,color:m2(t),value:Vt(r,s),type:c,payload:r,chartType:d,hide:u})};function vm(e){"@babel/helpers - typeof";return vm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vm(e)}function hT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Qs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hT(Object(r),!0).forEach(function(n){iF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iF(e,t,r){return t=lye(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lye(e){var t=cye(e,"string");return vm(t)=="symbol"?t:t+""}function cye(e,t){if(vm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(vm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dye(e,t){return mye(e)||hye(e,t)||fye(e,t)||uye()}function uye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 607In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fye(e,t){if(e){if(typeof e=="string")return mT(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mT(e,t)}}function mT(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,d=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function mye(e){if(Array.isArray(e))return e}var yx=Math.PI/180,pye=function(t){return t*180/Math.PI},Lt=function(t,r,n,s){return{x:t+Math.cos(-yx*s)*n,y:r+Math.sin(-yx*s)*n}},oF=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},gye=function(t,r,n,s,i){var o=t.width,l=t.height,c=t.startAngle,d=t.endAngle,u=hn(t.cx,o,o/2),f=hn(t.cy,l,l/2),h=oF(o,l,n),m=hn(t.innerRadius,h,0),v=hn(t.outerRadius,h,h*.8),p=Object.keys(r);return p.reduce(function(x,b){var y=r[b],w=y.domain,_=y.reversed,N;if(Le(y.range))s==="angleAxis"?N=[c,d]:s==="radiusAxis"&&(N=[m,v]),_&&(N=[N[1],N[0]]);else{N=y.range;var j=N,S=dye(j,2);c=S[0],d=S[1]}var C=tF(y,i),P=C.realScaleType,A=C.scale;A.domain(w).range(N),rF(A);var D=nF(A,Qs(Qs({},y),{},{realScaleType:P})),F=Qs(Qs(Qs({},y),D),{},{range:N,radius:v,realScaleType:P,scale:A,cx:u,cy:f,innerRadius:m,outerRadius:v,startAngle:c,endAngle:d});return Qs(Qs({},x),{},iF({},b,F))},{})},vye=function(t,r){var n=t.x,s=t.y,i=r.x,o=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(s-o,2))},xye=function(t,r){var n=t.x,s=t.y,i=r.cx,o=r.cy,l=vye({x:n,y:s},{x:i,y:o});if(l<=0)return{radius:l};var c=(n-i)/l,d=Math.acos(c);return s>o&&(d=2*Math.PI-d),{radius:l,angle:pye(d),angleInRadian:d}},yye=function(t){var r=t.startAngle,n=t.endAngle,s=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(s,i);return{startAngle:r-o*360,endAngle:n-o*360}},bye=function(t,r){var n=r.startAngle,s=r.endAngle,i=Math.floor(n/360),o=Math.floor(s/360),l=Math.min(i,o);return t+l*360},pT=function(t,r){var n=t.x,s=t.y,i=xye({x:n,y:s},r),o=i.radius,l=i.angle,c=r.innerRadius,d=r.outerRadius;if(o<c||o>d)return!1;if(o===0)return!0;var u=yye(r),f=u.startAngle,h=u.endAngle,m=l,v;if(f<=h){for(;m>h;)m-=360;for(;m<f;)m+=360;v=m>=f&&m<=h}else{for(;m>f;)m-=360;for(;m<h;)m+=360;v=m>=h&&m<=f}return v?Qs(Qs({},r),{},{radius:o,angle:bye(m,r)}):null},lF=function(t){return!g.isValidElement(t)&&!Fe(t)&&typeof t!="boolean"?t.className:""};function xm(e){"@babel/helpers - typeof";return xm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xm(e)}var wye=["offset"];function jye(e){return Cye(e)||_ye(e)||Sye(e)||Nye()}function Nye(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 608In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sye(e,t){if(e){if(typeof e=="string")return LN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return LN(e,t)}}function _ye(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Cye(e){if(Array.isArray(e))return LN(e)}function LN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pye(e,t){if(e==null)return{};var r=kye(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kye(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function gT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function yr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gT(Object(r),!0).forEach(function(n){Aye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Aye(e,t,r){return t=Eye(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Eye(e){var t=Oye(e,"string");return xm(t)=="symbol"?t:t+""}function Oye(e,t){if(xm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(xm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ym(){return ym=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ym.apply(this,arguments)}var Tye=function(t){var r=t.value,n=t.formatter,s=Le(t.children)?r:t.children;return Fe(n)?n(s):s},Mye=function(t,r){var n=fn(r-t),s=Math.min(Math.abs(r-t),360);return n*s},Iye=function(t,r,n){var s=t.position,i=t.viewBox,o=t.offset,l=t.className,c=i,d=c.cx,u=c.cy,f=c.innerRadius,h=c.outerRadius,m=c.startAngle,v=c.endAngle,p=c.clockWise,x=(f+h)/2,b=Mye(m,v),y=b>=0?1:-1,w,_;s==="insideStart"?(w=m+y*o,_=p):s==="insideEnd"?(w=v-y*o,_=!p):s==="end"&&(w=v+y*o,_=p),_=b<=0?_:!_;var N=Lt(d,u,x,w),j=Lt(d,u,x,w+(_?1:-1)*359),S="M".concat(N.x,",").concat(N.y,` 609 A`).concat(x,",").concat(x,",0,1,").concat(_?0:1,`, 610 `).concat(j.x,",").concat(j.y),C=Le(t.id)?Qo("recharts-radial-line-"):t.id;return I.createElement("text",ym({},n,{dominantBaseline:"central",className:qe("recharts-radial-bar-label",l)}),I.createElement("defs",null,I.createElement("path",{id:C,d:S})),I.createElement("textPath",{xlinkHref:"#".concat(C)},r))},$ye=function(t){var r=t.viewBox,n=t.offset,s=t.position,i=r,o=i.cx,l=i.cy,c=i.innerRadius,d=i.outerRadius,u=i.startAngle,f=i.endAngle,h=(u+f)/2;if(s==="outside"){var m=Lt(o,l,d+n,h),v=m.x,p=m.y;return{x:v,y:p,textAnchor:v>=o?"start":"end",verticalAnchor:"middle"}}if(s==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(s==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(s==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var x=(c+d)/2,b=Lt(o,l,x,h),y=b.x,w=b.y;return{x:y,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Rye=function(t){var r=t.viewBox,n=t.parentViewBox,s=t.offset,i=t.position,o=r,l=o.x,c=o.y,d=o.width,u=o.height,f=u>=0?1:-1,h=f*s,m=f>0?"end":"start",v=f>0?"start":"end",p=d>=0?1:-1,x=p*s,b=p>0?"end":"start",y=p>0?"start":"end";if(i==="top"){var w={x:l+d/2,y:c-f*s,textAnchor:"middle",verticalAnchor:m};return yr(yr({},w),n?{height:Math.max(c-n.y,0),width:d}:{})}if(i==="bottom"){var _={x:l+d/2,y:c+u+h,textAnchor:"middle",verticalAnchor:v};return yr(yr({},_),n?{height:Math.max(n.y+n.height-(c+u),0),width:d}:{})}if(i==="left"){var N={x:l-x,y:c+u/2,textAnchor:b,verticalAnchor:"middle"};return yr(yr({},N),n?{width:Math.max(N.x-n.x,0),height:u}:{})}if(i==="right"){var j={x:l+d+x,y:c+u/2,textAnchor:y,verticalAnchor:"middle"};return yr(yr({},j),n?{width:Math.max(n.x+n.width-j.x,0),height:u}:{})}var S=n?{width:d,height:u}:{};return i==="insideLeft"?yr({x:l+x,y:c+u/2,textAnchor:y,verticalAnchor:"middle"},S):i==="insideRight"?yr({x:l+d-x,y:c+u/2,textAnchor:b,verticalAnchor:"middle"},S):i==="insideTop"?yr({x:l+d/2,y:c+h,textAnchor:"middle",verticalAnchor:v},S):i==="insideBottom"?yr({x:l+d/2,y:c+u-h,textAnchor:"middle",verticalAnchor:m},S):i==="insideTopLeft"?yr({x:l+x,y:c+h,textAnchor:y,verticalAnchor:v},S):i==="insideTopRight"?yr({x:l+d-x,y:c+h,textAnchor:b,verticalAnchor:v},S):i==="insideBottomLeft"?yr({x:l+x,y:c+u-h,textAnchor:y,verticalAnchor:m},S):i==="insideBottomRight"?yr({x:l+d-x,y:c+u-h,textAnchor:b,verticalAnchor:m},S):rf(i)&&(xe(i.x)||El(i.x))&&(xe(i.y)||El(i.y))?yr({x:l+hn(i.x,d),y:c+hn(i.y,u),textAnchor:"end",verticalAnchor:"end"},S):yr({x:l+d/2,y:c+u/2,textAnchor:"middle",verticalAnchor:"middle"},S)},Dye=function(t){return"cx"in t&&xe(t.cx)};function Er(e){var t=e.offset,r=t===void 0?5:t,n=Pye(e,wye),s=yr({offset:r},n),i=s.viewBox,o=s.position,l=s.value,c=s.children,d=s.content,u=s.className,f=u===void 0?"":u,h=s.textBreakAll;if(!i||Le(l)&&Le(c)&&!g.isValidElement(d)&&!Fe(d))return null;if(g.isValidElement(d))return g.cloneElement(d,s);var m;if(Fe(d)){if(m=g.createElement(d,s),g.isValidElement(m))return m}else m=Tye(s);var v=Dye(i),p=Ae(s,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Iye(s,m,p);var x=v?$ye(s):Rye(s);return I.createElement(lc,ym({className:qe("recharts-label",f)},p,x,{breakAll:h}),m)}Er.displayName="Label";var cF=function(t){var r=t.cx,n=t.cy,s=t.angle,i=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,d=t.innerRadius,u=t.outerRadius,f=t.x,h=t.y,m=t.top,v=t.left,p=t.width,x=t.height,b=t.clockWise,y=t.labelViewBox;if(y)return y;if(xe(p)&&xe(x)){if(xe(f)&&xe(h))return{x:f,y:h,width:p,height:x};if(xe(m)&&xe(v))return{x:m,y:v,width:p,height:x}}return xe(f)&&xe(h)?{x:f,y:h,width:0,height:0}:xe(r)&&xe(n)?{cx:r,cy:n,startAngle:i||s||0,endAngle:o||s||0,innerRadius:d||0,outerRadius:u||c||l||0,clockWise:b}:t.viewBox?t.viewBox:{}},Lye=function(t,r){return t?t===!0?I.createElement(Er,{key:"label-implicit",viewBox:r}):Sr(t)?I.createElement(Er,{key:"label-implicit",viewBox:r,value:t}):g.isValidElement(t)?t.type===Er?g.cloneElement(t,{key:"label-implicit",viewBox:r}):I.createElement(Er,{key:"label-implicit",content:t,viewBox:r}):Fe(t)?I.createElement(Er,{key:"label-implicit",content:t,viewBox:r}):rf(t)?I.createElement(Er,ym({viewBox:r},t,{key:"label-implicit"})):null:null},Fye=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var s=t.children,i=cF(t),o=vn(s,Er).map(function(c,d){return g.cloneElement(c,{viewBox:r||i,key:"label-".concat(d)})});if(!n)return o;var l=Lye(t.label,r||i);return[l].concat(jye(o))};Er.parseViewBox=cF;Er.renderCallByParent=Fye;function Bye(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var zye=Bye;const Uye=mt(zye);function bm(e){"@babel/helpers - typeof";return bm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bm(e)}var Wye=["valueAccessor"],Hye=["data","dataKey","clockWise","id","textBreakAll"];function Vye(e){return Yye(e)||Kye(e)||Gye(e)||qye()}function qye(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 611In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gye(e,t){if(e){if(typeof e=="string")return FN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return FN(e,t)}}function Kye(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Yye(e){if(Array.isArray(e))return FN(e)}function FN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function bx(){return bx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bx.apply(this,arguments)}function vT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function xT(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vT(Object(r),!0).forEach(function(n){Xye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xye(e,t,r){return t=Qye(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qye(e){var t=Jye(e,"string");return bm(t)=="symbol"?t:t+""}function Jye(e,t){if(bm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(bm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yT(e,t){if(e==null)return{};var r=Zye(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zye(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ebe=function(t){return Array.isArray(t.value)?Uye(t.value):t.value};function rs(e){var t=e.valueAccessor,r=t===void 0?ebe:t,n=yT(e,Wye),s=n.data,i=n.dataKey,o=n.clockWise,l=n.id,c=n.textBreakAll,d=yT(n,Hye);return!s||!s.length?null:I.createElement(Xe,{className:"recharts-label-list"},s.map(function(u,f){var h=Le(i)?r(u,f):Vt(u&&u.payload,i),m=Le(l)?{}:{id:"".concat(l,"-").concat(f)};return I.createElement(Er,bx({},Ae(u,!0),d,m,{parentViewBox:u.parentViewBox,value:h,textBreakAll:c,viewBox:Er.parseViewBox(Le(o)?u:xT(xT({},u),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}rs.displayName="LabelList";function tbe(e,t){return e?e===!0?I.createElement(rs,{key:"labelList-implicit",data:t}):I.isValidElement(e)||Fe(e)?I.createElement(rs,{key:"labelList-implicit",data:t,content:e}):rf(e)?I.createElement(rs,bx({data:t},e,{key:"labelList-implicit"})):null:null}function rbe(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,s=vn(n,rs).map(function(o,l){return g.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!r)return s;var i=tbe(e.label,t);return[i].concat(Vye(s))}rs.renderCallByParent=rbe;function wm(e){"@babel/helpers - typeof";return wm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wm(e)}function BN(){return BN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BN.apply(this,arguments)}function bT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function wT(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bT(Object(r),!0).forEach(function(n){nbe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nbe(e,t,r){return t=abe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function abe(e){var t=sbe(e,"string");return wm(t)=="symbol"?t:t+""}function sbe(e,t){if(wm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(wm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ibe=function(t,r){var n=fn(r-t),s=Math.min(Math.abs(r-t),359.999);return n*s},xg=function(t){var r=t.cx,n=t.cy,s=t.radius,i=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,d=t.cornerIsExternal,u=c*(l?1:-1)+s,f=Math.asin(c/u)/yx,h=d?i:i+o*f,m=Lt(r,n,u,h),v=Lt(r,n,s,h),p=d?i-o*f:i,x=Lt(r,n,u*Math.cos(f*yx),p);return{center:m,circleTangency:v,lineTangency:x,theta:f}},dF=function(t){var r=t.cx,n=t.cy,s=t.innerRadius,i=t.outerRadius,o=t.startAngle,l=t.endAngle,c=ibe(o,l),d=o+c,u=Lt(r,n,i,o),f=Lt(r,n,i,d),h="M ".concat(u.x,",").concat(u.y,` 612 A `).concat(i,",").concat(i,`,0, 613 `).concat(+(Math.abs(c)>180),",").concat(+(o>d),`, 614 `).concat(f.x,",").concat(f.y,` 615 `);if(s>0){var m=Lt(r,n,s,o),v=Lt(r,n,s,d);h+="L ".concat(v.x,",").concat(v.y,` 616 A `).concat(s,",").concat(s,`,0, 617 `).concat(+(Math.abs(c)>180),",").concat(+(o<=d),`, 618 `).concat(m.x,",").concat(m.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},obe=function(t){var r=t.cx,n=t.cy,s=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,d=t.startAngle,u=t.endAngle,f=fn(u-d),h=xg({cx:r,cy:n,radius:i,angle:d,sign:f,cornerRadius:o,cornerIsExternal:c}),m=h.circleTangency,v=h.lineTangency,p=h.theta,x=xg({cx:r,cy:n,radius:i,angle:u,sign:-f,cornerRadius:o,cornerIsExternal:c}),b=x.circleTangency,y=x.lineTangency,w=x.theta,_=c?Math.abs(d-u):Math.abs(d-u)-p-w;if(_<0)return l?"M ".concat(v.x,",").concat(v.y,` 619 a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 620 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 621 `):dF({cx:r,cy:n,innerRadius:s,outerRadius:i,startAngle:d,endAngle:u});var N="M ".concat(v.x,",").concat(v.y,` 622 A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(m.x,",").concat(m.y,` 623 A`).concat(i,",").concat(i,",0,").concat(+(_>180),",").concat(+(f<0),",").concat(b.x,",").concat(b.y,` 624 A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(y.x,",").concat(y.y,` 625 `);if(s>0){var j=xg({cx:r,cy:n,radius:s,angle:d,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),S=j.circleTangency,C=j.lineTangency,P=j.theta,A=xg({cx:r,cy:n,radius:s,angle:u,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),D=A.circleTangency,F=A.lineTangency,q=A.theta,B=c?Math.abs(d-u):Math.abs(d-u)-P-q;if(B<0&&o===0)return"".concat(N,"L").concat(r,",").concat(n,"Z");N+="L".concat(F.x,",").concat(F.y,` 626 A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(D.x,",").concat(D.y,` 627 A`).concat(s,",").concat(s,",0,").concat(+(B>180),",").concat(+(f>0),",").concat(S.x,",").concat(S.y,` 628 A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(C.x,",").concat(C.y,"Z")}else N+="L".concat(r,",").concat(n,"Z");return N},lbe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},uF=function(t){var r=wT(wT({},lbe),t),n=r.cx,s=r.cy,i=r.innerRadius,o=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,d=r.cornerIsExternal,u=r.startAngle,f=r.endAngle,h=r.className;if(o<i||u===f)return null;var m=qe("recharts-sector",h),v=o-i,p=hn(l,v,0,!0),x;return p>0&&Math.abs(u-f)<360?x=obe({cx:n,cy:s,innerRadius:i,outerRadius:o,cornerRadius:Math.min(p,v/2),forceCornerRadius:c,cornerIsExternal:d,startAngle:u,endAngle:f}):x=dF({cx:n,cy:s,innerRadius:i,outerRadius:o,startAngle:u,endAngle:f}),I.createElement("path",BN({},Ae(r,!0),{className:m,d:x,role:"img"}))};function jm(e){"@babel/helpers - typeof";return jm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jm(e)}function zN(){return zN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zN.apply(this,arguments)}function jT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function NT(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jT(Object(r),!0).forEach(function(n){cbe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cbe(e,t,r){return t=dbe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dbe(e){var t=ube(e,"string");return jm(t)=="symbol"?t:t+""}function ube(e,t){if(jm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(jm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ST={curveBasisClosed:cse,curveBasisOpen:dse,curveBasis:lse,curveBumpX:Kae,curveBumpY:Yae,curveLinearClosed:use,curveLinear:fb,curveMonotoneX:fse,curveMonotoneY:hse,curveNatural:mse,curveStep:pse,curveStepAfter:vse,curveStepBefore:gse},yg=function(t){return t.x===+t.x&&t.y===+t.y},Ff=function(t){return t.x},Bf=function(t){return t.y},fbe=function(t,r){if(Fe(t))return t;var n="curve".concat(db(t));return(n==="curveMonotone"||n==="curveBump")&&r?ST["".concat(n).concat(r==="vertical"?"Y":"X")]:ST[n]||fb}
628,hbe=function(t){var r=t.type,n=r===void 0?"linear":r,s=t.points,i=s===void 0?[]:s,o=t.baseLine,l=t.layout,c=t.connectNulls,d=c===void 0?!1:c,u=fbe(n,l),f=d?i.filter(function(p){return yg(p)}):i,h;if(Array.isArray(o)){var m=d?o.filter(function(p){return yg(p)}):o,v=f.map(function(p,x){return NT(NT({},p),{},{base:m[x]})});return l==="vertical"?h=cg().y(Bf).x1(Ff).x0(function(p){return p.base.x}):h=cg().x(Ff).y1(Bf).y0(function(p){return p.base.y}),h.defined(yg).curve(u),h(v)}return l==="vertical"&&xe(o)?h=cg().y(Bf).x1(Ff).x0(o):xe(o)?h=cg().x(Ff).y1(Bf).y0(o):h=s3().x(Ff).y(Bf),h.defined(yg).curve(u),h(f)},Oo=function(t){var r=t.className,n=t.points,s=t.path,i=t.pathRef;if((!n||!n.length)&&!s)return null;var o=n&&n.length?hbe(t):s;return g.createElement("path",zN({},Ae(t,!1),Vv(t),{className:qe("recharts-curve",r),d:o,ref:i}))},fF={exports:{}},mbe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",pbe=mbe,gbe=pbe;function hF(){}function mF(){}mF.resetWarningCache=hF;var vbe=function(){function e(n,s,i,o,l,c){if(c!==gbe){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:mF,resetWarningCache:hF};return r.PropTypes=r,r};fF.exports=vbe();var xbe=fF.exports;const yt=mt(xbe);var ybe=Object.getOwnPropertyNames,bbe=Object.getOwnPropertySymbols,wbe=Object.prototype.hasOwnProperty;function _T(e,t){return function(n,s,i){return e(n,s,i)&&t(n,s,i)}}function bg(e){return function(r,n,s){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,s);var i=s.cache,o=i.get(r),l=i.get(n);if(o&&l)return o===n&&l===r;i.set(r,n),i.set(n,r);var c=e(r,n,s);return i.delete(r),i.delete(n),c}}function CT(e){return ybe(e).concat(bbe(e))}var jbe=Object.hasOwn||function(e,t){return wbe.call(e,t)};function _c(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var Nbe="__v",Sbe="__o",_be="_owner",PT=Object.getOwnPropertyDescriptor,kT=Object.keys;function Cbe(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function Pbe(e,t){return _c(e.getTime(),t.getTime())}function kbe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Abe(e,t){return e===t}function AT(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var s=new Array(n),i=e.entries(),o,l,c=0;(o=i.next())&&!o.done;){for(var d=t.entries(),u=!1,f=0;(l=d.next())&&!l.done;){if(s[f]){f++;continue}var h=o.value,m=l.value;if(r.equals(h[0],m[0],c,f,e,t,r)&&r.equals(h[1],m[1],h[0],m[0],e,t,r)){u=s[f]=!0;break}f++}if(!u)return!1;c++}return!0}var Ebe=_c;function Obe(e,t,r){var n=kT(e),s=n.length;if(kT(t).length!==s)return!1;for(;s-- >0;)if(!pF(e,t,r,n[s]))return!1;return!0}function zf(e,t,r){var n=CT(e),s=n.length;if(CT(t).length!==s)return!1;for(var i,o,l;s-- >0;)if(i=n[s],!pF(e,t,r,i)||(o=PT(e,i),l=PT(t,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function Tbe(e,t){return _c(e.valueOf(),t.valueOf())}function Mbe(e,t){return e.source===t.source&&e.flags===t.flags}function ET(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var s=new Array(n),i=e.values(),o,l;(o=i.next())&&!o.done;){for(var c=t.values(),d=!1,u=0;(l=c.next())&&!l.done;){if(!s[u]&&r.equals(o.value,l.value,o.value,l.value,e,t,r)){d=s[u]=!0;break}u++}if(!d)return!1}return!0}function Ibe(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function $be(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function pF(e,t,r,n){return(n===_be||n===Sbe||n===Nbe)&&(e.$$typeof||t.$$typeof)?!0:jbe(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var Rbe="[object Arguments]",Dbe="[object Boolean]",Lbe="[object Date]",Fbe="[object Error]",Bbe="[object Map]",zbe="[object Number]",Ube="[object Object]",Wbe="[object RegExp]",Hbe="[object Set]",Vbe="[object String]",qbe="[object URL]",Gbe=Array.isArray,OT=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,TT=Object.assign,Kbe=Object.prototype.toString.call.bind(Object.prototype.toString);function Ybe(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,s=e.areFunctionsEqual,i=e.areMapsEqual,o=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,d=e.areRegExpsEqual,u=e.areSetsEqual,f=e.areTypedArraysEqual,h=e.areUrlsEqual;return function(v,p,x){if(v===p)return!0;
628if(v==null||p==null)return!1;var b=typeof v;if(b!==typeof p)return!1;if(b!=="object")return b==="number"?o(v,p,x):b==="function"?s(v,p,x):!1;var y=v.constructor;if(y!==p.constructor)return!1;if(y===Object)return l(v,p,x);if(Gbe(v))return t(v,p,x);if(OT!=null&&OT(v))return f(v,p,x);if(y===Date)return r(v,p,x);if(y===RegExp)return d(v,p,x);if(y===Map)return i(v,p,x);if(y===Set)return u(v,p,x);var w=Kbe(v);return w===Lbe?r(v,p,x):w===Wbe?d(v,p,x):w===Bbe?i(v,p,x):w===Hbe?u(v,p,x):w===Ube?typeof v.then!="function"&&typeof p.then!="function"&&l(v,p,x):w===qbe?h(v,p,x):w===Fbe?n(v,p,x):w===Rbe?l(v,p,x):w===Dbe||w===zbe||w===Vbe?c(v,p,x):!1}}function Xbe(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,s={areArraysEqual:n?zf:Cbe,areDatesEqual:Pbe,areErrorsEqual:kbe,areFunctionsEqual:Abe,areMapsEqual:n?_T(AT,zf):AT,areNumbersEqual:Ebe,areObjectsEqual:n?zf:Obe,arePrimitiveWrappersEqual:Tbe,areRegExpsEqual:Mbe,areSetsEqual:n?_T(ET,zf):ET,areTypedArraysEqual:n?zf:Ibe,areUrlsEqual:$be};if(r&&(s=TT({},s,r(s))),t){var i=bg(s.areArraysEqual),o=bg(s.areMapsEqual),l=bg(s.areObjectsEqual),c=bg(s.areSetsEqual);s=TT({},s,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return s}function Qbe(e){return function(t,r,n,s,i,o,l){return e(t,r,l)}}function Jbe(e){var t=e.circular,r=e.comparator,n=e.createState,s=e.equals,i=e.strict;if(n)return function(c,d){var u=n(),f=u.cache,h=f===void 0?t?new WeakMap:void 0:f,m=u.meta;return r(c,d,{cache:h,equals:s,meta:m,strict:i})};if(t)return function(c,d){return r(c,d,{cache:new WeakMap,equals:s,meta:void 0,strict:i})};var o={cache:void 0,equals:s,meta:void 0,strict:i};return function(c,d){return r(c,d,o)}}var Zbe=tl();tl({strict:!0});tl({circular:!0});tl({circular:!0,strict:!0});tl({createInternalComparator:function(){return _c}});tl({strict:!0,createInternalComparator:function(){return _c}});tl({circular:!0,createInternalComparator:function(){return _c}});tl({circular:!0,createInternalComparator:function(){return _c},strict:!0});function tl(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,s=e.createState,i=e.strict,o=i===void 0?!1:i,l=Xbe(e),c=Ybe(l),d=n?n(c):Qbe(c);return Jbe({circular:r,comparator:c,createState:s,equals:d,strict:o})}function e0e(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function MT(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function s(i){r<0&&(r=i),i-r>t?(e(i),r=-1):e0e(s)};requestAnimationFrame(n)}function UN(e){"@babel/helpers - typeof";return UN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},UN(e)}function t0e(e){return s0e(e)||a0e(e)||n0e(e)||r0e()}function r0e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 629In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n0e(e,t){if(e){if(typeof e=="string")return IT(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return IT(e,t)}}function IT(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function a0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function s0e(e){if(Array.isArray(e))return e}function i0e(){var e={},t=function(){return null},r=!1,n=function s(i){if(!r){if(Array.isArray(i)){if(!i.length)return;var o=i,l=t0e(o),c=l[0],d=l.slice(1);if(typeof c=="number"){MT(s.bind(null,d),c);return}s(c),MT(s.bind(null,d));return}UN(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){r=!0},start:function(i){r=!1,n(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function Nm(e){"@babel/helpers - typeof";return Nm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nm(e)}function $T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function RT(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
vendor: 58,702 bytes, lines 629-647
629t%2?$T(Object(r),!0).forEach(function(n){gF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$T(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gF(e,t,r){return t=o0e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o0e(e){var t=l0e(e,"string");return Nm(t)==="symbol"?t:String(t)}function l0e(e,t){if(Nm(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Nm(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var c0e=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,s){return n.filter(function(i){return s.includes(i)})})},d0e=function(t){return t},u0e=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},jh=function(t,r){return Object.keys(r).reduce(function(n,s){return RT(RT({},n),{},gF({},s,t(s,r[s])))},{})},DT=function(t,r,n){return t.map(function(s){return"".concat(u0e(s)," ").concat(r,"ms ").concat(n)}).join(",")};function f0e(e,t){return p0e(e)||m0e(e,t)||vF(e,t)||h0e()}function h0e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 630In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m0e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,d=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function p0e(e){if(Array.isArray(e))return e}function g0e(e){return y0e(e)||x0e(e)||vF(e)||v0e()}function v0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 631In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vF(e,t){if(e){if(typeof e=="string")return WN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return WN(e,t)}}function x0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function y0e(e){if(Array.isArray(e))return WN(e)}function WN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var wx=1e-4,xF=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},yF=function(t,r){return t.map(function(n,s){return n*Math.pow(r,s)}).reduce(function(n,s){return n+s})},LT=function(t,r){return function(n){var s=xF(t,r);return yF(s,n)}},b0e=function(t,r){return function(n){var s=xF(t,r),i=[].concat(g0e(s.map(function(o,l){return o*l}).slice(1)),[0]);return yF(i,n)}},FT=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var s=r[0],i=r[1],o=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":s=0,i=0,o=1,l=1;break;case"ease":s=.25,i=.1,o=.25,l=1;break;case"ease-in":s=.42,i=0,o=1,l=1;break;case"ease-out":s=.42,i=0,o=.58,l=1;break;case"ease-in-out":s=0,i=0,o=.58,l=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var d=c[1].split(")")[0].split(",").map(function(x){return parseFloat(x)}),u=f0e(d,4);s=u[0],i=u[1],o=u[2],l=u[3]}}}var f=LT(s,o),h=LT(i,l),m=b0e(s,o),v=function(b){return b>1?1:b<0?0:b},p=function(b){for(var y=b>1?1:b,w=y,_=0;_<8;++_){var N=f(w)-y,j=m(w);if(Math.abs(N-y)<wx||j<wx)return h(w);w=v(w-N/j)}return h(w)};return p.isStepper=!1,p},w0e=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,s=t.damping,i=s===void 0?8:s,o=t.dt,l=o===void 0?17:o,c=function(u,f,h){var m=-(u-f)*n,v=h*i,p=h+(m-v)*l/1e3,x=h*l/1e3+u;return Math.abs(x-f)<wx&&Math.abs(p)<wx?[f,0]:[x,p]};return c.isStepper=!0,c.dt=l,c},j0e=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var s=r[0];if(typeof s=="string")switch(s){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return FT(s);case"spring":return w0e();default:if(s.split("(")[0]==="cubic-bezier")return FT(s)}return typeof s=="function"?s:null};function Sm(e){"@babel/helpers - typeof";return Sm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sm(e)}function BT(e){return _0e(e)||S0e(e)||bF(e)||N0e()}function N0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 632In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _0e(e){if(Array.isArray(e))return VN(e)}function zT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Dr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zT(Object(r),!0).forEach(function(n){HN(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function HN(e,t,r){return t=C0e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C0e(e){var t=P0e(e,"string");return Sm(t)==="symbol"?t:String(t)}function P0e(e,t){if(Sm(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Sm(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function k0e(e,t){return O0e(e)||E0e(e,t)||bF(e,t)||A0e()}function A0e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 633In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bF(e,t){if(e){if(typeof e=="string")return VN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return VN(e,t)}}function VN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function E0e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,d=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function O0e(e){if(Array.isArray(e))return e}var jx=function(t,r,n){return t+(r-t)*n},qN=function(t){var r=t.from,n=t.to;return r!==n},T0e=function e(t,r,n){var s=jh(function(i,o){if(qN(o)){var l=t(o.from,o.to,o.velocity),c=k0e(l,2),d=c[0],u=c[1];return Dr(Dr({},o),{},{from:d,velocity:u})}return o},r);return n<1?jh(function(i,o){return qN(o)?Dr(Dr({},o),{},{velocity:jx(o.velocity,s[i].velocity,n),from:jx(o.from,s[i].from,n)}):o},r):e(t,s,n-1)};const M0e=function(e,t,r,n,s){var i=c0e(e,t),o=i.reduce(function(x,b){return Dr(Dr({},x),{},HN({},b,[e[b],t[b]]))},{}),l=i.reduce(function(x,b){return Dr(Dr({},x),{},HN({},b,{from:e[b],velocity:0,to:t[b]}))},{}),c=-1,d,u,f=function(){return null},h=function(){return jh(function(b,y){return y.from},l)},m=function(){return!Object.values(l).filter(qN).length},v=function(b){d||(d=b);var y=b-d,w=y/r.dt;l=T0e(r,l,w),s(Dr(Dr(Dr({},e),t),h())),d=b,m()||(c=requestAnimationFrame(f))},p=function(b){u||(u=b);var y=(b-u)/n,w=jh(function(N,j){return jx.apply(void 0,BT(j).concat([r(y)]))},o);if(s(Dr(Dr(Dr({},e),t),w)),y<1)c=requestAnimationFrame(f);else{var _=jh(function(N,j){return jx.apply(void 0,BT(j).concat([r(1)]))},o);s(Dr(Dr(Dr({},e),t),_))}};return f=r.isStepper?v:p,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function gu(e){"@babel/helpers - typeof";return gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gu(e)}var I0e=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function $0e(e,t){if(e==null)return{};var r=R0e(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function R0e(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,i;for(i=0;i<n.length;i++)s=n[i],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}function Mw(e){return B0e(e)||F0e(e)||L0e(e)||D0e()}function D0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 634In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L0e(e,t){if(e){if(typeof e=="string")return GN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return GN(e,t)}}function F0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function B0e(e){if(Array.isArray(e))return GN(e)}function GN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function UT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Da(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?UT(Object(r),!0).forEach(function(n){Jf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jf(e,t,r){return t=wF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function z0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function U0e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wF(n.key),n)}}function W0e(e,t,r){return t&&U0e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function wF(e){var t=H0e(e,"string");return gu(t)==="symbol"?t:String(t)}function H0e(e,t){if(gu(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(gu(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function V0e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&KN(e,t)}function KN(e,t){return KN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},KN(e,t)}function q0e(e){var t=G0e();return function(){var n=Nx(e),s;if(t){var i=Nx(this).constructor;s=Reflect.construct(n,arguments,i)}else s=n.apply(this,arguments);return YN(this,s)}}function YN(e,t){if(t&&(gu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return XN(e)}function XN(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G0e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Nx(e){return Nx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Nx(e)}var _a=function(e){V0e(r,e);var t=q0e(r);function r(n,s){var i;z0e(this,r),i=t.call(this,n,s);var o=i.props,l=o.isActive,c=o.attributeName,d=o.from,u=o.to,f=o.steps,h=o.children,m=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(XN(i)),i.changeStyle=i.changeStyle.bind(XN(i)),!l||m<=0)return i.state={style:{}},typeof h=="function"&&(i.state={style:u}),YN(i);if(f&&f.length)i.state={style:f[0].style};else if(d){if(typeof h=="function")return i.state={style:d},YN(i);i.state={style:c?Jf({},c,d):d}}else i.state={style:{}};return i}return W0e(r,[{key:"componentDidMount",value:function(){var s=this.props,i=s.isActive,o=s.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(s){var i=this.props,o=i.isActive,l=i.canBegin,c=i.attributeName,d=i.shouldReAnimate,u=i.to,f=i.from,h=this.state.style;if(l){if(!o){var m={style:c?Jf({},c,u):u};this.state&&h&&(c&&h[c]!==u||!c&&h!==u)&&this.setState(m);return}if(!(Zbe(s.to,u)&&s.canBegin&&s.isActive)){var v=!s.canBegin||!s.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var p=v||d?f:s.to;if(this.state&&h){var x={style:c?Jf({},c,p):p};(c&&h[c]!==p||!c&&h!==p)&&this.setState(x)}this.runAnimation(Da(Da({},this.props),{},{from:p,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var s=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),s&&s()}},{key:"handleStyleChange",value:function(s){this.changeStyle(s)}},{key:"changeStyle",value:function(s){this.mounted&&this.setState({style:s})}},{key:"runJSAnimation",value:function(s){var i=this,o=s.from,l=s.to,c=s.duration,d=s.easing,u=s.begin,f=s.onAnimationEnd,h=s.onAnimationStart,m=M0e(o,l,j0e(d),c,this.changeStyle),v=function(){i.stopJSAnimation=m()};this.manager.start([h,u,v,c,f])}},{key:"runStepAnimation",value:function(s){var i=this,o=s.steps,l=s.begin,c=s.onAnimationStart,d=o[0],u=d.style,f=d.duration,h=f===void 0?0:f,m=function(p,x,b){if(b===0)return p;var y=x.duration,w=x.easing,_=w===void 0?"ease":w,N=x.style,j=x.properties,S=x.onAnimationEnd,C=b>0?o[b-1]:x,P=j||Object.keys(N);if(typeof _=="function"||_==="spring")return[].concat(Mw(p),[i.runJSAnimation.bind(i,{from:C.style,to:N,duration:y,easing:_}),y]);var A=DT(P,y,_),D=Da(Da(Da({},C.style),N),{},{transition:A});return[].concat(Mw(p),[D,y,S]).filter(d0e)};return this.manager.start([c].concat(Mw(o.reduce(m,[u,Math.max(h,l)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=i0e());var i=s.begin,o=s.duration,l=s.attributeName,c=s.to,d=s.easing,u=s.onAnimationStart,f=s.onAnimationEnd,h=s.steps,m=s.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof d=="function"||typeof m=="function"||d==="spring"){this.runJSAnimation(s);return}if(h.length>1){this.runStepAnimation(s);return}var p=l?Jf({},l,c):c,x=DT(Object.keys(p),o,d);v.start([u,i,Da(Da({},p),{},{transition:x}),o,f])}},{key:"render",value:function(){var s=this.props,i=s.children;s.begin;var o=s.duration;s.attributeName,s.easing;var l=s.isActive;s.steps,s.from,s.to,s.canBegin,s.onAnimationEnd,s.shouldReAnimate,s.onAnimationReStart;var c=$0e(s,I0e),d=g.Children.count(i),u=this.state.style;if(typeof i=="function")return i(u);if(!l||d===0||o<=0)return i;var f=function(m){var v=m.props,p=v.style,x=p===void 0?{}:p,b=v.className,y=g.cloneElement(m,Da(Da({},c),{},{style:Da(Da({},x),u),className:b}));return y};return d===1?f(g.Children.only(i)):I.createElement("div",null,g.Children.map(i,function(h){return f(h)}))}}]),r}(g.PureComponent);_a.displayName="Animate";_a.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};_a.propTypes={from:yt.oneOfType([yt.object,yt.string]),to:yt.oneOfType([yt.object,yt.string]),attributeName:yt.string,duration:yt.number,begin:yt.number,easing:yt.oneOfType([yt.string,yt.func]),steps:yt.arrayOf(yt.shape({duration:yt.number.isRequired,style:yt.object.isRequired,easing:yt.oneOfType([yt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),yt.func]),properties:yt.arrayOf("string"),onAnimationEnd:yt.func})),children:yt.oneOfType([yt.node,yt.func]),isActive:yt.bool,canBegin:yt.bool,onAnimationEnd:yt.func,shouldReAnimate:yt.bool,onAnimationStart:yt.func,onAnimationReStart:yt.func};function _m(e){"@babel/helpers - typeof";return _m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_m(e)}function Sx(){return Sx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sx.apply(this,arguments)}function K0e(e,t){return J0e(e)||Q0e(e,t)||X0e(e,t)||Y0e()}function Y0e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 635In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X0e(e,t){if(e){if(typeof e=="string")return WT(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return WT(e,t)}}function WT(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Q0e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,d=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function J0e(e){if(Array.isArray(e))return e}function HT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function VT(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HT(Object(r),!0).forEach(function(n){Z0e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Z0e(e,t,r){return t=ewe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ewe(e){var t=twe(e,"string");return _m(t)=="symbol"?t:t+""}function twe(e,t){if(_m(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(_m(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qT=function(t,r,n,s,i){var o=Math.min(Math.abs(n)/2,Math.abs(s)/2),l=s>=0?1:-1,c=n>=0?1:-1,d=s>=0&&n>=0||s<0&&n<0?1:0,u;if(o>0&&i instanceof Array){for(var f=[0,0,0,0],h=0,m=4;h<m;h++)f[h]=i[h]>o?o:i[h];u="M".concat(t,",").concat(r+l*f[0]),f[0]>0&&(u+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(d,",").concat(t+c*f[0],",").concat(r)),u+="L ".concat(t+n-c*f[1],",").concat(r),f[1]>0&&(u+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(d,`, 636 `).concat(t+n,",").concat(r+l*f[1])),u+="L ".concat(t+n,",").concat(r+s-l*f[2]),f[2]>0&&(u+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(d,`, 637 `).concat(t+n-c*f[2],",").concat(r+s)),u+="L ".concat(t+c*f[3],",").concat(r+s),f[3]>0&&(u+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(d,`, 638 `).concat(t,",").concat(r+s-l*f[3])),u+="Z"}else if(o>0&&i===+i&&i>0){var v=Math.min(o,i);u="M ".concat(t,",").concat(r+l*v,` 639 A `).concat(v,",").concat(v,",0,0,").concat(d,",").concat(t+c*v,",").concat(r,` 640 L `).concat(t+n-c*v,",").concat(r,` 641 A `).concat(v,",").concat(v,",0,0,").concat(d,",").concat(t+n,",").concat(r+l*v,` 642 L `).concat(t+n,",").concat(r+s-l*v,` 643 A `).concat(v,",").concat(v,",0,0,").concat(d,",").concat(t+n-c*v,",").concat(r+s,` 644 L `).concat(t+c*v,",").concat(r+s,` 645 A `).concat(v,",").concat(v,",0,0,").concat(d,",").concat(t,",").concat(r+s-l*v," Z")}else u="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(s," h ").concat(-n," Z");return u},rwe=function(t,r){if(!t||!r)return!1;var n=t.x,s=t.y,i=r.x,o=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var d=Math.min(i,i+l),u=Math.max(i,i+l),f=Math.min(o,o+c),h=Math.max(o,o+c);return n>=d&&n<=u&&s>=f&&s<=h}return!1},nwe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},p2=function(t){var r=VT(VT({},nwe),t),n=g.useRef(),s=g.useState(-1),i=K0e(s,2),o=i[0],l=i[1];g.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var _=n.current.getTotalLength();_&&l(_)}catch{}},[]);var c=r.x,d=r.y,u=r.width,f=r.height,h=r.radius,m=r.className,v=r.animationEasing,p=r.animationDuration,x=r.animationBegin,b=r.isAnimationActive,y=r.isUpdateAnimationActive;if(c!==+c||d!==+d||u!==+u||f!==+f||u===0||f===0)return null;var w=qe("recharts-rectangle",m);return y?I.createElement(_a,{canBegin:o>0,from:{width:u,height:f,x:c,y:d},to:{width:u,height:f,x:c,y:d},duration:p,animationEasing:v,isActive:y},function(_){var N=_.width,j=_.height,S=_.x,C=_.y;return I.createElement(_a,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:p,isActive:b,easing:v},I.createElement("path",Sx({},Ae(r,!0),{className:w,d:qT(S,C,N,j,h),ref:n})))}):I.createElement("path",Sx({},Ae(r,!0),{className:w,d:qT(c,d,u,f,h)}))},awe=["points","className","baseLinePoints","connectNulls"];function hd(){return hd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hd.apply(this,arguments)}function swe(e,t){if(e==null)return{};var r=iwe(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function iwe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function GT(e){return dwe(e)||cwe(e)||lwe(e)||owe()}function owe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 646In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lwe(e,t){if(e){if(typeof e=="string")return QN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return QN(e,t)}}function cwe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dwe(e){if(Array.isArray(e))return QN(e)}function QN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var KT=function(t){return t&&t.x===+t.x&&t.y===+t.y},uwe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){KT(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),KT(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Nh=function(t,r){var n=uwe(t);r&&(n=[n.reduce(function(i,o){return[].concat(GT(i),GT(o))},[])]);var s=n.map(function(i){return i.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return n.length===1?"".concat(s,"Z"):s},fwe=function(t,r,n){var s=Nh(t,n);return"".concat(s.slice(-1)==="Z"?s.slice(0,-1):s,"L").concat(Nh(r.reverse(),n).slice(1))},hwe=function(t){var r=t.points,n=t.className,s=t.baseLinePoints,i=t.connectNulls,o=swe(t,awe);if(!r||!r.length)return null;var l=qe("recharts-polygon",n);if(s&&s.length){var c=o.stroke&&o.stroke!=="none",d=fwe(r,s,i);return I.createElement("g",{className:l},I.createElement("path",hd({},Ae(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",stroke:"none",d})),c?I.createElement("path",hd({},Ae(o,!0),{fill:"none",d:Nh(r,i)})):null,c?I.createElement("path",hd({},Ae(o,!0),{fill:"none",d:Nh(s,i)})):null)}var u=Nh(r,i);return I.createElement("path",hd({},Ae(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",className:l,d:u}))};function JN(){return JN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},JN.apply(this,arguments)}var pp=function(t){var r=t.cx,n=t.cy,s=t.r,i=t.className,o=qe("recharts-dot",i);return r===+r&&n===+n&&s===+s?g.createElement("circle",JN({},Ae(t,!1),Vv(t),{className:o,cx:r,cy:n,r:s})):null};function Cm(e){"@babel/helpers - typeof";return Cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cm(e)}var mwe=["x","y","top","left","width","height","className"];function ZN(){return ZN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ZN.apply(this,arguments)}function YT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function pwe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YT(Object(r),!0).forEach(function(n){gwe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gwe(e,t,r){return t=vwe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vwe(e){var t=xwe(e,"string");return Cm(t)=="symbol"?t:t+""}function xwe(e,t){if(Cm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Cm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ywe(e,t){if(e==null)return{};var r=bwe(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bwe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var wwe=function(t,r,n,s,i,o){return"M".concat(t,",").concat(i,"v").concat(s,"M").concat(o,",").concat(r,"h").concat(n)},jwe=function(t){var r=t.x,n=r===void 0?0:r,s=t.y,i=s===void 0?0:s,o=t.top,l=o===void 0?0:o,c=t.left,d=c===void 0?0:c,u=t.width,f=u===void 0?0:u,h=t.height,m=h===void 0?0:h,v=t.className,p=ywe(t,mwe),x=pwe({x:n,y:i,top:l,left:d,width:f,height:m},p);return!xe(n)||!xe(i)||!xe(f)||!xe(m)||!xe(l)||!xe(d)?null:I.createElement("path",ZN({},Ae(x,!0),{className:qe("recharts-cross",v),d:wwe(n,i,f,m,l,d)}))},Nwe=Sb,Swe=ML,_we=Us;function Cwe(e,t){return e&&e.length?Nwe(e,_we(t),Swe):void 0}var Pwe=Cwe;const kwe=mt(Pwe);var Awe=Sb,Ewe=Us,Owe=IL;function Twe(e,t){return e&&e.length?Awe(e,Ewe(t),Owe):void 0}var Mwe=Twe;const Iwe=mt(Mwe);var $we=["cx","cy","angle","ticks","axisLine"],Rwe=["ticks","tick","angle","tickFormatter","stroke"];function vu(e){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vu(e)}function Sh(){return Sh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sh.apply(this,arguments)}function XT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ml(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?XT(Object(r),!0).forEach(function(n){kb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QT(e,t){if(e==null)return{};var r=Dwe(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Dwe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Lwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,NF(n.key),n)}}function Fwe(e,t,r){return t&&JT(e.prototype,t),r&&JT(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bwe(e,t,r){return t=_x(t),zwe(e,jF()?Reflect.construct(t,r||[],_x(e).constructor):t.apply(e,r))}function zwe(e,t){if(t&&(vu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Uwe(e)}function Uwe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jF=function(){return!!e})()}function _x(e){return _x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_x(e)}function Wwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eS(e,t)}function eS(e,t){return eS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},eS(e,t)}function kb(e,t,r){return t=NF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NF(e){var t=Hwe(e,"string");return vu(t)=="symbol"?t:t+""}function Hwe(e,t){if(vu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(vu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ab=function(e){function t(){return Lwe(this,t),Bwe(this,t,arguments)}return Wwe(t,e),Fwe(t,[{key:"getTickValueCoord",value:function(n){var s=n.coordinate,i=this.props,o=i.angle,l=i.cx,c=i.cy;return Lt(l,c,s,o)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,s;switch(n){case"left":s="end";break;case"right":s="start";break;default:s="middle";break}return s}},{key:"getViewBox",value:function(){var n=this.props,s=n.cx,i=n.cy,o=n.angle,l=n.ticks,c=kwe(l,function(u){return u.coordinate||0}),d=Iwe(l,function(u){return u.coordinate||0});return{cx:s,cy:i,startAngle:o,endAngle:o,innerRadius:d.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,s=n.cx,i=n.cy,o=n.angle,l=n.ticks,c=n.axisLine,d=QT(n,$we),u=l.reduce(function(v,p){return[Math.min(v[0],p.coordinate),Math.max(v[1],p.coordinate)]},[1/0,-1/0]),f=Lt(s,i,u[0],o),h=Lt(s,i,u[1],o),m=ml(ml(ml({},Ae(d,!1)),{},{fill:"none"},Ae(c,!1)),{},{x1:f.x,y1:f.y,x2:h.x,y2:h.y});return I.createElement("line",Sh({className:"recharts-polar-radius-axis-line"},m))}},{key:"renderTicks",value:function(){var n=this,s=this.props,i=s.ticks,o=s.tick,l=s.angle,c=s.tickFormatter,d=s.stroke,u=QT(s,Rwe),f=this.getTickTextAnchor(),h=Ae(u,!1),m=Ae(o,!1),v=i.map(function(p,x){var b=n.getTickValueCoord(p),y=ml(ml(ml(ml({textAnchor:f,transform:"rotate(".concat(90-l,", ").concat(b.x,", ").concat(b.y,")")},h),{},{stroke:"none",fill:d},m),{},{index:x},b),{},{payload:p});return I.createElement(Xe,Sh({className:qe("recharts-polar-radius-axis-tick",lF(o)),key:"tick-".concat(p.coordinate)},Bo(n.props,p,x)),t.renderTickItem(o,y,c?c(p.value,x):p.value))});return I.createElement(Xe,{className:"recharts-polar-radius-axis-ticks"},v)}},{key:"render",value:function(){var n=this.props,s=n.ticks,i=n.axisLine,o=n.tick;return!s||!s.length?null:I.createElement(Xe,{className:qe("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),Er.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,s,i){var o;return I.isValidElement(n)?o=I.cloneElement(n,s):Fe(n)?o=n(s):o=I.createElement(lc,Sh({},s,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])}(g.PureComponent);kb(Ab,"displayName","PolarRadiusAxis");kb(Ab,"axisType","radiusAxis");kb(Ab,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function Sl(){return Sl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sl.apply(this,arguments)}function ZT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function pl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZT(Object(r),!0).forEach(function(n){Eb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eM(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_F(n.key),n)}}function qwe(e,t,r){return t&&eM(e.prototype,t),r&&eM(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gwe(e,t,r){return t=Cx(t),Kwe(e,SF()?Reflect.construct(t,r||[],Cx(e).constructor):t.apply(e,r))}function Kwe(e,t){if(t&&(xu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ywe(e)}function Ywe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function SF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SF=function(){return!!e})()}function Cx(e){return Cx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Cx(e)}function Xwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tS(e,t)}function tS(e,t){return tS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},tS(e,t)}function Eb(e,t,r){return t=_F(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _F(e){var t=Qwe(e,"string");return xu(t)=="symbol"?t:t+""}function Qwe(e,t){if(xu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(xu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Jwe=Math.PI/180,tM=1e-5,Ob=function(e){function t(){return Vwe(this,t),Gwe(this,t,arguments)}return Xwe(t,e),qwe(t,[{key:"getTickLineCoord",value:function(n){var s=this.props,i=s.cx,o=s.cy,l=s.radius,c=s.orientation,d=s.tickSize,u=d||8,f=Lt(i,o,l,n.coordinate),h=Lt(i,o,l+(c==="inner"?-1:1)*u,n.coordinate);return{x1:f.x,y1:f.y,x2:h.x,y2:h.y}}},{key:"getTickTextAnchor",value:function(n){var s=this.props.orientation,i=Math.cos(-n.coordinate*Jwe),o;return i>tM?o=s==="outer"?"start":"end":i<-tM?o=s==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,s=n.cx,i=n.cy,o=n.radius,l=n.axisLine,c=n.axisLineType,d=pl(pl({},Ae(this.props,!1)),{},{fill:"none"},Ae(l,!1));if(c==="circle")return I.createElement(pp,Sl({className:"recharts-polar-angle-axis-line"},d,{cx:s,cy:i,r:o}));var u=this.props.ticks,f=u.map(function(h){return Lt(s,i,o,h.coordinate)});return I.createElement(hwe,Sl({className:"recharts-polar-angle-axis-line"},d,{points:f}))}},{key:"renderTicks",value:function(){var n=this,s=this.props,i=s.ticks,o=s.tick,l=s.tickLine,c=s.tickFormatter,d=s.stroke,u=Ae(this.props,!1),f=Ae(o,!1),h=pl(pl({},u),{},{fill:"none"},Ae(l,!1)),m=i.map(function(v,p){var x=n.getTickLineCoord(v),b=n.getTickTextAnchor(v),y=pl(pl(pl({textAnchor:b},u),{},{stroke:"none",fill:d},f),{},{index:p,payload:v,x:x.x2,y:x.y2});return I.createElement(Xe,Sl({className:qe("recharts-polar-angle-axis-tick",lF(o)),key:"tick-".concat(v.coordinate)},Bo(n.props,v,p)),l&&I.createElement("line",Sl({className:"recharts-polar-angle-axis-tick-line"},h,x)),o&&t.renderTickItem(o,y,c?c(v.value,p):v.value))});return I.createElement(Xe,{className:"recharts-polar-angle-axis-ticks"},m)}},{key:"render",value:function(){var n=this.props,s=n.ticks,i=n.radius,o=n.axisLine;return i<=0||!s||!s.length?null:I.createElement(Xe,{className:qe("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,s,i){var o;return I.isValidElement(n)?o=I.cloneElement(n,s):Fe(n)?o=n(s):o=I.createElement(lc,Sl({},s,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])}(g.PureComponent);Eb(Ob,"displayName","PolarAngleAxis");Eb(Ob,"axisType","angleAxis");Eb(Ob,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Zwe=A3,eje=Zwe(Object.getPrototypeOf,Object),tje=eje,rje=Oi,nje=tje,aje=Ti,sje="[object Object]",ije=Function.prototype,oje=Object.prototype,CF=ije.toString,lje=oje.hasOwnProperty,cje=CF.call(Object);function dje(e){if(!aje(e)||rje(e)!=sje)return!1;var t=nje(e);if(t===null)return!0;var r=lje.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&CF.call(r)==cje}var uje=dje;const fje=mt(uje);var hje=Oi,mje=Ti,pje="[object Boolean]";function gje(e){return e===!0||e===!1||mje(e)&&hje(e)==pje}var vje=gje;const xje=mt(vje);function Pm(e){"@babel/helpers - typeof";return Pm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pm(e)}function Px(){return Px=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Px.apply(this,arguments)}function yje(e,t){return Nje(e)||jje(e,t)||wje(e,t)||bje()}function bje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 647In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wje(e,t){if(e){if(typeof e=="string")return rM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rM(e,t)}}function rM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jje(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,d=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function Nje(e){if(Array.isArray(e))return e}function nM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function aM(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nM(Object(r),!0).forEach(function(n){Sje(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sje(e,t,r){return t=_je(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _je(e){var t=Cje(e,"string");return Pm(t)=="symbol"?t:t+""}function Cje(e,t){if(Pm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Pm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sM=function(t,r,n,s,i){var o=n-s,l;return l="M ".concat(t,",").concat(r),l+="L ".concat(t+n,",").concat(r),l+="L ".concat(t+n-o/2,",").concat(r+i),l+="L ".concat(t+n-o/2-s,",").concat(r+i),l+="L ".concat(t,",").concat(r," Z"),l},Pje={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},kje=function(t){var r=aM(aM({},Pje),t),n=g.useRef(),s=g.useState(-1),i=yje(s,2),o=i[0],l=i[1];g.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var w=n.current.getTotalLength();w&&l(w)}catch{}},[]);var c=r.x,d=r.y,u=r.upperWidth,f=r.lowerWidth,h=r.height,m=r.className,v=r.animationEasing,p=r.animationDuration,x=r.animationBegin,b=r.isUpdateAnimationActive;if(c!==+c||d!==+d||u!==+u||f!==+f||h!==+h||u===0&&f===0||h===0)return null;var y=qe("recharts-trapezoid",m);return b?I.createElement(_a,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:d},to:{upperWidth:u,lowerWidth:f,height:h,x:c,y:d},duration:p,animationEasing:v,isActive:b},function(w){var _=w.upperWidth,N=w.lowerWidth,j=w.height,S=w.x,C=w.y;return I.createElement(_a,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:p,easing:v},I.createElement("path",Px({},Ae(r,!0),{className:y,d:sM(S,C,_,N,j),ref:n})))}):I.createElement("g",null,I.createElement("path",Px({},Ae(r,!0),{className:y,d:sM(c,d,u,f,h)})))},Aje=["option","shapeType","propTransformer","activeClassName","isActive"];function km(e){"@babel/helpers - typeof";return km=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},km(e)}function Eje(e,t){if(e==null)return{};var r=Oje(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Oje(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function iM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function kx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iM(Object(r),!0).forEach(function(n){Tje(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tje(e,t,r){return t=Mje(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mje(e){var t=Ije(e,"string");return km(t)=="symbol"?t:t+""}function Ije(e,t){if(km(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(km(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $je(e,t){return kx(kx({},t),e)}function Rje(e,t){return e==="symbols"}function oM(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return I.createElement(p2,r);case"trapezoid":return I.createElement(kje,r);case"sector":return I.createElement(uF,r);case"symbols":if(Rje(t))return I.createElement(mb,r);break;default:return null}}function Dje(e){return g.isValidElement(e)?e.props:e}function Ax(e){var t=e.option,r=e.shapeType,n=e.propTransformer,s=n===void 0?$je:n,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,l=e.isActive,c=Eje(e,Aje),d;if(g.isValidElement(t))d=g.cloneElement(t,kx(kx({},c),Dje(t)));else if(Fe(t))d=t(c);else if(fje(t)&&!xje(t)){var u=s(t,c);d=I.createElement(oM,{shapeType:r,elementProps:u})}else{var f=c;d=I.createElement(oM,{shapeType:r,elementProps:f})}return l?I.createElement(Xe,{className:o},d):d}function Tb(e,t){return t!=null&&"trapezoids"in e.props}function Mb(e,t){return t!=null&&"sectors"in e.props}function Am(e,t){return t!=null&&"points"in e.props}function Lje(e,t){var r,n,s=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,i=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return s&&i}function Fje(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function Bje(e,t){var r=e.x===t.x,n=e.y===t.y,s=e.z===t.z;return r&&n&&s}function zje(e,t){var r;return Tb(e,t)?r=Lje:Mb(e,t)?r=Fje:Am(e,t)&&(r=Bje),r}function Uje(e,t){var r;return Tb(e,t)?r="trapezoids":Mb(e,t)?r="sectors":Am(e,t)&&(r="points"),r}function Wje(e,t){if(Tb(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(Mb(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return Am(e,t)?t.payload:{}}function Hje(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,s=Uje(r,t),i=Wje(r,t),o=n.filter(function(c,d){var u=zo(i,c),f=r.props[s].filter(function(v){var p=zje(r,t);return p(v,t)}),h=r.props[s].indexOf(f[f.length-1]),m=d===h;return u&&m}),l=n.indexOf(o[o.length-1]);return l}var Kg;function yu(e){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yu(e)}function md(){return md=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},md.apply(this,arguments)}function lM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function It(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lM(Object(r),!0).forEach(function(n){ha(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cM(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,kF(n.key),n)}}function qje(e,t,r){return t&&cM(e.prototype,t),r&&cM(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gje(e,t,r){return t=Ex(t),Kje(e,PF()?Reflect.construct(t,r||[],Ex(e).constructor):t.apply(e,r))}function Kje(e,t){if(t&&(yu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yje(e)}function Yje(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function PF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(PF=function(){return!!e})()}function Ex(e){return Ex=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ex(e)}function Xje(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rS(e,t)}function rS(e,t){return rS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},rS(e,t)}function ha(e,t,r){return t=kF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kF(e){var t=Qje(e,"string");return yu(t)=="symbol"?t:t+""}function Qje(e,t){if(yu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(yu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ka=function(e){function t(r){var n;return Vje(this,t),n=Gje(this,t,[r]),ha(n,"pieRef",null),ha(n,"sectorRefs",[]),ha(n,"id",Qo("recharts-pie-")),ha(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Fe(s)&&s()}),ha(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Fe(s)&&s()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return Xje(t,e),qje(t,[{key:"isActiveIndex",value:function(n){var s=this.props.activeIndex;return Array.isArray(s)?s.indexOf(n)!==-1:n===s}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,l=i.labelLine,c=i.dataKey,d=i.valueKey,u=Ae(this.props,!1),f=Ae(o,!1),h=Ae(l,!1),m=o&&o.offsetRadius||20,v=n.map(function(p,x){var b=(p.startAngle+p.endAngle)/2,y=Lt(p.cx,p.cy,p.outerRadius+m,b),w=It(It(It(It({},u),p),{},{stroke:"none"},f),{},{index:x,textAnchor:t.getTextAnchor(y.x,p.cx)},y),_=It(It(It(It({},u),p),{},{fill:"none",stroke:p.fill},h),{},{index:x,points:[Lt(p.cx,p.cy,p.outerRadius,b),y]}),N=c;return Le(c)&&Le(d)?N="value":Le(c)&&(N=d),I.createElement(Xe,{key:"label-".concat(p.startAngle,"-").concat(p.endAngle,"-").concat(p.midAngle,"-").concat(x)},l&&t.renderLabelLineItem(l,_,"line"),t.renderLabelItem(o,w,Vt(p,N)))});return I.createElement(Xe,{className:"recharts-pie-labels"},v)}},{key:"renderSectorsStatically",value:function(n){var s=this,i=this.props,o=i.activeShape,l=i.blendStroke,c=i.inactiveShape;return n.map(function(d,u){if((d==null?void 0:d.startAngle)===0&&(d==null?void 0:d.endAngle)===0&&n.length!==1)return null;var f=s.isActiveIndex(u),h=c&&s.hasActiveIndex()?c:null,m=f?o:h,v=It(It({},d),{},{stroke:l?d.fill:d.stroke,tabIndex:-1});return I.createElement(Xe,md({ref:function(x){x&&!s.sectorRefs.includes(x)&&s.sectorRefs.push(x)},tabIndex:-1,className:"recharts-pie-sector"},Bo(s.props,d,u),{key:"sector-".concat(d==null?void 0:d.startAngle,"-").concat(d==null?void 0:d.endAngle,"-").concat(d.midAngle,"-").concat(u)}),I.createElement(Ax,md({option:m,isActive:f,shapeType:"sector"},v)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,s=this.props,i=s.sectors,o=s.isAnimationActive,l=s.animationBegin,c=s.animationDuration,d=s.animationEasing,u=s.animationId,f=this.state,h=f.prevSectors,m=f.prevIsAnimationActive;return I.createElement(_a,{begin:l,duration:c,isActive:o,easing:d,from:{t:0},to:{t:1},key:"pie-".concat(u,"-").concat(m),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(v){var p=v.t,x=[],b=i&&i[0],y=b.startAngle;return i.forEach(function(w,_){var N=h&&h[_],j=_>0?Yn(w,"paddingAngle",0):0;if(N){var S=rr(N.endAngle-N.startAngle,w.endAngle-w.startAngle),C=It(It({},w),{},{startAngle:y+j,endAngle:y+S(p)+j});x.push(C),y=C.endAngle}else{var P=w.endAngle,A=w.startAngle,D=rr(0,P-A),F=D(p),q=It(It({},w),{},{startAngle:y+j,endAngle:y+F+j});x.push(q),y=q.endAngle}}),I.createElement(Xe,null,n.renderSectorsStatically(x))})}},{key:"attachKeyboardHandlers",value:function(n){var s=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[o].focus(),s.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--s.state.sectorToFocus<0?s.sectorRefs.length-1:s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[l].focus(),s.setState({sectorToFocus:l});break}case"Escape":{s.sectorRefs[s.state.sectorToFocus].blur(),s.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,s=n.sectors,i=n.isAnimationActive,o=this.state.prevSectors;return i&&s&&s.length&&(!o||!zo(o,s))?this.renderSectorsWithAnimation():this.renderSectorsStatically(s)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,s=this.props,i=s.hide,o=s.sectors,l=s.className,c=s.label,d=s.cx,u=s.cy,f=s.innerRadius,h=s.outerRadius,m=s.isAnimationActive,v=this.state.isAnimationFinished;if(i||!o||!o.length||!xe(d)||!xe(u)||!xe(f)||!xe(h))return null;var p=qe("recharts-pie",l);return I.createElement(Xe,{tabIndex:this.props.rootTabIndex,className:p,ref:function(b){n.pieRef=b}},this.renderSectors(),c&&this.renderLabels(o),Er.renderCallByParent(this.props,null,!1),(!m||v)&&rs.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,s){return s.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==s.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:s.curSectors,isAnimationFinished:!0}:n.sectors!==s.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,s){return n>s?"start":n<s?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,s,i){if(I.isValidElement(n))return I.cloneElement(n,s);if(Fe(n))return n(s);var o=qe("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return I.createElement(Oo,md({},s,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(n,s,i){if(I.isValidElement(n))return I.cloneElement(n,s);var o=i;if(Fe(n)&&(o=n(s),I.isValidElement(o)))return o;var l=qe("recharts-pie-label-text",typeof n!="boolean"&&!Fe(n)?n.className:"");return I.createElement(lc,md({},s,{alignmentBaseline:"middle",className:l}),o)}}])}(g.PureComponent);Kg=ka;ha(ka,"displayName","Pie");ha(ka,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!xa.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});ha(ka,"parseDeltaAngle",function(e,t){var r=fn(t-e),n=Math.min(Math.abs(t-e),360);return r*n});ha(ka,"getRealPieData",function(e){var t=e.data,r=e.children,n=Ae(e,!1),s=vn(r,Jo);return t&&t.length?t.map(function(i,o){return It(It(It({payload:i},n),i),s&&s[o]&&s[o].props)}):s&&s.length?s.map(function(i){return It(It({},n),i.props)}):[]});ha(ka,"parseCoordinateOfPie",function(e,t){var r=t.top,n=t.left,s=t.width,i=t.height,o=oF(s,i),l=n+hn(e.cx,s,s/2),c=r+hn(e.cy,i,i/2),d=hn(e.innerRadius,o,0),u=hn(e.outerRadius,o,o*.8),f=e.maxRadius||Math.sqrt(s*s+i*i)/2;return{cx:l,cy:c,innerRadius:d,outerRadius:u,maxRadius:f}});ha(ka,"getComposedData",function(e){var t=e.item,r=e.offset,n=t.type.defaultProps!==void 0?It(It({},t.type.defaultProps),t.props):t.props,s=Kg.getRealPieData(n);if(!s||!s.length)return null;var i=n.cornerRadius,o=n.startAngle,l=n.endAngle,c=n.paddingAngle,d=n.dataKey,u=n.nameKey,f=n.valueKey,h=n.tooltipType,m=Math.abs(n.minAngle),v=Kg.parseCoordinateOfPie(n,r),p=Kg.parseDeltaAngle(o,l),x=Math.abs(p),b=d;Le(d)&&Le(f)?(ts(!1,`Use "dataKey" to specify the value of pie,
648 the props "valueKey" will be deprecated in 1.1.0`),b="value"):Le(d)&&(ts(!1,`Use "dataKey" to specify the value of pie, 649 the props "valueKey" will be deprecated in 1.1.0`),b=f);var y=s.filter(function(C){return Vt(C,b,0)!==0}).length,w=(x>=360?y:y-1)*c,_=x-y*m-w,N=s.reduce(function(C,P){var A=Vt(P,b,0);return C+(xe(A)?A:0)},0),j;if(N>0){var S;j=s.map(function(C,P){var A=Vt(C,b,0),D=Vt(C,u,P),F=(xe(A)?A:0)/N,q;P?q=S.endAngle+fn(p)*c*(A!==0?1:0):q=o;var B=q+fn(p)*((A!==0?m:0)+F*_),V=(q+B)/2,E=(v.innerRadius+v.outerRadius)/2,M=[{name:D,value:A,payload:C,dataKey:b,type:h}],T=Lt(v.cx,v.cy,E,V);return S=It(It(It({percent:F,cornerRadius:i,name:D,tooltipPayload:M,midAngle:V,middleRadius:E,tooltipPosition:T},C),v),{},{value:Vt(C,b),startAngle:q,endAngle:B,payload:C,paddingAngle:fn(p)*c}),S})}return It(It({},v),{},{sectors:j,data:s})});var Jje=Math.ceil,Zje=Math.max;function e1e(e,t,r,n){for(var s=-1,i=Zje(Jje((t-e)/(r||1)),0),o=Array(i);i--;)o[n?i:++s]=e,e+=r;return o}var t1e=e1e,r1e=K3,dM=1/0,n1e=17976931348623157e292;function a1e(e){if(!e)return e===0?e:0;if(e=r1e(e),e===dM||e===-dM){var t=e<0?-1:1;return t*n1e}return e===e?e:0}var AF=a1e,s1e=t1e,i1e=vb,Iw=AF;function o1e(e){return function(t,r,n){return n&&typeof n!="number"&&i1e(t,r,n)&&(r=n=void 0),t=Iw(t),r===void 0?(r=t,t=0):r=Iw(r),n=n===void 0?t<r?1:-1:Iw(n),s1e(t,r,n,e)}}var l1e=o1e,c1e=l1e,d1e=c1e(),u1e=d1e;const Ox=mt(u1e);function Em(e){"@babel/helpers - typeof";return Em=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Em(e)}function uM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function fM(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uM(Object(r),!0).forEach(function(n){EF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function EF(e,t,r){return t=f1e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f1e(e){var t=h1e(e,"string");return Em(t)=="symbol"?t:t+""}function h1e(e,t){if(Em(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Em(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var m1e=["Webkit","Moz","O","ms"],p1e=function(t,r){var n=t.replace(/(\w)/,function(i){return i.toUpperCase()}),s=m1e.reduce(function(i,o){return fM(fM({},i),{},EF({},o+n,r))},{});return s[t]=r,s};function bu(e){"@babel/helpers - typeof";return bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bu(e)}function Tx(){return Tx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tx.apply(this,arguments)}function hM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function $w(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hM(Object(r),!0).forEach(function(n){Fn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function g1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mM(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,TF(n.key),n)}}function v1e(e,t,r){return t&&mM(e.prototype,t),r&&mM(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function x1e(e,t,r){return t=Mx(t),y1e(e,OF()?Reflect.construct(t,r||[],Mx(e).constructor):t.apply(e,r))}function y1e(e,t){if(t&&(bu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return b1e(e)}function b1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OF=function(){return!!e})()}
vendor: 145,409 bytes, lines 649-654
649function Mx(e){return Mx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Mx(e)}function w1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nS(e,t)}function nS(e,t){return nS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},nS(e,t)}function Fn(e,t,r){return t=TF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TF(e){var t=j1e(e,"string");return bu(t)=="symbol"?t:t+""}function j1e(e,t){if(bu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(bu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var N1e=function(t){var r=t.data,n=t.startIndex,s=t.endIndex,i=t.x,o=t.width,l=t.travellerWidth;if(!r||!r.length)return{};var c=r.length,d=bh().domain(Ox(0,c)).range([i,i+o-l]),u=d.domain().map(function(f){return d(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:d(n),endX:d(s),scale:d,scaleValues:u}},pM=function(t){return t.changedTouches&&!!t.changedTouches.length},wu=function(e){function t(r){var n;return g1e(this,t),n=x1e(this,t,[r]),Fn(n,"handleDrag",function(s){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(s):n.state.isSlideMoving&&n.handleSlideDrag(s)}),Fn(n,"handleTouchMove",function(s){s.changedTouches!=null&&s.changedTouches.length>0&&n.handleDrag(s.changedTouches[0])}),Fn(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var s=n.props,i=s.endIndex,o=s.onDragEnd,l=s.startIndex;o==null||o({endIndex:i,startIndex:l})}),n.detachDragEndListener()}),Fn(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Fn(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Fn(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Fn(n,"handleSlideDragStart",function(s){var i=pM(s)?s.changedTouches[0]:s;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return w1e(t,e),v1e(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var s=n.startX,i=n.endX,o=this.state.scaleValues,l=this.props,c=l.gap,d=l.data,u=d.length-1,f=Math.min(s,i),h=Math.max(s,i),m=t.getIndexInRange(o,f),v=t.getIndexInRange(o,h);return{startIndex:m-m%c,endIndex:v===u?u:v-v%c}}},{key:"getTextOfTick",value:function(n){var s=this.props,i=s.data,o=s.tickFormatter,l=s.dataKey,c=Vt(i[n],l,n);return Fe(o)?o(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var s=this.state,i=s.slideMoveStartX,o=s.startX,l=s.endX,c=this.props,d=c.x,u=c.width,f=c.travellerWidth,h=c.startIndex,m=c.endIndex,v=c.onChange,p=n.pageX-i;p>0?p=Math.min(p,d+u-f-l,d+u-f-o):p<0&&(p=Math.max(p,d-o,d-l));var x=this.getIndex({startX:o+p,endX:l+p});(x.startIndex!==h||x.endIndex!==m)&&v&&v(x),this.setState({startX:o+p,endX:l+p,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,s){var i=pM(s)?s.changedTouches[0]:s;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var s=this.state,i=s.brushMoveStartX,o=s.movingTravellerId,l=s.endX,c=s.startX,d=this.state[o],u=this.props,f=u.x,h=u.width,m=u.travellerWidth,v=u.onChange,p=u.gap,x=u.data,b={startX:this.state.startX,endX:this.state.endX},y=n.pageX-i;y>0?y=Math.min(y,f+h-m-d):y<0&&(y=Math.max(y,f-d)),b[o]=d+y;var w=this.getIndex(b),_=w.startIndex,N=w.endIndex,j=function(){var C=x.length-1;return o==="startX"&&(l>c?_%p===0:N%p===0)||l<c&&N===C||o==="endX"&&(l>c?N%p===0:_%p===0)||l>c&&N===C};this.setState(Fn(Fn({},o,d+y),"brushMoveStartX",n.pageX),function(){v&&j()&&v(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,s){var i=this,o=this.state,l=o.scaleValues,c=o.startX,d=o.endX,u=this.state[s],f=l.indexOf(u);if(f!==-1){var h=f+n;if(!(h===-1||h>=l.length)){var m=l[h];s==="startX"&&m>=d||s==="endX"&&m<=c||this.setState(Fn({},s,m),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,s=n.x,i=n.y,o=n.width,l=n.height,c=n.fill,d=n.stroke;return I.createElement("rect",{stroke:d,fill:c,x:s,y:i,width:o,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,s=n.x,i=n.y,o=n.width,l=n.height,c=n.data,d=n.children,u=n.padding,f=g.Children.only(d);return f?I.cloneElement(f,{x:s,y:i,width:o,height:l,margin:u,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,s){var i,o,l=this,c=this.props,d=c.y,u=c.travellerWidth,f=c.height,h=c.traveller,m=c.ariaLabel,v=c.data,p=c.startIndex,x=c.endIndex,b=Math.max(n,this.props.x),y=$w($w({},Ae(this.props,!1)),{},{x:b,y:d,width:u,height:f}),w=m||"Min value: ".concat((i=v[p])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=v[x])===null||o===void 0?void 0:o.name);return I.createElement(Xe,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[s],onTouchStart:this.travellerDragStartHandlers[s],onKeyDown:function(N){["ArrowLeft","ArrowRight"].includes(N.key)&&(N.preventDefault(),N.stopPropagation(),l.handleTravellerMoveKeyboard(N.key==="ArrowRight"?1:-1,s))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,y))}},{key:"renderSlide",value:function(n,s){var i=this.props,o=i.y,l=i.height,c=i.stroke,d=i.travellerWidth,u=Math.min(n,s)+d,f=Math.max(Math.abs(s-n)-d,0);return I.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:u,y:o,width:f,height:l})}},{key:"renderText",value:function(){var n=this.props,s=n.startIndex,i=n.endIndex,o=n.y,l=n.height,c=n.travellerWidth,d=n.stroke,u=this.state,f=u.startX,h=u.endX,m=5,v={pointerEvents:"none",fill:d};return I.createElement(Xe,{className:"recharts-brush-texts"},I.createElement(lc,Tx({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-m,y:o+l/2},v),this.getTextOfTick(s)),I.createElement(lc,Tx({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+m,y:o+l/2},v),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,s=n.data,i=n.className,o=n.children,l=n.x,c=n.y,d=n.width,u=n.height,f=n.alwaysShowText,h=this.state,m=h.startX,v=h.endX,p=h.isTextActive,x=h.isSlideMoving,b=h.isTravellerMoving,y=h.isTravellerFocused;if(!s||!s.length||!xe(l)||!xe(c)||!xe(d)||!xe(u)||d<=0||u<=0)return null;var w=qe("recharts-brush",i),_=I.Children.count(o)===1,N=p1e("userSelect","none");return I.createElement(Xe,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:N},this.renderBackground(),_&&this.renderPanorama(),this.renderSlide(m,v),this.renderTravellerLayer(m,"startX"),this.renderTravellerLayer(v,"endX"),(p||x||b||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var s=n.x,i=n.y,o=n.width,l=n.height,c=n.stroke,d=Math.floor(i+l/2)-1;return I.createElement(I.Fragment,null,I.createElement("rect",{x:s,y:i,width:o,height:l,fill:c,stroke:"none"}),I.createElement("line",{x1:s+1,y1:d,x2:s+o-1,y2:d,fill:"none",stroke:"#fff"}),I.createElement("line",{x1:s+1,y1:d+2,x2:s+o-1,y2:d+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,s){var i;return I.isValidElement(n)?i=I.cloneElement(n,s):Fe(n)?i=n(s):i=t.renderDefaultTraveller(s),i}},{key:"getDerivedStateFromProps",value:function(n,s){var i=n.data,o=n.width,l=n.x,c=n.travellerWidth,d=n.updateId,u=n.startIndex,f=n.endIndex;if(i!==s.prevData||d!==s.prevUpdateId)return $w({prevData:i,prevTravellerWidth:c,prevUpdateId:d,prevX:l,prevWidth:o},i&&i.length?N1e({data:i,width:o,x:l,travellerWidth:c,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(s.scale&&(o!==s.prevWidth||l!==s.prevX||c!==s.prevTravellerWidth)){s.scale.range([l,l+o-c]);var h=s.scale.domain().map(function(m){return s.scale(m)});return{prevData:i,prevTravellerWidth:c,prevUpdateId:d,prevX:l,prevWidth:o,startX:s.scale(n.startIndex),endX:s.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,s){for(var i=n.length,o=0,l=i-1;l-o>1;){var c=Math.floor((o+l)/2);n[c]>s?l=c:o=c}return s>=n[l]?l:o}}])}(g.PureComponent);Fn(wu,"displayName","Brush");Fn(wu,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var S1e=zC;function _1e(e,t){var r;return S1e(e,function(n,s,i){return r=t(n,s,i),!r}),!!r}var C1e=_1e,P1e=w3,k1e=Us,A1e=C1e,E1e=Dn,O1e=vb;function T1e(e,t,r){var n=E1e(e)?P1e:A1e;return r&&O1e(e,t,r)&&(t=void 0),n(e,k1e(t))}var M1e=T1e;const I1e=mt(M1e);var Is=function(t,r){var n=t.alwaysShow,s=t.ifOverflow;return n&&(s="extendDomain"),s===r},gM=W3;function $1e(e,t,r){t=="__proto__"&&gM?gM(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var R1e=$1e,D1e=R1e,L1e=z3,F1e=Us;function B1e(e,t){var r={};return t=F1e(t),L1e(e,function(n,s,i){D1e(r,s,t(n,s,i))}),r}var z1e=B1e;const U1e=mt(z1e);function W1e(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}var H1e=W1e,V1e=zC;function q1e(e,t){var r=!0;return V1e(e,function(n,s,i){return r=!!t(n,s,i),r}),r}var G1e=q1e,K1e=H1e,Y1e=G1e,X1e=Us,Q1e=Dn,J1e=vb;function Z1e(e,t,r){var n=Q1e(e)?K1e:Y1e;return r&&J1e(e,t,r)&&(t=void 0),n(e,X1e(t))}var eNe=Z1e;const MF=mt(eNe);var tNe=["x","y"];function Om(e){"@babel/helpers - typeof";return Om=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Om(e)}function aS(){return aS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aS.apply(this,arguments)}function vM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Uf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vM(Object(r),!0).forEach(function(n){rNe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rNe(e,t,r){return t=nNe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nNe(e){var t=aNe(e,"string");return Om(t)=="symbol"?t:t+""}function aNe(e,t){if(Om(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Om(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sNe(e,t){if(e==null)return{};var r=iNe(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function iNe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function oNe(e,t){var r=e.x,n=e.y,s=sNe(e,tNe),i="".concat(r),o=parseInt(i,10),l="".concat(n),c=parseInt(l,10),d="".concat(t.height||s.height),u=parseInt(d,10),f="".concat(t.width||s.width),h=parseInt(f,10);return Uf(Uf(Uf(Uf(Uf({},t),s),o?{x:o}:{}),c?{y:c}:{}),{},{height:u,width:h,name:t.name,radius:t.radius})}function xM(e){return I.createElement(Ax,aS({shapeType:"rectangle",propTransformer:oNe,activeClassName:"recharts-active-bar"},e))}var lNe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,s){if(typeof t=="number")return t;var i=xe(n)||Mne(n);return i?t(n,s):(i||dc(),r)}},cNe=["value","background"],IF;function ju(e){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(e)}function dNe(e,t){if(e==null)return{};var r=uNe(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function uNe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ix(){return Ix=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ix.apply(this,arguments)}function yM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function fr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yM(Object(r),!0).forEach(function(n){vo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bM(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,RF(n.key),n)}}function hNe(e,t,r){return t&&bM(e.prototype,t),r&&bM(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function mNe(e,t,r){return t=$x(t),pNe(e,$F()?Reflect.construct(t,r||[],$x(e).constructor):t.apply(e,r))}function pNe(e,t){if(t&&(ju(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gNe(e)}function gNe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $F(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($F=function(){return!!e})()}function $x(e){return $x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$x(e)}function vNe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sS(e,t)}function sS(e,t){return sS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},sS(e,t)}function vo(e,t,r){return t=RF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RF(e){var t=xNe(e,"string");return ju(t)=="symbol"?t:t+""}function xNe(e,t){if(ju(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ju(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wn=function(e){function t(){var r;fNe(this,t);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return r=mNe(this,t,[].concat(s)),vo(r,"state",{isAnimationFinished:!1}),vo(r,"id",Qo("recharts-bar-")),vo(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),vo(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return vNe(t,e),hNe(t,[{key:"renderRectanglesStatically",value:function(n){var s=this,i=this.props,o=i.shape,l=i.dataKey,c=i.activeIndex,d=i.activeBar,u=Ae(this.props,!1);return n&&n.map(function(f,h){var m=h===c,v=m?d:o,p=fr(fr(fr({},u),f),{},{isActive:m,option:v,index:h,dataKey:l,onAnimationStart:s.handleAnimationStart,onAnimationEnd:s.handleAnimationEnd});return I.createElement(Xe,Ix({className:"recharts-bar-rectangle"},Bo(s.props,f,h),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(h)}),I.createElement(xM,p))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,s=this.props,i=s.data,o=s.layout,l=s.isAnimationActive,c=s.animationBegin,d=s.animationDuration,u=s.animationEasing,f=s.animationId,h=this.state.prevData;return I.createElement(_a,{begin:c,duration:d,isActive:l,easing:u,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var v=m.t,p=i.map(function(x,b){var y=h&&h[b];if(y){var w=rr(y.x,x.x),_=rr(y.y,x.y),N=rr(y.width,x.width),j=rr(y.height,x.height);return fr(fr({},x),{},{x:w(v),y:_(v),width:N(v),height:j(v)})}if(o==="horizontal"){var S=rr(0,x.height),C=S(v);return fr(fr({},x),{},{y:x.y+x.height-C,height:C})}var P=rr(0,x.width),A=P(v);return fr(fr({},x),{},{width:A})});return I.createElement(Xe,null,n.renderRectanglesStatically(p))})}},{key:"renderRectangles",value:function(){var n=this.props,s=n.data,i=n.isAnimationActive,o=this.state.prevData;return i&&s&&s.length&&(!o||!zo(o,s))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(s)}},{key:"renderBackground",value:function(){var n=this,s=this.props,i=s.data,o=s.dataKey,l=s.activeIndex,c=Ae(this.props.background,!1);return i.map(function(d,u){d.value;var f=d.background,h=dNe(d,cNe);if(!f)return null;var m=fr(fr(fr(fr(fr({},h),{},{fill:"#eee"},f),c),Bo(n.props,d,u)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:u,className:"recharts-bar-background-rectangle"});return I.createElement(xM,Ix({key:"background-bar-".concat(u),option:n.props.background,isActive:u===l},m))})}},{key:"renderErrorBar",value:function(n,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,l=i.xAxis,c=i.yAxis,d=i.layout,u=i.children,f=vn(u,mf);if(!f)return null;var h=d==="vertical"?o[0].height/2:o[0].width/2,m=function(x,b){var y=Array.isArray(x.value)?x.value[1]:x.value;return{x:x.x,y:x.y,value:y,errorVal:Vt(x,b)}},v={clipPath:n?"url(#clipPath-".concat(s,")"):null};return I.createElement(Xe,v,f.map(function(p){return I.cloneElement(p,{key:"error-bar-".concat(s,"-").concat(p.props.dataKey),data:o,xAxis:l,yAxis:c,layout:d,offset:h,dataPointFormatter:m})}))}},{key:"render",value:function(){var n=this.props,s=n.hide,i=n.data,o=n.className,l=n.xAxis,c=n.yAxis,d=n.left,u=n.top,f=n.width,h=n.height,m=n.isAnimationActive,v=n.background,p=n.id;if(s||!i||!i.length)return null;var x=this.state.isAnimationFinished,b=qe("recharts-bar",o),y=l&&l.allowDataOverflow,w=c&&c.allowDataOverflow,_=y||w,N=Le(p)?this.id:p;return I.createElement(Xe,{className:b},y||w?I.createElement("defs",null,I.createElement("clipPath",{id:"clipPath-".concat(N)},I.createElement("rect",{x:y?d:d-f/2,y:w?u:u-h/2,width:y?f:f*2,height:w?h:h*2}))):null,I.createElement(Xe,{className:"recharts-bar-rectangles",clipPath:_?"url(#clipPath-".concat(N,")"):null},v?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(_,N),(!m||x)&&rs.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(n,s){return n.animationId!==s.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:s.curData}:n.data!==s.curData?{curData:n.data}:null}}])}(g.PureComponent);IF=Wn;vo(Wn,"displayName","Bar");vo(Wn,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!xa.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});vo(Wn,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,s=e.bandSize,i=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,d=e.stackedData,u=e.dataStartIndex,f=e.displayedData,h=e.offset,m=Jxe(n,r);if(!m)return null;var v=t.layout,p=r.type.defaultProps,x=p!==void 0?fr(fr({},p),r.props):r.props,b=x.dataKey,y=x.children,w=x.minPointSize,_=v==="horizontal"?o:i,N=d?_.scale.domain():null,j=sye({numericAxis:_}),S=vn(y,Jo),C=f.map(function(P,A){var D,F,q,B,V,E;d?D=Zxe(d[u+A],N):(D=Vt(P,b),Array.isArray(D)||(D=[j,D]));var M=lNe(w,IF.defaultProps.minPointSize)(D[1],A);if(v==="horizontal"){var T,L=[o.scale(D[0]),o.scale(D[1])],K=L[0],H=L[1];F=cT({axis:i,ticks:l,bandSize:s,offset:m.offset,entry:P,index:A}),q=(T=H??K)!==null&&T!==void 0?T:void 0,B=m.size;var ee=K-H;if(V=Number.isNaN(ee)?0:ee,E={x:F,y:o.y,width:B,height:o.height},Math.abs(M)>0&&Math.abs(V)<Math.abs(M)){var se=fn(V||M)*(Math.abs(M)-Math.abs(V));q-=se,V+=se}}else{var ne=[i.scale(D[0]),i.scale(D[1])],W=ne[0],ie=ne[1];if(F=W,q=cT({axis:o,ticks:c,bandSize:s,offset:m.offset,entry:P,index:A}),B=ie-W,V=m.size,E={x:i.x,y:q,width:i.width,height:V},Math.abs(M)>0&&Math.abs(B)<Math.abs(M)){var R=fn(B||M)*(Math.abs(M)-Math.abs(B));B+=R}}return fr(fr(fr({},P),{},{x:F,y:q,width:B,height:V,value:d?D:D[1],payload:P,background:E},S&&S[A]&&S[A].props),{},{tooltipPayload:[sF(r,P)],tooltipPosition:{x:F+B/2,y:q+V/2}})});return fr({data:C,layout:v},h)});function Tm(e){"@babel/helpers - typeof";return Tm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tm(e)}function yNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wM(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,DF(n.key),n)}}function bNe(e,t,r){return t&&wM(e.prototype,t),r&&wM(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function jM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ha(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jM(Object(r),!0).forEach(function(n){Ib(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ib(e,t,r){return t=DF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DF(e){var t=wNe(e,"string");return Tm(t)=="symbol"?t:t+""}function wNe(e,t){if(Tm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Tm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var g2=function(t,r,n,s,i){var o=t.width,l=t.height,c=t.layout,d=t.children,u=Object.keys(r),f={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},h=!!zn(d,Wn);return u.reduce(function(m,v){var p=r[v],x=p.orientation,b=p.domain,y=p.padding,w=y===void 0?{}:y,_=p.mirror,N=p.reversed,j="".concat(x).concat(_?"Mirror":""),S,C,P,A,D;if(p.type==="number"&&(p.padding==="gap"||p.padding==="no-gap")){var F=b[1]-b[0],q=1/0,B=p.categoricalDomain.sort(Dne);if(B.forEach(function(ne,W){W>0&&(q=Math.min((ne||0)-(B[W-1]||0),q))}),Number.isFinite(q)){var V=q/F,E=p.layout==="vertical"?n.height:n.width;if(p.padding==="gap"&&(S=V*E/2),p.padding==="no-gap"){var M=hn(t.barCategoryGap,V*E),T=V*E/2;S=T-M-(T-M)/E*M}}}s==="xAxis"?C=[n.left+(w.left||0)+(S||0),n.left+n.width-(w.right||0)-(S||0)]:s==="yAxis"?C=c==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(S||0),n.top+n.height-(w.bottom||0)-(S||0)]:C=p.range,N&&(C=[C[1],C[0]]);var L=tF(p,i,h),K=L.scale,H=L.realScaleType;K.domain(b).range(C),rF(K);var ee=nF(K,Ha(Ha({},p),{},{realScaleType:H}));s==="xAxis"?(D=x==="top"&&!_||x==="bottom"&&_,P=n.left,A=f[j]-D*p.height):s==="yAxis"&&(D=x==="left"&&!_||x==="right"&&_,P=f[j]-D*p.width,A=n.top);var se=Ha(Ha(Ha({},p),ee),{},{realScaleType:H,x:P,y:A,scale:K,width:s==="xAxis"?n.width:p.width,height:s==="yAxis"?n.height:p.height});return se.bandSize=xx(se,ee),!p.hide&&s==="xAxis"?f[j]+=(D?-1:1)*se.height:p.hide||(f[j]+=(D?-1:1)*se.width),Ha(Ha({},m),{},Ib({},v,se))},{})},LF=function(t,r){var n=t.x,s=t.y,i=r.x,o=r.y;return{x:Math.min(n,i),y:Math.min(s,o),width:Math.abs(i-n),height:Math.abs(o-s)}},jNe=function(t){var r=t.x1,n=t.y1,s=t.x2,i=t.y2;return LF({x:r,y:n},{x:s,y:i})},FF=function(){function e(t){yNe(this,e),this.scale=t}return bNe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(s){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),s=n[0],i=n[n.length-1];return s<=i?r>=s&&r<=i:r>=i&&r<=s}}],[{key:"create",value:function(r){return new e(r)}}])}();Ib(FF,"EPS",1e-4);var v2=function(t){var r=Object.keys(t).reduce(function(n,s){return Ha(Ha({},n),{},Ib({},s,FF.create(t[s])))},{});return Ha(Ha({},r),{},{apply:function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,l=i.position;return U1e(s,function(c,d){return r[d].apply(c,{bandAware:o,position:l})})},isInRange:function(s){return MF(s,function(i,o){return r[o].isInRange(i)})}})};function NNe(e){return(e%180+180)%180}var SNe=function(t){var r=t.width,n=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=NNe(s),o=i*Math.PI/180,l=Math.atan(n/r),c=o>l&&o<Math.PI-l?n/Math.sin(o):r/Math.cos(o);return Math.abs(c)},_Ne=Us,CNe=dp,PNe=pb;function kNe(e){return function(t,r,n){var s=Object(t);if(!CNe(t)){var i=_Ne(r);t=PNe(t),r=function(l){return i(s[l],l,s)}}var o=e(t,r,n);return o>-1?s[i?t[o]:o]:void 0}}var ANe=kNe,ENe=AF;function ONe(e){var t=ENe(e),r=t%1;return t===t?r?t-r:t:0}var TNe=ONe,MNe=$3,INe=Us,$Ne=TNe,RNe=Math.max;function DNe(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var s=r==null?0:$Ne(r);return s<0&&(s=RNe(n+s,0)),MNe(e,INe(t),s)}var LNe=DNe,FNe=ANe,BNe=LNe,zNe=FNe(BNe),UNe=zNe;const WNe=mt(UNe);var HNe=Dre(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),x2=g.createContext(void 0),y2=g.createContext(void 0),BF=g.createContext(void 0),zF=g.createContext({}),UF=g.createContext(void 0),WF=g.createContext(0),HF=g.createContext(0),NM=function(t){var r=t.state,n=r.xAxisMap,s=r.yAxisMap,i=r.offset,o=t.clipPathId,l=t.children,c=t.width,d=t.height,u=HNe(i);return I.createElement(x2.Provider,{value:n},I.createElement(y2.Provider,{value:s},I.createElement(zF.Provider,{value:i},I.createElement(BF.Provider,{value:u},I.createElement(UF.Provider,{value:o},I.createElement(WF.Provider,{value:d},I.createElement(HF.Provider,{value:c},l)))))))},VNe=function(){return g.useContext(UF)},VF=function(t){var r=g.useContext(x2);r==null&&dc();var n=r[t];return n==null&&dc(),n},qNe=function(){var t=g.useContext(x2);return to(t)},GNe=function(){var t=g.useContext(y2),r=WNe(t,function(n){return MF(n.domain,Number.isFinite)});return r||to(t)},qF=function(t){var r=g.useContext(y2);r==null&&dc();var n=r[t];return n==null&&dc(),n},KNe=function(){var t=g.useContext(BF);return t},YNe=function(){return g.useContext(zF)},b2=function(){return g.useContext(HF)},w2=function(){return g.useContext(WF)};function Nu(e){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(e)}function XNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QNe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,KF(n.key),n)}}function JNe(e,t,r){return t&&QNe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ZNe(e,t,r){return t=Rx(t),eSe(e,GF()?Reflect.construct(t,r||[],Rx(e).constructor):t.apply(e,r))}function eSe(e,t){if(t&&(Nu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tSe(e)}function tSe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GF=function(){return!!e})()}function Rx(e){return Rx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rx(e)}function rSe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&iS(e,t)}function iS(e,t){return iS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},iS(e,t)}function SM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function _M(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?SM(Object(r),!0).forEach(function(n){j2(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function j2(e,t,r){return t=KF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KF(e){var t=nSe(e,"string");return Nu(t)=="symbol"?t:t+""}function nSe(e,t){if(Nu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Nu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aSe(e,t){return lSe(e)||oSe(e,t)||iSe(e,t)||sSe()}function sSe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 650In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iSe(e,t){if(e){if(typeof e=="string")return CM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return CM(e,t)}}function CM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function oSe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,d=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function lSe(e){if(Array.isArray(e))return e}function oS(){return oS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oS.apply(this,arguments)}var cSe=function(t,r){var n;return I.isValidElement(t)?n=I.cloneElement(t,r):Fe(t)?n=t(r):n=I.createElement("line",oS({},r,{className:"recharts-reference-line-line"})),n},dSe=function(t,r,n,s,i,o,l,c,d){var u=i.x,f=i.y,h=i.width,m=i.height;if(n){var v=d.y,p=t.y.apply(v,{position:o});if(Is(d,"discard")&&!t.y.isInRange(p))return null;var x=[{x:u+h,y:p},{x:u,y:p}];return c==="left"?x.reverse():x}if(r){var b=d.x,y=t.x.apply(b,{position:o});if(Is(d,"discard")&&!t.x.isInRange(y))return null;var w=[{x:y,y:f+m},{x:y,y:f}];return l==="top"?w.reverse():w}if(s){var _=d.segment,N=_.map(function(j){return t.apply(j,{position:o})});return Is(d,"discard")&&I1e(N,function(j){return!t.isInRange(j)})?null:N}return null};function uSe(e){var t=e.x,r=e.y,n=e.segment,s=e.xAxisId,i=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,d=VNe(),u=VF(s),f=qF(i),h=KNe();if(!d||!h)return null;ts(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=v2({x:u.scale,y:f.scale}),v=Sr(t),p=Sr(r),x=n&&n.length===2,b=dSe(m,v,p,x,h,e.position,u.orientation,f.orientation,e);if(!b)return null;var y=aSe(b,2),w=y[0],_=w.x,N=w.y,j=y[1],S=j.x,C=j.y,P=Is(e,"hidden")?"url(#".concat(d,")"):void 0,A=_M(_M({clipPath:P},Ae(e,!0)),{},{x1:_,y1:N,x2:S,y2:C});return I.createElement(Xe,{className:qe("recharts-reference-line",l)},cSe(o,A),Er.renderCallByParent(e,jNe({x1:_,y1:N,x2:S,y2:C})))}var N2=function(e){function t(){return XNe(this,t),ZNe(this,t,arguments)}return rSe(t,e),JNe(t,[{key:"render",value:function(){return I.createElement(uSe,this.props)}}])}(I.Component);j2(N2,"displayName","ReferenceLine");j2(N2,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function lS(){return lS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lS.apply(this,arguments)}function Su(e){"@babel/helpers - typeof";return Su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Su(e)}function PM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function kM(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?PM(Object(r),!0).forEach(function(n){$b(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fSe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hSe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,XF(n.key),n)}}function mSe(e,t,r){return t&&hSe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pSe(e,t,r){return t=Dx(t),gSe(e,YF()?Reflect.construct(t,r||[],Dx(e).constructor):t.apply(e,r))}function gSe(e,t){if(t&&(Su(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vSe(e)}function vSe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(YF=function(){return!!e})()}function Dx(e){return Dx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Dx(e)}function xSe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cS(e,t)}function cS(e,t){return cS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},cS(e,t)}function $b(e,t,r){return t=XF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XF(e){var t=ySe(e,"string");return Su(t)=="symbol"?t:t+""}function ySe(e,t){if(Su(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Su(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bSe=function(t){var r=t.x,n=t.y,s=t.xAxis,i=t.yAxis,o=v2({x:s.scale,y:i.scale}),l=o.apply({x:r,y:n},{bandAware:!0});return Is(t,"discard")&&!o.isInRange(l)?null:l},Rb=function(e){function t(){return fSe(this,t),pSe(this,t,arguments)}return xSe(t,e),mSe(t,[{key:"render",value:function(){var n=this.props,s=n.x,i=n.y,o=n.r,l=n.alwaysShow,c=n.clipPathId,d=Sr(s),u=Sr(i);if(ts(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!d||!u)return null;var f=bSe(this.props);if(!f)return null;var h=f.x,m=f.y,v=this.props,p=v.shape,x=v.className,b=Is(this.props,"hidden")?"url(#".concat(c,")"):void 0,y=kM(kM({clipPath:b},Ae(this.props,!0)),{},{cx:h,cy:m});return I.createElement(Xe,{className:qe("recharts-reference-dot",x)},t.renderDot(p,y),Er.renderCallByParent(this.props,{x:h-o,y:m-o,width:2*o,height:2*o}))}}])}(I.Component);$b(Rb,"displayName","ReferenceDot");$b(Rb,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});$b(Rb,"renderDot",function(e,t){var r;return I.isValidElement(e)?r=I.cloneElement(e,t):Fe(e)?r=e(t):r=I.createElement(pp,lS({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function dS(){return dS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dS.apply(this,arguments)}function _u(e){"@babel/helpers - typeof";return _u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_u(e)}function AM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function EM(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?AM(Object(r),!0).forEach(function(n){Db(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):AM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wSe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jSe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,JF(n.key),n)}}function NSe(e,t,r){return t&&jSe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function SSe(e,t,r){return t=Lx(t),_Se(e,QF()?Reflect.construct(t,r||[],Lx(e).constructor):t.apply(e,r))}function _Se(e,t){if(t&&(_u(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return CSe(e)}function CSe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(QF=function(){return!!e})()}function Lx(e){return Lx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lx(e)}function PSe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uS(e,t)}function uS(e,t){return uS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},uS(e,t)}function Db(e,t,r){return t=JF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JF(e){var t=kSe(e,"string");return _u(t)=="symbol"?t:t+""}function kSe(e,t){if(_u(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(_u(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ASe=function(t,r,n,s,i){var o=i.x1,l=i.x2,c=i.y1,d=i.y2,u=i.xAxis,f=i.yAxis;if(!u||!f)return null;var h=v2({x:u.scale,y:f.scale}),m={x:t?h.x.apply(o,{position:"start"}):h.x.rangeMin,y:n?h.y.apply(c,{position:"start"}):h.y.rangeMin},v={x:r?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:s?h.y.apply(d,{position:"end"}):h.y.rangeMax};return Is(i,"discard")&&(!h.isInRange(m)||!h.isInRange(v))?null:LF(m,v)},Lb=function(e){function t(){return wSe(this,t),SSe(this,t,arguments)}return PSe(t,e),NSe(t,[{key:"render",value:function(){var n=this.props,s=n.x1,i=n.x2,o=n.y1,l=n.y2,c=n.className,d=n.alwaysShow,u=n.clipPathId;ts(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Sr(s),h=Sr(i),m=Sr(o),v=Sr(l),p=this.props.shape;if(!f&&!h&&!m&&!v&&!p)return null;var x=ASe(f,h,m,v,this.props);if(!x&&!p)return null;var b=Is(this.props,"hidden")?"url(#".concat(u,")"):void 0;return I.createElement(Xe,{className:qe("recharts-reference-area",c)},t.renderRect(p,EM(EM({clipPath:b},Ae(this.props,!0)),x)),Er.renderCallByParent(this.props,x))}}])}(I.Component);Db(Lb,"displayName","ReferenceArea");Db(Lb,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Db(Lb,"renderRect",function(e,t){var r;return I.isValidElement(e)?r=I.cloneElement(e,t):Fe(e)?r=e(t):r=I.createElement(p2,dS({},t,{className:"recharts-reference-area-rect"})),r});function ZF(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],s=0;s<e.length;s+=t)n.push(e[s]);return n}function ESe(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return SNe(n,r)}function OSe(e,t,r){var n=r==="width",s=e.x,i=e.y,o=e.width,l=e.height;return t===1?{start:n?s:i,end:n?s+o:i+l}:{start:n?s+o:i+l,end:n?s:i}}function Fx(e,t,r,n,s){if(e*t<e*n||e*t>e*s)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-s)<=0}function TSe(e,t){return ZF(e,t+1)}function MSe(e,t,r,n,s){for(var i=(n||[]).slice(),o=t.start,l=t.end,c=0,d=1,u=o,f=function(){var v=n==null?void 0:n[c];if(v===void 0)return{v:ZF(n,d)};var p=c,x,b=function(){return x===void 0&&(x=r(v,p)),x},y=v.coordinate,w=c===0||Fx(e,y,b,u,l);w||(c=0,u=o,d+=1),w&&(u=y+e*(b()/2+s),c+=d)},h;d<=i.length;)if(h=f(),h)return h.v;return[]}function Mm(e){"@babel/helpers - typeof";return Mm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mm(e)}function OM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Qr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OM(Object(r),!0).forEach(function(n){ISe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ISe(e,t,r){return t=$Se(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $Se(e){var t=RSe(e,"string");return Mm(t)=="symbol"?t:t+""}function RSe(e,t){if(Mm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Mm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DSe(e,t,r,n,s){for(var i=(n||[]).slice(),o=i.length,l=t.start,c=t.end,d=function(h){var m=i[h],v,p=function(){return v===void 0&&(v=r(m,h)),v};if(h===o-1){var x=e*(m.coordinate+e*p()/2-c);i[h]=m=Qr(Qr({},m),{},{tickCoord:x>0?m.coordinate-x*e:m.coordinate})}else i[h]=m=Qr(Qr({},m),{},{tickCoord:m.coordinate});var b=Fx(e,m.tickCoord,p,l,c);b&&(c=m.tickCoord-e*(p()/2+s),i[h]=Qr(Qr({},m),{},{isShow:!0}))},u=o-1;u>=0;u--)d(u);return i}function LSe(e,t,r,n,s,i){var o=(n||[]).slice(),l=o.length,c=t.start,d=t.end;if(i){var u=n[l-1],f=r(u,l-1),h=e*(u.coordinate+e*f/2-d);o[l-1]=u=Qr(Qr({},u),{},{tickCoord:h>0?u.coordinate-h*e:u.coordinate});var m=Fx(e,u.tickCoord,function(){return f},c,d);m&&(d=u.tickCoord-e*(f/2+s),o[l-1]=Qr(Qr({},u),{},{isShow:!0}))}for(var v=i?l-1:l,p=function(y){var w=o[y],_,N=function(){return _===void 0&&(_=r(w,y)),_};if(y===0){var j=e*(w.coordinate-e*N()/2-c);o[y]=w=Qr(Qr({},w),{},{tickCoord:j<0?w.coordinate-j*e:w.coordinate})}else o[y]=w=Qr(Qr({},w),{},{tickCoord:w.coordinate});var S=Fx(e,w.tickCoord,N,c,d);S&&(c=w.tickCoord+e*(N()/2+s),o[y]=Qr(Qr({},w),{},{isShow:!0}))},x=0;x<v;x++)p(x);return o}function S2(e,t,r){var n=e.tick,s=e.ticks,i=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,d=e.tickFormatter,u=e.unit,f=e.angle;if(!s||!s.length||!n)return[];if(xe(c)||xa.isSsr)return TSe(s,typeof c=="number"&&xe(c)?c:0);var h=[],m=l==="top"||l==="bottom"?"width":"height",v=u&&m==="width"?yh(u,{fontSize:t,letterSpacing:r}):{width:0,height:0},p=function(w,_){var N=Fe(d)?d(w.value,_):w.value;return m==="width"?ESe(yh(N,{fontSize:t,letterSpacing:r}),v,f):yh(N,{fontSize:t,letterSpacing:r})[m]},x=s.length>=2?fn(s[1].coordinate-s[0].coordinate):1,b=OSe(i,x,m);return c==="equidistantPreserveStart"?MSe(x,b,p,s,o):(c==="preserveStart"||c==="preserveStartEnd"?h=LSe(x,b,p,s,o,c==="preserveStartEnd"):h=DSe(x,b,p,s,o),h.filter(function(y){return y.isShow}))}var FSe=["viewBox"],BSe=["viewBox"],zSe=["ticks"];function Cu(e){"@babel/helpers - typeof";return Cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cu(e)}function pd(){return pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pd.apply(this,arguments)}function TM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function xr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?TM(Object(r),!0).forEach(function(n){_2(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):TM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rw(e,t){if(e==null)return{};var r=USe(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function USe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function WSe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MM(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,t6(n.key),n)}}function HSe(e,t,r){return t&&MM(e.prototype,t),r&&MM(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function VSe(e,t,r){return t=Bx(t),qSe(e,e6()?Reflect.construct(t,r||[],Bx(e).constructor):t.apply(e,r))}function qSe(e,t){if(t&&(Cu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GSe(e)}function GSe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function e6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(e6=function(){return!!e})()}function Bx(e){return Bx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bx(e)}function KSe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fS(e,t)}function fS(e,t){return fS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},fS(e,t)}function _2(e,t,r){return t=t6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t6(e){var t=YSe(e,"string");return Cu(t)=="symbol"?t:t+""}function YSe(e,t){if(Cu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Cu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pf=function(e){function t(r){var n;return WSe(this,t),n=VSe(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return KSe(t,e),HSe(t,[{key:"shouldComponentUpdate",value:function(n,s){var i=n.viewBox,o=Rw(n,FSe),l=this.props,c=l.viewBox,d=Rw(l,BSe);return!kd(i,c)||!kd(o,d)||!kd(s,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var s=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];s&&this.setState({fontSize:window.getComputedStyle(s).fontSize,letterSpacing:window.getComputedStyle(s).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var s=this.props,i=s.x,o=s.y,l=s.width,c=s.height,d=s.orientation,u=s.tickSize,f=s.mirror,h=s.tickMargin,m,v,p,x,b,y,w=f?-1:1,_=n.tickSize||u,N=xe(n.tickCoord)?n.tickCoord:n.coordinate;switch(d){case"top":m=v=n.coordinate,x=o+ +!f*c,p=x-w*_,y=p-w*h,b=N;break;case"left":p=x=n.coordinate,v=i+ +!f*l,m=v-w*_,b=m-w*h,y=N;break;case"right":p=x=n.coordinate,v=i+ +f*l,m=v+w*_,b=m+w*h,y=N;break;default:m=v=n.coordinate,x=o+ +f*c,p=x+w*_,y=p+w*h,b=N;break}return{line:{x1:m,y1:p,x2:v,y2:x},tick:{x:b,y}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,s=n.orientation,i=n.mirror,o;switch(s){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,s=n.orientation,i=n.mirror,o="end";switch(s){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var n=this.props,s=n.x,i=n.y,o=n.width,l=n.height,c=n.orientation,d=n.mirror,u=n.axisLine,f=xr(xr(xr({},Ae(this.props,!1)),Ae(u,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!d||c==="bottom"&&d);f=xr(xr({},f),{},{x1:s,y1:i+h*l,x2:s+o,y2:i+h*l})}else{var m=+(c==="left"&&!d||c==="right"&&d);f=xr(xr({},f),{},{x1:s+m*o,y1:i,x2:s+m*o,y2:i+l})}return I.createElement("line",pd({},f,{className:qe("recharts-cartesian-axis-line",Yn(u,"className"))}))}},{key:"renderTicks",value:function(n,s,i){var o=this,l=this.props,c=l.tickLine,d=l.stroke,u=l.tick,f=l.tickFormatter,h=l.unit,m=S2(xr(xr({},this.props),{},{ticks:n}),s,i),v=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),x=Ae(this.props,!1),b=Ae(u,!1),y=xr(xr({},x),{},{fill:"none"},Ae(c,!1)),w=m.map(function(_,N){var j=o.getTickLineCoord(_),S=j.line,C=j.tick,P=xr(xr(xr(xr({textAnchor:v,verticalAnchor:p},x),{},{stroke:"none",fill:d},b),C),{},{index:N,payload:_,visibleTicksCount:m.length,tickFormatter:f});return I.createElement(Xe,pd({className:"recharts-cartesian-axis-tick",key:"tick-".concat(_.value,"-").concat(_.coordinate,"-").concat(_.tickCoord)},Bo(o.props,_,N)),c&&I.createElement("line",pd({},y,S,{className:qe("recharts-cartesian-axis-tick-line",Yn(c,"className"))})),u&&t.renderTickItem(u,P,"".concat(Fe(f)?f(_.value,N):_.value).concat(h||"")))});return I.createElement("g",{className:"recharts-cartesian-axis-ticks"},w)}},{key:"render",value:function(){var n=this,s=this.props,i=s.axisLine,o=s.width,l=s.height,c=s.ticksGenerator,d=s.className,u=s.hide;if(u)return null;var f=this.props,h=f.ticks,m=Rw(f,zSe),v=h;return Fe(c)&&(v=h&&h.length>0?c(this.props):c(m)),o<=0||l<=0||!v||!v.length?null:I.createElement(Xe,{className:qe("recharts-cartesian-axis",d),ref:function(x){n.layerReference=x}},i&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),Er.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,s,i){var o,l=qe(s.className,"recharts-cartesian-axis-tick-value");return I.isValidElement(n)?o=I.cloneElement(n,xr(xr({},s),{},{className:l})):Fe(n)?o=n(xr(xr({},s),{},{className:l})):o=I.createElement(lc,pd({},s,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])}(g.Component);_2(pf,"displayName","CartesianAxis");_2(pf,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var XSe=["x1","y1","x2","y2","key"],QSe=["offset"];function uc(e){"@babel/helpers - typeof";return uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uc(e)}function IM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Zr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?IM(Object(r),!0).forEach(function(n){JSe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):IM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function JSe(e,t,r){return t=ZSe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZSe(e){var t=e_e(e,"string");return uc(t)=="symbol"?t:t+""}function e_e(e,t){if(uc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(uc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ml(){return Ml=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ml.apply(this,arguments)}function $M(e,t){if(e==null)return{};var r=t_e(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function t_e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var r_e=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,s=t.x,i=t.y,o=t.width,l=t.height,c=t.ry;return I.createElement("rect",{x:s,y:i,ry:c,width:o,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function r6(e,t){var r;if(I.isValidElement(e))r=I.cloneElement(e,t);else if(Fe(e))r=e(t);else{var n=t.x1,s=t.y1,i=t.x2,o=t.y2,l=t.key,c=$M(t,XSe),d=Ae(c,!1);d.offset;var u=$M(d,QSe);r=I.createElement("line",Ml({},u,{x1:n,y1:s,x2:i,y2:o,fill:"none",key:l}))}return r}function n_e(e){var t=e.x,r=e.width,n=e.horizontal,s=n===void 0?!0:n,i=e.horizontalPoints;if(!s||!i||!i.length)return null;var o=i.map(function(l,c){var d=Zr(Zr({},e),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return r6(s,d)});return I.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function a_e(e){var t=e.y,r=e.height,n=e.vertical,s=n===void 0?!0:n,i=e.verticalPoints;if(!s||!i||!i.length)return null;var o=i.map(function(l,c){var d=Zr(Zr({},e),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return r6(s,d)});return I.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function s_e(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,s=e.y,i=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,d=c===void 0?!0:c;if(!d||!t||!t.length)return null;var u=l.map(function(h){return Math.round(h+s-s)}).sort(function(h,m){return h-m});s!==u[0]&&u.unshift(0);var f=u.map(function(h,m){var v=!u[m+1],p=v?s+o-h:u[m+1]-h;if(p<=0)return null;var x=m%t.length;return I.createElement("rect",{key:"react-".concat(m),y:h,x:n,height:p,width:i,stroke:"none",fill:t[x],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return I.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function i_e(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,s=e.fillOpacity,i=e.x,o=e.y,l=e.width,c=e.height,d=e.verticalPoints;if(!r||!n||!n.length)return null;var u=d.map(function(h){return Math.round(h+i-i)}).sort(function(h,m){return h-m});i!==u[0]&&u.unshift(0);var f=u.map(function(h,m){var v=!u[m+1],p=v?i+l-h:u[m+1]-h;if(p<=0)return null;var x=m%n.length;return I.createElement("rect",{key:"react-".concat(m),x:h,y:o,width:p,height:c,stroke:"none",fill:n[x],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return I.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var o_e=function(t,r){var n=t.xAxis,s=t.width,i=t.height,o=t.offset;return eF(S2(Zr(Zr(Zr({},pf.defaultProps),n),{},{ticks:oi(n,!0),viewBox:{x:0,y:0,width:s,height:i}})),o.left,o.left+o.width,r)},l_e=function(t,r){var n=t.yAxis,s=t.width,i=t.height,o=t.offset;return eF(S2(Zr(Zr(Zr({},pf.defaultProps),n),{},{ticks:oi(n,!0),viewBox:{x:0,y:0,width:s,height:i}})),o.top,o.top+o.height,r)},Uc={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Il(e){var t,r,n,s,i,o,l=b2(),c=w2(),d=YNe(),u=Zr(Zr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Uc.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Uc.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Uc.horizontal,horizontalFill:(s=e.horizontalFill)!==null&&s!==void 0?s:Uc.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:Uc.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Uc.verticalFill,x:xe(e.x)?e.x:d.left,y:xe(e.y)?e.y:d.top,width:xe(e.width)?e.width:d.width,height:xe(e.height)?e.height:d.height}),f=u.x,h=u.y,m=u.width,v=u.height,p=u.syncWithTicks,x=u.horizontalValues,b=u.verticalValues,y=qNe(),w=GNe();if(!xe(m)||m<=0||!xe(v)||v<=0||!xe(f)||f!==+f||!xe(h)||h!==+h)return null;var _=u.verticalCoordinatesGenerator||o_e,N=u.horizontalCoordinatesGenerator||l_e,j=u.horizontalPoints,S=u.verticalPoints;if((!j||!j.length)&&Fe(N)){var C=x&&x.length,P=N({yAxis:w?Zr(Zr({},w),{},{ticks:C?x:w.ticks}):void 0,width:l,height:c,offset:d},C?!0:p);ts(Array.isArray(P),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(uc(P),"]")),Array.isArray(P)&&(j=P)}if((!S||!S.length)&&Fe(_)){var A=b&&b.length,D=_({xAxis:y?Zr(Zr({},y),{},{ticks:A?b:y.ticks}):void 0,width:l,height:c,offset:d},A?!0:p);ts(Array.isArray(D),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(uc(D),"]")),Array.isArray(D)&&(S=D)}return I.createElement("g",{className:"recharts-cartesian-grid"},I.createElement(r_e,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height,ry:u.ry}),I.createElement(n_e,Ml({},u,{offset:d,horizontalPoints:j,xAxis:y,yAxis:w})),I.createElement(a_e,Ml({},u,{offset:d,verticalPoints:S,xAxis:y,yAxis:w})),I.createElement(s_e,Ml({},u,{horizontalPoints:j})),I.createElement(i_e,Ml({},u,{verticalPoints:S})))}Il.displayName="CartesianGrid";var c_e=["type","layout","connectNulls","ref"],d_e=["key"];function Pu(e){"@babel/helpers - typeof";return Pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pu(e)}function RM(e,t){if(e==null)return{};var r=u_e(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function u_e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _h(){return _h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_h.apply(this,arguments)}function DM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ln(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DM(Object(r),!0).forEach(function(n){Va(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wc(e){return p_e(e)||m_e(e)||h_e(e)||f_e()}function f_e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 651In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h_e(e,t){if(e){if(typeof e=="string")return hS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hS(e,t)}}function m_e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function p_e(e){if(Array.isArray(e))return hS(e)}function hS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function g_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LM(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a6(n.key),n)}}function v_e(e,t,r){return t&&LM(e.prototype,t),r&&LM(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function x_e(e,t,r){return t=zx(t),y_e(e,n6()?Reflect.construct(t,r||[],zx(e).constructor):t.apply(e,r))}function y_e(e,t){if(t&&(Pu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return b_e(e)}function b_e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(n6=function(){return!!e})()}function zx(e){return zx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zx(e)}function w_e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mS(e,t)}function mS(e,t){return mS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},mS(e,t)}function Va(e,t,r){return t=a6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a6(e){var t=j_e(e,"string");return Pu(t)=="symbol"?t:t+""}function j_e(e,t){if(Pu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Pu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _i=function(e){function t(){var r;g_e(this,t);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return r=x_e(this,t,[].concat(s)),Va(r,"state",{isAnimationFinished:!0,totalLength:0}),Va(r,"generateSimpleStrokeDasharray",function(o,l){return"".concat(l,"px ").concat(o-l,"px")}),Va(r,"getStrokeDasharray",function(o,l,c){var d=c.reduce(function(b,y){return b+y});if(!d)return r.generateSimpleStrokeDasharray(l,o);for(var u=Math.floor(o/d),f=o%d,h=l-o,m=[],v=0,p=0;v<c.length;p+=c[v],++v)if(p+c[v]>f){m=[].concat(Wc(c.slice(0,v)),[f-p]);break}var x=m.length%2===0?[0,h]:[h];return[].concat(Wc(t.repeat(c,u)),Wc(m),x).map(function(b){return"".concat(b,"px")}).join(", ")}),Va(r,"id",Qo("recharts-line-")),Va(r,"pathRef",function(o){r.mainCurve=o}),Va(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Va(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return w_e(t,e),v_e(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,l=i.xAxis,c=i.yAxis,d=i.layout,u=i.children,f=vn(u,mf);if(!f)return null;var h=function(p,x){return{x:p.x,y:p.y,value:p.value,errorVal:Vt(p.payload,x)}},m={clipPath:n?"url(#clipPath-".concat(s,")"):null};return I.createElement(Xe,m,f.map(function(v){return I.cloneElement(v,{key:"bar-".concat(v.props.dataKey),data:o,xAxis:l,yAxis:c,layout:d,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,s,i){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,d=l.points,u=l.dataKey,f=Ae(this.props,!1),h=Ae(c,!0),m=d.map(function(p,x){var b=Ln(Ln(Ln({key:"dot-".concat(x),r:3},f),h),{},{index:x,cx:p.x,cy:p.y,value:p.value,dataKey:u,payload:p.payload,points:d});return t.renderDotItem(c,b)}),v={clipPath:n?"url(#clipPath-".concat(s?"":"dots-").concat(i,")"):null};return I.createElement(Xe,_h({className:"recharts-line-dots",key:"dots"},v),m)}},{key:"renderCurveStatically",value:function(n,s,i,o){var l=this.props,c=l.type,d=l.layout,u=l.connectNulls;l.ref;var f=RM(l,c_e),h=Ln(Ln(Ln({},Ae(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:s?"url(#clipPath-".concat(i,")"):null,points:n},o),{},{type:c,layout:d,connectNulls:u});return I.createElement(Oo,_h({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,s){var i=this,o=this.props,l=o.points,c=o.strokeDasharray,d=o.isAnimationActive,u=o.animationBegin,f=o.animationDuration,h=o.animationEasing,m=o.animationId,v=o.animateNewValues,p=o.width,x=o.height,b=this.state,y=b.prevPoints,w=b.totalLength;return I.createElement(_a,{begin:u,duration:f,isActive:d,easing:h,from:{t:0},to:{t:1},key:"line-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(_){var N=_.t;if(y){var j=y.length/l.length,S=l.map(function(F,q){var B=Math.floor(q*j);if(y[B]){var V=y[B],E=rr(V.x,F.x),M=rr(V.y,F.y);return Ln(Ln({},F),{},{x:E(N),y:M(N)})}if(v){var T=rr(p*2,F.x),L=rr(x/2,F.y);return Ln(Ln({},F),{},{x:T(N),y:L(N)})}return Ln(Ln({},F),{},{x:F.x,y:F.y})});return i.renderCurveStatically(S,n,s)}var C=rr(0,w),P=C(N),A;if(c){var D="".concat(c).split(/[,\s]+/gim).map(function(F){return parseFloat(F)});A=i.getStrokeDasharray(P,w,D)}else A=i.generateSimpleStrokeDasharray(w,P);return i.renderCurveStatically(l,n,s,{strokeDasharray:A})})}},{key:"renderCurve",value:function(n,s){var i=this.props,o=i.points,l=i.isAnimationActive,c=this.state,d=c.prevPoints,u=c.totalLength;return l&&o&&o.length&&(!d&&u>0||!zo(d,o))?this.renderCurveWithAnimation(n,s):this.renderCurveStatically(o,n,s)}},{key:"render",value:function(){var n,s=this.props,i=s.hide,o=s.dot,l=s.points,c=s.className,d=s.xAxis,u=s.yAxis,f=s.top,h=s.left,m=s.width,v=s.height,p=s.isAnimationActive,x=s.id;if(i||!l||!l.length)return null;var b=this.state.isAnimationFinished,y=l.length===1,w=qe("recharts-line",c),_=d&&d.allowDataOverflow,N=u&&u.allowDataOverflow,j=_||N,S=Le(x)?this.id:x,C=(n=Ae(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},P=C.r,A=P===void 0?3:P,D=C.strokeWidth,F=D===void 0?2:D,q=q5(o)?o:{},B=q.clipDot,V=B===void 0?!0:B,E=A*2+F;return I.createElement(Xe,{className:w},_||N?I.createElement("defs",null,I.createElement("clipPath",{id:"clipPath-".concat(S)},I.createElement("rect",{x:_?h:h-m/2,y:N?f:f-v/2,width:_?m:m*2,height:N?v:v*2})),!V&&I.createElement("clipPath",{id:"clipPath-dots-".concat(S)},I.createElement("rect",{x:h-E/2,y:f-E/2,width:m+E,height:v+E}))):null,!y&&this.renderCurve(j,S),this.renderErrorBar(j,S),(y||o)&&this.renderDots(j,V,S),(!p||b)&&rs.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,s){return n.animationId!==s.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:s.curPoints}:n.points!==s.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,s){for(var i=n.length%2!==0?[].concat(Wc(n),[0]):n,o=[],l=0;l<s;++l)o=[].concat(Wc(o),Wc(i));return o}},{key:"renderDotItem",value:function(n,s){var i;if(I.isValidElement(n))i=I.cloneElement(n,s);else if(Fe(n))i=n(s);else{var o=s.key,l=RM(s,d_e),c=qe("recharts-line-dot",typeof n!="boolean"?n.className:"");i=I.createElement(pp,_h({key:o},l,{className:c}))}return i}}])}(g.PureComponent);Va(_i,"displayName","Line");Va(_i,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!xa.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Va(_i,"getComposedData",function(e){var t=e.props,r=e.xAxis,n=e.yAxis,s=e.xAxisTicks,i=e.yAxisTicks,o=e.dataKey,l=e.bandSize,c=e.displayedData,d=e.offset,u=t.layout,f=c.map(function(h,m){var v=Vt(h,o);return u==="horizontal"?{x:pu({axis:r,ticks:s,bandSize:l,entry:h,index:m}),y:Le(v)?null:n.scale(v),value:v,payload:h}:{x:Le(v)?null:r.scale(v),y:pu({axis:n,ticks:i,bandSize:l,entry:h,index:m}),value:v,payload:h}});return Ln({points:f,layout:u},d)});var N_e=["layout","type","stroke","connectNulls","isRange","ref"],S_e=["key"],s6;function ku(e){"@babel/helpers - typeof";return ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ku(e)}function i6(e,t){if(e==null)return{};var r=__e(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function __e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function $l(){return $l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$l.apply(this,arguments)}function FM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function qi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?FM(Object(r),!0).forEach(function(n){Cs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function C_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BM(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l6(n.key),n)}}function P_e(e,t,r){return t&&BM(e.prototype,t),r&&BM(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function k_e(e,t,r){return t=Ux(t),A_e(e,o6()?Reflect.construct(t,r||[],Ux(e).constructor):t.apply(e,r))}function A_e(e,t){if(t&&(ku(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return E_e(e)}function E_e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(o6=function(){return!!e})()}function Ux(e){return Ux=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ux(e)}function O_e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pS(e,t)}function pS(e,t){return pS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},pS(e,t)}function Cs(e,t,r){return t=l6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l6(e){var t=T_e(e,"string");return ku(t)=="symbol"?t:t+""}function T_e(e,t){if(ku(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ku(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rl=function(e){function t(){var r;C_e(this,t);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return r=k_e(this,t,[].concat(s)),Cs(r,"state",{isAnimationFinished:!0}),Cs(r,"id",Qo("recharts-area-")),Cs(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Fe(o)&&o()}),Cs(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Fe(o)&&o()}),r}return O_e(t,e),P_e(t,[{key:"renderDots",value:function(n,s,i){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var c=this.props,d=c.dot,u=c.points,f=c.dataKey,h=Ae(this.props,!1),m=Ae(d,!0),v=u.map(function(x,b){var y=qi(qi(qi({key:"dot-".concat(b),r:3},h),m),{},{index:b,cx:x.x,cy:x.y,dataKey:f,value:x.value,payload:x.payload,points:u});return t.renderDotItem(d,y)}),p={clipPath:n?"url(#clipPath-".concat(s?"":"dots-").concat(i,")"):null};return I.createElement(Xe,$l({className:"recharts-area-dots"},p),v)}},{key:"renderHorizontalRect",value:function(n){var s=this.props,i=s.baseLine,o=s.points,l=s.strokeWidth,c=o[0].x,d=o[o.length-1].x,u=n*Math.abs(c-d),f=go(o.map(function(h){return h.y||0}));return xe(i)&&typeof i=="number"?f=Math.max(i,f):i&&Array.isArray(i)&&i.length&&(f=Math.max(go(i.map(function(h){return h.y||0})),f)),xe(f)?I.createElement("rect",{x:c<d?c:c-u,y:0,width:u,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var s=this.props,i=s.baseLine,o=s.points,l=s.strokeWidth,c=o[0].y,d=o[o.length-1].y,u=n*Math.abs(c-d),f=go(o.map(function(h){return h.x||0}));return xe(i)&&typeof i=="number"?f=Math.max(i,f):i&&Array.isArray(i)&&i.length&&(f=Math.max(go(i.map(function(h){return h.x||0})),f)),xe(f)?I.createElement("rect",{x:0,y:c<d?c:c-u,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(u)}):null}},{key:"renderClipRect",value:function(n){var s=this.props.layout;return s==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,s,i,o){var l=this.props,c=l.layout,d=l.type,u=l.stroke,f=l.connectNulls,h=l.isRange;l.ref;var m=i6(l,N_e);return I.createElement(Xe,{clipPath:i?"url(#clipPath-".concat(o,")"):null},I.createElement(Oo,$l({},Ae(m,!0),{points:n,connectNulls:f,type:d,baseLine:s,layout:c,stroke:"none",className:"recharts-area-area"})),u!=="none"&&I.createElement(Oo,$l({},Ae(this.props,!1),{className:"recharts-area-curve",layout:c,type:d,connectNulls:f,fill:"none",points:n})),u!=="none"&&h&&I.createElement(Oo,$l({},Ae(this.props,!1),{className:"recharts-area-curve",layout:c,type:d,connectNulls:f,fill:"none",points:s})))}},{key:"renderAreaWithAnimation",value:function(n,s){var i=this,o=this.props,l=o.points,c=o.baseLine,d=o.isAnimationActive,u=o.animationBegin,f=o.animationDuration,h=o.animationEasing,m=o.animationId,v=this.state,p=v.prevPoints,x=v.prevBaseLine;return I.createElement(_a,{begin:u,duration:f,isActive:d,easing:h,from:{t:0},to:{t:1},key:"area-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(b){var y=b.t;if(p){var w=p.length/l.length,_=l.map(function(C,P){var A=Math.floor(P*w);if(p[A]){var D=p[A],F=rr(D.x,C.x),q=rr(D.y,C.y);return qi(qi({},C),{},{x:F(y),y:q(y)})}return C}),N;if(xe(c)&&typeof c=="number"){var j=rr(x,c);N=j(y)}else if(Le(c)||of(c)){var S=rr(x,0);N=S(y)}else N=c.map(function(C,P){var A=Math.floor(P*w);if(x[A]){var D=x[A],F=rr(D.x,C.x),q=rr(D.y,C.y);return qi(qi({},C),{},{x:F(y),y:q(y)})}return C});return i.renderAreaStatically(_,N,n,s)}return I.createElement(Xe,null,I.createElement("defs",null,I.createElement("clipPath",{id:"animationClipPath-".concat(s)},i.renderClipRect(y))),I.createElement(Xe,{clipPath:"url(#animationClipPath-".concat(s,")")},i.renderAreaStatically(l,c,n,s)))})}},{key:"renderArea",value:function(n,s){var i=this.props,o=i.points,l=i.baseLine,c=i.isAnimationActive,d=this.state,u=d.prevPoints,f=d.prevBaseLine,h=d.totalLength;return c&&o&&o.length&&(!u&&h>0||!zo(u,o)||!zo(f,l))?this.renderAreaWithAnimation(n,s):this.renderAreaStatically(o,l,n,s)}},{key:"render",value:function(){var n,s=this.props,i=s.hide,o=s.dot,l=s.points,c=s.className,d=s.top,u=s.left,f=s.xAxis,h=s.yAxis,m=s.width,v=s.height,p=s.isAnimationActive,x=s.id;if(i||!l||!l.length)return null;var b=this.state.isAnimationFinished,y=l.length===1,w=qe("recharts-area",c),_=f&&f.allowDataOverflow,N=h&&h.allowDataOverflow,j=_||N,S=Le(x)?this.id:x,C=(n=Ae(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},P=C.r,A=P===void 0?3:P,D=C.strokeWidth,F=D===void 0?2:D,q=q5(o)?o:{},B=q.clipDot,V=B===void 0?!0:B,E=A*2+F;return I.createElement(Xe,{className:w},_||N?I.createElement("defs",null,I.createElement("clipPath",{id:"clipPath-".concat(S)},I.createElement("rect",{x:_?u:u-m/2,y:N?d:d-v/2,width:_?m:m*2,height:N?v:v*2})),!V&&I.createElement("clipPath",{id:"clipPath-dots-".concat(S)},I.createElement("rect",{x:u-E/2,y:d-E/2,width:m+E,height:v+E}))):null,y?null:this.renderArea(j,S),(o||y)&&this.renderDots(j,V,S),(!p||b)&&rs.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,s){return n.animationId!==s.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:s.curPoints,prevBaseLine:s.curBaseLine}:n.points!==s.curPoints||n.baseLine!==s.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(g.PureComponent);s6=rl;Cs(rl,"displayName","Area");Cs(rl,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!xa.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Cs(rl,"getBaseValue",function(e,t,r,n){var s=e.layout,i=e.baseValue,o=t.props.baseValue,l=o??i;if(xe(l)&&typeof l=="number")return l;var c=s==="horizontal"?n:r,d=c.scale.domain();if(c.type==="number"){var u=Math.max(d[0],d[1]),f=Math.min(d[0],d[1]);return l==="dataMin"?f:l==="dataMax"||u<0?u:Math.max(Math.min(d[0],d[1]),0)}return l==="dataMin"?d[0]:l==="dataMax"?d[1]:d[0]});Cs(rl,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,s=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,d=e.stackedData,u=e.dataStartIndex,f=e.displayedData,h=e.offset,m=t.layout,v=d&&d.length,p=s6.getBaseValue(t,r,n,s),x=m==="horizontal",b=!1,y=f.map(function(_,N){var j;v?j=d[u+N]:(j=Vt(_,c),Array.isArray(j)?b=!0:j=[p,j]);var S=j[1]==null||v&&Vt(_,c)==null;return x?{x:pu({axis:n,ticks:i,bandSize:l,entry:_,index:N}),y:S?null:s.scale(j[1]),value:j,payload:_}:{x:S?null:n.scale(j[1]),y:pu({axis:s,ticks:o,bandSize:l,entry:_,index:N}),value:j,payload:_}}),w;return v||b?w=y.map(function(_){var N=Array.isArray(_.value)?_.value[0]:null;return x?{x:_.x,y:N!=null&&_.y!=null?s.scale(N):null}:{x:N!=null?n.scale(N):null,y:_.y}}):w=x?s.scale(p):n.scale(p),qi({points:y,baseLine:w,layout:m,isRange:b},h)});Cs(rl,"renderDotItem",function(e,t){var r;if(I.isValidElement(e))r=I.cloneElement(e,t);else if(Fe(e))r=e(t);else{var n=qe("recharts-area-dot",typeof e!="boolean"?e.className:""),s=t.key,i=i6(t,S_e);r=I.createElement(pp,$l({},i,{key:s,className:n}))}return r});function Au(e){"@babel/helpers - typeof";return Au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Au(e)}function M_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I_e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u6(n.key),n)}}function $_e(e,t,r){return t&&I_e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function R_e(e,t,r){return t=Wx(t),D_e(e,c6()?Reflect.construct(t,r||[],Wx(e).constructor):t.apply(e,r))}function D_e(e,t){if(t&&(Au(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return L_e(e)}function L_e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(c6=function(){return!!e})()}function Wx(e){return Wx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wx(e)}function F_e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gS(e,t)}function gS(e,t){return gS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},gS(e,t)}function d6(e,t,r){return t=u6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u6(e){var t=B_e(e,"string");return Au(t)=="symbol"?t:t+""}function B_e(e,t){if(Au(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Au(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fb=function(e){function t(){return M_e(this,t),R_e(this,t,arguments)}return F_e(t,e),$_e(t,[{key:"render",value:function(){return null}}])}(g.Component);d6(Fb,"displayName","ZAxis");d6(Fb,"defaultProps",{zAxisId:0,range:[64,64],scale:"auto",type:"number"});var z_e=["option","isActive"];function Ch(){return Ch=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ch.apply(this,arguments)}function U_e(e,t){if(e==null)return{};var r=W_e(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function W_e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function H_e(e){var t=e.option,r=e.isActive,n=U_e(e,z_e);return typeof t=="string"?g.createElement(Ax,Ch({option:g.createElement(mb,Ch({type:t},n)),isActive:r,shapeType:"symbols"},n)):g.createElement(Ax,Ch({option:t,isActive:r,shapeType:"symbols"},n))}function Eu(e){"@babel/helpers - typeof";return Eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Eu(e)}function Ph(){return Ph=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ph.apply(this,arguments)}function zM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function la(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zM(Object(r),!0).forEach(function(n){xo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function V_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UM(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,h6(n.key),n)}}function q_e(e,t,r){return t&&UM(e.prototype,t),r&&UM(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function G_e(e,t,r){return t=Hx(t),K_e(e,f6()?Reflect.construct(t,r||[],Hx(e).constructor):t.apply(e,r))}function K_e(e,t){if(t&&(Eu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Y_e(e)}function Y_e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(f6=function(){return!!e})()}function Hx(e){return Hx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Hx(e)}function X_e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vS(e,t)}function vS(e,t){return vS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},vS(e,t)}function xo(e,t,r){return t=h6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h6(e){var t=Q_e(e,"string");return Eu(t)=="symbol"?t:t+""}function Q_e(e,t){if(Eu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Eu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bb=function(e){function t(){var r;V_e(this,t);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return r=G_e(this,t,[].concat(s)),xo(r,"state",{isAnimationFinished:!1}),xo(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0})}),xo(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1})}),xo(r,"id",Qo("recharts-scatter-")),r}return X_e(t,e),q_e(t,[{key:"renderSymbolsStatically",value:function(n){var s=this,i=this.props,o=i.shape,l=i.activeShape,c=i.activeIndex,d=Ae(this.props,!1);return n.map(function(u,f){var h=c===f,m=h?l:o,v=la(la({},d),u);return I.createElement(Xe,Ph({className:"recharts-scatter-symbol",key:"symbol-".concat(u==null?void 0:u.cx,"-").concat(u==null?void 0:u.cy,"-").concat(u==null?void 0:u.size,"-").concat(f)},Bo(s.props,u,f),{role:"img"}),I.createElement(H_e,Ph({option:m,isActive:h,key:"symbol-".concat(f)},v)))})}},{key:"renderSymbolsWithAnimation",value:function(){var n=this,s=this.props,i=s.points,o=s.isAnimationActive,l=s.animationBegin,c=s.animationDuration,d=s.animationEasing,u=s.animationId,f=this.state.prevPoints;return I.createElement(_a,{begin:l,duration:c,isActive:o,easing:d,from:{t:0},to:{t:1},key:"pie-".concat(u),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(h){var m=h.t,v=i.map(function(p,x){var b=f&&f[x];if(b){var y=rr(b.cx,p.cx),w=rr(b.cy,p.cy),_=rr(b.size,p.size);return la(la({},p),{},{cx:y(m),cy:w(m),size:_(m)})}var N=rr(0,p.size);return la(la({},p),{},{size:N(m)})});return I.createElement(Xe,null,n.renderSymbolsStatically(v))})}},{key:"renderSymbols",value:function(){var n=this.props,s=n.points,i=n.isAnimationActive,o=this.state.prevPoints;return i&&s&&s.length&&(!o||!zo(o,s))?this.renderSymbolsWithAnimation():this.renderSymbolsStatically(s)}},{key:"renderErrorBar",value:function(){var n=this.props.isAnimationActive;if(n&&!this.state.isAnimationFinished)return null;var s=this.props,i=s.points,o=s.xAxis,l=s.yAxis,c=s.children,d=vn(c,mf);return d?d.map(function(u,f){var h=u.props,m=h.direction,v=h.dataKey;return I.cloneElement(u,{key:"".concat(m,"-").concat(v,"-").concat(i[f]),data:i,xAxis:o,yAxis:l,layout:m==="x"?"vertical":"horizontal",dataPointFormatter:function(x,b){return{x:x.cx,y:x.cy,value:m==="x"?+x.node.x:+x.node.y,errorVal:Vt(x,b)}}})}):null}},{key:"renderLine",value:function(){var n=this.props,s=n.points,i=n.line,o=n.lineType,l=n.lineJointType,c=Ae(this.props,!1),d=Ae(i,!1),u,f;if(o==="joint")u=s.map(function(w){return{x:w.cx,y:w.cy}});else if(o==="fitting"){var h=Rne(s),m=h.xmin,v=h.xmax,p=h.a,x=h.b,b=function(_){return p*_+x};u=[{x:m,y:b(m)},{x:v,y:b(v)}]}var y=la(la(la({},c),{},{fill:"none",stroke:c&&c.fill},d),{},{points:u});return I.isValidElement(i)?f=I.cloneElement(i,y):Fe(i)?f=i(y):f=I.createElement(Oo,Ph({},y,{type:l})),I.createElement(Xe,{className:"recharts-scatter-line",key:"recharts-scatter-line"},f)}},{key:"render",value:function(){var n=this.props,s=n.hide,i=n.points,o=n.line,l=n.className,c=n.xAxis,d=n.yAxis,u=n.left,f=n.top,h=n.width,m=n.height,v=n.id,p=n.isAnimationActive;if(s||!i||!i.length)return null;var x=this.state.isAnimationFinished,b=qe("recharts-scatter",l),y=c&&c.allowDataOverflow,w=d&&d.allowDataOverflow,_=y||w,N=Le(v)?this.id:v;return I.createElement(Xe,{className:b,clipPath:_?"url(#clipPath-".concat(N,")"):null},y||w?I.createElement("defs",null,I.createElement("clipPath",{id:"clipPath-".concat(N)},I.createElement("rect",{x:y?u:u-h/2,y:w?f:f-m/2,width:y?h:h*2,height:w?m:m*2}))):null,o&&this.renderLine(),this.renderErrorBar(),I.createElement(Xe,{key:"recharts-scatter-symbols"},this.renderSymbols()),(!p||x)&&rs.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(n,s){return n.animationId!==s.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:s.curPoints}:n.points!==s.curPoints?{curPoints:n.points}:null}}])}(g.PureComponent);xo(Bb,"displayName","Scatter");xo(Bb,"defaultProps",{xAxisId:0,yAxisId:0,zAxisId:0,legendType:"circle",lineType:"joint",lineJointType:"linear",data:[],shape:"circle",hide:!1,isAnimationActive:!xa.isSsr,animationBegin:0,animationDuration:400,animationEasing:"linear"});xo(Bb,"getComposedData",function(e){var t=e.xAxis,r=e.yAxis,n=e.zAxis,s=e.item,i=e.displayedData,o=e.xAxisTicks,l=e.yAxisTicks,c=e.offset,d=s.props.tooltipType,u=vn(s.props.children,Jo),f=Le(t.dataKey)?s.props.dataKey:t.dataKey,h=Le(r.dataKey)?s.props.dataKey:r.dataKey,m=n&&n.dataKey,v=n?n.range:Fb.defaultProps.range,p=v&&v[0],x=t.scale.bandwidth?t.scale.bandwidth():0,b=r.scale.bandwidth?r.scale.bandwidth():0,y=i.map(function(w,_){var N=Vt(w,f),j=Vt(w,h),S=!Le(m)&&Vt(w,m)||"-",C=[{name:Le(t.dataKey)?s.props.name:t.name||t.dataKey,unit:t.unit||"",value:N,payload:w,dataKey:f,type:d},{name:Le(r.dataKey)?s.props.name:r.name||r.dataKey,unit:r.unit||"",value:j,payload:w,dataKey:h,type:d}];S!=="-"&&C.push({name:n.name||n.dataKey,unit:n.unit||"",value:S,payload:w,dataKey:m,type:d});var P=pu({axis:t,ticks:o,bandSize:x,entry:w,index:_,dataKey:f}),A=pu({axis:r,ticks:l,bandSize:b,entry:w,index:_,dataKey:h}),D=S!=="-"?n.scale(S):p,F=Math.sqrt(Math.max(D,0)/Math.PI);return la(la({},w),{},{cx:P,cy:A,x:P-F,y:A-F,xAxis:t,yAxis:r,zAxis:n,width:2*F,height:2*F,size:D,node:{x:N,y:j,z:S},tooltipPayload:C,tooltipPosition:{x:P,y:A},payload:w},u&&u[_]&&u[_].props)});return la({points:y},c)});function Ou(e){"@babel/helpers - typeof";return Ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ou(e)}function J_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z_e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,g6(n.key),n)}}function eCe(e,t,r){return t&&Z_e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function tCe(e,t,r){return t=Vx(t),rCe(e,m6()?Reflect.construct(t,r||[],Vx(e).constructor):t.apply(e,r))}function rCe(e,t){if(t&&(Ou(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nCe(e)}function nCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(m6=function(){return!!e})()}function Vx(e){return Vx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vx(e)}function aCe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xS(e,t)}function xS(e,t){return xS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},xS(e,t)}function p6(e,t,r){return t=g6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g6(e){var t=sCe(e,"string");return Ou(t)=="symbol"?t:t+""}function sCe(e,t){if(Ou(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ou(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yS(){return yS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yS.apply(this,arguments)}function iCe(e){var t=e.xAxisId,r=b2(),n=w2(),s=VF(t);return s==null?null:g.createElement(pf,yS({},s,{className:qe("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return oi(o,!0)}}))}var Xa=function(e){function t(){return J_e(this,t),tCe(this,t,arguments)}return aCe(t,e),eCe(t,[{key:"render",value:function(){return g.createElement(iCe,this.props)}}])}(g.Component);p6(Xa,"displayName","XAxis");p6(Xa,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function Tu(e){"@babel/helpers - typeof";return Tu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tu(e)}function oCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lCe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,y6(n.key),n)}}function cCe(e,t,r){return t&&lCe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function dCe(e,t,r){return t=qx(t),uCe(e,v6()?Reflect.construct(t,r||[],qx(e).constructor):t.apply(e,r))}function uCe(e,t){if(t&&(Tu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fCe(e)}function fCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(v6=function(){return!!e})()}function qx(e){return qx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qx(e)}function hCe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bS(e,t)}function bS(e,t){return bS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},bS(e,t)}function x6(e,t,r){return t=y6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y6(e){var t=mCe(e,"string");return Tu(t)=="symbol"?t:t+""}function mCe(e,t){if(Tu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Tu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wS(){return wS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wS.apply(this,arguments)}var pCe=function(t){var r=t.yAxisId,n=b2(),s=w2(),i=qF(r);return i==null?null:g.createElement(pf,wS({},i,{className:qe("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:s},ticksGenerator:function(l){return oi(l,!0)}}))},Hn=function(e){function t(){return oCe(this,t),dCe(this,t,arguments)}return hCe(t,e),cCe(t,[{key:"render",value:function(){return g.createElement(pCe,this.props)}}])}(g.Component);x6(Hn,"displayName","YAxis");x6(Hn,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function WM(e){return yCe(e)||xCe(e)||vCe(e)||gCe()}function gCe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 652In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vCe(e,t){if(e){if(typeof e=="string")return jS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jS(e,t)}}function xCe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yCe(e){if(Array.isArray(e))return jS(e)}function jS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var NS=function(t,r,n,s,i){var o=vn(t,N2),l=vn(t,Rb),c=[].concat(WM(o),WM(l)),d=vn(t,Lb),u="".concat(s,"Id"),f=s[0],h=r;if(c.length&&(h=c.reduce(function(p,x){if(x.props[u]===n&&Is(x.props,"extendDomain")&&xe(x.props[f])){var b=x.props[f];return[Math.min(p[0],b),Math.max(p[1],b)]}return p},h)),d.length){var m="".concat(f,"1"),v="".concat(f,"2");h=d.reduce(function(p,x){if(x.props[u]===n&&Is(x.props,"extendDomain")&&xe(x.props[m])&&xe(x.props[v])){var b=x.props[m],y=x.props[v];return[Math.min(p[0],b,y),Math.max(p[1],b,y)]}return p},h)}return i&&i.length&&(h=i.reduce(function(p,x){return xe(x)?[Math.min(p[0],x),Math.max(p[1],x)]:p},h)),h},b6={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(c,d,u){this.fn=c,this.context=d,this.once=u||!1}function i(c,d,u,f,h){if(typeof u!="function")throw new TypeError("The listener must be a function");var m=new s(u,f||c,h),v=r?r+d:d;return c._events[v]?c._events[v].fn?c._events[v]=[c._events[v],m]:c._events[v].push(m):(c._events[v]=m,c._eventsCount++),c}function o(c,d){--c._eventsCount===0?c._events=new n:delete c._events[d]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],u,f;if(this._eventsCount===0)return d;for(f in u=this._events)t.call(u,f)&&d.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(u)):d},l.prototype.listeners=function(d){var u=r?r+d:d,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,m=f.length,v=new Array(m);h<m;h++)v[h]=f[h].fn;return v},l.prototype.listenerCount=function(d){var u=r?r+d:d,f=this._events[u];return f?f.fn?1:f.length:0},l.prototype.emit=function(d,u,f,h,m,v){var p=r?r+d:d;if(!this._events[p])return!1;var x=this._events[p],b=arguments.length,y,w;if(x.fn){switch(x.once&&this.removeListener(d,x.fn,void 0,!0),b){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,u),!0;case 3:return x.fn.call(x.context,u,f),!0;case 4:return x.fn.call(x.context,u,f,h),!0;case 5:return x.fn.call(x.context,u,f,h,m),!0;case 6:return x.fn.call(x.context,u,f,h,m,v),!0}for(w=1,y=new Array(b-1);w<b;w++)y[w-1]=arguments[w];x.fn.apply(x.context,y)}else{var _=x.length,N;for(w=0;w<_;w++)switch(x[w].once&&this.removeListener(d,x[w].fn,void 0,!0),b){case 1:x[w].fn.call(x[w].context);break;case 2:x[w].fn.call(x[w].context,u);break;case 3:x[w].fn.call(x[w].context,u,f);break;case 4:x[w].fn.call(x[w].context,u,f,h);break;default:if(!y)for(N=1,y=new Array(b-1);N<b;N++)y[N-1]=arguments[N];x[w].fn.apply(x[w].context,y)}}return!0},l.prototype.on=function(d,u,f){return i(this,d,u,f,!1)},l.prototype.once=function(d,u,f){return i(this,d,u,f,!0)},l.prototype.removeListener=function(d,u,f,h){var m=r?r+d:d;if(!this._events[m])return this;if(!u)return o(this,m),this;var v=this._events[m];if(v.fn)v.fn===u&&(!h||v.once)&&(!f||v.context===f)&&o(this,m);else{for(var p=0,x=[],b=v.length;p<b;p++)(v[p].fn!==u||h&&!v[p].once||f&&v[p].context!==f)&&x.push(v[p]);x.length?this._events[m]=x.length===1?x[0]:x:o(this,m)}return this},l.prototype.removeAllListeners=function(d){var u;return d?(u=r?r+d:d,this._events[u]&&o(this,u)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(b6);var bCe=b6.exports;const wCe=mt(bCe);var Dw=new wCe,Lw="recharts.syncMouseEvents";function Im(e){"@babel/helpers - typeof";return Im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Im(e)}function jCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NCe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,w6(n.key),n)}}function SCe(e,t,r){return t&&NCe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fw(e,t,r){return t=w6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w6(e){var t=_Ce(e,"string");return Im(t)=="symbol"?t:t+""}function _Ce(e,t){if(Im(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Im(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var CCe=function(){function e(){jCe(this,e),Fw(this,"activeIndex",0),Fw(this,"coordinateList",[]),Fw(this,"layout","horizontal")}return SCe(e,[{key:"setDetails",value:function(r){var n,s=r.coordinateList,i=s===void 0?null:s,o=r.container,l=o===void 0?null:o,c=r.layout,d=c===void 0?null:c,u=r.offset,f=u===void 0?null:u,h=r.mouseHandlerCallback,m=h===void 0?null:h;this.coordinateList=(n=i??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=d??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=m??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var s=this.container.getBoundingClientRect(),i=s.x,o=s.y,l=s.height,c=this.coordinateList[this.activeIndex].coordinate,d=((r=window)===null||r===void 0?void 0:r.scrollX)||0,u=((n=window)===null||n===void 0?void 0:n.scrollY)||0,f=i+c+d,h=o+this.offset.top+l/2+u;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function PCe(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],s=e==null?void 0:e[1];if(n&&s&&xe(n)&&xe(s))return!0}return!1}function kCe(e,t,r,n){var s=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-s,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function j6(e){var t=e.cx,r=e.cy,n=e.radius,s=e.startAngle,i=e.endAngle,o=Lt(t,r,n,s),l=Lt(t,r,n,i);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:s,endAngle:i}}function ACe(e,t,r){var n,s,i,o;if(e==="horizontal")n=t.x,i=n,s=r.top,o=r.top+r.height;else if(e==="vertical")s=t.y,o=s,n=r.left,i=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,d=t.innerRadius,u=t.outerRadius,f=t.angle,h=Lt(l,c,d,f),m=Lt(l,c,u,f);n=h.x,s=h.y,i=m.x,o=m.y}else return j6(t);return[{x:n,y:s},{x:i,y:o}]}function $m(e){"@babel/helpers - typeof";return $m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$m(e)}function HM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function wg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HM(Object(r),!0).forEach(function(n){ECe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ECe(e,t,r){return t=OCe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OCe(e){var t=TCe(e,"string");return $m(t)=="symbol"?t:t+""}function TCe(e,t){if($m(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if($m(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function MCe(e){var t,r,n=e.element,s=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,d=e.activeTooltipIndex,u=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,m=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!m||!i||!o||h!=="ScatterChart"&&s!=="axis")return null;var v,p=Oo;if(h==="ScatterChart")v=o,p=jwe;else if(h==="BarChart")v=kCe(f,o,c,u),p=p2;else if(f==="radial"){var x=j6(o),b=x.cx,y=x.cy,w=x.radius,_=x.startAngle,N=x.endAngle;v={cx:b,cy:y,startAngle:_,endAngle:N,innerRadius:w,outerRadius:w},p=uF}else v={points:ACe(f,o,c)},p=Oo;var j=wg(wg(wg(wg({stroke:"#ccc",pointerEvents:"none"},c),v),Ae(m,!1)),{},{payload:l,payloadIndex:d,className:qe("recharts-tooltip-cursor",m.className)});return g.isValidElement(m)?g.cloneElement(m,j):g.createElement(p,j)}var ICe=["item"],$Ce=["children","className","width","height","style","compact","title","desc"];function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}function gd(){return gd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gd.apply(this,arguments)}function VM(e,t){return LCe(e)||DCe(e,t)||S6(e,t)||RCe()}function RCe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 653In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DCe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,d=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(u){d=!0,s=u}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function LCe(e){if(Array.isArray(e))return e}function qM(e,t){if(e==null)return{};var r=FCe(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function FCe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function BCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zCe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_6(n.key),n)}}function UCe(e,t,r){return t&&zCe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function WCe(e,t,r){return t=Gx(t),HCe(e,N6()?Reflect.construct(t,r||[],Gx(e).constructor):t.apply(e,r))}function HCe(e,t){if(t&&(Mu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return VCe(e)}function VCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(N6=function(){return!!e})()}function Gx(e){return Gx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Gx(e)}function qCe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&SS(e,t)}function SS(e,t){return SS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},SS(e,t)}function Iu(e){return YCe(e)||KCe(e)||S6(e)||GCe()}function GCe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 654In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S6(e,t){if(e){if(typeof e=="string")return _S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _S(e,t)}}function KCe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function YCe(e){if(Array.isArray(e))return _S(e)}function _S(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function GM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function he(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?GM(Object(r),!0).forEach(function(n){Be(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):GM(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Be(e,t,r){return t=_6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _6(e){var t=XCe(e,"string");return Mu(t)=="symbol"?t:t+""}function XCe(e,t){if(Mu(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Mu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var QCe={xAxis:["bottom","top"],yAxis:["left","right"]},JCe={width:"100%",height:"100%"},C6={x:0,y:0};function jg(e){return e}var ZCe=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},e2e=function(t,r,n,s){var i=r.find(function(u){return u&&u.index===n});if(i){if(t==="horizontal")return{x:i.coordinate,y:s.y};if(t==="vertical")return{x:s.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,l=s.radius;return he(he(he({},s),Lt(s.cx,s.cy,l,o)),{},{angle:o,radius:l})}var c=i.coordinate,d=s.angle;return he(he(he({},s),Lt(s.cx,s.cy,c,d)),{},{angle:d,radius:c})}return C6},zb=function(t,r){var n=r.graphicalItems,s=r.dataStartIndex,i=r.dataEndIndex,o=(n??[]).reduce(function(l,c){var d=c.props.data;return d&&d.length?[].concat(Iu(l),Iu(d)):l},[]);return o.length>0?o:t&&t.length&&xe(s)&&xe(i)?t.slice(s,i+1):[]};function P6(e){return e==="number"?[0,"auto"]:void 0}var CS=function(t,r,n,s){var i=t.graphicalItems,o=t.tooltipAxis,l=zb(r,t);return n<0||!i||!i.length||n>=l.length?null:i.reduce(function(c,d){var u,f=(u=d.props.data)!==null&&u!==void 0?u:r;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var m=f===void 0?l:f;h=Hv(m,o.dataKey,s)}else h=f&&f[n]||l[n];return h?[].concat(Iu(c),[sF(d,h)]):c},[])},KM=function(t,r,n,s){var i=s||{x:t.chartX,y:t.chartY},o=ZCe(i,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,d=t.tooltipTicks,u=qxe(o,l,d,c);if(u>=0&&d){var f=d[u]&&d[u].value,h=CS(t,r,u,f),m=e2e(n,l,u,i);return{activeTooltipIndex:u,activeLabel:f,activePayload:h,activeCoordinate:m}}return null},t2e=function(t,r){var n=r.axes,s=r.graphicalItems,i=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,d=r.dataEndIndex,u=t.layout,f=t.children,h=t.stackOffset,m=ZL(u,i);return n.reduce(function(v,p){var x,b=p.type.defaultProps!==void 0?he(he({},p.type.defaultProps),p.props):p.props,y=b.type,w=b.dataKey,_=b.allowDataOverflow,N=b.allowDuplicatedCategory,j=b.scale,S=b.ticks,C=b.includeHidden,P=b[o];if(v[P])return v;var A=zb(t.data,{graphicalItems:s.filter(function(ee){var se,ne=o in ee.props?ee.props[o]:(se=ee.type.defaultProps)===null||se===void 0?void 0:se[o];return ne===P}),dataStartIndex:c,dataEndIndex:d}),D=A.length,F,q,B;PCe(b.domain,_,y)&&(F=DN(b.domain,null,_),m&&(y==="number"||j!=="auto")&&(B=wh(A,w,"category")));var V=P6(y);if(!F||F.length===0){var E,M=(E=b.domain)!==null&&E!==void 0?E:V;if(w){if(F=wh(A,w,y),y==="category"&&m){var T=$ne(F);N&&T?(q=F,F=Ox(0,D)):N||(F=fT(M,F,p).reduce(function(ee,se){return ee.indexOf(se)>=0?ee:[].concat(Iu(ee),[se])},[]))}else if(y==="category")N?F=F.filter(function(ee){return ee!==""&&!Le(ee)}):F=fT(M,F,p).reduce(function(ee,se){return ee.indexOf(se)>=0||se===""||Le(se)?ee:[].concat(Iu(ee),[se])},[]);else if(y==="number"){var L=Qxe(A,s.filter(function(ee){var se,ne,W=o in ee.props?ee.props[o]:(se=ee.type.defaultProps)===null||se===void 0?void 0:se[o],ie="hide"in ee.props?ee.props.hide:(ne=ee.type.defaultProps)===null||ne===void 0?void 0:ne.hide;return W===P&&(C||!ie)}),w,i,u);L&&(F=L)}m&&(y==="number"||j!=="auto")&&(B=wh(A,w,"category"))}else m?F=Ox(0,D):l&&l[P]&&l[P].hasStack&&y==="number"?F=h==="expand"?[0,1]:aF(l[P].stackGroups,c,d):F=JL(A,s.filter(function(ee){var se=o in ee.props?ee.props[o]:ee.type.defaultProps[o],ne="hide"in ee.props?ee.props.hide:ee.type.defaultProps.hide;return se===P&&(C||!ne)}),y,u,!0);if(y==="number")F=NS(f,F,P,i,S),M&&(F=DN(M,F,_));else if(y==="category"&&M){var K=M,H=F.every(function(ee){return K.indexOf(ee)>=0});H&&(F=K)}}return he(he({},v),{},Be({},P,he(he({},b),{},{axisType:i,domain:F,categoricalDomain:B,duplicateDomain:q,originalDomain:(x=b.domain)!==null&&x!==void 0?x:V,isCategorical:m,layout:u})))},{})},r2e=function(t,r){var n=r.graphicalItems,s=r.Axis,i=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,d=r.dataEndIndex,u=t.layout,f=t.children,h=zb(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:d}),m=h.length,v=ZL(u,i),p=-1;return n.reduce(function(x,b){var y=b.type.defaultProps!==void 0?he(he({},b.type.defaultProps),b.props):b.props,w=y[o],_=P6("number");if(!x[w]){p++;var N;return v?N=Ox(0,m):l&&l[w]&&l[w].hasStack?(N=aF(l[w].stackGroups,c,d),N=NS(f,N,w,i)):(N=DN(_,JL(h,n.filter(function(j){var S,C,P=o in j.props?j.props[o]:(S=j.type.defaultProps)===null||S===void 0?void 0:S[o],A="hide"in j.props?j.props.hide:(C=j.type.defaultProps)===null||C===void 0?void 0:C.hide;return P===w&&!A}),"number",u),s.defaultProps.allowDataOverflow),N=NS(f,N,w,i)),he(he({},x),{},Be({},w,he(he({axisType:i},s.defaultProps),{},{hide:!0,orientation:Yn(QCe,"".concat(i,".").concat(p%2),null),domain:N,originalDomain:_,isCategorical:v,layout:u})))}return x},{})},n2e=function(t,r){var n=r.axisType,s=n===void 0?"xAxis":n,i=r.AxisComp,o=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,d=r.dataEndIndex,u=t.children,f="".concat(s,"Id"),h=vn(u,i),m={};return h&&h.length?m=t2e(t,{axes:h,graphicalItems:o,axisType:s,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:d}):o&&o.length&&(m=r2e(t,{Axis:i,graphicalItems:o,axisType:s,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:d})),m},a2e=function(t){var r=to(t),n=oi(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:UC(n,function(s){return s.coordinate}),tooltipAxis:r,tooltipAxisBandSize:xx(r,n)}},YM=function(t){var r=t.children,n=t.defaultShowTooltip,s=zn(r,wu),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),s&&s.props&&(s.props.startIndex>=0&&(i=s.props.startIndex),s.props.endIndex>=0&&(o=s.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},s2e=function(t){return!t||!t.length?!1:t.some(function(r){var n=ui(r&&r.type);return n&&n.indexOf("Bar")>=0})},XM=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},i2e=function(t,r){var n=t.props,s=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,l=t.yAxisMap,c=l===void 0?{}:l,d=n.width,u=n.height,f=n.children,h=n.margin||{},m=zn(f,wu),v=zn(f,Ao),p=Object.keys(c).reduce(function(N,j){var S=c[j],C=S.orientation;return!S.mirror&&!S.hide?he(he({},N),{},Be({},C,N[C]+S.width)):N},{left:h.left||0,right:h.right||0}),x=Object.keys(o).reduce(function(N,j){var S=o[j],C=S.orientation;return!S.mirror&&!S.hide?he(he({},N),{},Be({},C,Yn(N,"".concat(C))+S.height)):N},{top:h.top||0,bottom:h.bottom||0}),b=he(he({},x),p),y=b.bottom;m&&(b.bottom+=m.props.height||wu.defaultProps.height),v&&r&&(b=Yxe(b,s,n,r));var w=d-b.left-b.right,_=u-b.top-b.bottom;return he(he({brushBottom:y},b),{},{width:Math.max(w,0),height:Math.max(_,0)})},o2e=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Ub=function(t){var r=t.chartName,n=t.GraphicalChild,s=t.defaultTooltipEventType,i=s===void 0?"axis":s,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,d=t.legendContent,u=t.formatAxisMap,f=t.defaultProps,h=function(b,y){var w=y.graphicalItems,_=y.stackGroups,N=y.offset,j=y.updateId,S=y.dataStartIndex,C=y.dataEndIndex,P=b.barSize,A=b.layout,D=b.barGap,F=b.barCategoryGap,q=b.maxBarSize,B=XM(A),V=B.numericAxisName,E=B.cateAxisName,M=s2e(w),T=[];return w.forEach(function(L,K){var H=zb(b.data,{graphicalItems:[L],dataStartIndex:S,dataEndIndex:C}),ee=L.type.defaultProps!==void 0?he(he({},L.type.defaultProps),L.props):L.props,se=ee.dataKey,ne=ee.maxBarSize,W=ee["".concat(V,"Id")],ie=ee["".concat(E,"Id")],R={},O=c.reduce(function(Ze,Y){var _e=y["".concat(Y.axisType,"Map")],Oe=ee["".concat(Y.axisType,"Id")];_e&&_e[Oe]||Y.axisType==="zAxis"||dc();var Ee=_e[Oe];return he(he({},Ze),{},Be(Be({},Y.axisType,Ee),"".concat(Y.axisType,"Ticks"),oi(Ee)))},R),k=O[E],G=O["".concat(E,"Ticks")],te=_&&_[W]&&_[W].hasStack&&iye(L,_[W].stackGroups),$=ui(L.type).indexOf("Bar")>=0,ae=xx(k,G),oe=[],z=M&&Gxe({barSize:P,stackGroups:_,totalSize:o2e(O,E)});if($){var fe,ue,Ne=Le(ne)?q:ne,He=(fe=(ue=xx(k,G,!0))!==null&&ue!==void 0?ue:Ne)!==null&&fe!==void 0?fe:0;oe=Kxe({barGap:D,barCategoryGap:F,bandSize:He!==ae?He:ae,sizeList:z[ie],maxBarSize:Ne}),He!==ae&&(oe=oe.map(function(Ze){return he(he({},Ze),{},{position:he(he({},Ze.position),{},{offset:Ze.position.offset-He/2})})}))}var ke=L&&L.type&&L.type.getComposedData;ke&&T.push({props:he(he({},ke(he(he({},O),{},{displayedData:H,props:b,dataKey:se,item:L,bandSize:ae,barPosition:oe,offset:N,stackedData:te,layout:A,dataStartIndex:S,dataEndIndex:C}))),{},Be(Be(Be({key:L.key||"item-".concat(K)},V,O[V]),E,O[E]),"animationId",j)),childIndex:Kne(L,b.children),item:L})}),T},m=function(b,y){var w=b.props,_=b.dataStartIndex,N=b.dataEndIndex,j=b.updateId;if(!iE({props:w}))return null;var S=w.children,C=w.layout,P=w.stackOffset,A=w.data,D=w.reverseStackOrder,F=XM(C),q=F.numericAxisName,B=F.cateAxisName,V=vn(S,n),E=aye(A,V,"".concat(q,"Id"),"".concat(B,"Id"),P,D),M=c.reduce(function(ee,se){var ne="".concat(se.axisType,"Map");return he(he({},ee),{},Be({},ne,n2e(w,he(he({},se),{},{graphicalItems:V,stackGroups:se.axisType===q&&E,dataStartIndex:_,dataEndIndex:N}))))},{}),T=i2e(he(he({},M),{},{props:w,graphicalItems:V}),y==null?void 0:y.legendBBox);Object.keys(M).forEach(function(ee){M[ee]=u(w,M[ee],T,ee.replace("Map",""),r)});var L=M["".concat(B,"Map")],K=a2e(L),H=h(w,he(he({},M),{},{dataStartIndex:_,dataEndIndex:N,updateId:j,graphicalItems:V,stackGroups:E,offset:T}));return he(he({formattedGraphicalItems:H,graphicalItems:V,offset:T,stackGroups:E},K),M)},v=function(x){function b(y){var w,_,N;return BCe(this,b),N=WCe(this,b,[y]),Be(N,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Be(N,"accessibilityManager",new CCe),Be(N,"handleLegendBBoxUpdate",function(j){if(j){var S=N.state,C=S.dataStartIndex,P=S.dataEndIndex,A=S.updateId;N.setState(he({legendBBox:j},m({props:N.props,dataStartIndex:C,dataEndIndex:P,updateId:A},he(he({},N.state),{},{legendBBox:j}))))}}),Be(N,"handleReceiveSyncEvent",function(j,S,C){if(N.props.syncId===j){if(C===N.eventEmitterSymbol&&typeof N.props.syncMethod!="function")return;N.applySyncEvent(S)}}),Be(N,"handleBrushChange",function(j){var S=j.startIndex,C=j.endIndex;if(S!==N.state.dataStartIndex||C!==N.state.dataEndIndex){var P=N.state.updateId;N.setState(function(){return he({dataStartIndex:S,dataEndIndex:C},m({props:N.props,dataStartIndex:S,dataEndIndex:C,updateId:P},N.state))}),N.triggerSyncEvent({dataStartIndex:S,dataEndIndex:C})}}),Be(N,"handleMouseEnter",function(j){var S=N.getMouseInfo(j);if(S){var C=he(he({},S),{},{isTooltipActive:!0});N.setState(C),N.triggerSyncEvent(C);var P=N.props.onMouseEnter;Fe(P)&&P(C,j)}}),Be(N,"triggeredAfterMouseMove",function(j){var S=N.getMouseInfo(j),C=S?he(he({},S),{},{isTooltipActive:!0}):{isTooltipActive:!1};N.setState(C),N.triggerSyncEvent(C);var P=N.props.onMouseMove;Fe(P)&&P(C,j)}),Be(N,"handleItemMouseEnter",function(j){N.setState(function(){return{isTooltipActive:!0,activeItem:j,activePayload:j.tooltipPayload,activeCoordinate:j.tooltipPosition||{x:j.cx,y:j.cy}}})}),Be(N,"handleItemMouseLeave",function(){N.setState(function(){return{isTooltipActive:!1}})}),Be(N,"handleMouseMove",function(j){j.persist(),N.throttleTriggeredAfterMouseMove(j)}),Be(N,"handleMouseLeave",function(j){N.throttleTriggeredAfterMouseMove.cancel();var S={isTooltipActive:!1};N.setState(S),N.triggerSyncEvent(S);var C=N.props.onMouseLeave;Fe(C)&&C(S,j)}),Be(N,"handleOuterEvent",function(j){var S=Gne(j),C=Yn(N.props,"".concat(S));if(S&&Fe(C)){var P,A;/.*touch.*/i.test(S)?A=N.getMouseInfo(j.changedTouches[0]):A=N.getMouseInfo(j),C((P=A)!==null&&P!==void 0?P:{},j)}}),Be(N,"handleClick",function(j){var S=N.getMouseInfo(j);if(S){var C=he(he({},S),{},{isTooltipActive:!0});N.setState(C),N.triggerSyncEvent(C);var P=N.props.onClick;Fe(P)&&P(C,j)}}),Be(N,"handleMouseDown",function(j){var S=N.props.onMouseDown;if(Fe(S)){var C=N.getMouseInfo(j);S(C,j)}}),Be(N,"handleMouseUp",function(j){var S=N.props.onMouseUp;if(Fe(S)){var C=N.getMouseInfo(j);S(C,j)}}),Be(N,"handleTouchMove",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&N.throttleTriggeredAfterMouseMove(j.changedTouches[0])}),Be(N,"handleTouchStart",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&N.handleMouseDown(j.changedTouches[0])}),Be(N,"handleTouchEnd",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&N.handleMouseUp(j.changedTouches[0])}),Be(N,"handleDoubleClick",function(j){var S=N.props.onDoubleClick;if(Fe(S)){var C=N.getMouseInfo(j);S(C,j)}}),Be(N,"handleContextMenu",function(j){var S=N.props.onContextMenu;if(Fe(S)){var C=N.getMouseInfo(j);S(C,j)}}),Be(N,"triggerSyncEvent",function(j){N.props.syncId!==void 0&&Dw.emit(Lw,N.props.syncId,j,N.eventEmitterSymbol)}),Be(N,"applySyncEvent",function(j){var S=N.props,C=S.layout,P=S.syncMethod,A=N.state.updateId,D=j.dataStartIndex,F=j.dataEndIndex;if(j.dataStartIndex!==void 0||j.dataEndIndex!==void 0)N.setState(he({dataStartIndex:D,dataEndIndex:F},m({props:N.props,dataStartIndex:D,dataEndIndex:F,updateId:A},N.state)));else if(j.activeTooltipIndex!==void 0){var q=j.chartX,B=j.chartY,V=j.activeTooltipIndex,E=N.state,M=E.offset,T=E.tooltipTicks;if(!M)return;if(typeof P=="function")V=P(T,j);else if(P==="value"){V=-1;for(var L=0;L<T.length;L++)if(T[L].value===j.activeLabel){V=L;break}}var K=he(he({},M),{},{x:M.left,y:M.top}),H=Math.min(q,K.x+K.width),ee=Math.min(B,K.y+K.height),se=T[V]&&T[V].value,ne=CS(N.state,N.props.data,V),W=T[V]?{x:C==="horizontal"?T[V].coordinate:H,y:C==="horizontal"?ee:T[V].coordinate}:C6;N.setState(he(he({},j),{},{activeLabel:se,activeCoordinate:W,activePayload:ne,activeTooltipIndex:V}))}else N.setState(j)}),Be(N,"renderCursor",function(j){var S,C=N.state,P=C.isTooltipActive,A=C.activeCoordinate,D=C.activePayload,F=C.offset,q=C.activeTooltipIndex,B=C.tooltipAxisBandSize,V=N.getTooltipEventType(),E=(S=j.props.active)!==null&&S!==void 0?S:P,M=N.props.layout,T=j.key||"_recharts-cursor";return I.createElement(MCe,{key:T,activeCoordinate:A,activePayload:D,activeTooltipIndex:q,chartName:r,element:j,isActive:E,layout:M,offset:F,tooltipAxisBandSize:B,tooltipEventType:V})}),Be(N,"renderPolarAxis",function(j,S,C){var P=Yn(j,"type.axisType"),A=Yn(N.state,"".concat(P,"Map")),D=j.type.defaultProps,F=D!==void 0?he(he({},D),j.props):j.props,q=A&&A[F["".concat(P,"Id")]];return g.cloneElement(j,he(he({},q),{},{className:qe(P,q.className),key:j.key||"".concat(S,"-").concat(C),ticks:oi(q,!0)}))}),Be(N,"renderPolarGrid",function(j){var S=j.props,C=S.radialLines,P=S.polarAngles,A=S.polarRadius,D=N.state,F=D.radiusAxisMap,q=D.angleAxisMap,B=to(F),V=to(q),E=V.cx,M=V.cy,T=V.innerRadius,L=V.outerRadius;return g.cloneElement(j,{polarAngles:Array.isArray(P)?P:oi(V,!0).map(function(K){return K.coordinate}),polarRadius:Array.isArray(A)?A:oi(B,!0).map(function(K){return K.coordinate}),cx:E,cy:M,innerRadius:T,outerRadius:L,key:j.key||"polar-grid",radialLines:C})}),Be(N,"renderLegend",function(){var j=N.state.formattedGraphicalItems,S=N.props,C=S.children,P=S.width,A=S.height,D=N.props.margin||{},F=P-(D.left||0)-(D.right||0),q=XL({children:C,formattedGraphicalItems:j,legendWidth:F,legendContent:d});if(!q)return null;var B=q.item,V=qM(q,ICe);return g.cloneElement(B,he(he({},V),{},{chartWidth:P,chartHeight:A,margin:D,onBBoxUpdate:N.handleLegendBBoxUpdate}))}),Be(N,"renderTooltip",function(){var j,S=N.props,C=S.children,P=S.accessibilityLayer,A=zn(C,Ar);if(!A)return null;var D=N.state,F=D.isTooltipActive,q=D.activeCoordinate,B=D.activePayload,V=D.activeLabel,E=D.offset,M=(j=A.props.active)!==null&&j!==void 0?j:F;return g.cloneElement(A,{viewBox:he(he({},E),{},{x:E.left,y:E.top}),active:M,label:V,payload:M?B:[],coordinate:q,accessibilityLayer:P})}),Be(N,"renderBrush",function(j){var S=N.props,C=S.margin,P=S.data,A=N.state,D=A.offset,F=A.dataStartIndex,q=A.dataEndIndex,B=A.updateId;return g.cloneElement(j,{key:j.key||"_recharts-brush",onChange:vg(N.handleBrushChange,j.props.onChange),data:P,x:xe(j.props.x)?j.props.x:D.left,y:xe(j.props.y)?j.props.y:D.top+D.height+D.brushBottom-(C.bottom||0),width:xe(j.props.width)?j.props.width:D.width,startIndex:F,endIndex:q,updateId:"brush-".concat(B)})}),Be(N,"renderReferenceElement",function(j,S,C){if(!j)return null;var P=N,A=P.clipPathId,D=N.state,F=D.xAxisMap,q=D.yAxisMap,B=D.offset,V=j.type.defaultProps||{},E=j.props,M=E.xAxisId,T=M===void 0?V.xAxisId:M,L=E.yAxisId,K=L===void 0?V.yAxisId:L;return g.cloneElement(j,{key:j.key||"".concat(S,"-").concat(C),xAxis:F[T],yAxis:q[K],viewBox:{x:B.left,y:B.top,width:B.width,height:B.height},clipPathId:A})}),Be(N,"renderActivePoints",function(j){var S=j.item,C=j.activePoint,P=j.basePoint,A=j.childIndex,D=j.isRange,F=[],q=S.props.key,B=S.item.type.defaultProps!==void 0?he(he({},S.item.type.defaultProps),S.item.props):S.item.props,V=B.activeDot,E=B.dataKey,M=he(he({index:A,dataKey:E,cx:C.x,cy:C.y,r:4,fill:m2(S.item),strokeWidth:2,stroke:"#fff",payload:C.payload,value:C.value},Ae(V,!1)),Vv(V));return F.push(b.renderActiveDot(V,M,"".concat(q,"-activePoint-").concat(A))),P?F.push(b.renderActiveDot(V,he(he({},M),{},{cx:P.x,cy:P.y}),"".concat(q,"-basePoint-").concat(A))):D&&F.push(null),F}),Be(N,"renderGraphicChild",function(j,S,C){var P=N.filterFormatItem(j,S,C);if(!P)return null;var A=N.getTooltipEventType(),D=N.state,F=D.isTooltipActive,q=D.tooltipAxis,B=D.activeTooltipIndex,V=D.activeLabel,E=N.props.children,M=zn(E,Ar),T=P.props,L=T.points,K=T.isRange,H=T.baseLine,ee=P.item.type.defaultProps!==void 0?he(he({},P.item.type.defaultProps),P.item.props):P.item.props,se=ee.activeDot,ne=ee.hide,W=ee.activeBar,ie=ee.activeShape,R=!!(!ne&&F&&M&&(se||W||ie)),O={};A!=="axis"&&M&&M.props.trigger==="click"?O={onClick:vg(N.handleItemMouseEnter,j.props.onClick)}:A!=="axis"&&(O={onMouseLeave:vg(N.handleItemMouseLeave,j.props.onMouseLeave),onMouseEnter:vg(N.handleItemMouseEnter,j.props.onMouseEnter)});var k=g.cloneElement(j,he(he({},P.props),O));function G(Y){return typeof q.dataKey=="function"?q.dataKey(Y.payload):null}if(R)if(B>=0){var te,$;if(q.dataKey&&!q.allowDuplicatedCategory){var ae=typeof q.dataKey=="function"?G:"payload.".concat(q.dataKey.toString());te=Hv(L,ae,V),$=K&&H&&Hv(H,ae,V)}else te=L==null?void 0:L[B],$=K&&H&&H[B];if(ie||W){var oe=j.props.activeIndex!==void 0?j.props.activeIndex:B;return[g.cloneElement(j,he(he(he({},P.props),O),{},{activeIndex:oe})),null,null]}if(!Le(te))return[k].concat(Iu(N.renderActivePoints({item:P,activePoint:te,basePoint:$,childIndex:B,isRange:K})))}else{var z,fe=(z=N.getItemByXY(N.state.activeCoordinate))!==null&&z!==void 0?z:{graphicalItem:k},ue=fe.graphicalItem,Ne=ue.item,He=Ne===void 0?j:Ne,ke=ue.childIndex,Ze=he(he(he({},P.props),O),{},{activeIndex:ke});return[g.cloneElement(He,Ze),null,null]}return K?[k,null,null]:[k,null]}),Be(N,"renderCustomized",function(j,S,C){return g.cloneElement(j,he(he({key:"recharts-customized-".concat(C)},N.props),N.state))}),Be(N,"renderMap",{CartesianGrid:{handler:jg,once:!0},ReferenceArea:{handler:N.renderReferenceElement},ReferenceLine:{handler:jg},ReferenceDot:{handler:N.renderReferenceElement},XAxis:{handler:jg},YAxis:{handler:jg},Brush:{handler:N.renderBrush,once:!0},Bar:{handler:N.renderGraphicChild},Line:{handler:N.renderGraphicChild},Area:{handler:N.renderGraphicChild},Radar:{handler:N.renderGraphicChild},RadialBar:{handler:N.renderGraphicChild},Scatter:{handler:N.renderGraphicChild},Pie:{handler:N.renderGraphicChild},Funnel:{handler:N.renderGraphicChild},Tooltip:{handler:N.renderCursor,once:!0},PolarGrid:{handler:N.renderPolarGrid,once:!0},PolarAngleAxis:{handler:N.renderPolarAxis},PolarRadiusAxis:{handler:N.renderPolarAxis},Customized:{handler:N.renderCustomized}}),N.clipPathId="".concat((w=y.id)!==null&&w!==void 0?w:Qo("recharts"),"-clip"),N.throttleTriggeredAfterMouseMove=Y3(N.triggeredAfterMouseMove,(_=y.throttleDelay)!==null&&_!==void 0?_:1e3/60),N.state={},N}return qCe(b,x),UCe(b,[{key:"componentDidMount",value:function(){var w,_;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,_=w.children,N=w.data,j=w.height,S=w.layout,C=zn(_,Ar);if(C){var P=C.props.defaultIndex;if(!(typeof P!="number"||P<0||P>this.state.tooltipTicks.length-1)){var A=this.state.tooltipTicks[P]&&this.state.tooltipTicks[P].value,D=CS(this.state,N,P,A),F=this.state.tooltipTicks[P].coordinate,q=(this.state.offset.top+j)/2,B=S==="horizontal",V=B?{x:F,y:q}:{y:F,x:q},E=this.state.formattedGraphicalItems.find(function(T){var L=T.item;return L.type.name==="Scatter"});E&&(V=he(he({},V),E.props.points[P].tooltipPosition),D=E.props.points[P].tooltipPayload);var M={activeTooltipIndex:P,isTooltipActive:!0,activeLabel:A,activePayload:D,activeCoordinate:V};this.setState(M),this.renderCursor(C),this.accessibilityManager.setIndex(P)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,_){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==_.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var N,j;this.accessibilityManager.setDetails({offset:{left:(N=this.props.margin.left)!==null&&N!==void 0?N:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0}})}return null}},{key:"componentDidUpdate",value:function(w){J1([zn(w.children,Ar)],[zn(this.props.children,Ar)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=zn(this.props.children,Ar);if(w&&typeof w.props.shared=="boolean"){var _=w.props.shared?"axis":"item";return l.indexOf(_)>=0?_:i}return i}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var _=this.container,N=_.getBoundingClientRect(),j=bme(N),S={chartX:Math.round(w.pageX-j.left),chartY:Math.round(w.pageY-j.top)},C=N.width/_.offsetWidth||1,P=this.inRange(S.chartX,S.chartY,C);if(!P)return null;var A=this.state,D=A.xAxisMap,F=A.yAxisMap,q=this.getTooltipEventType(),B=KM(this.state,this.props.data,this.props.layout,P);if(q!=="axis"&&D&&F){var V=to(D).scale,E=to(F).scale,M=V&&V.invert?V.invert(S.chartX):null,T=E&&E.invert?E.invert(S.chartY):null;return he(he({},S),{},{xValue:M,yValue:T},B)}return B?he(he({},S),B):null}},{key:"inRange",value:function(w,_){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=this.props.layout,S=w/N,C=_/N;if(j==="horizontal"||j==="vertical"){var P=this.state.offset,A=S>=P.left&&S<=P.left+P.width&&C>=P.top&&C<=P.top+P.height;return A?{x:S,y:C}:null}var D=this.state,F=D.angleAxisMap,q=D.radiusAxisMap;if(F&&q){var B=to(F);return pT({x:S,y:C},B)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,_=this.getTooltipEventType(),N=zn(w,Ar),j={};N&&_==="axis"&&(N.props.trigger==="click"?j={onClick:this.handleClick}:j={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var S=Vv(this.props,this.handleOuterEvent);return he(he({},S),j)}},{key:"addListener",value:function(){Dw.on(Lw,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Dw.removeListener(Lw,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,_,N){for(var j=this.state.formattedGraphicalItems,S=0,C=j.length;S<C;S++){var P=j[S];if(P.item===w||P.props.key===w.key||_===ui(P.item.type)&&N===P.childIndex)return P}return null}},{key:"renderClipPath",value:function(){var w=this.clipPathId,_=this.state.offset,N=_.left,j=_.top,S=_.height,C=_.width;return I.createElement("defs",null,I.createElement("clipPath",{id:w},I.createElement("rect",{x:N,y:j,height:S,width:C})))}},{key:"getXScales",value:function(){var w=this.state.xAxisMap;return w?Object.entries(w).reduce(function(_,N){var j=VM(N,2),S=j[0],C=j[1];return he(he({},_),{},Be({},S,C.scale))},{}):null}},{key:"getYScales",value:function(){var w=this.state.yAxisMap;return w?Object.entries(w).reduce(function(_,N){var j=VM(N,2),S=j[0],C=j[1];return he(he({},_),{},Be({},S,C.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(w){var _;return(_=this.state.xAxisMap)===null||_===void 0||(_=_[w])===null||_===void 0?void 0:_.scale}},{key:"getYScaleByAxisId",value:function(w){var _;return(_=this.state.yAxisMap)===null||_===void 0||(_=_[w])===null||_===void 0?void 0:_.scale}},{key:"getItemByXY",value:function(w){var _=this.state,N=_.formattedGraphicalItems,j=_.activeItem;if(N&&N.length)for(var S=0,C=N.length;S<C;S++){var P=N[S],A=P.props,D=P.item,F=D.type.defaultProps!==void 0?he(he({},D.type.defaultProps),D.props):D.props,q=ui(D.type);if(q==="Bar"){var B=(A.data||[]).find(function(T){return rwe(w,T)});if(B)return{graphicalItem:P,payload:B}}else if(q==="RadialBar"){var V=(A.data||[]).find(function(T){return pT(w,T)});if(V)return{graphicalItem:P,payload:V}}else if(Tb(P,j)||Mb(P,j)||Am(P,j)){var E=Hje({graphicalItem:P,activeTooltipItem:j,itemData:F.data}),M=F.activeIndex===void 0?E:F.activeIndex;return{graphicalItem:he(he({},P),{},{childIndex:M}),payload:Am(P,j)?F.data[E]:P.props.data[E]}}}return null}},{key:"render",value:function(){var w=this;if(!iE(this))return null;var _=this.props,N=_.children,j=_.className,S=_.width,C=_.height,P=_.style,A=_.compact,D=_.title,F=_.desc,q=qM(_,$Ce),B=Ae(q,!1);if(A)return I.createElement(NM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},I.createElement(eN,gd({},B,{width:S,height:C,title:D,desc:F}),this.renderClipPath(),lE(N,this.renderMap)));if(this.props.accessibilityLayer){var V,E;B.tabIndex=(V=this.props.tabIndex)!==null&&V!==void 0?V:0,B.role=(E=this.props.role)!==null&&E!==void 0?E:"application",B.onKeyDown=function(T){w.accessibilityManager.keyboardEvent(T)},B.onFocus=function(){w.accessibilityManager.focus()}}var M=this.parseEventsOfWrapper();return I.createElement(NM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},I.createElement("div",gd({className:qe("recharts-wrapper",j),style:he({position:"relative",cursor:"default",width:S,height:C},P)},M,{ref:function(L){w.container=L}}),I.createElement(eN,gd({},B,{width:S,height:C,title:D,desc:F,style:JCe}),this.renderClipPath(),lE(N,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(g.Component);Be(v,"displayName",r),Be(v,"defaultProps",he({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Be(v,"getDerivedStateFromProps",function(x,b){var y=x.dataKey,w=x.data,_=x.children,N=x.width,j=x.height,S=x.layout,C=x.stackOffset,P=x.margin,A=b.dataStartIndex,D=b.dataEndIndex;if(b.updateId===void 0){var F=YM(x);return he(he(he({},F),{},{updateId:0},m(he(he({props:x},F),{},{updateId:0}),b)),{},{prevDataKey:y,prevData:w,prevWidth:N,prevHeight:j,prevLayout:S,prevStackOffset:C,prevMargin:P,prevChildren:_})}if(y!==b.prevDataKey||w!==b.prevData||N!==b.prevWidth||j!==b.prevHeight||S!==b.prevLayout||C!==b.prevStackOffset||!kd(P,b.prevMargin)){var q=YM(x),B={chartX:b.chartX,chartY:b.chartY,isTooltipActive:b.isTooltipActive},V=he(he({},KM(b,w,S)),{},{updateId:b.updateId+1}),E=he(he(he({},q),B),V);return he(he(he({},E),m(he({props:x},E),b)),{},{prevDataKey:y,prevData:w,prevWidth:N,prevHeight:j,prevLayout:S,prevStackOffset:C,prevMargin:P,prevChildren:_})}if(!J1(_,b.prevChildren)){var M,T,L,K,H=zn(_,wu),ee=H&&(M=(T=H.props)===null||T===void 0?void 0:T.startIndex)!==null&&M!==void 0?M:A,se=H&&(L=(K=H.props)===null||K===void 0?void 0:K.endIndex)!==null&&L!==void 0?L:D,ne=ee!==A||se!==D,W=!Le(w),ie=W&&!ne?b.updateId:b.updateId+1;return he(he({updateId:ie},m(he(he({props:x},b),{},{updateId:ie,dataStartIndex:ee,dataEndIndex:se}),b)),{},{prevChildren:_,dataStartIndex:ee,dataEndIndex:se})}return null}),Be(v,"renderActiveDot",function(x,b,y){var w;return g.isValidElement(x)?w=g.cloneElement(x,b):Fe(x)?w=x(b):w=I.createElement(pp,b),I.createElement(Xe,{className:"recharts-active-dot",ke
654y:y},w)});var p=g.forwardRef(function(b,y){return I.createElement(v,gd({},b,{ref:y}))});return p.displayName=v.displayName,p},k6=Ub({chartName:"LineChart",GraphicalChild:_i,axisComponents:[{axisType:"xAxis",AxisComp:Xa},{axisType:"yAxis",AxisComp:Hn}],formatAxisMap:g2}),QM=Ub({chartName:"BarChart",GraphicalChild:Wn,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Xa},{axisType:"yAxis",AxisComp:Hn}],formatAxisMap:g2}),Wb=Ub({chartName:"PieChart",GraphicalChild:ka,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Ob},{axisType:"radiusAxis",AxisComp:Ab}],formatAxisMap:gye,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),JM=Ub({chartName:"ComposedChart",GraphicalChild:[_i,rl,Wn,Bb],axisComponents:[{axisType:"xAxis",AxisComp:Xa},{axisType:"yAxis",AxisComp:Hn},{axisType:"zAxis",AxisComp:Fb}],formatAxisMap:g2});function l2e(){const{user:e}=it(),[t,r]=g.useState([]),[n,s]=g.useState(!0);async function i(){if(e)try{const{data:o}=await Z.from("profiles").select("industry").eq("user_id",e.id).single();if(!(o!=null&&o.industry)||o.industry.trim()===""){s(!1),r([]);return}const c={Healthcare:["62"],Defense:["3364"],IT:["5415"],"Information Technology":["5415"],Construction:["23"],Energy:["22"],Transportation:["48","49"],Manufacturing:["31","32","33"],"Professional Services":["54"],Education:["61"],Agriculture:["11"]}[o.industry]||[],{data:d,count:u}=await Z.from("procurement_awards").select("*",{count:"exact"}).or(c.length>0?c.map(p=>`naics_code.ilike.${p}%`).join(","):`description.ilike.%${o.industry}%,contractor.ilike.%${o.industry}%`).not("value","is",null).not("award_date","is",null).limit(1);if(!u||u===0){console.log("No data found, fetching real USA spending data...");const{data:p,error:x}=await Z.functions.invoke("fetch-usa-spending",{body:{industry:o.industry,limit:100}});x?console.error("Error fetching USA spending:",x):console.log(`Fetched ${p.inserted} real contracts from USAspending.gov`)}const{data:f}=await Z.from("procurement_awards").select("value, award_date, description, contractor").or(c.length>0?c.map(p=>`naics_code.ilike.${p}%`).join(","):`description.ilike.%${o.industry}%,contractor.ilike.%${o.industry}%`).not("value","is",null).not("award_date","is",null).order("award_date",{ascending:!0}).limit(200),h=[],m=new Date;for(let p=6;p>=1;p--){const x=new Date(m.getFullYear(),m.getMonth()-p,1),b=x.toLocaleString("default",{month:"short",year:"2-digit"});h.push({month:b,fullDate:x,totalValue:0,avgValue:0,count:0})}f&&f.length>0&&(f.forEach(p=>{if(!p.award_date||!p.value)return;const b=new Date(p.award_date).toLocaleString("default",{month:"short",year:"2-digit"}),y=h.find(w=>w.month===b);y&&(y.totalValue+=Number(p.value),y.count+=1)}),h.forEach(p=>{if(p.count>0){const x=p.totalValue;p.totalValue=x/1e6,p.avgValue=x/p.count/1e6}else p.totalValue=0,p.avgValue=0}));const v=h.filter(p=>p.count>0);r(v),console.log("Chart data loaded:",v),console.log("Awards foun
654d:",f==null?void 0:f.length),s(!1)}catch(o){console.error("Error fetching industry awards:",o),s(!1)}}return g.useEffect(()=>{i()},[e]),a.jsxs(J,{className:"glass-card hover-lift",children:[a.jsx(de,{children:a.jsx(le,{children:"Industry Budget Awards"})}),a.jsx(re,{children:n?a.jsx("div",{className:"flex items-center justify-center h-[300px]",children:a.jsx(Je,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):t.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-[300px] text-muted-foreground text-center px-4",children:[a.jsx("p",{className:"font-medium",children:"No industry award data available"}),a.jsx("p",{className:"text-sm mt-2",children:"Update your industry in Profile settings to see relevant procurement awards"})]}):a.jsx(js,{width:"100%",height:300,children:a.jsxs(k6,{data:t,children:[a.jsx(Il,{strokeDasharray:"3 3",className:"stroke-muted"}),a.jsx(Xa,{dataKey:"month",className:"text-xs"}),a.jsx(Hn,{className:"text-xs",tickFormatter:o=>o>=1e3?`$${(o/1e3).toFixed(1)}B`:`$${o.toFixed(0)}M`}),a.jsx(Ar,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"6px"},formatter:(o,l)=>l==="Total Awards"?o>=1e3?[`$${(o/1e3).toFixed(2)}B`,l]:[`$${o.toFixed(2)}M`,l]:l==="Avg Award"?o>=1e3?[`$${(o/1e3).toFixed(2)}B`,l]:[`$${o.toFixed(2)}M`,l]:[o,l]}),a.jsx(_i,{type:"monotone",dataKey:"totalValue",stroke:"hsl(var(--primary))",strokeWidth:2,name:"Total Awards"})]})})})]})}const c2e=ki("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ve({className:e,variant:t,...r}){return a.jsx("div",{className:me(c2e({variant:t}),e),...r})}const Rm=ki("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),U=g.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},i)=>{const o=n?Hu:"button";return a.jsx(o,{className:me(Rm({variant:t,size:r,className:e})),ref:i,...s})});U.displayName="Button";var d2e=g.createContext(void 0);function Ii(e){const t=g.useContext(d2e);return e||t||"ltr"}var Bw=0;function Hb(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ZM()),document.body.insertAdjacentElement("beforeend",e[1]??ZM()),Bw++,()=>{Bw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Bw--}},[])}function ZM(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var zw="focusScope.autoFocusOnMount",Uw="focusScope.autoFocusOnUnmount",eI={bubbles:!1,cancelable:!0},u2e="FocusScope",gp=g.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[l,c]=g.useState(null),d=_t(s),u=_t(i),f=g.useRef(null),h=Te(t,p=>c(p)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(n){let p=function(w){if(m.paused||!l)return;const _=w.target;l.contains(_)?f.current=_:Gi(f.current,{select:!0})},x=function(w){if(m.paused||!l)return;const _=w.relatedTarget;_!==null&&(l.contains(_)||Gi(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const N of w)N.removedNodes.length>0&&Gi(l)};document.addEventListener("focusin",p),document.addEventListener("focusout",x);const y=new MutationObserver(b);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",x),y.disconnect()}}},[n,l,m.paused]),g.useEffect(()=>{if(l){rI.add(m);const p=document.activeElement;if(!l.contains(p)){const b=new CustomEvent(zw,eI);l.addEventListener(zw,d),l.dispatchEvent(b),b.defaultPrevented||(f2e(v2e(A6(l)),{select:!0}),document.activeElement===p&&Gi(l))}return()=>{l.removeEventListener(zw,d),setTimeout(()=>{const b=new CustomEvent(Uw,eI);l.addEventListener(Uw,u),l.dispatchEvent(b),b.defaultPrevented||Gi(p??document.body,{select:!0}),l.removeEventListener(Uw,u),rI.remove(m)},0)}}},[l,d,u,m]);const v=g.useCallback(p=>{if(!r&&!n||m.paused)return;const x=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,b=document.activeElement;if(x&&b){const y=p.currentTarget,[w,_]=h2e(y);w&&_?!p.shiftKey&&b===_?(p.preventDefault(),r&&Gi(w,{select:!0}
vendor: 5,457 bytes, line 654
654)):p.shiftKey&&b===w&&(p.preventDefault(),r&&Gi(_,{select:!0})):b===y&&p.preventDefault()}},[r,n,m.paused]);return a.jsx(we.div,{tabIndex:-1,...o,ref:h,onKeyDown:v})});gp.displayName=u2e;function f2e(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Gi(n,{select:t}),document.activeElement!==r)return}function h2e(e){const t=A6(e),r=tI(t,e),n=tI(t.reverse(),e);return[r,n]}function A6(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function tI(e,t){for(const r of e)if(!m2e(r,{upTo:t}))return r}function m2e(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function p2e(e){return e instanceof HTMLInputElement&&"select"in e}function Gi(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&p2e(e)&&t&&e.select()}}var rI=g2e();function g2e(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=nI(e,t),e.unshift(t)},remove(t){var r;e=nI(e,t),(r=e[0])==null||r.resume()}}}function nI(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function v2e(e){return e.filter(t=>t.tagName!=="A")}var Ww="rovingFocusGroup.onEntryFocus",x2e={bubbles:!1,cancelable:!0},vp="RovingFocusGroup",[PS,E6,y2e]=bc(vp),[b2e,nl]=ir(vp,[y2e]),[w2e,j2e]=b2e(vp),O6=g.forwardRef((e,t)=>a.jsx(PS.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(PS.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(N2e,{...e,ref:t})})}));O6.displayName=vp;var N2e=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...f}=e,h=g.useRef(null),m=Te(t,h),v=Ii(i),[p,x]=vr({prop:o,defaultProp:l??null,onChange:c,caller:vp}),[b,y]=g.useState(!1),w=_t(d),_=E6(r),N=g.useRef(!1),[j,S]=g.useState(0);return g.useEffect(()=>{const C=h.current;if(C)return C.addEventListener(Ww,w),()=>C.removeEventListener(Ww,w)},[w]),a.jsx(w2e,{scope:r,orientation:n,dir:v,loop:s,currentTabStopId:p,onItemFocus:g.useCallback(C=>x(C),[x]),onItemShiftTab:g.useCallback(()=>y(!0),[]),onFocusableItemAdd:g.useCallback(()=>S(C=>C+1),[]),onFocusableItemRemove:g.useCallback(()=>S(C=>C-1),[]),children:a.jsx(we.div,{tabIndex:b||j===0?-1:0,"data-orientation":n,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:pe(e.onMouseDown,()=>{N.current=!0}),onFocus:pe(e.onFocus,C=>{const P=!N.current;if(C.target===C.currentTarget&&P&&!b){const A=new CustomEvent(Ww,x2e);if(C.currentTarget.dispatchEvent(A),!A.defaultPrevented){const D=_().filter(E=>E.focusable),F=D.find(E=>E.active),q=D.find(E=>E.id===p),V=[F,q,...D].filter(Boolean).map(E=>E.ref.current);I6(V,u)}}N.current=!1}),onBlur:pe(e.onBlur,()=>y(!1))})})}),T6="RovingFocusGroupItem",M6=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:i,children:o,...l}=e,c=tn(),d=i||c,u=j2e(T6,r),f=u.currentTabStopId===d,h=E6(r),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:p}=u;return g.useEffect(()=>{if(n)return m(),()=>v()},[n,m,v]),a.jsx(PS.ItemSlot,{scope:r,id:d,focusable:n,active:s,children:a.jsx(we.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:pe(e.onMouseDown,x=>{n?u.onItemFocus(d):x.preventDefault()}),onFocus:pe(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:pe(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const b=C2e(x,u.orientation,u.dir);if(b!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=h().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const _=w.indexOf(x.currentTarget);w=u.loop?P2e(w,_+1):w.slice(_+1)}setTimeout(()=>I6(w))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:p!=null}):o})})});M6.displayName=T6;var S2e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _2e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function C2e(e,t,r){const n=_2e(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return S2e[n]}function I6(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function P2e(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Vb=O6,qb=M6,k2e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Hc=new WeakMap,Ng=new WeakMap,Sg={},Hw=0,$6=function(e){return e&&(e.host||$6(e.parentNode))},A2e=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=$6(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},E2e=function(e,t,r,n){var s=A2e(t,Array.isArray(e)?e:[e]);Sg[r]||(Sg[r]=new WeakMap);var i=Sg[r],o=[],l=new Set,c=new Set(s),d=function(f){!f||l.has(f)||(l.add(f),d(f.parentNode))};
vendor: 13,400 bytes, lines 654-694
654s.forEach(d);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))u(h);else try{var m=h.getAttribute(n),v=m!==null&&m!=="false",p=(Hc.get(h)||0)+1,x=(i.get(h)||0)+1;Hc.set(h,p),i.set(h,x),o.push(h),p===1&&v&&Ng.set(h,!0),x===1&&h.setAttribute(r,"true"),v||h.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return u(t),l.clear(),Hw++,function(){o.forEach(function(f){var h=Hc.get(f)-1,m=i.get(f)-1;Hc.set(f,h),i.set(f,m),h||(Ng.has(f)||f.removeAttribute(n),Ng.delete(f)),m||f.removeAttribute(r)}),Hw--,Hw||(Hc=new WeakMap,Hc=new WeakMap,Ng=new WeakMap,Sg={})}},Gb=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=k2e(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),E2e(n,s,r,"aria-hidden")):function(){return null}},Ns=function(){return Ns=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ns.apply(this,arguments)};function R6(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function O2e(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,i;n<s;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var Yg="right-scroll-bar-position",Xg="width-before-scroll-bar",T2e="with-scroll-bars-hidden",M2e="--removed-body-scroll-bar-size";function Vw(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function I2e(e,t){var r=g.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var $2e=typeof window<"u"?g.useLayoutEffect:g.useEffect,aI=new WeakMap;function R2e(e,t){var r=I2e(null,function(n){return e.forEach(function(s){return Vw(s,n)})});return $2e(function(){var n=aI.get(r);if(n){var s=new Set(n),i=new Set(e),o=r.current;s.forEach(function(l){i.has(l)||Vw(l,null)}),i.forEach(function(l){s.has(l)||Vw(l,o)})}aI.set(r,e)},[e]),r}function D2e(e){return e}function L2e(e,t){t===void 0&&(t=D2e);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var o=t(i,n);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(n=!0;r.length;){var o=r;r=[],o.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(i),o=r}var c=function(){var u=o;o=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){o.push(u),d()},filter:function(u){return o=o.filter(u),r}}}};return s}function F2e(e){e===void 0&&(e={});var t=L2e(null);return t.options=Ns({async:!0,ssr:!1},e),t}var D6=function(e){var t=e.sideCar,r=R6(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return g.createElement(n,Ns({},r))};D6.isSideCarExport=!0;function B2e(e,t){return e.useMedium(t),D6}var L6=F2e(),qw=function(){},Kb=g.forwardRef(function(e,t){var r=g.useRef(null),n=g.useState({onScrollCapture:qw,onWheelCapture:qw,onTouchMoveCapture:qw}),s=n[0],i=n[1],o=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,f=e.shards,h=e.sideCar,m=e.noRelative,v=e.noIsolation,p=e.inert,x=e.allowPinchZoom,b=e.as,y=b===void 0?"div":b,w=e.gapMode,_=R6(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=h,j=R2e([r,t]),S=Ns(Ns({},_),s);return g.createElement(g.Fragment,null,u&&g.createElement(N,{sideCar:L6,removeScrollBar:d,shards:f,noRelative:m,noIsolation:v,inert:p,setCallbacks:i,allowPinchZoom:!!x,lockRef:r,gapMode:w}),o?g.cloneElement(g.Children.only(l),Ns(Ns({},S),{ref:j})):g.createElement(y,Ns({},S,{className:c,ref:j}),l))});Kb.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Kb.classNames={fullWidth:Xg,zeroRight:Yg};var z2e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function U2e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=z2e();return t&&e.setAttribute("nonce",t),e}function W2e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function H2e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var V2e=function(){var e=0,t=null;return{add:function(r){e==0&&(t=U2e())&&(W2e(t,r),H2e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},q2e=function(){var e=V2e();return function(t,r){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},F6=function(){var e=q2e(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},G2e={left:0,top:0,right:0,gap:0},Gw=function(e){return parseInt(e||"",10)||0},K2e=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Gw(r),Gw(n),Gw(s)]},Y2e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return G2e;var t=K2e(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},X2e=F6(),Od="data-scroll-locked",Q2e=function(e,t,r,n){var s=e.left,i=e.top,o=e.right,l=e.gap;return r===void 0&&(r="margin"),` 655 .`.concat(T2e,` { 656 overflow: hidden `).concat(n,`; 657 padding-right: `).concat(l,"px ").concat(n,`; 658 } 659 body[`).concat(Od,`] { 660 overflow: hidden `).concat(n,`; 661 overscroll-behavior: contain; 662 `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` 663 padding-left: `.concat(s,`px; 664 padding-top: `).concat(i,`px; 665 padding-right: `).concat(o,`px; 666 margin-left:0; 667 margin-top:0; 668 margin-right: `).concat(l,"px ").concat(n,`; 669 `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),` 670 } 671 672 .`).concat(Yg,` { 673 right: `).concat(l,"px ").concat(n,`; 674 } 675 676 .`).concat(Xg,` { 677 margin-right: `).concat(l,"px ").concat(n,`; 678 } 679 680 .`).concat(Yg," .").concat(Yg,` { 681 right: 0 `).concat(n,`; 682 } 683 684 .`).concat(Xg," .").concat(Xg,` { 685 margin-right: 0 `).concat(n,`; 686 } 687 688 body[`).concat(Od,`] { 689 `).concat(M2e,": ").concat(l,`px; 690 } 691`)},sI=function(){var e=parseInt(document.body.getAttribute(Od)||"0",10);return isFinite(e)?e:0},J2e=function(){g.useEffect(function(){return document.body.setAttribute(Od,(sI()+1).toString()),function(){var e=sI()-1;e<=0?document.body.removeAttribute(Od):document.body.setAttribute(Od,e.toString())}},[])},Z2e=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;J2e();var i=g.useMemo(function(){return Y2e(s)},[s]);return g.createElement(X2e,{styles:Q2e(i,!t,s,r?"":"!important")})},kS=!1;if(typeof window<"u")try{var _g=Object.defineProperty({},"passive",{get:function(){return kS=!0,!0}});window.addEventListener("test",_g,_g),window.removeEventListener("test",_g,_g)}catch{kS=!1}var Vc=kS?{passive:!1}:!1,ePe=function(e){return e.tagName==="TEXTAREA"},B6=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!ePe(e)&&r[t]==="visible")},tPe=function(e){return B6(e,"overflowY")},rPe=function(e){return B6(e,"overflowX")},iI=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=z6(e,n);if(s){var i=U6(e,n),o=i[1],l=i[2];if(o>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},nPe=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},aPe=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},z6=function(e,t){return e==="v"?tPe(t):rPe(t)},U6=function(e,t){return e==="v"?nPe(t):aPe(t)},sPe=function(e,t){return e==="h"&&t==="rtl"?-1:1},iPe=function(e,t,r,n,s){var i=sPe(e,window.getComputedStyle(t).direction),o=i*n,l=r.target,c=t.contains(l),d=!1,u=o>0,f=0,h=0;do{if(!l)break;var m=U6(e,l),v=m[0],p=m[1],x=m[2],b=p-x-i*v;(v||b)&&z6(e,l)&&(f+=b,h+=v);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&(Math.abs(f)<1||!s)||!u&&(Math.abs(h)<1||!s))&&(d=!0),d},Cg=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},oI=function(e){return[e.deltaX,e.deltaY]},lI=function(e){return e&&"current"in e?e.current:e},oPe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lPe=function(e){return` 692 .block-interactivity-`.concat(e,` {pointer-events: none;} 693 .allow-interactivity-`).concat(e,` {pointer-events: all;} 694`)},cPe=0,qc=[];function dPe(e){var t=g.useRef([]),r=g.useRef([0,0]),n=g.useRef(),s=g.useState(cPe++)[0],i=g.useState(F6)[0],o=g.useRef(e);g.useEffect(function(){o.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var p=O2e([e.lockRef.current],(e.shards||[]).map(lI),!0).filter(Boolean);return p.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=g.useCallback(function(p,x){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var b=Cg(p),y=r.current,w="deltaX"in p?p.deltaX:y[0]-b[0],_="deltaY"in p?p.deltaY:y[1]-b[1],N,j=p.target,S=Math.abs(w)>Math.abs(_)?"h":"v";if("touches"in p&&S==="h"&&j.type==="range")return!1;var C=iI(S,j);if(!C)return!0;if(C?N=S:(N=S==="v"?"h":"v",C=iI(S,j)),!C)return!1;if(!n.current&&"changedTouches"in p&&(w||_)&&(n.current=N),!N)return!0;var P=n.current||N;return iPe(P,x,p,P==="h"?w:_,!0)},[]),c=g.useCallback(function(p){var x=p;if(!(!qc.length||qc[qc.length-1]!==i)){var b="deltaY"in x?oI(x):Cg(x),y=t.current.filter(function(N){return N.name===x.type&&(N.target===x.target||x.target===N.shadowParent)&&oPe(N.delta,b)})[0];if(y&&y.should){x.cancelable&&x.preventDefault();return}if(!y){var w=(o.current.shards||[]).map(lI).filter(Boolean).filter(function(N){return N.contains(x.target)}),_=w.length>0?l(x,w[0]):!o.current.noIsolation;_&&x.cancelable&&x.preventDefault()}}},[]),d=g.useCallback(function(p,x,b,y){var w={name:p,delta:x,target:b,should:y,shadowParent:uPe(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(_){return _!==w})},1)},[]),u=g.useCallback(function(p){r.current=Cg(p),n.current=void 0},[]),f=g.useCallback(function(p){d(p.type,oI(p),p.target,l(p,e.lockRef.current))},[]),h=g.useCallback(function(p){d(p.type,Cg(p),p.target,l(p,e.lockRef.current))},[]);g.useEffect(function(){return qc.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Vc),document.addEventListener("touchmove",c,Vc),document.addEventListener("touchstart",u,Vc),function(){qc=qc.filter(function(p){return p!==i}),document.removeEventListener("wheel",c,Vc),document.removeEventListener("touchmove",c,Vc),document.removeEventListener("touchstart",u,Vc)}},[]);var m=e.removeScrollBar,v=e.inert;return g.createElement(g.Fragment,null,v?g.createElement(i,{styles:lPe(s)}):null,m?g.createElement(Z2e,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function uPe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fPe=B2e(L6,dPe);var xp=g.forwardRef(function(e,t){return g.createElement(Kb,Ns({},e,{ref:t,sideCar:fPe}))});xp.classNames=Kb.classNames;var AS=["Enter"," "],hPe=["ArrowDown","PageUp","Home"],W6=["ArrowUp","PageDown","End"],mPe=[...hPe,...W6],pPe={ltr:[...AS,"ArrowRight"],rtl:[...AS,"ArrowLeft"]},gPe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},yp="Menu",[Dm,vPe,xPe]=bc(yp),[Cc,H6]=ir(yp,[xPe,Ko,nl]),Yb=Ko(),V6=nl(),[yPe,Pc]=Cc(yp),[bPe,bp]=Cc(yp),q6=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:i,modal:o=!0}=e,l=Yb(t),[c,d]=g.useState(null),u=g.useRef(!1),f=_t(i),h=Ii(s);return g.useEffect(()=>{const m=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),a.jsx(My,{...l,children:a.jsx(yPe,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:d,children:a.jsx(bPe,{scope:t,onClose:g.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:h,modal:o,children:n})})})};q6.displayName=yp;var wPe="MenuAnchor",C2=g.forwardRef((e,t)=>
vendor: 12,964 bytes, line 694
694{const{__scopeMenu:r,...n}=e,s=Yb(r);return a.jsx(ip,{...s,...n,ref:t})});C2.displayName=wPe;var P2="MenuPortal",[jPe,G6]=Cc(P2,{forceMount:void 0}),K6=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,i=Pc(P2,t);return a.jsx(jPe,{scope:t,forceMount:r,children:a.jsx(Zt,{present:r||i.open,children:a.jsx(Vu,{asChild:!0,container:s,children:n})})})};K6.displayName=P2;var ya="MenuContent",[NPe,k2]=Cc(ya),Y6=g.forwardRef((e,t)=>{const r=G6(ya,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,i=Pc(ya,e.__scopeMenu),o=bp(ya,e.__scopeMenu);return a.jsx(Dm.Provider,{scope:e.__scopeMenu,children:a.jsx(Zt,{present:n||i.open,children:a.jsx(Dm.Slot,{scope:e.__scopeMenu,children:o.modal?a.jsx(SPe,{...s,ref:t}):a.jsx(_Pe,{...s,ref:t})})})})}),SPe=g.forwardRef((e,t)=>{const r=Pc(ya,e.__scopeMenu),n=g.useRef(null),s=Te(t,n);return g.useEffect(()=>{const i=n.current;if(i)return Gb(i)},[]),a.jsx(A2,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:pe(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),_Pe=g.forwardRef((e,t)=>{const r=Pc(ya,e.__scopeMenu);return a.jsx(A2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),CPe=$o("MenuContent.ScrollLock"),A2=g.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:m,disableOutsideScroll:v,...p}=e,x=Pc(ya,r),b=bp(ya,r),y=Yb(r),w=V6(r),_=vPe(r),[N,j]=g.useState(null),S=g.useRef(null),C=Te(t,S,x.onContentChange),P=g.useRef(0),A=g.useRef(""),D=g.useRef(0),F=g.useRef(null),q=g.useRef("right"),B=g.useRef(0),V=v?xp:g.Fragment,E=v?{as:CPe,allowPinchZoom:!0}:void 0,M=L=>{var R,O;const K=A.current+L,H=_().filter(k=>!k.disabled),ee=document.activeElement,se=(R=H.find(k=>k.ref.current===ee))==null?void 0:R.textValue,ne=H.map(k=>k.textValue),W=LPe(ne,K,se),ie=(O=H.find(k=>k.textValue===W))==null?void 0:O.ref.current;(function k(G){A.current=G,window.clearTimeout(P.current),G!==""&&(P.current=window.setTimeout(()=>k(""),1e3))})(K),ie&&setTimeout(()=>ie.focus())};g.useEffect(()=>()=>window.clearTimeout(P.current),[]),Hb();const T=g.useCallback(L=>{var H,ee;return q.current===((H=F.current)==null?void 0:H.side)&&BPe(L,(ee=F.current)==null?void 0:ee.area)},[]);return a.jsx(NPe,{scope:r,searchRef:A,onItemEnter:g.useCallback(L=>{T(L)&&L.preventDefault()},[T]),onItemLeave:g.useCallback(L=>{var K;T(L)||((K=S.current)==null||K.focus(),j(null))},[T]),onTriggerLeave:g.useCallback(L=>{T(L)&&L.preventDefault()},[T]),pointerGraceTimerRef:D,onPointerGraceIntentChange:g.useCallback(L=>{F.current=L},[]),children:a.jsx(V,{...E,children:a.jsx(gp,{asChild:!0,trapped:s,onMountAutoFocus:pe(i,L=>{var K;L.preventDefault(),(K=S.current)==null||K.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:a.jsx(qo,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:m,children:a.jsx(Vb,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:n,currentTabStopId:N,onCurrentTabStopIdChange:j,onEntryFocus:pe(c,L=>{b.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(Iy,{role:"menu","aria-orientation":"vertical","data-state":uB(x.open),"data-radix-menu-content":"",dir:b.dir,...y,...p,ref:C,style:{outline:"none",...p.style},onKeyDown:pe(p.onKeyDown,L=>{const H=L.target.closest("[data-radix-menu-content]")===L.currentTarget,ee=L.ctrlKey||L.altKey||L.metaKey,se=L.key.length===1;H&&(L.key==="Tab"&&L.preventDefault(),!ee&&se&&M(L.key));const ne=S.current;if(L.target!==ne||!mPe.includes(L.key))return;L.preventDefault();const ie=_().filter(R=>!R.disabled).map(R=>R.ref.current);W6.includes(L.key)&&ie.reverse(),RPe(ie)}),onBlur:pe(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(P.current),A.current="")}),onPointerMove:pe(e.onPointerMove,Lm(L=>{const K=L.target,H=B.current!==L.clientX;if(L.currentTarget.contains(K)&&H){const ee=L.clientX>B.current?"right":"left";q.current=ee,B.current=L.clientX}}))})})})})})})});Y6.displayName=ya;var PPe="MenuGroup",E2=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return a.jsx(we.div,{role:"group",...n,ref:t})});E2.displayName=PPe;var kPe="MenuLabel",X6=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return a.jsx(we.div,{...n,ref:t})});X6.displayName=kPe;var Kx="MenuItem",cI="menu.itemSelect",Xb=g.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,i=g.useRef(null),o=bp(Kx,e.__scopeMenu),l=k2(Kx,e.__scopeMenu),c=Te(t,i),d=g.useRef(!1),u=()=>{const f=i.current;if(!r&&f){const h=new CustomEvent(cI,{bubbles:!0,cancelable:!0});f.addEventListener(cI,m=>n==null?void 0:n(m),{once:!0}),Vh(f,h),h.defaultPrevented?d.current=!1:o.onClose()}};return a.jsx(Q6,{...s,ref:c,disabled:r,onClick:pe(e.onClick,u),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),d.current=!0},onPointerUp:pe(e.onPointerUp,f=>{var h;d.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:pe(e.onKeyDown,f=>{const h=l.searchRef.current!=="";r||h&&f.key===" "||AS.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Xb.displayName=Kx;var Q6=g.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...i}=e,o=k2(Kx,r),l=V6(r),c=g.useRef(null),d=Te(t,c),[u,f]=g.useState(!1),[h,m]=g.useState("");return g.useEffect(()=>{const v=c.current;v&&m((v.textContent??"").trim())},[i.children]),a.jsx(Dm.ItemSlot,{scope:r,disabled:n,textValue:s??h,children:a.jsx(qb,{asChild:!0,...l,focusable:!n,children:a.jsx(we.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:d,onPointerMove:pe(e.onPointerMove,Lm(v=>{n?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:pe(e.onPointerLeave,Lm(v=>o.onItemLeave(v))),onFocus:pe(e.onFocus,()=>f(!0)),onBlur:pe(e.onBlur,()=>f(!1))})})})}),APe="MenuCheckboxItem",J6=g.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return a.jsx(nB,{scope:e.__scopeMenu,checked:r,children:a.jsx(Xb,{role:"menuitemcheckbox","aria-checked":Yx(r)?"mixed":r,...s,ref:t,"data-state":T2(r),onSelect:pe(s.onSelect,()=>n==null?void 0:n(Yx(r)?!0:!r),{checkForDefaultPrevented:!1})})})});J6.displayName=APe;var Z6="MenuRadioGroup",[EPe,OPe]=Cc(Z6,{value:void 0,onValueChange:()=>{}}),eB=g.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,i=_t(n);return a.jsx(EPe,{scope:e.__scopeMenu,value:r,onValueChange:i,children:a.jsx(E2,{...s,ref:t})})});eB.displayName=Z6;var tB="MenuRadioItem",rB=g.forwardRef((e,t)=>{const{value:r,...n}=e,s=OPe(tB,e.__scopeMenu),i=r===s.value;return a.jsx(nB,{scope:e.__scopeMenu,checked:i,children:a.jsx(Xb,{role:"menuitemradio","aria-checked":i,...n,ref:t,"data-state":T2(i),onSelect:pe(n.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,r)},{checkForDefaultPrevented:!1})})})});rB.displayName=tB;var O2="MenuItemIndicator",[nB,TPe]=Cc(O2,{checked:!1}),aB=g.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,i=TPe(O2,r);return a.jsx(Zt,{present:n||Yx(i.checked)||i.checked===!0,children:a.jsx(we.span,{...s,ref:t,"data-state":T2(i.checked)})})});aB.displayName=O2;var MPe="MenuSeparator",sB=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return a.jsx(we.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});sB.displayName=MPe;var IPe="MenuArrow",iB=g.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Yb(r);return a.jsx($y,{...s,...n,ref:t})});iB.displayName=IPe;var $Pe="MenuSub",[pRe,oB]=Cc($Pe),Zf="MenuSubTrigger",lB=g.forwardRef((e,t)=>{const r=Pc(Zf,e.__scopeMenu),n=bp(Zf,e.__scopeMenu),s=oB(Zf,e.__scopeMenu),i=k2(Zf,e.__scopeMenu),o=g.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,d={__scopeMenu:e.__scopeMenu},u=g.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return g.useEffect(()=>u,[u]),g.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),a.jsx(C2,{asChild:!0,...d,children:a.jsx(Q6,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":uB(r.open),...e,ref:tp(t,s.onTriggerChange),onClick:f=>{var h;(h=e.onClick)==null||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:pe(e.onPointerMove,Lm(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),u()},100))})),onPointerLeave:pe(e.onPointerLeave,Lm(f=>{var m,v;u();const h=(m=r.content)==null?void 0:m.getBoundingClientRect();if(h){const p=(v=r.content)==null?void 0:v.dataset.side,x=p==="right",b=x?-5:5,y=h[x?"left":"right"],w=h[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+b,y:f.clientY},{x:y,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x:y,y:h.bottom}],side:p}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:pe(e.onKeyDown,f=>{var m;const h=i.searchRef.current!=="";e.disabled||h&&f.key===" "||pPe[n.dir].includes(f.key)&&(r.onOpenChange(!0),(m=r.content)==null||m.focus(),f.preventDefault())})})})});lB.displayName=Zf;var cB="MenuSubContent",dB=g.forwardRef((e,t)=>{const r=G6(ya,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,i=Pc(ya,e.__scopeMenu),o=bp(ya,e.__scopeMenu),l=oB(cB,e.__scopeMenu),c=g.useRef(null),d=Te(t,c);return a.jsx(Dm.Provider,{scope:e.__scopeMenu,children:a.jsx(Zt,{present:n||i.open,children:a.jsx(Dm.Slot,{scope:e.__scopeMenu,children:a.jsx(A2,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:d,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;o.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:pe(e.onFocusOutside,u=>{u.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:pe(e.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:pe(e.onKeyDown,u=>{var m;const f=u.currentTarget.contains(u.target),h=gPe[o.dir].includes(u.key);f&&h&&(i.onOpenChange(!1),(m=l.trigger)==null||m.focus(),u.preventDefault())})})})})})});dB.displayName=cB;function uB(e){return e?"open":"closed"}function Yx(e){return e==="indeterminate"}function T2(e){return Yx(e)?"indeterminate":e?"checked":"unchecked"}function RPe(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function DPe(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function LPe(e,t,r){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=DPe(e,Math.max(i,0));s.length===1&&(o=o.filter(d=>d!==r));const c=o.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function FPe(e,t){const{x:r,y:n}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],d=l.x,u=l.y,f=c.x,h=c.y;u>n!=h>n&&r<(f-d)*(n-u)/(h-u)+d&&(s=!s)}return s}function BPe(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return FPe(r,t)}function Lm(e){return t=>t.pointerType==="mouse"?e(t):void 0}var zPe=q6,UPe=C2,WPe=K6,HPe=Y6,VPe=E2,qPe=X6,GPe=Xb,KPe=J6,YPe=eB,XPe=rB,QPe=aB,JPe=sB,ZPe=iB,eke=lB,tke=dB,Qb="DropdownMenu",[rke,gRe]=ir(Qb,[H6]),wn=H6(),[nke,fB]=rke(Qb),hB=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,c=wn(t),d=g.useRef(null),[u,f]=vr({prop:s,defaultProp:i??!1,onChange:o,caller:Qb});return a.jsx(nke,{scope:t,triggerId:tn(),triggerRef:d,contentId:tn(),open:u,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(h=>!h),[f]),modal:l,children:a.jsx(zPe,{...c,open:u,onOpenChange:f,dir:n,modal:l,children:r})})};hB.displayName=Qb;var mB="DropdownMenuTrigger",pB=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,i=fB(mB,r),o=wn(r);return a.jsx(UPe,{asChild:!0,...o,children:a.jsx(we.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:tp(t,i.triggerRef),onPointerDown:pe(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:pe(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});pB.displayName=mB;var ake="DropdownMenuPortal",gB=e=>{const{__scopeDropdownMenu:t,...r}=e,n=wn(t);return a.jsx(WPe,{...n,...r})};gB.displayName=ake;var vB="DropdownMenuContent",xB=g.forwardRef((e,t)=>
694{const{__scopeDropdownMenu:r,...n}=e,s=fB(vB,r),i=wn(r),o=g.useRef(!1);return a.jsx(HPe,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...n,ref:t,onCloseAutoFocus:pe(e.onCloseAutoFocus,l=>{var c;o.current||(c=s.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:pe(e.onInteractOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,u=c.button===2||d;(!s.modal||u)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xB.displayName=vB;var ske="DropdownMenuGroup",ike=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wn(r);return a.jsx(VPe,{...s,...n,ref:t})});ike.displayName=ske;var oke="DropdownMenuLabel",yB=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wn(r);return a.jsx(qPe,{...s,...n,ref:t})});yB.displayName=oke;var lke="DropdownMenuItem",bB=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wn(r);return a.jsx(GPe,{...s,...n,ref:t})});bB.displayName=lke;var cke="DropdownMenuCheckboxItem",wB=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wn(r);return a.jsx(KPe,{...s,...n,ref:t})});wB.displayName=cke;var dke="DropdownMenuRadioGroup",uke=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wn(r);return a.jsx(YPe,{...s,...n,ref:t})});uke.displayName=dke;var fke="DropdownMenuRadioItem",jB=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wn(r);return a.jsx(XPe,{...s,...n,ref:t})});jB.displayName=fke;var hke="DropdownMenuItemIndicator",NB=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wn(r);return a.jsx(QPe,{...s,...n,ref:t})});NB.displayName=hke;var mke="DropdownMenuSeparator",SB=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wn(r);return a.jsx(JPe,{...s,...n,ref:t})});SB.displayName=mke;var pke="DropdownMenuArrow",gke=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wn(r);return a.jsx(ZPe,{...s,...n,ref:t})});gke.displayName=pke;var vke="DropdownMenuSubTrigger",_B=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wn(r);return a.jsx(eke,{...s,...n,ref:t})});_B.displayName=vke;var xke="DropdownMenuSubContent",CB=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=wn(r);return a.jsx(tke,{...s,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});CB.displayName=xke;var yke=hB,bke=pB,wke=gB,PB=xB,kB=yB,AB=bB,EB=wB,OB=jB,TB=NB,MB=SB,IB=_B,$B=CB;const Fm=yke,Bm=bke,jke=g.forwardRef(({className:e,inset:t,children:r,...n},s)=>a.jsxs(IB,{ref:s,className:me("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...n,children:[r,a.jsx(Zd,{className:"ml-auto h-4 w-4"})]}));jke.displayName=IB.displayName;const Nke=g.forwardRef(({className:e,...t},r)=>a.jsx($B,{ref:r,className:me("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Nke.displayName=$B.displayName;const $u=g.forwardRef(({className:e,sideOffset:t=4,...r},n)=>
694a.jsx(wke,{children:a.jsx(PB,{ref:n,sideOffset:t,className:me("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-background p-1 text-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));$u.displayName=PB.displayName;const Fr=g.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(AB,{ref:n,className:me("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...r}));Fr.displayName=AB.displayName;const Ske=g.forwardRef(({className:e,children:t,checked:r,...n},s)=>a.jsxs(EB,{ref:s,className:me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:r,...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(TB,{children:a.jsx(q_,{className:"h-4 w-4"})})}),t]}));Ske.displayName=EB.displayName;const _ke=g.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(OB,{ref:n,className:me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(TB,{children:a.jsx(qR,{className:"h-2 w-2 fill-current"})})}),t]}));_ke.displayName=OB.displayName;const Cke=g.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(kB,{ref:n,className:me("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));Cke.displayName=kB.displayName;const zm=g.forwardRef(({className:e,...t},r)=>a.jsx(MB,{ref:r,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));zm.displayName=MB.displayName;const Pke={completed:"bg-success text-white",pending:"bg-warning text-foreground",active:"bg-info text-white"};function kke(){const{user:e}=it(),[t,r]=g.useState([]),[n,s]=g.useState(!0);return g.useEffect(()=>{async function i(){if(!e){s(!1);return}try{const{data:o,error:l}=await Z.from("contracts").select("id, title, contract_value, status, created_at, industry").eq("user_id",e.id).order("created_at",{ascending:!1});l?console.error("Error fetching contracts:",l):r(o||[])}catch(o){console.error("Exception fetching contracts:",o)}finally{s(!1)}}i()},[e]),n?a.jsxs(J,{className:"glass-card hover-lift",children:[a.jsx(de,{className:"flex flex-row items-center justify-between",children:a.jsx(le,{children:"Recent Contracts"})}),a.jsx(re,{className:"flex items-center justify-center py-8",children:a.jsx(Je,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]}):t.length===0?a.jsxs(J,{className:"glass-card hover-lift",children:[a.jsx(de,{className:"flex flex-row items-center justify-between",children:a.jsx(le,{children:"Recent Contracts"})}),a.jsxs(re,{className:"text-center py-8 text-muted-foreground",children:[a.jsx("p",{children:"No contracts yet. Upload your first contract to get started!"}),a.jsx(U,{asChild:!0,className:"mt-4",size:"sm",children:a.jsx(je,{to:"/contracts",children:"Upload Contract"})})]})]}):a.jsxs(J,{className:"glass-card hover-lift",children:[a.jsxs(de,{className:"flex flex-row items-center justify-between",children:[a.jsx(le,{children:"Recent Contracts"}),a.jsx(U,{asChild:!0,variant:"outline",size:"sm",children:a.jsx(je,{to:"/contracts",children:"View All"})})]}),a.jsx(re,{children:a.jsx("div",{className:"space-y-4",children:t.map(i=>a.jsxs("div",{className:"flex items-center justify-between p-4 border border-border rounded-lg hover:bg-muted/50 transition-colors",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h4",{className:"font-medium",children:i.title}),a.jsx(ve,{className:Pke[i.status]||"bg-muted",children:i.status})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:i.industry||"Industry not specified"}),a.jsx("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:a.jsx("span",{children:new Date(i.created_at).toLocaleDateString()})})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"text-right",children:a.jsx("div",{className:"font-semibold text-lg",children:i.contract_value!==null&&i.contract_value!==void 0?`$${(i.contract_value/1e3).toFixed(0)}K`:"Value TBD"})}),a.jsxs(Fm,{children:[a.jsx(Bm,{asChild:!0,children:a.jsx(U,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(Eq,{className:"h-4 w-4"})})}),a.jsx($u,{align:"end",children:a.jsxs(Fr,{children:[a.jsx(ci,{className:"mr-2 h-4 w-4"}),"View Details"]}
vendor: 5,204 bytes, lines 694-698
694)})]})]})]},i.id))})})]})}var Jb="Dialog",[RB,DB]=ir(Jb),[Ake,ds]=RB(Jb),LB=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,l=g.useRef(null),c=g.useRef(null),[d,u]=vr({prop:n,defaultProp:s??!1,onChange:i,caller:Jb});return a.jsx(Ake,{scope:t,triggerRef:l,contentRef:c,contentId:tn(),titleId:tn(),descriptionId:tn(),open:d,onOpenChange:u,onOpenToggle:g.useCallback(()=>u(f=>!f),[u]),modal:o,children:r})};LB.displayName=Jb;var FB="DialogTrigger",BB=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ds(FB,r),i=Te(t,s.triggerRef);return a.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":$2(s.open),...n,ref:i,onClick:pe(e.onClick,s.onOpenToggle)})});BB.displayName=FB;var M2="DialogPortal",[Eke,zB]=RB(M2,{forceMount:void 0}),UB=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,i=ds(M2,t);return a.jsx(Eke,{scope:t,forceMount:r,children:g.Children.map(n,o=>a.jsx(Zt,{present:r||i.open,children:a.jsx(Vu,{asChild:!0,container:s,children:o})}))})};UB.displayName=M2;var Xx="DialogOverlay",WB=g.forwardRef((e,t)=>{const r=zB(Xx,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=ds(Xx,e.__scopeDialog);return i.modal?a.jsx(Zt,{present:n||i.open,children:a.jsx(Tke,{...s,ref:t})}):null});WB.displayName=Xx;var Oke=$o("DialogOverlay.RemoveScroll"),Tke=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ds(Xx,r);return a.jsx(xp,{as:Oke,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(we.div,{"data-state":$2(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),fc="DialogContent",HB=g.forwardRef((e,t)=>{const r=zB(fc,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=ds(fc,e.__scopeDialog);return a.jsx(Zt,{present:n||i.open,children:i.modal?a.jsx(Mke,{...s,ref:t}):a.jsx(Ike,{...s,ref:t})})});HB.displayName=fc;var Mke=g.forwardRef((e,t)=>{const r=ds(fc,e.__scopeDialog),n=g.useRef(null),s=Te(t,r.contentRef,n);return g.useEffect(()=>{const i=n.current;if(i)return Gb(i)},[]),a.jsx(VB,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:pe(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:pe(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:pe(e.onFocusOutside,i=>i.preventDefault())})}),Ike=g.forwardRef((e,t)=>{const r=ds(fc,e.__scopeDialog),n=g.useRef(!1),s=g.useRef(!1);return a.jsx(VB,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),VB=g.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,l=ds(fc,r),c=g.useRef(null),d=Te(t,c);return Hb(),a.jsxs(a.Fragment,{children:[a.jsx(gp,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(qo,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":$2(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(Rke,{titleId:l.titleId}),a.jsx(Lke,{contentRef:c,descriptionId:l.descriptionId})]})]})}),I2="DialogTitle",qB=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ds(I2,r);return a.jsx(we.h2,{id:s.titleId,...n,ref:t})});qB.displayName=I2;var GB="DialogDescription",KB=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ds(GB,r);return a.jsx(we.p,{id:s.descriptionId,...n,ref:t})});KB.displayName=GB;var YB="DialogClose",XB=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ds(YB,r);return a.jsx(we.button,{type:"button",...n,ref:t,onClick:pe(e.onClick,()=>s.onOpenChange(!1))})});XB.displayName=YB;function $2(e){return e?"open":"closed"}var QB="DialogTitleWarning",[$ke,JB]=I7(QB,{contentName:fc,titleName:I2,docsSlug:"dialog"}),Rke=({titleId:e})=>{const t=JB(QB),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 695 696If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 697 698For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Dke="DialogDescriptionWarning",Lke=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${JB(Dke).contentName}}.`;return g.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},R2=LB,D2=BB,L2=UB,wp=WB,jp=HB,Np=qB,Sp=KB,Zb=XB;const rn=R2,hc=D2,Fke=L2,ZB=g.forwardRef(({className:e,...t},r)=>
698a.jsx(wp,{ref:r,className:me("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ZB.displayName=wp.displayName;const Wr=g.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Fke,{children:[a.jsx(ZB,{}),a.jsxs(jp,{ref:n,className:me("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,a.jsxs(Zb,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[a.jsx(es,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Wr.displayName=jp.displayName;const Hr=({className:e,...t})=>a.jsx("div",{className:me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Hr.displayName="DialogHeader";const Qx=({className:e,...t})=>a.jsx("div",{className:me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Qx.displayName="DialogFooter";const Vr=g.forwardRef(({className:e,...t},r)=>a.jsx(Np,{ref:r,className:me("text-lg font-semibold leading-none tracking-tight",e),...t}));Vr.displayName=Np.displayName;const ba=g.forwardRef(({className:e,...t},r)=>a.jsx(Sp,{ref:r,className:me("text-sm text-muted-foreground",e),...t}));ba.displayName=Sp.displayName;const Bke=ki("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Zs=g.forwardRef(({className:e,variant:t,...r},n)=>a.jsx("div",{ref:n,role:"alert",className:me(Bke({variant:t}),e),...r}));Zs.displayName="Alert";const zke=g.forwardRef(({className:e,...t},r)=>a.jsx("h5",{ref:r,className:me("mb-1 font-medium leading-none tracking-tight",e),...t}));zke.displayName="AlertTitle";const ei=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:me("text-sm [&_p]:leading-relaxed",e),...t}));ei.displayName="AlertDescription";function e8({open:e,onOpenChange:t,documentUrl:r,title:n}){const[s,i]=g.useState(!1),[o,l]=g.useState(!0);if(!r)return null;const c=`https://docs.google.com/viewer?url=${encodeURIComponent(r)}&embedded=true`,d=o?c:r,u=()=>{i(!0)},f=()=>{l(!o),i(!1)};return a.jsx(rn,{open:e,onOpenChange:t,children:a.jsxs(Wr,{className:"max-w-6xl h-[90vh] p-0 flex flex-col",children:[a.jsx(Hr,{className:"px-6 py-4 border-b shrink-0",children:a.jsxs("div",{className:"flex items-center justify-between gap-4",children:[a.jsxs("div",{children:[a.jsxs(Vr,{className:"text-lg font-semibold flex items-center gap-2",children:[a.jsx(gt,{className:"h-5 w-5"}),n]}),a.jsx(ba,{className:"sr-only",children:"Document viewer for solicitation attachment"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(U,{variant:"outline",size:"sm",onClick:f,title:o?"Try direct view":"Use Google Viewer",children:[a.jsx(Ur,{className:"h-4 w-4 mr-2"}),o?"Direct View":"Google Viewer"]}),a.jsxs(U,{variant:"outline",size:"sm",onClick:()=>window.open(r,"_blank"),children:[a.jsx(ft,{className:"h-4 w-4 mr-2"}),"Open Original"]})]})]})}),a.jsx("div",{className:"flex-1 overflow-hidden bg-muted/30 relative",children:s?a.jsx("div",{className:"p-6 h-full overflow-auto flex items-center justify-center",children:a.jsx(Zs,{className:"max-w-2xl",children:a.jsxs(ei,{className:"flex flex-col gap-4",children:[a.jsx("p",{className:"text-sm",children:"Unable to preview this document. This may happen if the document is restricted or requires authentication."}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(U,{onClick:()=>{i(!1),f()},size:"sm",variant:"outline",children:[a.jsx(Ur,{className:"h-4 w-4 mr-2"}),"Try Alternative Viewer"]}),a.jsxs(U,{onClick:()=>window.open(r,"_blank"),size:"sm",children:[a.jsx(ft,{className:"h-4 w-4 mr-2"}),"View on SAM.gov"]})]})]})})}):a.jsx("iframe",{src:d,className:"w-full h-full border-0",title:n,onError:u,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms"})})]})})}function Uke(){const{user:e}=it(),t=vt(),[r,n]=g.useState([]),[s,i]=g.useState(!0),[o,l]=g.useState(null),c=m=>{We.success(`Added "${m.title}" to pipeline`)},d=m=>{We.success(`Preparing price bid for "${m.title}"`),t("/bid-results")},u=m=>{var p,x;let v=m.url;(p=m.metadata)!=null&&p.attachmentUrls&&m.metadata.attachmentUrls.length>0?v=m.metadata.attachmentUrls[0]:(x=m.metadata)!=null&&x.documentLinks&&m.metadata.documentLinks.length>0&&(v=m.metadata.documentLinks[0].url),v?l({url:v,title:m.title}):We.error("No document available for this opportunity")};g.useEffect(()=>{async function m(){if(!e){i(!1);return}try{const{data:v,error:p}=await Z.from("profiles").select("naics_codes, industry").eq("user_id",e.id).single();if(p){console.error("Error fetching profile:",p),i(!1);return}let x=Z.from("solicitations").select("*").eq("status","active").order("posted_date",{ascending:!1});if(v!=null&&v.naics_codes&&v.naics_codes.length>0){const _=v.naics_codes.map(N=>`naics_codes.cs.{${N}}`).join(",");x=x.or(_)}v!=null&&v.industry&&(x=x.or(`industry.ilike.%${v.industry}%`));const b=new Date;
698b.setDate(b.getDate()-7),x=x.gte("posted_date",b.toISOString()),x=x.limit(10);const{data:y,error:w}=await x;w?(console.error("Error fetching opportunities:",w),We.error("Failed to load opportunities")):n(y||[])}catch(v){console.error("Exception fetching opportunities:",v),We.error("An error occurred while loading opportunities")}finally{i(!1)}}m()},[e]);const f=(m,v)=>m&&v?`$${(m/1e3).toFixed(0)}K - $${(v/1e3).toFixed(0)}K`:m?`$${(m/1e3).toFixed(0)}K+`:v?`Up to $${(v/1e3).toFixed(0)}K`:"Value TBD",h=m=>{if(!m)return null;const v=new Date(m),p=new Date,x=Math.ceil((v.getTime()-p.getTime())/(1e3*60*60*24));return x<0?"Expired":x===0?"Today":x===1?"Tomorrow":x<=7?`${x} days left`:v.toLocaleDateString()};return s?a.jsxs(J,{className:"glass-card",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(_d,{className:"h-5 w-5"}),"Daily Opportunities"]})}),a.jsx(re,{className:"flex items-center justify-center py-8",children:a.jsx(Je,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]}):r.length===0?a.jsxs(J,{className:"glass-card",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(_d,{className:"h-5 w-5"}),"Daily Opportunities"]})}),a.jsx(re,{className:"text-center py-8 text-muted-foreground",children:a.jsx("p",{children:"No matching opportunities found. Update your profile with NAICS codes and industry preferences to see personalized opportunities."})})]}):a.jsxs(J,{className:"glass-card",children:[a.jsxs(de,{className:"flex flex-row items-center justify-between",children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(_d,{className:"h-5 w-5"}),"Daily Opportunities (",r.length,")"]}),a.jsx(U,{asChild:!0,variant:"outline",size:"sm",children:a.jsx("a",{href:"/opportunities",children:"View All"})})]}),a.jsx(re,{children:a.jsx("div",{className:"space-y-3",children:r.map(m=>{var v,p,x;return a.jsxs("div",{className:"group relative flex flex-col gap-3 p-3 border border-border rounded-lg hover:border-primary/50 hover:bg-primary/5 transition-all",children:[a.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-gradient-to-b from-primary to-primary/50 rounded-l-lg"}),a.jsx("div",{className:"flex items-start gap-3 pl-2",children:a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx("h4",{className:"font-medium text-sm line-clamp-1 flex-1",children:m.title}),m.url&&a.jsx(U,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx("a",{href:m.url,target:"_blank",rel:"noopener noreferrer",children:a.jsx(ft,{className:"h-3.5 w-3.5"})})})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1.5",children:[m.agency&&a.jsx(ve,{variant:"secondary",className:"text-xs h-5 px-2 bg-secondary/60",children:m.agency}),a.jsx(ve,{className:"text-xs h-5 px-2 bg-primary/10 text-primary border-primary/20",children:m.source_platform}),m.opportunity_type&&a.jsx(ve,{variant:"outline",className:"text-xs h-5 px-2",children:m.opportunity_type})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs mb-1.5",children:[a.jsx("span",{className:"font-semibold text-primary",children:f(m.contract_value_min,m.contract_value_max)}),m.response_deadline&&a.jsxs("span",{className:`flex items-center gap-1 ${(v=h(m.response_deadline))!=null&&v.includes("day")?"text-warning font-medium":"text-muted-foreground"}`,children:["ð
",h(m.response_deadline)]}),m.posted_date&&a.jsx("span",{className:"text-muted-foreground",children:new Date(m.posted_date).toLocaleDateString()})]}),(m.poc_name||m.poc_email)&&a.jsxs("div",{className:"flex flex-col gap-0.5 text-xs text-muted-foreground bg-muted/50 p-2 rounded border border-border/50",children:[a.jsx("div",{className:"font-medium text-foreground mb-0.5",children:"Contracting Officer"}),m.poc_name&&a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"font-medium",children:"Name:"}),a.jsx("span",{children:m.poc_name}),m.poc_title&&a.jsxs("span",{className:"text-muted-foreground",children:["(",m.poc_title,")"]})]}),m.poc_email&&a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"font-medium",children:"Email:"}),a.jsx("a",{href:`mailto:${m.poc_email}`,className:"text-primary hover:underline",children:m.poc_email})]}),m.poc_phone&&a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"font-medium",children:"Phone:"}),a.jsx("a",{href:`tel:${m.poc_phone}`,className:"text-primary hover:underline",children:m.poc_phone})]})]})]})}),a.jsxs("div",{className:"flex items-center justify-end gap-2 pl-2",children:[(m.url||((p=m.metadata)==null?void 0:p.attachmentUrls)||((x=m.metadata)==null?void 0:x.documentLinks))&&a.jsxs(U,{size:"sm",variant:"outline",onClick:()=>u(m),className:"h-7 text-xs",children:[a.jsx(gt,{className:"h-3 w-3 mr-1"}),"View Document"]}),a.jsxs(U,{size:"sm",variant:"outline",onClick:()=>c(m),className:"h-7 text-xs",children:[a.jsx(gn,{className:"h-3 w-3 mr-1"}),"Add to Pipeline"]}),a.jsxs(U,{size:"sm",onClick:()=>d(m),className:"h-7 text-xs",children:[a.jsx(Jt,{className:"h-3 w-3 mr-1"}),"Send to PriceBid"]})]})]},m.id)})})}),a.jsx(e8,{open:!!o,onOpenChange:m=>!m&&l(null),documentUrl:(o==null?void 0:o.url)||null,title:(o==null?void 0:o.title)||""})]})}const Pg=768;function t8(){const[e,t]=g.useState(()=>typeof window<"u"?window.innerWidth<Pg:!1);return g.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Pg-1}px)`),n=()=>{t(window.innerWidth<Pg)};
698return r.addEventListener("change",n),t(window.innerWidth<Pg),()=>r.removeEventListener("change",n)},[]),e}const ge=g.forwardRef(({className:e,type:t,...r},n)=>a.jsx("input",{type:t,className:me("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));ge.displayName="Input";var Wke="Separator",dI="horizontal",Hke=["horizontal","vertical"],r8=g.forwardRef((e,t)=>{const{decorative:r,orientation:n=dI,...s}=e,i=Vke(n)?n:dI,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(we.div,{"data-orientation":i,...l,...s,ref:t})});r8.displayName=Wke;function Vke(e){return Hke.includes(e)}var n8=r8;const St=g.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>a.jsx(n8,{ref:s,decorative:r,orientation:t,className:me("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));St.displayName=n8.displayName;const e0=R2,F2=D2,qke=L2,a8=g.forwardRef(({className:e,...t},r)=>
698a.jsx(wp,{className:me("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));a8.displayName=wp.displayName;const Gke=ki("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),_p=g.forwardRef(({side:e="right",className:t,children:r,...n},s)=>a.jsxs(qke,{children:[a.jsx(a8,{}),a.jsxs(jp,{ref:s,className:me(Gke({side:e}),t),...n,children:[r,a.jsxs(Zb,{className:"absolute right-4 top-4 roun
698ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[a.jsx(es,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));_p.displayName=jp.displayName;const t0=({className:e,...t})=>a.jsx("div",{className:me("flex flex-col space-y-2 text-center sm:text-left",e),...t});t0.displayName="SheetHeader";const r0=g.forwardRef(({className:e,...t},r)=>a.jsx(Np,{ref:r,className:me("text-lg font-semibold text-foreground",e),...t}));r0.displayName=Np.displayName;const Kke=g.forwardRef(({className:e,...t},r)=>a.jsx(Sp,{ref:r,className:me("text-sm text-muted-foreground",e),...t}));Kke.displayName=Sp.displayName;function uI({className:e,...t}){return a.jsx("div",{className:me("animate-pulse rounded-md bg-muted",e),...t})}const Yke="sidebar:state",Xke=60*60*24*7,Qke="16rem",Jke="18rem",Zke="3rem",eAe="b",s8=g.createContext(null);function Cp(){const e=g.useContext(s8);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const i8=g.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:s,children:i,...o},l)=>{const c=t8(),[d,u]=g.useState(!1),[f,h]=g.useState(e),m=t??f,v=g.useCallback(y=>{const w=typeof y=="function"?y(m):y;r?r(w):h(w),document.cookie=`${Yke}=${w}; path=/; max-age=${Xke}`},[r,m]),p=g.useCallback(()=>c?u(y=>!y):v(y=>!y),[c,v,u]);g.useEffect(()=>{const y=w=>{w.key===eAe&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),p())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[p]);const x=m?"expanded":"collapsed",b=g.useMemo(()=>({state:x,open:m,setOpen:v,isMobile:c,openMobile:d,setOpenMobile:u,toggleSidebar:p}),[x,m,v,c,d,u,p]);return a.jsx(s8.Provider,{value:b,children:a.jsx(iC,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":Qke,"--sidebar-width-icon":Zke,...s},className:me("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:l,...o,children:i})})})});i8.displayName="SidebarProvider";const o8=g.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:s,...i},o)=>{const{isMobile:l,state:c,openMobile:d,setOpenMobile:u}=Cp();return r==="none"?a.jsx("div",{className:me("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:o,...i,children:s}):l?a.jsx(e0,{open:d,onOpenChange:u,...i,children:a.jsx(_p,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Jke},side:e,children:a.jsx("div",{className:"flex h-full w-full flex-col",children:s})})}):a.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?r:"","data-variant":t,"data-side":e,children:[a.jsx("div",{className:me("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),a.jsx("div",{className:me("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...i,children:a.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:s})})]})});o8.displayName="Sidebar";const l8=g.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:s}=Cp();return a.jsxs(U,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:me("h-7 w-7",e),onClick:i=>{t==null||t(i),s()},...r,children:[a.jsx(Wq,{}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});l8.displayName="SidebarTrigger";const tAe=g.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=Cp();return a.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:me("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 hover:after:bg-sidebar-border sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});tAe.displayName="SidebarRail";const rAe=g.forwardRef(({className:e,...t},r)=>a.jsx("main",{ref:r,className:me("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-
698h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));rAe.displayName="SidebarInset";const nAe=g.forwardRef(({className:e,...t},r)=>a.jsx(ge,{ref:r,"data-sidebar":"input",className:me("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));nAe.displayName="SidebarInput";const aAe=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"header",className:me("flex flex-col gap-2 p-2",e),...t}));aAe.displayName="SidebarHeader";const sAe=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"footer",className:me("flex flex-col gap-2 p-2",e),...t}));sAe.displayName="SidebarFooter";const iAe=g.forwardRef(({className:e,...t},r)=>a.jsx(St,{ref:r,"data-sidebar":"separator",className:me("mx-2 w-auto bg-sidebar-border",e),...t}));iAe.displayName="SidebarSeparator";const c8=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"content",className:me("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));c8.displayName="SidebarContent";const Qg=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"group",className:me("relative flex w-full min-w-0 flex-col p-2",e),...t}));Qg.displayName="SidebarGroup";const Jg=g.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const s=t?Hu:"div";return a.jsx(s,{ref:n,"data-sidebar":"group-label",className:me("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});Jg.displayName="SidebarGroupLabel";const oAe=g.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const s=t?Hu:"button";return a.jsx(s,{ref:n,"data-sidebar":"group-action",className:me("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...r})});oAe.displayName="SidebarGroupAction";const Zg=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"group-content",className:me("w-full text-sm",e),...t}));Zg.displayName="SidebarGroupContent";const ev=g.forwardRef(({className:e,...t},r)=>a.jsx("ul",{ref:r,"data-sidebar":"menu",className:me("flex w-full min-w-0 flex-col gap-1",e),...t}));ev.displayName="SidebarMenu";const tv=g.forwardRef(({className:e,...t},r)=>a.jsx("li",{ref:r,"data-sidebar":"menu-item",className:me("group/menu-item relative",e),...t}));tv.displayName="SidebarMenuItem";const lAe=ki("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),rv=g.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:s,className:i,...o},l)=>{const c=e?Hu:"button",{isMobile:d,state:u}=Cp(),f=a.jsx(c,{ref:l,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:me(lAe({variant:r,size:n}),i),...o});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(RD,{children:[a.jsx(DD,{asChild:!0,children:f}),a.jsx(oC,{side:"right",align:"center",hidden:u!=="collapsed"||d,...s})]})):f});rv.displayName="SidebarMenuButton";const cAe=g.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},s)=>{const i=t?Hu:"button";return a.jsx(i,{ref:s,"data-sidebar":"menu-action",className:me("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})});cAe.displayName="SidebarMenuAction";const dAe=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:me("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));dAe.displayName="SidebarMenuBadge";const uAe=g.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const s=g.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:me("flex h-8 items-center gap-2 rounded-md px-2",e),...r,children:[t&&a.jsx(uI,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),a.jsx(uI,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});uAe.displayName="SidebarMenuSkeleton";const fAe=g.forwardRef(({className:e,...t},r)=>a.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:me("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));fAe.displayName="SidebarMenuSub";const hAe=g.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));hAe.displayName="SidebarMenuSubItem";const mAe=g.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...s},i)=>{const o=e?Hu:"a";return a.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:me("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...s})});mAe.displayName="SidebarMenuSubButton";const pAe="https://inmykxarbjptsgqibnbs.supabase.co",gAe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImlubXlreGFyYmpwdHNncWlibmJzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTg4MzM0OTcsImV4cCI6MjA3NDQwOTQ5N30.1Iui3SJ147OrAZ7DJfhVoW_KUQmr5aGoFugJJVEEtaM",lt=O5(pAe,gAe),al=()=>{const[e,t]=g.useState(null),[r,n]=g.useState(!1),[s,i]=g.useState(!0),{user:o}=it();return g.useEffect(()=>{(async()=>
698{if(!o){t(null),n(!1),i(!1);return}try{const{data:m,error:v}=await lt.rpc("is_admin",{_user_id:o.id});v?console.error("Error checking admin status:",v):n(m||!1);const{data:p,error:x}=await lt.from("user_roles").select("role").eq("user_id",o.id);x?(console.error("Error fetching user roles:",x),t("basic")):p&&p.length>0?p.some(b=>b.role==="admin")?t("admin"):p.some(b=>b.role==="premium")?t("premium"):t("basic"):t("basic")}catch(m){console.error("Error in fetchUserRole:",m),t("basic"),n(!1)}finally{i(!1)}})()},[o]),{role:e,isAdmin:r,loading:s,hasRole:h=>!e||!h?!1:r?!0:h==="premium"?e==="premium":h==="basic"?["basic","premium"].includes(e):e===h,canUploadContracts:()=>r||e!==null,canGenerateBids:()=>r||e!==null,canAccessAnalytics:()=>r||e==="premium",needsUpgrade:()=>!r&&e==="basic"}},vAe=[{title:"Dashboard",url:"/dashboard",icon:$s},{title:"Profile",url:"/profile",icon:Jt},{title:"PRICE BID",url:"/calculator",icon:rc},{title:"Pipeline",url:"/contracts",icon:gt},{title:"Contracts",url:"/opportunities",icon:_d},{title:"Directory",url:"/directory",icon:Mr},{title:"Price Trends",url:"/trends",icon:Ft},{title:"Financing",url:"/financing",icon:Os},{title:"Support",url:"/support",icon:G_,extraSpacing:!0}],xAe=[{title:"Settings",url:"/settings",icon:eu}],yAe=[{title:"User Management",url:"/admin/users",icon:XR},{title:"Leads Management",url:"/admin/leads",icon:Mr},{title:"Traffic",url:"/admin/traffic",icon:V_},{title:"Contracts CRM",url:"/admin/contracts-crm",icon:Mq},{title:"My Contracts",url:"/admin/my-contracts",icon:Pq}];function bAe(){const{state:e}=Cp();Bs().pathname;const r=e==="collapsed",{isAdmin:n}=al();return a.jsx(o8,{className:`${r?"w-14":"w-64"} glass-card-intense border-r-0`,children:a.jsxs(c8,{children:[a.jsx("div",{className:"px-4 py-6 border-b border-border/30 hero-gradient relative overflow-hidden",children:a.jsxs(je,{to:"/",className:"flex items-center gap-3 cursor-pointer hover-scale smooth-transition",children:[a.jsx("div",{className:"w-10 h-10 bg-white/30 rounded-xl flex items-center justify-center shadow-lg backdrop-blur-sm pulse-glow font-bold text-white text-sm",children:"PB"}),!r&&a.jsx("h2",{className:"font-bold text-xl text-white floating",children:"PriceBid"})]})}),a.jsxs(Qg,{className:"px-3 py-4",children:[a.jsx(Jg,{className:"text-muted-foreground font-semibold text-xs uppercase tracking-wider mb-2",children:"Main Navigation"}),a.jsx(Zg,{children:a.jsx(ev,{children:vAe.map(s=>a.jsx(tv,{className:s.extraSpacing?"mt-8":"",children:a.jsx(rv,{asChild:!0,children:a.jsxs(nw,{to:s.url,end:s.url==="/dashboard",className:({isActive:i})=>s.title==="Support"?i?"flex items-center rounded-xl px-4 py-3 mb-1 bg-white text-primary font-medium shadow-lg smooth-transition":"flex items-center rounded-xl px-4 py-3 mb-1 bg-white/85 text-primary hover:bg-white smooth-transition hover-scale":i?"flex items-center rounded-xl px-4 py-3 mb-1 hero-gradient text-white font-medium shadow-lg hover-glow smooth-transition":"flex items-center rounded-xl px-4 py-3 mb-1 text-foreground hover:bg-accent/50 hover:text-accent-foreground smooth-transition hover-scale",children:[a.jsx(s.icon,{className:"w-5 h-5 flex-shrink-0"}),!r&&a.jsx("span",{className:"ml-3 font-medium",children:s.title})]})})},s.title))})})]}),n&&a.jsxs(Qg,{className:"px-3 py-4",children:[a.jsx(Jg,{className:"text-muted-foreground font-semibold text-xs uppercase tracking-wider mb-2",children:"Admin"}),a.jsx(Zg,{children:a.jsx(ev,{children:yAe.map(s=>a.jsx(tv,{children:a.jsx(rv,{asChild:!0,children:a.jsxs(nw,{to:s.url,className:({isActive:i})=>i?"flex items-center rounded-xl px-4 py-3 mb-1 hero-gradient text-white font-medium shadow-lg hover-glow smooth-transition":"flex items-center rounded-xl px-4 py-3 mb-1 text-foreground hover:bg-accent/50 hover:text-accent-foreground smooth-transition hover-scale",children:[a.jsx(s.icon,{className:"w-5 h-5 flex-shrink-0"}),!r&&a.jsx("span",{className:"ml-3 font-medium",children:s.title})]})})},s.title))})})]}),a.jsxs(Qg,{className:"px-3 py-4 mt-auto",children:[a.jsx(Jg,{className:"text-muted-foreground font-semibold text-xs uppercase tracking-wider mb-2",children:"Settings"}),a.jsx(Zg,{children:a.jsx(ev,{children:xAe.map(s=>a.jsx(tv,{children:a.jsx(rv,{asChild:!0,children:a.jsxs(nw,{to:s.url,className:({isActive:i})=>i?"flex items-center rounded-xl px-4 py-3 mb-1 hero-gradient text-white font-medium shadow-lg hover-glow smooth-transition":"flex items-center rounded-xl px-4 py-3 mb-1 text-foreground hover:bg-accent/50 hover:text-accent-foreground smooth-transition hover-scale",children:[a.jsx(s.icon,{className:"w-5 h-5 flex-shrink-0"}),!r&&a.jsx("span",{className:"ml-3 font-medium",children:s.title})]})})},s.title))})})]})]})})}var d8={exports:{}},u8={};/** 699 * @license React 700 * use-sync-external-store-shim.production.js 701 * 702 * Copyright (c) Meta Platforms, Inc. and affiliates. 703 * 704 * This source code is licensed under the MIT license found in the 705 * LICENSE file in the root directory of this source tree. 706 */var Ru=g;function wAe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jAe=typeof Object.is=="function"?Object.is:wAe,NAe=Ru.useState,SAe=Ru.useEffect,_Ae=Ru.useLayoutEffect,CAe=Ru.useDebugValue;function PAe(e,t){var r=t(),n=NAe({inst:{value:r,getSnapshot:t}}),s=n[0].inst,i=n[1];return _Ae(function(){s.value=r,s.getSnapshot=t,Kw(s)&&i({inst:s})},[e,r,t]),SAe(function(){return Kw(s)&&i({inst:s}),e(function(){Kw(s)&&i({inst:s})})},[e]),CAe(r),r}function Kw(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!jAe(e,r)}catch{return!0}}function kAe(e,t){return t()}var AAe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?kAe:PAe;u8.useSyncExternalStore=Ru.useSyncExternalStore!==void 0?Ru.useSyncExternalStore:AAe;d8.exports=u8;var EAe=d8.exports;function OAe(){return EAe.useSyncExternalStore(TAe,()=>!0,()=>!1)}function TAe(){return()=>{}}var B2="Avatar",[MAe,vRe]=ir(B2),[IAe,f8]=MAe(B2),h8=g.forwardRef((e,t)=>
vendor: 1,446 bytes, line 706
706{const{__scopeAvatar:r,...n}=e,[s,i]=g.useState("idle");return a.jsx(IAe,{scope:r,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:a.jsx(we.span,{...n,ref:t})})});h8.displayName=B2;var m8="AvatarImage",p8=g.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:s=()=>{},...i}=e,o=f8(m8,r),l=$Ae(n,i),c=_t(d=>{s(d),o.onImageLoadingStatusChange(d)});return Kt(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?a.jsx(we.img,{...i,ref:t,src:n}):null});p8.displayName=m8;var g8="AvatarFallback",v8=g.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...s}=e,i=f8(g8,r),[o,l]=g.useState(n===void 0);return g.useEffect(()=>{if(n!==void 0){const c=window.setTimeout(()=>l(!0),n);return()=>window.clearTimeout(c)}},[n]),o&&i.imageLoadingStatus!=="loaded"?a.jsx(we.span,{...s,ref:t}):null});v8.displayName=g8;function fI(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function $Ae(e,{referrerPolicy:t,crossOrigin:r}){const n=OAe(),s=g.useRef(null),i=n?(s.current||(s.current=new window.Image),s.current):null,[o,l]=g.useState(()=>fI(i,e));return Kt(()=>{l(fI(i,e))},[i,e]),Kt(()=>{const c=f=>()=>{l(f)};if(!i)return;const d=c("loaded"),u=c("error");return i.addEventListener("load",d),i.addEventListener("error",u),t&&(i.referrerPolicy=t),typeof r=="string"&&(i.crossOrigin=r),()=>{i.removeEventListener("load",d),i.removeEventListener("error",u)}},[i,r,t]),o}var x8=h8,y8=p8,b8=v8;
706const Jx=g.forwardRef(({className:e,...t},r)=>a.jsx(x8,{ref:r,className:me("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Jx.displayName=x8.displayName;const w8=g.forwardRef(({className:e,...t},r)=>a.jsx(y8,{ref:r,className:me("aspect-square h-full w-full",e),...t}));w8.displayName=y8.displayName;const Zx=g.forwardRef(({className:e,...t},r)=>a.jsx(b8,{ref:r,className:me("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Zx.displayName=b8.displayName;function Ci(){return a.jsxs("footer",{className:"relative bg-gradient-to-br from-purple-900/90 via-blue-900/80 to-purple-800/90 backdrop-blur-sm border-t border-purple-500/20",children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-purple-600/10 via-blue-600/10 to-purple-600/10 opacity-50"}),a.jsxs("div",{className:"relative max-w-7xl mx-auto px-6 py-12",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-8 mb-8",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-white",children:"Contact Us"}),a.jsxs("ul",{className:"space-y-3 text-sm text-purple-100",children:[a.jsx("li",{children:a.jsxs(je,{to:"/support",className:"hover:text-white transition-colors hover:translate-x-1 transform duration-200 flex items-center gap-1",children:[a.jsx("span",{className:"w-1 h-1 bg-blue-400 rounded-full"}),"Contact Form"]})}),a.jsx("li",{children:a.jsxs(je,{to:"/support",className:"hover:text-white transition-colors hover:translate-x-1 transform duration-200 flex items-center gap-1",children:[a.jsx("span",{className:"w-1 h-1 bg-blue-400 rounded-full"}),"Support"]})})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-white",children:"Product"}),a.jsxs("ul",{className:"space-y-3 text-sm text-purple-100",children:[a.jsx("li",{children:a.jsxs(je,{to:"/plans",className:"hover:text-white transition-colors hover:translate-x-1 transform duration-200 flex items-center gap-1",children:[a.jsx("span",{className:"w-1 h-1 bg-blue-400 rounded-full"}),"Pricing"]})}),a.jsx("li",{children:a.jsxs(je,{to:"/features",className:"hover:text-white transition-colors hover:translate-x-1 transform duration-200 flex items-center gap-1",children:[a.jsx("span",{className:"w-1 h-1 bg-blue-400 rounded-full"}),"Features"]})}),a.jsx("li",{children:a.jsxs(je,{to:"/directory",className:"hover:text-white transition-colors hover:translate-x-1 transform duration-200 flex items-center gap-1",children:[a.jsx("span",{className:"w-1 h-1 bg-blue-400 rounded-full"}),"Directory"]})})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-white",children:"Resources"}),a.jsxs("ul",{className:"space-y-3 text-sm text-purple-100",children:[a.jsx("li",{children:a.jsxs(je,{to:"/news",className:"hover:text-white transition-colors hover:translate-x-1 transform duration-200 flex items-center gap-1",children:[a.jsx("span",{className:"w-1 h-1 bg-blue-400 rounded-full"}),"News"]})}),a.jsx("li",{children:a.jsxs(je,{to:"/support",className:"hover:text-white transition-colors hover:translate-x-1 transform duration-200 flex items-center gap-1",children:[a.jsx("span",{className:"w-1 h-1 bg-blue-400 rounded-full"}),"Support"]})}),a.jsx("li",{children:a.jsxs(je,{to:"/about",className:"hover:text-white transition-colors hover:translate-x-1 transform duration-200 flex items-center gap-1",children:[a.jsx("span",{className:"w-1 h-1 bg-blue-400 rounded-full"}),"About"]})})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-white",children:"Legal"}),a.jsx("ul",{className:"space-y-3 text-sm text-purple-100",children:a.jsx("li",{children:a.jsxs(je,{to:"/guarantee-terms",className:"hover:text-white transition-colors hover:translate-x-1 transform duration-200 flex items-center gap-1",children:[a.jsx("span",{className:"w-1 h-1 bg-blue-400 rounded-full"}),"Terms of Service"]})})})]})]}),a.jsx("div",{className:"border-t border-purple-500/30 pt-6",children:a.jsx("div",{className:"flex flex-col md:flex-row justify-between items-center space-y-4 md:space-y-0",children:a.jsxs("div",{className:"text-sm text-purple-100 flex items-center gap-2",children:[a.jsx("div",{className:"w-5 h-5 bg-gradient-to-br from-purple-400 to-blue-500 rounded-lg flex items-center justify-center",children:a.jsx("svg",{className:"w-3 h-3 text-white",viewBox:"0 0 24 24",fill:"
706currentColor",children:a.jsx("path",{d:"M4 6h8c2.2 0 4 1.8 4 4s-1.8 4-4 4H8v4H6V6zM8 8v4h4c1.1 0 2-.9 2-2s-.9-2-2-2H8z"})})}),"© 2026 PriceBid. All rights reserved."]})})})]})]})}const Yw=()=>{let e=sessionStorage.getItem("analytics_session_id");return e||(e=`${Date.now()}_${Math.random().toString(36).substr(2,9)}`,sessionStorage.setItem("analytics_session_id",e)),e},RAe=async()=>{const e=sessionStorage.getItem("analytics_location_data");if(e)try{return JSON.parse(e)}catch(t){console.error("Failed to parse cached location:",t)}try{const t=await fetch("https://ipapi.co/json/");if(!t.ok)throw new Error(`ipapi.co returned ${t.status}`);const r=await t.json();if(r.error)throw console.warn("ipapi.co error:",r),new Error(r.reason||"Location API error");const n={city:r.city||null,country:r.country_name||null,country_code:r.country_code||null,latitude:r.latitude||null,longitude:r.longitude||null,ip_address:r.ip||null};return sessionStorage.setItem("analytics_location_data",JSON.stringify(n)),n}catch(t){return console.error("Failed to get location data:",t),{city:null,country:null,country_code:null,latitude:null,longitude:null,ip_address:null}}},Xw=()=>{const e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"},Qw=()=>{const e=navigator.userAgent;let t="Unknown";return e.includes("Chrome")?t="Chrome":e.includes("Firefox")?t="Firefox":e.includes("Safari")?t="Safari":e.includes("Edge")&&(t="Edge"),t},Jw=()=>{const e=navigator.userAgent;return e.includes("Windows")?"Windows":e.includes("Mac")?"macOS":e.includes("Linux")?"Linux":e.includes("Android")?"Android":e.includes("iOS")?"iOS":"Unknown"},DAe=()=>{const e=Bs(),{user:t}=it(),r=g.useRef(Date.now());return g.useEffect(()=>((async()=>{const i=Yw(),o=await RAe();await Z.from("analytics_events").insert({user_id:(t==null?void 0:t.id)||null,session_id:i,event_type:"page_view",page_path:e.pathname,page_title:document.title,referrer:document.referrer||null,device_type:Xw(),browser:Qw(),os:Jw(),screen_resolution:`${window.screen.width}x${window.screen.height}`,city:o.city,country:o.country,country_code:o.country_code,latitude:o.latitude,longitude:o.longitude,ip_address:o.ip_address}),r.current=Date.now()})(),()=>{const i=Math.round((Date.now()-r.current)/1e3);Z.from("analytics_events").insert({user_id:(t==null?void 0:t.id)||null,session_id:Yw(),event_type:"page_duration",page_path:e.pathname,page_title:document.title,device_type:Xw(),browser:Qw(),os:Jw(),duration_seconds:i})}),[e,t]),{trackEvent:async(s,i)=>{await Z.from("analytics_events").insert({user_id:(t==null?void 0:t.id)||null,session_id:Yw(),event_type:s,page_path:e.pathname,page_title:document.title,device_type:Xw(),browser:Qw(),os:Jw(),metadata:i})}}};function ES(e,[t,r]){return Math.min(r,Math.max(t,e))}function LAe(e,t){return g.useReducer((r,n)=>t[r][n]??r,e)}var z2="ScrollArea",[j8,xRe]=ir(z2),[FAe,Aa]=j8(z2),N8=g.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:i=600,...o}=e,[l,c]=g.useState(null),[d,u]=g.useState(null),[f,h]=g.useState(null),[m,v]=g.useState(null),[p,x]=g.useState(null),[b,y]=g.useState(0),[w,_]=g.useState(0),[N,j]=g.useState(!1),[S,C]=g.useState(!1),P=Te(t,D=>c(D)),A=Ii(s);return a.jsx(FAe,{scope:r,type:n,dir:A,scrollHideDelay:i,scrollArea:l,viewport:d,onViewportChange:u,content:f,onContentChange:h,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:N,onScrollbarXEnabledChange:j,scrollbarY:p,onScrollbarYChange:x,scrollbarYEnabled:S,onScrollbarYEnabledChange:C,onCornerWidthChange:y,onCornerHeightChange:_,children:a.jsx(we.div,{dir:A,...o,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});N8.displayName=z2;var S8="ScrollAreaViewport",_8=g.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...i}=e,o=Aa(S8,r),l=g.useRef(null),c=Te(t,l,o.onViewportChange);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),a.jsx(we.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:a.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});_8.displayName=S8;var Ws="ScrollAreaScrollbar",U2=g.forwardRef((e,t)=>
vendor: 4,434 bytes, line 706
706{const{forceMount:r,...n}=e,s=Aa(Ws,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=s,l=e.orientation==="horizontal";return g.useEffect(()=>(l?i(!0):o(!0),()=>{l?i(!1):o(!1)}),[l,i,o]),s.type==="hover"?a.jsx(BAe,{...n,ref:t,forceMount:r}):s.type==="scroll"?a.jsx(zAe,{...n,ref:t,forceMount:r}):s.type==="auto"?a.jsx(C8,{...n,ref:t,forceMount:r}):s.type==="always"?a.jsx(W2,{...n,ref:t}):null});U2.displayName=Ws;var BAe=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Aa(Ws,e.__scopeScrollArea),[i,o]=g.useState(!1);return g.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const d=()=>{window.clearTimeout(c),o(!0)},u=()=>{c=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",u),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",u)}}},[s.scrollArea,s.scrollHideDelay]),a.jsx(Zt,{present:r||i,children:a.jsx(C8,{"data-state":i?"visible":"hidden",...n,ref:t})})}),zAe=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Aa(Ws,e.__scopeScrollArea),i=e.orientation==="horizontal",o=a0(()=>c("SCROLL_END"),100),[l,c]=LAe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return g.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,s.scrollHideDelay,c]),g.useEffect(()=>{const d=s.viewport,u=i?"scrollLeft":"scrollTop";if(d){let f=d[u];const h=()=>{const m=d[u];f!==m&&(c("SCROLL"),o()),f=m};return d.addEventListener("scroll",h),()=>d.removeEventListener("scroll",h)}},[s.viewport,i,c,o]),a.jsx(Zt,{present:r||l!=="hidden",children:a.jsx(W2,{"data-state":l==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:pe(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:pe(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),C8=g.forwardRef((e,t)=>{const r=Aa(Ws,e.__scopeScrollArea),{forceMount:n,...s}=e,[i,o]=g.useState(!1),l=e.orientation==="horizontal",c=a0(()=>{if(r.viewport){const d=r.viewport.offsetWidth<r.viewport.scrollWidth,u=r.viewport.offsetHeight<r.viewport.scrollHeight;o(l?d:u)}},10);return Du(r.viewport,c),Du(r.content,c),a.jsx(Zt,{present:n||i,children:a.jsx(W2,{"data-state":i?"visible":"hidden",...s,ref:t})})}),W2=g.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,s=Aa(Ws,e.__scopeScrollArea),i=g.useRef(null),o=g.useRef(0),[l,c]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=O8(l.viewport,l.content),u={...n,sizes:l,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:h=>i.current=h,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:h=>o.current=h};function f(h,m){return GAe(h,o.current,l,m)}return r==="horizontal"?a.jsx(UAe,{...u,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const h=s.viewport.scrollLeft,m=hI(h,l,s.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollLeft=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollLeft=f(h,s.dir))}}):r==="vertical"?a.jsx(WAe,{...u,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const h=s.viewport.scrollTop,m=hI(h,l);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollTop=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollTop=f(h))}}):null}),UAe=g.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=Aa(Ws,e.__scopeScrollArea),[o,l]=g.useState(),c=g.useRef(null),d=Te(t,c,i.onScrollbarXChange);return g.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),a.jsx(k8,{"data-orientation":"horizontal",...s,ref:d,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":n0(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(i.viewport){const h=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(h),M8(h,f)&&u.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:ty(o.paddingLeft),paddingEnd:ty(o.paddingRight)}})}})}),WAe=g.forwardRef((e,t)=>
vendor: 5,658 bytes, line 706
706{const{sizes:r,onSizesChange:n,...s}=e,i=Aa(Ws,e.__scopeScrollArea),[o,l]=g.useState(),c=g.useRef(null),d=Te(t,c,i.onScrollbarYChange);return g.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),a.jsx(k8,{"data-orientation":"vertical",...s,ref:d,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":n0(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(i.viewport){const h=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(h),M8(h,f)&&u.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:ty(o.paddingTop),paddingEnd:ty(o.paddingBottom)}})}})}),[HAe,P8]=j8(Ws),k8=g.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:u,onResize:f,...h}=e,m=Aa(Ws,r),[v,p]=g.useState(null),x=Te(t,P=>p(P)),b=g.useRef(null),y=g.useRef(""),w=m.viewport,_=n.content-n.viewport,N=_t(u),j=_t(c),S=a0(f,10);function C(P){if(b.current){const A=P.clientX-b.current.left,D=P.clientY-b.current.top;d({x:A,y:D})}}return g.useEffect(()=>{const P=A=>{const D=A.target;(v==null?void 0:v.contains(D))&&N(A,_)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[w,v,_,N]),g.useEffect(j,[n,j]),Du(v,S),Du(m.content,S),a.jsx(HAe,{scope:r,scrollbar:v,hasThumb:s,onThumbChange:_t(i),onThumbPointerUp:_t(o),onThumbPositionChange:j,onThumbPointerDown:_t(l),children:a.jsx(we.div,{...h,ref:x,style:{position:"absolute",...h.style},onPointerDown:pe(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),b.current=v.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),C(P))}),onPointerMove:pe(e.onPointerMove,C),onPointerUp:pe(e.onPointerUp,P=>{const A=P.target;A.hasPointerCapture(P.pointerId)&&A.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=y.current,m.viewport&&(m.viewport.style.scrollBehavior=""),b.current=null})})})}),ey="ScrollAreaThumb",A8=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=P8(ey,e.__scopeScrollArea);return a.jsx(Zt,{present:r||s.hasThumb,children:a.jsx(VAe,{ref:t,...n})})}),VAe=g.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,i=Aa(ey,r),o=P8(ey,r),{onThumbPositionChange:l}=o,c=Te(t,f=>o.onThumbChange(f)),d=g.useRef(void 0),u=a0(()=>{d.current&&(d.current(),d.current=void 0)},100);return g.useEffect(()=>{const f=i.viewport;if(f){const h=()=>{if(u(),!d.current){const m=KAe(f,l);d.current=m,l()}};return l(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[i.viewport,u,l]),a.jsx(we.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:pe(e.onPointerDownCapture,f=>{const m=f.target.getBoundingClientRect(),v=f.clientX-m.left,p=f.clientY-m.top;o.onThumbPointerDown({x:v,y:p})}),onPointerUp:pe(e.onPointerUp,o.onThumbPointerUp)})});A8.displayName=ey;var H2="ScrollAreaCorner",E8=g.forwardRef((e,t)=>{const r=Aa(H2,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?a.jsx(qAe,{...e,ref:t}):null});E8.displayName=H2;var qAe=g.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=Aa(H2,r),[i,o]=g.useState(0),[l,c]=g.useState(0),d=!!(i&&l);return Du(s.scrollbarX,()=>{var f;const u=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(u),c(u)}),Du(s.scrollbarY,()=>{var f;const u=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(u),o(u)}),d?a.jsx(we.div,{...n,ref:t,style:{width:i,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function ty(e){return e?parseInt(e,10):0}function O8(e,t){const r=e/t;return isNaN(r)?0:r}function n0(e){const t=O8(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function GAe(e,t,r,n="ltr"){const s=n0(r),i=s/2,o=t||i,l=s-o,c=r.scrollbar.paddingStart+o,d=r.scrollbar.size-r.scrollbar.paddingEnd-l,u=r.content-r.viewport,f=n==="ltr"?[0,u]:[u*-1,0];return T8([c,d],f)(e)}function hI(e,t,r="ltr"){const n=n0(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,o=t.content-t.viewport,l=i-n,c=r==="ltr"?[0,o]:[o*-1,0],d=ES(e,c);return T8([0,o],[0,l])(d)}function T8(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function M8(e,t){return e>0&&e<t}var KAe=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const i={left:e.scrollLeft,top:e.scrollTop},o=r.left!==i.left,l=r.top!==i.top;(o||l)&&t(),r=i,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function a0(e,t){const r=_t(e),n=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),g.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function Du(e,t){const r=_t(t);Kt(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var I8=N8,YAe=_8,XAe=E8;const $8=g.forwardRef(({className:e,children:t,...r},n)=>
706a.jsxs(I8,{ref:n,className:me("relative overflow-hidden",e),...r,children:[a.jsx(YAe,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsx(R8,{}),a.jsx(XAe,{})]}));$8.displayName=I8.displayName;const R8=g.forwardRef(({className:e,orientation:t="vertical",...r},n)=>a.jsx(U2,{ref:n,orientation:t,className:me("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:a.jsx(A8,{className:"relative flex-1 rounded-full bg-border"})}));R8.displayName=U2.displayName;function Um({onClose:e}){const{user:t}=it(),{toast:r}=dt(),[n,s]=g.useState(!1),[i,o]=g.useState(null),[l,c]=g.useState([]),[d,u]=g.useState(""),[f,h]=g.useState(!1),[m,v]=g.useState("open"),p=g.useRef(null),x=g.useRef(null);g.useEffect(()=>{var j;(j=x.current)==null||j.scrollIntoView({behavior:"smooth"})},[l]),g.useEffect(()=>{i&&(y(),b())},[i]);const b=()=>{const j=Z.channel(`support-messages-${i}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"support_messages",filter:`ticket_id=eq.${i}`},S=>{console.log("Received real-time message:",S);const C=S.new;C.sender_type!=="user"&&c(P=>[...P,C])}).subscribe(S=>{console.log("Subscription status:",S)});return()=>{Z.removeChannel(j)}},y=async()=>{const{data:j,error:S}=await Z.from("support_messages").select("*").eq("ticket_id",i).order("created_at",{ascending:!0});if(S){console.error("Error loading messages:",S);return}c(j||[])},w=async()=>{try{h(!0);const j=(t==null?void 0:t.id)||"anonymous",{data:S,error:C}=await Z.from("support_tickets").insert({user_id:j,subject:"Support Chat",status:"open"}).select().single();if(C)throw C;o(S.id),v(S.status),s(!0);const P=t?"Hi! I'm here to help you with any questions about our platform. How can I assist you today?":"Hi! I'm here to help answer your questions about PriceBid. Feel free to ask about our pricing plans, features, or anything else!",{data:A}=await Z.from("support_messages").insert({ticket_id:S.id,sender_type:"ai",message:P}).select().single();A&&c([A])}catch(j){console.error("Error starting chat:",j),r({title:"Error",description:"Failed to start chat. Please try again.",variant:"destructive"})}finally{h(!1)}},_=async()=>{if(!d.trim()||!i)return;const j=d.trim();u(""),h(!0);try{const{data:S,error:C}=await Z.from("support_messages").insert({ticket_id:i,sender_type:"user",sender_id:(t==null?void 0:t.id)||null,message:j}).select().single();if(C)throw C;c(D=>[...D,S]);const{data:P,error:A}=await Z.functions.invoke("support-chat",{body:{ticketId:i,userMessage:j}});if(A)throw A;console.log("Support chat response:",P),P.escalated&&v("escalated")}catch(S){console.error("Error sending message:",S),r({title:"Error",description:"Failed to send message. Please try again.",variant:"destructive"})}finally{h(!1)}},N=async()=>{if(i)try{await Z.functions.invoke("send-chat-transcript",{body:{ticketId:i}}),console.log("Chat transcript sent to [email protected]")}catch(j){console.error("Error sending transcript:",j)}s(!1),e&&e()};return n?a.jsxs(J,{className:"fixed bottom-6 right-6 w-96 max-h-[600px] shadow-2xl flex flex-col z-50",children:[a.jsxs(de,{className:"border-b pb-4 flex-shrink-0",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(le,{className:"text-lg",children:"Support Chat"}),m==="escalated"&&a.jsxs(ve,{variant:"secondary",className:"text-xs",children:[a.jsx(Jk,{className:"w-3 h-3 mr-1"}),"Human Agent"]}),m==="ai_handling"&&a.jsxs(ve,{variant:"outline",className:"text-xs",children:[a.jsx(Q0,{className:"w-3 h-3 mr-1"}),"AI Assistant"]})]}),a.jsx(U,{variant:"ghost",size:"icon",onClick:N,children:a.jsx(es,{className:"h-4 w-4"})})]}),a.jsx(nt,{children:m==="escalated"?"A support agent will assist you shortly":"Ask me anything about the platform"})]}),a.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",children:[a.jsx($8,{className:"flex-1",ref:p,children:a.jsxs("div",{className:"space-y-4 p-4 pb-6",children:[l.map(j=>a.jsxs("div",{className:`flex gap-3 ${j.sender_type==="user"?"flex-row-reverse":""}`,children:[a.jsx("div",{className:`flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center ${j.sender_type==="user"?"bg-primary text-primary-foreground":j.sender_type==="ai"?"bg-secondary text-secondary-foreground":"bg-
706accent text-accent-foreground"}`,children:j.sender_type==="user"?a.jsx(di,{className:"w-4 h-4"}):j.sender_type==="ai"?a.jsx(Q0,{className:"w-4 h-4"}):a.jsx(Jk,{className:"w-4 h-4"})}),a.jsxs("div",{className:`rounded-lg p-3 max-w-[240px] break-words ${j.sender_type==="user"?"bg-primary text-primary-foreground":"bg-muted"}`,children:[a.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words",children:j.message}),a.jsx("p",{className:"text-xs opacity-60 mt-1",children:new Date(j.created_at).toLocaleTimeString()})]})]},j.id)),f&&a.jsxs("div",{className:"flex gap-3",children:[a.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-secondary text-secondary-foreground flex items-center justify-center",children:a.jsx(Q0,{className:"w-4 h-4"})}),a.jsx("div",{className:"rounded-lg p-3 bg-muted",children:a.jsx(Je,{className:"w-4 h-4 animate-spin"})})]}),a.jsx("div",{ref:x})]})}),a.jsx("div",{className:"border-t p-4 flex-shrink-0",children:a.jsxs("form",{onSubmit:j=>{j.preventDefault(),_()},className:"flex gap-2",children:[a.jsx(ge,{value:d,onChange:j=>u(j.target.value),placeholder:"Type your message...",disabled:f,className:"flex-1"}),a.jsx(U,{type:"submit",size:"icon",disabled:f||!d.trim(),children:a.jsx(va,{className:"h-4 w-4"})})]})})]})]}):a.jsx(U,{onClick:w,disabled:f,size:"lg",className:"fixed bottom-6 right-6 rounded-full shadow-lg h-14 w-14 p-0 z-50",children:f?a.jsx(Je,{className:"h-6 w-6 animate-spin"}):a.jsx(Fq,{className:"h-6 w-6"})})}function Gt({children:e}){var m,v;const{signOut:t,user:r}=it(),n=vt(),s=t8(),[i,o]=g.useState(!1),{isAdmin:l}=al();DAe(),console.log("MainLayout render:",{isMobile:s,width:typeof window<"u"?window.innerWidth:"server"});const c=async()=>{await t(),n("/")},d=()=>{n("/profile")},u=[{title:"Dashboard",url:"/dashboard",icon:$s},{title:"Profile",url:"/profile",icon:Jt},{title:"PRICE BID",url:"/calculator",icon:rc},{title:"Contracts",url:"/contracts",icon:gt},{title:"Directory",url:"/directory",icon:Mr},{title:"Price Trends",url:"/trends",icon:Ft},{title:"Financing",url:"/financing",icon:Os},{title:"Support",url:"/support",icon:G_}],f=[{title:"User Management",url:"/admin/users",icon:XR},{title:"Leads Management",url:"/admin/leads",icon:Mr},{title:"Traffic",url:"/admin/traffic",icon:V_}],h=p=>{n(p),o(!1)};return a.jsx(a.Fragment,{children:s?a.jsxs("div",{className:"min-h-screen flex flex-col w-full bg-gradient-background",children:[a.jsxs("header",{className:"sticky top-0 z-50 h-14 border-b border-border/30 glass-card-intense flex items-center justify-between px-2 backdrop-blur-lg",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs(e0,{open:i,onOpenChange:o,children:[a.jsx(F2,{asChild:!0,children:a.jsxs(U,{variant:"ghost",size:"icon",className:"h-10 w-10 -ml-1",children:[a.jsx(K_,{className:"w-6 h-6"}),a.jsx("span",{className:"sr-only",children:"Open navigation menu"})]})}),a.jsxs(_p,{side:"left",className:"w-72 bg-background border-border p-0",children:[a.jsx(t0,{className:"px-4 py-8 border-b border-border/30 hero-gradient",children:a.jsxs("div",{className:"flex items-center justify-center gap-3",children:[a.jsx("div",{className:"w-12 h-12 bg-white/30 rounded-xl flex items-center justify-center shadow-lg backdrop-blur-sm",children:a.jsx("span",{className:"font-bold text-white text-base",children:"PB"})}),a.jsx(r0,{className:"text-white text-xl",children:"PriceBid"})]})}),a.jsxs("div",{className:"flex flex-col h-[calc(100%-120px)] overflow-y-auto bg-background",children:[a.jsxs("div",{className:"px-3 py-6 pt-6",children:[a.jsx("h3",{className:"px-4 text-muted-foreground font-semibold text-xs uppercase tracking-wider mb-2",children:"Main Navigation"}),a.jsx("nav",{className:"space-y-1",children:u.map(p=>a.jsxs(U,{variant:"ghost",onClick:()=>h(p.url),className:"w-full justify-start rounded-xl px-4 py-3 h-auto text-foreground hover:bg-accent",children:[a.jsx(p.icon,{className:"w-5 h-5 mr-3 flex-shrink-0"}),a.jsx("span",{className:"font-medium",children:p.title})]},p.title))})]}),l&&a.jsxs("div",{className:"px-3 py-4 border-t border-border",children:[a.jsx("h3",{className:"px-4 text-muted-foreground font-semibold text-xs uppercase tracking-wider mb-2",children:"Admin"}),a.jsx("nav",{className:"space-y-1",children:f.map(p=>a.jsxs(U,{variant:"ghost",onClick:()=>h(p.url),className:"w-full justify-start rounded-xl px-4 py-3 h-auto text-foreground hover:bg-accent",children:[a.jsx(p.icon,{className:"w-5 h-5 mr-3 flex-shrink-0"}),a.jsx("span",{className:"font-medium",children:p.title})]},p.title))})]}),a.jsxs("div",{className:"px-3 py-4 mt-auto border-t border-border",children:[a.jsxs(U,{variant:"ghost",onClick:()=>h("/settings"),className:"w-full justify-start rounded-xl px-4 py-3 h-auto text-foreground hover:bg-accent",children:[a.jsx(eu,{className:"w-5 h-5 mr-3 flex-shrink-0"}),a.jsx("span",{className:"font-medium",children:"Settings"})]}),a.jsxs(U,{variant:"ghost",onClick:c,className:"w-full justify-start rounded-xl px-4 py-3 h-auto text-foreground hover:bg-accent",children:[a.jsx(Vg,{className:"w-5 h-5 mr-3 flex-shrink-0"}),a.jsx("span",{className:"font-medium",children:"Log out"})]})]})]})]})]}),a.jsx("div",{className:"w-8 h-8 bg-gradient-primary rounded-lg flex items-center justify-center shadow-lg",children:a.jsx("span",{className:"font-bold text-white text-xs",children:"PB"})}),a.jsx("span",{className:"font-bold text-sm sm:text-base text-foreground",children:"PriceBid"})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs(U,{variant:"ghost",size:"icon",className:"h-9 w-9 relative",children:[a.jsx(d1,{className:"w-4 h-4"}),a.jsx("span",{className:"absolute -top-1 -right-1 w-2 h-2 bg-primary rounded-full"})]}),a.jsxs(Fm,{children:[a.jsx(Bm,{asChild:!0,children:a.jsx(U,{variant:"ghost",className:"relative h-9 w-9 rounded-full",children:a.jsx(Jx,{className:"h-9 w-9 ring-2 ring-primary/20",children:a.jsx(Zx,{className:"bg-gradient-primary text-white font-bold text-xs",children:((m=r==null?void 0:r.email)==null?void 0:m.charAt(0).toUpperCase())||"A"})})})}),a.jsxs($u,{className:"w-56 glass-card-intense",align:"end",children:[a.jsxs(Fr,{onClick:d,children:[a.jsx(di,{className:"mr-2 h-4 w-4"}),a.jsx("span",{children:"Profile"})]}),a.jsx(zm,{}),a.jsxs(Fr,{onClick:c,children:[a.jsx(Vg,{className:"mr-2 h-4 w-4"}),a.jsx("span",{children:"Log out"})]})]})]})]})]}),a.jsx("main",{className:"flex-1 p-3 sm:p-4",children:e}),a.jsx(Ci,{}),a.jsx(Um,{})]}):a.jsx(i8,{defaultOpen:!0,children:a.jsxs("div",{className:"min-h-screen flex w-full bg-gradient-background",children:[a.jsx(bAe,{}),a.jsxs("div",{className:"flex flex-col flex-1",children:[a.jsxs("header",{className:"sticky top-0 z-50 h-16 border-b border-border/30 glass-card-intense flex items-center justify-between px-6 backdrop-blur-lg shadow-sm",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(l8,{}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 hero-gradient rounded-xl flex items-center justify-center shadow-lg",children:a.jsx("span",{className:"font-bold text-white text-sm",children:"PB"})}),a.jsx("span",{className:"font-bold text-lg text-foreground",children:"PriceBid"})]})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(U,{variant:"ghost",size:"icon",className:"hover-scale relative h-10 w-10",children:[a.jsx(d1,{className:"w-4 h-4"}),a.jsx("span",{className:"absolute -top-1 -right-1 w-3 h-3 bg-primary rounded-full pulse-glow"})]}),a.jsxs(Fm,{children:[a.jsx(Bm,{asChild:!0,children:a.jsx(U,{variant:"ghost",className:"relative h-10 w-10 rounded-full hover-scale neon-border",children:a.jsx(Jx,{className:"h-10 w-10 ring-2 ring-primary/20",children:a.jsx(Zx,{className:"hero-gradient text-white font-bold text-sm",children:((v=r==null?void 0:r.email)==null?void 0:v.charAt(0).toUpperCase())||"A"})})})}),a.jsxs($u,{className:"w-56 bg-popover z-50 animate-slide-up",align:"end",forceMount:!0,children:[a.jsxs(Fr,{onClick:d,children:[a.jsx(di,{className:"mr-2 h-4 w-4"}),a.jsx("span",{children:"Profile"})]}),a.jsx(zm,{}),a.jsxs(Fr,{onClick:c,children:[a.jsx(Vg,{className:"mr-2 h-4 w-4"}),a.jsx("span",{children:"Log out"})]})]})]})]})]}),a.jsx("main",{className:"flex-1 p-6",children:e}),a.jsx(Ci,{}),a.jsx(Um,{})]})]})})})}const $r=({title:e="PriceBid | The Ultimate Contract Pricing Platform",description:t="The ultimate contract pricing platform for government contractors. Upload contracts, get AI-powered price bids, and win more government contracts with data-backed pricing analysis.",keywords:r="contract pricing, government contracts, bid pricing, RFP pricing, contract bidding, price analysis, government contracting, bid calculator, contract management, pricing strategy",image:n="https://www.pricebid.com/og-image.png",url:s="https://www.pricebid.com",type:i="website",structuredData:o})=>{const l=e.includes("PriceBid")?e:`${e} | PriceBid`;return a.jsxs(gR,{children:[a.jsx("title",{children:l}),a.jsx("meta",{name:"title",content:l}),a.jsx("meta",{name:"description",content:t}),a.jsx("meta",{name:"keywords",content:r}
706),a.jsx("meta",{name:"author",content:"Pricebid"}),a.jsx("meta",{name:"robots",content:"index, follow"}),a.jsx("meta",{name:"language",content:"English"}),a.jsx("meta",{name:"revisit-after",content:"7 days"}),a.jsx("link",{rel:"canonical",href:s}),a.jsx("meta",{property:"og:type",content:i}),a.jsx("meta",{property:"og:url",content:s}),a.jsx("meta",{property:"og:title",content:l}),a.jsx("meta",{property:"og:description",content:t}),a.jsx("meta",{property:"og:image",content:n}),a.jsx("meta",{property:"og:site_name",content:"Pricebid"}),a.jsx("meta",{property:"og:locale",content:"en_US"}),a.jsx("meta",{property:"twitter:card",content:"summary_large_image"}),a.jsx("meta",{property:"twitter:url",content:s}),a.jsx("meta",{property:"twitter:title",content:l}),a.jsx("meta",{property:"twitter:description",content:t}),a.jsx("meta",{property:"twitter:image",content:n}),a.jsx("meta",{property:"twitter:site",content:"@pricebid"}),a.jsx("meta",{property:"twitter:creator",content:"@pricebid"}),a.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1, shrink-to-fit=no"}),a.jsx("meta",{name:"theme-color",content:"#6366f1"}),a.jsx("meta",{name:"msapplication-TileColor",content:"#6366f1"}),a.jsx("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),a.jsx("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),o&&a.jsx("script",{type:"application/ld+json",children:JSON.stringify(o)})]})},QAe=()=>{const{user:e,loading:t}=it(),[r,n]=g.useState(""),[s,i]=g.useState(!1),[o,l]=g.useState({totalContracts:0,avgValue:0,activeBids:0,industryTotal:0});g.useEffect(()=>{async function u(){if(e)try{const{data:f}=await Z.from("profiles").select("industry").eq("user_id",e.id).single(),{data:h}=await Z.from("contracts").select("contract_value, status, industry").eq("user_id",e.id),m=(h==null?void 0:h.length)||0,v=(h==null?void 0:h.filter(_=>_.status==="pending").length)||0,p=(h==null?void 0:h.map(_=>_.contract_value||0).filter(_=>_>0))||[],x=p.length>0?p.reduce((_,N)=>_+N,0)/p.length:0,b=f==null?void 0:f.industry;let y=[];if(b&&b.trim()!==""){const{data:_}=await Z.from("procurement_awards").select("value").or(`description.ilike.%${b}%,contractor.ilike.%${b}%`).not("value","is",null).limit(500);y=_||[]}const w=y.reduce((_,N)=>_+(N.value||0),0)||0;l({totalContracts:m,avgValue:x,activeBids:v,industryTotal:w})}catch(f){console.error("Error fetching stats:",f)}}u()},[e]);const c=async u=>{if(u.preventDefault(),!r||!r.includes("@")){We.error("Please enter a valid email address");return}i(!0);try{if(!(await fetch(`${Z.supabaseUrl}/functions/v1/send-contact-email`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"Demo Request",email:r,message:"User requested a demo from the homepage"})})).ok)throw new Error("Failed to send request");We.success("Demo request sent! We'll contact you soon."),n("")}catch(f){console.error("Error sending demo request:",f),We.error("Failed to send request. Please try again.")}finally{i(!1)}},d=!!e;return t?a.jsx("div",{className:"flex items-center justify-center min-h-screen",children:a.jsx("div",{children:"Loading..."})}):d?a.jsx(Gt,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("h1",{className:"text-4xl font-bold text-gradient",children:"Dashboard"}),a.jsx("p",{className:"text-lg text-muted-foreground mb-4",children:"Welcome back! Here's your contract bidding overview"}),a.jsx(U,{asChild:!0,size:"lg",className:"text-lg px-8",children:a.jsx(je,{to:"/calculator",children:"Price Bid"})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[a.jsx(lg,{title:"Total Contracts",value:o.totalContracts.toString(),change:o.totalContracts>0?"Analyzed contracts":"Upload your first contract",changeType:"neutral",icon:gt}),a.jsx(lg,{title:"Industry Budget Awards",value:o.industryTotal>0?`$${(o.industryTotal/1e6).toFixed(1)}M`:"$0",change:"Total procurement awards",changeType:"neutral",icon:Ft}),a.jsx(lg,{title:"Avg. Contract Value",value:o.avgValue>
vendor: 21,017 bytes, line 706
7060?`$${(o.avgValue/1e3).toLocaleString("en-US",{maximumFractionDigits:0})}K`:"$0",change:o.avgValue>0?"Your analyzed contracts":"No data yet",changeType:"neutral",icon:Jt}),a.jsx(lg,{title:"Active Bids",value:o.activeBids.toString(),change:o.activeBids>0?"Pending analysis":"All up to date",changeType:"neutral",icon:rc})]}),a.jsx(Uke,{}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsx(l2e,{}),a.jsx(kke,{})]})]})}):a.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-gradient-background",children:[a.jsx($r,{title:"Your Ultimate Contract Pricing Platform | PriceBid",description:"Upload your contract and get real-time, data-backed bids and quotes with full justification. Built on historical awards, labor rates, and market indices.",keywords:"contract pricing, government contracts, bid pricing, RFP pricing, contract bidding platform",url:"https://www.pricebid.com"}),a.jsxs("div",{className:"text-center space-y-8",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("h1",{className:"text-6xl md:text-8xl font-bold text-gradient",children:"PriceBid"}),a.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl",children:"AI-Powered Contract Pricing Platform"})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[a.jsx(U,{asChild:!0,size:"lg",className:"text-lg px-8 py-4",children:a.jsx(je,{to:"/signup",children:"Get Started"})}),a.jsx(U,{asChild:!0,variant:"outline",size:"lg",className:"text-lg px-8 py-4",children:a.jsx(je,{to:"/login",children:"Sign In"})})]}),a.jsxs("div",{className:"mt-12 pt-8 border-t border-border/50",children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Request a Demo"}),a.jsx("form",{onSubmit:c,className:"max-w-md mx-auto",children:a.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[a.jsx(ge,{type:"email",placeholder:"Enter your email",value:r,onChange:u=>n(u.target.value),required:!0,className:"flex-1",disabled:s}),a.jsx(U,{type:"submit",size:"lg",disabled:s,children:s?"Sending...":"Request Demo"})]})})]})]}),a.jsx(Um,{})]})};var JAe="Label",D8=g.forwardRef((e,t)=>a.jsx(we.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));D8.displayName=JAe;var L8=D8;const ZAe=ki("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Q=g.forwardRef(({className:e,...t},r)=>a.jsx(L8,{ref:r,className:me(ZAe(),e),...t}));Q.displayName=L8.displayName;function Pp(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var eEe=[" ","Enter","ArrowUp","ArrowDown"],tEe=[" ","Enter"],mc="Select",[s0,i0,rEe]=bc(mc),[gf,yRe]=ir(mc,[rEe,Ko]),o0=Ko(),[nEe,sl]=gf(mc),[aEe,sEe]=gf(mc),F8=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:i,value:o,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:f,disabled:h,required:m,form:v}=e,p=o0(t),[x,b]=g.useState(null),[y,w]=g.useState(null),[_,N]=g.useState(!1),j=Ii(d),[S,C]=vr({prop:n,defaultProp:s??!1,onChange:i,caller:mc}),[P,A]=vr({prop:o,defaultProp:l,onChange:c,caller:mc}),D=g.useRef(null),F=x?v||!!x.closest("form"):!0,[q,B]=g.useState(new Set),V=Array.from(q).map(E=>E.props.value).join(";");return a.jsx(My,{...p,children:a.jsxs(nEe,{required:m,scope:t,trigger:x,onTriggerChange:b,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:_,onValueNodeHasChildrenChange:N,contentId:tn(),value:P,onValueChange:A,open:S,onOpenChange:C,dir:j,triggerPointerDownPosRef:D,disabled:h,children:[a.jsx(s0.Provider,{scope:t,children:a.jsx(aEe,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(E=>{B(M=>new Set(M).add(E))},[]),onNativeOptionRemove:g.useCallback(E=>{B(M=>{const T=new Set(M);return T.delete(E),T})},[]),children:r})}),F?a.jsxs(cz,{"aria-hidden":!0,required:m,tabIndex:-1,name:u,autoComplete:f,value:P,onChange:E=>A(E.target.value),disabled:h,form:v,children:[P===void 0?a.jsx("option",{value:""}):null,Array.from(q)]},V):null]})})};F8.displayName=mc;var B8="SelectTrigger",z8=g.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,i=o0(r),o=sl(B8,r),l=o.disabled||n,c=Te(t,o.onTriggerChange),d=i0(r),u=g.useRef("touch"),[f,h,m]=uz(p=>{const x=d().filter(w=>!w.disabled),b=x.find(w=>w.value===o.value),y=fz(x,p,b);y!==void 0&&o.onValueChange(y.value)}),v=p=>{l||(o.onOpenChange(!0),m()),p&&(o.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return a.jsx(ip,{asChild:!0,...i,children:a.jsx(we.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":dz(o.value)?"":void 0,...s,ref:c,onClick:pe(s.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&v(p)}),onPointerDown:pe(s.onPointerDown,p=>{u.current=p.pointerType;const x=p.target;x.hasPointerCapture(p.pointerId)&&x.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(v(p),p.preventDefault())}),onKeyDown:pe(s.onKeyDown,p=>{const x=f.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(x&&p.key===" ")&&eEe.includes(p.key)&&(v(),p.preventDefault())})})})});z8.displayName=B8;var U8="SelectValue",W8=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:i,placeholder:o="",...l}=e,c=sl(U8,r),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,f=Te(t,c.onValueNodeChange);return Kt(()=>{d(u)},[d,u]),a.jsx(we.span,{...l,ref:f,style:{pointerEvents:"none"},children:dz(c.value)?a.jsx(a.Fragment,{children:o}):i})});W8.displayName=U8;var iEe="SelectIcon",H8=g.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return a.jsx(we.span,{"aria-hidden":!0,...s,ref:t,children:n||"â¼"})});H8.displayName=iEe;var oEe="SelectPortal",V8=e=>a.jsx(Vu,{asChild:!0,...e});V8.displayName=oEe;var pc="SelectContent",q8=g.forwardRef((e,t)=>{const r=sl(pc,e.__scopeSelect),[n,s]=g.useState();if(Kt(()=>{s(new DocumentFragment)},[]),!r.open){const i=n;return i?yc.createPortal(a.jsx(G8,{scope:e.__scopeSelect,children:a.jsx(s0.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(K8,{...e,ref:t})});q8.displayName=pc;var La=10,[G8,il]=gf(pc),lEe="SelectContentImpl",cEe=$o("SelectContent.RemoveScroll"),K8=g.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:v,hideWhenDetached:p,avoidCollisions:x,...b}=e,y=sl(pc,r),[w,_]=g.useState(null),[N,j]=g.useState(null),S=Te(t,R=>_(R)),[C,P]=g.useState(null),[A,D]=g.useState(null),F=i0(r),[q,B]=g.useState(!1),V=g.useRef(!1);g.useEffect(()=>{if(w)return Gb(w)},[w]),Hb();const E=g.useCallback(R=>{const[O,...k]=F().map($=>$.ref.current),[G]=k.slice(-1),te=document.activeElement;for(const $ of R)if($===te||($==null||$.scrollIntoView({block:"nearest"}),$===O&&N&&(N.scrollTop=0),$===G&&N&&(N.scrollTop=N.scrollHeight),$==null||$.focus(),document.activeElement!==te))return},[F,N]),M=g.useCallback(()=>E([C,w]),[E,C,w]);g.useEffect(()=>{q&&M()},[q,M]);const{onOpenChange:T,triggerPointerDownPosRef:L}=y;g.useEffect(()=>{if(w){let R={x:0,y:0};const O=G=>{var te,$;R={x:Math.abs(Math.round(G.pageX)-(((te=L.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(G.pageY)-((($=L.current)==null?void 0:$.y)??0))}},k=G=>{R.x<=10&&R.y<=10?G.preventDefault():w.contains(G.target)||T(!1),document.removeEventListener("pointermove",O),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",O),document.addEventListener("pointerup",k,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",O),document.removeEventListener("pointerup",k,{capture:!0})}}},[w,T,L]),g.useEffect(()=>{const R=()=>T(!1);return window.addEventListener("blur",R),window.addEventListener("resize",R),()=>{window.removeEventListener("blur",R),window.removeEventListener("resize",R)}},[T]);const[K,H]=uz(R=>{const O=F().filter(te=>!te.disabled),k=O.find(te=>te.ref.current===document.activeElement),G=fz(O,R,k);G&&setTimeout(()=>G.ref.current.focus())}),ee=g.useCallback((R,O,k)=>{const G=!V.current&&!k;(y.value!==void 0&&y.value===O||G)&&(P(R),G&&(V.current=!0))},[y.value]),se=g.useCallback(()=>w==null?void 0:w.focus(),[w]),ne=g.useCallback((R,O,k)=>{const G=!V.current&&!k;(y.value!==void 0&&y.value===O||G)&&D(R)},[y.value]),W=n==="popper"?OS:Y8,ie=W===OS?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:v,hideWhenDetached:p,avoidCollisions:x}:{};return a.jsx(G8,{scope:r,content:w,viewport:N,onViewportChange:j,itemRefCallback:ee,selectedItem:C,onItemLeave:se,itemTextRefCallback:ne,focusSelectedItem:M,selectedItemText:A,position:n,isPositioned:q,searchRef:K,children:a.jsx(xp,{as:cEe,allowPinchZoom:!0,children:a.jsx(gp,{asChild:!0,trapped:y.open,onMountAutoFocus:R=>{R.preventDefault()},onUnmountAutoFocus:pe(s,R=>{var O;(O=y.trigger)==null||O.focus({preventScroll:!0}),R.preventDefault()}),children:a.jsx(qo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:R=>R.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:a.jsx(W,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:R=>R.preventDefault(),...b,...ie,onPlaced:()=>B(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:pe(b.onKeyDown,R=>{const O=R.ctrlKey||R.altKey||R.metaKey;if(R.key==="Tab"&&R.preventDefault(),!O&&R.key.length===1&&H(R.key),["ArrowUp","ArrowDown","Home","End"].includes(R.key)){let G=F().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(R.key)&&(G=G.slice().reverse()),["ArrowUp","ArrowDown"].includes(R.key)){const te=R.target,$=G.indexOf(te);G=G.slice($+1)}setTimeout(()=>E(G)),R.preventDefault()}})})})})})})});K8.displayName=lEe;var dEe="SelectItemAlignedPosition",Y8=g.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,i=sl(pc,r),o=il(pc,r),[l,c]=g.useState(null),[d,u]=g.useState(null),f=Te(t,S=>u(S)),h=i0(r),m=g.useRef(!1),v=g.useRef(!0),{viewport:p,selectedItem:x,selectedItemText:b,focusSelectedItem:y}=o,w=g.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&p&&x&&b){const S=i.trigger.getBoundingClientRect(),C=d.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),A=b.getBoundingClientRect();if(i.dir!=="rtl"){const te=A.left-C.left,$=P.left-te,ae=S.left-$,oe=S.width+ae,z=Math.max(oe,C.width),fe=window.innerWidth-La,ue=ES($,[La,Math.max(La,fe-z)]);l.style.minWidth=oe+"px",l.style.left=ue+"px"}else{const te=C.right-A.right,$=window.innerWidth-P.right-te,ae=window.innerWidth-S.right-$,oe=S.width+ae,z=Math.max(oe,C.width),fe=window.innerWidth-La,ue=ES($,[La,Math.max(La,fe-z)]);l.style.minWidth=oe+"px",l.style.right=ue+"px"}const D=h(),F=window.innerHeight-La*2,q=p.scrollHeight,B=window.getComputedStyle(d),V=parseInt(B.borderTopWidth,10),E=parseInt(B.paddingTop,10),M=parseInt(B.borderBottomWidth,10),T=parseInt(B.paddingBottom,10),L=V+E+q+T+M,K=Math.min(x.offsetHeight*5,L),H=window.getComputedStyle(p),ee=parseInt(H.paddingTop,10),se=parseInt(H.paddingBottom,10),ne=S.top+S.height/2-La,W=F-ne,ie=x.offsetHeight/2,R=x.offsetTop+ie,O=V+E+R,k=L-O;if(O<=ne){const te=D.length>0&&x===D[D.length-1].ref.current;l.style.bottom="0px";const $=d.clientHeight-p.offsetTop-p.offsetHeight,ae=Math.max(W,ie+(te?se:0)+$+M),oe=O+ae;l.style.height=oe+"px"}else{const te=D.length>0&&x===D[0].ref.current;l.style.top="0px";const ae=Math.max(ne,V+p.offsetTop+(te?ee:0)+ie)+k;l.style.height=ae+"px",p.scrollTop=O-ne+p.offsetTop}l.style.margin=`${La}px 0`,l.style.minHeight=K+"px",l.style.maxHeight=F+"px",n==null||n(),requestAnimationFrame(()=>m.current=!0)}},[h,i.trigger,i.valueNode,l,d,p,x,b,i.dir,n]);Kt(()=>w(),[w]);const[_,N]=g.useState();Kt(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const j=g.useCallback(S=>{S&&v.current===!0&&(w(),y==null||y(),v.current=!1)},[w,y]);return a.jsx(fEe,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:j,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:a.jsx(we.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Y8.displayName=dEe;var uEe="SelectPopperPosition",OS=g.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=La,...i}=e,o=o0(r);return a.jsx(Iy,{...o,...i,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});OS.displayName=uEe;var[fEe,V2]=gf(pc,{}),TS="SelectViewport",X8=g.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,i=il(TS,r),o=V2(TS,r),l=Te(t,i.onViewportChange),c=g.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(s0.Slot,{scope:r,children:a.jsx(we.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:pe(s.onScroll,d=>{const u=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=o;if(h!=null&&h.current&&f){const m=Math.abs(c.current-u.scrollTop);if(m>0){const v=window.innerHeight-La*2,p=parseFloat(f.style.minHeight),x=parseFloat(f.style.height),b=Math.max(p,x);if(b<v){const y=b+m,w=Math.min(v,y),_=y-w;f.style.height=w+"px",f.style.bottom==="0px"&&(u.scrollTop=_>0?_:0,f.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});X8.displayName=TS;var Q8="SelectGroup",[hEe,mEe]=gf(Q8),pEe=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=tn();return a.jsx(hEe,{scope:r,id:s,children:a.jsx(we.div,{role:"group","aria-labelledby":s,...n,ref:t})})});pEe.displayName=Q8;var J8="SelectLabel",Z8=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=mEe(J8,r);return a.jsx(we.div,{id:s.id,...n,ref:t})});Z8.displayName=J8;var ry="SelectItem",[gEe,ez]=gf(ry),tz=g.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:i,...o}=e,l=sl(ry,r),c=il(ry,r),d=l.value===n,[u,f]=g.useState(i??""),[h,m]=g.useState(!1),v=Te(t,y=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,y,n,s)}),p=tn(),x=g.useRef("touch"),b=()=>{s||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(gEe,{scope:r,value:n,disabled:s,textId:p,isSelected:d,onItemTextChange:g.useCallback(y=>{f(w=>w||((y==null?void 0:y.textContent)??"").trim())},[]),children:a.jsx(s0.ItemSlot,{scope:r,value:n,disabled:s,textValue:u,children:a.jsx(we.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:v,onFocus:pe(o.onFocus,()=>m(!0)),onBlur:pe(o.onBlur,()=>m(!1)),onClick:pe(o.onClick,()=>{x.current!=="mouse"&&b()}),onPointerUp:pe(o.onPointerUp,()=>{x.current==="mouse"&&b()}),onPointerDown:pe(o.onPointerDown,y=>{x.current=y.pointerType}),onPointerMove:pe(o.onPointerMove,y=>{var w;x.current=y.pointerType,s?(w=c.onItemLeave)==null||w.call(c):x.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:pe(o.onPointerLeave,y=>{var w;y.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:pe(o.onKeyDown,y=>{var _;((_=c.searchRef)==null?void 0:_.current)!==""&&y.key===" "||(tEe.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})})})})});tz.displayName=ry;var eh="SelectItemText",rz=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...i}=e,o=sl(eh,r),l=il(eh,r),c=ez(eh,r),d=sEe(eh,r),[u,f]=g.useState(null),h=Te(t,b=>f(b),c.onItemTextChange,b=>{var y;return(y=l.itemTextRefCallback)==null?void 0:y.call(l,b,c.value,c.disabled)}),m=u==null?void 0:u.textContent,v=g.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:p,onNativeOptionRemove:x}=d;return Kt(()=>(p(v),()=>x(v)),[p,x,v]),a.jsxs(a.Fragment,{children:[a.jsx(we.span,{id:c.textId,...i,ref:h}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?yc.createPortal(i.children,o.valueNode):null]})});rz.displayName=eh;var nz="SelectItemIndicator",az=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return ez(nz,r).isSelected?a.jsx(we.span,{"aria-hidden":!0,...n,ref:t}):null});az.displayName=nz;var MS="SelectScrollUpButton",sz=g.forwardRef((e,t)=>{const r=il(MS,e.__scopeSelect),n=V2(MS,e.__scopeSelect),[s,i]=g.useState(!1),o=Te(t,n.onScrollButtonChange);return Kt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?a.jsx(oz,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});sz.displayName=MS;var IS="SelectScrollDownButton",iz=g.forwardRef((e,t)=>{const r=il(IS,e.__scopeSelect),n=V2(IS,e.__scopeSelect),[s,i]=g.useState(!1),o=Te(t,n.onScrollButtonChange);return Kt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?a.jsx(oz,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});iz.displayName=IS;var oz=g.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,i=il("SelectScrollButton",r),o=g.useRef(null),l=i0(r),c=g.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return g.useEffect(()=>()=>c(),[c]),Kt(()=>{var u;const d=l().find(f=>f.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[l]),a.jsx(we.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:pe(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:pe(s.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:pe(s.onPointerLeave,()=>{c()})})}),vEe="SelectSeparator",lz=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(we.div,{"aria-hidden":!0,...n,ref:t})});lz.displayName=vEe;var $S="SelectArrow",xEe=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=o0(r),i=sl($S,r),o=il($S,r);return i.open&&o.position==="popper"?a.jsx($y,{...s,...n,ref:t}):null});xEe.displayName=$S;var yEe="SelectBubbleInput",cz=g.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=g.useRef(null),i=Te(n,s),o=Pp(t);return g.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&u){const f=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(f)}},[o,t]),a.jsx(we.select,{...r,style:{...jR,...r.style},ref:i,defaultValue:t})});cz.displayName=yEe;function dz(e){return e===""||e===void 0}function uz(e){const t=_t(e),r=g.useRef(""),n=g.useRef(0),s=g.useCallback(o=>{const l=r.current+o;t(l),function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),i=g.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,i]}function fz(e,t,r){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=bEe(e,Math.max(i,0));s.length===1&&(o=o.filter(d=>d!==r));const c=o.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function bEe(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var wEe=F8,hz=z8,jEe=W8,NEe=H8,SEe=V8,mz=q8,_Ee=X8,pz=Z8,gz=tz,CEe=rz,PEe=az,vz=sz,xz=iz,yz=lz;const Re=wEe,De=jEe,Me=g.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(hz,{ref:n,className:me("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
706ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,a.jsx(NEe,{asChild:!0,children:a.jsx(Go,{className:"h-4 w-4 opacity-50"})})]}));Me.displayName=hz.displayName;const bz=g.forwardRef(({className:e,...t},r)=>a.jsx(vz,{ref:r,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(VR,{className:"h-4 w-4"})}));bz.displayName=vz.displayName;const wz=g.forwardRef(({className:e,...t},r)=>a.jsx(xz,{ref:r,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Go,{className:"h-4 w-4"})}));wz.displayName=xz.displayName;const Ie=g.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>a.jsx(SEe,{children:a.jsxs(mz,{ref:s,className:me("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[a.jsx(bz,{}),a.jsx(_Ee,{className:me("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(wz,{})]})}));Ie.displayName=mz.displayName;const kEe=g.forwardRef(({className:e,...t},r)=>a.jsx(pz,{ref:r,className:me("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));kEe.displayName=pz.displayName;const ce=g.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(gz,{ref:n,className:me("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(PEe,{children:a.jsx(q_,{className:"h-4 w-4"})})}),a.jsx(CEe,{children:t})]}));ce.displayName=gz.displayName;const AEe=g.forwardRef(({className:e,...t},r)=>a.jsx(yz,{ref:r,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));AEe.displayName=yz.displayName;function EEe(){const[e,t]=g.useState([]),[r,n]=g.useState(!1),[s,i]=g.useState(""),[o,l]=g.useState(""),[c,d]=g.useState(""),[u,f]=g.useState("amount"),[h,m]=g.useState("desc"),{user:v}=it(),{toast:p}=dt(),x=[...new Set(e.map(j=>j.awarding_agency).filter(Boolean))],b=[...new Set(e.map(j=>
706j.naics_code).filter(Boolean))],y=async(j,S)=>{if(v){n(!0);try{const{data:C,error:P}=await Z.functions.invoke("fetch-historical-contracts",{body:{naicsCode:j||"541511",industry:S||"Information Technology",limit:50}});if(P)throw P;C!=null&&C.contracts&&(t(C.contracts),p({title:"Historical Contracts Loaded",description:`Found ${C.contracts.length} government contracts`}))}catch(C){console.error("Error fetching historical contracts:",C),p({title:"Error",description:"Failed to load historical contracts",variant:"destructive"})}finally{n(!1)}}};g.useEffect(()=>{y()},[v]);const w=e.filter(j=>{const S=!s||j.title.toLowerCase().includes(s.toLowerCase())||j.recipient_name.toLowerCase().includes(s.toLowerCase())||j.description.toLowerCase().includes(s.toLowerCase()),C=!o||j.naics_code===o,P=!c||j.awarding_agency===c;return S&&C&&P}).sort((j,S)=>{const C=h==="desc"?-1:1;switch(u){case"amount":return C*(j.award_amount-S.award_amount);case"date":return C*(new Date(j.start_date).getTime()-new Date(S.start_date).getTime());default:return 0}}),_=j=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(j),N=j=>{const S=j.usaspending_url||`https://www.usaspending.gov/search/?hash=${encodeURIComponent(j.award_id||"")}`;console.log("Opening contract URL:",S,"for contract:",j.title),window.open(S,"_blank")};return a.jsxs(Gt,{children:[a.jsx($r,{title:"Historical Awards | Contract Intelligence Platform",description:"Browse and analyze historical government awards. Find similar contracts, pricing trends, and winning strategies from USAspending.gov data.",keywords:"government contracts, historical awards, contract analysis, USAspending, federal contracting"}),a.jsxs("div",{className:"container mx-auto px-4 py-8 space-y-8",children:[a.jsxs("div",{className:"text-center space-y-4",children:[a.jsx("h1",{className:"text-4xl font-bold text-foreground",children:"Historical Awards"}),a.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:"Explore past government awards and contracts to inform your bidding strategy"})]}),a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(qu,{className:"w-5 h-5"}),"Search & Filter Contracts"]})}),a.jsxs(re,{className:"space-y-4",children:[a.jsxs("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"search",children:"Search Contracts"}),a.jsxs("div",{className:"relative",children:[a.jsx(Es,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4"}),a.jsx(ge,{id:"search",placeholder:"Search by title, company, or description...",value:s,onChange:j=>i(j.target.value),className:"pl-10"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"NAICS Code"}),a.jsxs(Re,{value:o,onValueChange:l,children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"All NAICS codes"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"",children:"All NAICS codes"}),b.map(j=>a.jsx(ce,{value:j,children:j},j))]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"Awarding Agency"}),a.jsxs(Re,{value:c,onValueChange:d,children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"All agencies"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"",children:"All agencies"}),x.map(j=>a.jsx(ce,{value:j,children:j},j))]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"Sort By"}),a.jsxs(Re,{value:`${u}-${h}`,onValueChange:j=>{const[S,C]=j.split("-");f(S),m(C)},children:[a.jsx(Me,{children:a.jsx(De,{})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"amount-desc",children:"Award Amount (High to Low)"}),a.jsx(ce,{value:"amount-asc",children:"Award Amount (Low to High)"}),a.jsx(ce,{value:"date-desc",children:"Date (Newest First)"}),a.jsx(ce,{value:"date-asc",children:"Date (Oldest First)"})]})]})]})]}),a.jsxs("div",{className:"flex gap-4",children:[a.jsx(U,{onClick:()=>y("541511","Information Technology"),disabled:r,className:"bg-primary hover:bg-primary/90",children:r?"Loading...":"Load IT Contracts"}),a.jsx(U,{onClick:()=>y("236220","Construction"),disabled:r,variant:"outline",children:"Load Construction Contracts"}),a.jsx(U,{onClick:()=>y("541330","Engineering"),disabled:r,variant:"outline",children:"Load Engineering Contracts"})]})]})]}),e.length>0&&a.jsx(J,{children:a.jsx(re,{className:"py-4",children:a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("span",{className:"font-medium",children:["Showing ",w.length," of ",e.length," contracts"]}),w.length>0&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(Jt,{className:"w-4 h-4"}),"Total Value: ",_(w.reduce((j,S)=>
706j+S.award_amount,0))]})]}),a.jsx(ve,{variant:"secondary",children:"USAspending.gov Data"})]})})}),a.jsx("div",{className:"grid gap-6",children:r?a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),a.jsx("p",{className:"text-muted-foreground",children:"Loading historical contracts..."})]}):w.length===0?a.jsx(J,{children:a.jsxs(re,{className:"text-center py-12",children:[a.jsx(gt,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium mb-2",children:"No Contracts Found"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:e.length===0?"Click one of the load buttons above to fetch contract data":"Try adjusting your search or filter criteria"})]})}):w.map((j,S)=>a.jsxs(J,{className:"hover:shadow-lg transition-all duration-200 cursor-pointer border-l-4 border-l-primary/20 hover:border-l-primary",onClick:()=>N(j),children:[a.jsx(de,{className:"pb-3",children:a.jsxs("div",{className:"flex justify-between items-start gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(le,{className:"text-lg leading-tight mb-2 hover:text-primary transition-colors",children:j.title||j.description}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx(ve,{variant:"outline",className:"text-xs",children:j.award_type}),j.naics_code&&a.jsxs(ve,{variant:"secondary",className:"text-xs",children:["NAICS: ",j.naics_code]})]})]}),a.jsx(ft,{className:"w-5 h-5 text-muted-foreground flex-shrink-0"})]})}),a.jsxs(re,{className:"space-y-4",children:[a.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"bg-green-50 dark:bg-green-950/20 border border-green-200 dark:border-green-800 rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(Jt,{className:"w-4 h-4 text-green-600"}),a.jsx("span",{className:"text-sm font-medium text-green-700 dark:text-green-400",children:"Award Amount"})]}),a.jsx("div",{className:"text-2xl font-bold text-green-800 dark:text-green-300",children:_(j.award_amount)})]}),a.jsxs("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(Br,{className:"w-4 h-4 text-blue-600"}),a.jsx("span",{className:"text-sm font-medium text-blue-700 dark:text-blue-400",children:"Contract Year"})]}),a.jsx("div",{className:"text-2xl font-bold text-blue-800 dark:text-blue-300",children:j.start_date?new Date(j.start_date).getFullYear():"N/A"})]})]}),a.jsxs("div",{className:"grid md:grid-cols-2 gap-4 text-sm",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(mr,{className:"w-4 h-4 text-muted-foreground mt-0.5 flex-shrink-0"}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Contractor:"}),a.jsx("p",{className:"font-medium",children:j.recipient_name})]})]}),a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(Ya,{className:"w-4 h-4 text-muted-foreground mt-0.5 flex-shrink-0"}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Agency:"}),a.jsx("p",{className:"font-medium",children:j.awarding_agency}),j.awarding_sub_agency&&a.jsx("p",{className:"text-xs text-muted-foreground",children:j.awarding_sub_agency})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(KR,{className:"w-4 h-4 text-muted-foreground mt-0.5 flex-shrink-0"}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Award ID:"}),a.jsx("p",{className:"font-mono text-xs bg-muted px-2 py-1 rounded",children:j.award_id})]})]}),a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(Br,{className:"w-4 h-4 text-muted-foreground mt-0.5 flex-shrink-0"}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-muted-foreground",children:"Duration:"}),a.jsxs("p",{className:"text-xs",children:[j.start_date?new Date(j.start_date).toLocaleDateString():"Start: N/A"," - ",j.end_date?new Date(j.end_date).toLocaleDateString():"End: N/A"]})]})]})]})]}),j.naics_description&&a.jsxs("div",{className:"bg-muted/30 rounded-lg p-3",children:[a.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Industry: "}),a.jsx("span",{className:"text-sm",children:j.naics_description})]}),a.jsx("div",{className:"text-xs text-muted-foreground text-center pt-2 border-t",children:"Click to view full contract details on USAspending.gov"})]})]},j.award_id||S))})]})]})}const OEe=({pricingBreakdown:e,totalPrice:t,formatCurrency:r})=>{const[n,s]=I.useState({}),i=l=>{s(c=>({...c,[l]:!c[l]}))},o=Object.entries(e).sort(([l],[c])=>{const d=l.toLowerCase().includes("product")||l.toLowerCase().includes("service")||l.toLowerCase().includes("material"),u=c.toLowerCase().includes("product")||c.toLowerCase().includes("service")||c.toLowerCase().includes("material");return d&&!u?-1:!d&&u?1:l.localeCompare(c)});return a.jsx(a.Fragment,{children:o.map(([l,c],d)=>{const u=[{bg:"bg-primary/10",text:"text-primary",border:"border-primary/20",dot:"hsl(var(--primary))"},{bg:"bg-purple-primary/10",text:"text-purple-primary",border:"border-purple-primary/20",dot:"hsl(var(--purple-primary))"},{bg:"bg-purple-light/10",text:"text-purple-light",border:"border-purple-light/20",dot:"hsl(var(--purple-light))"},{bg:"bg-info/10",text:"text-info",border:"border-info/20",dot:"hsl(var(--info))"},{bg:"bg-warning/10",text:"text-warning",border:"border-warning/20",dot:"hsl(var(--warning))"},{bg:"bg-success/10",text:"text-success",border:"border-success/20",dot:"hsl(var(--success))"},{bg:"bg-muted",text:"text-muted-foreground",border:"border-border",dot:"hsl(var(--muted-foreground))"}],f=u[d%u.length],m=(p=>{const x=c;switch(p.toLowerCase()){case"labor_cost":case"labour_cost":return{description:"Based on industry standards and contract complexity",factors:[`Senior consultants: $${Math.round(x*.6).toLocaleStr
706ing()} (60%)`,`Mid-level staff: $${Math.round(x*.3).toLocaleString()} (30%)`,`Junior staff: $${Math.round(x*.1).toLocaleString()} (10%)`]};case"material_costs":case"materials":return{description:"Products and service delivery costs",factors:[`Core products/services: $${Math.round(x*.7).toLocaleString()} (70%)`,`Supporting materials: $${Math.round(x*.2).toLocaleString()} (20%)`,`Consumables: $${Math.round(x*.1).toLocaleString()} (10%)`]};case"overhead":return{description:"Business operational costs allocation",factors:[`Office/facility costs: $${Math.round(x*.4).toLocaleString()} (40%)`,`Administrative costs: $${Math.round(x*.3).toLocaleString()} (30%)`,`Technology/tools: $${Math.round(x*.3).toLocaleString()} (30%)`]};case"profit_margin":return{description:"Competitive profit margin based on market analysis",factors:["Industry standard margin: 12-18%","Contract complexity factor: Applied","Market competition: Considered"]};case"delivery_costs":return{description:"Project delivery and logistics costs",factors:[`Transportation: $${Math.round(x*.4).toLocaleString()} (40%)`,`Setup/installation: $${Math.round(x*.4).toLocaleString()} (40%)`,`Documentation: $${Math.round(x*.2).toLocaleString()} (20%)`]};case"risk_buffer":return{description:"Risk mitigation and contingency allowance",factors:["Market volatility buffer: 3-5%","Technical risk allowance: 2-4%","Schedule contingency: 2-3%"]};default:return{description:"Additional project costs and considerations",factors:[`Primary component: $${Math.round(x*.6).toLocaleString()} (60%)`,`Secondary factors: $${Math.round(x*.4).toLocaleString()} (40%)`]}}})(l),v=n[l]||!1;return a.jsxs("div",{className:`border rounded-lg ${f.bg} ${f.border}`,children:[a.jsxs("div",{className:"flex justify-between items-center p-3 cursor-pointer hover:bg-opacity-80 transition-colors",onClick:()=>i(l),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:f.dot}}),a.jsx("span",{className:`font-medium capitalize text-sm ${f.text}`,children:l.replace(/_/g," ")})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:`font-semibold text-sm ${f.text}`,children:r(c)}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:[Math.round(c/t*100),"%"]})]}),a.jsx("div",{className:`w-5 h-5 rounded-full flex items-center justify-center transition-transform ${f.bg} border ${f.border} ${v?"rotate-45":""}`,children:a.jsx("span",{className:`text-xs font-bold ${f.text}`,children:"+"})})]})]}),v&&a.jsx("div",{className:"px-3 pb-3 border-t border-opacity-20",children:a.jsxs("div",{className:"mt-2 space-y-2",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:m.description}),a.jsx("div",{className:"space-y-1",children:m.factors.map((p,x)=>a.jsxs("div",{className:"text-xs flex items-center gap-2",children:[a.jsx("div",{className:"w-1 h-1 rounded-full bg-muted-foreground opacity-60"}),a.jsx("span",{children:p})]},x))})]})})]},l)})})},Wf=e=>e&&{541511:"Custom Computer Programming Services",541512:"Computer Systems Design Services",541519:"Other Computer Related Services",541330:"Engineering Services",541611:"Administrative Management and General Management Consulting",541618:"Other Management Consulting Services",311511:"Fluid Milk Manufacturing",311513:"Cheese Manufacturing",722310:"Food Service Contractors",722320:"Caterers",445299:"All Other Specialty Food Stores",336390:"Other Motor Vehicle Parts Manufacturing",336360:"Motor Vehicle Seating and Interior Trim Manufacturing",336370:"Motor Vehicle Metal Stamping",336399:"All Other Motor Vehicle Parts Manufacturing",236220:"Commercial and Institutional Building Construction",238210:"Electrical Contractors and Other Wiring Installation Contractors",238220:"Plumbing, Heating, and Air-Conditioning Contractors"}[e]||null,TEe=e=>e?/^\d{6}$/.test(e)||/^\d{3}$/.test(e):!1,mI=e=>e?TEe(e)?e:`${e} (Invalid format)`:"Not specified";function MEe(){var ne,W,ie,R,O,k,G,te;const[e]=mC(),t=vt(),[r,n]=g.useState(null),[s,i]=g.useState("Moderate"),[o,l]=g.useState([]),[c,d]=g.useState(!0),[u,f]=g.useState(!1),[h,m]=g.useState(1),[v,p]=g.useState(null),{user:x}=it(),{toast:b}=dt();
706g.useState([45]),g.useState([35]),g.useState([8]),g.useState("moderate"),g.useState(""),g.useState(""),g.useState(""),g.useState(null),g.useState("pending"),g.useState(""),g.useState(!0);const[y,w]=g.useState(!1),[_,N]=g.useState([{id:1,name:"Previous Awards",amount:"",type:"file",fileUrl:"",fileName:""},{id:2,name:"Expected Product/Service Cost",amount:"",type:"number"},{id:3,name:"Expected Labor Cost",amount:"",type:"number"},{id:6,name:"Transportation/Delivery",amount:"",type:"number"},{id:7,name:"Overhead",amount:"",type:"number"},{id:8,name:"Profit Margin",amount:"",type:"number"}]),[j,S]=g.useState([]),[C,P]=g.useState(""),A=()=>{const $=Math.max(..._.map(ae=>ae.id),...j.map(ae=>ae.id))+1;S([...j,{id:$,name:"",amount:""}])},D=$=>{S(j.filter(ae=>ae.id!==$))},F=$=>{N(_.filter(ae=>ae.id!==$))},q=($,ae,oe,z=!1)=>{z?S(j.map(fe=>fe.id===$?{...fe,[ae]:oe}:fe)):N(_.map(fe=>fe.id===$?{...fe,[ae]:oe}:fe))},B=async $=>{var oe;const ae=(oe=$.target.files)==null?void 0:oe[0];if(ae){if(ae.size>20*1024*1024){b({title:"File too large",description:"File must be less than 20MB",variant:"destructive"});return}try{const z=ae.name.split(".").pop(),fe=`${Math.random()}.${z}`,ue=`${x==null?void 0:x.id}/${fe}`,{error:Ne}=await Z.storage.from("contracts").upload(ue,ae);if(Ne)throw Ne;const{data:{publicUrl:He}}=Z.storage.from("contracts").getPublicUrl(ue);q(1,"fileUrl",He),q(1,"fileName",ae.name),b({title:"File uploaded",description:`${ae.name} has been uploaded successfully`})}catch(z){console.error("Error uploading file:",z),b({title:"Upload failed",description:"Failed to upload file. Please try again.",variant:"destructive"})}}},V=()=>{const $=[..._.filter(oe=>oe.name!=="Previous Awards"),...j],ae=$.reduce((oe,z)=>{const fe=parseFloat(z.amount)||0;return oe+fe},0);if(ae===0){b({title:"No expenses entered",description:"Please enter at least one expense amount",variant:"destructive"});return}if(r){const oe={...r,suggested_price:ae,pricing_breakdown:$.reduce((z,fe)=>(fe.amount&&(z[fe.name.toLowerCase().replace(/\s+/g,"_")]=parseFloat(fe.amount)),z),{})};n(oe),sessionStorage.setItem("bidResult",JSON.stringify(oe)),b({title:"Price Bid Updated",description:`Total expenses: ${T(ae)}`}),w(!1)}},E=$=>({"MedTech Solutions LLC":"https://medtechsolutions.com","Defense Software Corp":"https://defensesoftware.com","Digital Gov Solutions":"http://digital-gov-solutions.com","EduTech Innovations Inc":"https://mrtechguyschlmgt.com","AgriSoft Systems LLC":"https://agrisoftllc.com"})[$]||`https://www.google.com/search?q=${encodeURIComponent($+" company website")}`;g.useEffect(()=>{var Ne,He,ke,Ze;const $=e.get("contractId");if(console.log("BidResults page loaded, contractId from URL:",$),$)console.log("Storing contractId:",$),p($),sessionStorage.setItem("currentContractId",$);else{const Y=sessionStorage.getItem("currentContractId");console.log("No contractId in URL, checking sessionStorage:",Y),Y&&p(Y)}const ae=sessionStorage.getItem("bidResult"),oe=sessionStorage.getItem("historicalContracts");let z=null;if(ae)try{z=JSON.parse(ae),console.log("BidResult data available:",z),console.log("Fields in bidResult:",Object.keys(z)),n(z),i(z.strategy||"Moderate")}catch(Y){console.error("Error parsing bid data:",Y)}let fe=null;z!=null&&z.similarContracts?(fe=z.similarContracts,console.log("Found similarContracts from SAM.gov:",fe.length)):(He=(Ne=z==null?void 0:z.marketAnalysis)==null?void 0:Ne.historical_data)!=null&&He.contracts?(fe=z.marketAnalysis.historical_data.contracts,console.log("Found marketAnalysis path:",fe.length)):(Ze=(ke=z==null?void 0:z.market_analysis)==null?void 0:ke.historical_data)!=null&&Ze.contracts&&(fe=z.market_analysis.historical_data.contracts,console.log("Found market_analysis path:",fe.length)),(async()=>{if(z!=null&&z.naics_code){console.log("Fetching fresh historical contracts for NAICS:",z.naics_code,"Years:",h),f(!0),l([]);try{const{data:Y,error:_e}=await Z.functions.invoke("fetch-historical-contracts",{body:{naicsCode:z.naics_code,industry:z.industry||"Professional Services",limit:20,yearsBack:h}});!_e&&(Y!=null&&Y.contracts)&&Array.isArray(Y.contracts)&&Y.contracts.length>0?(console.log("Fresh historical contracts received:",Y.contracts.length),l(Y.contracts),sessionStorage.setItem("historicalContracts",JSON.stringify(Y.contracts))):fe?(console.log("Using similar contracts from bid analysis:",fe.length),l(fe)):(console.log("No historical contracts available"),l([]))}catch(Y){console.error("Error fetching fresh historical contracts:",Y),l(fe||[])}finally{f(!1)}}else if(fe)l(fe);else if(oe)try{const Y=JSON.parse(oe);Array.isArray(Y)&&Y.length>0?l(Y):l([])}catch(Y){console.error("Error parsing historical data:",Y),l([])}else l([])})(),d(!1),z||b({title:"No bid data found",description:"Please generate a bid from the calculator first",variant:"destructive"})},[e,b,h]);const M=async()=>
706{if(r){d(!0);try{const $=e.get("contractId"),ae=sessionStorage.getItem("currentContractId"),oe=$||ae||v;if(!oe)throw new Error("No contract ID found. Please return to the calculator and generate a new bid.");b({title:"ð Running diagnostics...",description:"Checking for issues and applying auto-fixes"});const{data:z,error:fe}=await Z.functions.invoke("diagnose-and-regenerate",{body:{contractId:oe}});if(fe)throw console.error("Diagnostic error:",fe),new Error(`Diagnostic failed: ${fe.message}`);if(!(z!=null&&z.success))throw new Error((z==null?void 0:z.error)||"Diagnostic check failed");const{diagnostic:ue,contract:Ne}=z;if(console.log("Diagnostic complete:",ue),ue.autoFixesApplied.length>0){const jt=ue.autoFixesApplied.join(` 707`);b({title:"ð§ Auto-repairs applied",description:jt,duration:5e3})}const He=ue.issues.filter(jt=>jt.severity==="critical"&&!jt.autoFixable);He.length>0&&b({title:"â ï¸ Manual attention needed",description:He.map(jt=>jt.issue).join(", "),variant:"destructive",duration:6e3}),b({title:"Re-parsing contract...",description:`Using NAICS ${Ne.naics_code} - ${Ne.industry}`});const{data:ke,error:Ze}=await Z.functions.invoke("parse-contract-details",{body:{contractId:oe}});if(Ze)throw console.error("Error parsing contract:",Ze),new Error(`Failed to parse contract: ${Ze.message}`);if(!(ke!=null&&ke.success))throw new Error((ke==null?void 0:ke.error)||"Failed to extract contract details");console.log("Contract properly parsed:",ke.data),b({title:"Contract parsed successfully",description:`Regenerating bid with NAICS ${ke.data.naics_code} - ${ke.data.industry}`}),sessionStorage.removeItem("bidResult"),sessionStorage.removeItem("historicalContracts"),l([]),n(null);const{data:Y,error:_e}=await Z.functions.invoke("generate-price-bid",{body:{contractId:oe,naicsCode:ke.data.naics_code,industry:ke.data.industry,productName:ke.data.product_service_name,quantity:ke.data.quantity,productType:ke.data.product_type,deliveryLocation:ke.data.delivery_location,contractAgency:ke.data.contract_agency}});if(_e)throw _e;const Oe={suggested_price:Y.suggestedPrice,confidence_score:Y.confidence,pricing_breakdown:Y.pricingBreakdown,market_analysis:Y.marketAnalysis,recommendations:Y.recommendations,risk_factors:Y.riskFactors,contract_title:ke.contractTitle,naics_code:ke.data.naics_code,industry:ke.data.industry,contract_agency:ke.data.contract_agency,delivery_location:ke.data.delivery_location,product_service_name:ke.data.product_service_name,product_type:ke.data.product_type,poc_name:ke.data.poc_name,poc_email:ke.data.poc_email,strategy:s,initialStrategy:r.initialStrategy||s};n(Oe),sessionStorage.setItem("bidResult",JSON.stringify(Oe));const{data:Ee,error:tt}=await Z.functions.invoke("fetch-historical-contracts",{body:{naicsCode:ke.data.naics_code,industry:ke.data.industry,limit:20,yearsBack:h}});!tt&&(Ee!=null&&Ee.contracts)&&(l(Ee.contracts),sessionStorage.setItem("historicalContracts",JSON.stringify(Ee.contracts))),b({title:"Bid regenerated successfully!",description:"Now showing accurate contract details and pricing"})}catch($){console.error("Error regenerating bid:",$),b({title:"Failed to regenerate bid",description:$ instanceof Error?$.message:"Please try again",variant:"destructive"})}finally{d(!1)}}},T=$=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format($),L=($,ae)=>{switch(ae){case"Conservative":return $*.85;case"Aggressive":return $*1.2;case"Moderate":default:return $}},K=$=>{console.log("=== CONTRACT CLICK DEBUG ==="),console.log("Contract clicked:",$);let ae="";if($.usaspending_url)ae=$.usaspending_url,console.log("Using provided URL:",ae);else if($.award_id)ae=`https://www.usaspending.gov/search/?hash=${encodeURIComponent($.award_id)}`,console.log("Creating search URL:",ae);else{const oe=($.title||$.description||"").split(" ").slice(0,3).join(" ");ae=`https://www.usaspending.gov/search/?q=${encodeURIComponent(oe)}`,console.log("Using title search URL:",ae)}console.log("Final URL to open:",ae),window.open(ae,"_blank")},H=()=>{var fe;const $={contract_title:r==null?void 0:r.contract_title,contract_overview:{naics_code:r==null?void 0:r.naics_code,industry:r==null?void 0:r.industry,agency:r==null?void 0:r.contract_agency,delivery_location:r==null?void 0:r.delivery_location,product_service:r==null?void 0:r.product_service_name,product_type:r==null?void 0:r.product_type,quantity:r==null?void 0:r.quantity,unit_of_measure:r==null?void 0:r.unit_of_measure,poc_name:r==null?void 0:r.poc_name,poc_email:r==null?void 0:r.poc_email},pricing:{suggested_price:r==null?void 0:r.suggested_price,adjusted_price:L((r==null?void 0:r.suggested_price)||0,s),strategy:s,confidence_score:r==null?void 0:r.confidence_score,pricing_breakdown:r==null?void 0:r.pricing_breakdown},analysis:{recommendations:r==null?void 0:r.recommendations,risk_factors:r==null?void 0:r.risk_factors,market_analysis:r==null?void 0:r.market_analysis},historical_contracts:o.slice(0,10).map(ue=>
707({title:ue.title,recipient:ue.recipient_name,amount:ue.award_amount,date:ue.start_date,agency:ue.awarding_agency})),metadata:{generated_at:new Date().toISOString(),contract_id:v}},ae=new Blob([JSON.stringify($,null,2)],{type:"application/json"}),oe=URL.createObjectURL(ae),z=document.createElement("a");z.href=oe,z.download=`bid-analysis-${(fe=r==null?void 0:r.contract_title)==null?void 0:fe.replace(/[^a-z0-9]/gi,"-").toLowerCase()}-${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(z),z.click(),document.body.removeChild(z),URL.revokeObjectURL(oe),b({title:"Bid Analysis Exported",description:"Your comprehensive bid analysis has been downloaded"})},ee=async()=>{const $=`${window.location.origin}/bid-results?contractId=${v}`;try{navigator.share?(await navigator.share({title:`Bid Analysis - ${r==null?void 0:r.contract_title}`,text:`Check out this bid analysis: ${T(L((r==null?void 0:r.suggested_price)||0,s))}`,url:$}),b({title:"Shared successfully",description:"Bid analysis has been shared"})):(await navigator.clipboard.writeText($),b({title:"Link copied!",description:"Share link has been copied to clipboard"}))}catch(ae){console.error("Error sharing:",ae),b({title:"Could not share",description:"Please copy the URL manually from your browser",variant:"destructive"})}};if(c)return a.jsx(Gt,{children:a.jsx("div",{className:"container mx-auto px-4 py-8",children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),a.jsx("p",{className:"text-muted-foreground",children:"Loading bid results..."})]})})});if(!r)return a.jsx(Gt,{children:a.jsx("div",{className:"container mx-auto px-4 py-8",children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx(gt,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium mb-2",children:"No Bid Data Found"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"Please generate a bid from the calculator first"}),a.jsx(U,{onClick:()=>t("/calculator"),children:"Go to Calculator"})]})})});const se=L(r.suggested_price,s);return a.jsxs(Gt,{children:[a.jsx($r,{title:`Bid Analysis - ${r.contract_title} | Contract Intelligence`,description:"Comprehensive bid analysis with AI-powered pricing recommendations, market intelligence, and historical contract data.",keywords:"bid analysis, contract pricing, government contracting, price recommendation"}),a.jsxs("div",{className:"container mx-auto px-4 py-8",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("h1",{className:"text-4xl font-bold text-foreground mb-2",children:"Bid Analysis Results"}),a.jsxs("div",{className:"mb-6",children:[a.jsx("p",{className:"text-lg text-muted-foreground mb-4",children:r.contract_title}),a.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4 text-sm",children:[r.naics_code&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(ve,{variant:"outline",className:"bg-primary/10",children:["NAICS: ",mI(r.naics_code)]}),Wf(r.naics_code)&&a.jsx("span",{className:"text-muted-foreground",children:Wf(r.naics_code)})]}),r.industry&&a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs(ve,{variant:"outline",className:"bg-info/10",children:["Industry: ",r.industry]})}),(r.contract_agency||((W=(ne=r.market_analysis)==null?void 0:ne.contract_data)==null?void 0:W.agency))&&a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs(ve,{variant:"outline",className:"bg-success/10",children:["Agency: ",r.contract_agency||((R=(ie=r.market_analysis)==null?void 0:ie.contract_data)==null?void 0:R.agency)]})})]}),((O=r.market_analysis)==null?void 0:O.contract_data)&&a.jsxs("div",{className:"mt-4 space-y-2 text-sm max-w-3xl mx-auto",children:[r.market_analysis.contract_data.products&&r.market_analysis.contract_data.products.length>0&&a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-muted-foreground font-medium min-w-[100px]",children:"Products:"}),a.jsx("span",{className:"text-foreground",children:r.market_analysis.contract_data.products.join(", ")})]}),r.market_analysis.contract_data.quantity&&a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-muted-foreground font-medium min-w-[100px]",children:"Quantity:"}),a.jsxs("span",{className:"text-foreground",children:[r.market_analysis.contract_data.quantity.toLocaleStr
707ing()," units"]})]}),r.market_analysis.contract_data.delivery_location&&a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-muted-foreground font-medium min-w-[100px]",children:"Delivery:"}),a.jsx("span",{className:"text-foreground",children:r.market_analysis.contract_data.delivery_location})]})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[a.jsxs(U,{variant:"outline",size:"sm",onClick:()=>t("/calculator"),className:"flex items-center gap-2",children:[a.jsx(Tr,{className:"w-4 h-4"}),"Back to Calculator"]}),a.jsx(U,{variant:"default",size:"sm",onClick:M,disabled:c,className:"flex items-center gap-2 bg-gradient-primary hover:opacity-90 shadow-glow",children:c?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"w-4 h-4 animate-spin"}),"Regenerating..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Ur,{className:"w-4 h-4"}),"Regenerate"]})}),a.jsxs(U,{variant:"outline",size:"sm",onClick:H,children:[a.jsx(kl,{className:"w-4 h-4 mr-2"}),"Export"]}),a.jsxs(U,{variant:"outline",size:"sm",onClick:ee,children:[a.jsx(qq,{className:"w-4 h-4 mr-2"}),"Share"]})]})]}),a.jsxs("div",{className:"space-y-8",children:[a.jsx(J,{className:"border-l-4 border-l-primary",children:a.jsxs(re,{className:"pt-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Recommended Bid"}),a.jsx("p",{className:"text-3xl font-bold text-primary",children:T(se)}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[s," Strategy (",s==="Conservative"?"-15%":s==="Aggressive"?"+20%":"baseline",")"]})]}),a.jsx(Jt,{className:"w-8 h-8 text-primary"})]}),a.jsxs("div",{className:"mt-4 pt-4 border-t flex flex-col items-center",children:[a.jsxs(rn,{open:y,onOpenChange:w,children:[a.jsx(hc,{asChild:!0,children:a.jsx(U,{size:"sm",className:"w-auto px-6",children:"Input Your Data"})}),a.jsxs(Wr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Hr,{children:[a.jsx(Vr,{children:"Add Line Item Expenses"}),a.jsx(ba,{children:"Add previous awards, expected labor cost, transportation, and other expenses"})]}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"border rounded-lg p-4 space-y-3 bg-muted/30",children:[a.jsx(Q,{className:"text-base font-semibold",children:"Previous Awards"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{className:"text-sm",children:"Upload Previous Awards Document"}),a.jsxs("div",{className:"border-2 border-dashed border-border rounded-lg p-4 text-center",children:[a.jsx(Ro,{className:"w-6 h-6 text-muted-foreground mx-auto mb-2"}),a.jsx(ge,{type:"file",onChange:B,accept:".pdf,.doc,.docx",className:"sr-only",id:"previous-award-upload"}),a.jsx(Q,{htmlFor:"previous-award-upload",className:"text-sm text-primary cursor-pointer hover:underline",children:((k=_[0])==null?void 0:k.fileName)||"Choose File"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"previous-award-link",className:"text-sm",children:"Award Link (Optional)"}),a.jsx(ge,{id:"previous-award-link",placeholder:"https://example.com/award-document",value:C,onChange:$=>P($.target.value)})]})]}),_.slice(1).map($=>a.jsxs("div",{className:"grid grid-cols-[1fr_1fr_auto] gap-4 items-end",children:[a.jsxs("div",{children:[a.jsx(Q,{htmlFor:`name-${$.id}`,children:$.name}),a.jsx(ge,{id:`name-${$.id}`,value:$.name,disabled:!0,className:"bg-muted"})]}),a.jsxs("div",{children:[a.jsx(Q,{htmlFor:`amount-${$.id}`,children:"Amount ($)"}),a.jsx(ge,{id:`amount-${$.id}`,type:"number",placeholder:"0.00",value:$.amount,onChange:ae=>q($.id,"amount",ae.target.value)})]}),a.jsx(U,{variant:"ghost",size:"icon",onClick:()=>F($.id),children:a.jsx(es,{className:"h-4 w-4"})})]},$.id)),j.map($=>a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Q,{htmlFor:`custom-name-${$.id}`,children:"Custom Item"}),a.jsx(ge,{id:`custom-name-${$.id}`,placeholder:"Item name",value:$.name,onChange:ae=>q($.id,"name",ae.target.value,!0)})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Q,{htmlFor:`custom-amount-${$.id}`,children:"Amount ($)"}),a.jsx(ge,{id:`custom-amount-${$.id}`,type:"number",placeholder:"0.00",value:$.amount,onChange:ae=>q($.id,"amount",ae.target.value,!0)})]}),a.jsx(U,{variant:"ghost",size:"icon",className:"mt-6",onClick:()=>D($.id),children:a.jsx(es,{className:"h-4 w-4"})})]})]},$.id)),a.jsxs(U,{variant:"outline",className:"w-full",onClick:A,children:[a.jsx(gn,{className:"h-4 w-4 mr-2"}),"Add Custom Line Item"]}),a.jsx("div",{className:"pt-4 border-t",children:a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-lg font-semibold",children:"Total Expenses:"}),a.jsx("span",{className:"text-2xl font-bold text-primary",children:T(_.slice(1).reduce(($,ae)=>$+(parseFloat(ae.amount)||0),0)+j.reduce(($,ae)=>$+(parseFloat(ae.amount)||0),0))})]})}),a.jsx(U,{className:"w-full",onClick:V,children:"Update Price Bid"})]})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground text-center mt-2",children:"Add previous awards, expected labor cost, transportation, etc."})]})]})}),a.jsx(J,{className:"bg-gradient-to-br from-background to-muted/20 border-2",children:a.jsx(re,{className:"pt-6",children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-lg font-semibold mb-4 block text-foreground",children:"Price Risk Appetite"}),a.jsx("div",{className:"relative bg-muted/40 p-2 rounded-xl shadow-inner border border-border/50",children:a.jsx("div",{className:"relative z-10 grid grid-cols-3 gap-0",children:["Conservative","Moderate","Aggressive"].map($=>a.jsxs("button",{onClick:()=>i($),className:`py-3 px-4 text-sm font-semibold rounded-lg transition-all duration-300 relative overflow-hidden ${s===$?"text-white shadow-lg transform scale-105":"text-muted-foreground hover:text-foreground hover:bg-background/20"}`,children:[s===$&&a.jsx("div",{className:"absolute inset-0 rounded-lg transition-all duration-300 ease-out shadow-lg",style:{background:$==="Conservative"?"hsl(var(--success))":$==="Moderate"?"linear-gradient(to right, hsl(var(--primary)), hsl(var(--purple-primary)))":"linear-gradient(to right, hsl(var(--warning)), hsl(var(--error)))"}}),a.jsx("span",{className:"relative z-10",children:$}),s===$&&a.jsx("div",{className:"absolute inset-0 bg-white/10 animate-pulse rounded-lg"})]},$))})})]}),a.jsx("div",{className:"p-4 rounded-xl border-l-4 transition-all duration-300",style:{backgroundColor:s==="Conservative"?"hsl(var(--success) / 0.1)":s==="Moderate"?"hsl(var(--primary) / 0.1)":"hsl(var(--warning) / 0.1)",borderLeftColor:s==="Conservative"?"hsl(var(--success))":s==="Moderate"?"hsl(var(--primary))":"hsl(var(--warning))",color:s==="Conservative"?"hsl(var(--success))":s==="Moderate"?"hsl(var(--primary))":"hsl(var(--warning))"},children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-2 h-2 rounded-full animate-pulse",style:{backgroundColor:s==="Conservative"?"hsl(var(--success))":s==="Moderate"?"hsl(var(--primary))":"hsl(var(--warning))"}}),a.jsxs("p",{className:"font-medium text-sm",children:[s==="Conservative"&&"ð¡ï¸ Conservative: Safer bid with higher win probability (-15%)",s==="Moderate"&&"âï¸ Moderate: Recommended balanced approach (baseline)",s==="Aggressive"&&"ð Aggressive: Higher profit margin, more competitive (+20%)"]})]})})]})})}),a.jsxs(J,{className:"bg-gradient-to-br from-background to-muted/20 border-2",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(gt,{className:"w-5 h-5"}),"Contract Overview"]})}),a.jsx(re,{children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[r.naics_code&&a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-primary/5 border border-primary/10",children:[a.jsx(gt,{className:"w-5 h-5 text-primary mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"NAICS Code"}),a.jsx("p",{className:"text-sm font-semibold text-foreground mt-1",children:r.naics_code}),Wf(r.naics_code)&&a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:Wf(r.naics_code)})]})]}),r.industry&&a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-purple-primary/5 border border-purple-primary/10",children:[a.jsx(mr,{className:"w-5 h-5 text-purple-primary mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Industry"}),a.jsx("p",{className:"text-sm font-semibold text-foreground mt-1",children:r.industry})]})]}),(r.product_service_name||r.contract_title)&&a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-success/5 border border-success/10",children:[a.jsx(gt,{className:"w-5 h-5 text-success mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Product/Service"}),a.jsx("p",{className:"text-sm font-semibold text-foreground mt-1 line-clamp-2",children:r.product_service_name||r.contract_title}),r.industry&&a.jsx(ve,{variant:"outline",className:"bg-purple-primary/10 border-purple-primary/20 text-purple-primary mt-2 text-xs",children:r.industry})]})]}),r.contract_agency&&a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-purple-light/5 border border-purple-light/10",children:[a.jsx(mr,{className:"w-5 h-5 text-purple-light mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Agency"}),a.jsx("p",{className:"text-sm font-semibold text-foreground mt-1",children:r.contract_agency})]})]}),r.delivery_location&&a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-info/5 border border-info/10",children:[a.jsx(mr,{className:"w-5 h-5 text-info mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Delivery Location"}),a.jsx("p",{className:"text-sm font-semibold text-foreground mt-1",children:r.delivery_location})]})]}),(r.quantity||((G=r.pricing_breakdown)==null?void 0:G.quantity))&&a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-info/5 border border-info/10",children:[a.jsx(gt,{className:"w-5 h-5 text-info mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Quantity"}),a.jsxs("p",{className:"text-sm font-semibold text-foreground mt-1",children:[r.quantity||r.pricing_breakdown.quantity,r.unit_of_measure&&` ${r.unit_of_measure}`]})]})]}),r.product_type&&a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-warning/5 border border-warning/10",children:[a.jsx(gt,{className:"w-5 h-5 text-warning mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Type"}),a.jsx("p",{className:"text-sm font-semibold text-foreground mt-1",children:r.product_type})]})]}),(r.poc_name||r.poc_email)&&a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-blue-500/5 border border-blue-500/10 md:col-span-2",children:[a.jsx(mr,{className:"w-5 h-5 text-blue-500 mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Point of Contact"}),r.poc_name&&a.jsx("p",{className:"text-sm font-semibold text-foreground mt-1",children:r.poc_name}),r.poc_email&&a.jsx("a",{href:`mailto:${r.poc_email}`,className:"text-sm text-blue-500 hover:underline mt-0.5 block",children:r.poc_email})]})]})]})})]}),a.jsxs(J,{className:"bg-gradient-to-br from-primary/5 to-purple-primary/5 border-2 border-primary/20",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2 text-primary",children:[a.jsx(mr,{className:"w-5 h-5"}),"Point of Contact"]})}),a.jsx(re,{children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-background/50 border border-primary/10",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:a.jsx("span",{className:"text-lg font-bold text-primary",children:((te=r.poc_name)==null?void 0:te.split(" ").map($=>$[0]).join(""))||"CO"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Name"}),a.jsx("p",{className:"text-sm font-semibold text-foreground mt-1",children:r.poc_name||`${r.contract_agency||"Agency"} Contracting Office`})]})]}),a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-background/50 border border-primary/10",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-purple-primary/10 flex items-center justify-center flex-shrink-0",children:a.jsx("span",{className:"text-primary",children:"@"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Email"}),r.poc_email?a.jsx("a",{href:`mailto:${r.poc_email}`,className:"text-sm font-semibold text-primary hover:underline mt-1 block break-all",children:r.poc_email}):a.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Contact ",r.contract_agency||"agency"," procurement office"]})]})]})]}),r.contract_agency&&a.jsx("div",{className:"border-t border-border/50 pt-4",children:a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-background/50 border border-primary/10",children:[a.jsx(mr,{className:"w-5 h-5 text-primary mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Contracting Agency"}),a.jsx("p",{className:"text-sm font-semibold text-foreground mt-1",children:r.contract_agency})]})]})}),a.jsxs("div",{className:"border-t border-border/50 pt-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Granted Awards"}),a.jsxs(ve,{variant:"outline",className:"bg-primary/10 text-primary border-primary/20",children:[o.slice(0,3).length," Recent"]})]}),o.length>0?a.jsx("div",{className:"space-y-2",children:o.slice(0,3).map(($,ae)=>a.jsx("div",{className:"p-3 rounded-lg bg-background/50 border border-primary/10 hover:border-primary/30 transition-colors cursor-pointer",onClick:()=>K($),children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:$.title||$.description||"Contract Award"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:$.recipient_name||$.contractor||"Unknown Contractor"})]}),a.jsxs("div",{className:"text-right flex-shrink-0",children:[a.jsx("p",{className:"text-sm font-semibold text-primary",children:T($.award_amount||$.amount||$.value||0)}),a.jsx("p",{className:"text-xs text-muted-foreground",children:$.award_date||$.start_date||"N/A"})]})]})}
707,$.award_id||$.generated_internal_id||ae))}):a.jsxs("div",{className:"text-center py-6 text-muted-foreground",children:[a.jsx(gt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),a.jsx("p",{className:"text-sm",children:"No recent contract data available"})]})]})]})})]}),a.jsxs(J,{className:"bg-gradient-to-br from-warning/5 to-error/5 border-2 border-warning/20",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2 text-warning",children:[a.jsx(Ft,{className:"w-5 h-5"}),"Expected Competition"]})}),a.jsxs(re,{children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Companies that have won similar contracts in this category"}),o.length>0?a.jsx("div",{className:"space-y-3",children:Array.from(new Set(o.map($=>$.recipient_name||$.contractor).filter(Boolean))).slice(0,8).map(($,ae)=>{const oe=o.filter(ue=>(ue.recipient_name||ue.contractor)===$),z=oe.reduce((ue,Ne)=>ue+(Ne.award_amount||Ne.amount||Ne.value||0),0),fe=oe.length;return a.jsxs("div",{className:"flex items-start justify-between p-3 rounded-lg bg-background/50 border border-warning/10 hover:border-warning/30 transition-colors",children:[a.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-warning/10 flex items-center justify-center flex-shrink-0",children:a.jsx("span",{className:"text-sm font-bold text-warning",children:($==null?void 0:$.split(" ").map(ue=>ue[0]).join("").slice(0,2))||"CO"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-semibold text-foreground truncate",children:$}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[fe," contract",fe!==1?"s":""," won"]})]})]}),a.jsxs("div",{className:"text-right flex-shrink-0 ml-3",children:[a.jsx("p",{className:"text-sm font-semibold text-warning",children:T(z)}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Total value"})]})]},ae)})}):a.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[a.jsx(mr,{className:"w-10 h-10 mx-auto mb-3 opacity-50"}),a.jsx("p",{className:"text-sm",children:"No competitor data available"}),a.jsx("p",{className:"text-xs mt-1",children:"Historical contract data will appear here"})]})]})]}),r.pricing_breakdown&&(()=>{const $=["product_service_cost","products_service_cost","material_costs","materials","labor_cost","labour_cost","overhead","delivery_costs","transportation","transportation_delivery","profit_margin","inflation_cost","inflation"],ae=Object.entries(r.pricing_breakdown).filter(([oe])=>$.some(z=>oe.toLowerCase().includes(z.toLowerCase()))).reduce((oe,[z,fe])=>(oe[z]=fe,oe),{});return a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs("div",{className:"grid lg:grid-cols-2 gap-8",children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Ov,{className:"w-5 h-5"}),"Cost Breakdown Analysis"]}),a.jsxs(le,{className:"flex items-center gap-2 justify-center lg:justify-start",children:[a.jsx(Ov,{className:"w-5 h-5"}),"Visual Cost Distribution"]})]})}),a.jsx(re,{children:a.jsxs("div",{className:"grid lg:grid-cols-2 gap-8",children:[a.jsx("div",{className:"space-y-4",children:a.jsx(OEe,{pricingBreakdown:ae,totalPrice:r.suggested_price,formatCurrency:T})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"h-80 flex items-center justify-center",children:a.jsx(js,{width:"100%",height:"100%",children:a.jsxs(Wb,{children:[a.jsx(ka,{data:Object.entries(ae).sort(([,oe],[,z])=>{const fe=typeof oe=="number"?oe:parseFloat(String(oe))||0;return(typeof z=="number"?z:parseFloat(String(z))||0)-fe}).map(([oe,z],fe)=>({name:oe.replace(/_/g," ").replace(/\b\w/g,ue=>ue.toUpperCase()),value:typeof z=="number"?z:parseFloat(String(z))||0,percentage:((typeof z=="number"?z:parseFloat(String(z))||0)/r.suggested_price*100).toFixed(1)})),cx:"50%",cy:"50%",labelLine:!1,label:({percentage:oe})=>oe>5?`${oe}%`:"",outerRadius:100,innerRadius:40,fill:"#8884d8",dataKey:"value",stroke:"white",strokeWidth:2,children:Object.entries(ae).sort(([,oe],[,z])=>{const fe=typeof oe=="number"?oe:parseFloat(String(oe))||0;return(typeof z=="number"?z:parseFloat(String(z))||0)-fe}).map((oe,z)=>{const fe=["hsl(213 100% 60%)","hsl(252 82% 51%)","hsl(266 76% 60%)","hsl(252 82% 41%)","hsl(142 76% 36%)","hsl(0 84% 60%)","hsl(43 96% 56%)","hsl(240 21% 96%)"];return a.jsx(Jo,{fill:fe[z%fe.length]},`cell-${z}`)})}),a.jsx(Ar,{formatter:(oe,z)=>[T(Number(oe)),z],contentStyle:{backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))",borderRadius:"8px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"}})]})})}),a.jsx("div",{className:"text-center pt-2",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Total: ",T(r.suggested_price)]})}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h4",{className:"font-medium text-sm text-center text-foreground",children:"Cost Categories"}),a.jsxs("div",{className:"space-y-2",children:[Object.entries(ae).sort(([,oe],[,z])=>{const fe=typeof oe=="number"?oe:parseFloat(String(oe))||0;return(typeof z=="number"?z:parseFloat(String(z))||0)-fe}).map(([oe,z],fe)=>{const ue=["hsl(213 100% 60%)","hsl(252 82% 51%)","hsl(266 76% 60%)","hsl(252 82% 41%)","hsl(142 76% 36%)","hsl(0 84% 60%)","hsl(43 96% 56%)","hsl(240 21% 96%)"],Ne=((typeof z=="number"?z:parseFloat(String(z))||0)/r.suggested_price*100).toFixed(1),He=typeof z=="number"?z:parseFloat(String(z))||0;return a.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-border/30",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:ue[fe%ue.length]}}),a.jsx("span",{className:"text-sm text-foreground",children:oe.replace(/_/g," ").replace(/\b\w/g,ke=>ke.toUpperCase())})]}),a.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[a.jsx("span",{className:"font-medium text-foreground",children:T(He)}),a.jsxs("span",{className:"text-muted-foreground min-w-[45px] text-right",children:[Ne,"%"]})]})]},oe)}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-t-2 border-primary/20 mt-4 pt-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0 bg-primary"}),a.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Total Project Price"})]}),a.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[a.jsx("span",{className:"font-bold text-primary text-base",children:T(r.suggested_price)}),a.jsx("span",{className:"text-primary min-w-[45px] text-right font-medium",children:"100%"})]})]})]})]})]})]})})]})})(),o.length>0&&a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(gt,{className:"w-5 h-5"}),"Past Awards",a.jsxs(ve,{variant:"outline",className:"ml-2",children:[o.length," similar contracts"]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(U,{variant:h===1?"default":"outline",size:"sm",onClick:()=>m(1),disabled:u,children:[u&&h===1?a.jsx(Je,{className:"w-4 h-4 animate-spin mr-1"}):null,"1 Year"]}),a.jsxs(U,{variant:h===3?"default":"outline",size:"sm",onClick:()=>m(3),disabled:u,children:[u&&h===3?a.jsx(Je,{className:"w-4 h-4 animate-spin mr-1"}):null,"3 Years"]}),a.jsxs(U,{variant:h===5?"default":"outline",size:"sm",onClick:()=>m(5),disabled:u,children:[u&&h===5?a.jsx(Je,{className:"w-4 h-4 animate-spin mr-1"}):null,"5 Years"]})]})]})}),a.jsxs(re,{children:[a.jsx("div",{className:"mb-4 p-3 bg-blue-50 border border-blue-200 rounded-lg",children:a.jsx("p",{className:"text-sm text-blue-800 font-medium",children:"ð Previous government contract awards with winning companies and actual pricing data"})}),a.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Real government contracts showing winning companies and award amounts to help inform your pricing strategy."}),a.jsx("div",{className:"space-y-4",children:o.map(($,ae)=>{var ke,Ze,Y;console.log("Contract data:",$);const oe=$.title||$.description||"Government Contract Award",z=$.value||$.award_amount||$.amount||0,fe=$.contractor||$.recipient_name||"Not Available",ue=$.contract_number||$.award_
707id||$.generated_internal_id,Ne=$.usaspending_url||`https://www.usaspending.gov/search/?hash=${ue||`${(ke=$.agency)==null?void 0:ke.replace(/\s+/g,"_")}_${ae}`}`,He=()=>{window.open(Ne,"_blank")};return a.jsxs("div",{className:"relative overflow-hidden rounded-lg border bg-gradient-to-br from-background to-muted/30 p-6 hover:shadow-lg transition-all duration-300 cursor-pointer group",onClick:He,children:[a.jsx("div",{className:"flex items-start justify-between gap-4",children:a.jsxs("div",{className:"flex-1 space-y-4",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"font-semibold text-lg text-foreground leading-tight line-clamp-2 group-hover:text-primary transition-colors",children:oe}),a.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[a.jsx(ve,{variant:"secondary",className:"text-xs",children:$.awarding_agency||$.agency||"Federal Agency"}),($.naics_code||(r==null?void 0:r.naics_code))&&($.naics_code||(r==null?void 0:r.naics_code))!=="541990"&&a.jsxs(ve,{variant:"default",className:"text-xs",style:{backgroundColor:$.naics_code===(r==null?void 0:r.naics_code)?"#059669":"#3b82f6",color:"white"},children:["NAICS ",$.naics_code||(r==null?void 0:r.naics_code)]}),a.jsx(ve,{variant:"outline",className:"text-xs",children:"SAM.gov Data"})]})]}),a.jsx("div",{className:"flex items-center gap-2 text-muted-foreground group-hover:text-primary transition-colors",children:a.jsx(ft,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Award Value"}),a.jsx("p",{className:"text-lg font-bold text-primary",children:T(z)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Winning Company"}),a.jsx("a",{href:E(fe),target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-primary hover:text-primary/80 underline transition-colors",onClick:_e=>{console.log("Company clicked:",fe),(!fe||fe==="Not Available")&&_e.preventDefault()},children:fe})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Award Date"}),a.jsx("p",{className:"text-sm font-medium text-foreground",children:$.award_date||$.start_date?new Date($.award_date||$.start_date).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"Date not available"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Contract #"}),a.jsx("p",{className:"text-sm font-medium text-foreground",children:ue||"N/A"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"NAICS Code"}),a.jsx("p",{className:"text-sm font-medium text-foreground",children:($.naics_code||r!=null&&r.naics_code)&&($.naics_code||(r==null?void 0:r.naics_code))!=="541990"?mI($.naics_code||(r==null?void 0:r.naics_code)):"Analyzing..."}),a.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:($.naics_code||r!=null&&r.naics_code)&&($.naics_code||(r==null?void 0:r.naics_code))!=="541990"?$.naics_description||Wf($.naics_code||(r==null?void 0:r.naics_code))||"Industry classification not available":"Re-analyzing for accurate classification"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 pt-4 border-t border-border/50",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Contract Type"}),a.jsx("p",{className:"text-sm font-medium text-foreground",children:$.award_type||$.contract_award_type||"Firm Fixed Price"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Award ID"}),a.jsx("p",{className:"text-xs font-mono bg-muted px-2 py-1 rounded",children:$.award_id||`${(Ze=$.agency||"FED")==null?void 0:Ze.slice(0,3).toUpperCase()}-${new Date().getFullYear()}-${ae.toString().padStart(4,"0")}`})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Service Category"}),a.jsx("p",{className:"text-sm font-medium text-foreground",children:((Y=$.keywords)==null?void 0:Y.slice(0,2).join(", "))||"Professional Services"})]})]}),$.keywords&&$.keywords.length>0&&a.jsxs("div",{className:"pt-3 border-t border-border/30",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:"Key Terms"}),a.jsx("div",{className:"flex flex-wrap gap-1",children:$.keywords.slice(0,6).map((_e,Oe)=>a.jsx(ve,{variant:"outline",className:"text-xs",children:_e},Oe))})]}),$.usaspending_url&&a.jsx("div",{className:"pt-3 border-t border-border/30",children:a.jsxs("a",{href:$.usaspending_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-primary hover:text-primary/80 transition-colors",children:[a.jsx(ft,{className:"h-4 w-4"}),"View on USASpending.gov"]})})]})}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-primary/0 via-primary/5 to-primary/0 opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none"})]},ue||ae)})})]})]}),r.recommendations&&a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(tr,{className:"w-5 h-5"}),"Strategic Recommendations"]})}),a.jsx(re,{children:a.jsx("div",{className:"prose prose-sm max-w-none",children:a.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed text-muted-foreground",children:r.recommendations})})})]})]})]})]})}const q2=()=>{const[e,t]=g.useState(!1),{user:r,session:n}=it();return{createCheckoutSession:async(i,o)=>{console.log("[useCheckout] Starting checkout for priceId:",i),t(!0);try{const l={},c={priceId:i};if(r&&n)l.Authorization=`Bearer ${n.access_token}`,console.log("[useCheckout] User authenticated");else if(o)c.email=o,console.log("[useCheckout] Guest checkout with email");else{kr({title:"Email required",description:"Please provide an email to continue.",variant:"destructive"}),t(!1);return}console.log("[useCheckout] Invoking create-checkout function");const{data:d,error:u}=await Z.functions.invoke("create-checkout",{body:c,headers:l});if(console.log("[useCheckout] Function response:",{data:d,error:u}),u)throw console.error("[useCheckout] Function error:",u),u;if(console.log("[useCheckout] Checking for URL in data:",d),d!=null&&d.url)console.log("[useCheckout] Checkout URL received, redirecting to:",d.url),window.self!==window.top?(console.log("[useCheckout] Opening in new tab (iframe detected)"),window.open(d.url,"_blank")):(console.log("[useCheckout] Using direct navigation"),window.location.href=d.url);else throw console.error("[useCheckout] No URL in response data:",d),new Error("No checkout URL returned")}catch(l){console.error("[useCheckout] Checkout error:",l),kr({title:"Checkout failed",description:l.message||"Failed to create checkout session",variant:"destructive"})}finally{t(!1)}},loading:e}},l0=({type:e,data:t})=>{const r={"@context":"https://schema.org","@type":e,...t};return a.jsx(gR,{children:a.jsx("script",{type:"application/ld+json",children:JSON.stringify(r)})})},IEe=()=>
707a.jsx(l0,{type:"Organization",data:{name:"Pricebid",url:"https://pricebid.com",logo:"https://pricebid.com/logo.png",description:"AI-powered contract pricing platform for government contractors",sameAs:["https://twitter.com/pricebid","https://linkedin.com/company/pricebid"],contactPoint:{"@type":"ContactPoint",telephone:"+1-800-PRICEBID",contactType:"customer service",availableLanguage:"English"}}}),$Ee=()=>a.jsx(l0,{type:"WebSite",data:{name:"Pricebid",url:"https://pricebid.com",description:"Contract pricing platform with AI-powered bid analysis",potentialAction:{"@type":"SearchAction",target:"https://pricebid.com/search?q={search_term_string}","query-input":"required name=search_term_string"}}}),REe=()=>a.jsx(l0,{type:"SoftwareApplication",data:{name:"Pricebid Platform",description:"AI-powered contract pricing and bid analysis platform",url:"https://pricebid.com",applicationCategory:"BusinessApplication",operatingSystem:"Web Browser",offers:{"@type":"Offer",price:"100",priceCurrency:"USD",priceValidUntil:"2025-12-31"},aggregateRating:{"@type":"AggregateRating",ratingValue:"4.8",ratingCount:"1250"}}}),DEe=()=>a.jsx(l0,{type:"FAQPage",data:{mainEntity:[{"@type":"Question",name:"How does Pricebid help with contract pricing?",acceptedAnswer:{"@type":"Answer",text:"Pricebid uses AI to analyze historical contract data, market trends, and economic indicators to provide data-driven pricing recommendations for government contracts."}},{"@type":"Question",name:"What types of contracts does Pricebid support?",acceptedAnswer:{"@type":"Answer",text:"Pricebid supports all types of government contracts including construction, IT services, consulting, manufacturing, and professional services contracts."}},{"@type":"Question",name:"How accurate are Pricebid's pricing recommendations?",acceptedAnswer:{"@type":"Answer",text:"Our AI-powered platform achieves 95% accuracy in pricing recommendations by analyzing over 10,000 historical contracts and real-time market data."}}]}});var c0="Switch",[LEe,bRe]=ir(c0),[FEe,BEe]=LEe(c0),jz=g.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:d,form:u,...f}=e,[h,m]=g.useState(null),v=Te(t,w=>m(w)),p=g.useRef(!1),x=h?u||!!h.closest("form"):!0,[b,y]=vr({prop:s,defaultProp:i??!1,onChange:d,caller:c0});return a.jsxs(FEe,{scope:r,checked:b,disabled:l,children:[a.jsx(we.button,{type:"button",role:"switch","aria-checked":b,"aria-required":o,"data-state":Cz(b),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:v,onClick:pe(e.onClick,w=>{y(_=>!_),x&&(p.current=w.isPropagationStopped(),p.current||w.stopPropagation())})}),x&&a.jsx(_z,{control:h,bubbles:!p.current,name:n,value:c,checked:b,required:o,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});jz.displayName=c0;var Nz="SwitchThumb",Sz=g.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=BEe(Nz,r);return a.jsx(we.span,{"data-state":Cz(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});Sz.displayName=Nz;var zEe="SwitchBubbleInput",_z=g.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},i)=>{const o=g.useRef(null),l=Te(o,i),c=Pp(r),d=Ty(t);return g.useEffect(()=>{const u=o.current;if(!u)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==r&&m){const v=new Event("click",{bubbles:n});m.call(u,r),u.dispatchEvent(v)}},[c,r,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:l,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_z.displayName=zEe;function Cz(e){return e?"checked":"unchecked"}var Pz=jz,UEe=Sz;const On=g.forwardRef(({className:e,...t},r)=>a.jsx(Pz,{className:me("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:r,children:a.jsx(UEe,{className:me("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}
707));On.displayName=Pz.displayName;const Qn=g.forwardRef(({className:e,...t},r)=>a.jsx("textarea",{className:me("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));Qn.displayName="Textarea";const kz=({open:e,onOpenChange:t})=>{const{toast:r}=dt(),[n,s]=g.useState(!1),[i,o]=g.useState({name:"",email:"",company:"",phone:"",message:""}),l=async c=>{c.preventDefault(),s(!0);try{const{supabase:d}=await Fo(async()=>{const{supabase:f}=await Promise.resolve().then(()=>ZZ);return{supabase:f}},void 0),{error:u}=await d.functions.invoke("send-contact-email",{body:{firstName:i.name.split(" ")[0]||i.name,lastName:i.name.split(" ").slice(1).join(" ")||"",email:i.email,company:i.company,message:`Phone: ${i.phone} 708 709${i.message}`}});if(u)throw u;r({title:"Request Submitted!",description:"Our sales team will contact you within 24 hours."}),t(!1),o({name:"",email:"",company:"",phone:"",message:""})}catch{r({title:"Submission Failed",description:"Please try again or email us directly.",variant:"destructive"})}finally{s(!1)}};return a.jsx(rn,{open:e,onOpenChange:t,children:a.jsxs(Wr,{className:"sm:max-w-[500px] max-h-[90vh] overflow-y-auto",children:[a.jsxs(Hr,{children:[a.jsx(Vr,{className:"text-2xl font-bold bg-gradient-to-r from-primary to-purple-600 bg-clip-text text-transparent",children:"Executive Plan - Contact Sales"}),a.jsx(ba,{className:"text-base",children:"Our executive plan requires personalized setup including ACH payment options and dedicated support. Fill out the form below and our team will reach out within 24 hours."})]}),a.jsxs("form",{onSubmit:l,className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Q,{htmlFor:"name",className:"flex items-center gap-2",children:[a.jsx(di,{className:"w-4 h-4"}),"Full Name *"]}),a.jsx(ge,{id:"name",value:i.name,onChange:c=>o({...i,name:c.target.value}),placeholder:"John Doe",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Q,{htmlFor:"email",className:"flex items-center gap-2",children:[a.jsx(an,{className:"w-4 h-4"}),"Email *"]}),a.jsx(ge,{id:"email",type:"email",value:i.email,onChange:c=>o({...i,email:c.target.value}),placeholder:"[email protected]",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Q,{htmlFor:"company",className:"flex items-center gap-2",children:[a.jsx(mr,{className:"w-4 h-4"}),"Company Name *"]}),a.jsx(ge,{id:"company",value:i.company,onChange:c=>o({...i,company:c.target.value}),placeholder:"Acme Corporation",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Q,{htmlFor:"phone",className:"flex items-center gap-2",children:[a.jsx(ky,{className:"w-4 h-4"}),"Phone Number *"]}),a.jsx(ge,{id:"phone",type:"tel",value:i.phone,onChange:c=>o({...i,phone:c.target.value}),placeholder:"+1 (555) 000-0000",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"message",children:"Additional Information"}),a.jsx(Qn,{id:"message",value:i.message,onChange:c=>o({...i,message:c.target.value}),placeholder:"Tell us about your contracting volume, team size, and any specific requirements...",rows:4})]}),a.jsxs("div",{className:"pt-4 space-y-3",children:[a.jsx(U,{type:"submit",className:"w-full bg-gradient-to-r from-primary to-purple-600 hover:from-primary/90 hover:to-purple-700",disabled:n,children:n?a.jsxs("div",{className:"flex items-center justify-center gap-2",children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white/20 border-t-white rounded-full animate-spin"}),a.jsx("span",{children:"Submitting..."})]}):"Submit Request"}),a.jsxs("p",{className:"text-xs text-center text-muted-foreground",children:["You can also reach us directly at"," ",a.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"})]})]})]})]})})};var kc="NavigationMenu",[G2,Az,WEe]=bc(kc),[RS,HEe,VEe]=bc(kc),[K2,wRe]=ir(kc,[WEe,VEe]),[qEe,Ea]=K2(kc),[GEe,KEe]=K2(kc),Ez=g.forwardRef((e,t)=>
vendor: 4,386 bytes, line 709
709{const{__scopeNavigationMenu:r,value:n,onValueChange:s,defaultValue:i,delayDuration:o=200,skipDelayDuration:l=300,orientation:c="horizontal",dir:d,...u}=e,[f,h]=g.useState(null),m=Te(t,P=>h(P)),v=Ii(d),p=g.useRef(0),x=g.useRef(0),b=g.useRef(0),[y,w]=g.useState(!0),[_,N]=vr({prop:n,onChange:P=>{const A=P!=="",D=l>0;A?(window.clearTimeout(b.current),D&&w(!1)):(window.clearTimeout(b.current),b.current=window.setTimeout(()=>w(!0),l)),s==null||s(P)},defaultProp:i??"",caller:kc}),j=g.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>N(""),150)},[N]),S=g.useCallback(P=>{window.clearTimeout(x.current),N(P)},[N]),C=g.useCallback(P=>{_===P?window.clearTimeout(x.current):p.current=window.setTimeout(()=>{window.clearTimeout(x.current),N(P)},o)},[_,N,o]);return g.useEffect(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(x.current),window.clearTimeout(b.current)},[]),a.jsx(Oz,{scope:r,isRootMenu:!0,value:_,dir:v,orientation:c,rootNavigationMenu:f,onTriggerEnter:P=>{window.clearTimeout(p.current),y?C(P):S(P)},onTriggerLeave:()=>{window.clearTimeout(p.current),j()},onContentEnter:()=>window.clearTimeout(x.current),onContentLeave:j,onItemSelect:P=>{N(A=>A===P?"":P)},onItemDismiss:()=>N(""),children:a.jsx(we.nav,{"aria-label":"Main","data-orientation":c,dir:v,...u,ref:m})})});Ez.displayName=kc;var DS="NavigationMenuSub",YEe=g.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,value:n,onValueChange:s,defaultValue:i,orientation:o="horizontal",...l}=e,c=Ea(DS,r),[d,u]=vr({prop:n,onChange:s,defaultProp:i??"",caller:DS});return a.jsx(Oz,{scope:r,isRootMenu:!1,value:d,dir:c.dir,orientation:o,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:f=>u(f),onItemSelect:f=>u(f),onItemDismiss:()=>u(""),children:a.jsx(we.div,{"data-orientation":o,...l,ref:t})})});YEe.displayName=DS;var Oz=e=>{const{scope:t,isRootMenu:r,rootNavigationMenu:n,dir:s,orientation:i,children:o,value:l,onItemSelect:c,onItemDismiss:d,onTriggerEnter:u,onTriggerLeave:f,onContentEnter:h,onContentLeave:m}=e,[v,p]=g.useState(null),[x,b]=g.useState(new Map),[y,w]=g.useState(null);return a.jsx(qEe,{scope:t,isRootMenu:r,rootNavigationMenu:n,value:l,previousValue:Pp(l),baseId:tn(),dir:s,orientation:i,viewport:v,onViewportChange:p,indicatorTrack:y,onIndicatorTrackChange:w,onTriggerEnter:_t(u),onTriggerLeave:_t(f),onContentEnter:_t(h),onContentLeave:_t(m),onItemSelect:_t(c),onItemDismiss:_t(d),onViewportContentChange:g.useCallback((_,N)=>{b(j=>(j.set(_,N),new Map(j)))},[]),onViewportContentRemove:g.useCallback(_=>{b(N=>N.has(_)?(N.delete(_),new Map(N)):N)},[]),children:a.jsx(G2.Provider,{scope:t,children:a.jsx(GEe,{scope:t,items:x,children:o})})})},Tz="NavigationMenuList",Mz=g.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,...n}=e,s=Ea(Tz,r),i=a.jsx(we.ul,{"data-orientation":s.orientation,...n,ref:t});return a.jsx(we.div,{style:{position:"relative"},ref:s.onIndicatorTrackChange,children:a.jsx(G2.Slot,{scope:r,children:s.isRootMenu?a.jsx(Wz,{asChild:!0,children:i}):i})})});Mz.displayName=Tz;var Iz="NavigationMenuItem",[XEe,$z]=K2(Iz),Rz=g.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,value:n,...s}=e,i=tn(),o=n||i||"LEGACY_REACT_AUTO_VALUE",l=g.useRef(null),c=g.useRef(null),d=g.useRef(null),u=g.useRef(()=>{}),f=g.useRef(!1),h=g.useCallback((v="start")=>{if(l.current){u.current();const p=FS(l.current);p.length&&Q2(v==="start"?p:p.reverse())}},[]),m=g.useCallback(()=>{if(l.current){const v=FS(l.current);v.length&&(u.current=nOe(v))}},[]);return a.jsx(XEe,{scope:r,value:o,triggerRef:c,contentRef:l,focusProxyRef:d,wasEscapeCloseRef:f,onEntryKeyDown:h,onFocusProxyEnter:h,onRootContentClose:m,onContentFocusOutside:m,children:a.jsx(we.li,{...s,ref:t})})});Rz.displayName=Iz;var LS="NavigationMenuTrigger",Dz=g.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,disabled:n,...s}=e,i=Ea(LS,e.__scopeNavigationMenu),o=$z(LS,e.__scopeNavigationMenu),l=g.useRef(null),c=Te(l,o.triggerRef,t),d=Vz(i.baseId,o.value),u=qz(i.baseId,o.value),f=g.useRef(!1),h=g.useRef(!1),m=o.value===i.value;return a.jsxs(a.Fragment,{children:[a.jsx(G2.ItemSlot,{scope:r,value:o.value,children:a.jsx(Hz,{asChild:!0,children:a.jsx(we.button,{id:d,disabled:n,"data-disabled":n?"":void 0,"data-state":J2(m),"aria-expanded":m,"aria-controls":u,...s,ref:c,onPointerEnter:pe(e.onPointerEnter,()=>{h.current=!1,o.wasEscapeCloseRef.current=!1}),onPointerMove:pe(e.onPointerMove,ny(()=>
709{n||h.current||o.wasEscapeCloseRef.current||f.current||(i.onTriggerEnter(o.value),f.current=!0)})),onPointerLeave:pe(e.onPointerLeave,ny(()=>{n||(i.onTriggerLeave(),f.current=!1)})),onClick:pe(e.onClick,()=>{i.onItemSelect(o.value),h.current=m}),onKeyDown:pe(e.onKeyDown,v=>{const x={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];m&&v.key===x&&(o.onEntryKeyDown(),v.preventDefault())})})})}),m&&a.jsxs(a.Fragment,{children:[a.jsx(NR,{"aria-hidden":!0,tabIndex:0,ref:o.focusProxyRef,onFocus:v=>{const p=o.contentRef.current,x=v.relatedTarget,b=x===l.current,y=p==null?void 0:p.contains(x);(b||!y)&&o.onFocusProxyEnter(b?"start":"end")}}),i.viewport&&a.jsx("span",{"aria-owns":u})]})]})});Dz.displayName=LS;var QEe="NavigationMenuLink",pI="navigationMenu.linkSelect",Lz=g.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,active:n,onSelect:s,...i}=e;return a.jsx(Hz,{asChild:!0,children:a.jsx(we.a,{"data-active":n?"":void 0,"aria-current":n?"page":void 0,...i,ref:t,onClick:pe(e.onClick,o=>{const l=o.target,c=new CustomEvent(pI,{bubbles:!0,cancelable:!0});if(l.addEventListener(pI,d=>s==null?void 0:s(d),{once:!0}),Vh(l,c),!c.defaultPrevented&&!o.metaKey){const d=new CustomEvent(nv,{bubbles:!0,cancelable:!0});Vh(l,d)}},{checkForDefaultPrevented:!1})})})});Lz.displayName=QEe;var Y2="NavigationMenuIndicator",Fz=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Ea(Y2,e.__scopeNavigationMenu),i=!!s.value;return s.indicatorTrack?B_.createPortal(a.jsx(Zt,{present:r||i,children:a.jsx(JEe,{...n,ref:t})}),s.indicatorTrack):null});Fz.displayName=Y2;var JEe=g.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,...n}=e,s=Ea(Y2,r),i=Az(r),[o,l]=g.useState(null),[c,d]=g.useState(null),u=s.orientation==="horizontal",f=!!s.value;g.useEffect(()=>{var p;const v=(p=i().find(x=>x.value===s.value))==null?void 0:p.ref.current;v&&l(v)},[i,s.value]);const h=()=>{o&&d({size:u?o.offsetWidth:o.offsetHeight,offset:u?o.offsetLeft:o.offsetTop})};return BS(o,h),BS(s.indicatorTrack,h),c?a.jsx(we.div,{"aria-hidden":!0,"data-state":f?"visible":"hidden","data-orientation":s.orientation,...n,ref:t,style:{position:"absolute",...u?{left:0,width:c.size+"px",transform:`translateX(${c.offset}px)`}:{top:0,height:c.size+"px",transform:`translateY(${c.offset}px)`},...n.style}}):null}),Lu="NavigationMenuContent",Bz=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Ea(Lu,e.__scopeNavigationMenu),i=$z(Lu,e.__scopeNavigationMenu),o=Te(i.contentRef,t),l=i.value===s.value,c={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...n};return s.viewport?a.jsx(ZEe,{forceMount:r,...c,ref:o}):a.jsx(Zt,{present:r||l,children:a.jsx(zz,{"data-state":J2(l),...c,ref:o,onPointerEnter:pe(e.onPointerEnter,s.onContentEnter),onPointerLeave:pe(e.onPointerLeave,ny(s.onContentLeave)),style:{pointerEvents:!l&&s.isRootMenu?"none":void 0,...c.style}})})});Bz.displayName=Lu;var ZEe=g.forwardRef((e,t)=>{const r=Ea(Lu,e.__scopeNavigationMenu),{onViewportContentChange:n,onViewportContentRemove:s}=r;return Kt(()=>{n(e.value,{ref:t,...e})},[e,t,n]),Kt(()=>()=>s(e.value),[e.value,s]),null}),nv="navigationMenu.rootContentDismiss",zz=g.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,value:n,triggerRef:s,focusProxyRef:i,wasEscapeCloseRef:o,onRootContentClose:l,onContentFocusOutside:c,...d}=e,u=Ea(Lu,r),f=g.useRef(null),h=Te(f,t),m=Vz(u.baseId,n),v=qz(u.baseId,n),p=Az(r),x=g.useRef(null),{onItemDismiss:b}=u;g.useEffect(()=>{const w=f.current;if(u.isRootMenu&&w){const _=()=>{var N;b(),l(),w.contains(document.activeElement)&&((N=s.current)==null||N.focus())};return w.addEventListener(nv,_),()=>w.removeEventListener(nv,_)}},[u.isRootMenu,e.value,s,b,l]);const y=g.useMemo(()=>{const _=p().map(A=>A.value);u.dir==="rtl"&&_.reverse();const N=_.indexOf(u.value),j=_.indexOf(u.previousValue),S=n===u.value,C=j===_.indexOf(n);if(!S&&!C)return x.current;const P=(()=>{if(N!==j){if(S&&j!==-1)return N>j?"from-end":"from-start";if(C&&N!==-1)return N>j?"to-start":"to-end"}return null})();return x.current=P,P},[u.previousValue,u.value,u.dir,p,n]);return a.jsx(Wz,{asChild:!0,children:a.jsx(qo,{id:v,"aria-labelledby":m,"data-motion":y,"data-orientation":u.orientation,...d,ref:h,disableOutsidePointerEvents:!1,onDismiss:()=>{var _;const w=new Event(nv,{bubbles:!0,cancelable:!0});(_=f.current)==null||_.dispatchEvent(w)},onFocusOutside:pe(e.onFocusOutside,w=>{var N;c();const _=w.target;(N=u.rootNavigationMenu)!=null&&N.contains(_)&&w.preventDefault()}),onPointerDownOutside:pe(e.onPointerDownOutside,w=>{var S;const _=w.target,N=p().some(C=>{var P;return(P=C.ref.current)==null?void 0:P.contains(_)}),j=u.isRootMenu&&((S=u.viewport)==null?void 0:S.contains(_));(N||j||!u.isRootMenu)&&w.preventDefault()}),onKeyDown:pe(e.onKeyDown,w=>{var j;const _=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!_){const S=FS(w.currentTarget),C=document.activeElement,P=S.findIndex(F=>F===C),D=w.shiftKey?S.slice(0,P).reverse():S.slice(P+1,S.length);Q2(D)?w.preventDefault():(j=i.current)==null||j.focus()}}),onEscapeKeyDown:pe(e.onEscapeKeyDown,w=>{o.current=!0})})})}),X2="NavigationMenuViewport",Uz=g.forwardRef((e,t)=>
709{const{forceMount:r,...n}=e,i=!!Ea(X2,e.__scopeNavigationMenu).value;return a.jsx(Zt,{present:r||i,children:a.jsx(eOe,{...n,ref:t})})});Uz.displayName=X2;var eOe=g.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,children:n,...s}=e,i=Ea(X2,r),o=Te(t,i.onViewportChange),l=KEe(Lu,e.__scopeNavigationMenu),[c,d]=g.useState(null),[u,f]=g.useState(null),h=c?(c==null?void 0:c.width)+"px":void 0,m=c?(c==null?void 0:c.height)+"px":void 0,v=!!i.value,p=v?i.value:i.previousValue;return BS(u,()=>{u&&d({width:u.offsetWidth,height:u.offsetHeight})}),a.jsx(we.div,{"data-state":J2(v),"data-orientation":i.orientation,...s,ref:o,style:{pointerEvents:!v&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":h,"--radix-navigation-menu-viewport-height":m,...s.style},onPointerEnter:pe(e.onPointerEnter,i.onContentEnter),onPointerLeave:pe(e.onPointerLeave,ny(i.onContentLeave)),children:Array.from(l.items).map(([b,{ref:y,forceMount:w,..._}])=>{const N=p===b;return a.jsx(Zt,{present:w||N,children:a.jsx(zz,{..._,ref:tp(y,j=>{N&&j&&f(j)})})},b)})})}),tOe="FocusGroup",Wz=g.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,...n}=e,s=Ea(tOe,r);return a.jsx(RS.Provider,{scope:r,children:a.jsx(RS.Slot,{scope:r,children:a.jsx(we.div,{dir:s.dir,...n,ref:t})})})}),gI=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],rOe="FocusGroupItem",Hz=g.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,...n}=e,s=HEe(r),i=Ea(rOe,r);return a.jsx(RS.ItemSlot,{scope:r,children:a.jsx(we.button,{...n,ref:t,onKeyDown:pe(e.onKeyDown,o=>{if(["Home","End",...gI].includes(o.key)){let c=s().map(f=>f.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(o.key)&&c.reverse(),gI.includes(o.key)){const f=c.indexOf(o.currentTarget);c=c.slice(f+1)}setTimeout(()=>Q2(c)),o.preventDefault()}})})})});function FS(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Q2(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}function nOe(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const r=t.dataset.tabindex;t.setAttribute("tabindex",r)})}}function BS(e,t){const r=_t(t);Kt(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}function J2(e){return e?"open":"closed"}function Vz(e,t){return`${e}-trigger-${t}`}function qz(e,t){return`${e}-content-${t}`}function ny(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Gz=Ez,Kz=Mz,aOe=Rz,Yz=Dz,sOe=Lz,Xz=Fz,Qz=Bz,Jz=Uz;const Zz=g.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Gz,{ref:n,className:me("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,a.jsx(nU,{})]}));Zz.displayName=Gz.displayName;const eU=g.forwardRef(({className:e,...t},r)=>a.jsx(Kz,{ref:r,className:me("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));eU.displayName=Kz.displayName;const vI=aOe,iOe=ki("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),tU=g.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Yz,{ref:n,className:me(iOe(),"group",e),...r,children:[t," ",a.jsx(Go,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));tU.displayName=Yz.displayName;const rU=g.forwardRef(({className:e,...t},r)=>a.jsx(Qz,{ref:r,className:me("left-0 top-0 w-full bg-background border border-border rounded-md shadow-lg data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",e),...t}));rU.displayName=Qz.displayName;const Gc=sOe,nU=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{className:me("absolute left-0 top-full flex justify-center z-50"),children:a.jsx(Jz,{className:me("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-background text-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:r,...t})}));nU.displayName=Jz.displayName;const oOe=g.forwardRef(({className:e,...t},r)=>a.jsx(Xz,{ref:r,className:me("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:a.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));oOe.displayName=Xz.displayName;const lOe=()=>{var j,S,C;const{user:e,signOut:t,loading:r}=it(),{createCheckoutSession:n,loading:s}=q2(),[i,o]=g.useState(!1),[l,c]=g.useState(!1),[d,u]=g.useState(!1),[f,h]=g.useState(!1),[m,v]=g.useState(""),[p,x]=g.useState(!1),b={basic:{monthly:"price_1SEzUNLzALanhniW4Hql0xm9",annual:"price_1SFImkLzALanhniWL0WAzdum"},standard:{monthly:"price_1SEzVhLzALanhniWD2GBGDtD",annual:"price_1SFInOLzALanhniWlqlc64Z9"},pro:{monthly:"price_1SEzWfLzALanhniWO6m3ImJm",annual:"price_1SFInsLzALanhniWxnZGWy5U"},enterprise:{monthly:"price_1SEzWoLzALanhniWJ9OLxHWU",annual:"price_1SFJ1nLzALanhniWQPATIk9c"}},y=[{name:"Starter",monthlyPrice:299,annualPrice:2880,priceId:b.basic},{name:"Pro",monthlyPrice:899,annualPrice:8640,priceId:b.standard},{name:"Enterprise",monthlyPrice:2499,annualPrice:24e3,priceId:b.pro},{name:"Executive",monthlyPrice:4999,annualPrice:48e3,priceId:b.enterprise}],w=(P,A)=>{const D=P*12;return((D-A)/D*100).toFixed(0)},_=async(P,A)=>{if(console.log("[Home] handleSubscribe called for:",A),A==="Executive"&&d){console.log("[Home] Opening contact sales dialog"),h(!0);return}const D=d?P.annual:P.monthly;if(console.log("[Home] Selected price ID:",D),!e){console.log("[Home] No user, redirecting to signup"),sessionStorage.setItem("selectedPriceId",D),sessionStorage.setItem("selectedPlanName",A),window.location.href="/signup";return}console.log("[Home] Calling createCheckoutSession"),await n(D)},N=async P=>{if(P.preventDefault(),!m||!m.includes("@")){We.error("Please enter a valid email address");return}x(!0);try{if(!(await fetch(`${Z.supabaseUrl}/functions/v1/send-contact-email`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"Demo Request",email:m,message:"User requested a demo from the homepage"})})).ok)throw new Error("Failed to send request");We.success("Demo request sent! We'll contact you soon."),v("")}catch(A){console.error("Error sending demo request:",A),We.error("Failed to send request. Please try again.")}finally{x(!1)}};return a.jsxs(a.Fragment,{children:[a.jsx(kz,{open:f,onOpenChange:h}),a.jsx($r,{title:"PriceBid | The Ultimate Contract Winning Platform",description:"Win more government contracts with AI-powered pricing analysis. Upload contracts, get data-backed price bids, and increase your win rate by 95%. Start free trial today.",keywords:"contract pricing, government contracts, bid pricing, RFP pricing, contract bidding, price analysis, government contracting, bid calculator, contract management, pricing strategy, AI pricing",url:"https://pricebid.com"}),a.jsx(IEe,{}),a.jsx($Ee,{}),a.jsx(REe,{}),a.jsx(DEe,{}),a.jsxs("div",{className:"min-h-screen bg-gradient-background",children:[a.jsx("header",{className:"sticky top-0 z-50 w-full border-b border-border glass-card backdrop-blur-lg",role:"banner",children:a.jsx("div",{className:"max-w-7xl mx-auto px-3 sm:px-6 py-3 sm:py-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[a.jsxs(e0,{open:i,onOpenChange:o,children:[a.jsx(F2,{asChild:!0,children:a.jsxs(U,{variant:"ghost",size:"icon",className:"lg:hidden h-10 w-10 -ml-2",children:[a.jsx(K_,{className:"w-6 h-6"}),a.jsx("span",{className:"sr-only",children:"Open menu"})]})}),a.jsxs(_p,{side:"left",className:"w-72 bg-background border-border p-0",children:[a.jsx(t0,{className:"px-4 py-6 border-b border-border hero-gradient",children:a.jsxs("div",{className:"flex items-center justify-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 bg-white/30 rounded-xl flex items-center justify-center shadow-lg",children:a.jsx("span",{className:"font-bold text-white text-sm",children:"PB"})}),a.jsx(r0,{className:"text-white",children:"PriceBid"})]})}),a.jsxs("nav",{className:"flex flex-col bg-background",children:[a.jsx("div",{className:"border-b border-border",children:a.jsx(je,{to:"/opportunities",onClick:()=>o(!1),className:"flex items-center px-4 py-3 text-sm font-medium text-foreground hover:bg-accent transition-colors",children:"RFP's"})}),a.jsxs("div",{className:"border-b border-border",children:[a.jsxs("button",{onClick:()=>c(!l),className:"w-full flex items-center justify-between px-4 py-3 text-sm font-medium text-foreground hover:bg-accent transition-colors",children:[a.jsx("span",{children:"Products"}),a.jsx(Go,{className:`h-4 w-4 transition-transform ${l?"rotate-180":""}`})]}),l&&a.jsxs("div",{className:"px-4 pb-3 space-y-1",children:[a.jsx(je,{to:"/pricebid",onClick:()=>o(!1),className:"flex items-center px-3 py-2.5 text-sm text-foreground hover:bg-accent rounded-lg transition-colors",children:"PriceBid"}),a.jsx(je,{to:"/bidscale",onClick:()=>o(!1),className:"flex items-center px-3 py-2.5 text-sm text-foreground hover:bg-accent rounded-lg transition-colors",children:"BidScale"}),a.jsx(je,{to:"/consulting",onClick:()=>o(!1),className:"flex items-center px-3 py-2.5 text-sm text-foreground hover:bg-accent rounded-lg transition-colors",children:"Consulting"}),a.jsx(je,{to:"/certifications",onClick:()=>o(!1),className:"flex items-center px-3 py-2.5 text-sm text-foreground hover:bg-accent rounded-lg transition-colors",children:"Certifications"}),a.jsx(je,{to:"/financing",onClick:()=>o(!1),className:"flex items-center px-3 py-2.5 text-sm text-foreground hover:bg-accent rounded-lg transition-colors",children:"Financing"}),a.jsx(je,{to:"/bidconnect",onClick:()=>o(!1),className:"flex items-center px-3 py-2.5 text-sm text-foreground hover:bg-accent rounded-lg transition-colors",children:"BidConnect"})]})]}),a.jsxs("div",{className:"px-4 py-3 space-y-1",children:[a.jsx(je,{to:"/plans",onClick:()=>o(!1),className:"flex items-center px-3 py-2.5 text-sm text-foreground hover:bg-accent rounded-lg transition-colors font-medium",children:"Plans"}),a.jsx(je,{to:"/about",onClick:()=>o(!1),className:"flex items-center px-3 py-2.5 text-sm text-foreground hover:bg-accent rounded-lg transition-colors font-medium",children:"About"}),a.jsx("a",{href:"#contact",onClick:()=>o(!1),className:"flex items-center px-3 py-2.5 text-sm text-foreground hover:bg-accent rounded-lg transition-colors font-medium",children:"Contact"}),a.jsx(je,{to:"/news",onClick:()=>o(!1),className:"flex items-center px-3 py-2.5 text-sm text-foreground hover:bg-accent rounded-lg transition-colors font-medium",children:"News"})]}),a.jsx("div",{className:"pt-4 border-t border-border space-y-2",children:e?a.jsxs(a.Fragment,{children:[a.jsx(U,{asChild:!0,className:"w-full hero-gradient",onClick:()=>o(!1),children:a.jsx(je,{to:"/dashboard",children:"Dashboard"})}),a.jsx(U,{variant:"outline",className:"w-full",onClick:()=>{t(),o(!1)},children:"Sign Out"})]}):a.jsxs(a.Fragment,{children:[a.jsx(U,{asChild:!0,variant:"outline",className:"w-full",onClick:()=>o(!1),children:a.jsx(je,{to:"/login",children:"Sign In"})}),a.jsx(U,{asChild:!0,className:"w-full hero-gradient",onClick:()=>o(!1),children:a.jsx(je,{to:"/signup",children:"Get Started"})})]})})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[a.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 hero-gradient rounded-xl flex items-center justify-center shadow-lg font-bold text-white text-xs sm:text-sm",role:"img","aria-label":"Pricebi
709d logo",children:"PB"}),a.jsx("h1",{className:"font-bold text-base sm:text-xl text-gradient",children:"PriceBid"})]})]}),a.jsxs("nav",{className:"hidden lg:flex items-center",role:"navigation","aria-label":"Main navigation",children:[a.jsx(Zz,{children:a.jsxs(eU,{children:[a.jsx(vI,{children:a.jsx(je,{to:"/opportunities",className:"text-base text-foreground hover:text-purple-600 font-medium px-4 py-2 inline-flex items-center",children:"RFP's"})}),a.jsxs(vI,{children:[a.jsx(tU,{className:"bg-transparent hover:bg-transparent focus:bg-transparent data-[state=open]:bg-transparent text-base text-foreground hover:text-purple-600 font-medium",children:"Products"}),a.jsx(rU,{children:a.jsxs("ul",{className:"grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px]",children:[a.jsx("li",{children:a.jsx(Gc,{asChild:!0,children:a.jsxs(je,{to:"/pricebid",className:"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[a.jsx("div",{className:"text-sm font-medium leading-none",children:"PriceBid"}),a.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:"Real-time bid pricing engine"})]})})}),a.jsx("li",{children:a.jsx(Gc,{asChild:!0,children:a.jsxs(je,{to:"/bidscale",className:"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[a.jsx("div",{className:"text-sm font-medium leading-none",children:"BidScale"}),a.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:"Scale Your Bidding Capacity"})]})})}),a.jsx("li",{children:a.jsx(Gc,{asChild:!0,children:a.jsxs(je,{to:"/consulting",className:"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[a.jsx("div",{className:"text-sm font-medium leading-none",children:"Consulting"}),a.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:"Expert consulting services"})]})})}),a.jsx("li",{children:a.jsx(Gc,{asChild:!0,children:a.jsxs(je,{to:"/certifications",className:"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[a.jsx("div",{className:"text-sm font-medium leading-none",children:"Certifications"}),a.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:"Certification support services"})]})})}),a.jsx("li",{children:a.jsx(Gc,{asChild:!0,children:a.jsxs(je,{to:"/financing",className:"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[a.jsx("div",{className:"text-sm font-medium leading-none",children:"Financing"}),a.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:"Contract financing solutions"})]})})}),a.jsx("li",{children:a.jsx(Gc,{asChild:!0,children:a.jsxs(je,{to:"/bidconnect",className:"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[a.jsx("div",{className:"text-sm font-medium leading-none",children:"BidConnect"}),a.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:"Contractors and Subcontractors Network"})]})})})]})})]})]})}),a.jsxs("div",{className:"flex items-center space-x-8 ml-8",children:[a.jsx(je,{to:"/plans",className:"text-foreground hover:text-purple-600 font-medium transition-colors",children:"Plans"}),a.jsx(je,{to:"/about",className:"text-foreground hover:text-purple-600 font-medium transition-colors",children:"About"}),a.jsx("a",{href:"#contact",className:"text-foreground hover:text-purple-600 font-medium transition-colors",children:"Contact"}),a.jsx(je,{to:"/news",className:"text-foreground hover:text-purple-600 font-medium transition-colors",children:"News"})]})]}),a.jsx("div",{className:"hidden lg:flex items-center gap-4",children:e?a.jsxs(a.Fragment,{children:[a.jsx(U,{asChild:!0,variant:"ghost",children:a.jsx(je,{to:"/dashboard",children:"Dashboard"})}),a.jsxs(Fm,{children:[a.jsx(Bm,{asChild:!0,children:a.jsx(U,{variant:"ghost",className:"relative h-10 w-10 rounded-full p-0",children:a.jsxs(Jx,{className:"h-10 w-10",children:[a.jsx(w8,{src:(j=e.user_metadata)==null?void 0:j.avatar_url,alt:e.email||""}),a.jsx(Zx,{className:"bg-purple-600 text-white",children:((S=e.email)==null?void 0:S.charAt(0).toUpperCase())||"A"})]})})}),a.jsxs($u,{className:"w-56 bg-background border border-border",align:"end",forceMount:!0,children:[a.jsx("div",{className:"flex items-center justify-start gap-2 p-2",children:a.jsxs("div",{className:"flex flex-col space-y-1 leading-none",children:[a.jsx("p",{className:"font-medium",children:e.email}),((C=e.user_metadata)==null?void 0:C.company_name)&&a.jsx("p",{className:"text-xs text-muted-foreground",children:e.user_metadata.company_name})]})}),a.jsx(zm,{}),a.jsx(Fr,{asChild:!0,children:a.jsxs(je,{to:"/profile#contact",className:"flex items-center gap-2",children:[a.jsx(di,{className:"h-4 w-4"}),"Profile"]})}),a.jsx(Fr,{asChild:!0,children:a.jsxs(je,{to:"/profile#preferences",className:"flex items-center gap-2",children:[a.jsx(eu,{className:"h-4 w-4"}),"Settings"]})}),a.jsx(Fr,{asChild:!0,children:a.jsxs(je,{to:"/profile#account",className:"flex items-center gap-2",children:[a.jsx(Kl,{className:"h-4 w-4"}),"Billing"]})}),a.jsx(zm,{}),a.jsxs(Fr,{onClick:t,className:"flex items-center gap-2 text-destructive",children:[a.jsx(Vg,{className:"h-4 w-4"}),"Sign Out"]})]})]})]}):a.jsxs(a.Fragment,{children:[a.jsx(U,{asChild:!0,variant:"ghost",children:a.jsx(je,{to:"/login",children:"Sign In"})}),a.jsx(U,{asChild:!0,className:"bg-purple-600 hover:bg-purple-700",children:a.jsx(je,{to:"/signup",children:"Get Started"})})]})})]})})}),a.jsxs("div",{className:"space-y-4 animate-fade-in",children:[a.jsxs("section",{className:"text-center space-y-8 py-16",role:"main",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("h1",{className:"text-4xl sm:text-6xl md:text-8xl font-bold text-gradient mb-6 animate-scale-in",children:"PriceBid"}),a.jsx("p",{className:"text-xl md:text-2xl text-muted-foreground max-w-3xl mx-auto leading-relaxed",children:"The Ultimate Contract Winning Platform"})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 sm:gap-6 justify-center items-center pt-8 px-4",children:[a.jsx(U,{asChild:!0,size:"lg",className:"text-lg px-10 py-4 h-auto hero-gradient glow-effect smooth-transition hover:scale-105",children:a.jsx(je,{to:"/signup",children:"Start Here - Sign Up"})}),a.jsx(U,{asChild:!0,variant:"outline",size:"lg",className:"text-lg px-8 py-4 h-auto smooth-transition hover:scale-105 border-primary/20",children:a.jsx(je,{to:"/login",children:"Sign In"})})]}),a.jsx("div",{className:"mt-4 pt-3 border-t border-border/30 max-w-lg mx-auto px-4",children:a.jsx("form",{onSubmit:N,className:"w-full",children:a.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[a.jsx(ge,{type:"email",placeholder:"Enter your email",value:m,onChange:P=>v(P.target.value),required:!0,className:"flex-1",disabled:p}),a.jsx(U,{type:"submit",size:"lg",disabled:p,className:"hero-gradient",children:p?"Sending...":"Request Demo"})]})})})]}),a.jsxs("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 px-4","aria-labelledby":"features-heading",children:[a.jsx("h2",{id:"features-heading",className:"sr-only",children:"Platform Features"}),a.jsxs("article",{className:"gradient-card smooth-transition hover:scale-105 hover:glow-effect",children:[a.jsx("header",{children:a.jsxs("h3",{className:"flex items-center gap-3 text-xl font-semibold p-6 pb-2",children:[a.jsx("div",{className:"p-3 rounded-lg bg-primary/10","aria-hidden":"true",children:a.jsx(rc,{className:"h-6 w-6 text-primary"})}),"Real-Time Pricing Engine"]})}),a.jsx("div",{className:"px-6 pb-6",children:a.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Get AI-powered pricing recommendations based on 10,000+ historical contracts, market trends, and economic indicators to optimize your bid success rate."})})]}),a.jsxs(J,{className:"gradient-card smooth-transition hover:scale-105 hover:glow-effect",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-3 text-xl",children:[a.jsx("div",{className:"p-3 rounded-lg bg-primary/10",children:a.jsx(Ft,{className:"h-6 w-6 text-primary"})}),"Win Rate Analytics"]})}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Track your bid success rates and identify winning strategies with comprehensive performance analytics."})})]}),a.jsxs(J,{className:"gradient-card smooth-transition hover:scale-105 hover:glow-effect",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-3 text-xl",children:[a.jsx("div",{className:"p-3 rounded-lg bg-primary/10",children:a.jsx(gt,{className:"h-6 w-6 text-primary"})}),"Contract Management"]})}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Organize and analyze all your contracts in one powerful dashboard with advanced filtering and insights."})})]})]}),a.jsxs("section",{className:"px-4","aria-labelledby":"stats-heading",children:[a.jsxs("div",{className:"text-center mb-12",children:[a.jsxs("h2",{id:"stats-heading",className:"text-3xl md:text-4xl font-bold text-gradient mb-4",children:["Join Over 10,000+ Contractors",a.jsx("br",{}),a.jsx("span",{className:"text-lg md:text-xl font-normal",children:"in Government & Private Sector"})]}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"Proven results from contractors winning more government contracts"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 max-w-5xl mx-auto",children:[a.jsx(J,{className:"gradient-card smooth-transition hover:scale-105 hover:glow-effect text-center p-8",children:a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"w-16 h-16 hero-gradient rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(Ft,{className:"w-8 h-8 text-white"})}),a.jsx("div",{className:"text-5xl font-bold text-gradient",children:"95%"}),a.jsx("div",{className:"text-muted-foreground font-medium",children:"Success Rate Improvement"})]})}),a.jsx(J,{className:"gradient-card smooth-transition hover:scale-105 hover:glow-effect text-center p-8",children:a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"w-16 h-16 hero-gradient rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(rc,{className:"w-8 h-8 text-white"})}),a.jsx("div",{className:"text-5xl font-bold text-gradient",children:"$2.3M"}),a.jsx("div",{className:"text-muted-foreground font-medium",children:"Average Contract Value"})]})}),a.jsx(J,{className:"gradient-card smooth-transition hover:scale-105 hover:glow-effect text-center p-8",children:a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"w-16 h-16 hero-gradient rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(gt,{className:"w-8 h-8 text-white"})}),a.jsx("div",{className:"text-5xl font-bold text-gradient",children:"100K+"}),a.jsx("div",{className:"text-muted-foreground font-medium",children:"Contracts Analyzed"})]})})]})]}),a.jsx("section",{className:"px-4 py-16","aria-labelledby":"testimonials-heading",children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-12",children:[a.jsx("h2",{id:"testimonials-heading",className:"text-3xl md:text-4xl font-bold text-gradient mb-4",children:"Trusted By Procurement Professionals"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"See how PriceBid helps teams win more contracts"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[a.jsx(J,{className:"gradient-card p-6 border-2 border-border hover:border-primary/50 transition-all",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex gap-1 text-amber-500",children:[...Array(5)].map((P,A)=>a.jsx("svg",{className:"w-5 h-5 fill-current",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M10 15l-5.878 3.09 1.123-6.545L.489 6.91l6.572-.955L10 0l2.939 5.955 6.572.955-4.756 4.635 1.123 6.545z"})},A))}
709),a.jsx("p",{className:"text-foreground/90 italic",children:'"It saved my team hours of manual analysis. The pricing accuracy is incredible."'}),a.jsxs("div",{className:"pt-4 border-t border-border/50",children:[a.jsx("p",{className:"font-semibold text-sm",children:"Procurement Manager"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Austin, Texas"})]})]})}),a.jsx(J,{className:"gradient-card p-6 border-2 border-border hover:border-primary/50 transition-all",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex gap-1 text-amber-500",children:[...Array(5)].map((P,A)=>a.jsx("svg",{className:"w-5 h-5 fill-current",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M10 15l-5.878 3.09 1.123-6.545L.489 6.91l6.572-.955L10 0l2.939 5.955 6.572.955-4.756 4.635 1.123 6.545z"})},A))}),a.jsx("p",{className:"text-foreground/90 italic",children:'"PriceBid transformed how we approach government contracts. Our submission and confidence rate doubled."'}),a.jsxs("div",{className:"pt-4 border-t border-border/50",children:[a.jsx("p",{className:"font-semibold text-sm",children:"Contract Analyst"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Washington, D.C."})]})]})}),a.jsx(J,{className:"gradient-card p-6 border-2 border-border hover:border-primary/50 transition-all",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex gap-1 text-amber-500",children:[...Array(5)].map((P,A)=>a.jsx("svg",{className:"w-5 h-5 fill-current",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M10 15l-5.878 3.09 1.123-6.545L.489 6.91l6.572-.955L10 0l2.939 5.955 6.572.955-4.756 4.635 1.123 6.545z"})},A))}),a.jsx("p",{className:"text-foreground/90 italic",children:'"Finally, data-driven pricing tool instead of guesswork. PriceBid is a game changer."'}),a.jsxs("div",{className:"pt-4 border-t border-border/50",children:[a.jsx("p",{className:"font-semibold text-sm",children:"Senior Buyer"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"San Diego, California"})]})]})})]})]})}),a.jsxs("section",{id:"plans",className:"px-4","aria-labelledby":"pricing-heading",children:[a.jsxs("div",{className:"text-center mb-12 space-y-6",children:[a.jsx("h2",{id:"pricing-heading",className:"text-3xl md:text-4xl font-bold text-gradient mb-4",children:"Pick Your Winning Plan"}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"100% Money back guarantee"}),a.jsxs("div",{className:"flex items-center justify-center gap-6 mt-8",children:[a.jsx(Q,{htmlFor:"home-billing-toggle",className:`text-lg font-semibold cursor-pointer transition-all duration-300 ${d?"text-muted-foreground hover:text-foreground":"text-primary scale-110"}`,children:"Monthly"}),a.jsx(On,{id:"home-billing-toggle",checked:d,onCheckedChange:u,className:"data-[state=checked]:bg-gradient-to-r data-[state=checked]:from-primary data-[state=checked]:to-purple-600 data-[state=unchecked]:bg-gradient-to-r data-[state=unchecked]:from-primary data-[state=unchecked]:to-purple-600 scale-125 shadow-lg"}),a.jsxs(Q,{htmlFor:"home-billing-toggle",className:`text-lg font-semibold cursor-pointer transition-all duration-300 flex items-center gap-2 ${d?"text-primary scale-110":"text-muted-foreground hover:text-foreground"}`,children:["Annual",a.jsx("span",{className:"text-xs bg-gradient-to-r from-green-500 to-emerald-600 text-white px-3 py-1 rounded-full font-bold shadow-md",children:"Save up to 20%"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 max-w-7xl mx-auto",children:[a.jsxs(J,{className:"gradient-card transition-all relative flex flex-col touch-manipulation",children:[a.jsxs(de,{children:[a.jsx(le,{className:"text-xl font-bold",children:"Starter"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"text-3xl font-bold text-primary",children:["$",d?y[0].annualPrice.toLocaleString():y[0].monthlyPrice.toLocaleString(),a.jsx("span",{className:"text-sm text-muted-foreground",children:d?"/year":"/month"})]}),d?a.jsxs("div",{className:"text-xs text-green-600 dark:text-green-400 bg-green-500/10 px-2 py-1 rounded font-medium",children:["Save ",w(y[0].monthlyPrice,y[0].annualPrice),"% vs monthly"]}):a.jsxs("div",{className:"text-xs text-muted-foreground bg-muted/30 px-2 py-1 rounded",children:["Or $",y[0].annualPrice.toLocaleStr
709ing(),"/year (save ",w(y[0].monthlyPrice,y[0].annualPrice),"%)"]})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Small contractors testing bids"})]}),a.jsxs(re,{className:"flex flex-col flex-1",children:[a.jsxs("ul",{className:"space-y-2 text-sm flex-1",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"1 Seat"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"10 bids per month"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"Core AI pricing engine"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"Cost summaries"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"Email support"]})]}),a.jsx(U,{className:"w-full bg-purple-600 hover:bg-purple-700 mt-4 active:scale-95 transition-transform",onClick:()=>_(b.basic,"Starter"),disabled:s,children:s?"Loading...":"Get Started"})]})]}),a.jsxs(J,{className:"gradient-card transition-all relative border-2 border-purple-500 flex flex-col touch-manipulation",children:[a.jsx("div",{className:"absolute -top-3 left-1/2 transform -translate-x-1/2",children:a.jsx("span",{className:"bg-purple-600 text-white px-4 py-1 rounded-full text-xs font-medium",children:"Most Popular"})}),a.jsxs(de,{children:[a.jsx(le,{className:"text-xl font-bold",children:"Pro"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"text-3xl font-bold text-primary",children:["$",d?y[1].annualPrice.toLocaleString():y[1].monthlyPrice.toLocaleString(),a.jsx("span",{className:"text-sm text-muted-foreground",children:d?"/year":"/month"})]}),d?a.jsxs("div",{className:"text-xs text-green-600 dark:text-green-400 bg-green-500/10 px-2 py-1 rounded font-medium",children:["Save ",w(y[1].monthlyPrice,y[1].annualPrice),"% vs monthly"]}):a.jsxs("div",{className:"text-xs text-muted-foreground bg-muted/30 px-2 py-1 rounded",children:["Or $",y[1].annualPrice.toLocaleString(),"/year (save ",w(y[1].monthlyPrice,y[1].annualPrice),"%)"]})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Smallâmid firms bidding weekly"})]}),a.jsxs(re,{className:"flex flex-col flex-1",children:[a.jsxs("ul",{className:"space-y-2 text-sm flex-1",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"2 Seats"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"30 bids per month"]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full flex-shrink-0 mt-1.5"}),"Full cost build-up (labor, materials, overhead, profit)"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"Inflation tracking"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"Live chat support"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"Advanced market analytics"]})]}),a.jsx(U,{className:"w-full bg-purple-600 hover:bg-purple-700 mt-4 active:scale-95 transition-transform",onClick:()=>_(b.standard,"Pro"),disabled:s,children:s?"Loading...":"Choose Pro"})]})]}),a.jsxs(J,{className:"gradient-card transition-all relative flex flex-col touch-manipulation",children:[a.jsxs(de,{children:[a.jsx(le,{className:"text-xl font-bold",children:"Enterprise"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"text-3xl font-bold text-primary",children:["$",d?y[2].annualPrice.toLocaleString():y[2].monthlyPrice.toLocaleString(),a.jsx("span",{className:"text-sm text-muted-foreground",children:d?"/year":"/month"})]}),d?a.jsxs("div",{className:"text-xs text-green-600 dark:text-green-400 bg-green-500/10 px-2 py-1 rounded font-medium",children:["Save ",w(y[2].monthlyPrice,y[2].annualPrice),"% vs monthly"]}):a.jsxs("div",{className:"text-xs text-muted-foreground bg-muted/30 px-2 py-1 rounded",children:["Or $",y[2].annualPrice.toLocaleStr
709ing(),"/year (save ",w(y[2].monthlyPrice,y[2].annualPrice),"%)"]})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Prime contractors or GovCon consultants"})]}),a.jsxs(re,{className:"flex flex-col flex-1",children:[a.jsxs("ul",{className:"space-y-2 text-sm flex-1",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"3 Seats"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"Unlimited bids"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"Historical award analysis"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"Dedicated success manager"]})]}),a.jsx(U,{className:"w-full bg-purple-600 hover:bg-purple-700 mt-4 active:scale-95 transition-transform",onClick:()=>_(b.pro,"Enterprise"),disabled:s,children:s?"Loading...":"Choose Enterprise"})]})]}),a.jsxs(J,{className:"gradient-card transition-all relative flex flex-col border-2 border-amber-500 touch-manipulation",children:[a.jsx("div",{className:"absolute -top-3 left-1/2 transform -translate-x-1/2",children:a.jsx("span",{className:"bg-gradient-to-r from-amber-500 to-yellow-500 text-white px-4 py-1 rounded-full text-xs font-medium",children:"ð Executive"})}),a.jsxs(de,{children:[a.jsx(le,{className:"text-xl font-bold",children:"Executive"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"text-3xl font-bold text-primary",children:["$",d?y[3].annualPrice.toLocaleString():y[3].monthlyPrice.toLocaleString(),a.jsx("span",{className:"text-sm text-muted-foreground",children:d?"/year":"/month"})]}),d?a.jsxs("div",{className:"text-xs text-green-600 dark:text-green-400 bg-green-500/10 px-2 py-1 rounded font-medium",children:["Save ",w(y[3].monthlyPrice,y[3].annualPrice),"% vs monthly"]}):a.jsxs("div",{className:"text-xs text-muted-foreground bg-muted/30 px-2 py-1 rounded",children:["Or $",y[3].annualPrice.toLocaleString(),"/year (save ",w(y[3].monthlyPrice,y[3].annualPrice),"%)"]})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"High-volume contractors & consulting firms"})]}),a.jsxs(re,{className:"flex flex-col flex-1",children:[a.jsxs("ul",{className:"space-y-2 text-sm flex-1",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"5 Seats"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"Predictive bid-success scoring (AI confidence index)"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"Proprietary award-trend dashboards"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"Financing optimization (Plaid + Stripe)"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"Dedicated Human Pricing Consultant"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"Custom reporting"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),"Early access to beta features"]})]}),a.jsx(U,{className:`w-full mt-4 active:scale-95 transition-transform ${d?"bg-gradient-to-r from-amber-600 to-yellow-600 hover:from-amber-700 hover:to-yellow-700 text-white":"bg-purple-600 hover:bg-purple-700"}`,onClick:()=>_(b.enterprise,"Executive"),disabled:s,children:s?"Loading...":d?"Contact Sales":"Choose Executive"})]})]})]}),a.jsx("div",{className:"text-center mt-8 max-w-3xl mx-auto",children:a.jsx("p",{className:"text-xs text-muted-foreground/80 leading-relaxed",children:"* All plans require a 24-hour account setup period during business days (MondayâFriday). Orders processed on Frid
709ay will be activated on the following Monday. You will receive email confirmation once your account is fully configured."})})]}),a.jsx("section",{className:"px-4 py-16",children:a.jsx("div",{className:"max-w-4xl mx-auto",children:a.jsx("div",{className:"gradient-card p-8 text-center cursor-pointer hover:scale-105 transition-transform duration-300",onClick:()=>window.open("/guarantee-terms","_blank"),children:a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex justify-center",children:a.jsx("div",{className:"w-16 h-16 bg-gradient-to-r from-green-500 to-emerald-500 rounded-full flex items-center justify-center",children:a.jsx("svg",{className:"w-8 h-8 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})})})}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-gradient",children:"100% Money Back Guarantee"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Make an annual commitment and submit at least 2 bids per month using PriceBid. If you're not completely satisfied with our pricing accuracy and your improved win rate, we'll refund your entire annual subscription."}),a.jsx("p",{className:"text-sm text-primary underline hover:text-primary/80 transition-colors",children:"details"})]})]})})})}),a.jsx("section",{id:"contact",className:"px-4 py-16",children:a.jsxs("div",{className:"max-w-4xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-12",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-gradient mb-4",children:"Get in Touch"}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"Ready to increase your win probability? Let's talk about how PriceBid can help you win more contracts."})]}),a.jsx(J,{className:"gradient-card p-8",children:a.jsxs("form",{className:"space-y-6",onSubmit:async P=>{P.preventDefault();const A=new FormData(P.currentTarget);try{const{data:D,error:F}=await Z.functions.invoke("send-contact-email",{body:{firstName:A.get("firstName"),lastName:A.get("lastName"),email:A.get("email"),company:A.get("company"),message:A.get("message")}});if(F)throw F;We.success("Message sent! We'll get back to you within 24 hours."),P.currentTarget.reset()}catch(D){console.error("Contact form error:",D),We.error("Failed to send message. Please try again or email [email protected] directly.")}},children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{htmlFor:"firstName",className:"text-sm font-medium text-foreground",children:"First Name"}),a.jsx("input",{id:"firstName",name:"firstName",type:"text",required:!0,className:"w-full px-4 py-3 border border-border rounded-lg bg-white dark:bg-white/95 text-gray-900 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent transition-all",placeholder:"Enter your first name"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{htmlFor:"lastName",className:"text-sm font-medium text-foreground",children:"Last Name"}),a.jsx("input",{id:"lastName",name:"lastName",type:"text",required:!0,className:"w-full px-4 py-3 border border-border rounded-lg bg-white dark:bg-white/95 text-gray-900 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent transition-all",placeholder:"Enter your last name"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{htmlFor:"email",className:"text-sm font-medium text-foreground",children:"Email Address"}),a.jsx("input",{id:"email",name:"email",type:"email",required:!0,className:"w-full px-4 py-3 border border-border rounded-lg bg-white dark:bg-white/95 text-gray-900 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent transition-all",placeholder:"Enter your email address"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{htmlFor:"company",className:"text-sm font-medium text-foreground",children:"Company"}),a.jsx("input",{id:"company",name:"company",type:"text",required:!0,className:"w-full px-4 py-3 border border-border rounded-lg bg-white dark:bg-white/95 text-gray-900 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent transition-all",placeholder:"Enter your company name"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{htmlFor:"message",className:"text-sm font-medium text-foreground",children:"Message"}),a.jsx("textarea",{id:"message",name:"message",rows:5,required:!0,className:"w-full px-4 py-3 border border-border rounded-lg bg-white dark:bg-white/95 text-gray-900 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent transition-all resize-none",placeholder:"Tell us about your project and how we
709can help..."})]}),a.jsx(U,{type:"submit",className:"w-full bg-purple-600 hover:bg-purple-700 text-lg py-4 h-auto smooth-transition hover:scale-105",children:"Send Message"})]})})]})})]}),a.jsx(Ci,{}),a.jsx(Um,{})]})]})};var d0="Checkbox",[cOe,jRe]=ir(d0),[dOe,Z2]=cOe(d0);function uOe(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:s,disabled:i,form:o,name:l,onCheckedChange:c,required:d,value:u="on",internal_do_not_use_render:f}=e,[h,m]=vr({prop:r,defaultProp:s??!1,onChange:c,caller:d0}),[v,p]=g.useState(null),[x,b]=g.useState(null),y=g.useRef(!1),w=v?!!o||!!v.closest("form"):!0,_={checked:h,disabled:i,setChecked:m,control:v,setControl:p,name:l,form:o,value:u,hasConsumerStoppedPropagationRef:y,required:d,defaultChecked:To(s)?!1:s,isFormControl:w,bubbleInput:x,setBubbleInput:b};return a.jsx(dOe,{scope:t,..._,children:fOe(f)?f(_):n})}var aU="CheckboxTrigger",sU=g.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},s)=>{const{control:i,value:o,disabled:l,checked:c,required:d,setControl:u,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:m,bubbleInput:v}=Z2(aU,e),p=Te(s,u),x=g.useRef(c);return g.useEffect(()=>{const b=i==null?void 0:i.form;if(b){const y=()=>f(x.current);return b.addEventListener("reset",y),()=>b.removeEventListener("reset",y)}},[i,f]),a.jsx(we.button,{type:"button",role:"checkbox","aria-checked":To(c)?"mixed":c,"aria-required":d,"data-state":dU(c),"data-disabled":l?"":void 0,disabled:l,value:o,...n,ref:p,onKeyDown:pe(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:pe(r,b=>{f(y=>To(y)?!0:!y),v&&m&&(h.current=b.isPropagationStopped(),h.current||b.stopPropagation())})})});sU.displayName=aU;var eP=g.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:s,defaultChecked:i,required:o,disabled:l,value:c,onCheckedChange:d,form:u,...f}=e;return a.jsx(uOe,{__scopeCheckbox:r,checked:s,defaultChecked:i,disabled:l,required:o,onCheckedChange:d,name:n,form:u,value:c,internal_do_not_use_render:({isFormControl:h})=>a.jsxs(a.Fragment,{children:[a.jsx(sU,{...f,ref:t,__scopeCheckbox:r}),h&&a.jsx(cU,{__scopeCheckbox:r})]})})});eP.displayName=d0;var iU="CheckboxIndicator",oU=g.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...s}=e,i=Z2(iU,r);return a.jsx(Zt,{present:n||To(i.checked)||i.checked===!0,children:a.jsx(we.span,{"data-state":dU(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});oU.displayName=iU;var lU="CheckboxBubbleInput",cU=g.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:o,required:l,disabled:c,name:d,value:u,form:f,bubbleInput:h,setBubbleInput:m}=Z2(lU,e),v=Te(r,m),p=Pp(i),x=Ty(n);g.useEffect(()=>{const y=h;if(!y)return;const w=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(w,"checked").set,j=!s.current;if(p!==i&&N){const S=new Event("click",{bubbles:j});y.indeterminate=To(i),N.call(y,To(i)?!1:i),y.dispatchEvent(S)}},[h,p,i,s]);const b=g.useRef(To(i)?!1:i);return a.jsx(we.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??b.current,required:l,disabled:c,name:d,value:u,form:f,...t,tabIndex:-1,ref:v,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});cU.displayName=lU;function fOe(e){return typeof e=="function"}function To(e){return e==="indeterminate"}function dU(e){return To(e)?"indeterminate":e?"checked":"unchecked"}const is=g.forwardRef(({className:e,...t},r)=>a.jsx(eP,{ref:r,className:me("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:a.jsx(oU,{className:me("flex items-center justify-center text-current"),children:a.jsx(q_,{className:"h-4 w-4"})})}));is.displayName=eP.displayName;var u0="Tabs",[hOe,NRe]=ir(u0,[nl]),uU=nl(),[mOe,tP]=hOe(u0),fU=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:s,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=Ii(l),[f,h]=vr({prop:n,onChange:s,defaultProp:i??"",caller:u0});return a.jsx(mOe,{scope:r,baseId:tn(),value:f,onValueChange:h,orientation:o,dir:u,activationMode:c,children:a.jsx(we.div,{dir:u,"data-orientation":o,...d,ref:t})})});fU.displayName=u0;var hU="TabsList",mU=g.forwardRef((e,t)=>
vendor: 4,134 bytes, line 709
709{const{__scopeTabs:r,loop:n=!0,...s}=e,i=tP(hU,r),o=uU(r);return a.jsx(Vb,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(we.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});mU.displayName=hU;var pU="TabsTrigger",gU=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...i}=e,o=tP(pU,r),l=uU(r),c=yU(o.baseId,n),d=bU(o.baseId,n),u=n===o.value;return a.jsx(qb,{asChild:!0,...l,focusable:!s,active:u,children:a.jsx(we.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:t,onMouseDown:pe(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?o.onValueChange(n):f.preventDefault()}),onKeyDown:pe(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(n)}),onFocus:pe(e.onFocus,()=>{const f=o.activationMode!=="manual";!u&&!s&&f&&o.onValueChange(n)})})})});gU.displayName=pU;var vU="TabsContent",xU=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:s,children:i,...o}=e,l=tP(vU,r),c=yU(l.baseId,n),d=bU(l.baseId,n),u=n===l.value,f=g.useRef(u);return g.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),a.jsx(Zt,{present:s||u,children:({present:h})=>a.jsx(we.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&i})})});xU.displayName=vU;function yU(e,t){return`${e}-trigger-${t}`}function bU(e,t){return`${e}-content-${t}`}var pOe=fU,wU=mU,jU=gU,NU=xU;const Ac=pOe,ol=g.forwardRef(({className:e,...t},r)=>a.jsx(wU,{ref:r,className:me("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));ol.displayName=wU.displayName;const Ot=g.forwardRef(({className:e,...t},r)=>a.jsx(jU,{ref:r,className:me("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));Ot.displayName=jU.displayName;const Rt=g.forwardRef(({className:e,...t},r)=>a.jsx(NU,{ref:r,className:me("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Rt.displayName=NU.displayName;var f0="Popover",[SU,SRe]=ir(f0,[Ko]),kp=Ko(),[gOe,ll]=SU(f0),_U=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:o=!1}=e,l=kp(t),c=g.useRef(null),[d,u]=g.useState(!1),[f,h]=vr({prop:n,defaultProp:s??!1,onChange:i,caller:f0});return a.jsx(My,{...l,children:a.jsx(gOe,{scope:t,contentId:tn(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:g.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>u(!0),[]),onCustomAnchorRemove:g.useCallback(()=>u(!1),[]),modal:o,children:r})})};_U.displayName=f0;var CU="PopoverAnchor",vOe=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=ll(CU,r),i=kp(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=s;return g.useEffect(()=>(o(),()=>l()),[o,l]),a.jsx(ip,{...i,...n,ref:t})});vOe.displayName=CU;var PU="PopoverTrigger",kU=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=ll(PU,r),i=kp(r),o=Te(t,s.triggerRef),l=a.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":MU(s.open),...n,ref:o,onClick:pe(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:a.jsx(ip,{asChild:!0,...i,children:l})});kU.displayName=PU;var rP="PopoverPortal",[xOe,yOe]=SU(rP,{forceMount:void 0}),AU=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,i=ll(rP,t);return a.jsx(xOe,{scope:t,forceMount:r,children:a.jsx(Zt,{present:r||i.open,children:a.jsx(Vu,{asChild:!0,container:s,children:n})})})};AU.displayName=rP;var Fu="PopoverContent",EU=g.forwardRef((e,t)=>
vendor: 4,097 bytes, line 709
709{const r=yOe(Fu,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,i=ll(Fu,e.__scopePopover);return a.jsx(Zt,{present:n||i.open,children:i.modal?a.jsx(wOe,{...s,ref:t}):a.jsx(jOe,{...s,ref:t})})});EU.displayName=Fu;var bOe=$o("PopoverContent.RemoveScroll"),wOe=g.forwardRef((e,t)=>{const r=ll(Fu,e.__scopePopover),n=g.useRef(null),s=Te(t,n),i=g.useRef(!1);return g.useEffect(()=>{const o=n.current;if(o)return Gb(o)},[]),a.jsx(xp,{as:bOe,allowPinchZoom:!0,children:a.jsx(OU,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:pe(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:pe(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:pe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),jOe=g.forwardRef((e,t)=>{const r=ll(Fu,e.__scopePopover),n=g.useRef(!1),s=g.useRef(!1);return a.jsx(OU,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),OU=g.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...f}=e,h=ll(Fu,r),m=kp(r);return Hb(),a.jsx(gp,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(qo,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:a.jsx(Iy,{"data-state":MU(h.open),role:"dialog",id:h.contentId,...m,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),TU="PopoverClose",NOe=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=ll(TU,r);return a.jsx(we.button,{type:"button",...n,ref:t,onClick:pe(e.onClick,()=>s.onOpenChange(!1))})});NOe.displayName=TU;var SOe="PopoverArrow",_Oe=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=kp(r);return a.jsx($y,{...s,...n,ref:t})});_Oe.displayName=SOe;function MU(e){return e?"open":"closed"}var COe=_U,POe=kU,kOe=AU,IU=EU;const Wm=COe,Hm=POe,Bu=g.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>a.jsx(kOe,{children:a.jsx(IU,{ref:s,align:t,sideOffset:r,className:me("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Bu.displayName=IU.displayName;function AOe({onContractUploaded:e}){const t=vt(),[r,n]=g.useState(""),[s,i]=g.useState(""),[o,l]=g.useState(!1),[c,d]=g.useState(""),[u,f]=g.useState(""),[h,m]=g.useState(null),[v,p]=g.useState(!1),[x,b]=g.useState("manual"),{toast:y}=dt(),{user:w,loading:_}=it();g.useEffect(()=>{console.log("ImprovedContractUpload - Auth State:",{user:(w==null?void 0:w.email)||"Not authenticated",loading:_,userId:w==null?void 0:w.id})},[w,_]);const N=()=>
709{d(`SOLICITATION FOR COMMERCIAL SERVICES 710 711Solicitation Number: RFQ-2024-IT-001 712Title: Enterprise Software Development Services 713Issuing Office: General Services Administration 714NAICS Code: 541511 - Custom Computer Programming Services 715PSC Code: D316 - Information Technology and Telecommunications 716 717SECTION B - SUPPLIES OR SERVICES AND PRICES 718 719CONTRACT LINE ITEMS (CLINs): 720 721CLIN 0001 - Software Development Services 722Quantity: 1 723Unit: Lot 724Unit Price: $350,000 725Description: Design, development, and implementation of custom enterprise software solution including web application, database design, API development, and integration services. 726 727CLIN 0002 - Project Management Services 728Quantity: 12 729Unit: Months 730Unit Price: $15,000 per month 731Description: Dedicated project management services including schedule management, risk assessment, stakeholder communication, and delivery oversight. 732 733CLIN 0003 - Quality Assurance and Testing 734Quantity: 1 735Unit: Lot 736Unit Price: $85,000 737Description: Comprehensive testing services including unit testing, integration testing, user acceptance testing, security testing, and performance testing. 738 739CLIN 0004 - Documentation and Training 740Quantity: 1 741Unit: Lot 742Unit Price: $45,000 743Description: Complete technical documentation, user manuals, system administration guides, and end-user training programs. 744 745SECTION C - DESCRIPTION/SPECIFICATIONS/WORK STATEMENT 746 747The contractor shall provide professional software development services for a mission-critical enterprise application. The solution must: 748 749Technical Requirements: 750- Support 500+ concurrent users 751- 99.9% uptime requirement 752- FedRAMP compliance for cloud deployment 753- Section 508 accessibility compliance 754- FISMA security requirements
755- API-first architecture with RESTful services 756- Modern web technologies (React, Node.js, PostgreSQL) 757 758Performance Requirements: 759- Page load times under 3 seconds 760- Database response times under 500ms 761- Mobile-responsive design 762- Cross-browser compatibility 763 764Security Requirements: 765- Multi-factor authentication 766- Role-based access control 767- Data encryption at rest and in transit 768- Regular security audits and penetration testing 769 770SECTION E - INSPECTION AND ACCEPTANCE 771All deliverables will be subject to government inspection and acceptance criteria as defined in the Performance Work Statement. 772 773SECTION F - DELIVERIES OR PERFORMANCE 774Performance Period: Base year (12 months) plus 4 option years 775Place of Performance: Contractor facility with periodic on-site work at government facilities 776 777EVALUATION CRITERIA: 778Factor 1: Technical Approach (40%) 779- Understanding of requirements 780- Technical solution architecture 781- Development methodology 782- Quality assurance approach 783 784Factor 2: Past Performance (30%) 785- Relevant experience with similar projects 786- Customer references and ratings 787- Project delivery track record 788- Quality of previous work 789 790Factor 3: Price (30%) 791- Cost reasonableness 792- Value proposition 793- Pricing structure 794 795Total Estimated Contract Value: $675,000 (Base Year) 796 797Due Date: Proposals must be submitted by [DATE] at 2:00 PM EST 798 799Point of Contact: 800Contracting Officer: [Name] 801Email: [email] 802Phone: [phone]`)},j=async()=>{var A,D,F,q;if(!w){console.error("=== AUTH ERROR: User not authenticated ==="),y({title:"Authentication required",description:"Please sign in to upload contracts. Try refreshing the page or signing in again.",variant:"destructive"});return}if(!r.trim()||!c.trim()&&!u.trim()){y({title:"Missing information",description:"Please provide a title and either contract text or a contract link",variant:"destructive"});return}console.log("=== AUTH CHECK PASSED: User authenticated ===",w.email),console.log("=== START: Processing contract ==="),console.log("Contract Link:",u),console.log("Manual Text length:",c==null?void 0:c.length),p(!0);const C=()=>{console.log("=== RESET: Processing state reset ==="),p(!1)},P=setTimeout(()=>{console.error("=== TIMEOUT: Safety timeout triggered after 2 minutes ==="),y({title:"Processing timeout",description:"The process is taking longer than expected. Please try again.",variant:"destructive"}),C()},12e4);try{console.log("STEP 1: Processing manual text or contract link..."),y({title:"Processing started",description:"Analyzing your contract..."});let B=c;if(!c.trim()&&u.trim()){console.log("Fetching contract content from link:",u),y({title:"Fetching contract...",description:"Downloading contract content from the provided link..."});const{data:k,error:G}=await Z.functions.invoke("fetch-contract-content",{body:{contractUrl:u,title:r}});if(G||!(k!=null&&k.success)){const te=(k==null?void 0:k.error)||(k==null?void 0:k.suggestion)||"Failed to fetch contract content from link. The link may be invalid, require authentication, or the content may not be accessible.";console.error("Link fetch error:",te),y({title:"Link fetch failed",description:te,variant:"destructive"}),p(!1);return}if(!k.content||k.content.trim().length<100){y({title:"Link fetch failed",description:"The link returned no usable content. Please paste the contract text directly instead.",variant:"destructive"}),p(!1);return}B=k.content,console.log("Successfully fetched contract content, length:",B.length),y({title:"Contract fetched",de
802scription:`Successfully downloaded ${B.length} characters from the link.`})}const{data:V,error:E}=await Z.functions.invoke("process-manual-text",{body:{text:B,title:r}});if(E)throw new Error(`Text processing failed: ${E.message}`);if(!(V!=null&&V.success))throw new Error("Text processing was not successful");console.log("â STEP 1 COMPLETE: Text processed successfully, fileId:",V.fileId),y({title:"Contract analyzed",description:"Getting industry classification..."}),console.log("STEP 2: Getting NAICS analysis for contract classification (REQUIRED)...");let M=s||null,T=null,L=0;const K=3;if(!M)for(;L<K&&!M;){L++;try{console.log(`NAICS detection attempt ${L}/${K}...`),y({title:"Detecting industry",description:`Classification attempt ${L} of ${K}...`});const{data:k,error:G}=await Z.functions.invoke("analyze-contract-suggestions",{body:{contractTitle:r,contractContent:B}});if(G){if(console.error(`NAICS analysis error (attempt ${L}):`,G),L<K){await new Promise(te=>setTimeout(te,2e3));continue}}else if(M=((D=(A=k==null?void 0:k.naics_suggestions)==null?void 0:A[0])==null?void 0:D.code)||null,T=((F=k==null?void 0:k.industry_suggestions)==null?void 0:F[0])||null,M){console.log("â STEP 2 COMPLETE: Detected NAICS:",M,"Industry:",T),y({title:"Classification successful",description:`Industry: ${T}`});break}}catch(k){if(console.error(`NAICS analysis exception (attempt ${L}):`,k),L<K){await new Promise(G=>setTimeout(G,2e3));continue}}}if(!M){console.error("=== CRITICAL: NAICS detection failed after all attempts ==="),clearTimeout(P),p(!1),l(!0),y({title:"Manual NAICS code required",description:"Please enter the 6-digit NAICS code in the field above and click the button again",variant:"destructive"});return}console.log("STEP 3: Getting bid analysis..."),y({title:"Generating bid",description:"Analyzing pricing and recommendations..."});const{data:H,error:ee}=await Z.functions.invoke("suggest-bid-range",{body:{fileId:V.fileId}});if(ee)throw console.error("=== ERROR: Bid generation failed ===",ee),new Error(`Bid generation failed: ${ee.message||"Unknown error"}`);console.log("â STEP 3 COMPLETE: Bid result received:",H);let se=`Contract Title: ${r} 803`;if(u&&(se+=`Source Link: ${u} 804`),H!=null&&H.success&&H.extractedData){const k=H.extractedData;se+=` 805=== Extracted Metadata === 806`,k.solicitation_number&&(se+=`Solicitation: ${k.solicitation_number} 807`),k.agency&&(se+=`Agency: ${k.agency} 808`),(q=k.clins)!=null&&q.length&&(se+=`CLINs: ${k.clins.length} 809`),k.estimated_value&&(se+=`Estimated Value: $${k.estimated_value} 810`),se+=`Extraction Confidence: ${Math.round((H.extractionConfidence||0)*100)}% 811`}const ne=se+` 812 813=== Full Contract Content === 814 815`+B;let W=w.id;try{const{data:k}=await Z.from("team_members").select("organization_id").eq("user_id",w.id).eq("status","active").single();k!=null&&k.organization_id&&(W=k.organization_id)}catch{console.log("User is organization owner, using their ID")}const ie={user_id:w.id,organization_id:W,title:r,content:ne,file_path:null,file_type:"text/plain",contract_value:null,industry:T,naics_code:M,contract_link:u||null,status:"pending",file_id:V.fileId};console.log("STEP 4: Creating contract record with NAICS:",M,"Industry:",T),console.log("Contract data:",ie);const{data:R,error:O}=await Z.from("contracts").insert(ie).select().single();if(O)throw console.error("=== ERROR: Contract creation failed ===",O),new Error(`Failed to save contract: ${O.message}`);console.log("â STEP 4 COMPLETE: Contract created:",R),console.log("STEP 5: Storing bid result and navigating..."),sessionStorage.setItem("bidResult",JSON.stringify(H)),console.log("â STEP 5 COMPLETE: All steps successful!"),console.log("=== SUCCESS: Contract processing complete ==="),y({title:"Success!",description:"Contract processed and bid generated successfully!"}),t("/bid-results")}catch(B){console.error("=== ERROR: Processing failed ==="),console.error("Error details:",B),console.error("Error stack:",B instanceof Error?B.stack:"No stack trace"),y({title:"Processing failed",description:B instanceof Error?B.message:"Failed to process contract. Please check console for details.",variant:"destructive"})}finally{clearTimeout(P),C(),console.log("=== END: Contract processing finished ===")}},S=async()=>
815{var C,P,A,D,F,q,B,V,E,M,T;if(!w){console.error("=== AUTH ERROR: User not authenticated ==="),y({title:"Authentication required",description:"Please sign in to upload contracts. Try refreshing the page or signing in again.",variant:"destructive"});return}if(!r.trim()||!h){y({title:"Missing information",description:"Please provide a title and select a file",variant:"destructive"});return}console.log("=== AUTH CHECK PASSED: User authenticated ===",w.email),p(!0);try{console.log("Uploading file:",h.name);const L=`${w.id}/${Date.now()}_${h.name}`,{error:K}=await Z.storage.from("contracts").upload(L,h);if(K)throw new Error(`Upload failed: ${K.message}`);console.log("File uploaded successfully:",L);const{data:H,error:ee}=await Z.functions.invoke("process-document",{body:{filePath:L,filename:h.name}});if(ee||!(H!=null&&H.success)){const Ne=(H==null?void 0:H.error)||"Document processing failed";throw console.error("Document processing error:",Ne),new Error(Ne)}console.log("Document processing started, fileId:",H.fileId),y({title:"Enhancing extraction...",description:"Running multi-model intelligent parser for maximum accuracy"});const{autoParseAfterUpload:se}=await Fo(async()=>{const{autoParseAfterUpload:Ne}=await import("./IntelligentParsingClient-E67AlEA3.js");return{autoParseAfterUpload:Ne}},[]),{data:ne,error:W}=await Z.from("contracts").insert({title:r||"Processing...",user_id:w.id,organization_id:w.id,file_id:H.fileId,content:"",status:"pending"}).select("id").single();W&&console.error("Error creating temp contract:",W);let ie=null;if(ne)try{ie=await se(ne.id,H.fileId),console.log("[Intelligent Parsing] Result:",ie),y({title:"Intelligent parsing complete",description:`Confidence: ${ie.confidence}% | Models: ${(C=ie.models)==null?void 0:C.map(He=>He.model).join(", ")}`});const Ne=await Z.from("doc_chunks").select("text").eq("file_id",H.fileId).order("page",{ascending:!0});if(Ne.data&&Ne.data.length>0){const He=Ne.data.map(ke=>ke.text).join(` 816`);Fo(async()=>{const{generateAndStoreEmbedding:ke}=await import("./IntelligentParsingClient-E67AlEA3.js");return{generateAndStoreEmbedding:ke}},[]).then(({generateAndStoreEmbedding:ke})=>{ke(ne.id,He).catch(Ze=>console.error("Background embedding generation failed:",Ze))})}}catch(Ne){console.error("[Intelligent Parsing] Failed:",Ne);const He=Ne instanceof Error?Ne.message:String(Ne);if(He.includes("quality")||He.includes("corrupted")||He.includes("illegible")){y({title:"Document quality issue",description:"The uploaded document produced poor quality text. Please try pasting the contract text manually instead.",variant:"destructive"}),ne&&await Z.from("contracts").delete().eq("id",ne.id),p(!1);return}y({title:"Using fallback extraction",description:"Intelligent parser failed, using standard extraction method"})}let R=((P=ie==null?void 0:ie.data)==null?void 0:P.naics_code)||null,O=((A=ie==null?void 0:ie.data)==null?void 0:A.industry)||null,k=((D=ie==null?void 0:ie.data)==null?void 0:D.contract_value)||null;const{data:G}=await Z.from("extractions").select("payload, confidence").eq("file_id",H.fileId).single();if(R=R||((F=G==null?void 0:G.payload)==null?void 0:F.naics_code)||null,O=O||((q=G==null?void 0:G.payload)==null?void 0:q.industry)||null,k=k||((B=G==null?void 0:G.payload)==null?void 0:B.contract_value)||null,console.log("Final NAICS:",R,"Industry:",O,"Value:",k,"Confidence:",(ie==null?void 0:ie.confidence)||(G==null?void 0:G.confidence)),!R){console.log("No NAICS from extraction, fetching file content for analysis...");const{data:Ne,error:He}=await Z.storage.from("contracts").download(L);if(!He&&Ne){const ke=await Ne.text();y({title:"Analyzing industry...",description:"Detecting NAICS code from document content..."});const{data:Ze}=await Z.functions.invoke("analyze-contract-suggestions",{body:{contractTitle:r,contractContent:ke.substring(0,5e3)}});(E=(V=Ze==null?void 0:Ze.naics_suggestions)==null?void 0:V[0])!=null&&E.code&&(R=Ze.naics_suggestions[0].code,O=((M=Ze.industry_suggestions)==null?void 0:M[0])||null,console.log("AI detected NAICS:",R,"Industry:",O))}}if(!R)throw new Error("Could not determine NAICS code for this contract. Please use the manual text option and provide the NAICS code.");const{data:te}
816=await Z.functions.invoke("suggest-bid-range",{body:{fileId:H.fileId}});let $=w.id;try{const{data:Ne}=await Z.from("team_members").select("organization_id").eq("user_id",w.id).eq("status","active").single();Ne!=null&&Ne.organization_id&&($=Ne.organization_id)}catch{console.log("User is organization owner")}console.log("Fetching full document content for storage...");let ae="";const{data:oe}=await Z.from("doc_chunks").select("text, page, section_type").eq("file_id",H.fileId).order("page",{ascending:!0});if(oe&&oe.length>0)ae=oe.map(Ne=>Ne.text).join(` 817 818`).substring(0,5e4),console.log("â Got content from doc_chunks:",ae.length,"chars");else{const{data:Ne,error:He}=await Z.storage.from("contracts").download(L);if(!He&&Ne)try{ae=(await Ne.text()).substring(0,5e4),console.log("â Got content from file download:",ae.length,"chars")}catch(ke){console.error("Failed to read file content:",ke),ae=`File: ${h.name} (binary content)`}else ae=`File: ${h.name} (content not available)`}const z={user_id:w.id,organization_id:$,title:r,content:ae,file_path:L,file_type:h.type,contract_value:((T=G==null?void 0:G.payload)==null?void 0:T.contract_value)||null,industry:O,naics_code:R,status:"pending",file_id:H.fileId};console.log("Creating contract with NAICS:",R);const{data:fe,error:ue}=await Z.from("contracts").insert(z).select().single();if(ue)throw new Error(`Failed to save contract: ${ue.message}`);te!=null&&te.success&&setTimeout(()=>{y({title:"Bid Analysis Complete",description:`Suggested range: $${te.bidSuggestion.low.toLocaleString()} - $${te.bidSuggestion.high.toLocaleString()}`})},1e3),y({title:"File uploaded successfully",description:"Your contract is being analyzed. You can view it in your contracts list."}),n(""),m(null),e(fe.id)}catch(L){console.error("Upload error:",L),y({title:"Upload failed",description:L instanceof Error?L.message:"Failed to upload file",variant:"destructive"})}finally{p(!1)}};return a.jsxs(J,{className:"w-full max-w-4xl mx-auto",children:[a.jsxs(de,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(gt,{className:"h-5 w-5"}),"Contract Analysis"]}),a.jsx(nt,{children:"Choose one of the three options below to analyze your contract and generate a price bid"}),!_&&!w&&a.jsxs(Zs,{variant:"destructive",className:"mt-4",children:[a.jsx(qh,{className:"h-4 w-4"}),a.jsxs(ei,{children:["You must be signed in to upload contracts. Please ",a.jsx("button",{onClick:()=>t("/login"),className:"underline font-semibold",children:"sign in"})," to continue."]})]}),_&&a.jsxs(Zs,{className:"mt-4",children:[a.jsx(Je,{className:"h-4 w-4 animate-spin"}),a.jsx(ei,{children:"Checking authentication status..."})]})]}),a.jsx(re,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"title",children:"Contract Title *"}),a.jsx(ge,{id:"title",value:r,onChange:C=>n(C.target.value),placeholder:"Enter contract title (e.g., 'IT Services RFP 2024')",required:!0})]}),o&&a.jsxs(Zs,{variant:"destructive",className:"border-2",children:[a.jsx(qh,{className:"h-4 w-4"}),a.jsxs(ei,{className:"space-y-3",children:[a.jsx("p",{className:"font-semibold",children:"â ï¸ Industry classification required"}),a.jsx("p",{className:"text-sm",children:"AI could not detect the NAICS code. Please enter it manually:"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"manualNaics",children:"NAICS Code (Required) *"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ge,{id:"manualNaics",value:s,onChange:C=>i(C.target.value.trim()),placeholder:"e.g., 541512",className:"max-w-[200px] border-2 border-destructive",maxLength:6}),a.jsxs(Wm,{children:[a.jsx(Hm,{asChild:!0,children:a.jsxs(U,{variant:"outline",size:"sm",children:[a.jsx(f1,{className:"h-4 w-4 mr-2"}),"Find NAICS Code"]})}),a.jsx(Bu,{className:"w-80",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"font-semibold",children:"How to find your NAICS code:"}),a.jsxs("ol",{className:"text-sm space-y-1 list-decimal list-inside",children:[a.jsxs("li",{children:["Visit ",a.jsx("a",{href:"https://www.naics.com/search/",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"NAICS.com"})]}),a.jsx("li",{children:"Search for your industry keywords"}),a.jsx("li",{children:"Find the 6-digit code that matches your service"}),a.jsx("li",{children:'Example: "Computer Systems Design" = 541512'})]})]})})]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Enter a 6-digit NAICS code. ",a.jsx("a",{href:"https://www.naics.com/search/",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Search NAICS codes here"})]})]})]})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs(Ac,{value:x,onValueChange:b,className:"w-full",children:[a.jsxs(ol,{className:"grid w-full grid-cols-2",children:[a.jsxs(Ot,{value:"manual",className:"flex items-center gap-2",children:[a.jsx(kq,{className:"h-4 w-4"}),"Paste Contract Text"]}),a.jsxs(Ot,{value:"upload",className:"flex items-center gap-2",children:[a.jsx(Ro,{className:"h-4 w-4"}),"Upload File"]})]}),a.jsxs(Rt,{value:"manual",className:"space-y-4",children:[a.jsxs(Zs,{children:[a.jsx(tr,{className:"h-4 w-4"}),a.jsx(ei,{children:"Paste your contract text below, or scroll down to use the contract link option."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"manualText",children:"Contract Text"}),a.jsx(Qn,{id:"manualText",value:c,onChange:C=>d(C.target.value),placeholder:"Paste your complete contract solicitation text here...",className:"min-h-[400px] font-mono text-sm"}),a.jsx("div",{className:"flex justify-between text-sm text-muted-foreground",children:a.jsxs("span",{children:[c.length.toLocaleStr
818ing()," characters"]})})]}),a.jsx("div",{className:"flex gap-2",children:a.jsx(U,{variant:"outline",onClick:N,disabled:v,className:"flex-1",children:"Load Sample Contract"})})]}),a.jsxs(Rt,{value:"upload",className:"space-y-4",children:[a.jsxs(Zs,{children:[a.jsx(tr,{className:"h-4 w-4"}),a.jsx(ei,{children:"Upload PDF, Word, or text files. Supported formats: .pdf, .docx, .doc, .txt"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-center justify-center w-full",children:a.jsxs("label",{htmlFor:"file-upload",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer hover:bg-accent/50 transition-colors",children:[a.jsxs("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[a.jsx(Ro,{className:"w-12 h-12 mb-4 text-muted-foreground"}),a.jsx("p",{className:"mb-2 text-sm font-semibold",children:h?h.name:"Click to upload or drag and drop"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"PDF, DOCX, DOC, or TXT (MAX. 20MB)"})]}),a.jsx("input",{id:"file-upload",type:"file",className:"hidden",accept:".pdf,.docx,.doc,.txt",onChange:C=>{var A;const P=(A=C.target.files)==null?void 0:A[0];if(P){if(P.size>20*1024*1024){y({title:"File too large",description:"Please select a file smaller than 20MB",variant:"destructive"});return}m(P)}}})]})}),a.jsx(U,{onClick:S,disabled:!w||!r.trim()||!h||v||_,className:"w-full",children:v?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"mr-2 h-4 w-4 animate-spin"}),"Processing File..."]}):"Upload & Analyze File"})]})]})]}),x==="manual"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"text-center",children:a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-0 flex items-center",children:a.jsx("span",{className:"w-full border-t"})}),a.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:a.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"OR"})})]})}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Q,{htmlFor:"contractLink",className:"text-base font-semibold",children:"Contract Link"}),a.jsxs(Wm,{children:[a.jsx(Hm,{asChild:!0,children:a.jsxs("button",{type:"button",className:"text-sm text-primary hover:text-primary/80 underline flex items-center gap-1",children:["sources ",a.jsx(f1,{className:"h-3 w-3"})]})}),a.jsx(Bu,{className:"w-80 max-h-96 overflow-y-auto",align:"start",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("h4",{className:"font-semibold text-sm",children:"Government Contract Sources"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("h5",{className:"font-medium text-sm mb-2",children:"ð Federal-Level Links"}),a.jsxs("ul",{className:"space-y-1 text-sm",children:[a.jsx("li",{children:a.jsxs("a",{href:"https://sam.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["SAM.gov â Solicitations ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{children:a.jsxs("a",{href:"https://usaspending.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["USAspending.gov â Award Pages ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{children:a.jsxs("a",{href:"https://defense.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["Defense.gov â DoD Daily Contracts ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{children:a.jsxs("a",{href:"https://fpds.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["FPDS.gov â Award Details ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{className:"text-xs text-muted-foreground pl-4",children:"(being merged into USAspending but still useful for historical lookups)"})]})]}),a.jsxs("div",{children:[a.jsx("h5",{className:"font-medium text-sm mb-2",children:"ð Agency-Specific Links"}),a.jsxs("ul",{className:"space-y-1 text-sm",children:[a.jsx("li",{children:a.jsxs("a",{href:"https://ebuy.gsa.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["GSA eBuy â Schedule Quotes ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{children:a.jsxs("a",{href:"https://usda.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["USDA Procurement ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{className:"text-xs text-muted-foreground pl-4",children:"(includes commodity and food-related bids)"}),a.jsx("li",{children:a.jsxs("a",{href:"https://era.nih.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["NIH Contracts ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{className:"text-xs text-muted-foreground pl-4",children:"(Electronic Research Administration portal)"}),a.jsx("li",{children:a.jsxs("a",{href:"https://nasa.gov/procurement",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["NASA Procurement ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{children:a.jsxs("a",{href:"https://energy.gov/procurement",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["DOE Procurement ",a.jsx(ft,{className:"h-3 w-3"})]})})]})]}),a.jsxs("div",{children:[a.jsx("h5",{className:"font-medium text-sm mb-2",children:"ð State & Local"}),a.jsxs("ul",{className:"space-y-1 text-sm",children:[a.jsx("li",{children:a.jsxs("a",{href:"https://caleprocure.ca.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["Cal eProcure â California ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{children:a.jsxs("a",{href:"https://txsmartbuy.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["TxSmartBuy â Texas ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{children:a.jsxs("a",{href:"https://passport.cityofnewyork.us",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["NYC PASSPort â New York City ",a.jsx(ft,{className:"h-3 w-3"})]})})]})]})]})]})})]})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Paste a link from SAM.gov, USAspending.gov, or other government sites. Content will be automatically fetched."}),a.jsx(ge,{id:"contractLink",value:u,onChange:C=>f(C.target.value),placeholder:"https://sam.gov/opp/... or https://usaspending.gov/award/...",className:u?"border-primary":""}),u&&a.jsxs(Zs,{className:"mt-2",children:[a.jsx(tr,{className:"h-4 w-4"}),a.jsx(ei,{children:"Link detected! Click the button below to fetch and analyze."})]})]}),a.jsx(U,{onClick:j,disabled:!w||!r.trim()||!c.trim()&&!u.trim()||o&&!s.trim()||v||_,className:"w-full",size:"lg",children:v?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"mr-2 h-4 w-4 animate-spin"}),u&&!c.trim()?"Fetching & Analyzing...":"Analyzing Contract..."]}):o?"â Continue with Manual NAICS Code":"Analyze Contract & Generate Bid"})]})]})]})})]})}const Ec=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{className:"relative w-full overflow-auto",children:a.jsx("table",{ref:r,className:me("w-full caption-bottom text-sm",e),...t})}));Ec.displayName="Table";const Oc=g.forwardRef(({className:e,...t},r)=>a.jsx("thead",{ref:r,className:me("[&_tr]:border-b",e),...t}));Oc.displayName="TableHeader";const Tc=g.forwardRef(({className:e,...t},r)=>a.jsx("tbody",{ref:r,className:me("[&_tr:last-child]:border-0",e),...t}));Tc.displayName="TableBody";const EOe=g.forwardRef(({className:e,...t},r)=>a.jsx("tfoot",{ref:r,className:me("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));EOe.displayName="TableFooter";const xn=g.forwardRef(({className:e,...t},r)=>a.jsx("tr",{ref:r,className:me("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));xn.displayName="TableRow";const Ge=g.forwardRef(({className:e,...t},r)=>a.jsx("th",{ref:r,className:me("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Ge.displayName="TableHead";const Ve=g.forwardRef(({className:e,...t},r)=>a.jsx("td",{ref:r,className:me("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ve.displayName="TableCell";const OOe=g.forwardRef(({className:e,...t},r)=>a.jsx("caption",{ref:r,className:me("mt-4 text-sm text-muted-foreground",e),...t}));OOe.displayName="TableCaption";const TOe=()=>{const[e,t]=g.useState(!1),[r,n]=g.useState([]),[s,i]=g.useState(!0),[o,l]=g.useState(null),[c,d]=g.useState(null),[u,f]=g.useState(!1),[h,m]=g.useState(!1),[v,p]=g.useState([]),[x,b]=g.useState(!1),{user:y,loading:w}=it(),{toast:_}=dt(),N=vt();g.useEffect(()=>{!w&&!y&&N("/login")},[y,w,N]),g.useEffect(()=>{y&&j()},[y]);const j=async()=>{try{i(!0);const{data:M,error:T}=await Z.from("contracts").select("*").eq("user_id",y.id).order("created_at",{ascending:!1});if(T){console.error("Error fetching contracts:",T),_({title:"Error loading contracts",description:T.message,variant:"destructive"});return}n(M||[]),console.log("Contracts fetched:",(M==null?void 0:M.length)||0,"contracts"),console.log("Contract data:",M)}catch(M){console.error("Error in fetchContracts:",M)}finally{i(!1)}},S=M=>{console.log("Contract uploaded:",M),t(!1),j(),_({title:"Contract uploaded successfully!",description:"Your contract has been added to the list."})},C=async M=>{try{const{error:T}=await Z.from("contracts").delete().eq("id",M).eq("user_id",y.id);if(T){_({title:"Error deleting contract",description:T.message,variant:"destructive"});return}j(),_({title:"Contract deleted",description:"The contract has been removed successfully."})}catch(T){console.error("Error deleting contract:",T),_({title:"Error deleting contract",description:"An unexpected error occurred.",variant:"destructive"})}}
818,P=async M=>{l(M),f(!0);try{const{data:T,error:L}=await Z.from("price_bids").select("*").eq("contract_id",M.id).order("created_at",{ascending:!1}).limit(1).maybeSingle();L&&console.error("Error fetching bid:",L),d(T)}catch(T){console.error("Error loading bid data:",T)}finally{f(!1)}},A=async M=>{var T,L,K,H,ee,se,ne,W,ie,R,O,k,G,te,$;if(M&&(M.preventDefault(),M.stopPropagation()),!o){_({title:"No contract selected",description:"Please select a contract first",variant:"destructive"});return}m(!0);try{_({title:"Regenerating bid...",description:"Analyzing contract and fetching market data"});const ae=new Promise((ke,Ze)=>setTimeout(()=>Ze(new Error("Request timeout - please try again")),6e4)),oe=Z.functions.invoke("generate-price-bid",{body:{contractId:o.id,forceRefresh:!0,timestamp:Date.now()}}),{data:z,error:fe}=await Promise.race([oe,ae]);if(fe)throw console.error("Edge function error:",fe),new Error(fe.message||"Failed to generate bid");if(!z)throw new Error("No data returned from bid generation");const{data:ue,error:Ne}=await Z.from("price_bids").select("*").eq("contract_id",o.id).order("created_at",{ascending:!1}).limit(1).maybeSingle();if(Ne)throw console.error("Error fetching updated bid:",Ne),new Error("Failed to fetch bid data from database");if(!ue)throw new Error("Bid was generated but not found in database");const He={suggested_price:ue.suggested_price,confidence_score:ue.confidence_score,pricing_breakdown:ue.pricing_breakdown,market_analysis:ue.market_analysis,recommendations:ue.recommendations,risk_factors:ue.risk_factors,contract_title:o.title,naics_code:o.naics_code,industry:o.industry,...((L=(T=ue.market_analysis)==null?void 0:T.contract_data)==null?void 0:L.agency)&&{contract_agency:ue.market_analysis.contract_data.agency},...((H=(K=ue.market_analysis)==null?void 0:K.contract_data)==null?void 0:H.delivery_location)&&{delivery_location:ue.market_analysis.contract_data.delivery_location},...((ne=(se=(ee=ue.market_analysis)==null?void 0:ee.contract_data)==null?void 0:se.products)==null?void 0:ne[0])&&{product_service_name:ue.market_analysis.contract_data.products[0]},...((ie=(W=ue.market_analysis)==null?void 0:W.contract_data)==null?void 0:ie.product_type)&&{product_type:ue.market_analysis.contract_data.product_type},...((O=(R=ue.market_analysis)==null?void 0:R.contract_data)==null?void 0:O.quantity)&&{quantity:ue.market_analysis.contract_data.quantity},...((G=(k=ue.market_analysis)==null?void 0:k.contract_data)==null?void 0:G.unit_of_measure)&&{unit_of_measure:ue.market_analysis.contract_data.unit_of_measure},strategy:"Moderate",initialStrategy:"Moderate"};sessionStorage.removeItem("historicalContracts"),sessionStorage.setItem("bidResult",JSON.stringify(He)),($=(te=ue.market_analysis)==null?void 0:te.historical_data)!=null&&$.contracts&&sessionStorage.setItem("historicalContracts",JSON.stringify(ue.market_analysis.historical_data.contracts)),_({title:"Bid regenerated successfully!",description:"Opening detailed results..."}),setTimeout(()=>{N("/bid-results?contractId="+o.id)},500)}catch(ae){console.error("Error regenerating bid:",ae),_({title:"Error regenerating bid",description:(ae==null?void 0:ae.message)||"Please try again or contact support",variant:"destructive"})}finally{m(!1)}},D=()=>{o&&sessionStorage.setItem("selectedContractForFinancing",JSON.stringify(o)),N("/financing")},F=async()=>{if(v.length!==0)try{b(!0);const{error:M}=await Z.from("contracts").delete().in("id",v).eq("user_id",y.id);if(M)throw M;_({title:"Contracts deleted",description:`Successfully deleted ${v.length} contract(s)`}),p([]),j()}catch(M){console.error("Error deleting contracts:",M),_({title:"Error deleting contracts",description:"Please try again",variant:"destructive"})}finally{b(!1)}},q=async()=>{if(v.length!==0)try{const{data:M}=await Z.from("price_bids").select("contract_id").in("contract_id",v).eq("user_id",y.id),T=new Set((M==null?void 0:M.map(K=>K.contract_id))||[]),L=v.filter(K=>!T.has(K));if(T.size>0&&_({title:"Some contracts already have price bids",description:`${T.size} contract(s) already have price bids. ${L.length} new bid(s) will be created.`}),L.length===0){_({title:"All contracts already have price bids",description:"Navigate to the Price Bid page to view them"});return}N("/bid-results"),_({title:"Ready for price bids",description:`${L.length} contract(s) ready for pricing`}),p([])}catch(M){console.error("Error checking price bids:",M),_({title:"Error",description:"Failed to send contracts to price bid",variant:"destructive"})}},B=()=>{v.length===r.length?p([]):p(r.map(M=>M.id))},V=M=>{p(T=>T.includes(M)?T.filter(L=>L!==M):[...T,M])},E=M=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(M);return w||s?a.jsx(Gt,{children:a.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),a.jsx("div",{children:"Loading contracts..."})]})})}):y?a.jsx(Gt,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsx(rn,{open:!!o,onOpenChange:M=>{M||(l(null),d(null))},children:a.jsxs(Wr,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsxs(Hr,{children:[a.jsxs(Vr,{className:"text-2xl text-gradient flex items-center gap-2",children:[a.jsx(gt,{className:"w-6 h-6"}),o==null?void 0:o.title]}),a.jsxs("div",{className:"flex gap-2 mt-2",children:[a.jsx(ve,{variant:"outline",children:(o==null?void 0:o.industry)||"General"}),(o==null?void 0:o.naics_code)&&a.jsxs(ve,{variant:"outline",children:["NAICS: ",o.naics_code]}),a.jsx(ve,{className:(o==null?void 0:o.status)==="completed"?"bg-success text-white":(o==null?void 0:o.status)==="pending"?"bg-warning text-foreground":"bg-muted text-foreground",children:o==null?void 0:o.status})]})]}),a.jsx("div",{className:"space-y-6 mt-4",children:u?a.jsx("div",{className:"flex items-center justify-center py-8",children:a.jsxs("div",{className:"text-center",children:[a.jsx(Je,{className:"w-8 h-8 animate-spin text-primary mx-auto mb-4"}),a.jsx("p",{className:"text-muted-foreground",children:"Loading bid data..."})]})}):c?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"p-4 rounded-lg bg-gradient-primary/10 border border-primary/20",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mb-1",children:[a.jsx(Jt,{className:"w-4 h-4"}),"Suggested Price"]}),a.jsx("div",{className:"text-2xl font-bold text-primary",children:E(c.suggested_price)})]}),a.jsxs("div",{className:"p-4 rounded-lg bg-success/10 border border-success/20",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mb-1",children:[a.jsx(Ft,{className:"w-4 h-4"}),"Confidence Score"]}),a.jsxs("div",{className:"text-2xl font-bold text-success",children:[c.confidence_score,"%"]})]}),a.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 border border-border",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mb-1",children:[a.jsx(tr,{className:"w-4 h-4"}),"Status"]}),a.jsx("div",{className:"text-2xl font-bold text-foreground",children:"Ready"})]})]}),a.jsx(St,{}),c.risk_factors&&c.risk_factors.length>0&&a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg font-semibold mb-3 flex items-center gap-2",children:[a.jsx(yi,{className:"w-5 h-5 text-warning"}),"Risk Factors"]}),a.jsx("ul",{className:"space-y-2",children:c.risk_factors.map((M,T)=>a.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[a.jsx("span",{className:"text-warning mt-1",children:"â¢"}),a.jsx("span",{className:"text-muted-foreground",children:M})]},T))})]}),a.jsx(St,{}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(U,{onClick:M=>A(M),disabled:h,type:"button",className:"w-full bg-gradient-primary hover:opacity-90 shadow-glow",size:"lg",children:h?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"w-5 h-5 mr-2 animate-spin"}),"Regenerating..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Ur,{className:"w-5 h-5 mr-2"}),"Regenerate Price Bid"]})}),a.jsxs(U,{onClick:D,type:"button",variant:"outline",className:"w-full border-primary/50 hover:bg-primary/10",size:"lg",children:[a.jsx(Jt,{className:"w-5 h-5 mr-2"}),"Get Financing"]})]})]}):a.jsxs("div",{className:"text-center py-8",children:[a.jsx(yi,{className:"w-12 h-12 text-warning mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium mb-2",children:"No Bid Data Available"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Generate a price bid for this contract to see details"}),a.jsx(U,{onClick:A,disabled:h,children:h?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):a.jsxs(a.Fragment,{children:[a.jsx(gn,{className:"w-4 h-4 mr-2"}),"Generate Price Bid"]})})]})})]})}),a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-bold text-gradient",children:"Pipeline"}),a.jsx("p",{className:"text-lg text-muted-foreground mt-2",children:"Manage and track all your contract bids and outcomes"})]}),a.jsxs(rn,{open:e,onOpenChange:t,children:[a.jsx(hc,{asChild:!0,children:a.jsxs(U,{className:"bg-gradient-primary hover:opacity-90 shadow-glow",children:[a.jsx(gn,{className:"w-4 h-4 mr-2"}),"Upload New Contract"]})}),a.jsxs(Wr,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsx(Hr,{children:a.jsx(Vr,{className:"text-2xl text-gradient",children:"Upload Contract"})}),a.jsx(AOe,{onContractUploaded:S})]})]})]}),a.jsx(J,{className:"glass-card",children:a.jsx(re,{className:"pt-6",children:a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(Es,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4"}),a.jsx(ge,{placeholder:"Search contracts...",className:"pl-10"})]}),a.jsxs(U,{variant:"outline",className:"shrink-0",children:[a.jsx(qu,{className:"w-4 h-4 mr-2"}),"Filter"]}),a.jsxs(U,{variant:"outline",className:"shrink-0",children:[a.jsx(kl,{className:"w-4 h-4 mr-2"}),"Export"]})]})})}),a.jsxs(J,{className:"glass-card hover-lift",children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(le,{children:"All Contracts"}),v.length>0&&a.jsxs("div",{className:"flex gap-2",children:[a.jsx(U,{variant:"destructive",size:"sm",onClick:F,disabled:x,children:x?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"w-4 h-4 mr-2 animate-spin"}),"Deleting..."]}):a.jsxs(a.Fragment,{children:[a.jsx(tu,{className:"w-4 h-4 mr-2"}),"Delete Selected (",v.length,")"]})}),a.jsxs(U,{variant:"outline",size:"sm",onClick:q,children:[a.jsx(Ft,{className:"w-4 h-4 mr-2"}),"Send to Price Bid (",v.length,")"]})]})]})}),a.jsx(re,{children:a.jsxs(Ec,{children:[a.jsx(Oc,{children:a.jsxs(xn,{children:[a.jsx(Ge,{className:"w-12",children:a.jsx(is,{checked:r.length>0&&v.length===r.length,onCheckedChange:B})}),a.jsx(Ge,{children:"Title"}),a.jsx(Ge,{children:"Industry"}),a.jsx(Ge,{children:"Value"}),a.jsx(Ge,{children:"Status"}),a.jsx(Ge,{children:"Created"}),a.jsx(Ge,{children:"Updated"}),a.jsx(Ge,{className:"text-center",children:"Actions"})]})}),a.jsx(Tc,{children:r.length===0?a.jsx(xn,{children:a.jsx(Ve,{colSpan:8,className:"text-center py-12",children:a.jsxs("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:[a.jsx(gt,{className:"w-12 h-12 mb-4 opacity-50"}),a.jsx("h3",{className:"text-lg font-medium mb-2",children:"No contracts yet"}),a.jsx("p",{className:"text-sm mb-4",children:"Upload your first contract to get started"}),a.jsxs(U,{onClick:()=>t(!0),variant:"outline",children:[a.jsx(gn,{className:"w-4 h-4 mr-2"}),"Upload Contract"]})]})})}):r.map(M=>a.jsxs(xn,{className:"hover:bg-muted/50",children:[a.jsx(Ve,{onClick:T=>T.stopPropagation(),children:a.jsx(is,{checked:v.includes(M.id),onCheckedChange:()=>V(M.id)})}),a.jsx(Ve,{className:"max-w-xs cursor-pointer",onClick:()=>P(M),children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsx("span",{className:"truncate",children:M.title}),a.jsx(iC,{children:a.jsxs(RD,{children:[a.jsx(DD,{asChild:!0,children:a.jsx("div",{className:"w-2 h-2 rounded-full bg-primary flex-shrink-0 mt-1.5"})}),a.jsx(oC,{children:a.jsx("p",{className:"text-xs font-mono",children:M.id})})]})})]})}),a.jsx(Ve,{children:a.jsx(ve,{variant:"outline",children:M.industry||"General"})}),a.jsx(Ve,{className:"font-semibold",children:M.contract_value?`$${M.contract_value.toLocaleStr
818ing()}`:"N/A"}),a.jsx(Ve,{children:a.jsx(ve,{className:M.status==="completed"?"bg-success text-white":M.status==="pending"?"bg-warning text-foreground":"bg-muted text-foreground",children:M.status})}),a.jsx(Ve,{children:new Date(M.created_at).toLocaleDateString()}),a.jsx(Ve,{children:new Date(M.updated_at).toLocaleDateString()}),a.jsx(Ve,{className:"text-center",onClick:T=>T.stopPropagation(),children:a.jsxs("div",{className:"flex gap-2 justify-center",children:[a.jsx(U,{variant:"outline",size:"sm",onClick:()=>P(M),className:"h-8 w-8 p-0",children:a.jsx(ci,{className:"h-4 w-4"})}),a.jsx(U,{variant:"outline",size:"sm",onClick:()=>C(M.id),className:"h-8 w-8 p-0 hover:bg-destructive hover:text-destructive-foreground",children:a.jsx(tu,{className:"h-4 w-4"})})]})})]},M.id))})]})})]})]})}):null};function MOe({onContractUploaded:e}){const[t,r]=g.useState(null),[n,s]=g.useState(""),[i,o]=g.useState(""),[l,c]=g.useState(""),[d,u]=g.useState(!1),[f,h]=g.useState(!1),{toast:m}=dt(),{user:v}=it(),{canUploadContracts:p,isAdmin:x}=al(),b=S=>S.size>20*1024*1024?(m({title:"File too large",description:"Please select a file smaller than 20MB",variant:"destructive"}),!1):["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/plain"].includes(S.type)?!0:(m({title:"Invalid file type",description:"Please upload a PDF, Word document, Excel file, or text file",variant:"destructive"}),!1),y=S=>{var P;console.log("handleFileUpload triggered");const C=(P=S.target.files)==null?void 0:P[0];console.log("Selected file:",C),C&&b(C)&&(console.log("File validated, setting file state"),r(C),s(""),c(""))},w=S=>{S.preventDefault(),h(!1);const C=S.dataTransfer.files[0];C&&b(C)&&(r(C),s(""),c(""))},_=S=>{S.preventDefault(),h(!0)},N=S=>{S.preventDefault(),h(!1)},j=async S=>{var C,P,A,D,F,q;if(S.preventDefault(),!v){m({title:"Authentication required",description:"Please sign in to upload contracts.",variant:"destructive"});return}if(!p()){m({title:"Access restricted",description:x?"Upload feature is temporarily unavailable.":"Please upgrade to upload contracts.",variant:"destructive"});return}if(!i||!t&&!n&&!l){m({title:"Missing information",description:"Please provide a title and either upload a file, paste contract text, or add a contract link",variant:"destructive"});return}u(!0);try{if(console.log("Starting contract upload..."),console.log("User for upload:",v),!(v!=null&&v.id))throw new Error("User authentication failed. Please sign in again.");let B=null,V=n;if(!t&&!n&&l){console.log("Fetching contract content from link:",l);try{const{data:ne,error:W}=await Z.functions.invoke("fetch-contract-content",{body:{contractUrl:l,title:i}});if(W)throw new Error(`Network error: ${W.message}`);if(!(ne!=null&&ne.success)){const ie=(ne==null?void 0:ne.error)||"Failed to fetch contract content from link",R=(ne==null?void 0:ne.suggestion)||"Try uploading the document or pasting the text instead",O=(ne==null?void 0:ne.hint)||"";throw m({title:"Link Processing Failed",description:`${ie} 819 820ð¡ ${R}${O?` 821 822`+O:""}`,variant:"destructive",duration:8e3}),new Error(ie)}V=ne.content,console.log("Successfully fetched contract content, length:",V.length),ne.extractedInfo&&ne.extractedInfo.length>0&&m({title:"Contract Link Processed",description:`Extracted ${ne.extractedInfo.length} key details from the contract.`,duration:3e3})}catch(ne){const W=ne instanceof Error?ne.message:"Unknown error";throw new Error(`Failed to process contract link: ${W}`)}}if(t){console.log("Uploading file:",t.name,"Size:",t.size,"Type:",t.type);const ne=t.name.split(".").pop(),W=`${Date.now()}-${Math.random().toString(36).substring(2)}.${ne}`;B=`${v.id}/${W}`,console.log("File path will be:",B);const{error:ie}=await Z.storage.from("contracts").upload(B,t,{cacheControl:"3600",upsert:!1});if(ie)throw console.error("File upload error:",ie),new Error(`File upload failed: ${ie.message}`);if(console.log("File uploaded successfully, starting robust processing..."),t.type==="application/pdf"){console.log("Using simplified PDF parser (pdf-parse library)...");const{data:R,error:O}
822=await Z.functions.invoke("parse-pdf-simple",{body:{filePath:B}});if(O)throw console.error("PDF parser error:",O),new Error("PDF parsing failed. Please paste the contract text manually.");if(!R.success||!R.text)throw console.error("PDF parser returned no text:",R),new Error(R.error||"Failed to extract text from PDF. Please paste the text manually.");console.log("â PDF parsed successfully"),console.log("Method:",R.method),console.log("Quality score:",R.qualityScore),console.log("Text length:",R.text.length),R.qualityScore<30&&m({title:"Low Quality Text Detected",description:"The PDF text quality is low. Consider pasting text manually for better results.",variant:"default",duration:5e3}),V=`=== Full Contract Content === 823 824${R.text}`}else{console.log("Processing non-PDF document...");const{data:R,error:O}=await Z.functions.invoke("process-document",{body:{filePath:B,filename:t.name}});if(O||!(R!=null&&R.success))throw new Error("Document processing failed");console.log("Fetching extracted document chunks for analysis...");const{data:k}=await Z.from("doc_chunks").select("text").eq("file_id",R.fileId).order("page",{ascending:!0});if(k&&k.length>0){const G=k.map(te=>te.text||"").filter(te=>te.trim().length>0).join(` 825 826`);console.log("Extracted text from chunks, length:",G.length),G.trim().length>0&&(V=`=== Full Contract Content === 827 828${G}`)}}if(!V||V.trim().length<100)throw new Error("Insufficient text extracted from document. Please paste the contract text manually.")}console.log("Preparing to insert contract data...");const E=ne=>ne&&ne.replace(/\u0000/g,"").replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,"").trim();let M=v.id;try{const{data:ne}=await Z.from("team_members").select("organization_id").eq("user_id",v.id).eq("status","active").single();ne!=null&&ne.organization_id&&(M=ne.organization_id)}catch{console.log("User is organization owner, using their ID")}console.log("Getting NAICS analysis before insert...");let T=null,L=null,K="unknown";try{const ne=V.length>15e3?V.substring(0,15e3):V,{data:W,error:ie}=await Z.functions.invoke("analyze-contract-suggestions",{body:{contractContent:ne||i,contractTitle:i}});ie&&console.error("Analysis error:",ie),W&&(console.log("Analysis results:",W),K=W.content_quality||"unknown",(P=(C=W.naics_suggestions)==null?void 0:C[0])!=null&&P.code&&(T=W.naics_suggestions[0].code),(A=W.industry_suggestions)!=null&&A[0]&&(L=W.industry_suggestions[0]))}catch(ne){console.error("NAICS analysis failed:",ne)}T||(console.warn("No NAICS code detected, contract will be created without it"),m({title:"NAICS Code Not Detected",description:"The contract will be saved, but you may need to manually add industry classification.",variant:"default",duration:5e3}));const H={user_id:v.id,organization_id:M,title:E(i),content:E(V),file_path:B,file_type:(t==null?void 0:t.type)||"text/plain",contract_value:null,industry:L,naics_code:T,contract_link:E(l)||null,status:"pending"};console.log("Contract data to insert:",H);const{data:ee,error:se}=await Z.from("contracts").insert(H).select().single();if(console.log("Database response:",{contract:ee,error:se}),se)throw console.error("Database insert error:",se),se.message.includes("row-level security")?new Error("Database permission error. Please try logging out and back in."):se.message.includes("unique constraint")?new Error("A contract with this information already exists."):new Error(`Database error: ${se.message}`);if(!ee)throw new Error("Contract was not created successfully.");try{console.log("Running post-insert contract analysis for additional fields...");const{data:ne,error:W}=await Z.functions.invoke("analyze-contract-suggestions",{body:{contractContent:V||i,contractTitle:i}});if(!W&&ne){console.log("Post-insert analysis results:",ne);const ie={};(F=(D=ne.naics_suggestions)==null?void 0:D[0])!=null&&F.code&&ne.naics_suggestions[0].code!==T&&(ie.naics_code=ne.naics_suggestions[0].code),(q=ne.industry_suggestions)!=null&&q[0]&&ne.industry_suggestions[0]!==L&&(ie.industry=ne.industry_suggestions[0]),Object.keys(ie).length>0&&(await Z.from("contracts").update(ie).eq("id",ee.id),console.log("Contract updated with additional analysis:",ie))}}catch(ne){console.warn("Post-insert analysis failed, but upload succeeded:",ne)}m({title:"Contract uploaded successfully",description:V&&V!==i&&V.length>50?"Contract content extracted and analyzed. NAICS and industry suggestions have been applied.":"Contract uploaded and analyzed. For better analysis results, consider pasting the contract text directly in the text area."}),r(null),s(""),o(""),c(""),e(ee.id)}catch(B){console.error("Upload error:",B),m({title:"Upload failed",description:B instanceof Error?B.message:"Failed to upload contract",variant:"destructive"})}finally{u(!1)}};return a.jsxs(J,{className:"w-full max-w-2xl mx-auto",children:[a.jsxs(de,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(gt,{className:"h-5 w-5"}),"Upload Contract"]}),a.jsx(nt,{children:"Choose one of the three options below to analyze your contract and generate a price bid"})]}),a.jsx(re,{children:a.jsxs("form",{onSubmit:j,className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"title",children:"Contract Title *"}),a.jsx(ge,{id:"title",value:i,onChange:S=>o(S.target.value),placeholder:"Enter contract title",required:!0})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"file",className:"text-base font-semibold",children:"Option 1: Upload Contract File"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Word, Excel, PDF, CSV files (max 20MB)"}),a.jsx("div",{className:"flex items-center justify-center w-full",children:a.jsxs("div",{className:`flex flex-col items-center justify-center w-full h-32 border-2 border-dashed rounded-lg cursor-pointer transition-colors ${f?"border-primary bg-primary/10":"border-muted-foreground
828/25 hover:bg-muted/50"}`,onDrop:w,onDragOver:_,onDragLeave:N,onClick:()=>{var S;return(S=document.getElementById("file"))==null?void 0:S.click()},children:[t?a.jsxs("div",{className:"flex flex-col items-center",children:[a.jsx(gt,{className:"h-8 w-8 text-primary mb-2"}),a.jsx("p",{className:"text-sm font-medium",children:t.name}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[(t.size/1024/1024).toFixed(2)," MB"]})]}):a.jsxs("div",{className:"flex flex-col items-center",children:[a.jsx(Ro,{className:"h-8 w-8 text-muted-foreground mb-2"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Click to upload or drag and drop"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Word, Excel, PDF, CSV files (max 20MB)"})]}),a.jsx("input",{id:"file",type:"file",accept:".pdf,.doc,.docx,.xls,.xlsx,.csv,.txt",onChange:y,className:"hidden"})]})})]}),a.jsx("div",{className:"text-center",children:a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-0 flex items-center",children:a.jsx("span",{className:"w-full border-t"})}),a.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:a.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"OR"})})]})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"content",className:"text-base font-semibold",children:"Option 2: Paste Contract Text"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Copy and paste your contract solicitation text"}),a.jsx(Qn,{id:"content",value:n,onChange:S=>s(S.target.value),placeholder:"Paste your contract text here...",className:"min-h-32",disabled:!!t})]}),a.jsx("div",{className:"text-center",children:a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-0 flex items-center",children:a.jsx("span",{className:"w-full border-t"})}),a.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:a.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"OR"})})]})}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Q,{htmlFor:"contractLink",className:"text-base font-semibold",children:"Option 3: Paste Contract Link"}),a.jsxs(Wm,{children:[a.jsx(Hm,{asChild:!0,children:a.jsxs("button",{type:"button",className:"text-sm text-primary hover:text-primary/80 underline flex items-center gap-1",children:["sources ",a.jsx(f1,{className:"h-3 w-3"})]})}),a.jsx(Bu,{className:"w-80 max-h-96 overflow-y-auto",align:"start",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("h4",{className:"font-semibold text-sm",children:"Government Contract Sources"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("h5",{className:"font-medium text-sm mb-2",children:"ð Federal-Level Links"}),a.jsxs("ul",{className:"space-y-1 text-sm",children:[a.jsx("li",{children:a.jsxs("a",{href:"https://sam.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["SAM.gov â Solicitations ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{children:a.jsxs("a",{href:"https://usaspending.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["USAspending.gov â Award Pages ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{children:a.jsxs("a",{href:"https://defense.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["Defense.gov â DoD Daily Contracts ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{children:a.jsxs("a",{href:"https://fpds.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["FPDS.gov â Award Details ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{className:"text-xs text-muted-foreground pl-4",children:"(being merged into USAspending but still useful for historical lookups)"})]})]}),a.jsxs("div",{children:[a.jsx("h5",{className:"font-medium text-sm mb-2",children:"ð Agency-Specific Links"}),a.jsxs("ul",{className:"space-y-1 text-sm",children:[a.jsx("li",{children:a.jsxs("a",{href:"https://ebuy.gsa.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["GSA eBuy â Schedule Quotes ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{children:a.jsxs("a",{href:"https://usda.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["USDA Procurement ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{className:"text-xs text-muted-foreground pl-4",children:"(includes commodity and food-related bids)"}),a.jsx("li",{children:a.jsxs("a",{href:"https://era.nih.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["NIH Contracts ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{className:"text-xs text-muted-foreground pl-4",children:"(Electronic Research Administration portal)"}),a.jsx("li",{children:a.jsxs("a",{href:"https://nasa.gov/procurement",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["NASA Procurement ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{children:a.jsxs("a",{href:"https://energy.gov/procurement",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["DOE Procurement ",a.jsx(ft,{className:"h-3 w-3"})]})})]})]}),a.jsxs("div",{children:[a.jsx("h5",{className:"font-medium text-sm mb-2",children:"ð State & Local"}),a.jsxs("ul",{className:"space-y-1 text-sm",children:[a.jsx("li",{children:a.jsxs("a",{href:"https://caleprocure.ca.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["Cal eProcure â California ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{children:a.jsxs("a",{href:"https://txsmartbuy.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["TxSmartBuy â Texas ",a.jsx(ft,{className:"h-3 w-3"})]})}),a.jsx("li",{children:a.jsxs("a",{href:"https://passport.cityofnewyork.us",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["NYC PASSPort â New York City ",a.jsx(ft,{className:"h-3 w-3"})]})})]})]})]})]})})]})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"(SAM.gov, USAspending.gov, Defense.gov, GSA eBuy, etc.)"}
828),a.jsx(ge,{id:"contractLink",value:l,onChange:S=>c(S.target.value),placeholder:"Paste government contract solicitation URL or reference link..."})]})]}),a.jsx(U,{type:"submit",disabled:d,className:"w-full",children:d?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"mr-2 h-4 w-4 animate-spin"}),"Uploading Contract..."]}):"Upload Contract"})]})})]})}const IOe=()=>{const e=vt(),[t,r]=g.useState(""),[n,s]=g.useState([]),[i,o]=g.useState(!1),[l,c]=g.useState(!1),[d,u]=g.useState(!1),[f,h]=g.useState(!1),[m,v]=g.useState(null),[p,x]=g.useState([]),[b,y]=g.useState("Moderate"),{user:w}=it(),{canGenerateBids:_,isAdmin:N}=al(),{toast:j}=dt(),[S,C]=g.useState(null);g.useEffect(()=>{w&&P()},[w]);const P=async()=>{var E,M;try{o(!0);let T=3,L;for(;T>0;)try{const{data:K,error:H}=await Z.from("contracts").select("*").eq("user_id",w==null?void 0:w.id).order("created_at",{ascending:!1});if(H)if(console.error("Error fetching contracts:",H),L=H,(E=H.message)!=null&&E.includes("Load failed")||(M=H.message)!=null&&M.includes("fetch")){if(T--,T>0){await new Promise(ee=>setTimeout(ee,1e3));continue}}else throw H;else{s(K||[]);return}}catch(K){L=K,T--,T>0&&await new Promise(H=>setTimeout(H,1e3))}j({title:"Connection issue",description:"Having trouble loading contracts. Please refresh the page.",variant:"destructive"})}catch(T){console.error("Error in fetchContracts:",T),j({title:"Error loading contracts",description:"Please refresh the page and try again.",variant:"destructive"})}finally{o(!1)}},A=async(E,M)=>{if(M.stopPropagation(),!!confirm("Are you sure you want to delete this contract?"))try{const{error:T}=await Z.from("contracts").delete().eq("id",E);if(T)throw T;j({title:"Contract deleted",description:"Contract has been removed successfully"}),t===E&&(r(""),v(null),x([])),await P()}catch(T){console.error("Error deleting contract:",T),j({title:"Delete failed",description:"Failed to delete contract",variant:"destructive"})}},D=async()=>{var E,M,T,L,K,H,ee,se,ne,W,ie,R,O,k,G,te;if(!w){j({title:"Authentication required",description:"Please sign in to generate bid prices.",variant:"destructive"});return}if(!_()){j({title:"Access restricted",description:N?"Bid generation temporarily unavailable.":"Please upgrade to generate bids.",variant:"destructive"});return}if(!t){j({title:"Contract required",description:"Please select a contract to generate a bid for.",variant:"destructive"});return}c(!0);try{const $=n.find(Ne=>Ne.id===t);let ae=[];const oe=($==null?void 0:$.naics_code)||((M=(E=m==null?void 0:m.naics_suggestions)==null?void 0:E[0])==null?void 0:M.code)||"UNKNOWN";console.log("=== FORCING HISTORICAL CONTRACT FETCH ==="),console.log("Using NAICS code:",oe),console.log("Selected contract NAICS:",$==null?void 0:$.naics_code);try{ae=await F(oe),console.log("FORCED fetch result:",(ae==null?void 0:ae.length)||0,"contracts")}catch(Ne){console.error("Error fetching historical contracts:",Ne),ae=[]}const{data:z,error:fe}=await Z.functions.invoke("generate-price-bid",{body:{contractId:t,naicsCode:oe,industry:((T=m==null?void 0:m.industry_suggestions)==null?void 0:T[0])||"",productName:((L=m==null?void 0:m.product_suggestions)==null?void 0:L[0])||"",customerLocation:((K=m==null?void 0:m.location_suggestions)==null?void 0:K[0])||""}});if(fe)throw fe;const ue={suggested_price:z.suggestedPrice,confidence_score:z.confidence,pricing_breakdown:z.pricingBreakdown,market_analysis:z.marketAnalysis,recommendations:z.recommendations,risk_factors:z.riskFactors,contract_title:((H=n.find(Ne=>Ne.id===t))==null?void 0:H.title)||"Contract",naics_code:oe,industry:((ee=m==null?void 0:m.industry_suggestions)==null?void 0:ee[0])||"",...z.contract_agency&&{contract_agency:z.contract_agency},...((ne=(se=z.marketAnalysis)==null?void 0:se.contract_data)==null?void 0:ne.delivery_location)&&{delivery_location:z.marketAnalysis.contract_data.delivery_location},...((W=m==null?void 0:m.product_suggestions)==null?void 0:W[0])&&{product_service_name:m.product_suggestions[0]},...((R=(ie=z.marketAnalysis)==null?void 0:ie.contract_data)==null?void 0:R.product_type)&&{product_type:z.marketAnalysis.contract_data.product_type},...((k=(O=z.marketAnalysis)==null?void 0:O.contract_data)==null?void 0:k.quantity)&&{quantity:z.marketAnalysis.contract_data.quantity},...((te=(G=z.marketAnalysis)==null?void 0:G.contract_data)==null?void 0:te.unit_of_measure)&&{unit_of_measure:z.marketAnalysis.contract_data.unit_of_measure},strategy:b};sessionStorage.removeItem("bidResult"),sessionStorage.removeItem("historicalContracts"),sessionStorage.removeItem("currentContractId"),sessionStorage.setItem("bidResult",JSON.stringify(ue)),sessionStorage.setItem("currentContractId",t),console.log("Stored contract ID for regeneration:",t),Array.isArray(ae)&&ae.length>0?(console.log("Storing FRESH historical contracts with NAICS:",oe),console.log("Sample stored contract:",ae[0]),sessionStorage.setItem("historicalContracts",JSON.stringify(ae)),console.log("Stored",ae.length,"fresh historical contracts")):(sessionStorage.removeItem("historicalContracts"),console.log("No historical contracts to store")),C(z),j({title:"Bid generated successfully!",description:"Opening detailed analysis page..."}),setTimeout(()=>{e(`/bid-results?contractId=${t}`)},1e3)}catch($){console.error("Error generating bid:",$),j({title:"Generation failed",description:$ instanceof Error?$.message:"Failed to generate bid price",variant:"destructive"})}finally{c(!1)}},F=async E=>{try{console.log("Fetching historical contracts for NAICS:",E);const{data:M,error:T}=await Z.functions.invoke("fetch-historical-contracts",{body:{naicsCode:E,industry:"",limit:10}});if(T)return console.error("Error fetching historical contracts:",T),[];if(console.log("Raw response from fetch-historical-contracts:",M),M!=null&&M.contracts&&Array.isArray(M.contracts)){console.log("Historical contracts loaded:",M.contracts.length),console.log("Sample contract structure:",JSON.stringify(M.c
828ontracts[0],null,2)),x(M.contracts);const L=JSON.stringify(M.contracts);console.log("Test serialization length:",L.length);const K=JSON.parse(L);return console.log("Test parsed length:",K.length),console.log("Serialization test passed:",Array.isArray(K)&&K.length===M.contracts.length),M.contracts}else return console.log("No contracts found in response or invalid structure:",M),[]}catch(M){return console.error("Error in fetchHistoricalContracts:",M),[]}},q=async E=>{var M,T,L,K;if(E){u(!0);try{const H=n.find(W=>W.id===E);if(!H)return;let ee=H.content||H.title;if(H.file_path&&(!H.content||H.content.trim()===""))try{console.log("Extracting content from file:",H.file_path);const{data:W,error:ie}=await Z.functions.invoke("parse-document-content",{body:{filePath:H.file_path,extractText:!0,preserveFormatting:!1}});if(ie){console.error("Document parsing error:",ie);const{data:R}=await Z.storage.from("contracts").createSignedUrl(H.file_path,60);ee=R!=null&&R.signedUrl?`Document file: ${H.title}. Please paste the contract text content for better analysis.`:H.title}else if(W!=null&&W.content&&W.content!=="Word document content extraction not implemented - please paste text manually"&&!W.content.includes("Microsoft Word document detected")&&W.content.length>50){ee=W.content,console.log("Successfully extracted content for analysis:",ee.substring(0,200)+"...");const{error:R}=await Z.from("contracts").update({content:W.content}).eq("id",E);R&&console.error("Error updating contract content:",R)}else ee=`${H.title}. Document content could not be extracted automatically. For accurate analysis, please paste the contract text directly.`}catch(W){console.warn("Failed to parse document, using title:",W),ee=H.title}const{data:se,error:ne}=await Z.functions.invoke("analyze-contract-suggestions",{body:{contractContent:ee,contractTitle:H.title}});if(ne){console.error("Error analyzing contract:",ne);return}se?(v(se),console.log("Contract suggestions received:",se),(T=(M=se.naics_suggestions)==null?void 0:M[0])!=null&&T.code&&F(se.naics_suggestions[0].code),j({title:"Contract Analysis Complete",description:`AI analysis completed with NAICS code: ${((K=(L=se.naics_suggestions)==null?void 0:L[0])==null?void 0:K.code)||"Unknown"}`})):console.log("No data received from contract analysis")}catch(H){console.error("Error analyzing contract:",H),v({naics_suggestions:[{code:"541330",name:"Engineering Services"},{code:"541511",name:"Custom Computer Programming Services"},{code:"541990",name:"All Other Professional, Scientific, and Technical Services"}],industry_suggestions:["Professional Services","Information Technology","Consulting"],product_suggestions:["Professional Services","Consulting Services","Technical Support"],location_suggestions:["Washington, DC","Arlington, VA","Remote/Virtual"]})}finally{u(!1)}}},B=async E=>{h(!1),await P(),r(E),j({title:"Contract uploaded successfully",description:"Contract has been selected and is ready for bid generation"})},V=()=>{if(!S)return 0;const E=S.suggestedPrice;switch(b){case"Conservative":return Math.round(E*.85);case"Aggressive":return Math.round(E*1.2);case"Moderate":default:return E}};return g.useEffect(()=>{t?q(t):(v(null),x([]))},[t,n]),a.jsx(Gt,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("h1",{className:"text-4xl font-bold text-gradient",children:"Bid Calculator"}),a.jsx("p",{className:"text-lg text-muted-foreground mb-6",children:"Generate intelligent pricing quotes using real-time AI, USDA data, and global market intelligence"}),a.jsxs(U,{onClick:()=>h(!0),className:"bg-primary hover:bg-primary/90 text-white px-8 py-3 text-lg font-medium shadow-lg",size:"lg",children:[a.jsx(Ro,{className:"w-5 h-5 mr-2"}),"Upload New Contract"]})]}),a.jsxs("div",{className:"flex flex-col items-center space-y-6 w-full max-w-6xl mx-auto",children:[a.jsxs(J,{className:"glass-card hover-lift w-full max-w-2xl",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(rc,{className:"w-5 h-5"}),"Contract & Details"]})}),a.jsx(re,{className:"space-y-6",children:i?a.jsxs("div",{className:"text-center py-8",children:[a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),a.jsx("p",{className:"text-muted-foreground",children:"Loading your contracts..."})]}):n.length===0?a.jsxs("div",{className:"text-center py-8",children:[a.jsx(gt,{className:"w-12 h-12 mx-auto mb-4 text-muted-foreground opacity-50"}),a.jsx("h3",{className:"text-lg font-medium mb-2",children:"No contracts found"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:'Use the "Upload New Contract" button above to get started with AI-powered bid pricing'}),a.jsxs(U,{onClick:()=>window.location.href="/contracts",variant:"outline",size:"sm",children:[a.jsx(gt,{className:"w-4 h-4 mr-2"}),"View All Contracts"]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"contract",children:"Select Contract"}),a.jsxs(Re,{value:t,onValueChange:r,children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select Contract"})}),a.jsx(Ie,{className:"bg-background z-50",children:n.map(E=>a.jsxs("div",{className:"flex items-center group px-2 py-1.5 hover:bg-accent",children:[a.jsx(ce,{value:E.id,className:"flex-1 border-0 cursor-pointer",children:a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"font-medium",children:E.title}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[E.industry," ⢠",new Date(E.created_at).toLocaleDateString(),E.contract_value&&typeof E.contract_value=="number"&&` ⢠$${E.contract_value.toLocaleStr
828ing()}`]})]})}),a.jsx(U,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 hover:bg-destructive/10 hover:text-destructive opacity-0 group-hover:opacity-100 transition-opacity ml-2",onClick:M=>A(E.id,M),children:a.jsx(es,{className:"h-3 w-3"})})]},E.id))})]}),t&&a.jsx("div",{className:"mt-3 p-3 bg-muted/50 rounded-lg border",children:a.jsxs("div",{className:"text-sm",children:[a.jsx("div",{className:"font-medium text-primary mb-1",children:"Selected Contract Details:"}),(()=>{const E=n.find(M=>M.id===t);return E?a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[a.jsxs("div",{children:["ð ",a.jsx("strong",{children:"Title:"})," ",E.title]}),E.industry&&a.jsxs("div",{children:["ð ",a.jsx("strong",{children:"Industry:"})," ",E.industry]}),E.naics_code&&a.jsxs("div",{children:["ð¢ ",a.jsx("strong",{children:"NAICS:"})," ",E.naics_code]}),E.contract_value&&typeof E.contract_value=="number"&&a.jsxs("div",{children:["ð° ",a.jsx("strong",{children:"Value:"})," $",E.contract_value.toLocaleString()]}),a.jsxs("div",{children:["ð
",a.jsx("strong",{children:"Created:"})," ",new Date(E.created_at).toLocaleDateString()]}),a.jsxs("div",{children:["ð ",a.jsx("strong",{children:"Status:"})," ",E.status||"Pending"]})]}),a.jsx(U,{variant:"outline",size:"sm",className:"w-full mt-2",onClick:()=>{const M=prompt("Enter correct NAICS code (6 digits):",E.naics_code||""),T=prompt("Enter correct industry:",E.industry||"");(M||T)&&Z.from("contracts").update({...M&&{naics_code:M},...T&&{industry:T}}).eq("id",E.id).then(()=>{j({title:"Contract updated",description:"NAICS and industry have been corrected"}),P()})},children:"âï¸ Edit NAICS & Industry"})]}):null})()]})})]}),a.jsx(U,{onClick:D,disabled:!t||l,className:"w-full bg-primary hover:bg-primary/90 text-white font-medium",children:l?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"mr-2 h-4 w-4 animate-spin"}),"Generating Bid..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Ft,{className:"mr-2 h-4 w-4"}),"Generate Price Bid"]})})]})})]}),a.jsxs("div",{className:"space-y-6",children:[S&&a.jsxs(J,{className:"glass-card",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Ft,{className:"w-5 h-5"}),"AI Price Recommendation"]})}),a.jsxs(re,{className:"space-y-4",children:[a.jsxs("div",{className:"text-center",children:[a.jsxs("div",{className:"text-4xl font-bold text-primary mb-2",children:["$",V().toLocaleString()]}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:["Confidence Score: ",S.confidence,"% ⢠",b," Strategy"]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("label",{className:"text-sm font-medium",children:"Pricing Strategy"}),a.jsx("div",{className:"flex space-x-1 bg-muted p-1 rounded-lg",children:["Conservative","Moderate","Aggressive"].map(E=>a.jsx("button",{onClick:()=>y(E),className:`flex-1 py-2 px-3 text-xs font-medium rounded-md transition-colors ${b===E?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:E},E))}),a.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:[b==="Conservative"&&"Safer bid with higher chance to win (-15%)",b==="Moderate"&&"Recommended balanced approach (baseline)",b==="Aggressive"&&"Higher margin but more competitive (+20%)"]})]}),S.pricingBreakdown&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(Ov,{className:"h-5 w-5 text-primary"}),a.jsx("h4",{className:"font-medium",children:"Pricing Breakdown"})]}),a.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[a.jsx("div",{className:"h-80",children:a.jsx(js,{width:"100%",height:"100%",children:a.jsxs(Wb,{children:[a.jsx(ka,{data:Object.entries(S.pricingBreakdown).map(([E,M])=>({name:E.replace(/_/g," ").replace(/\b\w/g,T=>T.toUpperCase()),value:M,color:{labor_cost:"#3b82f6",material_costs:"#10b981",overhead:"#f59e0b",profit_margin:"#8b5cf6",other_costs:"#ef4444",delivery_costs:"#06b6d4",risk_buffer:"#f97316"}[E]||"#6b7280"})),cx:"50%",cy:"50%",innerRadius:60,outerRadius:120,paddingAngle:2,dataKey:"value",children:Object.keys(S.pricingBreakdown).map((E,M)=>a.jsx(Jo,{fill:{labor_cost:"#3b82f6",material_costs:"#10b981",overhead:"#f59e0b",profit_margin:"#8b5cf6",other_
828costs:"#ef4444",delivery_costs:"#06b6d4",risk_buffer:"#f97316"}[E]||"#6b7280"},`cell-${M}`))}),a.jsx(Ar,{formatter:E=>`$${E&&typeof E=="number"?E.toLocaleString():"0"}`,labelStyle:{color:"#374151"}}),a.jsx(Ao,{wrapperStyle:{fontSize:"12px"},formatter:E=>a.jsx("span",{style:{color:"#374151"},children:E})})]})})}),a.jsx("div",{className:"space-y-3",children:Object.entries(S.pricingBreakdown||{}).map(([E,M])=>M==null||typeof M!="number"?null:a.jsxs("div",{className:"flex justify-between items-center p-3 bg-muted/30 rounded-lg",children:[a.jsx("span",{className:"text-sm font-medium capitalize",children:E.replace(/_/g," ")}),a.jsxs("span",{className:"text-sm font-semibold",children:["$",M.toLocaleString()]})]},E)).filter(Boolean)})]})]}),S.marketAnalysis&&a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium mb-2",children:"Market Analysis"}),a.jsx("div",{className:"bg-muted/50 p-3 rounded text-sm space-y-2",children:typeof S.marketAnalysis=="object"&&S.marketAnalysis.market_data?a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Market Data Quality:"})," ",S.marketAnalysis.market_data.dataQuality||"Unknown"]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Contracts Analyzed:"})," ",S.marketAnalysis.market_data.contractCount||0]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Competition Level:"})," ",S.marketAnalysis.market_data.competitionLevel||"Unknown"]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Price Trend:"})," ",S.marketAnalysis.market_data.priceTrend||"Unknown"]}),S.marketAnalysis.market_data.averageValue&&a.jsxs("div",{className:"col-span-2",children:[a.jsx("span",{className:"font-medium",children:"Market Average:"})," $",typeof S.marketAnalysis.market_data.averageValue=="number"?S.marketAnalysis.market_data.averageValue.toLocaleString():"N/A"]})]}):typeof S.marketAnalysis=="string"?a.jsx("div",{children:S.marketAnalysis}):a.jsx("div",{children:"Market analysis data processed"})})]}),S.recommendations&&a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium mb-2",children:"Historical Analysis & Recommendations"}),a.jsx("p",{className:"text-sm text-muted-foreground bg-muted/50 p-3 rounded",children:S.recommendations})]}),p&&p.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("h4",{className:"font-medium flex items-center gap-2",children:[a.jsx(gt,{className:"w-4 h-4 text-primary"}),"Historical Awards (",p.length,")"]}),a.jsx(U,{variant:"outline",size:"sm",onClick:()=>window.open("/historical-contracts","_blank"),className:"text-xs",children:"View All Contracts"})]}),a.jsxs("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Preview of related contracts:"}),p.slice(0,3).map((E,M)=>a.jsxs("div",{className:"p-3 bg-muted/30 rounded-lg border hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>{const T=E.generated_internal_id?`https://www.usaspending.gov/award/${E.generated_internal_id}`:`https://www.usaspending.gov/search/?hash=${encodeURIComponent(E.award_id||"")}`;console.log("Opening contract URL:",T),window.open(T,"_blank")},children:[a.jsxs("div",{className:"flex justify-between items-start mb-2",children:[a.jsx("h5",{className:"font-medium text-sm text-primary hover:underline",children:E.title||E.description}),a.jsx("span",{className:"text-xs text-muted-foreground bg-background px-2 py-1 rounded",children:E.award_type})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-3 text-xs",children:[a.jsxs("div",{className:"flex justify-between items-center p-2 bg-background rounded border",children:[a.jsx("span",{className:"text-muted-foreground",children:"Award Amount:"}),a.jsxs("span",{className:"text-lg font-bold text-green-600",children:["$",E.award_amount&&typeof E.award_amount=="number"?E.award_amount.toLocaleString():"N/A"]})]}),a.jsxs("div",{className:"flex justify-between items-center p-2 bg-background rounded border",children:[a.jsx("span",{className:"text-muted-foreground",children:"Contract Year:"}),a.jsx("span",{className:"font-semibold text-blue-600",children:E.start_date?new Date(E.start_date).getFullYear():"N/A"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs text-muted-foreground",children:[a.jsxs("div",{children:[a.jsx("strong",{children:"Agency:"})," ",E.awarding_agency]}),a.jsxs("div",{children:[a.jsx("strong",{children:"Contractor:"})," ",E.recipient_name]})]})]}),E.naics_code&&a.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[a.jsx("strong",{children:"NAICS:"})," ",E.naics_code," - ",E.naics_description]})]},E.award_id||M))]}),a.jsxs("div",{className:"text-xs text-muted-foreground mt-2 text-center",children:["Showing 3 of ",p.length," contracts ⢠",a.jsx("button",{onClick:()=>window.open("/historical-contracts","_blank"),className:"text-primary hover:underline",children:"View all contracts"})]})]}),S.riskFactors&&S.riskFactors.length>0&&a.jsxs("div",{children:[a.jsxs("h4",{className:"font-medium mb-2 flex items-center gap-2",children:[a.jsx(yi,{className:"w-4 h-4 text-amber-500"}),"Risk Factors"]}),a.jsx("ul",{className:"text-sm space-y-1",children:S.riskFactors.map((E,M)=>a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-amber-500 mt-1",children:"â¢"}),a.jsx("span",{children:E})]},M))})]})]})]}),l&&a.jsx(J,{className:"glass-card",children:a.jsx(re,{className:"py-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium mb-2",children:"Analyzing Contract"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Our AI is processing market data and generating your optimized bid price..."})]})})}),a.jsx("div",{className:"mt-8 p-4 bg-muted/30 border-l-4 border-border rounded-r-lg",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(yi,{className:"h-5 w-5 text-muted-foreground mt-0.5 flex-shrink-0"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:"Important Notice"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Generated prices are suggestions based on market data analysis. Always review and adjust based on your specific costs, margins, and business requirements."})]})]})})]})]}),f&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-4 z-50",children:a.jsxs("div",{className:"bg-background rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"p-4 border-b flex items-center justify-between",children:[a.jsx("h2",{className:"text-lg font-semibold",children:"Upload New Contract"}),a.jsx(U,{variant:"ghost",size:"sm",onClick:()=>h(!1),children:"â"})]}),a.jsx("div",{className:"p-4",children:a.jsx(MOe,{onContractUploaded:B})})]})})]})})};function xI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ay(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
828t%2?xI(Object(r),!0).forEach(function(n){$U(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $U(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $Oe(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,i;for(i=0;i<n.length;i++)s=n[i],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}function ROe(e,t){if(e==null)return{};var r=$Oe(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Td(e,t){return DOe(e)||LOe(e,t)||FOe(e,t)||BOe()}function DOe(e){if(Array.isArray(e))return e}function LOe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,l;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,l=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw l}}return n}}function FOe(e,t){if(e){if(typeof e=="string")return yI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yI(e,t)}}function yI(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function BOe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 829In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var zOe=["src","checkForExisting"],th={},bI=function(t){var r=document.querySelector('script[src="'.concat(t,'"]'));if(r)return th[t]={loading:!1,error:null,scriptEl:r}},wI=typeof window<"u"&&typeof window.document<"u";function UOe(e){var t=e.src,r=e.checkForExisting,n=r===void 0?!1:r,s=ROe(e,zOe),i=t?th[t]:void 0;!i&&n&&t&&wI&&(i=bI(t));var o=g.useState(i?i.loading:!!t),l=Td(o,2),c=l[0],d=l[1],u=g.useState(i?i.error:null),f=Td(u,2),h=f[0],m=f[1],v=g.useState(!1),p=Td(v,2),x=p[0],b=p[1];return g.useEffect(function(){if(!(!wI||!t||x||h)){i=th[t],!i&&n&&(i=bI(t));var y;i?y=i.scriptEl:(y=document.createElement("script"),y.src=t,Object.keys(s).forEach(function(N){y[N]===void 0?y.setAttribute(N,s[N]):y[N]=s[N]}),i=th[t]={loading:!0,error:null,scriptEl:y});var w=function(){i&&(i.loading=!1),d(!1),b(!0)},_=function(j){i&&(i.error=j),m(j)};return y.addEventListener("load",w),y.addEventListener("error",_),document.body.appendChild(y),function(){y.removeEventListener("load",w),y.removeEventListener("error",_),i&&i.loading&&(y.remove(),delete th[t])}}},[t]),[c,h]}var WOe=function(t,r,n){var s={};return delete Object.assign(s,t,$U({},n,t[r]))[r],s},HOe=function(t,r){var n={plaid:null,open:!1,onExitCallback:null};if(typeof window>"u"||!window.Plaid)throw new Error("Plaid not loaded");n.plaid=r(ay(ay({},t),{},{onExit:function(d,u){n.open=!1,t.onExit&&t.onExit(d,u),n.onExitCallback&&n.onExitCallback()}}));var s=function(){n.plaid&&(n.open=!0,n.onExitCallback=null,n.plaid.open())},i=function(d){n.plaid&&n.plaid.submit(d)},o=function(d,u){if(!n.open||!n.plaid){u&&u();return}n.onExitCallback=u,n.plaid.exit(d),d&&d.force&&(n.open=!1)},l=function(){n.plaid&&(n.plaid.destroy(),n.plaid=null)};return{open:s,submit:i,exit:o,destroy:l}},VOe=function(t,r){var n=WOe(t,"publicKey","key");return HOe(n,r)},qOe="https://cdn.plaid.com/link/v2/stable/link-initialize.js",jI=function(){},GOe=function(t){var r=UOe({src:qOe,checkForExisting:!0}),n=Td(r,2),s=n[0],i=n[1],o=g.useState(null),l=Td(o,2),c=l[0],d=l[1],u=g.useState(!1),f=Td(u,2),h=f[0],m=f[1],v=(t.product||[]).slice().sort().join(",");g.useEffect(function(){if(!s&&!(!t.token&&!t.publicKey&&!t.receivedRedirectUri)){if(i||!window.Plaid){console.error("Error loading Plaid",i);return}c!=null&&c.exit({force:!0},function(){return c.destroy()});var b=VOe(ay(ay({},t),{},{onLoad:function(){m(!0),t.onLoad&&t.onLoad()}}),window.Plaid.create);return d(b),function(){return b.exit({force:!0},function(){return b.destroy()})}}},[s,i,t.publicKey,t.token,v]);var p=c!=null&&(!s||h),x=function(){t.token||console.warn("react-plaid-link: You cannot call open() without a valid token supplied to usePlaidLink. This is a no-op.")};return{error:i,ready:p,submit:c?c.submit:jI,exit:c?c.exit:jI,open:c?c.open:x}},NI;(function(e){e.OPEN="OPEN",e.EXIT="EXIT",e.HANDOFF="HANDOFF",e.SELECT_INSTITUTION="SELECT_INSTITUTION",e.ERROR="ERROR",e.BANK_INCOME_INSIGHTS_COMPLETED="BANK_INCOME_INSIGHTS_COMPLETED",e.IDENTITY_VERIFICATION_PASS_SESSION="IDENTITY_VERIFICATION_PASS_SESSION",e.IDENTITY_VERIFICATION_FAIL_SESSION="IDENTITY_VERIFICATION_FAIL_SESSION"})(NI||(NI={}));function KOe({contracts:e}){var V;const{user:t}=it(),{toast:r}=dt(),[n,s]=g.useState(!1),[i,o]=g.useState(!1),[l,c]=g.useState([]),[d,u]=g.useState(!1),[f,h]=g.useState(null),[m,v]=g.useState(null),[p,x]=g.useState([]),[b,y]=g.useState({ein:"",companyName:"",ownerSSN:"",owns100Percent:!1,financingTypeSelected:"",hasAwardedContract:"",annualRevenue:"",timeInBusiness:"",creditScore:"",email:"",invoiceAmount:"",invoiceDate:"",customerName:"",paymentTerms:"",invoiceNumber:""}),[w,_]=g.useState(null),N=(E,M)=>{y(T=>({...T,[E]:M}))},j=E=>{const M=E.target.files;if(M){const T=Array.from(M).slice(0,3-l.length);c(L=>[...L,...T]),r({title:"Bank statements uploaded",description:`${T.length} file(s) added. Total: ${l.length+T.length}/3`})}},S=E=>{c(M=>M.filter((T,L)=>L!==E))},C=g.useCallback(async(E,M)=>{s(!0);try{console.log("Plaid Link success, exchanging token...");const{data:T,error:L}=await Z.functions.invoke("exchange-plaid-token",{body:{publicToken:E,userId:t==null?void 0:t.id}});if(L)throw L;T!=null&&T.accounts&&(x(T.accounts),o(!0),r({title:"Bank connected successfully",description:`Connected ${T.accounts.length} account(s) via Plaid`}))}
829catch(T){console.error("Error exchanging Plaid token:",T),r({title:"Connection failed",description:"Unable to verify bank connection. Please try again.",variant:"destructive"})}finally{s(!1)}},[t==null?void 0:t.id,r]),P=g.useCallback((E,M)=>{console.log("Plaid Link exit:",E,M),s(!1)},[]),{open:A,ready:D}=GOe({token:m,onSuccess:C,onExit:P}),F=async()=>{s(!0);try{const{data:E,error:M}=await Z.functions.invoke("connect-plaid",{body:{userId:t==null?void 0:t.id}});if(M)throw M;E!=null&&E.linkToken&&(v(E.linkToken),setTimeout(()=>{D&&A()},100))}catch(E){console.error("Error connecting Plaid:",E),r({title:"Connection failed",description:"Unable to initialize Plaid connection. Please try again or upload bank statements manually.",variant:"destructive"}),s(!1)}};g.useEffect(()=>{m&&D&&!i&&A()},[m,D,A,i]);const q=()=>{var M,T,L,K,H,ee,se;const E=[];return(M=b.ein)!=null&&M.trim()||E.push("EIN"),(T=b.companyName)!=null&&T.trim()||E.push("Company Name"),(L=b.annualRevenue)!=null&&L.trim()||E.push("Annual Revenue"),(K=b.timeInBusiness)!=null&&K.trim()||E.push("Time in Business"),(H=b.creditScore)!=null&&H.trim()||E.push("Credit Score"),(ee=b.financingTypeSelected)!=null&&ee.trim()||E.push("Financing Type"),(se=b.hasAwardedContract)!=null&&se.trim()||E.push("Contract Award Status"),E.length>0?(r({title:"Missing required fields",description:`Please fill in: ${E.join(", ")}`,variant:"destructive"}),!1):!t&&!b.email?(r({title:"Email required",description:"Please provide your email address",variant:"destructive"}),!1):!b.financingTypeSelected||!b.hasAwardedContract?(r({title:"Missing financing details",description:"Please specify financing type and contract award status",variant:"destructive"}),!1):f==="invoice"&&(!b.invoiceNumber||!b.invoiceAmount||!b.customerName||!b.paymentTerms)?(r({title:"Missing invoice details",description:"Please fill in all required invoice information",variant:"destructive"}),!1):(!i&&l.length===0&&r({title:"Bank verification recommended",description:"Adding bank verification can improve your rates, but you can proceed without it"}),!0)},B=async()=>{if(q()){s(!0);try{let E=[];if(l.length>0)for(const K of l){const H=`${(t==null?void 0:t.id)||"guest"}/${Date.now()}-${K.name}`,{error:ee}=await Z.storage.from("contracts").upload(H,K);if(ee)throw ee;E.push(H)}const M={...b,userId:(t==null?void 0:t.id)||null,email:(t==null?void 0:t.email)||b.email,bankStatements:E,plaidConnected:i,financingType:f};console.log("Submitting financing application with data:",M);const{data:T,error:L}=await Z.functions.invoke("apply-for-financing",{body:M});if(L)throw L;_(T.rates),u(!0),r({title:"Financing rates generated!",description:"Your personalized financing options are ready"})}catch(E){console.error("Error applying for financing:",E),r({title:"Application failed",description:E instanceof Error?E.message:"Unable to process financing application",variant:"destructive"})}finally{s(!1)}}};return f?a.jsxs("div",{className:"space-y-6",children:[a.jsxs(J,{className:"glass-card",children:[a.jsxs(de,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Kl,{className:"w-5 h-5"}),f==="contract"?"Contract Financing":"Invoice Factoring"," Application"]}),a.jsx(nt,{children:f==="contract"?"Get instant financing rates for your government contracts":"Get immediate cash for your unpaid invoices"}),a.jsx(U,{variant:"ghost",size:"sm",onClick:()=>h(null),className:"mt-2",children:"â Back to financing options"})]}),a.jsxs(re,{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[a.jsx(mr,{className:"w-4 h-4"}),"Company Information"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[!t&&a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[a.jsx(Q,{htmlFor:"email",children:"Email Address *"}),a.jsx(ge,{id:"email",type:"email",placeholder:"[email protected]",value:b.email,onChange:E=>N("email",E.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"ein",children:"EIN (Employer Identification Number) *"}),a.jsx(ge,{id:"ein",placeholder:"XX-XXXXXXX",value:b.ein,onChange:E=>N("ein",E.target.value),maxLength:10})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"companyName",children:"Official Company Name *"}),a.jsx(ge,{id:"companyName",placeholder:"Your Company LLC",value:b.companyName,onChange:E=>N("companyName",E.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"ownerSSN",children:"Owner's SSN (Optional)"}),a.jsx(ge,{id:"ownerSSN",type:"password",placeholder:"XXX-XX-XXXX",value:b.ownerSSN,onChange:E=>N("ownerSSN",E.target.value),maxLength:11}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Providing SSN may improve your rates"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"annualRevenue",children:"Annual Revenue *"}),a.jsx(ge,{id:"annualRevenue",placeholder:"$1,000,000",value:b.annualRevenue,onChange:E=>N("annualRevenue",E.target.value),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"timeInBusiness",children:"Time in Business (Years) *"}),a.jsx(ge,{id:"timeInBusiness",type:"number",placeholder:"5",value:b.timeInBusiness,onChange:E=>N("timeInBusiness",E.target.value),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"creditScore",children:"Estimated Credit Score *"}),a.jsxs(Re,{value:b.creditScore,onValueChange:E=>N("creditScore",E),required:!0,children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select credit score range"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"excellent",children:"Excellent (750+)"}),a.jsx(ce,{value:"good",children:"Good (700-749)"}),a.jsx(ce,{value:"fair",children:"Fair (650-699)"}),a.jsx(ce,{value:"poor",children:"Poor (Below 650)"})]})]})]})]}),a.jsxs("div",{className:"flex items-center space-x-2 pt-2",children:[a.jsx(is,{id:"owns100",checked:b.owns100Percent,onCheckedChange:E=>N("owns100Percent",E)}),a.jsx(Q,{htmlFor:"owns100",className:"cursor-pointer",children:"I own 100% of the company"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[a.jsx(Jt,{className:"w-4 h-4"}),"Financing Details"]}
829),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"financingTypeSelected",children:"What type of financing do you need? *"}),a.jsxs(Re,{value:b.financingTypeSelected,onValueChange:E=>N("financingTypeSelected",E),children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select financing type"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"factoring",children:"Factoring"}),a.jsx(ce,{value:"contract_financing",children:"Contract Financing"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"hasAwardedContract",children:"Have you been awarded a contract already? *"}),a.jsxs(Re,{value:b.hasAwardedContract,onValueChange:E=>N("hasAwardedContract",E),children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select answer"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"yes",children:"Yes"}),a.jsx(ce,{value:"no",children:"No"})]})]})]})]})]}),f==="invoice"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[a.jsx(Jt,{className:"w-4 h-4"}),"Invoice Details"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"invoiceNumber",children:"Invoice Number *"}),a.jsx(ge,{id:"invoiceNumber",placeholder:"INV-2024-001",value:b.invoiceNumber,onChange:E=>N("invoiceNumber",E.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"invoiceAmount",children:"Invoice Amount *"}),a.jsx(ge,{id:"invoiceAmount",placeholder:"$50,000",value:b.invoiceAmount,onChange:E=>N("invoiceAmount",E.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"invoiceDate",children:"Invoice Date *"}),a.jsx(ge,{id:"invoiceDate",type:"date",value:b.invoiceDate,onChange:E=>N("invoiceDate",E.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"customerName",children:"Customer/Agency Name *"}),a.jsx(ge,{id:"customerName",placeholder:"U.S. Department of Defense",value:b.customerName,onChange:E=>N("customerName",E.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"paymentTerms",children:"Payment Terms *"}),a.jsxs(Re,{value:b.paymentTerms,onValueChange:E=>N("paymentTerms",E),children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select payment terms"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"net30",children:"Net 30 Days"}),a.jsx(ce,{value:"net60",children:"Net 60 Days"}),a.jsx(ce,{value:"net90",children:"Net 90 Days"}),a.jsx(ce,{value:"net120",children:"Net 120 Days"})]})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"invoiceUpload",children:"Upload Invoice(s)"}),a.jsx(ge,{id:"invoiceUpload",type:"file",accept:".pdf,.jpg,.jpeg,.png",multiple:!0,onChange:j,className:"cursor-pointer"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Upload copies of your unpaid invoices for verification"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[a.jsx(Ro,{className:"w-4 h-4"}),"Bank Verification (Optional)"]}),a.jsx(Zs,{children:a.jsxs(ei,{children:[a.jsx("strong",{children:"Optional but recommended:"})," Adding bank verification can improve your rates and approval chances. Connect instantly via Plaid or upload bank statements."]})}),a.jsx("div",{className:"space-y-3",children:a.jsx(U,{onClick:F,disabled:n||i,variant:i?"outline":"default",className:"w-full",children:n?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"w-4 h-4 mr-2 animate-spin"}),"Connecting to Plaid..."]}):i?a.jsxs(a.Fragment,{children:[a.jsx(tr,{className:"w-4 h-4 mr-2"}),"Bank Connected via Plaid"]}):a.jsx(a.Fragment,{children:"Sync with Plaid (Instant Verification)"})})}),!i&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"text-center text-sm text-muted-foreground",children:"OR"}),a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"statements",className:"cursor-pointer",children:"Upload Bank Statements (Optional - 1-3 months)"}),a.jsx(ge,{id:"statements",type:"file",accept:".pdf,.jpg,.jpeg,.png",multiple:!0,onChange:j,disabled:l.length>=3,className:"mt-2"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:l.length>0?`${l.length}
829 statement(s) uploaded`:"Upload 1-3 bank statements to improve your rates"})]}),l.length>0&&a.jsx("div",{className:"space-y-2",children:l.map((E,M)=>a.jsxs("div",{className:"flex items-center justify-between p-2 bg-muted rounded",children:[a.jsx("span",{className:"text-sm truncate",children:E.name}),a.jsx(U,{variant:"ghost",size:"sm",onClick:()=>S(M),children:"Remove"})]},M))})]})]}),a.jsx(U,{onClick:B,disabled:n||d,className:"w-full",size:"lg",children:n?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"w-4 h-4 mr-2 animate-spin"}),"Processing Application..."]}):d?"Rates Generated":"Apply for Financing - Get Your Rates Now"})]})]}),d&&w&&a.jsxs(J,{className:"glass-card border-primary",children:[a.jsxs(de,{children:[a.jsxs(le,{className:"flex items-center gap-2 text-primary",children:[a.jsx(tr,{className:"w-5 h-5"}),"Your Financing Options"]}),a.jsx(nt,{children:"Personalized rates based on your application"})]}),a.jsx(re,{className:"space-y-4",children:(V=w.options)==null?void 0:V.map((E,M)=>a.jsxs("div",{className:"p-4 border rounded-lg space-y-2",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("h4",{className:"font-semibold text-lg",children:[E.term," Month Term"]}),a.jsxs("div",{className:"text-2xl font-bold text-primary",children:[E.rate,"% APR"]})]}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:["Monthly Payment: $",E.monthlyPayment.toLocaleString()]}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:["Total Interest: $",E.totalInterest.toLocaleString()]}),a.jsx(U,{variant:"outline",className:"w-full mt-2",children:"Select This Option"})]},M))})]})]}):a.jsx("div",{className:"space-y-6",children:a.jsxs(J,{className:"glass-card",children:[a.jsxs(de,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Kl,{className:"w-5 h-5"}),"Choose Your Financing Option"]}),a.jsx(nt,{children:"Select the type of financing that best suits your needs"})]}),a.jsx(re,{className:"space-y-4",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs(J,{className:"cursor-pointer hover:border-primary transition-all hover:shadow-lg bg-gradient-to-br from-primary/5 to-primary/10 border-primary/20",onClick:()=>h("contract"),children:[a.jsx(de,{children:a.jsxs(le,{className:"text-lg flex items-center gap-2 text-primary",children:[a.jsx(Jt,{className:"w-5 h-5"}),"Contract Financing"]})}),a.jsxs(re,{children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Get financing based on your awarded government contracts. Ideal for long-term projects requiring upfront capital."}),a.jsxs("ul",{className:"mt-4 space-y-2 text-sm",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(tr,{className:"w-4 h-4 text-primary"}),"Based on contract value"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(tr,{className:"w-4 h-4 text-primary"}),"Longer repayment terms"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(tr,{className:"w-4 h-4 text-primary"}),"Fund project expenses"]})]})]})]}),a.jsxs(J,{className:"cursor-pointer hover:border-accent transition-all hover:shadow-lg bg-gradient-to-br from-accent/5 to-accent/10 border-accent/20",onClick:()=>h("invoice"),children:[a.jsx(de,{children:a.jsxs(le,{className:"text-lg flex items-center gap-2 text-primary",children:[a.jsx(mr,{className:"w-5 h-5"}),"Invoice Factoring"]})}),a.jsxs(re,{children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Get immediate cash by selling your unpaid invoices. Perfect for maintaining cash flow on completed work."}),a.jsxs("ul",{className:"mt-4 space-y-2 text-sm",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(tr,{className:"w-4 h-4 text-primary"}),"Fast cash access"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(tr,{className:"w-4 h-4 text-primary"}),"No debt on books"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(tr,{className:"w-4 h-4 text-primary"}),"Improve cash flow"]})]})]})]})]})})]})})}const YOe=()=>{const{user:e,loading:t}=it(),r=vt(),[n,s]=g.useState([]),[i,o]=g.useState(!0);g.useEffect(()=>{e?l():o(!1)},[e]);const l=async()=>{try{o(!0);const{data:c,error:d}=await Z.from("contracts").select("*").eq("user_id",e==null?void 0:e.id).order("created_at",{ascending:!1});if(d){console.error("Error fetching contracts:",d);return}s(c||[])}catch(c){console.error("Error in fetchContracts:",c)}finally{o(!1)}};return t||i?a.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),a.jsx("div",{children:"Loading..."})]})}):a.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[a.jsx("header",{className:"sticky top-0 z-50 w-full border-b border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:a.jsxs("div",{className:"container flex h-16 items-center justify-between px-4",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(U,{variant:"ghost",size:"icon",onClick:()=>r(-1),children:a.jsx(Tr,{className:"w-5 h-5"})}),a.jsxs(je,{to:"/",className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 bg-gradient-primary rounded-xl flex items-center justify-center shadow-lg",children:a.jsx("span",{className:"font-bold text-white text-sm",children:"PB"})}),a.jsx("span",{className:"font-bold text-lg text-foreground",children:"PriceBid"})]})]}),a.jsx("div",{className:"flex items-center gap-4",children:e?a.jsx(U,{asChild:!0,variant:"outline",children:a.jsx(je,{to:"/dashboard",children:"Go to Dashboard"})}):a.jsxs(a.Fragment,{children:[a.jsx(U,{asChild:!0,variant:"ghost",children:a.jsx(je,{to:"/login",children:"Login"})}),a.jsx(U,{asChild:!0,children:a.jsx(je,{to:"/signup",children:"Sign Up"})})]})})]})}),a.jsx("main",{className:"flex-1 container py-8 px-4",children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"text-center",children:[a.jsxs("h1",{className:"text-4xl font-bold text-gradient flex items-center justify-center gap-3",children:[a.jsx(Kl,{className:"w-10 h-10"}),"Financing"]}),a.jsx("p",{className:"text-lg text-muted-foreground mt-2",children:"Get financing for your contracts with competitive rates"})]}),a.jsx("div",{className:"max-w-4xl mx-auto",children:a.jsx(KOe,{contracts:n})})]})}),a.jsx(Ci,{})]})},rh=[{code:"all",name:"All Industries",category:"General"},{code:"621",name:"Ambulatory Health Care Services",category:"Healthcare"},{code:"622",name:"Hospitals",category:"Healthcare"},{code:"623",name:"Nursing and Residential Care Facilities",category:"Healthcare"},{code:"621111",name:"Offices of Physicians (except Mental Health Specialists)",category:"Healthcare"},{code:"621511",name:"Medical Laboratories",category:"Healthcare"},{code:"621910",name:"Ambulance Services",category:"Healthcare"},{code:"541714",name:"Research and Development in Biotechnology",category:"Healthcare"},{code:"325412",name:"Pharmaceutical Preparation Manufacturing",category:"Healthcare"},{code:"334510",name:"Electromedical and Electrotherapeutic Apparatus Manufacturing",category:"Healthcare"}
829,{code:"339112",name:"Surgical and Medical Instrument Manufacturing",category:"Healthcare"},{code:"236",name:"Construction of Buildings",category:"Construction"},{code:"237",name:"Heavy and Civil Engineering Construction",category:"Construction"},{code:"238",name:"Specialty Trade Contractors",category:"Construction"},{code:"541330",name:"Engineering Services",category:"Construction"},{code:"541310",name:"Architectural Services",category:"Construction"},{code:"541511",name:"Computer Systems Design Services",category:"Technology"},{code:"541512",name:"Computer Systems Design Services",category:"Technology"},{code:"518210",name:"Data Processing, Hosting, and Related Services",category:"Technology"},{code:"334111",name:"Electronic Computer Manufacturing",category:"Technology"},{code:"541513",name:"Computer Facilities Management Services",category:"Technology"},{code:"541519",name:"Other Computer Related Services",category:"Technology"},{code:"541110",name:"Offices of Lawyers",category:"Professional Services"},{code:"541211",name:"Offices of Certified Public Accountants",category:"Professional Services"},{code:"541219",name:"Other Accounting Services",category:"Professional Services"},{code:"541611",name:"Administrative Management and General Management Consulting",category:"Professional Services"},{code:"541612",name:"Human Resources Consulting Services",category:"Professional Services"},{code:"541618",name:"Other Management Consulting Services",category:"Professional Services"},{code:"541690",name:"Other Scientific and Technical Consulting Services",category:"Professional Services"},{code:"541990",name:"Other Professional Services",category:"Professional Services"},{code:"336411",name:"Aircraft Manufacturing",category:"Defense"},{code:"336414",name:"Guided Missile and Space Vehicle Manufacturing",category:"Defense"},{code:"541710",name:"Research and Development in the Physical, Engineering, and Life Sciences",category:"Defense"},{code:"561210",name:"Facilities Support Services",category:"Defense"},{code:"561612",name:"Security Guards and Patrol Services",category:"Defense"},{code:"488",name:"Support Activities for Transportation",category:"Transportation"},{code:"484110",name:"General Freight Trucking, Local",category:"Transportation"},{code:"484121",name:"General Freight Trucking, Long-Distance, Truckload",category:"Transportation"},{code:"492110",name:"Couriers and Express Delivery Services",category:"Transportation"},{code:"493110",name:"General Warehousing and Storage",category:"Transportation"},{code:"221",name:"Utilities",category:"Utilities"},{code:"221112",name:"Fossil Fuel Electric Power Generation",category:"Utilities"},{code:"221121",name:"Electric Bulk Power Transmission and Control",category:"Utilities"},{code:"237130",name:"Power and Communication Line and Related Structures Construction",category:"Utilities"},{code:"561",name:"Administrative and Support Services",category:"Administrative"},{code:"561110",name:"Office Administrative Services",category:"Administrative"},{code:"561320",name:"Temporary Help Services",category:"Administrative"},{code:"311",name:"Food Manufacturing",category:"Manufacturing"},{code:"312",name:"Beverage and Tobacco Product Manufacturing",category:"Manufacturing"},{code:"313",name:"Textile Mills",category:"Manufacturing"},{code:"314",name:"Textile Product Mills",category:"Manufacturing"},{code:"315",name:"Apparel Manufacturing",category:"Manufacturing"},{code:"316",name:"Leather and Allied Product Manufacturing",category:"Manufacturing"},{code:"321",name:"Wood Product Manufacturing",category:"Manufacturing"},{code:"322",name:"Paper Manufacturing",category:"Manufacturing"},{code:"323",name:"Printing and Related Support Activities",category:"Manufacturing"},{code:"324",name:"Petroleum and Coal Products Manufacturing",category:"Manufacturing"},{code:"325",name:"Chemical Manufacturing",category:"Manufacturing"},{code:"326",name:"Plastics and Rubber Products Manufacturing",category:"Manufacturing"},{code:"327",name:"Nonmetallic Mineral Product Manufacturing",category:"Manufacturing"},{code:"331",name:"Primary Metal Manufacturing",category:"Manufacturing"},{code:"332",name:"Fabricated Metal Product Manufacturing",category:"Manufacturing"},{code:"333",name:"Machinery Manufacturing",category:"Manufacturing"},{code:"334",name:"Computer and Electronic Product Manufacturing",category:"Manufacturing"},{code:"335",name:"Electrical Equipment, Appliance, and Component Manufacturing",category:"Manufacturing"}
829,{code:"336",name:"Transportation Equipment Manufacturing",category:"Manufacturing"},{code:"337",name:"Furniture and Related Product Manufacturing",category:"Manufacturing"},{code:"339",name:"Miscellaneous Manufacturing",category:"Manufacturing"}];rh.filter(e=>e.category==="Healthcare");const XOe=[{month:"Jan 2024",avgPrice:245e4,contractCount:235,healthcare:385e4},{month:"Feb 2024",avgPrice:268e4,contractCount:218,healthcare:415e4},{month:"Mar 2024",avgPrice:252e4,contractCount:267,healthcare:428e4},{month:"Apr 2024",avgPrice:275e4,contractCount:245,healthcare:442e4},{month:"May 2024",avgPrice:289e4,contractCount:289,healthcare:465e4},{month:"Jun 2024",avgPrice:312e4,contractCount:312,healthcare:489e4},{month:"Jul 2024",avgPrice:328e4,contractCount:298,healthcare:512e4},{month:"Aug 2024",avgPrice:315e4,contractCount:285,healthcare:498e4},{month:"Sep 2024",avgPrice:345e4,contractCount:325,healthcare:535e4},{month:"Oct 2024",avgPrice:368e4,contractCount:341,healthcare:562e4},{month:"Nov 2024",avgPrice:352e4,contractCount:298,healthcare:548e4},{month:"Dec 2024",avgPrice:375e4,contractCount:315,healthcare:572e4}],Zw=[{value:"12months",label:"Past 12 Months"},{value:"2024",label:"2024"},{value:"2023",label:"2023"},{value:"2022",label:"2022"},{value:"2021",label:"2021"},{value:"2020",label:"2020"},{value:"custom",label:"Custom Range"}],QOe=[{year:"2020",totalSpend:645.8,contractCount:125e3,avgSize:5166},{year:"2021",totalSpend:692.1,contractCount:132e3,avgSize:5243},{year:"2022",totalSpend:718.4,contractCount:128e3,avgSize:5613},{year:"2023",totalSpend:759.3,contractCount:134e3,avgSize:5667},{year:"2024",totalSpend:782.1,contractCount:138e3,avgSize:5667}],ej=[{name:"Large Businesses",value:64.2,amount:502.1,color:"#8b5cf6"},{name:"Small Businesses",value:28.4,amount:222.1,color:"#06b6d4"},{name:"Small Disadvantaged",value:4.8,amount:37.5,color:"#10b981"},{name:"Women-Owned",value:2.6,amount:20.4,color:"#f59e0b"}],JOe=[{category:"Defense",fy2023:816,fy2024:842,fy2025:886},{category:"Health & Human Services",fy2023:131,fy2024:144,fy2025:158},{category:"Veterans Affairs",fy2023:273,fy2024:298,fy2025:325},{category:"Homeland Security",fy2023:52,fy2024:56,fy2025:59},{category:"Energy",fy2023:45,fy2024:48,fy2025:52}],ZOe=[{range:"$0-$50K",count:45200,percentage:32.8},{range:"$50K-$500K",count:38400,percentage:27.8},{range:"$500K-$5M",count:35600,percentage:25.8},{range:"$5M-$50M",count:15200,percentage:11},{range:"$50M+",count:3600,percentage:2.6}],eTe=()=>{var N;const[e,t]=g.useState(!1),[r,n]=g.useState("all"),[s,i]=g.useState("12months"),[o,l]=g.useState("all"),[c,d]=g.useState(""),[u,f]=g.useState(!1),[h,m]=g.useState(""),[v,p]=g.useState(!1),{toast:x}=dt(),b=rh.filter(j=>j.name.toLowerCase().includes(c.toLowerCase())||j.code.includes(c)||j.category.toLowerCase().includes(c.toLowerCase())),y=rh.filter(j=>j.name.toLowerCase().includes(h.toLowerCase())||j.code.includes(h)||j.category.toLowerCase().includes(h.toLowerCase())),w=()=>{const j=rh.find(S=>S.code===o);return j?j.name:"All Industries"},_=()=>{const j=rh.find(S=>S.code===r);return j?`${j.code} - ${j.name}`:"All NAICS Codes"};return a.jsx(Gt,{children:a.jsxs("div",{className:"space-y-8 animate-fade-in",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("h1",{className:"text-4xl font-bold text-gradient mb-2",children:"Price Trends & Analytics"}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"Comprehensive market intelligence, spending trends, and performance analytics"})]}),a.jsxs(J,{className:"glass-card mb-8 overflow-visible",children:[a.jsxs(de,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(qu,{className:"w-5 h-5"}),"Price Trends Filters"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Filter pricing data by healthcare, NAICS codes, and time periods"})]}),a.jsxs(re,{className:"overflow-visible",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6 overflow-visible",children:[a.jsxs("div",{className:"space-y-2 relative",children:[a.jsx(Q,{children:"Industry Focus"}),a.jsxs("div",{className:"relative",children:[a.jsx(ge,{type:"text",placeholder:"Search Industry",value:c,onChange:j=>{d(j.target.value),f(!0)},onFocus:()=>f(!0),className:"w-full"}),u&&a.jsxs("div",{className:"absolute top-full left-0 right-0 mt-1 bg-background border border-input rounded-md shadow-lg z-50 max-h-60 overflow-y-auto",children:[b.slice(0,20).map(j=>a.jsxs("div",{className:"px-3 py-2 hover:bg-accent hover:text-accent-foreground cursor-pointer border-b border-border last:border-b-0",onClick:()=>{l(j.code),d(j.name),f(!1),t(j.category==="Healthcare")},children:[a.jsx("div",{className:"font-medium",children:j.name}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:["NAICS: ",j.code," ⢠",j.category]})]},j.code)),b.length===0&&a.jsxs("div",{className:"px-3 py-2 text-muted-foreground",children:['No industries found matching "',c,'"']})]})]}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:["Selected: ",w()]})]}),a.jsxs("div",{className:"space-y-2 relative",children:[a.jsx(Q,{children:"NAICS Code"}),a.jsxs("div",{className:"relative",children:[a.jsx(ge,{type:"text",placeholder:"Search NAICS",value:h,onChange:j=>{m(j.target.value),p(!0)},onFocus:()=>p(!0),className:"w-full"}),v&&a.jsxs("div",{className:"absolute top-full left-0 right-0 mt-1 bg-background border border-input rounded-md shadow-lg z-50 max-h-60 overflow-y-auto",children:[y.slice(0,20).map(j=>a.jsxs("div",{className:"px-3 py-2 hover:bg-accent hover:text-accent-foreground cursor-pointer border-b border-border last:border-b-0",onClick:()=>{n(j.code),m(`${j.code} - ${j.name}`),p(!1)},children:[a.jsxs("div",{className:"font-medium",children:["NAICS ",j.code]}),a.jsx("div",{className:"text-sm",children:j.name}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:["Category: ",j.category]})]},j.code)),y.length===0&&a.jsxs("div",{className:"px-3 py-2 text-muted-foreground",children:['No NAICS codes found matching "',h,'"']}
829)]})]}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:["Selected: ",_()]})]}),a.jsxs("div",{className:"space-y-2 overflow-visible",children:[a.jsx(Q,{children:"Time Period"}),a.jsxs(Re,{value:s,onValueChange:i,children:[a.jsx(Me,{className:"w-full",children:a.jsx(De,{placeholder:"Select time period..."})}),a.jsx(Ie,{position:"popper",className:"z-[9999] w-full min-w-[200px]",children:Zw.map(j=>a.jsx(ce,{value:j.value,children:j.label},j.value))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{className:"invisible",children:"Action"}),a.jsxs(U,{onClick:()=>{var j;x({title:"Trends Updated",description:`Showing trends for ${e?"Healthcare":"All Industries"} ${r!=="all"?`(NAICS ${r})`:""} - ${(j=Zw.find(S=>S.value===s))==null?void 0:j.label}`})},className:"w-full h-10 bg-gradient-to-r from-primary to-purple-primary hover:from-primary/90 hover:to-purple-primary/90",children:[a.jsx(Ft,{className:"w-4 h-4 mr-2"}),"Run Trends"]})]})]}),a.jsxs("div",{className:"mt-6 pt-6 border-t border-border",children:[a.jsx("h4",{className:"font-semibold mb-3",children:"Available Industry Categories"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("h5",{className:"text-sm font-medium text-primary",children:"Healthcare & Medical"}),a.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[a.jsx("p",{children:"⢠Ambulatory Health Care Services (621)"}),a.jsx("p",{children:"⢠Hospitals & Medical Facilities (622)"}),a.jsx("p",{children:"⢠Medical Laboratories (621511)"}),a.jsx("p",{children:"⢠Pharmaceutical Manufacturing (325412)"}),a.jsx("p",{children:"⢠Medical Equipment Manufacturing (334510)"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h5",{className:"text-sm font-medium text-primary",children:"General Industries"}),a.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[a.jsx("p",{children:"⢠Construction & Engineering (236, 237, 238)"}),a.jsx("p",{children:"⢠Professional Services (541330, 541990)"}),a.jsx("p",{children:"⢠IT & Computer Systems (541511, 518210)"}),a.jsx("p",{children:"⢠Utilities & Transportation (221, 488)"}),a.jsx("p",{children:"⢠Administrative Services (561)"})]})]})]})]})]})]}),a.jsxs(J,{className:"glass-card mb-8",children:[a.jsxs(de,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Ft,{className:"w-5 h-5"}),"Contract Price Trends - ",s==="12months"?"Past 12 Months":(N=Zw.find(j=>j.value===s))==null?void 0:N.label]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[e?"Healthcare-focused":"All industries"," contract pricing trends",r&&r!=="all"&&` ⢠Filtered by NAICS ${r}`]})]}),a.jsx(re,{children:a.jsx(js,{width:"100%",height:400,children:a.jsxs(JM,{data:XOe,children:[a.jsx(Il,{strokeDasharray:"3 3",className:"stroke-muted"}),a.jsx(Xa,{dataKey:"month",className:"text-xs",angle:-45,textAnchor:"end",height:60}),a.jsx(Hn,{yAxisId:"left",className:"text-xs",label:{value:"Average Price ($)",angle:-90,position:"insideLeft"},tickFormatter:j=>`$${(j/1e6).toFixed(1)}M`}),a.jsx(Hn,{yAxisId:"right",orientation:"right",className:"text-xs",label:{value:"Contract Count",angle:90,position:"insideRight"}}),a.jsx(Ar,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"},formatter:(j,S)=>S==="avgPrice"||S==="healthcare"?[`$${(Number(j)/1e6).toFixed(1)}M`,S==="avgPrice"?"Average Price":"Healthcare Average"]:[j,"Contract Count"],labelFormatter:j=>`Month: ${j}`}),a.jsx(rl,{yAxisId:"left",type:"monotone",dataKey:e?"healthcare":"avgPrice",fill:"url(#priceGradient)",stroke:"#8b5cf6",strokeWidth:2,fillOpacity:.3}),a.jsx(Wn,{yAxisId:"right",dataKey:"contractCount",fill:"url(#countGradient)",radius:[2,2,0,0],opacity:.7}),a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"priceGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#8b5cf6",stopOpacity:.8}),a.jsx("stop",{offset:"95%",stopColor:"#8b5cf6",stopOpacity:.1})]}),a.jsxs("linearGradient",{id:"countGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",
829stopColor:"#06b6d4",stopOpacity:.8}),a.jsx("stop",{offset:"95%",stopColor:"#06b6d4",stopOpacity:.3})]})]})]})})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6 mb-8",children:[a.jsxs(J,{className:"glass-card hover-lift animate-scale-in",children:[a.jsx(de,{className:"pb-3",children:a.jsxs(le,{className:"text-lg flex items-center gap-2",children:[a.jsx(Jt,{className:"w-5 h-5 text-green-500"}),"Total FY2024 Spend"]})}),a.jsxs(re,{children:[a.jsx("div",{className:"text-3xl font-bold text-green-500",children:"$782.1B"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"+3.0% from FY2023"})]})]}),a.jsxs(J,{className:"glass-card hover-lift animate-scale-in",style:{animationDelay:"0.1s"},children:[a.jsx(de,{className:"pb-3",children:a.jsxs(le,{className:"text-lg flex items-center gap-2",children:[a.jsx(Jt,{className:"w-5 h-5 text-blue-500"}),"Active Contracts"]})}),a.jsxs(re,{children:[a.jsx("div",{className:"text-3xl font-bold text-blue-500",children:"138K"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"+3.0% from last year"})]})]}),a.jsxs(J,{className:"glass-card hover-lift animate-scale-in",style:{animationDelay:"0.2s"},children:[a.jsx(de,{className:"pb-3",children:a.jsxs(le,{className:"text-lg flex items-center gap-2",children:[a.jsx(Ft,{className:"w-5 h-5 text-purple-500"}),"Avg Contract Size"]})}),a.jsxs(re,{children:[a.jsx("div",{className:"text-3xl font-bold text-purple-500",children:"$5.67M"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"+1.0% from FY2023"})]})]}),a.jsxs(J,{className:"glass-card hover-lift animate-scale-in",style:{animationDelay:"0.3s"},children:[a.jsx(de,{className:"pb-3",children:a.jsxs(le,{className:"text-lg flex items-center gap-2",children:[a.jsx(mr,{className:"w-5 h-5 text-orange-500"}),"Small Business Share"]})}),a.jsxs(re,{children:[a.jsx("div",{className:"text-3xl font-bold text-orange-500",children:"28.4%"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"$222.1B captured"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[a.jsxs(J,{className:"glass-card hover-lift",children:[a.jsxs(de,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx($s,{className:"w-5 h-5"}),"Federal Contract Spending Trends"]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Annual government contract spending (bars) and total number of contracts (line)"})]}),a.jsx(re,{children:a.jsx(js,{width:"100%",height:300,children:a.jsxs(JM,{data:QOe,children:[a.jsx(Il,{strokeDasharray:"3 3",className:"stroke-muted"}),a.jsx(Xa,{dataKey:"year",className:"text-xs"}),a.jsx(Hn,{yAxisId:"left",className:"text-xs",label:{value:"Spending (Billions $)",angle:-90,position:"insideLeft"}}),a.jsx(Hn,{yAxisId:"right",orientation:"right",className:"text-xs",label:{value:"Contract Count (Thousands)",angle:90,position:"insideRight"}}),a.jsx(Ar,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"},formatter:(j,S)=>[S==="totalSpend"?`$${j}B`:`${Math.round(Number(j)/1e3)}K`,S==="totalSpend"?"Total Contract Spending":"Total Contract Count"],labelFormatter:j=>`Fiscal Year ${j}`}),a.jsx(Wn,{yAxisId:"left",dataKey:"totalSpend",fill:"url(#spendGradient)",radius:[4,4,0,0]}),a.jsx(_i,{yAxisId:"right",type:"monotone",dataKey:"contractCount",stroke:"#8b5cf6",strokeWidth:3}),a.jsx("defs",{children:a.jsxs("linearGradient",{id:"spendGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#8b5cf6",stopOpacity:.8}),a.jsx("stop",{offset:"95%",stopColor:"#8b5cf6",stopOpacity:.2})]})})]})})})]}),a.jsxs(J,{className:"glass-card hover-lift",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Ov,{className:"w-5 h-5"}),"Market Share by Company Size"]})}),a.jsx(re,{children:a.jsx(js,{width:"100%",height:300,children:a.jsxs(Wb,{children:[a.jsx(ka,{data:ej,cx:"50%",cy:"50%",outerRadius:100,dataKey:"value",label:({name:j,value:S})=>j+": "+S+"%",children:ej.map((j,S)=>a.jsx(Jo,{fill:j.color},`cell-${S}`))}),a.jsx(Ar,{formatter:(j,S)=>[`${j}%`,"Market Share"],labelFormatter:j=>{const S=ej.find(C=>C.name===j);return`${j}: $${S==null?void 0:S.amount}B`}})]})})})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[a.jsxs(J,{className:"glass-card hover-lift",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Br,{className:"w-5 h-5"}),"Federal Budget by Department (Billions)"]})}),a.jsxs(re,{children:[a.jsx(js,{width:"100%",height:350,children:a.jsxs(QM,{data:JOe,layout:"horizontal",children:[a.jsx(Il,{strokeDasharray:"3 3"}),a.jsx(Xa,{type:"number",className:"text-xs"}),a.jsx(Hn,{dataKey:"category",type:"category",className:"text-xs",width:80}),a.jsx(Ar,{formatter:j=>[`$${j}B`,"Budget"],contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),a.jsx(Wn,{dataKey:"fy2023",fill:"#94a3b8",radius:[0,4,4,0]}),a.jsx(Wn,{dataKey:"fy2024",fill:"#06b6d4",radius:[0,4,4,0]}),a.jsx(Wn,{dataKey:"fy2025",fill:"#8b5cf6",radius:[0,4,4,0]})]})}),a.jsxs("div",{className:"flex justify-center gap-6 mt-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-3 h-3 bg-slate-400 rounded"}),a.jsx("span",{className:"text-sm",children:"FY2023"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded"}),a.jsx("span",{className:"text-sm",children:"FY2024"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded"}),a.jsx("span",{className:"text-sm",children:"FY2025"})]})]})]})]}),a.jsxs(J,{className:"glass-card hover-lift",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(ap,{className:"w-5 h-5"}),"Contract Size Distribution"]})}),a.jsx(re,{children:a.jsx(js,{width:"100%",height:350,children:a.jsxs(QM,{data:ZOe,children:[a.jsx(Il,{strokeDasharray:"3 3"}),a.jsx(Xa,{dataKey:"range",className:"text-xs",angle:-45,textAnchor:"end",height:60}),a.jsx(Hn,{className:"text-xs",tickFormatter:j=>`${(j/1e3).toFixed(0)}K`}),a.jsx(Ar,{formatter:(j,S)=>
829[S==="count"?`${j.toLocaleString()} contracts`:`${j}%`,S==="count"?"Contract Count":"Percentage"],contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),a.jsx(Wn,{dataKey:"count",fill:"url(#contractGradient)",radius:[4,4,0,0]}),a.jsx("defs",{children:a.jsxs("linearGradient",{id:"contractGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#10b981",stopOpacity:.8}),a.jsx("stop",{offset:"95%",stopColor:"#10b981",stopOpacity:.3})]})})]})})})]})]})]})})},tTe=()=>{const[e,t]=g.useState({email:!0,push:!1,bidUpdates:!0,contractAlerts:!0,marketingEmails:!1}),[r,n]=g.useState({theme:"system",language:"en",timezone:"America/New_York",currency:"USD"}),{toast:s}=dt(),{user:i}=it(),o=()=>{s({title:"Settings saved",description:"Your preferences have been updated successfully."})},l=(d,u)=>{t(f=>({...f,[d]:u}))},c=(d,u)=>{n(f=>({...f,[d]:u}))};return a.jsx(Gt,{children:a.jsxs("div",{className:"space-y-8 animate-fade-in max-w-4xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("h1",{className:"text-4xl font-bold text-gradient mb-2",children:"Settings"}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"Customize your PriceBid experience"})]}),a.jsxs(J,{className:"glass-card hover-lift",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(di,{className:"w-5 h-5"}),"Profile Settings"]})}),a.jsx(re,{className:"space-y-6",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"email",children:"Email Address"}),a.jsx(ge,{id:"email",type:"email",value:(i==null?void 0:i.email)||"",disabled:!0,className:"bg-muted/50"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"company",children:"Company Name"}),a.jsx(ge,{id:"company",placeholder:"Enter your company name",defaultValue:"Parkpine"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"role",children:"Role"}),a.jsxs(Re,{defaultValue:"purchasing_officer",children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select your role"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"purchasing_officer",children:"Purchasing Officer"}),a.jsx(ce,{value:"bidder",children:"Bidder"}),a.jsx(ce,{value:"contractor",children:"Contractor"}),a.jsx(ce,{value:"consultant",children:"Consultant"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"phone",children:"Phone Number"}),a.jsx(ge,{id:"phone",type:"tel",placeholder:"Enter your phone number"})]})]})})]}),a.jsxs(J,{className:"glass-card hover-lift",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(d1,{className:"w-5 h-5"}),"Notification Preferences"]})}),a.jsx(re,{className:"space-y-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"email-notifications",children:"Email Notifications"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Receive notifications via email"})]}),a.jsx(On,{id:"email-notifications",checked:e.email,onCheckedChange:d=>l("email",d)})]}),a.jsx(St,{}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"bid-updates",children:"Bid Updates"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Get notified when bid status changes"})]}),a.jsx(On,{id:"bid-updates",checked:e.bidUpdates,onCheckedChange:d=>l("bidUpdates",d)})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"contract-alerts",children:"Contract Alerts"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Receive alerts for new contract opportunities"})]}),a.jsx(On,{id:"contract-alerts",checked:e.contractAlerts,onCheckedChange:d=>l("contractAlerts",d)})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"marketing-emails",children:"Marketing Emails"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Receive product updates and tips"})]}),a.jsx(On,{id:"marketing-emails",checked:e.marketingEmails,onCheckedChange:d=>l("marketingEmails",d)})]})]})})]}),a.jsxs(J,{className:"glass-card hover-lift",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Uq,{className:"w-5 h-5"}),"Appearance & Preferences"]})}),a.jsx(re,{className:"space-y-6",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"theme",children:"Theme"}),a.jsxs(Re,{value:r.theme,onValueChange:d=>c("theme",d),children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select theme"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"light",children:"Light"}),a.jsx(ce,{value:"dark",children:"Dark"}),a.jsx(ce,{value:"system",children:"System"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"language",children:"Language"}),a.jsxs(Re,{value:r.language,onValueChange:d=>c("language",d),children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select language"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"en",children:"English"}),a.jsx(ce,{value:"es",children:"Spanish"}),a.jsx(ce,{value:"fr",children:"French"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"timezone",children:"Timezone"}),a.jsxs(Re,{value:r.timezone,onValueChange:d=>c("timezone",d),children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select timezone"})}
829),a.jsxs(Ie,{children:[a.jsx(ce,{value:"America/New_York",children:"Eastern Time"}),a.jsx(ce,{value:"America/Chicago",children:"Central Time"}),a.jsx(ce,{value:"America/Denver",children:"Mountain Time"}),a.jsx(ce,{value:"America/Los_Angeles",children:"Pacific Time"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"currency",children:"Currency"}),a.jsxs(Re,{value:r.currency,onValueChange:d=>c("currency",d),children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select currency"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"USD",children:"USD ($)"}),a.jsx(ce,{value:"EUR",children:"EUR (â¬)"}),a.jsx(ce,{value:"GBP",children:"GBP (£)"}),a.jsx(ce,{value:"CAD",children:"CAD (C$)"})]})]})]})]})})]}),a.jsxs(J,{className:"glass-card hover-lift",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Os,{className:"w-5 h-5"}),"Security & Privacy"]})}),a.jsx(re,{className:"space-y-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Q,{children:"Password"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Update your password to keep your account secure"}),a.jsx(U,{variant:"outline",children:"Change Password"})]}),a.jsx(St,{}),a.jsxs("div",{children:[a.jsx(Q,{children:"Two-Factor Authentication"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Add an extra layer of security to your account"}),a.jsx(U,{variant:"outline",children:"Enable 2FA"})]}),a.jsx(St,{}),a.jsxs("div",{children:[a.jsx(Q,{children:"Data Export"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Download your data in a portable format"}),a.jsx(U,{variant:"outline",children:"Export Data"})]})]})})]}),a.jsxs(J,{className:"glass-card hover-lift",children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(GR,{className:"w-5 h-5"}),"API & Integrations"]})}),a.jsx(re,{className:"space-y-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Q,{children:"API Keys"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Manage API keys for third-party integrations"}),a.jsx(U,{variant:"outline",children:"Manage API Keys"})]}),a.jsx(St,{}),a.jsxs("div",{children:[a.jsx(Q,{children:"Webhooks"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Configure webhooks for real-time updates"}),a.jsx(U,{variant:"outline",children:"Configure Webhooks"})]})]})})]}),a.jsx("div",{className:"flex justify-end",children:a.jsx(U,{onClick:o,className:"px-8",children:"Save All Settings"})})]})})},rTe=()=>{const[e,t]=g.useState(""),[r,n]=g.useState(""),[s,i]=g.useState(!1),[o,l]=g.useState(!1),{signIn:c,user:d}=it(),u=vt(),f=async()=>{if(!e){kr({title:"Email required",description:"Please enter your email address first",variant:"destructive"});return}l(!0);try{const{error:m}=await Z.auth.resetPasswordForEmail(e,{redirectTo:`${window.location.origin}/reset-password`});kr(m?{title:"Reset failed",description:m.message,variant:"destructive"}:{title:"Reset email sent",description:"Check your email for password reset instructions"})}catch{kr({title:"Reset failed",description:"An unexpected error occurred",variant:"destructive"})}finally{l(!1)}};g.useEffect(()=>{d&&u("/dashboard")},[d,u]);const h=async m=>{m.preventDefault(),i(!0);try{const{error:v}=await c(e,r);v?kr({title:"Login failed",description:v.message,variant:"destructive"}):(kr({title:"Welcome back!",description:"Successfully logged in."}),u("/dashboard"))}catch{kr({title:"Login failed",description:"An unexpected error occurred.",variant:"destructive"})}finally{i(!1)}};return a.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:a.jsxs(J,{className:"w-full max-w-md gradient-card animate-scale-in",children:[a.jsx(de,{children:a.jsx(le,{className:"text-center text-2xl text-gradient",children:"Welcome Back"})}),a.jsx(re,{children:a.jsxs("form",{onSubmit:h,className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"email",className:"text-foreground",children:"Email"}),a.jsx(ge,{id:"email",type:"email",placeholder:"[email protected]",value:e,onCh
vendor: 3,917 bytes, line 829
829ange:m=>t(m.target.value),required:!0,className:"smooth-transition focus:glow-effect"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"password",className:"text-foreground",children:"Password"}),a.jsx(ge,{id:"password",type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:r,onChange:m=>n(m.target.value),required:!0,className:"smooth-transition focus:glow-effect"})]}),a.jsx(U,{type:"submit",className:"w-full hero-gradient glow-effect smooth-transition hover:scale-105",disabled:s,size:"lg",children:s?"Signing In...":"Sign In"}),a.jsx("div",{className:"text-center",children:a.jsx("button",{type:"button",onClick:f,disabled:o,className:"text-sm text-primary hover:underline font-medium smooth-transition",children:o?"Sending...":"Forgot your password?"})})]})}),a.jsx(M5,{className:"justify-center",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Don't have an account?"," ",a.jsx(je,{to:"/signup",className:"text-primary hover:underline font-semibold smooth-transition",children:"Sign up here"})]})})]})})};var nP="Radio",[nTe,RU]=ir(nP),[aTe,sTe]=nTe(nP),DU=g.forwardRef((e,t)=>{const{__scopeRadio:r,name:n,checked:s=!1,required:i,disabled:o,value:l="on",onCheck:c,form:d,...u}=e,[f,h]=g.useState(null),m=Te(t,x=>h(x)),v=g.useRef(!1),p=f?d||!!f.closest("form"):!0;return a.jsxs(aTe,{scope:r,checked:s,disabled:o,children:[a.jsx(we.button,{type:"button",role:"radio","aria-checked":s,"data-state":zU(s),"data-disabled":o?"":void 0,disabled:o,value:l,...u,ref:m,onClick:pe(e.onClick,x=>{s||c==null||c(),p&&(v.current=x.isPropagationStopped(),v.current||x.stopPropagation())})}),p&&a.jsx(BU,{control:f,bubbles:!v.current,name:n,value:l,checked:s,required:i,disabled:o,form:d,style:{transform:"translateX(-100%)"}})]})});DU.displayName=nP;var LU="RadioIndicator",FU=g.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...s}=e,i=sTe(LU,r);return a.jsx(Zt,{present:n||i.checked,children:a.jsx(we.span,{"data-state":zU(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t})})});FU.displayName=LU;var iTe="RadioBubbleInput",BU=g.forwardRef(({__scopeRadio:e,control:t,checked:r,bubbles:n=!0,...s},i)=>{const o=g.useRef(null),l=Te(o,i),c=Pp(r),d=Ty(t);return g.useEffect(()=>{const u=o.current;if(!u)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==r&&m){const v=new Event("click",{bubbles:n});m.call(u,r),u.dispatchEvent(v)}},[c,r,n]),a.jsx(we.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:l,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});BU.displayName=iTe;function zU(e){return e?"checked":"unchecked"}var oTe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],h0="RadioGroup",[lTe,_Re]=ir(h0,[nl,RU]),UU=nl(),WU=RU(),[cTe,dTe]=lTe(h0),HU=g.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:s,value:i,required:o=!1,disabled:l=!1,orientation:c,dir:d,loop:u=!0,onValueChange:f,...h}=e,m=UU(r),v=Ii(d),[p,x]=vr({prop:i,defaultProp:s??null,onChange:f,caller:h0});return a.jsx(cTe,{scope:r,name:n,required:o,disabled:l,value:p,onValueChange:x,children:a.jsx(Vb,{asChild:!0,...m,orientation:c,dir:v,loop:u,children:a.jsx(we.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:v,...h,ref:t})})})});HU.displayName=h0;var VU="RadioGroupItem",qU=g.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...s}=e,i=dTe(VU,r),o=i.disabled||n,l=UU(r),c=WU(r),d=g.useRef(null),u=Te(t,d),f=i.value===s.value,h=g.useRef(!1);return g.useEffect(()=>{const m=p=>{oTe.includes(p.key)&&(h.current=!0)},v=()=>h.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",v)}},[]),a.jsx(qb,{asChild:!0,...l,focusable:!o,active:f,children:a.jsx(DU,{disabled:o,required:i.required,
829checked:f,...c,...s,name:i.name,ref:u,onCheck:()=>i.onValueChange(s.value),onKeyDown:pe(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:pe(s.onFocus,()=>{var m;h.current&&((m=d.current)==null||m.click())})})})});qU.displayName=VU;var uTe="RadioGroupIndicator",GU=g.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,s=WU(r);return a.jsx(FU,{...s,...n,ref:t})});GU.displayName=uTe;var KU=HU,YU=qU,fTe=GU;const Ki=g.forwardRef(({className:e,...t},r)=>a.jsx(KU,{className:me("grid gap-2",e),...t,ref:r}));Ki.displayName=KU.displayName;const ur=g.forwardRef(({className:e,...t},r)=>a.jsx(YU,{ref:r,className:me("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:a.jsx(fTe,{className:"flex items-center justify-center",children:a.jsx(qR,{className:"h-2.5 w-2.5 fill-current text-current"})})}));ur.displayName=YU.displayName;const XU=({recommendedPlan:e="Standard",onPlanSelect:t,showRecommendation:r=!1})=>{const{user:n}=it(),{createCheckoutSession:s,loading:i}=q2(),{toast:o}=dt(),[l,c]=g.useState(!1),[d,u]=g.useState(!1),[f,h]=g.useState(""),[m,v]=g.useState(null),p={basic:{monthly:"price_1SEzUNLzALanhniW4Hql0xm9",annual:"price_1SFImkLzALanhniWL0WAzdum"},standard:{monthly:"price_1SEzVhLzALanhniWD2GBGDtD",annual:"price_1SFInOLzALanhniWlqlc64Z9"},pro:{monthly:"price_1SEzWfLzALanhniWO6m3ImJm",annual:"price_1SFInsLzALanhniWxnZGWy5U"},enterprise:{monthly:"price_1SEzWoLzALanhniWJ9OLxHWU",annual:"price_1SFJ1nLzALanhniWQPATIk9c"}},x=[{name:"Starter",monthlyPrice:299,annualPrice:2880,period:"/month",description:"Small contractors testing bids",priceId:p.basic,features:["1 Seat","10 bids per month","Core AI pricing engine","Cost summaries","Email support","Basic market intelligence"]},{name:"Pro",monthlyPrice:899,annualPrice:8640,period:"/month",description:"Smallâmid firms bidding weekly",priceId:p.standard,features:["2 Seats","30 bids per month","Full cost build-up (labor, materials, overhead, profit)","Inflation tracking","Live chat support","Advanced market analytics","RAG-based learning system"]},{name:"Enterprise",monthlyPrice:2499,annualPrice:24e3,period:"/month",description:"Prime contractors or GovCon consultants",priceId:p.pro,features:["3 Seats","Unlimited bids","Historical award analysis","Dedicated success manager","Custom integrations"]},{name:"Executive",monthlyPrice:4999,annualPrice:48e3,period:"/month",description:"High-volume contractors & consulting firms",priceId:p.enterprise,features:["5 Seats","Predictive bid-success scoring (AI confidence index)","Proprietary award-trend dashboards","Financing optimization (Plaid + Stripe)","Dedicated Human Pricing Consultant","Custom reporting","Early access to beta features"]}],b=(j,S)=>{const C=j*12;return((C-S)/C*100).toFixed(0)},y=()=>{const j=f.trim().toUpperCase();j==="WIN25"?(v({code:"WIN25",discount:.25}),o({title:"Promo code applied!",description:"You're getting 25% off your subscription."})):o(j===""?{title:"Enter a promo code",description:"Please enter a promo code first.",variant:"destructive"}:{title:"Invalid promo code",description:"Please check your code and try again.",variant:"destructive"})},w=()=>{v(null),h(""),o({title:"Promo code removed",description:"Original pricing restored."})},_=j=>m?Math.round(j*(1-m.discount)):j,N=async(j,S)=>{if(console.log("[PlansSection] handlePlanSelect called for:",S),S==="Executive"&&l){console.log("[PlansSection] Opening contact sales dialog"),u(!0);return}const C=l?j.annual:j.monthly;if(console.log("[PlansSection] Selected price ID:",C),t){console.log("[PlansSection] Calling onPlanSelect callback"),t(C,S);return}if(!n){console.log("[PlansSection] No user, redirecting to signup"),sessionStorage.setItem("selectedPriceId",C),sessionStorage.setItem("selectedPlanName",S),window.location.href="/signup";return}try{console.log("[PlansSection] Calling createCheckoutSession"),await s(C)}catch(P){console.error("Checkout error:",P),o({title:"Checkout failed",description:"Please try again or c
829ontact support.",variant:"destructive"})}};return a.jsxs(a.Fragment,{children:[a.jsx(kz,{open:d,onOpenChange:u}),a.jsx("div",{className:"w-full bg-background py-16",children:a.jsxs("div",{className:"max-w-none mx-auto space-y-8 px-8",children:[a.jsxs("div",{className:"text-center space-y-4 mb-12",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-gradient",children:"Pick A Plan. Start Winning."}),r&&a.jsxs("p",{className:"text-base text-muted-foreground max-w-2xl mx-auto",children:["Based on your profile, we recommend"," ",a.jsx("span",{className:"inline-flex items-center font-semibold text-primary bg-primary/10 px-2 py-1 rounded border border-primary/20 text-sm",children:e})]}),!r&&a.jsxs("p",{className:"text-lg text-muted-foreground max-w-3xl mx-auto",children:["Price Your Contract To Win."," ",a.jsx(je,{to:"/features",className:"text-primary hover:underline font-semibold",children:"Check Features"})]}),a.jsxs("div",{className:"flex items-center justify-center gap-6 mt-8",children:[a.jsx(Q,{htmlFor:"billing-toggle",className:`text-lg font-semibold cursor-pointer transition-all duration-300 ${l?"text-muted-foreground hover:text-foreground":"text-primary scale-110"}`,children:"Monthly"}),a.jsx(On,{id:"billing-toggle",checked:l,onCheckedChange:c,className:"data-[state=checked]:bg-gradient-to-r data-[state=checked]:from-primary data-[state=checked]:to-purple-600 data-[state=unchecked]:bg-gradient-to-r data-[state=unchecked]:from-primary data-[state=unchecked]:to-purple-600 scale-125 shadow-lg"}),a.jsxs(Q,{htmlFor:"billing-toggle",className:`text-lg font-semibold cursor-pointer transition-all duration-300 flex items-center gap-2 ${l?"text-primary scale-110":"text-muted-foreground hover:text-foreground"}`,children:["Annual",a.jsx("span",{className:"text-xs bg-gradient-to-r from-green-500 to-emerald-600 text-white px-3 py-1 rounded-full font-bold shadow-md",children:"Save up to 20%"})]})]}),a.jsxs("div",{className:"mt-6 flex items-center justify-center gap-3",children:[a.jsx(Kq,{className:"w-4 h-4 text-muted-foreground"}),m?a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-green-500/10 border border-green-500/20 rounded-full",children:[a.jsx(tr,{className:"w-3.5 h-3.5 text-green-600"}),a.jsxs("span",{className:"text-sm font-medium text-green-600",children:[m.code," (",Math.round(m.discount*100),"% off)"]}),a.jsx("button",{onClick:w,className:"ml-1 text-xs text-muted-foreground hover:text-foreground",children:"â"})]}):a.jsxs(a.Fragment,{children:[a.jsx(ge,{type:"text",placeholder:"Promo code",value:f,onChange:j=>h(j.target.value.toUpperCase()),onKeyDown:j=>j.key==="Enter"&&y(),className:"w-32 h-8 text-sm"}),a.jsx(U,{onClick:y,size:"sm",variant:"outline",className:"h-8 px-4",children:"Apply"})]})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 auto-rows-fr w-full",children:x.map(j=>{const S=j.name===e,C=j.name==="Pro";return a.jsxs(J,{className:`relative gradient-card transition-all flex flex-col border-2 min-h-[420px] overflow-hidden group ${S?"border-primary shadow-lg shadow-primary/20":C&&!S?"border-purple-500 shadow-lg shadow-purple-500/20":"border-border"}`,children:[a.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-primary/5 to-transparent rounded-bl-full opacity-0 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none"}),a.jsx("div",{className:`absolute inset-0 rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none ${S?"bg-gradient-to-r from-primary/10 via-trans
829parent to-primary/10":"bg-gradient-to-r from-purple-500/10 via-transparent to-purple-500/10"}`}),S&&r&&a.jsx("div",{className:"absolute -top-3 left-1/2 transform -translate-x-1/2 z-10 animate-fade-in",children:a.jsx("span",{className:"bg-gradient-to-r from-primary to-primary/90 text-primary-foreground px-4 py-1 rounded-full text-xs font-medium shadow-lg",children:"â Recommended"})}),a.jsxs(de,{className:"text-center space-y-3 pt-8 pb-4 px-8 relative z-10",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2",children:[a.jsx("div",{className:"w-8 h-0.5 bg-gradient-to-r from-transparent to-primary/50"}),a.jsx(le,{className:"text-xl font-bold",children:j.name}),a.jsx("div",{className:"w-8 h-0.5 bg-gradient-to-l from-transparent to-primary/50"})]}),a.jsx("p",{className:"text-xs text-muted-foreground bg-muted/50 inline-block px-3 py-1 rounded-full",children:j.description})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"space-y-1",children:[m&&a.jsxs("div",{className:"text-sm text-muted-foreground line-through",children:["$",l?j.annualPrice.toLocaleString():j.monthlyPrice.toLocaleString()]}),a.jsxs("div",{className:"text-3xl font-bold text-foreground group-hover:text-primary transition-colors duration-300",children:["$",l?_(j.annualPrice).toLocaleString():_(j.monthlyPrice).toLocaleString()]}),a.jsx("div",{className:"text-xs text-muted-foreground font-medium",children:l?"/year":j.period})]}),l&&a.jsxs("div",{className:"text-xs text-green-600 dark:text-green-400 bg-green-500/10 px-2 py-1 rounded font-medium",children:["Save ",b(j.monthlyPrice,j.annualPrice),"% vs monthly"]}),!l&&a.jsxs("div",{className:"text-xs text-muted-foreground bg-muted/30 px-2 py-1 rounded",children:["Or $",j.annualPrice.toLocaleString(),"/year (save ",b(j.monthlyPrice,j.annualPrice),"%)"]})]})]}),a.jsxs(re,{className:"flex flex-col flex-1 px-8 pb-6",children:[a.jsx("div",{className:"space-y-2 mb-6 flex-1",children:j.features.map((P,A)=>a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("div",{className:"flex-shrink-0 mt-0.5",children:a.jsx("div",{className:"w-4 h-4 rounded-full bg-primary/10 flex items-center justify-center",children:a.jsx(tr,{className:"w-2.5 h-2.5 text-primary"})})}),a.jsx("span",{className:"text-sm text-foreground/90 leading-relaxed",children:P})]},A))}),a.jsx(U,{onClick:()=>N(j.priceId,j.name),className:`w-full font-medium shadow-md active:scale-95 transition-transform ${j.name==="Executive"&&l?"bg-gradient-to-r from-amber-600 to-yellow-600 hover:from-amber-700 hover:to-yellow-700 text-white":S?"bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary text-primary-foreground":"bg-gradient-to-r from-purple-600 to-purple-700 hover:from-purple-700 hover:to-purple-800 text-white"}`,disabled:i,children:i?a.jsxs("div",{className:"flex items-center justify-center gap-2",children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white/20 border-t-white rounded-full animate-spin"}),a.jsx("span",{children:"Processing..."})]}):a.jsx(a.Fragment,{children:j.name==="Executive"?l?"Contact Sales":"Choose Executive":"Get Started"})})]})]},j.name)})}),a.jsx("div",{className:"text-center mt-12",children:a.jsx(J,{className:"gradient-card bg-gradient-to-br from-success/10 to-info/10 border-success/20 p-6 max-w-2xl mx-auto",children:a.jsxs("div",{className:"flex flex-col items-center justify-center gap-3",children:[a.jsx(tr,{className:"w-10 h-10 text-success"}),a.jsx("div",{className:"text-center",children:a.jsx("p",{className:"text-xl font-bold text-foreground",children:"100% Money Back Guarantee"})})]})})}),a.jsxs("div",{className:"text-center mt-12 pt-8 border-t border-border/50",children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"All plans require annual commitment ⢠Pay monthly or save with annual upfront payment"}),a.jsx("div",{className:"mb-6 max-w-3xl mx-auto",children:a.jsx("p",{className:"text-xs text-muted-foreground/80 leading-relaxed",children:"* All plans require a 24-hour account setup period during business days (MondayâFriday). Orders processed on Frid
829ay will be activated on the following Monday. You will receive email confirmation once your account is fully configured."})}),a.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4 text-xs text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),a.jsx("span",{children:"Secure Payment"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),a.jsx("span",{children:"Cancel Anytime"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-purple-500 rounded-full"}),a.jsx("span",{children:"24/7 Support"})]})]})]})]})})]})},hTe=({onComplete:e})=>{const[t,r]=g.useState(1),[n,s]=g.useState(!1),[i,o]=g.useState("");it();const{createCheckoutSession:l,loading:c}=q2();vt();const[d,u]=g.useState(""),[f,h]=g.useState(""),[m,v]=g.useState(""),[p,x]=g.useState(""),[b,y]=g.useState(""),[w,_]=g.useState(""),[N,j]=g.useState(""),[S,C]=g.useState(""),[P,A]=g.useState(""),[D,F]=g.useState(""),[q,B]=g.useState(""),[V,E]=g.useState(""),[M,T]=g.useState(!1),L=R=>{const O=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;if(!R)return"Email is required";if(!O.test(R))return"Please enter a valid email address";const k=R.split("@");if(k.length!==2)return"Please enter a valid email address";const[G,te]=k;return G.length===0||te.length===0?"Please enter a valid email address":""},K=R=>{const O=R.target.value;h(O);const k=L(O);v(k)},H=()=>S==="50+"&&P==="5M+"?"Enterprise":S==="50+"||P==="5M+"?"Pro":S==="10-50"||P==="250K-5M"||D==="25%+"?"Standard":"Basic",ee=()=>q==="100M+"&&V==="200+"?"Enterprise":q==="100M+"||V==="200+"?"Pro":q==="10M-100M"||V==="50-200"?"Standard":"Basic",se=R=>{if(R.preventDefault(),!d||!f||!p||!b||!w){kr({title:"Please fill all fields",description:"All fields are required to continue",variant:"destructive"});return}const O=L(f);if(O){v(O),kr({title:"Invalid email",description:O,variant:"destructive"});return}if(p.length<8){kr({title:"Password too short",description:"Password must be at least 8 characters",variant:"destructive"});return}if(p!==b){kr({title:"Passwords don't match",description:"Please make sure both passwords match",variant:"destructive"});return}r(2)},ne=R=>{if(R.preventDefault(),!N){kr({title:"Please select a role",description:"You must choose either Bidder or Purchasing Officer",variant:"destructive"});return}r(3)},W=async R=>{if(R.preventDefault(),N==="bidder"){if(!S||!P||!D){kr({title:"Please complete all questions",description:"All questionnaire fields are required",variant:"destructive"});return}}else if(!q||!V){kr({title:"Please complete all questions",description:"All questionnaire fields are required",variant:"destructive"});return}const O=N==="bidder"?H():ee();o(O),r(4)},ie=async(R,O)=>{try{await l(R,f)}catch(k){console.error("Checkout error:",k),kr({title:"Checkout failed",description:"Please try again or contact support.",variant:"destructive"})}};return t===1?a.jsxs(J,{className:"w-full max-w-md mx-auto gradient-card animate-scale-in",children:[a.jsx(de,{children:a.jsx(le,{className:"text-center text-2xl text-gradient",children:"Start Here â Discover Your Best Plan"})}),a.jsx(re,{children:a.jsxs("form",{onSubmit:se,className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"name",className:"text-foreground",children:"Name"}),a.jsx(ge,{id:"name",type:"text",placeholder:"John Doe",value:d,onChange:R=>u(R.target.value),className:"smooth-transition focus:glow-effect",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"email",className:"text-foreground",children:"Email"}),a.jsx(ge,{id:"email",type:"email",placeholder:"[email protected]",value:f,onChange:K,className:`smooth-transition focus:glow-effect ${m?"border-red-500 focus:border-red-500":""}`,required:!0}),m&&a.jsx("p",{className:"text-sm text-red-500 mt-1",children:m})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"password",className:"text-foreground",children:"Password"}),a.jsx(ge,{id:"password",type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:p,onChange:R=>x(R.target.value),className:"smooth-transition focus:glow-effect",required:!0,minLength:8})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"confirmPassword",className:"text-foreground",children:"Confirm Password"}),a.jsx(ge,{id:"confirmPassword",type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:b,onChange:R=>y(R.target.value),className:"smooth-transition focus:glow-effect",required:!0,minLength:8})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"company",className:"text-foreground",children:"Company Name"}),a.jsx(ge,{id:"company",placeholder:"Your Company Inc.",value:w,onChange:R=>_(R.target.value),className:"smooth-transition focus:glow-effect",required:!0})]}),a.jsx(U,{type:"submit",className:"w-full hero-gradient glow-effect smooth-transition hover:scale-105",size:"lg",children:"Continue"})]})})]}):t===2?a.jsxs(J,{className:"w-full max-w-md mx-auto gradient-card animate-scale-in",children:[a.jsx(de,{children:a.jsx(le,{className:"text-2xl text-gradient",children:"Role Identification"})}),a.jsx(re,{children:a.jsxs("form",{onSubmit:ne,className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(Q,{className:"text-lg font-semibold text-foreground",children:"Are you a:"}),a.jsxs(Ki,{value:N,onValueChange:R=>j(R),children:[a.jsxs("div",{className:"flex items-start space-x-3 p-4 rounded-lg border border-border hover:border-primary/50 smooth-transition",children:[a.jsx(ur,{value:"bid
829der",id:"bidder",className:"mt-1"}),a.jsxs(Q,{htmlFor:"bidder",className:"flex-1 cursor-pointer",children:[a.jsx("div",{className:"font-medium text-foreground",children:"Bidder / Vendor"}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Selling to agencies, responding to RFPs"})]})]}),a.jsxs("div",{className:"flex items-start space-x-3 p-4 rounded-lg border border-border hover:border-primary/50 smooth-transition",children:[a.jsx(ur,{value:"purchasing_officer",id:"purchasing_officer",className:"mt-1"}),a.jsxs(Q,{htmlFor:"purchasing_officer",className:"flex-1 cursor-pointer",children:[a.jsx("div",{className:"font-medium text-foreground",children:"Purchasing Officer / Contract Manager"}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Reviewing bids, managing budgets"})]})]})]})]}),a.jsx(U,{type:"submit",className:"w-full hero-gradient glow-effect smooth-transition hover:scale-105",size:"lg",children:"Continue"})]})})]}):t===3&&N==="bidder"?a.jsxs(J,{className:"w-full max-w-md mx-auto gradient-card animate-scale-in",children:[a.jsx(de,{children:a.jsx(le,{className:"text-2xl text-gradient",children:"Business Activity"})}),a.jsx(re,{children:a.jsxs("form",{onSubmit:W,className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(Q,{className:"text-lg font-semibold text-foreground",children:"How many contracts do you bid on per year?"}),a.jsxs(Ki,{value:S,onValueChange:C,className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"1-10",id:"contracts-1-10"}),a.jsx(Q,{htmlFor:"contracts-1-10",className:"tabular-nums cursor-pointer",children:"1â10"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"10-50",id:"contracts-10-50"}),a.jsx(Q,{htmlFor:"contracts-10-50",className:"tabular-nums cursor-pointer",children:"10â50"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"50+",id:"contracts-50-plus"}),a.jsx(Q,{htmlFor:"contracts-50-plus",className:"tabular-nums cursor-pointer",children:"50+"})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(Q,{className:"text-lg font-semibold text-foreground",children:"What's your average contract size?"}),a.jsxs(Ki,{value:P,onValueChange:A,className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"<250K",id:"size-250k"}),a.jsx(Q,{htmlFor:"size-250k",className:"tabular-nums cursor-pointer",children:"<$250K"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"250K-5M",id:"size-250k-5m"}),a.jsx(Q,{htmlFor:"size-250k-5m",className:"tabular-nums cursor-pointer",children:"$250Kâ$5M"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"5M+",id:"size-5m-plus"}),a.jsx(Q,{htmlFor:"size-5m-plus",className:"tabular-nums cursor-pointer",children:"$5M+"})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(Q,{className:"text-lg font-semibold text-foreground",children:"What's your current success rate?"}),a.jsxs(Ki,{value:D,onValueChange:F,className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"<10%",id:"rate-10"}),a.jsx(Q,{htmlFor:"rate-10",className:"tabular-nums cursor-pointer",children:"<10%"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"10-25%",id:"rate-10-25"}),a.jsx(Q,{htmlFor:"rate-10-25",className:"tabular-nums cursor-pointer",children:"10â25%"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"25%+",id:"rate-25-plus"}),a.jsx(Q,{htmlFor:"rate-25-plus",className:"tabular-nums cursor-pointer",children:"25%+"})]})]})]}),a.jsx(U,{type:"submit",className:"w-full hero-gradient glow-effect smooth-transition hover:scale-105",disabled:n,size:"lg",children:n?"Creating Account...":"Discover Plans"})]})})]}):t===3&&N==="purchasing_officer"?a.jsxs(J,{className:"w-full max-w-md mx-auto gradient-card animate-scale-in",children:[a.jsx(de,{children:a.jsx(le,{className:"text-2xl text-gradient",children:"Business Activity"})}),a.jsx(re,{children:a.jsxs("form",{onSubmit:W,className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(Q,{className:"text-lg font-semibold text-foreground",children:"What's your annual procurement budget?"}),a.jsxs(Ki,{value:q,onValueChange:B,className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"<10M",id:"budget-10m"}),a.jsx(Q,{htmlFor:"budget-10m",className:"tabular-nums cursor-pointer",children:"<$10M"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"10M-100M",id:"budget-10m-100m"}),a.jsx(Q,{htmlFor:"budget-10m-100m",className:"tabular-nums cursor-pointer",children:"$10Mâ$100M"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"100M+",id:"budget-100m-plus"}),a.jsx(Q,{htmlFor:"budget-100m-plus",className:"tabular-nums cursor-pointer",children:"$100M+"})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(Q,{className:"text-lg font-semibold text-foreground",children:"How many contracts do you oversee per year?"}),a.jsxs(Ki,{value:V,onValueChange:E,className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"1-50",id:"oversight-1-50"}),a.jsx(Q,{htmlFor:"oversight-1-50",className:"tabular-nums cursor-pointer",children:"1â50"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"50-200",id:"oversight-50-200"}),a.jsx(Q,{htmlFor:"oversight-50-200",className:"tabular-nums cursor-pointer",children:"50â200"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"200+",id:"oversight-200-plus"}),a.jsx(Q,{htmlFor:"oversight-200-plus",className:"tabular-nums cursor-pointer",children:"200+"})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(Q,{className:"text-lg font-semibold text-foreground",children:"Do you need team-wide access?"}),a.jsxs(Ki,{value:M?"true":"false",onValueChange:R=>T(R==="true"),children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"true",id:"team-yes"}),a.jsx(Q,{htmlFor:"team-yes",children:"Yes"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ur,{value:"false",id:"team-no"}),a.jsx(Q,{htmlFor:"team-no",children:"No"})]})]})]}),a.jsx(U,{type:"submit",className:"w-full hero-gradient glow-effect smooth-transition hover:scale-105",disabled:n,size:"lg",children:n?"Creating Account...":"Discover Plans"})]})})]}):t===4?a.jsx(XU,{recommendedPlan:i,onPlanSelect:ie,showRecommendation:!0}
829):null},mTe=()=>{const{user:e,loading:t}=it(),{isAdmin:r}=al(),n=vt();return g.useEffect(()=>{if(!t&&e){if(r){console.log("Admin user detected, redirecting to dashboard..."),n("/dashboard");return}console.log("User signed up successfully, redirecting to dashboard..."),n("/dashboard")}},[e,t,r,n]),t?a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx("div",{children:"Loading..."})}):a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("header",{className:"sticky top-0 z-50 w-full border-b border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:a.jsx("div",{className:"container flex h-16 items-center justify-between px-4",children:a.jsxs(U,{variant:"ghost",onClick:()=>n("/"),className:"gap-2",children:[a.jsx(Tr,{className:"h-4 w-4"}),"Back to Home"]})})}),a.jsx("div",{className:"flex items-center justify-center p-4 py-12",children:a.jsx("div",{className:"w-full max-w-2xl",children:a.jsx(hTe,{onComplete:()=>{}})})})]})},pTe=()=>{const e=vt();return a.jsxs(a.Fragment,{children:[a.jsx($r,{title:"Pricing Plans | PriceBid - Choose Your Perfect Contract Pricing Plan",description:"Compare PriceBid pricing plans and choose the perfect one for your contract bidding needs. From basic to enterprise, find the right AI-powered pricing solution for your business.",keywords:"pricing plans, contract pricing plans, bid pricing subscription, government contract pricing, RFP pricing plans, contract bidding software pricing",url:"https://pricebid.com/plans"}),a.jsxs("main",{className:"min-h-screen bg-background",children:[a.jsx("header",{className:"sticky top-0 z-50 w-full border-b border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:a.jsxs("div",{className:"container flex h-16 items-center justify-between px-4",children:[a.jsxs(U,{variant:"ghost",onClick:()=>e("/"),className:"gap-2",children:[a.jsx(Tr,{className:"h-4 w-4"}),"Back"]}),a.jsx(U,{variant:"outline",onClick:()=>e("/"),children:"Home"})]})}),a.jsx(XU,{})]})]})},gTe=()=>{const[e,t]=g.useState(""),[r,n]=g.useState(""),[s,i]=g.useState(!1);mC();const o=vt(),{toast:l}=dt();g.useEffect(()=>{(async()=>{const{data:u,error:f}=await Z.auth.getSession();f&&(console.error("Error getting session:",f),l({title:"Error",description:"Invalid or expired reset link. Please request a new one.",variant:"destructive"}),o("/login"))})()},[o,l]);const c=async d=>{if(d.preventDefault(),e!==r){l({title:"Error",description:"Passwords don't match",variant:"destructive"});return}if(e.length<6){l({title:"Error",description:"Password must be at least 6 characters",variant:"destructive"});return}i(!0);try{const{error:u}=await Z.auth.updateUser({password:e});if(u)throw u;l({title:"Success",description:"Password updated successfully!"}),o("/login")}catch(u){l({title:"Error",description:u.message||"Failed to update password",variant:"destructive"})}finally{i(!1)}};return a.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:a.jsxs(J,{className:"w-full max-w-md",children:[a.jsxs(de,{children:[a.jsx(le,{children:"Reset Password"}),a.jsx(nt,{children:"Enter your new password below"})]}),a.jsx(re,{children:a.jsxs("form",{onSubmit:c,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"password",children:"New Password"}),a.jsx(ge,{id:"password",type:"password",value:e,onChange:d=>t(d.target.value),placeholder:"Enter new password",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"confirmPassword",children:"Confirm Password"}),a.jsx(ge,{id:"confirmPassword",type:"password",value:r,onChange:d=>n(d.target.value),placeholder:"Confirm new password",required:!0})]}),a.jsx(U,{type:"submit",className:"w-full",disabled:s,children:s?"Updating...":"Update Password"})]})})]})})},vTe=()=>{const[e]=mC(),t=e.get("session_id"),r=t;return a.jsx("div",{className:"min-h-screen bg-gradient-background flex items-center justify-center p-4",children:a.jsxs(J,{className:"w-full max-w-md gradient-card animate-scale-in text-center",children:[a.jsxs(de,{children:[a.jsx("div",{className:"flex justify-center mb-4",children:a.jsx(tr,{className:"w-16 h-16 text-green-500"})}),a.jsx(le,{className:"text-2xl text-gradient",children:"Payment Successful!"})]}),a.jsx(re,{className:"space-y-6",children:r?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-muted-foreground",children:"Thank y
829ou for subscribing to PriceBid! Your payment has been processed successfully."}),a.jsxs("div",{className:"bg-blue-50 dark:bg-blue-950 border border-blue-200 dark:border-blue-800 rounded-lg p-4 my-4",children:[a.jsx("p",{className:"text-blue-900 dark:text-blue-100 font-semibold mb-2",children:"â³ Account Activation"}),a.jsx("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:"Your account will be fully activated within 24 hours. Our team will set up your permissions and ensure everything is configured properly for you."}),a.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-xs mt-2",children:"You'll receive an email notification once your account is ready."})]}),t&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Session ID: ",t]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(U,{asChild:!0,className:"w-full bg-purple-600 hover:bg-purple-700",children:a.jsx(je,{to:"/",children:"Go to Dashboard"})}),a.jsx(U,{asChild:!0,variant:"outline",className:"w-full",children:a.jsx(je,{to:"/contracts",children:"Upload Your First Contract"})}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"You should receive a confirmation email shortly with your payment details."})]})]}):a.jsx("p",{className:"text-muted-foreground",children:"Redirecting you back to the home page..."})})]})})},xTe=["Aerospace & Defense","Information Technology","Construction","Professional Services","Healthcare","Manufacturing","Transportation","Energy","Environmental","Education","Other"],yTe=["Small Business","8(a) Certified","SDVOSB (Service-Disabled Veteran-Owned)","WOSB (Women-Owned Small Business)","HUBZone Certified","Large Prime Contractor","VOSB (Veteran-Owned Small Business)","Minority-Owned Business","Disadvantaged Business Enterprise"],bTe=["FFP (Firm Fixed Price)","T&M (Time & Materials)","CPFF (Cost Plus Fixed Fee)","CPIF (Cost Plus Incentive Fee)","IDIQ (Indefinite Delivery/Indefinite Quantity)","GSA Schedule","Blanket Purchase Agreement (BPA)","Multiple Award Contract (MAC)"],wTe=["Department of Defense (DoD)","Department of Health and Human Services (HHS)","Department of Veterans Affairs (VA)","Department of Homeland Security (DHS)","General Services Administration (GSA)","NASA","Department of Energy (DOE)","USDA","Department of Transportation (DOT)","Environmental Protection Agency (EPA)","Department of Education","Department of Justice (DOJ)"];function jTe(){const{user:e}=it(),{toast:t}=dt(),[r,n]=g.useState("organization"),[s,i]=g.useState(!0),[o,l]=g.useState(null),[c,d]=g.useState({currentPassword:"",newPassword:"",confirmPassword:""}),[u,f]=g.useState(!1),[h,m]=g.useState({company_name:"",industry:"",naics_codes:[],business_type:"",headquarters_city:"",headquarters_state:"",headquarters_country:"",website_url:"",full_name:"",title:"",email:"",phone:"",preferred_communication:"email",billing_contact_name:"",billing_contact_email:"",billing_contact_phone:"",billing_address:"",subscription_plan:"Free",contract_types:[],preferred_agencies:[],regions_of_interest:[],target_margin_min:0,target_margin_max:0,report_delivery:"both"}),[v,p]=g.useState([]),[x,b]=g.useState([]),[y,w]=g.useState(!1),[_,N]=g.useState(!1),[j,S]=g.useState({name:"",email:"",role:"member"}),[C,P]=g.useState(!1),[A,D]=g.useState(null),[F,q]=g.useState(""),B=async()=>{if(!e){t({title:"Authentication required",description:"Please sign in to invite team members.",variant:"destructive"});return}if(!j.name||!j.email){t({title:"Missing information",description:"Please provide both name and email.",variant:"destructive"});return}if(!j.name||!j.email||!j.role){t({title:"Missing information",description:"Please fill in all fields.",variant:"destructive"});return}try{const{error:O}=await lt.from("team_members").insert({organization_id:e.id,name:j.name,email:j.email,role:j.role,invited_by:e.id,status:"pending"});if(O){console.error("Error inviting team member:",O),t({title:"Error",description:"Failed to invite team member. Please try again.",variant:"destructive"});return}try{const{error:k}=await lt.functions.invoke("send-team-invitation",{body:{type:"invitation",inviteeName:j.name,inviteeEmail:j.email,role:j.role,organizationId:e.id}});k&&console.error("Error sending invitation email:",k)}catch(k){console.error("Failed to send invitation email:",k)}t({title:"Invitation sent",description:`Invitation email sent to ${j.email}`}),N(!1),S({name:"",email:"",role:"member"}),E()}catch(O){console.error("Error inviting team member:",O),t({title:"Error",description:"Failed to invite team member. Please try again.",variant:"destructive"})}},V=async O=>{if(!e){t({title:"Authentication required",description:"Please sign in to resend invitations.",variant:"destructive"});return}try{const{error:k}=await lt.functions.invoke("send-team-invitation",{body:{type:"invitation",inviteeName:O.name,inviteeEmail:O.email,role:O.role,organizationId:e.id}});if(k){console.error("Error sending invitation email:",k),t({title:"Error",description:"Failed to resend invitation. Please try again.",variant:"destructive"});return}t({title:"Invitation resent",description:`Invitation email resent to ${O.email}`})}catch(k){console.error("Error resending invitation:",k),t({title:"Error",description:"Failed to resend invitation. Please try again.",variant:"destructive"})}},E=async()=>{try{const{data:O,error:k}=await lt.from("team_members").select("*").eq("organization_id",e==null?void 0:e.id).order("created_at",{ascending:!1});if(k){console.error("Error fetching team members:",k);return}p(O.map(G=>({id:G.id,name:G.name,email:G.email,role:G.role,status:G.status,last_login:G.last_login?new Date(G.last_login).toLocaleDateString():"Never"})))}catch(O){console.error("Error fetching team members:",O)}},M=async()=>{try{const{data:O,error:k}=await lt.from("report_history").select("*").eq("user_id",e==null?void 0:e.id).order("created_at",{ascending:!1});if(k){console.error("Error fetching report history:",k);return}b(O.map(G=>({id:G.id,title:G.title,type:G.type,created_at:new Date(G.created_at).toLocaleDateString(),status:G.status})))}catch(O){console.error("Error fetching report history:",O)}},T=async()=>{var O;if(!e){t({title:"Authentication required",description:"Please sign in to manage your subscription.",variant:"destructive"});return}w(!0);try{const{data:k,error:G}=await lt.functions.invoke("customer-portal",{headers:{Authorization:`Bearer ${(O=(await lt.auth.getSession()).data.session)==null?void 0:O.access_token}`}});if(G)throw G;if(k!=null&&k.url)window.open(k.url,"_blank");else throw new Error("No portal URL returned")}catch(k){console.error("Portal error:",k),t({title:"Portal failed",description:k.message||"Failed to open subscription portal",variant:"destructive"})}finally{w(!1)}};g.useEffect(()=>{e&&(L(),E(),M())},[e]),g.useEffect(()=>{const O=window.location.hash.substring(1);O&&["organization","contact","account","preferences","security","team","history"].includes(O)&&n(O)},[]);const L=async()=>{try{i(!0);const{data:O,error:k}=await lt.from("profiles").select("*").eq("user_id",e==null?void 0:e.id).single();if(k&&k.code!=="PGRST116"){console.error("Error fetching profile:",k),t({title:"Error",description:"Failed to load profile data",variant:"destructive"});return}O?m({company_name:O.company_name||"",industry:O.industry||"",naics_codes:O.naics_codes||[],business_type:O.business_type||"",headquarters_city:O.headquarters_city||"",headquarters_state:O.headquarters_state||"",headquarters_country:O.headquarters_country||"",website_url:O.website_url||"",full_name:`${O.first_name||""} ${O.last_name||""}`.trim(),title:O.title||"",email:O.email||(e==null?void 0:e.email)||"",phone:O.phone||"",preferred_communication:O.preferred_communication||"email",billing_contact_name:O.billing_contact_name||"",billing_contact_email:O.billing_contact_email||"",billing_contact_phone:O.billing_contact_phone||"",billing_address:O.billing_address||"",subscription_plan:O.subscription_plan||"Free",contract_types:O.contract_types||[],preferred_agencies:O.preferred_agencies||[],regions_of_interest:O.regi
829ons_of_interest||[],target_margin_min:O.target_margin_min||0,target_margin_max:O.target_margin_max||0,report_delivery:O.report_delivery||"both"}):e!=null&&e.email&&m(G=>({...G,email:e.email}))}catch(O){console.error("Error fetching profile:",O),t({title:"Error",description:"Failed to load profile data",variant:"destructive"})}finally{i(!1)}},K=async O=>{try{if(!(e!=null&&e.id))return;const k=h.full_name.trim().split(" "),G=k[0]||"",te=k.slice(1).join(" ")||"",$={user_id:e.id,email:h.email,company_name:h.company_name,role:h.title&&["bidder","purchasing_officer"].includes(h.title)?h.title:"user",first_name:G,last_name:te,industry:h.industry,naics_codes:h.naics_codes,business_type:h.business_type,headquarters_city:h.headquarters_city,headquarters_state:h.headquarters_state,headquarters_country:h.headquarters_country,website_url:h.website_url,title:h.title,phone:h.phone,preferred_communication:h.preferred_communication,billing_contact_name:h.billing_contact_name,billing_contact_email:h.billing_contact_email,billing_contact_phone:h.billing_contact_phone,billing_address:h.billing_address,subscription_plan:h.subscription_plan,contract_types:h.contract_types,preferred_agencies:h.preferred_agencies,regions_of_interest:h.regions_of_interest,target_margin_min:h.target_margin_min,target_margin_max:h.target_margin_max,report_delivery:h.report_delivery,updated_at:new Date().toISOString()},{error:ae}=await lt.from("profiles").update($).eq("user_id",e.id);if(ae){const{error:oe}=await lt.from("profiles").insert([$]);if(oe)throw oe}l(null),t({title:"Success",description:"Profile updated successfully"})}catch(k){console.error("Error saving profile:",k),t({title:"Error",description:"Failed to save profile",variant:"destructive"})}},H=()=>{l(null)},ee=O=>({ceo:"CEO",capture_manager:"Capture Manager",bid_manager:"Bid Manager",business_dev:"Business Development",contracts_manager:"Contracts Manager",proposal_manager:"Proposal Manager",other:"Other"})[O]||O,se=(O,k,G)=>{m(te=>{const $=te[O];return G&&!$.includes(k)?{...te,[O]:[...$,k]}:G?te:{...te,[O]:$.filter(ae=>ae!==k)}})},ne=async()=>{if(c.newPassword!==c.confirmPassword){t({title:"Error",description:"New passwords don't match",variant:"destructive"});return}if(c.newPassword.length<6){t({title:"Error",description:"Password must be at least 6 characters long",variant:"destructive"});return}f(!0);try{const{error:O}=await lt.auth.updateUser({password:c.newPassword});O?t({title:"Error",description:O.message,variant:"destructive"}):(t({title:"Success",description:"Password updated successfully"}),d({currentPassword:"",newPassword:"",confirmPassword:""}))}catch(O){console.error("Error updating password:",O),t({title:"Error",description:"Failed to update password",variant:"destructive"})}finally{f(!1)}},W=async O=>{if(confirm("Are you sure you want to remove this team member?"))try{console.log("Attempting to delete team member:",O);const{error:k}=await lt.from("team_members").delete().eq("id",O);if(k){console.error("Delete error:",k),t({title:"Error",description:`Failed to remove team member: ${k.message}`,variant:"destructive"});return}t({title:"Success",description:"Team member removed successfully"}),await E()}catch(k){console.error("Error removing team member:",k),t({title:"Error",description:k.message||"Failed to remove team member",variant:"destructive"})}},ie=O=>{console.log("Editing member:",O),D(O),q(""),P(!0)},R=async()=>{var O;if(A)try{console.log("Updating member:",A);const k={name:A.name,email:A.email,role:A.role,updated_at:new Date().toISOString()},{error:G}=await lt.from("team_members").update(k).eq("id",A.id);if(G){console.error("Update error:",G),t({title:"Error",description:`Failed to update team member: ${G.message}`,variant:"destructive"});return}if(F&&F.length>=6)try{const{data:te}=await lt.auth.getSession(),{data:$,error:ae}=await lt.functions.invoke("create-team-member-account",{body:{email:A.email,password:F,name:A.name,role:A.role,organizationId:e==null?void 0:e.id},headers:{Authorization:`Bearer ${(O=te.session)==null?void 0:O.access_token}`}});ae?(console.error("Account creation error:",ae),t({title:"Account Creation Failed",description:`Member updated but login account failed: ${ae.message}`,variant:"destructive"})):t({title:"Success",description:`Team member updated with login credentials. Email: ${A.email}, Password: ${F}`})}catch(te){console.error("Account error:",te),t({title:"Partial Success",description:"Member updated but account creation failed. Try again.",variant:"destructive"})}else t({title:"Success",description:"Team member updated successfully"});P(!1),D(null),q(""),await E()}catch(k){console.error("Error updating team member:",k),t({title:"Error",description:k.message||"Failed to update team member",variant:"destructive"})}};return e?a.jsx(Gt,{children:a.jsxs("div",{className:"container mx-auto px-4 py-8",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("h1",{className:"text-4xl font-bold text-gradient mb-2",children:"Profile"}),a.jsx("p",{className:"text-xl text-muted-foreground",children:"Manage your organization details, team, and preferences"})]}),a.jsxs(Ac,{value:r,onValueChange:n,className:"space-y-6",children:[a.jsxs(ol,{className:"grid w-full grid-cols-7",children:[a.jsxs(Ot,{value:"organization",className:"flex items-center gap-2",children:[a.jsx(Ev,{className:"h-4 w-4"}),"Organization"]}),a.jsxs(Ot,{value:"contact",className:"flex items-center gap-2",children:[a.jsx(di,{className:"h-4 w-4"}),"Contact"]}),a.jsxs(Ot,{value:"account",className:"flex items-center gap-2",children:[a.jsx(Kl,{className:"h-4 w-4"}),"Account"]}),a.jsxs(Ot,{value:"preferences",className:"flex items-center gap-2",children:[a.jsx(eu,{className:"h-4 w-4"}),"Preferences"]}),a.jsxs(Ot,{value:"security",className:"flex items-center gap-2",children:[a.jsx(Os,{className:"h-4 w-4"}),"Security"]}),a.jsxs(Ot,{value:"team",className:"flex items-center gap-2",children:[a.jsx(Mr,{className:"h-4 w-4"}),"Team"]}),a.jsxs(Ot,{value:"history",className:"flex items-center gap-2",children:[a.jsx(Rq,{className:"h-4 w-4"}),"History"]})]}),a.jsx(Rt,{value:"organization",className:"space-y-6",children:a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Ev,{className:"h-5 w-5"}),"Organization Information"]}),o!=="organization"&&a.jsxs(U,{variant:"outline",onClick:()=>l("organization"),children:[a.jsx(kf,{className:"h-4 w-4 mr-2"}),"Edit"]})]})}),a.jsx(re,{className:"space-y-6",children:o==="organization"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"company_name",children:"Company Name *"}),a.jsx(ge,{id:"company_name",value:h.company_name,onChange:O=>m(k=>({...k,company_name:O.target.value})),placeholder:"Your Company Name"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"industry",children:"Industry / Sector"}),a.jsxs(Re,{value:h.industry,onValueChange:O=>m(k=>({...k,industry:O})),children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select industry"})}),a.jsx(Ie,{children:xTe.map(O=>a.jsx(ce,{value:O,children:O},O))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"business_type",children:"Size / Type"}),a.jsxs(Re,{value:h.business_type,onValueChange:O=>m(k=>({...k,business_type:O})),children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select business type"})}),a.jsx(Ie,{children:yTe.map(O=>a.jsx(ce,{value:O,children:O},O))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"website_url",children:"Website URL"}),a.jsx(ge,{id:"website_url",type:"url",value:h.website_url,onChange:O=>m(k=>({...k,website_url:O.target.value})),placeholder:"https://yourcompany.com"})]})]}),a.jsx(St,{}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Headquarters Location"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"city",children:"City"}),a.jsx(ge,{id:"city",value:h.headquarters_city,onChange:O=>m(k=>({...k,headquarters_city:O.target.value})),placeholder:"City"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"state",children:"State"}),a.jsx(ge,{id:"state",value:h.headquarters_state,onChange:O=>m(k=>({...k,headquarters_state:O.target.value})),placeholder:"State"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"country",children:"Country"}),a.jsx(ge,{id:"country",value:h.headquarters_country,onChange:O=>m(k=>({...k,headquarters_country:O.target.value})),placeholder:"Country"})]})]})]}),a.jsx(St,{}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Primary NAICS / PSC Codes"}),a.jsx("div",{className:"flex flex-wrap gap-2 mb-4",children:h.naics_codes.map((O,k)=>
829a.jsxs(ve,{variant:"secondary",className:"flex items-center gap-1",children:[O,a.jsx("button",{onClick:()=>se("naics_codes",O,!1),className:"ml-1 hover:text-destructive",children:"Ã"})]},k))}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ge,{placeholder:"Enter NAICS/PSC code",id:"naics-input"}),a.jsx(U,{type:"button",onClick:()=>{const O=document.getElementById("naics-input");O.value.trim()&&(se("naics_codes",O.value.trim(),!0),O.value="")},children:"Add"})]})]}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(U,{variant:"outline",onClick:H,children:"Cancel"}),a.jsx(U,{onClick:()=>K(),className:"bg-primary hover:bg-primary/90",children:"Save Changes"})]})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-sm font-medium text-muted-foreground",children:"Company Name"}),a.jsx("p",{className:"text-lg font-medium",children:h.company_name})]}),a.jsxs("div",{children:[a.jsx(Q,{className:"text-sm font-medium text-muted-foreground",children:"Industry / Sector"}),a.jsx("p",{className:"text-lg",children:h.industry})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-sm font-medium text-muted-foreground",children:"Business Type"}),a.jsx("p",{className:"text-lg",children:h.business_type})]}),a.jsxs("div",{children:[a.jsx(Q,{className:"text-sm font-medium text-muted-foreground",children:"Website"}),a.jsx("p",{className:"text-lg",children:a.jsx("a",{href:h.website_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:h.website_url})})]})]})]}),a.jsx(St,{}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Headquarters Location"}),a.jsxs("div",{className:"flex items-center gap-2 text-lg",children:[a.jsx(Ya,{className:"h-4 w-4 text-muted-foreground"}),a.jsxs("span",{children:[h.headquarters_city,", ",h.headquarters_state,", ",h.headquarters_country]})]})]}),a.jsx(St,{}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Primary NAICS / PSC Codes"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:h.naics_codes.map((O,k)=>a.jsx(ve,{variant:"outline",children:O},k))})]})]})})]})}),a.jsx(Rt,{value:"contact",className:"space-y-6",children:a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(di,{className:"h-5 w-5"}),"Point of Contact"]}),o!=="contact"&&a.jsxs(U,{variant:"outline",onClick:()=>l("contact"),children:[a.jsx(kf,{className:"h-4 w-4 mr-2"}),"Edit"]})]})}),a.jsx(re,{className:"space-y-6",children:o==="contact"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"full_name",children:"Full Name *"}),a.jsx(ge,{id:"full_name",value:h.full_name,onChange:O=>m(k=>({...k,full_name:O.target.value})),placeholder:"John Doe"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"title",children:"Title / Role"}),a.jsxs(Re,{value:h.title,onValueChange:O=>m(k=>({...k,title:O})),children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select title"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"ceo",children:"CEO"}),a.jsx(ce,{value:"capture_manager",children:"Capture Manager"}),a.jsx(ce,{value:"bid_manager",children:"Bid Manager"}),a.jsx(ce,{value:"business_dev",children:"Business Development"}),a.jsx(ce,{value:"contracts_manager",children:"Contracts Manager"}),a.jsx(ce,{value:"proposal_manager",children:"Proposal Manager"}),a.jsx(ce,{value:"other",children:"Other"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"email",children:"Email (Primary Notification) *"}),a.jsx(ge,{id:"email",type:"email",value:h.email,onChange:O=>m(k=>({...k,email:O.target.value})),placeholder:"[email protected]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"phone",children:"Phone Number"}),a.jsx(ge,{id:"phone",type:"tel",value:h.phone,onChange:O=>m(k=>({...k,phone:O.target.value})),placeholder:"+1 (555) 123-4567"})]}),a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[a.jsx(Q,{htmlFor:"communication",children:"Preferred Communication Method"}),a.jsxs(Re,{value:h.preferred_communication,onValueChange:O=>m(k=>({...k,preferred_communication:O})),children:[a.jsx(Me,{children:a.jsx(De,{})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"email",children:"Email"}),a.jsx(ce,{value:"phone",children:"Phone"}),a.jsx(ce,{value:"slack",children:"Slack"}),a.jsx(ce,{value:"teams",children:"Microsoft Teams"})]})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(U,{variant:"outline",onClick:H,children:"Cancel"}),a.jsx(U,{onClick:()=>K(),className:"bg-primary hover:bg-primary/90",children:"Save Changes"})]})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-sm font-medium text-muted-foreground",children:"Full Name"}),a.jsx("p",{className:"text-lg font-medium",children:h.full_name})]}),a.jsxs("div",{children:[a.jsx(Q,{className:"text-sm font-medium text-muted-foreground",children:"Title / Role"}),a.jsx("p",{className:"text-lg",children:ee(h.title)})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-sm font-medium text-muted-foreground",children:"Email"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(an,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("p",{className:"text-lg",children:h.email})]})]}),a.jsxs("div",{children:[a.jsx(Q,{className:"text-sm font-medium text-muted-foreground",children:"Phone Number"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ky,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("p",{className:"text-lg",children:h.phone})]})]})]})]}),a.jsx(St,{}),a.jsxs("div",{children:[a.jsx(Q,{className:"text-sm font-medium text-muted-foreground",children:"Preferred Communication Method"}),a.jsx("p",{className:"text-lg capitalize",children:h.preferred_communication})]})]})})]})}),a.jsx(Rt,{value:"account",className:"space-y-6",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Kl,{className:"h-5 w-5"}),"Billing Information"]}),o!=="billing"&&a.jsxs(U,{variant:"outline",onClick:()=>l("billing"),children:[a.jsx(kf,{className:"h-4 w-4 mr-2"}),"Edit"]})]})}),a.jsx(re,{className:"space-y-4",children:o==="billing"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"billing_contact",children:"Billing Contact Name"}),a.jsx(ge,{id:"billing_contact",value:h.billing_contact_name,onChange:O=>m(k=>({...k,billing_contact_name:O.target.value})),placeholder:"Billing contact name"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"billing_email",children:"Billing Email"}),a.jsx(ge,{id:"billing_email",type:"email",value:h.billing_contact_email,onChange:O=>m(k=>({...k,billing_contact_email:O.target.value})),placeholder:"[email protected]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"billing_phone",children:"Billing Phone"}),a.jsx(ge,{id:"billing_phone",type:"tel",value:h.billing_contact_phone,onChange:O=>m(k=>({...k,billing_contact_phone:O.target.value})),placeholder:"+1 (555) 123-4567"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"billing_address",children:"Billing Address"}),a.jsx(Qn,{id:"billing_address",value:h.billing_address,onChange:O=>m(k=>({...k,billing_address:O.target.value})),placeholder:"Full billing address",rows:3})]}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(U,{variant:"outline",onClick:H,children:"Cancel"}),a.jsx(U,{onClick:()=>K(),className:"bg-primary hover:bg-primary/90",children:"Save Changes"})]})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-sm font-medium text-muted-foreground",children:"Billing Contact"}),a.jsx("p",{className:"text-lg font-medium",children:h.billing_contact_name}),a.jsx("p",{className:"text-sm text-muted-foreground",children:h.billing_contact_email}),a.jsx("p",{className:"text-sm text-muted-foreground",children:h.billing_contact_phone})]}),a.jsxs("div",{children:[a.jsx(Q,{className:"text-sm font-medium text-muted-foreground",children:"Billing Address"}),a.jsx("p",{className:"text-sm whitespace-pre-line",children:h.billing_address})]})]})})]}),a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Os,{className:"h-5 w-5"}),"Subscription Details"]}
829)}),a.jsxs(re,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"Current Plan"}),a.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[a.jsxs("div",{children:[a.jsx("div",{className:"font-medium",children:"Pro Plan"}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"$500/year per seat"})]}),a.jsx(ve,{variant:"outline",children:"Active"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"Payment Method"}),a.jsxs("div",{className:"flex items-center gap-2 p-3 border rounded-lg",children:[a.jsx(Kl,{className:"h-4 w-4"}),a.jsx("span",{children:"â¢â¢â¢â¢ â¢â¢â¢â¢ â¢â¢â¢â¢ 4242"}),a.jsx("span",{className:"text-sm text-muted-foreground ml-auto",children:"Expires 12/27"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Q,{children:"Invoice History"}),a.jsxs(U,{variant:"outline",size:"sm",children:[a.jsx(kl,{className:"h-4 w-4 mr-2"}),"Download All"]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between p-2 border rounded",children:[a.jsx("span",{className:"text-sm",children:"January 2024 - $500.00"}),a.jsx(U,{variant:"ghost",size:"sm",children:a.jsx(kl,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-2 border rounded",children:[a.jsx("span",{className:"text-sm",children:"December 2023 - $500.00"}),a.jsx(U,{variant:"ghost",size:"sm",children:a.jsx(kl,{className:"h-4 w-4"})})]})]})]}),a.jsx(U,{variant:"outline",className:"w-full",onClick:T,disabled:y,children:y?"Opening...":"Manage Subscription"})]})]})]})}),a.jsx(Rt,{value:"preferences",className:"space-y-6",children:a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(eu,{className:"h-5 w-5"}),"Contracting Preferences"]}),o!=="preferences"&&a.jsxs(U,{variant:"outline",onClick:()=>l("preferences"),children:[a.jsx(kf,{className:"h-4 w-4 mr-2"}),"Edit"]})]})}),a.jsx(re,{className:"space-y-6",children:o==="preferences"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-base font-medium",children:"Typical Contract Types"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Select the contract types you typically pursue"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:bTe.map(O=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(On,{id:O,checked:h.contract_types.includes(O),onCheckedChange:k=>se("contract_types",O,k)}),a.jsx(Q,{htmlFor:O,className:"text-sm",children:O})]},O))})]}),a.jsx(St,{}),a.jsxs("div",{children:[a.jsx(Q,{className:"text-base font-medium",children:"Preferred Agencies"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Select agencies you typically work with"}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:wTe.map(O=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(On,{id:O,checked:h.preferred_agencies.includes(O),onCheckedChange:k=>se("preferred_agencies",O,k)}),a.jsx(Q,{htmlFor:O,className:"text-sm",children:O})]},O))})]}),a.jsx(St,{}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(Q,{className:"text-base font-medium",children:"Target Margins"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"margin_min",children:"Minimum %"}),a.jsx(ge,{id:"margin_min",type:"number",value:h.target_margin_min,onChange:O=>m(k=>({...k,target_margin_min:parseFloat(O.target.value)||0})),placeholder:"8",min:"0",max:"100"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"margin_max",children:"Maximum %"}),a.jsx(ge,{id:"margin_max",type:"number",value:h.target_margin_max,onChange:O=>m(k=>({...k,target_margin_max:parseFloat(O.target.value)||0})),placeholder:"15",min:"0",max:"100"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"report_delivery",children:"Report Delivery Preference"}),a.jsxs(Re,{value:h.report_delivery,onValueChange:O=>m(k=>({...k,report_delivery:O})),children:[a.jsx(Me,{children:a.jsx(De,{})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"email",children:"Email PDF Only"}),a.jsx(ce,{value:"dashboard",children:"Dashboard Only"}),a.jsx(ce,{value:"both",children:"Both Email & Dashboard"})]})]})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(U,{variant:"outline",onClick:H,children:"Cancel"}),a.jsx(U,{onClick:()=>K(),className:"bg-primary hover:bg-primary/90",children:"Save Changes"})]})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-base font-medium mb-3 block",children:"Contract Types"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:h.contract_types.map((O,k)=>
829a.jsx(ve,{variant:"outline",children:O},k))})]}),a.jsx(St,{}),a.jsxs("div",{children:[a.jsx(Q,{className:"text-base font-medium mb-3 block",children:"Preferred Agencies"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:h.preferred_agencies.map((O,k)=>a.jsx(ve,{variant:"outline",children:O},k))})]}),a.jsx(St,{}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-base font-medium",children:"Target Margins"}),a.jsxs("p",{className:"text-lg",children:[h.target_margin_min,"% - ",h.target_margin_max,"%"]})]}),a.jsxs("div",{children:[a.jsx(Q,{className:"text-base font-medium",children:"Report Delivery"}),a.jsx("p",{className:"text-lg capitalize",children:h.report_delivery.replace("_"," & ")})]})]})]})})]})}),a.jsx(Rt,{value:"security",className:"space-y-6",children:a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Os,{className:"h-5 w-5"}),"Security Settings"]})}),a.jsxs(re,{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Change Password"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Update your password to keep your account secure"}),a.jsxs("div",{className:"space-y-4 max-w-md",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"newPassword",children:"New Password"}),a.jsx(ge,{id:"newPassword",type:"password",value:c.newPassword,onChange:O=>d(k=>({...k,newPassword:O.target.value})),placeholder:"Enter new password"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"confirmPassword",children:"Confirm New Password"}),a.jsx(ge,{id:"confirmPassword",type:"password",value:c.confirmPassword,onChange:O=>d(k=>({...k,confirmPassword:O.target.value})),placeholder:"Confirm new password"})]}),a.jsx(U,{onClick:ne,disabled:u||!c.newPassword||!c.confirmPassword,className:"bg-primary hover:bg-primary/90",children:u?"Updating...":"Update Password"})]})]}),a.jsx(St,{}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Account Security"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Two-Factor Authentication"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Add an extra layer of security to your account"})]}),a.jsx(On,{disabled:!0})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Login Notifications"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Get notified when someone signs in to your account"})]}),a.jsx(On,{defaultChecked:!0})]})]})]})]})]})}),a.jsxs(Rt,{value:"team",className:"space-y-6",children:[a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Mr,{className:"h-5 w-5"}),"Team Members"]}),a.jsxs(rn,{open:_,onOpenChange:N,children:[a.jsx(hc,{asChild:!0,children:a.jsxs(U,{className:"bg-primary hover:bg-primary/90",children:[a.jsx(Xq,{className:"h-4 w-4 mr-2"}),"Invite Teammate"]})}),a.jsxs(Wr,{children:[a.jsx(Hr,{children:a.jsx(Vr,{children:"Invite Team Member"})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"member-name",children:"Name"}),a.jsx(ge,{id:"member-name",value:j.name,onChange:O=>S(k=>({...k,name:O.target.value})),placeholder:"Enter team member's name"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"member-email",children:"Email"}),a.jsx(ge,{id:"member-email",type:"email",value:j.email,onChange:O=>S(k=>({...k,email:O.target.value})),placeholder:"Enter team member's email"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"member-role",children:"Role"}),a.jsxs(Re,{value:j.role,onValueChange:O=>S(k=>({...k,role:O})),children:[a.jsx(Me,{children:a.jsx(De,{})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"admin",children:"Admin"}),a.jsx(ce,{value:"member",children:"Member"}),a.jsx(ce,{value:"viewer",children:"Viewer"})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(U,{variant:"outline",onClick:()=>N(!1),children:"Cancel"}),a.jsx(U,{onClick:B,children:"Send Invite"})]})]})]})]})]})}),a.jsx(re,{children:a.jsx("div",{className:"space-y-4",children:v.map(O=>a.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"w-10 h-10 bg-primary/10 rounded-full flex items-center justify-center",children:a.jsx(di,{className:"h-5 w-5 text-primary"})}),a.jsxs("div",{children:[a.jsx("div",{className:"font-medium",children:O.name}),a.jsx("div",{className:"text-sm text-muted-foreground",children:O.email}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:[O.role," ⢠Last login: ",O.last_login]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ve,{variant:O.status==="Active"?"default":"secondary",children:O.status}),O.status==="pending"&&a.jsx(U,{variant:"ghost",size:"sm",onClick:()=>V(O),title:"Resend invitation",children:a.jsx(va,{className:"h-4 w-4"})}),a.jsx(U,{variant:"ghost",size:"sm",onClick:()=>ie(O),children:a.jsx(kf,{className:"h-4 w-4"})}),a.jsx(U,{variant:"ghost",size:"sm",onClick:()=>W(O.id),children:a.jsx(tu,{className:"h-4 w-4"})})]})]},O.id))})})]}),a.jsx(rn,{open:C,onOpenChange:P,children:a.jsxs(Wr,{children:[a.jsx(Hr,{children:a.jsx(Vr,{children:"Edit Team Member"})}),A&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"edit-member-name",children:"Name"}),a.jsx(ge,{id:"edit-member-name",value:A.name,onChange:O=>D(k=>k?{...k,name:O.target.value}:null),placeholder:"Enter team member's name"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"edit-member-email",children:"Email"}),a.jsx(ge,{id:"edit-member-email",type:"email",value:A.email,onChange:O=>D(k=>k?{...k,email:O.target.value}:null),placeholder:"Enter team member's email"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"edit-member-role",children:"Role"}),a.jsxs(Re,{value:A.role,onValueChange:O=>D(k=>k?{...k,role:O}:null),children:[a.jsx(Me,{children:a.jsx(De,{})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"admin",children:"Admin"}),a.jsx(ce,{value:"member",children:"Member"}),a.jsx(ce,{value:"viewer",children:"Viewer"})]})]})]}),a.jsx(St,{}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"member-password",children:"Set Password for Login"}),a.jsx(ge,{id:"member-password",type:"password",value:F,onChange:O=>q(O.target.value),placeholder:"Enter password (min 6 characters)"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"This will create a login account for this team member. They can use their email and this password to log in."})]}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(U,{variant:"outline",onClick:()=>P(!1),children:"Cancel"}),a.jsx(U,{onClick:R,children:"Update Member"})]})]})]})})]}),a.jsx(Rt,{value:"history",className:"space-y-6",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(gt,{className:"h-5 w-5"}),"Reports Generated"]})}),a.jsx(re,{children:a.jsx("div",{className:"space-y-3",children:x.map(O=>a.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[a.jsxs("div",{children:[a.jsx("div",{className:"font-medium",children:O.title}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:[O.type," ⢠",new Date(O.created_at).toLocaleDateString()]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ve,{variant:"outline",children:O.status}),a.jsx(U,{variant:"ghost",size:"sm",children:a.jsx(ci,{className:"h-4 w-4"})}),a.jsx(U,{variant:"ghost",size:"sm",children:a.jsx(kl,{className:"h-4 w-4"})})]})]},O.id))})})]}),a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Jt,{className:"h-5 w-5"}),"Win/Loss Tracking"]})}),a.jsx(re,{children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold text-primary",children:"12"}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Submitted"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold text-green-600",children:"8"}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Won"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold text-red-600",children:"4"}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Lost"})]})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-lg font-semibold",children:"67% Win Rate"}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Based on opportunities tracked"})]})]})})]})]})})]})]})}):a.jsx(Gt,{children:a.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Please log in to access your profile"}),a.jsx(U,{onClick:()=>window.location.href="/login",children:"Go to Login"})]})})})}const NTe=()=>{it();const{isAdmin:e,loading:t}=al(),{toast:r}=dt(),[n,s]=g.useState([]),[i,o]=g.useState([]),[l,c]=g.useState({subscription:"all",minLogins:"",maxLogins:"",minBids:"",maxBids:"",industry:"all"}),[d,u]=g.useState({total_contracts:0,total_bids:0,active_users:0,monthly_usage:0});g.useEffect(()=>{e&&(f(),h())},[e]),g.useEffect(()=>{m()},[n,l]);const f=async()=>{try{const{data:p,error:x}=await lt.from("profiles").select("*").order("created_at",{ascending:!1});if(x)throw x;const b=await Promise.all((p||[]).map(async y=>{var j;const{count:w}=await lt.from("price_bids").select("*",{count:"exact",head:!0}
829).eq("user_id",y.user_id),{data:_}=await lt.from("contracts").select("industry").eq("user_id",y.user_id).order("created_at",{ascending:!1}).limit(1);let N={subscription_plan:"Free",subscription_status:"No subscription",subscription_price:"-"};try{const{data:S}=await lt.functions.invoke("check-user-subscription",{body:{userEmail:y.email}});S&&!S.error&&(N={subscription_plan:S.plan||"Free",subscription_status:S.status||"No subscription",subscription_price:S.price||"-"})}catch(S){console.error("Error fetching subscription for user:",y.email,S)}return{...y,bid_count:w||0,industry:((j=_==null?void 0:_[0])==null?void 0:j.industry)||"Unknown",first_name:y.first_name||"",last_name:y.last_name||"",login_count:y.login_count||0,...N}}));s(b)}catch(p){console.error("Error fetching users:",p),r({title:"Error",description:"Failed to load users",variant:"destructive"})}},h=async()=>{try{const{count:p}=await lt.from("contracts").select("*",{count:"exact",head:!0}),{count:x}=await lt.from("price_bids").select("*",{count:"exact",head:!0}),{count:b}=await lt.from("profiles").select("*",{count:"exact",head:!0}),y=new Date;y.setDate(1),y.setHours(0,0,0,0);const{count:w}=await lt.from("contracts").select("*",{count:"exact",head:!0}).gte("created_at",y.toISOString());u({total_contracts:p||0,total_bids:x||0,active_users:b||0,monthly_usage:w||0})}catch(p){console.error("Error fetching usage stats:",p)}},m=()=>{let p=[...n];l.subscription!=="all"&&(p=p.filter(x=>x.subscription_plan===l.subscription)),l.minLogins&&(p=p.filter(x=>x.login_count>=parseInt(l.minLogins))),l.maxLogins&&(p=p.filter(x=>x.login_count<=parseInt(l.maxLogins))),l.minBids&&(p=p.filter(x=>x.bid_count>=parseInt(l.minBids))),l.maxBids&&(p=p.filter(x=>x.bid_count<=parseInt(l.maxBids))),l.industry!=="all"&&(p=p.filter(x=>x.industry===l.industry)),o(p)},v=()=>{const p=["Email","Name","Company","Industry","Role","Login Count","Bid Count","Subscription","Status","Price"],x=i.map(N=>[N.email,`${N.first_name} ${N.last_name}`,N.company_name,N.industry,N.role,N.login_count,N.bid_count,N.subscription_plan,N.subscription_status,N.subscription_price]),b=[p,...x].map(N=>N.join(",")).join(` 830`),y=new Blob([b],{type:"text/csv"}),w=window.URL.createObjectURL(y),_=document.createElement("a");_.href=w,_.download=`users-export-${new Date().toISOString().split("T")[0]}.csv`,_.click()};return t?a.jsx(Gt,{children:a.jsx("div",{className:"flex items-center justify-center min-h-screen",children:a.jsx("p",{children:"Loading..."})})}):e?a.jsx(Gt,{children:a.jsxs("div",{className:"container mx-auto p-6 space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsx("h1",{className:"text-3xl font-bold",children:"User Management"})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs(J,{children:[a.jsxs(de,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(le,{className:"text-sm font-medium",children:"Active Users"}),a.jsx(Mr,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsx(re,{children:a.jsx("div",{className:"text-2xl font-bold",children:d.active_users})})]}),a.jsxs(J,{children:[a.jsxs(de,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(le,{className:"text-sm font-medium",children:"Total Contracts"}),a.jsx(Ev,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsx(re,{children:a.jsx("div",{className:"text-2xl font-bold",children:d.total_contracts})})]}),a.jsxs(J,{children:[a.jsxs(de,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(le,{className:"text-sm font-medium",children:"Total Bids"}),a.jsx($s,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsx(re,{children:a.jsx("div",{className:"text-2xl font-bold",children:d.total_bids})})]}),a.jsxs(J,{children:[a.jsxs(de,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(le,{className:"text-sm font-medium",children:"Monthly Usage"}),a.jsx($s,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsx(re,{children:a.jsx("div",{className:"text-2xl font-bold",children:d.monthly_usage})})]})]}),a.jsxs(J,{children:[a.jsxs(de,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs(le,{children:["All Users (",i.length,")"]}),a.jsx(nt,{children:"Manage user accounts and subscriptions"})]}),a.jsxs(U,{onClick:v,variant:"outline",children:[a.jsx(kl,{className:"h-4 w-4 mr-2"}),"Export CSV"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-6 gap-4 mt-4",children:[a.jsxs(Re,{value:l.subscription,onValueChange:p=>c({...l,subscription:p}),children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Subscription"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"all",children:"All Plans"}),a.jsx(ce,{value:"Free",children:"Free"}),a.jsx(ce,{value:"Basic",children:"Basic"}),a.jsx(ce,{value:"Pro",children:"Pro"}),a.jsx(ce,{value:"Enterprise",children:"Enterprise"})]})]}),a.jsx(ge,{placeholder:"Min Logins",type:"number",value:l.minLogins,onChange:p=>c({...l,minLogins:p.target.value})}),a.jsx(ge,{placeholder:"Max Logins",type:"number",value:l.maxLogins,onChange:p=>c({...l,maxLogins:p.target.value})}),a.jsx(ge,{placeholder:"Min Bids",type:"number",value:l.minBids,onChange:p=>c({...l,minBids:p.target.value})}),a.jsx(ge,{placeholder:"Max Bids",type:"number",value:l.maxBids,onChange:p=>c({...l,maxBids:p.target.value})}),a.jsxs(U,{variant:"outline",onClick:()=>c({subscription:"all",minLogins:"",maxLogins:"",minBids:"",maxBids:"",industry:"all"}),children:[a.jsx(qu,{className:"h-4 w-4 mr-2"}),"Clear"]})]})]}),a.jsx(re,{children:a.jsxs(Ec,{children:[a.jsx(Oc,{children:a.jsxs(xn,{children:[a.jsx(Ge,{children:"User"}),a.jsx(Ge,{children:"Company"}),a.jsx(Ge,{children:"Industry"}),a.jsx(Ge,{children:"Role"}),a.jsx(Ge,{children:"Logins"}),a.jsx(Ge,{children:"Bids"}),a.jsx(Ge,{children:"Subscription"}),a.jsx(Ge,{children:"Status"}),a.jsx(Ge,{children:"Price"}),a.jsx(Ge,{children:"Joined"})]})}),a.jsx(Tc,{children:i.map(p=>a.jsxs(xn,{children:[a.jsx(Ve,{children:a.jsxs("div",{children:[a.jsxs("div",{className:"font-medium",children:[p.first_name," ",p.last_name]}),a.jsx("div",{className:"text-sm text-muted-foreground",children:p.email})]})}),a.jsx(Ve,{children:p.company_name}),a.jsx(Ve,{children:p.industry}),a.jsx(Ve,{children:a.jsx(ve,{variant:"outline",children:p.role})}),a.jsx(Ve,{children:p.login_count}),a.jsx(Ve,{children:p.bid_count}),a.jsx(Ve,{children:a.jsx(ve,{children:p.subscription_plan})}),a.jsx(Ve,{children:a.jsx(ve,{variant:"secondary",children:p.subscription_status})}),a.jsx(Ve,{children:p.subscription_price}),a.jsx(Ve,{children:new Date(p.created_at).toLocaleDateString()})]}
830,p.id))})]})})]})]})}):a.jsx(Al,{to:"/dashboard",replace:!0})};function ct(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Jn(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function un(e,t){const r=ct(e);return isNaN(t)?Jn(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function os(e,t){const r=ct(e);if(isNaN(t))return Jn(e,NaN);if(!t)return r;const n=r.getDate(),s=Jn(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const i=s.getDate();return n>=i?s:(r.setFullYear(s.getFullYear(),s.getMonth(),n),r)}const aP=6048e5,STe=864e5;let _Te={};function Ap(){return _Te}function Ls(e,t){var l,c,d,u;const r=Ap(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=ct(e),i=s.getDay(),o=(i<n?7:0)+i-n;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function gc(e){return Ls(e,{weekStartsOn:1})}function QU(e){const t=ct(e),r=t.getFullYear(),n=Jn(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const s=gc(n),i=Jn(e,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const o=gc(i);return t.getTime()>=s.getTime()?r+1:t.getTime()>=o.getTime()?r:r-1}function Uo(e){const t=ct(e);return t.setHours(0,0,0,0),t}function sy(e){const t=ct(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Ps(e,t){const r=Uo(e),n=Uo(t),s=+r-sy(r),i=+n-sy(n);return Math.round((s-i)/STe)}function CTe(e){const t=QU(e),r=Jn(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),gc(r)}function zS(e,t){const r=t*7;return un(e,r)}function PTe(e,t){return os(e,t*12)}function kTe(e){let t;return e.forEach(function(r){const n=ct(r);(t===void 0||t<n||isNaN(Number(n)))&&(t=n)}),t||new Date(NaN)}function ATe(e){let t;return e.forEach(r=>{const n=ct(r);(!t||t>n||isNaN(+n))&&(t=n)}),t||new Date(NaN)}function Tn(e,t){const r=Uo(e),n=Uo(t);return+r==+n}function sP(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ETe(e){if(!sP(e)&&typeof e!="number")return!1;const t=ct(e);return!isNaN(Number(t))}function Vm(e,t){const r=ct(e),n=ct(t),s=r.getFullYear()-n.getFullYear(),i=r.getMonth()-n.getMonth();return s*12+i}function OTe(e,t,r){const n=Ls(e,r),s=Ls(t,r),i=+n-sy(n),o=+s-sy(s);return Math.round((i-o)/aP)}function SI(e){const t=ct(e);return t.setHours(23,59,59,999),t}function iP(e){const t=ct(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function Rn(e){const t=ct(e);return t.setDate(1),t.setHours(0,0,0,0),t}function JU(e){const t=ct(e),r=Jn(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function oP(e,t){var l,c,d,u;const r=Ap(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=ct(e),i=s.getDay(),o=(i<n?-7:0)+6-(i-n);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function ZU(e){return oP(e,{weekStartsOn:1})}const TTe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},MTe=(e,t,r)=>{let n;const s=TTe[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function tj(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const ITe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},$Te={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},RTe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},DTe={date:tj({formats:ITe,defaultWidth:"full"}),time:tj({formats:$Te,defaultWidth:"full"}),dateTime:tj({formats:RTe,defaultWidth:"full"})},LTe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},FTe=(e,t,r,n)=>LTe[e];function Hf(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):o;s=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;s=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const BTe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},zTe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},UTe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},WTe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
830ay","Saturday"]},HTe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},VTe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},qTe=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},GTe={ordinalNumber:qTe,era:Hf({values:BTe,defaultWidth:"wide"}),quarter:Hf({values:zTe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Hf({values:UTe,defaultWidth:"wide"}),day:Hf({values:WTe,defaultWidth:"wide"}),dayPeriod:Hf({values:HTe,defaultWidth:"wide",formattingValues:VTe,defaultFormattingWidth:"wide"})};function Vf(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;const o=i[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?YTe(l,f=>f.test(o)):KTe(l,f=>f.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=r.valueCallback?r.valueCallback(d):d;const u=t.slice(o.length);return{value:d,rest:u}}}function KTe(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function YTe(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function XTe(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=n[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=r.valueCallback?r.valueCallback(o):o;const l=t.slice(s.length);return{value:o,rest:l}}}const QTe=/^(\d+)(th|st|nd|rd)?/i,JTe=/\d+/i,ZTe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},eMe={any:[/^b/i,/^(a|c)/i]},tMe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},rMe={any:[/1/i,/2/i,/3/i,/4/i]},nMe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},aMe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},sMe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},iMe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},oMe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},lMe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},cMe={ordinalNumber:XTe({matchPattern:QTe,parsePattern:JTe,valueCallback:e=>parseInt(e,10)}),era:Vf({matchPatterns:ZTe,defaultMatchWidth:"wide",parsePatterns:eMe,defaultParseWidth:"any"}),quarter:Vf({matchPatterns:tMe,defaultMatchWidth:"wide",parsePatterns:rMe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Vf({matchPatterns:nMe,defaultMatchWidth:"wide",parsePatterns:aMe,defaultParseWidth:"any"}),day:Vf({matchPatterns:sMe,defaultMatchWidth:"wide",parsePatterns:iMe,defaultParseWidth:"any"}),dayPeriod:Vf({matchPatterns:oMe,defaultMatchWidth:"any",parsePatterns:lMe,defaultParseWidth:"any"})},e9={code:"en-US",formatDistance:MTe,formatLong:DTe,formatRelative:FTe,localize:GTe,match:cMe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function dMe(e){const t=ct(e);return Ps(t,JU(t))+1}function t9(e){const t=ct(e),r=+gc(t)-+CTe(t);return Math.round(r/aP)+1}function r9(e,t){var u,f,h,m;const r=ct(e),n=r.getFullYear(),s=Ap(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(h=s.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,o=Jn(e,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=Ls(o,t),c=Jn(e,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const d=Ls(c,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function uMe(e,t){var l,c,d,u;const r=Ap(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=r9(e,t),i=Jn(e,0);return i.setFullYear(s,0,n),i.setHours(0,0,0,0),Ls(i,t)}function n9(e,t){const r=ct(e),n=+Ls(r,t)-+uMe(r,t);return Math.round(n/aP)+1}function Nt(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const Wi={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Nt(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Nt(r+1,2)},d(e,t){return Nt(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return Nt(e.getHours()%12||12,t.length)},H(e,t){return Nt(e.getHours(),t.length)},m(e,t){return Nt(e.getMinutes(),t.length)},s(e,t){return Nt(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return Nt(s,t.length)}},Kc={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},_I={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return Wi.y(e,t)},Y:function(e,t,r,n){const s=r9(e,n),i=s>0?s:1-s;if(t==="YY"){const o=i%100;return Nt(o,2)}return t==="Yo"?r.ordinalNumber(i,{unit:"year"}):Nt(i,t.length)},R:function(e,t){const r=QU(e);return Nt(r,t.length)},u:function(e,t){const r=e.getFullYear();return Nt(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Nt(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Nt(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return Wi.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return Nt(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const s=n9(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):Nt(s,t.length)},I:function(e,t,r){const n=t9(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Nt(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Wi.d(e,t)},D:function(e,t,r){const n=dMe(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Nt(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const s=e.getDay(),i=(s-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Nt(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const s=e.getDay(),i=(s-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Nt(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),s=n===0?7:n;switch(t){case"i":return String(s);case"ii":return Nt(s,t.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let s;switch(n===12?s=Kc.noon:n===0?s=Kc.midnight:s=n/12>
vendor: 4,717 bytes, line 830
830=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let s;switch(n>=17?s=Kc.evening:n>=12?s=Kc.afternoon:n>=4?s=Kc.morning:s=Kc.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Wi.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Wi.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Nt(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Nt(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Wi.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Wi.s(e,t)},S:function(e,t){return Wi.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return PI(n);case"XXXX":case"XX":return jl(n);case"XXXXX":case"XXX":default:return jl(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return PI(n);case"xxxx":case"xx":return jl(n);case"xxxxx":case"xxx":default:return jl(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+CI(n,":");case"OOOO":default:return"GMT"+jl(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+CI(n,":");case"zzzz":default:return"GMT"+jl(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return Nt(n,t.length)},T:function(e,t,r){const n=e.getTime();return Nt(n,t.length)}};function CI(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Math.trunc(n/60),i=n%60;return i===0?r+String(s):r+String(s)+t+Nt(i,2)}function PI(e,t){return e%60===0?(e>0?"-":"+")+Nt(Math.abs(e)/60,2):jl(e,t)}function jl(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Nt(Math.trunc(n/60),2),i=Nt(n%60,2);return r+s+t+i}const kI=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},a9=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},fMe=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return kI(e,t);let i;switch(n){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",kI(n,t)).replace("{{time}}",a9(s,t))},hMe={p:a9,P:fMe},mMe=/^D+$/,pMe=/^Y+$/,gMe=["D","DD","YY","YYYY"];function vMe(e){return mMe.test(e)}function xMe(e){return pMe.test(e)}function yMe(e,t,r){const n=bMe(e,t,r);if(console.warn(n),gMe.includes(e))throw new RangeError(n)}function bMe(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const wMe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,jMe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,NMe=/^'([^]*?)'?$/,SMe=/''/g,_Me=/[a-zA-Z]/;function bt(e,t,r){var u,f,h,m,v,p,x,b;const n=Ap(),s=(r==null?void 0:r.locale)??n.locale??e9,i=(r==null?void 0:r.firstWeekContainsDate)??((f=(u=r==null?void 0:r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??n.firstWeekContainsDate??((m=(h=n.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,o=(r==null?void 0:r.weekStartsOn)??((p=(v=r==null?void 0:r.locale)==null?void 0:v.options)==null?void 0:p.weekStartsOn)??n.weekStartsOn??((b=(x=n.locale)==null?void 0:x.options)==null?void 0:b.weekStartsOn)??0,l=ct(e);if(!ETe(l))throw new RangeError("Invalid time value");let c=t.match(jMe).map(y=>{const w=y[0];if(w==="p"||w==="P"){const _=hMe[w];return _(y,s.formatLong)}return y}).join("").match(wMe).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const w=y[0];if(w==="'")return{isToken:!1,value:CMe(y)};if(_I[w])return{isToken:!0,value:y};
830if(w.match(_Me))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:y}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return c.map(y=>{if(!y.isToken)return y.value;const w=y.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&xMe(w)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&vMe(w))&&yMe(w,t,String(e));const _=_I[w[0]];return _(l,w,s.localize,d)}).join("")}function CMe(e){const t=e.match(NMe);return t?t[1].replace(SMe,"'"):e}function PMe(e){const t=ct(e),r=t.getFullYear(),n=t.getMonth(),s=Jn(e,0);return s.setFullYear(r,n+1,0),s.setHours(0,0,0,0),s.getDate()}function kMe(e){return Math.trunc(+ct(e)/1e3)}function AMe(e){const t=ct(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(0,0,0,0),t}function EMe(e,t){return OTe(AMe(e),Rn(e),t)+1}function US(e,t){const r=ct(e),n=ct(t);return r.getTime()>n.getTime()}function s9(e,t){const r=ct(e),n=ct(t);return+r<+n}function lP(e,t){const r=ct(e),n=ct(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function OMe(e,t){const r=ct(e),n=ct(t);return r.getFullYear()===n.getFullYear()}function av(e,t){return un(e,-t)}function rj(e,t){const r=ct(e),n=r.getFullYear(),s=r.getDate(),i=Jn(e,0);i.setFullYear(n,t,15),i.setHours(0,0,0,0);const o=PMe(i);return r.setMonth(t,Math.min(s,o)),r}function AI(e,t){const r=ct(e);return isNaN(+r)?Jn(e,NaN):(r.setFullYear(t),r)}var Ue=function(){return Ue=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ue.apply(this,arguments)};function TMe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function i9(e,t,r){for(var n=0,s=t.length,i;n<s;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function Ep(e){return e.mode==="multiple"}function Op(e){return e.mode==="range"}function m0(e){return e.mode==="single"}var MMe={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function IMe(e,t){return bt(e,"LLLL y",t)}function $Me(e,t){return bt(e,"d",t)}function RMe(e,t){return bt(e,"LLLL",t)}function DMe(e){return"".concat(e)}function LMe(e,t){return bt(e,"cccccc",t)}function FMe(e,t){return bt(e,"yyyy",t)}var BMe=Object.freeze({__proto__:null,formatCaption:IMe,formatDay:$Me,formatMonthCaption:RMe,formatWeekNumber:DMe,formatWeekdayName:LMe,formatYearCaption:FMe}),zMe=function(e,t,r){return bt(e,"do MMMM (EEEE)",r)},UMe=function(){return"Month: "},WMe=function(){return"Go to next month"},HMe=function(){return"Go to previous month"},VMe=function(e,t){return bt(e,"cccc",t)},qMe=function(e){return"Week n. ".concat(e)},GMe=function(){return"Year: "},KMe=Object.freeze({__proto__:null,labelDay:zMe,labelMonthDropdown:UMe,labelNext:WMe,labelPrevious:HMe,labelWeekNumber:qMe,labelWeekday:VMe,labelYearDropdown:GMe});function YMe(){var e="buttons",t=MMe,r=e9,n={},s={},i=1,o={},l=new Date;return{captionLayout:e,classNames:t,formatters:BMe,labels:KMe,locale:r,modifiersClassNames:n,modifiers:s,numberOfMonths:i,styles:o,today:l,mode:"default"}}function XMe(e){var t=e.fromYear,r=e.toYear,n=e.fromMonth,s=e.toMonth,i=e.fromDate,o=e.toDate;return n?i=Rn(n):t&&(i=new Date(t,0,1)),s?o=iP(s):r&&(o=new Date(r,11,31)),{fromDate:i?Uo(i):void 0,toDate:o?Uo(o):void 0}}var o9=g.createContext(void 0);function QMe(e){var t,r=e.initialProps,n=YMe(),s=XMe(r),i=s.fromDate,o=s.toDate,l=(t=r.captionLayout)!==null&&t!==void 0?t:n.captionLayout;l!=="buttons"&&(!i||!o)&&(l="buttons");var c;(m0(r)||Ep(r)||Op(r))&&(c=r.onSelect);var d=Ue(Ue(Ue({},n),r),{captionLayout:l,classNames:Ue(Ue({},n.classNames),r.classNames),components:Ue({},r.components),formatters:Ue(Ue({},n.formatters),r.formatters),fromDate:i,labels:Ue(Ue({},n.labels),r.labels),mode:r.mode||n.mode,modifiers:Ue(Ue({},n.modifiers),r.modifiers),modifiersClassNames:Ue(Ue({},n.modifiersClassNames),r.modifiersClassNames),onSelect:c,styles:Ue(Ue({},n.styles),r.styles),toDate:o});return a.jsx(o9.Provider,{value:d,children:e.children})}function Bt(){var e=g.useContext(o9);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function l9(e){var t=Bt(),r=t.locale,n=t.classNames,s=t.styles,i=t.formatters.formatCaption;return a.jsx("div",{className:n.caption_label,style:s.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:r})})}function JMe(e){return a.jsx("svg",Ue({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:a.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.7
83078175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function c9(e){var t,r,n=e.onChange,s=e.value,i=e.children,o=e.caption,l=e.className,c=e.style,d=Bt(),u=(r=(t=d.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&r!==void 0?r:JMe;return a.jsxs("div",{className:l,style:c,children:[a.jsx("span",{className:d.classNames.vhidden,children:e["aria-label"]}),a.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:s,onChange:n,children:i}),a.jsxs("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true",children:[o,a.jsx(u,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})]})]})}function ZMe(e){var t,r=Bt(),n=r.fromDate,s=r.toDate,i=r.styles,o=r.locale,l=r.formatters.formatMonthCaption,c=r.classNames,d=r.components,u=r.labels.labelMonthDropdown;if(!n)return a.jsx(a.Fragment,{});if(!s)return a.jsx(a.Fragment,{});var f=[];if(OMe(n,s))for(var h=Rn(n),m=n.getMonth();m<=s.getMonth();m++)f.push(rj(h,m));else for(var h=Rn(new Date),m=0;m<=11;m++)f.push(rj(h,m));var v=function(x){var b=Number(x.target.value),y=rj(Rn(e.displayMonth),b);e.onChange(y)},p=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:c9;return a.jsx(p,{name:"months","aria-label":u(),className:c.dropdown_month,style:i.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:o}),children:f.map(function(x){return a.jsx("option",{value:x.getMonth(),children:l(x,{locale:o})},x.getMonth())})})}
830function eIe(e){var t,r=e.displayMonth,n=Bt(),s=n.fromDate,i=n.toDate,o=n.locale,l=n.styles,c=n.classNames,d=n.components,u=n.formatters.formatYearCaption,f=n.labels.labelYearDropdown,h=[];if(!s)return a.jsx(a.Fragment,{});if(!i)return a.jsx(a.Fragment,{});for(var m=s.getFullYear(),v=i.getFullYear(),p=m;p<=v;p++)h.push(AI(JU(new Date),p));var x=function(y){var w=AI(Rn(r),Number(y.target.value));e.onChange(w)},b=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:c9;return a.jsx(b,{name:"years","aria-label":f(),className:c.dropdown_year,style:l.dropdown_year,onChange:x,value:r.getFullYear(),caption:u(r,{locale:o}),children:h.map(function(y){return a.jsx("option",{value:y.getFullYear(),children:u(y,{locale:o})},y.getFullYear())})})}function tIe(e,t){var r=g.useState(e),n=r[0],s=r[1],i=t===void 0?n:t;return[i,s]}function rIe(e){var t=e.month,r=e.defaultMonth,n=e.today,s=t||r||n||new Date,i=e.toDate,o=e.fromDate,l=e.numberOfMonths,c=l===void 0?1:l;if(i&&Vm(i,s)<0){var d=-1*(c-1);s=os(i,d)}return o&&Vm(s,o)<0&&(s=o),Rn(s)}function nIe(){var e=Bt(),t=rIe(e),r=tIe(t,e.month),n=r[0],s=r[1],i=function(o){var l;if(!e.disableNavigation){var c=Rn(o);s(c),(l=e.onMonthChange)===null||l===void 0||l.call(e,c)}};return[n,i]}function aIe(e,t){for(var r=t.reverseMonths,n=t.numberOfMonths,s=Rn(e),i=Rn(os(s,n)),o=Vm(i,s),l=[],c=0;c<o;c++){var d=os(s,c);l.push(d)}return r&&(l=l.reverse()),l}function sIe(e,t){if(!t.disableNavigation){var r=t.toDate,n=t.pagedNavigation,s=t.numberOfMonths,i=s===void 0?1:s,o=n?i:1,l=Rn(e);if(!r)return os(l,o);var c=Vm(r,e);if(!(c<i))return os(l,o)}}function iIe(e,t){if(!t.disableNavigation){var r=t.fromDate,n=t.pagedNavigation,s=t.numberOfMonths,i=s===void 0?1:s,o=n?i:1,l=Rn(e);if(!r)return os(l,-o);var c=Vm(l,r);if(!(c<=0))return os(l,-o)}}var d9=g.createContext(void 0);function oIe(e){var t=Bt(),r=nIe(),n=r[0],s=r[1],i=aIe(n,t),o=sIe(n,t),l=iIe(n,t),c=function(f){return i.some(function(h){return lP(f,h)})},d=function(f,h){c(f)||(h&&s9(f,h)?s(os(f,1+t.numberOfMonths*-1)):s(f))},u={currentMonth:n,displayMonths:i,goToMonth:s,goToDate:d,previousMonth:l,nextMonth:o,isDateDisplayed:c};return a.jsx(d9.Provider,{value:u,children:e.children})}function Tp(){var e=g.useContext(d9);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function EI(e){var t,r=Bt(),n=r.classNames,s=r.styles,i=r.components,o=Tp().goToMonth,l=function(u){o(os(u,e.displayIndex?-e.dis
830playIndex:0))},c=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:l9,d=a.jsx(c,{id:e.id,displayMonth:e.displayMonth});return a.jsxs("div",{className:n.caption_dropdowns,style:s.caption_dropdowns,children:[a.jsx("div",{className:n.vhidden,children:d}),a.jsx(ZMe,{onChange:l,displayMonth:e.displayMonth}),a.jsx(eIe,{onChange:l,displayMonth:e.displayMonth})]})}function lIe(e){return a.jsx("svg",Ue({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:a.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function cIe(e){return a.jsx("svg",Ue({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:a.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var iy=g.forwardRef(function(e,t){var r=Bt(),n=r.classNames,s=r.styles,i=[n.button_reset,n.button];e.className&&i.push(e.className);var o=i.join(" "),l=Ue(Ue({},s.button_reset),s.button);return e.style&&Object.assign(l,e.style),a.jsx("button",Ue({},e,{ref:t,type:"button",className:o,style:l}))});function dIe(e){var t,r,n=Bt(),s=n.dir,i=n.locale,o=n.classNames,l=n.styles,c=n.labels,d=c.labelPrevious,u=c.labelNext,f=n.components;if(!e.nextMonth&&!e.previousMonth)return a.jsx(a.Fragment,{});var h=d(e.previousMonth,{locale:i}),m=[o.nav_button,o.nav_button_previous].join(" "),v=u(e.nextMonth,{locale:i}),p=[o.nav_button,o.nav_button_next].join(" "),x=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:cIe,b=(r=f==null?void 0:f.IconLeft)!==null&&r!==void 0?r:lIe;return a.jsxs("div",{className:o.nav,style:l.nav,children:[!e.hidePrevious&&a.jsx(iy,{name:"previous-month","aria-label":h,className:m,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:s==="rtl"?a.jsx(x,{className:o.nav_icon,style:l.nav_icon}):a.jsx(b,{className:o.nav_icon,style:l.nav_icon})}),!e.hideNext&&a.jsx(iy,{name:"next-month","aria-label":v,className:p,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:s==="rtl"?a.jsx(b,{className:o.nav_icon,style:l.nav_icon}):a.jsx(x,{className:o.nav_icon,style:l.nav_icon})})]})}function OI(e){var t=Bt().numberOfMonths,r=Tp(),n=r.previousMonth,s=r.nextMonth,i=r.goToMonth,o=r.displayMonths,l=o.findIndex(function(v){return lP(e.displayMonth,v)}),c=l===0,d=l===o.length-1,u=t>1&&(c||!d),f=t>1&&(d||!c),h=function(){n&&i(n)},m=function(){s&&i(s)};return a.jsx(dIe,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:f,nextMonth:s,previousMonth:n,onPreviousClick:h,onNextClick:m})}function uIe(e){var t,r=Bt(),n=r.classNames,s=r.disableNavigation,i=r.styles,o=r.captionLayout,l=r.components,c=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:l9,d;return s?d=a.jsx(c,{id:e.id,displayMonth:e.displayMonth}):o==="dropdown"?d=a.jsx(EI,{displayMonth:e.displayMonth,id:e.id}):o==="dropdown-buttons"?d=a.jsxs(a.Fragment,{children:[a.jsx(EI,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),a.jsx(OI,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):d=a.jsxs(a.Fragment,{children:[a.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),a.jsx(OI,{displayMonth:e.displayMonth,id:e.id})]}),a.jsx("div",{className:n.caption,style:i.caption,children:d})}function fIe(e){var t=Bt(),r=t.footer,n=t.styles,s=t.classNames.tfoot;return r?a.jsx("tfoot",{className:s,style:n.tfoot,children:a.jsx("tr",{children:a.jsx("td",{colSpan:8,children:r})})}):a.jsx(a.Fragment,{})}function hIe(e,t,r){for(var n=r?gc(new Date):Ls(new Date,{locale:e,weekStartsOn:t}),s=[],i=0;i<7;i++){var o=un(n,i);s.push(o)}return s}function mIe(){var e=Bt(),t=e.classNames,r=e.styles,n=e.showWeekNumber,s=e.locale,i=e.weekStartsOn,o=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,d=hIe(s,i,o);return a.jsxs("tr",{style:r.head_row,className:t.head_row,children:[n&&a.jsx("td",{style:r.head_cell,className:t.head_cell}),d.map(function(u,f){return a.jsx("th",{scope:"col",className:t.head_cell,style:r.head_cell,"aria-label":c(u,{locale:s}),children:l(u,{locale:s})},f)})]})}function pIe(){var e,t=Bt(),r=t.classNames,n=t.styles,s=t.components,i=(e=s==null?void 0:s.HeadRow)!==null&&e!==void 0?e:mIe;return a.jsx("thead",{style:n.head,className:r.head,children:a.jsx(i,{})})}function gIe(e){var t=Bt(),r=t.locale,n=t.formatters.formatDay;return a.jsx(a.Fragment,{children:n(e.date,{locale:r})})}var cP=g.createContext(void 0);function vIe(e){if(!Ep(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return a.jsx(cP.Provider,{value:t,children:e.children})}return a.jsx(xIe,{initialProps:e.initialProps,children:e.children})}function xIe(e){var t=e.initialProps,r=e.children,n=t.selected,s=t.min,i=t.max,o=function(d,u,f){var h,m;(h=t.onDayClick)===null||h===void 0||h.call(t,d,u,f);var v=!!(u.selected&&s&&(n==null?void 0:n.length)===s);if(!v){var p=!!(!u.selected&&i&&(n==null?void 0:n.length)===i);if(!p){var x=n?i9([],n):[];if(u.selected){var b=x.findIndex(function(y){return Tn(d,y)});x.splice(b,1)}else x.push(d);(m=t.onSelect)===null||m===void 0||m.call(t,x,d,u,f)}}},l={disabled:[]};n&&l.disabled.push(function(d){var u=i&&n.length>i-1,f=n.some(function(h){return Tn(h,d)});return!!(u&&!f)});
830var c={selected:n,onDayClick:o,modifiers:l};return a.jsx(cP.Provider,{value:c,children:r})}function dP(){var e=g.useContext(cP);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function yIe(e,t){var r=t||{},n=r.from,s=r.to;return n&&s?Tn(s,e)&&Tn(n,e)?void 0:Tn(s,e)?{from:s,to:void 0}:Tn(n,e)?void 0:US(n,e)?{from:e,to:s}:{from:n,to:e}:s?US(e,s)?{from:s,to:e}:{from:e,to:s}:n?s9(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}var uP=g.createContext(void 0);function bIe(e){if(!Op(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return a.jsx(uP.Provider,{value:t,children:e.children})}return a.jsx(wIe,{initialProps:e.initialProps,children:e.children})}function wIe(e){var t=e.initialProps,r=e.children,n=t.selected,s=n||{},i=s.from,o=s.to,l=t.min,c=t.max,d=function(m,v,p){var x,b;(x=t.onDayClick)===null||x===void 0||x.call(t,m,v,p);var y=yIe(m,n);(b=t.onSelect)===null||b===void 0||b.call(t,y,m,v,p)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],o?(u.range_end=[o],Tn(i,o)||(u.range_middle=[{after:i,before:o}])):u.range_end=[i]):o&&(u.range_start=[o],u.range_end=[o]),l&&(i&&!o&&u.disabled.push({after:av(i,l-1),before:un(i,l-1)}),i&&o&&u.disabled.push({after:i,before:un(i,l-1)}),!i&&o&&u.disabled.push({after:av(o,l-1),before:un(o,l-1)})),c){if(i&&!o&&(u.disabled.push({before:un(i,-c+1)}),u.disabled.push({after:un(i,c-1)})),i&&o){var f=Ps(o,i)+1,h=c-f;u.disabled.push({before:av(i,h)}),u.disabled.push({after:un(o,h)})}!i&&o&&(u.disabled.push({before:un(o,-c+1)}),u.disabled.push({after:un(o,c-1)}))}return a.jsx(uP.Provider,{value:{selected:n,onDayClick:d,modifiers:u},children:r})}function fP(){var e=g.useContext(uP);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function sv(e){return Array.isArray(e)?i9([],e):e!==void 0?[e]:[]}function jIe(e){var t={};return Object.entries(e).forEach(function(r){var n=r[0],s=r[1];t[n]=sv(s)}),t}var ls;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(ls||(ls={}));var NIe=ls.Selected,Gs=ls.Disabled,SIe=ls.Hidden,_Ie=ls.Today,nj=ls.RangeEnd,aj=ls.RangeMiddle,sj=ls.RangeStart,CIe=ls.Outside;function PIe(e,t,r){var n,s=(n={},n[NIe]=sv(e.selected),n[Gs]=sv(e.disabled),n[SIe]=sv(e.hidden),n[_Ie]=[e.today],n[nj]=[],n[aj]=[],n[sj]=[],n[CIe]=[],n);return e.fromDate&&s[Gs].push({before:e.fromDate}),e.toDate&&s[Gs].push({after:e.toDate}),Ep(e)?s[Gs]=s[Gs].concat(t.modifiers[Gs]):Op(e)&&(s[Gs]=s[Gs].concat(r.modifiers[Gs]),s[sj]=r.modifiers[sj],s[aj]=r.modifiers[aj],s[nj]=r.modifiers[nj]),s}var u9=g.createContext(void 0);function kIe(e){var t=Bt(),r=dP(),n=fP(),s=PIe(t,r,n),i=jIe(t.modifiers),o=Ue(Ue({},s),i);return a.jsx(u9.Provider,{value:o,children:e.children})}function f9(){var e=g.useContext(u9);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function AIe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function EIe(e){return!!(e&&typeof e=="object"&&"from"in e)}function OIe(e){return!!(e&&typeof e=="object"&&"after"in e)}function TIe(e){return!!(e&&typeof e=="object"&&"before"in e)}function MIe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function IIe(e,t){var r,n=t.from,s=t.to;if(n&&s){var i=Ps(s,n)<0;i&&(r=[s,n],n=r[0],s=r[1]);var o=Ps(e,n)>=0&&Ps(s,e)>=0;return o}return s?Tn(s,e):n?Tn(n,e):!1}function $Ie(e){return sP(e)}function RIe(e){return Array.isArray(e)&&e.every(sP)}function DIe(e,t){return t.some(function(r){if(typeof r=="boolean")return r;if($Ie(r))return Tn(e,r);if(RIe(r))return r.includes(e);if(EIe(r))return IIe(e,r);if(MIe(r))return r.dayOfWeek.includes(e.getDay());if(AIe(r)){var n=Ps(r.before,e),s=Ps(r.after,e),i=n>0,o=s<0,l=US(r.before,r.after);return l?o&&i:i||o}return OIe(r)?Ps(e,r.after)>0:TIe(r)?Ps(r.before,e)>0:typeof r=="function"?r(e):!1})}function hP(e,t,r){var n=Object.keys(t).reduce(function(i,o){var l=t[o];return DIe(e,l)&&i.push(o),i},[]),s={};
830return n.forEach(function(i){return s[i]=!0}),r&&!lP(e,r)&&(s.outside=!0),s}function LIe(e,t){for(var r=Rn(e[0]),n=iP(e[e.length-1]),s,i,o=r;o<=n;){var l=hP(o,t),c=!l.disabled&&!l.hidden;if(!c){o=un(o,1);continue}if(l.selected)return o;l.today&&!i&&(i=o),s||(s=o),o=un(o,1)}return i||s}var FIe=365;function h9(e,t){var r=t.moveBy,n=t.direction,s=t.context,i=t.modifiers,o=t.retry,l=o===void 0?{count:0,lastFocused:e}:o,c=s.weekStartsOn,d=s.fromDate,u=s.toDate,f=s.locale,h={day:un,week:zS,month:os,year:PTe,startOfWeek:function(x){return s.ISOWeek?gc(x):Ls(x,{locale:f,weekStartsOn:c})},endOfWeek:function(x){return s.ISOWeek?ZU(x):oP(x,{locale:f,weekStartsOn:c})}},m=h[r](e,n==="after"?1:-1);n==="before"&&d?m=kTe([d,m]):n==="after"&&u&&(m=ATe([u,m]));var v=!0;if(i){var p=hP(m,i);v=!p.disabled&&!p.hidden}return v?m:l.count>FIe?l.lastFocused:h9(m,{moveBy:r,direction:n,context:s,modifiers:i,retry:Ue(Ue({},l),{count:l.count+1})})}var m9=g.createContext(void 0);function BIe(e){var t=Tp(),r=f9(),n=g.useState(),s=n[0],i=n[1],o=g.useState(),l=o[0],c=o[1],d=LIe(t.displayMonths,r),u=s??(l&&t.isDateDisplayed(l))?l:d,f=function(){c(s),i(void 0)},h=function(x){i(x)},m=Bt(),v=function(x,b){if(s){var y=h9(s,{moveBy:x,direction:b,context:m,modifiers:r});Tn(s,y)||(t.goToDate(y,s),h(y))}},p={focusedDay:s,focusTarget:u,blur:f,focus:h,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}};return a.jsx(m9.Provider,{value:p,children:e.children})}function mP(){var e=g.useContext(m9);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function zIe(e,t){var r=f9(),n=hP(e,r,t);return n}var pP=g.createContext(void 0);function UIe(e){if(!m0(e.initialProps)){var t={selected:void 0};return a.jsx(pP.Provider,{value:t,children:e.children})}return a.jsx(WIe,{initialProps:e.initialProps,children:e.children})}function WIe(e){var t=e.initialProps,r=e.children,n=function(i,o,l){var c,d,u;if((c=t.onDayClick)===null||c===void 0||c.call(t,i,o,l),o.selected&&!t.required){(d=t.onSelect)===null||d===void 0||d.call(t,void 0,i,o,l);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,o,l)},s={selected:t.selected,onDayClick:n};return a.jsx(pP.Provider,{value:s,children:r})}function p9(){var e=g.useContext(pP);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function HIe(e,t){var r=Bt(),n=p9(),s=dP(),i=fP(),o=mP(),l=o.focusDayAfter,c=o.focusDayBefore,d=o.focusWeekAfter,u=o.focusWeekBefore,f=o.blur,h=o.focus,m=o.focusMonthBefore,v=o.focusMonthAfter,p=o.focusYearBefore,x=o.focusYearAfter,b=o.focusStartOfWeek,y=o.focusEndOfWeek,w=function(M){var T,L,K,H;m0(r)?(T=n.onDayClick)===null||T===void 0||T.call(n,e,t,M):Ep(r)?(L=s.onDayClick)===null||L===void 0||L.call(s,e,t,M):Op(r)?(K=i.onDayClick)===null||K===void 0||K.call(i,e,t,M):(H=r.onDayClick)===null||H===void 0||H.call(r,e,t,M)},_=function(M){var T;h(e),(T=r.onDayFocus)===null||T===void 0||T.call(r,e,t,M)},N=function(M){var T;f(),(T=r.onDayBlur)===null||T===void 0||T.call(r,e,t,M)},j=function(M){var T;(T=r.onDayMouseEnter)===null||T===void 0||T.call(r,e,t,M)},S=function(M){var T;(T=r.onDayMouseLeave)===null||T===void 0||T.call(r,e,t,M)},C=function(M){var T;(T=r.onDayPointerEnter)===null||T===void 0||T.call(r,e,t,M)},P=function(M){var T;(T=r.onDayPointerLeave)===null||T===void 0||T.call(r,e,t,M)},A=function(M){var T;(T=r.onDayTouchCancel)===null||T===void 0||T.call(r,e,t,M)},D=function(M){var T;(T=r.onDayTouchEnd)===null||T===void 0||T.call(r,e,t,M)},F=function(M){var T;(T=r.onDayTouchMove)===null||T===void 0||T.call(r,e,t,M)},q=function(M){var T;(T=r.onDayTouchStart)===null||T===void 0||T.call(r,e,t,M)},B=function(M){var T;(T=r.onDayKeyUp)===null||T===void 0||T.call(r,e,t,M)},V=function(M){var T;switch(M.key){case"ArrowLeft":M.preventDefault(),M.stopPropagation(),r.dir==="rtl"?l(
830):c();break;case"ArrowRight":M.preventDefault(),M.stopPropagation(),r.dir==="rtl"?c():l();break;case"ArrowDown":M.preventDefault(),M.stopPropagation(),d();break;case"ArrowUp":M.preventDefault(),M.stopPropagation(),u();break;case"PageUp":M.preventDefault(),M.stopPropagation(),M.shiftKey?p():m();break;case"PageDown":M.preventDefault(),M.stopPropagation(),M.shiftKey?x():v();break;case"Home":M.preventDefault(),M.stopPropagation(),b();break;case"End":M.preventDefault(),M.stopPropagation(),y();break}(T=r.onDayKeyDown)===null||T===void 0||T.call(r,e,t,M)},E={onClick:w,onFocus:_,onBlur:N,onKeyDown:V,onKeyUp:B,onMouseEnter:j,onMouseLeave:S,onPointerEnter:C,onPointerLeave:P,onTouchCancel:A,onTouchEnd:D,onTouchMove:F,onTouchStart:q};return E}function VIe(){var e=Bt(),t=p9(),r=dP(),n=fP(),s=m0(e)?t.selected:Ep(e)?r.selected:Op(e)?n.selected:void 0;return s}function qIe(e){return Object.values(ls).includes(e)}function GIe(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(n){var s=e.modifiersClassNames[n];if(s)r.push(s);else if(qIe(n)){var i=e.classNames["day_".concat(n)];i&&r.push(i)}}),r}function KIe(e,t){var r=Ue({},e.styles.day);return Object.keys(t).forEach(function(n){var s;r=Ue(Ue({},r),(s=e.modifiersStyles)===null||s===void 0?void 0:s[n])}),r}function YIe(e,t,r){var n,s,i,o=Bt(),l=mP(),c=zIe(e,t),d=HIe(e,c),u=VIe(),f=!!(o.onDayCl
830ick||o.mode!=="default");g.useEffect(function(){var j;c.outside||l.focusedDay&&f&&Tn(l.focusedDay,e)&&((j=r.current)===null||j===void 0||j.focus())},[l.focusedDay,e,r,f,c.outside]);var h=GIe(o,c).join(" "),m=KIe(o,c),v=!!(c.outside&&!o.showOutsideDays||c.hidden),p=(i=(s=o.components)===null||s===void 0?void 0:s.DayContent)!==null&&i!==void 0?i:gIe,x=a.jsx(p,{date:e,displayMonth:t,activeModifiers:c}),b={style:m,className:h,children:x,role:"gridcell"},y=l.focusTarget&&Tn(l.focusTarget,e)&&!c.outside,w=l.focusedDay&&Tn(l.focusedDay,e),_=Ue(Ue(Ue({},b),(n={disabled:c.disabled,role:"gridcell"},n["aria-selected"]=c.selected,n.tabIndex=w||y?0:-1,n)),d),N={isButton:f,isHidden:v,activeModifiers:c,selectedDays:u,buttonProps:_,divProps:b};return N}function XIe(e){var t=g.useRef(null),r=YIe(e.date,e.displayMonth,t);return r.isHidden?a.jsx("div",{role:"gridcell"}):r.isButton?a.jsx(iy,Ue({name:"day",ref:t},r.buttonProps)):a.jsx("div",Ue({},r.divProps))}function QIe(e){var t=e.number,r=e.dates,n=Bt(),s=n.onWeekNumberClick,i=n.styles,o=n.classNames,l=n.locale,c=n.labels.labelWeekNumber,d=n.formatters.formatWeekNumber,u=d(Number(t),{locale:l});if(!s)return a.jsx("span",{className:o.weeknumber,style:i.weeknumber,children:u});var f=c(Number(t),{locale:l}),h=function(m){s(t,r,m)};return a.jsx(iy,{name:"week-number","aria-label":f,className:o.weeknumber,style:i.weeknumber,onClick:h,children:u})}function JIe(e){var t,r,n=Bt(),s=n.styles,i=n.classNames,o=n.showWeekNumber,l=n.components,c=(t=l==null?void 0:l.Day)!==null&&t!==void 0?t:XIe,d=(r=l==null?void 0:l.WeekNumber)!==null&&r!==void 0?r:QIe,u;return o&&(u=a.jsx("td",{className:i.cell,style:s.cell,children:a.jsx(d,{number:e.weekNumber,dates:e.dates})})),a.jsxs("tr",{className:i.row,style:s.row,children:[u,e.dates.map(function(f){return a.jsx("td",{className:i.cell,style:s.cell,role:"presentation",children:a.jsx(c,{displayMonth:e.displayMonth,date:f})},kMe(f))})]})}function TI(e,t,r){for(var n=r!=null&&r.ISOWeek?ZU(t):oP(t,r),s=r!=null&&r.ISOWeek?gc(e):Ls(e,r),i=Ps(n,s),o=[],l=0;l<=i;l++)o.push(un(s,l));var c=o.reduce(function(d,u){var f=r!=null&&r.ISOWeek?t9(u):n9(u,r),h=d.find(function(m){return m.weekNumber===f});return h?(h.dates.push(u),d):(d.push({weekNumber:f,dates:[u]}),d)},[]);return c}function ZIe(e,t){var r=TI(Rn(e),iP(e),t);if(t!=null&&t.useFixedWeeks){var n=EMe(e,t);if(n<6){var s=r[r.length-1],i=s.dates[s.dates.length-1],o=zS(i,6-n),l=TI(zS(i,1),o,t);r.push.apply(r,l)}}return r}function e$e(e){var t,r,n,s=Bt(),i=s.locale,o=s.classNames,l=s.styles,c=s.hideHead,d=s.fixedWeeks,u=s.components,f=s.weekStartsOn,h=s.firstWeekContainsDate,m=s.ISOWeek,v=ZIe(e.displayMonth,{useFixedWeeks:!!d,ISOWeek:m,locale:i,weekStartsOn:f,firstWeekContainsDate:h}),p=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:pIe,x=(r=u==null?void 0:u.Row)!==null&&r!==void 0?r:JIe,b=(n=u==null?void 0:u.Footer)!==null&&n!==void 0?n:fIe;return a.jsxs("table",{id:e.id,className:o.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&a.jsx(p,{}),a.jsx("tbody",{className:o.tbody,style:l.tbody,children:v.map(function(y){return a.jsx(x,{displayMonth:e.displayMonth,dates:y.dates,weekNumber:y.weekNumber},y.weekNumber)})}),a.jsx(b,{displayMonth:e.displayMonth})]})}function t$e(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var r$e=t$e()?g.useLayoutEffect:g.useEffect,ij=!1,n$e=0;function MI(){return"react-day-picker-".concat(++n$e)}function a$e(e){var t,r=e??(ij?MI():null),n=g.useState(r),s=n[0],i=n[1];return r$e(function(){s===null&&i(MI())},[]),g.useEffect(function(){ij===!1&&(ij=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function s$e(e){var t,r,n=Bt(),s=n.dir,i=n.classNames,o=n.styles,l=n.components,c=Tp().displayMonths,d=a$e(n.id?"".concat(n.id,"-").concat(e.displayIndex):void 0),u=n.id?"".concat(n.id,"-grid-").concat(e.displayIndex):void 0,f=[i.month],h=o.month,m=e.displayIndex===0,v=e.displayIndex===c.length-1,p=!m&&!v;s==="rtl"&&(t=[m,v],v=t[0],m=t[1]),m&&(f.push(i.caption_start),h=Ue(Ue({},h),o.caption_start)),v&&(f.push(i.caption_end),h=Ue(Ue({},h),o.caption_end)),p&&(f.push(i.caption_between),h=Ue(Ue({},h),o.caption_between));var x=(r=l==null?void 0:l.Caption)!==null&&r!==void 0?r:uIe;return a.jsxs("div",{className:f.join(" "),style:h,children:[a.jsx(x,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),a.jsx(e$e,{id:u,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function i$e(e){var t=Bt(),r=t.classNames,n=t.styles;return a.jsx("div",{className:r.months,style:n.months,children:e.children})}function o$e(e){var t,r,n=e.initialProps,s=Bt(),i=mP(),o=Tp(),l=g.useState(!1),c=l[0],d=l[1];g.useEffect(function(){s.initialFocus&&i.focusTarget&&(c||(i.focus(i.focusTarget),d(!0)))},[s.initialFocus,c,i.focus,i.focusTarget,i]);var u=[s.classNames.root,s.className];s.numberOfMonths>1&&u.push(s.classNames.multiple_months),s.showWeekNumber&&u.push(s.classNames.with_weeknumber);var f=Ue(Ue({},s.styles.root),s.style),h=Object.keys(n).filter(function(v){return v.startsWith("data-")}).reduce(function(v,p){var x;return Ue(Ue({},v),(x={},x[p]=n[p],x))},{}),m=(r=(t=n.components)===null||t===void 0?void 0:t.Months)!==null&&r!==void 0?r:i$e;return a.jsx("div",Ue({className:u.join(" "),style:f,dir:s.dir,id:s.id,nonce:n.nonce,title:n.title,lang:n.lang},h,{children:a.jsx(m,{children:o.displayMonths.map(function(v,p){return a.jsx(s$e,{displayIndex:p,displayMonth:v},p)})})}))}function l$e(e){var t=e.children,r=TMe(e,["children"]);return a.jsx(QMe,{initialProps:r,children:a.jsx(oIe,{children:a.jsx(UIe,{initialProps:r,children:a.jsx(vIe,{initialProps:r,children:a.jsx(bIe,{initialProps:r,children:a.jsx(kIe,{children:a.jsx(BIe,{children:t})})})})})})})}function c$e(e){return a.jsx(l$e,Ue({},e,{children:a.jsx(o$e,{initialProps:e})}))}function gP({className:e,classNames:t,showOutsideDays:r=!0,...n}){return a.jsx(c$e,{showOutsideDays:r,className:me("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:sp
830ace-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:me(Rm({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:me(Rm({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...s})=>a.jsx(u1,{className:"h-4 w-4"}),IconRight:({...s})=>a.jsx(Zd,{className:"h-4 w-4"})},...n})}gP.displayName="Calendar";const d$e=({recipients:e,onClose:t,initialSubject:r,initialBody:n})=>{const{toast:s}=dt(),{user:i}=it(),[o,l]=g.useState(null),[c,d]=g.useState(""),[u,f]=g.useState(r||""),[h,m]=g.useState(n||""),[v,p]=g.useState(""),[x,b]=g.useState(),[y,w]=g.useState("09:00"),[_,N]=g.useState(!1),[j,S]=g.useState(!1),[C,P]=g.useState(!1),[A,D]=g.useState("modern"),[F,q]=g.useState("Learn More"),[B,V]=g.useState(""),[E,M]=g.useState(""),[T,L]=g.useState([]);g.useEffect(()=>{K()},[]);const K=async()=>{if(!i)return;const{data:R,error:O}=await Z.from("campaigns").select("id, name, subject, body, sms_body, campaign_type").or(`user_id.eq.${i.id},organization_id.eq.${i.id}`).order("created_at",{ascending:!1}).limit(10);!O&&R&&L(R)},H=R=>{const O=T.find(k=>k.id===R);O&&(f(O.subject||""),m(O.body||""),p(O.sms_body||""),s({title:"Template loaded",description:`Content from "${O.name}" has been loaded`}))},ee=async()=>{const R=o==="email",O=R?h:v;if(!c.trim()||R&&!u.trim()||!O.trim()){s({title:"Missing information",description:`Please fill in campaign name${R?", subject":""} and message`,variant:"destructive"});return}try{const{error:k}=await Z.from("campaigns").insert({name:c.trim(),subject:R?u.trim():"",body:R?h.trim():"",sms_body:R?null:v.trim(),campaign_type:o,recipients:e,status:"draft",user_id:i==null?void 0:i.id,organization_id:i==null?void 0:i.id});if(k)throw k;s({title:"Draft saved",description:"Your campaign has been saved as a draft"}),t()}catch(k){s({title:"Error",description:k.message,variant:"destructive"})}},se=async()=>{if(e.length===0){s({title:"No recipients selected",description:"Please select leads from the table before scheduling a campaign",variant:"destructive"});return}const R=o==="email",O=R?h:v;if(!c.trim()||R&&!u.trim()||!O.trim()||!x){s({title:"Missing information",description:"Please fill in all fields including schedule date",variant:"destructive"});return}const[k,G]=y.split(":").map(Number),te=new Date(x);if(te.setHours(k,G,0,0),te<=new Date){s({title:"Invalid date",description:"Please select a future date and time",variant:"destructive"});return}try{const{error:$}=await Z.from("campaigns").insert({name:c.trim(),subject:R?u.trim():"",body:R?h.trim():"",sms_body:R?null:v.trim(),campaign_type:o,recipients:e,status:"scheduled",scheduled_for:te.toISOString(),user_id:i==null?void 0:i.id,organization_id:i==null?void 0:i.id});if($)throw $;s({title:"Campaign scheduled",description:`Will be sent on ${bt(te,"PPP 'at' p")}`}),t()}catch($){s({title:"Error",description:$.message,variant:"destructive"})}},ne=async()=>{P(!0);try{const R=e.length>0?e.map(te=>({name:te.name,company:te.company})):[{name:"potential customer",company:"their organization"}],O=o==="email"?h.trim():v.trim(),{data:k,error:G}=await Z.functions.invoke("generate-sales-message",{body:{recipients:R,messageType:
830o==="email"?"email":"sms",existingContent:O||void 0}});if(G)throw G;o==="email"?m(k.message):p(k.message),s({title:"Message generated!",description:`AI has ${O?"enhanced your":"created a"} ${o==="email"?"email":"SMS"} message`})}catch(R){console.error("Error generating message:",R),s({title:"Error",description:R.message||"Failed to generate message",variant:"destructive"})}finally{P(!1)}},W=async()=>{const R=o==="email",O=R?h:v;if(R&&!u.trim()||!O.trim()){s({title:"Missing information",description:`Please fill in ${R?"subject and":""} message`,variant:"destructive"});return}const k=E.trim()||(i==null?void 0:i.email);if(!k){s({title:"No email address",description:"Please enter a test email address or make sure you're logged in",variant:"destructive"});return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(k)){s({title:"Invalid email",description:"Please enter a valid email address",variant:"destructive"});return}S(!0);try{if(R){const te=[{email:k,name:"Test User",company:"Test Company"}],{data:$,error:ae}=await Z.from("campaigns").insert({name:`Test - ${u.trim()}`,subject:u.trim(),body:h.trim(),campaign_type:"email",recipients:te,status:"sending",user_id:i==null?void 0:i.id,organization_id:i==null?void 0:i.id}).select().single();if(ae)throw ae;const{data:oe,error:z}=await Z.functions.invoke("send-email-campaign",{body:{campaignId:$.id,recipients:te,subject:u.trim(),body:h.trim(),template:A,ctaText:F,ctaUrl:B}});if(z)throw z;await Z.from("campaigns").update({status:"sent",sent_at:new Date().toISOString(),sent_count:oe.sent,failed_count:oe.failed,results:oe.results}).eq("id",$.id),s({title:"Test email sent!",description:`Check ${k} for your test email`})}else s({title:"SMS test not available",description:"SMS testing requires a phone number. Use email for testing.",variant:"destructive"})}catch(te){s({title:"Error sending test",description:te.message,variant:"destructive"})}finally{S(!1)}},ie=async()=>{if(console.log("Recipients before validation:",e),e.length===0){s({title:"No recipients selected",description:"Please select leads from the table before sending a campaign",variant:"destructive"});return}const R=e.filter(G=>G.email&&G.name&&G.company);if(console.log("Valid recipients after filtering:",R),R.length===0){s({title:"No valid recipients",description:"Selected leads are missing required information (email, name, or company). Please update the lead data before sending.",variant:"destructive"});return}const O=o==="email",k=O?h:v;if(!c.trim()||O&&!u.trim()||!k.trim()){s({title:"Missing information",description:`Please fill in campaign name${O?", subject":""} and message`,variant:"destructive"});return}if(O){if(u.length>200||h.length>5e3){s({title:"Content too long",description:"Subject must be â¤200 chars, body â¤5000 chars",variant:"destructive"});return}}else{if(v.length>1600){s({title:"Content too long",description:"SMS message must be â¤1600 characters",variant:"destructive"});return}if(R.filter(te=>te.phone).length===0){s({title:"No phone numbers",description:"Selected recipients don't have phone numbers",variant:"destructive"});return}}N(!0),console.log("Final valid recipients count:",R.length),s({title:"Starting campaign...",description:`Sending to ${R.length} valid recipients. This will run in the background.`});try{const{data:G,error:te}=await Z.from("campaigns").insert({name:c.trim(),subject:O?u.trim():"",body:O?h.trim():"",sms_body:O?null:v.trim(),campaign_type:o,recipients:R,status:"sending",user_id:i==null?void 0:i.id,organization_id:i==null?void 0:i.id}).select().single();if(te)throw te;const $=O?"send-email-campaign":"send-sms-campaign",ae=O?{campaignId:G.id,recipients:R,subject:u.trim(),body:h.trim(),template:A,ctaText:F,ctaUrl:B}:{campaignId:G.id,recipients:R,message:v.trim()},{data:oe,error:z}=await Z.functions.invoke($,{body:ae});if(z)throw z;await Z.from("campaigns").update({status:"sent",sent_at:new Date().toISOString(),sent_count:oe.sent,failed_count:oe.failed,results:oe.results}).eq("id",G.id),s({title:"Campaign sent!",description:`${oe.sent} ${O?"emails":"messages"} sent, ${oe.failed} failed`}),t()}catch(G){s({title:"Error",description:G.message,variant:"destructive"})}finally{N(!1)}};return o?a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[o==="email"?a.jsx(an,{className:"h-5 w-5"}):a.jsx(m1,{className:"h-5 w-5"}),a.jsxs("h3",{className:"font-semibold",children:[o==="email"?"Email":"SMS"," Campaign"]})]}),a.jsx(U,{variant:"ghost",size:"sm",onClick:()=>l(null),children:"Change Type"})]}),T.length>0&&a.jsxs("div",{className:"space-y-2 p-4 bg-muted/50 rounded-lg border border-border",children:[a.jsxs(Q,{className:"flex items-center gap-2",children:[a.jsx(Aq,{className:"h-4 w-4"}),"Copy from Previous Campaign"]}),a.jsxs(Re,{onValueChange:H,children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select a campaign to copy content from..."})}),a.jsx(Ie,{children:T.map(R=>a.jsxs(ce,{value:R.id,children:[R.name," - ",R.campaign_type==="sms"?"SMS":"Email"]},R.id))})]})]}),a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"campaign-name",children:"Campaign Name"}),a.jsx(ge,{id:"campaign-name",placeholder:"e.g., Q1 2024 Outreach",value:c,onChange:R=>d(R.target.value)})]}),o==="email"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"email-template",children:"Email Template"}),a.jsxs(Re,{value:A,onValueChange:D,children:[a.jsx(Me,{children:a.jsx(De,{})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"none",children:"No template - Plain text email"}),a.jsx(ce,{value:"modern",children:"Modern - Clean and professional"}),a.jsx(ce,{value:"bold",children:"Bold - Eye-catching design"}),a.jsx(ce,{value:"minimal",children:"Minimal - Simple and elegant"}),a.jsx(ce,{value:"newsletter",children:"Newsletter - Perfect for updates"})]})]})]}),a.jsxs("div",{children:[a.jsxs(Q,{htmlFor:"email-subject",children:["Email Subject (",u.length,"/200)"]}),a.jsx(ge,{id:"email-subject",placeholder:"Enter email subject...",value:u,onChange:R=>f(R.target.value.slice(0,200)),spellCheck:!0})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs(Q,{htmlFor:"email-body",children:["Email Message (",h.length,"/5000)"]}),a.jsxs(U,{type:"button",variant:"outline",size:"sm",onClick:ne,disabled:C,children:[a.jsx(ph,{className:"mr-2 h-4 w-4"}),C?"Generating...":"AI Generate"]})]}),a.jsx(Qn,{id:"email-body",placeholder:"Enter your email message or use AI to generate one...",value:h,onChange:R=>m(R.target.value.slice(0,5e3)),rows:8,disabled:!1,className:"resize-none",spellCheck:!0}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Emails sent with 2-second delay between each (max 50 recipients)"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"cta-text",children:"Call-to-Action Button Text"}),a.jsxs(Re,{value:F,onValueChange:q,children:[a.jsx(Me,{children:a.jsx(De,{})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"Learn More",children:"Learn More"}),a.jsx(ce,{value:"Buy Now",children:"Buy Now"}),a.jsx(ce,{value:"Get Started",children:"Get Started"}),a.jsx(ce,{value:"Select Plan",children:"Select Plan"}),a.jsx(ce,{value:"View Pricing",children:"View Pricing"}),a.jsx(ce,{value:"Schedule Demo",children:"Schedule Demo"}),a.jsx(ce,{value:"Contact Us",children:"Contact Us"})]})]})]}),a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"cta-url",children:"Button Link URL"}),a.jsx(ge,{id:"cta-url",placeholder:"https://pricebid.com/plans",value:
830B,onChange:R=>V(R.target.value)})]})]}),a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"test-email",children:"Test Email Address (Optional)"}),a.jsx(ge,{id:"test-email",type:"email",placeholder:(i==null?void 0:i.email)||"Enter email for testing...",value:E,onChange:R=>M(R.target.value)}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Leave blank to send test to ",(i==null?void 0:i.email)||"your account email"]})]})]}):a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs(Q,{htmlFor:"sms-body",children:["SMS Message (",v.length,"/1600)"]}),a.jsxs(U,{type:"button",variant:"outline",size:"sm",onClick:ne,disabled:C,children:[a.jsx(ph,{className:"mr-2 h-4 w-4"}),C?"Generating...":"AI Generate"]})]}),a.jsx(Qn,{id:"sms-body",placeholder:"Enter your SMS message... Use {name} and {company} for personalization.",value:v,onChange:R=>p(R.target.value.slice(0,1600)),rows:6,spellCheck:!0}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"SMS sent with 1-second delay between each (max 50 recipients)"}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Recipients with phone: ",e.filter(R=>R.phone).length,"/",e.length]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Q,{children:"Schedule Date"}),a.jsxs(Wm,{children:[a.jsx(Hm,{asChild:!0,children:a.jsxs(U,{variant:"outline",className:me("w-full justify-start text-left font-normal",!x&&"text-muted-foreground"),children:[a.jsx(Br,{className:"mr-2 h-4 w-4"}),x?bt(x,"PPP"):"Pick a date"]})}),a.jsx(Bu,{className:"w-auto p-0",align:"start",children:a.jsx(gP,{mode:"single",selected:x,onSelect:b,disabled:R=>R<new Date,initialFocus:!0,className:"p-3 pointer-events-auto"})})]})]}),a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"schedule-time",children:"Time (Your Local Timezone)"}),a.jsxs(Re,{value:y,onValueChange:w,children:[a.jsx(Me,{id:"schedule-time",children:a.jsx(De,{})}),a.jsx(Ie,{children:Array.from({length:24},(R,O)=>{const k=O.toString().padStart(2,"0");return a.jsxs(ce,{value:`${k}:00`,children:[k,":00"]},k)})})]}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Timezone: ",Intl.DateTimeFormat().resolvedOptions().timeZone]})]})]}),a.jsxs("div",{className:"flex gap-2 pt-4",children:[o==="email"&&a.jsxs(U,{onClick:W,disabled:_||j,variant:"secondary",children:[a.jsx(Yq,{className:"mr-2 h-4 w-4"}),j?"Sending...":"Send Test"]}),a.jsxs(U,{onClick:ie,disabled:_||j,className:"flex-1",children:[a.jsx(va,{className:"mr-2 h-4 w-4"}),"Send Now"]}),a.jsxs(U,{onClick:se,disabled:_||j,variant:"outline",className:"flex-1",children:[a.jsx(Br,{className:"mr-2 h-4 w-4"}),"Schedule"]}),a.jsxs(U,{onClick:ee,disabled:_||j,variant:"outline",children:[a.jsx(YR,{className:"mr-2 h-4 w-4"}),"Save Draft"]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:[e.length," recipient(s) selected",o==="email"&&(i==null?void 0:i.email)&&a.jsxs(a.Fragment,{children:[" ⢠Test email will be sent to ",i.email]})]})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"text-center mb-6",children:[a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Choose Campaign Type"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Select how you want to reach your leads"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(J,{className:"cursor-pointer hover:border-primary transition-all",onClick:()=>l("email"),children:a.jsxs(re,{className:"flex flex-col items-center justify-center p-6 space-y-3",children:[a.jsx(an,{className:"h-12 w-12 text-primary"}),a.jsxs("div",{className:"text-center",children:[a.jsx("h4",{className:"font-semibold",children:"Email Campaign"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Send personalized emails to your leads"})]})]})}),a.jsx(J,{className:"cursor-pointer hover:border-primary transition-all",onClick:()=>l("sms"),children:a.jsxs(re,{className:"flex flex-col items-center justify-center p-6 space-y-3",children:[a.jsx(m1,{className:"h-12 w-12 text-primary"}),a.jsxs("div",{className:"text-center",children:[a.jsx("h4",{className:"font-semibold",children:"SMS Campaign"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Send text messages via Twilio"})]})]})})]}),a.jsxs("p",{className:"text-xs text-muted-foreground text-center mt-4",children:[e.length," recipient(s) selected"]})]})};var vP="Progress",xP=100,[u$e,CRe]=ir(vP),[f$e,h$e]=u$e(vP),g9=g.forwardRef((e,t)=>
830{const{__scopeProgress:r,value:n=null,max:s,getValueLabel:i=m$e,...o}=e;(s||s===0)&&!II(s)&&console.error(p$e(`${s}`,"Progress"));const l=II(s)?s:xP;n!==null&&!$I(n,l)&&console.error(g$e(`${n}`,"Progress"));const c=$I(n,l)?n:null,d=oy(c)?i(c,l):void 0;return a.jsx(f$e,{scope:r,value:c,max:l,children:a.jsx(we.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":oy(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":y9(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});g9.displayName=vP;var v9="ProgressIndicator",x9=g.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,s=h$e(v9,r);return a.jsx(we.div,{"data-state":y9(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...n,ref:t})});x9.displayName=v9;function m$e(e,t){return`${Math.round(e/t*100)}%`}function y9(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function oy(e){return typeof e=="number"}function II(e){return oy(e)&&!isNaN(e)&&e>0}function $I(e,t){return oy(e)&&!isNaN(e)&&e<=t&&e>=0}function p$e(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${xP}\`.`}function g$e(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: 831 - a positive number 832 - less than the value passed to \`max\` (or ${xP} if no \`max\` prop is set) 833 - \`null\` or \`undefined\` if the progress is indeterminate. 834 835Defaulting to \`null\`.`}var b9=g9,v$e=x9;const Qa=g.forwardRef(({className:e,value:t,...r},n)=>a.jsx(b9,{ref:n,className:me("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:a.jsx(v$e,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Qa.displayName=b9.displayName;var w9="AlertDialog",[x$e,PRe]=ir(w9,[DB]),$i=DB(),j9=e=>{const{__scopeAlertDialog:t,...r}=e,n=$i(t);return a.jsx(R2,{...n,...r,modal:!0})};j9.displayName=w9;var y$e="AlertDialogTrigger",b$e=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=$i(r);return a.jsx(D2,{...s,...n,ref:t})});b$e.displayName=y$e;var w$e="AlertDialogPortal",N9=e=>{const{__scopeAlertDialog:t,...r}=e,n=$i(t);return a.jsx(L2,{...n,...r})};N9.displayName=w$e;var j$e="AlertDialogOverlay",S9=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=$i(r);return a.jsx(wp,{...s,...n,ref:t})});S9.displayName=j$e;var Md="AlertDialogContent",[N$e,S$e]=x$e(Md),_$e=xR("AlertDialogContent"),_9=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,i=$i(r),o=g.useRef(null),l=Te(t,o),c=g.useRef(null);return a.jsx($ke,{contentName:Md,titleName:C9,docsSlug:"alert-dialog",children:a.jsx(N$e,{scope:r,cancelRef:c,children:a.jsxs(jp,{role:"alertdialog",...i,...s,ref:l,onOpenAutoFocus:pe(s.onOpenAutoFocus,d=>{var u;d.preventDefault(),(u=c.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[a.jsx(_$e,{children:n}),a.jsx(P$e,{contentRef:o})]})})})});_9.displayName=Md;var C9="AlertDialogTitle",P9=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=$i(r);return a.jsx(Np,{...s,...n,ref:t})});P9.displayName=C9;var k9="AlertDialogDescription",A9=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=$i(r);return a.jsx(Sp,{...s,...n,ref:t})});A9.displayName=k9;var C$e="AlertDialogAction",E9=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=$i(r);return a.jsx(Zb,{...s,...n,ref:t})});E9.displayName=C$e;var O9="AlertDialogCancel",T9=g.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=S$e(O9,r),i=$i(r),o=Te(t,s);return a.jsx(Zb,{...i,...n,ref:o})});T9.displayName=O9;var P$e=({contentRef:e})=>{const t=`\`${Md}\` requires a description for the component to be accessible for screen reader users. 836 837You can add a description to the \`${Md}\` by passing a \`${k9}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 838 839Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Md}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 840 841For more information, see https://radix-ui.com/primitives/docs/components/
841alert-dialog`;return g.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},k$e=j9,A$e=N9,M9=S9,I9=_9,$9=E9,R9=T9,D9=P9,L9=A9;const E$e=k$e,O$e=A$e,F9=g.forwardRef(({className:e,...t},r)=>a.jsx(M9,{className:me("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));F9.displayName=M9.displayName;const B9=g.forwardRef(({className:e,...t},r)=>a.jsxs(O$e,{children:[a.jsx(F9,{}),a.jsx(I9,{ref:r,className:me("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));B9.displayName=I9.displayName;const z9=({className:e,...t})=>a.jsx("div",{className:me("flex flex-col space-y-2 text-center sm:text-left",e),...t});z9.displayName="AlertDialogHeader";const U9=({className:e,...t})=>a.jsx("div",{className:me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});U9.displayName="AlertDialogFooter";const W9=g.forwardRef(({className:e,...t},r)=>a.jsx(D9,{ref:r,className:me("text-lg font-semibold",e),...t}));W9.displayName=D9.displayName;const H9=g.forwardRef(({className:e,...t},r)=>a.jsx(L9,{ref:r,className:me("text-sm text-muted-foreground",e),...t}));H9.displayName=L9.displayName;const V9=g.forwardRef(({className:e,...t},r)=>a.jsx($9,{ref:r,className:me(Rm(),e),...t}));V9.displayName=$9.displayName;const q9=g.forwardRef(({className:e,...t},r)=>a.jsx(R9,{ref:r,className:me(Rm({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));q9.displayName=R9.displayName;const T$e=()=>{const[e,t]=g.useState(!1),[r,n]=g.useState(!1),[s,i]=g.useState([]),[o,l]=g.useState(""),[c,d]=g.useState(!1),[u,f]=g.useState([]),[h,m]=g.useState([]),[v,p]=g.useState(!0),x=async()=>{d(!0);try{const{data:j,error:S}=await Z.from("campaigns").select("id, name, subject, sent_count, failed_count, created_at, recipients").order("created_at",{ascending:!1}).limit(20);if(S)throw S;i(j||[])}catch(j){console.error("Error loading campaigns:",j),We.error("Failed to load campaigns")}finally{d(!1)}},b=async(j,S=v)=>{const C=s.find(P=>P.id===j);if(C!=null&&C.recipients){const P=Array.isArray(C.recipients)?C.recipients:[],{data:A}=await Z.from("campaign_deliveries").select("recipient_email, status").eq("campaign_id",j).in("status",["delivered","sent"]),D=new Set((A==null?void 0:A.map(B=>B.recipient_email.toLowerCase()))||[]);console.log(`Campaign has ${P.length} total recipients, ${D.size} already delivered`);const q=(S?P.filter(B=>!D.has(B.email.toLowerCase())):P).map(B=>({...B,alreadyDelivered:D.has(B.email.toLowerCase())}));console.log(`Showing ${q.length} recipients (excludeDelivered: ${S})`),f(q),m([])}},y=async()=>{if(!o){We.error("Please select a campaign");return}if(h.length===0){We.error("Please select at least one recipient");return}n(!0);try{const j=u.filter(P=>h.includes(P.email)).map(P=>P.email),{data:S,error:C}=await Z.functions.invoke("send-now",{body:{campaignId:o,selectedEmails:j}});if(C)throw C;We.success(`Campaign sent to ${h.length} recipients!`),t(!1),l(""),m([])}catch(j){console.error("Resend error:",j),We.error(`Failed to resend: ${j.message}`)}finally{n(!1)}},w=j=>{m(S=>S.includes(j)?S.filter(C=>C!==j):[...S,j])},_=()=>{m(u.map(j=>j.email))},N=()=>{m([])};return a.jsxs(rn,{open:e,onOpenChange:j=>{t(j),j&&x()},children:[a.jsx(hc,{asChild:!0,children:a.jsxs(U,{variant:"outline",size:"sm",children:[a.jsx(Ur,{className:"mr-2 h-4 w-4"}),"Resend Campaign"]})}),a.jsxs(Wr,{className:"sm:max-w-[500px]",children:[a.jsxs(Hr,{children:[a.jsx(Vr,{children:"Resend Campaign"}),a.jsx(ba,{children:"Select a campaign and choose recipients. Only shows recipients who haven't been successfully delivered to yet."})]}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"campaign",children:"Select Campaign"}),a.jsxs(Re,{value:o,onValueChange:j=>{l(j),b(j)}
841,disabled:c,children:[a.jsx(Me,{id:"campaign",children:a.jsx(De,{placeholder:"Choose a campaign..."})}),a.jsx(Ie,{children:s.map(j=>a.jsx(ce,{value:j.id,children:a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"font-medium",children:j.name}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[j.subject," ⢠Sent: ",j.sent_count||0]})]})},j.id))})]})]}),o&&a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(is,{id:"excludeDelivered",checked:v,onCheckedChange:j=>{const S=j;p(S),b(o,S)}}),a.jsx(Q,{htmlFor:"excludeDelivered",className:"text-sm cursor-pointer",children:"Exclude recipients who already received this email (synced with Resend)"})]}),u.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Q,{children:["Select Recipients (",h.length," of ",u.length,")"]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(U,{variant:"ghost",size:"sm",onClick:_,children:"Select All"}),a.jsx(U,{variant:"ghost",size:"sm",onClick:N,children:"Deselect All"}),a.jsx(U,{variant:"ghost",size:"sm",onClick:()=>{const j=u.filter(S=>!S.alreadyDelivered).map(S=>S.email);m(j)},children:"Exclude Sent"})]})]}),a.jsx("div",{className:"border rounded-md max-h-[400px] overflow-y-auto",children:u.map(j=>a.jsxs("div",{className:"flex items-start space-x-2 p-3 border-b last:border-0 hover:bg-muted/50",children:[a.jsx(is,{id:j.email,checked:h.includes(j.email),onCheckedChange:()=>w(j.email),className:"mt-1"}),a.jsx(Q,{htmlFor:j.email,className:"flex-1 cursor-pointer",children:a.jsxs("div",{className:"flex flex-col",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium text-sm",children:j.name}),j.alreadyDelivered&&a.jsxs("div",{className:"flex items-center gap-1 text-green-600",children:[a.jsx(Na,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs font-medium",children:"Sent"})]})]}),a.jsx("span",{className:"text-xs text-muted-foreground break-all",children:j.email}),j.company&&a.jsx("span",{className:"text-xs text-muted-foreground",children:j.company})]})})]},j.email))})]})]}),a.jsxs(Qx,{children:[a.jsx(U,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsxs(U,{onClick:y,disabled:r||!o||h.length===0,children:[r&&a.jsx(Je,{className:"mr-2 h-4 w-4 animate-spin"}),"Send to ",h.length," ",h.length===1?"Recipient":"Recipients"]})]})]})]})},M$e=()=>{const{toast:e}=dt(),t=vt(),[r,n]=g.useState([]),[s,i]=g.useState(!0),[o,l]=g.useState(null),c=async()=>{try{const{data:v,error:p}=await Z.from("campaigns").select(` 842 *, 843 campaign_deliveries ( 844 status, 845 delivered_at, 846 opened_at, 847 clicked_at 848 ) 849 `).order("created_at",{ascending:!1});if(p)throw p;n(v||[])}catch(v){e({title:"Error loading campaigns",description:v.message,variant:"destructive"})}finally{i(!1)}};g.useEffect(()=>{c();const v=Z.channel("campaigns_changes").on("postgres_changes",{event:"*",schema:"public",table:"campaigns"},()=>{c()}).subscribe();return()=>{v.unsubscribe()}},[]);const d=async()=>{if(o)try{const{error:v}=await Z.from("campaigns").delete().eq("id",o);if(v)throw v;e({title:"Campaign deleted",description:"The campaign has been removed"}),l(null)}catch(v){e({title:"Error",description:v.message,variant:"destructive"})}},u=async v=>{try{const{data:p,error:x}=await Z.functions.invoke("process-scheduled-campaigns",{body:{}});if(x)throw x;e({title:"Campaign processing started",description:"Your scheduled campaign is being sent now"}),await c()}catch(p){e({title:"Error",description:p.message,variant:"destructive"})}},f=async v=>{try{const{data:p,error:x}=await Z.from("campaigns").update({status:"sending"}).eq("id",v.id).select().single();if(x)throw x;const{data:b,error:y}=await Z.functions.invoke("send-email-campaign",{body:{campaignId:v.id,recipients:v.recipients,subject:v.subject,body:v.body}});if(y)throw y;await Z.from("campaigns").update({status:"sent",sent_at:new Date().toISOString(),sent_count:b.sent,failed_count:b.failed,results:b.results}).eq("id",v.id),e({title:"Campaign sent!",description:`${b.sent} emails sent, ${b.failed} failed`})}catch(p){e({title:"Error",description:p.message,variant:"destructive"})}},h=v=>{const p={draft:"secondary",scheduled:"default",sent:"outline",sending:"default"};return a.jsx(ve,{variant:p[v]||"outline",children:v})},m=v=>{const p=v.campaign_deliveries||[],x=p.length,b=p.filter(N=>N.delivered_at).length,y=p.filter(N=>N.opened_at).length,w=p.filter(N=>N.clicked_at).length,_=p.filter(N=>N.status==="failed").length;return{total:x,delivered:b,opened:y,clicked:w,failed:_,deliveryRate:x>0?b/x*100:0,openRate:b>0?y/b*100:0,clickRate:y>0?w/y*100:0}};return s?a.jsx("div",{className:"text-center py-8",children:"Loading c
849ampaigns..."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"space-y-4",children:r.length===0?a.jsx(J,{children:a.jsx(re,{className:"py-8 text-center text-muted-foreground",children:"No campaigns yet. Create your first one!"})}):r.map(v=>a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs(le,{className:"flex items-center gap-2",children:[v.name,h(v.status)]}),a.jsx(nt,{children:v.subject})]}),a.jsxs("div",{className:"flex gap-2",children:[v.status==="sent"&&a.jsxs(a.Fragment,{children:[a.jsx(U,{size:"sm",variant:"default",onClick:()=>t(`/admin/campaign/${v.id}`),children:"View Report"}),a.jsx(T$e,{})]}),v.status==="scheduled"&&a.jsxs(U,{size:"sm",variant:"outline",onClick:()=>u(),children:[a.jsx(va,{className:"h-4 w-4 mr-2"}),"Send Now"]}),v.status==="draft"&&a.jsx(U,{size:"sm",variant:"outline",onClick:()=>f(v),children:a.jsx(va,{className:"h-4 w-4"})}),a.jsx(U,{size:"sm",variant:"ghost",onClick:()=>l(v.id),children:a.jsx(tu,{className:"h-4 w-4"})})]})]})}),a.jsx(re,{children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Br,{className:"h-4 w-4"}),a.jsxs("span",{children:["Created: ",bt(new Date(v.created_at),"PPP")]})]}),v.scheduled_for&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Br,{className:"h-4 w-4"}),a.jsxs("span",{children:["Scheduled: ",bt(new Date(v.scheduled_for),"PPP 'at' p")]})]}),v.sent_at&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(an,{className:"h-4 w-4"}),a.jsxs("span",{children:["Sent: ",bt(new Date(v.sent_at),"PPP 'at' p")]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(an,{className:"h-4 w-4"}),a.jsxs("span",{children:[Array.isArray(v.recipients)?v.recipients.length:0," recipient(s)"]})]})]}),v.status==="sent"&&v.campaign_deliveries&&v.campaign_deliveries.length>0&&(()=>{const p=m(v);return a.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[a.jsxs("h4",{className:"font-semibold text-sm flex items-center gap-2",children:[a.jsx(Ft,{className:"h-4 w-4"}),"Campaign Performance"]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[a.jsx(Na,{className:"h-3 w-3"}),"Delivered"]}),a.jsx("div",{className:"text-2xl font-bold text-green-600",children:p.delivered}),a.jsx(Qa,{value:p.deliveryRate,className:"h-1"}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:[p.deliveryRate.toFixed(1),"%"]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[a.jsx(ci,{className:"h-3 w-3"}),"Opened"]}),a.jsx("div",{className:"text-2xl font-bold text-blue-600",children:p.opened}),a.jsx(Qa,{value:p.openRate,className:"h-1"}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:[p.openRate.toFixed(1),"%"]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[a.jsx(mh,{className:"h-3 w-3"}),"Clicked"]}),a.jsx("div",{className:"text-2xl font-bold text-purple-600",children:p.clicked}),a.jsx(Qa,{value:p.clickRate,className:"h-1"}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:[p.clickRate.toFixed(1),"%"]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[a.jsx(xi,{className:"h-3 w-3"}),"Failed"]}),a.jsx("div",{className:"text-2xl font-bold text-red-600",children:p.failed}),a.jsx(Qa,{value:p.failed/p.total*100,className:"h-1"}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:[(p.failed/p.total*100).toFixed(1),"%"]})]})]}),a.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground pt-2",children:[a.jsxs("span",{children:["Total Sent: ",p.total]}),a.jsx("span",{children:"â¢"}),a.jsxs("span",{children:["Engagement: ",p.openRate>0?`${p.openRate.toFixed(1)}%`:"N/A"]})]})]})})()]})})]},v.id))}),a.jsx(E$e,{open:!!o,onOpenChange:()=>l(null),children:a.jsxs(B9,{children:[a.jsxs(z9,{children:[a.jsx(W9,{children:"Delete Campaign?"}),a.jsx(H9,{children:"This action cannot be undone. This will permanently delete the campaign."})]}),a.jsxs(U9,{children:[a.jsx(q9,{children:"Cancel"}),a.jsx(V9,{onClick:d,children:"Delete"})]})]})})]})};var p0="Collapsible",[I$e,G9]=ir(p0),[$$e,yP]=I$e(p0),K9=g.forwardRef((e,t)=>
vendor: 4,181 bytes, line 849
849{const{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:i,onOpenChange:o,...l}=e,[c,d]=vr({prop:n,defaultProp:s??!1,onChange:o,caller:p0});return a.jsx($$e,{scope:r,disabled:i,contentId:tn(),open:c,onOpenToggle:g.useCallback(()=>d(u=>!u),[d]),children:a.jsx(we.div,{"data-state":NP(c),"data-disabled":i?"":void 0,...l,ref:t})})});K9.displayName=p0;var Y9="CollapsibleTrigger",bP=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,s=yP(Y9,r);return a.jsx(we.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":NP(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:t,onClick:pe(e.onClick,s.onOpenToggle)})});bP.displayName=Y9;var wP="CollapsibleContent",jP=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=yP(wP,e.__scopeCollapsible);return a.jsx(Zt,{present:r||s.open,children:({present:i})=>a.jsx(R$e,{...n,ref:t,present:i})})});jP.displayName=wP;var R$e=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:s,...i}=e,o=yP(wP,r),[l,c]=g.useState(n),d=g.useRef(null),u=Te(t,d),f=g.useRef(0),h=f.current,m=g.useRef(0),v=m.current,p=o.open||l,x=g.useRef(p),b=g.useRef(void 0);return g.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),Kt(()=>{const y=d.current;if(y){b.current=b.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();f.current=w.height,m.current=w.width,x.current||(y.style.transitionDuration=b.current.transitionDuration,y.style.animationName=b.current.animationName),c(n)}},[o.open,n]),a.jsx(we.div,{"data-state":NP(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!p,...i,ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:p&&s})});function NP(e){return e?"open":"closed"}var X9=K9,D$e=bP,L$e=jP,us="Accordion",F$e=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[SP,B$e,z$e]=bc(us),[g0,kRe]=ir(us,[z$e,G9]),_P=G9(),Q9=I.forwardRef((e,t)=>{const{type:r,...n}=e,s=n,i=n;return a.jsx(SP.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?a.jsx(V$e,{...i,ref:t}):a.jsx(H$e,{...s,ref:t})})});Q9.displayName=us;var[J9,U$e]=g0(us),[Z9,W$e]=g0(us,{collapsible:!1}),H$e=I.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},collapsible:i=!1,...o}=e,[l,c]=vr({prop:r,defaultProp:n??"",onChange:s,caller:us});return a.jsx(J9,{scope:e.__scopeAccordion,value:I.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:I.useCallback(()=>i&&c(""),[i,c]),children:a.jsx(Z9,{scope:e.__scopeAccordion,collapsible:i,children:a.jsx(eW,{...o,ref:t})})})}),V$e=I.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},...i}=e,[o,l]=vr({prop:r,defaultProp:n??[],onChange:s,caller:us}),c=I.useCallback(u=>l((f=[])=>[...f,u]),[l]),d=I.useCallback(u=>l((f=[])=>f.filter(h=>h!==u)),[l]);return a.jsx(J9,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:d,children:a.jsx(Z9,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(eW,{...i,ref:t})})})}),[q$e,v0]=g0(us),eW=I.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:s,orientation:i="vertical",...o}=e,l=I.useRef(null),c=Te(l,t),d=B$e(r),f=Ii(s)==="ltr",h=pe(e.onKeyDown,m=>{var C;if(!F$e.includes(m.key))return;const v=m.target,p=d().filter(P=>{var A;return!((A=P.ref.current)!=null&&A.disabled)}),x=p.findIndex(P=>P.ref.current===v),b=p.length;if(x===-1)return;m.preventDefault();let y=x;const w=0,_=b-1,N=()=>{y=x+1,y>_&&(y=w)},j=()=>{y=x-1,y<w&&(y=_)};switch(m.key){case"Home":y=w;break;case"End":y=_;break;case"ArrowRight":i==="horizontal"&&(f?N():j());break;case"ArrowDown":i==="vertical"&&N();break;case"ArrowLeft":i==="horizontal"&&(f?j():N());break;case"ArrowUp":i==="vertical"&&j();break}const S=y%b;(C=p[S].ref.current)==null||C.focus()});return a.jsx(q$e,{scope:r,disabled:n,direction:s,orientation:i,children:a.jsx(SP.Slot,{scope:r,children:a.jsx(we.div,{...o,"data-orientation":i,ref:c,onKeyDown:n?void 0:h})})})}),ly="AccordionItem",[G$e,CP]=g0(ly),tW=I.forwardRef((e,t)=>
849{const{__scopeAccordion:r,value:n,...s}=e,i=v0(ly,r),o=U$e(ly,r),l=_P(r),c=tn(),d=n&&o.value.includes(n)||!1,u=i.disabled||e.disabled;return a.jsx(G$e,{scope:r,open:d,disabled:u,triggerId:c,children:a.jsx(X9,{"data-orientation":i.orientation,"data-state":oW(d),...l,...s,ref:t,disabled:u,open:d,onOpenChange:f=>{f?o.onItemOpen(n):o.onItemClose(n)}})})});tW.displayName=ly;var rW="AccordionHeader",nW=I.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=v0(us,r),i=CP(rW,r);return a.jsx(we.h3,{"data-orientation":s.orientation,"data-state":oW(i.open),"data-disabled":i.disabled?"":void 0,...n,ref:t})});nW.displayName=rW;var WS="AccordionTrigger",aW=I.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=v0(us,r),i=CP(WS,r),o=W$e(WS,r),l=_P(r);return a.jsx(SP.ItemSlot,{scope:r,children:a.jsx(D$e,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...l,...n,ref:t})})});aW.displayName=WS;var sW="AccordionContent",iW=I.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=v0(us,r),i=CP(sW,r),o=_P(r);return a.jsx(L$e,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...o,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});iW.displayName=sW;function oW(e){return e?"open":"closed"}var K$e=Q9,Y$e=tW,X$e=nW,lW=aW,cW=iW;const Q$e=K$e,Qc=g.forwardRef(({className:e,...t},r)=>a.jsx(Y$e,{ref:r,className:me("border-b",e),...t}));Qc.displayName="AccordionItem";const Jc=g.forwardRef(({className:e,children:t,...r},n)=>a.jsx(X$e,{className:"flex",children:a.jsxs(lW,{ref:n,className:me("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,a.jsx(Go,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Jc.displayName=lW.displayName;const Zc=g.forwardRef(({className:e,children:t,...r},n)=>a.jsx(cW,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:a.jsx("div",{className:me("pb-4 pt-0",e),children:t})}));Zc.displayName=cW.displayName;function J$e({onApplySuggestion:e}){const[t,r]=g.useState(!1),[n,s]=g.useState(null),{toast:i}=dt(),o=async()=>{r(!0);try{const{data:c,error:d}=await Z.from("campaigns").select(` 850 *, 851 campaign_deliveries ( 852 status, 853 open_count, 854 click_count, 855 created_at 856 ) 857 `).order("created_at",{ascending:!1}).limit(10);if(d)throw d;const{data:u,error:f}=await Z.from("leads").select("status, source, created_at").order("created_at",{ascending:!1}).limit(100);if(f)throw f;const h=c==null?void 0:c.map(x=>{var b;return{name:x.name,type:x.campaign_type,status:x.status,sent:x.sent_count,failed:x.failed_count,deliveries:((b=x.campaign_deliveries)==null?void 0:b.length)||0,avgOpens:x.campaign_deliveries?x.campaign_deliveries.reduce((y,w)=>y+(w.open_count||0),0)/x.campaign_deliveries.length:0,avgClicks:x.campaign_deliveries?x.campaign_deliveries.reduce((y,w)=>y+(w.click_count||0),0)/x.campaign_deliveries.length:0}}),m={total:(u==null?void 0:u.length)||0,byStatus:u==null?void 0:u.reduce((x,b)=>(x[b.status]=(x[b.status]||0)+1,x),{}),bySources:u==null?void 0:u.reduce((x,b)=>(x[b.source]=(x[b.source]||0)+1,x),{})},{data:v,error:p}=await Z.functions.invoke("suggest-campaign-strategy",{body:{campaignHistory:h,leadData:m}});if(p)throw p;if(v.error)throw new Error(v.error);s(v.suggestions),i({title:"AI Suggestions Generated",description:"Review the recommendations below to improve your campaigns."})}catch(c){console.error("Error fetching suggestions:",c),i({title:"Error",description:c.message||"Failed to generate suggestions. Please try again.",variant:"destructive"})}finally{r(!1)}},l=(c,d)=>{e&&e({type:c,data:d}),i({title:"Suggestion Applied",description:"The suggestion has been loaded into your campaign editor."})};return a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(h1,{className:"h-5 w-5 text-primary"}),"AI Campaign Strategy"]}
857),a.jsx(nt,{children:"Get personalized recommendations based on your campaign performance"})]}),a.jsx(U,{onClick:o,disabled:t,children:t?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyzing..."]}):a.jsxs(a.Fragment,{children:[a.jsx(h1,{className:"mr-2 h-4 w-4"}),"Get Suggestions"]})})]})}),n&&a.jsxs(re,{className:"space-y-4",children:[a.jsxs(Q$e,{type:"single",collapsible:!0,className:"w-full",children:[n.followUpSequence&&n.followUpSequence.length>0&&a.jsxs(Qc,{value:"sequence",children:[a.jsx(Jc,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(np,{className:"h-4 w-4"}),a.jsxs("span",{children:["Automated Follow-up Sequence (",n.followUpSequence.length," steps)"]})]})}),a.jsx(Zc,{children:a.jsx("div",{className:"space-y-3",children:n.followUpSequence.map((c,d)=>a.jsx(J,{className:"bg-muted/50",children:a.jsx(re,{className:"pt-4",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"space-y-2 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(ve,{variant:"outline",children:["Step ",c.step]}),a.jsx(ve,{children:c.timing}),a.jsx(ve,{variant:"secondary",children:c.channel})]}),a.jsx("h4",{className:"font-medium",children:c.subject}),a.jsx("p",{className:"text-sm text-muted-foreground",children:c.content})]}),a.jsx(U,{size:"sm",variant:"outline",onClick:()=>l("sequence-step",c),children:"Use This"})]})})},d))})})]}),n.subjectLineTests&&n.subjectLineTests.length>0&&a.jsxs(Qc,{value:"subjects",children:[a.jsx(Jc,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(an,{className:"h-4 w-4"}),a.jsx("span",{children:"A/B Test Subject Lines"})]})}),a.jsx(Zc,{children:a.jsx("div",{className:"space-y-2",children:n.subjectLineTests.map((c,d)=>a.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[a.jsx("span",{className:"text-sm",children:c}),a.jsx(U,{size:"sm",variant:"ghost",onClick:()=>l("subject",c),children:"Use"})]},d))})})]}),n.segmentation&&Object.keys(n.segmentation).length>0&&a.jsxs(Qc,{value:"segmentation",children:[a.jsx(Jc,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ap,{className:"h-4 w-4"}),a.jsx("span",{children:"Lead Segmentation Strategy"})]})}),a.jsx(Zc,{children:a.jsx("div",{className:"space-y-3",children:Object.entries(n.segmentation).map(([c,d])=>a.jsxs("div",{className:"p-3 border rounded-lg",children:[a.jsx("h4",{className:"font-medium capitalize mb-2",children:c.replace(/([A-Z])/g," $1").trim()}),a.jsx("p",{className:"text-sm text-muted-foreground",children:d})]},c))})})]}),n.improvements&&n.improvements.length>0&&a.jsxs(Qc,{value:"improvements",children:[a.jsx(Jc,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ft,{className:"h-4 w-4"}),a.jsx("span",{children:"Recommended Improvements"})]})}),a.jsx(Zc,{children:a.jsx("ul",{className:"space-y-2",children:n.improvements.map((c,d)=>a.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[a.jsx("span",{className:"text-primary",children:"â¢"}),a.jsx("span",{children:c})]},d))})})]}),n.nextCampaign&&n.nextCampaign.subject&&a.jsxs(Qc,{value:"next-campaign",children:[a.jsx(Jc,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(an,{className:"h-4 w-4"}),a.jsx("span",{children:"Ready-to-Use Next Campaign"})]})}),a.jsx(Zc,{children:a.jsx(J,{className:"bg-primary/5",children:a.jsxs(re,{className:"pt-4 space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Target Segment"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:n.nextCampaign.targetSegment})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Subject"}),a.jsx("p",{className:"text-sm",children:n.nextCampaign.subject})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Body"}),a.jsx("p",{className:"text-sm whitespace-pre-wrap",children:n.nextCampaign.body})]}),a.jsx(U,{onClick:()=>l("full-campaign",n.nextCampaign),className:"w-full",children:"Create This Campaign"})]})})})]})]}),n.rawSuggestions&&a.jsxs("div",{className:"mt-4 p-4 bg-muted rounded-lg",children:[a.jsx("h4",{className:"font-medium mb-2",children:"AI Recommendations:"}),a.jsx("p",{className:"text-sm whitespace-pre-wrap",children:n.rawSuggestions})]})]})]})}function Z$e({onSyncComplete:e}){const[t,r]=g.useState(!1),[n,s]=g.useState(!1),[i,o]=g.useState(30),[l,c]=g.useState(5e4),[d,u]=g.useState(50),[f,h]=g.useState("Success"),m=async()=>{r(!0);try{const{data:{user:p}}=await Z.auth.getUser();if(!p)throw new Error("Not authenticated");const{data:x,error:b}=await Z.functions.invoke("enrich-procurement-contacts",{body:{daysBack:i,minValue:l,limit:d,organizationId:p.id,audienceName:f}});if(b)throw b;if(x.success)We.success(`Found ${x.enrichedCount} new contacts from ${x.totalAwards} federal awards`,{description:x.errors?`${x.errors.length} errors occurred`:"All contacts enriched successfully"}),e==null||e();else throw new Error(x.error||"Enrichment failed")}catch(p){console.error("Enrichment error:",p),We.error("Failed to enrich contacts",{description:p.message})}finally{r(!1)}},v=async()=>{s(!0);try{const{error:p}=await Z.functions.invoke("sync-procurement-data");if(p)throw p;We.success("Contract winners synced successfully"),e==null||e()}catch(p){console.error("Sync error:",p),We.error("Failed to sync contract winners",{description:p.message})}finally{s(!1)}};return a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(an,{className:"h-5 w-5"}),"Contact Enrichment"]})}),a.jsxs(re,{className:"space-y-3",children:[a.jsxs("div",{className:"grid gap-3 md:grid-cols-4",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Q,{htmlFor:"audienceName",className:"text-xs",children:"Audience"}),a.jsx(ge,{id:"audienceName",type:"text",value:f,onChange:p=>h(p.target.value),className:"h-8 text-sm"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Q,{htmlFor:"daysBack",className:"text-xs",children:"Days Back"}),a.jsx(ge,{id:"daysBack",type:"number",value:i,onChange:p=>o(Number(p.target.value)),min:1,max:365,className:"h-8 text-sm"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Q,{htmlFor:"minValue",className:"text-xs",children:"Min Value ($)"}
857),a.jsx(ge,{id:"minValue",type:"number",value:l,onChange:p=>c(Number(p.target.value)),min:0,step:1e4,className:"h-8 text-sm"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Q,{htmlFor:"limit",className:"text-xs",children:"Max Awards"}),a.jsx(ge,{id:"limit",type:"number",value:d,onChange:p=>u(Number(p.target.value)),min:1,max:100,className:"h-8 text-sm"})]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(U,{onClick:m,disabled:t||n,className:"flex-1",children:t?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"mr-2 h-4 w-4 animate-spin"}),"Enriching..."]}):a.jsxs(a.Fragment,{children:[a.jsx(an,{className:"mr-2 h-4 w-4"}),"Find Contacts"]})}),a.jsx(U,{onClick:v,disabled:t||n,variant:"outline",children:a.jsx(Ur,{className:`h-4 w-4 ${n?"animate-spin":""}`})})]})]})]})}function e4e({onSyncComplete:e}){const{user:t}=it(),[r,n]=g.useState(!1),s=async()=>{var i;if(!t){We.error("You must be logged in to sync data");return}n(!0),We.info("Starting procurement data sync...",{description:"This may take a few minutes to fetch and enrich contacts"});try{const{data:o,error:l}=await Z.functions.invoke("trigger-procurement-sync",{body:{organizationId:t.id,audienceName:"Success"}});if(l)throw l;We.success("Sync completed!",{description:`Found ${((i=o.stats)==null?void 0:i.totalLeads)||0} total leads in Success audience`}),e&&e()}catch(o){console.error("Sync error:",o),We.error("Sync failed",{description:o.message||"Failed to sync procurement data"})}finally{n(!1)}};return a.jsxs(U,{onClick:s,disabled:r,variant:"default",className:"gap-2",children:[a.jsx(Ur,{className:`h-4 w-4 ${r?"animate-spin":""}`}),r?"Searching...":"Search Contract Winners"]})}function t4e({onSyncComplete:e}){const{user:t}=it(),[r,n]=g.useState(!1),s=async()=>{var i,o;if(!t){We.error("You must be logged in to fetch data");return}n(!0),We.info("Fetching recent contract winners...",{description:"Looking for companies who won contracts in the last 7 days"});try{const{data:l,error:c}=await Z.functions.invoke("fetch-recent-winners",{body:{organizationId:t.id,daysBack:7}});if(c)throw c;We.success("Recent winners fetched!",{description:`Found ${((i=l.stats)==null?void 0:i.totalAwards)||0} recent awards, created ${((o=l.stats)==null?void 0:o.leadsCreated)||0} new leads in "Recent Winners" audience`}),e&&e()}catch(l){console.error("Fetch error:",l),We.error("Fetch failed",{description:l.message||"Failed to fetch recent winners"})}finally{n(!1)}};return a.jsxs(U,{onClick:s,disabled:r,variant:"default",className:"gap-2",children:[a.jsx(Ft,{className:`h-4 w-4 ${r?"animate-pulse":""}`}),r?"Fetching Winners...":"Find Recent Winners"]})}const r4e=()=>{const{user:e}=it(),{isAdmin:t,loading:r}=al(),{toast:n}=dt();console.log("LeadsManagement render - user:",e==null?void 0:e.email,"isAdmin:",t,"loading:",r);const[s,i]=g.useState([]),[o,l]=g.useState([]),[c,d]=g.useState([]),[u,f]=g.useState(0),[h,m]=g.useState([]),[v,p]=g.useState([]),[x,b]=g.useState(new Set),[y,w]=g.useState(!1),[_,N]=g.useState("menu"),[j,S]=g.useState(!1),[C,P]=g.useState(!1),[A,D]=g.useState(1),[F,q]=g.useState(25),[B,V]=g.useState("all"),[E,M]=g.useState("all"),[T,L]=g.useState("25"),[K,H]=g.useState(null),[ee,se]=g.useState({name:"",description:""}),[ne,W]=g.useState(null),ie=g.useRef(null),[R,O]=g.useState({company_name:"",contact_name:"",email:"",phone:"",industry:"",status:"new",source:"",notes:"",audience:"Total Contractors"}),k=g.useRef(null);g.useEffect(()=>{t&&(oe(),ae(),G())},[t,A,F,E,B]),g.useEffect(()=>{let Y=s;B==="not_contacted"&&(console.log("Filtering for not contacted leads (without checkmark)"),Y=Y.filter(_e=>!x.has(_e.id)),console.log(`Filtered ${Y.length} out of ${s.length} leads`)),d(Y)},[s,B,x]);const G=async()=>{try{const{data:Y,error:_e}=await lt.from("audiences").select("*").order("name");if(_e)throw _e;l(Y||[]),Y&&Y.length>0&&!R.audience&&O(Oe=>({...Oe,audience:Y[0].name}))}catch(Y){console.error("Error fetching audiences:",Y)}},te=async()=>{if(!ee.name.trim()){n({title:"Error",description:"Audience name is required",variant:"destructive"});return}try{const{error:Y}=await lt.from("audiences").insert([{name:ee.name.trim(),description:ee.description.trim(),user_id:e==null?void 0:e.id,organization_id:e==null?void 0:e.id}]);if(Y)throw Y;ne&&await $(ne,ee.name.trim()),await G(),P(!1),se({name:"",description:""}),W(null),n({title:"Success",description:ne?"Audience created and leads imported successfully":"Audience created successfully"})}catch(Y){console.error("Error creating audience:",Y),n({title:"Error",description:Y.message||"Failed to create audience",variant:"destructive"})}},$=async(Y,_e)=>{var jt;const Oe=(jt=Y.name.split(".").pop())==null?void 0:jt.toLowerCase(),Ee=Oe==="csv",tt=["xlsx","xls"].includes(Oe||"");if(!Ee&&!tt)throw new Error("Please upload a CSV or Excel file");return new Promise((sn,ta)=>{const fs=new FileReader;fs.onload=async Mp=>{var jn;try{const Rr=((jn=Mp.target)==null?void 0:jn.result).split(` 858`).filter(st=>st.trim());if(Rr.length===0){ta(new Error("File is empty"));return}const ra=Rr[0].trim().toLowerCase(),Oa=ra.includes("email")||ra.includes("company")||ra.includes("contact"),kt=[];if(Oa){const st=Rr[0].split(",").map(ut=>ut.trim().toLowerCase().replace(/"/g,""));for(let ut=1;ut<Rr.length;ut++){if(!Rr[ut].trim())continue;const xt=Rr[ut].split(",").map(vf=>vf.trim().replace(/"/g,"")),Gr={company_name:xt[st.indexOf("company_name")]||xt[st.indexOf("company")]||"",contact_name:xt[st.indexOf("contact_name")]||xt[st.indexOf("contact")]||"",email:xt[st.indexOf("email")]||"",phone:xt[st.indexOf("phone")]||"",industry:xt[st.indexOf("industry")]||"",status:xt[st.indexOf("status")]||"new",source:xt[st.indexOf("source")]||`${tt?"Excel":"CSV"} Import`,notes:xt[st.indexOf("notes")]||"",last_contact:null,audie
858nce:_e};Gr.email&&(Gr.company_name||Gr.contact_name)&&(Gr.company_name||(Gr.company_name=z(Gr.email)),Gr.contact_name||(Gr.contact_name=Gr.email.split("@")[0].replace(/[._]/g," ")),kt.push(Gr))}}else for(let st=0;st<Rr.length;st++){const ut=Rr[st].trim().replace(/"/g,"");if(!ut||!ut.includes("@"))continue;const xt=z(ut),Gr=ut.split("@")[0].replace(/[._]/g," ");kt.push({company_name:xt,contact_name:Gr,email:ut.toLowerCase(),phone:"",industry:"",status:"new",source:`${tt?"Excel":"CSV"} Import`,notes:"",last_contact:null,audience:_e})}if(kt.length>0){const st=kt.map(xt=>({...xt,user_id:e==null?void 0:e.id,organization_id:e==null?void 0:e.id})),{error:ut}=await lt.from("leads").insert(st);if(ut)throw ut;await oe(),sn(kt.length)}else ta(new Error("No valid leads found in file"))}catch(hs){ta(hs)}},fs.onerror=()=>ta(new Error("Failed to read file")),fs.readAsText(Y)})},ae=async()=>{try{const{data:Y,error:_e}=await lt.from("campaign_deliveries").select("recipient_email, lead_id");if(_e)throw _e;const{data:Oe,error:Ee}=await lt.from("leads").select("id, email");if(Ee)throw Ee;const tt=new Set;Y==null||Y.forEach(sn=>{sn.lead_id&&tt.add(sn.lead_id)});const jt=new Map((Oe==null?void 0:Oe.map(sn=>[sn.email.toLowerCase(),sn.id]))||[]);Y==null||Y.forEach(sn=>{if(sn.recipient_email){const ta=jt.get(sn.recipient_email.toLowerCase());ta&&tt.add(ta)}}),b(tt)}catch(Y){console.error("Error fetching leads with campaigns:",Y)}},oe=async()=>{try{console.log("Fetching leads with filters:",{audienceFilter:E,statusFilter:B});let Y=lt.from("leads").select("*",{count:"exact"});E!=="all"&&(Y=Y.eq("audience",E)),B!=="all"&&B!=="not_contacted"&&(Y=Y.eq("status",B));const _e=(A-1)*F,Oe=_e+F-1,{data:Ee,error:tt,count:jt}=await Y.order("created_at",{ascending:!1}).range(_e,Oe);if(tt)throw console.error("Query error:",tt),tt;console.log(`Query returned ${(Ee==null?void 0:Ee.length)||0} leads`),i(Ee||[]),f(jt||0)}catch(Y){console.error("Error fetching leads:",Y),n({title:"Error",description:"Failed to load leads",variant:"destructive"})}},z=Y=>{const _e=Y.split("@")[1];if(!_e)return"Unknown Company";const Oe=_e.split(".")[0];return Oe.charAt(0).toUpperCase()+Oe.slice(1)},fe=async Y=>{var sn,ta;const _e=(sn=Y.target.files)==null?void 0:sn[0];if(!_e)return;const Oe=(ta=_e.name.split(".").pop())==null?void 0:ta.toLowerCase(),Ee=Oe==="csv",tt=["xlsx","xls"].includes(Oe||"");if(!Ee&&!tt){n({title:"Error",description:"Please upload a CSV or Excel file",variant:"destructive"});return}const jt=new FileReader;jt.onload=async fs=>{var Oa;const jn=((Oa=fs.target)==null?void 0:Oa.result).split(` 859`).filter(kt=>kt.trim());if(jn.length===0){n({title:"Error",description:"File is empty",variant:"destructive"});return}const hs=jn[0].trim().toLowerCase(),Rr=hs.includes("email")||hs.includes("company")||hs.includes("contact"),ra=[];if(Rr){const kt=jn[0].split(",").map(st=>st.trim().toLowerCase().replace(/"/g,""));for(let st=1;st<jn.length;st++){if(!jn[st].trim())continue;const ut=jn[st].split(",").map(Gr=>Gr.trim().replace(/"/g,"")),xt={company_name:ut[kt.indexOf("company_name")]||ut[kt.indexOf("company")]||"",contact_name:ut[kt.indexOf("contact_name")]||ut[kt.indexOf("contact")]||"",email:ut[kt.indexOf("email")]||"",phone:ut[kt.indexOf("phone")]||"",industry:ut[kt.indexOf("industry")]||"",status:ut[kt.indexOf("status")]||"new",source:ut[kt.indexOf("source")]||`${tt?"Excel":"CSV"} Import`,notes:ut[kt.indexOf("notes")]||"",last_contact:null,audience:E!=="all"?E:"Total Contractors"};xt.email&&(xt.company_name||xt.contact_name)&&(xt.company_name||(xt.company_name=z(xt.email)),xt.contact_name||(xt.contact_name=xt.email.split("@")[0].replace(/[._]/g," ")),ra.push(xt))}}else for(let kt=0;kt<jn.length;kt++){const st=jn[kt].trim().replace(/"/g,"");if(!st||!st.includes("@"))continue;const ut=z(st),xt=st.split("@")[0].replace(/[._]/g," ");ra.push({company_name:ut,contact_name:xt,email:st.toLowerCase(),phone:"",industry:"",status:"new",source:`${tt?"Excel":"CSV"} Import`,notes:"",last_contact:null,audience:E!=="all"?E:"Total Contractors"})}if(ra.length>0)try{const kt=ra.map(ut=>({...ut,user_id:e==null?void 0:e.id,organization_id:e==null?void 0:e.id})),{error:st}=await lt.from("leads").insert(kt);if(st)throw st;await oe(),n({title:"Success",description:`Imported ${ra.length} leads to "${E!=="all"?E:"Total Contractors"}"`})}catch(kt){console.error("Error importing leads:",kt),n({title:"Error",description:"Failed to import leads",variant:"destructive"})}else n({title:"Warning",description:"No valid leads found in file. Make sure each row has at least an email and company/contact name.",variant:"destructive"})},jt.readAsText(_e),k.current&&(k.current.value="")},ue=async()=>
859{if(!R.company_name||!R.contact_name||!R.email){n({title:"Validation Error",description:"Company name, contact name, and email are required",variant:"destructive"});return}try{const{error:Y}=await lt.from("leads").insert([{...R,user_id:e==null?void 0:e.id,organization_id:e==null?void 0:e.id,last_contact:null}]);if(Y)throw Y;await oe(),S(!1),O({company_name:"",contact_name:"",email:"",phone:"",industry:"",status:"new",source:"",notes:"",audience:"Total Contractors"}),n({title:"Success",description:"Lead added successfully"})}catch(Y){console.error("Error adding lead:",Y),n({title:"Error",description:"Failed to add lead",variant:"destructive"})}},Ne=Y=>{m(_e=>{if(_e.includes(Y))return p(Ee=>Ee.filter(tt=>tt.id!==Y)),_e.filter(Ee=>Ee!==Y);{const Ee=s.find(tt=>tt.id===Y);return Ee&&p(tt=>[...tt,Ee]),[..._e,Y]}})},He=()=>{const Y=s.map(Oe=>Oe.id);Y.every(Oe=>h.includes(Oe))?(m(Oe=>Oe.filter(Ee=>!Y.includes(Ee))),p(Oe=>Oe.filter(Ee=>!Y.includes(Ee.id)))):m(Oe=>{const Ee=[...Oe],tt=[];return s.forEach(jt=>{Ee.includes(jt.id)||(Ee.push(jt.id),tt.push(jt))}),p(jt=>[...jt,...tt]),Ee})},ke=Y=>({new:"bg-blue-100 text-blue-800 border-blue-200",contacted:"bg-yellow-100 text-yellow-800 border-yellow-200",qualified:"bg-purple-100 text-purple-800 border-purple-200",negotiation:"bg-orange-100 text-orange-800 border-orange-200",closed:"bg-green-100 text-green-800 border-green-200"})[Y]||"bg-gray-100 text-gray-800",Ze=Y=>{console.log("Applying suggestion:",Y),Y.type==="full-campaign"||Y.type==="sequence-step"?(H(Y.data),N("create")):Y.type==="subject"&&(H({subject:Y.data}),N("create")),n({title:"Suggestion Applied",description:"The suggestion has been loaded. Review and send when ready."})};return r?(console.log("LeadsManagement: showing loading state"),a.jsx(Gt,{children:a.jsx("div",{className:"flex items-center justify-center min-h-screen",children:a.jsx("p",{children:"Loading..."})})})):t?(console.log("LeadsManagement: rendering main content with",s.length,"leads"),a.jsx(Gt,{children:a.jsxs("div",{className:"container mx-auto p-6 space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsx("h1",{className:"text-3xl font-bold",children:"Leads Management"})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs(J,{children:[a.jsx(de,{className:"pb-3",children:a.jsx(le,{className:"text-sm font-medium",children:"Total Leads"})}),a.jsxs(re,{children:[a.jsx("div",{className:"text-2xl font-bold",children:u.toLocaleString()}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"All time"})]})]}),a.jsxs(J,{children:[a.jsx(de,{className:"pb-3",children:a.jsx(le,{className:"text-sm font-medium",children:"New This Week"})}),a.jsxs(re,{children:[a.jsx("div",{className:"text-2xl font-bold",children:s.filter(Y=>new Date(Y.created_at)>new Date(Date.now()-7*24*60*60*1e3)).length}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Last 7 days"})]})]}),a.jsxs(J,{children:[a.jsx(de,{className:"pb-3",children:a.jsx(le,{className:"text-sm font-medium",children:"Active Pipeline"})}),a.jsxs(re,{children:[a.jsx("div",{className:"text-2xl font-bold",children:s.filter(Y=>["contacted","qualified","negotiation"].includes(Y.status)).length}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"In progress"})]})]}),a.jsxs(J,{children:[a.jsx(de,{className:"pb-3",children:a.jsx(le,{className:"text-sm font-medium",children:"Closed Deals"})}),a.jsxs(re,{children:[a.jsx("div",{className:"text-2xl font-bold",children:s.filter(Y=>Y.status==="closed").length}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Won"})]})]})]}),a.jsx(Z$e,{onSyncComplete:()=>{oe(),G()}}),a.jsxs(J,{children:[a.jsxs(de,{children:[a.jsx(le,{children:"Quick Actions"}),a.jsx(nt,{children:"Find and import leads from various sources"})]}),a.jsx(re,{children:a.jsxs("div",{className:"flex gap-3 flex-wrap",children:[a.jsx(e4e,{onSyncComplete:()=>{oe(),G()}}),a.jsx(t4e,{onSyncComplete:()=>{oe(),G()}})]})})]}),a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(le,{children:"Lead Management"}),a.jsx(nt,{children:"Track and manage potential client relationships"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{ref:k,type:"file",accept:".csv,.xlsx,.xls",onChange:fe,className:"hidden"}),a.jsxs(U,{variant:"outline",onClick:()=>{var Y;return(Y=k.current)==null?void 0:Y.click()},children:[a.jsx(Ro,{className:"h-4 w-4 mr-2"}),"Import Leads"]}),a.jsxs(rn,{open:y,onOpenChange:Y=>{w(Y),Y||N("menu")},children:[a.jsx(hc,{asChild:!0,children:a.jsxs(U,{children:[a.jsx(va,{className:"h-4 w-4 mr-2"}),"Campaigns ",h.length>0&&`(${h.length})`]})}),a.jsxs(Wr,{className:"max-w-6xl max-h-[90vh] overflow-y-auto",children:[a.jsxs(Hr,{children:[a.jsx(Vr,{children:"Campaign Management"}),a.jsx(ba,{children:"Use AI to optimize your campaigns and improve c
859onversion rates"})]}),a.jsxs(Ac,{value:_,onValueChange:Y=>N(Y),className:"w-full",children:[a.jsxs(ol,{className:"grid w-full grid-cols-3",children:[a.jsx(Ot,{value:"menu",children:"AI Suggestions"}),a.jsx(Ot,{value:"create",children:"Create Campaign"}),a.jsx(Ot,{value:"reports",children:"Reports"})]}),a.jsx(Rt,{value:"menu",className:"space-y-4",children:a.jsx(J$e,{onApplySuggestion:Ze})}),a.jsx(Rt,{value:"create",className:"space-y-4",children:a.jsx(d$e,{recipients:v.map(Y=>({email:Y.email||"",name:Y.contact_name||"",company:Y.company_name||"",phone:Y.phone||"",leadId:Y.id})),onClose:()=>{w(!1),m([]),p([]),H(null),ae()},initialSubject:K==null?void 0:K.subject,initialBody:(K==null?void 0:K.body)||(K==null?void 0:K.content)})}),a.jsx(Rt,{value:"reports",children:a.jsx(M$e,{})})]})]})]}),a.jsxs(rn,{open:j,onOpenChange:S,children:[a.jsx(hc,{asChild:!0,children:a.jsxs(U,{children:[a.jsx(gn,{className:"h-4 w-4 mr-2"}),"Add Lead"]})}),a.jsxs(Wr,{className:"sm:max-w-[500px]",children:[a.jsxs(Hr,{children:[a.jsx(Vr,{children:"Add New Lead"}),a.jsx(ba,{children:"Enter the details of the new lead"})]}),a.jsxs("div",{className:"grid gap-4 py-4",children:[a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx(Q,{htmlFor:"company",className:"text-right",children:"Company *"}),a.jsx(ge,{id:"company",className:"col-span-3",value:R.company_name,onChange:Y=>O({...R,company_name:Y.target.value})})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx(Q,{htmlFor:"contactName",className:"text-right",children:"Contact *"}),a.jsx(ge,{id:"contactName",className:"col-span-3",value:R.contact_name,onChange:Y=>O({...R,contact_name:Y.target.value})})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx(Q,{htmlFor:"email",className:"text-right",children:"Email *"}),a.jsx(ge,{id:"email",type:"email",className:"col-span-3",value:R.email,onChange:Y=>O({...R,email:Y.target.value})})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx(Q,{htmlFor:"phone",className:"text-right",children:"Phone"}),a.jsx(ge,{id:"phone",className:"col-span-3",value:R.phone,onChange:Y=>O({...R,phone:Y.target.value})})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx(Q,{htmlFor:"industry",className:"text-right",children:"Industry"}),a.jsx(ge,{id:"industry",className:"col-span-3",value:R.industry,onChange:Y=>O({...R,industry:Y.target.value})})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx(Q,{htmlFor:"status",className:"text-right",children:"Status"}),a.jsxs(Re,{value:R.status,onValueChange:Y=>O({...R,status:Y}),children:[a.jsx(Me,{className:"col-span-3",children:a.jsx(De,{})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"new",children:"New"}),a.jsx(ce,{value:"contacted",children:"Contacted"}),a.jsx(ce,{value:"qualified",children:"Qualified"}),a.jsx(ce,{value:"negotiation",children:"Negotiation"}),a.jsx(ce,{value:"closed",children:"Closed"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx(Q,{htmlFor:"audience",className:"text-right",children:"Audience"}),a.jsxs(Re,{value:R.audience,onValueChange:Y=>O({...R,audience:Y}),children:[a.jsx(Me,{className:"col-span-3",children:a.jsx(De,{})}),a.jsx(Ie,{className:"max-h-[300px] bg-popover z-50",children:o.map(Y=>a.jsx(ce,{value:Y.name,children:Y.name},Y.id))})]})]}),a.jsx("div",{className:"col-span-4 flex justify-end",children:a.jsxs(U,{type:"button",variant:"outline",size:"sm",onClick:()=>{S(!1),P(!0)},children:[a.jsx(gn,{className:"h-4 w-4 mr-2"}),"Create New Audience"]})}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx(Q,{htmlFor:"source",className:"text-right",children:"Source"}),a.jsx(ge,{id:"source",className:"col-span-3",value:R.source,onChange:Y=>O({...R,source:Y.target.value})})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx(Q,{htmlFor:"notes",className:"text-right",children:"Notes"}),a.jsx(Qn,{id:"notes",className:"col-span-3",value:R.notes,onChange:Y=>O({...R,notes:Y.target.value})})]})]}),a.jsxs(Qx,{children:[a.jsx(U,{variant:"outline",onClick:()=>S(!1),children:"Cancel"}),a.jsx(U,{onClick:ue,children:"Add Lead"})]})]})]}),a.jsx(rn,{open:C,onOpenChange:Y=>{P(Y),Y||W(null)},children:a.jsxs(Wr,{className:"sm:max-w-[600px]",children:[a.jsxs(Hr,{children:[a.jsx(Vr,{children:"Create New Audience"}),a.jsx(ba,{children:"Add a new audience and optionally import leads"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx(Q,{htmlFor:"audience-name",className:"text-right",children:"Name *"}),a.jsx(ge,{id:"audience-name",className:"col-span-3",placeholder:"e.g., Enterprise Clients",value:ee.name,onChange:Y=>se({...ee,name:Y.target.value})})]}),a.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[a.jsx(Q,{htmlFor:"audience-description",className:"text-right",children:"Description"}),a.jsx(Qn,{id:"audience-description",className:"col-span-3",placeholder:"Brief description of this audie
859nce",value:ee.description,onChange:Y=>se({...ee,description:Y.target.value})})]}),a.jsx("div",{className:"border-t pt-4",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Q,{className:"text-sm font-medium",children:"Import Leads (Optional)"}),a.jsx(ve,{variant:"outline",className:"text-xs",children:"CSV or Excel"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"file",ref:ie,className:"hidden",accept:".csv,.xlsx,.xls",onChange:Y=>{var Oe;const _e=(Oe=Y.target.files)==null?void 0:Oe[0];_e&&W(_e)}}),a.jsxs(U,{type:"button",variant:"outline",size:"sm",onClick:()=>{var Y;return(Y=ie.current)==null?void 0:Y.click()},className:"flex-1",children:[a.jsx(Ro,{className:"h-4 w-4 mr-2"}),ne?"Change File":"Choose File"]}),ne&&a.jsx(U,{type:"button",variant:"ghost",size:"sm",onClick:()=>{W(null),ie.current&&(ie.current.value="")},children:"Clear"})]}),ne&&a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Selected: ",ne.name]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Upload a CSV or Excel file with email addresses (one per line) or with columns: email, company_name, contact_name, phone, industry, status, notes"})]})})]}),a.jsxs(Qx,{children:[a.jsx(U,{variant:"outline",onClick:()=>{P(!1),W(null)},children:"Cancel"}),a.jsx(U,{onClick:te,children:ne?"Create & Import":"Create Audience"})]})]})})]})]})}),a.jsx(re,{children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Show"}),a.jsxs(Re,{value:F.toString(),onValueChange:Y=>{q(parseInt(Y)),D(1)},children:[a.jsx(Me,{className:"w-[100px]",children:a.jsx(De,{})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"25",children:"25"}),a.jsx(ce,{value:"50",children:"50"}),a.jsx(ce,{value:"100",children:"100"}),a.jsx(ce,{value:"250",children:"250"}),a.jsx(ce,{value:"500",children:"500"}),a.jsx(ce,{value:"1000",children:"1000"})]})]}),a.jsx("div",{className:"h-4 w-px bg-border mx-2"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"Status:"}),a.jsxs(Re,{value:B,onValueChange:Y=>{console.log("Status filter changed to:",Y),V(Y),D(1)},children:[a.jsx(Me,{className:"w-[170px]",children:a.jsx(De,{placeholder:"Select status"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"all",children:"All Statuses"}),a.jsx(ce,{value:"not_contacted",children:"Not Contacted"}),a.jsx(ce,{value:"new",children:"New"}),a.jsx(ce,{value:"contacted",children:"Contacted"}),a.jsx(ce,{value:"qualified",children:"Qualified"}),a.jsx(ce,{value:"negotiation",children:"Negotiation"}),a.jsx(ce,{value:"closed",children:"Closed"})]})]}),a.jsx("div",{className:"h-4 w-px bg-border mx-2"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"Audience:"}),a.jsxs(Re,{value:E,onValueChange:Y=>{M(Y),D(1)},children:[a.jsx(Me,{className:"w-[180px]",children:a.jsx(De,{placeholder:"Select audience"})}),a.jsxs(Ie,{className:"max-h-[300px] bg-popover z-50",children:[a.jsx(ce,{value:"all",children:"All Audiences"}),o.map(Y=>a.jsxs(ce,{value:Y.name,children:[Y.name," (",Y.lead_count,")"]},Y.id))]})]}),a.jsxs(U,{variant:"outline",size:"sm",onClick:()=>P(!0),children:[a.jsx(gn,{className:"h-4 w-4 mr-2"}),"New Audience"]}),a.jsx("div",{className:"h-4 w-px bg-border mx-2"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"Select:"}),a.jsxs(Re,{value:T,onValueChange:Y=>{L(Y);const _e=parseInt(Y),Oe=s.slice(0,_e).map(Ee=>Ee.id);m(Oe),n({title:"Leads Selected",description:`Selected ${Math.min(_e,s.length)} of ${_e} leads for bulk actions`})},children:[a.jsx(Me,{className:"w-[100px]",children:a.jsx(De,{})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"25",children:"25"}),a.jsx(ce,{value:"50",children:"50"}),a.jsx(ce,{value:"100",children:"100"}),a.jsx(ce,{value:"250",children:"250"}),a.jsx(ce,{value:"500",children:"500"}),a.jsx(ce,{value:"1000",children:"1000"})]})]})]}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing ",c.length," of ",u," leads",E!=="all"&&` (Audience: ${E})`,B!=="all"&&` (Status: ${B==="not_contacted"?"Not Contacted":B})`]})]}),a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[a.jsxs(U,{variant:"outline",size:"sm",onClick:()=>D(Y=>Math.max(1,Y-1)),disabled:A===1,children:[a.jsx(u1,{className:"h-4 w-4 mr-1"}),"Previous"]}),a.jsx("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(10,Math.ceil(u/F))},(Y,_e)=>{const Oe=Math.ceil(u/F);let Ee;return Oe<=10||A<=5?Ee=_e+1:A>=Oe-4?Ee=Oe-9+_e:Ee=A-4+_e,a.jsx(U,{variant:A===Ee?"default":"outline",size:"sm",onClick:()=>D(Ee),className:"w-10",children:Ee},Ee)})}),a.jsxs(U,{variant:"outline",size:"sm",onClick:()=>D(Y=>Math.min(Math.ceil(u/F),Y+1)),disabled:A>=Math.ceil(u/F),children:["Next",a.jsx(Zd,{className:"h-4 w-4 ml-1"})]})]}),a.jsxs(Ec,{children:[a.jsx(Oc,{children:a.jsxs(xn,{children:[a.jsx(Ge,{className:"w-12",children:a.jsx(is,{checked:h.length===s.length&&s.length>0,onCheckedChange:He})}),a.jsx(Ge,{children:"Company"}),a.jsx(Ge,{children:"Contact"}),a.jsx(Ge,{children:"Industry"}),a.jsx(Ge,{children:"Audience"}),a.jsx(Ge,{children:"Status"}),a.jsx(Ge,{children:"Source"}),a.jsx(Ge,{children:"Last Contact"})]})}),a.jsx(Tc,{children:c.map(Y=>a.jsxs(xn,{children:[a.jsx(Ve,{children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(is,{checked:h.includes(Y.id),onCheckedChange:()=>Ne(Y.id)}),x.has(Y.id)&&a.jsx(Na,{className:"h-5 w-5 text-green-600"})]})}),a.jsxs(Ve,{children:[a.jsx("div",{className:"font-medium",children:Y.company_name}),Y.notes&&a.jsxs("div",{className:"text-sm text-muted-foreground",children:[Y.notes.slice(0,40),Y.notes.length>40?"...":""]})]}),a.jsx(Ve,{children:a.jsxs("div",{children:[a.jsx("div",{className:"font-medium text-sm",children:Y.contact_name}),a.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx(an,{className:"h-3 w-3"}),Y.email]}),Y.phone&&a.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx(ky,{className:"h-3 w-3"}),Y.phone]}
859)]})}),a.jsx(Ve,{children:Y.industry}),a.jsx(Ve,{children:a.jsx(ve,{variant:"secondary",children:Y.audience})}),a.jsx(Ve,{children:a.jsx(ve,{variant:"outline",className:ke(Y.status),children:Y.status.charAt(0).toUpperCase()+Y.status.slice(1)})}),a.jsx(Ve,{children:Y.source}),a.jsx(Ve,{children:Y.last_contact?new Date(Y.last_contact).toLocaleDateString():"Never"})]},Y.id))})]}),a.jsxs("div",{className:"flex items-center justify-center gap-2 pt-4",children:[a.jsxs(U,{variant:"outline",size:"sm",onClick:()=>D(Y=>Math.max(1,Y-1)),disabled:A===1,children:[a.jsx(u1,{className:"h-4 w-4 mr-1"}),"Previous"]}),a.jsx("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(10,Math.ceil(u/F))},(Y,_e)=>{const Oe=Math.ceil(u/F);let Ee;return Oe<=10||A<=5?Ee=_e+1:A>=Oe-4?Ee=Oe-9+_e:Ee=A-4+_e,a.jsx(U,{variant:A===Ee?"default":"outline",size:"sm",onClick:()=>D(Ee),className:"w-10",children:Ee},Ee)})}),a.jsxs(U,{variant:"outline",size:"sm",onClick:()=>D(Y=>Math.min(Math.ceil(u/F),Y+1)),disabled:A>=Math.ceil(u/F),children:["Next",a.jsx(Zd,{className:"h-4 w-4 ml-1"})]})]}),a.jsxs("div",{className:"flex items-center justify-center gap-2 pt-2",children:[a.jsx("span",{className:"text-xs text-muted-foreground",children:"Jump to page:"}),[20,50,100].map(Y=>{const _e=Math.ceil(u/F);return Y<=_e?a.jsx(U,{variant:"ghost",size:"sm",onClick:()=>D(Y),className:"h-7 text-xs",children:Y},Y):null})]})]})})]})]})})):(console.log("LeadsManagement: not admin, redirecting"),a.jsx(Al,{to:"/dashboard",replace:!0}))};function n4e(){const[e,t]=g.useState("7d"),[r,n]=g.useState(null),[s,i]=g.useState(!0),[o,l]=g.useState({from:void 0,to:void 0}),[c,d]=g.useState(!1);g.useEffect(()=>{f()},[e,o]),g.useEffect(()=>{const b=setInterval(()=>{c||f()},3e4);return()=>clearInterval(b)},[e,c]);const u=()=>{switch(e){case"24h":return 1;case"7d":return 7;case"30d":return 30;case"90d":return 90;default:return 7}},f=async()=>{i(!0);let b,y=SI(new Date);if(c&&o.from)b=Uo(o.from),o.to&&(y=SI(o.to));else{const w=u();b=Uo(av(new Date,w))}console.log("ð
Date Range:",{period:e,startDate:b.toISOString(),endDate:y.toISOString(),daysCount:u()});try{const{data:w}=await Z.from("analytics_events").select("*").eq("event_type","page_view").gte("created_at",b.toISOString()).lte("created_at",y.toISOString()).order("created_at",{ascending:!0});if(console.log("ð Page Views Query Result:",{totalRecords:(w==null?void 0:w.length)||0,hasData:!!w,sampleWithLocation:w==null?void 0:w.find(R=>R.city&&R.country)}),!w||w.length===0){n(h()),i(!1);return}const _=w.length,N=new Set(w.map(R=>R.session_id)).size,{data:j}=await Z.from("analytics_events").select("duration_seconds").eq("event_type","page_duration").gte("created_at",b.toISOString()).not("duration_seconds","is",null),S=j&&j.length>0?m(j.reduce((R,O)=>R+(O.duration_seconds||0),0)/j.length):"0:00",C=w.reduce((R,O)=>(R[O.session_id]=(R[O.session_id]||0)+1,R),{}),P=Object.keys(C).length,A=Object.values(C).filter(R=>R===1).length,D=P>0?`${Math.round(A/P*100)}%`:"0%",F=w.reduce((R,O)=>{const k=bt(new Date(O.created_at),"yyyy-MM-dd");return R[k]||(R[k]={views:0,sessions:new Set}),R[k].views++,R[k].sessions.add(O.session_id),R},{}),q=Object.entries(F).map(([R,O])=>({date:R,views:O.views,visitors:O.sessions.size})),B=w.reduce((R,O)=>(R[O.page_path]||(R[O.page_path]={views:0,sessions:new Set,durations:[]}),R[O.page_path].views++,R[O.page_path].sessions.add(O.session_id),R),{});if(j){const{data:R}=await Z.from("analytics_events").select("page_path, duration_seconds").eq("event_type","page_duration").gte("created_at",b.toISOString()).not("duration_seconds","is",null);R&&R.forEach(O=>{B[O.page_path]&&B[O.page_path].durations.push(O.duration_seconds)})}const V=Object.entries(B).sort(([,R],[,O])=>O.views-R.views).slice(0,10).map(([R,O])=>{const k=O.durations.length>0?m(O.durations.reduce(($,ae)=>$+ae,0)/O.durations.length):"0:00",G=Array.from(O.sessions).filter($=>C[$]===1).length,te=O.sessions.size>0?`${Math.round(G/O.sessions.size*100)}%`:"0%";return{page:R,views:O.views,avgTime:k,bounceRate:te}}),E=w.reduce((R,O)=>{const k=O.device_type||"desktop";return R[k]=(R[k]||0)+1,R},{}),M=[{name:"Desktop",value:Math.round((E.desktop||0)/_*100),color:"hsl(var(--primary))"},{name:"Mobile",value:Math.round((E.mobile||0)/_*100),color:"hsl(var(--secondary))"},{name:"Tablet",value:Math.round((E.tablet||0)/_*100),color:"hsl(var(--accent))"}],T=w.reduce((R,O)=>{const k=v(O.referrer);return R[k]=(R[k]||0)+1,R},{}),L=Object.entries(T).sort(([,R],[,O])=>O-R).map(([R,O])=>({source:R,visitors:O,percentage:Math.round(O/_*100)})),K=new Date(Date.now()-5*60*1e3),{data:H}=await Z.from("analytics_events").select("page_path, session_id").eq("event_type","page_view").gte("created_at",K.toISOString()),ee=H?new Set(H.map(R=>R.session_id)).size:0,se=(H==null?void 0:H.reduce((R,O)=>(R[O.page_path]=(R[O.page_path]||0)+1,R),{}))||{},ne=Object.entries(se).sort(([,R],[,O])=>O-R).slice(0,5).map(([R,O])=>({page:R,activeUsers:O})),W=w.reduce((R,O)=>{if(!O.country||O.country==="Unknown"||!O.city||O.city==="Unknown")return R;const k=O.country,G=O.city,te=O.country_code||"",$=`${k}|${G}`;
859return R[$]||(R[$]={visitors:new Set,city:G,country:k,country_code:te}),O.session_id&&R[$].visitors.add(O.session_id),R},{}),ie=Object.values(W).map(R=>({country:R.country,city:R.city,visitors:R.visitors.size,country_code:R.country_code})).sort((R,O)=>O.visitors-R.visitors).slice(0,10);console.log("ð Final Location Data:",{totalPageViews:w.length,uniqueLocations:Object.keys(W).length,locationsArray:ie,samplePageView:w.find(R=>R.city&&R.country)}),n({totalPageViews:_,uniqueVisitors:N,avgDuration:S,bounceRate:D,pageViewsData:q,topPages:V,deviceData:M,trafficSources:L,realTimeUsers:ee,activePages:ne,locations:ie})}catch(w){console.error("Error fetching analytics:",w),n(h())}finally{i(!1)}},h=()=>({totalPageViews:0,uniqueVisitors:0,avgDuration:"0:00",bounceRate:"0%",pageViewsData:[],topPages:[],deviceData:[{name:"Desktop",value:0,color:"hsl(var(--primary))"},{name:"Mobile",value:0,color:"hsl(var(--secondary))"},{name:"Tablet",value:0,color:"hsl(var(--accent))"}],trafficSources:[],realTimeUsers:0,activePages:[],locations:[]}),m=b=>{const y=Math.floor(b/60),w=Math.round(b%60);return`${y}:${w.toString().padStart(2,"0")}`},v=b=>{if(!b)return"Direct";try{const y=new URL(b),w=window.location.hostname;if(y.hostname===w||y.hostname.includes("pricebid.com"))return"Direct"}catch{return"Direct"}return b.includes("google")?"Google Search":b.includes("facebook")?"Facebook":b.includes("twitter")||b.includes("t.co")?"Twitter":b.includes("linkedin")?"LinkedIn":"Referral"},p=b=>{if(!b||b.length!==2)return"ð";const y=b.toUpperCase().split("").map(w=>127397+w.charCodeAt(0));return String.fromCodePoint(...y)};if(s||!r)return a.jsx(Gt,{children:a.jsx("div",{className:"p-6 flex items-center justify-center min-h-screen",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),a.jsx("p",{className:"text-muted-foreground",children:"Loading analytics data..."})]})})});const x=[{title:"Total Page Views",value:r.totalPageViews.toLocaleString(),change:"+12.5%",icon:ci,trend:"up"},{title:"Unique Visitors",value:r.uniqueVisitors.toLocaleString(),change:"+8.2%",icon:Mr,trend:"up"},{title:"Avg. Session Duration",value:r.avgDuration,change:"+5.1%",icon:np,trend:"up"},{title:"Bounce Rate",value:r.bounceRate,change:"-3.2%",icon:mh,trend:"down"}];return a.jsx(Gt,{children:a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-bold bg-gradient-to-r from-primary to-purple-600 bg-clip-text text-transparent",children:"Traffic Analytics"}),a.jsx("p",{className:"text-muted-foreground mt-2",children:"Real-time traffic tracking and user behavior analytics"})]}),a.jsxs("div",{className:"flex gap-2 items-center flex-wrap",children:[["24h","7d","30d","90d"].map(b=>a.jsx(U,{onClick:()=>{t(b),d(!1),l({from:void 0,to:void 0})},variant:e===b&&!c?"default":"outline",size:"sm",children:b},b)),a.jsxs(Wm,{children:[a.jsx(Hm,{asChild:!0,children:a.jsxs(U,{variant:c?"default":"outline",size:"sm",className:me("justify-start text-left font-normal"),children:[a.jsx(Br,{className:"mr-2 h-4 w-4"}),o.from?o.to?a.jsxs(a.Fragment,{children:[bt(o.from,"MMM d, yyyy")," - ",bt(o.to,"MMM d, yyyy")]}):bt(o.from,"MMM d, yyyy"):"Custom Range"]})}),a.jsx(Bu,{className:"w-auto p-0",align:"end",children:a.jsx(gP,{initialFocus:!0,mode:"range",defaultMonth:o.from,selected:{from:o.from,to:o.to},onSelect:b=>{b&&(l({from:b.from,to:b.to}),b.from&&d(!0))},numberOfMonths:2,className:"pointer-events-auto"})})]})]})]}),a.jsx(J,{className:"glass-card bg-gradient-to-r from-primary/10 to-purple-500/10 border-primary/20",children:a.jsx(re,{className:"p-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(V_,{className:"h-10 w-10 text-primary animate-pulse"}),a.jsx("div",{className:"absolute -top-1 -right-1 h-4 w-4 bg-green-500 rounded-full animate-ping"}),a.jsx("div",{className:"absolute -top-1 -right-1 h-4 w-4 bg-green-500 rounded-full"})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-3xl font-bold",children:r.realTimeUsers}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Active Users Right Now"})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Last updated"}),a.jsx("p",{className:"text-sm font-medium",children:"Just now"})]})]})})}),a.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-4",children:x.map(b=>{const y=b.icon;return a.jsx(J,{className:"glass-card hover-glow smooth-transition",children:a.jsxs(re,{className:"p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsx("div",{className:"p-3 bg-gradient-to-br from-primary/20 to-purple-500/20 rounded-xl",children:a.jsx(y,{className:"h-6 w-6 text-primary"})})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:b.title}),a.jsx("h3",{className:"text-3xl font-bold mt-1",children:b.value})]})]})},b.title)})}),a.jsxs(J,{className:"glass-card",children:[a.jsxs(de,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Ya,{className:"h-5 w-5 text-primary"}),"Visitor Locations"]}),a.jsx(nt,{children:"Geographic distribution of your visitors"})]}),a.jsx(re,{children:r.locations.length>0?a.jsx("div",{className:"space-y-4",children:r.locations.map((b,y)=>a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center text-2xl",children:p(b.country_code)}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:b.country}),a.jsx("p",{className:"text-sm text-muted-foreground",children:b.city})]})]}),a.jsxs(ve,{variant:"secondary",children:[b.visitors," visitors"]})]},y))}):a.jsx("div",{className:"py-8 text-center text-muted-foreground",children:"No location data available"})})]}),a.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[a.jsxs(J,{className:"glass-card",children:[a.jsxs(de,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Ft,{className:"h-5 w-5 text-primary"}),"Page Views & Visitors Trend"]}),a.jsx(nt,{children:"Daily traffic over the selected period"})]}),a.jsx(re,{children:r.pageViewsData.length>0?a.jsx(js,{width:"100%",height:300,children:a.jsxs(k6,{data:r.pageViewsData,children:[a.jsx(Il,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),a.jsx(Xa,{dataKey:"date",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Hn,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ar,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),a.jsx(Ao,{}),a.jsx(_i,{type:"monotone",dataKey:"views",stroke:"hsl(var(--primary))",strokeWidth:3,name:"Page Views"}),a.jsx(_i,{type:"monotone",dataKey:"visitors",stroke:"hsl(var(--secondary))",strokeWidth:3,name:"Unique Visitors"})]})}):a.jsx("div",{className:"h-[300px] flex items-center justify-center text-muted-foreground",children:"No data available for this period"})})]}),a.jsxs(J,{className:"glass-card",children:[a.jsxs(de,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Bq,{className:"h-5 w-5 text-primary"}),"Device Breakdown"]}),a.jsx(nt,{children:"Traffic distribution by device type"})]}),a.jsx(re,{className:"flex items-center justify-center",children:r.deviceData.some(b=>b.value>0)?a.jsxs("div",{className:"flex items-center gap-8",children:[a.jsx(js,{width:200,height:200,children:a.jsx(Wb,{children:a.jsx(ka,{data:r.deviceData,cx:"50%",cy:"50%",innerRadius:60,outerRadius:80,paddingAngle:5,dataKey:"value",children:r.deviceData.map((b,y)=>a.jsx(Jo,{fill:b.color},`cell-${y}`))})})}),a.jsx("div",{className:"space-y-3",children:r.deviceData.map(b=>a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:b.color}}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:b.name}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[b.value,"%"]})]})]},b.name))})]}):a.jsx("div",{className:"h-[200px] flex items-center justify-center text-muted-foreground",children:"No device data available"})})]})]}),a.jsxs(Ac,{defaultValue:"pages",className:"space-y-4",children:[a.jsxs(ol,{className:"glass-card",children:[a.jsx(Ot,{value:"pages",children:"Top Pages"}),a.jsx(Ot,{value:"sources",children:"Traffic Sources"}),a.jsx(Ot,{value:"realtime",children:"Real-Time"})]}),a.jsx(Rt,{value:"pages",children:a.jsxs(J,{className:"glass-card",children:[a.jsxs(de,{children:[a.jsx(le,{children:"Top Performing Pages"}),a.jsx(nt,{children:"Most visited pages with engagement metrics"})]}),a.jsx(re,{children:r.topPages.length>0?a.jsxs(Ec,{children:[a.jsx(Oc,{children:a.jsxs(xn,{children:[a.jsx(Ge,{children:"Page URL"}),a.jsx(Ge,{className:"text-right",children:"Page Views"}),a.jsx(Ge,{className:"text-right",children:"Avg. Time"}),a.jsx(Ge,{className:"text-right",children:"Bounce Rate"})]})}),a.jsx(Tc,{children:r.topPages.map(b=>a.jsxs(xn,{children:[a.jsx(Ve,{className:"font-mono text-sm",children:b.page}),a.jsx(Ve,{className:"text-right font-medium",children:b.views.toLocaleStr
859ing()}),a.jsx(Ve,{className:"text-right",children:b.avgTime}),a.jsx(Ve,{className:"text-right",children:a.jsx(ve,{variant:parseInt(b.bounceRate)>45?"destructive":"default",children:b.bounceRate})})]},b.page))})]}):a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No page data available yet"})})]})}),a.jsx(Rt,{value:"sources",children:a.jsxs(J,{className:"glass-card",children:[a.jsxs(de,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Iq,{className:"h-5 w-5 text-primary"}),"Traffic Sources"]}),a.jsx(nt,{children:"Where your visitors are coming from"})]}),a.jsx(re,{children:r.trafficSources.length>0?a.jsx("div",{className:"space-y-4",children:r.trafficSources.map(b=>a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"font-medium",children:b.source}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[b.visitors.toLocaleString()," visitors (",b.percentage,"%)"]})]}),a.jsx("div",{className:"h-3 bg-muted rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-gradient-to-r from-primary to-purple-600 smooth-transition",style:{width:`${b.percentage}%`}})})]},b.source))}):a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No traffic source data available yet"})})]})}),a.jsx(Rt,{value:"realtime",children:a.jsxs(J,{className:"glass-card",children:[a.jsxs(de,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"relative flex h-3 w-3",children:[a.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),a.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-green-500"})]}),"Real-Time Active Users"]}),a.jsx(nt,{children:"Users active in the last 5 minutes"})]}),a.jsxs(re,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"text-5xl font-bold text-primary mb-2",children:r.realTimeUsers}),a.jsx("p",{className:"text-muted-foreground",children:"Active users right now"})]}),r.activePages.length>0?a.jsxs("div",{className:"space-y-3",children:[a.jsx("h4",{className:"font-semibold",children:"Active Pages"}),r.activePages.map(b=>a.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[a.jsx("span",{className:"font-mono text-sm",children:b.page}),a.jsxs(ve,{variant:"outline",className:"bg-green-500/10 text-green-600 border-green-500/20",children:[b.activeUsers," users"]})]},b.page))]}):a.jsx("div",{className:"text-center py-4 text-muted-foreground",children:"No active users right now"})]})]})})]})]})})}class a4e{async measureTime(t){const r=Date.now(),n=await t(),s=Date.now()-r;return{result:n,duration:s}}async runContractAnalysisTests(){const t=[{name:"Automotive Parts Contract",title:"ARM, REARVIEW MIRROR Contract",content:"ARM, REARVIEW MIRROR for military vehicles. High-durability automotive parts with anti-glare coating. Quantity: 500 units. NAICS Code: 336390. Vehicle parts manufacturing.",expectedNAICS:"336390"},{name:"Software Development Contract",title:"Custom Software Development",content:"Custom software development services for government database system. Python programming, PostgreSQL database design, cloud deployment. 12-month development cycle.",expectedNAICS:"541511"},{name:"Construction Services Contract",title:"Building Construction Services",content:"Commercial building electrical installation and HVAC maintenance for federal facility. Includes electrical wiring, circuit installation, and maintenance services.",expectedNAICS:"238210"}],{result:r,duration:n}=await this.measureTime(async()=>{var l,c,d,u;const o=[];for(const f of t)try{const{data:h,error:m}=await Z.functions.invoke("analyze-contract-suggestions",{body:{contractContent:f.content,contractTitle:f.title}});if(m){o.push({test:f.name,status:"failed",error:m.message,expected:f.expectedNAICS,actual:null});continue}const v=(l=h.naics_suggestions)==null?void 0:l.some(p=>p.code===f.expectedNAICS);o.push({test:f.name,status:v?"passed":"warning",expected:f.expectedNAICS,actual:((d=(c=h.naics_suggestions)==null?void 0:c[0])==null?void 0:d.code)||"none",allSuggestions:((u=h.naics_suggestions)==null?void 0:u.map(p=>p.code))||[],analysisConfidence:h.extraction_confidence||0})}catch(h){o.push({test:f.name,status:"failed",error:h instanceof Error?h.message:"Unknown error",expected:f.expectedNAICS,actual:null})}return o}
859),s=r.filter(o=>o.status==="passed").length,i=s/t.length;return{name:"Contract Analysis Tests",status:i>=.8?"passed":i>=.6?"warning":"failed",details:{accuracy:Math.round(i*100),results:r,passedCount:s,totalCount:t.length},duration:n,recommendations:i<.8?["Improve AI prompt specificity for contract analysis","Enhance NAICS code mapping accuracy","Add more industry-specific keyword patterns"]:["Contract analysis accuracy within acceptable range"]}}async runPricingLogicTests(){const{result:t,duration:r}=await this.measureTime(async()=>{var l,c;const i=[{contractType:"automotive_parts",expectedMin:5e4,expectedMax:3e5,content:"Vehicle parts supply contract - 500 automotive mirrors"},{contractType:"information_technology",expectedMin:2e5,expectedMax:6e5,content:"Software development - custom database system"},{contractType:"construction",expectedMin:3e5,expectedMax:8e5,content:"Building construction - electrical installation work"}],o=[];for(const d of i)try{const{data:u,error:f}=await Z.functions.invoke("generate-price-bid",{body:{contractContent:d.content,contractTitle:`${d.contractType} Contract`,naicsCode:d.contractType==="automotive_parts"?"336390":d.contractType==="information_technology"?"541511":"238210"}});if(f){o.push({test:d.contractType,status:"failed",error:f.message});continue}const h=((l=u.pricing_analysis)==null?void 0:l.suggested_price)||0,m=h>=d.expectedMin&&h<=d.expectedMax;o.push({test:d.contractType,status:m?"passed":"warning",suggestedPrice:h,expectedRange:{min:d.expectedMin,max:d.expectedMax},withinRange:m,priceBreakdown:((c=u.pricing_analysis)==null?void 0:c.breakdown)||null})}catch(u){o.push({test:d.contractType,status:"failed",error:u instanceof Error?u.message:"Unknown error"})}return o}),n=t.filter(i=>i.status==="passed").length,s=n/t.length;return{name:"Pricing Logic Tests",status:s>=.8?"passed":s>=.6?"warning":"failed",details:{accuracy:Math.round(s*100),results:t,passedCount:n,totalCount:t.length},duration:r,recommendations:s<.8?["Review and calibrate pricing algorithms","Update industry baseline pricing data","Improve cost estimation for different contract types"]:["Pricing logic performing within expected ranges"]}}async runEdgeFunctionConnectivityTests(){const{result:t,duration:r}=await this.measureTime(async()=>{const i=["analyze-contract-suggestions","generate-price-bid","fetch-contract-content","process-manual-text","suggest-bid-range"],o=[];for(const l of i)try{const{data:c,error:d}=await Z.functions.invoke(l,{body:{test:!0,minimal:!0}});o.push({function:l,status:d?"warning":"passed",accessible:!d,responseReceived:!!c,error:(d==null?void 0:d.message)||null})}catch(c){o.push({function:l,status:"failed",accessible:!1,error:c instanceof Error?c.message:"Unknown connectivity error"})}return o}),n=t.filter(i=>i.status==="passed").length,s=n/t.length;return{name:"Edge Function Connectivity Tests",status:s>=.9?"passed":s>=.7?"warning":"failed",details:{connectivity:Math.round(s*100),results:t,functionalCount:n,totalFunctions:t.length},duration:r,recommendations:s<.9?["Check edge function deployment status","Verify environment variables and secrets","Review function error logs for specific issues"]:["All edge functions accessible and responsive"]}}async runFullSystemTest(){console.log("ð Starting comprehensive system validation tests...");const t=Date.now(),r=[];try{const[n,s,i]=await Promise.all([this.runContractAnalysisTests(),this.runPricingLogicTests(),this.runEdgeFunctionConnectivityTests()]);r.push(n,s,i);const o=r.filter(h=>h.status==="passed").length,l=r.filter(h=>h.status==="failed").length,c=r.filter(h=>h.status==="warning").length,d=l>0?"failed":c>0?"warning":"passed",u=r.flatMap(h=>h.recommendations||[]),f=[...new Set(u)];return{timestamp:new Date().toISOString(),totalTests:r.length,passed:o,failed:l,warnings:c,results:r,overallStatus:d,recommendations:f}}catch(n){return console.error("System test execution failed:",n),{timestamp:new Date().toISOString(),totalTests:0,passed:0,failed:1,warnings:0,results:[{name:"System Test Execution",status:"failed",details:{error:n instanceof Error?n.message:"Unknown error"},duration:Date.now()-t}],overallStatus:"failed",recommendations:["Critical system error - check console logs and edge function status"]}}}}const s4e=new a4e;function i4e(){const[e,t]=g.useState(null),[r,n]=g.useState(!1),{toast:s}=dt(),i=async()=>{n(!0);try{console.log("ð Starting comprehensive system validation...");const c=await s4e.runFullSystemTest();t(c),s({title:"System Validation Complete",description:`${c.passed}/${c.totalTests} tests passed`,variant:c.overallStatus==="failed"?"destructive":"default"})}catch(c){console.error("System test execution failed:",c),s({title:"Test Execution Failed",description:c instanceof Error?c.message:"Unknown error",variant:"destructive"})}finally{n(!1)}},o=c=>{switch(c){case"passed":return a.jsx(tr,{className:"h-4 w-4 text-green-500"});case"failed":return a.jsx(xi,{className:"h-4 w-4 text-red-500"});case"warning":return a.jsx(yi,{className:"h-4 w-4 text-yellow-500"});default:return null}},l=c=>{switch(c){case"passed":return"bg-green-500";case"failed":return"bg-red-500";case"warning":return"bg-yellow-500";default:return"bg-gray-500"}};return a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold",children:"System Validation Dashboard"}),a.jsx("p",{className:"text-muted-foreground",children:"Comprehensive testing suite for contract analysis engine"})]}),a.jsx(U,{onClick:i,disabled:r,size:"lg",children:r?a.jsxs(a.Fragment,{children:[a.jsx(Ur,{className:"h-4 w-4 mr-2 animate-spin"}),"Running Tests..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Gh,{className:"h-4 w-4 mr-2"}),"Run System Tests"]})})]}),e&&a.jsxs("div",{className:"grid gap-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs(J,{children:[a.jsx(de,{className:"pb-2",children:a.jsx(le,{className:"text-sm font-medium",children:"Overall Status"})}),a.jsx(re,{children:a.jsxs("div",{className:"flex items-center space-x-2",children:[o(e.overallStatus),a.jsx(ve,{variant:e.overallStatus==="passed"?"default":e.overallStatus==="failed"?"destructive":"secondary",children:e.overallStatus.toUpperCase()})]})})]}),a.jsxs(J,{children:[a.jsx(de,{className:"pb-2",children:a.jsx(le,{className:"text-sm font-medium",children:"Tests Passed"})}),a.jsxs(re,{children:[a.jsxs("div",{className:"text-2xl font-bold text-green-600",children:[e.passed,"/",e.totalTests]}),a.jsx(Qa,{value:e.passed/e.totalTests*100,className:"mt-2"})]})]}),a.jsxs(J,{children:[a.jsx(de,{className:"pb-2",children:a.jsx(le,{className:"text-sm font-medium",children:"Warnings"})}),a.jsx(re,{children:a.jsx("div",{className:"text-2xl font-bold text-yellow-600",children:e.warnings})})]}),a.jsxs(J,{children:[a.jsx(de,{className:"pb-2",children:a.jsx(le,{className:"text-sm font-medium",children:"Failed"})}),a.jsx(re,{children:a.jsx("div",{className:"text-2xl font-bold text-red-600",children:e.failed})})]})]}),a.jsxs(J,{children:[a.jsxs(de,{children:[a.jsx(le,{children:"Test Results"}),a.jsx(nt,{children:"Detailed results from system validation tests"})]}),a.jsx(re,{children:a.jsx("div",{className:"space-y-4",children:e.results.map((c,d)=>a.jsxs("div",{className:"border rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[o(c.status),a.jsx("h3",{className:"font-semibold",children:c.name}),a.jsxs(ve,{variant:"outline",children:[c.duration,"ms"]})]}),a.jsx("div",{className:`w-3 h-3 rounded-full ${l(c.status)}`})]}),c.details.accuracy&&a.jsxs("div",{className:"mb-2",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Accuracy: "}),a.jsxs("span",{className:"font-medium",children:[c.details.accuracy,"%"]})]}),c.details.results&&a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium",children:"Individual Test Results:"}),a.jsx("div",{className:"space-y-1",children:c.details.results.map((u,f)=>a.jsxs("div",{className:"flex items-center justify-between text-sm bg-muted/50 p-2 rounded",children:[a.jsx("span",{children:u.test||u.function}),a.jsxs("div",{className:"flex items-center space-x-2",children:[o(u.status),u.expected&&u.actual&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:["Expected: ",u.expected," | Got: ",u.actual]})]})]},f))})]}),c.recommendations&&c.recommendations.length>0&&a.jsxs("div",{className:"mt-3",children:[a.jsx("h4",{className:"text-sm font-medium mb-2",children:"Recommendations:"}),a.jsx("ul",{className:"text-sm text-muted-foreground space-y-1",children:c.recommendations.map((u,f)=>a.jsxs("li",{className:"flex items-start space-x-2",children:[a.jsx("span",{className:"text-blue-500",children:"â¢"}),a.jsx("span",{children:u})]},f))})]})]},d))})})]}),e.recommendations.length>0&&a.jsxs(J,{children:[a.jsxs(de,{children:[a.jsx(le,{children:"System Recommendations"}),a.jsx(nt,{children:"Suggested improvements based on test results"})]}),a.jsx(re,{children:a.jsx("ul",{className:"space-y-2",children:e.recommendations.map((c,d)=>a.jsxs("li",{className:"flex items-start space-x-2",children:[a.jsx(yi,{className:"h-4 w-4 text-yellow-500 mt-0.5 flex-shrink-0"}),a.jsx("span",{className:"text-sm",children:c})]},d))})})]})]}),!e&&!r&&a.jsx(J,{children:a.jsxs(re,{className:"flex flex-col items-center justify-center py-12",children:[a.jsx(Gh,{className:"h-12 w-12 text-muted-foreground mb-4"}),a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Ready to Run System Tests"}),a.jsx("p",{className:"text-muted-foreground text-center mb-4",children:'Click the "Run System Tests" button to validate the contract analysis engine'})]})})]})}function o4e(){const[e,t]=g.useState(!1),[r,n]=g.useState(null),s=async()=>{t(!0);try{console.log("Starting system health check...");const{data:c,error:d}=await Z.functions.invoke("test-system-health");if(d){console.error("Health check error:",d),We.error("Health check failed: "+d.message);return}if(c!=null&&c.results){n(c.results);const u=c.results.overallHealth;u==="excellent"?We.success("System health: EXCELLENT â
"):u==="good"?We.success("System health: GOOD â ï¸"):u==="needs_attention"?We.error("System health: NEEDS ATTENTION â ï¸"):We.error("System health: CRITICAL â")}}catch(c){console.error("Health check exception:",c),We.error("Health check failed")}finally{t(!1)}},i=c=>
859{switch(c){case"passed":return a.jsx(tr,{className:"h-5 w-5 text-green-500"});case"failed":return a.jsx(xi,{className:"h-5 w-5 text-red-500"});case"warning":return a.jsx(qh,{className:"h-5 w-5 text-yellow-500"});case"testing":return a.jsx(Je,{className:"h-5 w-5 text-blue-500 animate-spin"});default:return a.jsx(qh,{className:"h-5 w-5 text-gray-500"})}},o=c=>{switch(c){case"passed":return a.jsx(ve,{variant:"default",className:"bg-green-100 text-green-800",children:"Passed"});case"failed":return a.jsx(ve,{variant:"destructive",children:"Failed"});case"warning":return a.jsx(ve,{variant:"secondary",className:"bg-yellow-100 text-yellow-800",children:"Warning"});case"testing":return a.jsx(ve,{variant:"outline",children:"Testing..."});default:return a.jsx(ve,{variant:"outline",children:"Unknown"})}},l=c=>{switch(c){case"excellent":return a.jsx(ve,{className:"bg-green-100 text-green-800",children:"EXCELLENT"});case"good":return a.jsx(ve,{className:"bg-blue-100 text-blue-800",children:"GOOD"});case"needs_attention":return a.jsx(ve,{className:"bg-yellow-100 text-yellow-800",children:"NEEDS ATTENTION"});case"critical":return a.jsx(ve,{variant:"destructive",children:"CRITICAL"});default:return a.jsx(ve,{variant:"outline",children:"TESTING"})}};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold",children:"System Health Checker"}),a.jsx("p",{className:"text-muted-foreground",children:"Real-time validation of all system components"})]}),a.jsx(U,{onClick:s,disabled:e,className:"min-w-[150px]",children:e?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"mr-2 h-4 w-4 animate-spin"}),"Running..."]}):"Run Health Check"})]}),r&&a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center justify-between",children:["Overall System Health",l(r.overallHealth)]})}),a.jsx(re,{children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"border rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("h3",{className:"font-semibold flex items-center gap-2",children:[i(r.contractAnalysis.status),"Contract Analysis"]}),o(r.contractAnalysis.status)]}),a.jsx("div",{className:"text-sm space-y-1",children:r.contractAnalysis.details.map((c,d)=>a.jsx("p",{className:"text-muted-foreground",children:c},d))})]}),a.jsxs("div",{className:"border rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("h3",{className:"font-semibold flex items-center gap-2",children:[i(r.pricingEngine.status),"Pricing Engine"]}),o(r.pricingEngine.status)]}),a.jsx("div",{className:"text-sm space-y-1",children:r.pricingEngine.details.map((c,d)=>a.jsx("p",{className:"text-muted-foreground",children:c},d))})]}),a.jsxs("div",{className:"border rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("h3",{className:"font-semibold flex items-center gap-2",children:[i(r.linkProcessing.status),"Link Processing"]}),o(r.linkProcessing.status)]}),a.jsx("div",{className:"text-sm space-y-1",children:r.linkProcessing.details.map((c,d)=>a.jsx("p",{className:"text-muted-foreground",children:c},d))})]}),a.jsxs("div",{className:"border rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("h3",{className:"font-semibold flex items-center gap-2",children:[i(r.naicsAccuracy.status),"NAICS Accuracy"]}),o(r.naicsAccuracy.status)]}),a.jsx("div",{className:"text-sm space-y-1",children:r.naicsAccuracy.details.map((c,d)=>a.jsx("p",{className:"text-muted-foreground",children:c},d))})]})]})})]}),!r&&!e&&a.jsx(J,{children:a.jsx(re,{className:"text-center py-8",children:a.jsx("p",{className:"text-muted-foreground",children:'Click "Run Health Check" to validate all system components'})})})]})}function l4e(){const[e,t]=g.useState(null),[r,n]=g.useState(!1),{toast:s}=dt(),i=async()=>{n(!0);try{console.log("ð Starting pricing engine validation...");const{data:c,error:d}=await lt.functions.invoke("pricing-validation-test",{body:{testMode:!0}});if(d){console.error("Pricing validation error:",d),s({title:"Validation Failed",description:d.message||"Unknown error occurred",variant:"destructive"});return}t(c),s({title:"Pricing Validation Complete",description:`${c.summary.passed}/${c.summary.totalTests} tests passed (${c.summary.accuracy})`,variant:c.overallStatus==="FAILED"?"destructive":"default"})}catch(c){console.error("Pricing validation execution failed:",c),s({title:"Validation Execution Failed",description:c instanceof Error?c.message:"Unknown error",variant:"destructive"})}finally{n(!1)}},o=c=>{switch(c){case"PASSED":return a.jsx(tr,{className:"h-4 w-4 text-green-500"});case"FAILED":return a.jsx(xi,{className:"h-4 w-4 text-red-500"});case"WARNING":return a.jsx(yi,{className:"h-4 w-4 text-yellow-500"});default:return null}},l=c=>{switch(c){case"PASSED":return"bg-green-500";case"FAILED":return"bg-red-500";case"WARNING":return"bg-yellow-500";default:return"bg-gray-500"}};return a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold",children:"Pricing Engine Validation"}),a.jsx("p",{className:"text-muted-foreground",children:"Comprehensive testing of government contract pricing accuracy"})]}),a.jsx(U,{onClick:i,disabled:r,size:"lg",children:r?a.jsxs(a.Fragment,{children:[a.jsx(Ur,{className:"h-4 w-4 mr-2 animate-spin"}),"Running Validation..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Gh,{className:"h-4 w-4 mr-2"}),"Run Pricing Tests"]})})]}),e&&a.jsxs("div",{className:"grid gap-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs(J,{children:[a.jsx(de,{className:"pb-2",children:a.jsx(le,{className:"text-sm font-medium",children:"Overall Status"})}),a.jsx(re,{children:a.jsxs("div",{className:"flex items-center space-x-2",children:[o(e.overallStatus),a.jsx(ve,{variant:e.overallStatus==="PASSED"?"default":e.overallStatus==="FAILED"?"destructive":"secondary",children:e.overallStatus})]})})]}),a.jsxs(J,{children:[a.jsx(de,{className:"pb-2",children:a.jsx(le,{className:"text-sm font-medium",children:"Accuracy"})}),a.jsxs(re,{children:[a.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.summary.accuracy}),a.jsx(Qa,{value:parseInt(e.summary.accuracy.replace("%","")),className:"mt-2"})]})]}),a.jsxs(J,{children:[a.jsx(de,{className:"pb-2",children:a.jsx(le,{className:"text-sm font-medium",children:"Tests Passed"})}),a.jsx(re,{children:a.jsxs("div",{className:"text-2xl font-bold text-green-600",children:[e.summary.passed,"/",e.summary.totalTests]})})]}),a.jsxs(J,{children:[a.jsx(de,{className:"pb-2",children:a.jsx(le,{className:"text-sm font-medium",children:"Critical Issues"})}),a.jsx(re,{children:a.jsx("div",{className:"text-2xl font-bold text-red-600",children:e.criticalIssues.length})})]})]}),e.criticalIssues.length>0&&a.jsxs(J,{className:"border-red-200 bg-red-50",children:[a.jsx(de,{children:a.jsxs(le,{className:"text-red-800 flex items-center gap-2",children:[a.jsx(xi,{className:"h-5 w-5"}),"Critical Issues Detected"]})}),a.jsx(re,{children:a.jsx("ul",{className:"space-y-2",children:e.criticalIssues.map((c,d)=>a.jsxs("li",{className:"text-red-700 flex items-start space-x-2",children:[a.jsx("span",{className:"text-red-500",children:"â¢"}),a.jsxs("span",{children:[c," - Failed validation"]})]},d))})})]}),a.jsxs(J,{children:[a.jsxs(de,{children:[a.jsx(le,{children:"Detailed Test Results"}),a.jsx(nt,{children:"Individual test case results and pricing analysis"})]}),a.jsx(re,{children:a.jsx("div",{className:"space-y-4",children:e.testResults.map((c,d)=>{var u,f,h,m,v,p,x,b,y;return a.jsxs("div",{className:"border rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[o(c.status),a.jsx("h3",{className:"font-semibold",children:c.testCase})]}),a.jsx("div",{className:`w-3 h-3 rounded-full ${l(c.status)}`})]}),c.error?a.jsxs("div",{className:"text-red-600 text-sm bg-red-50 p-2 rounded",children:["Error: ",c.error]}):c.validationResults&&a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Suggested Price:"}),a.jsxs("div",{className:"font-medium",children:["$",(u=c.validationResults.details.suggestedPrice)==null?void 0:u.toLocaleStr
859ing()]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Expected Range:"}),a.jsxs("div",{className:"font-medium",children:["$",(h=(f=c.validationResults.details.expectedRange)==null?void 0:f.min)==null?void 0:h.toLocaleString()," - $",(v=(m=c.validationResults.details.expectedRange)==null?void 0:m.max)==null?void 0:v.toLocaleString()]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"NAICS Code:"}),a.jsx("div",{className:"font-medium",children:c.validationResults.details.naicsCode})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Confidence:"}),a.jsxs("div",{className:"font-medium",children:[c.validationResults.confidenceLevel,"%"]})]})]}),c.validationResults.details.breakdown&&a.jsxs("div",{className:"bg-muted/50 p-3 rounded",children:[a.jsx("h4",{className:"text-sm font-medium mb-2",children:"Pricing Breakdown:"}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-xs",children:[a.jsxs("div",{children:["Labor: $",(p=c.validationResults.details.breakdown.direct_labor)==null?void 0:p.toLocaleString()]}),a.jsxs("div",{children:["Materials: $",(x=c.validationResults.details.breakdown.material_costs)==null?void 0:x.toLocaleString()]}),a.jsxs("div",{children:["Overhead: $",(b=c.validationResults.details.breakdown.overhead_cost)==null?void 0:b.toLocaleString()]}),a.jsxs("div",{children:["Profit: $",(y=c.validationResults.details.breakdown.profit_margin)==null?void 0:y.toLocaleString()]})]})]}),c.issues&&c.issues.length>0&&a.jsxs("div",{className:"bg-yellow-50 p-3 rounded",children:[a.jsx("h4",{className:"text-sm font-medium mb-2 text-yellow-800",children:"Issues Identified:"}),a.jsx("ul",{className:"text-sm text-yellow-700 space-y-1",children:c.issues.map((w,_)=>a.jsxs("li",{className:"flex items-start space-x-2",children:[a.jsx("span",{className:"text-yellow-500",children:"â¢"}),a.jsx("span",{children:w})]},_))})]}),c.recommendation&&a.jsxs("div",{className:"bg-blue-50 p-3 rounded",children:[a.jsx("h4",{className:"text-sm font-medium mb-2 text-blue-800",children:"Recommendation:"}),a.jsx("p",{className:"text-sm text-blue-700",children:c.recommendation})]})]})]},d)})})})]}),e.recommendations.length>0&&a.jsxs(J,{children:[a.jsxs(de,{children:[a.jsx(le,{children:"System Recommendations"}),a.jsx(nt,{children:"Suggested improvements for pricing engine accuracy"})]}),a.jsx(re,{children:a.jsx("ul",{className:"space-y-2",children:e.recommendations.map((c,d)=>a.jsxs("li",{className:"flex items-start space-x-2",children:[a.jsx(yi,{className:"h-4 w-4 text-yellow-500 mt-0.5 flex-shrink-0"}),a.jsx("span",{className:"text-sm",children:c})]},d))})})]})]}),!e&&!r&&a.jsx(J,{children:a.jsxs(re,{className:"flex flex-col items-center justify-center py-12",children:[a.jsx(Gh,{className:"h-12 w-12 text-muted-foreground mb-4"}),a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Ready to Validate Pricing Engine"}),a.jsx("p",{className:"text-muted-foreground text-center mb-4",children:'Click "Run Pricing Tests" to validate the accuracy of government contract pricing'})]})})]})}const c4e=[{id:"test-it-services",title:"IT Support Services RFP",content:"Request for Proposal for Custom Computer Programming Services. The Department of Defense requires software development and system integration services for mission-critical applications. NAICS Code: 541511. Contract value: $2,500,000.",expectedNAICS:"541511",expectedAgency:"Department of Defense"},{id:"test-food-service",title:"Cafeteria Services Contract",content:"The Veterans Affairs is seeking food service and catering providers for hospital cafeteria operations. Services include meal preparation, serving, and cleanup. NAICS: 722310. Estimated value: $500,000 annually.",expectedNAICS:"722310",expectedAgency:"Veterans Affairs"},{id:"test-manufacturing",title:"Cheese Manufacturing Contract",content:"Department of Agriculture procurement for cheese manufacturing and dairy product production. Contractor will produce and deliver various cheese products. NAICS Code: 311513. Contract ceiling: $1,200,000.",expectedNAICS:"311513",expectedAgency:"Department of Agriculture"},{id:"test-construction",title:"Electrical Installation Services",content:"General Services Administration requires electrical installation and maintenance services for federal buildings. Work includes wiring, lighting systems, and power distribution. NAICS: 238210. V
859alue: $850,000.",expectedNAICS:"238210",expectedAgency:"General Services Administration"},{id:"test-consulting",title:"Management Consulting Services",content:"The Department of Homeland Security needs management consulting and advisory services for organizational improvement. NAICS Code: 541611. Fixed price contract for $600,000.",expectedNAICS:"541611",expectedAgency:"Department of Homeland Security"}];function d4e(){const[e,t]=g.useState(!1),[r,n]=g.useState([]),[s,i]=g.useState(""),o=async()=>{var u,f,h,m,v;t(!0),n([]);const c=[];for(const p of c4e){i(p.title);const x=Date.now();try{const{data:b,error:y}=await Z.from("contracts").insert({title:p.title,content:p.content,status:"pending",user_id:(u=(await Z.auth.getUser()).data.user)==null?void 0:u.id,organization_id:(f=(await Z.auth.getUser()).data.user)==null?void 0:f.id}).select().single();if(y)throw y;const{data:w,error:_}=await Z.functions.invoke("analyze-contract-suggestions",{body:{contractContent:p.content,contractTitle:p.title}});if(_)throw _;const{data:N,error:j}=await Z.functions.invoke("parse-contract-details",{body:{contractId:b.id}});if(j)throw j;const S=Date.now()-x,P=((m=(h=w.naics_suggestions)==null?void 0:h[0])==null?void 0:m.code)===p.expectedNAICS,A=p.expectedAgency?(v=w.agency)==null?void 0:v.toLowerCase().includes(p.expectedAgency.toLowerCase()):!0;c.push({testCase:p,parsed:{suggestions:w,details:N},naicsMatch:P,agencyMatch:A,confidence:w.extraction_confidence||0,duration:S}),await Z.from("contracts").delete().eq("id",b.id)}catch(b){c.push({testCase:p,parsed:null,naicsMatch:!1,agencyMatch:!1,confidence:0,duration:Date.now()-x,error:b instanceof Error?b.message:"Unknown error"})}}n(c),t(!1),i("");const d=c.filter(p=>p.naicsMatch&&p.agencyMatch).length/c.length;We.success(`Tests complete! Pass rate: ${(d*100).toFixed(0)}%`)},l=c=>c.error?a.jsx(xi,{className:"w-5 h-5 text-destructive"}):c.naicsMatch&&c.agencyMatch?a.jsx(tr,{className:"w-5 h-5 text-green-500"}):a.jsx(qh,{className:"w-5 h-5 text-yellow-500"});return a.jsxs("div",{className:"space-y-6",children:[a.jsxs(J,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Contract Parsing Validator"}),a.jsx("p",{className:"text-muted-foreground",children:"Test parsing accuracy across different contract types"})]}),a.jsx(U,{onClick:o,disabled:e,children:e?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"w-4 h-4 mr-2 animate-spin"}),"Testing..."]}):"Run All Tests"})]}),s&&a.jsx("div",{className:"mt-4 p-4 bg-primary/10 rounded-lg",children:a.jsxs("p",{className:"text-sm font-medium",children:["Testing: ",s]})})]}),r.length>0&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs(J,{className:"p-6",children:[a.jsx("h3",{className:"text-xl font-bold mb-4",children:"Test Results Summary"}),a.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-3xl font-bold",children:r.length}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Tests"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-3xl font-bold text-green-500",children:r.filter(c=>c.naicsMatch&&c.agencyMatch).length}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Passed"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-3xl font-bold text-yellow-500",children:r.filter(c=>!c.naicsMatch||!c.agencyMatch).length}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Partial"})]}),a.jsxs("div",{className:"text-center",children:[a.jsxs("div",{className:"text-3xl font-bold",children:[(r.reduce((c,d)=>c+d.duration,0)/r.length/1e3).toFixed(1),"s"]}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Avg Time"})]})]})]}),r.map((c,d)=>{var u,f,h,m,v,p,x,b;return a.jsx(J,{className:"p-6",children:a.jsxs("div",{className:"flex items-start gap-4",children:[l(c),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"font-bold mb-2",children:c.testCase.title}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Expected NAICS:"}),a.jsx("span",{className:"ml-2 font-mono",children:c.testCase.expectedNAICS})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Got NAICS:"}),a.jsx("span",{className:`ml-2 font-mono ${c.naicsMatch?"text-green-500":"text-destructive"}`,children:((m=(h=(f=(u=c.parsed)==null?void 0:u.suggestions)==null?void 0:f.naics_suggestions)==null?void 0:h[0])==null?void 0:m.code)||"None"})]}),c.testCase.expectedAgency&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Expected Agency:"}),a.jsx("span",{className:"ml-2",children:c.testCase.expectedAgency})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Got Agency:"}),a.jsx("span",{className:`ml-2 ${c.agencyMatch?"text-green-500":"text-destructive"}`,children:((p=(v=c.parsed)==null?void 0:v.suggestions)==null?void 0:p.agency)||"None"})]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Confidence:"}),a.jsxs("span",{className:"ml-2",children:[(c.confidence*100).toFixed(0),"%"]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Duration:"}),a.jsxs("span",{className:"ml-2",children:[(c.duration/1e3).toFixed(1),"s"]})]})]}),c.error&&a.jsxs("div",{className:"mt-4 p-3 bg-destructive/10 rounded text-sm text-destructive",children:["Error: ",c.error]}),((b=(x=c.parsed)==null?void 0:x.suggestions)==null?void 0:b.naics_suggestions)&&a.jsxs("details",{className:"mt-4",children:[a.jsx("summary",{className:"cursor-pointer text-sm text-muted-foreground hover:text-foreground",children:"View all NAICS candidates"}),a.jsx("div",{className:"mt-2 space-y-2",children:c.parsed.suggestions.naics_suggestions.slice(0,3).map((y,w)=>
859a.jsxs("div",{className:"text-sm p-2 bg-muted rounded",children:[a.jsxs("div",{className:"font-mono font-bold",children:[y.code," - ",y.name]}),a.jsxs("div",{className:"text-muted-foreground",children:["Confidence: ",(y.confidence*100).toFixed(0),"%"]}),a.jsx("div",{className:"text-xs mt-1",children:y.reason})]},w))})]})]})]})},d)})]})]})}function u4e(){return a.jsxs(a.Fragment,{children:[a.jsx($r,{title:"System Testing Dashboard",description:"Comprehensive testing suite for government contract analysis platform"}),a.jsx("div",{className:"min-h-screen bg-background p-6",children:a.jsxs(Ac,{defaultValue:"parsing",className:"w-full",children:[a.jsxs(ol,{className:"grid w-full grid-cols-4",children:[a.jsx(Ot,{value:"parsing",children:"Parsing Tests"}),a.jsx(Ot,{value:"pricing-validation",children:"Pricing Validation"}),a.jsx(Ot,{value:"health-check",children:"Live Health Check"}),a.jsx(Ot,{value:"validation",children:"System Validation"})]}),a.jsx(Rt,{value:"parsing",children:a.jsx(d4e,{})}),a.jsx(Rt,{value:"pricing-validation",children:a.jsx(l4e,{})}),a.jsx(Rt,{value:"health-check",children:a.jsx(o4e,{})}),a.jsx(Rt,{value:"validation",children:a.jsx(i4e,{})})]})})]})}const f4e=()=>{const[e,t]=g.useState("Ready to send"),[r,n]=g.useState(0),[s,i]=g.useState(0),[o,l]=g.useState(!1),c=async()=>{try{l(!0),t("Calling edge function..."),console.log("Invoking resend-campaign...");const{data:d,error:u}=await Z.functions.invoke("resend-campaign",{body:{campaignId:"fe54a82e-04e5-4455-8c75-006b12908afe",excludeDelivered:!1}});if(console.log("Response:",{data:d,error:u}),u){t(`Error: ${u.message}`),l(!1);return}i((d==null?void 0:d.count)||0),t(`Success! Resending ${(d==null?void 0:d.count)||0} emails with verified domain [email protected]`),l(!1)}catch(d){console.error("Error:",d),t(`Error: ${d.message}`),l(!1)}};return a.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:a.jsxs("div",{className:"max-w-md w-full space-y-6 text-center",children:[a.jsx("h1",{className:"text-3xl font-bold",children:"Campaign Send"}),a.jsx("p",{className:"text-lg",children:e}),s>0&&a.jsxs("div",{className:"text-5xl font-bold text-primary",children:[r," / ",s]}),a.jsx(U,{onClick:c,disabled:o,size:"lg",className:"w-full",children:o?"Sending...":"Resend Campaign (999 emails)"})]})})},h4e=()=>{const e=vt();return a.jsxs(a.Fragment,{children:[a.jsx($r,{title:"100% Money Back Guarantee Terms - PriceBid",description:"Detailed terms and conditions for PriceBid's 100% money back guarantee for government contract bidding software.",keywords:"money back guarantee, terms, government contracts, bidding software, refund policy"}),a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-background via-background to-muted/20",children:a.jsxs("div",{className:"container mx-auto px-4 py-16",children:[a.jsxs("div",{className:"text-center mb-12",children:[a.jsx("div",{className:"flex justify-center mb-6",children:a.jsx("div",{className:"w-20 h-20 bg-gradient-to-r from-green-500 to-emerald-500 rounded-full flex items-center justify-center",children:a.jsx("svg",{className:"w-10 h-10 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})})})}),a.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-gradient mb-4",children:"100% Money Back Guarantee"}),a.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"Complete terms and conditions for our comprehensive money back guarantee"})]}),a.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[a.jsxs(J,{className:"gradient-card",children:[a.jsx(de,{children:a.jsx(le,{className:"text-2xl text-gradient",children:"Guarantee Overview"})}),a.jsxs(re,{className:"space-y-4",children:[a.jsx("p",{className:"text-lg text-foreground",children:"We stand behind PriceBid's ability to improve your government contract bidding success. Our 100% money back guarantee ensures you can invest in your business growth with complete confidence."}),a.jsx("div",{className:"bg-primary/10 border border-primary/20 rounded-lg p-4",children:a.jsx("p",{className:"text-primary font-semibold",children:"If PriceBid doesn't help improve your bid accuracy or win rate after meeting our guarantee requirements, we'll refund your entire annual subscription - no questions asked."})})]})]}),a.jsxs(J,{className:"gradient-card",children:[a.jsx(de,{children:a.jsx(le,{className:"text-2xl text-gradient",children:"Eligibility Requirements"})}),a.jsx(re,{className:"space-y-6",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-primary rounded-full flex items-center justify-center",children:a.jsx("svg",{className:"w-4 h-4 text-white",f
859ill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),a.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Annual Subscription"})]}),a.jsx("p",{className:"text-muted-foreground ml-11",children:"You must purchase any annual subscription plan (Basic, Standard, Professional, or Enterprise) to be eligible for the money back guarantee."})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-primary rounded-full flex items-center justify-center",children:a.jsx("svg",{className:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"})})}),a.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Monthly Activity"})]}),a.jsx("p",{className:"text-muted-foreground ml-11",children:"Submit at least 2 bids per month using PriceBid's analysis and pricing tools. This ensures active engagement with our platform throughout your subscription year."})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-primary rounded-full flex items-center justify-center",children:a.jsx("svg",{className:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),a.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Full Year Commitment"})]}),a.jsx("p",{className:"text-muted-foreground ml-11",children:"Complete your full annual subscription period while maintaining the minimum 2 bids per month requirement to qualify for the guarantee."})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-primary rounded-full flex items-center justify-center",children:a.jsx("svg",{className:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),a.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Documentation"})]}),a.jsx("p",{className:"text-muted-foreground ml-11",children:"Maintain records of your bid submissions and outcomes to demonstrate platform usage and support any guarantee claims."})]})]})})]}),a.jsxs(J,{className:"gradient-card",children:[a.jsx(de,{children:a.jsx(le,{className:"text-2xl text-gradient",children:"How to Claim Your Refund"})}),a.jsx(re,{className:"space-y-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-8 h-8 bg-primary rounded-full flex items-center justify-center flex-shrink-0 mt-1",children:a.jsx("span",{className:"text-white font-bold text-sm",children:"1"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Contact Support"}),a.jsxs("p",{className:"text-muted-foreground",children:["Email our support team at ",a.jsx("span",{className:"text-primary font-medium",children:"[email protected]"})," with your refund request after completing your annual commitment period."]})]})]}),a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-8 h-8 bg-primary rounded-full flex items-center justify-center flex-shrink-0 mt-1",children:a.jsx("span",{className:"text-white font-bold text-sm",children:"2"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Provide Documentation"}),a.jsx("p",{className:"text-muted-foreground",children:"Submit proof of your monthly bid submissions (minimum 2 per month) and any relevant outcome data that demonstrates your experience with the platform."})]})]}),a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-8 h-8 bg-primary rounded-full flex items-center justify-center flex-shrink-0 mt-1",children:a.jsx("span",{className:"text-white font-bold text-sm",children:"3"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Qu
859ick Processing"}),a.jsx("p",{className:"text-muted-foreground",children:"Once eligibility is confirmed, we'll process your full refund within 2 business days. No lengthy reviews or complicated procedures."})]})]})]})})]}),a.jsxs(J,{className:"gradient-card",children:[a.jsx(de,{children:a.jsx(le,{className:"text-2xl text-gradient",children:"Important Notes"})}),a.jsxs(re,{className:"space-y-4",children:[a.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:[a.jsx("h4",{className:"font-semibold text-amber-800 mb-2",children:"Guarantee Validity"}),a.jsx("p",{className:"text-amber-700 text-sm",children:"This guarantee applies only to annual subscription plans. Monthly subscriptions are not eligible. The guarantee period begins from your subscription start date."})]}),a.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[a.jsx("h4",{className:"font-semibold text-blue-800 mb-2",children:"Platform Usage"}),a.jsx("p",{className:"text-blue-700 text-sm",children:"To qualify, you must actively use PriceBid's core features including contract analysis, pricing calculations, and bid submissions. Simply logging in does not constitute active usage."})]}),a.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4",children:[a.jsx("h4",{className:"font-semibold text-green-800 mb-2",children:"Our Commitment"}),a.jsx("p",{className:"text-green-700 text-sm",children:"We're confident in PriceBid's value and are committed to your success. This guarantee reflects our dedication to helping government contractors improve their bidding outcomes."})]})]})]}),a.jsxs(J,{className:"gradient-card",children:[a.jsx(de,{children:a.jsx(le,{className:"text-2xl text-gradient",children:"Questions About Our Guarantee?"})}),a.jsxs(re,{className:"space-y-4",children:[a.jsx("p",{className:"text-muted-foreground",children:"If you have any questions about our money back guarantee or need clarification on the terms, our support team is here to help."}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("svg",{className:"w-5 h-5 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 4.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),a.jsx("span",{className:"text-foreground",children:"[email protected]"})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("svg",{className:"w-5 h-5 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"})}),a.jsx("span",{className:"text-foreground",children:"1-800-PRICEBID"})]})]})]})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center pt-8",children:[a.jsx(U,{onClick:()=>e("/"),className:"bg-primary hover:bg-primary/90",children:"Back to Home"}),a.jsx(U,{onClick:()=>e("/#plans"),variant:"outline",className:"border-primary text-primary hover:bg-primary hover:text-white",children:"View Pricing Plans"})]})]})]})})]})},oj=e=>{const t=parseInt(e.replace(/[,$]/g,""));return t>=1e9?`$${(t/1e9).toFixed(1)}B`:t>=1e6?`$${(t/1e6).toFixed(0)}M`:e},m4e=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),lj=e=>({Defense:"bg-red-500/10 text-red-700 dark:text-red-400",Healthcare:"bg-blue-500/10 text-blue-700 dark:text-blue-400",Technology:"bg-purple-500/10 text-purple-700 dark:text-purple-400",Transportation:"bg-green-500/10 text-green-700 dark:text-green-400",Energy:"bg-orange-500/10 text-orange-700 dark:text-orange-400",Infrastructure:"bg-indigo-500/10 text-indigo-700 dark:text-indigo-400"})[e]||"bg-muted text-muted-foreground",p4e=()=>{const[e,t]=g.useState([]),[r,n]=g.useState(!0),[s,i]=g.useState("Federal Spending"),[o,l]=g.useState(!1),c=vt(),{toast:d}=dt(),u=async()=>{var y;try{console.log("[News] Starting to fetch articles...");const{data:w,error:_}=await Z.from("news_articles").select("id, title, summary, content, source, agency, contract_value, location, category, trending, contract_date, published_at, image_url").order("contract_date",{ascending:!1}).limit(100);if(console.log("[News] Query executed, data:",w==null?void 0:w.length,"error:",_),_){if(console.error("[News] Database error:",_),(y=_.message)!=null&&y.includes("timeout")||_.code==="57014"){console.warn("[News] Database timeout - triggering regeneration"),d({title:"Regenerating articles...",description:"Database had issues, creating fresh articles now."}),await f();return}throw _}if((w==null?void 0:w.some(S=>["Defense","Healthcare","Technology"].includes(S.category)))||!w||w.length===0){console.log("[News] Triggering fresh article generation..."),d({title:"Generating articles...",description:"Creating fresh articles across all 6 categories..."}),await f();return}console.log("[News] Loaded",w.length,"articles"),console.log("[News] Categories:",[...new Set(w.map(S=>S.category))]),t(w);const j=w.filter(S=>!S.image_url);j.length>0&&(console.log(`[News] ${j.length} articles missing images, triggering backfill...`),h())}catch(w){console.error("[News] Fatal error:",w),t([]),d({title:"Error",description:"Please refresh the page",variant:"destructive"})}finally{n(!1)}},f=async()=>{try{n(!0),d({title:"Generating articles...",description:"Creating articles across all 6 categories (Federal Spending, Notable Awards, Private Contracts, Technology & AI, Small Business, Policy & Regulation). This takes about 30 seconds..."}),console.log("[News] Triggering article generation with manual trigger flag...");const{error:y}=await Z.functions.invoke("trigger-daily-news",{body:{trigger:"manual"}});if(y)throw console.error("[News] Error invoking trigger-daily-news:",y),y;console.log("[News] Generation triggered, waiting for completion..."),setTimeout(()=>{console.log("[News] Refetching articles after generation..."),u()},12e3)}catch(y){console.error("[News] Error triggering daily news:",y),d({title:"Error",description:"Failed to generate news articles. Please try again.",variant:"destructive"}),n(!1)}},h=async()=>{try{d({title:"Generating images...",description:"Generating images for all articles missing them. This will take a few minutes..."});const{data:y,error:w}=await Z.functions.invoke("backfill-article-images");if(w)throw w;d({title:"Image generation complete!",description:`Generated ${(y==null?void 0:y.successful)||0} images successfully.`}),setTimeout(()=>{u()},1e3)}catch(y){console.error("Error generating images:",y),d({title:"Error",description:"Failed to generate images. Please try again.",variant:"destructive"})}},m=y=>{c(`/news/${y}`)};if(g.useEffect(()=>{u();const y=Z.channel("news-updates").on("postgres_changes",{event:"INSERT",schema:"public",table:"news_articles"},()=>{u()}).subscribe();return()=>{Z.removeChannel(y)}},[]),r)return a.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary mx-auto"}),a.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading contract intelligence..."})]})});const v=e.filter(y=>s==="Federal Spending"?y.category==="Federal Spending":s==="Notable Awards"?y.category==="Notable Awards":s==="Small Business"?y.category==="Small Business":s==="Technology & AI"?y.category==="Technology & AI":s==="Policy & Regulation"?y.category==="Policy & Regulation":s.startsWith("Private:")?y.category===s:!0),p=v[0],x=v.slice(1,4),b=v.slice(4);return a.jsxs(a.Fragment,{children:[a.jsx($r,{title:"Government Contract News | Daily Federal Procurement Intelligence",description:"Breaking news on government contract awards. Real-time updates from DOD, Navy, Air Force, and federal agencies with AI-generated visual coverage.",keywords:"government contracts news, federal procurement, contract awards, defense contracts, live updates"}),a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx("header",{className:"border-b border-border bg-background/95 backdrop-blur sticky top-0 z-50",children:a.jsx("div",{className:"max-w-7xl mx-auto px-6 py-4",children:a.jsx(U,{variant:"ghost",size:"sm",asChild:!0,children:a.jsxs(je,{to:"/",className:"flex items-center gap-2",children:[a.jsx(Tr,{className:"w-4 h-4"}),"Back"]})})})}),a.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-6",children:[a.jsxs("div",{className:"text-center mb-4 border-b border-border pb-4",children:[a.jsx("h1",{className:"text-6xl font-nyt font-bold mb-4 tracking-tight",children:"The Contracts Today"}),a.jsxs("div",{className:"flex items-center justify-center gap-4 text-sm text-muted-foreground whitespace-nowrap",children:[a.jsx(Br,{className:"w-4 h-4"}),a.jsx("span",{children:new Date().toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}),a.jsx("span",{children:"â¢"}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),a.jsx("span",{children:"Live"})]})]})]}),a.jsx("nav",{className:"mb-8 border-b border-border hidden md:block",children:a.jsxs("div",{className:"flex flex-nowrap items-center justify-center gap-6 pb-3 overflow-x-auto",children:[a.jsx("button",{onClick:()=>i("Federal Spending"),className:`text-sm font-semibold hover:text-primary transition-colors ${s==="Federal Spending"?"text-primary":"text-muted-foreground"}`,children:"Federal Spending"}),a.jsx("button",{onClick:()=>i("Notable Awards"),className:`text-sm font-semibold hover:text-primary transition-colors ${s==="Notable Awards"?"text-primary":"text-muted-foreground"}`,children:"Notable Awards"}),a.jsx("button",{onClick:()=>i("Small Business"),className:`text-sm font-semibold hover:text-primary transition-colors ${s==="Small Business"?"text-primary":"text-muted-foreground"}`,children:"Small Business"}),a.jsx("button",{onClick:()=>i("Policy & Regulation"),className:`text-sm font-semibold hover:text-primary transition-colors ${s==="Policy & Regulation"?"text-primary":"text-muted-foreground"}`,children:"Policy & Regulation"}),a.jsx("button",{onClick:()=>i("Technology & AI"),className:`text-sm font-semibold hover:text-primary transition-colors ${s==="Technology & AI"?"text-primary":"text-muted-foreground"}`,children:"Technology & AI"}),a.jsxs(Fm,{children:[a.jsx(Bm,{asChild:!0,children:a.jsxs("button",{className:`text-sm font-semibold hover:text-primary transition-colors pb-1 flex items-center gap-1 ${s.startsWith("Private:")?"border-b-2 border-primary":"text-muted-foreground"}`,children:["Private Contracts",a.jsx(Go,{className:"w-3 h-3"})]})}),a.jsxs($u,{align:"center",className:"bg-background border-border",children:[a.jsx(Fr,{onClick:()=>i("Private: Energy"),children:"Energy & Utilities"}),a.jsx(Fr,{onClick:()=>i("Private: Healthcare"),children:"Healthcare & Pharma"}),a.jsx(Fr,{onClick:()=>i("Private: Manufacturing"),children:"Manufacturing & Industrials"}),a.jsx(Fr,{onClick:()=>i("Private: Technology"),children:"Technology & Software"}),a.jsx(Fr,{onClick:()=>i("Private: Construction"),children:"Construction & Real Estate"}),a.jsx(Fr,{onClick:()=>i("Private: Logistics"),children:"Logistics & Transportation"}),a.jsx(Fr,{onClick:()=>i("Private: Financing"),children:"Financial Services"})]})]})]})}),a.jsx("div",{className:"mb-8 md:hidden",children:a.jsxs(e0,{open:o,onOpenChange:l,children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border pb-3",children:[a.jsx("span",{className:"text-sm font-semibold text-primary",children:s}),a.jsx(F2,{asChild:!0,children:a.jsx(U,{variant:"ghost",size:"sm",children:a.jsx(K_,{className:"h-5 w-5"})})})]}),a.jsxs(_p,{side:"left",className:"w-[280px]",children:[a.jsx(t0,{children:a.jsx(r0,{children:"Categories"})}),a.jsxs("div",{className:"mt-6 flex flex-col gap-3",children:[a.jsx("button",{onClick:()=>{i("Federal Spending"),l(!1)},className:`text-left px-4 py-3 rounded-lg transition-colors ${s==="Federal Spending"?"bg-primary text-primary-foreground font-semibold":"hover:bg-muted"}`,children:"Federal Spending"}),a.jsx("button",{onClick:()=>{i("Notable Awards"),l(!1)},className:`text-left px-4 py-3 rounded-lg transition-colors ${s==="Notable Awards"?"bg-primary text-primary-foreground font-semibold":"hover:bg-muted"}`,children:"Notable Awards"}),a.jsx("button",{onClick:()=>{i("Small Business"),l(!1)},className:`text-left px-4 py-3 rounded-lg transition-colors ${s==="Small Business"?"bg-primary text-primary-foreground font-semibold":"hover:bg-muted"}`,children:"Small Business"}),a.jsx("button",{onClick:()=>{i("Policy & Regulation"),l(!1)},className:`text-left px-4 py-3 rounded-lg transition-colors ${s==="Policy & Regulation"?"bg-primary text-primary-foreground font-semibold":"hover:bg-muted"}`,children:"Policy & Regulation"}),a.jsx("button",{onClick:()=>{i("Technology & AI"),l(!1)},className:`text-left px-4 py-3 rounded-lg transition-colors ${s==="Technology & AI"?"bg-primary text-primary-foreground font-semibold":"hover:bg-muted"}`,children:"Technology & AI"}),a.jsxs("div",{className:"border-t border-border my-2 pt-2",children:[a.jsx("p",{className:"text-xs text-muted-foreground px-4 mb-2",children:"Private Contracts"}),a.jsx("button",{onClick:()=>{i("Private: Energy"),l(!1)},className:`w-full text-left px-4 py-2 rounded-lg transition-colors ${s==="Private: Energy"?"bg-primary text-primary-foreground font-semibold":"hover:bg-muted"}`,children:"Energy & Utilities"}),a.jsx("button",{onClick:()=>{i("Private: Healthcare"),l(!1)},className:`w-full text-left px-4 py-2 rounded-lg transition-colors ${s==="Private: Healthcare"?"bg-primary text-primary-foreground font-semibold":"hover:bg-muted"}`,children:"Healthcare & Pharma"}),a.jsx("button",{onClick:()=>{i("Private: Manufacturing"),l(!1)},className:`w-full text-left px-4 py-2 rounded-lg transition-colors ${s==="Private: Manufacturing"?"bg-primary text-primary-foreground font-semibold":"hover:bg-muted"}`,children:"Manufacturing & Industrials"}),a.jsx("button",{onClick:()=>{i("Private: Technology"),l(!1)},className:`w-full text-left px-4 py-2 rounded-lg transition-colors ${s==="Private: Technology"?"bg-primary text-primary-foreground font-semibold":"hover:bg-muted"}`,children:"Technology & Software"}),a.jsx("button",{onClick:()=>{i("Private: Construction"),l(!1)},className:`w-full text-left px-4 py-2 rounded-lg transition-colors ${s==="Private: Construction"?"bg-primary text-primary-foreground font-semibold":"hover:bg-muted"}`,children:"Construction & Real Estate"}),a.jsx("button",{onClick:()=>{i("Private: Logistics"),l(!1)},className:`w-full text-left px-4 py-2 rounded-lg transition-colors ${s==="Private: Logistics"?"bg-primary text-primary-foreground font-semibold":"hover:bg-muted"}`,children:"Logistics & Transportation"}),a.jsx("button",{onClick:()=>{i("Private: Financing"),l(!1)},className:`w-full text-left px-4 py-2 rounded-lg transition-colors ${s==="Private: Financing"?"bg-primary text-primary-foreground font-semibold":"hover:bg-muted"}`,children:"Financial Services"})]})]})]})]})}),v.length===0?a.jsxs("div",{className:"text-center py-20",children:[a.jsx(mr,{className:"w-20 h-20 text-muted-foreground mx-auto mb-6"}),a.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"No Articles Yet"}),a.jsx("p",{className:"text-muted-foreground",children:"Articles are generated automatically with images"})]}):a.jsxs("div",{className:"space-y-12",children:[p&&a.jsx("article",{className:"group cursor-pointer",onClick:()=>m(p.id),children:a.jsxs("div",{className:"grid md:grid-cols-2 gap-8 items-start",children:[a.jsxs("div",{className:"relative aspect-[16/10] overflow-hidden rounded-lg",children:[p.image_url?a.jsx("img",{src:p.image_url,alt:p.title,className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"}):a.jsx("div",{className:"w-full h-full bg-gradient-to-br from-primary/20 to-secondary/20"}),p.trending&&a.jsxs(ve,{className:"absolute top-4 left-4 bg-red-500 te
859xt-white",children:[a.jsx(Ft,{className:"w-3 h-3 mr-1"}),"Breaking"]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ve,{className:lj(p.category),children:p.category}),a.jsx("span",{className:"text-sm text-muted-foreground",children:m4e(p.published_at)})]}),a.jsx("h2",{className:"text-4xl font-inter font-bold leading-tight tracking-tight group-hover:text-primary transition-colors",children:p.title}),a.jsx("p",{className:"text-lg text-muted-foreground leading-relaxed",children:p.summary}),a.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-primary/10 rounded-full border border-primary/20",children:[a.jsx(Br,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"font-semibold text-primary",children:new Date(p.contract_date).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]}),a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-green-500/10 rounded-full border border-green-500/20",children:[a.jsx(Jt,{className:"w-4 h-4 text-green-600 dark:text-green-400"}),a.jsx("span",{className:"font-bold text-green-600 dark:text-green-400",children:oj(p.contract_value)})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(mr,{className:"w-4 h-4"}),a.jsx("span",{children:p.agency})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ya,{className:"w-4 h-4"}),a.jsx("span",{children:p.location})]})]})]})]})}),a.jsx("div",{className:"border-t border-border"}),x.length>0&&a.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:x.map((y,w)=>a.jsxs("article",{className:"group cursor-pointer space-y-4",onClick:()=>m(y.id),children:[a.jsxs("div",{className:"relative aspect-[16/10] overflow-hidden rounded-lg",children:[y.image_url?a.jsx("img",{src:y.image_url,alt:y.title,className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"}):a.jsx("div",{className:"w-full h-full bg-gradient-to-br from-primary/10 to-secondary/10"}),a.jsx(ve,{className:`absolute top-3 left-3 ${lj(y.category)}`,children:y.category})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h3",{className:"text-xl font-inter font-semibold leading-tight tracking-tight group-hover:text-primary transition-colors line-clamp-3",children:y.title}),a.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:y.summary}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-primary/10 rounded-full",children:[a.jsx(Br,{className:"w-3 h-3 text-primary"}),a.jsx("span",{className:"font-semibold text-primary",children:new Date(y.contract_date).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]}),a.jsx("span",{children:"â¢"}),a.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-green-500/10 rounded-full",children:[a.jsx(Jt,{className:"w-3 h-3 text-green-600 dark:text-green-400"}),a.jsx("span",{className:"font-bold text-green-600 dark:text-green-400",children:oj(y.contract_value)})]})]})]})]},y.id))}),b.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"border-t border-border"}),a.jsx("div",{className:"grid md:grid-cols-4 gap-6",children:b.map(y=>a.jsxs("article",{className:"group cursor-pointer space-y-3",onClick:()=>m(y.id),children:[y.image_url&&a.jsx("div",{className:"relative aspect-[16/10] overflow-hidden rounded-lg",children:a.jsx("img",{src:y.image_url,alt:y.title,className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(ve,{className:lj(y.category),variant:"outline",children:y.category}),a.jsx("h4",{className:"font-inter font-semibold leading-tight tracking-tight group-hover:text-primary transition-colors line-clamp-2",children:y.title}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-primary/10 rounded-full",children:[a.jsx(Br,{className:"w-3 h-3 text-primary"}),a.jsx("span",{className:"font-semibold text-primary",children:new Date(y.contract_date).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]}),a.jsx("span",{children:"â¢"}),a.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-green-500/10 rounded-full",children:[a.jsx(Jt,{className:"w-3 h-3 text-green-600 dark:text-green-400"}),a.jsx("span",{className:"font-bold text-green-600 dark:text-green-400",children:oj(y.contract_value)})]})]})]})]},y.id))})]})]})]})]})]})},g4e=e=>{const t=parseInt(e.replace(/[,$]/g,""));return t>=1e9?`$${(t/1e9).toFixed(1)}B`:t>=1e6?`$${(t/1e6).toFixed(0)}M`:e},v4e=e=>new Date(e).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}),x4e=e=>({Defense:"bg-red-500/10 text-red-700 dark:text-red-400",Healthcare:"bg-blue-500/10 text-blue-700 dark:text-blue-400",Technology:"bg-purple-500/10 text-purple-700 dark:text-purple-400",Transportation:"bg-green-500/10 text-green-700 dark:text-green-400",Energy:"bg-orange-500/10 text-orange-700 dark:text-orange-400",Infrastru
859cture:"bg-indigo-500/10 text-indigo-700 dark:text-indigo-400"})[e]||"bg-muted text-muted-foreground",y4e=()=>{const{id:e}=Uy(),t=vt(),{toast:r}=dt(),[n,s]=g.useState(null),[i,o]=g.useState(!0);if(g.useEffect(()=>{(async()=>{if(e){o(!0);try{const{data:d,error:u}=await Z.from("news_articles").select("*").eq("id",e).single();if(u)throw u;s(d)}catch(d){console.error("Error fetching article:",d),r({title:"Error",description:"Failed to load article",variant:"destructive"}),t("/news")}finally{o(!1)}}})()},[e,t,r]),i)return a.jsx("div",{className:"min-h-screen bg-gradient-background",children:a.jsx("div",{className:"flex items-center justify-center min-h-screen",children:a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary"})})});if(!n)return a.jsx("div",{className:"min-h-screen bg-gradient-background",children:a.jsxs("div",{className:"flex flex-col items-center justify-center min-h-screen gap-4",children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Article not found"}),a.jsx(U,{asChild:!0,children:a.jsxs(je,{to:"/news",children:[a.jsx(Tr,{className:"w-4 h-4 mr-2"}),"Back to News"]})})]})});const l={"@context":"https://schema.org","@type":"NewsArticle",headline:n.title,description:n.summary,image:n.image_url||"https://www.pricebid.com/og-image.png",datePublished:n.published_at,author:{"@type":"Organization",name:"Pricebi
859d"},publisher:{"@type":"Organization",name:"Pricebid",logo:{"@type":"ImageObject",url:"https://www.pricebid.com/logo.png"}}};return a.jsxs("div",{className:"min-h-screen bg-gradient-background",children:[a.jsx($r,{title:`${n.title} - Government Contract News`,description:n.summary,keywords:`${n.category}, government contracts, ${n.agency}, contract news, procurement`,url:`https://www.pricebid.com/news/${n.id}`,type:"article",image:n.image_url,structuredData:l}),a.jsx("article",{className:"min-h-screen bg-background",children:a.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-8",children:[a.jsx(U,{variant:"ghost",className:"mb-6",asChild:!0,children:a.jsxs(je,{to:"/news",children:[a.jsx(Tr,{className:"w-4 h-4 mr-2"}),"Back to News"]})}),a.jsxs("header",{className:"mb-8",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-4 flex-wrap",children:[a.jsx(ve,{className:x4e(n.category),children:n.category}),n.trending&&a.jsxs(ve,{className:"bg-red-500/10 text-red-700 dark:text-red-400",children:[a.jsx(Ft,{className:"w-3 h-3 mr-1"}),"Trending"]})]}),a.jsx("h1",{className:"text-4xl md:text-5xl font-bold leading-tight mb-4 tracking-tight",children:n.title}),a.jsx("p",{className:"text-xl text-muted-foreground mb-6 leading-relaxed",children:n.summary}),a.jsxs("div",{className:"flex items-center gap-6 text-sm text-muted-foreground flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(np,{className:"w-4 h-4"}),a.jsx("span",{children:v4e(n.published_at)})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(mr,{className:"w-4 h-4"}),a.jsx("span",{children:n.agency})]})]})]}),n.image_url&&a.jsx("figure",{className:"w-full mb-8 rounded-lg overflow-hidden",children:a.jsx("img",{src:n.image_url,alt:n.title,className:"w-full h-auto object-cover"})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-8",children:[a.jsxs("div",{className:"bg-card border rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mb-2",children:[a.jsx(Br,{className:"w-4 h-4"}),a.jsx("span",{className:"text-sm font-medium",children:"Award Date"})]}),a.jsx("p",{className:"text-lg font-semibold",children:new Date(n.contract_date).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})})]}),a.jsxs("div",{className:"bg-card border rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mb-2",children:[a.jsx(Jt,{className:"w-4 h-4"}),a.jsx("span",{className:"text-sm font-medium",children:"Contract Value"})]}),a.jsx("p",{className:"text-lg font-semibold",children:g4e(n.contract_value)})]}),a.jsxs("div",{className:"bg-card border rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mb-2",children:[a.jsx(Ya,{className:"w-4 h-4"}),a.jsx("span",{className:"text-sm font-medium",children:"Location"})]}),a.jsx("p",{className:"text-lg font-semibold",children:n.location})]})]}),a.jsx("div",{className:"prose prose-lg dark:prose-invert max-w-none mb-8",dangerouslySetInnerHTML:{__html:n.content}}),a.jsx("footer",{className:"border-t pt-6 mt-8",children:a.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Source"}),a.jsx("p",{className:"font-medium",children:n.source})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Agency"}),a.jsx("p",{className:"font-medium",children:n.agency})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Category"}),a.jsx("p",{className:"font-medium",children:n.category})]})]})}),a.jsxs("div",{className:"mt-12 border-t pt-8",children:[a.jsx("div",{className:"text-2xl font-bold mb-6",children:"Related Resources"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs(je,{to:"/news",className:"block p-4 bg-card border rounded-lg hover:bg-accent transition-colors",children:[a.jsx("div",{className:"font-semibold mb-2",children:"Latest Contract News"}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Browse more government contract intelligence and insights"})]}),a.jsxs(je,{to:"/calculator",className:"block p-4 bg-card border rounded-lg hover:bg-accent transition-colors",children:[a.jsx("div",{className:"font-semibold mb-2",children:"AI Pricing Calculator"}),a.jsx("div",{className:"text-sm text-muted-foreground",children:"Get AI-powered pricing analysis for your contracts"})]}),a.jsxs(je,{to:"/trends",className:"block p-4 bg-card border rounded-lg hover:bg-accent transition-colors",children:[a.jsx("div",{className:"font-semibold mb-2",children:"Market Trends & Analysis"}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:["Explore pricing trends and market intelligence in ",n.category]})]}),a.jsxs(je,{to:"/directory",className:"block p-4 bg-card border rounded-lg hover:bg-accent transition-colors",children:[a.jsx("div",{className:"font-semibold mb-2",children:"Agency Directory"}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:["Find contacts for ",n.agency," and other government agencies"]}
859)]})]})]})]})}),a.jsx(Ci,{}),a.jsx(Um,{})]})};var dW="Toggle",PP=g.forwardRef((e,t)=>{const{pressed:r,defaultPressed:n,onPressedChange:s,...i}=e,[o,l]=vr({prop:r,onChange:s,defaultProp:n??!1,caller:dW});return a.jsx(we.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:pe(e.onClick,()=>{e.disabled||l(!o)})})});PP.displayName=dW;var uW=PP,cl="ToggleGroup",[fW,ARe]=ir(cl,[nl]),hW=nl(),kP=I.forwardRef((e,t)=>{const{type:r,...n}=e;if(r==="single"){const s=n;return a.jsx(b4e,{...s,ref:t})}if(r==="multiple"){const s=n;return a.jsx(w4e,{...s,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${cl}\``)});kP.displayName=cl;var[mW,pW]=fW(cl),b4e=I.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},...i}=e,[o,l]=vr({prop:r,defaultProp:n??"",onChange:s,caller:cl});return a.jsx(mW,{scope:e.__scopeToggleGroup,type:"single",value:I.useMemo(()=>o?[o]:[],[o]),onItemActivate:l,onItemDeactivate:I.useCallback(()=>l(""),[l]),children:a.jsx(gW,{...i,ref:t})})}),w4e=I.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},...i}=e,[o,l]=vr({prop:r,defaultProp:n??[],onChange:s,caller:cl}),c=I.useCallback(u=>l((f=[])=>[...f,u]),[l]),d=I.useCallback(u=>l((f=[])=>f.filter(h=>h!==u)),[l]);return a.jsx(mW,{scope:e.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:c,onItemDeactivate:d,children:a.jsx(gW,{...i,ref:t})})});kP.displayName=cl;var[j4e,N4e]=fW(cl),gW=I.forwardRef((e,t)=>{const{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:s=!0,orientation:i,dir:o,loop:l=!0,...c}=e,d=hW(r),u=Ii(o),f={role:"group",dir:u,...c};return a.jsx(j4e,{scope:r,rovingFocus:s,disabled:n,children:s?a.jsx(Vb,{asChild:!0,...d,orientation:i,dir:u,loop:l,children:a.jsx(we.div,{...f,ref:t})}):a.jsx(we.div,{...f,ref:t})})}),cy="ToggleGroupItem",vW=I.forwardRef((e,t)=>{const r=pW(cy,e.__scopeToggleGroup),n=N4e(cy,e.__scopeToggleGroup),s=hW(e.__scopeToggleGroup),i=r.value.includes(e.value),o=n.disabled||e.disabled,l={...e,pressed:i,disabled:o},c=I.useRef(null);return n.rovingFocus?a.jsx(qb,{asChild:!0,...s,focusable:!o,active:i,ref:c,children:a.jsx(RI,{...l,ref:t})}):a.jsx(RI,{...l,ref:t})});vW.displayName=cy;var RI=I.forwardRef((e,t)=>{const{__scopeToggleGroup:r,value:n,...s}=e,i=pW(cy,r),o={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=i.type==="single"?o:void 0;return a.jsx(PP,{...l,...s,ref:t,onPressedChange:c=>{c?i.onItemActivate(n):i.onItemDeactivate(n)}})}),xW=kP,yW=vW;const bW=ki("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),S4e=g.forwardRef(({className:e,variant:t,size:r,...n},s)=>a.jsx(uW,{ref:s,className:me(bW({variant:t,size:r,className:e})),...n}));S4e.displayName=uW.displayName;const wW=g.createContext({size:"default",variant:"default"}),jW=g.forwardRef(({className:e,variant:t,size:r,children:n,...s},i)=>a.jsx(xW,{ref:i,className:me("flex items-center justify-center gap-1",e),...s,children:a.jsx(wW.Provider,{value:{variant:t,size:r},children:n})}));jW.displayName=xW.displayName;const HS=g.forwardRef(({className:e,children:t,variant:r,size:n,...s},i)=>{const o=g.useContext(wW);return a.jsx(yW,{ref:i,className:me(bW({variant:o.variant||r,size:o.size||n}),e),...s,children:t})});HS.displayName=yW.displayName;const _4e=()=>{console.log("[Directory] Component mounted at path:",window.location.pathname);const{user:e,loading:t}=it(),r=vt(),n=Fy(),[s,i]=g.useState(""),[o,l]=g.useState(null),[c,d]=g.useState(null),[u,f]=g.useState(null),[h,m]=g.useState("government"),[v,p]=g.useState(!1);g.useEffect(()=>{console.log("[Directory] useEffect - Current URL:",window.location.href)},[]),g.useEffect(()=>{!t&&!e&&(We.error("Please sign in to access the directory"),r("/login"))},[e,t,r]);const{data:x=[],isLoading:b}=ic({queryKey:["procurement-contacts"],queryFn:async()=>{const{data:j,error:S}=await Z.from("procurement_contacts").select("*").order("name");if(S)throw S;return j}}),{data:y=[]}=ic({queryKey:["procurement-awards",u],queryFn:async()=>
859{if(!u)return[];const{data:j,error:S}=await Z.from("procurement_awards").select("*").eq("contact_id",u).order("award_date",{ascending:!1});if(S)throw S;return j},enabled:!!u}),w=Array.from(new Set(x.map(j=>j.agency))).sort(),_=Array.from(new Set(x.map(j=>j.specialty).flat())).sort();g.useEffect(()=>{const j=async()=>{if(x.filter(C=>{var P,A;return((P=C.email)==null?void 0:P.endsWith(".mil"))||((A=C.email)==null?void 0:A.endsWith(".gov"))}).length<1e3&&!v){p(!0),console.log("Auto-importing federal contacts..."),We.info("Importing 11,000+ federal contacts in background...");try{const{error:C}=await Z.functions.invoke("import-federal-contacts");C?console.error("Import error:",C):(n.invalidateQueries({queryKey:["procurement-contacts"]}),We.success("Federal contacts imported successfully!"))}catch(C){console.error("Import failed:",C)}}};x.length>0&&j()},[x,v,n]);const N=x.filter(j=>{var F,q;const S=j.name.toLowerCase().includes(s.toLowerCase())||j.agency.toLowerCase().includes(s.toLowerCase())||j.department.toLowerCase().includes(s.toLowerCase())||j.specialty.some(B=>B.toLowerCase().includes(s.toLowerCase())),C=!o||j.agency===o,P=!c||j.specialty.includes(c),A=((F=j.email)==null?void 0:F.endsWith(".gov"))||((q=j.email)==null?void 0:q.endsWith(".mil"));return S&&(h==="government"?C:P)&&(h==="government"?A:!A)});return t?a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),a.jsx("p",{className:"text-muted-foreground",children:"Loading..."})]})}):e?a.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-background via-background to-muted/20",children:[a.jsx($r,{title:"Government Procurement Directory | Key Decision Makers",description:"Directory of government procurement officers and key decision makers across federal agencies. Connect with contracting officers for your bidding opportunities.",keywords:"government procurement directory, contracting officers, federal agencies, procurement contacts, government buyers"}),a.jsxs("div",{className:"container mx-auto px-4 py-8",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx(U,{variant:"ghost",asChild:!0,className:"mb-4",children:a.jsxs(je,{to:"/contracts",className:"flex items-center gap-2",children:[a.jsx(Tr,{className:"w-4 h-4"}),"Back to Contracts"]})}),a.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[a.jsx("div",{className:"w-12 h-12 hero-gradient rounded-xl flex items-center justify-center shadow-lg",children:a.jsx(Mr,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-bold text-foreground",children:"Procurement Directory"}),a.jsx("p",{className:"text-muted-foreground mt-1",children:"Connect with key decision makers across federal agencies"})]})]})]}),a.jsx(J,{className:"mb-6",children:a.jsxs(re,{className:"pt-6",children:[a.jsx("div",{className:"mb-4 flex justify-center",children:a.jsxs(jW,{type:"single",value:h,onValueChange:j=>j&&m(j),className:"bg-muted p-1 rounded-lg",children:[a.jsx(HS,{value:"government","aria-label":"Government sector",className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground px-6",children:"Government"}),a.jsx(HS,{value:"private","aria-label":"Private sector",className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground px-6",children:"Private Sector"})]})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(Es,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),a.jsx(ge,{placeholder:"Search by name, agency, or specialty...",value:s,onChange:j=>i(j.target.value),className:"pl-10"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(mr,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),a.jsxs(Re,{value:h==="government"?o||"all":c||"all",onValueChange:j=>{h==="government"?l(j==="all"?null:j):d(j==="all"?null:j)},children:[a.jsx(Me,{className:"w-full",children:a.jsx(De,{placeholder:h==="government"?"Filter by agency":"Filter by industry"})}),a.jsxs(Ie,{className:"max-h-[300px] bg-popover z-50",children:[a.jsx(ce,{value:"all",children:h==="government"?"All Agencies":"All Industries"}),h==="government"?w.map(j=>a.jsx(ce,{value:j,children:j},j)):_.map(j=>a.jsx(ce,{value:j,children:j},j))]})]})]})]})]})}),a.jsx(J,{children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(Ec,{children:[a.jsx(Oc,{children:a.jsxs(xn,{children:[a.jsx(Ge,{className:"min-w-[200px]",children:"Contact"}),a.jsx(Ge,{className:"min-w-[250px]",children:h==="government"?"Agency & Department":"Industry & Specialties"}),a.jsx(Ge,{className:"min-w-[200px]",children:"Contact Info"}),a.jsx(Ge,{className:"min-w-[150px]",children:"Location"}),a.jsx(Ge,{className:"min-w-[200px]",children:"Contract Types"}),a.jsx(Ge,{className:"w-[120px]",children:"Actions"})]})}),a.jsx(Tc,{children:N.map(j=>a.jsxs(xn,{className:"hover:bg-muted/50",children:[a.jsx(Ve,{children:a.jsxs("div",{children:[a.jsx("div",{className:"font-semibold text-foreground",children:j.name}),a.jsx("div",{className:"text-sm text-muted-foreground",children:j.title})]})}),a.jsx(Ve,{children:h==="government"?a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(mr,{className:"w-4 h-4 text-muted-foreground mt-0.5 flex-shrink-0"}),a.jsxs("div",{children:[a.jsx("div",{className:"font-medium text-foreground",children:j.agency}),a.jsx("div",{className:"text-sm text-muted-foreground",children:j.department})]})]}):a.jsxs("div",{className:"flex flex-wrap gap-1",children:[j.specialty.slice(0,3).map((S,C)=>a.jsx(ve,{variant:"secondary",className:"text-xs",children:S},C)),j.specialty.length>3&&a.jsxs(ve,{variant:"outline",className:"text-xs",children:["+",j.specialty.length-3]})]})}),a.jsx(Ve,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(an,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),a.jsx("a",{href:`mailto:${j.email}`,className:"text-sm text-primary hover:underline break-all",children:j.email})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ky,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),a.jsx("span",{className:"text-sm text-foreground",children:j.phone})]})]})}),a.jsx(Ve,{children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(Ya,{className:"w-3.5 h-3.5 text-muted-foreground mt-0.5 flex-shrink-0"}),a.jsx("span",{className:"text-sm text-foreground",children:j.location})]})}),a.jsx(Ve,{children:a.jsx("div",{className:"flex flex-wrap gap-1",children:j.contract_types.map((S,C)=>a.jsx(ve,{variant:"outline",className:"text-xs",children:S},C))})}),a.jsx(Ve,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(U,{size:"sm",variant:"outline",asChild:!0,children:a.jsx("a",{href:`mailto:${j.email}`,children:a.jsx(an,{className:"w-3.5 h-3.5"})})}),a.jsxs(rn,{onOpenChange:S=>S&&f(j.id),children:[a.jsx(hc,{asChild:!0,children:a.jsxs(U,{size:"sm",variant:"outline",className:"relative",children:[a.jsx(hh,{className:"w-3.5 h-3.5"}),j.total_awards_count>0&&a.jsx("span",{className:"absolute -top-1 -right-1 w-4 h-4 bg-primary text-primary-foreground text-[10px] rounded-full flex items-center justify-center",children:j.total_awards_count})]})}),a.jsxs(Wr,{className:"max-w-3xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Hr,{children:[a.jsxs(Vr,{className:"flex items-center gap-2",children:[a.jsx(hh,{className:"w-5 h-5 text-primary"}),"Past Awards - ",j.name]}),a.jsxs(ba,{children:["Contracts awarded by ",j.name," at ",j.agency]})]}),y.length>
8590?a.jsx("div",{className:"space-y-4 mt-4",children:y.map(S=>a.jsx(J,{children:a.jsx(re,{className:"pt-6",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold text-foreground",children:S.description||"N/A"}),a.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Contract: ",S.contract_number]})]}),a.jsx(ve,{variant:"secondary",className:"text-sm font-semibold",children:S.value?`$${(S.value/1e6).toFixed(1)}M`:"N/A"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Contractor:"}),a.jsx("p",{className:"font-medium text-foreground",children:S.contractor||"N/A"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Award Date:"}),a.jsx("p",{className:"font-medium text-foreground",children:S.award_date?new Date(S.award_date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"N/A"})]})]})]})})},S.id))}):a.jsxs("div",{className:"py-12 text-center",children:[a.jsx(hh,{className:"w-12 h-12 text-muted-foreground mx-auto mb-3 opacity-50"}),a.jsx("p",{className:"text-muted-foreground",children:"No past awards recorded for this contracting officer."})]})]})]})]})})]},j.id))})]})})}),N.length===0&&a.jsx(J,{children:a.jsxs(re,{className:"py-12 text-center",children:[a.jsx("p",{className:"text-muted-foreground",children:"No contacts found matching your search criteria."}),a.jsx(U,{variant:"outline",className:"mt-4",onClick:()=>{i(""),l(null),d(null),m("government")},children:"Clear Filters"})]})}),a.jsx(J,{className:"mt-8",children:a.jsx(re,{className:"py-6",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"w-10 h-10 bg-primary/10 rounded-lg flex items-center justify-center flex-shrink-0",children:a.jsx(ft,{className:"w-5 h-5 text-primary"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-1",children:"Need More Information?"}),a.jsxs("p",{className:"text-sm text-muted-foreground mb-3",children:["For the most up-to-date contact information and additional procurement officers, visit the official agency websites or check"," ",a.jsx("a",{href:"https://www.sam.gov",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"SAM.gov"})," ","for comprehensive federal procurement data."]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.jsx("strong",{children:"Disclaimer:"})," Contact information is provided for general reference. Always verify current contact details through official agency channels before initiating communication."]})]})]})})})]})]}):null};function C4e(){const{user:e}=it(),{toast:t}=dt(),[r,n]=g.useState(!1),[s,i]=g.useState(!1),[o,l]=g.useState([]),[c,d]=g.useState(!1),[u,f]=g.useState(!1),[h,m]=g.useState({name:"",email:"",contractId:"",supportType:"technical",message:""});g.useEffect(()=>{e&&(p(),v())},[e]);const v=async()=>{try{const{data:b,error:y}=await Z.from("profiles").select("first_name, last_name, email").eq("user_id",e==null?void 0:e.id).single();if(y)throw y;b&&m(w=>({...w,name:`${b.first_name||""} ${b.last_name||""}`.trim()||"",email:b.email||""}))}catch(b){console.error("Error fetching profile:",b)}},p=async()=>{try{const{data:b,error:y}=await Z.from("contracts").select("id, title").eq("user_id",e==null?void 0:e.id).order("created_at",{ascending:!1}).limit(10);if(y)throw y;l(b||[])}catch(b){console.error("Error fetching contracts:",b)}},x=async b=>{b.preventDefault(),n(!0);try{const{error:y}=await Z.functions.invoke("send-support-request",{body:{name:h.name,email:h.email,contractId:h.contractId,supportType:h.supportType,message:h.message,userId:e==null?void 0:e.id}});if(y)throw y;i(!0),t({title:"Support request submitted!",description:"We'll get back to you within 24 hours."}),m({name:"",email:"",contractId:"",supportType:"technical",message:""})}catch(y){console.error("Error submitting support request:",y),t({title:"Error",description:"Failed to submit support request. Please try again.",variant:"destructive"})}finally{n(!1)}};return s?a.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[a.jsx("div",{className:"flex-1 container mx-auto px-4 py-8 flex items-center justify-center min-h-[60vh]",children:a.jsx(J,{className:"max-w-md w-full text-center glass-card",children:a.jsxs(re,{className:"pt-12 pb-12",children:[a.jsx("div",{className:"flex justify-center mb-6",children:a.jsx("div",{className:"w-20 h-20 rounded-full bg-success/10 flex items-center justify-center",children:a.jsx(tr,{className:"w-10 h-10 text-success"})})}),a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Request Submitted!"}),a.jsx("p",{className:"text-muted-foreground mb-6",children:"Thank y
859ou for contacting us. We'll get back to you within 24 hours."}),a.jsx(U,{onClick:()=>i(!1),children:"Submit Another Request"})]})})}),a.jsx(Ci,{})]}):a.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[a.jsx("header",{className:"border-b border-border/30 px-6 py-4 flex items-center gap-3",children:a.jsxs(je,{to:"/",className:"flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(Tr,{className:"w-4 h-4"}),a.jsx("span",{className:"text-sm",children:"Back to PriceBid"})]})}),a.jsx("div",{className:"flex-1 container mx-auto px-4 py-8",children:a.jsxs("div",{className:"max-w-2xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-4",children:[a.jsxs("div",{className:"flex items-center justify-center gap-3 mb-2",children:[a.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:a.jsx(G_,{className:"w-6 h-6 text-primary"})}),a.jsx("h1",{className:"text-4xl font-bold text-gradient",children:"Support"})]}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"We're here for you 24/7"})]}),a.jsxs(J,{className:"glass-card",children:[a.jsxs(de,{children:[a.jsx(le,{children:"Submit Support Request"}),a.jsx(nt,{children:"Fill out the form below and we'll get back to you within 24 hours"})]}),a.jsx(re,{children:a.jsxs("form",{onSubmit:x,className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"name",children:"Name *"}),a.jsxs("div",{className:"relative",children:[a.jsx(ge,{id:"name",placeholder:"Your full name",value:h.name,onChange:b=>m({...h,name:b.target.value}),disabled:!c,required:!0,className:"pr-10"}),a.jsx(U,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8",onClick:()=>d(!c),children:a.jsx(Qk,{className:"h-4 w-4"})})]})]}),a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"email",children:"Email *"}),a.jsxs("div",{className:"relative",children:[a.jsx(ge,{id:"email",type:"email",placeholder:"[email protected]",value:h.email,onChange:b=>m({...h,email:b.target.value}),disabled:!u,required:!0,className:"pr-10"}),a.jsx(U,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8",onClick:()=>f(!u),children:a.jsx(Qk,{className:"h-4 w-4"})})]})]})]}),a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"contract",children:"Contract Needing Support"}),a.jsxs(Re,{value:h.contractId,onValueChange:b=>m({...h,contractId:b}),children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select a contract (optional)"})}),a.jsx(Ie,{children:o.map(b=>a.jsx(ce,{value:b.id,children:b.title},b.id))})]})]}),a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"supportType",children:"Support Type *"}),a.jsxs(Re,{value:h.supportType,onValueChange:b=>m({...h,supportType:b}),children:[a.jsx(Me,{children:a.jsx(De,{placeholder:"Select support type"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"technical",children:"Technical"}),a.jsx(ce,{value:"sales",children:"Sales"}),a.jsx(ce,{value:"billing",children:"Billing"}),a.jsx(ce,{value:"other",children:"Other"})]})]})]}),a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"message",children:"Message *"}),a.jsx(Qn,{id:"message",placeholder:"Please describe your issue or question in detail...",value:h.message,onChange:b=>m({...h,message:b.target.value}),required:!0,rows:6,className:"resize-none"})]}),a.jsx(U,{type:"submit",className:"w-full bg-gradient-primary hover:opacity-90",size:"lg",disabled:r,children:r?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin mr-2"}),"Submitting..."]}):a.jsxs(a.Fragment,{children:[a.jsx(va,{className:"w-4 h-4 mr-2"}),"Submit Support Request"]})})]})})]})]})}),a.jsx(Ci,{})]})}const P4e=()=>a.jsxs("div",{className:"min-h-screen bg-gradient-background",children:[a.jsx($r,{title:"About Pricebid - Patent-Pending Contract Intelligence",description:"Discover how Pricebid transforms contract complexity into clarity with proprietary AI technology and past award data aggregation.",keywords:"contract intelligence, AI pricing, government contracting, RFP analysis, bid confidence"}),a.jsx("header",{className:"w-full border-b border-border glass-card",children:a.jsx("div",{className:"max-w-7xl mx-auto px-6 py-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(je,{to:"/",className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 hero-gradient rounded-xl flex items-center justify-center shadow-lg font-bold text-white text-sm",children:"PB"}),a.jsx("h1",{className:"font-bold text-xl text-foreground",children:"PriceBid"})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(U,{asChild:!0,variant:"ghost",children:a.jsx(je,{to:"/",children:"Home"})}),a.jsx(U,{asChild:!0,variant:"ghost",children:a.jsx(je,{to:"/login",children:"Sign In"})}),a.jsx(U,{asChild:!0,className:"bg-purple-600 hover:bg-purple-700",children:a.jsx(je,{to:"/signup",children:"Get Started"})})]})]})})}),a.jsx("div",{className:"py-12 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"max-w-4xl mx-auto",children:[a.jsx("div",{className:"text-center mb-10",children:a.jsx("h2",{className:"text-3xl md:text-4xl font-bold bg-gradient-to-r from-purple-400 via-blue-400 to-purple-500 bg-clip-text text-transparent mb-3",children:"PriceBidâ¢"})}),a.jsx(J,{className:"p-8 md:p-10 bg-card/50 backdrop-blur-sm border-purple-500/20 shadow-lg",children:a.jsxs("div",{className:"space-y-6 text-foreground
859/90 leading-relaxed",children:[a.jsxs("section",{children:[a.jsxs("h3",{className:"text-xl font-semibold text-foreground mb-3 flex items-center gap-2",children:[a.jsx("span",{className:"w-2 h-2 bg-blue-400 rounded-full"}),"Mission"]}),a.jsx("p",{className:"text-base",children:"Pricebid was created to solve one of the toughest challenges in contracting: knowing how to price with confidence. Too often, businesses waste valuable time reading through long solicitations and RFPs, only to make decisions based on incomplete data or guesswork. Our mission is to change that by turning complexity into clarity."})]}),a.jsxs("section",{children:[a.jsxs("h3",{className:"text-xl font-semibold text-foreground mb-3 flex items-center gap-2",children:[a.jsx("span",{className:"w-2 h-2 bg-purple-400 rounded-full"}),"Patent-Pending Technology"]}),a.jsxs("p",{className:"text-base",children:["Our patent-pending proprietary technology transforms unstructured contracts into actionable intelligence. By blending advanced AI with our ",a.jsx("strong",{children:a.jsx("em",{children:"proprietary parsing and validation methods"})}),", Pricebid not only extracts the key details from contractsâit enhances them with the aggregation of past award data. From pricing benchmarks to contract timelines and even points of contact, we deliver higher confidence by grounding every recommendation in real-world outcomes."]})]}),a.jsxs("section",{children:[a.jsxs("h3",{className:"text-xl font-semibold text-foreground mb-3 flex items-center gap-2",children:[a.jsx("span",{className:"w-2 h-2 bg-blue-400 rounded-full"}),"What Sets Us Apart"]}),a.jsx("p",{className:"text-base mb-3",children:"By combining advanced AI with real-world historical data, Pricebid delivers accurate, defensible pricing recommendations instantly. Plus, we help you secure financing for different stages of contracting, ensuring you have the capital you need to win and execute contracts with confidence."}),a.jsxs("p",{className:"text-base",children:["We focus laser-sharp on the key winning factor: ",a.jsx("strong",{children:"pricing"}),"âand we do it in real time."]})]}),a.jsxs("section",{className:"bg-gradient-to-br from-purple-900/20 via-blue-900/20 to-purple-800/20 p-5 rounded-lg border border-purple-500/20",children:[a.jsxs("h3",{className:"text-xl font-semibold text-foreground mb-3 flex items-center gap-2",children:[a.jsx("span",{className:"w-2 h-2 bg-purple-400 rounded-full"}),"Our Vision"]}),a.jsx("p",{className:"text-base",children:"At Pricebid, we believe confidence comes from clarityâand clarity comes from data you can trust. That's why we're building more than just software; we're creating a new standard for how organizations approach both government and private contracts."})]})]})}),a.jsx("div",{className:"mt-10 text-center",children:a.jsx(U,{asChild:!0,size:"lg",className:"bg-gradient-to-r from-purple-500 to-blue-500 hover:from-purple-600 hover:to-blue-600",children:a.jsxs(je,{to:"/plans",className:"inline-flex items-center gap-2",children:["Get Started Today",a.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 7l5 5m0 0l-5 5m5-5H6"})})]})})})]})}),a.jsx(Ci,{})]}),DI=()=>{const e=vt(),t=[{icon:rc,title:"PriceBid⢠AI-Powered Bid Pricing Generator",description:"Upload any government contract and get instant, data-backed pricing recommendations. Our AI analyzes historical data, market trends, and contract specifics to suggest winning bid prices.",benefits:["95% accuracy rate","Instant pricing analysis","Historical data comparison"],link:"/plans"},{icon:Tq,title:"Intelligent Contract Parser",description:"Advanced document processing that extracts key information from contracts automatically. Supports PDF, Word, and text formats with 99% accuracy.",benefits:["Multi-format support","Automatic data extraction","NAICS code detection"],link:"/plans"},{icon:GR,title:"Historical Contract Database",description:"Access thousands of past government contracts with pricing data. Search by agency, category, NAICS code, or contractor to inform your bidding strategy.",benefits:["10,000+ contracts","Advanced filtering","Price trend anal
859ysis"],link:"/plans"},{icon:Mr,title:"Procurement Directory",description:"Connect directly with federal procurement officers and contracting specialists. Search by agency, specialty, and location to find the right contacts for your opportunities.",benefits:["1,000+ verified contacts","Direct contact info","Agency filtering"],link:"/directory"}],r=[{icon:$s,title:"Market Intelligence Dashboard",description:"Comprehensive analytics showing market trends, competitor pricing, and opportunity forecasts. Make data-driven decisions with real-time insights.",benefits:["Real-time analytics","Competitor tracking","Trend forecasting"]},{icon:Ft,title:"Win Rate Optimization",description:"Track your bidding performance and get personalized recommendations to improve your win rate. Learn from past bids to refine your strategy.",benefits:["Performance metrics","Strategy recommendations","Historical tracking"]},{icon:Mr,title:"Team Collaboration",description:"Invite team members, assign roles, and collaborate on contract analysis. Perfect for procurement teams and bidding departments.",benefits:["Multi-user access","Role-based permissions","Shared workspaces"]},{icon:m1,title:"24/7 Support Chat",description:"Get instant help with contract questions, pricing strategies, or platform navigation. Our AI assistant is trained on government contracting best practices.",benefits:["Instant responses","Contract expertise","Platform guidance"]}];return a.jsxs(a.Fragment,{children:[a.jsx($r,{title:"PriceBid | AI-Powered Contract Pricing Platform",description:"Discover all the powerful features of PriceBid: AI-powered pricing, contract parsing, market intelligence, and more. Win more government contracts with data-driven insights.",keywords:"contract pricing features, AI bid analysis, contract database, market intelligence, government contracting tools"}),a.jsxs("div",{className:"min-h-screen bg-gradient-background",children:[a.jsx("div",{className:"max-w-7xl mx-auto px-4 pt-8",children:a.jsxs(U,{variant:"ghost",onClick:()=>e("/"),className:"flex items-center gap-2 hover:scale-105 smooth-transition",children:[a.jsx(Tr,{className:"w-4 h-4"}),"Back"]})}),a.jsx("section",{className:"py-12 px-4 bg-gradient-to-br from-purple-primary/10 to-blue-primary/10",children:a.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[a.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-gradient mb-4",children:"PriceBid"}),a.jsx("p",{className:"text-xl text-foreground mb-4",children:"AI-Powered Contract Pricing Platform"}),a.jsx("p",{className:"text-base text-muted-foreground mb-6",children:"Win more contracts with data-backed pricing recommendations. Our AI analyzes historical data, market trends, and contract specifics to generate optimal bid prices."}),a.jsx(U,{asChild:!0,size:"lg",className:"text-lg px-8 hero-gradient",children:a.jsx(je,{to:"/plans",children:"Get Started"})})]})}),a.jsx("section",{className:"pt-4 pb-12 px-4",children:a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h1",{className:"text-4xl font-bold text-gradient mb-4",children:"Core Features"}),a.jsxs("p",{className:"text-lg text-muted-foreground",children:["The Most Powerful Patented Technology To Price & Finance",a.jsx("br",{}),"Government And Private Contracts"]})]}),a.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:t.map((n,s)=>a.jsxs(J,{className:"gradient-card smooth-transition hover:scale-105 hover:glow-effect group",children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-14 h-14 hero-gradient rounded-lg flex items-center justify-center flex-shrink-0",children:a.jsx(n.icon,{className:"w-7 h-7 text-white"})}),a.jsx("div",{className:"flex-1",children:a.jsx(le,{className:"text-2xl mb-2",children:n.title})})]})}),a.jsxs(re,{children:[a.jsx("p",{className:"text-muted-foreground mb-6",children:n.description}),a.jsx("div",{className:"space-y-2 mb-6",children:n.benefits.map((i,o)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Na,{className:"w-5 h-5 text-green-500"}),a.jsx("span",{className:"text-sm",children:i})]},o))}),n.link&&a.jsx(U,{asChild:!0,variant:"ghost",className:"group-hover:text-primary",children:a.jsxs(je,{to:n.link,className:"flex items-center gap-2",children:["Try it now ",a.jsx(_q,{className:"w-4 h-4"})]})})]})]},s))})]})}),a.jsx("section",{className:"py-12 px-4 bg-muted/30",children:a.jsxs("div",{className:"max-w-5xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-4xl font-bold text-gradient mb-4",children:"How It Works"}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"From contract upload to winning bid in 3 simple steps"})]}),a.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[a.jsxs(J,{className:"gradient-card text-center",children:[a.jsxs(de,{children:[a.jsx("div",{className:"w-16 h-16 hero-gradient rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx("span",{className:"text-2xl font-bold text-white",children:"1"})}),a.jsx(le,{children:"Upload Contract"})]}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground",children:"Upload your RFP, solicitation, or contract document in any format. Our AI instantly parses all key details."})})]}),a.jsxs(J,{className:"gradient-card text-center",children:[a.jsxs(de,{children:[a.jsx("div",{className:"w-16 h-16 hero-gradient rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx("span",{className:"text-2xl font-bold text-white",children:"2"})}),a.jsx(le,{children:"AI Analysis"})]}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground",children:"Our AI analyzes historical data, market trends, and contract specifics to generate optimal pricing."})})]}),a.jsxs(J,{className:"gradient-card text-center",children:[a.jsxs(de,{children:[a.jsx("div",{className:"w-16 h-16 hero-gradient rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx("span",{className:"text-2xl font-bold text-white",children:"3"})}),a.jsx(le,{children:"Win the Bid"})]}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground",children:"Get a data-backed price recommendation with confidence scores and market insights to submit your winning bid."})})]})]}),a.jsx("div",{className:"mt-12 text-center",children:a.jsx(J,{className:"gradient-card bg-gradient-to-br from-success/10 to-info/10 border-success/20 p-8 max-w-3xl mx-auto",children:a.jsxs("div",{className:"flex flex-col items-center justify-center gap-4",children:[a.jsx(Os,{className:"w-12 h-12 text-success"}),a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-2xl font-bold mb-1 text-foreground",children:"Patent-Pending Technology"}),a.jsx("p",{className:"text-muted-foreground",children:"Powered by proprietary AI algorithms and advanced contract parsing"})]})]})})})]})}),a.jsx("section",{className:"py-12 px-4 bg-muted/30",children:a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-4xl font-bold text-gradient mb-4",children:"Advanced Capabilities"}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"Professional tools for serious contractors"})]}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-6",children:r.map((n,s)=>a.jsxs(J,{className:"gradient-card smooth-transition hover:scale-105",children:[a.jsxs(de,{children:[a.jsx(n.icon,{className:"w-10 h-10 text-primary mb-4"}),a.jsx(le,{className:"text-lg",children:n.title})]}),a.jsxs(re,{children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:n.description}),a.jsx("ul",{className:"space-y-1",children:n.benefits.map((i,o)=>a.jsxs("li",{className:"text-xs flex items-center gap-2",children:[a.jsx(Na,{className:"w-3 h-3 text-green-500"}),i]},o))})]})]},s))})]})}),a.jsx("section",{className:"py-12 px-4",children:a.jsx("div",{className:"max-w-4xl mx-auto text-center",children:a.jsxs(J,{className:"bg-purple-primary border-purple-primary p-12 shadow-strong",children:[a.jsx("h2",{className:"text-4xl font-bold text-white mb-6",children:"Ready to Win More Contracts?"}),a.jsx("p",{className:"text-xl text-white/90 mb-8",children:"Start with PriceBid to increase their win rates and save time on bid preparation."}),a.jsx("div",{className:"flex justify-center",children:a.jsx(U,{asChild:!0,size:"lg",variant:"secondary",className:"text-lg px-8",children:a.jsx(je,{to:"/plans",children:"Choose your plan"})})})]})})})]})]})},k4e=()=>{const e=vt(),t=[{icon:Vq,title:"Scale Your Operations",description:"Handle multiple bids simultaneously with automated workflows and intelligent project management.",benefits:["Multi-project tracking","Automated workflows","Resource optimization"]},{icon:Mr,title:"Team Collaboration",description:"Coordinate seamlessly across teams with role-based access and real-time collaboration tools.",benefits:["Role-based permissions","Real-time updates","Shared workspaces"]},{icon:$s,title:"Performance Analytics",description:"Track your bidding c
859apacity, win rates, and team productivity with comprehensive analytics.",benefits:["Capacity dashboards","Win rate tracking","Performance metrics"]},{icon:Qq,title:"Automated Bid Processing",description:"Speed up your bid preparation with automated document processing and template management.",benefits:["Template library","Auto-fill capabilities","Document generation"]}];return a.jsxs(a.Fragment,{children:[a.jsx($r,{title:"BidScale | Scale Your Bidding Capacity",description:"Scale your contract bidding operations with BidScale. Handle multiple bids simultaneously, automate workflows, and increase your bidding capacity.",keywords:"bid management, contract scaling, team collaboration, bid automation, capacity management"}),a.jsxs("div",{className:"min-h-screen bg-gradient-background",children:[a.jsx("div",{className:"max-w-7xl mx-auto px-4 pt-8",children:a.jsxs(U,{variant:"ghost",onClick:()=>e("/"),className:"flex items-center gap-2 hover:scale-105 smooth-transition",children:[a.jsx(Tr,{className:"w-4 h-4"}),"Back to Home"]})}),a.jsx("section",{className:"py-12 px-4 bg-gradient-to-br from-purple-primary/10 to-blue-primary/10",children:a.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[a.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-gradient mb-4",children:"BidScale"}),a.jsx("p",{className:"text-xl text-foreground mb-4",children:"Scale Your Bidding Capacity"}),a.jsx("p",{className:"text-base text-muted-foreground mb-6",children:"Transform your bidding operations with intelligent automation and team collaboration. Handle 10x more opportunities without adding headcount."}),a.jsx(U,{asChild:!0,size:"lg",className:"text-lg px-8 hero-gradient",children:a.jsx(je,{to:"/plans",children:"Get Started"})})]})}),a.jsx("section",{className:"py-12 px-4",children:a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-4xl font-bold text-gradient mb-4",children:"Core Capabilities"}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"Everything you need to scale your bidding operations"})]}),a.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:t.map((r,n)=>a.jsxs(J,{className:"gradient-card smooth-transition hover:scale-105 hover:glow-effect group",children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-14 h-14 hero-gradient rounded-lg flex items-center justify-center flex-shrink-0",children:a.jsx(r.icon,{className:"w-7 h-7 text-white"})}),a.jsx("div",{className:"flex-1",children:a.jsx(le,{className:"text-2xl mb-2",children:r.title})})]})}),a.jsxs(re,{children:[a.jsx("p",{className:"text-muted-foreground mb-6",children:r.description}),a.jsx("div",{className:"space-y-2",children:r.benefits.map((s,i)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Na,{className:"w-5 h-5 text-green-500"}),a.jsx("span",{className:"text-sm",children:s})]},i))})]})]},n))})]})}),a.jsx("section",{className:"py-12 px-4 bg-muted/30",children:a.jsxs("div",{className:"max-w-5xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-4xl font-bold text-gradient mb-4",children:"Why BidScale?"}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"Transform your bidding capacity and win rate"})]}),a.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[a.jsxs(J,{className:"gradient-card text-center",children:[a.jsxs(de,{children:[a.jsx(ap,{className:"w-12 h-12 text-primary mx-auto mb-4"}),a.jsx(le,{children:"10x More Bids"})]}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground",children:"Handle 10x more bid opportunities with the same team size through automation and optimization."})})]}),a.jsxs(J,{className:"gradient-card text-center",children:[a.jsxs(de,{children:[a.jsx(Ft,{className:"w-12 h-12 text-primary mx-auto mb-4"}),a.jsx(le,{children:"Higher Win Rates"})]}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground",children:"Focus on quality bids with better preparation time, increasing your overall win rate by 40%."})})]}),a.jsxs(J,{className:"gradient-card text-center",children:[a.jsxs(de,{children:[a.jsx(eu,{className:"w-12 h-12 text-primary mx-auto mb-4"}),a.jsx(le,{children:"Streamlined Process"})]}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground",children:"Reduce bid preparation time from weeks to days with automated workflows and templates."})})]})]})]})}),a.jsx("section",{className:"py-12 px-4",children:a.jsx("div",{className:"max-w-4xl mx-auto text-center",children:a.jsxs(J,{className:"bg-purple-primary border-purple-primary p-12 shadow-strong",children:[a.jsx("h2",{className:"text-4xl font-bold text-white mb-6",children:"Ready to Scale Your Bidding?"}),a.jsx("p",{className:"text-xl text-white/90 mb-8",children:"Join hundreds of contractors who've scaled their operations with BidScale."}),a.jsxs("div",{className:"flex justify-center gap-4",children:[a.jsx(U,{asChild:!0,size:"lg",variant:"secondary",className:"text-lg px-8",children:a.jsx(je,{to:"/plans",children:"View Plans"})}),a.jsx(U,{asChild:!0,size:"lg",variant:"outline",className:"text-lg px-8 bg-white/10 text-white border-white/20 hover:bg-white/20",children:a.jsx(je,{to:"/#contact",children:"Contact Sales"})})]})]})})})]})]})},A4e=()=>{const e=vt(),t=[{icon:_d,title:"Bid Strategy Development",description:"Work with our experts to develop winning bid strategies tailored to your business and target contracts.",benefits:["Custom strategy development","Market analysis","Competitive positioning"]},{icon:Mr,title:"Team Training & Coaching",description:"Train your team on best practices for contract bidding, pricing strategies, and government contracting.",benefits:["Live workshops","One-on-one coaching","Best practices training"]},{icon:ap,title:"Proposal Review & Optimization",description:"Get expert review of your proposals before submission to maximize your chances of winning.",benefits:["Proposal critiques","Pricing optimization","Compliance review"]},{icon:Ft,title:"Business Growth Planning",description:"Strategic planning to help you identify high-value opportunities and grow your contracting business.",benefits:["Growth roadmaps","Market opportunities","Capacity planning"]}];return a.jsxs(a.Fragment,{children:[a.jsx($r,{title:"Consulting Services | Expert Government Contracting Guidance",description:"Get expert consulting for government contracting. Bid strategy development, team training, proposal review, and business growth planning.",keywords:"government contracting consulting, bid strategy, proposal review, contracting training"}),a.jsxs("div",{className:"min-h-screen bg-gradient-background",children:[a.jsx("div",{className:"max-w-7xl mx-auto px-4 pt-8",children:a.jsxs(U,{variant:"ghost",onClick:()=>e("/"),className:"flex items-center gap-2 hover:scale-105 smooth-transition",children:[a.jsx(Tr,{className:"w-4 h-4"}),"Back to Home"]})}),a.jsx("section",{className:"py-12 px-4 bg-gradient-to-br from-purple-primary/10 to-blue-primary/10",children:a.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[a.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-gradient mb-4",children:"Consulting"}),a.jsx("p",{className:"text-xl text-foreground mb-4",children:"Expert Consulting Services"}),a.jsx("p",{className:"text-base text-muted-foreground mb-6",children:"Work directly with government contracting experts to develop winning strategies, optimize your bids, and grow your business."}),a.jsx(U,{asChild:!0,size:"lg",className:"text-lg px-8 hero-gradient",children:a.jsx(je,{to:"/#contact",children:"Schedule Consultation"})})]})}),a.jsx("section",{className:"py-12 px-4",children:a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-4xl font-bold text-gradient mb-4",children:"Our Services"}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"Comprehensive consulting to help you win more contracts"})]}),a.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:t.map((r,n)=>a.jsxs(J,{className:"gradient-card smooth-transition hover:scale-105 hover:glow-effect group",children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-14 h-14 hero-gradient rounded-lg flex items-center justify-center flex-shrink-0",children:a.jsx(r.icon,{className:"w-7 h-7 text-white"})}),a.jsx("div",{className:"flex-1",children:a.jsx(le,{className:"text-2xl mb-2",children:r.title})})]})}),a.jsxs(re,{children:[a.jsx("p",{className:"text-muted-foreground mb-6",children:r.description}),a.jsx("div",{className:"space-y-2",children:r.benefits.map((s,i)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Na,{className:"w-5 h-5 text-green-500"}),a.jsx("span",{className:"text-sm",children:s})]},i))})]})]},n))})]})}),a.jsx("section",{className:"py-12 px-4 bg-muted/30",children:a.jsxs("div",{className:"max-w-5xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-4xl font-bold text-gradient mb-4",children:"Why Choose Our Experts?"}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"Decades of combined experience in government contracting"})]}),a.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[a.jsxs(J,{className:"gradient-card text-center",children:[a.jsxs(de,{children:[a.jsx(Cq,{className:"w-12 h-12 text-primary mx-auto mb-4"}),a.jsx(le,{children:"Deep Expertise"})]}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground",children:"Our consultants have 20+ years of experience in government contracting and procurement."})})]}),a.jsxs(J,{className:"gradient-card text-center",children:[a.jsxs(de,{children:[a.jsx(h1,{className:"w-12 h-12 text-primary mx-auto mb-4"}),a.jsx(le,{children:"Proven Methods"})]}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground",children:"Battle-tested strategies that have helped contractors win billions in contracts."})})]}),a.jsxs(J,{className:"gradient-card text-center",children:[a.jsxs(de,{children:[a.jsx(hh,{className:"w-12 h-12 text-primary mx-auto mb-4"}),a.jsx(le,{children:"Results Driven"})]}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground",children:"Our clients see an average 60% increase in win rates after working with us."})})]})]})]})}),a.jsx("section",{className:"py-12 px-4",children:a.jsx("div",{className:"max-w-4xl mx-auto text-center",children:a.jsxs(J,{className:"bg-purple-primary border-purple-primary p-12 shadow-strong",children:[a.jsx("h2",{className:"text-4xl font-bold text-white mb-6",children:"Ready to Work With Experts?"}),a.jsx("p",{className:"text-xl text-white/90 mb-8",children:"Schedule a free consultation to discu
859ss your goals and how we can help."}),a.jsx(U,{asChild:!0,size:"lg",variant:"secondary",className:"text-lg px-8",children:a.jsx(je,{to:"/#contact",children:"Schedule Free Consultation"})})]})})})]})]})},E4e=()=>{const e=vt(),t=[{icon:hh,title:"8(a) Business Development",description:"Navigate the 8(a) program application and certification process with expert guidance.",benefits:["Application assistance","Documentation prep","SBA liaison"]},{icon:Oq,title:"Small Business Certifications",description:"Get certified as a small business to access set-aside contracts and preferences.",benefits:["SBA certification","Size standard analysis","Recertification support"]},{icon:Os,title:"WOSB/EDWOSB Certification",description:"Women-Owned Small Business certification to access exclusive contracting opportunities.",benefits:["WOSB certification","Economic disadvantage review","Annual certification"]},{icon:Gq,title:"HUBZone Certification",description:"Qualify for HUBZone contracts by certifying your business in historically underutilized zones.",benefits:["HUBZone eligibility","Location verification","Employee requirements"]}];return a.jsxs(a.Fragment,{children:[a.jsx($r,{title:"Certifications Support | Government Contracting Certifications",description:"Get support for government contracting certifications including 8(a), Small Business, WOSB, and HUBZone certifications.",ke
859ywords:"government contracting certifications, 8(a) certification, small business certification, WOSB, HUBZone"}),a.jsxs("div",{className:"min-h-screen bg-gradient-background",children:[a.jsx("div",{className:"max-w-7xl mx-auto px-4 pt-8",children:a.jsxs(U,{variant:"ghost",onClick:()=>e("/"),className:"flex items-center gap-2 hover:scale-105 smooth-transition",children:[a.jsx(Tr,{className:"w-4 h-4"}),"Back to Home"]})}),a.jsx("section",{className:"py-12 px-4 bg-gradient-to-br from-purple-primary/10 to-blue-primary/10",children:a.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[a.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-gradient mb-4",children:"Certifications"}),a.jsx("p",{className:"text-xl text-foreground mb-4",children:"Certification Support Services"}),a.jsx("p",{className:"text-base text-muted-foreground mb-6",children:"Navigate the complex certification process with expert guidance. Unlock set-aside contracts and competitive advantages."}),a.jsx(U,{asChild:!0,size:"lg",className:"text-lg px-8 hero-gradient",children:a.jsx(je,{to:"/#contact",children:"Get Certified"})})]})}),a.jsx("section",{className:"py-12 px-4",children:a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-4xl font-bold text-gradient mb-4",children:"Certification Programs"}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"We help you navigate every certification program"})]}),a.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:t.map((r,n)=>a.jsxs(J,{className:"gradient-card smooth-transition hover:scale-105 hover:glow-effect group",children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-14 h-14 hero-gradient rounded-lg flex items-center justify-center flex-shrink-0",children:a.jsx(r.icon,{className:"w-7 h-7 text-white"})}),a.jsx("div",{className:"flex-1",children:a.jsx(le,{className:"text-2xl mb-2",children:r.title})})]})}),a.jsxs(re,{children:[a.jsx("p",{className:"text-muted-foreground mb-6",children:r.description}),a.jsx("div",{className:"space-y-2",children:r.benefits.map((s,i)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Na,{className:"w-5 h-5 text-green-500"}),a.jsx("span",{className:"text-sm",children:s})]},i))})]})]},n))})]})}),a.jsx("section",{className:"py-12 px-4 bg-muted/30",children:a.jsxs("div",{className:"max-w-5xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-4xl font-bold text-gradient mb-4",children:"Why Get Certified?"}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"Unlock exclusive opportunities and competitive advantages"})]}),a.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[a.jsxs(J,{className:"gradient-card text-center",children:[a.jsxs(de,{children:[a.jsx(_d,{className:"w-12 h-12 text-primary mx-auto mb-4"}),a.jsx(le,{children:"Access Set-Asides"})]}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground",children:"Gain access to billions in set-aside contracts reserved for certified small businesses."})})]}),a.jsxs(J,{className:"gradient-card text-center",children:[a.jsxs(de,{children:[a.jsx(Os,{className:"w-12 h-12 text-primary mx-auto mb-4"}),a.jsx(le,{children:"Competitive Edge"})]}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground",children:"Stand out in competitions and meet agency small business goals with proper certifications."})})]}),a.jsxs(J,{className:"gradient-card text-center",children:[a.jsxs(de,{children:[a.jsx(Mr,{className:"w-12 h-12 text-primary mx-auto mb-4"}),a.jsx(le,{children:"Partner Opportunities"})]}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground",children:"Become a valuable partner for large contractors looking to meet subcontracting goals."})})]})]})]})}),a.jsx("section",{className:"py-12 px-4",children:a.jsx("div",{className:"max-w-4xl mx-auto text-center",children:a.jsxs(J,{className:"bg-purple-primary border-purple-primary p-12 shadow-strong",children:[a.jsx("h2",{className:"text-4xl font-bold text-white mb-6",children:"Ready to Get Certified?"}),a.jsx("p",{className:"text-xl text-white/90 mb-8",children:"Let our experts guide you through the certification process from start to finish."}),a.jsx(U,{asChild:!0,size:"lg",variant:"secondary",className:"text-lg px-8",children:a.jsx(je,{to:"/#contact",children:"Start Your Certification"})})]})})})]})]})},O4e=()=>{const e=vt(),t=[{icon:zq,title:"Contractor Network",description:"Connect with thousands of verified prime contractors and subcontractors actively seeking partners.",benefits:["Verified contractors","Active opportunities","Partnership matching"]},{icon:$q,title:"Teaming Agreements",description:"Find the perfect teaming partners for your projects with our intelligent matching system.",benefits:["Smart matching","Capability-based search","Agreement templates"]},{icon:Ev,title:"Subcontracting Opportunities",description:"Access exclusive subcontracting opportunities from prime contractors looking for qualified partners.",benefits:["Direct opportunities","Set-aside requirements","Real-time notifications"]},{icon:Ft,title:"Business Growth",description:"Grow your network and business relationships to win more contracts as a team.",benefits:["Partner discovery","Business development","Market expansion"]}];return a.jsxs(a.Fragment,{children:[a.jsx($r,{title:"BidConnect | Contractors and Subcontractors Network",description:"Connect with prime contractors and subcontractors. Find teaming partners, access subcontracting opportunities, and grow your network.",keywords:"contractor network, subcontracting, teaming agreements, prime contractors, business partnerships"}),a.jsxs("div",{className:"min-h-screen bg-gradient-background",children:[a.jsx("div",{className:"max-w-7xl mx-auto px-4 pt-8",children:a.jsxs(U,{variant:"ghost",onClick:()=>e("/"),className:"flex items-center gap-2 hover:scale-105 smooth-transition",children:[a.jsx(Tr,{className:"w-4 h-4"}),"Back to Home"]})}),a.jsx("section",{className:"py-12 px-4 bg-gradient-to-br from-purple-primary/10 to-blue-primary/10",children:a.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[a.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-gradient mb-4",children:"BidConnect"}),a.jsx("p",{className:"text-xl text-foreground mb-4",children:"Contractors and Subcontractors Network"}),a.jsx("p",{className:"text-base text-muted-foreground mb-6",children:"Build powerful partnerships with verified contractors and subcontractors. Find the perfect team to win more contracts together."}),a.jsxs("div",{className:"flex gap-4 justify-center",children:[a.jsx(U,{asChild:!0,size:"lg",className:"text-lg px-8 hero-gradient",children:a.jsx(je,{to:"/directory",children:"Browse Network"})}),a.jsx(U,{asChild:!0,size:"lg",variant:"outline",className:"text-lg px-8",children:a.jsx(je,{to:"/#contact",children:"Join Network"})})]})]})}),a.jsx("section",{className:"py-12 px-4",children:a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-4xl font-bold text-gradient mb-4",children:"Network Features"}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"Everything you need to build winning partnerships"})]}),a.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:t.map((r,n)=>a.jsxs(J,{className:"gradient-card smooth-transition hover:scale-105 hover:glow-effect group",children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-14 h-14 hero-gradient rounded-lg flex items-center justify-center flex-shrink-0",children:a.jsx(r.icon,{className:"w-7 h-7 text-white"})}),a.jsx("div",{className:"flex-1",children:a.jsx(le,{className:"text-2xl mb-2",children:r.title})})]})}),a.jsxs(re,{children:[a.jsx("p",{className:"text-muted-foreground mb-6",children:r.description}),a.jsx("div",{className:"space-y-2",children:r.benefits.map((s,i)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Na,{className:"w-5 h-5 text-green-500"}),a.jsx("span",{className:"text-sm",children:s})]},i))})]})]},n))})]})}),a.jsx("section",{className:"py-12 px-4 bg-muted/30",children:a.jsxs("div",{className:"max-w-5xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-4xl font-bold text-gradient mb-4",children:"Why Join BidConnect?"}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"The most trusted network in government contracting"})]}),a.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[a.jsxs(J,{className:"gradient-card text-center",children:[a.jsxs(de,{children:[a.jsx(Mr,{className:"w-12 h-12 text-primary mx-auto mb-4"}),a.jsx(le,{children:"1,000+ Members"})]}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground",children:"Join a growing network of verified contractors and subcontractors across all industries."})})]}),a.jsxs(J,{className:"gradient-card text-center",children:[a.jsxs(de,{children:[a.jsx(ap,{className:"w-12 h-12 text-primary mx-auto mb-4"}),a.jsx(le,{children:"Smart Matching"})]}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground",children:"Our AI-powered matching connects you with the most relevant partners for your needs."})})]}),a.jsxs(J,{className:"gradient-card text-center",children:[a.jsxs(de,{children:[a.jsx(Os,{className:"w-12 h-12 text-primary mx-auto mb-4"}),a.jsx(le,{children:"Verified Partners"})]}),a.jsx(re,{children:a.jsx("p",{className:"text-muted-foreground",children:"All members are verified for certifications, capabilities, and past performance."})})]})]})]})}),a.jsx("section",{className:"py-12 px-4",children:a.jsx("div",{className:"max-w-4xl mx-auto text-center",children:a.jsxs(J,{className:"bg-purple-primary border-purple-primary p-12 shadow-strong",children:[a.jsx("h2",{className:"text-4xl font-bold text-white mb-6",children:"Ready to Build Your Network?"}),a.jsx("p",{className:"text-xl text-white/90 mb-8",children:"Join BidConnect today and start building partnerships that win contracts."}),a.jsxs("div",{className:"flex justify-center gap-4",children:[a.jsx(U,{asChild:!0,size:"lg",variant:"secondary",className:"text-lg px-8",children:a.jsx(je,{to:"/directory",children:"Browse Directory"})}),a.jsx(U,{asChild:!0,size:"lg",variant:"outline",className:"text-lg px-8 bg-white/10 text-white border-white/20 hover:bg-white/20",children:a.jsx(je,{to:"/#contact",children:"Join Network"})})]})]})})})]})]})};function T4e(){var N;const{id:e}=Uy(),t=vt(),{toast:r}=dt(),[n,s]=g.useState(null),[i,o]=g.useState(!0),[l,c]=g.useState(new Set),[d,u]=g.useState("all"),[f,h]=g.useState(!1);g.useEffect(()=>{if(!e||!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)){console.error("Invalid campaign ID:",e),r({title:"Invalid Campaign ID",description:"The campaign ID in the URL is invali
859d. Redirecting...",variant:"destructive"}),t("/admin/leads");return}m();const S=Z.channel("campaign-updates").on("postgres_changes",{event:"*",schema:"public",table:"campaign_deliveries",filter:`campaign_id=eq.${e}`},()=>{console.log("Campaign delivery updated, reloading..."),m()}).subscribe();return()=>{Z.removeChannel(S)}},[e]);const m=async()=>{try{const{data:j,error:S}=await Z.from("campaigns").select(` 860 *, 861 campaign_deliveries ( 862 id, 863 status, 864 delivered_at, 865 opened_at, 866 clicked_at, 867 recipient_email, 868 error_message, 869 open_count, 870 click_count, 871 last_opened_at, 872 last_clicked_at, 873 opens, 874 clicks 875 ) 876 `).eq("id",e).single();if(S)throw S;s(j)}catch(j){r({title:"Error loading campaign",description:j.message,variant:"destructive"}),t("/admin/leads")}finally{o(!1)}},v=()=>{if(!(n!=null&&n.campaign_deliveries))return null;const j=n.campaign_deliveries,S=j.length,C=j.filter(B=>B.delivered_at).length,P=j.filter(B=>B.opened_at).length,A=j.filter(B=>B.clicked_at).length,D=j.filter(B=>B.status==="failed").length,F=j.reduce((B,V)=>B+(V.open_count||0),0),q=j.reduce((B,V)=>B+(V.click_count||0),0);return{total:S,delivered:C,opened:P,clicked:A,failed:D,totalOpens:F,totalClicks:q,deliveryRate:S>0?C/S*100:0,openRate:C>0?P/C*100:0,clickRate:P>0?A/P*100:0,failureRate:S>0?D/S*100:0}},p=()=>{if(!(n!=null&&n.campaign_deliveries))return[];let j=[...n.campaign_deliveries];return d==="opened"?j=j.filter(S=>S.opened_at):d==="clicked"?j=j.filter(S=>S.clicked_at):d==="delivered"?j=j.filter(S=>S.delivered_at&&!S.opened_at):d==="failed"&&(j=j.filter(S=>S.status==="failed")),j.sort((S,C)=>{const P=(S.click_count||0)*2+(S.open_count||0);return(C.click_count||0)*2+(C.open_count||0)-P})},x=j=>{const S=new Set(l);S.has(j)?S.delete(j):S.add(j),c(S)},b=()=>{var j,S;if(l.size===((j=n==null?void 0:n.campaign_deliveries)==null?void 0:j.length))c(new Set);else{const C=new Set(((S=n==null?void 0:n.campaign_deliveries)==null?void 0:S.map(P=>P.recipient_email||""))||[]);c(C)}},y=async()=>{h(!0);try{const{error:j}=await Z.functions.invoke("sync-resend-events",{body:{campaignId:e}});if(j)throw j;await m(),r({title:"Stats synced",description:"Campaign analytics updated from Resend"})}catch(j){r({title:"Sync failed",description:j.message,variant:"destructive"})}finally{h(!1)}},w=()=>{if(l.size===0){r({title:"No recipients selected",description:"Please select at least one recipient to create an audience.",variant:"destructive"});return}const j=Array.from(l).map(S=>({email:S}));t("/admin/leads",{state:{prefilledRecipients:j,audienceName:`Audience from ${n==null?void 0:n.name}`}}),r({title:"Audience created",description:`${l.size} recipients added to new campaign.`})};if(i)return a.jsx(Gt,{children:a.jsx("div",{className:"container mx-auto py-8",children:a.jsx("div",{className:"text-center",children:"Loading campaign report..."})})});if(!n)return a.jsx(Gt,{children:a.jsx("div",{className:"container mx-auto py-8",children:a.jsx("div",{className:"text-center",children:"Campaign not found"})})});const _=v();return a.jsx(Gt,{children:a.jsxs("div",{className:"container mx-auto py-8 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>t("/admin/leads"),className:"mb-2",children:[a.jsx(Tr,{className:"h-4 w-4 mr-2"}),"Back to Campaigns"]}),a.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[n.name,a.jsx(ve,{variant:n.status==="sent"?"outline":"secondary",children:n.status})]}),a.jsx("p",{className:"text-muted-foreground",children:n.subject})]}),a.jsxs(U,{onClick:y,disabled:f,variant:"outline",children:[a.jsx(Ur,{className:`h-4 w-4 mr-2 ${f?"animate-spin":""}`}),f?"Syncing...":"Sync from Resend"]})]}),a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Br,{className:"h-5 w-5"}),"Campaign Details"]})}),a.jsxs(re,{className:"grid md:grid-cols-3 gap-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"Created"}
876),a.jsx("div",{className:"font-medium",children:bt(new Date(n.created_at),"PPP 'at' p")})]}),n.sent_at&&a.jsxs("div",{children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"Sent"}),a.jsx("div",{className:"font-medium",children:bt(new Date(n.sent_at),"PPP 'at' p")})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"Type"}),a.jsx("div",{className:"font-medium capitalize",children:n.campaign_type||"Email"})]})]})]}),_&&a.jsxs(a.Fragment,{children:[a.jsxs(J,{children:[a.jsxs(de,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx($s,{className:"h-5 w-5"}),"Performance Overview"]}),a.jsx(nt,{children:"Real-time campaign engagement metrics"})]}),a.jsx(re,{children:a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(Na,{className:"h-4 w-4 text-green-600"}),"Delivered"]}),a.jsxs(ve,{variant:"outline",className:"text-xs",children:[_.deliveryRate.toFixed(1),"%"]})]}),a.jsx("div",{className:"text-3xl font-bold text-green-600",children:_.delivered}),a.jsx(Qa,{value:_.deliveryRate,className:"h-2"}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:["of ",_.total," sent"]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(ci,{className:"h-4 w-4 text-blue-600"}),"Opened"]}),a.jsxs(ve,{variant:"outline",className:"text-xs",children:[_.openRate.toFixed(1),"%"]})]}),a.jsx("div",{className:"text-3xl font-bold text-blue-600",children:_.opened}),a.jsx(Qa,{value:_.openRate,className:"h-2"}),a.jsx("div",{className:"text-xs text-muted-foreground",children:"open rate"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(mh,{className:"h-4 w-4 text-purple-600"}),"Clicked"]}),a.jsxs(ve,{variant:"outline",className:"text-xs",children:[_.clickRate.toFixed(1),"%"]})]}),a.jsx("div",{className:"text-3xl font-bold text-purple-600",children:_.clicked}),a.jsx(Qa,{value:_.clickRate,className:"h-2"}),a.jsx("div",{className:"text-xs text-muted-foreground",children:"click-through rate"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(xi,{className:"h-4 w-4 text-red-600"}),"Failed"]}),a.jsxs(ve,{variant:"outline",className:"text-xs",children:[_.failureRate.toFixed(1),"%"]})]}),a.jsx("div",{className:"text-3xl font-bold text-red-600",children:_.failed}),a.jsx(Qa,{value:_.failureRate,className:"h-2"}),a.jsx("div",{className:"text-xs text-muted-foreground",children:"delivery failures"})]})]})})]}),a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Mr,{className:"h-5 w-5"}),"Recipient Activity"]}),a.jsx(nt,{children:"Sorted by engagement - most engaged first"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(Re,{value:d,onValueChange:u,children:[a.jsx(Me,{className:"w-[180px]",children:a.jsx(De,{placeholder:"Filter by status"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"all",children:"All Recipients"}),a.jsx(ce,{value:"clicked",children:"Clicked"}),a.jsx(ce,{value:"opened",children:"Opened"}),a.jsx(ce,{value:"delivered",children:"Delivered Only"}),a.jsx(ce,{value:"failed",children:"Failed"})]})]}),a.jsx(U,{variant:"outline",size:"sm",onClick:b,children:l.size===((N=n.campaign_deliveries)==null?void 0:N.length)?"Deselect All":"Select All"}),a.jsxs(U,{onClick:w,disabled:l.size===0,size:"sm",children:[a.jsx(Mr,{className:"mr-2 h-4 w-4"}),"Create Audience (",l.size,")"]})]})]})}),a.jsx(re,{children:a.jsx("div",{className:"space-y-2",children:p().map(j=>{var S,C,P,A;return a.jsxs("div",{className:"flex items-center gap-3 p-3 border rounded-lg hover:bg-muted/50 transition-colors",children:[a.jsx(is,{checked:l.has(j.recipient_email||""),onCheckedChange:()=>x(j.recipient_email||"")}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"font-medium",children:j.recipient_email||"Unknown"}),a.jsxs("div",{className:"text-xs text-muted-foreground mt-1 space-x-3",children:[j.open_count>0&&a.jsxs("span",{children:["Opened ",j.open_count,"x"]}),j.click_count>0&&a.jsxs("span",{children:["Clicked ",j.click_count,"x"]}),j.last_opened_at&&a.jsxs("span",{children:["Last opened: ",bt(new Date(j.last_opened_at),"MMM d, h:mm a")]})]}),j.error_message&&a.jsx("div",{className:"text-xs text-red-600 mt-1",children:j.error_message}),(((S=j.opens)==null?void 0:S.length)>1||((C=j.clicks)==null?void 0:C.length)>0)&&a.jsxs("details",{className:"mt-2",children:[a.jsx("summary",{className:"text-xs cursor-pointer text-blue-600 hover:underline",children:"View detailed activity"}),a.jsxs("div",{className:"mt-2 space-y-1 text-xs",children:[(P=j.opens)==null?void 0:P.map((D,F)=>a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(ci,{className:"h-3 w-3"}),"Opened at ",bt(new Date(D.timestamp),"MMM d, h:mm:ss a")]},F)),(A=j.clicks)==null?void 0:A.map((D,F)=>a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(mh,{className:"h-3 w-3"}),"Clicked ",D.url," at ",bt(new Date(D.timestamp),"MMM d, h:mm:ss a")]},F))]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[j.delivered_at&&a.jsxs(ve,{variant:"outline",className:"text-xs",children:[a.jsx(Na,{className:"h-3 w-3 mr-1"}),"Delivered"]}),j.opened_at&&a.jsxs(ve,{variant:"outline",className:"text-xs",children:[a.jsx(ci,{className:"h-3 w-3 mr-1"}),"Opened"]}),j.clicked_at&&a.jsxs(ve,{variant:"outline",className:"text-xs",children:[a.jsx(mh,{className:"h-3 w-3 mr-1"}),"Clicked"]}),j.status==="failed"&&a.jsxs(ve,{variant:"destructive",className:"text-xs",children:[a.jsx(xi,{className:"h-3 w-3 mr-1"}),"Failed"]})]})]},j.id)})})})]})]}),a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(an,{className:"h-5 w-5"}),"Message Content"]})}),a.jsxs(re,{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-muted-foreground mb-1",children:"Subject"}),a.jsx("div",{className:"font-medium",children:n.subject})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-muted-foreground mb-1",children:"Body"}),a.jsx("div",{className:"prose prose-sm max-w-none whitespace-pre-wrap bg-muted p-4 rounded-lg",children:n.body})]})]})]})]})})}const M4e=X9,I4e=bP,$4e=jP,R4e=["all","Aerospace & Defense","Agriculture & Food Services","Architecture & Engineering","Construction & Building","Education & Training","Energy & Utilities","Environmental Services","Financial Services","Healthcare & Medical","Human Services","Information Technology","Legal Services","Logistics & Transportation","Manufacturing","Marketing & Communications","Professional Services","Public Safety","Real Estate","Research & Development","Security Services","Telecommunications","Other"],NW=["all","Department of Defense (DOD)","Department of Homeland Security (DHS)","Department of Veterans Affairs (VA)","Department of Energy (DOE)","Department of Health and Human Services (HHS)","Department of Agriculture (USDA)","Department of Transportation (DOT)","Department of Justice (DOJ)","Department of State","Department of the Interior","Department of Commerce","Department of Labor","Department of Education","Department of Housing and Urban Development (HUD)","Department of the Treasury","Environmental Protection Agency (EPA)","National Aeronautics and Space Administration (NASA)","General Services Administration (GSA)","Small Business Administration (SBA)","Social Security Administration (SSA)","National Science Foundation (NSF)","Agency for International Development (USAID)","Nuclear Regulatory Commission (NRC)","Office of Personnel Management (OPM)","Federal Communications Commission (FCC)","Securities and Exchange Commission (SEC)","Federal Trade Commission (FTC)","Consumer Financial Protection Bureau (CFPB)","National Institutes of Health (NIH)","Centers for Disease Control and Prevention (CDC)","Food and Drug Administration (FDA)","Federal Aviation Administration (FAA)","Federal Highway Administration (FHWA)","Coast Guard","Army","Navy","Air Force","Marine Corps","Space Force"],SW=[{code:"11",title:"Agriculture, Forestry, Fishing and Hunting"},{code:"111",title:"Crop Production"},{code:"112",title:"Animal Production and Aquaculture"}
876,{code:"113",title:"Forestry and Logging"},{code:"114",title:"Fishing, Hunting and Trapping"},{code:"115",title:"Support Activities for Agriculture and Forestry"},{code:"21",title:"Mining, Quarrying, and Oil and Gas Extraction"},{code:"211",title:"Oil and Gas Extraction"},{code:"212",title:"Mining (except Oil and Gas)"},{code:"213",title:"Support Activities for Mining"},{code:"22",title:"Utilities"},{code:"221",title:"Utilities"},{code:"23",title:"Construction"},{code:"236",title:"Construction of Buildings"},{code:"237",title:"Heavy and Civil Engineering Construction"},{code:"238",title:"Specialty Trade Contractors"},{code:"31",title:"Manufacturing"},{code:"32",title:"Manufacturing"},{code:"33",title:"Manufacturing"},{code:"311",title:"Food Manufacturing"},{code:"312",title:"Beverage and Tobacco Product Manufacturing"},{code:"313",title:"Textile Mills"},{code:"314",title:"Textile Product Mills"},{code:"315",title:"Apparel Manufacturing"},{code:"316",title:"Leather and Allied Product Manufacturing"},{code:"321",title:"Wood Product Manufacturing"},{code:"322",title:"Paper Manufacturing"},{code:"323",title:"Printing and Related Support Activities"},{code:"324",title:"Petroleum and Coal Products Manufacturing"},{code:"325",title:"Chemical Manufacturing"},{code:"326",title:"Plastics and Rubber Products Manufacturing"},{code:"327",title:"Nonmetallic Mineral Product Manufacturing"},{code:"331",title:"Primary Metal Manufacturing"},{code:"332",title:"Fabricated Metal Product Manufacturing"},{code:"333",title:"Machinery Manufacturing"},{code:"334",title:"Computer and Electronic Product Manufacturing"},{code:"335",title:"Electrical Equipment, Appliance, and Component Manufacturing"},{code:"336",title:"Transportation Equipment Manufacturing"},{code:"337",title:"Furniture and Related Product Manufacturing"},{code:"339",title:"Miscellaneous Manufacturing"},{code:"42",title:"Wholesale Trade"},{code:"423",title:"Merchant Wholesalers, Durable Goods"},{code:"424",title:"Merchant Wholesalers, Nondurable Goods"},{code:"425",title:"Wholesale Electronic Markets and Agents and Brokers"},{code:"44",title:"Retail Trade"},{code:"45",title:"Retail Trade"},{code:"441",title:"Motor Vehicle and Parts Dealers"},{code:"442",title:"Furniture and Home Furnishings Stores"},{code:"443",title:"Electronics and Appliance Stores"},{code:"444",title:"Building Material and Garden Equipment and Supplies Dealers"},{code:"445",title:"Food and Beverage Stores"},{code:"446",title:"Health and Personal Care Stores"},{code:"447",title:"Gasoline Stations"},{code:"448",title:"Clothing and Clothing Accessories Stores"},{code:"451",title:"Sporting Goods, Hobby, Musical Instrument, and Book Stores"},{code:"452",title:"General Merchandise Stores"},{code:"453",title:"Miscellaneous Store Retailers"},{code:"454",title:"Nonstore Retailers"},{code:"48",title:"Transportation and Warehousing"},{code:"49",title:"Transportation and Warehousing"},{code:"481",title:"Air Transportation"},{code:"482",title:"Rail Transportation"},{code:"483",title:"Water Transportation"},{code:"484",title:"Truck Transportation"},{code:"485",title:"Transit and Ground Passenger Transportation"},{code:"486",title:"Pipeline Transportation"},{code:"487",title:"Scenic and Sightseeing Transportation"},{code:"488",title:"Support Activities for Transportation"},{code:"491",title:"Postal Service"},{code:"492",title:"Couriers and Messengers"},{code:"493",title:"Warehousing and Storage"},{code:"51",title:"Information"},{code:"511",title:"Publishing Industries (except Internet)"},{code:"512",title:"Motion Picture and Sound Recording Industries"},{code:"515",title:"Broadcasting (except Internet)"},{code:"517",title:"Telecommunications"},{code:"518",title:"Data Processing, Hosting, and Related Services"},{code:"519",title:"Other Information Services"},{code:"52",title:"Finance and Insurance"},{code:"521",title:"Monetary Authorities-Central Bank"},{code:"522",title:"Credit Intermediation and Related Activities"},{code:"523",title:"Securities, Commodity Contracts, and Other Financial Investments"},{code:"524",title:"Insurance Carriers and Related Activities"},{code:"525",title:"Funds, Trusts, and Other Financial Vehicles"},{code:"53",title:"Real Estate and Rental and Leasing"},{code:"531",title:"Real Estate"},{code:"532",title:"Rental and Leasing Services"},{code:"533",title:"Lessors of Nonfinancial Intangible Assets"},{code:"54",title:"Professional, Scientific, and Technical Services"},{code:"541",title:"Professional, Scientific, and Technical Services"},{code:"5411",title:"Legal Services"},{code:"5412",title:"Accounting, Tax Preparation, Bookkeeping, and Payroll Services"},{code:"5413",title:"Architectural, Engineering, and Related Services"},{code:"5414",title:"Specialized Design Services"},{code:"5415",title:"Computer Systems Design and Related Services"},{code:"5416",title:"Management, Scientific, and Technical Consulting Services"}
876,{code:"5417",title:"Scientific Research and Development Services"},{code:"5418",title:"Advertising, Public Relations, and Related Services"},{code:"5419",title:"Other Professional, Scientific, and Technical Services"},{code:"55",title:"Management of Companies and Enterprises"},{code:"551",title:"Management of Companies and Enterprises"},{code:"56",title:"Administrative and Support and Waste Management"},{code:"561",title:"Administrative and Support Services"},{code:"562",title:"Waste Management and Remediation Services"},{code:"61",title:"Educational Services"},{code:"611",title:"Educational Services"},{code:"62",title:"Health Care and Social Assistance"},{code:"621",title:"Ambulatory Health Care Services"},{code:"622",title:"Hospitals"},{code:"623",title:"Nursing and Residential Care Facilities"},{code:"624",title:"Social Assistance"},{code:"71",title:"Arts, Entertainment, and Recreation"},{code:"711",title:"Performing Arts, Spectator Sports, and Related Industries"},{code:"712",title:"Museums, Historical Sites, and Similar Institutions"},{code:"713",title:"Amusement, Gambling, and Recreation Industries"},{code:"72",title:"Accommodation and Food Services"},{code:"721",title:"Accommodation"},{code:"722",title:"Food Services and Drinking Places"},{code:"81",title:"Other Services (except Public Administration)"},{code:"811",title:"Repair and Maintenance"},{code:"812",title:"Personal and Laundry Services"},{code:"813",title:"Religious, Grantmaking, Civic, Professional, and Similar Organizations"},{code:"814",title:"Private Households"},{code:"92",title:"Public Administration"},{code:"921",title:"Executive, Legislative, and Other General Government Support"},{code:"922",title:"Justice, Public Order, and Safety Activities"},{code:"923",title:"Administration of Human Resource Programs"},{code:"924",title:"Administration of Environmental Quality Programs"},{code:"925",title:"Administration of Housing Programs, Urban Planning, and Community Development"},{code:"926",title:"Administration of Economic Programs"},{code:"927",title:"Space Research and Technology"},{code:"928",title:"National Security and International Affairs"}],_W=["all","Small Business","8(a) Business Development","HUBZone","Women-Owned Small Business (WOSB)","Economically Disadvantaged WOSB (EDWOSB)","Service-Disabled Veteran-Owned Small Business (SDVOSB)","Veteran-Owned Small Business (VOSB)","Indian Economic Enterprise","Emerging Small Business","Total Small Business Set-Aside"],D4e=()=>{const{toast:e}=dt();vt();const[t,r]=g.useState("government"),[n,s]=g.useState([]),[i,o]=g.useState([]),[l,c]=g.useState(!0),[d,u]=g.useState(!1),[f,h]=g.useState(""),[m,v]=g.useState(""),[p,x]=g.useState("all"),[b,y]=g.useState("all"),[w,_]=g.useState("all"),[N,j]=g.useState("all"),[S,C]=g.useState("all"),[P,A]=g.useState(""),[D,F]=g.useState(""),[q,B]=g.useState(!0),V=R4e,E=_W,M=Array.from(new Set(n.map(k=>k.agency).filter(Boolean))),T=[...new Set([...NW,...M])].sort((k,G)=>k==="all"?-1:G==="all"?1:k.localeCompare(G)),L=["all",...Array.from(new Set(n.map(k=>k.place_of_performance).filter(Boolean)))];g.useEffect(()=>{K()},[t]),g.useEffect(()=>{!l&&n.length===0&&t==="private"&&H()},[l,n.length,t]),g.useEffect(()=>{ee()},[m,p,b,w,N,S,P,D,n]);const K=async()=>{try{c(!0);let k=Z.from("solicitations").select("*").eq("status","active").order("posted_date",{ascending:!1}).limit(1e3);t==="government"?k=k.in("source_platform",["sam.gov","grants_gov","state_portal"]):k=k.eq("source_platform","census_trade");const{data:G,error:te}=await k;if(te)throw te;const $=(G||[]).filter(ae=>{var oe;return((oe=ae.metadata)==null?void 0:oe.generated_by_ai)!==!0});s($)}catch(k){console.error("Error loading solicitations:",k),e({title:"Error loading opportunities",description:"Please try again",variant:"destructive"})}finally{c(!1)}},H=async()=>{try{if(u(!0),t==="private"){e({title:"Fetching Real Trade Data...",description:"Accessing US Census Bureau import/export intelligence"});const{data:k,error:G}=await Z.functions.invoke("fetch-import-intelligence");if(G)throw G;e({title:"Sync Complete",description:`Fetched ${(k==null?void 0:k.count)||0} real trade opportunities from US Census Bureau`})}else{e({title:"Fetching Real Government Contracts...",description:"Accessing SAM.gov, Grants.gov, and state portals"});const{data:k,error:G}=await Z.functions.invoke("aggregate-all-opportunities");if(G)throw G;e({title:"Sync Complete",description:`Fetched ${k.total_opportunities||0} real government opportunities from ${k.sources_succeeded||0} sources`})}await K()}catch(k){console.error("Error syncing:",k),e({title:"Sync Failed",description:"Could not fetch new opportunities",variant:"destructive"})}finally{u(!1)}},ee=()=>{let k=n;if(m&&(k=k.filter(G=>{var te,$;return G.title.toLowerCase().includes(m.toLowerCase())||((te=G.description)==null?void 0:te.toLowerCase().includes(m.toLowerCase()))||G.agency.toLowerCase().includes(m.toLowerCase())||(($=G.solicitation_number)==null?void 0:$.toLowerCase().includes(m.toLowerCase()))})),p&&p!=="all"&&(k=k.filter(G=>({"Information Technology":["IT"],"Construction & Building":["Construction"],"Healthcare & Medical":["Healthcare"],Manufacturing:["Manufacturing"],"Professional Services":["Professional Services"],"Logistics & Transportation":["Transportation"],"Energy & Utilities":["Other"]}[p]||[p]).includes(G.industry))),b&&b!=="all"&&(k=k.filter(G=>{var te;return(te=G.naics_codes)==null?void 0:te.some($=>$.startsWith(b))})),w&&w!=="all"&&(k=k.filter(G=>G.agency.toLowerCase().includes(w.toLowerCase().split("(")[0].trim()))),N&&N!=="all"&&(k=k.filter(G=>G.set_aside_type===N)),S&&S!=="all"&&(k=k.filter(G=>G.place_of_performance===S)),P){const G=parseFloat(P)*1e3;k=k.filter(te=>te.contract_value_min&&te.contract_value_min>=G||te.contract_value_max&&te.contract_value_max>=G)}if(D){const G=parseFloat(D)*1e3;k=k.filter(te=>te.contract_value_max&&te.contract_value_max<=G||te.contract_value_min&&te.contract_value_min<=G)}o(k)},se=async()=>
876{if(v(f),f.trim()&&t==="government"){e({title:"Searching Real Opportunities...",description:`Looking for "${f}" in government databases`});try{const{data:k,error:G}=await Z.functions.invoke("aggregate-all-opportunities",{body:{keywords:f}});if(G)throw G;await K(),e({title:"Search Complete",description:`Found opportunities from ${k.sources_succeeded||0} government sources`})}catch(k){console.error("Search error:",k),e({title:"Search Error",description:"Could not fetch opportunities",variant:"destructive"})}}},ne=()=>{h(""),v("")},W=()=>{h(""),v(""),x("all"),y("all"),_("all"),j("all"),C("all"),A(""),F("")},ie=(k,G)=>!k&&!G?"Not specified":k&&G?`$${(k/1e3).toFixed(0)}K - $${(G/1e3).toFixed(0)}K`:k?`From $${(k/1e3).toFixed(0)}K`:`Up to $${(G/1e3).toFixed(0)}K`,R=async k=>{var G;try{const{data:{user:te}}=await Z.auth.getUser();if(!te){e({title:"Authentication required",description:"Please sign in to add contracts to your pipeline",variant:"destructive"});return}const{data:$}=await Z.from("profiles").select("user_id").eq("user_id",te.id).single(),{error:ae}=await Z.from("contracts").insert({user_id:te.id,organization_id:($==null?void 0:$.user_id)||te.id,title:k.title,content:k.description,industry:k.industry,naics_code:((G=k.naics_codes)==null?void 0:G[0])||null,contract_link:k.url,status:"pending",contract_value:k.contract_value_max||k.contract_value_min||null});if(ae)throw ae;e({title:"Added to Pipeline",description:"Contract has been added to your pipeline"})}catch(te){console.error("Error adding to pipeline:",te),e({title:"Error",description:"Failed to add contract to pipeline",variant:"destructive"})}},O=async k=>{var G;try{const{data:{user:te}}=await Z.auth.getUser();if(!te){e({title:"Authentication required",description:"Please sign in to generate price bids",variant:"destructive"});return}const{data:$}=await Z.from("profiles").select("user_id").eq("user_id",te.id).single(),{error:ae}=await Z.from("contracts").insert({user_id:te.id,organization_id:($==null?void 0:$.user_id)||te.id,title:k.title,content:k.description,industry:k.industry,naics_code:((G=k.naics_codes)==null?void 0:G[0])||null,contract_link:k.url,status:"pending",contract_value:k.contract_value_max||k.contract_value_min||null});if(ae)throw ae;e({title:"Ready for Price Bid",description:"Contract added. Go to Price Bid page to generate pricing."})}catch(te){console.error("Error adding contract:",te),e({title:"Error",description:"Failed to add contract for price bid",variant:"destructive"})}};return a.jsx(Gt,{children:a.jsxs("div",{className:"container mx-auto py-8 space-y-6",children:[a.jsx("div",{className:"flex justify-between items-center",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-bold",children:"Find Contracts"}),a.jsx("p",{className:"text-muted-foreground mt-2",children:"Browse solicitations and RFQs from government and private sectors"})]})}),a.jsxs(Ac,{value:t,onValueChange:k=>r(k),children:[a.jsxs("div",{className:"flex items-center justify-center gap-4",children:[a.jsxs(ol,{className:"grid w-full max-w-md grid-cols-2",children:[a.jsx(Ot,{value:"government",className:"data-[state=active]:bg-accent data-[state=active]:text-accent-foreground",children:"Government"}),a.jsx(Ot,{value:"private",className:"data-[state=active]:bg-accent data-[state=active]:text-accent-foreground",children:"Private"})]}),a.jsx(U,{onClick:H,disabled:d,variant:"outline",size:"icon",title:"Refresh opportunities",className:"border-border hover:bg-accent hover:text-accent-foreground",children:d?a.jsx(Je,{className:"h-4 w-4 animate-spin"}):a.jsx(Ur,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"mt-6 space-y-4",children:[a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(Es,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),a.jsx(ge,{placeholder:"Search by title, keywords, solicitation number...",value:f,onChange:k=>h(k.target.value),onKeyDown:k=>k.key==="Enter"&&se(),className:"pl-10"})]}),a.jsxs(U,{onClick:se,className:"gap-2",children:[a.jsx(Es,{className:"h-4 w-4"}),"Search"]}),m&&a.jsx(U,{onClick:ne,variant:"outline",children:"Clear"})]}),a.jsx(M4e,{open:q,onOpenChange:B,children:a.jsxs(J,{children:[a.jsx(I4e,{asChild:!0,children:a.jsx(de,{className:"cursor-pointer hover:bg-accent/50 transition-colors py-2 px-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(qu,{className:"h-3.5 w-3.5"}),a.jsx(le,{className:"text-sm font-medium",children:"Advanced Filters"})]}),a.jsx(Go,{className:`h-3.5 w-3.5 transition-transform ${q?"rotate-180":""}`})]})})}),a.jsx($4e,{children:a.jsxs(re,{className:"space-y-2 py-3 px-4",children:[a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 ga
876p-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wide",children:"Industry"}),a.jsxs(Re,{value:p,onValueChange:x,children:[a.jsx(Me,{className:"h-8 text-xs",children:a.jsx(De,{placeholder:"Select"})}),a.jsx(Ie,{children:V.map(k=>a.jsx(ce,{value:k,children:k==="all"?"All":k},k))})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wide",children:"NAICS"}),a.jsxs(Re,{value:b,onValueChange:y,children:[a.jsx(Me,{className:"h-8 text-xs",children:a.jsx(De,{placeholder:"Select code"})}),a.jsxs(Ie,{className:"max-h-[300px]",children:[a.jsx(ce,{value:"all",children:"All NAICS Codes"}),SW.map((k,G)=>a.jsxs(ce,{value:k.code,children:[k.code," - ",k.title]},`${k.code}-${G}`))]})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wide",children:t==="government"?"Agency":"Company"}),a.jsxs(Re,{value:w,onValueChange:_,children:[a.jsx(Me,{className:"h-8 text-xs",children:a.jsx(De,{placeholder:"Select"})}),a.jsx(Ie,{className:"max-h-[300px]",children:T.map(k=>a.jsx(ce,{value:k,children:k==="all"?"All":k},k))})]})]}),t==="government"&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wide",children:"Set-Aside"}),a.jsxs(Re,{value:N,onValueChange:j,children:[a.jsx(Me,{className:"h-8 text-xs",children:a.jsx(De,{placeholder:"Select"})}),a.jsx(Ie,{children:E.map(k=>a.jsx(ce,{value:k,children:k==="all"?"All":k},k))})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wide",children:"Location"}),a.jsxs(Re,{value:S,onValueChange:C,children:[a.jsx(Me,{className:"h-8 text-xs",children:a.jsx(De,{placeholder:"Select"})}),a.jsx(Ie,{className:"max-h-[300px]",children:L.map(k=>a.jsx(ce,{value:k,children:k==="all"?"All":k},k))})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wide",children:"Min ($K)"}),a.jsx(ge,{className:"h-8 text-xs",type:"number",placeholder:"0",value:P,onChange:k=>A(k.target.value)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wide",children:"Max ($K)"}),a.jsx(ge,{className:"h-8 text-xs",type:"number",placeholder:"0",value:D,onChange:k=>F(k.target.value)})]})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:W,children:"Clear All Filters"}),a.jsxs(U,{size:"sm",className:"h-7 text-xs gap-1.5",onClick:ee,children:[a.jsx(Es,{className:"h-3 w-3"}),"Search"]})]})]})})]})}),l?a.jsx("div",{className:"flex justify-center py-12",children:a.jsx(Je,{className:"h-8 w-8 animate-spin"})}):a.jsx(Rt,{value:t,className:"space-y-4",children:i.length===0?a.jsx(J,{children:a.jsxs(re,{className:"py-12 text-center space-y-4",children:[a.jsx(Ft,{className:"h-12 w-12 mx-auto text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-lg font-medium",children:"No opportunities found"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:t==="private"?m?"Try: aircraft, automotive, computing, solar panels, medical devices, pharmaceuticals, or agricultural products":"Click refresh to fetch import intelligence and agricultural export opportunities":m?"Try adjusting your search or filters":"Click refresh to fetch the latest government opportunities"})]}),a.jsxs(U,{onClick:H,children:[a.jsx(Ur,{className:"h-4 w-4 mr-2"}),"Fetch Opportunities"]})]})}):i.map(k=>{var G;return a.jsxs(J,{className:"hover:shadow-lg transition-shadow",children:[a.jsx(de,{children:a.jsxs("div",{className:"flex justify-between items-start gap-4",children:[a.jsxs("div",{className:"space-y-2 flex-1",children:[a.jsx(le,{className:"text-xl",children:k.title}),a.jsxs("div",{className:"flex gap-2 flex-wrap",children:[a.jsx(ve,{variant:k.source_platform==="sam_gov"?"default":k.source_platform==="grants_gov"?"secondary":"outline",children:k.source_platform==="sam_gov"?"SAM.gov":k.source_platform==="grants_gov"?"Grants.gov":"State Portal"}),a.jsx(ve,{variant:k.opportunity_type==="grant"?"secondary":"default",children:k.opportunity_type==="grant"?"Grant":"C
876ontract"}),a.jsx(ve,{variant:"outline",children:k.industry}),k.set_aside_type&&a.jsx(ve,{variant:"secondary",children:k.set_aside_type}),(G=k.naics_codes)==null?void 0:G.map(te=>a.jsxs(ve,{variant:"outline",children:["NAICS: ",te]},te))]})]}),a.jsx(U,{asChild:!0,variant:"ghost",size:"sm",children:a.jsx("a",{href:k.url,target:"_blank",rel:"noopener noreferrer",children:a.jsx(ft,{className:"h-4 w-4"})})})]})}),a.jsxs(re,{className:"space-y-4",children:[a.jsx("p",{className:"text-muted-foreground line-clamp-2",children:k.description}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(mr,{className:"h-4 w-4 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:k.agency}),a.jsx("p",{className:"text-xs text-muted-foreground",children:k.department})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Jt,{className:"h-4 w-4 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Value"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:ie(k.contract_value_min,k.contract_value_max)})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Br,{className:"h-4 w-4 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Deadline"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:k.response_deadline?bt(new Date(k.response_deadline),"MMM dd, yyyy"):"TBD"})]})]}),k.place_of_performance&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ya,{className:"h-4 w-4 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Location"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:k.place_of_performance})]})]})]}),k.solicitation_number&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Solicitation #: ",k.solicitation_number]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[a.jsxs(U,{onClick:()=>R(k),variant:"outline",size:"sm",className:"gap-2",children:[a.jsx(gn,{className:"h-4 w-4"}),"Add to Pipeline"]}),a.jsxs(U,{onClick:()=>O(k),variant:"default",size:"sm",className:"gap-2",children:[a.jsx(Ft,{className:"h-4 w-4"}),"Get Price Bid"]})]})]})]},k.id)})})]})]})]})})},kg=[{code:"000",label:"All Categories"},{code:"001",label:"Web Design and Development"},{code:"002",label:"Mobile Application Development"},{code:"003",label:"Call Center and Answering"},{code:"004",label:"Data Entry, Scanning & Records"},{code:"005",label:"Medical Transcription"},{code:"006",label:"AI and Machine Learning"},{code:"007",label:"Document Printing & Mailing"},{code:"008",label:"Software, System & Application"},{code:"009",label:"Medical Billing and Coding"},{code:"010",label:"Translation & Interpretation"},{code:"011",label:"Court Reporting"},{code:"012",label:"CAD/CAM Drafting"},{code:"013",label:"Graphics and Animation"},{code:"014",label:"Auditing, Finance & Accounting"},{code:"015",label:"Social Media & SEO"},{code:"016",label:"Billing Services"},{code:"017",label:"Global, Remote, Offshore"},{code:"018",label:"Marketing and Branding"},{code:"019",label:"Writing Services"},{code:"020",label:"HR Services"},{code:"021",label:"Recycling Services"},{code:"022",label:"Asset Management"},{code:"023",label:"Destruction Services"},{code:"024",label:"GIS Services"},{code:"025",label:"CCTV & Security Services"},{code:"026",label:"Networking Services"},{code:"027",label:"Debt Collection Services"},{code:"028",label:"Computer Supplies & Equipment"},{code:"029",label:"Medical & Surgical Supplies"},{code:"030",label:"Medical Services"},{code:"031",label:"Legal Services"},{code:"032",label:"Electron Microscope"},{code:"033",label:"Professional & Consulting Services"},{code:"034",label:"Case Management Services"},{code:"035",label:"Records Storage Services"},{code:"036",label:"IT Services & Maintenance"},{code:"037",label:"Data Research & Analytics"},{code:"038",label:"Staffing Services"},{code:"039",label:"Food, Beverage & Catering"}
876,{code:"040",label:"Transportation Services"},{code:"041",label:"Rental Services"},{code:"042",label:"Cleaning & Janitorial"},{code:"043",label:"Office Supplies & Equipment"},{code:"044",label:"Real Estate & Property"},{code:"045",label:"Waste Disposal Services"},{code:"046",label:"Health & Related Services"},{code:"047",label:"Painting Services"},{code:"048",label:"Banking Services"},{code:"049",label:"Plumbing Services"},{code:"050",label:"Pharmaceutical & Pharmacy"},{code:"051",label:"Weapons & Ammunition"},{code:"052",label:"Aircraft Services & Supplies"},{code:"053",label:"Railway Services & Supplies"},{code:"054",label:"Space Vehicle Services"},{code:"055",label:"Ship & Marine Services"},{code:"056",label:"Ground Vehicles Services"},{code:"057",label:"Other Vehicles Services"},{code:"058",label:"Special Industry Machinery"},{code:"059",label:"Fire Control & Safety"},{code:"060",label:"Farming & Agricultural"},{code:"061",label:"Electrical & Electronic"},{code:"062",label:"Furniture Services"},{code:"063",label:"Service & Trade Equipment"},{code:"064",label:"Water & Sewage Services"},{code:"065",label:"Telecommunication Services"},{code:"066",label:"HVAC & Refrigeration"},{code:"067",label:"Music, Movies & Photography"},{code:"068",label:"Ores, Mines & Minerals"},{code:"069",label:"Natural Resources & Conservation"},{code:"070",label:"Fabricated Materials & Metals"},{code:"071",label:"Social Services"},{code:"072",label:"Quality Control & Testing"},{code:"073",label:"Clothing & Textiles"},{code:"074",label:"Fuels & Lubricants"},{code:"075",label:"Utilities & Housekeeping"},{code:"076",label:"Education & Training Supplies"},{code:"077",label:"Sports & Recreation"},{code:"078",label:"Toiletries & Personal Care"},{code:"079",label:"Construction & Architecture"},{code:"080",label:"Background Check & Screening"},{code:"081",label:"Travel Agency Services"},{code:"082",label:"Uncategorized"},{code:"083",label:"Insurance Services"},{code:"084",label:"US Federal"}],LI=["All Locations","USA","Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming","District of Columbia","Puerto Rico","Guam"],L4e=[{value:"all",label:"All Status"},{value:"active",label:"Active"},{value:"expired",label:"Expired"}],F4e=[{value:"all",label:"All Sources"},{value:"sam.gov",label:"SAM.gov"},{value:"census_trade",label:"Census Trade"},{value:"usaspending",label:"USA Spending"},{value:"usaspending_micropurchase",label:"P-Card / Micro-Purchase"},{value:"ny_state",label:"New York State"},{value:"tx_state",label:"Texas State"},{value:"ca_state",label:"California State"},{value:"fl_state",label:"Florida State"},{value:"eu_ted",label:"EU (TED)"},{value:"world_bank",label:"World Bank"},{value:"un_ungm",label:"UN (UNGM)"},{value:"adb",label:"Asian Dev Bank"},{value:"bidnet_direct",label:"BidNet Direct"},{value:"planetbids",label:"PlanetBids"},{value:"demandstar",label:"DemandStar"},{value:"publicpurchase",label:"PublicPurchase"},{value:"bonfire",label:"Bonfire/IonWave"},{value:"opengov",label:"OpenGov"}],B4e=[{value:"all",label:"All Values"},{value:"pcard",label:"ð¢ P-Card (Under $10K)"},{value:"micropurchase",label:"â¡ Micro-Purchase (Under $25K)"},{value:"simplified",label:"Simplified ($25K-$250K)"},{value:"full",label:"Full & Open ($250K+)"}],z4e=20;function U4e(){var oe;const e=vt(),{toast:t}=dt(),{user:r}=it(),[n,s]=g.useState(""),[i,o]=g.useState("all"),[l,c]=g.useState("all"),[d,u]=g.useState("all"),[f,h]=g.useState("All Locations"),[m,v]=g.useState("000"),[p,x]=g.useState(""),[b,y]=g.useState(""),[w,_]=g.useState("all"),[N,j]=g.useState("all"),[S,C]=g.useState("all"),[P,A]=g.useState(z4e),[D,F]=g.useState([]),[q,B]=g.useState(!0),[V,E]=g.useState(!1),[M,T]=g.useState(0),[L,K]=g.useState(0),[H,ee]=g.useState(null),[se,ne]=g.useState(!1),W=g.useCallback(async(z=!0)=>{try{B(!0),z&&K(0);const fe=z?0:L;let ue=Z.from("solicitations").select("*",{count:"exact"}).order("posted_date",{ascending:!1}).range(fe*P,(fe+1)*P-1);if(i!=="all"&&(ue=ue.eq("status",i)),l!=="all"&&(ue=ue.eq("source_platform",l)),d!=="all"&&(ue=ue.ilike("agency",`%${d.split("(")[0].trim()}%`)),n.trim()&&(ue=ue.or(`title.ilike.%${n.trim()}%,description.ilike.%${n.trim()}%,solicitation_number.ilike.%${n.trim()}%`)),p&&(ue=ue.gte("posted_date",p)),b&&(ue=ue.lte("posted_date",b)),w!=="all"&&(ue=ue.eq("set_aside_type",w)),f!=="All Locations"&&f!=="USA"&&(ue=ue.ilike("place_of_performance",`%${f}%`)),m!=="000"){const Ze=kg.find(Y=>Y.code===m);if(Ze){const _e=Ze.label.split(/[&,]/).map(Oe=>
876Oe.trim()).filter(Boolean).flatMap(Oe=>[`title.ilike.%${Oe}%`,`description.ilike.%${Oe}%`,`industry.ilike.%${Oe}%`]);ue=ue.or(_e.join(","))}}N!=="all"&&(ue=ue.contains("naics_codes",[N])),S==="pcard"?ue=ue.or("contract_value_max.lte.10000,contract_value_min.lte.10000"):S==="micropurchase"?ue=ue.or("contract_value_max.lte.25000,contract_value_min.lte.25000"):S==="simplified"?ue=ue.gte("contract_value_min",25e3).lte("contract_value_max",25e4):S==="full"&&(ue=ue.gte("contract_value_min",25e4));const{data:Ne,error:He,count:ke}=await ue;if(He)throw He;F(Ne||[]),T(ke||0)}catch(fe){console.error("Error loading solicitations:",fe),t({title:"Error loading opportunities",description:"Please try again",variant:"destructive"})}finally{B(!1)}},[n,i,l,d,f,m,p,b,w,N,S,P,L]);g.useEffect(()=>{W(!0)},[]),g.useEffect(()=>{L>0&&W(!1)},[L]);const ie=()=>{W(!0)},R=()=>{s(""),o("all"),c("all"),u("all"),h("All Locations"),v("000"),x(""),y(""),_("all"),j("all"),C("all"),setTimeout(()=>W(!0),0)},O=async()=>{try{E(!0),t({title:"Syncing...",description:"Fetching latest from SAM.gov, Grants.gov & more"});const{data:z,error:fe}=await Z.functions.invoke("aggregate-all-opportunities");if(fe)throw fe;t({title:"Sync Complete",description:`Fetched ${(z==null?void 0:z.total_opportunities)||0} opportunities from ${(z==null?void 0:z.sources_succeeded)||0} sources`}),await W(!0)}catch(z){console.error("Sync error:",z),t({title:"Sync Failed",variant:"destructive"})}finally{E(!1)}},k=async z=>{var fe;if(!r){t({title:"Sign in required",variant:"destructive"}),e("/login");return}try{const{data:ue}=await Z.from("profiles").select("user_id").eq("user_id",r.id).single(),{error:Ne}=await Z.from("contracts").insert({user_id:r.id,organization_id:(ue==null?void 0:ue.user_id)||r.id,title:z.title,content:z.description,industry:z.industry,naics_code:((fe=z.naics_codes)==null?void 0:fe[0])||null,contract_link:z.url,status:"pending",contract_value:z.contract_value_max||z.contract_value_min||null});if(Ne)throw Ne;t({title:"Added to Pipeline",description:"Contract added to your pipeline"})}catch{t({title:"Error",description:"Failed to add",variant:"destructive"})}},G=async z=>{if(!r){e("/login");return}ne(!0);try{const{data:fe,error:ue}=await Z.functions.invoke("prepare-bid-package",{body:{solicitationId:z.id}});if(ue)throw ue;t({title:"Bid Package Prepared!",description:"Opening draft..."}),setTimeout(()=>e("/admin/my-contracts"),1e3)}catch(fe){t({title:"Failed",description:fe.message,variant:"destructive"})}finally{ne(!1)}},te=(z,fe)=>{if(!z&&!fe)return"Not specified";const ue=Ne=>Ne>=1e6?`$${(Ne/1e6).toFixed(1)}M`:`$${(Ne/1e3).toFixed(0)}K`;return z&&fe?`${ue(z)} - ${ue(fe)}`:z?`From ${ue(z)}`:`Up to ${ue(fe)}`},$=z=>z?new Date(z)<new Date:!1,ae=Math.ceil(M/P);return a.jsxs(a.Fragment,{children:[a.jsx($r,{title:"Government RFPs & Contract Opportunities | PriceBid",description:"Browse thousands of active government RFPs, solicitations, and contract opportunities from SAM.gov, Grants.gov, and state portals.",keywords:"government contracts, RFP, solicitations, bid opportunities, SAM.gov, government procurement"}),a.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[a.jsx("div",{className:"bg-background border-b border-border/30 px-4 py-3",children:a.jsx("div",{className:"container mx-auto max-w-7xl",children:a.jsxs(je,{to:"/",className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(Tr,{className:"h-4 w-4"}),"Back to Home"]})})}),a.jsx("div",{className:"bg-gradient-to-r from-[hsl(var(--purple-primary))] to-[hsl(var(--primary))] py-4 px-4",children:a.jsxs("div",{className:"container mx-auto max-w-7xl",children:[a.jsxs("div",{className:"text-center mb-3",children:[a.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-white mb-1",children:"Government RFPs & Contract Opportunities"}),a.jsxs("p",{className:"text-white/80 text-xs md:text-sm",children:[M.toLocaleString()," opportunities from 19 sources including SAM.gov, BidNet, PlanetBids, DemandStar & more"]})]}),a.jsxs("div",{className:"bg-white/10 backdrop-blur-md rounded-lg p-3 space-y-2",children:[a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-6 gap-2",children:[a.jsx(ge,{placeholder:"Keyword or RFP ID",value:n,onChange:z=>s(z.target.value),onKeyDown:z=>z.key==="Enter"&&ie(),className:"bg-white text-foreground border-0 h-8 text-sm col-span-2 md:col-span-1"}),a.jsxs(Re,{value:i,onValueChange:o,children:[a.jsx(Me,{className:"bg-white text-foreground border-0 h-8 text-sm",children:a.jsx(De,{placeholder:"Status"})}),a.jsx(Ie,{children:L4e.map(z=>a.jsx(ce,{value:z.value,children:z.label},z.value))})]}),a.jsxs(Re,{value:f,onValueChange:h,children:[a.jsx(Me,{className:"bg-white text-foreground border-0 h-8 text-sm",children:a.jsx(De,{placeholder:"Location"})}),a.jsx(Ie,{className:"max-h-[300px]",children:LI.map(z=>a.jsx(ce,{value:z,children:z},z))})]}),a.jsxs(Re,{value:d,onValueChange:u,children:[a.jsx(Me,{className:"bg-white text-foreground border-0 h-8 text-sm",children:a.jsx(De,{placeholder:"Agency"})}),a.jsx(Ie,{className:"max-h-[300px]",children:NW.map(z=>a.jsx(ce,{value:z,children:z==="all"?"All Agencies":z},z))})]}),a.jsxs(Re,{value:m,onValueChange:z=>v(z),children:[a.jsx(Me,{className:"bg-white text-foreground border-0 h-8 text-sm",children:a.jsx(De,{placeholder:"Category"})}),a.jsx(Ie,{className:"max-h-[300px]",children:kg.map(z=>a.jsxs(ce,{value:z.code,children:[z.code," - ",z.label]},z.code))})]}),a.jsxs(Re,{value:l,onValueChange:c,children:[a.jsx(Me,{className:"bg-white text-foreground border-0 h-8 text-sm",children:a.jsx(De,{placeholder:"Source"})}),a.jsx(Ie,{className:"max-h-[300px]",children:F4e.map(z=>a.jsx(ce,{value:z.value,children:z.label},z.value))})]})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-6 gap-2",children:[a.jsx(ge,{type:"date",placeholder:"From",value:p,onChange:z=>x(z.target.value),className:"bg-white text-foreground border-0 h-8 text-sm"}),a.jsx(ge,{type:"date",placeholder:"To",value:b,onChange:z=>y(z.target.value),className:"bg-white text-foreground border-0 h-8 text-sm"}),a.jsxs(Re,{value:w,onValueChange:_,children:[a.jsx(Me,{className:"bg-white text-foreground border-0 h-8 text-sm",children:a.jsx(De,{placeholder:"Set-Aside"})}),a.jsx(Ie,{children:_W.map(z=>a.jsx(ce,{value:z,children:z==="all"?"All Set-Aside Types":z},z))})]}),a.jsxs(Re,{value:S,onValueChange:C,children:[a.jsx(Me,{className:"bg-white text-foreground border-0 h-8 text-sm",children:a.jsx(De,{placeholder:"Value"})}),a.jsx(Ie,{children:B4e.map(z=>a.jsx(ce,{value:z.value,children:z.label},z.value))})]}),a.jsxs(Re,{value:N,onValueChange:j,children:[a.jsx(Me,{className:"bg-white text-foreground border-0 h-8 text-sm",children:a.jsx(De,{placeholder:"NAICS"})}),a.jsxs(Ie,{className:"max-h-[300px]",children:[a.jsx(ce,{value:"all",children:"All NAICS Codes"}),SW.map((z,fe)=>a.jsxs(ce,{value:z.code,children:[z.code," - ",z.title]},`${z.code}-${fe}`))]})]}),a.jsxs("div",{className:"flex gap-1.5",children:[a.jsxs(U,{size:"sm",onClick:ie,className:"bg-white text-[hsl(var(--purple-primary))] hover:bg-white/90 font-semibold h-8 px-3 text-sm flex-1",children:[a.jsx(Es,{className:"h-3.5 w-3.5 mr-1"}),"Search"]}),a.jsx(U,{variant:"outline",size:"sm",onClick:R,className:"bg-white/20 text-white border-white/30 hover:bg-white/30 h-8 px-2 text-sm",children:a.jsx(es,{className:"h-3.5 w-3.5"})}),a.jsx(U,{variant:"outline",size:"sm",onClick:O,disabled:V,className:"bg-white/20 text-white border-white/30 hover:bg-white/30 h-8 px-2 text-sm",children:V?a.jsx(Je,{className:"h-3.5 w-3.5 animate-spin"}):a.jsx(Ur,{className:"h-3.5 w-3.5"})})]})]})]})]})}),a.jsx("div",{className:"container mx-auto max-w-7xl py-6 px-4",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[200px_1fr_220px] gap-6",children:[a.jsx("div",{className:"space-y-4",children:a.jsxs(J,{children:[a.jsx("div",{className:"p-3 bg-primary text-primary-foreground rounded-t-lg",children:a.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-1.5",children:[a.jsx(Ya,{className:"h-3.5 w-3.5"}),"Location"]})}),a.jsx(re,{className:"p-0",children:a.jsx("div",{className:"max-h-[500px] overflow-y-auto",children:LI.map(z=>a.jsxs("button",{onClick:()=>{h(z),W(!0)},className:`w-full text-left px-3 py-1.5 text-xs hover:bg-accent/50 transition-colors border-b border-border/50 flex items-center justify-between ${f===z?"bg-accent/30 font-medium text-primary":"text-foreground"}`,children:[a.jsx("span",{children:z}),f===z&&a.jsx(Zd,{className:"h-3 w-3"})]},z))})})]})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(ve,{variant:"secondary",className:"text-xs",children:[M.toLocaleStr
876ing()," Results"]}),f!=="All Locations"&&a.jsxs(ve,{variant:"outline",className:"text-xs gap-1",children:[a.jsx(Ya,{className:"h-3 w-3"})," ",f,a.jsx("button",{onClick:()=>{h("All Locations"),W(!0)},children:a.jsx(es,{className:"h-3 w-3"})})]}),m!=="000"&&a.jsxs(ve,{variant:"outline",className:"text-xs gap-1",children:[a.jsx(qu,{className:"h-3 w-3"})," ",(oe=kg.find(z=>z.code===m))==null?void 0:oe.label,a.jsx("button",{onClick:()=>{v("000"),W(!0)},children:a.jsx(es,{className:"h-3 w-3"})})]})]}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:["Page ",L+1," of ",ae||1]})]}),q?a.jsx("div",{className:"flex justify-center py-16",children:a.jsx(Je,{className:"h-8 w-8 animate-spin text-primary"})}):D.length===0?a.jsx(J,{children:a.jsxs(re,{className:"py-16 text-center",children:[a.jsx(gt,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),a.jsx("p",{className:"text-lg font-medium",children:"No opportunities found"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Try adjusting your filters or refresh data"}),a.jsxs(U,{onClick:O,className:"mt-4",size:"sm",children:[a.jsx(Ur,{className:"h-4 w-4 mr-2"})," Fetch Latest Opportunities"]})]})}):a.jsx("div",{className:"space-y-0 border border-border rounded-lg overflow-hidden",children:D.map((z,fe)=>{const ue=$(z.response_deadline);return a.jsxs("div",{className:`p-4 hover:bg-accent/30 transition-colors cursor-pointer ${fe<D.length-1?"border-b border-border":""} ${ue?"opacity-70":""}`,onClick:()=>ee(z),children:[a.jsxs("h3",{className:"text-sm font-semibold text-primary hover:underline leading-tight mb-2",children:[z.solicitation_number&&a.jsx("span",{className:"text-muted-foreground font-mono text-xs mr-2",children:z.solicitation_number}),z.title,z.response_deadline&&a.jsxs("span",{className:"text-muted-foreground font-normal text-xs ml-2",children:["- Deadline ",bt(new Date(z.response_deadline),"MMMM d, yyyy")]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[z.posted_date&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Br,{className:"h-3 w-3 text-success"}),"Posted: ",bt(new Date(z.posted_date),"EEEE, d MMMM, yyyy")]}),z.response_deadline&&a.jsxs("span",{className:`flex items-center gap-1 ${ue?"text-destructive":""}`,children:[a.jsx(np,{className:"h-3 w-3 text-destructive"}),ue?"Expired":"Expires",": ",bt(new Date(z.response_deadline),"EEEE, d MMMM, yyyy")]})]}),a.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-2",children:[(z.contract_value_max&&z.contract_value_max<=1e4||z.contract_value_min&&z.contract_value_min<=1e4&&!z.contract_value_max)&&a.jsx(ve,{className:"text-[10px] h-5 bg-emerald-500/20 text-emerald-700 dark:text-emerald-400 border-emerald-500/30 font-semibold animate-pulse",children:"ð¢ P-Card Eligible"}),(z.contract_value_max&&z.contract_value_max>1e4&&z.contract_value_max<=25e3||z.contract_value_min&&z.contract_value_min>1e4&&z.contract_value_min<=25e3&&!z.contract_value_max)&&a.jsx(ve,{className:"text-[10px] h-5 bg-amber-500/20 text-amber-700 dark:text-amber-400 border-amber-500/30 font-semibold",children:"â¡ Micro-Purchase"}),z.opportunity_type==="purchase_card"&&a.jsx(ve,{className:"text-[10px] h-5 bg-emerald-500/20 text-emerald-700 dark:text-emerald-400 border-emerald-500/30 font-semibold",children:"ð³ Purchase Card"}),a.jsx(ve,{variant:"outline",className:"text-[10px] h-5",children:{"sam.gov":"SAM.gov",census_trade:"Census",usaspending:"USASpending",bidnet_direct:"BidNet",planetbids:"PlanetBids",demandstar:"DemandStar",publicpurchase:"PublicPurchase",bonfire:"Bonfire",opengov:"OpenGov",ny_state:"NY",tx_state:"TX",ca_state:"CA",fl_state:"FL",eu_ted:"EU TED",world_bank:"World Bank",un_ungm:"UN",adb:"ADB"}[z.source_platform]||z.source_platform}),z.agency&&a.jsxs(ve,{variant:"secondary",className:"text-[10px] h-5",children:[a.jsx(mr,{className:"h-2.5 w-2.5 mr-1"}),z.agency.length>40?z.agency.substring(0,40)+"...":z.agency]}),z.industry&&a.jsx(ve,{variant:"outline",className:"text-[10px] h-5",children:z.industry}),(z.contract_value_min||z.contract_value_max)&&a.jsxs(ve,{variant:"outline",className:"text-[10px] h-5 text-success border-success/30",children:[a.jsx(Jt,{className:"h-2.5 w-2.5 mr-0.5"}),te(z.contract_value_min,z.contract_value_max)]}),z.place_of_performance&&a.jsxs(ve,{variant:"outline",className:"text-[10px] h-5",children:[a.jsx(Ya,{className:"h-2.5 w-2.5 mr-0.5"}),z.place_of_performance.length>30?z.place_of_performance.substring(0,30)+"...":z.place_of_performance]}),z.set_aside_type&&a.jsx(ve,{className:"text-[10px] h-5 bg-warning/20 text-warning border-warning/30",children:z.set_aside_type}),ue&&a.jsx(ve,{variant:"destructive",className:"text-[10px] h-5",children:"Expired"})]})]},z.id)})}),ae>1&&a.jsxs("div",{className:"flex items-center justify-between py-4",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx("span",{children:"Show"}),a.jsxs(Re,{value:String(P),onValueChange:z=>{A(Number(z)),K(0)},children:[a.jsx(Me,{className:"w-[70px] h-8",children:a.jsx(De,{})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"10",children:"10"}),a.jsx(ce,{value:"20",children:"20"}),a.jsx(ce,{value:"30",children:"30"}),a.jsx(ce,{value:"50",children:"50"})]})]}),a.jsx("span",{children:"per page"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(U,{variant:"outline",size:"sm",disabled:L===0,onClick:()=>K(z=>Math.max(0,z-1)),children:"Previous"}),Array.from({length:Math.min(5,ae)},(z,fe)=>{const ue=L<3?fe:L-2+fe;return ue>=ae?null:a.jsx(U,{variant:ue===L?"default":"outline",size:"sm",className:"w-8 h-8 p-0",onClick:()=>K(ue),children:ue+1},ue)}),a.jsx(U,{variant:"outline",size:"sm",disabled:L>=ae-1,onClick:()=>K(z=>z+1),children:"Next"})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs(J,{children:[a.jsx("div",{className:"p-3 bg-primary text-primary-foreground rounded-t-lg",children:a.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-1.5",children:[a.jsx(KR,{className:"h-3.5 w-3.5"}),"Category"]})}),a.jsx(re,{className:"p-0",children:a.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:kg.map(z=>a.jsxs("button",{onClick:()=>{v(z.code),W(!0)},className:`w-full text-left px-3 py-1.5 text-xs hover:bg-accent/50 transition-colors border-b border-border/50 flex items-center justify-between ${m===z.code?"bg-accent/30 font-medium text-primary":"text-foreground"}`,children:[a.jsx("span",{children:z.label}),m===z.code&&a.jsx(Zd,{className:"h-3 w-3"})]},z.code))})})]}),a.jsxs(J,{children:[a.jsx("div",{className:"p-3 bg-primary text-primary-foreground rounded-t-lg",children:a.jsx("h3",{className:"text-sm font-semibold",children:"Qu
876ick Stats"})}),a.jsx(re,{className:"p-3 space-y-2 text-xs",children:a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"Total RFPs"}),a.jsx("span",{className:"font-semibold",children:M.toLocaleString()})]})})]}),a.jsx(J,{className:"bg-gradient-to-br from-[hsl(var(--purple-primary)/0.1)] to-[hsl(var(--primary)/0.1)] border-primary/20",children:a.jsxs(re,{className:"p-4 text-center space-y-2",children:[a.jsx(Ft,{className:"h-8 w-8 mx-auto text-primary"}),a.jsx("p",{className:"text-sm font-semibold",children:"Get AI Price Bids"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Click any RFP to generate a competitive bid instantly"}),a.jsx(U,{size:"sm",className:"w-full text-xs",onClick:()=>e("/pricebid"),children:"Learn More"})]})})]})]})}),a.jsx(rn,{open:!!H,onOpenChange:()=>ee(null),children:a.jsxs(Wr,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[a.jsx(Hr,{children:a.jsx(Vr,{className:"text-lg leading-tight",children:H==null?void 0:H.title})}),H&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Solicitation #"}),a.jsx("p",{className:"font-mono text-xs",children:H.solicitation_number||"N/A"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Status"}),a.jsx("div",{children:a.jsx(ve,{variant:$(H.response_deadline)?"destructive":"default",className:"text-xs",children:$(H.response_deadline)?"Expired":H.status||"Active"})})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Agency"}),a.jsx("p",{className:"text-xs",children:H.agency||"Not specified"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Department"}),a.jsx("p",{className:"text-xs",children:H.department||"Not specified"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Posted Date"}),a.jsx("p",{className:"text-xs",children:H.posted_date?bt(new Date(H.posted_date),"MMMM d, yyyy"):"N/A"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Response Deadline"}),a.jsx("p",{className:"text-xs font-semibold",children:H.response_deadline?bt(new Date(H.response_deadline),"MMMM d, yyyy h:mm a"):"N/A"})]})]}),a.jsx(St,{}),a.jsxs("div",{children:[a.jsxs("span",{className:"text-xs font-semibold flex items-center gap-1 mb-1",children:[a.jsx(Jt,{className:"h-3.5 w-3.5"})," Estimated Value"]}),a.jsx("p",{className:"text-xl font-bold text-primary",children:te(H.contract_value_min,H.contract_value_max)})]}),H.place_of_performance&&a.jsxs("div",{children:[a.jsxs("span",{className:"text-xs font-semibold flex items-center gap-1 mb-1",children:[a.jsx(Ya,{className:"h-3.5 w-3.5"})," Place of Performance"]}),a.jsx("p",{className:"text-sm",children:H.place_of_performance})]}),a.jsx(St,{}),a.jsxs("div",{children:[a.jsx("span",{className:"text-xs font-semibold mb-1 block",children:"Description"}),a.jsx("p",{className:"text-xs text-muted-foreground whitespace-pre-wrap leading-relaxed",children:H.description||"No description available"})]}),H.poc_name&&a.jsxs(a.Fragment,{children:[a.jsx(St,{}),a.jsxs("div",{children:[a.jsx("span",{className:"text-xs font-semibold mb-1 block",children:"Point of Contact"}),a.jsxs("div",{className:"text-xs space-y-0.5",children:[a.jsxs("p",{children:[H.poc_name," ",H.poc_title&&`(${H.poc_title})`]}),H.poc_email&&a.jsx("p",{className:"text-primary",children:H.poc_email}),H.poc_phone&&a.jsx("p",{children:H.poc_phone})]})]})]}),H.naics_codes&&H.naics_codes.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(St,{}),a.jsxs("div",{children:[a.jsx("span",{className:"text-xs font-semibold mb-1 block",children:"NAICS Codes"}),a.jsx("div",{className:"flex flex-wrap gap-1",children:H.naics_codes.map(z=>a.jsx(ve,{variant:"outline",className:"text-xs",children:z},z))})]})]}),H.set_aside_type&&a.jsxs("div",{children:[a.jsx("span",{className:"text-xs font-semibold mb-1 block",children:"Set-Aside"}),a.jsx(ve,{className:"text-xs",children:H.set_aside_type})]}),a.jsx(St,{}),a.jsxs("div",{className:"flex gap-2 pt-2",children:[a.jsx(U,{className:"flex-1 text-xs h-9",onClick:()=>G(H),disabled:se,children:se?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"})," Preparing..."]}):a.jsxs(a.Fragment,{children:[a.jsx(va,{className:"h-3.5 w-3.5 mr-1.5"})," Prepare Bid Package"]})}),a.jsxs(U,{variant:"outline",className:"text-xs h-9",onClick:()=>k(H),children:[a.jsx(gn,{className:"h-3.5 w-3.5 mr-1.5"})," Add to Pipeline"]}),H.url&&a.jsx(U,{variant:"outline",className:"text-xs h-9",asChild:!0,children:a.jsxs("a",{href:H.url,target:"_blank",rel:"noopener noreferrer",children:[a.jsx(ft,{className:"h-3.5 w-3.5 mr-1.5"})," View Source"]})})]})]})]})}),a.jsx(Ci,{})]})]})}function W4e(){const e=vt(),{user:t}=it(),{toast:r}=dt(),[n,s]=g.useState(null),{data:i=[],isLoading:o,refetch:l}=ic({queryKey:["sequences",t==null?void 0:t.id],queryFn:async()=>{const{data:f,error:h}=await Z.from("campaign_sequences").select("*").order("created_at",{ascending:!1});if(h)throw h;return f},enabled:!!t}),c=async f=>{s(f);try{const{error:h}=await Z.from("campaign_sequences").delete().eq("id",f);if(h)throw h;r({title:"Sequence deleted",description:"The campaign sequence has been deleted successfully."}),l()}catch{r({title:"Error",description:"Failed to delete sequence. Please try again.",variant:"destructive"})}finally{s(null)}},d=async(f,h)=>{const m=h==="active"?"paused":"active";try{const{error:v}=await Z.from("campaign_sequences").update({status:m}).eq("id",f);if(v)throw v;r({title:`Sequence ${m==="active"?"activated":"paused"}`,description:`The campaign sequence is now ${m}.`}),l()}catch{r({title:"Error",description:"Failed to update sequence status.",variant:"destructive"})}},u=f=>{const h={active:"bg-success/10 text-success border-success/20",paused:"bg-warning/10 text-warning border-warning/20",draft:"bg-muted text-muted-foreground border-border"};return h[f]||h.draft};return o?a.jsx("div",{className:"min-h-screen bg-background p-6",children:a.jsx("div",{className:"max-w-7xl mx-auto",children:a.jsxs("div",{className:"animate-pulse space-y-4",children:[a.jsx("div",{className:"h-8 bg-muted rounded w-48"}),a.jsx("div",{className:"h-32 bg-muted rounded"}),a.jsx("div",{className:"h-32 bg-muted rounded"})]})})}):a.jsx("div",{className:"min-h-screen bg-background p-6",children:a.jsxs("div",{className:"max-w-7xl mx-auto
876space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Campaign Sequences"}),a.jsx("p",{className:"text-muted-foreground mt-1",children:"Create automated drip campaigns with A/B testing and engagement tracking"})]}),a.jsxs(U,{onClick:()=>e("/sequences/new"),size:"lg",children:[a.jsx(gn,{className:"w-4 h-4 mr-2"}),"New Sequence"]})]}),i.length===0?a.jsx(J,{className:"p-12 text-center",children:a.jsxs("div",{className:"max-w-md mx-auto space-y-4",children:[a.jsx("div",{className:"w-16 h-16 bg-primary/10 rounded-full flex items-center justify-center mx-auto",children:a.jsx($s,{className:"w-8 h-8 text-primary"})}),a.jsx("h3",{className:"text-xl font-semibold",children:"No sequences yet"}),a.jsx("p",{className:"text-muted-foreground",children:"Create your first automated campaign sequence to start nurturing leads"}),a.jsxs(U,{onClick:()=>e("/sequences/new"),children:[a.jsx(gn,{className:"w-4 h-4 mr-2"}),"Create Your First Sequence"]})]})}):a.jsx("div",{className:"grid gap-4",children:i.map(f=>{const h=f.total_sent>0?Math.round(f.total_opened/f.total_sent*100):0,m=f.total_sent>0?Math.round(f.total_clicked/f.total_sent*100):0;return a.jsx(J,{className:"p-6 hover:shadow-lg transition-shadow",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h3",{className:"text-xl font-semibold text-foreground",children:f.name}),a.jsx(ve,{className:u(f.status),children:f.status})]}),f.description&&a.jsx("p",{className:"text-muted-foreground",children:f.description}),a.jsxs("div",{className:"flex items-center gap-6 text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Mr,{className:"w-4 h-4 text-muted-foreground"}),a.jsx("span",{className:"text-foreground font-medium",children:f.active_leads_count}),a.jsx("span",{className:"text-muted-foreground",children:"active"})]}),a.jsxs("div",{className:"text-muted-foreground",children:[f.completed_leads_count," completed"]}),a.jsxs("div",{className:"text-muted-foreground",children:[f.total_sent," sent"]}),f.total_sent>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"text-success",children:[h,"% open rate"]}),a.jsxs("div",{className:"text-primary",children:[m,"% click rate"]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(U,{variant:"outline",size:"sm",onClick:()=>e(`/sequences/${f.id}/analytics`),children:a.jsx($s,{className:"w-4 h-4"})}),a.jsx(U,{variant:"outline",size:"sm",onClick:()=>d(f.id,f.status),disabled:f.status==="draft",children:f.status==="active"?a.jsx(Hq,{className:"w-4 h-4"}):a.jsx(Gh,{className:"w-4 h-4"})}),a.jsx(U,{variant:"outline",size:"sm",onClick:()=>e(`/sequences/${f.id}/edit`),children:"Edit"}),a.jsx(U,{variant:"outline",size:"sm",onClick:()=>c(f.id),disabled:n===f.id,children:a.jsx(tu,{className:"w-4 h-4 text-destructive"})})]})]})},f.id)})})]})})}function H4e({step:e,stepIndex:t,totalSteps:r,onUpdate:n,onDelete:s}){const[i,o]=g.useState(t===0),l=()=>{const u=[...e.subject_variants,""];n({...e,subject_variants:u,enable_ab_test:!0})},c=u=>{const f=e.subject_variants.filter((h,m)=>m!==u);n({...e,subject_variants:f,enable_ab_test:f.length>1})},d=(u,f)=>{const h=[...e.subject_variants];h[u]=f,n({...e,subject_variants:h})};return a.jsxs(J,{className:"overflow-hidden",children:[a.jsxs("div",{className:"p-4 bg-muted/30 flex items-center justify-between cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>o(!i),children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(ve,{variant:"outline",className:"font-mono",children:["Step ",e.step_number]}),a.jsx("h3",{className:"font-semibold text-foreground",children:e.name||`Step ${e.step_number}`}),t>0&&a.jsxs("span",{className:"text-sm text-muted-foreground",children:["Wait ",e.delay_days,"d ",e.delay_hours,"h"]}),e.enable_ab_test&&a.jsx(ve,{variant:"secondary",children:"A/B Test"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[r>1&&a.jsx(U,{variant:"ghost",size:"sm",onClick:u=>{u.stopPropagation(),s()},children:a.jsx(tu,{className:"w-4 h-4 text-destructive"})}),i?a.jsx(VR,{className:"w-5 h-5 text-muted-foreground"}):a.jsx(Go,{className:"w-5 h-5 text-muted-foreground"})]})]}),i&&a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"Step Name *"}),a.jsx(ge,{value:e.name,onChange:u=>n({...e,name:u.target.value}),placeholder:"e.g., Initial Contact"})]}),t>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"Delay Days"}),a.jsx(ge,{type:"number",min:"0",value:e.delay_days,onChange:u=>n({...e,delay_days:parseInt(u.target.value)||0})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"Delay Hours"}),a.jsx(ge,{type:"number",min:"0",max:"23",value:e.delay_hours,onChange:u=>n({...e,delay_hours:parseInt(u.target.value)||0})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"Send Time"}),a.jsx(ge,{type:"time",value:e.send_time,onChange:u=>n({...e,send_time:u.target.value})})]})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 bg-muted/30 rounded-lg",children:[a.jsxs("div",{children:[a.jsx(Q,{children:"Enable A/B Testing"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Test multiple subject lines to find the best performing one"})]}),a.jsx(On,{checked:e.enable_ab_test,onCheckedChange:u=>n({...e,enable_ab_test:u})})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Q,{children:["Subject Line",e.enable_ab_test?"s":""," *"]}),e.enable_ab_test&&a.jsxs(U,{variant:"outline",size:"sm",onClick:l,disabled:e.subject_variants.length>=3,children:[a.jsx(gn,{className:"w-4 h-4 mr-2"}),"Add Variant"]})]}),e.subject_variants.map((u,f)=>a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ge,{value:u,onChange:h=>d(f,h.target.value),placeholder:`Subject line${e.enable_ab_test?` variant ${f+1}`:""}`}),e.enable_ab_test&&e.subject_variants.length>1&&a.jsx(U,{variant:"ghost",size:"sm",onClick:()=>c(f),children:a.jsx(es,{className:"w-4 h-4"})})]},f))]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"Email Body *"}),a.jsx(Qn,{value:e.body,onChange:u=>n({...e,body:u.target.value}),placeholder:"Write your email content here...",rows:8,className:"font-mono text-sm"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use ","{","name","}",", ","{","company","}",", ","{","email","}"," to personalize"]})]})]})]})}function V4e({open:e,onClose:t}){const{id:r}=Uy(),{user:n}
876=it(),{toast:s}=dt(),[i,o]=g.useState([]),[l,c]=g.useState(""),[d,u]=g.useState(!1),{data:f=[]}=ic({queryKey:["leads-for-sequence",n==null?void 0:n.id],queryFn:async()=>{const{data:x,error:b}=await Z.from("leads").select("id, contact_name, email, company_name, status").in("status",["new","contacted","qualified"]).order("created_at",{ascending:!1});if(b)throw b;return x},enabled:!!n&&e}),h=f.filter(x=>x.contact_name.toLowerCase().includes(l.toLowerCase())||x.email.toLowerCase().includes(l.toLowerCase())||x.company_name.toLowerCase().includes(l.toLowerCase())),m=x=>{o(b=>b.includes(x)?b.filter(y=>y!==x):[...b,x])},v=()=>{i.length===h.length?o([]):o(h.map(x=>x.id))},p=async()=>{if(i.length===0){s({title:"No leads selected",description:"Please select at least one lead to enroll.",variant:"destructive"});return}u(!0);try{const{data:x}=await Z.from("campaign_sequences").select("*").eq("id",r).single();if(!x)throw new Error("Sequence not found");const b=i.map(w=>({sequence_id:r,lead_id:w,status:"active",current_step:1,next_send_at:new Date().toISOString()})),{error:y}=await Z.from("sequence_enrollments").insert(b);if(y)throw y;await Z.rpc("increment",{row_id:r,table_name:"campaign_sequences",column_name:"active_leads_count",x:i.length}),s({title:"Leads enrolled",description:`${i.length} lead(s) enrolled in the sequence.`}),t()}catch(x){s({title:"Error",description:x.message||"Failed to enroll leads.",variant:"destructive"})}finally{u(!1)}};return a.jsx(rn,{open:e,onOpenChange:t,children:a.jsxs(Wr,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[a.jsxs(Hr,{children:[a.jsx(Vr,{children:"Enroll Leads in Sequence"}),a.jsx(ba,{children:"Select the leads you want to add to this campaign sequence"})]}),a.jsxs("div",{className:"space-y-4 flex-1 overflow-hidden flex flex-col",children:[a.jsxs("div",{className:"relative",children:[a.jsx(Es,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),a.jsx(ge,{placeholder:"Search leads...",value:l,onChange:x=>c(x.target.value),className:"pl-10"})]}),a.jsxs("div",{className:"flex items-center gap-2 p-2 border-b",children:[a.jsx(is,{checked:i.length===h.length&&h.length>0,onCheckedChange:v}),a.jsxs("span",{className:"text-sm font-medium",children:["Select All (",i.length," / ",h.length,")"]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto space-y-2",children:[h.map(x=>a.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>m(x.id),children:[a.jsx(is,{checked:i.includes(x.id),onCheckedChange:()=>m(x.id)}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"font-medium text-foreground truncate",children:x.contact_name}),a.jsxs("div",{className:"text-sm text-muted-foreground truncate",children:[x.email," ⢠",x.company_name]})]})]},x.id)),h.length===0&&a.jsx("div",{className:"text-center py-8 text-muted-foreground",children:l?"No leads found":"No leads available"})]})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[a.jsx(U,{variant:"outline",onClick:t,children:"Cancel"}),a.jsxs(U,{onClick:p,disabled:d||i.length===0,children:["Enroll ",i.length," Lead",i.length!==1?"s":""]})]})]})})}function FI(){const{id:e}=Uy(),t=vt(),{user:r}=it(),{toast:n}=dt(),[s,i]=g.useState(""),[o,l]=g.useState(""),[c,d]=g.useState(!0),[u,f]=g.useState(!1),[h,m]=g.useState([{step_number:1,name:"Initial Contact",subject_variants:[""],body:"",delay_days:0,delay_hours:0,send_time:"09:00",enable_ab_test:!1,ab_test_percentage:50}]),[v,p]=g.useState(!1),[x,b]=g.useState(!1),y=()=>{const j={step_number:h.length+1,name:`Follow-up ${h.length}`,subject_variants:[""],body:"",delay_days:h.length===1?3:2,delay_hours:0,send_time:"09:00",enable_ab_test:!1,ab_test_percentage:50};m([...h,j])},w=(j,S)=>{const C=[...h];C[j]=S,m(C)},_=j=>{if(h.length===1){n({title:"Cannot delete",description:"Sequence must have at least one step.",variant:"destructive"});return}const S=h.filter((C,P)=>P!==j);S.forEach((C,P)=>{C.step_number=P+1}),m(S)},N=async j=>{if(!s.trim()){n({title:"Missing information",description:"Please enter a sequence name.",variant:"destructive"});return}if(h.some(S=>!S.name.trim()||S.subject_variants.some(C=>!C.trim())||!S.body.trim())){n({title:"Incomplete steps",description:"All steps must have a name, subject, and body.",variant:"destructive"});return}p(!0);
876try{const S={name:s,description:o,status:j,user_id:r==null?void 0:r.id,organization_id:r==null?void 0:r.id,stop_on_reply:c,stop_on_click:u},{data:C,error:P}=e?await Z.from("campaign_sequences").update(S).eq("id",e).select().single():await Z.from("campaign_sequences").insert(S).select().single();if(P)throw P;e&&await Z.from("campaign_sequence_steps").delete().eq("sequence_id",C.id);const A=h.map(F=>({sequence_id:C.id,...F,subject_variants:JSON.stringify(F.subject_variants)})),{error:D}=await Z.from("campaign_sequence_steps").insert(A);if(D)throw D;n({title:j==="draft"?"Sequence saved":"Sequence activated",description:j==="draft"?"Your sequence has been saved as a draft.":"Your sequence is now active and ready to enroll leads."}),j==="active"?b(!0):t("/sequences")}catch(S){n({title:"Error",description:S.message||"Failed to save sequence.",variant:"destructive"})}finally{p(!1)}};return a.jsxs("div",{className:"min-h-screen bg-background p-6",children:[a.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>t("/sequences"),children:[a.jsx(Tr,{className:"w-4 h-4 mr-2"}),"Back"]}),a.jsx("h1",{className:"text-3xl font-bold text-foreground",children:e?"Edit Sequence":"Create Sequence"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(U,{variant:"outline",onClick:()=>N("draft"),disabled:v,children:[a.jsx(YR,{className:"w-4 h-4 mr-2"}),"Save Draft"]}),a.jsxs(U,{onClick:()=>N("active"),disabled:v,children:[a.jsx(va,{className:"w-4 h-4 mr-2"}),"Activate & Enroll Leads"]})]})]}),a.jsxs(J,{className:"p-6 space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"name",children:"Sequence Name *"}),a.jsx(ge,{id:"name",placeholder:"e.g., New Lead Nurture Campaign",value:s,onChange:j=>i(j.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{htmlFor:"description",children:"Description"}),a.jsx(Qn,{id:"description",placeholder:"Describe what this sequence is for...",value:o,onChange:j=>l(j.target.value),rows:2})]}),a.jsxs("div",{className:"space-y-3 pt-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"stop-reply",children:"Stop on Reply"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Stop sending when lead replies"})]}),a.jsx(On,{id:"stop-reply",checked:c,onCheckedChange:d})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Q,{htmlFor:"stop-click",children:"Stop on Click"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Stop sending when lead clicks a link"})]}),a.jsx(On,{id:"stop-click",checked:u,onCheckedChange:f})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Email Sequence"}),a.jsxs(U,{onClick:y,variant:"outline",size:"sm",children:[a.jsx(gn,{className:"w-4 h-4 mr-2"}),"Add Step"]})]}),h.map((j,S)=>a.jsx(H4e,{step:j,stepIndex:S,totalSteps:h.length,onUpdate:C=>w(S,C),onDelete:()=>_(S)},S))]})]}),a.jsx(V4e,{open:x,onClose:()=>{b(!1),t("/sequences")}})]})}const q4e=()=>{const e=Bs();return g.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),a.jsx("div",{className:"min-h-screen bg-gradient-background flex items-center justify-center p-4",children:a.jsxs(J,{className:"w-full max-w-md gradient-card animate-scale-in text-center",children:[a.jsxs(de,{children:[a.jsx("div",{className:"flex justify-center mb-4",children:a.jsx(yi,{className:"w-16 h-16 text-orange-500"})}),a.jsx(le,{className:"text-2xl text-gradient",children:"Page Not Found"})]}),a.jsxs(re,{className:"space-y-6",children:[a.jsx("p",{className:"text-muted-foreground",children:"Oops! The page you're looking for doesn't exist or has been moved."}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(U,{asChild:!0,className:"w-full bg-purple-600 hover:bg-purple-700",children:a.jsxs(je,{to:"/",children:[a.jsx(Dq,{className:"w-4 h-4 mr-2"}),"Back to Dashboard"]})}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Error c
876ode: 404 | Path: ",e.pathname]})]})]})]})})};function G4e(){const[e,t]=g.useState(!1),[r,n]=g.useState(null),{toast:s}=dt(),i=async()=>{t(!0),n(null);try{const{data:o,error:l}=await Z.functions.invoke("backfill-article-images");if(l)throw l;n(o),s({title:"Images generated!",description:`${o.successful} images created successfully, ${o.failed} failed`})}catch(o){s({title:"Error",description:o.message,variant:"destructive"})}finally{t(!1)}};return a.jsx(Gt,{children:a.jsx("div",{className:"container mx-auto py-8",children:a.jsxs(J,{children:[a.jsxs(de,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Lq,{className:"h-6 w-6"}),"Article Image Backfill"]}),a.jsx(nt,{children:"Generate missing images for news articles"})]}),a.jsxs(re,{className:"space-y-4",children:[a.jsxs(U,{onClick:i,disabled:e,size:"lg",children:[e&&a.jsx(Je,{className:"mr-2 h-4 w-4 animate-spin"}),"Generate Missing Images"]}),r&&a.jsxs("div",{className:"p-4 bg-muted rounded-lg space-y-2",children:[a.jsx("div",{className:"font-semibold",children:"Results:"}),a.jsxs("div",{children:["Total articles processed: ",r.total]}),a.jsxs("div",{className:"text-green-600",children:["â Successful: ",r.successful]}),a.jsxs("div",{className:"text-red-600",children:["â Failed: ",r.failed]})]})]})]})})})}const K4e=()=>{const{user:e}=it(),{isAdmin:t,loading:r}=al(),{toast:n}=dt(),[s,i]=g.useState([]),[o,l]=g.useState([]),[c,d]=g.useState(""),[u,f]=g.useState("all"),[h,m]=g.useState("all"),[v,p]=g.useState(null),[x,b]=g.useState(!1);g.useEffect(()=>{t&&e&&y()},[t,e]),g.useEffect(()=>{w()},[s,c,u,h]);const y=async()=>{try{const{data:S,error:C}=await lt.from("contracts").select("*").order("created_at",{ascending:!1});if(C)throw C;i(S||[])}catch(S){console.error("Error fetching contracts:",S),n({title:"Error",description:"Failed to load contracts",variant:"destructive"})}},w=()=>{let S=s;c&&(S=S.filter(C=>{var P;return C.title.toLowerCase().includes(c.toLowerCase())||((P=C.naics_code)==null?void 0:P.toLowerCase().includes(c.toLowerCase()))})),u!=="all"&&(S=S.filter(C=>C.status===u)),h!=="all"&&(S=S.filter(C=>C.industry===h)),l(S)},_=S=>({pending:"bg-yellow-500/10 text-yellow-500 border-yellow-500/20",active:"bg-green-500/10 text-green-500 border-green-500/20",completed:"bg-blue-500/10 text-blue-500 border-blue-500/20",cancelled:"bg-red-500/10 text-red-500 border-red-500/20"})[S]||"bg-gray-500/10 text-gray-500 border-gray-500/20",N=S=>{p(S),b(!0)},j=Array.from(new Set(s.map(S=>S.industry).filter(Boolean)));return r?a.jsx(Gt,{children:a.jsx("div",{className:"flex items-center justify-center h-screen",children:a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary"})})}):t?a.jsxs(Gt,{children:[a.jsxs("div",{className:"container mx-auto p-6 space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold",children:"My Contracts"}),a.jsx("p",{className:"text-muted-foreground mt-2",children:"Manage and track all your contracts"})]}),a.jsxs(U,{className:"gap-2",children:[a.jsx(gn,{className:"w-4 h-4"}),"Add Contract"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsx(J,{children:a.jsxs(de,{className:"pb-3",children:[a.jsx(nt,{children:"Total Contracts"}),a.jsx(le,{className:"text-3xl",children:s.length})]})}),a.jsx(J,{children:a.jsxs(de,{className:"pb-3",children:[a.jsx(nt,{children:"Active"}),a.jsx(le,{className:"text-3xl",children:s.filter(S=>S.status==="active").length})]})}),a.jsx(J,{children:a.jsxs(de,{className:"pb-3",children:[a.jsx(nt,{children:"Pending"}),a.jsx(le,{className:"text-3xl",children:s.filter(S=>S.status==="pending").length})]})}),a.jsx(J,{children:a.jsxs(de,{className:"pb-3",children:[a.jsx(nt,{children:"Total Value"}),a.jsxs(le,{className:"text-3xl",children:["$",s.reduce((S,C)=>S+(C.contract_value||0),0).toLocaleString()]})]})})]}),a.jsxs(J,{children:[a.jsx(de,{children:a.jsx(le,{children:"Filters"})}),a.jsx(re,{children:a.jsxs("div",{className:"flex gap-4 flex-wrap",children:[a.jsx("div",{className:"flex-1 min-w-[200px]",children:a.jsxs("div",{className:"relative",children:[a.jsx(Es,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),a.jsx(ge,{placeholder:"Search contracts...",value:c,onChange:S=>d(S.target.value),className:"pl-10"})]})}),a.jsxs(Re,{value:u,onValueChange:f,children:[a.jsx(Me,{className:"w-[180px]",children:a.jsx(De,{placeholder:"Status"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"all",children:"All Statuses"}),a.jsx(ce,{value:"pending",children:"Pending"}),a.jsx(ce,{value:"active",children:"Active"}),a.jsx(ce,{value:"completed",children:"Completed"}),a.jsx(ce,{value:"cancelled",children:"Cancelled"})]})]}),a.jsxs(Re,{value:h,onValueChange:m,children:[a.jsx(Me,{className:"w-[180px]",children:a.jsx(De,{placeholder:"Industry"})}),a.jsxs(Ie,{children:[a.jsx(ce,{value:"all",children:"All Industries"}),j.map(S=>a.jsx(ce,{value:S,children:S},S))]})]})]})})]}),a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs(le,{children:["All Contracts (",o.length,")"]})}),a.jsx(re,{children:a.jsxs(Ec,{children:[a.jsx(Oc,{children:a.jsxs(xn,{children:[a.jsx(Ge,{children:"Title"}),a.jsx(Ge,{children:"Industry"}),a.jsx(Ge,{children:"NAICS"}),a.jsx(Ge,{children:"Value"}),a.jsx(Ge,{children:"Status"}),a.jsx(Ge,{children:"Created"}),a.jsx(Ge,{children:"Actions"})]})}),a.jsxs(Tc,{children:[o.map(S=>a.jsxs(xn,{children:[a.jsx(Ve,{className:"font-medium",children:S.title}),a.jsx(Ve,{children:S.industry||"N/A"}),a.jsx(Ve,{children:S.naics_code||"N/A"}),a.jsx(Ve,{children:S.contract_value?`$${S.contract_value.toLocaleStr
876ing()}`:"N/A"}),a.jsx(Ve,{children:a.jsx(ve,{variant:"outline",className:_(S.status),children:S.status})}),a.jsx(Ve,{children:new Date(S.created_at).toLocaleDateString()}),a.jsx(Ve,{children:a.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>N(S),className:"gap-2",children:[a.jsx(ci,{className:"w-4 h-4"}),"View"]})})]},S.id)),o.length===0&&a.jsx(xn,{children:a.jsx(Ve,{colSpan:7,className:"text-center text-muted-foreground",children:"No contracts found"})})]})]})})]})]}),v&&a.jsx(e8,{open:x,onOpenChange:b,documentUrl:v.file_path,title:v.title})]}):a.jsx(Al,{to:"/dashboard",replace:!0})},Y4e=()=>{const[e,t]=g.useState(!1),[r,n]=g.useState(null),{data:s,refetch:i}=ic({queryKey:["pending-emails"],queryFn:async()=>{const{data:c,error:d}=await Z.from("campaign_deliveries").select("status",{count:"exact",head:!1});if(d)throw d;const u=(c==null?void 0:c.filter(m=>m.status==="pending").length)||0,f=(c==null?void 0:c.filter(m=>m.status==="delivered").length)||0,h=(c==null?void 0:c.filter(m=>m.status==="failed").length)||0;return{pending:u,delivered:f,failed:h,total:(c==null?void 0:c.length)||0}},refetchInterval:5e3}),o=async()=>{t(!0);try{console.log("Calling process-pending-deliveries...");const{data:c,error:d}=await Z.functions.invoke("process-pending-deliveries",{body:{}});if(console.log("Response:",{data:c,error:d}),d){We.error(`Error: ${d.message}`);return}n(c),We.success(`Processed batch: ${c.sent} sent, ${c.failed} failed`),await i()}catch(c){console.error("Error:",c),We.error(`Failed: ${c.message}`)}finally{t(!1)}},l=async()=>{t(!0);let c=0,d=0;try{for(;;){const{data:u,error:f}=await Z.functions.invoke("process-pending-deliveries",{body:{}});if(f){We.error(`Error: ${f.message}`);break}if(u.message==="No pending deliveries")break;c+=u.sent||0,d+=u.failed||0,await i(),await new Promise(h=>setTimeout(h,2e3))}n({sent:c,failed:d}),We.success(`All done! ${c} sent, ${d} failed`)}catch(u){console.error("Error:",u),We.error(`Failed: ${u.message}`)}finally{t(!1)}};return a.jsx("div",{className:"min-h-screen p-8",children:a.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Process Pending Emails"}),a.jsx("p",{className:"text-muted-foreground",children:"Manually trigger email delivery processing"})]}),a.jsxs(J,{children:[a.jsxs(de,{children:[a.jsx(le,{children:"Current Status"}),a.jsx(nt,{children:"Real-time email delivery statistics"})]}),a.jsx(re,{children:a.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(an,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:"Pending"})]}),a.jsx("div",{className:"text-3xl font-bold",children:(s==null?void 0:s.pending)||0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(tr,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:"Delivered"})]}),a.jsx("div",{className:"text-3xl font-bold text-green-600",children:(s==null?void 0:s.delivered)||0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(xi,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:"Failed"})]}),a.jsx("div",{className:"text-3xl font-bold text-red-600",children:(s==null?void 0:s.failed)||0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(an,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:"Total"})]}),a.jsx("div",{className:"text-3xl font-bold",children:(s==null?void 0:s.total)||0})]})]})})]}),r&&a.jsxs(J,{children:[a.jsx(de,{children:a.jsx(le,{children:"Last Batch Result"})}),a.jsx(re,{children:a.jsxs("div",{className:"flex gap-6",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"Sent"}),a.jsx("div",{className:"text-2xl font-bold text-green-600",children:r.sent})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed"}),a.jsx("div",{className:"text-2xl font-bold text-red-600",children:r.failed})]})]})})]}),a.jsxs(J,{children:[a.jsxs(de,{children:[a.jsx(le,{children:"Actions"}),a.jsx(nt,{children:"Process emails in batches of 100 at a time"})]}),a.jsxs(re,{className:"flex gap-4",children:[a.jsxs(U,{onClick:o,disabled:e||!(s!=null&&s.pe
876nding),size:"lg",children:[e&&a.jsx(Je,{className:"mr-2 h-4 w-4 animate-spin"}),"Process One Batch (100)"]}),a.jsxs(U,{onClick:l,disabled:e||!(s!=null&&s.pending),size:"lg",variant:"default",children:[e&&a.jsx(Je,{className:"mr-2 h-4 w-4 animate-spin"}),"Process All Remaining"]})]})]}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:[a.jsx("p",{children:"⢠The system processes 100 emails per batch"}),a.jsx("p",{children:"⢠A cron job runs every minute to process pending emails automatically"}),a.jsx("p",{children:'⢠Use "Process All" to send everything immediately'})]})]})})};function X4e(){var K,H,ee,se,ne;const{toast:e}=dt(),t=Fy(),r=vt(),[n,s]=g.useState(null),[i,o]=g.useState(""),[l,c]=g.useState(""),[d,u]=g.useState(null),[f,h]=g.useState(!1),[m,v]=g.useState(10),[p,x]=g.useState("drafts"),{data:b,isLoading:y,refetch:w}=ic({queryKey:["proposal-drafts"],queryFn:async()=>{const{data:W,error:ie}=await Z.from("proposal_drafts").select(` 877 *, 878 solicitations!left ( 879 title, 880 solicitation_number, 881 description, 882 response_deadline, 883 poc_email, 884 poc_name, 885 agency, 886 contract_value_min, 887 contract_value_max 888 ) 889 `).order("created_at",{ascending:!1});if(ie)throw console.error("Error fetching drafts:",ie),ie;return console.log("Fetched drafts:",W),W||[]}}),{data:_,isLoading:N}=ic({queryKey:["opportunities",m],queryFn:async()=>{var R;const{data:W,error:ie}=await Z.from("solicitations").select("*").not("response_deadline","is",null).neq("source_platform","usaspending").order("posted_date",{ascending:!1,nullsLast:!0}).order("contract_value_max",{ascending:!1,nullsLast:!0}).limit(m);if(ie)throw ie;if(W){const O=W.filter(k=>!k.contract_value_min&&!k.contract_value_max);if(O.length>0){console.log(`Auto-populating pricing for ${O.length} contracts using industry standards...`);for(const k of O){let G=1e4,te=1e5;const $=((R=k.industry)==null?void 0:R.toLowerCase())||"";$.includes("construction")?(G=5e4,te=5e5):$.includes("healthcare")?(G=25e3,te=25e4):$.includes("manufacturing")?(G=15e3,te=15e4):$.includes("professional")&&(G=2e4,te=2e5),await Z.from("solicitations").update({contract_value_min:G,contract_value_max:te,updated_at:new Date().toISOString()}).eq("id",k.id)}t.invalidateQueries({queryKey:["opportunities",m]})}}return W}}),j=ag({mutationFn:async W=>{const{data:ie,error:R}=await Z.functions.invoke("generate-proposal",{body:{draftId:W}});if(R)throw R;return ie},onSuccess:()=>{t.invalidateQueries({queryKey:["proposal-drafts"]}),e({title:"Proposal Generated",description:"AI has generated your proposal. Review and submit when ready."})},onError:W=>{e({title:"Generation Failed",description:W.message,variant:"destructive"})}}),S=ag({mutationFn:async W=>{const{data:ie,error:R}=await Z.functions.invoke("submit-proposal",{body:{draftId:W}});if(R)throw R;return ie},onSuccess:()=>{t.invalidateQueries({queryKey:["proposal-drafts"]}),s(null),e({title:"Proposal Submitted",description:"Your proposal has been sent successfully."})},onError:W=>{e({title:"Submission Failed",description:W.message,variant:"destructive"})}}),C=ag({mutationFn:async({draftId:W,content:ie})=>{const{error:R}=await Z.from("proposal_drafts").update({proposal_content:ie}).eq("id",W);if(R)throw R},onSuccess:()=>{t.invalidateQueries({queryKey:["proposal-drafts"]}),e({title:"Changes Saved",description:"Your edits have been saved."})}}),P=ag({mutationFn:async()=>{const{data:W,error:ie}=await Z.functions.invoke("analyze-daily-contracts");if(ie)throw ie;return W},onSuccess:W=>{t.invalidateQueries({queryKey:["proposal-drafts"]}),e({title:"Analysis Complete",description:`Analyzed ${W.analyzed} contracts, created ${W.drafts_created} proposal drafts.`})},onError:W=>{console.error("Analysis error:",W),e({title:"Analysis Failed",description:(W==null?void 0:W.message)||"Could not analyze contracts. Please try again.",variant:"destructive"})}}),A=W=>{const ie={pending_generation:{variant:"secondary",icon:np,label:"Pending"},ready_for_review:{variant:"default",icon:gt,label:"Ready"},submitted:{variant:"success",icon:Na,label:"Submitted"},draft:{variant:"outline",icon:gt,label:"Draft"}},R=ie[W]||ie.draft,O=R.icon;return a.jsxs(ve,{variant:R.variant,className:"gap-1",children:[a.jsx(O,{className:"h-3 w-3"}),R.label]})},D=(b==null?void 0:b.filter(W=>W.status==="draft"))||[],F=(b==null?void 0:b.filter(W=>W.status==="pending_generation"))||[],q=(b==null?void 0:b.filter(W=>W.status==="ready_for_review"))||[],B=(b==null?void 0:b.filter(W=>W.status==="submitted"))||[],V=(_==null?void 0:_.filter(W=>(W.title||"").toLowerCase().includes(l.toLowerCase())||(W.agency||"").toLowerCase().includes(l.toLowerCase())||(W.solicitation_number||"").toLowerCase().includes(l.toLowerCase())))||[],E=W=>{const ie=W||0;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(ie)},M=W=>W.contract_value_min&&W.contract_value_max?`${E(W.contract_value_min)} - ${E(W.contract_value_max)}`:W.contract_value_min?E(W.contract_value_min):W.contract_value_max?E(W.contract_value_max):E(0),T=async W=>{var ie,R;h(!0);try{const{data:O,error:k}=await Z.from("proposal_drafts").insert({solicitation_id:W.id,user_id:(ie=(await Z.auth.getUser()).data.user)==null?void 0:ie.id,organization_id:(R=(await Z.auth.getUser()).data.user)==null?void 0:R.id,ai_analysis:{ke
889y_requirements:["Review solicitation details"],pricing_strategy:"Analyze market rates and competitor pricing",win_probability:75},status:"draft"}).select().single();if(k)throw k;e({title:"Bid Package Created!",description:"Your bid draft is ready. You can now review and customize it."}),u(null),x("drafts"),t.invalidateQueries({queryKey:["proposal-drafts"]})}catch(O){console.error("Error preparing bid:",O),e({title:"Failed to Prepare Bid",description:O.message||"Please try again.",variant:"destructive"})}finally{h(!1)}},L=async W=>{try{e({title:"Analyzing Opportunity",description:"AI is suggesting pricing..."});const{data:ie,error:R}=await Z.functions.invoke("suggest-opportunity-pricing",{body:{solicitationId:W.id}});if(R)throw R;if(e({title:"Pricing Suggested!",description:`Estimated: ${E(ie.pricing.min)} - ${E(ie.pricing.max)}`}),t.invalidateQueries({queryKey:["opportunities"]}),(d==null?void 0:d.id)===W.id){const{data:O}=await Z.from("solicitations").select("*").eq("id",W.id).single();O&&u(O)}}catch(ie){console.error("Error suggesting pricing:",ie),e({title:"Failed to Suggest Pricing",description:ie.message||"Please try again.",variant:"destructive"})}};return a.jsxs(a.Fragment,{children:[a.jsx($r,{title:"My Contracts - Automated Proposal Management",description:"Review and submit AI-generated contract proposals"}),a.jsxs("div",{className:"container mx-auto py-8 px-4",children:[a.jsx("div",{className:"mb-8",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs(U,{variant:"ghost",onClick:()=>r("/"),className:"mb-4",children:[a.jsx(Tr,{className:"mr-2 h-4 w-4"}),"Back to Dashboard"]}),a.jsx("h1",{className:"text-3xl font-bold",children:"My Contracts"}),a.jsx("p",{className:"text-muted-foreground",children:"Review AI-generated proposals and bid on active opportunities"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(U,{onClick:()=>P.mutate(),disabled:P.isPending,children:[a.jsx(ph,{className:"mr-2 h-4 w-4"}),P.isPending?"Analyzing...":"Analyze Contracts"]}),a.jsxs(U,{variant:"outline",onClick:async()=>{e({title:"Fetching Real Solicitations",description:"Getting active opportunities from SAM.gov with deadlines, pricing, and POC details..."});try{const{data:W,error:ie}=await Z.functions.invoke("fetch-daily-solicitations",{body:{opportunityType:"government"}});if(ie)throw ie;t.invalidateQueries({queryKey:["opportunities"]}),e({title:"Success!",description:`Loaded ${(W==null?void 0:W.count)||0} active solicitations ready for bidding!`})}catch(W){console.error("Fetch error:",W),e({title:"Fetch Failed",description:W.message||"Failed to fetch solicitations",variant:"destructive"})}},children:[a.jsx(Ur,{className:"mr-2 h-4 w-4"}),"Fetch Active Solicitations"]})]})]})}),a.jsxs(Ac,{value:p,onValueChange:x,className:"space-y-6",children:[a.jsxs(ol,{children:[a.jsxs(Ot,{value:"drafts",children:["Bid Drafts (",D.length,")"]}),a.jsxs(Ot,{value:"opportunities",children:["Available Opportunities (",V.length,")"]}),a.jsxs(Ot,{value:"ready",children:["Ready to Review (",q.length,")"]}),a.jsxs(Ot,{value:"pending",children:["Generating (",F.length,")"]}),a.jsxs(Ot,{value:"submitted",children:["Submitted (",B.length,")"]})]}),a.jsx(Rt,{value:"drafts",className:"space-y-4",children:y?a.jsx("div",{className:"flex justify-center p-8",children:a.jsx(Je,{className:"h-8 w-8 animate-spin"})}):D.length===0?a.jsx(J,{children:a.jsxs(re,{className:"py-12 text-center",children:[a.jsx(gt,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),a.jsx("p",{className:"text-muted-foreground mb-2",children:"No bid drafts yet"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:'Click "Prepare Bid" on an opportunity to create your first draft'})]})}):D.map(W=>{var ie,R,O,k,G;return a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(le,{children:((ie=W.solicitations)==null?void 0:ie.title)||"Bid Draft"}),a.jsxs(nt,{children:[((R=W.solicitations)==null?void 0:R.solicitation_number)&&a.jsx("span",{className:"font-mono text-xs",children:W.solicitations.solicitation_number}),((O=W.solicitations)==null?void 0:O.solicitation_number)&&((k=W.solicitations)==null?void 0:k.response_deadline)&&" ⢠",((G=W.solicitations)==null?void 0:G.response_deadline)&&a.jsxs("span",{children:["Deadline: ",bt(new Date(W.
889solicitations.response_deadline),"MMM d, yyyy")]})]})]}),A(W.status)]})}),a.jsxs(re,{className:"space-y-4",children:[W.ai_analysis&&a.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[a.jsx("h4",{className:"font-semibold text-sm",children:"AI Analysis"}),a.jsxs("div",{className:"space-y-2 text-sm",children:[W.ai_analysis.key_requirements&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Key Requirements:"}),a.jsx("ul",{className:"list-disc list-inside text-muted-foreground ml-2 mt-1",children:Array.isArray(W.ai_analysis.key_requirements)?W.ai_analysis.key_requirements.map((te,$)=>a.jsx("li",{children:te},$)):a.jsx("li",{children:W.ai_analysis.key_requirements})})]}),W.ai_analysis.pricing_strategy&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Pricing Strategy:"}),a.jsx("p",{className:"text-muted-foreground ml-2 mt-1",children:W.ai_analysis.pricing_strategy})]}),W.ai_analysis.win_probability&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Win Probability:"}),a.jsxs("p",{className:"text-muted-foreground ml-2 mt-1",children:[W.ai_analysis.win_probability,"%"]})]})]})]}),a.jsx("div",{className:"flex gap-2",children:a.jsxs(U,{onClick:async()=>{var te,$,ae;try{const oe=W.solicitations;if(!oe){e({title:"Error",description:"Solicitation data not found",variant:"destructive"});return}const z=`# Proposal for ${oe.title} 890 891## Executive Summary 892This proposal outlines our approach and pricing strategy for ${oe.solicitation_number}. Our team has extensive experience in ${oe.industry||"this sector"} and is well-positioned to deliver exceptional results. 893 894## Technical Approach 895We will address all key requirements including: 896${(($=(te=W.ai_analysis)==null?void 0:te.key_requirements)==null?void 0:$.map(Ze=>`- ${Ze}`).join(` 897`))||`- Comprehensive project management 898- Quality assurance 899- Timely delivery`} 900 901## Pricing Strategy 902${((ae=W.ai_analysis)==null?void 0:ae.pricing_strategy)||"Our pricing is based on industry standards and competitive market analysis."} 903 904## Team Qualifications 905Our team brings proven expertise and a track record of successful contract delivery. 906 907## Conclusion 908We are confident in our ability to meet and exceed the requirements of this solicitation.`,fe=oe.contract_value_min||5e4,ue=oe.contract_value_max||5e5,Ne=Math.floor((fe+ue)/2),He={recommended_bid:Ne,min_safe_bid:Math.floor(fe*1.1),max_competitive_bid:Math.floor(ue*.9),confidence_level:"high",market_factors:["Industry standard pricing","Competitive positioning","Historical contract data"]},{error:ke}=await Z.from("proposal_drafts").update({proposal_content:z,pricing_analysis:He,status:"ready_for_review",updated_at:new Date().toISOString()}).eq("id",W.id);if(ke)throw ke;e({title:"Proposal Generated!",description:`Recommended bid: ${E(Ne)}`}),w()}catch(oe){console.error("Error generating proposal:",oe),e({title:"Failed to Generate Proposal",description:oe.message||"Please try again.",variant:"destructive"})}},children:[a.jsx(ph,{className:"mr-2 h-4 w-4"}),"Generate Full Proposal"]})})]})]},W.id)})}),a.jsxs(Rt,{value:"opportunities",className:"space-y-4",children:[a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(Es,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),a.jsx(ge,{placeholder:"Search by title, agency, or solicitation number...",value:l,onChange:W=>c(W.target.value),className:"pl-10"})]}),a.jsx(U,{variant:"outline",onClick:()=>t.invalidateQueries({queryKey:["opportunities"]}),disabled:N,children:a.jsx(Ur,{className:`h-4 w-4 ${N?"animate-spin":""}`})})]}),N?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx(Je,{className:"h-8 w-8 animate-spin"})}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-4",children:[V==null?void 0:V.map(W=>a.jsxs(J,{className:"cursor-pointer hover:shadow-lg transition-shadow",onClick:()=>u(W),children:[a.jsx(de,{children:a.jsxs("div",{className:"flex justify-between items-start gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(le,{className:"text-lg",children:W.title}),a.jsx(nt,{className:"mt-1",children:W.solicitation_number&&a.jsx("span",{className:"font-mono text-xs",children:W.solicitation_number})})]}),a.jsx(ve,{variant:W.status==="active"?"default":"secondary",children:W.status||"Active"})]})}),a.jsx(re,{children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Jt,{className:"h-4 w-4 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium",children:"Estimated Value"}),a.jsx("div",{className:"text-sm text-muted-foreground",children:M(W)})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(mr,{className:"h-4 w-4 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium",children:"Agency"}),a.jsx("div",{className:"text-sm text-muted-foreground",children:W.agency||"Not specified"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Br,{className:"h-4 w-4 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium",children:"Response Deadline"}),a.jsx("div",{className:"text-sm text-muted-foreground",children:W.response_deadline?bt(new Date(W.response_deadline),"MMM d, yyyy"):"Not specified"})]})]})]})})]},W.id)),(V==null?void 0:V.length)===0&&a.jsx(J,{children:a.jsxs(re,{className:"py-12 text-center",children:[a.jsx(gt,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),a.jsx("p",{className:"text-muted-foreground",children:"No opportunities found matching your search."})]})})]}),!l&&_&&_.length>=m&&a.jsx("div",{className:"flex justify-center pt-4",children:a.jsx(U,{variant:"outline",onClick:()=>v(W=>W+10),disabled:N,children:N?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"h-4 w-4 mr-2 animate-spin"}),"Loading..."]}):"Load More"})})]})]}),a.jsx(Rt,{value:"ready",className:"space-y-4",children:y?a.jsx("div",{className:"flex justify-center p-8",children:a.jsx(Je,{className:"h-8 w-8 animate-spin"})}):q.length===0?a.jsx(J,{children:a.jsx(re,{className:"py-12 text-center text-muted-foreground",children:"No proposals ready for review"})}):q.map(W=>{var ie,R,O,k,G;return a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsx(le,{children:(ie=W.solicitations)==null?void 0:ie.title}),a.jsxs(nt,{children:[(R=W.solicitations)==null?void 0:R.solicitation_number," â¢"," ","Deadline: ",new Date((O=W.solicitations)==null?void 0:O.response_deadline).toLocaleDateString()]})]}),A(W.status)]})}),a.jsxs(re,{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Submission Email:"}),a.jsx("p",{className:"text-muted-foreground",children:W.submission_email})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Recommended Bid:"}),a.jsxs("p",{className:"text-muted-foreground",children:["$",(G=(k=W.pricing_analysis)==null?void 0:k.recommended_bid)==null?void 0:G.toLocaleStr
908ing()]})]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(U,{onClick:()=>{s(W),o(W.proposal_content)},children:[a.jsx(gt,{className:"mr-2 h-4 w-4"}),"Review & Edit"]}),a.jsxs(U,{variant:"outline",onClick:()=>S.mutate(W.id),disabled:S.isPending,children:[a.jsx(va,{className:"mr-2 h-4 w-4"}),"Submit Now"]})]})]})]},W.id)})}),a.jsx(Rt,{value:"pending",className:"space-y-4",children:F.map(W=>{var ie,R;return a.jsxs(J,{children:[a.jsx(de,{children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsx(le,{children:(ie=W.solicitations)==null?void 0:ie.title}),a.jsx(nt,{children:(R=W.solicitations)==null?void 0:R.solicitation_number})]}),A(W.status)]})}),a.jsx(re,{children:a.jsxs(U,{onClick:()=>j.mutate(W.id),disabled:j.isPending,children:[a.jsx(Ur,{className:"mr-2 h-4 w-4"}),"Generate Proposal"]})})]},W.id)})}),a.jsx(Rt,{value:"submitted",className:"space-y-4",children:B.map(W=>{var ie;return a.jsx(J,{children:a.jsx(de,{children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsx(le,{children:(ie=W.solicitations)==null?void 0:ie.title}),a.jsxs(nt,{children:["Submitted: ",new Date(W.submitted_at).toLocaleDateString()]})]}),A(W.status)]})})},W.id)})})]}),a.jsx(rn,{open:!!n,onOpenChange:()=>s(null),children:a.jsxs(Wr,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[a.jsxs(Hr,{children:[a.jsx(Vr,{children:(K=n==null?void 0:n.solicitations)==null?void 0:K.title}),a.jsx(ba,{children:"Review and edit your proposal before submission"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Solicitation:"}),a.jsx("p",{className:"text-muted-foreground",children:(H=n==null?void 0:n.solicitations)==null?void 0:H.solicitation_number})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Deadline:"}),a.jsx("p",{className:"text-muted-foreground",children:((ee=n==null?void 0:n.solicitations)==null?void 0:ee.response_deadline)&&new Date(n.solicitations.response_deadline).toLocaleDateString()})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Submit To:"}),a.jsx("p",{className:"text-muted-foreground",children:n==null?void 0:n.submission_email})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Recommended Bid:"}),a.jsxs("p",{className:"text-muted-foreground",children:["$",(ne=(se=n==null?void 0:n.pricing_analysis)==null?void 0:se.recommended_bid)==null?void 0:ne.toLocaleString()]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Proposal Content"}),a.jsx(Qn,{value:i,onChange:W=>o(W.target.value),rows:20,className:"font-mono text-sm"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(U,{onClick:()=>{C.mutate({draftId:n.id,content:i})},disabled:C.isPending,children:"Save Changes"}),a.jsxs(U,{onClick:()=>S.mutate(n.id),disabled:S.isPending,children:[a.jsx(va,{className:"mr-2 h-4 w-4"}),"Submit Proposal"]}),a.jsx(U,{variant:"outline",onClick:()=>s(null),children:"Cancel"})]})]})]})}),a.jsx(rn,{open:!!d,onOpenChange:()=>u(null),children:a.jsxs(Wr,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[a.jsxs(Hr,{children:[a.jsx(Vr,{children:d==null?void 0:d.title}),a.jsx(ba,{children:"Review opportunity details before preparing your bid"})]}),d&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:"Solicitation Number"}),a.jsx("div",{className:"font-mono text-sm",children:d.solicitation_number||"N/A"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:"Status"}),a.jsx(ve,{children:d.status||"Active"})]})]}),a.jsx(St,{}),a.jsxs("div",{children:[a.jsxs("h3",{className:"font-semibold mb-3 flex items-center gap-2",children:[a.jsx(Jt,{className:"h-4 w-4"}),"Estimated Contract Value"]}),a.jsx("div",{className:"text-2xl font-bold text-primary",children:M(d)})]}),a.jsx(St,{}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-muted-foreground mb-1",children:"Agency"}),a.jsx("div",{children:d.agency||"Not specified"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-muted-foreground mb-1",children:"Response Deadline"}),a.jsx("div",{children:d.response_deadline?bt(new Date(d.response_deadline),"MMMM d, yyyy h:mm a"):"Not specified"})]})]}),a.jsx(St,{}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-2",children:"Description"}),a.jsx("div",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:d.description||"No description available"})]}),d.poc_name&&a.jsxs(a.Fragment,{children:[a.jsx(St,{}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-2",children:"Point of Contact"}),a.jsxs("div",{className:"space-y-1 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Name:"})," ",d.poc_name]}),d.poc_email&&a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Email:"})," ",d.poc_email]}),d.poc_phone&&a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Phone:"})," ",d.poc_phone]}
908)]})]})]}),d.naics_codes&&d.naics_codes.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(St,{}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-2",children:"NAICS Codes"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:d.naics_codes.map(W=>a.jsx(ve,{variant:"outline",children:W},W))})]})]}),a.jsxs("div",{className:"flex gap-3 pt-4",children:[!d.contract_value_min&&!d.contract_value_max&&a.jsxs(U,{variant:"outline",onClick:()=>L(d),className:"flex-1",children:[a.jsx(ph,{className:"h-4 w-4 mr-2"}),"Suggest Pricing"]}),a.jsx(U,{className:"flex-1",onClick:()=>T(d),disabled:f,children:f?a.jsxs(a.Fragment,{children:[a.jsx(Je,{className:"h-4 w-4 mr-2 animate-spin"}),"Preparing Bid Package..."]}):a.jsxs(a.Fragment,{children:[a.jsx(va,{className:"h-4 w-4 mr-2"}),"Prepare Bid Package"]})}),a.jsx(U,{variant:"outline",onClick:()=>u(null),children:"Close"})]})]})]})})]})]})}const Q4e=()=>{const[e,t]=g.useState(!1),[r,n]=g.useState(null),[s,i]=g.useState(null),[o,l]=g.useState(0),c=async()=>{const{count:u}=await Z.from("campaign_deliveries").select("*",{count:"exact",head:!0}).eq("status","pending").eq("delivery_type","email");i(u??0)},d=async()=>{t(!0);try{console.log("Processing pending deliveries...");const{data:u,error:f}=await Z.functions.invoke("process-pending-deliveries",{body:{trigger:"manual"}});if(console.log("Response:",{data:u,error:f}),f)throw f;n(u),l(h=>h+((u==null?void 0:u.sent)||0)),await c(),We.success(`Batch complete! Sent: ${(u==null?void 0:u.sent)||0}, Failed: ${(u==null?void 0:u.failed)||0}`)}catch(u){console.error("Process error:",u),We.error(`Failed: ${u.message}`)}finally{t(!1)}};return g.useEffect(()=>{c()},[]),a.jsxs("div",{className:"flex flex-col items-center justify-center min-h-screen gap-6 p-4",children:[a.jsxs("div",{className:"text-center max-w-md",children:[a.jsx("h1",{className:"text-3xl font-bold mb-4",children:"ð§ Email Processor"}),s!==null&&a.jsxs("div",{className:"mb-6 p-4 bg-muted rounded-lg",children:[a.jsx("p",{className:"text-2xl font-bold",children:s.toLocaleString()}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"emails remaining"}),o>0&&a.jsxs("p",{className:"text-sm text-green-600 mt-2",children:["â ",o.toLocaleString()," processed this session"]})]}),e&&a.jsxs("div",{className:"mb-4",children:[a.jsx(Je,{className:"h-12 w-12 animate-spin mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Processing batch of 100..."})]}),r&&!e&&a.jsxs("div",{className:"mb-4 p-4 bg-green-50 border border-green-200 rounded-lg",children:[a.jsx("p",{className:"font-semibold",children:"Last batch:"}),a.jsxs("p",{className:"text-sm",children:["Sent: ",r.sent," | Failed: ",r.failed]})]}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Each click processes 100 emails. Keep clicking until all are sent!"})]}),a.jsxs(U,{onClick:d,disabled:e||s===0,size:"lg",className:"w-64",children:[e&&a.jsx(Je,{className:"mr-2 h-4 w-4 animate-spin"}),s===0?"â All Done!":"Process Next 100 Emails"]}
908)]})},J4e=new fX,Z4e=()=>a.jsx(vX,{client:J4e,children:a.jsx(eee,{children:a.jsxs(iC,{children:[a.jsx(MG,{}),a.jsx(uK,{}),a.jsx(_Q,{children:a.jsxs(gQ,{children:[a.jsx(ze,{path:"/",element:a.jsx(lOe,{})}),a.jsx(ze,{path:"/home",element:a.jsx(Al,{to:"/",replace:!0})}),a.jsx(ze,{path:"/dashboard",element:a.jsx(QAe,{})}),a.jsx(ze,{path:"/contracts",element:a.jsx(TOe,{})}),a.jsx(ze,{path:"/financing",element:a.jsx(YOe,{})}),a.jsx(ze,{path:"/support",element:a.jsx(C4e,{})}),a.jsx(ze,{path:"/directory",element:a.jsx(_4e,{})}),a.jsx(ze,{path:"/pricebid",element:a.jsx(DI,{})}),a.jsx(ze,{path:"/features",element:a.jsx(DI,{})}),a.jsx(ze,{path:"/bidscale",element:a.jsx(k4e,{})}),a.jsx(ze,{path:"/consulting",element:a.jsx(A4e,{})}),a.jsx(ze,{path:"/certifications",element:a.jsx(E4e,{})}),a.jsx(ze,{path:"/bidconnect",element:a.jsx(O4e,{})}),a.jsx(ze,{path:"/historical-contracts",element:a.jsx(EEe,{})}),a.jsx(ze,{path:"/bid-results",element:a.jsx(MEe,{})}),a.jsx(ze,{path:"/calculator",element:a.jsx(IOe,{})}),a.jsx(ze,{path:"/trends",element:a.jsx(eTe,{})}),a.jsx(ze,{path:"/analytics",element:a.jsx(Al,{to:"/trends",replace:!0})}),a.jsx(ze,{path:"/news",element:a.jsx(p4e,{})}),a.jsx(ze,{path:"/news/:id",element:a.jsx(y4e,{})}),a.jsx(ze,{path:"/settings",element:a.jsx(tTe,{})}),a.jsx(ze,{path:"/profile",element:a.jsx(jTe,{})}),a.jsx(ze,{path:"/admin",element:a.jsx(Al,{to:"/admin/users",replace:!0})}),a.jsx(ze,{path:"/admin/users",element:a.jsx(NTe,{})}),a.jsx(ze,{path:"/admin/leads",element:a.jsx(r4e,{})}),a.jsx(ze,{path:"/admin/campaign/:id",element:a.jsx(T4e,{})}),a.jsx(ze,{path:"/admin/traffic",element:a.jsx(n4e,{})}),a.jsx(ze,{path:"/admin/contracts-crm",element:a.jsx(K4e,{})}),a.jsx(ze,{path:"/admin/my-contracts",element:a.jsx(X4e,{})}),a.jsx(ze,{path:"/sequences",element:a.jsx(W4e,{})}),a.jsx(ze,{path:"/sequences/new",element:a.jsx(FI,{})}),a.jsx(ze,{path:"/sequences/:id/edit",element:a.jsx(FI,{})}),a.jsx(ze,{path:"/opportunities",element:a.jsx(U4e,{})}),a.jsx(ze,{path:"/opportunities/search",element:a.jsx(D4e,{})}),a.jsx(ze,{path:"/system-testing",element:a.jsx(u4e,{})}),a.jsx(ze,{path:"/send-campaign",element:a.jsx(f4e,{})}),a.jsx(ze,{path:"/process-pending-emails",element:a.jsx(Y4e,{})}),a.jsx(ze,{path:"/process-deliveries",element:a.jsx(Q4e,{})}),a.jsx(ze,{path:"/login",element:a.jsx(rTe,{})}),a.jsx(ze,{path:"/signup",element:a.jsx(mTe,{})}),a.jsx(ze,{path:"/plans",element:a.jsx(pTe,{})}),a.jsx(ze,{path:"/plan",element:a.jsx(Al,{to:"/plans",replace:!0})}),a.jsx(ze,{path:"/reset-password",element:a.jsx(gTe,{})}),a.jsx(ze,{path:"/success",element:a.jsx(vTe,{})}),a.jsx(ze,{path:"/guarantee-terms",element:a.jsx(h4e,{})}),a.jsx(ze,{path:"/about",element:a.jsx(P4e,{})}),a.jsx(ze,{path:"/admin/image-backfill",element:a.jsx(G4e,{})}),a.jsx(ze,{path:"*",element:a.jsx(q4e,{})})]})})]})})});lR(document.getElementById("root")).render(a.jsx(pR,{children:a.jsx(Z4e,{})}));export{Z as s};
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.