PageSourceSearch

https://xpharma.ai/assets/index-CC5WnUxL.js

js xpharma.ai collected 2026-10-05 14:11:21 UTC 2,551,937 bytes, 899 lines download raw bytes

vendor: 5,068 bytes, lines 1-9
1var voe=Object.defineProperty;var U$=e=>{throw TypeError(e)};var xoe=(e,t,n)=>t in e?voe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var No=(e,t,n)=>xoe(e,typeof t!="symbol"?t+"":t,n),Qk=(e,t,n)=>t.has(e)||U$("Cannot "+n);var H=(e,t,n)=>(Qk(e,t,"read from private field"),n?n.call(e):t.get(e)),Qe=(e,t,n)=>t.has(e)?U$("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Oe=(e,t,n,r)=>(Qk(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),_t=(e,t,n)=>(Qk(e,t,"access private method"),n);var Hb=(e,t,n,r)=>({set _(i){Oe(e,t,i,n)},get _(){return H(e,t,r)}});function boe(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var Hc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ot(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xU={exports:{}},p_={},bU={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 Yx=Symbol.for("react.element"),woe=Symbol.for("react.portal"),joe=Symbol.for("react.fragment"),_oe=Symbol.for("react.strict_mode"),Soe=Symbol.for("react.profiler"),koe=Symbol.for("react.provider"),Noe=Symbol.for("react.context"),Coe=Symbol.for("react.forward_ref"),Aoe=Symbol.for("react.suspense"),Toe=Symbol.for("react.memo"),Eoe=Symbol.for("react.lazy"),q$=Symbol.iterator;function Poe(e){return e===null||typeof e!="object"?null:(e=q$&&e[q$]||e["@@iterator"],typeof e=="function"?e:null)}var wU={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},jU=Object.assign,_U={};function Lm(e,t,n){this.props=e,this.context=t,this.refs=_U,this.updater=n||wU}Lm.prototype.isReactComponent={};Lm.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")};Lm.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function SU(){}SU.prototype=Lm.prototype;function _O(e,t,n){this.props=e,this.context=t,this.refs=_U,this.updater=n||wU}var SO=_O.prototype=new SU;SO.constructor=_O;jU(SO,Lm.prototype);SO.isPureReactComponent=!0;var H$=Array.isArray,kU=Object.prototype.hasOwnProperty,kO={current:null},NU={key:!0,ref:!0,__self:!0,__source:!0};function CU(e,t,n){var r,i={},a=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)kU.call(t,r)&&!NU.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:Yx,type:e,key:a,ref:o,props:i,_owner:kO.current}}function Ooe(e,t){return{$$typeof:Yx,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function NO(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yx}function Ioe(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var K$=/\/+/g;function Xk(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ioe(""+e.key):t.toString(36)}function ow(e,t,n,r,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Yx:case woe:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+Xk(o,0):r,H$(i)?(n="",e!=null&&(n=e.replace(K$,"$&/")+"/"),ow(i,t,n,"",function(u){return u})):i!=null&&(NO(i)&&(i=Ooe(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(K$,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",H$(e))for(var l=0;l<e.length;l++){a=e[l];var c=r+Xk(a,l);o+=ow(a,t,n,c,i)}else if(c=Poe(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;
vendor: 4,179 bytes, lines 9-17
9)a=a.value,c=r+Xk(a,l++),o+=ow(a,t,n,c,i);else if(a==="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 Kb(e,t,n){if(e==null)return e;var r=[],i=0;return ow(e,r,"","",function(a){return t.call(n,a,i++)}),r}function Roe(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Vi={current:null},lw={transition:null},Doe={ReactCurrentDispatcher:Vi,ReactCurrentBatchConfig:lw,ReactCurrentOwner:kO};function AU(){throw Error("act(...) is not supported in production builds of React.")}At.Children={map:Kb,forEach:function(e,t,n){Kb(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Kb(e,function(){t++}),t},toArray:function(e){return Kb(e,function(t){return t})||[]},only:function(e){if(!NO(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};At.Component=Lm;At.Fragment=joe;At.Profiler=Soe;At.PureComponent=_O;At.StrictMode=_oe;At.Suspense=Aoe;At.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Doe;At.act=AU;At.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=jU({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=kO.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)kU.call(t,c)&&!NU.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Yx,type:e.type,key:i,ref:a,props:r,_owner:o}};At.createContext=function(e){return e={$$typeof:Noe,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:koe,_context:e},e.Consumer=e};At.createElement=CU;At.createFactory=function(e){var t=CU.bind(null,e);return t.type=e,t};At.createRef=function(){return{current:null}};At.forwardRef=function(e){return{$$typeof:Coe,render:e}};At.isValidElement=NO;At.lazy=function(e){return{$$typeof:Eoe,_payload:{_status:-1,_result:e},_init:Roe}};At.memo=function(e,t){return{$$typeof:Toe,type:e,compare:t===void 0?null:t}};At.startTransition=function(e){var t=lw.transition;lw.transition={};try{e()}finally{lw.transition=t}};At.unstable_act=AU;At.useCallback=function(e,t){return Vi.current.useCallback(e,t)};At.useContext=function(e){return Vi.current.useContext(e)};At.useDebugValue=function(){};At.useDeferredValue=function(e){return Vi.current.useDeferredValue(e)};At.useEffect=function(e,t){return Vi.current.useEffect(e,t)};At.useId=function(){return Vi.current.useId()};At.useImperativeHandle=function(e,t,n){return Vi.current.useImperativeHandle(e,t,n)};At.useInsertionEffect=function(e,t){return Vi.current.useInsertionEffect(e,t)};At.useLayoutEffect=function(e,t){return Vi.current.useLayoutEffect(e,t)};At.useMemo=function(e,t){return Vi.current.useMemo(e,t)};At.useReducer=function(e,t,n){return Vi.current.useReducer(e,t,n)};At.useRef=function(e){return Vi.current.useRef(e)};At.useState=function(e){return Vi.current.useState(e)};At.useSyncExternalStore=function(e,t,n){return Vi.current.useSyncExternalStore(e,t,n)};At.useTransition=function(){return Vi.current.useTransition()};At.version="18.3.1";bU.exports=At;var x=bU.exports;const L=Ot(x),CO=boe({__proto__:null,default:L},[x]);/**
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 Moe=x,$oe=Symbol.for("react.element"),Loe=Symbol.for("react.fragment"),Foe=Object.prototype.hasOwnProperty,zoe=Moe.__SECRET_INT
vendor: 11,415 bytes, lines 17-34
17ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Boe={key:!0,ref:!0,__self:!0,__source:!0};function TU(e,t,n){var r,i={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Foe.call(t,r)&&!Boe.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:$oe,type:e,key:a,ref:o,props:i,_owner:zoe.current}}p_.Fragment=Loe;p_.jsx=TU;p_.jsxs=TU;xU.exports=p_;var s=xU.exports,EU={exports:{}},Qs={},PU={exports:{}},OU={};/**
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(I,M){var R=I.length;I.push(M);e:for(;0<R;){var K=R-1>>>1,D=I[K];if(0<i(D,M))I[K]=M,I[R]=D,R=K;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var M=I[0],R=I.pop();if(R!==M){I[0]=R;e:for(var K=0,D=I.length,E=D>>>1;K<E;){var q=2*(K+1)-1,X=I[q],re=q+1,Y=I[re];if(0>i(X,R))re<D&&0>i(Y,X)?(I[K]=Y,I[re]=R,K=re):(I[K]=X,I[q]=R,K=q);else if(re<D&&0>i(Y,R))I[K]=Y,I[re]=R,K=re;else break e}}return M}function i(I,M){var R=I.sortIndex-M.sortIndex;return R!==0?R:I.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,h=null,f=3,p=!1,m=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,v=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(I){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=I)r(u),M.sortIndex=M.expirationTime,t(c,M);else break;M=n(u)}}function _(I){if(g=!1,w(I),!m)if(n(c)!==null)m=!0,B(j);else{var M=n(u);M!==null&&P(_,M.startTime-I)}}function j(I,M){m=!1,g&&(g=!1,b(N),N=-1),p=!0;var R=f;try{for(w(M),h=n(c);h!==null&&(!(h.expirationTime>M)||I&&!A());){var K=h.callback;if(typeof K=="function"){h.callback=null,f=h.priorityLevel;var D=K(h.expirationTime<=M);M=e.unstable_now(),typeof D=="function"?h.callback=D:h===n(c)&&r(c),w(M)}else r(c);h=n(c)}if(h!==null)var E=!0;else{var q=n(u);q!==null&&P(_,q.startTime-M),E=!1}return E}finally{h=null,f=R,p=!1}}var S=!1,k=null,N=-1,T=5,C=-1;function A(){return!(e.unstable_now()-C<T)}function O(){if(k!==null){var I=e.unstable_now();C=I;var M=!0;try{M=k(!0,I)}finally{M?z():(S=!1,k=null)}}else S=!1}var z;if(typeof v=="function")z=function(){v(O)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,F=$.port2;$.port1.onmessage=O,z=function(){F.postMessage(null)}}else z=function(){y(O,0)};function B(I){k=I,S||(S=!0,z())}function P(I,M){N=y(function(){I(e.unstable_now())},M)}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(I){I.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,B(j))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(I){switch(f){case 1:case 2:case 3:var M=3;break;default:M=f}var R=f;f=M;try{return I()}finally{f=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,M){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var R=f;f=I;try{return M()}finally{f=R}},e.unstable_scheduleCallback=function(I,M,R){var K=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?K+R:K):R=K,I){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=R+D,I={id:d++,callback:M,priorityLevel:I,startTime:R,expirationTime:D,sortIndex:-1},R>K?(I.sortIndex=R,t(u,I),n(c)===null&&I===n(u)&&(g?(b(N),N=-1):g=!0,P(_,R-K))):(I.sortIndex=D,t(c,I),m||p||(m=!0,B(j))),I},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(I){var M=f;return function(){var R=f;f=M;try{return I.apply(this,arguments)}finally{f=R}}}})(OU);PU.exports=OU;var Voe=PU.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 Woe=x,Ws=Voe;function ye(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var IU=new Set,fv={};function Ch(e,t){Ip(e,t),Ip(e+"Capture",t)}function Ip(e,t){for(fv[e]=t,e=0;e<t.length;e++)IU.add(t[e])}var Wl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),UA=Object.prototype.hasOwnProperty,Uoe=/^[: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]*$/,G$={},Y$={};function qoe(e){return UA.call(Y$,e)?!0:UA.call(G$,e)?!1:Uoe.test(e)?Y$[e]=!0:(G$[e]=!0,!1)}function Hoe(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Koe(e,t,n,r){if(t===null||typeof t>"u"||Hoe(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 Wi(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var ai={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ai[e]=new Wi(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ai[t]=new Wi(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ai[e]=new Wi(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ai[e]=new Wi(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){ai[e]=new Wi(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ai[e]=new Wi(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ai[e]=new Wi(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ai[e]=new Wi(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ai[e]=new Wi(e,5,!1,e.toLowerCase(),null,!1,!1)});var AO=/[\-:]([a-z])/g;function TO(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(AO,TO);ai[t]=new Wi(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(AO,TO);ai[t]=new Wi(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(AO,TO);ai[t]=new Wi(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ai[e]=new Wi(e,1,!1,e.toLowerCase(),null,!1,!1)});ai.xlinkHref=new Wi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ai[e]=new Wi(e,1,!1,e.toLowerCase(),null,!0,!0)});function EO(e,t,n,r){var i=ai.hasOwnProperty(t)?ai[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Koe(t,n,i,r)&&(n=null),r||i===null?qoe(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ec=Woe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Gb=Symbol.for("react.element"),Of=Symbol.for("react.portal"),If=Symbol.for("react.fragment"),PO=Symbol.for("react.strict_mode"),qA=Symbol.for("react.profiler"),RU=Symbol.for("react.provider"),DU=Symbol.for("react.context"),OO=Symbol.for("react.forward_ref"),HA=Symbol.for("react.suspense"),KA=Symbol.for("react.suspense_list"),IO=Symbol.for("react.memo"),Cc=Symbol.for("react.lazy"),MU=Symbol.for("react.offscreen"),Q$=Symbol.iterator;function Eg(e){return e===null||typeof e!="object"?null:(e=Q$&&e[Q$]||e["@@iterator"],typeof e=="function"?e:null)}var zn=Object.assign,Zk;function gy(e){if(Zk===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Zk=t&&t[1]||""}return`
34`+Zk+e}var Jk=!1;function eN(e,t){if(!e||Jk)return"";Jk=!0;var n=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(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}
vendor: 14,137 bytes, lines 34-37
34catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
35`),a=r.stack.split(`
36`),o=i.length-1,l=a.length-1;1<=o&&0<=l&&i[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==a[l]){var c=`
37`+i[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{Jk=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?gy(e):""}function Goe(e){switch(e.tag){case 5:return gy(e.type);case 16:return gy("Lazy");case 13:return gy("Suspense");case 19:return gy("SuspenseList");case 0:case 2:case 15:return e=eN(e.type,!1),e;case 11:return e=eN(e.type.render,!1),e;case 1:return e=eN(e.type,!0),e;default:return""}}function GA(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 If:return"Fragment";case Of:return"Portal";case qA:return"Profiler";case PO:return"StrictMode";case HA:return"Suspense";case KA:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case DU:return(e.displayName||"Context")+".Consumer";case RU:return(e._context.displayName||"Context")+".Provider";case OO:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case IO:return t=e.displayName||null,t!==null?t:GA(e.type)||"Memo";case Cc:t=e._payload,e=e._init;try{return GA(e(t))}catch{}}return null}function Yoe(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 GA(t);case 8:return t===PO?"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 mu(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $U(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Qoe(e){var t=$U(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yb(e){e._valueTracker||(e._valueTracker=Qoe(e))}function LU(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$U(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Hw(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 YA(e,t){var n=t.checked;return zn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function X$(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=mu(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function FU(e,t){t=t.checked,t!=null&&EO(e,"checked",t,!1)}function QA(e,t){FU(e,t);var n=mu(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?XA(e,t.type,n):t.hasOwnProperty("defaultValue")&&XA(e,t.type,mu(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Z$(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function XA(e,t,n){(t!=="number"||Hw(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var yy=Array.isArray;function tp(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+mu(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ZA(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ye(91));return zn({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function J$(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ye(92));if(yy(n)){if(1<n.length)throw Error(ye(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:mu(n)}}function zU(e,t){var n=mu(t.value),r=mu(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function eL(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function BU(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 JA(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?BU(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Qb,VU=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Qb=Qb||document.createElement("div"),Qb.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Qb.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function pv(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Oy={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},Xoe=["Webkit","ms","Moz","O"];Object.keys(Oy).forEach(function(e){Xoe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Oy[t]=Oy[e]})});function WU(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Oy.hasOwnProperty(e)&&Oy[e]?(""+t).trim():t+"px"}function UU(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=WU(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Zoe=zn({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 eT(e,t){if(t){if(Zoe[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 tT(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 nT=null;function RO(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rT=null,np=null,rp=null;function tL(e){if(e=Zx(e)){if(typeof rT!="function")throw Error(ye(280));var t=e.stateNode;t&&(t=x_(t),rT(e.stateNode,e.type,t))}}function qU(e){np?rp?rp.push(e):rp=[e]:np=e}function HU(){if(np){var e=np,t=rp;if(rp=np=null,tL(e),t)for(e=0;e<t.length;e++)tL(t[e])}}function KU(e,t){return e(t)}function GU(){}var tN=!1;function YU(e,t,n){if(tN)return e(t,n);tN=!0;try{return KU(e,t,n)}finally{tN=!1,(np!==null||rp!==null)&&(GU(),HU())}}function mv(e,t){var n=e.stateNode;if(n===null)return null;var r=x_(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ye(231,t,typeof n));return n}var iT=!1;if(Wl)try{var Pg={};Object.defineProperty(Pg,"passive",{get:function(){iT=!0}}),window.addEventListener("test",Pg,Pg),window.removeEventListener("test",Pg,Pg)}catch{iT=!1}function Joe(e,t,n,r,i,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Iy=!1,Kw=null,Gw=!1,sT=null,ele={onError:function(e){Iy=!0,Kw=e}};function tle(e,t,n,r,i,a,o,l,c){Iy=!1,Kw=null,Joe.apply(ele,arguments)}function nle(e,t,n,r,i,a,o,l,c){if(tle.apply(this,arguments),Iy){if(Iy){var u=Kw;Iy=!1,Kw=null}else throw Error(ye(198));Gw||(Gw=!0,sT=u)}}function Ah(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function QU(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 nL(e){if(Ah(e)!==e)throw Error(ye(188))}function rle(e){var t=e.alternate;if(!t){if(t=Ah(e),t===null)throw Error(ye(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return nL(i),e;if(a===r)return nL(i),t;a=a.sibling}throw Error(ye(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,r=a;break}if(l===r){o=!0,r=i,n=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===n){o=!0,n=a,r=i;break}if(l===r){o=!0,r=a,n=i;break}l=l.sibling}if(!o)throw Error(ye(189))}}if(n.alternate!==r)throw Error(ye(190))}if(n.tag!==3)throw Error(ye(188));return n.stateNode.current===n?e:t}function XU(e){return e=rle(e),e!==null?ZU(e):null}function ZU(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ZU(e);if(t!==null)return t;e=e.sibling}return null}var JU=Ws.unstable_scheduleCallback,rL=Ws.unstable_cancelCallback,ile=Ws.unstable_shouldYield,sle=Ws.unstable_requestPaint,Zn=Ws.unstable_now,ale=Ws.unstable_getCurrentPriorityLevel,DO=Ws.unstable_ImmediatePriority,eq=Ws.unstable_UserBlockingPriority,Yw=Ws.unstable_NormalPriority,ole=Ws.unstable_LowPriority,tq=Ws.unstable_IdlePriority,m_=null,Uo=null;function lle(e){if(Uo&&typeof Uo.onCommitFiberRoot=="function")try{Uo.onCommitFiberRoot(m_,e,void 0,(e.current.flags&128)===128)}catch{}}var so=Math.clz32?Math.clz32:dle,cle=Math.log,ule=Math.LN2;function dle(e){return e>>>=0,e===0?32:31-(cle(e)/ule|0)|0}var Xb=64,Zb=4194304;function vy(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 Qw(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=vy(l):(a&=o,a!==0&&(r=vy(a)))}else o=n&~i,o!==0?r=vy(o):a!==0&&(r=vy(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-so(t),i=1<<n,r|=e[n],t&=~i;return r}function hle(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 fle(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-so(a),l=1<<o,c=i[o];c===-1?(!(l&n)||l&r)&&(i[o]=hle(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function aT(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function nq(){var e=Xb;return Xb<<=1,!(Xb&4194240)&&(Xb=64),e}function nN(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}
vendor: 4,096 bytes, line 37
37function Qx(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-so(t),e[t]=n}function ple(e,t){var n=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 r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-so(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function MO(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-so(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Jt=0;function rq(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var iq,$O,sq,aq,oq,oT=!1,Jb=[],eu=null,tu=null,nu=null,gv=new Map,yv=new Map,Oc=[],mle="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 iL(e,t){switch(e){case"focusin":case"focusout":eu=null;break;case"dragenter":case"dragleave":tu=null;break;case"mouseover":case"mouseout":nu=null;break;case"pointerover":case"pointerout":gv.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":yv.delete(t.pointerId)}}function Og(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Zx(t),t!==null&&$O(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function gle(e,t,n,r,i){switch(t){case"focusin":return eu=Og(eu,e,t,n,r,i),!0;case"dragenter":return tu=Og(tu,e,t,n,r,i),!0;case"mouseover":return nu=Og(nu,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return gv.set(a,Og(gv.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,yv.set(a,Og(yv.get(a)||null,e,t,n,r,i)),!0}return!1}function lq(e){var t=xd(e.target);if(t!==null){var n=Ah(t);if(n!==null){if(t=n.tag,t===13){if(t=QU(n),t!==null){e.blockedOn=t,oq(e.priority,function(){sq(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function cw(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=lT(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nT=r,n.target.dispatchEvent(r),nT=null}else return t=Zx(n),t!==null&&$O(t),e.blockedOn=n,!1;t.shift()}return!0}function sL(e,t,n){cw(e)&&n.delete(t)}function yle(){oT=!1,eu!==null&&cw(eu)&&(eu=null),tu!==null&&cw(tu)&&(tu=null),nu!==null&&cw(nu)&&(nu=null),gv.forEach(sL),yv.forEach(sL)}function Ig(e,t){e.blockedOn===t&&(e.blockedOn=null,oT||(oT=!0,Ws.unstable_scheduleCallback(Ws.unstable_NormalPriority,yle)))}function vv(e){function t(i){return Ig(i,e)}if(0<Jb.length){Ig(Jb[0],e);for(var n=1;n<Jb.length;n++){var r=Jb[n];r.blockedOn===e&&(r.blockedOn=null)}}for(eu!==null&&Ig(eu,e),tu!==null&&Ig(tu,e),nu!==null&&Ig(nu,e),gv.forEach(t),yv.forEach(t),n=0;n<Oc.length;n++)r=Oc[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Oc.length&&(n=Oc[0],n.blockedOn===null);)lq(n),n.blockedOn===null&&Oc.shift()}var ip=ec.ReactCurrentBatchConfig,Xw=!0;function vle(e,t,n,r){var i=Jt,a=ip.transition;ip.transition=null;try{Jt=1,LO(e,t,n,r)}finally{Jt=i,ip.transition=a}}function xle(e,t,n,r){var i=Jt,a=ip.transition;ip.transition=null;try{Jt=4,LO(e,t,n,r)}finally{Jt=i,ip.transition=a}}function LO(e,t,n,r){if(Xw){var i=lT(e,t,n,r);if(i===null)hN(e,t,r,Zw,n),iL(e,r);else if(gle(i,e,t,n,r))r.stopPropagation();else if(iL(e,r),t&4&&-1<mle.indexOf(e)){for(;i!==null;){var a=Zx(i);if(a!==null&&iq(a),a=lT(e,t,n,r),a===null&&hN(e,t,r,Zw,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else hN(e,t,r,null,n)}}var Zw=null;function lT(e,t,n,r){if(Zw=null,e=RO(r),e=xd(e),e!==null)if(t=Ah(e),t===null)e=null;else if(n=t.tag,n===13){if(e=QU(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Zw=e,null}
vendor: 10,457 bytes, line 37
37function cq(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(ale()){case DO:return 1;case eq:return 4;case Yw:case ole:return 16;case tq:return 536870912;default:return 16}default:return 16}}var Kc=null,FO=null,uw=null;function uq(){if(uw)return uw;var e,t=FO,n=t.length,r,i="value"in Kc?Kc.value:Kc.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return uw=i.slice(e,1<r?1-r:void 0)}function dw(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 e0(){return!0}function aL(){return!1}function Xs(e){function t(n,r,i,a,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?e0:aL,this.isPropagationStopped=aL,this}return zn(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=e0)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=e0)},persist:function(){},isPersistent:e0}),t}var Fm={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zO=Xs(Fm),Xx=zn({},Fm,{view:0,detail:0}),ble=Xs(Xx),rN,iN,Rg,g_=zn({},Xx,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:BO,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!==Rg&&(Rg&&e.type==="mousemove"?(rN=e.screenX-Rg.screenX,iN=e.screenY-Rg.screenY):iN=rN=0,Rg=e),rN)},movementY:function(e){return"movementY"in e?e.movementY:iN}}),oL=Xs(g_),wle=zn({},g_,{dataTransfer:0}),jle=Xs(wle),_le=zn({},Xx,{relatedTarget:0}),sN=Xs(_le),Sle=zn({},Fm,{animationName:0,elapsedTime:0,pseudoElement:0}),kle=Xs(Sle),Nle=zn({},Fm,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Cle=Xs(Nle),Ale=zn({},Fm,{data:0}),lL=Xs(Ale),Tle={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ele={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"},Ple={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ole(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ple[e])?!!t[e]:!1}function BO(){return Ole}var Ile=zn({},Xx,{key:function(e){if(e.key){var t=Tle[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=dw(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ele[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:BO,charCode:function(e){return e.type==="keypress"?dw(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?dw(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rle=Xs(Ile),Dle=zn({},g_,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cL=Xs(Dle),Mle=zn({},Xx,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:BO}),$le=Xs(Mle),Lle=zn({},Fm,{propertyName:0,elapsedTime:0,pseudoElement:0}),Fle=Xs(Lle),zle=zn({},g_,{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}),Ble=Xs(zle),Vle=[9,13,27,32],VO=Wl&&"CompositionEvent"in window,Ry=null;Wl&&"documentMode"in document&&(Ry=document.documentMode);var Wle=Wl&&"TextEvent"in window&&!Ry,dq=Wl&&(!VO||Ry&&8<Ry&&11>=Ry),uL=" ",dL=!1;function hq(e,t){switch(e){case"keyup":return Vle.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fq(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rf=!1;function Ule(e,t){switch(e){case"compositionend":return fq(t);case"keypress":return t.which!==32?null:(dL=!0,uL);case"textInput":return e=t.data,e===uL&&dL?null:e;default:return null}}function qle(e,t){if(Rf)return e==="compositionend"||!VO&&hq(e,t)?(e=uq(),uw=FO=Kc=null,Rf=!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 dq&&t.locale!=="ko"?null:t.data;default:return null}}var Hle={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 hL(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Hle[e.type]:t==="textarea"}function pq(e,t,n,r){qU(r),t=Jw(t,"onChange"),0<t.length&&(n=new zO("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Dy=null,xv=null;function Kle(e){kq(e,0)}function y_(e){var t=$f(e);if(LU(t))return e}function Gle(e,t){if(e==="change")return t}var mq=!1;if(Wl){var aN;if(Wl){var oN="oninput"in document;if(!oN){var fL=document.createElement("div");fL.setAttribute("oninput","return;"),oN=typeof fL.oninput=="function"}aN=oN}else aN=!1;mq=aN&&(!document.documentMode||9<document.documentMode)}function pL(){Dy&&(Dy.detachEvent("onpropertychange",gq),xv=Dy=null)}function gq(e){if(e.propertyName==="value"&&y_(xv)){var t=[];pq(t,xv,e,RO(e)),YU(Kle,t)}}function Yle(e,t,n){e==="focusin"?(pL(),Dy=t,xv=n,Dy.attachEvent("onpropertychange",gq)):e==="focusout"&&pL()}function Qle(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return y_(xv)}function Xle(e,t){if(e==="click")return y_(t)}function Zle(e,t){if(e==="input"||e==="change")return y_(t)}function Jle(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ho=typeof Object.is=="function"?Object.is:Jle;function bv(e,t){if(ho(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!UA.call(t,i)||!ho(e[i],t[i]))return!1}return!0}function mL(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gL(e,t){var n=mL(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=mL(n)}}function yq(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yq(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vq(){for(var e=window,t=Hw();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Hw(e.document)}return t}function WO(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 ece(e){var t=vq(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&yq(n.ownerDocument.documentElement,n)){if(r!==null&&WO(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=gL(n,a);var o=gL(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var tce=Wl&&"documentMode"in document&&11>=document.documentMode,Df=null,cT=null,My=null,uT=!1;function yL(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;uT||Df==null||Df!==Hw(r)||(r=Df,"selectionStart"in r&&WO(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 4,510 bytes, line 37
37sNode:r.focusNode,focusOffset:r.focusOffset}),My&&bv(My,r)||(My=r,r=Jw(cT,"onSelect"),0<r.length&&(t=new zO("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Df)))}function t0(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Mf={animationend:t0("Animation","AnimationEnd"),animationiteration:t0("Animation","AnimationIteration"),animationstart:t0("Animation","AnimationStart"),transitionend:t0("Transition","TransitionEnd")},lN={},xq={};Wl&&(xq=document.createElement("div").style,"AnimationEvent"in window||(delete Mf.animationend.animation,delete Mf.animationiteration.animation,delete Mf.animationstart.animation),"TransitionEvent"in window||delete Mf.transitionend.transition);function v_(e){if(lN[e])return lN[e];if(!Mf[e])return e;var t=Mf[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in xq)return lN[e]=t[n];return e}var bq=v_("animationend"),wq=v_("animationiteration"),jq=v_("animationstart"),_q=v_("transitionend"),Sq=new Map,vL="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 Au(e,t){Sq.set(e,t),Ch(t,[e])}for(var cN=0;cN<vL.length;cN++){var uN=vL[cN],nce=uN.toLowerCase(),rce=uN[0].toUpperCase()+uN.slice(1);Au(nce,"on"+rce)}Au(bq,"onAnimationEnd");Au(wq,"onAnimationIteration");Au(jq,"onAnimationStart");Au("dblclick","onDoubleClick");Au("focusin","onFocus");Au("focusout","onBlur");Au(_q,"onTransitionEnd");Ip("onMouseEnter",["mouseout","mouseover"]);Ip("onMouseLeave",["mouseout","mouseover"]);Ip("onPointerEnter",["pointerout","pointerover"]);Ip("onPointerLeave",["pointerout","pointerover"]);Ch("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ch("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ch("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ch("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ch("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ch("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xy="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(" "),ice=new Set("cancel close invalid load scroll toggle".split(" ").concat(xy));function xL(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,nle(r,t,void 0,e),e.currentTarget=null}function kq(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&i.isPropagationStopped())break e;xL(i,l,u),a=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&i.isPropagationStopped())break e;xL(i,l,u),a=c}}}if(Gw)throw e=sT,Gw=!1,sT=null,e}function xn(e,t){var n=t[mT];n===void 0&&(n=t[mT]=new Set);var r=e+"__bubble";n.has(r)||(Nq(t,e,2,!1),n.add(r))}function dN(e,t,n){var r=0;t&&(r|=4),Nq(n,e,r,t)}var n0="_reactListening"+Math.random().toString(36).slice(2);function wv(e){if(!e[n0]){e[n0]=!0,IU.forEach(function(n){n!=="selectionchange"&&(ice.has(n)||dN(n,!1,e),dN(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[n0]||(t[n0]=!0,dN("selectionchange",!1,t))}}function Nq(e,t,n,r){switch(cq(t)){case 1:var i=vle;break;case 4:i=xle;break;default:i=LO}n=i.bind(null,t,n,e),i=void 0,!iT||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function hN(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;
vendor: 2,535 bytes, line 37
37if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;l!==null;){if(o=xd(l),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue e}l=l.parentNode}}r=r.return}YU(function(){var u=a,d=RO(n),h=[];e:{var f=Sq.get(e);if(f!==void 0){var p=zO,m=e;switch(e){case"keypress":if(dw(n)===0)break e;case"keydown":case"keyup":p=Rle;break;case"focusin":m="focus",p=sN;break;case"focusout":m="blur",p=sN;break;case"beforeblur":case"afterblur":p=sN;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=oL;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=jle;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=$le;break;case bq:case wq:case jq:p=kle;break;case _q:p=Fle;break;case"scroll":p=ble;break;case"wheel":p=Ble;break;case"copy":case"cut":case"paste":p=Cle;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=cL}var g=(t&4)!==0,y=!g&&e==="scroll",b=g?f!==null?f+"Capture":null:f;g=[];for(var v=u,w;v!==null;){w=v;var _=w.stateNode;if(w.tag===5&&_!==null&&(w=_,b!==null&&(_=mv(v,b),_!=null&&g.push(jv(v,_,w)))),y)break;v=v.return}0<g.length&&(f=new p(f,m,null,n,d),h.push({event:f,listeners:g}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==nT&&(m=n.relatedTarget||n.fromElement)&&(xd(m)||m[Ul]))break e;if((p||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=u,m=m?xd(m):null,m!==null&&(y=Ah(m),m!==y||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=u),p!==m)){if(g=oL,_="onMouseLeave",b="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(g=cL,_="onPointerLeave",b="onPointerEnter",v="pointer"),y=p==null?f:$f(p),w=m==null?f:$f(m),f=new g(_,v+"leave",p,n,d),f.target=y,f.relatedTarget=w,_=null,xd(d)===u&&(g=new g(b,v+"enter",m,n,d),g.target=w,g.relatedTarget=y,_=g),y=_,p&&m)t:{for(g=p,b=m,v=0,w=g;w;w=qh(w))v++;for(w=0,_=b;_;_=qh(_))w++;for(;0<v-w;)g=qh(g),v--;for(;0<w-v;)b=qh(b),w--;for(;v--;){if(g===b||b!==null&&g===b.alternate)break t;g=qh(g),b=qh(b)}g=null}else g=null;p!==null&&bL(h,f,p,g,!1),m!==null&&y!==null&&bL(h,y,m,g,!0)}}
vendor: 5,367 bytes, lines 37-38
37e:{if(f=u?$f(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var j=Gle;else if(hL(f))if(mq)j=Zle;else{j=Qle;var S=Yle}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(j=Xle);if(j&&(j=j(e,u))){pq(h,j,n,d);break e}S&&S(e,f,u),e==="focusout"&&(S=f._wrapperState)&&S.controlled&&f.type==="number"&&XA(f,"number",f.value)}switch(S=u?$f(u):window,e){case"focusin":(hL(S)||S.contentEditable==="true")&&(Df=S,cT=u,My=null);break;case"focusout":My=cT=Df=null;break;case"mousedown":uT=!0;break;case"contextmenu":case"mouseup":case"dragend":uT=!1,yL(h,n,d);break;case"selectionchange":if(tce)break;case"keydown":case"keyup":yL(h,n,d)}var k;if(VO)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else Rf?hq(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(dq&&n.locale!=="ko"&&(Rf||N!=="onCompositionStart"?N==="onCompositionEnd"&&Rf&&(k=uq()):(Kc=d,FO="value"in Kc?Kc.value:Kc.textContent,Rf=!0)),S=Jw(u,N),0<S.length&&(N=new lL(N,e,null,n,d),h.push({event:N,listeners:S}),k?N.data=k:(k=fq(n),k!==null&&(N.data=k)))),(k=Wle?Ule(e,n):qle(e,n))&&(u=Jw(u,"onBeforeInput"),0<u.length&&(d=new lL("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:u}),d.data=k))}kq(h,t)})}function jv(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jw(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=mv(e,n),a!=null&&r.unshift(jv(e,a,i)),a=mv(e,t),a!=null&&r.push(jv(e,a,i))),e=e.return}return r}function qh(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function bL(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,i?(c=mv(n,a),c!=null&&o.unshift(jv(n,c,l))):i||(c=mv(n,a),c!=null&&o.push(jv(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var sce=/\r\n?/g,ace=/\u0000|\uFFFD/g;function wL(e){return(typeof e=="string"?e:""+e).replace(sce,`
38`).replace(ace,"")}function r0(e,t,n){if(t=wL(t),wL(e)!==t&&n)throw Error(ye(425))}function ej(){}var dT=null,hT=null;function fT(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 pT=typeof setTimeout=="function"?setTimeout:void 0,oce=typeof clearTimeout=="function"?clearTimeout:void 0,jL=typeof Promise=="function"?Promise:void 0,lce=typeof queueMicrotask=="function"?queueMicrotask:typeof jL<"u"?function(e){return jL.resolve(null).then(e).catch(cce)}:pT;function cce(e){setTimeout(function(){throw e})}function fN(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),vv(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);vv(t)}function ru(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 _L(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var zm=Math.random().toString(36).slice(2),Mo="__reactFiber$"+zm,_v="__reactProps$"+zm,Ul="__reactContainer$"+zm,mT="__reactEvents$"+zm,uce="__reactListeners$"+zm,dce="__reactHandles$"+zm;function xd(e){var t=e[Mo];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ul]||n[Mo]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_L(e);e!==null;){if(n=e[Mo])return n;e=_L(e)}return t}e=n,n=e.parentNode}return null}function Zx(e){return e=e[Mo]||e[Ul],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function $f(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ye(33))}function x_(e){return e[_v]||null}var gT=[],Lf=-1;function Tu(e){return{current:e}}function kn(e){0>Lf||(e.current=gT[Lf],gT[Lf]=null,Lf--)}function hn(e,t){Lf++,gT[Lf]=e.current,e.current=t}var gu={},wi=Tu(gu),os=Tu(!1),rh=gu;function Rp(e,t){var n=e.type.contextTypes;if(!n)return gu;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ls(e){return e=e.childContextTypes,e!=null}function tj(){kn(os),kn(wi)}function SL(e,t,n){if(wi.current!==gu)throw Error(ye(168));hn(wi,t),hn(os,n)}function Cq(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ye(108,Yoe(e)||"Unknown",i));return zn({},n,r)}function nj(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||gu,rh=wi.current,hn(wi,e),hn(os,os.current),!0}function kL(e,t,n){var r=e.stateNode;if(!r)throw Error(ye(169));n?(e=Cq(e,t,rh),r.__reactInternalMemoizedMergedChildContext=e,kn(os),kn(wi),hn(wi,e)):kn(os),hn(os,n)}var _l=null,b_=!1,pN=!1;function Aq(e){_l===null?_l=[e]:_l.push(e)}function hce(e){b_=!0,Aq(e)}
vendor: 27,911 bytes, lines 38-40
38function Eu(){if(!pN&&_l!==null){pN=!0;var e=0,t=Jt;try{var n=_l;for(Jt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}_l=null,b_=!1}catch(i){throw _l!==null&&(_l=_l.slice(e+1)),JU(DO,Eu),i}finally{Jt=t,pN=!1}}return null}var Ff=[],zf=0,rj=null,ij=0,fa=[],pa=0,ih=null,Al=1,Tl="";function sd(e,t){Ff[zf++]=ij,Ff[zf++]=rj,rj=e,ij=t}function Tq(e,t,n){fa[pa++]=Al,fa[pa++]=Tl,fa[pa++]=ih,ih=e;var r=Al;e=Tl;var i=32-so(r)-1;r&=~(1<<i),n+=1;var a=32-so(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Al=1<<32-so(t)+i|n<<i|r,Tl=a+e}else Al=1<<a|n<<i|r,Tl=e}function UO(e){e.return!==null&&(sd(e,1),Tq(e,1,0))}function qO(e){for(;e===rj;)rj=Ff[--zf],Ff[zf]=null,ij=Ff[--zf],Ff[zf]=null;for(;e===ih;)ih=fa[--pa],fa[pa]=null,Tl=fa[--pa],fa[pa]=null,Al=fa[--pa],fa[pa]=null}var $s=null,Ms=null,Pn=!1,Ja=null;function Eq(e,t){var n=ya(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function NL(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,$s=e,Ms=ru(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,$s=e,Ms=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ih!==null?{id:Al,overflow:Tl}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ya(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,$s=e,Ms=null,!0):!1;default:return!1}}function yT(e){return(e.mode&1)!==0&&(e.flags&128)===0}function vT(e){if(Pn){var t=Ms;if(t){var n=t;if(!NL(e,t)){if(yT(e))throw Error(ye(418));t=ru(n.nextSibling);var r=$s;t&&NL(e,t)?Eq(r,n):(e.flags=e.flags&-4097|2,Pn=!1,$s=e)}}else{if(yT(e))throw Error(ye(418));e.flags=e.flags&-4097|2,Pn=!1,$s=e}}}function CL(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;$s=e}function i0(e){if(e!==$s)return!1;if(!Pn)return CL(e),Pn=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!fT(e.type,e.memoizedProps)),t&&(t=Ms)){if(yT(e))throw Pq(),Error(ye(418));for(;t;)Eq(e,t),t=ru(t.nextSibling)}if(CL(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 n=e.data;if(n==="/$"){if(t===0){Ms=ru(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ms=null}}else Ms=$s?ru(e.stateNode.nextSibling):null;return!0}function Pq(){for(var e=Ms;e;)e=ru(e.nextSibling)}function Dp(){Ms=$s=null,Pn=!1}function HO(e){Ja===null?Ja=[e]:Ja.push(e)}var fce=ec.ReactCurrentBatchConfig;function Dg(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ye(309));var r=n.stateNode}if(!r)throw Error(ye(147,e));var i=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=i.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(ye(284));if(!n._owner)throw Error(ye(290,e))}return e}function s0(e,t){throw e=Object.prototype.toString.call(t),Error(ye(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function AL(e){var t=e._init;return t(e._payload)}function Oq(e){function t(b,v){if(e){var w=b.deletions;w===null?(b.deletions=[v],b.flags|=16):w.push(v)}}function n(b,v){if(!e)return null;for(;v!==null;)t(b,v),v=v.sibling;return null}function r(b,v){for(b=new Map;v!==null;)v.key!==null?b.set(v.key,v):b.set(v.index,v),v=v.sibling;return b}function i(b,v){return b=ou(b,v),b.index=0,b.sibling=null,b}function a(b,v,w){return b.index=w,e?(w=b.alternate,w!==null?(w=w.index,w<v?(b.flags|=2,v):w):(b.flags|=2,v)):(b.flags|=1048576,v)}function o(b){return e&&b.alternate===null&&(b.flags|=2),b}function l(b,v,w,_){return v===null||v.tag!==6?(v=wN(w,b.mode,_),v.return=b,v):(v=i(v,w),v.return=b,v)}function c(b,v,w,_){var j=w.type;return j===If?d(b,v,w.props.children,_,w.key):v!==null&&(v.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Cc&&AL(j)===v.type)?(_=i(v,w.props),_.ref=Dg(b,v,w),_.return=b,_):(_=vw(w.type,w.key,w.props,null,b.mode,_),_.ref=Dg(b,v,w),_.return=b,_)}function u(b,v,w,_){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=jN(w,b.mode,_),v.return=b,v):(v=i(v,w.children||[]),v.return=b,v)}function d(b,v,w,_,j){return v===null||v.tag!==7?(v=Vd(w,b.mode,_,j),v.return=b,v):(v=i(v,w),v.return=b,v)}function h(b,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return v=wN(""+v,b.mode,w),v.return=b,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Gb:return w=vw(v.type,v.key,v.props,null,b.mode,w),w.ref=Dg(b,null,v),w.return=b,w;case Of:return v=jN(v,b.mode,w),v.return=b,v;case Cc:var _=v._init;return h(b,_(v._payload),w)}if(yy(v)||Eg(v))return v=Vd(v,b.mode,w,null),v.return=b,v;s0(b,v)}return null}function f(b,v,w,_){var j=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return j!==null?null:l(b,v,""+w,_);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Gb:return w.key===j?c(b,v,w,_):null;case Of:return w.key===j?u(b,v,w,_):null;case Cc:return j=w._init,f(b,v,j(w._payload),_)}if(yy(w)||Eg(w))return j!==null?null:d(b,v,w,_,null);s0(b,w)}return null}function p(b,v,w,_,j){if(typeof _=="string"&&_!==""||typeof _=="number")return b=b.get(w)||null,l(v,b,""+_,j);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Gb:return b=b.get(_.key===null?w:_.key)||null,c(v,b,_,j);case Of:return b=b.get(_.key===null?w:_.key)||null,u(v,b,_,j);case Cc:var S=_._init;return p(b,v,w,S(_._payload),j)}if(yy(_)||Eg(_))return b=b.get(w)||null,d(v,b,_,j,null);s0(v,_)}return null}function m(b,v,w,_){for(var j=null,S=null,k=v,N=v=0,T=null;k!==null&&N<w.length;N++){k.index>N?(T=k,k=null):T=k.sibling;var C=f(b,k,w[N],_);if(C===null){k===null&&(k=T);break}e&&k&&C.alternate===null&&t(b,k),v=a(C,v,N),S===null?j=C:S.sibling=C,S=C,k=T}if(N===w.length)return n(b,k),Pn&&sd(b,N),j;if(k===null){for(;N<w.length;N++)k=h(b,w[N],_),k!==null&&(v=a(k,v,N),S===null?j=k:S.sibling=k,S=k);return Pn&&sd(b,N),j}for(k=r(b,k);N<w.length;N++)T=p(k,b,N,w[N],_),T!==null&&(e&&T.alternate!==null&&k.delete(T.key===null?N:T.key),v=a(T,v,N),S===null?j=T:S.sibling=T,S=T);return e&&k.forEach(function(A){return t(b,A)}),Pn&&sd(b,N),j}function g(b,v,w,_){var j=Eg(w);if(typeof j!="function")throw Error(ye(150));if(w=j.call(w),w==null)throw Error(ye(151));for(var S=j=null,k=v,N=v=0,T=null,C=w.next();k!==null&&!C.done;N++,C=w.next()){k.index>N?(T=k,k=null):T=k.sibling;var A=f(b,k,C.value,_);if(A===null){k===null&&(k=T);break}e&&k&&A.alternate===null&&t(b,k),v=a(A,v,N),S===null?j=A:S.sibling=A,S=A,k=T}if(C.done)return n(b,k),Pn&&sd(b,N),j;if(k===null){for(;!C.done;N++,C=w.next())C=h(b,C.value,_),C!==null&&(v=a(C,v,N),S===null?j=C:S.sibling=C,S=C);return Pn&&sd(b,N),j}for(k=r(b,k);!C.done;N++,C=w.next())C=p(k,b,N,C.value,_),C!==null&&(e&&C.alternate!==null&&k.delete(C.key===null?N:C.key),v=a(C,v,N),S===null?j=C:S.sibling=C,S=C);return e&&k.forEach(function(O){return t(b,O)}),Pn&&sd(b,N),j}function y(b,v,w,_){if(typeof w=="object"&&w!==null&&w.type===If&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Gb:e:{for(var j=w.key,S=v;S!==null;){if(S.key===j){if(j=w.type,j===If){if(S.tag===7){n(b,S.sibling),v=i(S,w.props.children),v.return=b,b=v;break e}}else if(S.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Cc&&AL(j)===S.type){n(b,S.sibling),v=i(S,w.props),v.ref=Dg(b,S,w),v.return=b,b=v;break e}n(b,S);break}else t(b,S);S=S.sibling}w.type===If?(v=Vd(w.props.children,b.mode,_,w.key),v.return=b,b=v):(_=vw(w.type,w.key,w.props,null,b.mode,_),_.ref=Dg(b,v,w),_.return=b,b=_)}return o(b);case Of:e:{for(S=w.key;v!==null;){if(v.key===S)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(b,v.sibling),v=i(v,w.children||[]),v.return=b,b=v;break e}else{n(b,v);break}else t(b,v);v=v.sibling}v=jN(w,b.mode,_),v.return=b,b=v}return o(b);case Cc:return S=w._init,y(b,v,S(w._payload),_)}if(yy(w))return m(b,v,w,_);if(Eg(w))return g(b,v,w,_);s0(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(b,v.sibling),v=i(v,w),v.return=b,b=v):(n(b,v),v=wN(w,b.mode,_),v.return=b,b=v),o(b)):n(b,v)}return y}var Mp=Oq(!0),Iq=Oq(!1),sj=Tu(null),aj=null,Bf=null,KO=null;function GO(){KO=Bf=aj=null}function YO(e){var t=sj.current;kn(sj),e._currentValue=t}function xT(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function sp(e,t){aj=e,KO=Bf=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(rs=!0),e.firstContext=null)}function Sa(e){var t=e._currentValue;if(KO!==e)if(e={context:e,memoizedValue:t,next:null},Bf===null){if(aj===null)throw Error(ye(308));Bf=e,aj.dependencies={lanes:0,firstContext:e}}else Bf=Bf.next=e;return t}var bd=null;function QO(e){bd===null?bd=[e]:bd.push(e)}function Rq(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,QO(t)):(n.next=i.next,i.next=n),t.interleaved=n,ql(e,r)}function ql(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ac=!1;function XO(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Dq(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 Il(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function iu(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Lt&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,ql(e,n)}return i=r.interleaved,i===null?(t.next=t,QO(r)):(t.next=i.next,i.next=t),r.interleaved=t,ql(e,n)}function hw(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,MO(e,n)}}function TL(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function oj(e,t,n,r){var i=e.updateQueue;Ac=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var h=i.baseState;o=0,d=u=c=null,l=a;do{var f=l.lane,p=l.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,g=l;switch(f=t,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){h=m.call(p,h,f);break e}h=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m=="function"?m.call(p,h,f):m,f==null)break e;h=zn({},h,f);break e;case 2:Ac=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=h):d=d.next=p,o|=f;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;f=l,l=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(d===null&&(c=h),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);ah|=o,e.lanes=o,e.memoizedState=h}}function EL(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(ye(191,i));i.call(r)}}}var Jx={},qo=Tu(Jx),Sv=Tu(Jx),kv=Tu(Jx);function wd(e){if(e===Jx)throw Error(ye(174));return e}function ZO(e,t){switch(hn(kv,t),hn(Sv,e),hn(qo,Jx),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:JA(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=JA(t,e)}kn(qo),hn(qo,t)}function $p(){kn(qo),kn(Sv),kn(kv)}function Mq(e){wd(kv.current);var t=wd(qo.current),n=JA(t,e.type);t!==n&&(hn(Sv,e),hn(qo,n))}function JO(e){Sv.current===e&&(kn(qo),kn(Sv))}var Mn=Tu(0);function lj(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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 mN=[];function eI(){for(var e=0;e<mN.length;e++)mN[e]._workInProgressVersionPrimary=null;mN.length=0}var fw=ec.ReactCurrentDispatcher,gN=ec.ReactCurrentBatchConfig,sh=0,Fn=null,Tr=null,qr=null,cj=!1,$y=!1,Nv=0,pce=0;function ci(){throw Error(ye(321))}function tI(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ho(e[n],t[n]))return!1;return!0}function nI(e,t,n,r,i,a){if(sh=a,Fn=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,fw.current=e===null||e.memoizedState===null?vce:xce,e=n(r,i),$y){a=0;do{if($y=!1,Nv=0,25<=a)throw Error(ye(301));a+=1,qr=Tr=null,t.updateQueue=null,fw.current=bce,e=n(r,i)}while($y)}if(fw.current=uj,t=Tr!==null&&Tr.next!==null,sh=0,qr=Tr=Fn=null,cj=!1,t)throw Error(ye(300));return e}function rI(){var e=Nv!==0;return Nv=0,e}function To(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qr===null?Fn.memoizedState=qr=e:qr=qr.next=e,qr}function ka(){if(Tr===null){var e=Fn.alternate;e=e!==null?e.memoizedState:null}else e=Tr.next;var t=qr===null?Fn.memoizedState:qr.next;if(t!==null)qr=t,Tr=e;else{if(e===null)throw Error(ye(310));Tr=e,e={memoizedState:Tr.memoizedState,baseState:Tr.baseState,baseQueue:Tr.baseQueue,queue:Tr.queue,next:null},qr===null?Fn.memoizedState=qr=e:qr=qr.next=e}return qr}function Cv(e,t){return typeof t=="function"?t(e):t}function yN(e){var t=ka(),n=t.queue;if(n===null)throw Error(ye(311));n.lastRenderedReducer=e;var r=Tr,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}r.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,r=r.baseState;var l=o=null,c=null,u=a;do{var d=u.lane;if((sh&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=h,o=r):c=c.next=h,Fn.lanes|=d,ah|=d}u=u.next}while(u!==null&&u!==a);c===null?o=r:c.next=l,ho(r,t.memoizedState)||(rs=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do a=i.lane,Fn.lanes|=a,ah|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function vN(e){var t=ka(),n=t.queue;if(n===null)throw Error(ye(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);ho(a,t.memoizedState)||(rs=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function $q(){}function Lq(e,t){var n=Fn,r=ka(),i=t(),a=!ho(r.memoizedState,i);if(a&&(r.memoizedState=i,rs=!0),r=r.queue,iI(Bq.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||qr!==null&&qr.memoizedState.tag&1){if(n.flags|=2048,Av(9,zq.bind(null,n,r,i,t),void 0,null),Gr===null)throw Error(ye(349));sh&30||Fq(n,t,i)}return i}function Fq(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Fn.updateQueue,t===null?(t={lastEffect:null,stores:null},Fn.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zq(e,t,n,r){t.value=n,t.getSnapshot=r,Vq(t)&&Wq(e)}function Bq(e,t,n){return n(function(){Vq(t)&&Wq(e)})}function Vq(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ho(e,n)}catch{return!0}}function Wq(e){var t=ql(e,1);t!==null&&ao(t,e,1,-1)}function PL(e){var t=To();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Cv,lastRenderedState:e},t.queue=e,e=e.dispatch=yce.bind(null,Fn,e),[t.memoizedState,e]}function Av(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Fn.updateQueue,t===null?(t={lastEffect:null,stores:null},Fn.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Uq(){return ka().memoizedState}function pw(e,t,n,r){var i=To();Fn.flags|=e,i.memoizedState=Av(1|t,n,void 0,r===void 0?null:r)}function w_(e,t,n,r){var i=ka();r=r===void 0?null:r;var a=void 0;if(Tr!==null){var o=Tr.memoizedState;if(a=o.destroy,r!==null&&tI(r,o.deps)){i.memoizedState=Av(t,n,a,r);return}}Fn.flags|=e,i.memoizedState=Av(1|t,n,a,r)}function OL(e,t){return pw(8390656,8,e,t)}function iI(e,t){return w_(2048,8,e,t)}function qq(e,t){return w_(4,2,e,t)}function Hq(e,t){return w_(4,4,e,t)}function Kq(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 Gq(e,t,n){return n=n!=null?n.concat([e]):null,w_(4,4,Kq.bind(null,t,e),n)}function sI(){}function Yq(e,t){var n=ka();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&tI(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Qq(e,t){var n=ka();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&tI(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Xq(e,t,n){return sh&21?(ho(n,t)||(n=nq(),Fn.lanes|=n,ah|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,rs=!0),e.memoizedState=n)}function mce(e,t){var n=Jt;Jt=n!==0&&4>n?n:4,e(!0);var r=gN.transition;gN.transition={};try{e(!1),t()}finally{Jt=n,gN.transition=r}}function Zq(){return ka().memoizedState}function gce(e,t,n){var r=au(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Jq(e))e9(t,n);else if(n=Rq(e,t,n,r),n!==null){var i=Fi();ao(n,e,r,i),t9(n,t,r)}}function yce(e,t,n){var r=au(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jq(e))e9(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(i.hasEagerState=!0,i.eagerState=l,ho(l,o)){var c=t.interleaved;c===null?(i.next=i,QO(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=Rq(e,t,i,r),n!==null&&(i=Fi(),ao(n,e,r,i),t9(n,t,r))}}function Jq(e){var t=e.alternate;return e===Fn||t!==null&&t===Fn}function e9(e,t){$y=cj=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function t9(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,MO(e,n)}}var uj={readContext:Sa,useCallback:ci,useContext:ci,useEffect:ci,useImperativeHandle:ci,useInsertionEffect:ci,useLayoutEffect:ci,useMemo:ci,useReducer:ci,useRef:ci,useState:ci,useDebugValue:ci,useDeferredValue:ci,useTransition:ci,useMutableSource:ci,useSyncExternalStore:ci,useId:ci,unstable_isNewReconciler:!1},vce={readContext:Sa,useCallback:function(e,t){return To().memoizedState=[e,t===void 0?null:t],e},useContext:Sa,useEffect:OL,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,pw(4194308,4,Kq.bind(null,t,e),n)},useLayoutEffect:function(e,t){return pw(4194308,4,e,t)},useInsertionEffect:function(e,t){return pw(4,2,e,t)},useMemo:function(e,t){var n=To();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=To();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=gce.bind(null,Fn,e),[r.memoizedState,e]},useRef:function(e){var t=To();return e={current:e},t.memoizedState=e},useState:PL,useDebugValue:sI,useDeferredValue:function(e){return To().memoizedState=e},useTransition:function(){var e=PL(!1),t=e[0];return e=mce.bind(null,e[1]),To().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Fn,i=To();if(Pn){if(n===void 0)throw Error(ye(407));n=n()}else{if(n=t(),Gr===null)throw Error(ye(349));sh&30||Fq(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,OL(Bq.bind(null,r,a,e),[e]),r.flags|=2048,Av(9,zq.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=To(),t=Gr.identifierPrefix;if(Pn){var n=Tl,r=Al;n=(r&~(1<<32-so(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Nv++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=pce++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},xce={readContext:Sa,useCallback:Yq,useContext:Sa,useEffect:iI,useImperativeHandle:Gq,useInsertionEffect:qq,useLayoutEffect:Hq,useMemo:Qq,useReducer:yN,useRef:Uq,useState:function(){return yN(Cv)},useDebugValue:sI,useDeferredValue:function(e){var t=ka();return Xq(t,Tr.memoizedState,e)},useTransition:function(){var e=yN(Cv)[0],t=ka().memoizedState;return[e,t]},useMutableSource:$q,useSyncExternalStore:Lq,useId:Zq,unstable_isNewReconciler:!1},bce={readContext:Sa,useCallback:Yq,useContext:Sa,useEffect:iI,useImperativeHandle:Gq,useInsertionEffect:qq,useLayoutEffect:Hq,useMemo:Qq,useReducer:vN,useRef:Uq,useState:function(){return vN(Cv)},useDebugValue:sI,useDeferredValue:function(e){var t=ka();return Tr===null?t.memoizedState=e:Xq(t,Tr.memoizedState,e)},useTransition:function(){var e=vN(Cv)[0],t=ka().memoizedState;return[e,t]},useMutableSource:$q,useSyncExternalStore:Lq,useId:Zq,unstable_isNewReconciler:!1};function qa(e,t){if(e&&e.defaultProps){t=zn({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function bT(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:zn({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var j_={isMounted:function(e){return(e=e._reactInternals)?Ah(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Fi(),i=au(e),a=Il(r,i);a.payload=t,n!=null&&(a.callback=n),t=iu(e,a,i),t!==null&&(ao(t,e,i,r),hw(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Fi(),i=au(e),a=Il(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=iu(e,a,i),t!==null&&(ao(t,e,i,r),hw(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Fi(),r=au(e),i=Il(n,r);i.tag=2,t!=null&&(i.callback=t),t=iu(e,i,r),t!==null&&(ao(t,e,r,n),hw(t,e,r))}};function IL(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!bv(n,r)||!bv(i,a):!0}function n9(e,t,n){var r=!1,i=gu,a=t.contextType;return typeof a=="object"&&a!==null?a=Sa(a):(i=ls(t)?rh:wi.current,r=t.contextTypes,a=(r=r!=null)?Rp(e,i):gu),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=j_,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function RL(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&j_.enqueueReplaceState(t,t.state,null)}function wT(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},XO(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Sa(a):(a=ls(t)?rh:wi.current,i.context=Rp(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(bT(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&j_.enqueueReplaceState(i,i.state,null),oj(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Lp(e,t){try{var n="",r=t;do n+=Goe(r),r=r.return;while(r);var i=n}catch(a){i=`
39Error generating stack: `+a.message+`
40`+a.stack}return{value:e,source:t,stack:i,digest:null}}function xN(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function jT(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var wce=typeof WeakMap=="function"?WeakMap:Map;function r9(e,t,n){n=Il(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){hj||(hj=!0,OT=r),jT(e,t)},n}function i9(e,t,n){n=Il(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){jT(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){jT(e,t),typeof r!="function"&&(su===null?su=new Set([this]):su.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function DL(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new wce;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Dce.bind(null,e,t,n),t.then(e,e))}function ML(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 $L(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Il(-1,1),t.tag=2,iu(n,t,1))),n.lanes|=1),e)}var jce=ec.ReactCurrentOwner,rs=!1;function Ti(e,t,n,r){t.child=e===null?Iq(t,null,n,r):Mp(t,e.child,n,r)}function LL(e,t,n,r,i){n=n.render;var a=t.ref;return sp(t,i),r=nI(e,t,n,r,a,i),n=rI(),e!==null&&!rs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Hl(e,t,i)):(Pn&&n&&UO(t),t.flags|=1,Ti(e,t,r,i),t.child)}function FL(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!fI(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,s9(e,t,a,r,i)):(e=vw(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:bv,n(o,r)&&e.ref===t.ref)return Hl(e,t,i)}return t.flags|=1,e=ou(a,r),e.ref=t.ref,e.return=t,t.child=e}function s9(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(bv(a,r)&&e.ref===t.ref)if(rs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(rs=!0);else return t.lanes=e.lanes,Hl(e,t,i)}return _T(e,t,n,r,i)}function a9(e,t,n){var r=t.pendingProps,i=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},hn(Wf,Ps),Ps|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,hn(Wf,Ps),Ps|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,hn(Wf,Ps),Ps|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,hn(Wf,Ps),Ps|=r;return Ti(e,t,i,n),t.child}function o9(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}
vendor: 8,186 bytes, line 40
40function _T(e,t,n,r,i){var a=ls(n)?rh:wi.current;return a=Rp(t,a),sp(t,i),n=nI(e,t,n,r,a,i),r=rI(),e!==null&&!rs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Hl(e,t,i)):(Pn&&r&&UO(t),t.flags|=1,Ti(e,t,n,i),t.child)}function zL(e,t,n,r,i){if(ls(n)){var a=!0;nj(t)}else a=!1;if(sp(t,i),t.stateNode===null)mw(e,t),n9(t,n,r),wT(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Sa(u):(u=ls(n)?rh:wi.current,u=Rp(t,u));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==u)&&RL(t,o,r,u),Ac=!1;var f=t.memoizedState;o.state=f,oj(t,r,o,i),c=t.memoizedState,l!==r||f!==c||os.current||Ac?(typeof d=="function"&&(bT(t,n,d,r),c=t.memoizedState),(l=Ac||IL(t,n,l,r,f,c,u))?(h||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=r,t.memoizedState=c),o.props=r,o.state=c,o.context=u,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Dq(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:qa(t.type,l),o.props=u,h=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Sa(c):(c=ls(n)?rh:wi.current,c=Rp(t,c));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==h||f!==c)&&RL(t,o,r,c),Ac=!1,f=t.memoizedState,o.state=f,oj(t,r,o,i);var m=t.memoizedState;l!==h||f!==m||os.current||Ac?(typeof p=="function"&&(bT(t,n,p,r),m=t.memoizedState),(u=Ac||IL(t,n,u,r,f,m,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return ST(e,t,n,r,a,i)}function ST(e,t,n,r,i,a){o9(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&kL(t,n,!1),Hl(e,t,a);r=t.stateNode,jce.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Mp(t,e.child,null,a),t.child=Mp(t,null,l,a)):Ti(e,t,l,a),t.memoizedState=r.state,i&&kL(t,n,!0),t.child}function l9(e){var t=e.stateNode;t.pendingContext?SL(e,t.pendingContext,t.pendingContext!==t.context):t.context&&SL(e,t.context,!1),ZO(e,t.containerInfo)}function BL(e,t,n,r,i){return Dp(),HO(i),t.flags|=256,Ti(e,t,n,r),t.child}var kT={dehydrated:null,treeContext:null,retryLane:0};function NT(e){return{baseLanes:e,cachePool:null,transitions:null}}function c9(e,t,n){var r=t.pendingProps,i=Mn.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),hn(Mn,i&1),e===null)return vT(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=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:"hidden",children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=k_(o,r,0,null),e=Vd(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=NT(n),t.memoizedState=kT,e):aI(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return _ce(e,t,o,r,l,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,l=i.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=ou(i,c),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=ou(l,a):(a=Vd(a,o,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?NT(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=kT,r}return a=e.child,e=a.sibling,r=ou(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function aI(e,t){return t=k_({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function a0(e,t,n,r){return r!==null&&HO(r),Mp(t,e.child,null,n),e=aI(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _ce(e,t,n,r,i,a,o){if(n)return t.flags&256?(t.flags&=-257,r=xN(Error(ye(422))),a0(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=k_({mode:"visible",children:r.children},i,0,null),a=Vd(a,i,o,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&Mp(t,e.child,null,o),t.child.memoizedState=NT(o),t.memoizedState=kT,a);if(!(t.mode&1))return a0(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,a=Error(ye(419)),r=xN(a,r,void 0),a0(e,t,o,r)}if(l=(o&e.childLanes)!==0,rs||l){if(r=Gr,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,ql(e,i),ao(r,e,i,-1))}return hI(),r=xN(Error(ye(421))),a0(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Mce.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Ms=ru(i.nextSibling),$s=t,Pn=!0,Ja=null,e!==null&&(fa[pa++]=Al,fa[pa++]=Tl,fa[pa++]=ih,Al=e.id,Tl=e.overflow,ih=t),t=aI(t,r.children),t.flags|=4096,t)}function VL(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),xT(e.return,t,n)}function bN(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function u9(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Ti(e,t,r.children,n),r=Mn.current,r&2)r=r&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&&VL(e,n,t);else if(e.tag===19)VL(e,n,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}r&=1}if(hn(Mn,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&lj(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),bN(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&lj(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}bN(t,!0,n,null,a);break;case"together":bN(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function mw(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Hl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ah|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ye(153));
vendor: 5,454 bytes, line 40
40if(t.child!==null){for(e=t.child,n=ou(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ou(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Sce(e,t,n){switch(t.tag){case 3:l9(t),Dp();break;case 5:Mq(t);break;case 1:ls(t.type)&&nj(t);break;case 4:ZO(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;hn(sj,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(hn(Mn,Mn.current&1),t.flags|=128,null):n&t.child.childLanes?c9(e,t,n):(hn(Mn,Mn.current&1),e=Hl(e,t,n),e!==null?e.sibling:null);hn(Mn,Mn.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return u9(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),hn(Mn,Mn.current),r)break;return null;case 22:case 23:return t.lanes=0,a9(e,t,n)}return Hl(e,t,n)}var d9,CT,h9,f9;d9=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};CT=function(){};h9=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,wd(qo.current);var a=null;switch(n){case"input":i=YA(e,i),r=YA(e,r),a=[];break;case"select":i=zn({},i,{value:void 0}),r=zn({},r,{value:void 0}),a=[];break;case"textarea":i=ZA(e,i),r=ZA(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ej)}eT(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(fv.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var c=r[u];if(l=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(fv.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&xn("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};f9=function(e,t,n,r){n!==r&&(t.flags|=4)};function Mg(e,t){if(!Pn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ui(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function kce(e,t,n){var r=t.pendingProps;switch(qO(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ui(t),null;case 1:return ls(t.type)&&tj(),ui(t),null;case 3:return r=t.stateNode,$p(),kn(os),kn(wi),eI(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(i0(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ja!==null&&(DT(Ja),Ja=null))),CT(e,t),ui(t),null;case 5:JO(t);var i=wd(kv.current);if(n=t.type,e!==null&&t.stateNode!=null)h9(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ye(166));return ui(t),null}if(e=wd(qo.current),i0(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Mo]=t,r[_v]=a,e=(t.mode&1)!==0,n){case"dialog":xn("cancel",r),xn("close",r);break;case"iframe":case"object":case"embed":xn("load",r);break;case"video":case"audio":for(i=0;i<xy.length;i++)xn(xy[i],r);break;case"source":xn("error",r);break;case"img":case"image":case"link":xn("error",r),xn("load",r);break;case"details":xn("toggle",r);break;case"input":X$(r,a),xn("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},xn("invalid",r);break;case"textarea":J$(r,a),xn("invalid",r)}eT(n,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?r.textContent!==l&&(a.suppressHydrationWarning!==!0&&r0(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&r0(r.textContent,l,e),i=["children",""+l]):fv.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&xn("scroll",r)}switch(n){case"input":Yb(r),Z$(r,a,!0);break;case"textarea":Yb(r),eL(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=ej)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=BU(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>
40",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Mo]=t,e[_v]=r,d9(e,t,!1,!1),t.stateNode=e;e:{switch(o=tT(n,r),n){case"dialog":xn("cancel",e),xn("close",e),i=r;break;case"iframe":case"object":case"embed":xn("load",e),i=r;break;case"video":case"audio":for(i=0;i<xy.length;i++)xn(xy[i],e);i=r;break;case"source":xn("error",e),i=r;break;case"img":case"image":case"link":xn("error",e),xn("load",e),i=r;break;case"details":xn("toggle",e),i=r;break;case"input":X$(e,r),i=YA(e,r),xn("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=zn({},r,{value:void 0}),xn("invalid",e);break;case"textarea":J$(e,r),i=ZA(e,r),xn("invalid",e);break;default:i=r}eT(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?UU(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&VU(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&pv(e,c):typeof c=="number"&&pv(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(fv.hasOwnProperty(a)?c!=null&&a==="onScroll"&&xn("scroll",e):c!=null&&EO(e,a,c,o))}switch(n){case"input":Yb(e),Z$(e,r,!1);break;case"textarea":Yb(e),eL(e);break;case"option":r.value!=null&&e.setAttribute("value",""+mu(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?tp(e,!!r.multiple,a,!1):r.defaultValue!=null&&tp(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=ej)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ui(t),null;case 6:if(e&&t.stateNode!=null)f9(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ye(166));if(n=wd(kv.current),wd(qo.current),i0(t)){if(r=t.stateNode,n=t.memoizedProps,r[Mo]=t,(a=r.nodeValue!==n)&&(e=$s,e!==null))switch(e.tag){case 3:r0(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&r0(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Mo]=t,t.stateNode=r}return ui(t),null;case 13:if(kn(Mn),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Pn&&Ms!==null&&t.mode&1&&!(t.flags&128))Pq(),Dp(),t.flags|=98560,a=!1;else if(a=i0(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(ye(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(ye(317));a[Mo]=t}else Dp(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ui(t),a=!1}else Ja!==null&&(DT(Ja),Ja=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Mn.current&1?Rr===0&&(Rr=3):hI())),t.updateQueue!==null&&(t.flags|=4),ui(t),null);case 4:return $p(),CT(e,t),e===null&&wv(t.stateNode.containerInfo),ui(t),null;case 10:return YO(t.type._context),ui(t),null;case 17:return ls(t.type)&&tj(),ui(t),null;case 19:if(kn(Mn),a=t.memoizedState,a===null)return ui(t),null;if(r=(t.flags&128)!==0,o=a.rendering,o===null)if(r)Mg(a,!1);else{if(Rr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=lj(e),o!==null){for(t.flags|=128,Mg(a,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return hn(Mn,Mn.current&1|2),t.child}e=e.sibling}a.tail!==null&&Zn()>Fp&&(t.flags|=128,r=!0,Mg(a,!1),t.lanes=4194304)}else{if(!r)if(e=lj(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Mg(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Pn)return ui(t),null}else 2*Zn()-a.renderingStartTime>Fp&&n!==1073741824&&(t.flags|=128,r=!0,Mg(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Zn(),t.sibling=null,n=Mn.current,hn(Mn,r?n&1|2:n&1),t):(ui(t),null);case 22:case 23:return dI(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ps&1073741824&&(ui(t),t.subtreeFlags&6&&(t.flags|=8192)):ui(t),null;case 24:return null;case 25:return null}throw Error(ye(156,t.tag))}function Nce(e,t){switch(qO(t),t.tag){case 1:return ls(t.type)&&tj(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;
vendor: 23,268 bytes, line 40
40case 3:return $p(),kn(os),kn(wi),eI(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return JO(t),null;case 13:if(kn(Mn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ye(340));Dp()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return kn(Mn),null;case 4:return $p(),null;case 10:return YO(t.type._context),null;case 22:case 23:return dI(),null;case 24:return null;default:return null}}var o0=!1,mi=!1,Cce=typeof WeakSet=="function"?WeakSet:Set,De=null;function Vf(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Hn(e,t,r)}else n.current=null}function AT(e,t,n){try{n()}catch(r){Hn(e,t,r)}}var WL=!1;function Ace(e,t){if(dT=Xw,e=vq(),WO(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,h=e,f=null;t:for(;;){for(var p;h!==n||i!==0&&h.nodeType!==3||(l=o+i),h!==a||r!==0&&h.nodeType!==3||(c=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===e)break t;if(f===n&&++u===i&&(l=o),f===a&&++d===r&&(c=o),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(hT={focusedElem:e,selectionRange:n},Xw=!1,De=t;De!==null;)if(t=De,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,De=e;else for(;De!==null;){t=De;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,y=m.memoizedState,b=t.stateNode,v=b.getSnapshotBeforeUpdate(t.elementType===t.type?g:qa(t.type,g),y);b.__reactInternalSnapshotBeforeUpdate=v}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(_){Hn(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,De=e;break}De=t.return}return m=WL,WL=!1,m}function Ly(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&AT(t,n,a)}i=i.next}while(i!==r)}}function __(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function TT(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function p9(e){var t=e.alternate;t!==null&&(e.alternate=null,p9(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Mo],delete t[_v],delete t[mT],delete t[uce],delete t[dce])),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 m9(e){return e.tag===5||e.tag===3||e.tag===4}function UL(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||m9(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 ET(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ej));else if(r!==4&&(e=e.child,e!==null))for(ET(e,t,n),e=e.sibling;e!==null;)ET(e,t,n),e=e.sibling}function PT(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(PT(e,t,n),e=e.sibling;e!==null;)PT(e,t,n),e=e.sibling}var ei=null,Ya=!1;function pc(e,t,n){for(n=n.child;n!==null;)g9(e,t,n),n=n.sibling}function g9(e,t,n){if(Uo&&typeof Uo.onCommitFiberUnmount=="function")try{Uo.onCommitFiberUnmount(m_,n)}catch{}switch(n.tag){case 5:mi||Vf(n,t);case 6:var r=ei,i=Ya;ei=null,pc(e,t,n),ei=r,Ya=i,ei!==null&&(Ya?(e=ei,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ei.removeChild(n.stateNode));break;case 18:ei!==null&&(Ya?(e=ei,n=n.stateNode,e.nodeType===8?fN(e.parentNode,n):e.nodeType===1&&fN(e,n),vv(e)):fN(ei,n.stateNode));break;case 4:r=ei,i=Ya,ei=n.stateNode.containerInfo,Ya=!0,pc(e,t,n),ei=r,Ya=i;break;case 0:case 11:case 14:case 15:if(!mi&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&AT(n,t,o),i=i.next}while(i!==r)}pc(e,t,n);break;case 1:if(!mi&&(Vf(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Hn(n,t,l)}pc(e,t,n);break;case 21:pc(e,t,n);break;case 22:n.mode&1?(mi=(r=mi)||n.memoizedState!==null,pc(e,t,n),mi=r):pc(e,t,n);break;default:pc(e,t,n)}}function qL(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Cce),t.forEach(function(r){var i=$ce.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ma(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:ei=l.stateNode,Ya=!1;break e;case 3:ei=l.stateNode.containerInfo,Ya=!0;break e;case 4:ei=l.stateNode.containerInfo,Ya=!0;break e}l=l.return}if(ei===null)throw Error(ye(160));g9(a,o,i),ei=null,Ya=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){Hn(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)y9(t,e),t=t.sibling}function y9(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ma(t,e),Co(e),r&4){try{Ly(3,e,e.return),__(3,e)}catch(g){Hn(e,e.return,g)}try{Ly(5,e,e.return)}catch(g){Hn(e,e.return,g)}}break;case 1:Ma(t,e),Co(e),r&512&&n!==null&&Vf(n,n.return);break;case 5:if(Ma(t,e),Co(e),r&512&&n!==null&&Vf(n,n.return),e.flags&32){var i=e.stateNode;try{pv(i,"")}catch(g){Hn(e,e.return,g)}}if(r&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&FU(i,a),tT(l,o);var u=tT(l,a);for(o=0;o<c.length;o+=2){var d=c[o],h=c[o+1];d==="style"?UU(i,h):d==="dangerouslySetInnerHTML"?VU(i,h):d==="children"?pv(i,h):EO(i,d,h,u)}switch(l){case"input":QA(i,a);break;case"textarea":zU(i,a);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?tp(i,!!a.multiple,p,!1):f!==!!a.multiple&&(a.defaultValue!=null?tp(i,!!a.multiple,a.defaultValue,!0):tp(i,!!a.multiple,a.multiple?[]:"",!1))}i[_v]=a}catch(g){Hn(e,e.return,g)}}break;case 6:if(Ma(t,e),Co(e),r&4){if(e.stateNode===null)throw Error(ye(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(g){Hn(e,e.return,g)}}break;case 3:if(Ma(t,e),Co(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{vv(t.containerInfo)}catch(g){Hn(e,e.return,g)}break;case 4:Ma(t,e),Co(e);break;case 13:Ma(t,e),Co(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(cI=Zn())),r&4&&qL(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(mi=(u=mi)||d,Ma(t,e),mi=u):Ma(t,e),Co(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(De=e,d=e.child;d!==null;){for(h=De=d;De!==null;){switch(f=De,p=f.child,f.tag){case 0:case 11:case 14:case 15:Ly(4,f,f.return);break;case 1:Vf(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){Hn(r,n,g)}}break;case 5:Vf(f,f.return);break;case 22:if(f.memoizedState!==null){KL(h);continue}}p!==null?(p.return=f,De=p):KL(h)}d=d.sibling}e:for(d=null,h=e;;){if(h.tag===5){if(d===null){d=h;try{i=h.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=h.stateNode,c=h.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=WU("display",o))}catch(g){Hn(e,e.return,g)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(g){Hn(e,e.return,g)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Ma(t,e),Co(e),r&4&&qL(e);break;case 21:break;default:Ma(t,e),Co(e)}}function Co(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(m9(n)){var r=n;break e}n=n.return}throw Error(ye(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(pv(i,""),r.flags&=-33);var a=UL(e);PT(e,a,i);break;case 3:case 4:var o=r.stateNode.containerInfo,l=UL(e);ET(e,l,o);break;default:throw Error(ye(161))}}catch(c){Hn(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tce(e,t,n){De=e,v9(e)}function v9(e,t,n){for(var r=(e.mode&1)!==0;De!==null;){var i=De,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||o0;if(!o){var l=i.alternate,c=l!==null&&l.memoizedState!==null||mi;l=o0;var u=mi;if(o0=o,(mi=c)&&!u)for(De=i;De!==null;)o=De,c=o.child,o.tag===22&&o.memoizedState!==null?GL(i):c!==null?(c.return=o,De=c):GL(i);for(;a!==null;)De=a,v9(a),a=a.sibling;De=i,o0=l,mi=u}HL(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,De=a):HL(e)}}function HL(e){for(;De!==null;){var t=De;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:mi||__(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!mi)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:qa(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&EL(t,a,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}EL(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&vv(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ye(163))}mi||t.flags&512&&TT(t)}catch(f){Hn(t,t.return,f)}}if(t===e){De=null;break}if(n=t.sibling,n!==null){n.return=t.return,De=n;break}De=t.return}}function KL(e){for(;De!==null;){var t=De;if(t===e){De=null;break}var n=t.sibling;if(n!==null){n.return=t.return,De=n;break}De=t.return}}function GL(e){for(;De!==null;){var t=De;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{__(4,t)}catch(c){Hn(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){Hn(t,i,c)}}var a=t.return;try{TT(t)}catch(c){Hn(t,a,c)}break;case 5:var o=t.return;try{TT(t)}catch(c){Hn(t,o,c)}}}catch(c){Hn(t,t.return,c)}if(t===e){De=null;break}var l=t.sibling;if(l!==null){l.return=t.return,De=l;break}De=t.return}}var Ece=Math.ceil,dj=ec.ReactCurrentDispatcher,oI=ec.ReactCurrentOwner,ja=ec.ReactCurrentBatchConfig,Lt=0,Gr=null,mr=null,si=0,Ps=0,Wf=Tu(0),Rr=0,Tv=null,ah=0,S_=0,lI=0,Fy=null,ns=null,cI=0,Fp=1/0,xl=null,hj=!1,OT=null,su=null,l0=!1,Gc=null,fj=0,zy=0,IT=null,gw=-1,yw=0;function Fi(){return Lt&6?Zn():gw!==-1?gw:gw=Zn()}function au(e){return e.mode&1?Lt&2&&si!==0?si&-si:fce.transition!==null?(yw===0&&(yw=nq()),yw):(e=Jt,e!==0||(e=window.event,e=e===void 0?16:cq(e.type)),e):1}function ao(e,t,n,r){if(50<zy)throw zy=0,IT=null,Error(ye(185));Qx(e,n,r),(!(Lt&2)||e!==Gr)&&(e===Gr&&(!(Lt&2)&&(S_|=n),Rr===4&&Ic(e,si)),cs(e,r),n===1&&Lt===0&&!(t.mode&1)&&(Fp=Zn()+500,b_&&Eu()))}function cs(e,t){var n=e.callbackNode;fle(e,t);var r=Qw(e,e===Gr?si:0);if(r===0)n!==null&&rL(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&rL(n),t===1)e.tag===0?hce(YL.bind(null,e)):Aq(YL.bind(null,e)),lce(function(){!(Lt&6)&&Eu()}),n=null;else{switch(rq(r)){case 1:n=DO;break;case 4:n=eq;break;case 16:n=Yw;break;case 536870912:n=tq;break;default:n=Yw}n=N9(n,x9.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function x9(e,t){if(gw=-1,yw=0,Lt&6)throw Error(ye(327));var n=e.callbackNode;if(ap()&&e.callbackNode!==n)return null;var r=Qw(e,e===Gr?si:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=pj(e,r);else{t=r;var i=Lt;Lt|=2;var a=w9();(Gr!==e||si!==t)&&(xl=null,Fp=Zn()+500,Bd(e,t));do try{Ice();break}catch(l){b9(e,l)}while(!0);GO(),dj.current=a,Lt=i,mr!==null?t=0:(Gr=null,si=0,t=Rr)}if(t!==0){if(t===2&&(i=aT(e),i!==0&&(r=i,t=RT(e,i))),t===1)throw n=Tv,Bd(e,0),Ic(e,r),cs(e,Zn()),n;if(t===6)Ic(e,r);else{if(i=e.current.alternate,!(r&30)&&!Pce(i)&&(t=pj(e,r),t===2&&(a=aT(e),a!==0&&(r=a,t=RT(e,a))),t===1))throw n=Tv,Bd(e,0),Ic(e,r),cs(e,Zn()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(ye(345));case 2:ad(e,ns,xl);break;case 3:if(Ic(e,r),(r&130023424)===r&&(t=cI+500-Zn(),10<t)){if(Qw(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Fi(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=pT(ad.bind(null,e,ns,xl),t);break}ad(e,ns,xl);break;case 4:if(Ic(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-so(r);a=1<<o,o=t[o],o>i&&(i=o),r&=~a}if(r=i,r=Zn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ece(r/1960))-r,10<r){e.timeoutHandle=pT(ad.bind(null,e,ns,xl),r);break}ad(e,ns,xl);break;case 5:ad(e,ns,xl);break;default:throw Error(ye(329))}}}return cs(e,Zn()),e.callbackNode===n?x9.bind(null,e):null}function RT(e,t){var n=Fy;return e.current.memoizedState.isDehydrated&&(Bd(e,t).flags|=256),e=pj(e,t),e!==2&&(t=ns,ns=n,t!==null&&DT(t)),e}function DT(e){ns===null?ns=e:ns.push.apply(ns,e)}function Pce(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!ho(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Ic(e,t){for(t&=~lI,t&=~S_,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-so(t),r=1<<n;e[n]=-1,t&=~r}}function YL(e){if(Lt&6)throw Error(ye(327));ap();var t=Qw(e,0);if(!(t&1))return cs(e,Zn()),null;var n=pj(e,t);if(e.tag!==0&&n===2){var r=aT(e);r!==0&&(t=r,n=RT(e,r))}if(n===1)throw n=Tv,Bd(e,0),Ic(e,t),cs(e,Zn()),n;if(n===6)throw Error(ye(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ad(e,ns,xl),cs(e,Zn()),null}function uI(e,t){var n=Lt;Lt|=1;try{return e(t)}finally{Lt=n,Lt===0&&(Fp=Zn()+500,b_&&Eu())}}function oh(e){Gc!==null&&Gc.tag===0&&!(Lt&6)&&ap();var t=Lt;Lt|=1;var n=ja.transition,r=Jt;try{if(ja.transition=null,Jt=1,e)return e()}finally{Jt=r,ja.transition=n,Lt=t,!(Lt&6)&&Eu()}}function dI(){Ps=Wf.current,kn(Wf)}function Bd(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,oce(n)),mr!==null)for(n=mr.return;n!==null;){var r=n;switch(qO(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&tj();break;case 3:$p(),kn(os),kn(wi),eI();break;case 5:JO(r);break;case 4:$p();break;case 13:kn(Mn);break;case 19:kn(Mn);break;case 10:YO(r.type._context);break;case 22:case 23:dI()}n=n.return}if(Gr=e,mr=e=ou(e.current,null),si=Ps=t,Rr=0,Tv=null,lI=S_=ah=0,ns=Fy=null,bd!==null){for(t=0;t<bd.length;t++)if(n=bd[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}bd=null}return e}function b9(e,t){do{var n=mr;try{if(GO(),fw.current=uj,cj){for(var r=Fn.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}cj=!1}if(sh=0,qr=Tr=Fn=null,$y=!1,Nv=0,oI.current=null,n===null||n.return===null){Rr=1,Tv=t,mr=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=si,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=ML(o);if(p!==null){p.flags&=-257,$L(p,o,l,a,t),p.mode&1&&DL(a,u,t),t=p,c=u;var m=t.updateQueue;if(m===null){var g=new Set;g.add(c),t.updateQueue=g}else m.add(c);break e}else{if(!(t&1)){DL(a,u,t),hI();break e}c=Error(ye(426))}}else if(Pn&&l.mode&1){var y=ML(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),$L(y,o,l,a,t),HO(Lp(c,l));break e}}a=c=Lp(c,l),Rr!==4&&(Rr=2),Fy===null?Fy=[a]:Fy.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var b=r9(a,c,t);TL(a,b);break e;case 1:l=c;var v=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof v.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(su===null||!su.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var _=i9(a,l,t);TL(a,_);break e}}a=a.return}while(a!==null)}_9(n)}catch(j){t=j,mr===n&&n!==null&&(mr=n=n.return);continue}break}while(!0)}function w9(){var e=dj.current;return dj.current=uj,e===null?uj:e}function hI(){(Rr===0||Rr===3||Rr===2)&&(Rr=4),Gr===null||!(ah&268435455)&&!(S_&268435455)||Ic(Gr,si)}function pj(e,t){var n=Lt;Lt|=2;var r=w9();(Gr!==e||si!==t)&&(xl=null,Bd(e,t));do try{Oce();break}catch(i){b9(e,i)}while(!0);if(GO(),Lt=n,dj.current=r,mr!==null)throw Error(ye(261));return Gr=null,si=0,Rr}function Oce(){for(;mr!==null;)j9(mr)}function Ice(){for(;mr!==null&&!ile();)j9(mr)}function j9(e){var t=k9(e.alternate,e,Ps);e.memoizedProps=e.pendingProps,t===null?_9(e):mr=t,oI.current=null}function _9(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Nce(n,t),n!==null){n.flags&=32767,mr=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Rr=6,mr=null;return}}else if(n=kce(n,t,Ps),n!==null){mr=n;return}if(t=t.sibling,t!==null){mr=t;return}mr=t=e}while(t!==null);Rr===0&&(Rr=5)}function ad(e,t,n){var r=Jt,i=ja.transition;try{ja.transition=null,Jt=1,Rce(e,t,n,r)}finally{ja.transition=i,Jt=r}return null}function Rce(e,t,n,r){do ap();while(Gc!==null);if(Lt&6)throw Error(ye(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ye(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(ple(e,a),e===Gr&&(mr=Gr=null,si=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||l0||(l0=!0,N9(Yw,function(){return ap(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=ja.transition,ja.transition=null;var o=Jt;Jt=1;var l=Lt;Lt|=4,oI.current=null,Ace(e,n),y9(n,e),ece(hT),Xw=!!dT,hT=dT=null,e.current=n,Tce(n),sle(),Lt=l,Jt=o,ja.transition=a}else e.current=n;if(l0&&(l0=!1,Gc=e,fj=i),a=e.pendingLanes,a===0&&(su=null),lle(n.stateNode),cs(e,Zn()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(hj)throw hj=!1,e=OT,OT=null,e;return fj&1&&e.tag!==0&&ap(),a=e.pendingLanes,a&1?e===IT?zy++:(zy=0,IT=e):zy=0,Eu(),null}function ap(){if(Gc!==null){var e=rq(fj),t=ja.transition,n=Jt;try{if(ja.transition=null,Jt=16>e?16:e,Gc===null)var r=!1;else{if(e=Gc,Gc=null,fj=0,Lt&6)throw Error(ye(331));var i=Lt;for(Lt|=4,De=e.current;De!==null;){var a=De,o=a.child;if(De.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(De=u;De!==null;){var d=De;switch(d.tag){case 0:case 11:case 15:Ly(8,d,a)}var h=d.child;if(h!==null)h.return=d,De=h;else for(;De!==null;){d=De;var f=d.sibling,p=d.return;if(p9(d),d===u){De=null;break}if(f!==null){f.return=p,De=f;break}De=p}}}var m=a.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(g!==null)}}De=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,De=o;else e:for(;De!==null;){if(a=De,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Ly(9,a,a.return)}var b=a.sibling;if(b!==null){b.return=a.return,De=b;break e}De=a.return}}var v=e.current;for(De=v;De!==null;){o=De;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,De=w;else e:for(o=v;De!==null;){if(l=De,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:__(9,l)}}catch(j){Hn(l,l.return,j)}if(l===o){De=null;break e}var _=l.sibling;if(_!==null){_.return=l.return,De=_;break e}De=l.return}}if(Lt=i,Eu(),Uo&&typeof Uo.onPostCommitFiberRoot=="function")try{Uo.onPostCommitFiberRoot(m_,e)}catch{}r=!0}return r}finally{Jt=n,ja.transition=t}}return!1}function QL(e,t,n){t=Lp(n,t),t=r9(e,t,1),e=iu(e,t,1),t=Fi(),e!==null&&(Qx(e,1,t),cs(e,t))}function Hn(e,t,n){if(e.tag===3)QL(e,e,n);else for(;t!==null;){if(t.tag===3){QL(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(su===null||!su.has(r))){e=Lp(n,e),e=i9(t,e,1),t=iu(t,e,1),e=Fi(),t!==null&&(Qx(t,1,e),cs(t,e));break}}t=t.return}}function Dce(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Fi(),e.pingedLanes|=e.suspendedLanes&n,Gr===e&&(si&n)===n&&(Rr===4||Rr===3&&(si&130023424)===si&&500>Zn()-cI?Bd(e,0):lI|=n),cs(e,t)}function S9(e,t){t===0&&(e.mode&1?(t=Zb,Zb<<=1,!(Zb&130023424)&&(Zb=4194304)):t=1);var n=Fi();e=ql(e,t),e!==null&&(Qx(e,t,n),cs(e,n))}function Mce(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),S9(e,n)}function $ce(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ye(314))}r!==null&&r.delete(t),S9(e,n)}var k9;k9=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||os.current)rs=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return rs=!1,Sce(e,t,n);rs=!!(e.flags&131072)}else rs=!1,Pn&&t.flags&1048576&&Tq(t,ij,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;mw(e,t),e=t.pendingProps;var i=Rp(t,wi.current);sp(t,n),i=nI(null,t,r,e,i,n);var a=rI();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ls(r)?(a=!0,nj(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,XO(t),i.updater=j_,t.stateNode=i,i._reactInternals=t,wT(t,r,e,n),t=ST(null,t,r,!0,a,n)):(t.tag=0,Pn&&a&&UO(t),Ti(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(mw(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Fce(r),e=qa(r,e),i){case 0:t=_T(null,t,r,e,n);break e;case 1:t=zL(null,t,r,e,n);break e;case 11:t=LL(null,t,r,e,n);break e;case 14:t=FL(null,t,r,qa(r.type,e),n);break e}throw Error(ye(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:qa(r,i),_T(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:qa(r,i),zL(e,t,r,i,n);case 3:e:{if(l9(t),e===null)throw Error(ye(387));
vendor: 8,453 bytes, line 40
40r=t.pendingProps,a=t.memoizedState,i=a.element,Dq(e,t),oj(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Lp(Error(ye(423)),t),t=BL(e,t,r,n,i);break e}else if(r!==i){i=Lp(Error(ye(424)),t),t=BL(e,t,r,n,i);break e}else for(Ms=ru(t.stateNode.containerInfo.firstChild),$s=t,Pn=!0,Ja=null,n=Iq(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Dp(),r===i){t=Hl(e,t,n);break e}Ti(e,t,r,n)}t=t.child}return t;case 5:return Mq(t),e===null&&vT(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,fT(r,i)?o=null:a!==null&&fT(r,a)&&(t.flags|=32),o9(e,t),Ti(e,t,o,n),t.child;case 6:return e===null&&vT(t),null;case 13:return c9(e,t,n);case 4:return ZO(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Mp(t,null,r,n):Ti(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:qa(r,i),LL(e,t,r,i,n);case 7:return Ti(e,t,t.pendingProps,n),t.child;case 8:return Ti(e,t,t.pendingProps.children,n),t.child;case 12:return Ti(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,hn(sj,r._currentValue),r._currentValue=o,a!==null)if(ho(a.value,o)){if(a.children===i.children&&!os.current){t=Hl(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=Il(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),xT(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(ye(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),xT(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Ti(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,sp(t,n),i=Sa(i),r=r(i),t.flags|=1,Ti(e,t,r,n),t.child;case 14:return r=t.type,i=qa(r,t.pendingProps),i=qa(r.type,i),FL(e,t,r,i,n);case 15:return s9(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:qa(r,i),mw(e,t),t.tag=1,ls(r)?(e=!0,nj(t)):e=!1,sp(t,n),n9(t,r,i),wT(t,r,i,n),ST(null,t,r,!0,e,n);case 19:return u9(e,t,n);case 22:return a9(e,t,n)}throw Error(ye(156,t.tag))};function N9(e,t){return JU(e,t)}function Lce(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ya(e,t,n,r){return new Lce(e,t,n,r)}function fI(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fce(e){if(typeof e=="function")return fI(e)?1:0;if(e!=null){if(e=e.$$typeof,e===OO)return 11;if(e===IO)return 14}return 2}function ou(e,t){var n=e.alternate;return n===null?(n=ya(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function vw(e,t,n,r,i,a){var o=2;if(r=e,typeof e=="function")fI(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case If:return Vd(n.children,i,a,t);case PO:o=8,i|=8;break;case qA:return e=ya(12,n,t,i|2),e.elementType=qA,e.lanes=a,e;case HA:return e=ya(13,n,t,i),e.elementType=HA,e.lanes=a,e;case KA:return e=ya(19,n,t,i),e.elementType=KA,e.lanes=a,e;case MU:return k_(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case RU:o=10;break e;case DU:o=9;break e;case OO:o=11;break e;case IO:o=14;break e;case Cc:o=16,r=null;break e}throw Error(ye(130,e==null?e:typeof e,""))}return t=ya(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Vd(e,t,n,r){return e=ya(7,e,r,t),e.lanes=n,e}function k_(e,t,n,r){return e=ya(22,e,r,t),e.elementType=MU,e.lanes=n,e.stateNode={isHidden:!1},e}function wN(e,t,n){return e=ya(6,e,null,t),e.lanes=n,e}function jN(e,t,n){return t=ya(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function zce(e,t,n,r,i){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=nN(0),this.expirationTimes=nN(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nN(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function pI(e,t,n,r,i,a,o,l,c){return e=new zce(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=ya(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},XO(a),e}function Bce(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Of,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function C9(e){if(!e)return gu;e=e._reactInternals;e:{if(Ah(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(ls(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ye(171))}if(e.tag===1){var n=e.type;if(ls(n))return Cq(e,n,t)}return t}function A9(e,t,n,r,i,a,o,l,c){return e=pI(n,r,!0,e,i,a,o,l,c),e.context=C9(null),n=e.current,r=Fi(),i=au(n),a=Il(r,i),a.callback=t??null,iu(n,a,i),e.current.lanes=i,Qx(e,i,r),cs(e,r),e}function N_(e,t,n,r){var i=t.current,a=Fi(),o=au(i);return n=C9(n),t.context===null?t.context=n:t.pendingContext=n,t=Il(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=iu(i,t,o),e!==null&&(ao(e,i,o,a),hw(e,i,o)),o}function mj(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 XL(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mI(e,t){XL(e,t),(e=e.alternate)&&XL(e,t)}function Vce(){return null}var T9=typeof reportError=="function"?reportError:function(e){console.error(e)};function gI(e){this._internalRoot=e}C_.prototype.render=gI.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ye(409));N_(e,t,null,null)};C_.prototype.unmount=gI.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;oh(function(){N_(null,e,null,null)}),t[Ul]=null}};function C_(e){this._internalRoot=e}C_.prototype.unstable_scheduleHydration=function(e){if(e){var t=aq();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Oc.length&&t!==0&&t<Oc[n].priority;n++);Oc.splice(n,0,e),n===0&&lq(e)}};function yI(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function A_(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ZL(){}function Wce(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=mj(o);a.call(u)}}var o=A9(t,r,e,0,null,!1,!1,"",ZL);return e._reactRootContainer=o,e[Ul]=o.current,wv(e.nodeType===8?e.parentNode:e),oh(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var u=mj(c);l.call(u)}}var c=pI(e,0,!1,null,null,!1,!1,"",ZL);return e._reactRootContainer=c,e[Ul]=c.current,wv(e.nodeType===8?e.parentNode:e),oh(function(){N_(t,c,n,r)}),c}function T_(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var l=i;
vendor: 4,530 bytes, line 40
40i=function(){var c=mj(o);l.call(c)}}N_(t,o,e,i)}else o=Wce(n,t,e,i,r);return mj(o)}iq=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=vy(t.pendingLanes);n!==0&&(MO(t,n|1),cs(t,Zn()),!(Lt&6)&&(Fp=Zn()+500,Eu()))}break;case 13:oh(function(){var r=ql(e,1);if(r!==null){var i=Fi();ao(r,e,1,i)}}),mI(e,1)}};$O=function(e){if(e.tag===13){var t=ql(e,134217728);if(t!==null){var n=Fi();ao(t,e,134217728,n)}mI(e,134217728)}};sq=function(e){if(e.tag===13){var t=au(e),n=ql(e,t);if(n!==null){var r=Fi();ao(n,e,t,r)}mI(e,t)}};aq=function(){return Jt};oq=function(e,t){var n=Jt;try{return Jt=e,t()}finally{Jt=n}};rT=function(e,t,n){switch(t){case"input":if(QA(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=x_(r);if(!i)throw Error(ye(90));LU(r),QA(r,i)}}}break;case"textarea":zU(e,n);break;case"select":t=n.value,t!=null&&tp(e,!!n.multiple,t,!1)}};KU=uI;GU=oh;var Uce={usingClientEntryPoint:!1,Events:[Zx,$f,x_,qU,HU,uI]},$g={findFiberByHostInstance:xd,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},qce={bundleType:$g.bundleType,version:$g.version,rendererPackageName:$g.rendererPackageName,rendererConfig:$g.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ec.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=XU(e),e===null?null:e.stateNode},findFiberByHostInstance:$g.findFiberByHostInstance||Vce,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 c0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!c0.isDisabled&&c0.supportsFiber)try{m_=c0.inject(qce),Uo=c0}catch{}}Qs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Uce;Qs.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!yI(t))throw Error(ye(200));return Bce(e,t,null,n)};Qs.createRoot=function(e,t){if(!yI(e))throw Error(ye(299));var n=!1,r="",i=T9;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=pI(e,1,!1,null,null,n,!1,r,i),e[Ul]=t.current,wv(e.nodeType===8?e.parentNode:e),new gI(t)};Qs.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=XU(t),e=e===null?null:e.stateNode,e};Qs.flushSync=function(e){return oh(e)};Qs.hydrate=function(e,t,n){if(!A_(t))throw Error(ye(200));return T_(null,e,t,!0,n)};Qs.hydrateRoot=function(e,t,n){if(!yI(e))throw Error(ye(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",o=T9;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=A9(t,null,e,1,n??null,i,!1,a,o),e[Ul]=t.current,wv(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new C_(t)};Qs.render=function(e,t,n){if(!A_(t))throw Error(ye(200));return T_(null,e,t,!1,n)};Qs.unmountComponentAtNode=function(e){if(!A_(e))throw Error(ye(40));return e._reactRootContainer?(oh(function(){T_(null,null,e,!1,function(){e._reactRootContainer=null,e[Ul]=null})}),!0):!1};Qs.unstable_batchedUpdates=uI;Qs.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!A_(n))throw Error(ye(200));if(e==null||e._reactInternals===void 0)throw Error(ye(38));return T_(e,t,n,!1,r)};Qs.version="18.3.1-next-f1338f8080-20240426";function E9(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(E9)}catch(e){console.error(e)}}E9(),EU.exports=Qs;var Th=EU.exports;const P9=Ot(Th);var O9,JL=Th;O9=JL.createRoot,JL.hydrateRoot;var Hce=typeof Element<"u",Kce=typeof Map=="function",Gce=typeof Set=="function",Yce=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function xw(e,t){if(e===t)return!0;
40if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!xw(e[r],t[r]))return!1;return!0}var a;if(Kce&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;for(a=e.entries();!(r=a.next()).done;)if(!xw(r.value[1],t.get(r.value[0])))return!1;return!0}if(Gce&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(Yce&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])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(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(Hce&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!xw(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var Qce=function(t,n){try{return xw(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const Xce=Ot(Qce);var Zce=function(e,t,n,r,i,a,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 u=[n,r,i,a,o,l],d=0;c=new Error(t.replace(/%s/g,function(){return u[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}},Jce=Zce;const e4=Ot(Jce);var eue=function(t,n,r,i){var a=r?r.call(i,t,n):void 0;if(a!==void 0)return!!a;if(t===n)return!0;if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var o=Object.keys(t),l=Object.keys(n);if(o.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(n),u=0;u<o.length;u++){var d=o[u];if(!c(d))return!1;var h=t[d],f=n[d];if(a=r?r.call(i,h,f,d):void 0,a===!1||a===void 0&&h!==f)return!1}return!0};const tue=Ot(eue);var I9=(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))(I9||{}),_N={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"]}},t4=Object.values(I9),E_={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},R9=Object.entries(E_).reduce((e,[t,n])=>(e[n]=t,e),{}),ro="data-rh",op={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},lp=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},nue=e=>{let t=lp(e,"title");const n=lp(e,op.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=lp(e,op.DEFAULT_TITLE);return t||r||void 0},rue=e=>lp(e,op.ON_CHANGE_CLIENT_STATE)||(()=>{}),SN=(e,t)=>t.filter(n=>typeof n[e]<"u").map(n=>n[e]).reduce((n,r)=>({...n,...r}),{}),iue=(e,t)=>t.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const i=Object.keys(r);for(let a=0;a<i.length;a+=1){const l=i[a].toLowerCase();if(e.indexOf(l)!==-1&&r[l])return n.concat(r)}}return n},[]),sue=e=>console&&typeof console.warn=="function"&&console.warn(e),Lg=(e,t,n
40)=>{const r={};return n.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&sue(`Helmet: ${e} should be of type "Array". Instead found type "${typeof i[e]}"`),!1)).map(i=>i[e]).reverse().reduce((i,a)=>{const o={};a.filter(c=>{let u;const d=Object.keys(c);for(let f=0;f<d.length;f+=1){const p=d[f],m=p.toLowerCase();t.indexOf(m)!==-1&&!(u==="rel"&&c[u].toLowerCase()==="canonical")&&!(m==="rel"&&c[m].toLowerCase()==="stylesheet")&&(u=m),t.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(u=p)}if(!u||!c[u])return!1;const h=c[u].toLowerCase();return r[u]||(r[u]={}),o[u]||(o[u]={}),r[u][h]?!1:(o[u][h]=!0,!0)}).reverse().forEach(c=>i.push(c));const l=Object.keys(o);for(let c=0;c<l.length;c+=1){const u=l[c],d={...r[u],...o[u]};r[u]=d}return i},[]).reverse()},aue=(e,t)=>{if(Array.isArray(e)&&e.length){for(let n=0;n<e.length;n+=1)if(e[n][t])return!0}return!1},oue=e=>({baseTag:iue(["href"],e),bodyAttributes:SN("bodyAttributes",e),defer:lp(e,op.DEFER),encode:lp(e,op.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:SN("htmlAttributes",e),linkTags:Lg("link",["rel","href"],e),metaTags:Lg("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:Lg("noscript",["innerHTML"],e),onChangeClientState:rue(e),scriptTags:Lg("script",["src","innerHTML"],e),styleTags:Lg("style",["cssText"],e),title:nue(e),titleAttributes:SN("titleAttributes",e),prioritizeSeoTags:aue(e,op.PRIORITIZE_SEO_TAGS)}),D9=e=>Array.isArray(e)?e.join(""):e,lue=(e,t)=>{const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1},kN=(e,t)=>Array.isArray(e)?e.reduce((n,r)=>(lue(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},n4=(e,t)=>({...e,[t]:void 0}),cue=["noscript","script","style"],MT=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),M9=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),uue=(e,t,n,r)=>{const i=M9(n),a=D9(t);return i?`<${e} ${ro}="true" ${i}>${MT(a,r)}</${e}>`:`<${e} ${ro}="true">${MT(a,r)}</${e}>`},due=(e,t,n=!0)=>t.reduce((r,i)=>{const a=i,o=Object.keys(a).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,d)=>{const h=typeof a[d]>"u"?d:`${d}="${MT(a[d],n)}"`;return u?`${u} ${h}`:h},""),l=a.innerHTML||a.cssText||"",c=cue.indexOf(e)===-1;return`${r}<${e} ${ro}="true" ${o}${c?"/>":`>${l}</${e}>`}`},""),$9=(e,t={})=>Object.keys(e).reduce((n,r)=>{const i=E_[r];return n[i||r]=e[r],n},t),hue=(e,t,n)=>{const r={key:t,[ro]:!0},i=$9(n,r);return[L.createElement("title",i,t)]},bw=(e,t)=>t.map((n,r)=>{const i={key:r,[ro]:!0};return Object.keys(n).forEach(a=>{const l=E_[a]||a;if(l==="innerHTML"||l==="cssText"){const c=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:c}}else i[l]=n[a]}),L.createElement(e,i)}),ca=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>hue(e,t.title,t.titleAttributes),toString:()=>uue(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>$9(t),toString:()=>M9(t)};default:return{toComponent:()=>bw(e,t),toString:()=>due(e,t,n)}}},fue=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const i=kN(e,_N.meta),a=kN(t,_N.link),o=kN(n,_N.script);return{priorityMethods:{toComponent:()=>[...bw("meta",i.priority),...bw("link",a.priority),...bw("script",o.priority)],toString:()=>`${ca("meta",i.priority,r)} ${ca("link",a.priority,r)} ${ca("script",o.priority,r)}`},metaTags:i.default,linkTags:a.default,scriptTags:o.default}},pue=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:i,noscriptTags:a,styleTags:o,title:l="",titleAttributes:c,prioritizeSeoTags:u}=e;let{linkTags:d,metaTags:h,scriptTags:f}=e,p={toComponent:()=>[],toString:()=>""};return u&&({priorityMethods:p,linkTags:d,metaTags:h,scriptTags:f}=fue(e)),{priority:p,base:ca("base",t,r),bodyAttributes:ca("bodyAttributes",n,r),htmlAttributes:ca("htmlAttributes",i,r),link:ca("link",d,r),meta:ca("meta",h,r),noscript:ca("noscript",a,r),script:ca("script",f,r),style:ca("style",o,r),title:ca("title",{title:l,titleAttributes:c},r)}},$T=pue,u0=[],vI=!!(typeof window<"u"&&window.document&&window.document.createElement),LT=class{constructor(e,t){No(this,"instances",[]);No(this,"canUseDOM",vI);No(this,"context");No(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?u0:this.instances,add:e=>{(this.canUseDOM?u0:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?u0:this.instances).indexOf(e);(this.canUseDOM?u0:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=$T({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},mue=parseInt(L.version.split(".")[0],10),FT=mue>=19,gue={},L9=L.createContext(gue),Pd,F9=(Pd=class extends x.Component{constructor(n){super(n);No(this,"helmetData");FT?this.helmetData=null:this.helmetData=new LT(this.props.context||{},Pd.canUseDOM)}render(){return FT?L.createElement(L.Fragment,null,this.props.children):L.createElement(L9.Provider,{value:this.helmetData.value},this.props.children)}},No(Pd,"canUseDOM",vI),Pd),Hh=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${e}[${ro}]`),i=[].slice.call(r),a=[];let o;return t&&t.length&&t.forEach(l=>{const c=document.createElement(e);for(const u in l)if(Object.prototype.hasOwnProperty.call(l,u))if(u==="innerHTML")c.innerHTML=l.innerHTML;else if(u==="cssText"){const d=l.cssText;
40c.appendChild(document.createTextNode(d))}else{const d=u,h=typeof l[d]>"u"?"":l[d];c.setAttribute(u,h)}c.setAttribute(ro,"true"),i.some((u,d)=>(o=d,c.isEqualNode(u)))?i.splice(o,1):a.push(c)}),i.forEach(l=>{var c;return(c=l.parentNode)==null?void 0:c.removeChild(l)}),a.forEach(l=>n.appendChild(l)),{oldTags:i,newTags:a}},zT=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(ro),i=r?r.split(","):[],a=[...i],o=Object.keys(t);for(const l of o){const c=t[l]||"";n.getAttribute(l)!==c&&n.setAttribute(l,c),i.indexOf(l)===-1&&i.push(l);const u=a.indexOf(l);u!==-1&&a.splice(u,1)}for(let l=a.length-1;l>=0;l-=1)n.removeAttribute(a[l]);i.length===a.length?n.removeAttribute(ro):n.getAttribute(ro)!==o.join(",")&&n.setAttribute(ro,o.join(","))},yue=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=D9(e)),zT("title",t)},r4=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:i,linkTags:a,metaTags:o,noscriptTags:l,onChangeClientState:c,scriptTags:u,styleTags:d,title:h,titleAttributes:f}=e;zT("body",r),zT("html",i),yue(h,f);const p={baseTag:Hh("base",n),linkTags:Hh("link",a),metaTags:Hh("meta",o),noscriptTags:Hh("noscript",l),scriptTags:Hh("script",u),styleTags:Hh("style",d)},m={},g={};Object.keys(p).forEach(y=>{const{newTags:b,oldTags:v}=p[y];b.length&&(m[y]=b),v.length&&(g[y]=p[y].oldTags)}),t&&t(),c(e,m,g)},Fg=null,vue=e=>{Fg&&cancelAnimationFrame(Fg),e.defer?Fg=requestAnimationFrame(()=>{r4(e,()=>{Fg=null})}):(r4(e),Fg=null)},xue=vue,i4=class extends x.Component{constructor(){super(...arguments);No(this,"rendered",!1)}shouldComponentUpdate(t){return!tue(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let r=null;const i=oue(t.get().map(a=>{const{context:o,...l}=a.props;return l}));F9.canUseDOM?xue(i):$T&&(r=$T(i)),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},ww=[],s4=e=>{const t={};for(const n of Object.keys(e))t[R9[n]||n]=e[n];return t},Ku=e=>{const t={};for(const n of Object.keys(e)){const r=E_[n];t[r||n]=e[n]}return t},a4=(e,t)=>{if(!vI)return;const n=document.getElementsByTagName(e)[0];if(!n)return;const r="data-rh-managed",i=n.getAttribute(r),a=i?i.split(","):[],o=Object.keys(t);for(const l of a)o.includes(l)||n.removeAttribute(l);for(const l of o){const c=t[l];c==null||c===!1?n.removeAttribute(l):c===!0?n.setAttribute(l,""):n.setAttribute(l,String(c))}o.length>0?n.setAttribute(r,o.join(",")):n.removeAttribute(r)},NN=()=>{const e={},t={};for(const n of ww){const{htmlAttributes:r,bodyAttributes:i}=n.props;r&&Object.assign(e,s4(r)),i&&Object.assign(t,s4(i))}a4("html",e),a4("body",t)},bue=class extends x.Component{componentDidMount(){ww.push(this),NN()}componentDidUpdate(){NN()}componentWillUnmount(){const e=ww.indexOf(this);e!==-1&&ww.splice(e,1),NN()}resolveTitle(){const{title:e,titleTemplate:t,defaultTitle:n}=this.props;return e&&t?t.replace(/%s/g,()=>Array.isArray(e)?e.join(""):e):e||n||void 0}renderTitle(){const e=this.resolveTitle();if(e===void 0)return null;const t=this.props.titleAttributes||{};return L.createElement("title",Ku(t),e)}renderBase(){const{base:e}=this.props;return e?L.createElement("base",Ku(e)):null}renderMeta(){const{meta:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,n)=>L.createElement("meta",{key:n,...Ku(t)}))}renderLink(){const{link:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,n)=>L.createElement("link",{key:n,...Ku(t)}))}renderScript(){const{script:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,n)=>{const{innerHTML:r,...i}=t,a=Ku(i);return r&&(a.dangerouslySetInnerHTML={__html:r}),L.createElement("script",{key:n,...a})})}renderStyle(){const{style:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,n)=>{const{cssText:r,...i}=t,a=Ku(i);return r&&(a.dangerouslySetInnerHTML={__html:r}),L.createElement("style",{key:n,...a})})}renderNoscript(){const{noscript:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,n)=>{const{innerHTML:r,...i}=t,a=Ku(i);return r&&(a.dangerouslySetInnerHTML={__html:r}),L.createElement("noscript",{key:n,...a})})}render(){return L.createElement(L.Fragment,null,this.renderTitle(),this.renderBase(),this.renderMeta(),this.renderLink(),this.renderScript(),this.renderStyle(),this.renderNoscript())}},WA,wue=(WA=class extends x.Component{shouldComponentUpdate(e){return!Xce(n4(this.props,"helmetData"),n4(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,n,r){return{...t,[e.type]:[...t[e.type]||[],{...n,...this.mapNestedChildrenToProps(e,r)}]}}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return{...t,[e.type]:r,titleAttributes:{...n}};case"body":return{...t,bodyAttributes:{...n}};case"html":return{...t,htmlAttributes:{...n}};default:return{...t,[e.type]:{...n}}}}mapArrayTypeChildrenToProps(e,t){let n={...t};return Object.keys(e).forEach(r=>{n={...n,[r]:e[r]}}),n}
40warnOnInvalidChildren(e,t){return e4(t4.some(n=>e.type===n),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 ${t4.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),e4(!t||typeof t=="string"||Array.isArray(t)&&!t.some(n=>typeof n!="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 n={};return L.Children.forEach(e,r=>{if(!r||!r.props)return;const{children:i,...a}=r.props,o=Object.keys(a).reduce((c,u)=>(c[R9[u]||u]=a[u],c),{});let{type:l}=r;switch(typeof l=="symbol"?l=l.toString():this.warnOnInvalidChildren(r,i),l){case"Symbol(react.fragment)":t=this.mapChildrenToProps(i,t);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,o,i);break;default:t=this.mapObjectTypeChildren(r,t,o,i);break}}),this.mapArrayTypeChildrenToProps(n,t)}render(){const{children:e,...t}=this.props;let n={...t},{helmetData:r}=t;if(e&&(n=this.mapChildrenToProps(e,n)),r&&!(r instanceof LT)){const i=r;r=new LT(i.context,!0),delete n.helmetData}return FT?L.createElement(bue,{...n}):r?L.createElement(i4,{...n,context:r.value}):L.createElement(L9.Consumer,null,i=>L.createElement(i4,{...n,context:i}))}},No(WA,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),WA);const jue=1,_ue=1e6;let CN=0;function Sue(){return CN=(CN+1)%Number.MAX_SAFE_INTEGER,CN.toString()}const AN=new Map,o4=e=>{if(AN.has(e))return;const t=setTimeout(()=>{AN.delete(e),By({type:"REMOVE_TOAST",toastId:e})},_ue);AN.set(e,t)},kue=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,jue)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?o4(n):e.toasts.forEach(r=>{o4(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},jw=[];let _w={toasts:[]};function By(e){_w=kue(_w,e),jw.forEach(t=>{t(_w)})}function z9({...e}){const t=Sue(),n=i=>By({type:"UPDATE_TOAST",toast:{...i,id:t}}),r=()=>By({type:"DISMISS_TOAST",toastId:t});return By({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||r()}}}),{id:t,dismiss:r,update:n}}function xt(){const[e,t]=x.useState(_w);return x.useEffect(()=>(jw.push(t),()=>{const n=jw.indexOf(t);n>-1&&jw.splice(n,1)}),[e]),{...e,toast:z9,dismiss:n=>By({type:"DISMISS_TOAST",toastId:n})}}function fe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function l4(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Kl(...e){return t=>{let n=!1;const r=e.map(i=>{const a=l4(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():l4(e[i],null)}}}}function Ke(...e){return x.useCallback(Kl(...e),e)}function Nue(e,t){const n=x.createContext(t),r=a=>{const{children:o,...l}=a,c=x.useMemo(()=>l,Object.values(l));return s.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function i(a){const o=x.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function sr(e,t=[]){let n=[];function r(a,o){const l=x.createContext(o),c=n.length;n=[...n,o];const u=h=>{var b;const{scope:f,children:p,...m}=h,g=((b=f==null?void 0:f[e])==null?void 0:b[c])||l,y=x.useMemo(()=>m,Object.values(m));return s.jsx(g.Provider,{value:y,children:p})};u.displayName=a+"Provider";function d(h,f){var g;const p=((g=f==null?void 0:f[e])==null?void 0:g[c])||l,m=x.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[u,d]}const i=()=>{const a=n.map(o=>x.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[r,Cue(i,...t)]}function Cue(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));
vendor: 10,291 bytes, line 40
40return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const h=c(a)[`__scope${u}`];return{...l,...h}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function yu(e){const t=Aue(e),n=x.forwardRef((r,i)=>{const{children:a,...o}=r,l=x.Children.toArray(a),c=l.find(Tue);if(c){const u=c.props.children,d=l.map(h=>h===c?x.Children.count(u)>1?x.Children.only(null):x.isValidElement(u)?u.props.children:null:h);return s.jsx(t,{...o,ref:i,children:x.isValidElement(u)?x.cloneElement(u,void 0,d):null})}return s.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var B9=yu("Slot");function Aue(e){const t=x.forwardRef((n,r)=>{const{children:i,...a}=n;if(x.isValidElement(i)){const o=Pue(i),l=Eue(a,i.props);return i.type!==x.Fragment&&(l.ref=r?Kl(r,o):o),x.cloneElement(i,l)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var V9=Symbol("radix.slottable");function W9(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=V9,t}function Tue(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===V9}function Eue(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...l)=>{const c=a(...l);return i(...l),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Pue(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Bm(e){const t=e+"CollectionProvider",[n,r]=sr(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:y,children:b}=g,v=L.useRef(null),w=L.useRef(new Map).current;return s.jsx(i,{scope:y,itemMap:w,collectionRef:v,children:b})};o.displayName=t;const l=e+"CollectionSlot",c=yu(l),u=L.forwardRef((g,y)=>{const{scope:b,children:v}=g,w=a(l,b),_=Ke(y,w.collectionRef);return s.jsx(c,{ref:_,children:v})});u.displayName=l;const d=e+"CollectionItemSlot",h="data-radix-collection-item",f=yu(d),p=L.forwardRef((g,y)=>{const{scope:b,children:v,...w}=g,_=L.useRef(null),j=Ke(y,_),S=a(d,b);return L.useEffect(()=>(S.itemMap.set(_,{ref:_,...w}),()=>void S.itemMap.delete(_))),s.jsx(f,{[h]:"",ref:j,children:v})});p.displayName=d;function m(g){const y=a(e+"CollectionConsumer",g);return L.useCallback(()=>{const v=y.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((S,k)=>w.indexOf(S.ref.current)-w.indexOf(k.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:p},m,r]}var Oue=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ne=Oue.reduce((e,t)=>{const n=yu(`Primitive.${t}`),r=x.forwardRef((i,a)=>{const{asChild:o,...l}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xI(e,t){e&&Th.flushSync(()=>e.dispatchEvent(t))}function Jn(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Iue(e,t=globalThis==null?void 0:globalThis.document){const n=Jn(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Rue="DismissableLayer",BT="dismissableLayer.update",Due="dismissableLayer.pointerDownOutside",Mue="dismissableLayer.focusOutside",c4,U9=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Eh=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=x.useContext(U9),[d,h]=x.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=x.useState({}),m=Ke(t,k=>h(k)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(y),v=d?g.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,_=v>=b,j=Lue(k=>{const N=k.target,T=[...u.branches].some(C=>C.contains(N));!_||T||(i==null||i(k),o==null||o(k),k.defaultPrevented||l==null||l())},f),S=Fue(k=>{const N=k.target;[...u.branches].some(C=>C.contains(N))||(a==null||a(k),o==null||o(k),k.defaultPrevented||l==null||l())},f);return Iue(k=>{v===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},f),x.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(c4=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),u4(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=c4)}},[d,f,n,u]),x.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),u4())},[d,u]),x.useEffect(()=>{const k=()=>p({});return document.addEventListener(BT,k),()=>document.removeEventListener(BT,k)},[]),s.jsx(Ne.div,{...c,ref:m,style:{pointerEvents:w?_?"auto":"none":void 0,...e.style},onFocusCapture:fe(e.onFocusCapture,S.onFocusCapture),onBlurCapture:fe(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:fe(e.onPointerDownCapture,j.onPointerDownCapture)})});Eh.displayName=Rue;var $ue="DismissableLayerBranch",q9=x.forwardRef((e,t)=>{const n=x.useContext(U9),r=x.useRef(null),i=Ke(t,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),s.jsx(Ne.div,{...e,ref:i})});q9.displayName=$ue;function Lue(e,t=globalThis==null?void 0:globalThis.document){const n=Jn(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){H9(Due,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Fue(e,t=globalThis==null?void 0:globalThis.document){const n=Jn(e),r=x.useRef(!1);return x.useEffect(()=>{const i=a=>{a.target&&!r.current&&H9(Mue,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function u4(){const e=new CustomEvent(BT);document.dispatchEvent(e)}function H9(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?xI(i,a):i.dispatchEvent(a)}var zue=Eh,Bue=q9,Lr=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},Vue="Portal",Vm=x.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,a]=x.useState(!1);Lr(()=>a(!0),[]);const o=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?P9.createPortal(s.jsx(Ne.div,{...r,ref:t}),o):null});Vm.displayName=Vue;function Wue(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var vr=e=>{const{present:t,children:n}=e,r=Uue(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=Ke(r.ref,que(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:a}):null};vr.displayName="Presence";function Uue(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),a=x.useRef("none"),o=e?"mounted":"unmounted",[l,c]=Wue(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const u=d0(r.current);a.current=l==="mounted"?u:"none"},[l]),Lr(()=>{const u=r.current,d=i.current;if(d!==e){const f=a.current,p=d0(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),Lr(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,h=p=>{const g=d0(r.current).includes(p.animationName);if(p.target===t&&g&&(c("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=p=>{p.target===t&&(a.current=d0(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function d0(e){return(e==null?void 0:e.animationName)||"none"}function que(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Hue=CO[" useInsertionEffect ".trim().toString()]||Lr;function ji({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=Kue({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:i;{const d=x.useRef(e!==void 0);x.useEffect(()=>{const h=d.current;h!==l&&console.warn(`${r} is changing from ${h?"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.`),d.current=l},[l,r])}const u=x.useCallback(d=>{var h;if(l){const f=Gue(d)?d(e):d;f!==e&&((h=o.current)==null||h.call(o,f))}else a(d)},[l,e,a,o]);return[c,u]}function Kue({defaultProp:e,onChange:t}
40){const[n,r]=x.useState(e),i=x.useRef(n),a=x.useRef(t);return Hue(()=>{a.current=t},[t]),x.useEffect(()=>{var o;i.current!==n&&((o=a.current)==null||o.call(a,n),i.current=n)},[n,i]),[n,r,a]}function Gue(e){return typeof e=="function"}var K9=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"}),Yue="VisuallyHidden",P_=x.forwardRef((e,t)=>s.jsx(Ne.span,{...e,ref:t,style:{...K9,...e.style}}));P_.displayName=Yue;var Que=P_,bI="ToastProvider",[wI,Xue,Zue]=Bm("Toast"),[G9,Npt]=sr("Toast",[Zue]),[Jue,O_]=G9(bI),Y9=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:a=50,children:o}=e,[l,c]=x.useState(null),[u,d]=x.useState(0),h=x.useRef(!1),f=x.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${bI}\`. Expected non-empty \`string\`.`),s.jsx(wI.Provider,{scope:t,children:s.jsx(Jue,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:x.useCallback(()=>d(p=>p+1),[]),onToastRemove:x.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:f,children:o})})};Y9.displayName=bI;var Q9="ToastViewport",ede=["F8"],VT="toast.viewportPause",WT="toast.viewportResume",X9=x.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=ede,label:i="Notifications ({hotkey})",...a}=e,o=O_(Q9,n),l=Xue(n),c=x.useRef(null),u=x.useRef(null),d=x.useRef(null),h=x.useRef(null),f=Ke(t,h,o.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=o.toastCount>0;x.useEffect(()=>{const y=b=>{var w;r.length!==0&&r.every(_=>b[_]||b.code===_)&&((w=h.current)==null||w.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),x.useEffect(()=>{const y=c.current,b=h.current;if(m&&y&&b){const v=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(VT);b.dispatchEvent(S),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent(WT);b.dispatchEvent(S),o.isClosePausedRef.current=!1}},_=S=>{!y.contains(S.relatedTarget)&&w()},j=()=>{y.contains(document.activeElement)||w()};return y.addEventListener("focusin",v),y.addEventListener("focusout",_),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",j),window.addEventListener("blur",v),window.addEventListener("focus",w),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",_),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",j),window.removeEventListener("blur",v),window.removeEventListener("focus",w)}}},[m,o.isClosePausedRef]);const g=x.useCallback(({tabbingDirection:y})=>{const v=l().map(w=>{const _=w.ref.current,j=[_,...fde(_)];return y==="forwards"?j:j.reverse()});return(y==="forwards"?v.reverse():v).flat()},[l]);return x.useEffect(()=>{const y=h.current;if(y){const b=v=>{var j,S,k;const w=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!w){const N=document.activeElement,T=v.shiftKey;if(v.target===y&&T){(j=u.current)==null||j.focus();return}const O=g({tabbingDirection:T?"backwards":"forwards"}),z=O.findIndex($=>$===N);TN(O.slice(z+1))?v.preventDefault():T?(S=u.current)==null||S.focus():(k=d.current)==null||k.focus()}};return y.addEventListener("keydown",b),()=>y.removeEventListener("keydown",b)}},[l,g]),s.jsxs(Bue,{ref:c,role:"region","aria-label":i.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&s.jsx(UT,{ref:u,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"forwards"});TN(y)}}),s.jsx(wI.Slot,{scope:n,children:s.jsx(Ne.ol,{tabIndex:-1,...a,ref:f})}),m&&s.jsx(UT,{ref:d,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"backwards"});TN(y)}})]})});X9.displayName=Q9;var Z9="ToastFocusProxy",UT=x.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=O_(Z9,n);return s.jsx(P_,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=a.viewport)!=null&&u.contains(l))&&r()}})});UT.displayName=Z9;var eb="Toast",tde="toast.swipeStart",nde="toast.swipeMove",rde="toast.swipeCancel",ide="toast.swipeEnd",J9=x.forwardRef((e,t)=>
40{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[l,c]=ji({prop:r,defaultProp:i??!0,onChange:a,caller:eb});return s.jsx(vr,{present:n||l,children:s.jsx(ode,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:Jn(e.onPause),onResume:Jn(e.onResume),onSwipeStart:fe(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:fe(e.onSwipeMove,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:fe(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:fe(e.onSwipeEnd,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});J9.displayName=eb;var[sde,ade]=G9(eb,{onClose(){}}),ode=x.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:a,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:f,onSwipeEnd:p,...m}=e,g=O_(eb,n),[y,b]=x.useState(null),v=Ke(t,$=>b($)),w=x.useRef(null),_=x.useRef(null),j=i||g.duration,S=x.useRef(0),k=x.useRef(j),N=x.useRef(0),{onToastAdd:T,onToastRemove:C}=g,A=Jn(()=>{var F;(y==null?void 0:y.contains(document.activeElement))&&((F=g.viewport)==null||F.focus()),o()}),O=x.useCallback($=>{!$||$===1/0||(window.clearTimeout(N.current),S.current=new Date().getTime(),N.current=window.setTimeout(A,$))},[A]);x.useEffect(()=>{const $=g.viewport;if($){const F=()=>{O(k.current),u==null||u()},B=()=>{const P=new Date().getTime()-S.current;k.current=k.current-P,window.clearTimeout(N.current),c==null||c()};return $.addEventListener(VT,B),$.addEventListener(WT,F),()=>{$.removeEventListener(VT,B),$.removeEventListener(WT,F)}}},[g.viewport,j,c,u,O]),x.useEffect(()=>{a&&!g.isClosePausedRef.current&&O(j)},[a,j,g.isClosePausedRef,O]),x.useEffect(()=>(T(),()=>C()),[T,C]);const z=x.useMemo(()=>y?aH(y):null,[y]);return g.viewport?s.jsxs(s.Fragment,{children:[z&&s.jsx(lde,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:z}),s.jsx(sde,{scope:n,onClose:A,children:Th.createPortal(s.jsx(wI.ItemSlot,{scope:n,children:s.jsx(zue,{asChild:!0,onEscapeKeyDown:fe(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||A(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(Ne.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":g.swipeDirection,...m,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:fe(e.onKeyDown,$=>{$.key==="Escape"&&(l==null||l($.nativeEvent),$.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,A()))}),onPointerDown:fe(e.onPointerDown,$=>{$.button===0&&(w.current={x:$.clientX,y:$.clientY})}),onPointerMove:fe(e.onPointerMove,$=>{if(!w.current)return;const F=$.clientX-w.current.x,B=$.clientY-w.current.y,P=!!_.current,I=["left","right"].includes(g.swipeDirection),M=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,R=I?M(0,F):0,K=I?0:M(0,B),D=$.pointerType==="touch"?10:2,E={x:R,y:K},q={originalEvent:$,delta:E};P?(_.current=E,h0(nde,h,q,{discrete:!1})):d4(E,g.swipeDirection,D)?(_.current=E,h0(tde,d,q,{discrete:!1}),$.target.setPointerCapture($.pointerId)):(Math.abs(F)>D||Math.abs(B)>D)&&(w.current=null)}),onPointerUp:fe(e.onPointerUp,$=>{const F=_.current,B=$.target;if(B.hasPointerCapture($.pointerId)&&B.releasePointerCapture($.pointerId),_.current=null,w.current=null,F){const P=$.currentTarget,I={originalEvent:$,delta:F};d4(F,g.swipeDirection,g.swipeThreshold)?h0(ide,p,I,{discrete:!0}):h0(rde,f,I,{discrete:!0}),P.addEventListener("click",M=>M.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),lde=e=>{const{__scopeToast:t,children:n,...r}=e,i=O_(eb,t),[a,o]=x.useState(!1),[l,c]=x.useState(!1);return dde(()=>o(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:s.jsx(Vm,{asChild:!0,children:s.jsx(P_,{...r,children:a&&s.jsxs(s.Fragment,{children:[i.label," ",n]})})})},cde="ToastTitle",eH=x.forwardRef((e,t)=>
vendor: 4,755 bytes, lines 40-60
40{const{__scopeToast:n,...r}=e;return s.jsx(Ne.div,{...r,ref:t})});eH.displayName=cde;var ude="ToastDescription",tH=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Ne.div,{...r,ref:t})});tH.displayName=ude;var nH="ToastAction",rH=x.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(sH,{altText:n,asChild:!0,children:s.jsx(jI,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${nH}\`. Expected non-empty \`string\`.`),null)});rH.displayName=nH;var iH="ToastClose",jI=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,i=ade(iH,n);return s.jsx(sH,{asChild:!0,children:s.jsx(Ne.button,{type:"button",...r,ref:t,onClick:fe(e.onClick,i.onClose)})})});jI.displayName=iH;var sH=x.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...i}=e;return s.jsx(Ne.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function aH(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),hde(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",a=r.dataset.radixToastAnnounceExclude==="";if(!i)if(a){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...aH(r))}}),t}function h0(e,t,n,{discrete:r}){const i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?xI(i,a):i.dispatchEvent(a)}var d4=(e,t,n=0)=>{const r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t==="left"||t==="right"?a&&r>n:!a&&i>n};function dde(e=()=>{}){const t=Jn(e);Lr(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function hde(e){return e.nodeType===e.ELEMENT_NODE}function fde(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function TN(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var pde=Y9,oH=X9,lH=J9,cH=eH,uH=tH,dH=rH,hH=jI;function fH(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=fH(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function mt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=fH(e))&&(r&&(r+=" "),r+=t);return r}const h4=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,f4=mt,Wm=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return f4(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],h=a==null?void 0:a[u];if(d===null)return null;const f=h4(d)||h4(h);return i[u][f]}),l=n&&Object.entries(n).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:f,...p}=d;return Object.entries(p).every(m=>{let[g,y]=m;return Array.isArray(y)?y.includes({...a,...l}[g]):{...a,...l}[g]===y})?[...u,h,f]:u},[]);return f4(e,o,c,n==null?void 0:n.class,n==null?void 0:n.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 mde=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pH=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).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 gde={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 yde=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...l},c)=>x.createElement("svg",{ref:c,...gde,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:pH("lucide",i),...l},[...o.map(([u,d])=>x.createElement(u,d)),...Array.isArray(a)?a:[a]]));/**
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 ue=(e,t)=>
60{const n=x.forwardRef(({className:r,...i},a)=>x.createElement(yde,{ref:a,iconNode:t,className:pH(`lucide-${mde(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
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 mH=ue("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-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 vde=ue("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
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 xde=ue("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
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 bde=ue("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);/**
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 Wt=ue("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
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 Gn=ue("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
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 wde=ue("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
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 Ls=ue("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
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 jde=ue("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
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 _de=ue("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"}]]);/**
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 Sde=ue("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"}]]);/**
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 Wd=ue("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/**
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 kde=ue("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"}]]);/**
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 Nde=ue("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
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 gH=ue("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"}]]);/**
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 pr=ue("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"}
140],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
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 Cde=ue("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"}]]);/**
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 Ade=ue("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"}]]);/**
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 yH=ue("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"}]]);/**
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 _I=ue("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/**
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 Fr=ue("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
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 Ta=ue("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
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 Ph=ue("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
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 Us=ue("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
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 Tde=ue("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
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 va=ue("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"}]]);/**
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 fo=ue("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
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 sn=ue("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
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 I_=ue("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"}]]);/**
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 SI=ue("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
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 Ede=ue("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/**
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 gn=ue("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"}]]);/**
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 vH=ue("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
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 Yn=ue("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
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 Pde=ue("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",ke
235y:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
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 Ode=ue("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"}]]);/**
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 xH=ue("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"}]]);/**
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 Rl=ue("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"}]]);/**
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 Ide=ue("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
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 tc=ue("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"}]]);/**
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 Na=ue("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"}]]);/**
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 bH=ue("Factory",[["path",{d:"M2 20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8l-7 5V8l-7 5V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"159hny"}],["path",{d:"M17 18h1",key:"uldtlt"}],["path",{d:"M12 18h1",key:"s9uhes"}],["path",{d:"M7 18h1",key:"1neino"}]]);/**
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 Rde=ue("FileCheck2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m3 15 2 2 4-4",key:"1lhrkk"}]]);/**
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 wH=ue("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"}]]);/**
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 ti=ue("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"}]]);/**
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 jH=ue("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
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 Dde=ue("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}
295],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);/**
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 Oh=ue("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
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 zp=ue("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"}]]);/**
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 _H=ue("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
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 p4=ue("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
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 Mde=ue("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
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 SH=ue("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"}]]);/**
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 $de=ue("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"}]]);/**
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 Lde=ue("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"}]]);/**
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 Pu=ue("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
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 m4=ue("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
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 Fde=ue("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
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 kH=ue("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
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 zde=ue("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",ke
360y:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
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 g4=ue("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/**
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 NH=ue("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
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 ne=ue("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 y4=ue("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/**
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 Zo=ue("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
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 qT=ue("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
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 gj=ue("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"}]]);/**
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 Bde=ue("MailX",[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h9",key:"1j9vog"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m17 17 4 4",key:"1b3523"}],["path",{d:"m21 17-4 4",key:"uinynz"}]]);/**
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 qs=ue("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"}]]);/**
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 Um=ue("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"}]]);/**
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 CH=ue("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"}]]);/**
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 Ev=ue("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"}]]);/**
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 AH=ue("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}
425],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);/**
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 Vde=ue("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
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 TH=ue("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"}]]);/**
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 Wde=ue("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
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 Ude=ue("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"}]]);/**
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 kI=ue("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
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 io=ue("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 ps=ue("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"}]]);/**
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 NI=ue("RotateCcw",[["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"}]]);/**
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 R_=ue("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"}]]);/**
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 CI=ue("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/**
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 Ea=ue("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 Bp=ue("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"}]]);/**
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 qde=ue("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"}]]);/**
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 Hde=ue("ShieldAlert",[["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
495y:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
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 Hs=ue("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
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 AI=ue("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",key:"oel41y"}]]);/**
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 Vp=ue("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/**
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 EH=ue("Sigma",[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]]);/**
516 * @license lucide-react v0.462.0 - ISC
517 *
518 * This source code is licensed under the ISC license.
519 * See the LICENSE file in the root directory of this source tree.
520 */const Cn=ue("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"}]]);/**
521 * @license lucide-react v0.462.0 - ISC
522 *
523 * This source code is licensed under the ISC license.
524 * See the LICENSE file in the root directory of this source tree.
525 */const PH=ue("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"}]]);/**
526 * @license lucide-react v0.462.0 - ISC
527 *
528 * This source code is licensed under the ISC license.
529 * See the LICENSE file in the root directory of this source tree.
530 */const OH=ue("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"}]]);/**
531 * @license lucide-react v0.462.0 - ISC
532 *
533 * This source code is licensed under the ISC license.
534 * See the LICENSE file in the root directory of this source tree.
535 */const IH=ue("Stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]);/**
536 * @license lucide-react v0.462.0 - ISC
537 *
538 * This source code is licensed under the ISC license.
539 * See the LICENSE file in the root directory of this source tree.
540 */const Kde=ue("StickyNote",[["path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",key:"qazsjp"}],["path",{d:"M15 3v4a2 2 0 0 0 2 2h4",key:"40519r"}]]);/**
541 * @license lucide-react v0.462.0 - ISC
542 *
543 * This source code is licensed under the ISC license.
544 * See the LICENSE file in the root directory of this source tree.
545 */const Gde=ue("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
546 * @license lucide-react v0.462.0 - ISC
547 *
548 * This source code is licensed under the ISC license.
549 * See the LICENSE file in the root directory of this source tree.
550 */const RH=ue("Swords",[["polyline",{points:"14.5 17.5 3 6 3 3 6 3 17.5 14.5",key:"1hfsw2"}],["line",{x1:"13",x2:"19",y1:"19",y2:"13",key:"1vrmhu"}],["line",{x1:"16",x2:"20",y1:"16",y2:"20",key:"1bron3"}],["line",{x1:"19",x2:"21",y1:"21",y2:"19",key:"13pww6"}],["polyline",{points:"14.5 6.5 18 3 21 3 21 6 17.5 9.5",key:"hbey2j"}],["line",{x1:"5",x2:"9",y1:"14",y2:"18",key:"1hf58s"}],["line",{x1:"7",x2:"4",y1:"17",y2:"20",key:"pidxm4"}],["line",{x1:"3",x2:"5",y1:"19",y2:"21",key:"1pehsh"}]]);/**
551 * @license lucide-react v0.462.0 - ISC
552 *
553 * This source code is licensed under the ISC license.
554 * See the LICENSE file in the root directory of this source tree.
555 */const Gl=ue("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
vendor: 8,974 bytes, lines 555-595
555],["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"}]]);/**
556 * @license lucide-react v0.462.0 - ISC
557 *
558 * This source code is licensed under the ISC license.
559 * See the LICENSE file in the root directory of this source tree.
560 */const Wp=ue("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"}]]);/**
561 * @license lucide-react v0.462.0 - ISC
562 *
563 * This source code is licensed under the ISC license.
564 * See the LICENSE file in the root directory of this source tree.
565 */const ir=ue("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"}]]);/**
566 * @license lucide-react v0.462.0 - ISC
567 *
568 * This source code is licensed under the ISC license.
569 * See the LICENSE file in the root directory of this source tree.
570 */const yj=ue("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"}]]);/**
571 * @license lucide-react v0.462.0 - ISC
572 *
573 * This source code is licensed under the ISC license.
574 * See the LICENSE file in the root directory of this source tree.
575 */const v4=ue("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"}]]);/**
576 * @license lucide-react v0.462.0 - ISC
577 *
578 * This source code is licensed under the ISC license.
579 * See the LICENSE file in the root directory of this source tree.
580 */const Yde=ue("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"}]]);/**
581 * @license lucide-react v0.462.0 - ISC
582 *
583 * This source code is licensed under the ISC license.
584 * See the LICENSE file in the root directory of this source tree.
585 */const po=ue("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"}]]);/**
586 * @license lucide-react v0.462.0 - ISC
587 *
588 * This source code is licensed under the ISC license.
589 * See the LICENSE file in the root directory of this source tree.
590 */const Ui=ue("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
591 * @license lucide-react v0.462.0 - ISC
592 *
593 * This source code is licensed under the ISC license.
594 * See the LICENSE file in the root directory of this source tree.
595 */const DH=ue("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"}]]),TI="-",Qde=e=>{const t=Zde(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(TI);return l[0]===""&&l.length!==1&&l.shift(),MH(l,t)||Xde(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},MH=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?MH(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(TI);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},x4=/^\[(.+)\]$/,Xde=e=>{if(x4.test(e)){const t=x4.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Zde=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ehe(Object.entries(e.classGroups),n).forEach(([a,o])=>{HT(o,r,a,t)}),r},HT=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:b4(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(Jde(i)){HT(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,o])=>{HT(o,b4(t,a),n,r)})})},b4=(e,t)=>{let n=e;return t.split(TI).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Jde=e=>e.isThemeGetter,ehe=(e,t)=>t?e.map(([n,r])=>{const i=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,l])=>[t+o,l])):a);return[n,i]}):e,the=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return i(a,o),o},set(a,o){n.has(a)?n.set(a,o):i(a,o)}}},$H="!",nhe=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=l=>{const c=[];let u=0,d=0,h;for(let y=0;y<l.length;y++){let b=l[y];if(u===0){if(b===i&&(r||l.slice(y,y+a)===t)){c.push(l.slice(d,y)),d=y+a;continue}if(b==="/"){h=y;continue}}b==="["?u++:b==="]"&&u--}const f=c.length===0?l:l.substring(d),p=f.startsWith($H),m=p?f.substring(1):f,g=h&&h>d?h-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}};return n?l=>n({className:l,parseClassName:o}):o},rhe=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},ihe=e=>({cache:the(e.cacheSize),parseClassName:nhe(e),...Qde(e)}),she=/\s+/,ahe=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(she);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:p}=n(u);let m=!!p,g=r(m?f.substring(0,p):f);if(!g){if(!m){l=u+(l.length>0?" "+l:l);continue}if(g=r(f),!g){l=u+(l.length>0?" "+l:l);continue}m=!1}const y=rhe(d).join(":"),b=h?y+$H:y,v=b+g;if(a.includes(v))continue;a.push(v);const w=i(g,m);for(let _=0;_<w.length;++_){const j=w[_];a.push(b+j)}l=u+(l.length>0?" "+l:l)}return l};function ohe(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=LH(t))&&(r&&(r+=" "),r+=n);return r}const LH=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=LH(e[r]))&&(n&&(n+=" "),n+=t);return n};function lhe(e,...t){let n,r,i,a=o;function o(c){const u=t.reduce((d,h)=>h(d),e());return n=ihe(u),r=n.cache.get,i=n.cache.set,a=l,l(c)}function l(c){const u=r(c);if(u)return u;const d=ahe(c,n);return i(c,d),d}return function(){return a(ohe.apply(null,arguments))}}const vn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},FH=/^\[(?:([a-z-]+):)?(.+)\]$/i,che=/^\d+\/\d+$/,uhe=new Set(["px","full","screen"]),dhe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hhe=/\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$/,fhe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,phe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mhe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hl=e=>cp(e)||uhe.has(e)||che.test(e),mc=e=>qm(e,"length",_he),cp=e=>!!e&&!Number.isNaN(Number(e)),EN=e=>qm(e,"number",cp),zg=e=>!!e&&Number.isInteger(Number(e)),ghe=e=>e.endsWith("%")&&cp(e.slice(0,-1)),bt=e=>FH.test(e),gc=e=>dhe.test(e),yhe=new Set(["length","size","percentage"]),vhe=e=>qm(e,yhe,zH),xhe=e=>qm(e,"position",zH),bhe=new Set(["image","url"]),whe=e=>qm(e,bhe,khe),jhe=e=>qm(e,"",She),Bg=()=>!0,qm=(e,t,n)=>{const r=FH.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},_he=e=>hhe.test(e)&&!fhe.test(e),zH=()=>!1,She=e=>phe.test(e),khe=e=>mhe.test(e),Nhe=()=>{const e=vn("colors"),t=vn("spacing"),n=vn("blur"),r=vn("brightness"),i=vn("borderColor"),a=vn("borderRadius"),o=vn("borderSpacing"),l=vn("borderWidth"),c=vn("contrast"),u=vn("grayscale"),d=vn("hueRotate"),h=vn("invert"),f=vn("gap"),p=vn("gradientColorStops"),m=vn("gradientColorStopPositions"),g=vn("inset"),y=vn("margin"),b=vn("opacity"),v=vn("padding"),w=vn("saturate"),_=vn("scale"),j=vn("sepia"),S=vn("skew"),k=vn("space"),N=vn("translate"),T=()=>["auto","contain","none"],C=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",bt,t],O=()=>[bt,t],z=()=>["",hl,mc],$=()=>["auto",cp,bt],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],P=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",bt],R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[cp,bt];return{cacheSize:500,separator:":",theme:{colors:[Bg],spacing:[hl,mc],blur:["none","",gc,bt],brightness:K(),borderColor:[e],borderRadius:["n
595one","","full",gc,bt],borderSpacing:O(),borderWidth:z(),contrast:K(),grayscale:M(),hueRotate:K(),invert:M(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[ghe,mc],inset:A(),margin:A(),opacity:K(),padding:O(),saturate:K(),scale:K(),sepia:M(),skew:K(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",bt]}],container:["container"],columns:[{columns:[gc]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:[...F(),bt]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",zg,bt]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",bt]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",zg,bt]}],"grid-cols":[{"grid-cols":[Bg]}],"col-start-end":[{col:["auto",{span:["full",zg,bt]},bt]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[Bg]}],"row-start-end":[{row:["auto",{span:[zg,bt]},bt]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",bt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",bt]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",bt,t]}],"min-w":[{"min-w":[bt,t,"min","max","fit"]}],"max-w":[{"max-w":[bt,t,"none","full","min","max","fit","prose",{screen:[gc]},gc]}],h:[{h:[bt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[bt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[bt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[bt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",gc,mc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",EN]}],"font-family":[{font:[Bg]}],"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",bt]}],"line-clamp":[{"line-clamp":["none",cp,EN]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",hl,bt]}],"list-image":[{"list-image":["none",bt]}],"list-style-type":[{list:["none","disc","decimal",bt]}],"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:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",hl,mc]}],"underline-offset":[{"underline-offset":["auto",hl,bt]}],"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:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",bt]}],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",bt]}],"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:[...F(),xhe]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vhe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},whe]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}
vendor: 4,886 bytes, line 595
595],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"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:[...B(),"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:B()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[hl,bt]}],"outline-w":[{outline:[hl,mc]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[hl,mc]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",gc,jhe]}],"shadow-color":[{shadow:[Bg]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...P(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":P()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",gc,bt]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[w]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"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",bt]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",bt]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",bt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[zg,bt]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",bt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",bt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}
595],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",bt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[hl,mc,EN]}],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"]}}},Che=lhe(Nhe);function ae(...e){return Che(mt(e))}function Qn(e,t="An error occurred. Please try again."){if(!e)return t;const n=e==null?void 0:e.code;return n==="23505"?"This record already exists.":n==="42501"?"Permission denied.":n==="23503"?"A related record was not found.":n==="23514"?"Invalid data provided.":t}function D_(e){if(!e||e<1)return"0s";const t=Math.round(e),n=Math.floor(t/60),r=Math.floor(n/60);return r>0?`${r}h ${(n%60).toString().padStart(2,"0")}m`:n>0?`${n}m ${(t%60).toString().padStart(2,"0")}s`:`${t}s`}const Ahe=pde,BH=x.forwardRef(({className:e,...t},n)=>s.jsx(oH,{ref:n,className:ae("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}));BH.displayName=oH.displayName;const The=Wm("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"}}),VH=x.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(lH,{ref:r,className:ae(The({variant:t}),e),...n}));VH.displayName=lH.displayName;const Ehe=x.forwardRef(({className:e,...t},n)=>s.jsx(dH,{ref:n,className:ae("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}));Ehe.displayName=dH.displayName;const WH=x.forwardRef(({className:e,...t},n)=>s.jsx(hH,{ref:n,className:ae("absolute right-2 top-2 rounded-md p-1 text-foreground
595/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:s.jsx(Ui,{className:"h-4 w-4"})}));WH.displayName=hH.displayName;const UH=x.forwardRef(({className:e,...t},n)=>s.jsx(cH,{ref:n,className:ae("text-sm font-semibold",e),...t}));UH.displayName=cH.displayName;const qH=x.forwardRef(({className:e,...t},n)=>s.jsx(uH,{ref:n,className:ae("text-sm opacity-90",e),...t}));qH.displayName=uH.displayName;function Phe(){const{toasts:e}=xt();return s.jsxs(Ahe,{children:[e.map(function({id:t,title:n,description:r,action:i,...a}){return s.jsxs(VH,{...a,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(UH,{children:n}),r&&s.jsx(qH,{children:r})]}),i,s.jsx(WH,{})]},t)}),s.jsx(BH,{})]})}var w4=["light","dark"],Ohe="(prefers-color-scheme: dark)",Ihe=x.createContext(void 0),Rhe={setTheme:e=>{},themes:[]},Dhe=()=>{var e;return(e=x.useContext(Ihe))!=null?e:Rhe};x.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,attrs:l,nonce:c})=>{let u=a==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(m=>`'${m}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=i?w4.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(m,g=!1,y=!0)=>{let b=o?o[m]:m,v=g?m+"|| ''":`'${b}'`,w="";return i&&y&&!g&&w4.includes(m)&&(w+=`d.style.colorScheme = '${m}';`),n==="class"?g||b?w+=`c.add(${v})`:w+="null":b&&(w+=`d[s](n,${v})`),w},p=e?`!function(){${d}${f(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${Ohe}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${u?"":"else{"+f(a,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(a,!1,!1)};}${h}}catch(t){}}();`;return x.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:p}})});var Mhe=e=>{switch(e){case"success":return Fhe;case"info":return Bhe;case"warning":return zhe;case"error":return Vhe;default:return null}},$he=Array(12).fill(0),Lhe=({visible:e,className:t})=>L.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},L.createElement("div",{className:"sonner-spinner"},$he.map((n,r)=>L.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Fhe=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.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"})),zhe=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},L.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"})),Bhe=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.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"})),Vhe=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.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"})),Whe=L.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"},L.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),L.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Uhe=()=>{let[e,t]=L.useState(document.hidden);return L.useEffect(()=>{let n=()=>{t(document.hidden)};
595return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},KT=1,qhe=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:n,...r}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:KT++,a=this.toasts.find(l=>l.id===i),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...e,id:i,title:n}),{...l,...e,id:i,dismissible:o,title:n}):l):this.addToast({title:n,...r,dismissible:o,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({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)=>
595this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),i=n!==void 0,a,o=r.then(async c=>{if(a=["resolve",c],L.isValidElement(c))i=!1,this.create({id:n,type:"default",message:c});else if(Khe(c)&&!c.ok){i=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:u,description:d})}else if(t.success!==void 0){i=!1;let u=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:u,description:d})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){i=!1;let u=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:u,description:d})}}).finally(()=>{var c;i&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>o.then(()=>a[0]==="reject"?u(a[1]):c(a[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||KT++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},es=new qhe,Hhe=(e,t)=>{let n=(t==null?void 0:t.id)||KT++;return es.addToast({title:e,...t,id:n}),n},Khe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Ghe=Hhe,Yhe=()=>es.toasts,Qhe=()=>es.getActiveToasts(),gi=Object.assign(Ghe,{success:es.success,info:es.info,warning:es.warning,error:es.error,custom:es.custom,message:es.message,promise:es.promise,dismiss:es.dism
595iss,loading:es.loading},{getHistory:Yhe,getToasts:Qhe});function Xhe(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Xhe(`: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;
595left: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}
595: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%);
595--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%)}
596`);function f0(e){return e.label!==void 0}var Zhe=3,Jhe="32px",efe="16px",j4=4e3,tfe=356,nfe=14,rfe=20,ife=200;function $a(...e){return e.filter(Boolean).join(" ")}function sfe(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var afe=e=>{var t,n,r,i,a,o,l,c,u,d,h;let{invert:f,toast:p,unstyled:m,interacting:g,setHeights:y,visibleToasts:b,heights:v,index:w,toasts:_,expanded:j,removeToast:S,defaultRichColors:k,closeButton:N,style:T,cancelButtonStyle:C,actionButtonStyle:A,className:O="",descriptionClassName:z="",duration:$,position:F,gap:B,loadingIcon:P,expandByDefault:I,classNames:M,icons:R,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:D}=e,[E,q]=L.useState(null),[X,re]=L.useState(null),[Y,le]=L.useState(!1),[Z,de]=L.useState(!1),[pe,J]=L.useState(!1),[be,ee]=L.useState(!1),[Ce,Re]=L.useState(!1),[Ze,Ee]=L.useState(0),[kt,V]=L.useState(0),Q=L.useRef(p.duration||$||j4),te=L.useRef(null),ve=L.useRef(null),we=w===0,G=w+1<=b,U=p.type,ie=p.dismissible!==!1,ke=p.className||"",Ge=p.descriptionClassName||"",jt=L.useMemo(()=>v.findIndex(at=>at.toastId===p.id)||0,[v,p.id]),Tn=L.useMemo(()=>{var at;return(at=p.closeButton)!=null?at:N},[p.closeButton,N]),vs=L.useMemo(()=>p.duration||$||j4,[p.duration,$]),Bn=L.useRef(0),ar=L.useRef(0),_r=L.useRef(0),tn=L.useRef(null),[li,Vr]=F.split("-"),Ub=L.useMemo(()=>v.reduce((at,$t,Ht)=>Ht>=jt?at:at+$t.height,0),[v,jt]),Ki=Uhe(),Uh=p.invert||f,ul=U==="loading";ar.current=L.useMemo(()=>jt*B+Ub,[jt,Ub]),L.useEffect(()=>{Q.current=vs},[vs]),L.useEffect(()=>{le(!0)},[]),L.useEffect(()=>{let at=ve.current;if(at){let $t=at.getBoundingClientRect().height;return V($t),y(Ht=>[{toastId:p.id,height:$t,position:p.position},...Ht]),()=>y(Ht=>Ht.filter(ki=>ki.toastId!==p.id))}},[y,p.id]),L.useLayoutEffect(()=>{if(!Y)return;let at=ve.current,$t=at.style.height;at.style.height="auto";let Ht=at.getBoundingClientRect().height;at.style.height=$t,V(Ht),y(ki=>ki.find(xs=>xs.toastId===p.id)?ki.map(xs=>xs.toastId===p.id?{...xs,height:Ht}:xs):[{toastId:p.id,height:Ht,position:p.position},...ki])},[Y,p.title,p.description,y,p.id]);let ta=L.useCallback(()=>{de(!0),Ee(ar.current),y(at=>at.filter($t=>$t.toastId!==p.id)),setTimeout(()=>{S(p)},ife)},[p,S,y,ar]);L.useEffect(()=>{if(p.promise&&U==="loading"||p.duration===1/0||p.type==="loading")return;let at;return j||g||D&&Ki?(()=>{if(_r.current<Bn.current){let $t=new Date().getTime()-Bn.current;Q.current=Q.current-$t}
596_r.current=new Date().getTime()})():Q.current!==1/0&&(Bn.current=new Date().getTime(),at=setTimeout(()=>{var $t;($t=p.onAutoClose)==null||$t.call(p,p),ta()},Q.current)),()=>clearTimeout(at)},[j,g,p,U,D,Ki,ta]),L.useEffect(()=>{p.delete&&ta()},[ta,p.delete]);function Hk(){var at,$t,Ht;return R!=null&&R.loading?L.createElement("div",{className:$a(M==null?void 0:M.loader,(at=p==null?void 0:p.classNames)==null?void 0:at.loader,"sonner-loader"),"data-visible":U==="loading"},R.loading):P?L.createElement("div",{className:$a(M==null?void 0:M.loader,($t=p==null?void 0:p.classNames)==null?void 0:$t.loader,"sonner-loader"),"data-visible":U==="loading"},P):L.createElement(Lhe,{className:$a(M==null?void 0:M.loader,(Ht=p==null?void 0:p.classNames)==null?void 0:Ht.loader),visible:U==="loading"})}return L.createElement("li",{tabIndex:0,ref:ve,className:$a(O,ke,M==null?void 0:M.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,M==null?void 0:M.default,M==null?void 0:M[U],(n=p==null?void 0:p.classNames)==null?void 0:n[U]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:k,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":Y,"data-promise":!!p.promise,"data-swiped":Ce,"data-removed":Z,"data-visible":G,"data-y-position":li,"data-x-position":Vr,"data-index":w,"data-front":we,"data-swiping":pe,"data-dismissible":ie,"data-type":U,"data-invert":Uh,"data-swipe-out":be,"data-swipe-direction":X,"data-expanded":!!(j||I&&Y),style:{"--index":w,"--toasts-before":w,"--z-index":_.length-w,"--offset":`${Z?Ze:ar.current}px`,"--initial-height":I?"auto":`${kt}px`,...T,...p.style},onDragEnd:()=>{J(!1),q(null),tn.current=null},onPointerDown:at=>{ul||!ie||(te.current=new Date,Ee(ar.current),at.target.setPointerCapture(at.pointerId),at.target.tagName!=="BUTTON"&&(J(!0),tn.current={x:at.clientX,y:at.clientY}))},onPointerUp:()=>{var at,$t,Ht,ki;if(be||!ie)return;tn.current=null;let xs=Number(((at=ve.current)==null?void 0:at.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),or=Number((($t=ve.current)==null?void 0:$t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),dl=new Date().getTime()-((Ht=te.current)==null?void 0:Ht.getTime()),Ni=E==="x"?xs:or,Gi=Math.abs(Ni)/dl;if(Math.abs(Ni)>=rfe||Gi>.11){Ee(ar.current),(ki=p.onDismiss)==null||ki.call(p,p),re(E==="x"?xs>0?"right":"left":or>0?"down":"up"),ta(),ee(!0),Re(!1);return}J(!1),q(null)},onPointerMove:at=>{var $t,Ht,ki,xs;
596if(!tn.current||!ie||(($t=window.getSelection())==null?void 0:$t.toString().length)>0)return;let or=at.clientY-tn.current.y,dl=at.clientX-tn.current.x,Ni=(Ht=e.swipeDirections)!=null?Ht:sfe(F);!E&&(Math.abs(dl)>1||Math.abs(or)>1)&&q(Math.abs(dl)>Math.abs(or)?"x":"y");let Gi={x:0,y:0};E==="y"?(Ni.includes("top")||Ni.includes("bottom"))&&(Ni.includes("top")&&or<0||Ni.includes("bottom")&&or>0)&&(Gi.y=or):E==="x"&&(Ni.includes("left")||Ni.includes("right"))&&(Ni.includes("left")&&dl<0||Ni.includes("right")&&dl>0)&&(Gi.x=dl),(Math.abs(Gi.x)>0||Math.abs(Gi.y)>0)&&Re(!0),(ki=ve.current)==null||ki.style.setProperty("--swipe-amount-x",`${Gi.x}px`),(xs=ve.current)==null||xs.style.setProperty("--swipe-amount-y",`${Gi.y}px`)}},Tn&&!p.jsx?L.createElement("button",{"aria-label":K,"data-disabled":ul,"data-close-button":!0,onClick:ul||!ie?()=>{}:()=>{var at;ta(),(at=p.onDismiss)==null||at.call(p,p)},className:$a(M==null?void 0:M.closeButton,(i=p==null?void 0:p.classNames)==null?void 0:i.closeButton)},(a=R==null?void 0:R.close)!=null?a:Whe):null,p.jsx||x.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:L.createElement(L.Fragment,null,U||p.icon||p.promise?L.createElement("div",{"data-icon":"",className:$a(M==null?void 0:M.icon,(o=p==null?void 0:p.classNames)==null?void 0:o.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Hk():null,p.type!=="loading"?p.icon||(R==null?void 0:R[U])||Mhe(U):null):null,L.createElement("div",{"data-content":"",className:$a(M==null?void 0:M.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},L.createElement("div",{"data-title":"",className:$a(M==null?void 0:M.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?L.createElement("div",{"data-description":"",className:$a(z,Ge,M==null?void 0:M.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),x.isValidElement(p.cancel)?p.cancel:p.cancel&&f0(p.cancel)?L.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||C,onClick:at=>{var $t,Ht;f0(p.cancel)&&ie&&((Ht=($t=p.cancel).onClick)==null||Ht.call($t,at),ta())},className:$a(M==null?void 0:M.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,x.isValidElement(p.action)?p.action:p.action&&f0(p.action)?L.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||A,onClick:at=>{var $t,Ht;f0(p.action)&&((Ht=($t=p.action).onClick)==null||Ht.call($t,at),!at.defaultPrevented&&ta())},className:$a(M==null?void 0:M.actionButton,(h=p==null?void 0:p.classNames)==null?void 0:h.actionButton)},p.action.label):null))};function _4(){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 ofe(e,t){let n={};return[e,t].forEach((r,i)=>{let a=i===1,o=a?"--mobile-offset":"--offset",l=a?efe:Jhe;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${o}-${u}`]=l:n[`${o}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(l)}),n}var lfe=x.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:o,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:h,duration:f,style:p,visibleToasts:m=Zhe,toastOptions:g,dir:y=_4(),gap:b=nfe,loadingIcon:v,icons:w,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:j}=e,[S,k]=L.useState([]),N=L.useMemo(()=>Array.from(new Set([r].concat(S.filter(D=>D.position).map(D=>D.position)))),[S,r]),[T,C]=L.useState([]),[A,O]=L.useState(!1),[z,$]=L.useState(!1),[F,B]=L.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),P=L.useRef(null),I=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=L.useRef(null),R=L.useRef(!1),K=L.useCallback(D=>{k(E=>{var q;return(q=E.find(X=>X.id===D.id))!=null&&q.delete||es.dismiss(D.id),E.filter(({id:X})=>X!==D.id)})},[]);return L.useEffect(()=>es.subscribe(D=>{if(D.dismiss){k(E=>E.map(q=>q.id===D.id?{...q,delete:!0}:q));return}setTimeout(()=>{P9.flushSync(()=>{k(E=>{let q=E.findIndex(X=>X.id===D.id);return q!==-1?[...E.slice(0,q),{...E[q],...D},...E.slice(q+1)]:[D,...E]})})})}),[]),L.useEffect(()=>{if(d!=="system"){B(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;let D=window.matchMedia("(prefers-color-scheme: dark)");try{D.addEventListener("change",({matches:E})=>{B(E?"dark":"light")})}catch{D.addListener(({matches:q})=>{try{B(q?"dark":"light")}catch(X){console.error(X)}})}},[d]),L.useEffect(()=>{S.length<=1&&O(!1)},[S]),L.useEffect(()=>{let D=E=>{var q,X;i.every(re=>E[re]||E.code===re)&&(O(!0),(q=P.current)==null||q.focus()),E.code==="Escape"&&(document.activeElement===P.current||(X=P.current)!=null&&X.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[i]),L.useEffect(()=>{if(P.current)return()=>
vendor: 4,768 bytes, line 596
596{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,R.current=!1)}},[P.current]),L.createElement("section",{ref:t,"aria-label":`${_} ${I}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((D,E)=>{var q;let[X,re]=D.split("-");return S.length?L.createElement("ol",{key:D,dir:y==="auto"?_4():y,tabIndex:-1,ref:P,className:l,"data-sonner-toaster":!0,"data-theme":F,"data-y-position":X,"data-lifted":A&&S.length>1&&!a,"data-x-position":re,style:{"--front-toast-height":`${((q=T[0])==null?void 0:q.height)||0}px`,"--width":`${tfe}px`,"--gap":`${b}px`,...p,...ofe(c,u)},onBlur:Y=>{R.current&&!Y.currentTarget.contains(Y.relatedTarget)&&(R.current=!1,M.current&&(M.current.focus({preventScroll:!0}),M.current=null))},onFocus:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||R.current||(R.current=!0,M.current=Y.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{z||O(!1)},onDragEnd:()=>O(!1),onPointerDown:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},S.filter(Y=>!Y.position&&E===0||Y.position===D).map((Y,le)=>{var Z,de;return L.createElement(afe,{key:Y.id,icons:w,index:le,toast:Y,defaultRichColors:h,duration:(Z=g==null?void 0:g.duration)!=null?Z:f,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:m,closeButton:(de=g==null?void 0:g.closeButton)!=null?de:o,interacting:z,position:D,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:K,toasts:S.filter(pe=>pe.position==Y.position),heights:T.filter(pe=>pe.position==Y.position),setHeights:C,expandByDefault:a,gap:b,loadingIcon:v,expanded:A,pauseWhenPageIsHidden:j,swipeDirections:e.swipeDirections})})):null}))});const cfe=({...e})=>{const{theme:t="system"}=Dhe();return s.jsx(lfe,{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 ufe=CO[" useId ".trim().toString()]||(()=>{}),dfe=0;function gr(e){const[t,n]=x.useState(ufe());return Lr(()=>{n(r=>r??String(dfe++))},[e]),t?`radix-${t}`:""}const hfe=["top","right","bottom","left"],vu=Math.min,Rs=Math.max,vj=Math.round,p0=Math.floor,Ho=e=>({x:e,y:e}),ffe={left:"right",right:"left",bottom:"top",top:"bottom"},pfe={start:"end",end:"start"};function GT(e,t,n){return Rs(e,vu(t,n))}function Yl(e,t){return typeof e=="function"?e(t):e}function Ql(e){return e.split("-")[0]}function Hm(e){return e.split("-")[1]}function EI(e){return e==="x"?"y":"x"}function PI(e){return e==="y"?"height":"width"}const mfe=new Set(["top","bottom"]);function Fo(e){return mfe.has(Ql(e))?"y":"x"}function OI(e){return EI(Fo(e))}function gfe(e,t,n){n===void 0&&(n=!1);const r=Hm(e),i=OI(e),a=PI(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=xj(o)),[o,xj(o)]}function yfe(e){const t=xj(e);return[YT(e),t,YT(t)]}function YT(e){return e.replace(/start|end/g,t=>pfe[t])}const S4=["left","right"],k4=["right","left"],vfe=["top","bottom"],xfe=["bottom","top"];function bfe(e,t,n){switch(e){case"top":case"bottom":return n?t?k4:S4:t?S4:k4;case"left":case"right":return t?vfe:xfe;default:return[]}}function wfe(e,t,n,r){const i=Hm(e);let a=bfe(Ql(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(YT)))),a}function xj(e){return e.replace(/left|right|bottom|top/g,t=>ffe[t])}function jfe(e){return{top:0,right:0,bottom:0,left:0,...e}}function HH(e){return typeof e!="number"?jfe(e):{top:e,right:e,bottom:e,left:e}}function bj(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function N4(e,t,n){let{reference:r,floating:i}=e;const a=Fo(t),o=OI(t),l=PI(o),c=Ql(t),u=a==="y",d=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,f=r[l]/2-i[l]/2;let p;switch(c){case"top":p={x:d,y:r.y-i.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:h};break;case"left":p={x:r.x-i.width,y:h};break;default:p={x:r.x,y:r.y}}switch(Hm(t)){case"start":p[o]-=f*(n&&u?-1:1);break;case"end":p[o]+=f*(n&&u?-1:1);break}return p}const _fe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}
vendor: 7,534 bytes, line 596
596=n,l=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:h}=N4(u,r,c),f=r,p={},m=0;for(let g=0;g<l.length;g++){const{name:y,fn:b}=l[g],{x:v,y:w,data:_,reset:j}=await b({x:d,y:h,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:u,platform:o,elements:{reference:e,floating:t}});d=v??d,h=w??h,p={...p,[y]:{...p[y],..._}},j&&m<=50&&(m++,typeof j=="object"&&(j.placement&&(f=j.placement),j.rects&&(u=j.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):j.rects),{x:d,y:h}=N4(u,f,c)),g=-1)}return{x:d,y:h,placement:f,strategy:i,middlewareData:p}};async function Pv(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:p=0}=Yl(t,e),m=HH(p),y=l[f?h==="floating"?"reference":"floating":h],b=bj(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(y)))==null||n?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),v=h==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),_=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},j=bj(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:w,strategy:c}):v);return{top:(b.top-j.top+m.top)/_.y,bottom:(j.bottom-b.bottom+m.bottom)/_.y,left:(b.left-j.left+m.left)/_.x,right:(j.right-b.right+m.right)/_.x}}const Sfe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Yl(e,t)||{};if(u==null)return{};const h=HH(d),f={x:n,y:r},p=OI(i),m=PI(p),g=await o.getDimensions(u),y=p==="y",b=y?"top":"left",v=y?"bottom":"right",w=y?"clientHeight":"clientWidth",_=a.reference[m]+a.reference[p]-f[p]-a.floating[m],j=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let k=S?S[w]:0;(!k||!await(o.isElement==null?void 0:o.isElement(S)))&&(k=l.floating[w]||a.floating[m]);const N=_/2-j/2,T=k/2-g[m]/2-1,C=vu(h[b],T),A=vu(h[v],T),O=C,z=k-g[m]-A,$=k/2-g[m]/2+N,F=GT(O,$,z),B=!c.arrow&&Hm(i)!=null&&$!==F&&a.reference[m]/2-($<O?C:A)-g[m]/2<0,P=B?$<O?$-O:$-z:0;return{[p]:f[p]+P,data:{[p]:F,centerOffset:$-F-P,...B&&{alignmentOffset:P}},reset:B}}}),kfe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=Yl(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const b=Ql(i),v=Fo(l),w=Ql(l)===l,_=await(c.isRTL==null?void 0:c.isRTL(u.floating)),j=f||(w||!g?[xj(l)]:yfe(l)),S=m!=="none";!f&&S&&j.push(...wfe(l,g,m,_));const k=[l,...j],N=await Pv(t,y),T=[];let C=((r=a.flip)==null?void 0:r.overflows)||[];if(d&&T.push(N[b]),h){const $=gfe(i,o,_);T.push(N[$[0]],N[$[1]])}if(C=[...C,{placement:i,overflows:T}],!T.every($=>$<=0)){var A,O;const $=(((A=a.flip)==null?void 0:A.index)||0)+1,F=k[$];if(F&&(!(h==="alignment"?v!==Fo(F):!1)||C.every(I=>I.overflows[0]>0&&Fo(I.placement)===v)))return{data:{index:$,overflows:C},reset:{placement:F}};let B=(O=C.filter(P=>P.overflows[0]<=0).sort((P,I)=>P.overflows[1]-I.overflows[1])[0])==null?void 0:O.placement;if(!B)switch(p){case"bestFit":{var z;const P=(z=C.filter(I=>{if(S){const M=Fo(I.placement);return M===v||M==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(M=>M>0).reduce((M,R)=>M+R,0)]).sort((I,M)=>I[1]-M[1])[0])==null?void 0:z[0];P&&(B=P);break}case"initialPlacement":B=l;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function C4(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function A4(e){return hfe.some(t=>e[t]>=0)}const Nfe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Yl(e,t);switch(r){case"referenceHidden":{const a=await Pv(t,{...i,elementContext:"reference"}),o=C4(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:A4(o)}}}case"escaped":{const a=await Pv(t,{...i,altBoundary:!0}),o=C4(a,n.floating);return{data:{escapedOffsets:o,escaped:A4(o)}}}default:return{}}}}},KH=new Set(["left","top"]);async function Cfe(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ql(n),l=Hm(n),c=Fo(n)==="y",u=KH.has(o)?-1:1,d=a&&c?-1:1,h=Yl(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof m=="number"&&(p=l==="end"?m*-1:m),c?{x:p*d,y:f*u}:{x:f*u,y:p*d}}const Afe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:l}=t,c=await Cfe(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:o}}}}},Tfe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:y=>{let{x:b,y:v}=y;return{x:b,y:v}}},...c}=Yl(e,t),u={x:n,y:r},d=await Pv(t,c),h=Fo(Ql(i)),f=EI(h);let p=u[f],m=u[h];if(a){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",v=p+d[y],w=p-d[b];p=GT(v,p,w)}if(o){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=m+d[y],w=m-d[b];m=GT(v,m,w)}const g=l.fn({...t,[f]:p,[h]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[f]:a,[h]:o}}}}}},Efe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Yl(e,t),d={x:n,y:r},h=Fo(i),f=EI(h);let p=d[f],m=d[h];const g=Yl(l,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const w=f==="y"?"height":"width",_=a.reference[f]-a.floating[w]+y.mainAxis,j=a.reference[f]+a.reference[w]-y.mainAxis;p<_?p=_:p>j&&(p=j)}if(u){var b,v;const w=f==="y"?"width":"height",_=KH.has(Ql(i)),j=a.reference[h]-a.floating[w]+(_&&((b=o.offset)==null?void 0:b[h])||0)+(_?0:y.crossAxis),S=a.reference[h]+a.reference[w]+(_?0:((v=o.offset)==null?void 0:v[h])||0)-(_?y.crossAxis:0);m<j?m=j:m>S&&(m=S)}return{[f]:p,[h]:m}}}},Pfe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...u}=Yl(e,t),d=await Pv(t,u),h=Ql(i),f=Hm(i),p=Fo(i)==="y",{width:m,height:g}=a.floating;let y,b;h==="top"||h==="bottom"?(y=h,b=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(b=h,y=f==="end"?"top":"bottom");const v=g-d.top-d.bottom,w=m-d.left-d.right,_=vu(g-d[y],v),j=vu(m-d[b],w),S=!t.middlewareData.shift;let k=_,N=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=v),S&&!f){const C=Rs(d.left,0),A=Rs(d.right,0),O=Rs(d.top,0),z=Rs(d.bottom,0);p?N=m-2*(C!==0||A!==0?C+A:Rs(d.left,d.right)):k=g-2*(O!==0||z!==0?O+z:Rs(d.top,d.bottom))}await c({...t,availableWidth:N,availableHeight:k});const T=await o.getDimensions(l.floating);
vendor: 4,318 bytes, line 596
596return m!==T.width||g!==T.height?{reset:{rects:!0}}:{}}}};function M_(){return typeof window<"u"}function Km(e){return GH(e)?(e.nodeName||"").toLowerCase():"#document"}function Fs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rl(e){var t;return(t=(GH(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function GH(e){return M_()?e instanceof Node||e instanceof Fs(e).Node:!1}function mo(e){return M_()?e instanceof Element||e instanceof Fs(e).Element:!1}function Jo(e){return M_()?e instanceof HTMLElement||e instanceof Fs(e).HTMLElement:!1}function T4(e){return!M_()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Fs(e).ShadowRoot}const Ofe=new Set(["inline","contents"]);function tb(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=go(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Ofe.has(i)}const Ife=new Set(["table","td","th"]);function Rfe(e){return Ife.has(Km(e))}const Dfe=[":popover-open",":modal"];function $_(e){return Dfe.some(t=>{try{return e.matches(t)}catch{return!1}})}const Mfe=["transform","translate","scale","rotate","perspective"],$fe=["transform","translate","scale","rotate","perspective","filter"],Lfe=["paint","layout","strict","content"];function II(e){const t=RI(),n=mo(e)?go(e):e;return Mfe.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||$fe.some(r=>(n.willChange||"").includes(r))||Lfe.some(r=>(n.contain||"").includes(r))}function Ffe(e){let t=xu(e);for(;Jo(t)&&!Up(t);){if(II(t))return t;if($_(t))return null;t=xu(t)}return null}function RI(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const zfe=new Set(["html","body","#document"]);function Up(e){return zfe.has(Km(e))}function go(e){return Fs(e).getComputedStyle(e)}function L_(e){return mo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xu(e){if(Km(e)==="html")return e;const t=e.assignedSlot||e.parentNode||T4(e)&&e.host||rl(e);return T4(t)?t.host:t}function YH(e){const t=xu(e);return Up(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jo(t)&&tb(t)?t:YH(t)}function Ov(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=YH(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=Fs(i);if(a){const l=QT(o);return t.concat(o,o.visualViewport||[],tb(i)?i:[],l&&n?Ov(l):[])}return t.concat(i,Ov(i,[],n))}function QT(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function QH(e){const t=go(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Jo(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,l=vj(n)!==a||vj(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function DI(e){return mo(e)?e:e.contextElement}function up(e){const t=DI(e);if(!Jo(t))return Ho(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=QH(t);let o=(a?vj(n.width):n.width)/r,l=(a?vj(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Bfe=Ho(0);function XH(e){const t=Fs(e);return!RI()||!t.visualViewport?Bfe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vfe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Fs(e)?!1:t}function lh(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=DI(e);let o=Ho(1);t&&(r?mo(r)&&(o=up(r)):o=up(e));const l=Vfe(a,n,r)?XH(a):Ho(0);let c=(i.left+l.x)/o.x,u=(i.top+l.y)/o.y,d=i.width/o.x,h=i.height/o.y;if(a){const f=Fs(a),p=r&&mo(r)?Fs(r):r;let m=f,g=QT(m);for(;g&&r&&p!==m;){const y=up(g),b=g.getBoundingClientRect(),v=go(g),w=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*y.x,_=b.top+(g.clientTop+parseFloat(v.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,h*=y.y,c+=w,u+=_,m=Fs(g),g=QT(m)}}return bj({width:d,height:h,x:c,y:u})}function MI(e,t){const n=L_(e).scrollLeft;return t?t.left+n:lh(rl(e)).left+n}function ZH(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:MI(e,r)),a=r.top+t.scrollTop;return{x:i,y:a}}function Wfe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=rl(r),l=t?$_(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},u=Ho(1);const d=Ho(0),h=Jo(r);
vendor: 5,558 bytes, line 596
596if((h||!h&&!a)&&((Km(r)!=="body"||tb(o))&&(c=L_(r)),Jo(r))){const p=lh(r);u=up(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const f=o&&!h&&!a?ZH(o,c,!0):Ho(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+f.x,y:n.y*u.y-c.scrollTop*u.y+d.y+f.y}}function Ufe(e){return Array.from(e.getClientRects())}function qfe(e){const t=rl(e),n=L_(e),r=e.ownerDocument.body,i=Rs(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Rs(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+MI(e);const l=-n.scrollTop;return go(r).direction==="rtl"&&(o+=Rs(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:l}}function Hfe(e,t){const n=Fs(e),r=rl(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(i){a=i.width,o=i.height;const u=RI();(!u||u&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:l,y:c}}const Kfe=new Set(["absolute","fixed"]);function Gfe(e,t){const n=lh(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Jo(e)?up(e):Ho(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=i*a.x,u=r*a.y;return{width:o,height:l,x:c,y:u}}function E4(e,t,n){let r;if(t==="viewport")r=Hfe(e,n);else if(t==="document")r=qfe(rl(e));else if(mo(t))r=Gfe(t,n);else{const i=XH(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return bj(r)}function JH(e,t){const n=xu(e);return n===t||!mo(n)||Up(n)?!1:go(n).position==="fixed"||JH(n,t)}function Yfe(e,t){const n=t.get(e);if(n)return n;let r=Ov(e,[],!1).filter(l=>mo(l)&&Km(l)!=="body"),i=null;const a=go(e).position==="fixed";let o=a?xu(e):e;for(;mo(o)&&!Up(o);){const l=go(o),c=II(o);!c&&l.position==="fixed"&&(i=null),(a?!c&&!i:!c&&l.position==="static"&&!!i&&Kfe.has(i.position)||tb(o)&&!c&&JH(e,o))?r=r.filter(d=>d!==o):i=l,o=xu(o)}return t.set(e,r),r}function Qfe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?$_(t)?[]:Yfe(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((u,d)=>{const h=E4(t,d,i);return u.top=Rs(h.top,u.top),u.right=vu(h.right,u.right),u.bottom=vu(h.bottom,u.bottom),u.left=Rs(h.left,u.left),u},E4(t,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Xfe(e){const{width:t,height:n}=QH(e);return{width:t,height:n}}function Zfe(e,t,n){const r=Jo(t),i=rl(t),a=n==="fixed",o=lh(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=Ho(0);function u(){c.x=MI(i)}if(r||!r&&!a)if((Km(t)!=="body"||tb(i))&&(l=L_(t)),r){const p=lh(t,!0,a,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else i&&u();a&&!r&&i&&u();const d=i&&!r&&!a?ZH(i,l):Ho(0),h=o.left+l.scrollLeft-c.x-d.x,f=o.top+l.scrollTop-c.y-d.y;return{x:h,y:f,width:o.width,height:o.height}}function PN(e){return go(e).position==="static"}function P4(e,t){if(!Jo(e)||go(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return rl(e)===n&&(n=n.ownerDocument.body),n}function eK(e,t){const n=Fs(e);if($_(e))return n;if(!Jo(e)){let i=xu(e);for(;i&&!Up(i);){if(mo(i)&&!PN(i))return i;i=xu(i)}return n}let r=P4(e,t);for(;r&&Rfe(r)&&PN(r);)r=P4(r,t);return r&&Up(r)&&PN(r)&&!II(r)?n:r||Ffe(e)||n}const Jfe=async function(e){const t=this.getOffsetParent||eK,n=this.getDimensions,r=await n(e.floating);return{reference:Zfe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function epe(e){return go(e).direction==="rtl"}const tpe={convertOffsetParentRelativeRectToViewportRelativeRect:Wfe,getDocumentElement:rl,getClippingRect:Qfe,getOffsetParent:eK,getElementRects:Jfe,getClientRects:Ufe,getDimensions:Xfe,getScale:up,isElement:mo,isRTL:epe};function tK(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function npe(e,t){let n=null,r;const i=rl(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const u=e.getBoundingClientRect(),{left:d,top:h,width:f,height:p}=u;if(l||t(),!f||!p)return;const m=p0(h),g=p0(i.clientWidth-(d+f)),y=p0(i.clientHeight-(h+p)),b=p0(d),w={rootMargin:-m+"px "+-g+"px "+-y+"px "+-b+"px",threshold:Rs(0,vu(1,c))||1};let _=!0;function j(S){const k=S[0].intersectionRatio;if(k!==c){if(!_)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}k===1&&!tK(u,e.getBoundingClientRect())&&o(),_=!1}try{n=new IntersectionObserver(j,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(j,w)}n.observe(e)}return o(!0),a}function rpe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=DI(e),d=i||a?[...u?Ov(u):[],...Ov(t)]:[];d.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const h=u&&l?npe(u,n):null;let f=-1,p=null;o&&(p=new ResizeObserver(b=>{let[v]=b;v&&v.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),u&&!c&&p.observe(u),p.observe(t));let m,g=c?lh(e):null;c&&y();function y(){const b=lh(e);g&&!tK(g,b)&&n(),g=b,m=requestAnimationFrame(y)}return n(),()=>{var b;d.forEach(v=>{i&&v.removeEventListener("scroll",n),a&&v.removeEventListener("resize",n)}),h==null||h(),(b=p)==null||b.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const ipe=Afe,spe=Tfe,ape=kfe,ope=Pfe,lpe=Nfe,O4=Sfe,cpe=Efe,upe=(e,t,n)=>{const r=new Map,i={platform:tpe,...n},a={...i.platform,_c:r};return _fe(e,t,{...i,platform:a})};var dpe=typeof document<"u",hpe=function(){},Sw=dpe?x.useLayoutEffect:hpe;function wj(e,t){if(e===t)return!0;
vendor: 4,167 bytes, line 596
596if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!wj(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!wj(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function nK(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function I4(e,t){const n=nK(e);return Math.round(t*n)/n}function ON(e){const t=x.useRef(e);return Sw(()=>{t.current=e}),t}function fpe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,h]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=x.useState(r);wj(f,r)||p(r);const[m,g]=x.useState(null),[y,b]=x.useState(null),v=x.useCallback(I=>{I!==S.current&&(S.current=I,g(I))},[]),w=x.useCallback(I=>{I!==k.current&&(k.current=I,b(I))},[]),_=a||m,j=o||y,S=x.useRef(null),k=x.useRef(null),N=x.useRef(d),T=c!=null,C=ON(c),A=ON(i),O=ON(u),z=x.useCallback(()=>{if(!S.current||!k.current)return;const I={placement:t,strategy:n,middleware:f};A.current&&(I.platform=A.current),upe(S.current,k.current,I).then(M=>{const R={...M,isPositioned:O.current!==!1};$.current&&!wj(N.current,R)&&(N.current=R,Th.flushSync(()=>{h(R)}))})},[f,t,n,A,O]);Sw(()=>{u===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,h(I=>({...I,isPositioned:!1})))},[u]);const $=x.useRef(!1);Sw(()=>($.current=!0,()=>{$.current=!1}),[]),Sw(()=>{if(_&&(S.current=_),j&&(k.current=j),_&&j){if(C.current)return C.current(_,j,z);z()}},[_,j,z,C,T]);const F=x.useMemo(()=>({reference:S,floating:k,setReference:v,setFloating:w}),[v,w]),B=x.useMemo(()=>({reference:_,floating:j}),[_,j]),P=x.useMemo(()=>{const I={position:n,left:0,top:0};if(!B.floating)return I;const M=I4(B.floating,d.x),R=I4(B.floating,d.y);return l?{...I,transform:"translate("+M+"px, "+R+"px)",...nK(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:R}},[n,l,B.floating,d.x,d.y]);return x.useMemo(()=>({...d,update:z,refs:F,elements:B,floatingStyles:P}),[d,z,F,B,P])}const ppe=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?O4({element:r.current,padding:i}).fn(n):{}:r?O4({element:r,padding:i}).fn(n):{}}}},mpe=(e,t)=>({...ipe(e),options:[e,t]}),gpe=(e,t)=>({...spe(e),options:[e,t]}),ype=(e,t)=>({...cpe(e),options:[e,t]}),vpe=(e,t)=>({...ape(e),options:[e,t]}),xpe=(e,t)=>({...ope(e),options:[e,t]}),bpe=(e,t)=>({...lpe(e),options:[e,t]}),wpe=(e,t)=>({...ppe(e),options:[e,t]});var jpe="Arrow",rK=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return s.jsx(Ne.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});rK.displayName=jpe;var _pe=rK;function nb(e){const[t,n]=x.useState(void 0);return Lr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var $I="Popper",[iK,Ou]=sr($I),[Spe,sK]=iK($I),aK=e=>{const{__scopePopper:t,children:n}=e,[r,i]=x.useState(null);return s.jsx(Spe,{scope:t,anchor:r,onAnchorChange:i,children:n})};aK.displayName=$I;var oK="PopperAnchor",lK=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=sK(oK,n),o=x.useRef(null),l=Ke(t,o);return x.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:s.jsx(Ne.div,{...i,ref:l})});lK.displayName=oK;var LI="PopperContent",[kpe,Npe]=iK(LI),cK=x.forwardRef((e,t)=>
vendor: 4,226 bytes, line 596
596{var Y,le,Z,de,pe,J;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...g}=e,y=sK(LI,n),[b,v]=x.useState(null),w=Ke(t,be=>v(be)),[_,j]=x.useState(null),S=nb(_),k=(S==null?void 0:S.width)??0,N=(S==null?void 0:S.height)??0,T=r+(a!=="center"?"-"+a:""),C=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},A=Array.isArray(u)?u:[u],O=A.length>0,z={padding:C,boundary:A.filter(Ape),altBoundary:O},{refs:$,floatingStyles:F,placement:B,isPositioned:P,middlewareData:I}=fpe({strategy:"fixed",placement:T,whileElementsMounted:(...be)=>rpe(...be,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[mpe({mainAxis:i+N,alignmentAxis:o}),c&&gpe({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?ype():void 0,...z}),c&&vpe({...z}),xpe({...z,apply:({elements:be,rects:ee,availableWidth:Ce,availableHeight:Re})=>{const{width:Ze,height:Ee}=ee.reference,kt=be.floating.style;kt.setProperty("--radix-popper-available-width",`${Ce}px`),kt.setProperty("--radix-popper-available-height",`${Re}px`),kt.setProperty("--radix-popper-anchor-width",`${Ze}px`),kt.setProperty("--radix-popper-anchor-height",`${Ee}px`)}}),_&&wpe({element:_,padding:l}),Tpe({arrowWidth:k,arrowHeight:N}),f&&bpe({strategy:"referenceHidden",...z})]}),[M,R]=hK(B),K=Jn(m);Lr(()=>{P&&(K==null||K())},[P,K]);const D=(Y=I.arrow)==null?void 0:Y.x,E=(le=I.arrow)==null?void 0:le.y,q=((Z=I.arrow)==null?void 0:Z.centerOffset)!==0,[X,re]=x.useState();return Lr(()=>{b&&re(window.getComputedStyle(b).zIndex)},[b]),s.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:P?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(de=I.transformOrigin)==null?void 0:de.x,(pe=I.transformOrigin)==null?void 0:pe.y].join(" "),...((J=I.hide)==null?void 0:J.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(kpe,{scope:n,placedSide:M,onArrowChange:j,arrowX:D,arrowY:E,shouldHideArrow:q,children:s.jsx(Ne.div,{"data-side":M,"data-align":R,...g,ref:w,style:{...g.style,animation:P?void 0:"none"}})})})});cK.displayName=LI;var uK="PopperArrow",Cpe={top:"bottom",right:"left",bottom:"top",left:"right"},dK=x.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=Npe(uK,r),o=Cpe[a.placedSide];return s.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:s.jsx(_pe,{...i,ref:n,style:{...i.style,display:"block"}})})});dK.displayName=uK;function Ape(e){return e!==null}var Tpe=e=>({name:"transformOrigin",options:e,fn(t){var y,b,v;const{placement:n,rects:r,middlewareData:i}=t,o=((y=i.arrow)==null?void 0:y.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=hK(n),h={start:"0%",center:"50%",end:"100%"}[d],f=(((b=i.arrow)==null?void 0:b.x)??0)+l/2,p=(((v=i.arrow)==null?void 0:v.y)??0)+c/2;let m="",g="";return u==="bottom"?(m=o?h:`${f}px`,g=`${-c}px`):u==="top"?(m=o?h:`${f}px`,g=`${r.floating.height+c}px`):u==="right"?(m=`${-c}px`,g=o?h:`${p}px`):u==="left"&&(m=`${r.floating.width+c}px`,g=o?h:`${p}px`),{data:{x:m,y:g}}}});function hK(e){const[t,n="center"]=e.split("-");return[t,n]}var F_=aK,rb=lK,z_=cK,B_=dK,[V_,Cpt]=sr("Tooltip",[Ou]),W_=Ou(),fK="TooltipProvider",Epe=700,XT="tooltip.open",[Ppe,FI]=V_(fK),pK=e=>{const{__scopeTooltip:t,delayDuration:n=Epe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=x.useRef(!0),l=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),s.jsx(Ppe,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>
vendor: 4,243 bytes, line 596
596o.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:x.useCallback(u=>{l.current=u},[]),disableHoverableContent:i,children:a})};pK.displayName=fK;var Iv="Tooltip",[Ope,U_]=V_(Iv),mK=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,c=FI(Iv,e.__scopeTooltip),u=W_(t),[d,h]=x.useState(null),f=gr(),p=x.useRef(0),m=o??c.disableHoverableContent,g=l??c.delayDuration,y=x.useRef(!1),[b,v]=ji({prop:r,defaultProp:i??!1,onChange:k=>{k?(c.onOpen(),document.dispatchEvent(new CustomEvent(XT))):c.onClose(),a==null||a(k)},caller:Iv}),w=x.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),_=x.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,v(!0)},[v]),j=x.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=x.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,v(!0),p.current=0},g)},[g,v]);return x.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),s.jsx(F_,{...u,children:s.jsx(Ope,{scope:t,contentId:f,open:b,stateAttribute:w,trigger:d,onTriggerChange:h,onTriggerEnter:x.useCallback(()=>{c.isOpenDelayedRef.current?S():_()},[c.isOpenDelayedRef,S,_]),onTriggerLeave:x.useCallback(()=>{m?j():(window.clearTimeout(p.current),p.current=0)},[j,m]),onOpen:_,onClose:j,disableHoverableContent:m,children:n})})};mK.displayName=Iv;var ZT="TooltipTrigger",gK=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=U_(ZT,n),a=FI(ZT,n),o=W_(n),l=x.useRef(null),c=Ke(t,l,i.onTriggerChange),u=x.useRef(!1),d=x.useRef(!1),h=x.useCallback(()=>u.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),s.jsx(rb,{asChild:!0,...o,children:s.jsx(Ne.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:fe(e.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:fe(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:fe(e.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:fe(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:fe(e.onBlur,i.onClose),onClick:fe(e.onClick,i.onClose)})})});gK.displayName=ZT;var Ipe="TooltipPortal",[Apt,Rpe]=V_(Ipe,{forceMount:void 0}),qp="TooltipContent",yK=x.forwardRef((e,t)=>{const n=Rpe(qp,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=U_(qp,e.__scopeTooltip);return s.jsx(vr,{present:r||o.open,children:o.disableHoverableContent?s.jsx(vK,{side:i,...a,ref:t}):s.jsx(Dpe,{side:i,...a,ref:t})})}),Dpe=x.forwardRef((e,t)=>{const n=U_(qp,e.__scopeTooltip),r=FI(qp,e.__scopeTooltip),i=x.useRef(null),a=Ke(t,i),[o,l]=x.useState(null),{trigger:c,onClose:u}=n,d=i.current,{onPointerInTransitChange:h}=r,f=x.useCallback(()=>{l(null),h(!1)},[h]),p=x.useCallback((m,g)=>{const y=m.currentTarget,b={x:m.clientX,y:m.clientY},v=zpe(b,y.getBoundingClientRect()),w=Bpe(b,v),_=Vpe(g.getBoundingClientRect()),j=Upe([...w,..._]);l(j),h(!0)},[h]);return x.useEffect(()=>()=>f(),[f]),x.useEffect(()=>{if(c&&d){const m=y=>p(y,d),g=y=>p(y,c);return c.addEventListener("pointerleave",m),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",g)}}},[c,d,p,f]),x.useEffect(()=>{if(o){const m=g=>{const y=g.target,b={x:g.clientX,y:g.clientY},v=(c==null?void 0:c.contains(y))||(d==null?void 0:d.contains(y)),w=!Wpe(b,o);v?f():w&&(f(),u())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,d,o,u,f]),s.jsx(vK,{...e,ref:a})}),[Mpe,$pe]=V_(Iv,{isInside:!1}),Lpe=W9("TooltipContent"),vK=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=U_(qp,n),u=W_(n),{onClose:d}=c;return x.useEffect(()=>(document.addEventListener(XT,d),()=>document.removeEventListener(XT,d)),[d]),x.useEffect(()=>{if(c.trigger){const h=f=>{const p=f.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}}
596,[c.trigger,d]),s.jsx(Eh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:s.jsxs(z_,{"data-state":c.stateAttribute,...u,...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:[s.jsx(Lpe,{children:r}),s.jsx(Mpe,{scope:n,isInside:!0,children:s.jsx(Que,{id:c.contentId,role:"tooltip",children:i||r})})]})})});yK.displayName=qp;var xK="TooltipArrow",Fpe=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=W_(n);return $pe(xK,n).isInside?null:s.jsx(B_,{...i,...r,ref:t})});Fpe.displayName=xK;function zpe(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Bpe(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Vpe(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Wpe(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],c=t[o],u=l.x,d=l.y,h=c.x,f=c.y;d>r!=f>r&&n<(h-u)*(r-d)/(f-d)+u&&(i=!i)}return i}function Upe(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),qpe(t)}function qpe(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const a=n[n.length-1],o=n[n.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Hpe=pK,Kpe=mK,Gpe=gK,bK=yK;const Rv=Hpe,ni=Kpe,ri=Gpe,Kr=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(bK,{ref:r,sideOffset:t,className:ae("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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Kr.displayName=bK.displayName;var Gm=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(){}},ch=typeof window>"u"||"Deno"in globalThis;function Ei(){}function Ype(e,t){return typeof e=="function"?e(t):e}function JT(e){return typeof e=="number"&&e>=0&&e!==1/0}function wK(e,t){return Math.max(e+(t||0)-Date.now(),0)}function lu(e,t){return typeof e=="function"?e(t):e}function ha(e,t){return typeof e=="function"?e(t):e}function R4(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==zI(o,t.options))return!1}else if(!Dv(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||a&&!a(t))}function D4(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(uh(t.options.mutationKey)!==uh(a))return!1}else if(!Dv(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function zI(e,t){return((t==null?void 0:t.queryKeyHashFn)||uh)(e)}function uh(e){return JSON.stringify(e,(t,n)=>eE(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Dv(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Dv(e[n],t[n])):!1}function jK(e,t){if(e===t)return e;const n=M4(e)&&M4(t);if(n||eE(e)&&eE(t)){const r=n?e:Object.keys(e),i=r.length,a=n?t:Object.keys(t),o=a.length,l=n?[]:{},c=new Set(r);let u=0;for(let d=0;d<o;d++){const h=n?d:a[d];(!n&&c.has(h)||n)&&e[h]===void 0&&t[h]===void 0?(l[h]=void 0,u++):(l[h]=jK(e[h],t[h]),l[h]===e[h]&&e[h]!==void 0&&u++)}return i===o&&u===i?e:l}return t}function jj(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function M4(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function eE(e){if(!$4(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!$4(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function $4(e){return Object.prototype.toString.call(e)==="[object Object]"}function Qpe(e){return new Promise(t=>{setTimeout(t,e)})}function tE(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?jK(e,t):t}function Xpe(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Zpe(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var BI=Symbol();function _K(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===BI?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function SK(e,t){return typeof e=="function"?e(...t):!!e}var Od,Mc,wp,cU,Jpe=(cU=class extends Gm{constructor(){super();Qe(this,Od);Qe(this,Mc);Qe(this,wp);Oe(this,wp,t=>{if(!ch&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){H(this,Mc)||this.setEventListener(H(this,wp))}onUnsubscribe(){var t;this.hasListeners()||((t=H(this,Mc))==null||t.call(this),Oe(this,Mc,void 0))}setEventListener(t){var n;Oe(this,wp,t),(n=H(this,Mc))==null||n.call(this),Oe(this,Mc,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){H(this,Od)!==t&&(Oe(this,Od,t),this.onFocus())}onFocus(){const t=this.isFocused();
vendor: 4,673 bytes, line 596
596this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof H(this,Od)=="boolean"?H(this,Od):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Od=new WeakMap,Mc=new WeakMap,wp=new WeakMap,cU),VI=new Jpe,jp,$c,_p,uU,eme=(uU=class extends Gm{constructor(){super();Qe(this,jp,!0);Qe(this,$c);Qe(this,_p);Oe(this,_p,t=>{if(!ch&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){H(this,$c)||this.setEventListener(H(this,_p))}onUnsubscribe(){var t;this.hasListeners()||((t=H(this,$c))==null||t.call(this),Oe(this,$c,void 0))}setEventListener(t){var n;Oe(this,_p,t),(n=H(this,$c))==null||n.call(this),Oe(this,$c,t(this.setOnline.bind(this)))}setOnline(t){H(this,jp)!==t&&(Oe(this,jp,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return H(this,jp)}},jp=new WeakMap,$c=new WeakMap,_p=new WeakMap,uU),_j=new eme;function nE(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function tme(e){return Math.min(1e3*2**e,3e4)}function kK(e){return(e??"online")==="online"?_j.isOnline():!0}var NK=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function IN(e){return e instanceof NK}function CK(e){let t=!1,n=0,r=!1,i;const a=nE(),o=g=>{var y;r||(f(new NK(g)),(y=e.abort)==null||y.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>VI.isFocused()&&(e.networkMode==="always"||_j.isOnline())&&e.canRun(),d=()=>kK(e.networkMode)&&e.canRun(),h=g=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,g),i==null||i(),a.resolve(g))},f=g=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,g),i==null||i(),a.reject(g))},p=()=>new Promise(g=>{var y;i=b=>{(r||u())&&g(b)},(y=e.onPause)==null||y.call(e)}).then(()=>{var g;i=void 0,r||(g=e.onContinue)==null||g.call(e)}),m=()=>{if(r)return;let g;const y=n===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(b){g=Promise.reject(b)}Promise.resolve(g).then(h).catch(b=>{var S;if(r)return;const v=e.retry??(ch?0:3),w=e.retryDelay??tme,_=typeof w=="function"?w(n,b):w,j=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,b);if(t||!j){f(b);return}n++,(S=e.onFail)==null||S.call(e,n,b),Qpe(_).then(()=>u()?void 0:p()).then(()=>{t?f(b):m()})})};return{promise:a,cancel:o,continue:()=>(i==null||i(),a),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?m():p().then(m),a)}}var nme=e=>setTimeout(e,0);function rme(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=nme;const a=l=>{t?e.push(l):i(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var Pr=rme(),Id,dU,AK=(dU=class{constructor(){Qe(this,Id)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),JT(this.gcTime)&&Oe(this,Id,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ch?1/0:5*60*1e3))}clearGcTimeout(){H(this,Id)&&(clearTimeout(H(this,Id)),Oe(this,Id,void 0))}},Id=new WeakMap,dU),Sp,Rd,ua,Dd,hi,qx,Md,Ka,vl,hU,ime=(hU=class extends AK{constructor(t){super();Qe(this,Ka);Qe(this,Sp);Qe(this,Rd);Qe(this,ua);Qe(this,Dd);Qe(this,hi);Qe(this,qx);Qe(this,Md);Oe(this,Md,!1),Oe(this,qx,t.defaultOptions),this.setOptions(t.options),this.observers=[],Oe(this,Dd,t.client),Oe(this,ua,H(this,Dd).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Oe(this,Sp,sme(this.options)),this.state=t.state??H(this,Sp),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=H(this,hi))==null?void 0:t.promise}setOptions(t){this.options={...H(this,qx),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&H(this,ua).remove(this)}setData(t,n){const r=tE(this.state.data,t,this.options);return _t(this,Ka,vl).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){_t(this,Ka,vl).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=H(this,hi))==null?void 0:r.promise;return(i=H(this,hi))==null||i.cancel(t),n?n.then(Ei).catch(Ei):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}
vendor: 1,537 bytes, line 596
596reset(){this.destroy(),this.setState(H(this,Sp))}isActive(){return this.observers.some(t=>ha(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===BI||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>lu(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:!wK(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=H(this,hi))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=H(this,hi))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),H(this,ua).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(H(this,hi)&&(H(this,Md)?H(this,hi).cancel({revert:!0}):H(this,hi).cancelRetry()),this.scheduleGc()),H(this,ua).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||_t(this,Ka,vl).call(this,{type:"invalidate"})}
vendor: 27,440 bytes, line 596
596fetch(t,n){var u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(H(this,hi))return H(this,hi).continueRetry(),H(this,hi).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(Oe(this,Md,!0),r.signal)})},a=()=>{const f=_K(this.options,n),m=(()=>{const g={client:H(this,Dd),queryKey:this.queryKey,meta:this.meta};return i(g),g})();return Oe(this,Md,!1),this.options.persister?this.options.persister(f,m,this):f(m)},l=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:H(this,Dd),state:this.state,fetchFn:a};return i(f),f})();(u=this.options.behavior)==null||u.onFetch(l,this),Oe(this,Rd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&_t(this,Ka,vl).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta});const c=f=>{var p,m,g,y;IN(f)&&f.silent||_t(this,Ka,vl).call(this,{type:"error",error:f}),IN(f)||((m=(p=H(this,ua).config).onError)==null||m.call(p,f,this),(y=(g=H(this,ua).config).onSettled)==null||y.call(g,this.state.data,f,this)),this.scheduleGc()};return Oe(this,hi,CK({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var p,m,g,y;if(f===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(b){c(b);return}(m=(p=H(this,ua).config).onSuccess)==null||m.call(p,f,this),(y=(g=H(this,ua).config).onSettled)==null||y.call(g,f,this.state.error,this),this.scheduleGc()},onError:c,onFail:(f,p)=>{_t(this,Ka,vl).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{_t(this,Ka,vl).call(this,{type:"pause"})},onContinue:()=>{_t(this,Ka,vl).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),H(this,hi).start()}},Sp=new WeakMap,Rd=new WeakMap,ua=new WeakMap,Dd=new WeakMap,hi=new WeakMap,qx=new WeakMap,Md=new WeakMap,Ka=new WeakSet,vl=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...TK(r.data,this.options),fetchMeta:t.meta??null};case"success":return Oe(this,Rd,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return IN(i)&&i.revert&&H(this,Rd)?{...H(this,Rd),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Pr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),H(this,ua).notify({query:this,type:"updated",action:t})})},hU);function TK(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kK(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function sme(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Oo,fU,ame=(fU=class extends Gm{constructor(t={}){super();Qe(this,Oo);this.config=t,Oe(this,Oo,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??zI(i,n);let o=this.get(a);return o||(o=new ime({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){H(this,Oo).has(t.queryHash)||(H(this,Oo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=H(this,Oo).get(t.queryHash);n&&(t.destroy(),n===t&&H(this,Oo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Pr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return H(this,Oo).get(t)}getAll(){return[...H(this,Oo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>R4(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>R4(t,r)):n}notify(t){Pr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Pr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Pr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Oo=new WeakMap,fU),Io,Ci,$d,Ro,wc,pU,ome=(pU=class extends AK{constructor(t){super();Qe(this,Ro);Qe(this,Io);Qe(this,Ci);Qe(this,$d);this.mutationId=t.mutationId,Oe(this,Ci,t.mutationCache),Oe(this,Io,[]),this.state=t.state||EK(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){H(this,Io).includes(t)||(H(this,Io).push(t),this.clearGcTimeout(),H(this,Ci).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Oe(this,Io,H(this,Io).filter(n=>n!==t)),this.scheduleGc(),H(this,Ci).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){H(this,Io).length||(this.state.status==="pending"?this.scheduleGc():H(this,Ci).remove(this))}continue(){var t;return((t=H(this,$d))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,o,l,c,u,d,h,f,p,m,g,y,b,v,w,_,j,S,k,N;const n=()=>{_t(this,Ro,wc).call(this,{type:"continue"})};Oe(this,$d,CK({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,C)=>{_t(this,Ro,wc).call(this,{type:"failed",failureCount:T,error:C})},onPause:()=>{_t(this,Ro,wc).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>H(this,Ci).canRun(this)}));const r=this.state.status==="pending",i=!H(this,$d).canStart();try{if(r)n();else{_t(this,Ro,wc).call(this,{type:"pending",variables:t,isPaused:i}),await((o=(a=H(this,Ci).config).onMutate)==null?void 0:o.call(a,t,this));const C=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));C!==this.state.context&&_t(this,Ro,wc).call(this,{type:"pending",context:C,variables:t,isPaused:i})}const T=await H(this,$d).start();return await((d=(u=H(this,Ci).config).onSuccess)==null?void 0:d.call(u,T,t,this.state.context,this)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,T,t,this.state.context)),await((m=(p=H(this,Ci).config).onSettled)==null?void 0:m.call(p,T,null,this.state.variables,this.state.context,this)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,T,null,t,this.state.context)),_t(this,Ro,wc).call(this,{type:"success",data:T}),T}catch(T){try{throw await((v=(b=H(this,Ci).config).onError)==null?void 0:v.call(b,T,t,this.state.context,this)),await((_=(w=this.options).onError)==null?void 0:_.call(w,T,t,this.state.context)),await((S=(j=H(this,Ci).config).onSettled)==null?void 0:S.call(j,void 0,T,this.state.variables,this.state.context,this)),await((N=(k=this.options).onSettled)==null?void 0:N.call(k,void 0,T,t,this.state.context)),T}finally{_t(this,Ro,wc).call(this,{type:"error",error:T})}}finally{H(this,Ci).runNext(this)}}},Io=new WeakMap,Ci=new WeakMap,$d=new WeakMap,Ro=new WeakSet,wc=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Pr.batch(()=>{H(this,Io).forEach(r=>{r.onMutationUpdate(t)}),H(this,Ci).notify({mutation:this,type:"updated",action:t})})},pU);function EK(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Sl,Ga,Hx,mU,lme=(mU=class extends Gm{constructor(t={}){super();Qe(this,Sl);Qe(this,Ga);Qe(this,Hx);this.config=t,Oe(this,Sl,new Set),Oe(this,Ga,new Map),Oe(this,Hx,0)}build(t,n,r){const i=new ome({mutationCache:this,mutationId:++Hb(this,Hx)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){H(this,Sl).add(t);const n=m0(t);if(typeof n=="string"){const r=H(this,Ga).get(n);r?r.push(t):H(this,Ga).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(H(this,Sl).delete(t)){const n=m0(t);if(typeof n=="string"){const r=H(this,Ga).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&H(this,Ga).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=m0(t);if(typeof n=="string"){const r=H(this,Ga).get(n),i=r==null?void 0:r.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=m0(t);if(typeof n=="string"){const i=(r=H(this,Ga).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Pr.batch(()=>{H(this,Sl).forEach(t=>{this.notify({type:"removed",mutation:t})}),H(this,Sl).clear(),H(this,Ga).clear()})}getAll(){return Array.from(H(this,Sl))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>D4(n,r))}findAll(t={}){return this.getAll().filter(n=>D4(t,n))}notify(t){Pr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Pr.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ei))))}},Sl=new WeakMap,Ga=new WeakMap,Hx=new WeakMap,mU);function m0(e){var t;return(t=e.options.scope)==null?void 0:t.id}function L4(e){return{onFetch:(t,n)=>{var d,h,f,p,m;const r=t.options,i=(f=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:f.direction,a=((p=t.state.data)==null?void 0:p.pages)||[],o=((m=t.state.data)==null?void 0:m.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const y=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},b=_K(t.options,t.fetchOptions),v=async(w,_,j)=>{if(g)return Promise.reject();if(_==null&&w.pages.length)return Promise.resolve(w);const k=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:_,direction:j?"backward":"forward",meta:t.options.meta};return y(A),A})(),N=await b(k),{maxPages:T}=t.options,C=j?Zpe:Xpe;return{pages:C(w.pages,N,T),pageParams:C(w.pageParams,_,T)}};if(i&&a.length){const w=i==="backward",_=w?cme:F4,j={pages:a,pageParams:o},S=_(r,j);l=await v(j,S,w)}else{const w=e??a.length;do{const _=c===0?o[0]??r.initialPageParam:F4(r,l);if(c>0&&_==null)break;l=await v(l,_),c++}while(c<w)}return l};t.options.persister?t.fetchFn=()=>{var g,y;return(y=(g=t.options).persister)==null?void 0:y.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function F4(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function cme(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Vn,Lc,Fc,kp,Np,zc,Cp,Ap,gU,ume=(gU=class{constructor(e={}){Qe(this,Vn);Qe(this,Lc);Qe(this,Fc);Qe(this,kp);Qe(this,Np);Qe(this,zc);Qe(this,Cp);Qe(this,Ap);Oe(this,Vn,e.queryCache||new ame),Oe(this,Lc,e.mutationCache||new lme),Oe(this,Fc,e.defaultOptions||{}),Oe(this,kp,new Map),Oe(this,Np,new Map),Oe(this,zc,0)}mount(){Hb(this,zc)._++,H(this,zc)===1&&(Oe(this,Cp,VI.subscribe(async e=>{e&&(await this.resumePausedMutations(),H(this,Vn).onFocus())})),Oe(this,Ap,_j.subscribe(async e=>{e&&(await this.resumePausedMutations(),H(this,Vn).onOnline())})))}unmount(){var e,t;Hb(this,zc)._--,H(this,zc)===0&&((e=H(this,Cp))==null||e.call(this),Oe(this,Cp,void 0),(t=H(this,Ap))==null||t.call(this),Oe(this,Ap,void 0))}isFetching(e){return H(this,Vn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return H(this,Lc).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=H(this,Vn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=H(this,Vn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(lu(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return H(this,Vn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=H(this,Vn).get(r.queryHash),a=i==null?void 0:i.state.data,o=Ype(t,a);if(o!==void 0)return H(this,Vn).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Pr.batch(()=>H(this,Vn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=H(this,Vn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=H(this,Vn);Pr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=H(this,Vn);return Pr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Pr.batch(()=>H(this,Vn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Ei).catch(Ei)}invalidateQueries(e,t={}){return Pr.batch(()=>(H(this,Vn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Pr.batch(()=>H(this,Vn).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(Ei)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Ei)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=H(this,Vn).build(this,t);return n.isStaleByTime(lu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ei).catch(Ei)}fetchInfiniteQuery(e){return e.behavior=L4(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ei).catch(Ei)}ensureInfiniteQueryData(e){return e.behavior=L4(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return _j.isOnline()?H(this,Lc).resumePausedMutations():Promise.resolve()}getQueryCache(){return H(this,Vn)}getMutationCache(){return H(this,Lc)}getDefaultOptions(){return H(this,Fc)}setDefaultOptions(e){Oe(this,Fc,e)}setQueryDefaults(e,t){H(this,kp).set(uh(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...H(this,kp).values()],n={};return t.forEach(r=>{Dv(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){H(this,Np).set(uh(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...H(this,Np).values()],n={};return t.forEach(r=>{Dv(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...H(this,Fc).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=zI(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===BI&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...H(this,Fc).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){H(this,Vn).clear(),H(this,Lc).clear()}},Vn=new WeakMap,Lc=new WeakMap,Fc=new WeakMap,kp=new WeakMap,Np=new WeakMap,zc=new WeakMap,Cp=new WeakMap,Ap=new WeakMap,gU),Xi,Et,Kx,Ai,Ld,Tp,Bc,Vc,Gx,Ep,Pp,Fd,zd,Wc,Op,Yt,by,rE,iE,sE,aE,oE,lE,cE,PK,yU,dme=(yU=class extends Gm{constructor(t,n){super();Qe(this,Yt);Qe(this,Xi);Qe(this,Et);Qe(this,Kx);Qe(this,Ai);Qe(this,Ld);Qe(this,Tp);Qe(this,Bc);Qe(this,Vc);Qe(this,Gx);Qe(this,Ep);Qe(this,Pp);Qe(this,Fd);Qe(this,zd);Qe(this,Wc);Qe(this,Op,new Set);this.options=n,Oe(this,Xi,t),Oe(this,Vc,null),Oe(this,Bc,nE()),this.options.experimental_prefetchInRender||H(this,Bc).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(H(this,Et).addObserver(this),z4(H(this,Et),this.options)?_t(this,Yt,by).call(this):this.updateResult(),_t(this,Yt,aE).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return uE(H(this,Et),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return uE(H(this,Et),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,_t(this,Yt,oE).call(this),_t(this,Yt,lE).call(this),H(this,Et).removeObserver(this)}setOptions(t){const n=this.options,r=H(this,Et);if(this.options=H(this,Xi).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ha(this.options.enabled,H(this,Et))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");_t(this,Yt,cE).call(this),H(this,Et).setOptions(this.options),n._defaulted&&!jj(this.options,n)&&H(this,Xi).getQueryCache().notify({type:"observerOptionsUpdated",query:H(this,Et),observer:this});const i=this.hasListeners();i&&B4(H(this,Et),r,this.options,n)&&_t(this,Yt,by).call(this),this.updateResult(),i&&(H(this,Et)!==r||ha(this.options.enabled,H(this,Et))!==ha(n.enabled,H(this,Et))||lu(this.options.staleTime,H(this,Et))!==lu(n.staleTime,H(this,Et)))&&_t(this,Yt,rE).call(this);const a=_t(this,Yt,iE).call(this);i&&(H(this,Et)!==r||ha(this.options.enabled,H(this,Et))!==ha(n.enabled,H(this,Et))||a!==H(this,Wc))&&_t(this,Yt,sE).call(this,a)}getOptimisticResult(t){const n=H(this,Xi).getQueryCache().build(H(this,Xi),t),r=this.createResult(n,t);return fme(this,r)&&(Oe(this,Ai,r),Oe(this,Tp,this.options),Oe(this,Ld,H(this,Et).state)),r}getCurrentResult(){return H(this,Ai)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(r,i))})}trackProp(t){H(this,Op).add(t)}getCurrentQuery(){return H(this,Et)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=H(this,Xi).defaultQueryOptions(t),r=H(this,Xi).getQueryCache().build(H(this,Xi),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return _t(this,Yt,by).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),H(this,Ai)))}createResult(t,n){var T;const r=H(this,Et),i=this.options,a=H(this,Ai),o=H(this,Ld),l=H(this,Tp),u=t!==r?t.state:H(this,Kx),{state:d}=t;let h={...d},f=!1,p;if(n._optimisticResults){const C=this.hasListeners(),A=!C&&z4(t,n),O=C&&B4(t,r,n,i);(A||O)&&(h={...h,...TK(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:m,errorUpdatedAt:g,status:y}=h;p=h.data;let b=!1;if(n.placeholderData!==void 0&&p===void 0&&y==="pending"){let C;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(C=a.data,b=!0):C=typeof n.placeholderData=="function"?n.placeholderData((T=H(this,Pp))==null?void 0:T.state.data,H(this,Pp)):n.placeholderData,C!==void 0&&(y="success",p=tE(a==null?void 0:a.data,C,n),f=!0)}if(n.select&&p!==void 0&&!b)if(a&&p===(o==null?void 0:o.data)&&n.select===H(this,Gx))p=H(this,Ep);else try{Oe(this,Gx,n.select),p=n.select(p),p=tE(a==null?void 0:a.data,p,n),Oe(this,Ep,p),Oe(this,Vc,null)}catch(C){Oe(this,Vc,C)}H(this,Vc)&&(m=H(this,Vc),p=H(this,Ep),g=Date.now(),y="error");const v=h.fetchStatus==="fetching",w=y==="pending",_=y==="error",j=w&&v,S=p!==void 0,N={status:y,fetchStatus:h.fetchStatus,isPending:w,isSuccess:y==="success",isError:_,isInitialLoading:j,isLoading:j,data:p,dataUpdatedAt:h.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!w,isLoadingError:_&&!S,isPaused:h.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:_&&S,isStale:WI(t,n),refetch:this.refetch,promise:H(this,Bc),isEnabled:ha(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const C=z=>{N.status==="error"?z.reject(N.error):N.data!==void 0&&z.resolve(N.data)},A=()=>{const z=Oe(this,Bc,N.promise=nE());C(z)},O=H(this,Bc);switch(O.status){case"pending":t.queryHash===r.queryHash&&C(O);break;case"fulfilled":(N.status==="error"||N.data!==O.value)&&A();break;case"rejected":(N.status!=="error"||N.error!==O.reason)&&A();break}}return N}updateResult(){const t=H(this,Ai),n=this.createResult(H(this,Et),this.options);if(Oe(this,Ld,H(this,Et).state),Oe(this,Tp,this.options),H(this,Ld).data!==void 0&&Oe(this,Pp,H(this,Et)),jj(n,t))return;Oe(this,Ai,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!H(this,Op).size)return!0;const o=new Set(a??H(this,Op));return this.options.throwOnError&&o.add("error"),Object.keys(H(this,Ai)).some(l=>{const c=l;return H(this,Ai)[c]!==t[c]&&o.has(c)})};_t(this,Yt,PK).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&_t(this,Yt,aE).call(this)}},Xi=new WeakMap,Et=new WeakMap,Kx=new WeakMap,Ai=new WeakMap,Ld=new WeakMap,Tp=new WeakMap,Bc=new WeakMap,Vc=new WeakMap,Gx=new WeakMap,Ep=new WeakMap,Pp=new WeakMap,Fd=new WeakMap,zd=new WeakMap,Wc=new WeakMap,Op=new WeakMap,Yt=new WeakSet,by=function(t){_t(this,Yt,cE).call(this);let n=H(this,Et).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ei)),n},rE=function(){_t(this,Yt,oE).call(this);const t=lu(this.options.staleTime,H(this,Et));if(ch||H(this,Ai).isStale||!JT(t))return;const r=wK(H(this,Ai).dataUpdatedAt,t)+1;Oe(this,Fd,setTimeout(()=>{H(this,Ai).isStale||this.updateResult()},r))},iE=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(H(this,Et)):this.options.refetchInterval)??!1},sE=function(t){_t(this,Yt,lE).call(this),Oe(this,Wc,t),!(ch||ha(this.options.enabled,H(this,Et))===!1||!JT(H(this,Wc))||H(this,Wc)===0)&&Oe(this,zd,setInterval(()=>{(this.options.refetchIntervalInBackground||VI.isFocused())&&_t(this,Yt,by).call(this)},H(this,Wc)))},aE=function(){_t(this,Yt,rE).call(this),_t(this,Yt,sE).call(this,_t(this,Yt,iE).call(this))},oE=function(){H(this,Fd)&&(clearTimeout(H(this,Fd)),Oe(this,Fd,void 0))},lE=function(){H(this,zd)&&(clearInterval(H(this,zd)),Oe(this,zd,void 0))},cE=function(){const t=H(this,Xi).getQueryCache().build(H(this,Xi),this.options);if(t===H(this,Et))return;const n=H(this,Et);Oe(this,Et,t),Oe(this,Kx,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},PK=function(t){Pr.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(H(this,Ai))}),H(this,Xi).getQueryCache().notify({query:H(this,Et),type:"observerResultsUpdated"})})},yU);function hme(e,t){return ha(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function z4(e,t){return hme(e,t)||e.state.data!==void 0&&uE(e,t,t.refetchOnMount)}function uE(e,t,n){if(ha(t.enabled,e)!==!1&&lu(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&WI(e,t)}return!1}function B4(e,t,n,r){return(e!==t||ha(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&WI(e,n)}function WI(e,t){return ha(t.enabled,e)!==!1&&e.isStaleByTime(lu(t.staleTime,e))}function fme(e,t){return!jj(e.getCurrentResult(),t)}var Uc,qc,Zi,kl,Vl,kw,dE,vU,pme=(vU=class extends Gm{constructor(n,r){super();Qe(this,Vl);Qe(this,Uc);Qe(this,qc);Qe(this,Zi);Qe(this,kl);Oe(this,Uc,n),this.setOptions(r),this.bindMethods(),_t(this,Vl,kw).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=H(this,Uc).defaultMutationOptions(n),jj(this.options,r)||H(this,Uc).getMutationCache().notify({type:"observerOptionsUpdated",mutation:H(this,Zi),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&uh(r.mutationKey)!==uh(this.options.mutationKey)?this.reset():((i=H(this,Zi))==null?void 0:i.state.status)==="pending"&&H(this,Zi).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=H(this,Zi))==null||n.removeObserver(this)}onMutationUpdate(n){_t(this,Vl,kw).call(this),_t(this,Vl,dE).call(this,n)}getCurrentResult(){return H(this,qc)}reset(){var n;(n=H(this,Zi))==null||n.removeObserver(this),Oe(this,Zi,void 0),_t(this,Vl,kw).call(this),_t(this,Vl,dE).call(this)}mutate(n,r){var i;return Oe(this,kl,r),(i=H(this,Zi))==null||i.removeObserver(this),Oe(this,Zi,H(this,Uc).getMutationCache().build(H(this,Uc),this.options)),H(this,Zi).addObserver(this),H(this,Zi).execute(n)}},Uc=new WeakMap,qc=new WeakMap,Zi=new WeakMap,kl=new WeakMap,Vl=new WeakSet,kw=function(){var r;const n=((r=H(this,Zi))==null?void 0:r.state)??EK();Oe(this,qc,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},dE=function(n){Pr.batch(()=>{var r,i,a,o,l,c,u,d;if(H(this,kl)&&this.hasListeners()){const h=H(this,qc).variables,f=H(this,qc).context;(n==null?void 0:n.type)==="success"?((i=(r=H(this,kl)).onSuccess)==null||i.call(r,n.data,h,f),(o=(a=H(this,kl)).onSettled)==null||o.call(a,n.data,null,h,f)):(n==null?void 0:n.type)==="error"&&((c=(l=H(this,kl)).onError)==null||c.call(l,n.error,h,f),(d=(u=H(this,kl)).onSettled)==null||d.call(u,void 0,n.error,h,f))}this.listeners.forEach(h=>{h(H(this,qc))})})},vU),OK=x.createContext(void 0),Ae=e=>{const t=x.useContext(OK);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},mme=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(OK.Provider,{value:e,children:t})),IK=x.createContext(!1),gme=()=>x.useContext(IK);IK.Provider;function yme(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var vme=x.createContext(yme()),xme=()=>x.useContext(vme),bme=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},wme=e=>{x.useEffect(()=>{e.clearReset()},[e])},jme=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||SK(n,[e.error,r])),_me=e=>{if(e.suspense){const t=r=>
596r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Sme=(e,t)=>e.isLoading&&e.isFetching&&!t,kme=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,V4=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Nme(e,t,n){var h,f,p,m,g;const r=gme(),i=xme(),a=Ae(),o=a.defaultQueryOptions(e);(f=(h=a.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||f.call(h,o),o._optimisticResults=r?"isRestoring":"optimistic",_me(o),bme(o,i),wme(i);const l=!a.getQueryCache().get(o.queryHash),[c]=x.useState(()=>new t(a,o)),u=c.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(y=>{const b=d?c.subscribe(Pr.batchCalls(y)):Ei;return c.updateResult(),b},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setOptions(o)},[o,c]),kme(o,u))throw V4(o,c,i);if(jme({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((m=(p=a.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||m.call(p,o,u),o.experimental_prefetchInRender&&!ch&&Sme(u,r)){const y=l?V4(o,c,i):(g=a.getQueryCache().get(o.queryHash))==null?void 0:g.promise;y==null||y.catch(Ei).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function Se(e,t){return Nme(e,dme)}function $e(e,t){const n=Ae(),[r]=x.useState(()=>new pme(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(o=>r.subscribe(Pr.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((o,l)=>{r.mutate(o,l).catch(Ei)},[r]);if(i.error&&SK(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}/**
597 * @remix-run/router v1.23.0
598 *
599 * Copyright (c) Remix Software Inc.
600 *
601 * This source code is licensed under the MIT license found in the
602 * LICENSE.md file in the root directory of this source tree.
603 *
604 * @license MIT
605 */function Mv(){return Mv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mv.apply(this,arguments)}var Yc;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Yc||(Yc={}));const W4="popstate";function Cme(e){e===void 0&&(e={});function t(r,i){let{pathname:a,search:o,hash:l}=r.location;return hE("",{pathname:a,search:o,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Sj(i)}return Tme(t,n,null,e)}function nr(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function RK(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ame(){return Math.random().toString(36).substr(2,8)}function U4(e,t){return{usr:e.state,key:e.key,idx:t}}function hE(e,t,n,r){return n===void 0&&(n=null),Mv({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ym(t):t,{state:n,key:t&&t.key||r||Ame()})}function Sj(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ym(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Tme(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l=Yc.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Mv({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function h(){l=Yc.Pop;let y=d(),b=y==null?null:y-u;u=y,c&&c({action:l,location:g.location,delta:b})}function f(y,b){l=Yc.Push;let v=hE(g.location,y,b);u=d()+1;let w=U4(v,u),_=g.createHref(v);try{o.pushState(w,"",_)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(_)}a&&c&&c({action:l,location:g.location,delta:1})}function p(y,b){l=Yc.Replace;let v=hE(g.location,y,b);u=d();let w=U4(v,u),_=g.createHref(v);o.replaceState(w,"",_),a&&c&&c({action:l,location:g.location,delta:0})}function m(y){let b=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof y=="string"?y:Sj(y);return v=v.replace(/ $/,"%20"),nr(b,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,b)}let g={get action(){return l},get location(){return e(i,o)},listen(y){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(W4,h),c=y,()=>{i.removeEventListener(W4,h),c=null}},createHref(y){return t(i,y)},createURL:m,encodeLocation(y){let b=m(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:p,go(y){return o.go(y)}};return g}var q4;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(q4||(q4={}));function Eme(e,t,n){return n===void 0&&(n="/"),Pme(e,t,n,!1)}function Pme(e,t,n,r){let i=typeof t=="string"?Ym(t):t,a=UI(i.pathname||"/",n);if(a==null)return null;let o=DK(e);Ome(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=Wme(a);l=Bme(o[c],u,r)}return l}function DK(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(nr(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not val
605id. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=cu([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(nr(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),DK(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:Fme(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,o);else for(let c of MK(a.path))i(a,o,c)}),t}function MK(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=MK(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Ome(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:zme(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Ime=/^:[\w-]+$/,Rme=3,Dme=2,Mme=1,$me=10,Lme=-2,H4=e=>e==="*";function Fme(e,t){let n=e.split("/"),r=n.length;return n.some(H4)&&(r+=Lme),t&&(r+=Dme),n.filter(i=>!H4(i)).reduce((i,a)=>i+(Ime.test(a)?Rme:a===""?Mme:$me),r)}function zme(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Bme(e,t,n){let{routesMeta:r}=e,i={},a="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",h=K4({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),f=c.route;if(!h&&u&&n&&!r[r.length-1].route.index&&(h=K4({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!h)return null;
vendor: 6,948 bytes, lines 605-614
605Object.assign(i,h.params),o.push({params:i,pathname:cu([a,h.pathname]),pathnameBase:Kme(cu([a,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(a=cu([a,h.pathnameBase]))}return o}function K4(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Vme(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((u,d,h)=>{let{paramName:f,isOptional:p}=d;if(f==="*"){let g=l[h]||"";o=a.slice(0,a.length-g.length).replace(/(.)\/+$/,"$1")}const m=l[h];return p&&!m?u[f]=void 0:u[f]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function Vme(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),RK(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Wme(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return RK(!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 UI(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Ume(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ym(e):e;return{pathname:n?n.startsWith("/")?n:qme(n,t):t,search:Gme(r),hash:Yme(i)}}function qme(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function RN(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"].  Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Hme(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function qI(e,t){let n=Hme(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function HI(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ym(e):(i=Mv({},e),nr(!i.pathname||!i.pathname.includes("?"),RN("?","pathname","search",i)),nr(!i.pathname||!i.pathname.includes("#"),RN("#","pathname","hash",i)),nr(!i.search||!i.search.includes("#"),RN("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,l;if(o==null)l=n;else{let h=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;i.pathname=f.join("/")}l=h>=0?t[h]:"/"}let c=Ume(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const cu=e=>e.join("/").replace(/\/\/+/g,"/"),Kme=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Gme=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Yme=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Qme(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const $K=["post","put","patch","delete"];new Set($K);const Xme=["get",...$K];new Set(Xme);/**
606 * React Router v6.30.1
607 *
608 * Copyright (c) Remix Software Inc.
609 *
610 * This source code is licensed under the MIT license found in the
611 * LICENSE.md file in the root directory of this source tree.
612 *
613 * @license MIT
614 */function $v(){return $v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$v.apply(this,arguments)}const KI=x.createContext(null),Zme=x.createContext(null),Iu=x.createContext(null),q_=x.createContext(null),nc=x.createContext({outlet:null,matches:[],isDataRoute:!1}),LK=x.createContext(null);function Jme(e,t){let{relative:n}=t===void 0?{}:t;Qm()||nr(!1);let{basename:r,navigator:i}=x.useContext(Iu),{hash:a,pathname:o,search:l}=zK(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:cu([r,o])),i.createHref({pathname:c,search:l,hash:a})}function Qm(){return x.useContext(q_)!=null}function wo(){return Qm()||nr(!1),x.useContext(q_).location}function FK(e){x.useContext(Iu).static||x.useLayoutEffect(e)}function xr(){let{isDataRoute:e}=x.useContext(nc);return e?hge():ege()}function ege(){Qm()||nr(!1);let e=x.useContext(KI),{basename:t,future:n,navigator:r}=x.useContext(Iu),{matches:i}=x.useContext(nc),{pathname:a}=wo(),o=JSON.stringify(qI(i,n.v7_relativeSplatPath)),l=x.useRef(!1);return FK(()=>{l.current=!0}),x.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let h=HI(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:cu([t,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[t,r,o,a,e])}function Zs(){let{matches:e}=x.useContext(nc),t=e[e.length-1];return t?t.params:{}}function zK(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=x.useContext(Iu),{matches:i}=x.useContext(nc),{pathname:a}=wo(),o=JSON.stringify(qI(i,r.v7_relativeSplatPath));return x.useMemo(()=>HI(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function tge(e,t){return nge(e,t)}function nge(e,t,n,r){Qm()||nr(!1);let{navigator:i}=x.useContext(Iu),{matches:a}=x.useContext(nc),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=wo(),d;if(t){var h;let y=typeof t=="string"?Ym(t):t;c==="/"||(h=y.pathname)!=null&&h.startsWith(c)||nr(!1),d=y}else d=u;let f=d.pathname||"/",p=f;if(c!=="/"){let y=c.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let m=Eme(e,{pathname:p}),g=oge(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:cu([c,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:cu([c,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r);return t&&g?x.createElement(q_.Provider,{value:{location:$v({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Yc.Pop}},g):g}function rge(){let e=dge(),t=Qme(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application 
614Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:i},n):null,null)}const ige=x.createElement(rge,null);class sge extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?x.createElement(nc.Provider,{value:this.props.routeContext},x.createElement(LK.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function age(e){let{routeContext:t,match:n,children:r}=e,i=x.useContext(KI);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(nc.Provider,{value:t},r)}function oge(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let d=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);d>=0||nr(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let h=o[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:f,errors:p}=n,m=h.route.loader&&f[h.route.id]===void 0&&(!p||p[h.route.id]===void 0);if(h.route.lazy||m){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,h,f)=>{let p,m=!1,g=null,y=null;n&&(p=l&&h.route.id?l[h.route.id]:void 0,g=h.route.errorElement||ige,c&&(u<0&&f===0?(m=!0,y=null):u===f&&(m=!0,y=h.route.hydrateFallbackElement||null)));let b=t.concat(o.slice(0,f+1)),v=()=>{let w;return p?w=g:m?w=y:h.route.Component?w=x.createElement(h.route.Component,null):h.route.element?w=h.route.element:w=d,x.createElement(age,{match:h,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:w})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?x.createElement(sge,{location:n.location,revalidation:n.revalidation,component:g,error:p,children:v(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):v()},null)}var BK=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(BK||{}),kj=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}(kj||{});function lge(e){let t=x.useContext(KI);return t||nr(!1),t}function cge(e){let t=x.useContext(Zme);return t||nr(!1),t}function uge(e){let t=x.useContext(nc);return t||nr(!1),t}function VK(e){let t=uge(),n=t.matches[t.matches.length-1];return n.route.id||nr(!1),n.route.id}function dge(){var e;let t=x.useContext(LK),n=cge(kj.UseRouteError),r=VK(kj.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function hge(){let{router:e}=lge(BK.UseNavigateStable),t=VK(kj.UseNavigateStable),n=x.useRef(!1);return FK(()=>{n.current=!0}),x.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,$v({fromRouteId:t},a)))},[e,t])}function fge(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Pt(e){let{to:t,replace:n,state:r,relative:i}=e;Qm()||nr(!1);let{future:a,static:o}=x.useContext(Iu),{matches:l}=x.useContext(nc),{pathname:c}=wo(),u=xr(),d=HI(t,qI(l,a.v7_relativeSplatPath),c,i==="path"),h=JSON.stringify(d);return x.useEffect(()=>u(JSON.parse(h),{replace:n,state:r,relative:i}),[u,h,i,n,r]),null}function ct(e){nr(!1)}function pge(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Yc.Pop,navigator:a,static:o=!1,future:l}=e;Qm()&&nr(!1);
614let c=t.replace(/^\/*/,"/"),u=x.useMemo(()=>({basename:c,navigator:a,static:o,future:$v({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=Ym(r));let{pathname:d="/",search:h="",hash:f="",state:p=null,key:m="default"}=r,g=x.useMemo(()=>{let y=UI(d,c);return y==null?null:{location:{pathname:y,search:h,hash:f,state:p,key:m},navigationType:i}},[c,d,h,f,p,m,i]);return g==null?null:x.createElement(Iu.Provider,{value:u},x.createElement(q_.Provider,{children:n,value:g}))}function mge(e){let{children:t,location:n}=e;return tge(fE(t),n)}new Promise(()=>{});function fE(e,t){t===void 0&&(t=[]);let n=[];return x.Children.forEach(e,(r,i)=>{if(!x.isValidElement(r))return;let a=[...t,i];if(r.type===x.Fragment){n.push.apply(n,fE(r.props.children,a));return}r.type!==ct&&nr(!1),!r.props.index||!r.props.children||nr(!1);let o={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=fE(r.props.children,a)),n.push(o)}),n}/**
615 * React Router DOM v6.30.1
616 *
617 * Copyright (c) Remix Software Inc.
618 *
619 * This source code is licensed under the MIT license found in the
620 * LICENSE.md file in the root directory of this source tree.
621 *
622 * @license MIT
623 */function pE(){return pE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pE.apply(this,arguments)}function gge(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function yge(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function vge(e,t){return e.button===0&&(!t||t==="_self")&&!yge(e)}function mE(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function xge(e,t){let n=mE(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}const bge=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],wge="6";try{window.__reactRouterVersion=wge}catch{}const jge="startTransition",G4=CO[jge];function _ge(e){let{basename:t,children:n,future:r,window:i}=e,a=x.useRef();a.current==null&&(a.current=Cme({window:i,v5Compat:!0}));let o=a.current,[l,c]=x.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=x.useCallback(h=>{u&&G4?G4(()=>c(h)):c(h)},[c,u]);return x.useLayoutEffect(()=>o.listen(d),[o,d]),x.useEffect(()=>fge(r),[r]),x.createElement(pge,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const Sge=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",kge=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,oe=x.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:h}=t,f=gge(t,bge),{basename:p}=x.useContext(Iu),m,g=!1;if(typeof u=="string"&&kge.test(u)&&(m=u,Sge))try{let w=new URL(window.location.href),_=u.startsWith("//")?new URL(w.protocol+u):new URL(u),j=UI(_.pathname,p);_.origin===w.origin&&j!=null?u=j+_.search+_.hash:g=!0}catch{}let y=Jme(u,{relative:i}),b=Nge(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:h});function v(w){r&&r(w),w.defaultPrevented||b(w)}return x.createElement("a",pE({},f,{href:m||y,onClick:g||a?r:v,ref:n,target:c}))});var Y4;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Y4||(Y4={}));var Q4;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Q4||(Q4={}));function Nge(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=xr(),u=wo(),d=zK(e,{relative:o});return x.useCallback(h=>{if(vge(h,n)){h.preventDefault();let f=r!==void 0?r:Sj(u)===Sj(d);c(e,{replace:f,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,r,i,n,e,a,o,l])}function il(e){let t=x.useRef(mE(e)),n=x.useRef(!1),r=wo(),i=x.useMemo(()=>xge(r.search,n.current?null:t.current),[r.search]),a=xr(),o=x.useCallback((l,c)=>{const u=mE(typeof l=="function"?l(i):l);n.current=!0,a("?"+u,c)},[a,i]);return[i,o]}var $o=function(){return $o=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},$o.apply(this,arguments)};function Xm(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Cge(e,t,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}
623return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(h){o(h)}}function c(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?a(d.value):i(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})}function Age(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}const Tge=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class GI extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}}class Ege extends GI{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class X4 extends GI{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Z4 extends GI{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var gE;(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"})(gE||(gE={}));class Pge{constructor(t,{headers:n={},customFetch:r,region:i=gE.Any}={}){this.url=t,this.headers=n,this.region=i,this.fetch=Tge(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return Cge(this,arguments,void 0,function*(n,r={}){var i;let a,o;try{const{headers:l,method:c,body:u,signal:d,timeout:h}=r;let f={},{region:p}=r;p||(p=this.region);const m=new URL(`${this.url}/${n}`);p&&p!=="any"&&(f["x-region"]=p,m.searchParams.set("forceFunctionRegion",p));let g;u&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",g=u):typeof u=="string"?(f["Content-Type"]="text/plain",g=u):typeof FormData<"u"&&u instanceof FormData?g=u:(f["Content-Type"]="application/json",g=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?g=JSON.stringify(u):g=u;let y=d;h&&(o=new AbortController,a=setTimeout(()=>o.abort(),h),d?(y=o.signal,d.addEventListener("abort",()=>o.abort())):y=o.signal);const b=yield this.fetch(m.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),l),body:g,signal:y}).catch(j=>{throw new Ege(j)}),v=b.headers.get("x-relay-error");if(v&&v==="true")throw new X4(b);if(!b.ok)throw new Z4(b);let w=((i=b.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),_;return w==="application/json"?_=yield b.json():w==="application/octet-stream"||w==="application/pdf"?_=yield b.blob():w==="text/event-stream"?_=b:w==="multipart/form-data"?_=yield b.formData():_=yield b.text(),{data:_,error:null,response:b}}catch(l){return{data:null,error:l,response:l instanceof Z4||l instanceof X4?l.context:void 0}}finally{a&&clearTimeout(a)}})}}var Oge=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
623de=e.code}},Ige=class{constructor(e){var t,n;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var n=this;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 r=this.fetch;let i=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async a=>{let o=null,l=null,c=null,u=a.status,d=a.statusText;if(a.ok){var h,f;if(n.method!=="HEAD"){var p;const b=await a.text();b===""||(n.headers.get("Accept")==="text/csv"||n.headers.get("Accept")&&(!((p=n.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text"))?l=b:l=JSON.parse(b))}const g=(h=n.headers.get("Prefer"))===null||h===void 0?void 0:h.match(/count=(exact|planned|estimated)/),y=(f=a.headers.get("content-range"))===null||f===void 0?void 0:f.split("/");g&&y&&y.length>1&&(c=parseInt(y[1])),n.isMaybeSingle&&n.method==="GET"&&Array.isArray(l)&&(l.length>1?(o={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,c=null,u=406,d="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{var m;const g=await a.text();try{o=JSON.parse(g),Array.isArray(o)&&a.status===404&&(l=[],o=null,u=200,d="OK")}catch{a.status===404&&g===""?(u=204,d="No Content"):o={message:g}}if(o&&n.isMaybeSingle&&(!(o==null||(m=o.details)===null||m===void 0)&&m.includes("0 rows"))&&(o=null,u=200,d="OK"),o&&n.shouldThrowOnError)throw new Oge(o)}return{error:o,data:l,count:c,status:u,statusText:d}});return this.shouldThrowOnError||(i=i.catch(a=>{var o;let l="";const c=a==null?void 0:a.cause;if(c){var u,d,h,f;const m=(u=c==null?void 0:c.message)!==null&&u!==void 0?u:"",g=(d=c==null?void 0:c.code)!==null&&d!==void 0?d:"";l=`${(h=a==null?void 0:a.name)!==null&&h!==void 0?h:"FetchError"}: ${a==null?void 0:a.message}`,l+=`
624
625Caused by: ${(f=c==null?void 0:c.name)!==null&&f!==void 0?f:"Error"}: ${m}`,g&&(l+=` (${g})`),c!=null&&c.stack&&(l+=`
626${c.stack}`)}else{var p;l=(p=a==null?void 0:a.stack)!==null&&p!==void 0?p:""}return{error:{message:`${(o=a==null?void 0:a.name)!==null&&o!==void 0?o:"FetchError"}: ${a==null?void 0:a.message}`,details:l,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),i.then(e,t)}returns(){return this}overrideTypes(){return this}},Rge=class extends Ige{select(e){let t=!1;const n=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:i=r}={}){const a=i?`${i}.order`:"order",o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const i=typeof r>"u"?"offset":`${r}.offset`,a=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(a,`${t-e+1}`),this}abortSignal(e){return this.signal=e,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}
626explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:a="text"}={}){var o;const l=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,i?"wal":null].filter(Boolean).join("|"),c=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${a}; for="${c}"; options=${l};`),a==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const J4=new RegExp("[,()]");var wf=class extends Rge{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&J4.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&J4.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let i="";r==="plain"?i="pl":r==="phrase"?i="ph":r==="websearch"&&(i="w");const a=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${i}fts${a}.${t}`),this}match(e){return Object.entries(e).forEach(([t,n])=>{this.url.searchParams.append(t,`eq.${n}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},Dge=class{constructor(e,{headers:t={},schema:n,fetch:r}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=t??{},i=n?"HEAD":"GET";let a=!1;const o=(e??"*").split("").map(u=>/\s/.test(u)&&!a?"":(u==='"'&&(a=!a),u)).join(""),{url:l,headers:c}=this.cloneRequestState();return l.searchParams.set("select",o),r&&c.append("Prefer",`count=${r}`),new wf({method:i,url:l,headers:c,schema:this.schema,fetch:this.fetch})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const i="POST",{url:a,headers:o}=this.cloneRequestState();if(t&&o.append("Prefer",`count=${t}`),n||o.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){const c=[...new Set(l)].map(u=>`"${u}"`);a.searchParams.set("columns",c.join(","))}}return new wf({method:i,url:a,headers:o,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){var a;const o="POST",{url:l,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&l.searchParams.set("on_conflict",t),r&&c.append("Prefer",`count=${r}`),i||c.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((d,h)=>d.concat(Object.keys(h)),[]);if(u.length>0){const d=[...new Set(u)].map(h=>`"${h}"`);l.searchParams.set("columns",d.join(","))}}return new wf({method:o,url:l,headers:c,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}update(e,{count:t}={}){var n;const r="PATCH",{url:i,headers:a}=this.cloneRequestState();return t&&a.append("Prefer",`count=${t}`),new wf({method:r,url:i,headers:a,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:e}={}){var t;const n="DELETE",{url:r,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new wf({method:n,url:r,headers:i,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch})}},Mge=class WK{constructor(t,{headers:n={},schema:r,fetch:i}={}){this.url=t,this.headers=new Headers(n),this.schemaName=r,this.fetch=i}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new Dge(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new WK(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,n={},{head:r=!1,get:i=!1,count:a}={}){var o;let l;const c=new URL(`${this.url}/rpc/${t}`);let u;const d=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(d)),h=r&&Object.values(n).some(d);h?(l="POST",u=n):r||i?(l=r?"HEAD":"GET",Object.entries(n).filter(([p,m])=>m!==void 0).map(([p,m])=>[p,Array.isArray(m)?`{${m.join(",")}}`:`${m}
626`]).forEach(([p,m])=>{c.searchParams.append(p,m)})):(l="POST",u=n);const f=new Headers(this.headers);return h?f.set("Prefer",a?`count=${a},return=minimal`:"return=minimal"):a&&f.set("Prefer",`count=${a}`),new wf({method:l,url:c,headers:f,schema:this.schemaName,body:u,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}};class $ge{constructor(){}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."};const n=globalThis.process;if(n){const r=n.versions;if(r&&r.node){const i=r.node,a=parseInt(i.replace(/^v/,"").split(".")[0]);return a>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${a} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${a} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
627import ws from "ws"
628new 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 n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=`
629
630Suggested solution: ${t.workaround}`),new Error(n)}static createWebSocket(t,n){const r=this.getWebSocketConstructor();return new r(t,n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const Lge="2.93.1",Fge=`realtime-js/${Lge}`,zge="1.0.0",UK="2.0.0",eF=UK,yE=1e4,Bge=1e3,Vge=100;var Tc;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(Tc||(Tc={}));var Cr;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Cr||(Cr={}));var Qa;(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"})(Qa||(Qa={}));var vE;(function(e){e.websocket="websocket"})(vE||(vE={}));var fd;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(fd||(fd={}));class Wge{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,r;const i=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,i)}_encodeJsonUserBroadcastPush(t){var n,r;const i=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},o=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,n,r){var i,a;const o=t.topic,l=(i=t.ref)!==null&&i!==void 0?i:"",c=(a=t.join_ref)!==null&&a!==void 0?a:"",u=t.payload.event,d=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},h=Object.keys(d).length===0?"":JSON.stringify(d);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const f=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+o.length+u.length+h.length,p=new ArrayBuffer(this.HEADER_LENGTH+f);let m=new DataView(p),g=0;m.setUint8(g++,this.KINDS.userBroadcastPush),m.setUint8(g++,c.length),m.setUint8(g++,l.length),m.setUint8(g++,o.length),m.setUint8(g++,u.length),m.setUint8(g++,h.length),m.setUint8(g++,n),Array.from(c,b=>m.setUint8(g++,b.charCodeAt(0))),Array.from(l,b=>m.setUint8(g++,b.charCodeAt(0))),Array.from(o,b=>m.setUint8(g++,b.charCodeAt(0))),Array.from(u,b=>m.setUint8(g++,b.charCodeAt(0))),Array.from(h,b=>m.setUint8(g++,b.charCodeAt(0)));var y=new Uint8Array(p.byteLength+r.byteLength);return y.set(new Uint8Array(p),0),y.set(new Uint8Array(r),p.byteLength),y.buffer}decode(t,n){if(this._isArrayBuffer(t)){let r=this._binaryDecode(t);return n(r)}if(typeof t=="string"){const r=JSON.parse(t),[i,a,o,l,c]=r;
630return n({join_ref:i,ref:a,topic:o,event:l,payload:c})}return n({})}_binaryDecode(t){const n=new DataView(t),r=n.getUint8(0),i=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,i)}}_decodeUserBroadcast(t,n,r){const i=n.getUint8(1),a=n.getUint8(2),o=n.getUint8(3),l=n.getUint8(4);let c=this.HEADER_LENGTH+4;const u=r.decode(t.slice(c,c+i));c=c+i;const d=r.decode(t.slice(c,c+a));c=c+a;const h=r.decode(t.slice(c,c+o));c=c+o;const f=t.slice(c,t.byteLength),p=l===this.JSON_ENCODING?JSON.parse(r.decode(f)):f,m={type:this.BROADCAST_EVENT,event:d,payload:p};return o>0&&(m.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:m}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t==null?void 0:t.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)))}}class qK{constructor(t,n){this.callback=t,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=n}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 ln;(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"})(ln||(ln={}));const tF=(e,t,n={})=>{var r;const i=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((a,o)=>(a[o]=Uge(o,e,t,i),a),{}):{}},Uge=(e,t,n,r)=>{const i=t.find(l=>
630l.name===e),a=i==null?void 0:i.type,o=n[e];return a&&!r.includes(a)?HK(a,o):xE(o)},HK=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return Gge(t,n)}switch(e){case ln.bool:return qge(t);case ln.float4:case ln.float8:case ln.int2:case ln.int4:case ln.int8:case ln.numeric:case ln.oid:return Hge(t);case ln.json:case ln.jsonb:return Kge(t);case ln.timestamp:return Yge(t);case ln.abstime:case ln.date:case ln.daterange:case ln.int4range:case ln.int8range:case ln.money:case ln.reltime:case ln.text:case ln.time:case ln.timestamptz:case ln.timetz:case ln.tsrange:case ln.tstzrange:return xE(t);default:return xE(t)}},xE=e=>e,qge=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},Hge=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},Kge=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},Gge=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let a;const o=e.slice(1,n);try{a=JSON.parse("["+o+"]")}catch{a=o?o.split(","):[]}return a.map(l=>HK(t,l))}return e},Yge=e=>typeof e=="string"?e.replace(" ","T"):e,KK=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class DN{constructor(t,n,r={},i=yE){this.channel=t,this.event=n,this.payload=r,this.timeout=i,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,n){var r;return this._hasReceived(t)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:t,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:n})}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:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(n))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var nF;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(nF||(nF={}));class Vy{constructor(t,n){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},i=>{const{onJoin:a,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Vy.syncState(this.state,i,a,o),this.pendingDiffs.forEach(c=>{this.state=Vy.syncDiff(this.state,c,a,o)}),this.pendingDiffs=[],l()}),this.channel._on(r.diff,{},i=>{const{onJoin:a,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=Vy.syncDiff(this.state,i,a,o),l())}),this.onJoin((i,a,o)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:a,newPresences:o})}),this.onLeave((i,a,o)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:a,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,n,r,i){const a=this.cloneDeep(t),o=this.transformState(n),l={},c={};return this.map(a,(u,d)=>{o[u]||(c[u]=d)}),this.map(o,(u,d)=>{const h=a[u];if(h){const f=d.map(y=>y.presence_ref),p=h.map(y=>y.presence_ref),m=d.filter(y=>p.indexOf(y.presence_ref)<0),g=h.filter(y=>f.indexOf(y.presence_ref)<0);m.length>0&&(l[u]=m),g.length>0&&(c[u]=g)}else l[u]=d}),this.syncDiff(a,{joins:l,leaves:c},r,i)}static syncDiff(t,n,r,i){const{joins:a,leaves:o}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),i||(i=()=>{}),this.map(a,(l,c)=>{var u;
630const d=(u=t[l])!==null&&u!==void 0?u:[];if(t[l]=this.cloneDeep(c),d.length>0){const h=t[l].map(p=>p.presence_ref),f=d.filter(p=>h.indexOf(p.presence_ref)<0);t[l].unshift(...f)}r(l,d,c)}),this.map(o,(l,c)=>{let u=t[l];if(!u)return;const d=c.map(h=>h.presence_ref);u=u.filter(h=>d.indexOf(h.presence_ref)<0),t[l]=u,i(l,u,c),u.length===0&&delete t[l]}),t}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const i=t[r];return"metas"in i?n[r]=i.metas.map(a=>(a.presence_ref=a.phx_ref,delete a.phx_ref,delete a.phx_ref_prev,a)):n[r]=i,n},{})}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 rF;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(rF||(rF={}));var Wy;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Wy||(Wy={}));var bl;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(bl||(bl={}));class Uf{constructor(t,n={config:{}},r){var i,a;if(this.topic=t,this.params=n,this.socket=r,this.bindings={},this.state=Cr.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},n.config),this.timeout=this.socket.timeout,this.joinPush=new DN(this,Qa.join,this.params,this.timeout),this.rejoinTimer=new qK(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Cr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Cr.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Cr.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Cr.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Cr.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Qa.reply,{},(o,l)=>{this._trigger(this._replyEventName(l),o)}),this.presence=new Vy(this),this.broadcastEndpointURL=KK(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((a=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||a===void 0)&&a.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,n=this.timeout){var r,i,a;if(this.socket.isConnected()||this.socket.connect(),this.state==Cr.closed){const{config:{broadcast:o,presence:l,private:c}}=this.params,u=(i=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(p=>p.filter))!==null&&i!==void 0?i:[],d=!!this.bindings[Wy.PRESENCE]&&this.bindings[Wy.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,h={},f={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(p=>t==null?void 0:t(bl.CHANNEL_ERROR,p)),this._onClose(()=>t==null?void 0:t(bl.CLOSED)),this.updateJoinPayload(Object.assign({config:f},h)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:p})=>{var m;if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){t==null||t(bl.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,y=(m=g==null?void 0:g.length)!==null&&m!==void 0?m:0,b=[];for(let v=0;v<y;v++){const w=g[v],{filter:{event:_,schema:j,table:S,filter:k}}=w,N=p&&p[v];if(N&&N.event===_&&Uf.isFilterValueEqual(N.schema,j)&&Uf.isFilterValueEqual(N.table,S)&&Uf.isFilterValueEqual(N.filter,k))b.push(Object.assign(Object.assign({},w),{id:N.id}));else{this.unsubscribe(),this.state=Cr.errored,t==null||t(bl.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=b,t&&t(bl.SUBSCRIBED);return}}).receive("error",p=>{this.state=Cr.errored,t==null||t(bl.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(bl.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,r){return this.state===Cr.joined&&t===Wy.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(t,n,r)}async httpSend(t,n,r={}){var i;if(n==null)return Promise.reject("Payload is required for httpSend()");const a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:n,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(i=r.timeout)!==null&&i!==void 0?i:this.timeout);if(l.status===202)return{success:!0};let c=l.statusText;
630try{const u=await l.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(t,n={}){var r,i;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:a,payload:o}=t,l={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:l,body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((i=u.body)===null||i===void 0?void 0:i.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var o,l,c;const u=this._push(t.type,t,n.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)&&a("ok"),u.receive("ok",()=>a("ok")),u.receive("error",()=>a("error")),u.receive("timeout",()=>a("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Cr.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Qa.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(i=>{r=new DN(this,Qa.leave,{},t),r.receive("ok",()=>{n(),i("ok")}).receive("timeout",()=>{n(),i("timed out")}).receive("error",()=>{i("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Cr.closed,this.bindings={}}async _fetchWithTimeout(t,n,r){const i=new AbortController,a=setTimeout(()=>i.abort(),r),o=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:i.signal}));return clearTimeout(a),o}_push(t,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new DN(this,t,n,r);return this._canPush()?i.send():this._addToPushBuffer(i),i}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>Vge){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(t,n,r){return n}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,n,r){var i,a;const o=t.toLocaleLowerCase(),{close:l,error:c,leave:u,join:d}=Qa;if(r&&[l,c,u,d].indexOf(o)>=0&&r!==this._joinRef())return;let f=this._onMessage(o,n,r);if(n&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(p=>{var m,g,y;return((m=p.filter)===null||m===void 0?void 0:m.event)==="*"||((y=(g=p.filter)===null||g===void 0?void 0:g.event)===null||y===void 0?void 0:y.toLocaleLowerCase())===o}).map(p=>p.callback(f,r)):(a=this.bindings[o])===null||a===void 0||a.filter(p=>{var m,g,y,b,v,w;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in p){const _=p.id,j=(m=p.filter)===null||m===void 0?void 0:m.event;return _&&((g=n.ids)===null||g===void 0?void 0:g.includes(_))&&(j==="*"||(j==null?void 0:j.toLocaleLowerCase())===((y=n.data)===null||y===void 0?void 0:y.type.toLocaleLowerCase()))}else{const _=(v=(b=p==null?void 0:p.filter)===null||b===void 0?void 0:b.event)===null||v===void 0?void 0:v.toLocaleLowerCase();return _==="*"||_===((w=n==null?void 0:n.event)===null||w===void 0?void 0:w.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===o}).map(p=>{if(typeof f=="object"&&"ids"in f){const m=f.data,{schema:g,table:y,commit_timestamp:b,type:v,errors:w}=m;f=Object.assign(Object.assign({},{schema:g,table:y,commit_timestamp:b,eventType:v,new:{},old:{},errors:w}),this._getPayloadRecords(m))}p.callback(f,r)}
630)}_isClosed(){return this.state===Cr.closed}_isJoined(){return this.state===Cr.joined}_isJoining(){return this.state===Cr.joining}_isLeaving(){return this.state===Cr.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,n,r){const i=t.toLocaleLowerCase(),a={type:i,filter:n,callback:r};return this.bindings[i]?this.bindings[i].push(a):this.bindings[i]=[a],this}_off(t,n){const r=t.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(i=>{var a;return!(((a=i.type)===null||a===void 0?void 0:a.toLocaleLowerCase())===r&&Uf.isEqual(i.filter,n))})),this}static isEqual(t,n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(const r in t)if(t[r]!==n[r])return!1;return!0}static isFilterValueEqual(t,n){return(t??void 0)===(n??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Qa.close,{},t)}_onError(t){this._on(Qa.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Cr.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=tF(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=tF(t.columns,t.old_record)),n}}const MN=()=>{},g0={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Qge=[1e3,2e3,5e3,1e4],Xge=1e4,Zge=`
631  addEventListener("message", (e) => {
632    if (e.data.event === "start") {
633      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
634    }
635  });`;class Jge{constructor(t,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=yE,this.transport=null,this.heartbeatIntervalMs=g0.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=MN,this.ref=0,this.reconnectTimer=null,this.vsn=eF,this.logger=MN,this.conn=null,this.sendBuffer=[],this.serializer=new Wge,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=i=>i?(...a)=>i(...a):(...a)=>fetch(...a),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey,this.endPoint=`${t}/${vE.websocket}`,this.httpEndpoint=KK(t),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=$ge.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const n=t.message;throw n.includes("Node.js")?new Error(`${n}
636
637To use Realtime in Node.js, you need to provide a WebSocket implementation:
638
639Option 1: Use Node.js 22+ which has native WebSocket support
640Option 2: Install and provide the "ws" package:
641
642  npm install ws
643
644  import ws from "ws"
645  const client = new RealtimeClient(url, {
646    ...options,
647    transport: ws
648  })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,n??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,n,r){this.logger(t,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case Tc.connecting:return fd.Connecting;case Tc.open:return fd.Open;case Tc.closing:return fd.Closing;default:return fd.Closed}}isConnected(){return this.connectionState()===fd.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}
648channel(t,n={config:{}}){const r=`realtime:${t}`,i=this.getChannels().find(a=>a.topic===r);if(i)return i;{const a=new Uf(`realtime:${t}`,n,this);return this.channels.push(a),a}}push(t){const{topic:n,event:r,payload:i,ref:a}=t,o=()=>{this.encode(t,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${n} ${r} (${a})`,i),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(Bge,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},g0.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}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 n=this.channels.find(r=>r.topic===t&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${t}"`),n.unsubscribe())}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,n=>{if(n.topic==="phoenix"&&n.event==="phx_reply"&&n.ref&&n.ref===this.pendingHeartbeatRef){const u=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error",u)}catch(d){this.log("error","error in heartbeat callback",d)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:r,event:i,payload:a,ref:o}=n,l=o?`(${o})`:"",c=a.status||"";this.log("receive",`${c} ${r} ${i} ${l}`.trim(),a),this.channels.filter(u=>u._isMember(r)).forEach(u=>u._trigger(i,a,o)),this._triggerStateCallbacks("message",n)})}_clearTimer(t){var n;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.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),this.conn.readyState===Tc.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===Tc.open||this.conn.readyState===Tc.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(n=>{this.log("error","error waiting for auth on connect",n),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=n=>{this.log("worker","worker error",n.message),this._terminateWorker()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(t){var n;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t);try{this.heartbeatCallback("error")}catch(n){this.log("error","error in heartbeat callback",n)}}
648_triggerChanError(){this.channels.forEach(t=>t._trigger(Qa.error))}_appendParams(t,n){if(Object.keys(n).length===0)return t;const r=t.match(/\?/)?"&":"?",i=new URLSearchParams(n);return`${t}${r}${i}`}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([Zge],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(t,n=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(t=null){let n,r=!1;if(t)n=t,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(i=>{const a={access_token:n,version:Fge};n&&i.updateJoinPayload(a),i.joinedOnce&&i._isJoined()&&i._push(Qa.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${t}`,n)})}_triggerStateCallbacks(t,n){try{this.stateChangeCallbacks[t].forEach(r=>{try{r(n)}catch(i){this.log("error",`error in ${t} callback`,i)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new qK(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},g0.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var n,r,i,a,o,l,c,u,d,h,f,p;switch(this.transport=(n=t==null?void 0:t.transport)!==null&&n!==void 0?n:null,this.timeout=(r=t==null?void 0:t.timeout)!==null&&r!==void 0?r:yE,this.heartbeatIntervalMs=(i=t==null?void 0:t.heartbeatIntervalMs)!==null&&i!==void 0?i:g0.HEARTBEAT_INTERVAL,this.worker=(a=t==null?void 0:t.worker)!==null&&a!==void 0?a:!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:MN,this.vsn=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:eF,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=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:m=>Qge[m-1]||Xge,this.vsn){case zge:this.encode=(d=t==null?void 0:t.encode)!==null&&d!==void 0?d:(m,g)=>g(JSON.stringify(m)),this.decode=(h=t==null?void 0:t.decode)!==null&&h!==void 0?h:(m,g)=>g(JSON.parse(m));break;case UK:this.encode=(f=t==null?void 0:t.encode)!==null&&f!==void 0?f:this.serializer.encode.bind(this.serializer),this.decode=(p=t==null?void 0:t.decode)!==null&&p!==void 0?p:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}var Lv=class extends Error{constructor(e,t){var n;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((n=t.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function eye(e,t,n){const r=new URL(t,e);if(n)for(const[i,a]of Object.entries(n))a!==void 0&&r.searchParams.set(i,a);return r.toString()}async function tye(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function nye(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:a,headers:o}){const l=eye(e.baseUrl,r,i),c=await tye(e.auth),u=await t(l,{method:n,headers:{...a?{"Content-Type":"application/json"}:{},...c,...o},body:a?JSON.stringify(a):void 0}),d=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),f=h&&d?JSON.parse(d):d;if(!u.ok){const p=h?f:void 0,m=p==null?void 0:p.error;throw new Lv((m==null?void 0:m.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:m==null?void 0:m.type,icebergCode:m==null?void 0:m.code,details:p})}return{status:u.status,headers:u.headers,data:f}}}}function y0(e){return e.join("�")}var rye=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:y0(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${y0(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${y0(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${y0(e.namespace)}`}),!0}catch(t){if(t instanceof Lv&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof Lv&&n.status===409)return;throw n}}};function Kh(e){return e.join("�")}var iye=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Kh(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Kh(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Kh(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Kh(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Kh(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Kh(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof Lv&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof Lv&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},sye=class{constructor(e){var r;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=nye({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(r=e.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new r
648ye(this.client,t),this.tableOps=new iye(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},H_=class extends Error{constructor(e,t="storage",n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}};function K_(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var v0=class extends H_{constructor(e,t,n,r="storage"){super(e,r,t,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},GK=class extends H_{constructor(e,t,n="storage"){super(e,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const aye=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),oye=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)},bE=e=>{if(Array.isArray(e))return e.map(n=>bE(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const i=n.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));t[i]=bE(r)}),t},lye=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function Fv(e){"@babel/helpers - typeof";return Fv=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},Fv(e)}function cye(e,t){if(Fv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Fv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uye(e){var t=cye(e,"string");return Fv(t)=="symbol"?t:t+""}function dye(e,t,n){return(t=uye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function it(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iF(Object(n),!0).forEach(function(r){dye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const sF=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},hye=async(e,t,n,r)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(n!=null&&n.noResolveJson)){const i=e,a=i.status||500;if(typeof i.json=="function")i.json().then(o=>{const l=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||a+"";t(new v0(sF(o),a,l,r))}).catch(()=>{if(r==="vectors"){const o=a+"";t(new v0(i.statusText||`HTTP ${a} error`,a,o,r))}else{const o=a+"";t(new v0(i.statusText||`HTTP ${a} error`,a,o,r))}});else{const o=a+"";t(new v0(i.statusText||`HTTP ${a} error`,a,o,r))}}else t(new GK(sF(e),e,r))},fye=(e,t,n,r)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||e==="HEAD"||!r?it(it({},i),n):(oye(r)?(i.headers=it({"Content-Type":"application/json"},t==null?void 0:t.headers),i.body=JSON.stringify(r)):i.body=r,t!=null&&t.duplex&&(i.duplex=t.duplex),it(it({},i),n))};async function Vg(e,t,n,r,i,a,o){return new Promise((l,c)=>{e(n,fye(t,r,i,a)).then(u=>{if(!u.ok)throw u;if(r!=null&&r.noResolveJson)return u;if(o==="vectors"){const d=u.headers.get("content-type");if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>l(u)).catch(u=>hye(u,c,r,o))})}function pye(e="storage"){return{get:async(t,n,r,i)=>Vg(t,"GET",n,r,i,void 0,e),post:async(t,n,r,i,a)=>Vg(t,"POST",n,i,a,r,e),put:async(t,n,r,i,a)=>Vg(t,"PUT",n,i,a,r,e),head:async(t,n,r,i)=>Vg(t,"HEAD",n,it(it({},r),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,n,r,i,a)=>Vg(t,"DELETE",n,i,a,r,e)}}const mye=pye("storage"),{get:zv,post:En,put:wE,head:gye,remove:YI}=mye;var Zm=class{constructor(e,t={},n,r="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.fetch=aye(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(K_(n))return{data:null,error:n};throw n}}},yye=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(K_(t))return{data:null,error:t};throw t}}};let YK;YK=Symbol.toStringTag;var vye=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[YK]="BlobDownloadBuilder",this.promise=null}asStream(){return new yye(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(K_(t))return{data:null,error:t};throw t}}};const xye={limit:100,offset:0,sortBy:{column:"name",order:"asc"}}
648,aF={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var bye=class extends Zm{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var i=this;return i.handleOperation(async()=>{let a;const o=it(it({},aF),r);let l=it(it({},i.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&n instanceof Blob?(a=new FormData,a.append("cacheControl",o.cacheControl),c&&a.append("metadata",i.encodeMetadata(c)),a.append("",n)):typeof FormData<"u"&&n instanceof FormData?(a=n,a.has("cacheControl")||a.append("cacheControl",o.cacheControl),c&&!a.has("metadata")&&a.append("metadata",i.encodeMetadata(c))):(a=n,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<"u"&&a instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!o.duplex&&(o.duplex="half")),r!=null&&r.headers&&(l=it(it({},l),r.headers));const u=i._removeEmptyFolders(t),d=i._getFinalPath(u),h=await(e=="PUT"?wE:En)(i.fetch,`${i.url}/object/${d}`,a,it({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:u,id:h.Id,fullPath:h.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var i=this;const a=i._removeEmptyFolders(e),o=i._getFinalPath(a),l=new URL(i.url+`/object/upload/sign/${o}`);return l.searchParams.set("token",t),i.handleOperation(async()=>{let c;const u=it({upsert:aF.upsert},r),d=it(it({},i.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.append("cacheControl",u.cacheControl)):(c=n,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType),{path:a,fullPath:(await wE(i.fetch,l.toString(),c,{headers:d})).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const i=it({},n.headers);t!=null&&t.upsert&&(i["x-upsert"]="true");const a=await En(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:i}),o=new URL(n.url+a.url),l=o.searchParams.get("token");if(!l)throw new H_("No token returned by API");return{signedUrl:o.toString(),path:e,token:l}})}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await En(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
648stinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await En(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(e),a=await En(r.fetch,`${r.url}/object/sign/${i}`,it({expiresIn:t},n!=null&&n.transform?{transform:n.transform}:{}),{headers:r.headers});const o=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{signedUrl:encodeURI(`${r.url}${a.signedURL}${o}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{const i=await En(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),a=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return i.map(o=>it(it({},o),{},{signedUrl:o.signedURL?encodeURI(`${r.url}${o.signedURL}${a}`):null}))})}download(e,t){const n=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",r=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),i=r?`?${r}`:"",a=this._getFinalPath(e),o=()=>zv(this.fetch,`${this.url}/${n}/${a}${i}`,{headers:this.headers,noResolveJson:!0});return new vye(o,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>bE(await zv(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await gye(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(K_(r)&&r instanceof GK){const i=r.originalError;if([400,404].includes(i==null?void 0:i.status))return{data:!1,error:r}}throw r}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=[],i=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";i!==""&&r.push(i);const a=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",o=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});o!==""&&r.push(o);let l=r.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${l}`)}}}async remove(e){var t=this;return t.handleOperation(async()=>await YI(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{const i=it(it(it({},xye),t),{},{prefix:e||""});return await En(r.fetch,`${r.url}/object/list/${r.bucketId}`,i,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const r=it({},e);return await En(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const wye="2.93.1",ib={"X-Client-Info":`storage-js/${wye}`};var jye=class extends Zm{constructor(e,t={},n,r){const i=new URL(e);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."));const a=i.href.replace(/\/$/,""),o=it(it({},ib),t);super(a,o,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await zv(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await zv(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await En(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await wE(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await En(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await YI(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},_ye=class extends Zm{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=it(it({},ib),t);super(r,i,n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await En(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const r=n.toString(),i=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await zv(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await YI(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!lye(e))throw new H_("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new sye({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}
648),r=this.shouldThrowOnError;return new Proxy(n,{get(i,a){const o=i[a];return typeof o!="function"?o:async(...l)=>{try{return{data:await o.apply(i,l),error:null}}catch(c){if(r)throw c;return{data:null,error:c}}}}})}},Sye=class extends Zm{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=it(it({},ib),{},{"Content-Type":"application/json"},t);super(r,i,n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await En(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await En(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await En(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await En(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},kye=class extends Zm{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=it(it({},ib),{},{"Content-Type":"application/json"},t);super(r,i,n,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await En(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await En(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await En(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await En(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await En(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},Nye=class extends Zm{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=it(it({},ib),{},{"Content-Type":"application/json"},t);super(r,i,n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await En(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await En(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await En(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await En(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},Cye=class extends Nye{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new Aye(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},Aye=class extends Sye{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,it(it({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,it(it({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new Tye(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},Tye=class extends kye{constructor(e,t,n,r,i){super(e,t,i),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,it(it({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,it(it({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,it(it({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,it(it({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,it(it({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},Eye=class extends jye{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new bye(this.url,this.headers,e,this.fetch)}get vectors(){return new Cye(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new _ye(this.url+"/iceberg",this.headers,this.fetch)}};const QK="2.93.1",jf=30*1e3,jE=3,$N=jE*jf,Pye="http://localhost:9999",Oye="supabase.auth.token",Iye={"X-Client-Info":`gotrue-js/${QK}`},_E="X-Supabase-Api-Version",XK={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Rye=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Dye=10*60*1e3;
648class Bv extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function Ue(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class Mye extends Bv{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function $ye(e){return Ue(e)&&e.name==="AuthApiError"}class pd extends Bv{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class rc extends Bv{constructor(t,n,r,i){super(t,r,i),this.name=n,this.status=r}}class js extends rc{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function LN(e){return Ue(e)&&e.name==="AuthSessionMissingError"}class Gh extends rc{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class x0 extends rc{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class b0 extends rc{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function Lye(e){return Ue(e)&&e.name==="AuthImplicitGrantRedirectError"}class oF extends rc{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Fye extends rc{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class SE extends rc{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function FN(e){return Ue(e)&&e.name==="AuthRetryableFetchError"}class lF extends rc{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class kE extends rc{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Nj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),cF=` 	
649\r=`.split(""),zye=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<cF.length;t+=1)e[cF[t].charCodeAt(0)]=-2;for(let t=0;t<Nj.length;t+=1)e[Nj[t].charCodeAt(0)]=t;return e})();function uF(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(Nj[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(Nj[r]),t.queuedBits-=6}}function ZK(e,t,n){const r=zye[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function dF(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=o=>{Wye(o,r,n)};for(let o=0;o<e.length;o+=1)ZK(e.charCodeAt(o),i,a);return t.join("")}function Bye(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 Vye(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const i=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|i)+65536,n+=1}Bye(r,t)}}function Wye(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;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&&n(t.codepoint)}}function dp(e){const t=[],n={queue:0,queuedBits:0},r=i=>{t.push(i)};for(let i=0;i<e.length;i+=1)ZK(e.charCodeAt(i),n,r);return new Uint8Array(t)}function Uye(e){const t=[];return Vye(e,n=>t.push(n)),new Uint8Array(t)}
649function jd(e){const t=[],n={queue:0,queuedBits:0},r=i=>{t.push(i)};return e.forEach(i=>uF(i,n,r)),uF(null,n,r),t.join("")}function qye(e){return Math.round(Date.now()/1e3)+e}function Hye(){return Symbol("auth-callback")}const Zr=()=>typeof window<"u"&&typeof document<"u",Gu={tested:!1,writable:!1},JK=()=>{if(!Zr())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Gu.tested)return Gu.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Gu.tested=!0,Gu.writable=!0}catch{Gu.tested=!0,Gu.writable=!1}return Gu.writable};function Kye(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((i,a)=>{t[a]=i})}catch{}return n.searchParams.forEach((r,i)=>{t[i]=r}),t}const e7=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Gye=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",_f=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},Yu=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Xr=async(e,t)=>{await e.removeItem(t)};class G_{constructor(){this.promise=new G_.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}G_.promiseConstructor=Promise;function w0(e){const t=e.split(".");if(t.length!==3)throw new kE("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!Rye.test(t[r]))throw new kE("JWT not in base64url format");return{header:JSON.parse(dF(t[0])),payload:JSON.parse(dF(t[1])),signature:dp(t[2]),raw:{header:t[0],payload:t[1]}}}async function Yye(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function Qye(e,t){return new Promise((r,i)=>{(async()=>{for(let a=0;a<1/0;a++)try{const o=await e(a);if(!t(a,null,o)){r(o);return}}catch(o){if(!t(a,o)){i(o);return}}})()})}function Xye(e){return("0"+e.toString(16)).substr(-2)}function Zye(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let i="";for(let a=0;a<56;a++)i+=n.charAt(Math.floor(Math.random()*r));return i}return crypto.getRandomValues(t),Array.from(t,Xye).join("")}async function Jye(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(r);return Array.from(i).map(a=>String.fromCharCode(a)).join("")}async function eve(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 n=await Jye(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Yh(e,t,n=!1){const r=Zye();let i=r;n&&(i+="/PASSWORD_RECOVERY"),await _f(e,`${t}-code-verifier`,i);const a=await eve(r);return[a,r===a?"plain":"s256"]}const tve=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function nve(e){const t=e.headers.get(_E);if(!t||!t.match(tve))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function rve(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 ive(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 sve=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Qh(e){if(!sve.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function zN(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="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 "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function ave(e,t){return new Proxy(e,{get:(n,r,i)=>{if(r==="__isInsecureUserWarningProxy")return!0;
649if(typeof r=="symbol"){const a=r.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)"||a==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,i)}return!t.value&&typeof r=="string"&&(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."),t.value=!0),Reflect.get(n,r,i)}})}function hF(e){return JSON.parse(JSON.stringify(e))}const od=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),ove=[502,503,504];async function fF(e){var t;if(!Gye(e))throw new SE(od(e),0);if(ove.includes(e.status))throw new SE(od(e),e.status);let n;try{n=await e.json()}catch(a){throw new pd(od(a),a)}let r;const i=nve(e);if(i&&i.getTime()>=XK["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new lF(od(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new js}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((a,o)=>a&&typeof o=="string",!0))throw new lF(od(n),e.status,n.weak_password.reasons);throw new Mye(od(n),e.status||500,r)}const lve=(e,t,n,r)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function et(e,t,n,r){var i;const a=Object.assign({},r==null?void 0:r.headers);a[_E]||(a[_E]=XK["2024-01-01"].name),r!=null&&r.jwt&&(a.Authorization=`Bearer ${r.jwt}`);const o=(i=r==null?void 0:r.query)!==null&&i!==void 0?i:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await cve(e,t,n+l,{headers:a,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(c):{data:Object.assign({},c),error:null}}async function cve(e,t,n,r,i,a){const o=lve(t,r,i,a);let l;try{l=await e(n,Object.assign({},o))}catch(c){throw console.error(c),new SE(od(c),0)}if(l.ok||await fF(l),r!=null&&r.noResolveJson)return l;try{return await l.json()}catch(c){await fF(c)}}function Ba(e){var t;let n=null;hve(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=qye(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function pF(e){const t=Ba(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((n,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Rc(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function uve(e){return{data:e,error:null}}function dve(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a}=e,o=Xm(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function mF(e){return e}function hve(e){return e.access_token&&e.refresh_token&&e.expires_in}const BN=["global","local","others"];class fve{constructor({url:t="",headers:n={},fetch:r}){this.url=t,this.headers=n,this.fetch=e7(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,n=BN[0]){if(BN.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${BN.join(", ")}`);try{return await et(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Ue(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await et(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Rc})}catch(r){if(Ue(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=Xm(t,["options"]),i=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(i.new_email=r==null?void 0:r.newEmail,delete i.newEmail),await et(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:dve,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(Ue(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await et(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Rc})}catch(n){if(Ue(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,i,a,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await et(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(a=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:mF});if(d.error)throw d.error;const h=await d.json(),f=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>
6490&&(p.forEach(m=>{const g=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(m.split(";")[1].split("=")[1]);u[`${y}Page`]=g}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(Ue(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){Qh(t);try{return await et(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Rc})}catch(n){if(Ue(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){Qh(t);try{return await et(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:Rc})}catch(r){if(Ue(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){Qh(t);try{return await et(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:Rc})}catch(r){if(Ue(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){Qh(t.userId);try{const{data:n,error:r}=await et(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:n,error:r}}catch(n){if(Ue(n))return{data:null,error:n};throw n}}async _deleteFactor(t){Qh(t.userId),Qh(t.id);try{return{data:await et(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(Ue(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,i,a,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await et(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(a=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:mF});if(d.error)throw d.error;const h=await d.json(),f=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>0&&(p.forEach(m=>{const g=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(m.split(";")[1].split("=")[1]);u[`${y}Page`]=g}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(Ue(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await et(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Ue(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await et(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Ue(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await et(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Ue(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await et(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Ue(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await et(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Ue(n))return{data:null,error:n};throw n}}}function gF(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const Xh={debug:!!(globalThis&&JK()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};
649class t7 extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class pve extends t7{}async function mve(e,t,n){Xh.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),Xh.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:r.signal},async i=>{if(i){Xh.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,i.name);try{return await n()}finally{Xh.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,i.name)}}else{if(t===0)throw Xh.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new pve(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Xh.debug)try{const a=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(a,null,"  "))}catch(a){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",a)}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 n()}}))}function gve(){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)}}function n7(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function yve(e){return parseInt(e,16)}function vve(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function xve(e){var t;const{chainId:n,domain:r,expirationTime:i,issuedAt:a=new Date,nonce:o,notBefore:l,requestId:c,resources:u,scheme:d,uri:h,version:f}=e;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)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(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
650`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const p=n7(e.address),m=d?`${d}://${r}
650`:r,g=e.statement?`${e.statement}
651`:"",y=`${m} wants you to sign in with your Ethereum account:
652${p}
653
654${g}`;let b=`URI: ${h}
655Version: ${f}
656Chain ID: ${n}${o?`
657Nonce: ${o}`:""}
658Issued At: ${a.toISOString()}`;if(i&&(b+=`
659Expiration Time: ${i.toISOString()}`),l&&(b+=`
660Not Before: ${l.toISOString()}`),c&&(b+=`
661Request ID: ${c}`),u){let v=`
662Resources:`;for(const w of u){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}`);v+=`
663- ${w}`}b+=v}return`${y}
664${b}`}class hr extends Error{constructor({message:t,code:n,cause:r,name:i}){var a;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(a=i??(r instanceof Error?r.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=n}}class Cj extends hr{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function bve({error:e,options:t}){var n,r,i;const{publicKey:a}=t;if(!a)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new hr({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=a.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new hr({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((r=a.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new hr({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((i=a.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new hr({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new hr({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new hr({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return a.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new hr({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new hr({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const o=window.location.hostname;if(r7(o)){if(a.rp.id!==o)return new hr({message:`The RP ID "${a.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new hr({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(a.user.id.byteLength<1||a.user.id.byteLength>64)return new hr({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new hr({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new hr({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function wve({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new hr({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new hr({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(r7(r)){if(n.rpId!==r)return new hr({message:`The RP ID "${n.rpId}
664" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new hr({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new hr({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new hr({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class jve{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const _ve=new jve;function Sve(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:r}=e,i=Xm(e,["challenge","user","excludeCredentials"]),a=dp(t).buffer,o=Object.assign(Object.assign({},n),{id:dp(n.id).buffer}),l=Object.assign(Object.assign({},i),{challenge:a,user:o});if(r&&r.length>0){l.excludeCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const u=r[c];l.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:dp(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return l}function kve(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,r=Xm(e,["challenge","allowCredentials"]),i=dp(t).buffer,a=Object.assign(Object.assign({},r),{challenge:i});if(n&&n.length>0){a.allowCredentials=new Array(n.length);for(let o=0;o<n.length;o++){const l=n[o];a.allowCredentials[o]=Object.assign(Object.assign({},l),{id:dp(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return a}function Nve(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:jd(new Uint8Array(e.response.attestationObject)),clientDataJSON:jd(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Cve(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,r=e.getClientExtensionResults(),i=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:jd(new Uint8Array(i.authenticatorData)),clientDataJSON:jd(new Uint8Array(i.clientDataJSON)),signature:jd(new Uint8Array(i.signature)),userHandle:i.userHandle?jd(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function r7(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function yF(){var e,t;return!!(Zr()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function Ave(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Cj("Browser returned unexpected credential type",t)}:{data:null,error:new Cj("Empty credential response",t)}}catch(t){return{data:null,error:bve({error:t,options:e})}}}async function Tve(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Cj("Browser returned unexpected credential type",t)}:{data:null,error:new Cj("Empty credential response",t)}}
664catch(t){return{data:null,error:wve({error:t,options:e})}}}const Eve={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},Pve={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Aj(...e){const t=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),n=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),r={};for(const i of e)if(i)for(const a in i){const o=i[a];if(o!==void 0)if(Array.isArray(o))r[a]=o;else if(n(o))r[a]=o;else if(t(o)){const l=r[a];t(l)?r[a]=Aj(l,o):r[a]=Aj(o)}else r[a]=o}return r}function Ove(e,t){return Aj(Eve,e,t||{})}function Ive(e,t){return Aj(Pve,e,t||{})}class Rve{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:n,friendlyName:r,signal:i},a){try{const{data:o,error:l}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!o)return{data:null,error:l};const c=i??_ve.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:u}=o.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${r}`),u.displayName||(u.displayName=u.name)}switch(o.webauthn.type){case"create":{const u=Ove(o.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:d,error:h}=await Ave({publicKey:u,signal:c});return d?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}case"request":{const u=Ive(o.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:d,error:h}=await Tve(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:u,signal:c}));return d?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}}}catch(o){return Ue(o)?{data:null,error:o}:{data:null,error:new pd("Unexpected error in challenge",o)}}}async _verify({challengeId:t,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:r})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},a){if(!n)return{data:null,error:new Bv("rpId is required for WebAuthn authentication")};try{if(!yF())return{data:null,error:new pd("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:i},{request:a});if(!o)return{data:null,error:l};const{webauthn:c}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(o){return Ue(o)?{data:null,error:o}:{data:null,error:new pd("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},a){if(!n)return{data:null,error:new Bv("rpId is required for WebAuthn registration")};try{if(!yF())return{data:null,error:new pd("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this._enroll({friendlyName:t});if(!o)return await this.client.mfa.listFactors().then(d=>{var h;return(h=d.data)===null||h===void 0?void 0:h.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===t&&f.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:l};const{data:c,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:i},{create:a});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(o){return Ue(o)?{data:null,error:o}:{data:null,error:new pd("Unexpected error in register",o)}}}}gve();const Dve={url:Pye,storageKey:Oye,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Iye,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function vF(e,t,n){return await n()}const Zh={};class Vv{get jwks(){var t,n;return(n=(t=Zh[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){Zh[this.storageKey]=Object.assign(Object.assign({},Zh[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=Zh[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Zh[this.storageKey]=Object.assign(Object.assign({},Zh[this.storageKey]),{cachedAt:t})}constructor(t){var n,r,i;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=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;const a=Object.assign(Object.assign({},Dve),t);if(this.storageKey=a.storageKey,this.instanceID=(n=Vv.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,Vv.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.instanceID>0&&Zr()){const o=`${this._logPrefix()} 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.`;console.warn(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=a.persistSession,this.autoRefreshToken=a.autoRefreshToken,this.admin=new fve({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=e7(a.fetch),this.lock=a.lock||vF,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,this.throwOnError=a.throwOnError,this.lockAcquireTimeout=a.lockAcquireTimeout,a.lock?this.lock=a.lock:this.persistSession&&Zr()&&
664(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=mve:this.lock=vF,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),webauthn:new Rve(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(a.storage?this.storage=a.storage:JK()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=gF(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=gF(this.memoryStorage)),Zr()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o);try{await this._notifyAllSubscribers(o.data.event,o.data.session,!1)}catch(l){this._debug("#broadcastChannel","error",l)}})}this.initialize().catch(o=>{this._debug("#initialize()","error",o)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${QK}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let n={},r="none";if(Zr()&&(n=Kye(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),Zr()&&this.detectSessionInUrl&&r!=="none"){const{data:i,error:a}=await this._getSessionFromURL(n,r);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),Lye(a)){const c=(t=a.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:a}}return{error:a}}const{session:o,redirectType:l}=i;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(n){return Ue(n)?this._returnResult({error:n}):this._returnResult({error:new pd("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,i;try{const a=await et(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(i=t==null?void 0:t.options)===null||i===void 0?void 0:i.captchaToken}},xform:Ba}),{data:o,error:l}=a;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(a){if(Ue(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signUp(t){var n,r,i;try{let a;if("email"in t){const{email:d,password:h,options:f}=t;let p=null,m=null;this.flowType==="pkce"&&([p,m]=await Yh(this.storage,this.storageKey)),a=await et(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:d,password:h,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:p,code_challenge_method:m},xform:Ba})}else if("phone"in t){const{phone:d,password:h,options:f}=t;a=await et(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},channel:(i=f==null?void 0:f.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:Ba})}else throw new x0("You must provide either an email or phone number and a password");const{data:o,error:l}=a;if(l||!o)return await Xr(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(a){if(await Xr(this.storage,`${this.storageKey}-code-verifier`),Ue(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithPassword(t){try{let n;if("email"in t){const{email:a,password:o,options:l}=t;n=await et(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:pF})}else if("phone"in t){const{phone:a,password:o,options:l}=t;n=await et(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:pF})}else throw new x0("You must provide either an email or phone number and a password");const{data:r,error:i}=n;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!r||!r.session||!r.user){const a=new Gh;return this._returnResult({data:{user:null,session:null},error:a})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:i})}catch(n){if(Ue(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,r,i,a;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(i=t.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(a=t.o
664ptions)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,r,i,a,o,l,c,u,d,h,f;let p,m;if("message"in t)p=t.message,m=t.signature;else{const{chain:g,wallet:y,statement:b,options:v}=t;let w;if(Zr())if(typeof y=="object")w=y;else{const T=window;if("ethereum"in T&&typeof T.ethereum=="object"&&"request"in T.ethereum&&typeof T.ethereum.request=="function")w=T.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 y!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=y}const _=new URL((n=v==null?void 0:v.url)!==null&&n!==void 0?n:window.location.href),j=await w.request({method:"eth_requestAccounts"}).then(T=>T).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!j||j.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const S=n7(j[0]);let k=(r=v==null?void 0:v.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!k){const T=await w.request({method:"eth_chainId"});k=yve(T)}const N={domain:_.host,address:S,statement:b,uri:_.href,version:"1",chainId:k,nonce:(i=v==null?void 0:v.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(o=(a=v==null?void 0:v.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=v==null?void 0:v.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=v==null?void 0:v.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=v==null?void 0:v.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=v==null?void 0:v.signInWithEthereum)===null||d===void 0?void 0:d.resources};p=xve(N),m=await w.request({method:"personal_sign",params:[vve(p),S]})}try{const{data:g,error:y}=await et(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:m},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:Ba});if(y)throw y;if(!g||!g.session||!g.user){const b=new Gh;return this._returnResult({data:{user:null,session:null},error:b})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:y})}catch(g){if(Ue(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var n,r,i,a,o,l,c,u,d,h,f,p;let m,g;if("message"in t)m=t.message,g=t.signature;else{const{chain:y,wallet:b,statement:v,options:w}=t;let _;if(Zr())if(typeof b=="object")_=b;else{const S=window;if("solana"in S&&typeof S.solana=="object"&&("signIn"in S.solana&&typeof S.solana.signIn=="function"||"signMessage"in S.solana&&typeof S.solana.signMessage=="function"))_=S.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 j=new URL((n=w==null?void 0:w.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in _&&_.signIn){const S=await _.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:j.host,uri:j.href}),v?{statement:v}:null));let k;if(Array.isArray(S)&&S[0]&&typeof S[0]=="object")k=S[0];else if(S&&typeof S=="object"&&"signedMessage"in S&&"signature"in S)k=S;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in k&&"signature"in k&&(typeof k.signedMessage=="string"||k.signedMessage instanceof Uint8Array)&&k.signature instanceof Uint8Array)m=typeof k.signedMessage=="string"?k.signedMessage:new TextDecoder().decode(k.signedMessage),g=k.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");m=[`${j.host} wants you to sign in with your Solana account:`,_.publicKey.toBase58(),...v?["",v,""]:[""],"Version: 1",`URI: ${j.href}`,`Issued At: ${(i=(r=w==null?void 0:w.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((a=w==null?void 0:w.signInWithSolana)===null||a===void 0)&&a.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}`]:[],...!((u=w==null?void 0:w.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${w.signInWithSolana.requestId}`]:[],...!((h=(d=w==null?void 0:w.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||h===void 0)&&h.length?["Resources",...w.sign
664InWithSolana.resources.map(k=>`- ${k}`)]:[]].join(`
665`);const S=await _.signMessage(new TextEncoder().encode(m),"utf8");if(!S||!(S instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=S}}try{const{data:y,error:b}=await et(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:m,signature:jd(g)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:Ba});if(b)throw b;if(!y||!y.session||!y.user){const v=new Gh;return this._returnResult({data:{user:null,session:null},error:v})}return y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("SIGNED_IN",y.session)),this._returnResult({data:Object.assign({},y),error:b})}catch(y){if(Ue(y))return this._returnResult({data:{user:null,session:null},error:y});throw y}}async _exchangeCodeForSession(t){const n=await Yu(this.storage,`${this.storageKey}-code-verifier`),[r,i]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new Fye;const{data:a,error:o}=await et(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Ba});if(await Xr(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!a||!a.session||!a.user){const l=new Gh;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign(Object.assign({},a),{redirectType:i??null}),error:o})}catch(a){if(await Xr(this.storage,`${this.storageKey}-code-verifier`),Ue(a))return this._returnResult({data:{user:null,session:null,redirectType:null},error:a});throw a}}async signInWithIdToken(t){try{const{options:n,provider:r,token:i,access_token:a,nonce:o}=t,l=await et(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:i,access_token:a,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:Ba}),{data:c,error:u}=l;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new Gh;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(n){if(Ue(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,r,i,a,o;try{if("email"in t){const{email:l,options:c}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await Yh(this.storage,this.storageKey));const{error:h}=await et(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in t){const{phone:l,options:c}=t,{data:u,error:d}=await et(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(i=c==null?void 0:c.data)!==null&&i!==void 0?i:{},create_user:(a=c==null?void 0:c.shouldCreateUser)!==null&&a!==void 0?a:!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 this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new x0("You must provide either an email or phone number.")}catch(l){if(await Xr(this.storage,`${this.storageKey}-code-verifier`),Ue(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var n,r;try{let i,a;"options"in t&&(i=(n=t.options)===null||n===void 0?void 0:n.redirectTo,a=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:l}=await et(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:a}}),redirectTo:i,xform:Ba});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,u=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(Ue(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(t){var n,r,i,a,o;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await Yh(this.storage,this.storageKey));const u=await et(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:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((i=t==null?void 0:t.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:uve});return!((a=u.data)===null||a===void 0)&&a.url&&Zr()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(l){if(await Xr(this.storage,`${this.storageKey}-code-verifier`),Ue(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)throw r;if(!n)throw new js;const{error:i}=await et(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(t){if(Ue(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:i,options:a}=t,{error:o}=await et(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in t){const{phone:r,type:i,options:a}=t,{data:o,error:l}=await et(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l})}throw new x0("You must provide either an email or phone number and a type")}catch(n){if(Ue(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await r}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 n=await this.__loadSession();return await t(n)}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 n=await Yu(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not val
665id"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<$N:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const o=await Yu(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=zN()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};t.user=ave(t.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:i,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{session:null},error:a}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await et(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Rc}):await this._useSession(async n=>{var r,i,a;const{data:o,error:l}=n;if(l)throw l;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new js}:await et(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(i=o.session)===null||i===void 0?void 0:i.access_token)!==null&&a!==void 0?a:void 0,xform:Rc})})}catch(n){if(Ue(n))return LN(n)&&(await this._removeSession(),await Xr(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:i,error:a}=r;if(a)throw a;if(!i.session)throw new js;const o=i.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await Yh(this.storage,this.storageKey));const{data:u,error:d}=await et(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:o.access_token,xform:Rc});if(d)throw d;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(r){if(await Xr(this.storage,`${this.storageKey}-code-verifier`),Ue(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new js;const n=Date.now()/1e3;let r=n,i=!0,a=null;const{payload:o}=w0(t.access_token);if(o.exp&&(r=o.exp,i=r<=n),i){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};a=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});a={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return this._returnResult({data:{user:a.user,session:a},error:null})}catch(n){if(Ue(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:o,error:l}=n;if(l)throw l;t=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new js;const{data:i,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{user:null,session:null},error:a}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(Ue(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}
665async _getSessionFromURL(t,n){try{if(!Zr())throw new b0("No browser detected.");if(t.error||t.error_description||t.error_code)throw new b0(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new oF("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new b0("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new oF("No code detected.");const{data:v,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:v.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:i,access_token:a,refresh_token:o,expires_in:l,expires_at:c,token_type:u}=t;if(!a||!l||!o||!u)throw new b0("No session defined in URL");const d=Math.round(Date.now()/1e3),h=parseInt(l);let f=d+h;c&&(f=parseInt(c));const p=f-d;p*1e3<=jf&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${h}s`);const m=f-h;d-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,f,d):d-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,f,d);const{data:g,error:y}=await this._getUser(a);if(y)throw y;const b={provider_token:r,provider_refresh_token:i,access_token:a,expires_in:h,expires_at:f,refresh_token:o,token_type:u,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:b,redirectType:t.type},error:null})}catch(r){if(Ue(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await Yu(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:i,error:a}=n;if(a&&!LN(a))return this._returnResult({error:a});const o=(r=i.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!($ye(l)&&(l.status===404||l.status===401||l.status===403)||LN(l)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await Xr(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=Hye(),r={id:n,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,i;try{const{data:{session:a},error:o}=n;if(o)throw o;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",t,"session",a)}catch(a){await((i=this.stateChangeEmitters.get(t))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",a),console.error(a)}})}async resetPasswordForEmail(t,n={}){let r=null,i=null;this.flowType==="pkce"&&([r,i]=await Yh(this.storage,this.storageKey,!0));try{return await et(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:i,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(a){if(await Xr(this.storage,`${this.storageKey}-code-verifier`),Ue(a))return this._returnResult({data:null,error:a});throw a}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(Ue(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:r,error:i}=await this._useSession(async a=>{var o,l,c,u,d;const{data:h,error:f}=a;if(f)throw f;const p=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 et(this.fetch,"GET",p,{headers:this.headers,jwt:(d=(u=h.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(i)throw i;return Zr()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:t.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(Ue(r))return this._returnResult({data:{provider:t.provider,url:null},error:r});throw r}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var r;try{const{error:i,data:{session:a}}=n;if(i)throw i;const{options:o,provider:l,token:c,access_token:u,nonce:d}=t,h=await et(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=a==null?void 0:a.access_token)!==null&&r!==void 0?r:void 0,body:{provider:l,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Ba}),{data:f,error:p}=h;return p?this._returnResult({data:{user:null,session:null},error:p}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new Gh}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:p}))}catch(i){if(await Xr(this.storage,`${this.storageKey}-code-verifier`),Ue(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,i;const{data:a,error:o}=n;
665if(o)throw o;return await et(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(i=(r=a.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0})})}catch(n){if(Ue(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await Qye(async i=>(i>0&&await Yye(200*Math.pow(2,i-1)),this._debug(n,"refreshing attempt",i),await et(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Ba})),(i,a)=>{const o=200*Math.pow(2,i);return a&&FN(a)&&Date.now()+o-r<jf})}catch(r){if(this._debug(n,"error",r),Ue(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",r),Zr()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const i=await Yu(this.storage,this.storageKey);if(i&&this.userStorage){let o=await Yu(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:i.user},await _f(this.userStorage,this.storageKey+"-user",o)),i.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:zN()}else if(i&&!i.user&&!i.user){const o=await Yu(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(i.user=o.user,await Xr(this.storage,this.storageKey+"-user"),await _f(this.storage,this.storageKey,i)):i.user=zN()}if(this._debug(r,"session from storage",i),!this._isValidSession(i)){this._debug(r,"session is not valid"),i!==null&&await this._removeSession();return}const a=((n=i.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<$N;if(this._debug(r,`session has${a?"":" not"} expired with margin of ${$N}s`),a){if(this.autoRefreshToken&&i.refresh_token){const{error:o}=await this._callRefreshToken(i.refresh_token);o&&(console.error(o),FN(o)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(i.access_token);!l&&(o!=null&&o.user)?(i.user=o.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(r,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(r,"error",i),console.error(i);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new js;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new G_;const{data:a,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!a.session)throw new js;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const l={data:a.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(a){if(this._debug(i,"error",a),Ue(a)){const o={data:null,error:a};return FN(a)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(a),a}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(t,n,r=!0){const i=`#_notifyAllSubscribers(${t})`;this._debug(i,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const a=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,n)}catch(c){a.push(c)}});if(await Promise.all(o),a.length>0){for(let l=0;l<a.length;l+=1)console.error(a[l]);throw a[0]}}finally{this._debug(i,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Xr(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},t),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await _f(this.userStorage,this.storageKey+"-user",{user:n.user});const i=Object.assign({},n);delete i.user;const a=hF(i);await _f(this.storage,this.storageKey,a)}else{const i=hF(n);await _f(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Xr(this.storage,this.storageKey),await Xr(this.storage,this.storageKey+"-code-verifier"),await Xr(this.storage,this.storageKey+"-user"),this.userStorage&&await Xr(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Zr()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}
665catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),jf);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}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 n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((r.expires_at*1e3-t)/jf);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${jf}ms, refresh threshold is ${jE} ticks`),i<=jE&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof t7)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Zr()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"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,n,r){const i=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&i.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&i.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[a,o]=await Yh(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(o)}`});i.push(l.toString())}if(r!=null&&r.queryParams){const a=new URLSearchParams(r.queryParams);i.push(a.toString())}return r!=null&&r.skipBrowserRedirect&&i.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${i.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:i,error:a}=n;return a?this._returnResult({data:null,error:a}):await et(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Ue(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,i;const{data:a,error:o}=n;
665if(o)return this._returnResult({data:null,error:o});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:u}=await et(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&c.type==="totp"&&(!((i=c==null?void 0:c.totp)===null||i===void 0)&&i.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(n){if(Ue(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:a}=n;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?Nve(t.webauthn.credential_response):Cve(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await et(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(n){if(Ue(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:a}=n;if(a)return this._returnResult({data:null,error:a});const o=await et(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});if(o.error)return o;const{data:l}=o;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:Sve(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:kve(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(Ue(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const i={all:[],phone:[],totp:[],webauthn:[]};for(const a of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])i.all.push(a),a.status==="verified"&&i[a.factor_type].push(a);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(t){var n,r,i,a;if(t)try{const{payload:p}=w0(t);let m=null;p.aal&&(m=p.aal);let g=m;const{data:{user:y},error:b}=await this.getUser(t);if(b)return this._returnResult({data:null,error:b});((r=(n=y==null?void 0:y.factors)===null||n===void 0?void 0:n.filter(_=>_.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(g="aal2");const w=p.amr||[];return{data:{currentLevel:m,nextLevel:g,currentAuthenticationMethods:w},error:null}}catch(p){if(Ue(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:o},error:l}
665=await this.getSession();if(l)return this._returnResult({data:null,error:l});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=w0(o.access_token);let u=null;c.aal&&(u=c.aal);let d=u;((a=(i=o.user.factors)===null||i===void 0?void 0:i.filter(p=>p.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(d="aal2");const f=c.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:f},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:r},error:i}=n;return i?this._returnResult({data:null,error:i}):r?await et(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:r.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new js})})}catch(n){if(Ue(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:i},error:a}=r;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new js});const o=await et(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Zr()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(Ue(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:i},error:a}=r;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new js});const o=await et(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Zr()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(Ue(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await et(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new js})})}catch(t){if(Ue(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:r},error:i}=n;return i?this._returnResult({data:null,error:i}):r?(await et(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new js})})}catch(n){if(Ue(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(l=>l.kid===t);if(r)return r;const i=Date.now();if(r=this.jwks.keys.find(l=>l.kid===t),r&&this.jwks_cached_at+Dye>i)return r;const{data:a,error:o}=await et(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!a.keys||a.keys.length===0||(this.jwks=a,this.jwks_cached_at=i,r=a.keys.find(l=>l.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:p,error:m}
665=await this.getSession();if(m||!p.session)return this._returnResult({data:null,error:m});r=p.session.access_token}const{header:i,payload:a,signature:o,raw:{header:l,payload:c}}=w0(r);n!=null&&n.allowExpired||rve(a.exp);const u=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!u){const{error:p}=await this.getUser(r);if(p)throw p;return{data:{claims:a,header:i,signature:o},error:null}}const d=ive(i.alg),h=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,o,Uye(`${l}.${c}`)))throw new kE("Invalid JWT signature");return{data:{claims:a,header:i,signature:o},error:null}}catch(r){if(Ue(r))return this._returnResult({data:null,error:r});throw r}}}Vv.nextInstanceID={};const Mve=Vv,$ve="2.93.1";let wy="";typeof Deno<"u"?wy="deno":typeof document<"u"?wy="web":typeof navigator<"u"&&navigator.product==="ReactNative"?wy="react-native":wy="node";function Lve(){const e=globalThis.process;if(e&&e.platform){const t=e.platform;if(t==="darwin")return"macOS";if(t==="win32")return"Windows";if(t==="linux")return"Linux";if(t==="android")return"Android"}if(typeof navigator<"u"&&navigator.userAgentData&&navigator.userAgentData.platform){const t=navigator.userAgentData.platform;if(t==="macOS")return"macOS";if(t==="Windows")return"Windows";if(t==="Linux")return"Linux";if(t==="Android")return"Android";if(t==="iOS")return"iOS"}return null}function Fve(){const e=globalThis.process;if(e){const t=e.versions;if(t&&t.node&&typeof window>"u")try{const n=globalThis.require;if(n)return n("os").release()}catch{return null}}if(typeof Deno<"u"&&Deno.osRelease)try{return Deno.osRelease()}catch{return null}return typeof navigator<"u"&&navigator.userAgentData&&navigator.userAgentData.platformVersion?navigator.userAgentData.platformVersion:null}function zve(){if(typeof Deno<"u")return"deno";if(typeof Bun<"u")return"bun";const e=globalThis.process;if(e){const t=e.versions;if(t&&t.node)return"node"}return null}function Bve(){if(typeof Deno<"u"&&Deno.version)return Deno.version.deno;if(typeof Bun<"u"&&Bun.version)return Bun.version;const e=globalThis.process;if(e){const t=e.versions;if(t&&t.node)return t.node}return null}function Vve(){const e={"X-Client-Info":`supabase-js-${wy}/${$ve}`},t=Lve();t&&(e["X-Supabase-Client-Platform"]=t);const n=Fve();n&&(e["X-Supabase-Client-Platform-Version"]=n);const r=zve();r&&(e["X-Supabase-Client-Runtime"]=r);const i=Bve();return i&&(e["X-Supabase-Client-Runtime-Version"]=i),e}const Wve=Vve(),Uve={headers:Wve},qve={schema:"public"},Hve={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Kve={};function Wv(e){"@babel/helpers - typeof";return Wv=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},Wv(e)}function Gve(e,t){if(Wv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Wv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yve(e){var t=Gve(e,"string");return Wv(t)=="symbol"?t:t+""}function Qve(e,t,n){return(t=Yve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Un(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xF(Object(n),!0).forEach(function(r){Qve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const Xve=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Zve=()=>Headers,Jve=(e,t,n)=>{const r=Xve(n),i=Zve();return async(a,o)=>{var l;const c=(l=await t())!==null&&l!==void 0?l:e;let u=new i(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),r(a,Un(Un({},o),{},{headers:u}))}};function exe(e){return e.endsWith("/")?e:e+"/"}function txe(e,t){var n,r;const{db:i,auth:a,realtime:o,global:l}=e,{db:c,auth:u,realtime:d,global:h}=t,f={db:Un(Un({},c),i),auth:Un(Un({},u),a),realtime:Un(Un({},d),o),storage:{},global:Un(Un(Un({},h),l),{},{headers:Un(Un({},(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{}),(r=l==null?void 0:l.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function nxe(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");
665if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(exe(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var rxe=class extends Mve{constructor(e){super(e)}},ixe=class{constructor(e,t,n){var r,i;this.supabaseUrl=e,this.supabaseKey=t;const a=nxe(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const o=`sb-${a.hostname.split(".")[0]}-auth-token`,l={db:qve,realtime:Kve,auth:Un(Un({},Hve),{},{storageKey:o}),global:Uve},c=txe(n??{},l);if(this.storageKey=(r=c.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(i=c.global.headers)!==null&&i!==void 0?i:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=c.auth)!==null&&u!==void 0?u:{},this.headers,c.global.fetch)}this.fetch=Jve(t,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Un({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new Mge(new URL("rest/v1",a).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new Eye(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new Pge(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,n;if(e.accessToken)return await e.accessToken();const{data:r}=await e.auth.getSession();return(t=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:a,flowType:o,lock:l,debug:c,throwOnError:u},d,h){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new rxe({url:this.authUrl.href,headers:Un(Un({},f),d),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:o,lock:l,debug:c,throwOnError:u,fetch:h,hasCustomAuthorizationHeader:Object.keys(this.headers).some(p=>p.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new Jge(this.realtimeUrl.href,Un(Un({},e),{},{params:Un(Un({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const sxe=(e,t,n)=>new ixe(e,t,n);function axe(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}axe()&&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 Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function oxe(){var y,b;if(typeof window>"u")return;const e=location.hostname,n=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(v=>e===v||e.endsWith("."+v)),r="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",i=n?((y=e.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+r+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:y[1])??((b=e.match(new RegExp("^("+r+")(?=[.-])","i")))==null?void 0:b[1]):void 0,a=window.parent&&window.parent!==window;if(!i||!a)return localStorage;const o=e.endsWith(".lovableproject-dev.com")||e.endsWith(".gpt-eng.com"),l=o?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,c=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),u=c&&l.test(c)?[c]:o?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],d="lovable-preview-auth:result",h=2e3,f=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),p=(v,w,_)=>new Promise(j=>{const S=f();let k=!1,N;const T=O=>{k||(k=!0,clearTimeout(N),window.removeEventListener("message",C),j(O))},C=O=>{if(u.indexOf(O.origin)<0)return;const z=O.data;z&&z.type===d&&z.requestId===S&&T(z)};window.addEventListener("message",C);const A={type:v,requestId:S,projectId:i,key:w};_!==void 0&&(A.value=_);for(const O of u)window.parent.postMessage(A,O);N=setTimeout(()=>T(null),h)});let m=!0;const g=250;return{getItem:async v=>{let w=await p("lovable-preview-auth:get",v);return!w&&m&&(await new Promise(_=>setTimeout(_,g)),w=await p("lovable-preview-auth:get",v)),m=!1,w&&w.ok&&typeof w.value=="string"?w.value===""?(localStorage.removeItem(v),null):w.value:localStorage.getItem(v)},setItem:(v,w)=>(localStorage.setItem(v,w),p("lovable-preview-auth:set",v,w).then(()=>{})),removeItem:v=>(localStorage.removeItem(v),p("lovable-preview-auth:remove",v).then(()=>{}))}}const lxe="https://jvdzxfpnisnowhefnlau.supabase.co",cxe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imp2ZHp4ZnBuaXNub3doZWZubGF1Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njk0NzkyOTYsImV4cCI6MjA4NTA1NTI5Nn0.lfALU9pqkD_E5G3vLkbefiDX5Lwg3zpAIaWPLg_zmwI",W=sxe(lxe,cxe,{auth:{storage:oxe(),persistSession:!0,autoRefreshToken:!0}}),i7=x.createContext(void 0);async function Jh(e,t){const{data:n,error:r}=await W.from("user_roles").select("role").eq("user_id",e).eq("role",t).maybeSingle();return r?(console.error(`Error checking ${t} role:`,r),!1):!!n}function uxe({children:e}
665){const t=Ae(),[n,r]=x.useState(null),[i,a]=x.useState(null),[o,l]=x.useState(!1),[c,u]=x.useState(!1),[d,h]=x.useState(!1),[f,p]=x.useState(!0),[m,g]=x.useState(!1),y=x.useRef(void 0),b=x.useRef(0),v=x.useCallback(S=>y.current!==S?(t.clear(),y.current=S,!0):!1,[t]);x.useEffect(()=>{const{data:{subscription:S}}=W.auth.onAuthStateChange((k,N)=>{const T=++b.current,C=(N==null?void 0:N.user.id)??null,A=v(C);a(N),r((N==null?void 0:N.user)??null),N!=null&&N.user?(A&&(l(!1),u(!1),h(!1)),g(!1),setTimeout(async()=>{const[O,z,$]=await Promise.all([Jh(N.user.id,"admin"),Jh(N.user.id,"buyer"),Jh(N.user.id,"partner")]);y.current!==N.user.id||b.current!==T||(l(O),u(z),h($),g(!0))},0)):(l(!1),u(!1),h(!1),g(!0))});return W.auth.getSession().then(async({data:{session:k}})=>{const N=(k==null?void 0:k.user.id)??null;if(y.current!==void 0&&y.current!==N){p(!1);return}if(v(N),a(k),r((k==null?void 0:k.user)??null),k!=null&&k.user){const T=++b.current,[C,A,O]=await Promise.all([Jh(k.user.id,"admin"),Jh(k.user.id,"buyer"),Jh(k.user.id,"partner")]);y.current===k.user.id&&b.current===T&&(l(C),u(A),h(O),g(!0))}else y.current===null&&(l(!1),u(!1),h(!1),g(!0));p(!1)}),()=>S.unsubscribe()},[v]);const w=async(S,k)=>{const{error:N}=await W.auth.signInWithPassword({email:S,password:k});return{error:N}},_=async(S,k,N,T)=>{const C=T||`${window.location.origin}/auth`,{data:A,error:O}=await W.auth.signUp({email:S,password:k,options:{emailRedirectTo:C,data:N}});return{data:A,error:O}},j=async()=>{await W.auth.signOut(),b.current+=1,v(null),r(null),a(null),l(!1),u(!1),h(!1),g(!0)};return s.jsx(i7.Provider,{value:{user:n,session:i,isAdmin:o,isBuyer:c,isPartner:d,isLoading:f,rolesReady:m,signIn:w,signUp:_,signOut:j},children:e})}function me(){const e=x.useContext(i7);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}const s7=x.createContext({impersonating:null,isImpersonating:!1,startImpersonation:()=>{},stopImpersonation:()=>{},getEffectiveSupplierId:e=>e,getEffectiveBuyerUserId:e=>e,guardMutation:()=>!1});function dxe({children:e}){const{isAdmin:t}=me(),[n,r]=x.useState(null),i=x.useCallback(d=>{t&&r(d)},[t]),a=x.useCallback(()=>{r(null)},[]),o=t&&n!==null,l=x.useCallback(d=>o&&(n==null?void 0:n.type)==="supplier"?n.id:d,[o,n]),c=x.useCallback(d=>o&&(n==null?void 0:n.type)==="buyer"?n.id:d,[o,n]),u=x.useCallback(d=>o?(gi.error("View-only mode",{description:`${d||"This action"} is disabled while viewing as ${n==null?void 0:n.name}`}),!0):!1,[o,n]);return s.jsx(s7.Provider,{value:{impersonating:n,isImpersonating:o,startImpersonation:i,stopImpersonation:a,getEffectiveSupplierId:l,getEffectiveBuyerUserId:c,guardMutation:u},children:e})}function qe(){return x.useContext(s7)}const a7=x.createContext(void 0),o7="xph-theme";function bF(){if(typeof window>"u")return"system";try{const e=localStorage.getItem(o7);if(e==="system"||e==="light"||e==="dark")return e}catch(e){console.warn("[useTheme] localStorage unavailable, falling back to system preference",e)}return"system"}function hxe(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function wF(e){return e==="system"?hxe():e}function fxe({children:e}){const[t,n]=x.useState(bF),[r,i]=x.useState(()=>wF(bF()));x.useEffect(()=>{i(wF(t));try{localStorage.setItem(o7,t)}catch(l){console.warn("[useTheme] failed to persist theme preference; will reset on reload",l)}},[t]),x.useEffect(()=>{if(t!=="system"||typeof window>"u"||!window.matchMedia)return;const l=window.matchMedia("(prefers-color-scheme: dark)"),c=u=>i(u.matches?"dark":"light");return l.addEventListener("change",c),()=>l.removeEventListener("change",c)},[t]),x.useEffect(()=>{const l=document.documentElement;l.setAttribute("data-theme",r),r==="dark"?l.classList.add("dark"):l.classList.remove("dark")},[r]);const a=x.useCallback(l=>n(l),[]),o=x.useMemo(()=>({preference:t,resolved:r,setPreference:a}),[t,r,a]);return s.jsx(a7.Provider,{value:o,children:e})}function pxe(){const e=x.useContext(a7);if(!e)throw new Error("useTheme must be used inside <ThemeProvider>");return e}function It({children:e}){const{user:t,isLoading:n}=me();return n?s.jsx("div",{className:"flex items-center justify-center h-screen",children:s.jsx(ne,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):t?s.jsx(s.Fragment,{children:e}):s.jsx(Pt,{to:"/auth",replace:!0})}const Uv=Wm("inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md text-[13.5px] font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-55 [&_svg]:pointer-events-none [&_svg]:size-3.5 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:opacity-90",destructive:"bg-destructive text-destructive-foreground hover:opacity-90",outline:"border border-border bg-card text-foreground hover:bg-muted hover:border-[hsl(var(--c-border-strong))]",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"text-muted-foreground hover:bg-muted hover:text-foreground",link:"text-[hsl(var(--c-accent))] underline-offset-4 hover:underline"},size:{default:"h-9 px-3.5 py-2",sm:"h-7 rounded-md px-2.5 text-[12.5px]",lg:"h-10 rounded-md px-5 text-[14px]",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),je=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?B9:"button";return s.jsx(o,{className:ae(Uv({variant:t,size:n,className:e})),ref:a,...i})});
665je.displayName="Button";class mxe extends x.Component{constructor(n){super(n);No(this,"handleReset",()=>{this.setState({hasError:!1,error:null}),window.location.href="/"});this.state={hasError:!1,error:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){console.error("ErrorBoundary caught:",n,r)}render(){return this.state.hasError?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:s.jsxs("div",{className:"max-w-md w-full text-center space-y-6",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-16 w-16 rounded-full bg-destructive/10 flex items-center justify-center",children:s.jsx(ir,{className:"h-8 w-8 text-destructive"})})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("h1",{className:"text-xl font-semibold text-foreground",children:"Something went wrong"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"An unexpected error occurred. Please try again or contact support if the problem persists."})]}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(je,{onClick:this.handleReset,children:"Return to Home"}),s.jsx(je,{variant:"outline",onClick:()=>window.location.reload(),children:"Reload Page"})]})]})}):this.props.children}}const l7="xpharma_session_id",c7="xpharma_session_last_active",u7="xpharma_session_user",d7="xpharma_session_effective_user",gxe=30*60*1e3;let jF=null;function yxe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`sess_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`}function _F(e){return e??""}function vxe(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(l7);if(!e)return null;const t=Number(window.localStorage.getItem(c7)||0),n=window.localStorage.getItem(u7)??"",r=window.localStorage.getItem(d7)??"";return{id:e,lastActive:t,user:n,effectiveUser:r}}catch{return null}}function xxe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(l7,e.id),window.localStorage.setItem(c7,String(e.lastActive)),window.localStorage.setItem(u7,e.user),window.localStorage.setItem(d7,e.effectiveUser)}catch{}}function QI(e){const t=Date.now(),n=_F(e.userId),r=_F(e.effectiveUserId),i=vxe()??jF,a=i?i.user!==n&&!(i.user===""&&n!==""):!1,o=i?i.effectiveUser!==r&&!(i.effectiveUser===""&&r!==""):!1,c=!i||t-i.lastActive>gxe||a||o?yxe():i.id,u={id:c,lastActive:t,user:n,effectiveUser:r};return xxe(u),jF=u,c}const h7=[{regex:/^\/$/,pattern:"/"},{regex:/^\/auth$/,pattern:"/auth"},{regex:/^\/reset-password$/,pattern:"/reset-password"},{regex:/^\/admin$/,pattern:"/admin"},{regex:/^\/admin\/review\/asset\/[^/]+$/,pattern:"/admin/review/asset/:id"},{regex:/^\/pipeline$/,pattern:"/pipeline"},{regex:/^\/pipeline\/[^/]+$/,pattern:"/pipeline/:id"},{regex:/^\/valuation$/,pattern:"/valuation"},{regex:/^\/verification$/,pattern:"/verification"},{regex:/^\/supplier$/,pattern:"/supplier"},{regex:/^\/supplier\/pending$/,pattern:"/supplier/pending"},{regex:/^\/supplier\/onboarding$/,pattern:"/supplier/onboarding"},{regex:/^\/supplier\/onboarding\/entity$/,pattern:"/supplier/onboarding/entity"},{regex:/^\/supplier\/onboarding\/personnel$/,pattern:"/supplier/onboarding/pers
665onnel"},{regex:/^\/supplier\/onboarding\/asset\/[^/]+$/,pattern:"/supplier/onboarding/asset/:id"},{regex:/^\/supplier\/asset\/[^/]+$/,pattern:"/supplier/asset/:id"},{regex:/^\/supplier\/personnel\/[^/]+$/,pattern:"/supplier/personnel/:id"},{regex:/^\/supplier\/market$/,pattern:"/supplier/market"},{regex:/^\/supplier\/market\/asset\/[^/]+$/,pattern:"/supplier/market/asset/:id"},{regex:/^\/supplier\/engagements$/,pattern:"/supplier/engagements"},{regex:/^\/supplier\/engagements\/[^/]+$/,pattern:"/supplier/engagements/:id"},{regex:/^\/buyer$/,pattern:"/buyer"},{regex:/^\/buyer\/asset\/[^/]+$/,pattern:"/buyer/asset/:id"},{regex:/^\/buyer\/pending$/,pattern:"/buyer/pending"},{regex:/^\/buyer\/search$/,pattern:"/buyer/search"},{regex:/^\/buyer\/watchlist$/,pattern:"/buyer/watchlist"},{regex:/^\/buyer\/team$/,pattern:"/buyer/team"},{regex:/^\/buyer\/workspaces$/,pattern:"/buyer/workspaces"},{regex:/^\/buyer\/workspace\/[^/]+$/,pattern:"/buyer/workspace/:id"},{regex:/^\/supplier-directory$/,pattern:"/supplier-directory"},{regex:/^\/profile$/,pattern:"/profile"},{regex:/^\/unsubscribe$/,pattern:"/unsubscribe"},{regex:/^\/terms$/,pattern:"/terms"},{regex:/^\/privacy$/,pattern:"/privacy"},{regex:/^\/features$/,pattern:"/features"},{regex:/^\/pricing$/,pattern:"/pricing"},{regex:/^\/docs$/,pattern:"/docs"},{regex:/^\/docs\/[^/]+\/[^/]+$/,pattern:"/docs/:section/:page"},{regex:/^\/solutions-partners$/,pattern:"/solutions-partners"},{regex:/^\/solutions-partners\/[^/]+$/,pattern:"/solutions-partners/:slug"},{regex:/^\/partner$/,pattern:"/partner"},{regex:/^\/partner\/team$/,pattern:"/partner/team"},{regex:/^\/partner\/engagement\/[^/]+$/,pattern:"/partner/engagement/:id"},{regex:/^\/partner\/asset\/[^/]+$/,pattern:"/partner/asset/:id"}];function f7(e){for(const{regex:t,pattern:n}of h7)if(t.test(e))return n;return null}const bxe=h7.map(e=>e.pattern),wxe=new Set(["/","/auth","/reset-password","/terms","/privacy","/unsubscribe","/features","/pricing","/docs","/docs/:section/:page"]);function jxe(e){const t=f7(e);return t!==null&&wxe.has(t)}const _xe=[/bot\b/i,/crawl(er|ing)?/i,/spider/i,/slurp/i,/googlebot/i,/bingbot/i,/yandex/i,/baiduspider/i,/duckduckbot/i,/facebookexternalhit/i,/facebot/i,/twitterbot/i,/linkedinbot/i,/whatsapp/i,/telegrambot/i,/discordbot/i,/slackbot/i,/embedly/i,/lighthouse/i,/pagespeed/i,/gtmetrix/i,/pingdom/i,/uptimerobot/i,/headlesschrome/i,/phantomjs/i,/puppeteer/i,/playwright/i,/selenium/i,/curl\//i,/wget/i,/python-requests/i,/axios/i,/node-fetch/i];function Sxe(e){return e?_xe.some(t=>t.test(e)):!0}const SF="xp_geo_country";async function kxe(){if(typeof window>"u")return null;try{const e=sessionStorage.getItem(SF);if(e)return e;const t=await fetch("https://api.country.is/",{signal:AbortSignal.timeout(3e3)}),{country:n}=await t.json();return typeof n=="string"&&n.length>0?(sessionStorage.setItem(SF,n),n):null}catch{return null}}const Nxe="https://jvdzxfpnisnowhefnlau.supabase.co",kF="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imp2ZHp4ZnBuaXNub3doZWZubGF1Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njk0NzkyOTYsImV4cCI6MjA4NTA1NTI5Nn0.lfALU9pqkD_E5G3vLkbefiDX5Lwg3zpAIaWPLg_zmwI",Cxe=`${Nxe}/functions/v1/log-pageview`;function Axe(){const e=wo(),{user:t,session:n,isLoading:r}=me(),{impersonating:i,isImpersonating:a}=qe(),o=x.useRef(null),l=x.useRef(null);return l.current=(n==null?void 0:n.access_token)??null,x.useEffect(()=>{if(r||!t&&!jxe(e.pathname))return;const c=typeof navigator<"u"?navigator.userAgent:null;if(Sxe(c))return;const u=new URLSearchParams(e.search);if(u.get("forceHideBadge"))return;const d=e.pathname+e.search,h=f7(e.pathname),f=u.get("q"),p=u.get("tab"),m=a&&(i!=null&&i.userId)?i.userId:(t==null?void 0:t.id)??null,g=QI({userId:(t==null?void 0:t.id)??null,effectiveUserId:m}),y=crypto.randomUUID(),b=Date.now(),v=o.current;v&&NF(v.id,v.sessionId,Date.now()-v.enteredAt,l.current),o.current={id:y,path:d,sessionId:g,enteredAt:b},kxe().then(_=>{const j={id:y,session_id:g,user_id:(t==null?void 0:t.id)??null,effective_user_id:m,path:d,route_pattern:h,search_query:f,tab:p,referrer:typeof document<"u"&&document.referrer||null,user_agent:c,locale:typeof navigator<"u"?navigator.language:null,viewport:typeof window<"u"?`${window.innerWidth}x${window.innerHeight}`:null,country:_};W.functions.invoke("log-pageview",{body:j}).catch(S=>{console.warn("[activity-tracker] log-pageview failed",S)})});const w=()=>{const _=o.current;_&&NF(_.id,_.sessionId,Date.now()-_.enteredAt,l.current)};return window.addEventListener("beforeunload",w),window.addEventListener("pagehide",w),(
665)=>{window.removeEventListener("beforeunload",w),window.removeEventListener("pagehide",w)}},[e.pathname,e.search,t==null?void 0:t.id,r,a,i==null?void 0:i.userId]),null}function NF(e,t,n,r){const i={"Content-Type":"application/json",apikey:kF,Authorization:`Bearer ${r??kF}`};try{fetch(Cxe,{method:"POST",headers:i,body:JSON.stringify({id:e,session_id:t,finalize:!0,duration_ms:n}),keepalive:!0}).catch(a=>console.warn("[activity-tracker] finalize failed",a))}catch(a){console.warn("[activity-tracker] finalize threw",a)}}const Txe=5*60*1e3,Exe=/src="(\/assets\/index-[^"]+\.js)"/;function Pxe(e){var t;return((t=e.match(Exe))==null?void 0:t[1])??null}function Oxe(e=document){const t=e.querySelector('script[type="module"][src^="/assets/index-"]');return(t==null?void 0:t.getAttribute("src"))??null}function Ixe(){const[e,t]=x.useState(!1),n=x.useRef(null),r=x.useRef(!1),i=x.useRef(!1),a=wo(),o=x.useCallback(async()=>{if(!(!n.current||r.current))try{const l=await fetch(`/index.html?_t=${Date.now()}`,{cache:"no-store",headers:{"Cache-Control":"no-cache",Pragma:"no-cache"}});if(!l.ok)return;const c=Pxe(await l.text());if(!c)return;c!==n.current&&(r.current=!0,t(!0))}catch{}},[]);return x.useEffect(()=>{n.current=Oxe(),o();const l=setInterval(o,Txe);return()=>clearInterval(l)},[o]),x.useEffect(()=>{if(!i.current){i.current=!0;return}o()},[a.pathname,o]),{newVersionAvailable:e}}function Rxe(){const{newVersionAvailable:e}=Ixe();return e?s.jsxs("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-[100] bg-primary text-primary-foreground px-4 py-2 rounded-lg shadow-lg flex items-center gap-3 text-sm animate-in slide-in-from-bottom-4",children:[s.jsx("span",{children:"A new version is available."}),s.jsxs(je,{size:"sm",variant:"secondary",onClick:()=>window.location.reload(),className:"h-7",children:[s.jsx(ps,{className:"h-3.5 w-3.5 mr-1.5"}),"Refresh"]})]}):null}const p7=x.createContext({});function Hp(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const Dxe=typeof window<"u",XI=Dxe?x.useLayoutEffect:x.useEffect,ZI=x.createContext(null);function JI(e,t){e.indexOf(t)===-1&&e.push(t)}function Kp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const yo=(e,t,n)=>n>t?t:n<e?e:n;let Y_=()=>{},el=()=>{};const bu={},m7=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function g7(e){return typeof e=="object"&&e!==null}const y7=e=>/^0[^.\s]+$/u.test(e);function v7(e){let t;return()=>(t===void 0&&(t=e()),t)}const us=e=>e,Mxe=(e,t)=>n=>t(e(n)),sb=(...e)=>e.reduce(Mxe),dh=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class eR{constructor(){this.subscriptions=[]}add(t){return JI(this.subscriptions,t),()=>Kp(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const zi=e=>e*1e3,xa=e=>e/1e3;function tR(e,t){return t?e*(1e3/t):0}const $xe=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e},x7=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Lxe=1e-7,Fxe=12;function zxe(e,t,n,r,i){let a,o,l=0;do o=t+(n-t)/2,a=x7(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Lxe&&++l<Fxe);return o}function ab(e,t,n,r){if(e===t&&n===r)return us;const i=a=>zxe(a,0,1,e,n);return a=>a===0||a===1?a:x7(i(a),t,r)}const b7=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,w7=e=>t=>1-e(1-t),j7=ab(.33,1.53,.69,.99),nR=w7(j7),_7=b7(nR),S7=e=>e>=1?1:(e*=2)<1?.5*nR(e):.5*(2-Math.pow(2,-10*(e-1))),rR=e=>1-Math.sin(Math.acos(e)),k7=w7(rR),N7=b7(rR),Bxe=ab(.42,0,1,1),Vxe=ab(0,0,.58,1),C7=ab(.42,0,.58,1),A7=e=>Array.isArray(e)&&typeof e[0]!="number";function T7(e,t){return A7(e)?e[$xe(0,e.length,t)]:e}const E7=e=>Array.isArray(e)&&typeof e[0]=="number",CF={linear:us,easeIn:Bxe,easeInOut:C7,easeOut:Vxe,circIn:rR,circInOut:N7,circOut:k7,backIn:nR,backInOut:_7,backOut:j7,anticipate:S7},Wxe=e=>typeof e=="string",AF=e=>{if(E7(e)){el(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,i]=e;return ab(t,n,r,i)}else if(Wxe(e))return el(CF[e]!==void 0,`Invalid easing type '${e}
665'`,"invalid-easing-type"),CF[e];return e},j0=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],TF={value:null,addProjectionMetrics:null};function Uxe(e,t){let n=new Set,r=new Set,i=!1,a=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function u(h){o.has(h)&&(d.schedule(h),e()),c++,h(l)}const d={schedule:(h,f=!1,p=!1)=>{const g=p&&i?n:r;return f&&o.add(h),g.add(h),h},cancel:h=>{r.delete(h),o.delete(h)},process:h=>{if(l=h,i){a=!0;return}i=!0;const f=n;n=r,r=f,n.forEach(u),t&&TF.value&&TF.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,d.process(h))}};return d}const qxe=40;function P7(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=j0.reduce((w,_)=>(w[_]=Uxe(a,t?_:void 0),w),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:h,preRender:f,render:p,postRender:m}=o,g=()=>{const w=bu.useManualTiming,_=w?i.timestamp:performance.now();n=!1,w||(i.delta=r?1e3/60:Math.max(Math.min(_-i.timestamp,qxe),1)),i.timestamp=_,i.isProcessing=!0,l.process(i),c.process(i),u.process(i),d.process(i),h.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(g))},y=()=>{n=!0,r=!0,i.isProcessing||e(g)};return{schedule:j0.reduce((w,_)=>{const j=o[_];return w[_]=(S,k=!1,N=!1)=>(n||y(),j.schedule(S,k,N)),w},{}),cancel:w=>{for(let _=0;_<j0.length;_++)o[j0[_]].cancel(w)},state:i,steps:o}}const{schedule:Mt,cancel:Ca,state:Wr,steps:VN}=P7(typeof requestAnimationFrame<"u"?requestAnimationFrame:us,!0);let Nw;function Hxe(){Nw=void 0}
vendor: 15,784 bytes, line 665
665const Ri={now:()=>(Nw===void 0&&Ri.set(Wr.isProcessing||bu.useManualTiming?Wr.timestamp:performance.now()),Nw),set:e=>{Nw=e,queueMicrotask(Hxe)}},O7=e=>t=>typeof t=="string"&&t.startsWith(e),I7=O7("--"),Kxe=O7("var(--"),iR=e=>Kxe(e)?Gxe.test(e.split("/*")[0].trim()):!1,Gxe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function EF(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Jm={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},qv={...Jm,transform:e=>yo(0,1,e)},_0={...Jm,default:1},Uy=e=>Math.round(e*1e5)/1e5,sR=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Yxe(e){return e==null}const Qxe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,aR=(e,t)=>n=>!!(typeof n=="string"&&Qxe.test(n)&&n.startsWith(e)||t&&!Yxe(n)&&Object.prototype.hasOwnProperty.call(n,t)),R7=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,o,l]=r.match(sR);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Xxe=e=>yo(0,255,e),WN={...Jm,transform:e=>Math.round(Xxe(e))},_d={test:aR("rgb","red"),parse:R7("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+WN.transform(e)+", "+WN.transform(t)+", "+WN.transform(n)+", "+Uy(qv.transform(r))+")"};function Zxe(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const NE={test:aR("#"),parse:Zxe,transform:_d.transform},ob=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),jc=ob("deg"),Ko=ob("%"),Le=ob("px"),Jxe=ob("vh"),ebe=ob("vw"),PF={...Ko,parse:e=>Ko.parse(e)/100,transform:e=>Ko.transform(e*100)},qf={test:aR("hsl","hue"),parse:R7("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ko.transform(Uy(t))+", "+Ko.transform(Uy(n))+", "+Uy(qv.transform(r))+")"},fr={test:e=>_d.test(e)||NE.test(e)||qf.test(e),parse:e=>_d.test(e)?_d.parse(e):qf.test(e)?qf.parse(e):NE.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?_d.transform(e):qf.transform(e),getAnimatableNone:e=>{const t=fr.parse(e);return t.alpha=0,fr.transform(t)}},tbe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function nbe(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(sR))==null?void 0:t.length)||0)+(((n=e.match(tbe))==null?void 0:n.length)||0)>0}const D7="number",M7="color",rbe="var",ibe="var(",OF="${}",sbe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Gp(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const l=t.replace(sbe,c=>(fr.test(c)?(r.color.push(a),i.push(M7),n.push(fr.parse(c))):c.startsWith(ibe)?(r.var.push(a),i.push(rbe),n.push(c)):(r.number.push(a),i.push(D7),n.push(parseFloat(c))),++a,OF)).split(OF);return{values:n,split:l,indexes:r,types:i}}function abe(e){return Gp(e).values}function $7({split:e,types:t}){const n=e.length;return r=>{let i="";for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){const o=t[a];o===D7?i+=Uy(r[a]):o===M7?i+=fr.transform(r[a]):i+=r[a]}return i}}function obe(e){return $7(Gp(e))}const lbe=e=>typeof e=="number"?0:fr.test(e)?fr.getAnimatableNone(e):e,cbe=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:lbe(e);function ube(e){const t=Gp(e);return $7(t)(t.values.map((r,i)=>cbe(r,t.split[i])))}const oo={test:nbe,parse:abe,createTransformer:obe,getAnimatableNone:ube};function UN(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function dbe({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;i=UN(c,l,e+1/3),a=UN(c,l,e),o=UN(c,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Tj(e,t){return n=>n>0?t:e}const fn=(e,t,n)=>e+(t-e)*n,qN=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},hbe=[NE,_d,qf],fbe=e=>hbe.find(t=>t.test(e));function IF(e){const t=fbe(e);if(Y_(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===qf&&(n=dbe(n)),n}const RF=(e,t)=>{const n=IF(e),r=IF(t);if(!n||!r)return Tj(e,t);const i={...n};return a=>(i.red=qN(n.red,r.red,a),i.green=qN(n.green,r.green,a),i.blue=qN(n.blue,r.blue,a),i.alpha=fn(n.alpha,r.alpha,a),_d.transform(i))},CE=new Set(["none","hidden"]);function pbe(e,t){return CE.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function mbe(e,t){return n=>fn(e,t,n)}function oR(e){return typeof e=="number"?mbe:typeof e=="string"?iR(e)?Tj:fr.test(e)?RF:vbe:Array.isArray(e)?L7:typeof e=="object"?fr.test(e)?RF:gbe:Tj}function L7(e,t){const n=[...e],r=n.length,i=e.map((a,o)=>oR(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=i[o](a);return n}}function gbe(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=oR(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function ybe(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const a=t.types[i],o=e.indexes[a][r[a]],l=e.values[o]??0;n[i]=l,r[a]++}return n}const vbe=(e,t)=>{const n=oo.createTransformer(t),r=Gp(e),i=Gp(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?CE.has(e)&&!i.values.length||CE.has(t)&&!r.values.length?pbe(e,t):sb(L7(ybe(r,i),i.values),n):(Y_(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Tj(e,t))};function F7(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?fn(e,t,n):oR(e)(e,t)}const xbe=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Mt.update(t,n),stop:()=>Ca(t),now:()=>Wr.isProcessing?Wr.timestamp:Ri.now()}},z7=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)r+=Math.round(e(a/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Ej=2e4;function lR(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Ej;)t+=n,r=e.next(t);return t>=Ej?1/0:t}function B7(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(lR(r),Ej);return{type:"keyframes",ease:a=>r.next(i*a).value/t,duration:xa(i)}}const Dn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function AE(e,t){return e*Math.sqrt(1-t*t)}const bbe=12;function wbe(e,t,n){let r=n;for(let i=1;i<bbe;i++)r=r-e(r)/t(r);return r}const HN=.001;function jbe({duration:e=Dn.duration,bounce:t=Dn.bounce,velocity:n=Dn.velocity,mass:r=Dn.mass}){let i,a;Y_(e<=zi(Dn.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=yo(Dn.minDamping,Dn.maxDamping,o),e=yo(Dn.minDuration,Dn.maxDuration,xa(e)),o<1?(i=u=>{const d=u*o,h=d*e,f=d-n,p=AE(u,o),m=Math.exp(-h);return HN-f/p*m},a=u=>{const h=u*o*e,f=h*n+n,p=Math.pow(o,2)*Math.pow(u,2)*e,m=Math.exp(-h),g=AE(Math.pow(u,2),o);return(-i(u)+HN>0?-1:1)*((f-p)*m)/g}):(i=u=>{const d=Math.exp(-u*e),h=(u-n)*e+1;return-HN+d*h},a=u=>{const d=Math.exp(-u*e),h=(n-u)*(e*e);return d*h});const l=5/e,c=wbe(i,a,l);if(e=zi(e),isNaN(c))return{stiffness:Dn.stiffness,damping:Dn.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const _be=["duration","bounce"],Sbe=["stiffness","damping","mass"];function DF(e,t){return t.some(n=>e[n]!==void 0)}function kbe(e){let t={velocity:Dn.velocity,stiffness:Dn.stiffness,damping:Dn.damping,mass:Dn.mass,isResolvedFromDuration:!1,...e};if(!DF(e,Sbe)&&DF(e,_be))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*yo(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Dn.mass,stiffness:i,damping:a}}else{const n=jbe({...e,velocity:0});t={...t,...n,mass:Dn.mass},t.isResolvedFromDuration=!0}return t}function Hv(e=Dn.visualDuration,t=Dn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:u,mass:d,duration:h,velocity:f,isResolvedFromDuration:p}=kbe({...n,velocity:-xa(n.velocity||0)}),m=f||0,g=u/(2*Math.sqrt(c*d)),y=o-a,b=xa(Math.sqrt(c/d)),v=Math.abs(y)<5;r||(r=v?Dn.restSpeed.granular:Dn.restSpeed.default),i||(i=v?Dn.restDelta.granular:Dn.restDelta.default);let w,_,j,S,k,N;if(g<1)j=AE(b,g),S=(m+g*b*y)/j,w=C=>{const A=Math.exp(-g*b*C);return o-A*(S*Math.sin(j*C)+y*Math.cos(j*C))},k=g*b*S+y*j,N=g*b*y-S*j,_=C=>Math.exp(-g*b*C)*(k*Math.sin(j*C)+N*Math.cos(j*C));else if(g===1){w=A=>o-Math.exp(-b*A)*(y+(m+b*y)*A);const C=m+b*y;_=A=>Math.exp(-b*A)*(b*C*A-m)}else{const C=b*Math.sqrt(g*g-1);w=$=>{const F=Math.exp(-g*b*$),B=Math.min(C*$,300);return o-F*((m+g*b*y)*Math.sinh(B)+C*y*Math.cosh(B))/C};const A=(m+g*b*y)/C,O=g*b*A-y*C,z=g*b*y-A*C;_=$=>{const F=Math.exp(-g*b*$),B=Math.min(C*$,300);return F*(O*Math.sinh(B)+z*Math.cosh(B))}}const T={calculatedDuration:p&&h||null,velocity:C=>zi(_(C)),next:C=>{if(!p&&g<1){const O=Math.exp(-g*b*C),z=Math.sin(j*C),$=Math.cos(j*C),F=o-O*(S*z+y*$),B=zi(O*(k*z+N*$));return l.done=Math.abs(B)<=r&&Math.abs(o-F)<=i,l.value=l.done?o:F,l}const A=w(C);if(p)l.done=C>=h;else{const O=zi(_(C));l.done=Math.abs(O)<=r&&Math.abs(o-A)<=i}return l.value=l.done?o:A,l},toString:()=>{const C=Math.min(lR(T),Ej),A=z7(O=>T.next(C*O).value,C,30);return C+"ms "+A},toTransition:()=>{}};return T}Hv.applyToOptions=e=>{const t=B7(e,100,Hv);return e.ease=t.ease,e.duration=zi(t.duration),e.type="keyframes",e};const Nbe=5;function V7(e,t,n){const r=Math.max(t-Nbe,0);return tR(n-e(r),t-r)}function TE({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const h=e[0],f={done:!1,value:h},p=N=>l!==void 0&&N<l||c!==void 0&&N>c,m=N=>l===void 0?c:c===void 0||Math.abs(l-N)<Math.abs(c-N)?l:c;let g=n*t;const y=h+g,b=o===void 0?y:o(y);b!==y&&(g=b-h);const v=N=>-g*Math.exp(-N/r),w=N=>b+v(N),_=N=>{const T=v(N),C=w(N);f.done=Math.abs(T)<=u,f.value=f.done?b:C};let j,S;const k=N=>{p(f.value)&&(j=N,S=Hv({keyframes:[f.value,m(f.value)],velocity:V7(w,N,f.value),damping:i,stiffness:a,restDelta:u,restSpeed:d}))};return k(0),{calculatedDuration:null,next:N=>{let T=!1;return!S&&j===void 0&&(T=!0,_(N),k(N)),j!==void 0&&N>=j?S.next(N-j):(!T&&_(N),f)}}}function Cbe(e,t,n){const r=[],i=n||bu.mix||F7,a=e.length-1;for(let o=0;o<a;o++){let l=i(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||us:t;l=sb(c,l)}r.push(l)}return r}function cR(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(el(a===t.length,"Both input and output ranges must be the same length","range-length"),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=Cbe(t,r,i),c=l.length,u=d=>{if(o&&d<e[0])return t[0];let h=0;if(c>1)for(;h<e.length-2&&!(d<e[h+1]);h++);const f=dh(e[h],e[h+1],d);return l[h](f)};return n?d=>u(yo(e[0],e[a-1],d)):u}function W7(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=dh(0,t,r);e.push(fn(n,1,i))}}function uR(e){const t=[0];return W7(t,e.length-1),t}function Abe(e,t){return e.map(n=>n*t)}function Tbe(e,t){return e.map(()=>t||C7).splice(0,e.length-1)}function qy({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=A7(r)?r.map(AF):AF(r),a={done:!1,value:t[0]},o=Abe(n&&n.length===t.length?n:uR(t),e),l=cR(o,t,{ease:Array.isArray(i)?i:Tbe(t,i)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const Ebe=e=>e!==null;function Q_(e,{repeat:t,repeatType:n="loop"},r,i=1){const a=e.filter(Ebe),l=i<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!l||r===void 0?a[l]:r}const Pbe={decay:TE,inertia:TE,tween:qy,keyframes:qy,spring:Hv};function U7(e){typeof e.type=="string"&&(e.type=Pbe[e.type])}class dR{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Obe=e=>e/100;class Kv extends dR{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==Ri.now()&&this.tick(Ri.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;U7(t);const{type:n=qy,repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=t;let{keyframes:l}=t;const c=n||qy;c!==qy&&typeof l[0]!="number"&&(this.mixKeyframes=sb(Obe,F7(l[0],l[1])),l=[0,100]);const u=c({...t,keyframes:l});a==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=lR(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:h,repeatType:f,repeatDelay:p,type:m,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const b=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?b<0:b>i;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,_=r;if(h){const N=Math.min(this.currentTime,i)/l;let T=Math.floor(N),C=N%1;!C&&N>=1&&(C=1),C===1&&T--,T=Math.min(T,h+1),!!(T%2)&&(f==="reverse"?(C=1-C,p&&(C-=p/l)):f==="mirror"&&(_=o)),w=yo(0,1,C)*l}let j;v?(this.delayState.value=d[0],j=this.delayState):j=_.next(w),a&&!v&&(j.value=a(j.value));let{done:S}=j;!v&&c!==null&&(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return k&&m!==TE&&(j.value=Q_(d,this.options,y,this.speed)),g&&g(j.value),k&&this.finish(),j}then(t,n){return this.finished.then(t,n)}get duration(){return xa(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+xa(t)}get time(){return xa(this.currentTime)}set time(t){t=zi(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;
665if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return V7(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Ri.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=xa(this.currentTime))}play(){var i,a;if(this.isStopped)return;const{driver:t=xbe,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(a=(i=this.options).onPlay)==null||a.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ri.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function Ibe(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Sd=e=>e*180/Math.PI,EE=e=>{const t=Sd(Math.atan2(e[1],e[0]));return PE(t)},Rbe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:EE,rotateZ:EE,skewX:e=>Sd(Math.atan(e[1])),skewY:e=>Sd(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},PE=e=>(e=e%360,e<0&&(e+=360),e),MF=EE,$F=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),LF=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Dbe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$F,scaleY:LF,scale:e=>($F(e)+LF(e))/2,rotateX:e=>PE(Sd(Math.atan2(e[6],e[5]))),rotateY:e=>PE(Sd(Math.atan2(-e[2],e[0]))),rotateZ:MF,rotate:MF,skewX:e=>Sd(Math.atan(e[4])),skewY:e=>Sd(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function OE(e){return e.includes("scale")?1:0}function IE(e,t){if(!e||e==="none")return OE(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=Dbe,i=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Rbe,i=l}if(!i)return OE(t);const a=r[t],o=i[1].split(",").map($be);return typeof a=="function"?a(o):o[a]}const Mbe=(e,t)=>
vendor: 7,945 bytes, line 665
665{const{transform:n="none"}=getComputedStyle(e);return IE(n,t)};function $be(e){return parseFloat(e.trim())}const eg=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],tg=new Set(eg),FF=e=>e===Jm||e===Le,Lbe=new Set(["x","y","z"]),Fbe=eg.filter(e=>!Lbe.has(e));function zbe(e){const t=[];return Fbe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Qc={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>IE(t,"x"),y:(e,{transform:t})=>IE(t,"y")};Qc.translateX=Qc.x;Qc.translateY=Qc.y;const Ud=new Set;let RE=!1,DE=!1,ME=!1;function q7(){if(DE){const e=Array.from(Ud).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=zbe(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([a,o])=>{var l;(l=r.getValue(a))==null||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}DE=!1,RE=!1,Ud.forEach(e=>e.complete(ME)),Ud.clear()}function H7(){Ud.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(DE=!0)})}function Bbe(){ME=!0,H7(),q7(),ME=!1}class hR{constructor(t,n,r,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Ud.add(this),RE||(RE=!0,Mt.read(H7),Mt.resolveKeyframes(q7))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const a=i==null?void 0:i.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const l=r.readValue(n,o);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=o),i&&a===void 0&&i.set(t[0])}Ibe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ud.delete(this)}cancel(){this.state==="scheduled"&&(Ud.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Vbe=e=>e.startsWith("--");function K7(e,t,n){Vbe(t)?e.style.setProperty(t,n):e.style[t]=n}const Wbe={};function fR(e,t){const n=v7(e);return()=>Wbe[t]??n()}const pR=fR(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),G7=fR(()=>window.ViewTimeline!==void 0,"viewTimeline"),Y7=fR(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),jy=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,zF={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jy([0,.65,.55,1]),circOut:jy([.55,0,1,.45]),backIn:jy([.31,.01,.66,-.59]),backOut:jy([.33,1.53,.69,.99])};function Q7(e,t){if(e)return typeof e=="function"?Y7()?z7(e,t):"ease-out":E7(e)?jy(e):Array.isArray(e)?e.map(n=>Q7(n,t)||zF.easeOut):zF[e]}function Ube(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const h=Q7(l,i);Array.isArray(h)&&(d.easing=h);const f={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),e.animate(d,f)}function mR(e){return typeof e=="function"&&"applyToOptions"in e}function qbe({type:e,...t}){return mR(e)&&Y7()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class X7 extends dR{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,el(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=qbe(t);this.animation=Ube(n,r,i,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const d=Q_(i,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(d),K7(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,i;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(r=this.animation).commitStyles)==null||i.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return xa(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+xa(t)}get time(){return xa(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=zi(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:i}){var a;return this.allowFlatten&&((a=this.animation.effect)==null||a.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&pR()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),us):i(this)}}const Z7={anticipate:S7,backInOut:_7,circInOut:N7};function Hbe(e){return e in Z7}function Kbe(e){typeof e.ease=="string"&&Hbe(e.ease)&&(e.ease=Z7[e.ease])}const KN=10;class Gbe extends X7{constructor(t){Kbe(t),U7(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:a,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new Kv({...o,autoplay:!1}),c=Math.max(KN,Ri.now()-this.startTime),u=yo(0,KN,c-KN),d=l.sample(c).value,{name:h}=this.options;a&&h&&K7(a,h,d),n.setWithVelocity(l.sample(Math.max(0,c-u)).value,d,u),l.stop()}}const BF=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(oo.test(e)||e==="0")&&!e.startsWith("url("));function Ybe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Qbe(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=BF(i,t),l=BF(a,t);return Y_(o===l,`You are trying to animate ${t} from "${i}" to "${a}". "${o?a:i}" is not an animatable value.`,"value-not-animatable"),!o||!l?!1:Ybe(e)||(n==="spring"||mR(n))&&r}function $E(e){e.duration=0,e.type="keyframes"}const J7=new Set(["opacity","clipPath","filter","transform"]),Xbe=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Zbe(e){for(let t=0;t<e.length;
665t++)if(typeof e[t]=="string"&&Xbe.test(e[t]))return!0;return!1}const Jbe=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),e0e=v7(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function t0e(e){var h;const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:l}=e;if(!(((h=t==null?void 0:t.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=t.owner.getProps();return e0e()&&n&&(J7.has(n)||Jbe.has(n)&&Zbe(l))&&(n!=="transform"||!d)&&!u&&!r&&i!=="mirror"&&a!==0&&o!=="inertia"}const n0e=40;class r0e extends dR{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:l,name:c,motionValue:u,element:d,...h}){var m;super(),this.stop=()=>{var g,y;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=Ri.now();const f={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:o,name:c,motionValue:u,element:d,...h},p=(d==null?void 0:d.KeyframeResolver)||hR;this.keyframeResolver=new p(l,(g,y,b)=>this.onKeyframesResolved(g,y,f,!b),c,u,d),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,r,i){var b,v;this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=Ri.now();let h=!0;Qbe(t,a,o,l)||(h=!1,(bu.instantAnimations||!c)&&(d==null||d(Q_(t,r,n))),t[0]=t[t.length-1],$E(r),r.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>n0e?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=h&&!u&&t0e(p),g=(v=(b=p.motionValue)==null?void 0:b.owner)==null?void 0:v.current;let y;if(m)try{y=new Gbe({...p,element:g})}catch{y=new Kv(p)}else y=new Kv(p);y.finished.then(()=>{this.notifyFinished()}).catch(us),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Bbe()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}class i0e{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t){const n=this.animations.map(r=>r.attachTimeline(t));return()=>{n.forEach((r,i)=>{r&&r(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return VF(this.animations,"duration")}get iterationDuration(){return VF(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function VF(e,t){let n=0;for(let r=0;r<e.length;r++){const i=e[r][t];i!==null&&i>n&&(n=i)}return n}class s0e extends i0e{then(t,n){return this.finished.finally(t).then(()=>{})}}function eG(e,t,n,r=0,i=1){const a=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),o=e.size,l=(o-1)*r;return typeof n=="function"?n(a,o):i===1?a*r:l-a*r}const a0e=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function o0e(e){const t=a0e.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const l0e=4;function tG(e,t,n=1){el(n<=l0e,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=o0e(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return m7(o)?parseFloat(o):o}return iR(i)?tG(i,t,n+1):i}const c0e={type:"spring",stiffness:500,damping:25,restSpeed:10},u0e=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),d0e={type:"keyframes",duration:.8},h0e={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},f0e=(e,{keyframes:t})=>t.length>2?d0e:tg.has(e)?e.startsWith("scale")?u0e(t[1]):c0e:h0e;function nG(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function gR(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?nG(n,e):n}const p0e=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function m0e(e){for(const t in e)if(!p0e.has(t))return!0;return!1}const yR=(e,t,n,r={},i,a)=>o=>{const l=gR(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-zi(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:f=>{t.set(f),l.onUpdate&&l.onUpdate(f)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:i};m0e(l)||Object.assign(d,f0e(e,d)),d.duration&&(d.duration=zi(d.duration)),d.repeatDelay&&(d.repeatDelay=zi(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&($E(d),d.delay===0&&(h=!0)),(bu.
vendor: 14,828 bytes, line 665
665instantAnimations||bu.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(h=!0,$E(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,h&&!a&&t.get()!==void 0){const f=Q_(d.keyframes,l);if(f!==void 0){Mt.update(()=>{d.onUpdate(f),d.onComplete()});return}}return l.isSync?new Kv(d):new r0e(d)};function WF(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function vR(e,t,n,r){if(typeof t=="function"){const[i,a]=WF(r);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=WF(r);t=t(n!==void 0?n:e.custom,i,a)}return t}function qd(e,t,n){const r=e.getProps();return vR(r,t,n!==void 0?n:r.custom,e)}const rG=new Set(["width","height","top","left","right","bottom",...eg]),UF=30,g0e=e=>!isNaN(parseFloat(e)),Hy={current:void 0};class y0e{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var a;const i=Ri.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ri.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=g0e(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new eR);const r=this.events[t].add(n);return t==="change"?()=>{r(),Mt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return Hy.current&&Hy.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Ri.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>UF)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,UF);return tR(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ba(e,t){return new y0e(e,t)}const LE=e=>Array.isArray(e);function v0e(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ba(n))}function x0e(e){return LE(e)?e[e.length-1]||0:e}function b0e(e,t){const n=qd(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const o in a){const l=x0e(a[o]);v0e(e,o,l)}}const tr=e=>!!(e&&e.getVelocity);function w0e(e){return!!(tr(e)&&e.add)}function FE(e,t){const n=e.getValue("willChange");if(w0e(n))return n.add(t);if(!n&&bu.WillChange){const r=new bu.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function xR(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const j0e="framerAppearId",iG="data-"+xR(j0e);function sG(e){return e.props[iG]}function _0e({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function bR(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...l}=t;const c=e.getDefaultTransition();a=a?nG(a,c):c;const u=a==null?void 0:a.reduceMotion;r&&(a=r);const d=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const f in l){const p=e.getValue(f,e.latestValues[f]??null),m=l[f];if(m===void 0||h&&_0e(h,f))continue;const g={delay:n,...gR(a||{},f)},y=p.get();if(y!==void 0&&!p.isAnimating()&&!Array.isArray(m)&&m===y&&!g.velocity){Mt.update(()=>p.set(m));continue}let b=!1;if(window.MotionHandoffAnimation){const _=sG(e);if(_){const j=window.MotionHandoffAnimation(_,f,Mt);j!==null&&(g.startTime=j,b=!0)}}FE(e,f);const v=u??e.shouldReduceMotion;p.start(yR(f,p,m,v&&rG.has(f)?{type:!1}:g,e,b));const w=p.animation;w&&d.push(w)}if(o){const f=()=>Mt.update(()=>{o&&b0e(e,o)});d.length?Promise.all(d).then(f):f()}return d}function zE(e,t,n={}){var c;const r=qd(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const a=r?()=>Promise.all(bR(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:f}=i;return S0e(e,t,u,d,h,f,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[u,d]=l==="beforeChildren"?[a,o]:[o,a];return u().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function S0e(e,t,n=0,r=0,i=0,a=1,o){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(zE(c,t,{...o,delay:n+(typeof r=="function"?0:r)+eG(e.variantChildren,c,r,i,a)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function k0e(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(a=>zE(e,a,n));r=Promise.all(i)}else if(typeof t=="string")r=zE(e,t,n);else{const i=typeof t=="function"?qd(e,t,n.custom):t;r=Promise.all(bR(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const N0e={test:e=>e==="auto",parse:e=>e},aG=e=>t=>t.test(e),oG=[Jm,Le,Ko,jc,ebe,Jxe,N0e],qF=e=>oG.find(aG(e));function C0e(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||y7(e):!0}const A0e=new Set(["brightness","contrast","saturate","opacity"]);function T0e(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(sR)||[];if(!r)return e;const i=n.replace(r,"");let a=A0e.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const E0e=/\b([a-z-]*)\(.*?\)/gu,BE={...oo,getAnimatableNone:e=>{const t=e.match(E0e);return t?t.map(T0e).join(" "):e}},VE={...oo,getAnimatableNone:e=>{const t=oo.parse(e);return oo.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},HF={...Jm,transform:Math.round},P0e={rotate:jc,rotateX:jc,rotateY:jc,rotateZ:jc,scale:_0,scaleX:_0,scaleY:_0,scaleZ:_0,skew:jc,skewX:jc,skewY:jc,distance:Le,translateX:Le,translateY:Le,translateZ:Le,x:Le,y:Le,z:Le,perspective:Le,transformPerspective:Le,opacity:qv,originX:PF,originY:PF,originZ:Le},wR={borderWidth:Le,borderTopWidth:Le,borderRightWidth:Le,borderBottomWidth:Le,borderLeftWidth:Le,borderRadius:Le,borderTopLeftRadius:Le,borderTopRightRadius:Le,borderBottomRightRadius:Le,borderBottomLeftRadius:Le,width:Le,maxWidth:Le,height:Le,maxHeight:Le,top:Le,right:Le,bottom:Le,left:Le,inset:Le,insetBlock:Le,insetBlockStart:Le,insetBlockEnd:Le,insetInline:Le,insetInlineStart:Le,insetInlineEnd:Le,padding:Le,paddingTop:Le,paddingRight:Le,paddingBottom:Le,paddingLeft:Le,paddingBlock:Le,paddingBlockStart:Le,paddingBlockEnd:Le,paddingInline:Le,paddingInlineStart:Le,paddingInlineEnd:Le,margin:Le,marginTop:Le,marginRight:Le,marginBottom:Le,marginLeft:Le,marginBlock:Le,marginBlockStart:Le,marginBlockEnd:Le,marginInline:Le,marginInlineStart:Le,marginInlineEnd:Le,fontSize:Le,backgroundPositionX:Le,backgroundPositionY:Le,...P0e,zIndex:HF,fillOpacity:qv,strokeOpacity:qv,numOctaves:HF},O0e={...wR,color:fr,backgroundColor:fr,outlineColor:fr,fill:fr,stroke:fr,borderColor:fr,borderTopColor:fr,borderRightColor:fr,borderBottomColor:fr,borderLeftColor:fr,filter:BE,WebkitFilter:BE,mask:VE,WebkitMask:VE},lG=e=>O0e[e],I0e=new Set([BE,VE]);function cG(e,t){let n=lG(e);return I0e.has(n)||(n=oo),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const R0e=new Set(["auto","none","0"]);function D0e(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!R0e.has(a)&&Gp(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=cG(n,i)}class M0e extends hR{constructor(t,n,r,i,a){super(t,n,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let h=t[d];if(typeof h=="string"&&(h=h.trim(),iR(h))){const f=tG(h,n.current);f!==void 0&&(t[d]=f),d===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!rG.has(r)||t.length!==2)return;const[i,a]=t,o=qF(i),l=qF(a),c=EF(i),u=EF(a);if(c!==u&&Qc[r]){this.needsMeasurement=!0;return}if(o!==l)if(FF(o)&&FF(l))for(let d=0;d<t.length;d++){const h=t[d];typeof h=="string"&&(t[d]=parseFloat(h))}else Qc[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||C0e(t[i]))&&r.push(i);r.length&&D0e(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Qc[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const a=r.length-1,o=r[a];r[a]=Qc[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function X_(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;t&&(r=t.current);const i=(n==null?void 0:n[e])??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(r=>r!=null)}const uG=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function dG(e){return g7(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:jR,cancel:Ept}=P7(queueMicrotask,!1),Wa={x:!1,y:!1};function hG(){return Wa.x||Wa.y}function $0e(e){return e==="x"||e==="y"?Wa[e]?null:(Wa[e]=!0,()=>{Wa[e]=!1}):Wa.x||Wa.y?null:(Wa.x=Wa.y=!0,()=>{Wa.x=Wa.y=!1})}function fG(e,t){const n=X_(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function L0e(e){return!(e.pointerType==="touch"||hG())}function F0e(e,t,n={}){const[r,i,a]=fG(e,n);return r.forEach(o=>{let l=!1,c=!1,u;const d=()=>{o.removeEventListener("pointerleave",m)},h=y=>{u&&(u(y),u=void 0),d()},f=y=>{l=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),c&&(c=!1,h(y))},p=()=>{l=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},m=y=>{if(y.pointerType!=="touch"){if(l){c=!0;return}h(y)}},g=y=>{if(!L0e(y))return;c=!1;const b=t(o,y);typeof b=="function"&&(u=b,o.addEventListener("pointerleave",m,i))};o.addEventListener("pointerenter",g,i),o.addEventListener("pointerdown",p,i)}),a}const pG=(e,t)=>t?e===t?!0:pG(e,t.parentElement):!1,_R=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,z0e=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function B0e(e){return z0e.has(e.tagName)||e.isContentEditable===!0}const V0e=new Set(["INPUT","SELECT","TEXTAREA"]);function W0e(e){return V0e.has(e.tagName)||e.isContentEditable===!0}const Cw=new WeakSet;function KF(e){return t=>{t.key==="Enter"&&e(t)}}function GN(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const U0e=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=KF(()=>{if(Cw.has(n))return;GN(n,"down");const i=KF(()=>{GN(n,"up")}),a=()=>GN(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function GF(e){return _R(e)&&!hG()}const YF=new WeakSet;function q0e(e,t,n={}){const[r,i,a]=fG(e,n),o=l=>{const c=l.currentTarget;if(!GF(l)||YF.has(l))return;Cw.add(c),n.stopPropagation&&YF.add(l);const u=t(c,l),d=(p,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),Cw.has(c)&&Cw.delete(c),GF(p)&&typeof u=="function"&&u(p,{success:m})},h=p=>{d(p,c===window||c===document||n.useGlobalTarget||pG(c,p.target))},f=p=>{d(p,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,i),dG(l)&&(l.addEventListener("focus",u=>U0e(u,i)),!B0e(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),a}function Z_(e){return g7(e)&&"ownerSVGElement"in e}const Aw=new WeakMap;let _c;const mG=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:Z_(r)&&"getBBox"in r?r.getBBox()[t]:r[n],H0e=mG("inline","width","offsetWidth"),K0e=mG("block","height","offsetHeight");function G0e({target:e,borderBoxSize:t}){var n;(n=Aw.get(e))==null||n.forEach(r=>{r(e,{get width(){return H0e(e,t)},get height(){return K0e(e,t)}})})}function Y0e(e){e.forEach(G0e)}function Q0e(){typeof ResizeObserver>"u"||(_c=new ResizeObserver(Y0e))}function X0e(e,t){_c||Q0e();const n=X_(e);return n.forEach(r=>{let i=Aw.get(r);i||(i=new Set,Aw.set(r,i)),i.add(t),_c==null||_c.observe(r)}),()=>{n.forEach(r=>{const i=Aw.get(r);i==null||i.delete(t),i!=null&&i.size||_c==null||_c.unobserve(r)})}}const Tw=new Set;let Hf;function Z0e(){Hf=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Tw.forEach(t=>t(e))},window.addEventListener("resize",Hf)}function J0e(e){return Tw.add(e),Hf||Z0e(),()=>{Tw.delete(e),!Tw.size&&typeof Hf=="function"&&(window.removeEventListener("resize",Hf),Hf=void 0)}}function WE(e,t){return typeof e=="function"?J0e(e):X0e(e,t)}function gG(e,t){let n;const r=()=>{const{currentTime:i}=t,o=(i===null?0:i.value)/100;n!==o&&e(o),n=o};return Mt.preUpdate(r,!0),()=>Ca(r)}function yG(e){return Z_(e)&&e.tagName==="svg"}function ewe(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],l=cR(i,a,o);return t?l(r):l}function twe(e,t,n={}){const r=e.get();let i=null,a=r,o;const l=typeof r=="string"?r.replace(/[\d.-]/g,""):void 0,c=()=>
665{i&&(i.stop(),i=null),e.animation=void 0},u=()=>{const h=QF(e.get()),f=QF(a);if(h===f){c();return}const p=i?i.getGeneratorVelocity():e.getVelocity();c(),i=new Kv({keyframes:[h,f],velocity:p,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})},d=()=>{var h;u(),e.animation=i??void 0,(h=e.events.animationStart)==null||h.notify(),i==null||i.then(()=>{var f;e.animation=void 0,(f=e.events.animationComplete)==null||f.notify()})};if(e.attach((h,f)=>{a=h,o=p=>f(YN(p,l)),Mt.postRender(d)},c),tr(t)){let h=n.skipInitialAnimation===!0;const f=t.on("change",m=>{h?(h=!1,e.jump(YN(m,l),!1)):e.set(YN(m,l))}),p=e.on("destroy",f);return()=>{f(),p()}}return c}function YN(e,t){return t?e+t:e}function QF(e){return typeof e=="number"?e:parseFloat(e)}const nwe=[...oG,fr,oo],rwe=e=>nwe.find(aG(e)),XF=()=>({translate:0,scale:1,origin:0,originPoint:0}),Kf=()=>({x:XF(),y:XF()}),ZF=()=>({min:0,max:0}),cr=()=>({x:ZF(),y:ZF()}),Gv=new WeakMap;function J_(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Yv(e){return typeof e=="string"||Array.isArray(e)}const SR=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],kR=["initial",...S
vendor: 6,218 bytes, line 665
665R];function eS(e){return J_(e.animate)||kR.some(t=>Yv(e[t]))}function vG(e){return!!(eS(e)||e.variants)}function iwe(e,t,n){for(const r in t){const i=t[r],a=n[r];if(tr(i))e.addValue(r,i);else if(tr(a))e.addValue(r,ba(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,ba(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Pj={current:null},NR={current:!1},swe=typeof window<"u";function xG(){if(NR.current=!0,!!swe)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Pj.current=e.matches;e.addEventListener("change",t),t()}else Pj.current=!1}const JF=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Oj={};function bG(e){Oj=e}function awe(){return Oj}class wG{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:o,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=hR,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Ri.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,Mt.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=l;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=eS(n),this.isVariantNode=vG(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const m=f[p];u[p]!==void 0&&tr(m)&&m.set(u[p])}}mount(t){var n,r;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,Gv.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,a)=>this.bindToMotionValue(a,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(NR.current||xG(),this.shouldReduceMotion=Pj.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Ca(this.notifyUpdate),Ca(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&J7.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:c,ease:u,duration:d}=n.accelerate,h=new X7({element:this.current,name:t,keyframes:l,times:c,ease:u,duration:zi(d)}),f=o(h);this.valueSubscriptions.set(t,()=>{f(),h.cancel()});return}const r=tg.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Mt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Oj){const n=Oj[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):cr()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<JF.length;r++){const i=JF[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=iwe(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}
vendor: 3,035 bytes, line 665
665addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=ba(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(m7(r)||y7(r))?r=parseFloat(r):!rwe(r)&&oo.test(n)&&(r=cG(t,n)),this.setBaseTarget(t,tr(r)?r.get():r)),tr(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var a;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=vR(this.props,n,(a=this.presenceContext)==null?void 0:a.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!tr(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new eR),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){jR.render(this.render)}}class jG extends wG{constructor(){super(...arguments),this.KeyframeResolver=M0e}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;tr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Ru{constructor(t){this.isMounted=!1,this.node=t}update(){}}function _G({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function owe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function lwe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function QN(e){return e===void 0||e===1}function UE({scale:e,scaleX:t,scaleY:n}){return!QN(e)||!QN(t)||!QN(n)}function ld(e){return UE(e)||SG(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function SG(e){return e3(e.x)||e3(e.y)}function e3(e){return e&&e!=="0%"}function Ij(e,t,n){const r=e-n,i=t*r;return n+i}function t3(e,t,n,r,i){return i!==void 0&&(e=Ij(e,i,r)),Ij(e,n,r)+t}function qE(e,t=0,n=1,r,i){e.min=t3(e.min,t,n,r,i),e.max=t3(e.max,t,n,r,i)}function kG(e,{x:t,y:n}
vendor: 41,778 bytes, line 665
665){qE(e.x,t.translate,t.scale,t.originPoint),qE(e.y,n.translate,n.scale,n.originPoint)}const n3=.999999999999,r3=1.0000000000001;function cwe(e,t,n,r=!1){var l;const i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let c=0;c<i;c++){a=n[c],o=a.projectionDelta;const{visualElement:u}=a.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Do(e.x,-a.scroll.offset.x),Do(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,kG(e,o)),r&&ld(a.latestValues)&&Ew(e,a.latestValues,(l=a.layout)==null?void 0:l.layoutBox))}t.x<r3&&t.x>n3&&(t.x=1),t.y<r3&&t.y>n3&&(t.y=1)}function Do(e,t){e.min+=t,e.max+=t}function i3(e,t,n,r,i=.5){const a=fn(e.min,e.max,i);qE(e,t,n,a,r)}function s3(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Ew(e,t,n){const r=n??e;i3(e.x,s3(t.x,r.x),t.scaleX,t.scale,t.originX),i3(e.y,s3(t.y,r.y),t.scaleY,t.scale,t.originY)}function NG(e,t){return _G(lwe(e.getBoundingClientRect(),t))}function uwe(e,t,n){const r=NG(e,n),{scroll:i}=t;return i&&(Do(r.x,i.offset.x),Do(r.y,i.offset.y)),r}const dwe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},hwe=eg.length;function fwe(e,t,n){let r="",i=!0;for(let a=0;a<hwe;a++){const o=eg[a],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(o.startsWith("scale")?1:0);else{const u=parseFloat(l);c=o.startsWith("scale")?u===1:u===0}if(!c||n){const u=uG(l,wR[o]);if(!c){i=!1;const d=dwe[o]||o;r+=`${d}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function CR(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(tg.has(c)){o=!0;continue}else if(I7(c)){i[c]=u;continue}else{const d=uG(u,wR[c]);c.startsWith("origin")?(l=!0,a[c]=d):r[c]=d}}if(t.transform||(o||n?r.transform=fwe(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=a;r.transformOrigin=`${c} ${u} ${d}`}}function CG(e,{style:t,vars:n},r,i){const a=e.style;let o;for(o in t)a[o]=t[o];i==null||i.applyProjectionStyles(a,r);for(o in n)a.setProperty(o,n[o])}function a3(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Wg={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Le.test(e))e=parseFloat(e);else return e;const n=a3(e,t.target.x),r=a3(e,t.target.y);return`${n}% ${r}%`}},pwe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=oo.parse(e);if(i.length>5)return r;const a=oo.createTransformer(e),o=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=l,i[1+o]/=c;const u=fn(l,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),a(i)}},HE={borderRadius:{...Wg,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Wg,borderTopRightRadius:Wg,borderBottomLeftRadius:Wg,borderBottomRightRadius:Wg,boxShadow:pwe};function AG(e,{layout:t,layoutId:n}){return tg.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!HE[e]||e==="opacity")}function AR(e,t,n){var o;const r=e.style,i=t==null?void 0:t.style,a={};if(!r)return a;for(const l in r)(tr(r[l])||i&&tr(i[l])||AG(l,e)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(a[l]=r[l]);return a}function mwe(e){return window.getComputedStyle(e)}class TG extends jG{constructor(){super(...arguments),this.type="html",this.renderInstance=CG}readValueFromInstance(t,n){var r;if(tg.has(n))return(r=this.projection)!=null&&r.isProjecting?OE(n):Mbe(t,n);{const i=mwe(t),a=(I7(n)?i.getPropertyValue(n):i[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return NG(t,n)}build(t,n,r){CR(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return AR(t,n,r)}}function gwe(e,t){return e in t}class ywe extends wG{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(gwe(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return cr()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}const vwe={offset:"stroke-dashoffset",array:"stroke-dasharray"},xwe={offset:"strokeDashoffset",array:"strokeDasharray"};function bwe(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?vwe:xwe;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const wwe=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function EG(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...l},c,u,d){if(CR(e,l,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:f}=e;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete h.transformBox);for(const p of wwe)h[p]!==void 0&&(f[p]=h[p],delete h[p]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),i!==void 0&&bwe(h,i,a,o,!1)}const PG=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),OG=e=>typeof e=="string"&&e.toLowerCase()==="svg";function jwe(e,t,n,r){CG(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(PG.has(i)?i:xR(i),t.attrs[i])}function IG(e,t,n){const r=AR(e,t,n);for(const i in e)if(tr(e[i])||tr(t[i])){const a=eg.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}class RG extends jG{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=cr}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(tg.has(n)){const r=lG(n);return r&&r.default||0}return n=PG.has(n)?n:xR(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return IG(t,n,r)}build(t,n,r){EG(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){jwe(t,n,r,i)}mount(t){this.isSVGTag=OG(t.tagName),super.mount(t)}}const _we=kR.length;function DG(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?DG(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<_we;n++){const r=kR[n],i=e.props[r];(Yv(i)||i===!1)&&(t[r]=i)}return t}function MG(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Swe=[...SR].reverse(),kwe=SR.length;function Nwe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>k0e(e,n,r)))}function Cwe(e){let t=Nwe(e),n=o3(),r=!0,i=!1;const a=u=>(d,h)=>{var p;const f=qd(e,h,u==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(f){const{transition:m,transitionEnd:g,...y}=f;d={...d,...y,...g}}return d};function o(u){t=u(e)}function l(u){const{props:d}=e,h=DG(e.parent)||{},f=[],p=new Set;let m={},g=1/0;for(let b=0;b<kwe;b++){const v=Swe[b],w=n[v],_=d[v]!==void 0?d[v]:h[v],j=Yv(_),S=v===u?w.isActive:null;S===!1&&(g=b);let k=_===h[v]&&_!==d[v]&&j;if(k&&(r||i)&&e.manuallyAnimateOnMount&&(k=!1),w.protectedKeys={...m},!w.isActive&&S===null||!_&&!w.prevProp||J_(_)||typeof _=="boolean")continue;if(v==="exit"&&w.isActive&&S!==!0){w.prevResolvedValues&&(m={...m,...w.prevResolvedValues});continue}const N=Awe(w.prevProp,_);let T=N||v===u&&w.isActive&&!k&&j||b>g&&j,C=!1;const A=Array.isArray(_)?_:[_];let O=A.reduce(a(v),{});S===!1&&(O={});const{prevResolvedValues:z={}}=w,$={...z,...O},F=I=>{T=!0,p.has(I)&&(C=!0,p.delete(I)),w.needsAnimating[I]=!0;const M=e.getValue(I);M&&(M.liveStyle=!1)};for(const I in $){const M=O[I],R=z[I];if(m.hasOwnProperty(I))continue;let K=!1;LE(M)&&LE(R)?K=!MG(M,R):K=M!==R,K?M!=null?F(I):p.add(I):M!==void 0&&p.has(I)?F(I):w.protectedKeys[I]=!0}w.prevProp=_,w.prevResolvedValues=O,w.isActive&&(m={...m,...O}),(r||i)&&e.blockInitialAnimation&&(T=!1);const B=k&&N;T&&(!B||C)&&f.push(...A.map(I=>{const M={type:v};if(typeof I=="string"&&(r||i)&&!B&&e.manuallyAnimateOnMount&&e.parent){const{parent:R}=e,K=qd(R,I);if(R.enteringChildren&&K){const{delayChildren:D}=K.transition||{};M.delay=eG(R.enteringChildren,e,D)}}return{animation:I,options:M}}))}if(p.size){const b={};if(typeof d.initial!="boolean"){const v=qd(e,Array.isArray(d.initial)?d.initial[0]:d.initial);v&&v.transition&&(b.transition=v.transition)}p.forEach(v=>{const w=e.getBaseTarget(v),_=e.getValue(v);_&&(_.liveStyle=!0),b[v]=w??null}),f.push({animation:b})}let y=!!f.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,i=!1,y?t(f):Promise.resolve()}function c(u,d){var f;if(n[u].isActive===d)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(u,d)}),n[u].isActive=d;const h=l(u);for(const p in n)n[p].protectedKeys={};return h}return{animateChanges:l,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=o3(),i=!0}}}function Awe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!MG(t,e):!1}function Qu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function o3(){return{animate:Qu(!0),whileInView:Qu(),whileHover:Qu(),whileTap:Qu(),whileDrag:Qu(),whileFocus:Qu(),exit:Qu()}}function KE(e,t){e.min=t.min,e.max=t.max}function La(e,t){KE(e.x,t.x),KE(e.y,t.y)}function l3(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const $G=1e-4,Twe=1-$G,Ewe=1+$G,LG=.01,Pwe=0-LG,Owe=0+LG;function Di(e){return e.max-e.min}function Iwe(e,t,n){return Math.abs(e-t)<=n}function c3(e,t,n,r=.5){e.origin=r,e.originPoint=fn(t.min,t.max,e.origin),e.scale=Di(n)/Di(t),e.translate=fn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Twe&&e.scale<=Ewe||isNaN(e.scale))&&(e.scale=1),(e.translate>=Pwe&&e.translate<=Owe||isNaN(e.translate))&&(e.translate=0)}function Ky(e,t,n,r){c3(e.x,t.x,n.x,r?r.originX:void 0),c3(e.y,t.y,n.y,r?r.originY:void 0)}function u3(e,t,n,r=0){const i=r?fn(n.min,n.max,r):n.min;e.min=i+t.min,e.max=e.min+Di(t)}function Rwe(e,t,n,r){u3(e.x,t.x,n.x,r==null?void 0:r.x),u3(e.y,t.y,n.y,r==null?void 0:r.y)}function d3(e,t,n,r=0){const i=r?fn(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Di(t)}function Rj(e,t,n,r){d3(e.x,t.x,n.x,r==null?void 0:r.x),d3(e.y,t.y,n.y,r==null?void 0:r.y)}function h3(e,t,n,r,i){return e-=t,e=Ij(e,1/n,r),i!==void 0&&(e=Ij(e,1/i,r)),e}function Dwe(e,t=0,n=1,r=.5,i,a=e,o=e){if(Ko.test(t)&&(t=parseFloat(t),t=fn(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=fn(a.min,a.max,r);e===a&&(l-=t),e.min=h3(e.min,t,n,l,i),e.max=h3(e.max,t,n,l,i)}function f3(e,t,[n,r,i],a,o){Dwe(e,t[n],t[r],t[i],t.scale,a,o)}const Mwe=["x","scaleX","originX"],$we=["y","scaleY","originY"];function p3(e,t,n,r){f3(e.x,t,Mwe,n?n.x:void 0,r?r.x:void 0),f3(e.y,t,$we,n?n.y:void 0,r?r.y:void 0)}function m3(e){return e.translate===0&&e.scale===1}function FG(e){return m3(e.x)&&m3(e.y)}function g3(e,t){return e.min===t.min&&e.max===t.max}function Lwe(e,t){return g3(e.x,t.x)&&g3(e.y,t.y)}function y3(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function zG(e,t){return y3(e.x,t.x)&&y3(e.y,t.y)}function v3(e){return Di(e.x)/Di(e.y)}function x3(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Eo(e){return[e("x"),e("y")]}function Fwe(e,t,n){let r="";const i=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:h,rotateY:f,skewX:p,skewY:m}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotateX(${h}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const BG=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],zwe=BG.length,b3=e=>typeof e=="string"?parseFloat(e):e,w3=e=>typeof e=="number"||Le.test(e);function Bwe(e,t,n,r,i,a){i?(e.opacity=fn(0,n.opacity??1,Vwe(r)),e.opacityExit=fn(t.opacity??1,0,Wwe(r))):a&&(e.opacity=fn(t.opacity??1,n.opacity??1,r));for(let o=0;o<zwe;o++){const l=BG[o];let c=j3(t,l),u=j3(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||w3(c)===w3(u)?(e[l]=Math.max(fn(b3(c),b3(u),r),0),(Ko.test(u)||Ko.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=fn(t.rotate||0,n.rotate||0,r))}function j3(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Vwe=VG(0,.5,k7),Wwe=VG(.5,.95,us);function VG(e,t,n){return r=>r<e?0:r>t?1:n(dh(e,t,r))}function WG(e,t,n){const r=tr(e)?e:ba(e);return r.start(yR("",r,t,n)),r.animation}function Qv(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const Uwe=(e,t)=>e.depth-t.depth;class qwe{constructor(){this.children=[],this.isDirty=!1}add(t){JI(this.children,t),this.isDirty=!0}remove(t){Kp(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Uwe),this.isDirty=!1,this.children.forEach(t)}}function Hwe(e,t){const n=Ri.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(Ca(r),e(a-t))};return Mt.setup(r,!0),()=>Ca(r)}function Pw(e){return tr(e)?e.get():e}class Kwe{constructor(){this.members=[]}add(t){JI(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const i=r.instance;(!i||i.isConnected===!1)&&!r.snapshot&&(Kp(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Kp(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const i=this.members[r];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(t,n){var i;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:a}=r.options,{layoutDependency:o}=t.options;(a===void 0||a!==o)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(i=t.root)!=null&&i.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,a,o;(r=(n=t.options).onExitComplete)==null||r.call(n),(o=(i=t.resumingFrom)==null?void 0:(a=i.options).onExitComplete)==null||o.call(a)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const Ow={hasAnimatedSinceResize:!0,hasEverUpdated:!1},XN=["","X","Y","Z"],Gwe=1e3;let Ywe=0;function ZN(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function UG(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=sG(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Mt,!(i||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&UG(r)}function qG({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},l=t==null?void 0:t()){this.id=Ywe++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Zwe),this.nodes.forEach(ije),this.nodes.forEach(sje),this.nodes.forEach(Jwe)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new qwe)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new eR),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Z_(o)&&!yG(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),e){let d,h=0;const f=()=>this.root.updateBlockedByResize=!1;Mt.read(()=>{h=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==h&&(h=p,this.root.updateBlockedByResize=!0,d&&d(),d=Hwe(f,250),Ow.hasAnimatedSinceResize&&(Ow.hasAnimatedSinceResize=!1,this.nodes.forEach(k3)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||uje,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=u.getProps(),b=!this.targetLayout||!zG(this.targetLayout,p),v=!h&&f;if(this.options.layoutRoot||this.resumeFrom||v||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...gR(m,"layout"),onPlay:g,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(d,v)}else h||k3(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ca(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(aje),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&UG(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const h=this.path[d];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(tje),this.nodes.forEach(_3);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(S3);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(nje),this.nodes.forEach(rje),this.nodes.forEach(Qwe),this.nodes.forEach(Xwe)):this.nodes.forEach(S3),this.clearAllSnapshots();const l=Ri.now();Wr.delta=yo(0,1e3/60,l-Wr.timestamp),Wr.timestamp=l,Wr.isProcessing=!0,VN.update.process(Wr),VN.preRender.process(Wr),VN.render.process(Wr),Wr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,jR.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eje),this.sharedNodes.forEach(oje)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Mt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Mt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Di(this.snapshot.measuredBox.x)&&!Di(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=cr()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!FG(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||ld(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),dje(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return cr();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(hje))){const{scroll:d}=this.root;d&&(Do(l.x,d.offset.x),Do(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=cr();if(La(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:h,options:f}=d;d!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&La(l,o),Do(l.x,h.offset.x),Do(l.y,h.offset.y))}return l}applyTransform(o,l=!1,c){var d,h;const u=c||cr();La(u,o);for(let f=0;f<this.path.length;f++){const p=this.path[f];!l&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(Do(u.x,-p.scroll.offset.x),Do(u.y,-p.scroll.offset.y)),ld(p.latestValues)&&Ew(u,p.latestValues,(d=p.layout)==null?void 0:d.layoutBox)}return ld(this.latestValues)&&Ew(u,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),u}removeTransform(o){var c;const l=cr();La(l,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];if(!ld(d.latestValues))continue;let h;d.instance&&(UE(d.latestValues)&&d.updateSnapshot(),h=cr(),La(h,d.measurePageBox())),p3(l,d.latestValues,(c=d.snapshot)==null?void 0:c.layoutBox,h)}return ld(this.latestValues)&&p3(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Wr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:h}=this.options;if(!this.layout||!(d||h))return;this.resolvedRelativeTargetAt=Wr.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=cr(),this.targetWithTransforms=cr()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Rwe(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):La(this.target,this.layout.layoutBox),kG(this.target,this.targetDelta)):La(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||UE(this.parent.latestValues)||SG(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=cr(),this.relativeTargetOrigin=cr(),Rj(this.relativeTargetOrigin,l,c,this.options.layoutAnchor||void 0),La(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Wr.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;La(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;cwe(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=cr());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(l3(this.prevProjectionDelta.x,this.projectionDelta.x),l3(this.prevProjectionDelta.y,this.projectionDelta.y)),Ky(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!x3(this.projectionDelta.x,this.prevProjectionDelta.x)||!x3(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Kf(),this.projectionDelta=Kf(),this.projectionDeltaWithTransform=Kf()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},h=Kf();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const f=cr(),p=c?c.source:void 0,m=this.layout?this.layout.source:void 0,g=p!==m,y=this.getStack(),b=!y||y.members.length<=1,v=!!(g&&!b&&this.options.crossfade===!0&&!this.path.some(cje));this.animationProgress=0;let w;this.mixTargetDelta=_=>{const j=_/1e3;N3(h.x,o.x,j),N3(h.y,o.y,j),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Rj(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),lje(this.relativeTarget,this.relativeTargetOrigin,f,j),w&&Lwe(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=cr()),La(w,this.relativeTarget)),g&&(this.animationValues=d,Bwe(d,u,this.latestValues,j,v,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Ca(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Mt.update(()=>{Ow.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ba(0)),this.motionValue.jump(0,!1),this.currentAnimation=WG(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Gwe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&HG(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||cr();const h=Di(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+h;const f=Di(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}La(l,c),Ew(l,d),Ky(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Kwe),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&ZN("z",o,u,this.animationValues);for(let d=0;d<XN.length;d++)ZN(`rotate${XN[d]}`,o,u,this.animationValues),ZN(`skew${XN[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Pw(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Pw(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!ld(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=Fwe(this.projectionDeltaWithTransform,this.treeScale,d);c&&(h=c(d,h)),o.transform=h;const{x:f,y:p}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,u.animationValues?o.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in HE){if(d[m]===void 0)continue;const{correct:g,applyTo:y,isCSSVariable:b}=HE[m],v=h==="none"?d[m]:g(d[m],u);if(y){const w=y.length;for(let _=0;_<w;_++)o[y[_]]=v}else b?this.options.visualElement.renderState.vars[m]=v:o[m]=v}this.options.layoutId&&(o.pointerEvents=u===this?Pw(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(_3),this.root.sharedNodes.clear()}}}function Qwe(e){e.updateLayout()}function Xwe(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;if(a==="size")Eo(h=>{const f=o?t.measuredBox[h]:t.layoutBox[h],p=Di(f);f.min=r[h].min,f.max=f.min+p});else if(a==="x"||a==="y"){const h=a==="x"?"y":"x";KE(o?t.measuredBox[h]:t.layoutBox[h],r[h])}else HG(a,t.layoutBox,r)&&Eo(h=>{const f=o?t.measuredBox[h]:t.layoutBox[h],p=Di(r[h]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+p)});const l=Kf();Ky(l,r,t.layoutBox);const c=Kf();o?Ky(c,e.applyTransform(i,!0),t.measuredBox):Ky(c,r,t.layoutBox);const u=!FG(l);let d=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:p}=h;if(f&&p){const m=e.options.layoutAnchor||void 0,g=cr();Rj(g,t.layoutBox,f.layoutBox,m);const y=cr();Rj(y,r,p.layoutBox,m),zG(g,y)||(d=!0),h.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=g,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Zwe(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Jwe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function eje(e){e.clearSnapshot()}function _3(e){e.clearMeasurements()}function tje(e){e.isLayoutDirty=!0,e.updateLayout()}function S3(e){e.isLayoutDirty=!1}function nje(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function rje(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function k3(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ije(e){e.resolveTargetDelta()}function sje(e){e.calcProjection()}function aje(e){e.resetSkewAndRotation()}function oje(e){e.removeLeadSnapshot()}function N3(e,t,n){e.translate=fn(t.translate,0,n),e.scale=fn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function C3(e,t,n,r){e.min=fn(t.min,n.min,r),e.max=fn(t.max,n.max,r)}function lje(e,t,n,r){C3(e.x,t.x,n.x,r),C3(e.y,t.y,n.y,r)}function cje(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const uje={duration:.45,ease:[.4,0,.1,1]},A3=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),T3=A3("applewebkit/")&&!A3("chrome/")?Math.round:us;function E3(e){e.min=T3(e.min),e.max=T3(e.max)}function dje(e){E3(e.x),E3(e.y)}function HG(e,t,n){return e==="position"||e==="preserve-aspect"&&!Iwe(v3(t),v3(n),.2)}function hje(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const fje=qG({attachResizeListener:(e,t)=>Qv(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),JN={current:void 0},KG=qG({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!JN.current){const e=new fje({});e.mount(window),e.setOptions({layoutScroll:!0}),JN.current=e}return JN.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),tS=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function pje(e=!0){const t=x.useContext(ZI);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,a=x.useId();x.useEffect(()=>{if(e)return i(a)},[e]);const o=x.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const GG=x.createContext({strict:!1}),P3={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let O3=!1;function mje(){if(O3)return;const e={};for(const t in P3)e[t]={isEnabled:n=>P3[t].some(r=>!!n[r])};bG(e),O3=!0}function YG(){return mje(),awe()}function gje(e){const t=YG();for(const n in e)t[n]={...t[n],...e[n]};bG(t)}const yje=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Dj(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||yje.has(e)}let QG=e=>!Dj(e);function vje(e){typeof e=="function"&&(QG=t=>t.startsWith("on")?!Dj(t):e(t))}try{vje(require("@emotion/is-prop-valid").default)}catch{}function xje(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||tr(e[i])||(QG(i)||n===!0&&Dj(i)||!t&&!Dj(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const nS=x.createContext({});function bje(e,t){if(eS(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Yv(n)?n:void 0,animate:Yv(r)?r:void 0}}return e.inherit!==!1?t:{}}function wje(e){const{initial:t,animate:n}=bje(e,x.useContext(nS));return x.useMemo(()=>({initial:t,animate:n}),[I3(t),I3(n)])}function I3(e){return Array.isArray(e)?e.join(" "):e}const TR=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function XG(e,t,n){for(const r in t)!tr(t[r])&&!AG(r,n)&&(e[r]=t[r])}function jje({transformTemplate:e},t){return x.useMemo(()=>{const n=TR();return CR(n,t,e),Object.assign({},n.vars,n.style)},[t])}function _je(e,t){const n=e.style||{},r={};return XG(r,n,e),Object.assign(r,jje(e,t)),r}function Sje(e,t){const n={},r=_je(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}
665`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const ZG=()=>({...TR(),attrs:{}});function kje(e,t,n,r){const i=x.useMemo(()=>{const a=ZG();return EG(a,t,OG(r),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};XG(a,e.style,e),i.style={...a,...i.style}}return i}const Nje=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ER(e){return typeof e!="string"||e.includes("-")?!1:!!(Nje.indexOf(e)>-1||/[A-Z]/u.test(e))}function Cje(e,t,n,{latestValues:r},i,a=!1,o){const c=(o??ER(e)?kje:Sje)(t,r,i,e),u=xje(t,typeof e=="string",a),d=e!==x.Fragment?{...u,...c,ref:n}:{},{children:h}=t,f=x.useMemo(()=>tr(h)?h.get():h,[h]);return x.createElement(e,{...d,children:f})}function Aje({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Tje(n,r,i,e),renderState:t()}}function Tje(e,t,n,r){const i={},a=r(e,{});for(const f in a)i[f]=Pw(a[f]);let{initial:o,animate:l}=e;const c=eS(e),u=vG(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const h=d?l:o;if(h&&typeof h!="boolean"&&!J_(h)){const f=Array.isArray(h)?h:[h];for(let p=0;p<f.length;p++){const m=vR(e,f[p]);if(m){const{transitionEnd:g,transition:y,...b}=m;for(const v in b){let w=b[v];if(Array.isArray(w)){const _=d?w.length-1:0;w=w[_]}w!==null&&(i[v]=w)}for(const v in g)i[v]=g[v]}}}return i}const JG=e=>(t,n)=>{const r=x.useContext(nS),i=x.useContext(ZI),a=()=>Aje(e,t,r,i);return n?a():Hp(a)},Eje=JG({scrapeMotionValuesFromProps:AR,createRenderState:TR}),Pje=JG({scrapeMotionValuesFromProps:IG,createRenderState:ZG}),Oje=Symbol.for("motionComponentSymbol");function Ije(e,t,n){const r=x.useRef(n);x.useInsertionEffect(()=>{r.current=n});const i=x.useRef(null);return x.useCallback(a=>{var l;a&&((l=e.onMount)==null||l.call(e,a));const o=r.current;if(typeof o=="function")if(a){const c=o(a);typeof c=="function"&&(i.current=c)}else i.current?(i.current(),i.current=null):o(a);else o&&(o.current=a);t&&(a?t.mount(a):t.unmount())},[t])}const eY=x.createContext({});function Sf(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Rje(e,t,n,r,i,a){var w,_;const{visualElement:o}=x.useContext(nS),l=x.useContext(GG),c=x.useContext(ZI),u=x.useContext(tS),d=u.reducedMotion,h=u.skipAnimations,f=x.useRef(null),p=x.useRef(!1);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:h,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const m=f.current,g=x.useContext(eY);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&Dje(f.current,n,i,g);const y=x.useRef(!1);x.useInsertionEffect(()=>{m&&y.current&&m.update(n,c)});const b=n[iG],v=x.useRef(!!b&&typeof window<"u"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,b))&&((_=window.MotionHasOptimisedAnimation)==null?void 0:_.call(window,b)));return XI(()=>{p.current=!0,m&&(y.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),x.useEffect(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var j;(j=window.MotionHandoffMarkAsComplete)==null||j.call(window,b)}),v.current=!1),m.enteringChildren=void 0)}),m}function Dje(e,t,n,r){const{layoutId:i,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutAnchor:d,layoutCrossfade:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:tY(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||l&&Sf(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:c,layoutRoot:u,layoutAnchor:d})}function tY(e){if(e)return e.options.allowProjection!==!1?e.projection:tY(e.parent)}function eC(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&gje(r);const a=n?n==="svg":ER(e),o=a?Pje:Eje;function l(u,d){let h;const f={...x.useContext(tS),...u,layoutId:Mje(u)},{isStatic:p}=f,m=wje(u),g=o(u,p);if(!p&&typeof window<"u"){$je();const y=Lje(f);h=y.MeasureLayout,m.visualElement=Rje(e,g,f,i,y.ProjectionNode,a)}return s.jsxs(nS.Provider,{value:m,children:[h&&m.visualElement?s.jsx(h,{visualElement:m.visualElement,...f}):null,Cje(e,u,Ije(g,m.visualElement,d),g,p,t,a)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=x.forwardRef(l);return c[Oje]=e,c}function Mje({layoutId:e}){const t=x.useContext(p7).id;return t&&e!==void 0?t+"-"+e:e}function $je(e,t){x.useContext(GG).strict}function Lje(e){const t=YG(),{drag:n,layout:r}=t;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}
vendor: 18,549 bytes, line 665
665function Fje(e,t){if(typeof Proxy>"u")return eC;const n=new Map,r=(a,o)=>eC(a,o,e,t),i=(a,o)=>r(a,o);return new Proxy(i,{get:(a,o)=>o==="create"?r:(n.has(o)||n.set(o,eC(o,void 0,e,t)),n.get(o))})}const zje=(e,t)=>t.isSVG??ER(e)?new RG(t):new TG(t,{allowProjection:e!==x.Fragment});class Bje extends Ru{constructor(t){super(t),t.animationState||(t.animationState=Cwe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();J_(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let Vje=0;class Wje extends Ru{constructor(){super(...arguments),this.id=Vje++,this.isExitComplete=!1}update(){var a;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:o,custom:l}=this.node.getProps();if(typeof o=="string"){const c=qd(this.node,o,l);if(c){const{transition:u,transitionEnd:d,...h}=c;for(const f in h)(a=this.node.getValue(f))==null||a.jump(h[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Uje={animation:{Feature:Bje},exit:{Feature:Wje}};function lb(e){return{point:{x:e.pageX,y:e.pageY}}}const qje=e=>t=>_R(t)&&e(t,lb(t));function Gy(e,t,n,r){return Qv(e,t,qje(n),r)}const nY=({current:e})=>e?e.ownerDocument.defaultView:null,R3=(e,t)=>Math.abs(e-t);function Hje(e,t){const n=R3(e.x,t.x),r=R3(e.y,t.y);return Math.sqrt(n**2+r**2)}const D3=new Set(["auto","scroll"]);class rY{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:a=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=S0(this.lastRawMoveEventInfo,this.transformPagePoint));const p=tC(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=Hje(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:y}=p,{timestamp:b}=Wr;this.history.push({...y,timestamp:b});const{onStart:v,onMove:w}=this.handlers;m||(v&&v(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=S0(m,this.transformPagePoint),Mt.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:b}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=tC(p.type==="pointercancel"?this.lastMoveEventInfo:S0(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,v),y&&y(p,v)},!_R(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=i||window;const c=lb(t),u=S0(c,this.transformPagePoint),{point:d}=u,{timestamp:h}=Wr;this.history=[{...d,timestamp:h}];const{onSessionStart:f}=n;f&&f(t,tC(u,this.history)),this.removeListeners=sb(Gy(this.contextWindow,"pointermove",this.handlePointerMove),Gy(this.contextWindow,"pointerup",this.handlePointerUp),Gy(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(D3.has(r.overflowX)||D3.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,i=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},a={x:i.x-n.x,y:i.y-n.y};a.x===0&&a.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(t,i),Mt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ca(this.updatePoint)}}function S0(e,t){return t?{point:t(e.point)}:e}function M3(e,t){return{x:e.x-t.x,y:e.y-t.y}}function tC({point:e},t){return{point:e,delta:M3(e,iY(t)),offset:M3(e,Kje(t)),velocity:Gje(t,.1)}}function Kje(e){return e[0]}function iY(e){return e[e.length-1]}function Gje(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=iY(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>zi(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>zi(t)*2&&(r=e[1]);const a=xa(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Yje(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?fn(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?fn(n,e,r.max):Math.min(e,n)),e}function $3(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Qje(e,{top:t,left:n,bottom:r,right:i}){return{x:$3(e.x,n,i),y:$3(e.y,t,r)}}function L3(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Xje(e,t){return{x:L3(e.x,t.x),y:L3(e.y,t.y)}}function Zje(e,t){let n=.5;const r=Di(e),i=Di(t);return i>r?n=dh(t.min,t.max-r,e.min):r>i&&(n=dh(e.min,e.max-i,t.min)),yo(0,1,n)}function Jje(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const GE=.35;function e1e(e=GE){return e===!1?e=0:e===!0&&(e=GE),{x:F3(e,"left","right"),y:F3(e,"top","bottom")}}function F3(e,t,n){return{min:z3(e,t),max:z3(e,n)}}function z3(e,t){return typeof e=="number"?e:e[t]||0}const t1e=new WeakMap;class n1e{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=cr(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const a=h=>{n&&this.snapToCursor(lb(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=$0e(p),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Eo(b=>{let v=this.getAxisMotionValue(b).get()||0;if(Ko.test(v)){const{projection:w}=this.visualElement;if(w&&w.layout){const _=w.layout.layoutBox[b];_&&(v=Di(_)*(parseFloat(v)/100))}}this.originPoint[b]=v}),g&&Mt.update(()=>g(h,f),!1,!0),FE(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:y}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:b}=f;if(m&&this.currentDirection===null){this.currentDirection=i1e(b),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),y&&Mt.update(()=>y(h,f),!1,!0)},c=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new rY(t,{onSessionStart:a,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:nY(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Mt.postRender(()=>l(r,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!k0(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=Yje(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var a;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,i=this.constraints;t&&Sf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Qje(r.layoutBox,t):this.constraints=!1,this.elastic=e1e(n),i!==this.constraints&&!Sf(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Eo(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Jje(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Sf(t))return!1;const r=t.current;el(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=uwe(r,i.root,this.visualElement.getTransformPagePoint());let o=Xje(i.layout.layoutBox,a);if(n){const l=n(owe(o));this.hasMutatedConstraints=!!l,l&&(o=_G(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Eo(d=>{if(!k0(d,n,this.currentDirection))return;let h=c&&c[d]||{};(o===!0||o===d)&&(h={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...a,...h};return this.startAxisValueAnimation(d,m)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return FE(this.visualElement,t),r.start(yR(t,r,0,n,this.visualElement,!1))}stopAnimation(){Eo(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Eo(n=>{const{drag:r}=this.getProps();if(!k0(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:l}=i.layout.layoutBox[n],c=a.get()||0;a.set(t[n]-fn(o,l,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Sf(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Eo(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();i[o]=Zje({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Eo(o=>{if(!k0(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(fn(c,u,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;t1e.set(this.visualElement,this);const t=this.visualElement.current,n=Gy(t,"pointerdown",u=>{const{drag:d,dragListener:h=!0}=this.getProps(),f=u.target,p=f!==t&&W0e(f);d&&h&&!p&&this.start(u)});let r;const i=()=>{const{dragConstraints:u}=this.getProps();Sf(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=r1e(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:a}=this.visualElement,o=a.addEventListener("measure",i);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),Mt.read(i);const l=Qv(window,"resize",()=>this.scalePositionWithinConstraints()),c=a.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Eo(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=u[h].translate,f.set(f.get()+u[h].translate))}),this.visualElement.render())});return()=>{l(),n(),o(),c&&c(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=GE,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function B3(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function r1e(e,t,n){const r=WE(e,B3(n)),i=WE(t,B3(n));return()=>{r(),i()}}function k0(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function i1e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class s1e extends Ru{constructor(t){super(t),this.removeGroupControls=us,this.removeListeners=us,this.controls=new n1e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||us}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const nC=e=>(t,n)=>{e&&Mt.update(()=>e(t,n),!1,!0)};class a1e extends Ru{constructor(){super(...arguments),this.removePointerDownListener=us}onPointerDown(t){this.session=new rY(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nY(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:nC(t),onStart:nC(n),onMove:nC(r),onEnd:(a,o)=>{delete this.session,i&&Mt.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=Gy(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let rC=!1;class o1e extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=t;a&&(n.group&&n.group.add(a),r&&r.register&&i&&r.register(a),rC&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ow.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),rC=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==a?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||Mt.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),jR.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;rC=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function sY(e){const[t,n]=pje(),r=x.useContext(p7);return s.jsx(o1e,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(eY),isPresent:t,safeToRemove:n})}const l1e={pan:{Feature:a1e},drag:{Feature:s1e,ProjectionNode:KG,MeasureLayout:sY}};function V3(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,a=r[i];a&&Mt.postRender(()=>a(t,lb(t)))}class c1e extends Ru{mount(){const{current:t}=this.node;t&&(this.unmount=F0e(t,(n,r)=>(V3(this.node,r,"Start"),i=>V3(this.node,i,"End"))))}unmount(){}}class u1e extends Ru{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=sb(Qv(this.node.current,"focus",()=>this.onFocus()),Qv(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function W3(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),a=r[i];a&&Mt.postRender(()=>a(t,lb(t)))}class d1e extends Ru{mount(){const{current:t}=this.node;if(!t)return;
665const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=q0e(t,(i,a)=>(W3(this.node,a,"Start"),(o,{success:l})=>W3(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const YE=new WeakMap,iC=new WeakMap,h1e=e=>{const t=YE.get(e.target);t&&t(e)},f1e=e=>{e.forEach(h1e)};function p1e({root:e,...t}){const n=e||document;iC.has(n)||iC.set(n,{});const r=iC.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(f1e,{root:e,...t})),r[i]}function m1e(e,t,n){const r=p1e(t);return YE.set(e,n),r.observe(e),()=>{YE.delete(e),r.unobserve(e)}}const g1e={some:0,all:1};class y1e extends Ru{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:g1e[i]},l=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,a&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:h,onViewportLeave:f}=this.node.getProps(),p=d?h:f;p&&p(u)};this.stopObserver=m1e(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(v1e(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function v1e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const x1e={inView:{Feature:y1e},tap:{Feature:d1e},focus:{Feature:u1e},hover:{Feature:c1e}},b1e={layout:{ProjectionNode:KG,MeasureLayout:sY}},w1e={...Uje,...x1e,...l1e,...b1e},Sn=Fje(w1e,zje);function Mj(e){return typeof window>"u"?!1:e?G7():pR()}const j1e=50,U3=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),_1e=()=>({time:0,x:U3(),y:U3()}),S1e={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function q3(e,t,n,r){const i=n[t],{length:a,position:o}=S1e[t],l=i.current,c=n.time;i.current=Math.abs(e[`scroll${o}`]),i.scrollLength=e[`scroll${a}`]-e[`client${a}`],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=dh(0,i.scrollLength,i.current);const u=r-c;i.velocity=u>j1e?0:tR(i.current-l,u)}function k1e(e,t,n){q3(e,"x",t,n),q3(e,"y",t,n),t.time=n}function N1e(e,t){const n={x:0,y:0};let r=e;for(;r&&r!==t;)if(dG(r))n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if(r.tagName==="svg"){const i=r.getBoundingClientRect();r=r.parentElement;const a=r.getBoundingClientRect();n.x+=i.left-a.left,n.y+=i.top-a.top}else if(r instanceof SVGGraphicsElement){const{x:i,y:a}=r.getBBox();n.x+=i,n.y+=a;let o=null,l=r.parentNode;for(;!o;)l.tagName==="svg"&&(o=l),l=r.parentNode;r=o}else break;return n}const QE={start:0,center:.5,end:1};function H3(e,t,n=0){let r=0;if(e in QE&&(e=QE[e]),typeof e=="string"){const i=parseFloat(e);e.endsWith("px")?r=i:e.endsWith("%")?e=i/100:e.endsWith("vw")?r=i/100*document.documentElement.clientWidth:e.endsWith("vh")?r=i/100*document.documentElement.clientHeight:e=i}return typeof e=="number"&&(r=t*e),n+r}const C1e=[0,0];function A1e(e,t,n,r){let i=Array.isArray(e)?e:C1e,a=0,o=0;return typeof e=="number"?i=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?i=e.split(" "):i=[e,QE[e]?e:"0"]),a=H3(i[0],n,r),o=H3(i[1],t),a-o}const _y={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},T1e={x:0,y:0};function E1e(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function P1e(e,t,n){const{offset:r=_y.All}=n,{target:i=e,axis:a="y"}=n,o=a==="y"?"height":"width",l=i!==e?N1e(i,e):T1e,c=i===e?{width:e.scrollWidth,height:e.scrollHeight}:E1e(i),u={width:e.clientWidth,height:e.clientHeight};t[a].offset.length=0;let d=!t[a].interpolate;const h=r.length;for(let f=0;f<h;f++){const p=A1e(r[f],u[o],c[o],l[a]);
665!d&&p!==t[a].interpolatorOffsets[f]&&(d=!0),t[a].offset[f]=p}d&&(t[a].interpolate=cR(t[a].offset,uR(r),{clamp:!1}),t[a].interpolatorOffsets=[...t[a].offset]),t[a].progress=yo(0,1,t[a].interpolate(t[a].current))}function O1e(e,t=e,n){if(n.x.targetOffset=0,n.y.targetOffset=0,t!==e){let r=t;for(;r&&r!==e;)n.x.targetOffset+=r.offsetLeft,n.y.targetOffset+=r.offsetTop,r=r.offsetParent}n.x.targetLength=t===e?t.scrollWidth:t.clientWidth,n.y.targetLength=t===e?t.scrollHeight:t.clientHeight,n.x.containerLength=e.clientWidth,n.y.containerLength=e.clientHeight}function I1e(e,t,n,r={}){return{measure:i=>{O1e(e,r.target,n),k1e(e,n,i),(r.offset||r.target)&&P1e(e,n,r)},notify:()=>t(n)}}const ef=new WeakMap,K3=new WeakMap,sC=new WeakMap,G3=new WeakMap,N0=new WeakMap,Y3=e=>e===document.scrollingElement?window:e;function aY(e,{container:t=document.scrollingElement,trackContentSize:n=!1,...r}={}){if(!t)return us;let i=sC.get(t);i||(i=new Set,sC.set(t,i));const a=_1e(),o=I1e(t,e,a,r);if(i.add(o),!ef.has(t)){const c=()=>{for(const f of i)f.measure(Wr.timestamp);Mt.preUpdate(u)},u=()=>{for(const f of i)f.notify()},d=()=>Mt.read(c);ef.set(t,d);const h=Y3(t);window.addEventListener("resize",d),t!==document.documentElement&&K3.set(t,WE(t,d)),h.addEventListener("scroll",d),d()}if(n&&!N0.has(t)){const c=ef.get(t),u={width:t.scrollWidth,height:t.scrollHeight};G3.set(t,u);const d=()=>{const f=t.scrollWidth,p=t.scrollHeight;(u.width!==f||u.height!==p)&&(c(),u.width=f,u.height=p)},h=Mt.read(d,!0);N0.set(t,h)}const l=ef.get(t);return Mt.read(l,!1,!0),()=>{var h;Ca(l);const c=sC.get(t);if(!c||(c.delete(o),c.size))return;const u=ef.get(t);ef.delete(t),u&&(Y3(t).removeEventListener("scroll",u),(h=K3.get(t))==null||h(),window.removeEventListener("resize",u));const d=N0.get(t);d&&(Ca(d),N0.delete(t)),G3.delete(t)}}const R1e=[[_y.Enter,"entry"],[_y.Exit,"exit"],[_y.Any,"cover"],[_y.All,"contain"]],Q3={start:0,end:1};function D1e(e){const t=e.trim().split(/\s+/);if(t.length!==2)return;const n=Q3[t[0]],r=Q3[t[1]];if(!(n===void 0||r===void 0))return[n,r]}function M1e(e){if(e.length!==2)return;const t=[];for(const n of e)if(Array.isArray(n))t.push(n);else if(typeof n=="string"){const r=D1e(n);if(!r)return;t.push(r)}else return;return t}function $1e(e,t){const n=M1e(e);if(!n)return!1;for(let r=0;r<2;r++){const i=n[r],a=t[r];if(i[0]!==a[0]||i[1]!==a[1])return!1}return!0}function PR(e){if(!e)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[t,n]of R1e)if($1e(e,t))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const X3=new Map;function Z3(e){const t={value:0},n=aY(r=>
665{t.value=r[e.axis].progress*100},e);return{currentTime:t,cancel:n}}function oY({source:e,container:t,...n}){const{axis:r}=n;e&&(t=e);let i=X3.get(t);i||(i=new Map,X3.set(t,i));const a=n.target??"self";let o=i.get(a);o||(o={},i.set(a,o));const l=r+(n.offset??[]).join(",");return o[l]||(n.target&&Mj(n.target)?PR(n.offset)?o[l]=new ViewTimeline({subject:n.target,axis:r}):o[l]=Z3({container:t,...n}):Mj()?o[l]=new ScrollTimeline({source:t,axis:r}):o[l]=Z3({container:t,...n})),o[l]}function L1e(e,t){const n=oY(t),r=t.target?PR(t.offset):void 0,i=t.target?Mj(t.target)&&!!r:Mj();return e.attachTimeline({timeline:i?n:void 0,...r&&i&&{rangeStart:r.rangeStart,rangeEnd:r.rangeEnd},observe:a=>(a.pause(),gG(o=>{a.time=a.iterationDuration*o},n))})}function F1e(e){return e.length===2}function z1e(e,t){return F1e(e)?aY(n=>{e(n[t.axis].progress,n)},t):gG(e,oY(t))}function lY(e,{axis:t="y",container:n=document.scrollingElement,...r}={}){if(!n)return us;const i={axis:t,container:n,...r};return typeof e=="function"?z1e(e,i):L1e(e,i)}const B1e=()=>({scrollX:ba(0),scrollY:ba(0),scrollXProgress:ba(0),scrollYProgress:ba(0)}),C0=e=>e?!e.current:!1;function J3(e,t,n,r){return{factory:i=>lY(i,{...t,axis:e,container:(n==null?void 0:n.current)||void 0,target:(r==null?void 0:r.current)||void 0}),times:[0,1],keyframes:[0,1],ease:i=>i,duration:1}}function V1e(e,t){return typeof window>"u"?!1:e?G7()&&!!PR(t):pR()}function W1e({container:e,target:t,...n}={}){const r=Hp(B1e);V1e(t,n.offset)&&(r.scrollXProgress.accelerate=J3("x",n,e,t),r.scrollYProgress.accelerate=J3("y",n,e,t));const i=x.useRef(null),a=x.useRef(!1),o=x.useCallback(()=>(i.current=lY((l,{x:c,y:u})=>{r.scrollX.set(c.current),r.scrollXProgress.set(c.progress),r.scrollY.set(u.current),r.scrollYProgress.set(u.progress)},{...n,container:(e==null?void 0:e.current)||void 0,target:(t==null?void 0:t.current)||void 0}),()=>{var l;(l=i.current)==null||l.call(i)}),[e,t,JSON.stringify(n.offset)]);return XI(()=>{if(a.current=!1,C0(e)||C0(t)){a.current=!0;return}else return o()},[o]),x.useEffect(()=>{if(a.current)return el(!C0(e),"Container ref is defined but not hydrated","use-scroll-ref"),el(!C0(t),"Target ref is defined but not hydrated","use-scroll-ref"),o()},[o]),r}function $j(e){const t=Hp(()=>ba(e)),{isStatic:n}=x.useContext(tS);if(n){const[,r]=x.useState(e);x.useEffect(()=>t.on("change",r),[])}return t}function cY(e,t){const n=$j(t()),r=()=>n.set(t());return r(),XI(()=>{const i=()=>Mt.preRender(r,!1,!0),a=e.map(o=>o.on("change",i));return()=>{a.forEach(o=>o()),Ca(r)}}),n}function U1e(e){Hy.current=[],e();const t=cY(Hy.current,e);return Hy.current=void 0,t}function Xv(e,t,n,r){if(typeof e=="function")return U1e(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!="function")return q1e(e,t,n,r);const o=typeof t=="function"?t:ewe(t,n,r),l=Array.isArray(e)?e5(e,o):e5([e],([u])=>o(u)),c=Array.isArray(e)?void 0:e.accelerate;return c&&!c.isTransformed&&typeof t!="function"&&Array.isArray(n)&&(r==null?void 0:r.clamp)!==!1&&(l.accelerate={...c,times:t,keyframes:n,isTransformed:!0}),l}function e5(e,t){const n=Hp(()=>[]);return cY(e,()=>{n.length=0;const r=e.length;for(let i=0;i<r;i++)n[i]=e[i].get();return t(n)})}function q1e(e,t,n,r){const i=Hp(()=>Object.keys(n)),a=Hp(()=>({}));for(const o of i)a[o]=Xv(e,t,n[o],r);return a}function H1e(e,t={}){const{isStatic:n}=x.useContext(tS),r=()=>tr(e)?e.get():e;if(n)return Xv(r);const i=$j(r());return x.useInsertionEffect(()=>twe(i,e,t),[i,JSON.stringify(t)]),i}function t5(e,t={}){return H1e(e,{type:"spring",...t})}function qi(){!NR.current&&xG();const[e]=x.useState(Pj.current);return e}function OR(e){return typeof e=="object"&&!Array.isArray(e)}function uY(e,t,n,r){return e==null?[]:typeof e=="string"&&OR(t)?X_(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(i=>i!=null):[e]}function K1e(e,t,n){return e*(t+1)}function n5(e,t,n,r){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:t.startsWith("<")?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function G1e(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];i.at>t&&i.at<n&&(Kp(e,i),r--)}}function Y1e(e,t,n,r,i,a){G1e(e,i,a);for(let o=0;o<t.length;
vendor: 4,358 bytes, line 665
665o++)e.push({value:t[o],at:fn(i,a,r[o]),easing:T7(n,o)})}function Q1e(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function X1e(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const Z1e="easeInOut",J1e=20;function e_e(e,{defaultTransition:t={},...n}={},r,i){const a=t.duration||.3,o=new Map,l=new Map,c={},u=new Map;let d=0,h=0,f=0;for(let p=0;p<e.length;p++){const m=e[p];if(typeof m=="string"){u.set(m,h);continue}else if(!Array.isArray(m)){u.set(m.name,n5(h,m.at,d,u));continue}let[g,y,b={}]=m;b.at!==void 0&&(h=n5(h,b.at,d,u));let v=0;const w=(_,j,S,k=0,N=0)=>{const T=t_e(_),{delay:C=0,times:A=uR(T),type:O=t.type||"keyframes",repeat:z,repeatType:$,repeatDelay:F=0,...B}=j;let{ease:P=t.ease||"easeOut",duration:I}=j;const M=typeof C=="function"?C(k,N):C,R=T.length,K=mR(O)?O:i==null?void 0:i[O||"keyframes"];if(R<=2&&K){let X=100;if(R===2&&i_e(T)){const le=T[1]-T[0];X=Math.abs(le)}const re={...t,...B};I!==void 0&&(re.duration=zi(I));const Y=B7(re,X,K);P=Y.ease,I=Y.duration}I??(I=a);const D=h+M;A.length===1&&A[0]===0&&(A[1]=1);const E=A.length-T.length;if(E>0&&W7(A,E),T.length===1&&T.unshift(null),z){el(z<J1e,"Repeat count too high, must be less than 20","repeat-count-high"),I=K1e(I,z);const X=[...T],re=[...A];P=Array.isArray(P)?[...P]:[P];const Y=[...P];for(let le=0;le<z;le++){T.push(...X);for(let Z=0;Z<X.length;Z++)A.push(re[Z]+(le+1)),P.push(Z===0?"linear":T7(Y,Z-1))}Q1e(A,z)}const q=D+I;Y1e(S,T,P,A,D,q),v=Math.max(M+I,v),f=Math.max(q,f)};if(tr(g)){const _=r5(g,l);w(y,b,i5("default",_))}else{const _=uY(g,y,r,c),j=_.length;for(let S=0;S<j;S++){y=y,b=b;const k=_[S],N=r5(k,l);for(const T in y)w(y[T],n_e(b,T),i5(T,N),S,j)}}d=h,h+=v}return l.forEach((p,m)=>{for(const g in p){const y=p[g];y.sort(X1e);const b=[],v=[],w=[];for(let k=0;k<y.length;k++){const{at:N,value:T,easing:C}=y[k];b.push(T),v.push(dh(0,f,N)),w.push(C||"easeOut")}v[0]!==0&&(v.unshift(0),b.unshift(b[0]),w.unshift(Z1e)),v[v.length-1]!==1&&(v.push(1),b.push(null)),o.has(m)||o.set(m,{keyframes:{},transition:{}});const _=o.get(m);_.keyframes[g]=b;const{type:j,...S}=t;_.transition[g]={...S,duration:f,ease:w,times:v,...n}}}),o}function r5(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function i5(e,t){return t[e]||(t[e]=[]),t[e]}function t_e(e){return Array.isArray(e)?e:[e]}function n_e(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const r_e=e=>typeof e=="number",i_e=e=>e.every(r_e);function s_e(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Z_(e)&&!yG(e)?new RG(t):new TG(t);n.mount(e),Gv.set(e,n)}function a_e(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new ywe(t);n.mount(e),Gv.set(e,n)}function o_e(e,t){return tr(e)||typeof e=="number"||typeof e=="string"&&!OR(t)}function dY(e,t,n,r){const i=[];if(o_e(e,t))i.push(WG(e,OR(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;const a=uY(e,t,r),o=a.length;el(!!o,"No valid elements provided.","no-valid-elements");for(let l=0;l<o;l++){const c=a[l],u=c instanceof Element?s_e:a_e;Gv.has(c)||u(c);const d=Gv.get(c),h={...n};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(l,o)),i.push(...bR(d,{...t,transition:h},{}))}}return i}function l_e(e,t,n){const r=[],i=e.map(o=>{if(Array.isArray(o)&&typeof o[0]=="function"){const l=o[0],c=ba(0);return c.on("change",l),o.length===1?[c,[0,1]]:o.length===2?[c,[0,1],o[1]]:[c,o[1],o[2]]}return o});return e_e(i,t,n,{spring:Hv}).forEach(({keyframes:o,transition:l},c)=>{r.push(...dY(c,o,l))}),r}function c_e(e){return Array.isArray(e)&&e.some(Array.isArray)}function u_e(e={}){const{scope:t,reduceMotion:n}=e;function r(i,a,o){let l=[],c;if(c_e(i)){const{onComplete:d,...h}=a||{};typeof d=="function"&&(c=d),l=l_e(i,n!==void 0?{reduceMotion:n,...h}:h,t)}else{const{onComplete:d,...h}=o||{};typeof d=="function"&&(c=d),l=dY(i,a,n!==void 0?{reduceMotion:n,...h}:h,t)}const u=new s0e(l);return c&&u.finished.then(c),t&&(t.animations.push(u),u.finished.then(()=>{Kp(t.animations,u)})),u}return r}const d_e=u_e(),h_e={some:0,all:1};function f_e(e,t,{root:n,margin:r,amount:i="some"}={}){const a=X_(e),o=new WeakMap,l=u=>{u.forEach(d=>{const h=o.get(d.target);if(d.isIntersecting!==!!h)if(d.isIntersecting){const f=t(d.target,d);typeof f=="function"?o.set(d.target,f):c.unobserve(d.target)}
665else typeof h=="function"&&(h(d),o.delete(d.target))})},c=new IntersectionObserver(l,{root:n,rootMargin:r,threshold:typeof i=="number"?i:h_e[i]});return a.forEach(u=>c.observe(u)),()=>c.disconnect()}function cb(e,{root:t,margin:n,amount:r,once:i=!1,initial:a=!1}={}){const[o,l]=x.useState(a);return x.useEffect(()=>{if(!e.current||i&&o)return;const c=()=>(l(!0),i?void 0:()=>l(!1)),u={root:t&&t.current||void 0,margin:n,amount:r};return f_e(e.current,c,u)},[t,e,n,i,r]),o}const hY="xpharma-active-supplier-id";let fY=(()=>{try{return localStorage.getItem(hY)}catch{return null}})();const XE=new Set;function p_e(e){return XE.add(e),()=>{XE.delete(e)}}function m_e(){return fY}function g_e(e){fY=e;try{localStorage.setItem(hY,e)}catch{}XE.forEach(t=>t())}function An(e={}){const{enabled:t=!0}=e,{user:n}=me(),{isImpersonating:r,impersonating:i}=qe(),a=Ae(),o=x.useSyncExternalStore(p_e,m_e),l=r&&(i==null?void 0:i.type)==="supplier"?i.id:null,c=x.useCallback(d=>{g_e(d),a.invalidateQueries({queryKey:["supplier-profile"]}),a.invalidateQueries({queryKey:["supplier-assets"]}),a.invalidateQueries({queryKey:["supplier-personnel"]}),a.invalidateQueries({queryKey:["supplier-onboarding"]})},[a]);return Se({queryKey:["supplier-profile",l||(n==null?void 0:n.id),o],queryFn:async()=>{const d={supplierUser:null,supplier:null,isApproved:!1,isPending:!1,isRejected:!1,allMemberships:[],activeSupplierIndex:0,switchSupplier:c};if(!n)return d;if(l){const{data:v,error:w}=await W.from("suppliers").select("id, name, location, verified, assets_listed").eq("id",l).single();if(w||!v)return d;const{data:_}=await W.from("supplier_users").select("*").eq("supplier_id",l).eq("status","approved").limit(1).maybeSingle(),j={id:v.id,name:v.name,location:v.location,verified:v.verified,assetsListed:v.assets_listed},S={id:(_==null?void 0:_.id)||"",userId:(_==null?void 0:_.user_id)||"",supplierId:l,pendingCompanyName:(_==null?void 0:_.pending_company_name)||null,pendingCompanyLocation:(_==null?void 0:_.pending_company_location)||null,status:"approved",rejectionReason:null,createdAt:(_==null?void 0:_.created_at)||"",updatedAt:(_==null?void 0:_.updated_at)||"",supplier:j};return{supplierUser:S,supplier:j,isApproved:!0,isPending:!1,isRejected:!1,allMemberships:[{supplierUser:S,supplier:j}],activeSupplierIndex:0,switchSupplier:c}}const{data:h,error:f}=await W.from("supplier_users").select(`
666          id, user_id, supplier_id, pending_company_name, pending_company_location,
667          status, rejection_reason, created_at, updated_at,
668          suppliers ( id, name, location, verified, assets_listed )
669        `).eq("user_id",n.id);if(f)throw console.error("Error fetching supplier profile:",f),f;if(!h||h.length===0)return d;const p=[],m=[];for(const v of h){const w=v.suppliers,_=w?{id:w.id,name:w.name,location:w.location,verified:w.verified,assetsListed:w.assets_listed}:null,j={id:v.id,userId:v.user_id,supplierId:v.supplier_id,pendingCompanyName:v.pending_company_name,pendingCompanyLocation:v.pending_company_location,status:v.status,rejectionReason:v.rejection_reason,createdAt:v.created_at,updatedAt:v.updated_at,supplier:_??void 0};m.push(j),_&&v.status==="approved"&&p.push({supplierUser:j,supplier:_})}let g=0;if(o&&p.length>1){const v=p.findIndex(w=>w.supplier.id===o);v>=0&&(g=v)}if(p.length>0){const v=p[g];return{supplierUser:v.supplierUser,supplier:v.supplier,isApproved:!0,isPending:!1,isRejected:!1,allMemberships:p,activeSupplierIndex:g,switchSupplier:c}}const y=m[0],b=y.supplier?{id:y.supplier.id,name:y.supplier.name,location:y.supplier.location,verified:y.supplier.verified,assetsListed:y.supplier.assetsListed}:null;return{supplierUser:y,supplier:b??null,isApproved:y.status==="approved",isPending:y.status==="pending",isRejected:y.status==="rejected",allMemberships:p,activeSupplierIndex:0,switchSupplier:c}},enabled:!!n&&t})}function Zv(e){return e?{id:e.id,orgType:e.org_type,orgKind:e.org_kind,name:e.name,location:e.location,websiteUrl:e.website_url,emailDomain:e.email_domain,status:e.status,rejectionReason:e.rejection_reason,createdBy:e.created_by,approvedAt:e.approved_at,rejectedAt:e.rejected_at??null,createdAt:e.created_at,updatedAt:e.updated_at}:null}const pY="xpharma-active-buyer-org-id";let mY=(()=>{try{return localStorage.getItem(pY)}catch{return null}})();const ZE=new Set;function y_e(e){return ZE.add(e),()=>{ZE.delete(e)}}function v_e(){return mY}function x_e(e){mY=e;try{localStorage.setItem(pY,e)}catch{}ZE.forEach(t=>t())}function s5(e,t){return{id:e.id,userId:e.user_id,orgId:e.org_id,orgRole:e.org_role,pendingCompanyName:e.pending_company_name,pendingCompanyLocation:e.pending_company_location,companyName:e.company_name,companyLocation:e.company_location,status:e.status,rejectionReason:e.rejection_reason,createdAt:e.created_at,updatedAt:e.updated_at,organization:t}}function oi(e={}){const{enabled:t=!0}=e,{user:n}=me(),{isImpersonating:r,impersonating:i}
669=qe(),a=Ae(),o=x.useSyncExternalStore(y_e,v_e),l=r&&(i==null?void 0:i.type)==="buyer"?i.id:null,c=x.useCallback(u=>{x_e(u),a.invalidateQueries({queryKey:["buyer-profile"]}),a.invalidateQueries({queryKey:["buyer-watchlist"]}),a.invalidateQueries({queryKey:["buyer-inquiries"]}),a.invalidateQueries({queryKey:["asset-chat"]}),a.invalidateQueries({queryKey:["org-roster"]}),a.invalidateQueries({queryKey:["org-invitations"]})},[a]);return Se({queryKey:["buyer-profile",l||(n==null?void 0:n.id),o],queryFn:async()=>{const u={buyerUser:null,organization:null,isApproved:!1,isPending:!1,isRejected:!1,allMemberships:[],activeOrgIndex:0,switchOrg:c};if(!n)return u;if(l){const{data:y,error:b}=await W.from("buyer_users").select("*, organizations(*)").eq("id",l).maybeSingle();if(b)throw console.error("Error fetching buyer profile:",b),b;if(!y)return u;const v=Zv(y.organizations),w=s5(y,v),_=v&&y.status==="approved"?[{buyerUser:w,organization:v}]:[];return{buyerUser:w,organization:v,isApproved:y.status==="approved",isPending:y.status==="pending",isRejected:y.status==="rejected",allMemberships:_,activeOrgIndex:0,switchOrg:c}}const{data:d,error:h}=await W.from("buyer_users").select("*, organizations(*)").eq("user_id",n.id).order("created_at",{ascending:!0});if(h)throw console.error("Error fetching buyer profile:",h),h;if(!d||d.length===0)return u;const f=d.map(y=>{const b=Zv(y.organizations);return{buyerUser:s5(y,b),organization:b}}),p=f.filter(y=>y.buyerUser.status==="approved"),m=p.filter(y=>!!y.organization);if(p.length>0){let y=0;if(o&&m.length>1){const v=m.findIndex(w=>w.organization.id===o);v>=0&&(y=v)}const b=m[y]??p[0];return{buyerUser:b.buyerUser,organization:b.organization??null,isApproved:!0,isPending:!1,isRejected:!1,allMemberships:m,activeOrgIndex:y,switchOrg:c}}const g=f[f.length-1];return{buyerUser:g.buyerUser,organization:g.organization,isApproved:!1,isPending:g.buyerUser.status==="pending",isRejected:g.buyerUser.status==="rejected",allMemberships:m,activeOrgIndex:0,switchOrg:c}},enabled:!!n&&t})}const gY="xpharma-active-partner-org-id";let yY=(()=>{try{return localStorage.getItem(gY)}catch{return null}})();const JE=new Set;function b_e(e){return JE.add(e),()=>{JE.delete(e)}}function w_e(){return yY}function j_e(e){yY=e;try{localStorage.setItem(gY,e)}catch{}JE.forEach(t=>t())}function __e(e,t){return{id:e.id,userId:e.user_id,orgId:e.org_id,orgRole:e.org_role,status:e.status,createdAt:e.created_at,updatedAt:e.updated_at,organization:t}}function ng(e={}){const{enabled:t=!0}=e,{user:n}=me(),r=Ae(),i=x.useSyncExternalStore(b_e,w_e),a=x.useCallback(o=>{j_e(o),r.invalidateQueries({queryKey:["partner-profile"]}),r.invalidateQueries({queryKey:["partner-org-roster"]}),r.invalidateQueries({queryKey:["org-invitations"]}),r.invalidateQueries({queryKey:["partner-engagements"]})},[r]);return Se({queryKey:["partner-profile",n==null?void 0:n.id,i],queryFn:async()=>{const o={partnerUser:null,organization:null,isApproved:!1,allMemberships:[],activeOrgIndex:0,switchOrg:a};if(!n)return o;const{data:l,error:c}=await W.from("partner_users").select("*").eq("user_id",n.id).order("created_at",{ascending:!0});if(c)throw console.error("Error fetching partner profile:",c),c;if(!l||l.length===0)return o;const u=Array.from(new Set(l.map(b=>b.org_id))),{data:d,error:h}=await W.from("organizations").select("*").in("id",u);if(h)throw console.error("Error fetching partner organizations:",h),h;const f=new Map((d??[]).map(b=>[b.id,Zv(b)])),m=l.filter(b=>b.status==="approved").map(b=>{const v=f.get(b.org_id)??null;return v?{partnerUser:__e(b,v),organization:v}:null}).filter(b=>b!==null);if(m.length===0)return o;let g=0;if(i&&m.length>1){const b=m.findIndex(v=>v.organization.id===i);b>=0&&(g=b)}const y=m[g];return{partnerUser:y.partnerUser,organization:y.organization,isApproved:!0,allMemberships:m,activeOrgIndex:g,switchOrg:a}},enabled:!!n&&t})}var aC="focusScope.autoFocusOnMount",oC="focusScope.autoFocusOnUnmount",a5={bubbles:!1,cancelable:!0},S_e="FocusScope",ub=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[l,c]=x.useState(null),u=Jn(i),d=Jn(a),h=x.useRef(null),f=Ke(t,g=>c(g)),p=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let g=function(w){if(p.paused||!l)return;const _=w.target;l.contains(_)?h.current=_:Sc(h.current,{select:!0})},y=function(w){if(p.paused||!l)return;const _=w.relatedTarget;_!==null&&(l.contains(_)||Sc(h.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const j of w)j.removedNodes.length>0&&Sc(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const v=new MutationObserver(b);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),v.disconnect()}}},[r,l,p.paused]),x.useEffect(()=>{if(l){l5.add(p);const g=document.activeElement;if(!l.contains(g)){const b=new CustomEvent(aC,a5);l.addEventListener(aC,u),l.dispatchEvent(b),b.defaultPrevented||(k_e(E_e(vY(l)),{select:!0}),document.activeElement===g&&Sc(l))}return()=>{l.removeEventListener(aC,u),setTimeout(()=>{const b=new CustomEvent(oC,a5);l.addEventListener(oC,d),l.dispatchEvent(b),b.defaultPrevented||Sc(g??document.body,{select:!0}),l.removeEventListener(oC,d),l5.remove(p)}
vendor: 2,942 bytes, line 669
669,0)}}},[l,u,d,p]);const m=x.useCallback(g=>{if(!n&&!r||p.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,b=document.activeElement;if(y&&b){const v=g.currentTarget,[w,_]=N_e(v);w&&_?!g.shiftKey&&b===_?(g.preventDefault(),n&&Sc(w,{select:!0})):g.shiftKey&&b===w&&(g.preventDefault(),n&&Sc(_,{select:!0})):b===v&&g.preventDefault()}},[n,r,p.paused]);return s.jsx(Ne.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});ub.displayName=S_e;function k_e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Sc(r,{select:t}),document.activeElement!==n)return}function N_e(e){const t=vY(e),n=o5(t,e),r=o5(t.reverse(),e);return[n,r]}function vY(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function o5(e,t){for(const n of e)if(!C_e(n,{upTo:t}))return n}function C_e(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 A_e(e){return e instanceof HTMLInputElement&&"select"in e}function Sc(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&A_e(e)&&t&&e.select()}}var l5=T_e();function T_e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=c5(e,t),e.unshift(t)},remove(t){var n;e=c5(e,t),(n=e[0])==null||n.resume()}}}function c5(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function E_e(e){return e.filter(t=>t.tagName!=="A")}var lC=0;function rS(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??u5()),document.body.insertAdjacentElement("beforeend",e[1]??u5()),lC++,()=>{lC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),lC--}},[])}function u5(){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 Iw="right-scroll-bar-position",Rw="width-before-scroll-bar",P_e="with-scroll-bars-hidden",O_e="--removed-body-scroll-bar-size";function cC(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function I_e(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var R_e=typeof window<"u"?x.useLayoutEffect:x.useEffect,d5=new WeakMap;function D_e(e,t){var n=I_e(null,function(r){return e.forEach(function(i){return cC(i,r)})});return R_e(function(){var r=d5.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;
vendor: 4,224 bytes, lines 669-684
669i.forEach(function(l){a.has(l)||cC(l,null)}),a.forEach(function(l){i.has(l)||cC(l,o)})}d5.set(n,e)},[e]),n}function M_e(e){return e}function $_e(e,t){t===void 0&&(t=M_e);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(a),o=n}var c=function(){var d=o;o=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),n}}}};return i}function L_e(e){e===void 0&&(e={});var t=$_e(null);return t.options=$o({async:!0,ssr:!1},e),t}var xY=function(e){var t=e.sideCar,n=Xm(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,$o({},n))};xY.isSideCarExport=!0;function F_e(e,t){return e.useMedium(t),xY}var bY=L_e(),uC=function(){},iS=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:uC,onWheelCapture:uC,onTouchMoveCapture:uC}),i=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,b=e.as,v=b===void 0?"div":b,w=e.gapMode,_=Xm(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=f,S=D_e([n,t]),k=$o($o({},_),i);return x.createElement(x.Fragment,null,d&&x.createElement(j,{sideCar:bY,removeScrollBar:u,shards:h,noRelative:p,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!y,lockRef:n,gapMode:w}),o?x.cloneElement(x.Children.only(l),$o($o({},k),{ref:S})):x.createElement(v,$o({},k,{className:c,ref:S}),l))});iS.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};iS.classNames={fullWidth:Rw,zeroRight:Iw};var z_e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function B_e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=z_e();return t&&e.setAttribute("nonce",t),e}function V_e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function W_e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var U_e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=B_e())&&(V_e(t,n),W_e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},q_e=function(){var e=U_e();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},wY=function(){var e=q_e(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},H_e={left:0,top:0,right:0,gap:0},dC=function(e){return parseInt(e||"",10)||0},K_e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[dC(n),dC(r),dC(i)]},G_e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return H_e;var t=K_e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Y_e=wY(),hp="data-scroll-locked",Q_e=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
670  .`.concat(P_e,` {
671   overflow: hidden `).concat(r,`;
672   padding-right: `).concat(l,"px ").concat(r,`;
673  }
674  body[`).concat(hp,`] {
675    overflow: hidden `).concat(r,`;
676    overscroll-behavior: contain;
677    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
678    padding-left: `.concat(i,`px;
679    padding-top: `).concat(a,`px;
680    padding-right: `).concat(o,`px;
681    margin-left:0;
682    margin-top:0;
683    margin-right: `).concat(l,"px ").concat(r,`;
684    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";
684")].filter(Boolean).join(""),`
685  }
686  
687  .`).concat(Iw,` {
688    right: `).concat(l,"px ").concat(r,`;
689  }
690  
691  .`).concat(Rw,` {
692    margin-right: `).concat(l,"px ").concat(r,`;
693  }
694  
695  .`).concat(Iw," .").concat(Iw,` {
696    right: 0 `).concat(r,`;
697  }
698  
699  .`).concat(Rw," .").concat(Rw,` {
700    margin-right: 0 `).concat(r,`;
701  }
702  
703  body[`).concat(hp,`] {
704    `).concat(O_e,": ").concat(l,`px;
705  }
706`)},h5=function(){var e=parseInt(document.body.getAttribute(hp)||"0",10);return isFinite(e)?e:0},X_e=function(){x.useEffect(function(){return document.body.setAttribute(hp,(h5()+1).toString()),function(){var e=h5()-1;e<=0?document.body.removeAttribute(hp):document.body.setAttribute(hp,e.toString())}},[])},Z_e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;X_e();var a=x.useMemo(function(){return G_e(i)},[i]);return x.createElement(Y_e,{styles:Q_e(a,!t,i,n?"":"!important")})},eP=!1;if(typeof window<"u")try{var A0=Object.defineProperty({},"passive",{get:function(){return eP=!0,!0}});window.addEventListener("test",A0,A0),window.removeEventListener("test",A0,A0)}catch{eP=!1}var tf=eP?{passive:!1}:!1,J_e=function(e){return e.tagName==="TEXTAREA"},jY=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!J_e(e)&&n[t]==="visible")},eSe=function(e){return jY(e,"overflowY")},tSe=function(e){return jY(e,"overflowX")},f5=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=_Y(e,r);if(i){var a=SY(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},nSe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},rSe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},_Y=function(e,t){return e==="v"?eSe(t):tSe(t)},SY=function(e,t){return e==="v"?nSe(t):rSe(t)},iSe=function(e,t){return e==="h"&&t==="rtl"?-1:1},sSe=function(e,t,n,r,i){var a=iSe(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,d=o>0,h=0,f=0;do{if(!l)break;var p=SY(e,l),m=p[0],g=p[1],y=p[2],b=g-y-a*m;(m||b)&&_Y(e,l)&&(h+=b,f+=m);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(h)<1||!i)||!d&&(Math.abs(f)<1||!i))&&(u=!0),u},T0=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},p5=function(e){return[e.deltaX,e.deltaY]},m5=function(e){return e&&"current"in e?e.current:e},aSe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},oSe=function(e){return`
707  .block-interactivity-`.concat(e,` {pointer-events: none;}
708  .allow-interactivity-`).concat(e,` {pointer-events: all;}
709`)},lSe=0,nf=[];function cSe(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(lSe++)[0],a=x.useState(wY)[0],o=x.useRef(e);x.useEffect(function(){o.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var g=Age([e.lockRef.current],(e.shards||[]).map(m5),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var b=T0(g),v=n.current,w="deltaX"in g?g.deltaX:v[0]-b[0],_="deltaY"in g?g.deltaY:v[1]-b[1],j,S=g.target,k=Math.abs(w)>Math.abs(_)?"h":"v";if("touches"in g&&k==="h"&&S.type==="range")return!1;var N=f5(k,S);if(!N)return!0;if(N?j=k:(j=k==="v"?"h":"v",N=f5(k,S)),!N)return!1;if(!r.current&&"changedTouches"in g&&(w||_)&&(r.current=j),!j)return!0;var T=r.current||j;return sSe(T,y,g,T==="h"?w:_,!0)},[]),c=x.useCallback(function(g){var y=g;if(!(!nf.length||nf[nf.length-1]!==a)){var b="deltaY"in y?p5(y):T0(y),v=t.current.filter(function(j){return j.name===y.type&&(j.target===y.target||y.target===j.shadowParent)&&aSe(j.delta,b)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}
vendor: 4,271 bytes, line 709
709if(!v){var w=(o.current.shards||[]).map(m5).filter(Boolean).filter(function(j){return j.contains(y.target)}),_=w.length>0?l(y,w[0]):!o.current.noIsolation;_&&y.cancelable&&y.preventDefault()}}},[]),u=x.useCallback(function(g,y,b,v){var w={name:g,delta:y,target:b,should:v,shadowParent:uSe(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(_){return _!==w})},1)},[]),d=x.useCallback(function(g){n.current=T0(g),r.current=void 0},[]),h=x.useCallback(function(g){u(g.type,p5(g),g.target,l(g,e.lockRef.current))},[]),f=x.useCallback(function(g){u(g.type,T0(g),g.target,l(g,e.lockRef.current))},[]);x.useEffect(function(){return nf.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,tf),document.addEventListener("touchmove",c,tf),document.addEventListener("touchstart",d,tf),function(){nf=nf.filter(function(g){return g!==a}),document.removeEventListener("wheel",c,tf),document.removeEventListener("touchmove",c,tf),document.removeEventListener("touchstart",d,tf)}},[]);var p=e.removeScrollBar,m=e.inert;return x.createElement(x.Fragment,null,m?x.createElement(a,{styles:oSe(i)}):null,p?x.createElement(Z_e,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function uSe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const dSe=F_e(bY,cSe);var db=x.forwardRef(function(e,t){return x.createElement(iS,$o({},e,{ref:t,sideCar:dSe}))});db.classNames=iS.classNames;var hSe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},rf=new WeakMap,E0=new WeakMap,P0={},hC=0,kY=function(e){return e&&(e.host||kY(e.parentNode))},fSe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kY(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},pSe=function(e,t,n,r){var i=fSe(t,Array.isArray(e)?e:[e]);P0[n]||(P0[n]=new WeakMap);var a=P0[n],o=[],l=new Set,c=new Set(i),u=function(h){!h||l.has(h)||(l.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(f){if(l.has(f))d(f);else try{var p=f.getAttribute(r),m=p!==null&&p!=="false",g=(rf.get(f)||0)+1,y=(a.get(f)||0)+1;rf.set(f,g),a.set(f,y),o.push(f),g===1&&m&&E0.set(f,!0),y===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),l.clear(),hC++,function(){o.forEach(function(h){var f=rf.get(h)-1,p=a.get(h)-1;rf.set(h,f),a.set(h,p),f||(E0.has(h)||h.removeAttribute(r),E0.delete(h)),p||h.removeAttribute(n)}),hC--,hC||(rf=new WeakMap,rf=new WeakMap,E0=new WeakMap,P0={})}},sS=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=hSe(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),pSe(r,i,n,"aria-hidden")):function(){return null}},aS="Dialog",[NY,CY]=sr(aS),[mSe,jo]=NY(aS),AY=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=x.useRef(null),c=x.useRef(null),[u,d]=ji({prop:r,defaultProp:i??!1,onChange:a,caller:aS});return s.jsx(mSe,{scope:t,triggerRef:l,contentRef:c,contentId:gr(),titleId:gr(),descriptionId:gr(),open:u,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(h=>!h),[d]),modal:o,children:n})};AY.displayName=aS;var TY="DialogTrigger",EY=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jo(TY,n),a=Ke(t,i.triggerRef);return s.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":DR(i.open),...r,ref:a,onClick:fe(e.onClick,i.onOpenToggle)})});EY.displayName=TY;var IR="DialogPortal",[gSe,PY]=NY(IR,{forceMount:void 0}),OY=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=jo(IR,t);return s.jsx(gSe,{scope:t,forceMount:n,children:x.Children.map(r,o=>s.jsx(vr,{present:n||a.open,children:s.jsx(Vm,{asChild:!0,container:i,children:o})}))})};OY.displayName=IR;var Lj="DialogOverlay",IY=x.forwardRef((e,t)=>{const n=PY(Lj,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=jo(Lj,e.__scopeDialog);return a.modal?s.jsx(vr,{present:r||a.open,children:s.jsx(vSe,{...i,ref:t})}):null});
vendor: 5,080 bytes, lines 709-713
709IY.displayName=Lj;var ySe=yu("DialogOverlay.RemoveScroll"),vSe=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jo(Lj,n);return s.jsx(db,{as:ySe,allowPinchZoom:!0,shards:[i.contentRef],children:s.jsx(Ne.div,{"data-state":DR(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),hh="DialogContent",RY=x.forwardRef((e,t)=>{const n=PY(hh,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=jo(hh,e.__scopeDialog);return s.jsx(vr,{present:r||a.open,children:a.modal?s.jsx(xSe,{...i,ref:t}):s.jsx(bSe,{...i,ref:t})})});RY.displayName=hh;var xSe=x.forwardRef((e,t)=>{const n=jo(hh,e.__scopeDialog),r=x.useRef(null),i=Ke(t,n.contentRef,r);return x.useEffect(()=>{const a=r.current;if(a)return sS(a)},[]),s.jsx(DY,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:fe(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:fe(e.onFocusOutside,a=>a.preventDefault())})}),bSe=x.forwardRef((e,t)=>{const n=jo(hh,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return s.jsx(DY,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),DY=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=jo(hh,n),c=x.useRef(null),u=Ke(t,c);return rS(),s.jsxs(s.Fragment,{children:[s.jsx(ub,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:s.jsx(Eh,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":DR(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(jSe,{titleId:l.titleId}),s.jsx(SSe,{contentRef:c,descriptionId:l.descriptionId})]})]})}),RR="DialogTitle",MY=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jo(RR,n);return s.jsx(Ne.h2,{id:i.titleId,...r,ref:t})});MY.displayName=RR;var $Y="DialogDescription",LY=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jo($Y,n);return s.jsx(Ne.p,{id:i.descriptionId,...r,ref:t})});LY.displayName=$Y;var FY="DialogClose",zY=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jo(FY,n);return s.jsx(Ne.button,{type:"button",...r,ref:t,onClick:fe(e.onClick,()=>i.onOpenChange(!1))})});zY.displayName=FY;function DR(e){return e?"open":"closed"}var BY="DialogTitleWarning",[wSe,VY]=Nue(BY,{contentName:hh,titleName:RR,docsSlug:"dialog"}),jSe=({titleId:e})=>{const t=VY(BY),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
710
711If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
712
713For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},_Se="DialogDescriptionWarning",SSe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${VY(_Se).contentName}}.`;return x.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},oS=AY,MR=EY,lS=OY,rg=IY,ig=RY,hb=MY,fb=LY,cS=zY;const pb=oS,WY=MR,kSe=lS,UY=x.forwardRef(({className:e,...t},n)=>s.jsx(rg,{className:ae("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));UY.displayName=rg.displayName;const NSe=Wm("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"}}),sg=x.forwardRef(({side:e="right",className:t,children:n,...r},i)=>s.jsxs(kSe,{children:[s.jsx(UY,{}),s.jsxs(ig,{ref:i,className:ae(NSe({side:e}),t),...r,children:[n,s.jsxs(cS,{className:"absolute right-4 top-4 roun
713ded-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:[s.jsx(Ui,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));sg.displayName=ig.displayName;const uS=({className:e,...t})=>s.jsx("div",{className:ae("flex flex-col space-y-2 text-center sm:text-left",e),...t});uS.displayName="SheetHeader";const dS=x.forwardRef(({className:e,...t},n)=>s.jsx(hb,{ref:n,className:ae("text-lg font-semibold text-foreground",e),...t}));dS.displayName=hb.displayName;const CSe=x.forwardRef(({className:e,...t},n)=>s.jsx(fb,{ref:n,className:ae("text-sm text-muted-foreground",e),...t}));CSe.displayName=fb.displayName;function tP({size:e=26}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,style:{display:"block",flexShrink:0},children:[s.jsx("rect",{width:"32",height:"32",rx:"6",fill:"hsl(var(--c-accent))"}),s.jsx("path",{d:"M9 9L23 23",stroke:"#fff",strokeWidth:"4",strokeLinecap:"round"}),s.jsx("path",{d:"M23 9C23 9 20 12 16 16C12 20 9 23 9 23",stroke:"#fff",strokeWidth:"6",strokeLinecap:"round"}),s.jsx("circle",{cx:"16",cy:"16",r:"2",fill:"hsl(var(--c-accent))"})]})}const ASe=[{name:"Pipeline",href:"/pipeline",icon:Oh},{name:"Valuation",href:"/valuation",icon:_I},{name:"Verification",href:"/verification",icon:Hs}],TSe=[{name:"Valuation",href:"/valuation",icon:_I}],ESe=[{name:"Features",href:"/features",icon:Cn},{name:"Pricing",href:"/pricing",icon:Ode},{name:"Docs",href:"/docs",icon:Sde}];function PSe({minimal:e}){const t=wo(),{user:n,isAdmin:r,isBuyer:i,signOut:a}=me(),{data:o}=An(),{data:l}=oi(),{data:c}=ng(),u=xr(),[d,h]=x.useState(!1),f=async()=>{await a(),u("/")},p=o==null?void 0:o.isApproved,m=o==null?void 0:o.isPending,g=l==null?void 0:l.isApproved,y=(l==null?void 0:l.isPending)||i&&!(l!=null&&l.buyerUser),b=c==null?void 0:c.isApproved,v=p?"/supplier":g?"/buyer":b?"/partner":"/",_=(()=>{if(!n)return ESe;const S=[];return r&&(S.push(...ASe),S.push({name:"Admin",href:"/admin",icon:qde})),p?(r||S.push(...TSe),S.push({name:"Supplier",href:"/supplier",icon:pr}),S.push({name:"Market view",href:"/supplier/market",icon:Na})):r&&S.push({name:"Supplier",href:"/supplier",icon:pr}),(g||r&&!g)&&S.push({name:"Buyer",href:"/buyer",icon:Vp}),b&&S.push({name:"Partner",href:"/partner",icon:$de}),S})(),j=((n==null?void 0:n.email)??"XP").slice(0,2).toUpperCase();return s.jsx("header",{className:"xph-header",children:s.jsxs("div",{className:"xph-header-inner",children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:24},children:[e?s.jsxs("span",{className:"xph-logo",children:[s.jsx(tP,{}),s.jsx("span",{className:"xph-logo-word",children:"xPharma"})]}):s.jsxs(oe,{to:v,className:"xph-logo",children:[s.jsx(tP,{}),s.jsx("span",{className:"xph-logo-word",children:"xPharma"})]}),!e&&_.length>0&&s.jsxs(s.Fragment,{children:[n&&s.jsx("span",{style:{width:1,height:18,background:"hsl(var(--c-border))"}}),s.jsxs("nav",{className:`hidden md:flex ${n?"xph-nav":"xph-public-nav"}`,style:n?void 0:{gap:28,alignItems:"center"},children:[_.map(S=>{const k=S.icon,N=t.pathname===S.href||S.href!=="/"&&t.pathname.startsWith(S.href+"/");return n?s.jsxs(oe,{to:S.href,className:`xph-nav-link ${N?"is-active":""}`,children:[s.jsx(k,{size:15}),S.name]},S.name):s.jsx(oe,{to:S.href,className:"xph-public-nav-link",style:{fontSize:13.5,textDecoration:"none",color:N?"hsl(var(--c-ink))":"hsl(var(--c-fg-muted))",fontWeight:N?500:400,transition:"color 120ms"},children:S.name},S.name)}),m&&s.jsxs(oe,{to:"/supplier/pending",className:"xph-nav-link",children:[s.jsx(Yn,{size:15}),"Supplier",s.jsx("span",{style:{marginLeft:4,fontFamily:"var(--font-mono)",fontSize:9.5,letterSpacing:"0.06em",textTransform:"uppercase",background:"hsl(var(--c-warning-soft))",color:"hsl(var(--c-warning-fg))",padding:"2px 6px",borderRadius:3},children:"Pending"})]}),y&&s.jsxs(oe,{to:"/buyer/pending",className:"xph-nav-link",children:[s.jsx(Yn,{size:15}),"Buyer",s.jsx("span",{style:{marginLeft:4,fontFamily:"var(--font-mono)",fontSize:9.5,letterSpacing:"0.06em",textTransform:"uppercase",background:"hsl(var(--c-warning-soft))",color:"hsl(var(--c-warning-fg))",padding:"2px 6px",borderRadius:3},children:"Pending"})]})]})]})]}),!e&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"hidden md:flex",style:{alignItems:"center",gap:8},children:n?s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:f,className:"xph-btn xph-btn-ghost xph-btn-sm",children:[s.jsx(gj,{size:15}),"Sign out"]}),s.jsx(oe,{to:"/profile",className:"xph-avatar","aria-label":"Profile",title:n.email??"Profile",children:j})]}):s.jsxs(oe,{to:"/auth",className:"xph-btn xph-btn-outline xph-btn-sm",children:[s.jsx(qT,{size:14}),"Sign in"]})}),s.jsxs(pb,{open:d,onOpenChange:h,children:[s.jsx(WY,{asChild:!0,children:s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon md:hidden","aria-label":"Open menu",children:s.jsx(CH,{size:18})})}),s.jsx(sg,{side:"right",className:"w-72",children:s.jsxs("div",{className:"flex flex-col gap-2 mt-8",children:[_.map(S=>{const k=S.icon,N=t.pathname===S.href;return s.jsxs(oe,{to:S.href,onClick:()=>h(!1),className:`xph-nav-link ${N?"is-active":""}`,style:{padding:"10px 12px",fontSize:14},children:[s.jsx(k,{size:16}),S.name]},S.name)}),m&&s.jsxs(oe,{to:"/supplier/pending",onClick:()=>h(!1),className:"xph-nav-link",style:{padding:"10px 12px",fontSize:14},children:[s.jsx(Yn,{size:16})," Supplier · Pending"]}),y&&s.jsxs(oe,{to:"/buyer/pending",onClick:()=>h(!1),className:"xph-nav-link",style:{padding:"10px 12px",fontSize:14},children:[s.jsx(Yn,{size:16})," Buyer · Pending"]}),s.jsx("div",{className:"border-t pt-4 mt-2 space-y-2",children:n?s.jsxs(s.Fragment,{children:[s.jsxs(oe,{to:"/profile",onClick:()=>h(!1),className:"xph-btn xph-btn-outline w-full justify-start",children:[s.jsx(Ede,{size:15})," Profile"]}),s.jsxs("button",{type:"button",onClick:async()=>{await f(),h(!1)},className:"xph-btn xph-btn-outline w-full justify-start",children:[s.jsx(gj,{size:15})," Sign out"]})]}):s.jsxs(oe,{to:"/auth",onClick:()=>h(!1),className:"xph-btn xph-btn-outline w-full justify-start",children:[s.jsx(qT,{size:15})," Sign in"]})})]})})]})]})]})})}const OSe={light:{icon:Gde,label:"Light"},system:{icon:TH,label:"System"},dark:{icon:Wde,label:"Dark"}},ISe=["light","system","dark"],g5=ISe.map(e=>({value:e,...OSe[e]}
713)),Ug=26,fC=3,y5=0;function qY({className:e,tooltipSide:t="top"}){const{preference:n,setPreference:r}=pxe(),i=Math.max(0,g5.findIndex(a=>a.value===n));return s.jsxs("div",{role:"radiogroup","aria-label":"Theme",className:e,style:{position:"relative",display:"inline-flex",padding:fC,background:"hsl(var(--c-surface-2))",border:"1px solid hsl(var(--c-border))",borderRadius:9999,gap:y5},children:[s.jsx("span",{"aria-hidden":!0,style:{position:"absolute",top:fC,left:fC,width:Ug,height:Ug,borderRadius:9999,background:"hsl(var(--c-card))",boxShadow:"var(--shadow-sm)",transform:`translateX(${i*(Ug+y5)}px)`,transition:"transform 220ms cubic-bezier(0.4, 0, 0.2, 1)",pointerEvents:"none"}}),g5.map(a=>{const o=a.icon,l=n===a.value;return s.jsxs(ni,{delayDuration:120,children:[s.jsx(ri,{asChild:!0,children:s.jsx("button",{type:"button",role:"radio","aria-checked":l,"aria-label":a.label,onClick:()=>r(a.value),style:{position:"relative",zIndex:1,width:Ug,height:Ug,borderRadius:9999,border:0,background:"transparent",color:l?"hsl(var(--c-ink))":"hsl(var(--c-fg-muted))",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",transition:"color 150ms",padding:0},children:s.jsx(o,{size:13,strokeWidth:2})})}),s.jsx(Kr,{side:t,className:"px-3 py-2 text-xs",children:s.jsx("span",{className:"font-medium text-foreground",children:a.label})})]},a.value)})]})}const RSe=[{heading:"Product",links:[{kind:"route",label:"Features",to:"/features"},{kind:"route",label:"Pricing",to:"/pricing"},{kind:"route",label:"Documentation",to:"/docs"}]},{heading:"Company",links:[{kind:"route",label:"Request access",to:"/auth?signup=true"},{kind:"route",label:"Sign in",to:"/auth"},{kind:"external",label:"Contact",href:"mailto:[email protected]"}]},{heading:"Legal",links:[{kind:"route",label:"Terms",to:"/terms"},{kind:"route",label:"Privacy",to:"/privacy"}]}];function DSe(){return s.jsx("footer",{style:{borderTop:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-card))"},children:s.jsx("div",{className:"xph-container",style:{padding:"clamp(40px, 6vw, 64px) 24px"},children:s.jsxs("div",{className:"grid gap-y-10 lg:grid-cols-[minmax(0,320px)_minmax(0,1fr)] lg:gap-x-20 xl:gap-x-28",style:{alignItems:"flex-start"},children:[s.jsxs("div",{style:{maxWidth:320},children:[s.jsxs(oe,{to:"/",style:{display:"inline-flex",alignItems:"center",gap:10,textDecoration:"none",color:"inherit"},children:[s.jsx(tP,{size:22}),s.jsx("span",{className:"xph-logo-word",style:{color:"hsl(var(--c-ink))",fontSize:15},children:"xPharma"})]}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:14,lineHeight:1.55},children:"The fastest path from molecule to medicine. Currently in limited preview by invitation."}),s.jsxs("div",{style:{marginTop:18,display:"flex",alignItems:"center",gap:14},children:[s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:11.5,color:"hsl(var(--c-fg-subtle))"},children:"© 2026 xPharma"}),s.jsx(qY,{})]})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-y-10 gap-x-8",children:RSe.map(e=>s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))",marginBottom:14},children:e.heading}),s.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:10},children:e.links.map(t=>s.jsx("li",{children:t.kind==="external"?s.jsx("a",{href:t.href,className:"xph-footer-link",style:{color:"hsl(var(--c-fg-muted))",textDecoration:"none",fontSize:13},children:t.label}):s.jsx(oe,{to:t.to,className:"xph-footer-link",style:{color:"hsl(var(--c-fg-muted))",textDecoration:"none",fontSize:13},children:t.label})},t.label))})]},e.heading))})]})})})}function MSe(){const{impersonating:e,isImpersonating:t,stopImpersonation:n}=qe();if(!t||!e)return null;const r=e.type==="supplier"?"Supplier":"Buyer";return s.jsx("div",{className:"sticky top-16 z-40 w-full bg-amber-500 text-amber-950 px-4 py-2",children:s.jsxs("div",{className:"container flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx(Na,{className:"h-4 w-4"}),s.jsxs("span",{children:["Viewing as ",r,": ",s.jsx("strong",{children:e.name})]}),s.jsx("span",{className:"opacity-70",children:"• Read-only mode"})]}),s.jsxs(je,{variant:"ghost",size:"sm",onClick:n,className:"h-7 text-amber-950 hover:text-amber-950 hover:bg-amber-400",children:[s.jsx(Ui,{className:"h-4 w-4 mr-1"}),"Stop Viewing"]})]})})}function he({children:e,minimal:t}){return s.jsxs("div",{className:"min-h-screen flex flex-col",style:{background:"hsl(var(--c-surface))"},children:[s.jsx(PSe,{minimal:t}),s.jsx(MSe,{}),s.jsx("main",{className:"flex-1",children:e}),s.jsx(DSe,{})]})}const $Se="https://xpharma.ai";function Js({title:e,description:t,path:n,noindex:r,jsonLd:i}){const a=`${$Se}${n}`;return s.jsxs(wue,{children:[s.jsx("title",{children:e}),s.jsx("meta",{name:"description",content:t}),s.jsx("link",{rel:"canonical",href:a}),s.jsx("meta",{property:"og:title",content:e}),s.jsx("meta",{property:"og:description",content:t}),s.jsx("meta",{property:"og:url",content:a}),s.jsx("meta",{name:"twitter:title",content:e}),s.jsx("meta",{name:"twitter:description",content:t}),r&&s.jsx("meta",{name:"robots",content:"noindex, nofollow"}),i&&s.jsx("script",{type:"application/ld+json",children:JSON.stringify(i)})]})}const HY={preind:{bg:"hsl(var(--c-stage-preind-bg))",fg:"hsl(var(--c-stage-preind-fg))"},glp:{bg:"hsl(var(--c-stage-glp-bg))",fg:"hsl(var(--c-stage-glp-fg))"},ind:{bg:"hsl(var(--c-stage-ind-bg))",fg:"hsl(var(--c-stage-ind-fg))"},clinical:{bg:"hsl(var(--c-stage-clinical-bg))",fg:"hsl(var(--c-stage-clinical-fg))"},discovery:{bg:"hsl(var(--c-stage-discovery-bg))",fg:"hsl(var(--c-stage-discovery-fg))"},accent:{bg:"hsl(var(--c-accent-soft))",fg:"hsl(var(--c-accent))"}},KY=[{id:"ai-document-extraction",icon:Nde,title:"AI document extraction",summary:"Auto-categorize and extract structured asset data from PDFs, DOCX, XLSX, and PPT
713X uploads.",description:"xPharma reads your data room the way an experienced BD analyst would. Documents are routed through a categorizer trained on the 12-category pharma taxonomy, then a structured extraction pass pulls target, MOA, preclinical, CMC, IP, and clinical fields into a normalized asset profile. Suppliers see their listing populate as they upload — no manual data entry, no form fatigue.",bullets:["Multi-format ingestion: PDF, DOCX, XLSX, PPTX","Automatic taxonomy assignment with manual override","Field-level confidence and source-document traceability"],palette:"glp",homepage:!0},{id:"valuation-terminal",icon:yH,title:"Valuation terminal",summary:"Risk-adjusted NPV with stage-gated milestones, real-options modeling, and Monte Carlo distributions.",description:"The valuation engine combines a four-layer probability-of-success model with real-options modeling and 10,000-iteration Monte Carlo simulation to produce P10 / P50 / P90 NPV ranges. Tornado sensitivity charts show exactly which assumptions move the deal — peak penetration, pricing, cPOS, discount rate — so buyers and suppliers can negotiate against the same numbers.",bullets:["Real-options + 4-layer cPOS + Monte Carlo","Tornado sensitivity on the levers that move NPV","Calibrated against published comparable deals"],palette:"ind",homepage:!0},{id:"semantic-asset-search",icon:Ea,title:"Semantic asset search",summary:"Natural-language queries across structured asset fields and underlying document content.",description:'Ask in plain English — "oral NLRP3 inhibitors with clean rat tox at pre-IND" — and xPharma searches across asset metadata, document content, and extracted scientific data. Results are ranked by semantic relevance, not keyword match, so adjacent indications and comparable mechanisms surface together. Watchlists and saved searches keep buyers ahead of new listings.',bullets:["Natural-language queries across asset and document corpora","Filters across stage, indication, modality, geography","Watchlists with new-listing notifications"],palette:"accent",homepage:!0},{id:"data-room",icon:ti,title:"12-category data room",summary:"Pharma-specific document taxonomy from corporate and legal through transaction process.",description:"Every uploaded document is auto-routed into a pharma-specific taxonomy tuned to BD diligence, with manual override available. Buyers see a clean, structured data room from day one; suppliers stop maintaining ad-hoc folder structures across deals.",bullets:["12 categories tuned to pharma BD diligence patterns","Confidential vs. published document scoping","Signed-URL access with row-level security"],palette:"preind"},{id:"supplier-verification",icon:Hs,title:"Supplier verification",summary:"Entity registry lookup, personnel checks, LinkedIn and email verification surfaced to buyers.",description:"Before an asset goes live, xPharma runs entity registry verification, key-personnel checks, and contact validation. Verification status is surfaced on the listing so buyers know what has been independently confirmed — and what has not — before they ever request a meeting. The result: less time wasted on assets that cannot transact.",bullets:["Entity registry + key-personnel verification","LinkedIn and corporate-email validation","Verification badges visible on every public listing"],palette:"clinical"},{id:"role-based-access",icon:po,title:"Role-based access",summary:"Admin approvals, supplier and buyer scoping, and row-level security across all data.",description:"xPharma is built for multi-stakeholder organizations. Suppliers can invite teammates with scoped roles (scientific lead, legal reviewer, BD), buyers manage internal review groups, and admins have read-only impersonation for support without bypassing the audit trail. Every read and every mutation is gated by row-level security in the underlying database — there is no application-layer trust boundary.",bullets:["Personnel invitations with scoped internal roles","Read-only admin impersonation with full audit trail","Row-level security on every table, every read, every write"],palette:"discovery"}],LSe=KY.filter(e=>e.homepage),Ih=[.22,1,.36,1],GY=[.34,1.56,.64,1],Rh={once:!0,margin:"0px 0px -10% 0p
713x"};function Yp(e,t,n,r){return e?{initial:!1,animate:void 0}:{initial:n,animate:t?r:n}}const da=x.forwardRef(function({children:t,delay:n=0,y:r=24,duration:i=.6,once:a=!0,...o},l){return qi()?s.jsx("div",{ref:l,...o,children:t}):s.jsx(Sn.div,{ref:l,initial:{opacity:0,y:r},whileInView:{opacity:1,y:0},viewport:{once:a,margin:"-10% 0px -10% 0px"},transition:{duration:i,delay:n,ease:Ih},...o,children:t})});function Jv({tokens:e,trigger:t="mount",staggerMs:n=45,delayMs:r=50,durationMs:i=550,travel:a="110%",as:o="div",className:l,style:c}){const u=qi(),d=Sn[o],h=[];e.forEach((m,g)=>{typeof m=="string"?m.split(/\s+/).filter(Boolean).forEach((y,b)=>{h.push({key:`s-${g}-${b}`,content:y})}):h.push({key:m.key??`n-${g}`,content:m.node})});const f={hidden:{},visible:{transition:{staggerChildren:u?0:n/1e3,delayChildren:u?0:r/1e3}}},p={hidden:u?{y:0}:{y:a},visible:{y:0,transition:{duration:i/1e3,ease:Ih}}};return s.jsx(d,{className:l,style:c,variants:f,initial:"hidden",...t==="view"?{whileInView:"visible",viewport:Rh}:{animate:"visible"},children:h.map(m=>s.jsx("span",{style:{display:"inline-flex",clipPath:"polygon(-100% 0%, 200% 0%, 200% 100%, -100% 100%)",verticalAlign:"bottom",paddingBottom:"0.12em",marginBottom:"-0.12em",marginRight:"0.25em"},children:s.jsx(Sn.span,{variants:p,style:{display:"inline-block",willChange:"transform"},children:m.content})},m.key))})}function Dw({to:e,from:t=0,duration:n=1.2,decimals:r=1,prefix:i="",suffix:a="",triggerOnView:o=!0}){const l=x.useRef(null),c=x.useRef(null),u=cb(l,Rh),d=qi(),h={minimumFractionDigits:r,maximumFractionDigits:r},f=d||!o?e:t,p=e.toLocaleString(void 0,h);return x.useEffect(()=>{if(d){c.current&&(c.current.textContent=p);return}if(o&&!u)return;const m=d_e(t,e,{duration:n,ease:Ih,onUpdate:g=>{c.current&&(c.current.textContent=g.toLocaleString(void 0,h))}});return()=>m.stop()},[u,t,e,n,d,o,r,p]),s.jsxs("span",{ref:l,style:{fontVariantNumeric:"tabular-nums"},children:[i,s.jsxs("span",{style:{position:"relative",display:"inline-block"},children:[s.jsx("span",{"aria-hidden":!0,style:{visibility:"hidden"},children:p}),s.jsx("span",{ref:c,style:{position:"absolute",inset:0,textAlign:"right"},children:f.toLocaleString(void 0,h)})]}),a]})}function FSe({segments:e,speedMs:t=28,delayMs:n=600,className:r,cursor:i=!0}){const a=qi(),o=e.reduce((f,p)=>f+p.text.length,0),[l,c]=x.useState(a?o:0);x.useEffect(()=>{if(a){c(o);return}c(0);let f;const p=setTimeout(()=>{f=setInterval(()=>{c(m=>m>=o?(f&&clearInterval(f),m):m+1)},t)},n);return()=>{clearTimeout(p),f&&clearInterval(f)}},[o,t,n,a]);const u=l>=o;let d=l;const h=[];for(let f=0;f<e.length;f++){const p=e[f];if(d<=0)break;const m=Math.min(p.text.length,d);h.push(s.jsx("span",{style:p.style,children:p.text.slice(0,m)},f)),d-=m}return s.jsxs("span",{className:r,children:[h,i&&!u&&s.jsx("span",{"aria-hidden":!0,style:{display:"inline-block",width:"1px",height:"1em",background:"currentColor",marginLeft:1,verticalAlign:"-0.15em",animation:a?"none":"xph-caret-blink 1s steps(2) infinite"}})]})}function v5({children:e,baseRotateY:t=-3,baseRotateX:n=2,maxTilt:r=5,style:i,className:a}){const o=x.useRef(null),l=qi(),c=$j(0),u=$j(0),d=t5(c,{stiffness:140,damping:18,mass:.6}),h=t5(u,{stiffness:140,damping:18,mass:.6}),f=Xv(d,[-1,1],[t-r,t+r]),p=Xv(h,[-1,1],[n+r,n-r]);return l?s.jsx("div",{className:a,style:{...i,transform:`rotateY(${t}deg) rotateX(${n}deg)`}
713,children:e}):s.jsx("div",{style:{perspective:1200},className:a,children:s.jsx(Sn.div,{ref:o,onPointerMove:m=>{var v;const g=(v=o.current)==null?void 0:v.getBoundingClientRect();if(!g)return;const y=(m.clientX-g.left)/g.width*2-1,b=(m.clientY-g.top)/g.height*2-1;c.set(y),u.set(b)},onPointerLeave:()=>{c.set(0),u.set(0)},style:{...i,rotateY:f,rotateX:p,transformStyle:"preserve-3d"},children:e})})}function zSe({size:e=6,color:t="hsl(var(--c-positive))"}){const n=qi();return s.jsxs("span",{style:{position:"relative",width:e,height:e,display:"inline-block"},"aria-hidden":!0,children:[s.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:t,animation:n?"none":"xph-live-ring 2s ease-out infinite"}}),s.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:t,animation:n?"none":"xph-live-core 2s ease-in-out infinite"}})]})}function nP({children:e,staggerMs:t=80,initialDelayMs:n=0,...r}){const i=qi(),a=x.Children.toArray(e).filter(x.isValidElement);return s.jsx(Sn.ul,{role:"list",initial:"hidden",whileInView:"visible",viewport:Rh,variants:{hidden:{},visible:{transition:{staggerChildren:i?0:t/1e3,delayChildren:i?0:n/1e3}}},...r,children:a.map((o,l)=>s.jsx(Sn.li,{role:"listitem",variants:{hidden:i?{opacity:1}:{opacity:0,y:8},visible:{opacity:1,y:0}},transition:{duration:.45,ease:Ih},style:{listStyle:"none"},children:o},o.key??l))})}const pC={accent:"hsl(var(--c-accent))",iqr:"hsl(var(--c-accent-border))",tail:"hsl(var(--c-surface-2))"};function BSe(e,t){return e?pC.accent:t?pC.iqr:pC.tail}function VSe({heights:e,accentIndex:t=7,iqr:n=[2,12]}){const r=x.useRef(null),i=cb(r,Rh),a=qi();return s.jsx("div",{ref:r,style:{marginTop:18,height:64,display:"flex",alignItems:"end",gap:3},"aria-hidden":!0,children:e.map((o,l)=>{const c=Yp(!!a,i,{scaleY:0},{scaleY:1});return s.jsx(Sn.div,{...c,transition:{duration:.55,delay:l*.045,ease:Ih},style:{flex:1,height:`${o}%`,background:BSe(l===t,l>=n[0]&&l<=n[1]),borderRadius:"2px 2px 0 0",transformOrigin:"bottom"}},l)})})}function WSe(e,t){return t>50&&e<50?"center":t<=50?"right":"left"}function x5({leftPct:e,fill:t,delay:n,initial:r,animate:i}){return s.jsx("span",{style:{position:"absolute",top:"50%",left:`${e}%`,width:7,height:7,transform:"translate(-50%, -50%)",pointerEvents:"none"},children:s.jsx(Sn.span,{initial:r,animate:i,transition:{duration:.3,delay:n},style:{display:"block",width:"100%",height:"100%",borderRadius:"50%",background:t,border:"1.5px solid hsl(var(--c-accent))"}})})}function USe({label:e,lowPct:t,highPct:n,swing:r,delayMs:i=0}){const a=x.useRef(null),o=cb(a,Rh),l=qi(),c=i/1e3,u=Yp(!!l,o,{opacity:0,scale:.4},{opacity:1,scale:1}),d=Yp(!!l,o,{scaleX:0},{scaleX:1});return s.jsxs("div",{ref:a,style:{display:"grid",gridTemplateColumns:"1fr 56px",gap:12,alignItems:"center"},children:[s.jsxs("div",{children:[s.jsx("div",{style:{fontSize:11,color:"hsl(var(--c-fg-muted))",marginBottom:6},children:e}),s.jsxs("div",{style:{position:"relative",height:14}
713,children:[s.jsx("div",{style:{position:"absolute",top:5,left:0,right:0,height:4,background:"hsl(var(--c-surface-2))",borderRadius:2}}),s.jsx("div",{style:{position:"absolute",top:0,bottom:0,left:"50%",width:1,background:"hsl(var(--c-border-strong))"}}),s.jsx(Sn.div,{...d,transition:{duration:.7,delay:c,ease:Ih},style:{position:"absolute",top:2,bottom:2,left:`${t}%`,width:`${n-t}%`,background:"hsl(var(--c-accent) / 0.18)",border:"1px solid hsl(var(--c-accent) / 0.7)",borderRadius:3,transformOrigin:WSe(t,n)}}),s.jsx(x5,{leftPct:t,fill:"hsl(var(--c-card))",delay:c+.5,...u}),s.jsx(x5,{leftPct:n,fill:"hsl(var(--c-accent))",delay:c+.55,...u})]})]}),s.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-ink))",fontWeight:500,textAlign:"right"},children:r})]})}const qSe={done:{bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))",label:"COMPLETE"},active:{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))",label:"IN PROGRESS"},pending:{bg:"hsl(var(--c-surface))",fg:"hsl(var(--c-fg-subtle))",label:"PENDING"}};function HSe({rows:e}){const t=x.useRef(null),n=cb(t,Rh),r=qi();return s.jsx("div",{ref:t,children:e.map(([i,a],o)=>{const l=qSe[a],c=Yp(!!r,n,{opacity:0,x:-12},{opacity:1,x:0}),u=Yp(!!r,n,{scale:.6,opacity:0},{scale:1,opacity:1});return s.jsxs(Sn.div,{...c,transition:{duration:.45,delay:o*.12,ease:Ih},style:{display:"grid",gridTemplateColumns:"24px 1fr auto",gap:10,alignItems:"center",padding:"10px 14px",borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsx("span",{style:{width:22,height:22,borderRadius:"50%",background:l.bg,color:l.fg,display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:11,fontWeight:600},children:a==="done"?s.jsx(Fr,{size:12}):o+1}),s.jsx("span",{style:{fontSize:12.5,color:"hsl(var(--c-ink))",fontWeight:500},children:i}),s.jsx(Sn.span,{...u,transition:{duration:.45,delay:o*.12+.25,ease:GY},style:{fontFamily:"var(--font-mono)",fontSize:9.5,color:l.fg,background:l.bg,padding:"2px 7px",borderRadius:3,letterSpacing:"0.06em"},children:l.label})]},i)})})}function KSe(){const e=x.useRef(null),t=cb(e,Rh),n=qi(),r=Yp(!!n,t,{scale:.8,opacity:0}
713,{scale:1,opacity:1});return s.jsxs("div",{ref:e,children:[s.jsxs("div",{style:{padding:"14px 16px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,color:"hsl(var(--c-fg-subtle))",textTransform:"uppercase",letterSpacing:"0.06em"},children:"US"}),s.jsx("span",{className:"xph-badge xph-stage-preind",children:"Pre-IND"}),s.jsx(Sn.span,{...r,transition:{duration:.4,delay:.6,ease:GY},style:{fontFamily:"var(--font-mono)",fontSize:10.5,color:"hsl(var(--c-accent))",background:"hsl(var(--c-accent-soft))",border:"1px solid hsl(var(--c-accent-border))",borderRadius:4,padding:"2px 7px",textTransform:"uppercase",letterSpacing:"0.04em",animation:n?"none":"xph-hot-pulse 2.6s ease-in-out 1.2s infinite"},children:"Hot · 24h"})]}),s.jsxs("div",{style:{padding:"16px 16px 12px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12},children:[s.jsxs("div",{children:[s.jsx("div",{className:"tt-stat-lg",children:"ATX-1421"}),s.jsx("div",{className:"tt-mono-sm",style:{marginTop:2},children:"NLRP3 · SM (oral)"})]}),s.jsxs("div",{style:{textAlign:"right"},children:[s.jsx("div",{className:"tt-stat-lg",children:s.jsx(Dw,{to:340.4,prefix:"$",suffix:"M",decimals:1})}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-positive-fg))",marginTop:2},children:"▲ +$28M"})]})]}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:12},children:"Allosteric NLRP3 inhibitor; clean rat tox; chronic-tox + scale-up gaps."})]}),s.jsxs("div",{style:{padding:"10px 16px",borderTop:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-surface))",display:"flex",justifyContent:"space-between",fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-fg-muted))"},children:[s.jsx("span",{children:"150 inbounds · 92% data"}),s.jsx("span",{children:"Atlas Bio"})]})]})}function GSe({targetRef:e}){const t=qi(),{scrollYProgress:n}=W1e({target:e,offset:["start 60%","end 60%"]}),r=Xv(n,[0,1],[0,1]);return t?null:s.jsx("div",{"aria-hidden":!0,className:"hidden lg:flex",style:{position:"absolute",top:0,bottom:0,left:"50%",width:1,pointerEvents:"none",justifyContent:"center"},children:s.jsx(Sn.div,{style:{width:1,height:"100%",background:"linear-gradient(to bottom, transparent 0%, hsl(var(--c-accent) / 0.45) 12%, hsl(var(--c-accent) / 0.45) 88%, transparent 100%)",transformOrigin:"top",scaleY:r}})})}const YSe=[{num:"01",title:"Verify",icon:Hs,iconBg:"hsl(var(--c-positive-soft))",iconFg:"hsl(var(--c-positive-fg))",description:"Suppliers onboard through entity verification, personnel checks, and document-level asset review. Only credible assets go live."},{num:"02",title:"Position",icon:Oh,iconBg:"hsl(var(--c-accent-soft))",iconFg:"hsl(var(--c-accent))",description:"AI reads your data room and builds a structured asset profile — target, MOA, preclinical, CMC, IP, clinical, and commercial data — so buyers see substance, not slide decks."},{num:"03",title:"Transact",icon:DH,iconBg:"hsl(var(--c-warning-soft))",iconFg:"hsl(var(--c-warning-fg))",description:"Buyers search, shortlist, and engage directly. Pre-built data rooms and structured profiles compress diligence to weeks."}],QSe=["Guided onboarding with entity and personnel verification","AI auto-fills your asset profile from uploaded documents","12-category pharma data room with auto-categorized documents","Verification status visible to buyers — builds trust before first contact"],XSe=["AI-powered semantic search across verified assets","Structured profiles with preclinical, CMC, IP, and clinical data","Comparable deal valuations and NPV benchmarks","Watchlists and direct inquiries to suppliers"],ZSe=[["Identity & ownership","done"],["Pharmacology & tox","active"],["CMC & supply","active"],["Patent / FTO","pending"]],JSe=[["Peak penetration · 8% → 22%",14,86,"$248M"],["Pricing · WAC discount range",24,78,"$172M"],["Phase II → III · cPOS",32,71,"$116M"],["Discount rate · 9% → 14%",41,62,"$54M"]],eke=[6,12,22,36,54,72,90,100,92,76,56,38,22,12,6],tke=[s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{padding:"14px 16px",borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{className:"eyebrow",children:"Listing checklist · 78% complete"}),s.jsx("div",{className:"tt-display-sm",style:{fontSize:14,marginTop:4},children:"Guided positioning."})]}),s.jsx(HSe,{rows:ZSe})]}),s.jsx(KSe,{}),s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{padding:"14px 16px",borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{className:"eyebrow",children:"Sensitivity · NPV swing"}),s.jsx("div",{className:"tt-display-sm",style:{fontSize:14,marginTop:4},children:"What moves the deal."})]}),s.jsx("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12},children:JSe.map(([e,t,n,r],i)=>s.jsx(USe,{label:e,lowPct:t,highPct:n,swing:r,delayMs:i*110},e))})]})];function nke(){const e=x.useRef(null),t=qi();return s.jsxs(he,{children:[s.jsx(Js,{title:"xPharma — The fastest path from molecule to medicine",description:"A curated marketplace where verified biotech assets meet diligence-ready buyers. Position, verify, value, and transact — faster.",path:"/"}),s.jsxs("section",{style:{padding:"clamp(56px, 8vw, 88px) 0 clamp(40px, 6vw, 72px)",borderBottom:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-bg))",position:"relative",overflow:"hidden"},children:[s.jsx("div",{className:"xph-aurora"}),s.jsxs("div",{className:"xph-container",style:{position:"relative",zIndex:1,display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 480px), 1fr))",gap:"clamp(40px, 5vw, 56px)",alignItems:"center"},children:[s.jsxs("div",{children:[s.jsx(Jv,{as:"h1",className:"tt-display-xl",style:{marginBottom:24},tokens:[{node:s.jsx("span",{style:{fontStyle:"italic",color:"hsl(var(--c-accent))"},children:"AI-powered"}),key:"ai"},"diligence for biotech asset transactions"]}),s.jsx(Sn.p,{className:"tt-lead",style:{maxWidth:540,marginBottom:32},initial:t?!1:{opacity:0,y:12}
713,animate:{opacity:1,y:0},transition:{duration:.7,delay:.5,ease:[.22,1,.36,1]},children:"xPharma's proprietary AI turns raw science into transactable assets — positioning, verifying, and valuing pre-clinical and clinical programs so suppliers get to a deal faster and buyers get diligence-ready opportunities they can trust."}),s.jsxs(Sn.div,{style:{display:"flex",gap:12,flexWrap:"wrap"},initial:t?!1:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.6,delay:.7,ease:[.22,1,.36,1]},children:[s.jsxs(oe,{to:"/auth?buyer=true",className:"xph-btn xph-btn-primary",style:{padding:"12px 22px",fontSize:14.5},children:["I'm a Buyer — Request Access",s.jsx(Gn,{size:14})]}),s.jsx(oe,{to:"/auth?supplier=true",className:"xph-btn xph-btn-outline",style:{padding:"12px 22px",fontSize:14.5},children:"I'm a Supplier — List an Asset"})]})]}),s.jsxs(Sn.div,{style:{position:"relative"},"aria-hidden":!0,initial:t?!1:{opacity:0,y:24},animate:{opacity:1,y:0},transition:{duration:.8,delay:.3,ease:[.22,1,.36,1]},children:[s.jsxs(v5,{style:{background:"hsl(var(--c-card))",border:"1px solid hsl(var(--c-border))",borderRadius:14,boxShadow:"var(--shadow-lg)",overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-fg-subtle))",textTransform:"uppercase",letterSpacing:"0.06em"},children:[s.jsx("span",{children:"Asset · ATX-1421 · NLRP3"}),s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,color:"hsl(var(--c-positive-fg))"},children:[s.jsx(zSe,{}),"Live"]})]}),s.jsxs("div",{style:{padding:22},children:[s.jsx("div",{className:"eyebrow",children:"NPV · P50 · Monte Carlo · 24h"}),s.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:12,marginTop:6},children:[s.jsx("span",{className:"tt-stat-xl",children:s.jsx(Dw,{to:340.4,prefix:"$",suffix:"M",decimals:1,triggerOnView:!1})}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-positive-fg))"},children:["▲ +",s.jsx(Dw,{to:28.1,prefix:"$",suffix:"M",decimals:1,triggerOnView:!1,duration:1.4})," ·"," ","+",s.jsx(Dw,{to:8.3,suffix:"%",decimals:1,triggerOnView:!1,duration:1.4})]})]}),s.jsx(VSe,{heights:eke}),s.jsxs("div",{style:{marginTop:8,display:"flex",justifyContent:"space-between",fontFamily:"var(--font-mono)",fontSize:10.5,color:"hsl(var(--c-fg-subtle))"},children:[s.jsx("span",{children:"P10"}),s.jsx("span",{style:{color:"hsl(var(--c-accent))"},children:"P50"}),s.jsx("span",{children:"P90"})]})]}),s.jsx("div",{style:{borderTop:"1px solid hsl(var(--c-border))",display:"grid",gridTemplateColumns:"repeat(3, 1fr)"},children:[["Stage","Pre-IND"],["PoS","38%"],["Inbounds","150"]].map(([n,r])=>s.jsxs("div",{style:{padding:"14px 18px",borderRight:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{className:"eyebrow",children:n}),s.jsx("div",{className:"tt-stat-md",style:{marginTop:4},children:r})]},n))})]}),s.jsxs(Sn.div,{className:"hidden md:block",initial:t?!1:{opacity:0,y:16,scale:.96},animate:{opacity:1,y:0,scale:1},transition:{duration:.7,delay:1,ease:[.22,1,.36,1]},style:{position:"absolute",bottom:-28,right:-32,width:280,background:"hsl(var(--c-card))",border:"1px solid hsl(var(--c-border))",borderRadius:12,padding:14,boxShadow:"var(--shadow-lg)",transform:"rotateY(-3deg)"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10},children:[s.jsx("span",{style:{width:22,height:22,borderRadius:5,background:"hsl(var(--c-ink))",color:"hsl(var(--c-ink-inverse))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:9,fontWeight:600},children:"xp"}),s.jsx("div",{className:"eyebrow",style:{fontSize:9.5},children:"Asset Chat"})]}),s.jsx("div",{style:{fontSize:12.5,color:"hsl(var(--c-fg))",lineHeight:1.45,minHeight:56},children:s.jsx(FSe,{speedMs:26,delayMs:1400,segments:[{text:"Closing the chronic-tox gap moves NPV from "},{text:"$340M → $522M",style:{fontWeight:600,color:"hsl(var(--c-ink))"}},{text:" at P50."}]})})]})]})]})]}),s.jsx("section",{style:{padding:"clamp(56px, 8vw, 88px) 0 clamp(72px, 9vw, 104px)",background:"hsl(var(--c-surface))"},children:s.jsxs("div",{className:"xph-container",children:[s.jsxs(da,{style:{textAlign:"center",maxWidth:720,margin:"0 auto clamp(56px, 7vw, 88px)"},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-accent))"},children:"How xPharma works"}),s.jsxs("h2",{className:"tt-display-lg",style:{marginTop:12,marginBottom:16},children:["From raw science to"," ",s.jsx("span",{style:{fontStyle:"italic",color:"hsl(var(--c-accent))"},children:"deal-ready"})," in three steps"]}),s.jsx("p",{className:"tt-lead",children:"xPharma handles the work that slows transactions down — verification, structuring, and presentation."})]}),s.jsxs("div",{ref:e,style:{position:"relative"}
713,children:[s.jsx(GSe,{targetRef:e}),YSe.slice(0,3).map((n,r)=>{const i=n.icon,a=r%2===1,o=a?-3:3,l=tke[r];return s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 360px), 1fr))",gap:"clamp(40px, 5vw, 72px)",alignItems:"center",marginTop:r===0?0:"clamp(64px, 8vw, 112px)",position:"relative"},children:[s.jsx(da,{className:a?"lg:order-2":"lg:order-1",style:{},y:32,duration:.7,children:s.jsx(v5,{baseRotateY:o,baseRotateX:2,maxTilt:3,style:{background:"hsl(var(--c-card))",border:"1px solid hsl(var(--c-border))",borderRadius:14,boxShadow:"var(--shadow-lg)",overflow:"hidden",maxWidth:480,marginInline:a?"0 auto":"auto 0",width:"100%"},children:l})}),s.jsxs(da,{className:a?"lg:order-1":"lg:order-2",style:{maxWidth:480,width:"100%",marginInline:a?"auto 0":"0 auto"},delay:.15,children:[s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:10,marginBottom:16},children:[s.jsx(Sn.span,{initial:t?!1:{scale:.6,rotate:-8,opacity:0},whileInView:{scale:1,rotate:0,opacity:1},viewport:{once:!0,margin:"0px 0px -10% 0px"},transition:{duration:.5,delay:.25,ease:[.34,1.56,.64,1]},style:{width:36,height:36,borderRadius:8,background:n.iconBg,color:n.iconFg,display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(i,{size:17})}),s.jsxs("span",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))"},children:["Step ",n.num]})]}),s.jsx("h3",{className:"tt-display-md",style:{marginBottom:14},children:n.title}),s.jsx("p",{className:"tt-lead",children:n.description})]})]},n.num)})]})]})}),s.jsx("section",{style:{padding:"clamp(56px, 8vw, 88px) 0",background:"hsl(var(--c-bg))"},children:s.jsxs("div",{className:"xph-container",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 380px), 1fr))",gap:16},children:[s.jsx(da,{style:{height:"100%"},children:s.jsxs("div",{className:"xph-card xph-hover-lift",style:{padding:"clamp(24px, 4vw, 36px)",height:"100%",display:"flex",flexDirection:"column"},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-positive-fg))"},children:"For Suppliers"}),s.jsx("h3",{className:"tt-display-md",style:{marginTop:10,marginBottom:24},children:"Get your asset in front of serious buyers"}),s.jsx(nP,{style:{padding:0,margin:"0 0 28px",display:"flex",flexDirection:"column",gap:12},staggerMs:90,initialDelayMs:150,children:QSe.map(n=>s.jsxs("span",{className:"tt-body",style:{display:"flex",gap:10},children:[s.jsx("span",{style:{width:18,height:18,borderRadius:4,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:2},children:s.jsx(Fr,{size:11})}),s.jsx("span",{style:{color:"hsl(var(--c-fg))"},children:n})]},n))}),s.jsxs(oe,{to:"/auth?supplier=true",className:"xph-btn xph-btn-primary",style:{marginTop:"auto",alignSelf:"flex-start"},children:["List an Asset",s.jsx(Gn,{size:13})]})]})}),s.jsx(da,{delay:.1,style:{height:"100%"},children:s.jsxs("div",{className:"xph-card xph-hover-lift",style:{padding:"clamp(24px, 4vw, 36px)",height:"100%",display:"flex",flexDirection:"column"},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-accent))"},children:"For Buyers"}),s.jsx("h3",{className:"tt-display-md",style:{marginTop:10,marginBottom:24},children:"Find your next pipeline asset — already diligenced"}),s.jsx(nP,{style:{padding:0,margin:"0 0 28px",display:"flex",flexDirection:"column",gap:12},staggerMs:90,initialDelayMs:150,children:XSe.map(n=>s.jsxs("span",{className:"tt-body",style:{display:"flex",gap:10},children:[s.jsx("span",{style:{width:18,height:18,borderRadius:4,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:2},children:s.jsx(Fr,{size:11})}),s.jsx("span",{style:{color:"hsl(var(--c-fg))"},children:n})]},n))}),s.jsxs(oe,{to:"/auth?buyer=true",className:"xph-btn xph-btn-primary",style:{marginTop:"auto",alignSelf:"flex-start"},children:["Request Access",s.jsx(Gn,{size:13})]})]})})]})}),s.jsx("section",{style:{padding:"clamp(56px, 8vw, 88px) 0",background:"hsl(var(--c-surface))"},children:s.jsxs("div",{className:"xph-container",children:[s.jsxs(da,{style:{textAlign:"center",maxWidth:720,margin:"0 auto clamp(36px, 5vw, 56px)"},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-accent))"},children:"Platform capabilities"}),s.jsxs("h2",{className:"tt-display-lg",style:{marginTop:12,marginBottom:16},children:["Built for ",s.jsx("span",{style:{fontStyle:"italic",color:"hsl(var(--c-accent))"},children:"pharma BD"})]}),s.jsx("p",{className:"tt-lead",children:"Purpose-built tools that understand the language, workflow, and data structures of drug development."})]}),s.jsx(Sn.div,{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",initial:"hidden",
713whileInView:"visible",viewport:{once:!0,margin:"0px 0px -10% 0px"},variants:{hidden:{},visible:{transition:{staggerChildren:t?0:.12}}},children:LSe.map(n=>{const r=n.icon,i=HY[n.palette];return s.jsxs(Sn.div,{className:"xph-card xph-hover-lift",variants:{hidden:t?{opacity:1}:{opacity:0,y:18},visible:{opacity:1,y:0,transition:{duration:.55,ease:[.22,1,.36,1]}}},style:{padding:22,display:"flex",gap:14,alignItems:"flex-start"},children:[s.jsx(Sn.span,{whileHover:t?void 0:{scale:1.08},transition:{type:"spring",stiffness:320,damping:18},style:{width:36,height:36,borderRadius:8,background:i.bg,color:i.fg,display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s.jsx(r,{size:17})}),s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",style:{marginBottom:4},children:n.title}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:n.summary})]})]},n.id)})}),s.jsx(da,{style:{textAlign:"center",marginTop:"clamp(28px, 4vw, 40px)"},delay:.2,children:s.jsxs(oe,{to:"/features",className:"xph-btn xph-btn-outline",style:{padding:"10px 18px",fontSize:14},children:["View all platform capabilities",s.jsx(Gn,{size:13})]})})]})}),s.jsx("section",{style:{padding:"clamp(56px, 8vw, 88px) 0",background:"hsl(var(--c-bg))",borderTop:"1px solid hsl(var(--c-border))"},children:s.jsx("div",{className:"xph-container",style:{textAlign:"center",maxWidth:720,margin:"0 auto"},children:s.jsxs(da,{children:[s.jsx(Jv,{as:"h2",className:"tt-display-lg",trigger:"view",tokens:["The best deals start with the",{node:s.jsx("span",{style:{fontStyle:"italic",color:"hsl(var(--c-accent))"},children:"best data."}),key:"best-data"}]}),s.jsx("p",{className:"tt-lead",style:{margin:"16px auto 32px",maxWidth:600},children:"xPharma is currently onboarding suppliers and buyers by invitation. Request early access to join the marketplace."}),s.jsxs(oe,{to:"/auth?signup=true",className:"xph-btn xph-btn-primary",style:{padding:"12px 22px",fontSize:14.5},children:["Request Early Access",s.jsx(Gn,{size:14})]})]})})})]})}function rke(){const e=qi();return s.jsxs(he,{children:[s.jsx(Js,{title:"Features — xPharma platform capabilities",description:"Verification, AI-powered positioning, valuation, and a curated buyer marketplace — the full xPharma toolkit for biotech BD.",path:"/features"}),s.jsxs("section",{style:{padding:"clamp(56px, 8vw, 88px) 0 clamp(40px, 6vw, 56px)",borderBottom:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-bg))",position:"relative",overflow:"hidden"},children:[s.jsx("div",{className:"xph-aurora"}),s.jsxs("div",{className:"xph-container",style:{textAlign:"center",maxWidth:760,margin:"0 auto",position:"relative",zIndex:1},children:[s.jsx(da,{y:12,duration:.5,children:s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-accent))"},children:"Platform capabilities"})}),s.jsx(Jv,{as:"h1",className:"tt-display-xl",style:{marginTop:14,marginBottom:18},tokens:["Built for",{node:s.jsx("span",{style:{fontStyle:"italic",color:"hsl(var(--c-accent))"},children:"pharma BD"}),key:"pharma-bd"}]}),s.jsx(Sn.p,{className:"tt-lead",initial:e?!1:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.7,delay:.45,ease:[.22,1,.36,1]},children:"Purpose-built tools that understand the language, workflow, and data structures of drug development — so verification, structuring, and presentation stop slowing transactions down."})]})]}),s.jsx("section",{style:{padding:"clamp(48px, 7vw, 80px) 0",background:"hsl(var(--c-surface))"},children:s.jsx("div",{className:"xph-container",children:s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"clamp(20px, 3vw, 28px)"},children:KY.map((t,n)=>{const r=t.icon,i=HY[t.palette];return s.jsx(da,{delay:n===0?0:.05,y:28,children:s.jsxs("article",{className:"xph-card xph-hover-lift",style:{padding:"clamp(24px, 4vw, 36px)",display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 320px), 1fr))",gap:"clamp(24px, 4vw, 40px)",alignItems:"flex-start"},children:[s.jsxs("div",{children:[s.jsx(Sn.span,{whileHover:e?void 0:{scale:1.08},transition:{type:"spring",stiffness:320,damping:18},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:40,height:40,borderRadius:8,background:i.bg,color:i.fg,marginBottom:16},children:s.jsx(r,{size:19})}),s.jsx("h2",{className:"tt-display-md",style:{marginBottom:12},children:t.title}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",lineHeight:1.6},children:t.description})]}),s.jsx(nP,{style:{padding:0,margin:0,display:"flex",flexDirection:"column",gap:12},staggerMs:70,initialDelayMs:120,children:t.bullets.map(a=>s.jsxs("span",{className:"tt-body",style:{display:"flex",gap:10,alignItems:"flex-start"},children:[s.jsx("span",{style:{width:18,height:18,borderRadius:4,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:3},children:s.jsx(Fr,{size:11})}),s.jsx("span",{style:{color:"hsl(var(--c-fg))"},children:a})]},a))})]})},t.id)})})})}),s.jsx("section",{style:{padding:"clamp(56px, 8vw, 88px) 0",background:"hsl(var(--c-bg))",borderTop:"1px solid hsl(var(--c-border))"},children:s.jsx("div",{className:"xph-container",style:{textAlign:"center",maxWidth:720,margin:"0 auto"},children:s.jsxs(da,{children:[s.jsx(Jv,{as:"h2",className:"tt-display-lg",trigger:"view",tokens:["See it on a",{node:s.jsx("span",{style:{fontStyle:"italic",color:"hsl(var(--c-accent))"},children:"real asset."}),key:"real-asset"}]}),s.jsx("p",{className:"tt-lead",style:{margin:"16px auto 32px",maxWidth:600},children:"xPharma is currently onboarding suppliers and buyers by invitation. Request access to see the platform with verified pre-clinical and clinical programs."}),s.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"center",flexWrap:"wrap"},children:[s.jsxs(oe,{to:"/auth?signup=true",className:"xph-btn xph-btn-primary",style:{padding:"12px 22px",fontSize:14.5}
713,children:["Request access",s.jsx(Gn,{size:14})]}),s.jsx(oe,{to:"/pricing",className:"xph-btn xph-btn-outline",style:{padding:"12px 22px",fontSize:14.5},children:"See pricing"})]})]})})})]})}function ike(){const e=qi();return s.jsxs(he,{children:[s.jsx(Js,{title:"Pricing — xPharma",description:"xPharma is in limited preview, available by invitation. Public launch and pricing details will be released soon.",path:"/pricing"}),s.jsxs("section",{style:{padding:"clamp(72px, 10vw, 120px) 0",background:"hsl(var(--c-bg))",position:"relative",overflow:"hidden"},children:[s.jsx("div",{className:"xph-aurora"}),s.jsxs("div",{className:"xph-container",style:{textAlign:"center",maxWidth:760,margin:"0 auto",position:"relative",zIndex:1},children:[s.jsx(da,{y:12,duration:.5,children:s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-accent))"},children:"Pricing"})}),s.jsx(Jv,{as:"h1",className:"tt-display-xl",style:{marginTop:14,marginBottom:18},tokens:["Currently in",{node:s.jsx("span",{style:{fontStyle:"italic",color:"hsl(var(--c-accent))"},children:"limited preview"}),key:"limited-preview"}]}),s.jsxs(Sn.p,{className:"tt-lead",style:{marginBottom:32},initial:e?!1:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.7,delay:.45,ease:[.22,1,.36,1]},children:[s.jsx("strong",{children:"xPharma is available by invitation only"})," due to high demand. We are processing waitlist applications and details regarding our public launch and pricing will be released at a later date."]}),s.jsx(Sn.div,{initial:e?!1:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.6,delay:.65,ease:[.22,1,.36,1]},children:s.jsxs(oe,{to:"/auth?signup=true",className:"xph-btn xph-btn-primary",style:{padding:"12px 22px",fontSize:14.5},children:["Request access",s.jsx(Gn,{size:14})]})})]})]})]})}const ske=e=>({id:e.id,name:e.name,location:e.location,verified:e.verified,assetsListed:e.assets_listed});function hS(){return Se({queryKey:["suppliers"],queryFn:async()=>{const{data:e,error:t}=await W.from("suppliers").select("*").order("name");if(t)throw console.error("Error fetching suppliers:",t),t;return e.map(ske)}})}const Nn={discovery:"Discovery","glp-tox":"GLP Tox","pre-ind":"Pre-IND","ind-filing":"IND Filing",clinical:"Clinical"},Zt={"small-molecule":"Small Molecule",antibody:"Antibody",adc:"ADC","cell-therapy":"Cell Therapy","gene-therapy":"Gene Therapy",peptide:"Peptide",rna:"RNA Therapeutics"},mb=["discovery","glp-tox","pre-ind","ind-filing","clinical"],$R={draft:"Draft",pending_review:"Pending Review",published:"Published",rejected:"Rejected"},b5={pending:"Pending",reviewed:"Reviewed",responded:"Responded"},YY={pending:"Pending",in_progress:"In Progress",verified:"Verified",failed:"Failed"},rP={admin:"Admin",scientific_lead:"Scientific Lead",legal_reviewer:"Legal Reviewer",business_development:"Business Development"},ea={discovery:"xph-stage-discovery","glp-tox":"xph-stage-glp","pre-ind":"xph-stage-preind","ind-filing":"xph-stage-ind",clinical:"xph-stage-clinical"};function ds(e){const t=e??0;return t>=1e9?`$${(t/1e9).toFixed(2)}B`:t>=1e6?`$${(t/1e6).toFixed(1)}M`:t>=1e3?`$${(t/1e3).toFixed(0)}K`:`$${t.toFixed(0)}`}function LR({asset:e,basePath:t="/pipeline",anonymized:n,isOwn:r,matchLabel:i,matchReason:a}){const o=n&&!r?"Undisclosed Asset":e.productName,l=n&&!r?"Undisclosed supplier":e.supplier.name,c=ea[e.stage];return s.jsxs(oe,{to:`${t}/${e.id}`,className:"bb-card",style:{background:"hsl(var(--c-card))",border:`1px solid ${r?"hsl(var(--c-positive-border))":"hsl(var(--c-border))"}`,boxShadow:r?"0 0 0 1px hsl(var(--c-positive-soft))":void 0,borderRadius:12,overflow:"hidden",cursor:"pointer",display:"flex",flexDirection:"column",textDecoration:"none",color:"inherit"},children:[s.jsxs("div",{style:{padding:"14px 16px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[e.origin&&s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,color:"hsl(var(--c-fg-subtle))",textTransform:"uppercase",letterSpacing:"0.06em"},children:e.origin}),s.jsx("span",{className:`xph-badge ${c}`,children:Nn[e.stage]}),r&&s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,color:"hsl(var(--c-positive-fg))",background:"hsl(var(--c-positive-soft))",border:"1px solid hsl(var(--c-positive-border))",borderRadius:4,padding:"2px 7px",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Your asset"}),i&&s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,color:"hsl(var(--c-accent))",background:"hsl(var(--c-accent-soft))",border:"1px solid hsl(var(--c-accent-border))",borderRadius:4,padding:"2px 7px",textTransform:"uppercase",letterSpacing:"0.04em"},children:i})]}),s.jsx("span",{className:"xph-btn xph-btn-ghost xph-btn-icon","aria-hidden":!0,style:{pointerEvents:"none",color:"hsl(var(--c-fg-muted))"},children:s.jsx(Wd,{size:14})})]}),s.jsxs("div",{style:{padding:"16px 16px 10px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12},children:[s.jsxs("div",{style:{minWidth:0},children:[s.jsx("div",{className:"tt-display-sm",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o}),s.jsxs("div",{className:"tt-mono-sm",style:{marginTop:2},children:[e.primaryTarget??"—"," · ",Zt[e.modality]]})]}),s.jsxs("div",{style:{textAlign:"right"},children:[s.jsx("div",{className:"tt-stat-lg",children:ds(e.estimatedNPV)}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:"Est. NPV"})]})]}),e.leadIndication&&s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:12,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.leadIndication}),a&&s.jsxs("div",{style:{marginTop:10,padding:"8px 10px",background:"hsl(var(--c-surface))",border:"1px solid hsl(var(--c-border))",borderRadius:6,fontSize:12,fontStyle:"italic",color:"hsl(var(--c-fg-muted))"},children:["“",a,"”"]}
713)]}),s.jsxs("div",{style:{marginTop:"auto",padding:"12px 16px",borderTop:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center",background:"hsl(var(--c-surface))"},children:[s.jsxs("div",{style:{display:"flex",gap:12,fontFamily:"var(--font-mono)",fontSize:11.5,color:"hsl(var(--c-fg-muted))",flexWrap:"wrap"},children:[s.jsxs("span",{children:[s.jsx(Na,{size:11,style:{verticalAlign:-1,marginRight:3}}),e.documentsCount," docs"]}),s.jsx("span",{style:{color:"hsl(var(--c-fg-subtle))"},children:"·"}),s.jsx("span",{children:l})]}),s.jsx(Ls,{size:14,style:{color:"hsl(var(--c-fg-subtle))"}})]})]})}function ce({className:e,...t}){return s.jsx("div",{className:ae("animate-pulse rounded-md bg-muted",e),...t})}function sl(e,t){const n=e.suppliers??{},r=(t??e.verification_steps??[]).map(i=>({id:i.id,name:i.name,description:i.description,status:i.status,completedAt:i.completed_at??void 0}));return{id:e.id,productName:e.product_name??"",primaryTarget:e.primary_target??null,modality:e.modality,leadIndication:e.lead_indication??null,stage:e.stage,origin:e.origin??null,innCode:e.inn_code??null,therapeuticArea:e.therapeutic_area??null,secondaryIndications:e.secondary_indications??[],mechanismOfAction:e.mechanism_of_action??null,currentStageDetails:e.current_stage_details??null,nextStepsRequired:e.next_steps_required??[],preclinicalEfficacySummary:e.preclinical_efficacy_summary??null,toxicologySummary:e.toxicology_summary??null,pharmacokineticsSummary:e.pharmacokinetics_summary??null,biomarkerStrategy:e.biomarker_strategy??null,drugSubstanceDescription:e.drug_substance_description??null,drugProductForm:e.drug_product_form??null,manufacturingSite:e.manufacturing_site??null,cmcStatus:e.cmc_status??null,stabilitySummary:e.stability_summary??null,clinicalPhase:e.clinical_phase??null,clinicalTrialId:e.clinical_trial_id??null,patientPopulation:e.patient_population??null,primaryEndpoints:e.primary_endpoints??null,clinicalResultsSummary:e.clinical_results_summary??null,regulatoryDesignation:e.regulatory_designation??null,regulatoryFilings:e.regulatory_filings??null,orphanDrugStatus:e.orphan_drug_status??!1,fastTrackStatus:e.fast_track_status??!1,competitiveLandscape:e.competitive_landscape??null,differentiationSummary:e.differentiation_summary??null,marketSizeEstimate:e.market_size_estimate??null,peakSalesEstimate:e.peak_sales_estimate??null,targetRegions:e.target_regions??[],patentSummary:e.patent_summary??null,patentExpiry:e.patent_expiry??null,freedomToOperate:e.freedom_to_operate??null,unmetMedicalNeed:e.unmet_medical_need??null,strategicRationale:e.strategic_rationale??null,inVitroPotency:e.in_vitro_potency??null,costOfGoods:e.cost_of_goods??null,safetyTolerability:e.safety_tolerability??null,secondaryEndpoints:e.secondary_endpoints??null,clinicalDifferentiation:e.clinical_differentiation??null,barriersToEntry:e.barriers_to_entry??null,commercializationModel:e.commercialization_model??null,lifeCycleManagement:e.life_cycle_management??null,targetPatientPopulation:e.target_patient_population??null,treatmentPenetrationPct:e.treatment_penetration_pct??null,annualTreatmentPrice:e.annual_treatment_price??null,yearsOfTreatment:e.years_of_treatment??null,targetNovelty:e.target_novelty??null,diseasePrevalence:e.disease_prevalence??null,clinicalTrialOutcome:e.clinical_trial_outcome??null,trialDesign:e.trial_design??null,breakthroughTherapy:e.breakthrough_therapy??!1,priorApprovalOtherIndication:e.prior_approval_other_indication??!1,sponsorPriorApprovals:e.sponsor_prior_approvals??null,sponsorTaTrackRecord:e.sponsor_ta_track_record??null,supplier:{id:n.id??"",name:n.name??"",location:n.location??"",verified:n.verified??!1,assetsListed:n.assets_listed??0},verificationStatus:e.verification_status,verificationSteps:r,estimatedNPV:e.estimated_npv??0,listedAt:e.listed_at,updatedAt:e.updated_at??void 0,documentsCount:e.documents_count??0,assetStatus:e.asset_status||"published",assetRejectionReason:e.asset_rejection_reason??null,submittedBy:e.submitted_by??null,submitterEmail:e._submitterEmail??null,submitterUserId:e._submitterUserId??null}}function ag(){return Se({queryKey:["pharma-assets"],queryFn:async()=>{const{data:e,error:t}=await W.from("pharma_assets").select(`
714          *,
715          suppliers (*),
716          verification_steps (*)
717        `).order("listed_at",{ascending:!1});if(t)throw console.error("Error fetching pharma assets:",t),t;return e.map(n=>sl(n))}})}function fS(e){return Se({queryKey:["pharma-asset",e],queryFn:async()=>{const{data:t,error:n}=await W.from("pharma_assets").select(`
718          *,
719          suppliers (*),
720          verification_steps (*)
721        `).eq("id",e).maybeSingle();if(n)throw console.error("Error fetching pharma asset:",n),n;return t?sl(t):null},enabled:!!e})}const ake=["All","Oncology","Inflammation","Cardiometabolic","Neuro","Rare"];function oke({active:e,label:t,onClick:n}){return s.jsx("button",{type:"button",onClick:n,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px",borderRadius:9999,background:e?"hsl(var(--c-ink))":"hsl(var(--c-card))",color:e?"hsl(var(--c-ink-inverse))":"hsl(var(--c-fg))",border:`1px solid ${e?"hsl(var(--c-ink))":"hsl(var(--c-border))"}`,fontSize:13,fontWeight:500,cursor:"pointer",transition:"all 150ms"},children:t})}
721function lke(){const[e,t]=il(),[n,r]=x.useState("grid"),[i,a]=x.useState(""),[o,l]=x.useState("all"),[c,u]=x.useState("all"),[d,h]=x.useState(()=>e.get("supplier")||"all"),[f,p]=x.useState("All"),{data:m=[],isLoading:g,error:y}=ag(),{data:b=[]}=hS();x.useEffect(()=>{const _=e.get("supplier");d!=="all"&&d!==_?(e.set("supplier",d),t(e,{replace:!0})):d==="all"&&_&&(e.delete("supplier"),t(e,{replace:!0}))},[d,e,t]);const v=x.useMemo(()=>m.filter(_=>{const j=_.productName.toLowerCase().includes(i.toLowerCase())||(_.primaryTarget||"").toLowerCase().includes(i.toLowerCase())||(_.leadIndication||"").toLowerCase().includes(i.toLowerCase()),S=o==="all"||_.stage===o,k=c==="all"||_.modality===c,N=d==="all"||_.supplier.id===d,T=f==="All"||(_.therapeuticArea??"").toLowerCase().includes(f.toLowerCase())||(_.leadIndication??"").toLowerCase().includes(f.toLowerCase());return j&&S&&k&&N&&T}),[m,i,o,c,d,f]),w=(o!=="all"?1:0)+(c!=="all"?1:0)+(d!=="all"?1:0);return y?s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"32px 24px"},children:s.jsx("div",{className:"xph-card",style:{padding:48,textAlign:"center"},children:s.jsx("p",{style:{color:"hsl(var(--c-negative-fg))"},children:"Error loading assets. Please try again later."})})})}):s.jsxs(he,{children:[s.jsx(Js,{title:"Pipeline marketplace — xPharma",description:"Browse verified biotech assets across modalities, indications, and stages — diligence-ready listings curated for licensing and acquisition.",path:"/pipeline",noindex:!0,jsonLd:{"@context":"https://schema.org","@type":"CollectionPage",name:"xPharma asset marketplace",description:"Verified biotech assets available for licensing and acquisition.",url:"https://xpharma.ai/pipeline"}}),s.jsxs("div",{style:{background:"hsl(var(--c-surface))"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))",padding:"20px 0"},children:s.jsxs("div",{className:"xph-container",style:{display:"flex",flexDirection:"column",gap:16},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"end",flexWrap:"wrap",gap:16},children:[s.jsxs("div",{children:[s.jsx("h1",{className:"tt-display-md",children:"Marketplace"}),s.jsxs("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:4},children:[m.length," verified assets across all development stages"]})]}),s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[s.jsxs("div",{className:"xph-search-wrap",style:{width:320},children:[s.jsx(Ea,{size:14}),s.jsx("input",{className:"xph-input",value:i,onChange:_=>a(_.target.value),placeholder:"Search target, modality, indication…"})]}),s.jsxs("select",{value:o,onChange:_=>l(_.target.value),className:"xph-input",style:{width:160},children:[s.jsx("option",{value:"all",children:"All stages"}),mb.map(_=>s.jsx("option",{value:_,children:Nn[_]},_))]}),s.jsxs("select",{value:c,onChange:_=>u(_.target.value),className:"xph-input",style:{width:160},children:[s.jsx("option",{value:"all",children:"All modalities"}),Object.entries(Zt).map(([_,j])=>s.jsx("option",{value:_,children:j},_))]}),s.jsxs("select",{value:d,onChange:_=>h(_.target.value),className:"xph-input",style:{width:160},children:[s.jsx("option",{value:"all",children:"All suppliers"}),b.map(_=>s.jsx("option",{value:_.id,children:_.name},_.id))]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",disabled:!0,children:[s.jsx(jH,{size:13}),"Filters · ",w]})]})]}),s.jsx("div",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:ake.map(_=>s.jsx(oke,{label:_,active:f===_,onClick:()=>p(_)},_))})]})}),s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:20},children:[s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",fontFamily:"var(--font-mono)",fontSize:12,color:"hsl(var(--c-fg-muted))",flexWrap:"wrap"},children:[s.jsx("span",{style:{textTransform:"uppercase",letterSpacing:"0.06em",color:"hsl(var(--c-fg-subtle))"},children:"Showing"}),s.jsxs("span",{style:{color:"hsl(var(--c-fg))",fontWeight:600},children:[v.length," of ",m.length]})]}),s.jsxs("div",{style:{display:"flex",gap:4,padding:3,background:"hsl(var(--c-surface-2))",borderRadius:6},children:[s.jsx("button",{type:"button",onClick:()=>r("grid"),className:"xph-btn xph-btn-sm",style:{background:n==="grid"?"hsl(var(--c-card))":"transparent",boxShadow:n==="grid"?"0 1px 2px hsl(222 25% 9% / 0.08)":"none"},"aria-label":"Grid view",children:s.jsx(kH,{size:13})}),s.jsx("button",{type:"button",onClick:()=>r("table"),className:"xph-btn xph-btn-sm",style:{background:n==="table"?"hsl(var(--c-card))":"transparent",boxShadow:n==="table"?"0 1px 2px hsl(222 25% 9% / 0.08)":"none"},"aria-label":"Table view",children:s.jsx(NH,{size:13})})]})]}),g&&s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:16},children:[...Array(6)].map((_,j)=>s.jsxs("div",{className:"xph-card",style:{padding:18},children:[s.jsx(ce,{className:"h-6 w-3/4 mb-4"}),s.jsx(ce,{className:"h-4 w-1/2 mb-2"}),s.jsx(ce,{className:"h-4 w-2/3 mb-4"}),s.jsx(ce,{className:"h-8 w-24"})]},j))}),!g&&n==="grid"&&s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:v.map(_=>s.jsx(LR,{asset:_},_.id))}),!g&&n==="table"&&s.jsx("div",{className:"xph-card",style:{padding:0,overflow:"hidden"},children:s.jsxs("table",{className:"xph-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Asset"}),s.jsx("th",{children:"Target"}),s.jsx("th",{children:"Stage"}),s.jsx("th",{children:"Sponsor"}),s.jsx("th",{children:"Docs"}),s.jsx("th",{style:{textAlign:"right"},children:"Est. NPV"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:v.map(_=>s.jsxs("tr",{children:[s.jsx("td",{style:{fontWeight:600,color:"hsl(var(--c-ink))"},children:s.jsx(oe,{to:`/pipeline/${_.id}`,style:{color:"inherit",textDecoration:"none"},children:_.productName})}),s.jsx("td",{style:{fontFamily:"var(--font-mono)",fontSize:12},children:_.primaryTarget??"—"}),s.jsx("td",{children:s.jsx("span",{className:`xph-badge ${ea[_.stage]}`,children:Nn[_.stage]})}),s.jsx("td",{style:{color:"hsl(var(--c-fg-muted))"},children:_.supplier.name}),s.jsx("td",{children:_.documentsCount}),s.jsx("td",{style:{textAlign:"right",fontWeight:600},children:ds(_.estimatedNPV)}),s.jsx("td",{style:{textAlign:"right"},children:s.jsx(oe,{to:`/pipeline/${_.id}`,className:"xph-btn xph-btn-ghost xph-btn-sm","aria-label":"Open",children:s.jsx(Ls,{size:14})})})]},_.id))})]})}),!g&&v.length===0&&s.jsxs("div",{className:"xph-card",style:{padding:48,textAlign:"center"},children:[s.jsx("p",{style:{color:"hsl(var(--c-fg-muted))"},children:"No assets match your filters"}),s.jsx("button",{type:"button",onClick:()=>{a(""),l("all"),u("all"),h("all"),p("All")},className:"xph-btn xph-btn-ghost xph-btn-sm",style:{marginTop:12},children:"Clear filters"})]})]})]})]})}const vi=[{key:"product_identity",label:"Product Identity",icon:"FlaskConical",fields:[{key:"product_name",label:"Product Name",type:"text",requiredForPublish:!0,placeholder:"e.g., XPH-001"},{key:"modality",label:"Modality",type:"select",requiredForPublish:!0,options:[{value:"small-molecule",label:"Small Molecule"},{value:"antibody",label:"Antibody"},{value:"adc",label:"ADC"},{value:"cell-therapy",label:"Cell Therapy"},{value:"gene-therapy",label:"Gene Therapy"},{value:"peptide",label:"Peptide"},{value:"rna",label:"RNA Therapeutics"}]},{key:"lead_indication",label:"Lead Indication",type:"text",requiredForPublish:!0,placeholder:"e.g., Non-Small Cell Lung Cancer"},{key:"primary_target",label:"Primary Target",type:"text",requiredForPublish:!0,placeholder:"e.g., HER2"},{key:"mechanism_of_action",label:"Mechanism of Action",type:"textarea",requiredForPublish:!0,placeholder:"Describe how the asset works..."},{key:"unmet_medical_need",label:"Unmet Medical Need",type:"textarea",requiredForPublish:!0,placeholder:"Describe the unmet medical need this asset addresses..."},{key:"strategic_rationale",label:"Strategic Rationale",type:"textarea",requiredForPublish:!1,placeholder:"Why is this asset strategically valuable?"},{key:"therapeutic_area",label:"Therapeutic Area",type:"text",requiredForPublish:!1,placeholder:"e.g., Oncology"},{key:"secondary_indications",label:"Secondary Indications",type:"array",requiredForPublish:!1,placeholder:"Add secondary indications..."},{key:"inn_code",label:"INN Code",type:"text",requiredForPublish:!1,placeholder:"International Nonproprietary Name"},{key:"origin",label:"Origin",type:"text",requiredForPublish:!1,placeholder:"e.g., In-house discovery"},{key:"target_novelty",label:"Target Novelty",type:"select",requiredForPublish:!1,description:"Used by advanced valuation model",options:[{value:"first_in_class",label:"First in Class"},{value:"best_in_class",label:"Best in Class"},{value:"me_too",label:"Me-Too"},{value:"off_patent",label:"Off-Patent / 505(b)(2)"},{value:"biosimilar",label:"Biosimilar"}]},{key:"disease_prevalence",label:"Disease Prevalence",type:"select",requiredForPublish:!1,description:"Used by advanced valuation model",options:[{value:"ultra_rare",label:"Ultra Rare"},{value:"rare",label:"Rare"},{value:"uncommon",label:"Uncommon"},{value:"common",label:"Common"},{value:"highly_prevalent",label:"Highly Prevalent"}]}]},{key:"preclinical",label:"Preclinical",icon:"Microscope",fields:[{key:"in_vitro_potency",label:"In Vitro Potency",type:"textarea",requiredForPublish:!0,placeholder:"Summarize in vitro potency data..."},{key:"preclinical_efficacy_summary",label:"Preclinical Efficacy",type:"textarea",requiredForPublish:!0,placeholder:"Summarize preclinical efficacy data..."},{key:"toxicology_summary",label:"Toxicology Summary",type:"textarea",requiredForPublish:!0,placeholder:"Summarize toxicology f
721indings..."},{key:"pharmacokinetics_summary",label:"Pharmacokinetics (PK)",type:"textarea",requiredForPublish:!1,placeholder:"Summarize PK profile..."},{key:"biomarker_strategy",label:"Biomarker Strategy",type:"textarea",requiredForPublish:!1,placeholder:"Describe biomarker strategy..."}]},{key:"cmc",label:"CMC",icon:"Factory",fields:[{key:"drug_substance_description",label:"Drug Substance",type:"textarea",requiredForPublish:!0,placeholder:"Describe the drug substance..."},{key:"drug_product_form",label:"Drug Product Form",type:"text",requiredForPublish:!0,placeholder:"e.g., Lyophilized powder for injection"},{key:"cost_of_goods",label:"Cost of Goods",type:"text",requiredForPublish:!1,placeholder:"Estimated COGS..."},{key:"manufacturing_site",label:"Manufacturing Site",type:"text",requiredForPublish:!1,placeholder:"e.g., Basel, Switzerland"},{key:"cmc_status",label:"CMC Status",type:"textarea",requiredForPublish:!1,placeholder:"Current CMC development status..."},{key:"stability_summary",label:"Stability Summary",type:"textarea",requiredForPublish:!1,placeholder:"Summarize stability data..."}]},{key:"clinical",label:"Clinical",icon:"Stethoscope",fields:[{key:"stage",label:"Development Stage",type:"select",requiredForPublish:!0,options:[{value:"discovery",label:"Discovery"},{value:"glp-tox",label:"GLP Tox"},{value:"pre-ind",label:"Pre-IND"},{value:"ind-filing",label:"IND Filing"},{value:"clinical",label:"Clinical"}]},{key:"clinical_phase",label:"Clinical Phase",type:"text",requiredForPublish:!1,placeholder:"e.g., Phase 1b/2"},{key:"primary_endpoints",label:"Primary Endpoints",type:"textarea",requiredForPublish:!1,placeholder:"Describe primary endpoints..."},{key:"secondary_endpoints",label:"Secondary Endpoints",type:"textarea",requiredForPublish:!1,placeholder:"Describe secondary endpoints..."},{key:"safety_tolerability",label:"Safety & Tolerability",type:"textarea",requiredForPublish:!1,placeholder:"Summarize safety profile..."},{key:"clinical_differentiation",label:"Clinical Differentiation",type:"textarea",requiredForPublish:!1,placeholder:"How does this differ from competitors clinically?"},{key:"clinical_trial_id",label:"Clinical Trial ID",type:"text",requiredForPublish:!1,placeholder:"e.g., NCT12345678"},{key:"patient_population",label:"Patient Population",type:"text",requiredForPublish:!1,placeholder:"Describe target patient population..."},{key:"clinical_results_summary",label:"Clinical Results Summary",type:"textarea",requiredForPublish:!1,placeholder:"Summarize clinical results..."},{key:"clinical_trial_outcome",label:"Clinical Trial Outcome",type:"select",requiredForPublish:!1,description:"Used by advanced valuation model",options:[{value:"positive",label:"Positive"},{value:"mixed",label:"Mixed"},{value:"negative",label:"Negative"},{value:"pending",label:"Pending"}]},{key:"trial_design",label:"Trial Design",type:"select",requiredForPublish:!1,description:"Used by advanced valuation model",options:[{value:"double_blind",label:"Double Blind"},{value:"open_label",label:"Open Label"},{value:"adaptive",label:"Adaptive"},{value:"basket",label:"Basket"}]}]},{key:"regulatory",label:"Regulatory",icon:"Scale",fields:[{key:"regulatory_designation",label:"Regulatory Designation",type:"text",requiredForPublish:!1,placeholder:"e.g., Breakthrough Therapy Designation"},{key:"regulatory_filings",label:"Regulatory Filings",type:"textarea",requiredForPublish:!1,placeholder:"List any regulatory filings..."},{key:"orphan_drug_status",label:"Orphan Drug Status",type:"boolean",requiredForPublish:!1},{key:"fast_track_status",label:"Fast Track Status",type:"boolean",requiredForPublish:!1},{key:"breakthrough_therapy",label:"Breakthrough Therapy Designation",type:"boolean",requiredForPublish:!1,description:"Used by advanced valuation model"},{key:"prior_approval_other_indication",label:"Drug approved for another indication",type:"boolean",requiredForPublish:!1,description:"Used by advanced valuation model"},{key:"sponsor_prior_approvals",label:"Sponsor Prior FDA Approvals",type:"number",requiredForPublish:!1,placeholder:"e.g., 3",description:"Used by advanced valuation model",min:0,step:1},{key:"sponsor_ta_track_record",label:"Sponsor Successful Transitions in This TA",type:"number",requiredForPublish:!1,placeholder:"e.g., 1",description:"Used by advanced valuation model",min:0,step:1}]},{key:"competitive",label:"Competitive",icon:"Swords",fields:[{key:"competitive_landscape",label:"Competitive Landscape",type:"textarea",requiredForPublish:!0,placeholder:"Describe 
721key competitors and their assets..."},{key:"differentiation_summary",label:"Differentiation Summary",type:"textarea",requiredForPublish:!0,placeholder:"What differentiates this asset?"},{key:"barriers_to_entry",label:"Barriers to Entry",type:"textarea",requiredForPublish:!1,placeholder:"Describe barriers to entry for competitors..."}]},{key:"commercial",label:"Commercial",icon:"TrendingUp",fields:[{key:"market_size_estimate",label:"Market Size Estimate",type:"text",requiredForPublish:!0,placeholder:"e.g., $2.5B addressable market"},{key:"peak_sales_estimate",label:"Peak Sales Estimate",type:"text",requiredForPublish:!0,placeholder:"e.g., $800M peak annual sales"},{key:"target_regions",label:"Target Regions",type:"array",requiredForPublish:!1,placeholder:"Add target regions..."},{key:"commercialization_model",label:"Commercialization Model",type:"textarea",requiredForPublish:!1,placeholder:"Describe go-to-market strategy..."},{key:"life_cycle_management",label:"Life Cycle Management",type:"textarea",requiredForPublish:!1,placeholder:"Plans for life cycle management..."},{key:"target_patient_population",label:"Target Patient Population",type:"number",requiredForPublish:!1,placeholder:"e.g., 50000",description:"Used by advanced valuation model (bottom-up revenue)",min:0},{key:"treatment_penetration_pct",label:"Expected Market Penetration (%)",type:"number",requiredForPublish:!1,placeholder:"e.g., 25",description:"Used by advanced valuation model (bottom-up revenue)",min:0,max:100,step:.1},{key:"annual_treatment_price",label:"Annual Treatment Price (USD)",type:"number",requiredForPublish:!1,placeholder:"e.g., 150000",description:"Used by advanced valuation model (bottom-up revenue)",min:0},{key:"years_of_treatment",label:"Years of Treatment",type:"number",requiredForPublish:!1,placeholder:"e.g., 2.5",description:"Used by advanced valuation model (bottom-up revenue)",min:0,step:.1}]},{key:"ip",label:"IP",icon:"Shield",fields:[{key:"patent_summary",label:"Patent Summary",type:"textarea",requiredForPublish:!0,placeholder:"Summarize patent portfolio..."},{key:"patent_expiry",label:"Patent Expiry",type:"text",requiredForPublish:!1,placeholder:"e.g., 2038"},{key:"freedom_to_operate",label:"Freedom to Operate",type:"textarea",requiredForPublish:!1,placeholder:"Summarize FTO analysis..."}]}];function Fj(e,t){var n,r;if(!t)return null;for(const i of vi){const a=i.fields.find(o=>o.key===e);if(a)return((r=(n=a.options)==null?void 0:n.find(o=>o.value===t))==null?void 0:r.label)??t}return t}function wu(e){const t={},n=new Set(vi.flatMap(i=>i.fields.map(a=>a.key))),r={productName:"product_name",primaryTarget:"primary_target",modality:"modality",leadIndication:"lead_indication",stage:"stage",origin:"origin",innCode:"inn_code",therapeuticArea:"therapeutic_area",secondaryIndications:"secondary_indications",mechanismOfAction:"mechanism_of_action",unmetMedicalNeed:"unmet_medical_need",strategicRationale:"strategic_rationale",preclinicalEfficacySummary:"preclinical_efficacy_summary",toxicologySummary:"toxicology_summary",pharmacokineticsSummary:"pharmacokinetics_summary",biomarkerStrategy:"biomarker_strategy",inVitroPotency:"in_vitro_potency",drugSubstanceDescription:"drug_substance_description",drugProductForm:"drug_product_form",costOfGoods:"cost_of_goods",manufacturingSite:"manufacturing_site",cmcStatus:"cmc_status",stabilitySummary:"stability_summary",clinicalPhase:"clinical_phase",primaryEndpoints:"primary_endpoints",secondaryEndpoints:"secondary_endpoints",safetyTolerability:"safety_tolerability",clinicalDifferentiation:"clinical_differentiation",clinicalTrialId:"clinical_trial_id",patientPopulation:"patient_population",clinicalResultsSummary:"clinical_results_summary",regulatoryDesignation:"regulatory_designation",regulatoryFilings:"regulatory_filings",orphanDrugStatus:"orphan_drug_status",fastTrackStatus:"fast_track_status",competitiveLandscape:"competitive_landscape",differentiationSummary:"differentiation_summary",barriersToEntry:"barriers_to_entry",marketSizeEstimate:"market_size_estimate",peakSalesEstimate:"peak_sales_estimate",targetRegions:"target_regions",commercializationModel:"
721commercialization_model",lifeCycleManagement:"life_cycle_management",patentSummary:"patent_summary",patentExpiry:"patent_expiry",freedomToOperate:"freedom_to_operate",targetPatientPopulation:"target_patient_population",treatmentPenetrationPct:"treatment_penetration_pct",annualTreatmentPrice:"annual_treatment_price",yearsOfTreatment:"years_of_treatment",targetNovelty:"target_novelty",diseasePrevalence:"disease_prevalence",clinicalTrialOutcome:"clinical_trial_outcome",trialDesign:"trial_design",breakthroughTherapy:"breakthrough_therapy",priorApprovalOtherIndication:"prior_approval_other_indication",sponsorPriorApprovals:"sponsor_prior_approvals",sponsorTaTrackRecord:"sponsor_ta_track_record"};for(const[i,a]of Object.entries(r))n.has(a)&&(t[a]=e[i]);return t}vi.flatMap(e=>e.fields.filter(t=>t.requiredForPublish).map(t=>t.key));function Qp(e){const t=vi.map(i=>{const a=i.fields.filter(l=>l.requiredForPublish),o=a.filter(l=>{const c=e[l.key];return!(c==null||c===""||Array.isArray(c)&&c.length===0)}).length;return{key:i.key,label:i.label,filled:o,total:a.length}}),n=t.reduce((i,a)=>i+a.filled,0),r=t.reduce((i,a)=>i+a.total,0);return{filled:n,total:r,percent:r>0?Math.round(n/r*100):0,perCategory:t}}function QY(e){const t=wu(e);let n=0,r=0;return{categories:vi.map(o=>{const l=o.fields.map(c=>{const u=t[c.key],d=u==null?!1:typeof u=="string"?u.trim()!=="":Array.isArray(u)?u.length>0:typeof u=="boolean"?!0:typeof u=="number"?Number.isFinite(u):!!u,h=(()=>{if(u==null)return"—";if(Array.isArray(u))return u.length===0?"—":u.join(", ");if(typeof u=="boolean")return u?"Yes":"No";if(typeof u=="number")return String(u);const p=String(u).trim();return p===""?"—":p})(),f=d?"src":"gap";return d?n+=1:r+=1,{fieldKey:c.key,label:c.label,value:h,quality:f}});return{label:o.label,rows:l}}),counts:{sourced:n,partial:0,gap:r}}}function XY({asset:e,highlightedFieldKeys:t}){const n=x.useMemo(()=>QY(e),[e]),r=t??new Set;return s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"16px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs("div",{children:[s.jsxs("div",{className:"eyebrow",children:["Ontology · ",n.categories.reduce((i,a)=>i+a.rows.length,0)," fields ·"," ",n.categories.length," categories"]}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:4},children:"Structured asset profile"})]}),s.jsxs("div",{style:{display:"flex",gap:14,fontFamily:"var(--font-mono)",fontSize:11.5},children:[s.jsxs("span",{children:[s.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:2,background:"hsl(var(--c-positive))",marginRight:6,verticalAlign:1}}),n.counts.sourced," sourced"]}),s.jsxs("span",{children:[s.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:2,background:"hsl(var(--c-warning))",marginRight:6,verticalAlign:1}}),n.counts.partial," partial"]}),s.jsxs("span",{children:[s.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:2,background:"hsl(var(--c-negative))",marginRight:6,verticalAlign:1}}),n.counts.gap," gaps"]})]})]}),n.categories.map(i=>s.jsxs("div",{children:[s.jsx("div",{style:{padding:"10px 16px",background:"hsl(var(--c-surface))",fontFamily:"var(--font-mono)",fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.06em",color:"hsl(var(--c-fg-muted))",borderTop:"1px solid hsl(var(--c-border))",borderBottom:"1px solid hsl(var(--c-border))"},children:i.label}),i.rows.map(a=>{const o=a.quality==="gap"?"hsl(var(--c-negative))":a.quality==="partial"?"hsl(var(--c-warning))":"hsl(var(--c-positive))",l=r.has(a.fieldKey);return s.jsxs("div",{style:{padding:"10px 14px",borderBottom:"1px solid hsl(var(--c-border))",display:"grid",gridTemplateColumns:"180px minmax(0, 1fr) 28px",gap:12,alignItems:"start",fontSize:13.5,borderLeft:l?"3px solid hsl(var(--c-accent))":void 0,background:l?"hsl(var(--c-accent) / 0.04)":void 0},children:[s.jsxs("div",{style:{color:"hsl(var(--c-fg-muted))",fontSize:13},children:[a.label,l&&s.jsx("span",{className:"tt-mono-sm",style:{marginLeft:6,padding:"1px 6px",borderRadius:3,background:"hsl(var(--c-accent) / 0.15)",color:"hsl(var(--c-accent))",fontSize:10,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Changed"})]}),s.jsx("div",{style:{color:a.quality==="gap"?"hsl(var(--c-fg-subtle))":"hsl(var(--c-ink))",whiteSpace:"normal",wordBreak:"break-word"},children:a.value}),s.jsx("div",{style:{width:8,height:8,borderRadius:2,background:o,justifySelf:"end"}})]},a.label)})]},i.label))]})}function w5({pct:e}){const n=2*Math.PI*22;return s.jsxs("svg",{width:"56",height:"56",viewBox:"0 0 56 56",children:[s.jsx("circle",{cx:"28",cy:"28",r:22,fill:"none",stroke:"hsl(var(--c-surface-2))",strokeWidth:"4"}),s.jsx("circle",{cx:"28",cy:"28",r:22,fill:"none",stroke:"hsl(var(--c-accent))",strokeWidth:"4",strokeDasharray:n,strokeDashoffset:n*(1-e/100),strokeLinecap:"round",transform:"rotate(-90 28 28)"}),s.jsxs("text",{x:"28",y:"32",textAnchor:"middle",fontFamily:"var(--font-display)",fontSize:"13",fontWeight:"600",fill:"hsl(var(--c-ink))",children:[e,"%"]})]})}function cke(){var h;const{id:e}=Zs(),{data:t,isLoading:n,error:r}=fS(e||""),i=x.useMemo(()=>t?QY(t):null,[t]),a=x.useMemo(()=>
721{if(!t)return 0;const f=wu(t);return Qp(f).percent},[t]);if(n)return s.jsx(he,{children:s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px"},children:[s.jsx(ce,{className:"h-8 w-48 mb-6"}),s.jsxs("div",{className:"xph-card",style:{padding:24},children:[s.jsx(ce,{className:"h-6 w-3/4 mb-4"}),s.jsx(ce,{className:"h-4 w-1/2 mb-2"}),s.jsx(ce,{className:"h-32 w-full"})]})]})});if(r||!t)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"32px 24px"},children:s.jsxs("div",{className:"xph-card",style:{padding:48,textAlign:"center"},children:[s.jsx("h2",{style:{fontFamily:"var(--font-display)",fontSize:22,fontWeight:600,marginBottom:8},children:"Asset not found"}),s.jsx("p",{style:{color:"hsl(var(--c-fg-muted))",marginBottom:16},children:"The requested asset could not be found."}),s.jsxs(oe,{to:"/pipeline",className:"xph-btn xph-btn-primary",children:[s.jsx(Wt,{size:14}),"Back to marketplace"]})]})})});const o=ea[t.stage],l=ds(t.estimatedNPV),c=[["Modality",Zt[t.modality],t.therapeuticArea??"—"],["Stage",Nn[t.stage],t.clinicalPhase??"Pipeline"],["Indication",t.leadIndication??"—",t.unmetMedicalNeed?"Unmet need on file":"—"],["Documents",String(t.documentsCount),"in data room"],["Listed",new Date(t.listedAt).toLocaleDateString("en-US",{month:"short",year:"numeric"}),"verified supplier"]],u=`${t.productName} — ${Nn[t.stage]} ${Zt[t.modality]} · xPharma`.slice(0,60),d=(t.differentiationSummary||`${t.productName}: ${Zt[t.modality]} for ${t.leadIndication??"pipeline indication"} at ${Nn[t.stage]}. Verified asset on xPharma.`).slice(0,158);return s.jsxs(he,{children:[s.jsx(Js,{title:u,description:d,path:`/pipeline/${t.id}`,noindex:!0,jsonLd:{"@context":"https://schema.org","@type":"Product",name:t.productName,description:d,category:t.therapeuticArea??"Biotech asset",manufacturer:{"@type":"Organization",name:t.supplier.name}}}),s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))"},children:s.jsxs("div",{className:"xph-container",style:{padding:"12px 24px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,flexWrap:"wrap"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,fontSize:13,color:"hsl(var(--c-fg-muted))",flexWrap:"wrap"},children:[s.jsx(oe,{to:"/pipeline",style:{color:"hsl(var(--c-fg-muted))",textDecoration:"none"},children:"Marketplace"}),s.jsx(Us,{size:12}),s.jsx("span",{children:t.primaryTarget??"—"}),s.jsx(Us,{size:12}),s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:t.productName})]}),s.jsx("div",{style:{display:"flex",gap:8},children:s.jsxs(oe,{to:`/valuation?asset=${t.id}`,className:"xph-btn xph-btn-primary xph-btn-sm",children:[s.jsx(EH,{size:13}),"View valuation",s.jsx(Gn,{size:13})]})})]})}),s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px 24px"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",gap:24,flexWrap:"wrap"},children:[s.jsxs("div",{style:{minWidth:0},children:[s.jsxs("div",{className:"eyebrow",children:[t.primaryTarget??"—"," · ",((h=t.leadIndication)==null?void 0:h.toLowerCase())??"pipeline asset"," ·"," ",Zt[t.modality].toLowerCase()]}),s.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:16,marginTop:8,flexWrap:"wrap"},children:[s.jsx("h1",{className:"tt-display-lg",children:t.productName}),s.jsxs("span",{className:"tt-mono-sm",style:{fontSize:13},children:[t.supplier.name," · ",t.supplier.location]}),s.jsx("span",{className:`xph-badge ${o}`,children:Nn[t.stage]}),t.verificationStatus==="verified"&&s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-positive-fg))",background:"hsl(var(--c-positive-soft))",border:"1px solid hsl(var(--c-positive-border))",borderRadius:4,padding:"3px 8px",letterSpacing:"0.04em",textTransform:"uppercase"},children:[s.jsx(Fr,{size:11})," Verified"]})]}),t.differentiationSummary&&s.jsx("p",{className:"tt-lead",style:{maxWidth:720,marginTop:16},children:t.differentiationSummary})]}),s.jsxs("div",{style:{display:"flex",gap:28,alignItems:"center"},children:[s.jsx(w5,{pct:a}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Estimated NPV"}),s.jsx("div",{className:"tt-stat-xl",style:{marginTop:6},children:l}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:4},children:"Risk-adjusted P50"})]})]})]}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, minmax(0, 1fr))",gap:12,marginTop:28},children:c.map(([f,p,m])=>s.jsxs("div",{className:"xph-card",style:{padding:"14px 16px"},children:[s.jsx("div",{className:"eyebrow",children:f}),s.jsx("div",{className:"tt-stat-md",style:{marginTop:6,overflow:"hidden",textOverflow:"ellipsis"},children:p}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:3},children:m})]},f))})]}),s.jsxs("div",{className:"xph-container",style:{padding:"0 24px 64px",display:"grid",gridTemplateColumns:"minmax(0, 1.6fr) minmax(0, 1fr)",gap:16},children:[s.jsx(XY,{asset:t}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,position:"sticky",top:80,al
721ignSelf:"flex-start"},children:[s.jsxs("div",{className:"xph-card",style:{padding:0},children:[s.jsxs("div",{style:{padding:"14px 16px",borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{className:"eyebrow",children:"Profile completeness"}),s.jsx("div",{className:"tt-display-sm",style:{fontSize:15,marginTop:4},children:"Field coverage at a glance"})]}),s.jsxs("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16},children:[s.jsx(w5,{pct:a}),s.jsxs("div",{children:[s.jsxs("div",{className:"tt-stat-md",children:[a,"%"]}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:"sourced"})]})]}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[s.jsxs("div",{style:{padding:"10px 12px",background:"hsl(var(--c-positive-soft))",border:"1px solid hsl(var(--c-positive-border))",borderRadius:6},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-positive-fg))"},children:"Sourced"}),s.jsx("div",{className:"tt-stat-md",style:{color:"hsl(var(--c-positive-fg))"},children:(i==null?void 0:i.counts.sourced)??0})]}),s.jsxs("div",{style:{padding:"10px 12px",background:"hsl(var(--c-negative-soft))",border:"1px solid hsl(var(--c-border))",borderRadius:6},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-negative-fg))"},children:"Gaps"}),s.jsx("div",{className:"tt-stat-md",style:{color:"hsl(var(--c-negative-fg))"},children:(i==null?void 0:i.counts.gap)??0})]})]})]})]}),s.jsxs("div",{className:"xph-card",style:{padding:16},children:[s.jsx("div",{className:"eyebrow",children:"Counterparty"}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:8},children:[s.jsx("span",{style:{width:36,height:36,borderRadius:8,background:"hsl(var(--c-ink))",color:"hsl(var(--c-ink-inverse))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:600},children:t.supplier.name.split(" ").map(f=>f[0]).slice(0,2).join("")}),s.jsxs("div",{children:[s.jsx("div",{style:{fontWeight:600,fontSize:14},children:t.supplier.name}),s.jsxs("div",{style:{fontSize:12,color:"hsl(var(--c-fg-muted))"},children:[t.supplier.location," · ",t.supplier.verified?"Verified supplier":"Verification pending"]})]})]}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,marginTop:14,fontSize:12},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Listings"}),s.jsx("div",{style:{marginTop:3},children:t.supplier.assetsListed})]}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Documents"}),s.jsxs("div",{style:{marginTop:3},children:[t.documentsCount," on file"]})]})]})]})]})]})]})]})}const Be=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ae("rounded-[10px] border bg-card text-card-foreground shadow-[var(--shadow-sm)]",e),...t}));Be.displayName="Card";const ht=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ae("flex flex-col space-y-1 p-5",e),...t}));ht.displayName="CardHeader";const ft=x.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:ae("tt-display-sm",e),...t}));ft.displayName="CardTitle";const Mr=x.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:ae("tt-body-sm text-muted-foreground",e),...t}));Mr.displayName="CardDescription";const pt=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ae("p-5 pt-0",e),...t}));pt.displayName="CardContent";const uke=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ae("flex items-center p-5 pt-0",e),...t}));uke.displayName="CardFooter";function ex(e,[t,n]){return Math.min(n,Math.max(t,e))}var dke=x.createContext(void 0);function Du(e){const t=x.useContext(dke);return e||t||"ltr"}function gb(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var hke=[" ","Enter","ArrowUp","ArrowDown"],fke=[" ","Enter"],fh="Select",[pS,mS,pke]=Bm(fh),[og,Opt]=sr(fh,[pke,Ou]),gS=Ou(),[mke,Mu]=og(fh),[gke,yke]=og(fh),ZY=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:h,disabled:f,required:p,form:m}
vendor: 17,942 bytes, line 721
721=e,g=gS(t),[y,b]=x.useState(null),[v,w]=x.useState(null),[_,j]=x.useState(!1),S=Du(u),[k,N]=ji({prop:r,defaultProp:i??!1,onChange:a,caller:fh}),[T,C]=ji({prop:o,defaultProp:l,onChange:c,caller:fh}),A=x.useRef(null),O=y?m||!!y.closest("form"):!0,[z,$]=x.useState(new Set),F=Array.from(z).map(B=>B.props.value).join(";");return s.jsx(F_,{...g,children:s.jsxs(mke,{required:p,scope:t,trigger:y,onTriggerChange:b,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:_,onValueNodeHasChildrenChange:j,contentId:gr(),value:T,onValueChange:C,open:k,onOpenChange:N,dir:S,triggerPointerDownPosRef:A,disabled:f,children:[s.jsx(pS.Provider,{scope:t,children:s.jsx(gke,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(B=>{$(P=>new Set(P).add(B))},[]),onNativeOptionRemove:x.useCallback(B=>{$(P=>{const I=new Set(P);return I.delete(B),I})},[]),children:n})}),O?s.jsxs(jQ,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:h,value:T,onChange:B=>C(B.target.value),disabled:f,form:m,children:[T===void 0?s.jsx("option",{value:""}):null,Array.from(z)]},F):null]})})};ZY.displayName=fh;var JY="SelectTrigger",eQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,a=gS(n),o=Mu(JY,n),l=o.disabled||r,c=Ke(t,o.onTriggerChange),u=mS(n),d=x.useRef("touch"),[h,f,p]=SQ(g=>{const y=u().filter(w=>!w.disabled),b=y.find(w=>w.value===o.value),v=kQ(y,g,b);v!==void 0&&o.onValueChange(v.value)}),m=g=>{l||(o.onOpenChange(!0),p()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return s.jsx(rb,{asChild:!0,...a,children:s.jsx(Ne.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":_Q(o.value)?"":void 0,...i,ref:c,onClick:fe(i.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&m(g)}),onPointerDown:fe(i.onPointerDown,g=>{d.current=g.pointerType;const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(m(g),g.preventDefault())}),onKeyDown:fe(i.onKeyDown,g=>{const y=h.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&f(g.key),!(y&&g.key===" ")&&hke.includes(g.key)&&(m(),g.preventDefault())})})})});eQ.displayName=JY;var tQ="SelectValue",nQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:o="",...l}=e,c=Mu(tQ,n),{onValueNodeHasChildrenChange:u}=c,d=a!==void 0,h=Ke(t,c.onValueNodeChange);return Lr(()=>{u(d)},[u,d]),s.jsx(Ne.span,{...l,ref:h,style:{pointerEvents:"none"},children:_Q(c.value)?s.jsx(s.Fragment,{children:o}):a})});nQ.displayName=tQ;var vke="SelectIcon",rQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return s.jsx(Ne.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});rQ.displayName=vke;var xke="SelectPortal",iQ=e=>s.jsx(Vm,{asChild:!0,...e});iQ.displayName=xke;var ph="SelectContent",sQ=x.forwardRef((e,t)=>{const n=Mu(ph,e.__scopeSelect),[r,i]=x.useState();if(Lr(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?Th.createPortal(s.jsx(aQ,{scope:e.__scopeSelect,children:s.jsx(pS.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),a):null}return s.jsx(oQ,{...e,ref:t})});sQ.displayName=ph;var Ua=10,[aQ,$u]=og(ph),bke="SelectContentImpl",wke=yu("SelectContent.RemoveScroll"),oQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:g,avoidCollisions:y,...b}=e,v=Mu(ph,n),[w,_]=x.useState(null),[j,S]=x.useState(null),k=Ke(t,Y=>_(Y)),[N,T]=x.useState(null),[C,A]=x.useState(null),O=mS(n),[z,$]=x.useState(!1),F=x.useRef(!1);x.useEffect(()=>{if(w)return sS(w)},[w]),rS();const B=x.useCallback(Y=>{const[le,...Z]=O().map(J=>J.ref.current),[de]=Z.slice(-1),pe=document.activeElement;for(const J of Y)if(J===pe||(J==null||J.scrollIntoView({block:"nearest"}),J===le&&j&&(j.scrollTop=0),J===de&&j&&(j.scrollTop=j.scrollHeight),J==null||J.focus(),document.activeElement!==pe))return},[O,j]),P=x.useCallback(()=>B([N,w]),[B,N,w]);x.useEffect(()=>{z&&P()},[z,P]);const{onOpenChange:I,triggerPointerDownPosRef:M}=v;x.useEffect(()=>{if(w){let Y={x:0,y:0};const le=de=>{var pe,J;Y={x:Math.abs(Math.round(de.pageX)-(((pe=M.current)==null?void 0:pe.x)??0)),y:Math.abs(Math.round(de.pageY)-(((J=M.current)==null?void 0:J.y)??0))}},Z=de=>{Y.x<=10&&Y.y<=10?de.preventDefault():w.contains(de.target)||I(!1),document.removeEventListener("pointermove",le),M.current=null};return M.current!==null&&(document.addEventListener("pointermove",le),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",le),document.removeEventListener("pointerup",Z,{capture:!0})}}},[w,I,M]),x.useEffect(()=>{const Y=()=>I(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[I]);const[R,K]=SQ(Y=>{const le=O().filter(pe=>!pe.disabled),Z=le.find(pe=>pe.ref.current===document.activeElement),de=kQ(le,Y,Z);de&&setTimeout(()=>de.ref.current.focus())}),D=x.useCallback((Y,le,Z)=>{const de=!F.current&&!Z;(v.value!==void 0&&v.value===le||de)&&(T(Y),de&&(F.current=!0))},[v.value]),E=x.useCallback(()=>w==null?void 0:w.focus(),[w]),q=x.useCallback((Y,le,Z)=>{const de=!F.current&&!Z;(v.value!==void 0&&v.value===le||de)&&A(Y)},[v.value]),X=r==="popper"?iP:lQ,re=X===iP?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:g,avoidCollisions:y}:{};return s.jsx(aQ,{scope:n,content:w,viewport:j,onViewportChange:S,itemRefCallback:D,selectedItem:N,onItemLeave:E,itemTextRefCallback:q,focusSelectedItem:P,selectedItemText:C,position:r,isPositioned:z,searchRef:R,children:s.jsx(db,{as:wke,allowPinchZoom:!0,children:s.jsx(ub,{asChild:!0,trapped:v.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:fe(i,Y=>{var le;(le=v.trigger)==null||le.focus({preventScroll:!0}),Y.preventDefault()}),children:s.jsx(Eh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:s.jsx(X,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:Y=>Y.preventDefault(),...b,...re,onPlaced:()=>$(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:fe(b.onKeyDown,Y=>{const le=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!le&&Y.key.length===1&&K(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let de=O().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const pe=Y.target,J=de.indexOf(pe);de=de.slice(J+1)}setTimeout(()=>B(de)),Y.preventDefault()}})})})})})})});oQ.displayName=bke;var jke="SelectItemAlignedPosition",lQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,a=Mu(ph,n),o=$u(ph,n),[l,c]=x.useState(null),[u,d]=x.useState(null),h=Ke(t,k=>d(k)),f=mS(n),p=x.useRef(!1),m=x.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:b,focusSelectedItem:v}=o,w=x.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&g&&y&&b){const k=a.trigger.getBoundingClientRect(),N=u.getBoundingClientRect(),T=a.valueNode.getBoundingClientRect(),C=b.getBoundingClientRect();if(a.dir!=="rtl"){const pe=C.left-N.left,J=T.left-pe,be=k.left-J,ee=k.width+be,Ce=Math.max(ee,N.width),Re=window.innerWidth-Ua,Ze=ex(J,[Ua,Math.max(Ua,Re-Ce)]);l.style.minWidth=ee+"px",l.style.left=Ze+"px"}else{const pe=N.right-C.right,J=window.innerWidth-T.right-pe,be=window.innerWidth-k.right-J,ee=k.width+be,Ce=Math.max(ee,N.width),Re=window.innerWidth-Ua,Ze=ex(J,[Ua,Math.max(Ua,Re-Ce)]);l.style.minWidth=ee+"px",l.style.right=Ze+"px"}const A=f(),O=window.innerHeight-Ua*2,z=g.scrollHeight,$=window.getComputedStyle(u),F=parseInt($.borderTopWidth,10),B=parseInt($.paddingTop,10),P=parseInt($.borderBottomWidth,10),I=parseInt($.paddingBottom,10),M=F+B+z+I+P,R=Math.min(y.offsetHeight*5,M),K=window.getComputedStyle(g),D=parseInt(K.paddingTop,10),E=parseInt(K.paddingBottom,10),q=k.top+k.height/2-Ua,X=O-q,re=y.offsetHeight/2,Y=y.offsetTop+re,le=F+B+Y,Z=M-le;if(le<=q){const pe=A.length>0&&y===A[A.length-1].ref.current;l.style.bottom="0px";const J=u.clientHeight-g.offsetTop-g.offsetHeight,be=Math.max(X,re+(pe?E:0)+J+P),ee=le+be;l.style.height=ee+"px"}else{const pe=A.length>0&&y===A[0].ref.current;l.style.top="0px";const be=Math.max(q,F+g.offsetTop+(pe?D:0)+re)+Z;l.style.height=be+"px",g.scrollTop=le-q+g.offsetTop}l.style.margin=`${Ua}px 0`,l.style.minHeight=R+"px",l.style.maxHeight=O+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,l,u,g,y,b,a.dir,r]);Lr(()=>w(),[w]);const[_,j]=x.useState();Lr(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const S=x.useCallback(k=>{k&&m.current===!0&&(w(),v==null||v(),m.current=!1)},[w,v]);return s.jsx(Ske,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:S,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:s.jsx(Ne.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});lQ.displayName=jke;var _ke="SelectPopperPosition",iP=x.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ua,...a}=e,o=gS(n);return s.jsx(z_,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...a.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)"}})});iP.displayName=_ke;var[Ske,FR]=og(ph,{}),sP="SelectViewport",cQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,a=$u(sP,n),o=FR(sP,n),l=Ke(t,a.onViewportChange),c=x.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),s.jsx(pS.Slot,{scope:n,children:s.jsx(Ne.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:fe(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&h){const p=Math.abs(c.current-d.scrollTop);if(p>0){const m=window.innerHeight-Ua*2,g=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),b=Math.max(g,y);if(b<m){const v=b+p,w=Math.min(m,v),_=v-w;h.style.height=w+"px",h.style.bottom==="0px"&&(d.scrollTop=_>0?_:0,h.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});cQ.displayName=sP;var uQ="SelectGroup",[kke,Nke]=og(uQ),Cke=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=gr();return s.jsx(kke,{scope:n,id:i,children:s.jsx(Ne.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Cke.displayName=uQ;var dQ="SelectLabel",hQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Nke(dQ,n);return s.jsx(Ne.div,{id:i.id,...r,ref:t})});hQ.displayName=dQ;var zj="SelectItem",[Ake,fQ]=og(zj),pQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,l=Mu(zj,n),c=$u(zj,n),u=l.value===r,[d,h]=x.useState(a??""),[f,p]=x.useState(!1),m=Ke(t,v=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,v,r,i)}),g=gr(),y=x.useRef("touch"),b=()=>{i||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(Ake,{scope:n,value:r,disabled:i,textId:g,isSelected:u,onItemTextChange:x.useCallback(v=>{h(w=>w||((v==null?void 0:v.textContent)??"").trim())},[]),children:s.jsx(pS.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:s.jsx(Ne.div,{role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:fe(o.onFocus,()=>p(!0)),onBlur:fe(o.onBlur,()=>p(!1)),onClick:fe(o.onClick,()=>{y.current!=="mouse"&&b()}),onPointerUp:fe(o.onPointerUp,()=>{y.current==="mouse"&&b()}),onPointerDown:fe(o.onPointerDown,v=>{y.current=v.pointerType}),onPointerMove:fe(o.onPointerMove,v=>{var w;y.current=v.pointerType,i?(w=c.onItemLeave)==null||w.call(c):y.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:fe(o.onPointerLeave,v=>{var w;v.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:fe(o.onKeyDown,v=>{var _;((_=c.searchRef)==null?void 0:_.current)!==""&&v.key===" "||(fke.includes(v.key)&&b(),v.key===" "&&v.preventDefault())})})})})});pQ.displayName=zj;var Sy="SelectItemText",mQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...a}=e,o=Mu(Sy,n),l=$u(Sy,n),c=fQ(Sy,n),u=yke(Sy,n),[d,h]=x.useState(null),f=Ke(t,b=>h(b),c.onItemTextChange,b=>{var v;return(v=l.itemTextRefCallback)==null?void 0:v.call(l,b,c.value,c.disabled)}),p=d==null?void 0:d.textContent,m=x.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=u;return Lr(()=>(g(m),()=>y(m)),[g,y,m]),s.jsxs(s.Fragment,{children:[s.jsx(Ne.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Th.createPortal(a.children,o.valueNode):null]})});mQ.displayName=Sy;var gQ="SelectItemIndicator",yQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return fQ(gQ,n).isSelected?s.jsx(Ne.span,{"aria-hidden":!0,...r,ref:t}):null});yQ.displayName=gQ;var aP="SelectScrollUpButton",vQ=x.forwardRef((e,t)=>{const n=$u(aP,e.__scopeSelect),r=FR(aP,e.__scopeSelect),[i,a]=x.useState(!1),o=Ke(t,r.onScrollButtonChange);return Lr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?s.jsx(bQ,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});vQ.displayName=aP;var oP="SelectScrollDownButton",xQ=x.forwardRef((e,t)=>{const n=$u(oP,e.__scopeSelect),r=FR(oP,e.__scopeSelect),[i,a]=x.useState(!1),o=Ke(t,r.onScrollButtonChange);return Lr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;a(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?s.jsx(bQ,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});xQ.displayName=oP;var bQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,a=$u("SelectScrollButton",n),o=x.useRef(null),l=mS(n),c=x.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),Lr(()=>{var d;const u=l().find(h=>h.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),s.jsx(Ne.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:fe(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:fe(i.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:fe(i.onPointerLeave,()=>{c()})})}),Tke="SelectSeparator",wQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(Ne.div,{"aria-hidden":!0,...r,ref:t})});wQ.displayName=Tke;var lP="SelectArrow",Eke=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=gS(n),a=Mu(lP,n),o=$u(lP,n);return a.open&&o.position==="popper"?s.jsx(B_,{...i,...r,ref:t}):null});Eke.displayName=lP;var Pke="SelectBubbleInput",jQ=x.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=x.useRef(null),a=Ke(r,i),o=gb(t);return x.useEffect(()=>{const l=i.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const h=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(h)}},[o,t]),s.jsx(Ne.select,{...n,style:{...K9,...n.style},ref:a,defaultValue:t})});jQ.displayName=Pke;function _Q(e){return e===""||e===void 0}function SQ(e){const t=Jn(e),n=x.useRef(""),r=x.useRef(0),i=x.useCallback(o=>{const l=n.current+o;t(l),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),a=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function kQ(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=Oke(e,Math.max(a,0));i.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function Oke(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ike=ZY,NQ=eQ,Rke=nQ,Dke=rQ,Mke=iQ,CQ=sQ,$ke=cQ,AQ=hQ,TQ=pQ,Lke=mQ,Fke=yQ,EQ=vQ,PQ=xQ,OQ=wQ;const $n=Ike,Ln=Rke,On=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(NQ,{ref:r,className:ae("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
721ing-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),...n,children:[t,s.jsx(Dke,{asChild:!0,children:s.jsx(Ta,{className:"h-4 w-4 opacity-50"})})]}));On.displayName=NQ.displayName;const IQ=x.forwardRef(({className:e,...t},n)=>s.jsx(EQ,{ref:n,className:ae("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Tde,{className:"h-4 w-4"})}));IQ.displayName=EQ.displayName;const RQ=x.forwardRef(({className:e,...t},n)=>s.jsx(PQ,{ref:n,className:ae("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Ta,{className:"h-4 w-4"})}));RQ.displayName=PQ.displayName;const In=x.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>s.jsx(Mke,{children:s.jsxs(CQ,{ref:i,className:ae("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[s.jsx(IQ,{}),s.jsx($ke,{className:ae("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(RQ,{})]})}));In.displayName=CQ.displayName;const zke=x.forwardRef(({className:e,...t},n)=>s.jsx(AQ,{ref:n,className:ae("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));zke.displayName=AQ.displayName;const Rt=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(TQ,{ref:r,className:ae("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),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Fke,{children:s.jsx(Fr,{className:"h-4 w-4"})})}),s.jsx(Lke,{children:t})]}));Rt.displayName=TQ.displayName;const Bke=x.forwardRef(({className:e,...t},n)=>s.jsx(OQ,{ref:n,className:ae("-mx-1 my-1 h-px bg-muted",e),...t}));Bke.displayName=OQ.displayName;var DQ=["PageUp","PageDown"],MQ=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],$Q={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},lg="Slider",[cP,Vke,Wke]=Bm(lg),[LQ,Ipt]=sr(lg,[Wke]),[Uke,yS]=LQ(lg),FQ=x.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:a=1,orientation:o="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:d,onValueChange:h=()=>{},onValueCommit:f=()=>{},inverted:p=!1,form:m,...g}=e,y=x.useRef(new Set),b=x.useRef(0),w=o==="horizontal"?qke:Hke,[_=[],j]=ji({prop:d,defaultProp:u,onChange:A=>{var z;(z=[...y.current][b.current])==null||z.focus(),h(A)}}),S=x.useRef(_);function k(A){const O=Xke(_,A);C(A,O)}function N(A){C(A,b.current)}function T(){const A=S.current[b.current];_[b.current]!==A&&f(_)}function C(A,O,{commit:z}={commit:!1}){const $=tNe(a),F=nNe(Math.round((A-r)/a)*a+r,$),B=ex(F,[r,i]);j((P=[])=>{const I=Yke(P,B,O);if(eNe(I,c*a)){b.current=I.indexOf(B);const M=String(I)!==String(P);return M&&z&&f(I),M?I:P}else return P})}return s.jsx(Uke,{scope:e.__scopeSlider,name:n,disabled:l,min:r,max:i,valueIndexToChangeRef:b,thumbs:y.current,values:_,orientation:o,form:m,children:s.jsx(cP.Provider,{scope:e.__scopeSlider,children:s.jsx(cP.Slot,{scope:e.__scopeSlider,children:s.jsx(w,{"aria-disabled":l,"data-disabled":l?"":void 0,...g,ref:t,onPointerDown:fe(g.onPointerDown,()=>{l||(S.current=_)}),min:r,max:i,inverted:p,onSlideStart:l?void 0:k,onSlideMove:l?void 0:N,onSlideEnd:l?void 0:T,onHomeKeyDown:()=>!l&&C(r,0,{commit:!0}),onEndKeyDown:()=>!l&&C(i,_.length-1,{commit:!0}),onStepKeyDown:({event:A,direction:O})=>{if(!l){const F=DQ.includes(A.key)||A.shiftKey&&MQ.includes(A.key)?10:1,B=b.current,P=_[B],I=a*F*O;C(P+I,B,{commit:!0})}}})})})})});FQ.displayName=lg;var[zQ,BQ]=LQ(lg,{startEdge:"left",endEdge:"right",size:"width",direction:1}),qke=x.forwardRef((e,t)=>
721{const{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:l,onSlideEnd:c,onStepKeyDown:u,...d}=e,[h,f]=x.useState(null),p=Ke(t,w=>f(w)),m=x.useRef(void 0),g=Du(i),y=g==="ltr",b=y&&!a||!y&&a;function v(w){const _=m.current||h.getBoundingClientRect(),j=[0,_.width],k=zR(j,b?[n,r]:[r,n]);return m.current=_,k(w-_.left)}return s.jsx(zQ,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:s.jsx(VQ,{dir:g,"data-orientation":"horizontal",...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const _=v(w.clientX);o==null||o(_)},onSlideMove:w=>{const _=v(w.clientX);l==null||l(_)},onSlideEnd:()=>{m.current=void 0,c==null||c()},onStepKeyDown:w=>{const j=$Q[b?"from-left":"from-right"].includes(w.key);u==null||u({event:w,direction:j?-1:1})}})})}),Hke=x.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:l,onStepKeyDown:c,...u}=e,d=x.useRef(null),h=Ke(t,d),f=x.useRef(void 0),p=!i;function m(g){const y=f.current||d.current.getBoundingClientRect(),b=[0,y.height],w=zR(b,p?[r,n]:[n,r]);return f.current=y,w(g-y.top)}return s.jsx(zQ,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:s.jsx(VQ,{"data-orientation":"vertical",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const y=m(g.clientY);a==null||a(y)},onSlideMove:g=>{const y=m(g.clientY);o==null||o(y)},onSlideEnd:()=>{f.current=void 0,l==null||l()},onStepKeyDown:g=>{const b=$Q[p?"from-bottom":"from-top"].includes(g.key);c==null||c({event:g,direction:b?-1:1})}})})}),VQ=x.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:l,onStepKeyDown:c,...u}=e,d=yS(lg,n);return s.jsx(Ne.span,{...u,ref:t,onKeyDown:fe(e.onKeyDown,h=>{h.key==="Home"?(o(h),h.preventDefault()):h.key==="End"?(l(h),h.preventDefault()):DQ.concat(MQ).includes(h.key)&&(c(h),h.preventDefault())}),onPointerDown:fe(e.onPointerDown,h=>{const f=h.target;f.setPointerCapture(h.pointerId),h.preventDefault(),d.thumbs.has(f)?f.focus():r(h)}),onPointerMove:fe(e.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&i(h)}),onPointerUp:fe(e.onPointerUp,h=>{const f=h.target;f.hasPointerCapture(h.pointerId)&&(f.releasePointerCapture(h.pointerId),a(h))})})}),WQ="SliderTrack",UQ=x.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=yS(WQ,n);return s.jsx(Ne.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});UQ.displayName=WQ;var uP="SliderRange",qQ=x.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=yS(uP,n),a=BQ(uP,n),o=x.useRef(null),l=Ke(t,o),c=i.values.length,u=i.values.map(f=>GQ(f,i.min,i.max)),d=c>1?Math.min(...u):0,h=100-Math.max(...u);return s.jsx(Ne.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:l,style:{...e.style,[a.startEdge]:d+"%",[a.endEdge]:h+"%"}})});qQ.displayName=uP;var dP="SliderThumb",HQ=x.forwardRef((e,t)=>{const n=Vke(e.__scopeSlider),[r,i]=x.useState(null),a=Ke(t,l=>i(l)),o=x.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return s.jsx(Kke,{...e,ref:a,index:o})}),Kke=x.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...a}=e,o=yS(dP,n),l=BQ(dP,n),[c,u]=x.useState(null),d=Ke(t,v=>u(v)),h=c?o.form||!!c.closest("form"):!0,f=nb(c),p=o.values[r],m=p===void 0?0:GQ(p,o.min,o.max),g=Qke(r,o.values.length),y=f==null?void 0:f[l.size],b=y?Zke(y,m,l.direction):0;return x.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),s.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${m}% + ${b}px)`},children:[s.jsx(cP.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(Ne.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...a,ref:d,style:p===void 0?{display:"none"}:e.style,onFocus:fe(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),h&&s.jsx(KQ,{name:i??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:p},r)]})});HQ.displayName=dP;
721var Gke="RadioBubbleInput",KQ=x.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=x.useRef(null),a=Ke(i,r),o=gb(t);return x.useEffect(()=>{const l=i.current;if(!l)return;const c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const h=new Event("input",{bubbles:!0});d.call(l,t),l.dispatchEvent(h)}},[o,t]),s.jsx(Ne.input,{style:{display:"none"},...n,ref:a,defaultValue:t})});KQ.displayName=Gke;function Yke(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,a)=>i-a)}function GQ(e,t,n){const a=100/(n-t)*(e-t);return ex(a,[0,100])}function Qke(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Xke(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),r=Math.min(...n);return n.indexOf(r)}function Zke(e,t,n){const r=e/2,a=zR([0,50],[0,r]);return(r-a(t)*n)*n}function Jke(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function eNe(e,t){if(t>0){const n=Jke(e);return Math.min(...n)>=t}return!0}function zR(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function tNe(e){return(String(e).split(".")[1]||"").length}function nNe(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var YQ=FQ,rNe=UQ,iNe=qQ,sNe=HQ;const QQ=x.forwardRef(({className:e,...t},n)=>s.jsxs(YQ,{ref:n,className:ae("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(rNe,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(iNe,{className:"absolute h-full bg-primary"})}),s.jsx(sNe,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background 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"})]}));QQ.displayName=YQ.displayName;const aNe=Wm("inline-flex items-center gap-1 rounded border px-2 py-[3px] font-mono text-[10.5px] font-medium uppercase tracking-[0.06em] 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:opacity-90",secondary:"border-transparent bg-[hsl(var(--c-surface-2))] text-foreground hover:bg-[hsl(var(--c-surface))]",destructive:"border-transparent bg-destructive text-destructive-foreground hover:opacity-90",outline:"border-border bg-card text-foreground"}},defaultVariants:{variant:"default"}});function pn({className:e,variant:t,...n}){return s.jsx("div",{className:ae(aNe({variant:t}),e),...n})}var mC="rovingFocusGroup.onEntryFocus",oNe={bubbles:!1,cancelable:!0},yb="RovingFocusGroup",[hP,XQ,lNe]=Bm(yb),[cNe,cg]=sr(yb,[lNe]),[uNe,dNe]=cNe(yb),ZQ=x.forwardRef((e,t)=>s.jsx(hP.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(hP.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(hNe,{...e,ref:t})})}));ZQ.displayName=yb;var hNe=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=e,f=x.useRef(null),p=Ke(t,f),m=Du(a),[g,y]=ji({prop:o,defaultProp:l??null,onChange:c,caller:yb}),[b,v]=x.useState(!1),w=Jn(u),_=XQ(n),j=x.useRef(!1),[S,k]=x.useState(0);return x.useEffect(()=>{const N=f.current;if(N)return N.addEventListener(mC,w),()=>N.removeEventListener(mC,w)},[w]),s.jsx(uNe,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:g,onItemFocus:x.useCallback(N=>y(N),[y]),onItemShiftTab:x.useCallback(()=>v(!0),[]),onFocusableItemAdd:x.useCallback(()=>k(N=>N+1),[]),onFocusableItemRemove:x.useCallback(()=>k(N=>N-1),[]),children:s.jsx(Ne.div,{tabIndex:b||S===0?-1:0,"data-orientation":r,...h,ref:p,style:{outline:"none",...e.style},onMouseDown:fe(e.onMouseDown,()=>{j.current=!0}),onFocus:fe(e.onFocus,N=>{const T=!j.current;if(N.target===N.currentTarget&&T&&!b){const C=new CustomEvent(mC,oNe);if(N.currentTarget.dispatchEvent(C),!C.defaultPrevented){const A=_().filter(B=>B.focusable),O=A.find(B=>B.active),z=A.find(B=>
vendor: 5,264 bytes, line 721
721B.id===g),F=[O,z,...A].filter(Boolean).map(B=>B.ref.current);tX(F,d)}}j.current=!1}),onBlur:fe(e.onBlur,()=>v(!1))})})}),JQ="RovingFocusGroupItem",eX=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...l}=e,c=gr(),u=a||c,d=dNe(JQ,n),h=d.currentTabStopId===u,f=XQ(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:g}=d;return x.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),s.jsx(hP.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:s.jsx(Ne.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:fe(e.onMouseDown,y=>{r?d.onItemFocus(u):y.preventDefault()}),onFocus:fe(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:fe(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const b=mNe(y,d.orientation,d.dir);if(b!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=f().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const _=w.indexOf(y.currentTarget);w=d.loop?gNe(w,_+1):w.slice(_+1)}setTimeout(()=>tX(w))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:g!=null}):o})})});eX.displayName=JQ;var fNe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function pNe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function mNe(e,t,n){const r=pNe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return fNe[r]}function tX(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function gNe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var BR=ZQ,VR=eX,vS="Tabs",[yNe,Rpt]=sr(vS,[cg]),nX=cg(),[vNe,WR]=yNe(vS),rX=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=Du(l),[h,f]=ji({prop:r,onChange:i,defaultProp:a??"",caller:vS});return s.jsx(vNe,{scope:n,baseId:gr(),value:h,onValueChange:f,orientation:o,dir:d,activationMode:c,children:s.jsx(Ne.div,{dir:d,"data-orientation":o,...u,ref:t})})});rX.displayName=vS;var iX="TabsList",sX=x.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,a=WR(iX,n),o=nX(n);return s.jsx(BR,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:s.jsx(Ne.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});sX.displayName=iX;var aX="TabsTrigger",oX=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=WR(aX,n),l=nX(n),c=uX(o.baseId,r),u=dX(o.baseId,r),d=r===o.value;return s.jsx(VR,{asChild:!0,...l,focusable:!i,active:d,children:s.jsx(Ne.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...a,ref:t,onMouseDown:fe(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?o.onValueChange(r):h.preventDefault()}),onKeyDown:fe(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(r)}),onFocus:fe(e.onFocus,()=>{const h=o.activationMode!=="manual";!d&&!i&&h&&o.onValueChange(r)})})})});oX.displayName=aX;var lX="TabsContent",cX=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,l=WR(lX,n),c=uX(l.baseId,r),u=dX(l.baseId,r),d=r===l.value,h=x.useRef(d);return x.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),s.jsx(vr,{present:i||d,children:({present:f})=>s.jsx(Ne.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:f&&a})})});cX.displayName=lX;function uX(e,t){return`${e}-trigger-${t}`}function dX(e,t){return`${e}-content-${t}`}var xNe=rX,hX=sX,fX=oX,pX=cX;const mh=xNe,ju=x.forwardRef(({className:e,...t},n)=>s.jsx(hX,{ref:n,className:ae("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));ju.displayName=hX.displayName;const Er=x.forwardRef(({className:e,...t},n)=>s.jsx(fX,{ref:n,className:ae("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}));Er.displayName=fX.displayName;const pi=x.forwardRef(({className:e,...t},n)=>s.jsx(pX,{ref:n,className:ae("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));pi.displayName=pX.displayName;const bNe={discovery:"stage-discovery","glp-tox":"stage-glp","pre-ind":"stage-preind","ind-filing":"stage-ind",clinical:"stage-clinical"};function Xp({stage:e,size:t="default"}){return s.jsx("span",{className:ae("stage-badge",bNe[e],t==="sm"&&"text-xs px-2 py-0"),
721children:Nn[e]})}const wNe=e=>({id:e.id,assetName:e.asset_name,target:e.target,modality:e.modality,stage:e.stage,transactionValue:e.transaction_value,date:e.transaction_date,acquirer:e.acquirer});function jNe(){return Se({queryKey:["comparable-transactions"],queryFn:async()=>{const{data:e,error:t}=await W.from("comparable_transactions").select("*").order("transaction_date",{ascending:!1});if(t)throw console.error("Error fetching comparable transactions:",t),t;return e.map(wNe)}})}function mX(e,t){const n=Ae(),r=Se({queryKey:["valuation",e,t],queryFn:async()=>{const{data:{session:a}}=await W.auth.getSession();if(!a)throw new Error("Not authenticated");const o=await W.functions.invoke("calculate-npv",{body:{asset_id:e,discount_rate:t}});if(o.error)throw new Error(o.error.message||"Valuation calculation failed");return o.data},enabled:!!e,staleTime:5*60*1e3});return{...r,refetch:a=>{(a==null?void 0:a.discountRate)!==void 0?n.invalidateQueries({queryKey:["valuation",e,a.discountRate]}):r.refetch()}}}function _Ne(e,t,n){return Se({queryKey:["valuation-v2",e,t,n==null?void 0:n.mcIterations],queryFn:async()=>{const{data:{session:r}}=await W.auth.getSession();if(!r)throw new Error("Not authenticated");const i=await W.functions.invoke("calculate-npv-v2",{body:{asset_id:e,discount_rate:t,mc_iterations:n==null?void 0:n.mcIterations}});if(i.error)throw new Error(i.error.message||"V2 valuation calculation failed");const a=i.data;if(!a||typeof a.npvBase!="number"||!a.monteCarlo||typeof a.cpos!="number"){const o=a==null?void 0:a.error;throw new Error(typeof o=="string"?o:"V2 valuation returned an invalid response")}return a},enabled:!!e,staleTime:5*60*1e3})}const j5={discountRate:.1,peakSales:15e8,patentLife:12,marketSize:3e9,taxRate:.15,cogsPct:.15,sgaPct:.25},UR={1:"Very Low",2:"Low",3:"Moderate",4:"High",5:"Very High"},SNe={bottom_up:"Bottom-up (population × price)",numeric:"Peak sales (numeric field)",parsed:"Peak sales (parsed text)",benchmark:"Benchmark by prevalence"},kNe={hurdle_35:"Phase III+ (35%)",hurdle_50:"Phase II (50%)",hurdle_60:"Phase I (60%)",hurdle_70:"Startup / Seed (70%)"};var NNe=Array.isArray,ms=NNe,CNe=typeof Hc=="object"&&Hc&&Hc.Object===Object&&Hc,gX=CNe,ANe=gX,TNe=typeof self=="object"&&self&&self.Object===Object&&self,ENe=ANe||TNe||Function("return this")(),al=ENe,PNe=al,ONe=PNe.Symbol,vb=ONe,_5=vb,yX=Object.prototype,INe=yX.hasOwnProperty,RNe=yX.toString,qg=_5?_5.toStringTag:void 0;function DNe(e){var t=INe.call(e,qg),n=e[qg];try{e[qg]=void 0;var r=!0}catch{}var i=RNe.call(e);return r&&(t?e[qg]=n:delete e[qg]),i}var MNe=DNe,$Ne=Object.prototype,LNe=$Ne.toString;function FNe(e){return LNe.call(e)}var zNe=FNe,S5=vb,BNe=MNe,VNe=zNe,WNe="[object Null]",UNe="[object Undefined]",k5=S5?S5.toStringTag:void 0;function qNe(e){return e==null?e===void 0?UNe:WNe:k5&&k5 in Object(e)?BNe(e):VNe(e)}var ic=qNe;function HNe(e){return e!=null&&typeof e=="object"}var sc=HNe,KNe=ic,GNe=sc,YNe="[object Symbol]";function QNe(e){return typeof e=="symbol"||GNe(e)&&KNe(e)==YNe}var ug=QNe,XNe=ms,ZNe=ug,JNe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,eCe=/^\w*$/;function tCe(e,t){if(XNe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ZNe(e)?!0:eCe.test(e)||!JNe.test(e)||t!=null&&e in Object(t)}var qR=tCe;function nCe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Lu=nCe;const dg=Ot(Lu);var rCe=ic,iCe=Lu,sCe="[object AsyncFunction]",aCe="[object Function]",oCe="[object GeneratorFunction]",lCe="[object Proxy]";function cCe(e){if(!iCe(e))return!1;var t=rCe(e);return t==aCe||t==oCe||t==sCe||t==lCe}var HR=cCe;const tt=Ot(HR);var uCe=al,dCe=uCe["__core-js_shared__"],hCe=dCe,gC=hCe,N5=function(){var e=/[^.]+$/.exec(gC&&gC.keys&&gC.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function fCe(e){return!!N5&&N5 in e}var pCe=fCe,mCe=Function.prototype,gCe=mCe.toString;function yCe(e){if(e!=null){try{return gCe.call(e)}catch{}try{return e+""}catch{}}return""}var vX=yCe,vCe=HR,xCe=pCe,bCe=Lu,wCe=vX,jCe=/[\\^$.*+?()[\]{}|]/g,_Ce=/^\[object .+?Constructor\]$/,SCe=Function.prototype,kCe=Object.prototype,NCe=SCe.toString,CCe
vendor: 3,912 bytes, line 721
721=kCe.hasOwnProperty,ACe=RegExp("^"+NCe.call(CCe).replace(jCe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function TCe(e){if(!bCe(e)||xCe(e))return!1;var t=vCe(e)?ACe:_Ce;return t.test(wCe(e))}var ECe=TCe;function PCe(e,t){return e==null?void 0:e[t]}var OCe=PCe,ICe=ECe,RCe=OCe;function DCe(e,t){var n=RCe(e,t);return ICe(n)?n:void 0}var Dh=DCe,MCe=Dh,$Ce=MCe(Object,"create"),xS=$Ce,C5=xS;function LCe(){this.__data__=C5?C5(null):{},this.size=0}var FCe=LCe;function zCe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var BCe=zCe,VCe=xS,WCe="__lodash_hash_undefined__",UCe=Object.prototype,qCe=UCe.hasOwnProperty;function HCe(e){var t=this.__data__;if(VCe){var n=t[e];return n===WCe?void 0:n}return qCe.call(t,e)?t[e]:void 0}var KCe=HCe,GCe=xS,YCe=Object.prototype,QCe=YCe.hasOwnProperty;function XCe(e){var t=this.__data__;return GCe?t[e]!==void 0:QCe.call(t,e)}var ZCe=XCe,JCe=xS,eAe="__lodash_hash_undefined__";function tAe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=JCe&&t===void 0?eAe:t,this}var nAe=tAe,rAe=FCe,iAe=BCe,sAe=KCe,aAe=ZCe,oAe=nAe;function hg(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}hg.prototype.clear=rAe;hg.prototype.delete=iAe;hg.prototype.get=sAe;hg.prototype.has=aAe;hg.prototype.set=oAe;var lAe=hg;function cAe(){this.__data__=[],this.size=0}var uAe=cAe;function dAe(e,t){return e===t||e!==e&&t!==t}var KR=dAe,hAe=KR;function fAe(e,t){for(var n=e.length;n--;)if(hAe(e[n][0],t))return n;return-1}var bS=fAe,pAe=bS,mAe=Array.prototype,gAe=mAe.splice;function yAe(e){var t=this.__data__,n=pAe(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():gAe.call(t,n,1),--this.size,!0}var vAe=yAe,xAe=bS;function bAe(e){var t=this.__data__,n=xAe(t,e);return n<0?void 0:t[n][1]}var wAe=bAe,jAe=bS;function _Ae(e){return jAe(this.__data__,e)>-1}var SAe=_Ae,kAe=bS;function NAe(e,t){var n=this.__data__,r=kAe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var CAe=NAe,AAe=uAe,TAe=vAe,EAe=wAe,PAe=SAe,OAe=CAe;function fg(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}fg.prototype.clear=AAe;fg.prototype.delete=TAe;fg.prototype.get=EAe;fg.prototype.has=PAe;fg.prototype.set=OAe;var wS=fg,IAe=Dh,RAe=al,DAe=IAe(RAe,"Map"),GR=DAe,A5=lAe,MAe=wS,$Ae=GR;function LAe(){this.size=0,this.__data__={hash:new A5,map:new($Ae||MAe),string:new A5}}var FAe=LAe;function zAe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var BAe=zAe,VAe=BAe;function WAe(e,t){var n=e.__data__;return VAe(t)?n[typeof t=="string"?"string":"hash"]:n.map}var jS=WAe,UAe=jS;function qAe(e){var t=UAe(this,e).delete(e);return this.size-=t?1:0,t}var HAe=qAe,KAe=jS;function GAe(e){return KAe(this,e).get(e)}var YAe=GAe,QAe=jS;function XAe(e){return QAe(this,e).has(e)}var ZAe=XAe,JAe=jS;function eTe(e,t){var n=JAe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var tTe=eTe,nTe=FAe,rTe=HAe,iTe=YAe,sTe=ZAe,aTe=tTe;function pg(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}pg.prototype.clear=nTe;pg.prototype.delete=rTe;pg.prototype.get=iTe;pg.prototype.has=sTe;pg.prototype.set=aTe;var YR=pg,xX=YR,oTe="Expected a function";function QR(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(oTe);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(QR.Cache||xX),n}QR.Cache=xX;var bX=QR;const lTe=Ot(bX);var cTe=bX,uTe=500;function dTe(e){var t=cTe(e,function(r){return n.size===uTe&&n.clear(),r}),n=t.cache;return t}var hTe=dTe,fTe=hTe,pTe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mTe=/\\(\\)?/g,gTe=fTe(function(e){var t=[];
721return e.charCodeAt(0)===46&&t.push(""),e.replace(pTe,function(n,r,i,a){t.push(i?a.replace(mTe,"$1"):r||n)}),t}),yTe=gTe;function vTe(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var XR=vTe,T5=vb,xTe=XR,bTe=ms,wTe=ug,jTe=1/0,E5=T5?T5.prototype:void 0,P5=E5?E5.toString:void 0;function wX(e){if(typeof e=="string")return e;if(bTe(e))return xTe(e,wX)+"";if(wTe(e))return P5?P5.call(e):"";var t=e+"";return t=="0"&&1/e==-jTe?"-0":t}var _Te=wX,STe=_Te;function kTe(e){return e==null?"":STe(e)}var jX=kTe,NTe=ms,CTe=qR,ATe=yTe,TTe=jX;function ETe(e,t){return NTe(e)?e:CTe(e,t)?[e]:ATe(TTe(e))}var _X=ETe,PTe=ug,OTe=1/0;function ITe(e){if(typeof e=="string"||PTe(e))return e;var t=e+"";return t=="0"&&1/e==-OTe?"-0":t}var _S=ITe,RTe=_X,DTe=_S;function MTe(e,t){t=RTe(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[DTe(t[n++])];return n&&n==r?e:void 0}var ZR=MTe,$Te=ZR;function LTe(e,t,n){var r=e==null?void 0:$Te(e,t);return r===void 0?n:r}var SX=LTe;const zs=Ot(SX);function FTe(e){return e==null}var zTe=FTe;const dt=Ot(zTe);var BTe=ic,VTe=ms,WTe=sc,UTe="[object String]";function qTe(e){return typeof e=="string"||!VTe(e)&&WTe(e)&&BTe(e)==UTe}var HTe=qTe;const gh=Ot(HTe);var kX={exports:{}},en={};/**
722 * @license React
723 * react-is.production.min.js
724 *
725 * Copyright (c) Facebook, Inc. and its affiliates.
726 *
727 * This source code is licensed under the MIT license found in the
728 * LICENSE file in the root directory of this source tree.
729 */var JR=Symbol.for("react.element"),eD=Symbol.for("react.portal"),SS=Symbol.for("react.fragment"),kS=Symbol.for("react.strict_mode"),NS=Symbol.for("react.profiler"),CS=Symbol.for("react.provider"),AS=Symbol.for("react.context"),KTe=Symbol.for("react.server_context"),TS=Symbol.for("react.forward_ref"),ES=Symbol.for("react.suspense"),PS=Symbol.for("react.suspense_list"),OS=Symbol.for("react.memo"),IS=Symbol.for("react.lazy"),GTe=Symbol.for("react.offscreen"),NX;NX=Symbol.for("react.module.reference");function Pa(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case JR:switch(e=e.type,e){case SS:case NS:case kS:case ES:case PS:return e;default:switch(e=e&&e.$$typeof,e){case KTe:case AS:case TS:case IS:case OS:case CS:return e;default:return t}}case eD:return t}}}en.ContextConsumer=AS;en.ContextProvider=CS;en.Element=JR;en.ForwardRef=TS;en.Fragment=SS;en.Lazy=IS;en.Memo=OS;en.Portal=eD;en.Profiler=NS;en.StrictMode=kS;en.Suspense=ES;en.SuspenseList=PS;en.isAsyncMode=function(){return!1};en.isConcurrentMode=function(){return!1};en.isContextConsumer=function(e){return Pa(e)===AS};en.isContextProvider=function(e){return Pa(e)===CS};en.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===JR};en.isForwardRef=function(e){return Pa(e)===TS};en.isFragment=function(e){return Pa(e)===SS};en.isLazy=function(e){return Pa(e)===IS};en.isMemo=function(e){return Pa(e)===OS};en.isPortal=function(e){return Pa(e)===eD};en.isProfiler=function(e){return Pa(e)===NS};en.isStrictMode=function(e){return Pa(e)===kS};en.isSuspense=function(e){return Pa(e)===ES};en.isSuspenseList=function(e){return Pa(e)===PS};en.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===SS||e===NS||e===kS||e===ES||e===PS||e===GTe||typeof e=="object"&&e!==null&&(e.$$typeof===IS||e.$$typeof===OS||e.$$typeof===CS||e.$$typeof===AS||e.$$typeof===TS||e.$$typeof===NX||e.getModuleId!==void 0)};en.typeOf=Pa;kX.exports=en;var YTe=kX.exports,QTe=ic,XTe=sc,ZTe="[object Number]";function JTe(e){return typeof e=="number"||XTe(e)&&QTe(e)==ZTe}var CX=JTe;const eEe=Ot(CX);var tEe=CX;function nEe(e){return tEe(e)&&e!=+e}var rEe=nEe;const mg=Ot(rEe);var Mi=function(t){return t===0?0:t>0?1:-1},kd=function(t){return gh(t)&&t.indexOf("%")===t.length-1},ge=function(t){return eEe(t)&&!mg(t)},iEe=function(t){return dt(t)},Dr=function(t){return ge(t)||gh(t)},sEe=0,Mh=function(t){var n=++sEe;return"".concat(t||"").concat(n)},$i=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ge(t)&&!gh(t))return r;var a;if(kd(t)){var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return mg(a)&&(a=r),i&&a>n&&(a=n),a},Dc=function(t){if(!t)return null;var n=Object.keys(t);
vendor: 5,203 bytes, line 729
729return n&&n.length?t[n[0]]:null},aEe=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},Or=function(t,n){return ge(t)&&ge(n)?function(r){return t+r*(n-t)}:function(){return n}};function Bj(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):zs(r,t))===n})}var oEe=function(t,n){return ge(t)&&ge(n)?t-n:gh(t)&&gh(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function fp(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function fP(e){"@babel/helpers - typeof";return fP=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},fP(e)}var lEe=["viewBox","children"],cEe=["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","colorRendering","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"],O5=["points","pathLength"],yC={svg:lEe,polygon:O5,polyline:O5},tD=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onF
729ocus","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","onDragCapture","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"],Vj=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(x.isValidElement(t)&&(r=t.props),!dg(r))return null;var i={};return Object.keys(r).forEach(function(a){tD.includes(a)&&(i[a]=n||function(o){return r[a](r,o)})}),i},uEe=function(t,n,r){return function(i){return t(n,r,i),null}},yh=function(t,n,r){if(!dg(t)||fP(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(a){var o=t[a];tD.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=uEe(o,n,r))}),i}
vendor: 3,058 bytes, line 729
729,dEe=["children"],hEe=["children"];function I5(e,t){if(e==null)return{};var n=fEe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fEe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function pP(e){"@babel/helpers - typeof";return pP=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},pP(e)}var R5={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"},Dl=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},D5=null,vC=null,nD=function e(t){if(t===D5&&Array.isArray(vC))return vC;var n=[];return x.Children.forEach(t,function(r){dt(r)||(YTe.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),vC=n,D5=t,n};function Bs(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return Dl(i)}):r=[Dl(t)],nD(e).forEach(function(i){var a=zs(i,"type.displayName")||zs(i,"type.name");r.indexOf(a)!==-1&&n.push(i)}),n}function Os(e,t){var n=Bs(e,t);return n&&n[0]}var M5=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!ge(r)||r<=0||!ge(i)||i<=0)},pEe=["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"],mEe=function(t){return t&&t.type&&gh(t.type)&&pEe.indexOf(t.type)>=0},AX=function(t){return t&&pP(t)==="object"&&"clipDot"in t},gEe=function(t,n,r,i){var a,o=(a=yC==null?void 0:yC[i])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!tt(t)&&(i&&o.includes(n)||cEe.includes(n))||r&&tD.includes(n)},He=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(x.isValidElement(t)&&(i=t.props),!dg(i))return null;var a={};
729return Object.keys(i).forEach(function(o){var l;gEe((l=i)===null||l===void 0?void 0:l[o],o,n,r)&&(a[o]=i[o])}),a},mP=function e(t,n){if(t===n)return!0;var r=x.Children.count(t);if(r!==x.Children.count(n))return!1;if(r===0)return!0;if(r===1)return $5(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var a=t[i],o=n[i];if(Array.isArray(a)||Array.isArray(o)){if(!e(a,o))return!1}else if(!$5(a,o))return!1}return!0},$5=function(t,n){if(dt(t)&&dt(n))return!0;if(!dt(t)&&!dt(n)){var r=t.props||{},i=r.children,a=I5(r,dEe),o=n.props||{},l=o.children,c=I5(o,hEe);return i&&l?fp(a,c)&&mP(i,l):!i&&!l?fp(a,c):!1}return!1},L5=function(t,n){var r=[],i={};return nD(t).forEach(function(a,o){if(mEe(a))r.push(a);else if(a){var l=Dl(a.type),c=n[l]||{},u=c.handler,d=c.once;if(u&&(!d||!i[l])){var h=u(a,l,o);r.push(h),i[l]=!0}}}),r},yEe=function(t){var n=t&&t.type;return n&&R5[n]?R5[n]:null},vEe=function(t,n){return nD(n).indexOf(t)},xEe=["children","width","height","viewBox","className","style","title","desc"];function gP(){return gP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gP.apply(this,arguments)}function bEe(e,t){if(e==null)return{};var n=wEe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wEe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function yP(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,a=e.className,o=e.style,l=e.title,c=e.desc,u=bEe(e,xEe),d=i||{width:n,height:r,x:0,y:0},h=mt("recharts-surface",a);return L.createElement("svg",gP({},He(u,!0,"svg"),{className:h,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),L.createElement("title",null,l),L.createElement("desc",null,c),t)}var jEe=["children","className"];function vP(){return vP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vP.apply(this,arguments)}function _Ee(e,t){if(e==null)return{};var n=SEe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function SEe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Ct=L.forwardRef(function(e,t){var n=e.children,r=e.className,i=_Ee(e,jEe),a=mt("recharts-layer",r);return L.createElement("g",vP({className:a},He(i,!0),{ref:t}),n)}),lo=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a]};function kEe(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}var NEe=kEe,CEe=NEe;function AEe(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:CEe(e,t,n)}var TEe=AEe,EEe="\\ud800-\\udfff",PEe="\\u0300-\\u036f",OEe="\\ufe20-\\ufe2f",IEe="\\u20d0-\\u20ff",REe=PEe+OEe+IEe,DEe="\\ufe0e\\ufe0f",MEe="\\u200d",$Ee=RegExp("["+MEe+EEe+REe+DEe+"]");function LEe(e){return $Ee.test(e)}var TX=LEe;function FEe(e){return e.split("")}var zEe=FEe,EX="\\ud800-\\udfff",BEe="\\u0300-\\u036f",VEe="\\ufe20-\\ufe2f",WEe="\\u20d0-\\u20ff",UEe=BEe+VEe+WEe,qEe="\\ufe0e\\ufe0f",HEe="["+EX+"]",xP="["+UEe+"]",bP="\\ud83c[\\udffb-\\udfff]",KEe="(?:"+xP+"|"+bP+")",PX="[^"+EX+"]",OX="(?:\\ud83c[\\udde6-\\uddff]){2}",IX="[\\ud800-\\udbff][\\udc00-\\udfff]",GEe="\\u200d",RX=KEe+"?",DX="["+qEe+"]?",YEe="(?:"+GEe+"(?:"+[PX,OX,IX].join("|")+")"+DX+RX+")*",QEe=DX+RX+YEe,XEe="(?:"+[PX+xP+"?",xP,OX,IX,HEe].join("|")+")",ZEe=RegExp(bP+"(?="+bP+")|"+XEe+QEe,"g");function JEe(e){return e.match(ZEe)||[]}var ePe=JEe,tPe=zEe,nPe=TX,rPe=ePe;function iPe(e){return nPe(e)?rPe(e):tPe(e)}var sPe=iPe,aPe=TEe,oPe=TX,lPe=sPe,cPe=jX;function uPe(e){return function(t){t=cPe(t);var n=oPe(t)?lPe(t):void 0,r=n?n[0]:t.charAt(0),i=n?aPe(n,1).join(""):t.slice(1);return r[e]()+i}}var dPe=uPe,hPe=dPe,fPe=hPe("toUpperCase"),pPe=fPe;const RS=Ot(pPe);function dn(e){return function(){return e}}const MX=Math.cos,Wj=Math.sin,_o=Math.sqrt,Uj=Math.PI,DS=2*Uj,wP=Math.PI,jP=2*wP,cd=1e-6,mPe=jP-cd;function $X(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function gPe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return $X;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class yPe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?$X:gPe(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,c=r-t,u=i-n,d=o-t,h=l-n,f=d*d+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>cd)if(!(Math.abs(h*c-u*d)>cd)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-o,m=i-l,g=c*c+u*u,y=p*p+m*m,b=Math.sqrt(g),v=Math.sqrt(f),w=a*Math.tan((wP-Math.acos((g+f-y)/(2*b*v)))/2),_=w/v,j=w/b;Math.abs(_-1)>cd&&this._append`L${t+_*d},${n+_*h}`,this._append`A${a},${a},0,0,${+(h*p>d*m)},${this._x1=t+j*c},${this._y1=n+j*u}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),u=t+l,d=n+c,h=1^o,f=o?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>cd||Math.abs(this._y1-d)>cd)&&this._append`L${u},${d}`,r&&(f<0&&(f=f%jP+jP),f>mPe?this._append`A${r},${r},0,1,${h}
729,${t-l},${n-c}A${r},${r},0,1,${h},${this._x1=u},${this._y1=d}`:f>cd&&this._append`A${r},${r},0,${+(f>=wP)},${h},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function rD(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new yPe(t)}function iD(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function LX(e){this._context=e}LX.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 MS(e){return new LX(e)}function FX(e){return e[0]}function zX(e){return e[1]}function BX(e,t){var n=dn(!0),r=null,i=MS,a=null,o=rD(l);e=typeof e=="function"?e:e===void 0?FX:dn(e),t=typeof t=="function"?t:t===void 0?zX:dn(t);function l(c){var u,d=(c=iD(c)).length,h,f=!1,p;for(r==null&&(a=i(p=o())),u=0;u<=d;++u)!(u<d&&n(h=c[u],u,c))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+e(h,u,c),+t(h,u,c));if(p)return a=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:dn(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:dn(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:dn(!!c),l):n},l.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),l):i},l.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),l):r},l}function O0(e,t,n){var r=null,i=dn(!0),a=null,o=MS,l=null,c=rD(u);e=typeof e=="function"?e:e===void 0?FX:dn(+e),t=typeof t=="function"?t:dn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?zX:dn(+n);function u(h){var f,p,m,g=(h=iD(h)).length,y,b=!1,v,w=new Array(g),_=new Array(g);for(a==null&&(l=o(v=c())),f=0;f<=g;++f){if(!(f<g&&i(y=h[f],f,h))===b)if(b=!b)p=f,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),m=f-1;m>=p;--m)l.point(w[m],_[m]);l.lineEnd(),l.areaEnd()}b&&(w[f]=+e(y,f,h),_[f]=+t(y,f,h),l.point(r?+r(y,f,h):w[f],n?+n(y,f,h):_[f]))}if(v)return l=null,v+""||null}function d(){return BX().defined(i).curve(o).context(a)}return u.x=function(h){return arguments.length?(e=typeof h=="function"?h:dn(+h),r=null,u):e},u.x0=function(h){return arguments.length?(e=typeof h=="function"?h:dn(+h),u):e},u.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:dn(+h),u):r},u.y=function(h){return arguments.length?(t=typeof h=="function"?h:dn(+h),n=null,u):t},u.y0=function(h){return arguments.length?(t=typeof h=="function"?h:dn(+h),u):t},u.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:dn(+h),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(h){return arguments.length?(i=typeof h=="function"?h:dn(!!h),u):i},u.curve=function(h){return arguments.length?(o=h,a!=null&&(l=o(a)),u):o},u.context=function(h){return arguments.length?(h==null?a=l=null:l=o(a=h),u):a},u}class VX{constructor(t,n){this._context=t,this._x=n}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,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function vPe(e){return new VX(e,!0)}function xPe(e){return new VX(e,!1)}const sD={draw(e,t){const n=_o(t/Uj);e.moveTo(n,0),e.arc(0,0,n,0,DS)}},bPe={draw(e,t){const n=_o(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},WX=_o(1/3),wPe=WX*2,jPe={draw(e,t){const n=_o(t/wPe),r=n*WX;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},_Pe={draw(e,t){const n=_o(t),r=-n/2;e.rect(r,r,n,n)}},SPe=.8908130915292852,UX=Wj(Uj/10)/Wj(7*Uj/10),kPe=Wj(DS/10)*UX,NPe=-MX(DS/10)*UX,CPe={draw(e,t){const n=_o(t*SPe),r=kPe*n,i=NPe*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=DS*a/5,l=MX(o),c=Wj(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},xC=_o(3),APe={draw(e,t){const n=-_o(t/(xC*3));e.moveTo(0,n*2),e.lineTo(-xC*n,-n),e.lineTo(xC*n,-n),e.closePath()}},na=-.5,ra=_o(3)/2,_P=1/_o(12),TPe=(_P/2+1)*3,EPe={draw(e,t){const n=_o(t/TPe),r=n/2,i=n*_P,a=r,o=n*_P+n,l=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(na*r-ra*i,ra*r
vendor: 6,947 bytes, line 729
729+na*i),e.lineTo(na*a-ra*o,ra*a+na*o),e.lineTo(na*l-ra*c,ra*l+na*c),e.lineTo(na*r+ra*i,na*i-ra*r),e.lineTo(na*a+ra*o,na*o-ra*a),e.lineTo(na*l+ra*c,na*c-ra*l),e.closePath()}};function PPe(e,t){let n=null,r=rD(i);e=typeof e=="function"?e:dn(e||sD),t=typeof t=="function"?t:dn(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:dn(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:dn(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function qj(){}function Hj(e,t,n){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+n)/6)}function qX(e){this._context=e}qX.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(){switch(this._point){case 3:Hj(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:Hj(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OPe(e){return new qX(e)}function HX(e){this._context=e}HX.prototype={areaStart:qj,areaEnd:qj,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:Hj(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function IPe(e){return new HX(e)}function KX(e){this._context=e}KX.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 n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Hj(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function RPe(e){return new KX(e)}function GX(e){this._context=e}GX.prototype={areaStart:qj,areaEnd:qj,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 DPe(e){return new GX(e)}function F5(e){return e<0?-1:1}function z5(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),l=(a*i+o*r)/(r+i);return(F5(a)+F5(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function B5(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function bC(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,i+l*t,a-l,o-l*n,a,o)}function Kj(e){this._context=e}Kj.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:bC(this,this._t0,B5(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 n=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,bC(this,B5(this,n=z5(this,e,t)),n);break;default:bC(this,this._t0,n=z5(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function YX(e){this._context=new QX(e)}(YX.prototype=Object.create(Kj.prototype)).point=function(e,t){Kj.prototype.point.call(this,t,e)};function QX(e){this._context=e}QX.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,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function MPe(e){return new Kj(e)}function $Pe(e){return new YX(e)}function XX(e){this._context=e}XX.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,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=V5(e),i=V5(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===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 V5(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function LPe(e){return new XX(e)}function $S(e,t){this._context=e,this._t=t}$S.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 729-732
729default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function FPe(e){return new $S(e,.5)}function zPe(e){return new $S(e,0)}function BPe(e){return new $S(e,1)}function Zp(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,l=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function SP(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function VPe(e,t){return e[t]}function WPe(e){const t=[];return t.key=e,t}function UPe(){var e=dn([]),t=SP,n=Zp,r=VPe;function i(a){var o=Array.from(e.apply(this,arguments),WPe),l,c=o.length,u=-1,d;for(const h of a)for(l=0,++u;l<c;++l)(o[l][u]=[0,+r(h,o[l].key,u,a)]).data=h;for(l=0,d=iD(t(o));l<c;++l)o[d[l]].index=l;return n(o,d),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:dn(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:dn(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?SP:typeof a=="function"?a:dn(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Zp,i):n},i}function qPe(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}Zp(e,t)}}function HPe(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,l=0;o<i;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}Zp(e,t)}}function KPe(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var l=0,c=0,u=0;l<o;++l){for(var d=e[t[l]],h=d[r][1]||0,f=d[r-1][1]||0,p=(h-f)/2,m=0;m<l;++m){var g=e[t[m]],y=g[r][1]||0,b=g[r-1][1]||0;p+=y-b}c+=h,u+=p*h}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,Zp(e,t)}}function tx(e){"@babel/helpers - typeof";return tx=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},tx(e)}var GPe=["type","size","sizeType"];function kP(){return kP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kP.apply(this,arguments)}function W5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function U5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W5(Object(n),!0).forEach(function(r){YPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YPe(e,t,n){return t=QPe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QPe(e){var t=XPe(e,"string");return tx(t)=="symbol"?t:t+""}function XPe(e,t){if(tx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(tx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ZPe(e,t){if(e==null)return{};var n=JPe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function JPe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ZX={symbolCircle:sD,symbolCross:bPe,symbolDiamond:jPe,symbolSquare:_Pe,symbolStar:CPe,symbolTriangle:APe,symbolWye:EPe},e2e=Math.PI/180,t2e=function(t){var n="symbol".concat(RS(t));return ZX[n]||sD},n2e=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*e2e;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),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}},r2e=function(t,n){ZX["symbol".concat(RS(t))]=n},aD=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,a=i===void 0?64:i,o=t.sizeType,l=o===void 0?"area":o,c=ZPe(t,GPe),u=U5(U5({},c),{},{type:r,size:a,sizeType:l}),d=function(){var y=t2e(r),b=PPe().type(y).size(n2e(a,l,r));return b()},h=u.className,f=u.cx,p=u.cy,m=He(u,!0);return f===+f&&p===+p&&a===+a?L.createElement("path",kP({},m,{className:mt("recharts-symbols",h),transform:"translate(".concat(f,", ").concat(p,")"),d:d()})):null};aD.registerSymbol=r2e;function Jp(e){"@babel/helpers - typeof";return Jp=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},Jp(e)}function NP(){return NP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NP.apply(this,arguments)}function q5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function i2e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q5(Object(n),!0).forEach(function(r){nx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function s2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a2e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eZ(r.key),r)}}function o2e(e,t,n){return t&&a2e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function l2e(e,t,n){return t=Gj(t),c2e(e,JX()?Reflect.construct(t,n||[],Gj(e).constructor):t.apply(e,n))}function c2e(e,t){if(t&&(Jp(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return u2e(e)}function u2e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JX(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JX=function(){return!!e})()}function Gj(e){return Gj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Gj(e)}function d2e(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&&CP(e,t)}function CP(e,t){return CP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},CP(e,t)}function nx(e,t,n){return t=eZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eZ(e){var t=h2e(e,"string");return Jp(t)=="symbol"?t:t+""}function h2e(e,t){if(Jp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Jp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ia=32,oD=function(e){function t(){return s2e(this,t),l2e(this,t,arguments)}return d2e(t,e),o2e(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,a=ia/2,o=ia/6,l=ia/3,c=r.inactive?i:r.color;if(r.type==="plainline")return L.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:ia,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return L.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(l,`
730            A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(a,`
731            H`).concat(ia,"M").concat(2*l,",").concat(a,`
732            A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return L.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(ia/8,"h").concat(ia,"v").concat(ia*3/4,"h").concat(-ia,"z"),className:"recharts-legend-icon"});if(L.isValidElement(r.legendIcon)){var u=i2e({},r);return delete u.legendIcon,L.cloneElement(r.legendIcon,u)}return L.createElement(aD,{fill:c,cx:a,cy:a,size:ia,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,a=i.payload,o=i.iconSize,l=i.layout,c=i.formatter,u=i.inactiveColor,d={x:0,y:0,width:ia,height:ia}
732,h={display:l==="horizontal"?"inline-block":"block",marginRight:10},f={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(p,m){var g=p.formatter||c,y=mt(nx(nx({"recharts-legend-item":!0},"legend-item-".concat(m),!0),"inactive",p.inactive));if(p.type==="none")return null;var b=tt(p.value)?null:p.value;lo(!tt(p.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 v=p.inactive?u:p.color;return L.createElement("li",NP({className:y,style:h,key:"legend-item-".concat(m)},yh(r.props,p,m)),L.createElement(yP,{width:o,height:o,viewBox:d,style:f},r.renderIcon(p)),L.createElement("span",{className:"recharts-legend-item-text",style:{color:v}},g?g(b,p,m):b))})}},{key:"render",value:function(){var r=this.props,i=r.payload,a=r.layout,o=r.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return L.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(x.PureComponent);nx(oD,"displayName","Legend");nx(oD,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var f2e=wS;function p2e(){this.__data__=new f2e,this.size=0}var m2e=p2e;function g2e(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var y2e=g2e;function v2e(e){return this.__data__.get(e)}var x2e=v2e;function b2e(e){return this.__data__.has(e)}var w2e=b2e,j2e=wS,_2e=GR,S2e=YR,k2e=200;function N2e(e,t){var n=this.__data__;if(n instanceof j2e){var r=n.__data__;if(!_2e||r.length<k2e-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new S2e(r)}return n.set(e,t),this.size=n.size,this}var C2e=N2e,A2e=wS,T2e=m2e,E2e=y2e,P2e=x2e,O2e=w2e,I2e=C2e;function gg(e){var t=this.__data__=new A2e(e);this.size=t.size}gg.prototype.clear=T2e;gg.prototype.delete=E2e;gg.prototype.get=P2e;gg.prototype.has=O2e;gg.prototype.set=I2e;var tZ=gg,R2e="__lodash_hash_undefined__";function D2e(e){return this.__data__.set(e,R2e),this}var M2e=D2e;function $2e(e){return this.__data__.has(e)}var L2e=$2e,F2e=YR,z2e=M2e,B2e=L2e;function Yj(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new F2e;++t<n;)this.add(e[t])}Yj.prototype.add=Yj.prototype.push=z2e;Yj.prototype.has=B2e;var nZ=Yj;function V2e(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var rZ=V2e;function W2e(e,t){return e.has(t)}var iZ=W2e,U2e=nZ,q2e=rZ,H2e=iZ,K2e=1,G2e=2;function Y2e(e,t,n,r,i,a){var o=n&K2e,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=n&G2e?new U2e:void 0;for(a.set(e,t),a.set(t,e);++h<l;){var m=e[h],g=t[h];if(r)var y=o?r(g,m,h,t,e,a):r(m,g,h,e,t,a);if(y!==void 0){if(y)continue;f=!1;break}if(p){if(!q2e(t,function(b,v){if(!H2e(p,v)&&(m===b||i(m,b,n,r,a)))return p.push(v)})){f=!1;break}}else if(!(m===g||i(m,g,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}var sZ=Y2e,Q2e=al,X2e=Q2e.Uint8Array,Z2e=X2e;function J2e(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var eOe=J2e;function tOe(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var lD=tOe,H5=vb,K5=Z2e,nOe=KR,rOe=sZ,iOe=eOe,sOe=lD,aOe=1,oOe=2,lOe="[object Boolean]",cOe="[object Date]",uOe="[object Error]",dOe="[object Map]",hOe="[object Number]",fOe="[object RegExp]",pOe="[object Set]",mOe="[object String]",gOe="[object Symbol]",yOe="[object ArrayBuffer]",vOe="[object DataView]",G5=H5?H5.prototype:void 0,wC=G5?G5.valueOf:void 0;function xOe(e,t,n,r,i,a,o){switch(n){case vOe:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case yOe:return!(e.byteLength!=t.byteLength||!a(new K5(e),new K5(t)));case lOe:case cOe:case hOe:return nOe(+e,+t);case uOe:return e.name==t.name&&e.message==t.message;case fOe:case mOe:return e==t+"";case dOe:var l=iOe;case pOe:var c=r&aOe;if(l||(l=sOe),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;r|=oOe,o.set(e,t);var d=rOe(l(e),l(t),r,i,a,o);return o.delete(e),d;case gOe:if(wC)return wC.call(e)==wC.call(t)}return!1}var bOe=xOe;function wOe(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var aZ=wOe,jOe=aZ,_Oe=ms;function SOe(e,t,n){var r=t(e);return _Oe(e)?r:jOe(r,n(e))}var kOe=SOe;function NOe(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}var COe=NOe;function AOe(){return[]}var TOe=AOe,EOe=COe,POe=TOe,OOe=Object.prototype,IOe=OOe.propertyIsEnumerable,Y5=Object.getOwnPropertySymbols,ROe=Y5?function(e){return e==null?[]:(e=Object(e),EOe(Y5(e),function(t){return IOe.call(e,t)}))}:POe,DOe=ROe;function MOe(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var $Oe=MOe,LOe=ic,FOe=sc,zOe="[object Arguments]";function BOe(e){return FOe(e)&&LOe(e)==zOe}var VOe=BOe,Q5=VOe,WOe=sc,oZ=Object.prototype,UOe=oZ.hasOwnProperty,qOe=oZ.propertyIsEnumerable,HOe=Q5(function(){return arguments}())?Q5:function(e){return WOe(e)&&UOe.call(e,"callee")&&!qOe.call(e,"callee")},cD=HOe,Qj={exports:{}};function KOe(){return!1}var GOe=KOe;Qj.exports;(function(e,t){var n=al,r=GOe,i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===i,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;e.exports=u}
vendor: 4,576 bytes, line 732
732)(Qj,Qj.exports);var lZ=Qj.exports,YOe=9007199254740991,QOe=/^(?:0|[1-9]\d*)$/;function XOe(e,t){var n=typeof e;return t=t??YOe,!!t&&(n=="number"||n!="symbol"&&QOe.test(e))&&e>-1&&e%1==0&&e<t}var uD=XOe,ZOe=9007199254740991;function JOe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ZOe}var dD=JOe,eIe=ic,tIe=dD,nIe=sc,rIe="[object Arguments]",iIe="[object Array]",sIe="[object Boolean]",aIe="[object Date]",oIe="[object Error]",lIe="[object Function]",cIe="[object Map]",uIe="[object Number]",dIe="[object Object]",hIe="[object RegExp]",fIe="[object Set]",pIe="[object String]",mIe="[object WeakMap]",gIe="[object ArrayBuffer]",yIe="[object DataView]",vIe="[object Float32Array]",xIe="[object Float64Array]",bIe="[object Int8Array]",wIe="[object Int16Array]",jIe="[object Int32Array]",_Ie="[object Uint8Array]",SIe="[object Uint8ClampedArray]",kIe="[object Uint16Array]",NIe="[object Uint32Array]",jn={};jn[vIe]=jn[xIe]=jn[bIe]=jn[wIe]=jn[jIe]=jn[_Ie]=jn[SIe]=jn[kIe]=jn[NIe]=!0;jn[rIe]=jn[iIe]=jn[gIe]=jn[sIe]=jn[yIe]=jn[aIe]=jn[oIe]=jn[lIe]=jn[cIe]=jn[uIe]=jn[dIe]=jn[hIe]=jn[fIe]=jn[pIe]=jn[mIe]=!1;function CIe(e){return nIe(e)&&tIe(e.length)&&!!jn[eIe(e)]}var AIe=CIe;function TIe(e){return function(t){return e(t)}}var cZ=TIe,Xj={exports:{}};Xj.exports;(function(e,t){var n=gX,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===r,o=a&&n.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(Xj,Xj.exports);var EIe=Xj.exports,PIe=AIe,OIe=cZ,X5=EIe,Z5=X5&&X5.isTypedArray,IIe=Z5?OIe(Z5):PIe,uZ=IIe,RIe=$Oe,DIe=cD,MIe=ms,$Ie=lZ,LIe=uD,FIe=uZ,zIe=Object.prototype,BIe=zIe.hasOwnProperty;function VIe(e,t){var n=MIe(e),r=!n&&DIe(e),i=!n&&!r&&$Ie(e),a=!n&&!r&&!i&&FIe(e),o=n||r||i||a,l=o?RIe(e.length,String):[],c=l.length;for(var u in e)(t||BIe.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||LIe(u,c)))&&l.push(u);return l}var WIe=VIe,UIe=Object.prototype;function qIe(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||UIe;return e===n}var HIe=qIe;function KIe(e,t){return function(n){return e(t(n))}}var dZ=KIe,GIe=dZ,YIe=GIe(Object.keys,Object),QIe=YIe,XIe=HIe,ZIe=QIe,JIe=Object.prototype,eRe=JIe.hasOwnProperty;function tRe(e){if(!XIe(e))return ZIe(e);var t=[];for(var n in Object(e))eRe.call(e,n)&&n!="constructor"&&t.push(n);return t}var nRe=tRe,rRe=HR,iRe=dD;function sRe(e){return e!=null&&iRe(e.length)&&!rRe(e)}var xb=sRe,aRe=WIe,oRe=nRe,lRe=xb;function cRe(e){return lRe(e)?aRe(e):oRe(e)}var LS=cRe,uRe=kOe,dRe=DOe,hRe=LS;function fRe(e){return uRe(e,hRe,dRe)}var pRe=fRe,J5=pRe,mRe=1,gRe=Object.prototype,yRe=gRe.hasOwnProperty;function vRe(e,t,n,r,i,a){var o=n&mRe,l=J5(e),c=l.length,u=J5(t),d=u.length;if(c!=d&&!o)return!1;for(var h=c;h--;){var f=l[h];if(!(o?f in t:yRe.call(t,f)))return!1}var p=a.get(e),m=a.get(t);if(p&&m)return p==t&&m==e;var g=!0;a.set(e,t),a.set(t,e);for(var y=o;++h<c;){f=l[h];var b=e[f],v=t[f];if(r)var w=o?r(v,b,f,t,e,a):r(b,v,f,e,t,a);if(!(w===void 0?b===v||i(b,v,n,r,a):w)){g=!1;break}y||(y=f=="constructor")}if(g&&!y){var _=e.constructor,j=t.constructor;_!=j&&"constructor"in e&&"constructor"in t&&!(typeof _=="function"&&_ instanceof _&&typeof j=="function"&&j instanceof j)&&(g=!1)}return a.delete(e),a.delete(t),g}var xRe=vRe,bRe=Dh,wRe=al,jRe=bRe(wRe,"DataView"),_Re=jRe,SRe=Dh,kRe=al,NRe=SRe(kRe,"Promise"),CRe=NRe,ARe=Dh,TRe=al,ERe=ARe(TRe,"Set"),hZ=ERe,PRe=Dh,ORe=al,IRe=PRe(ORe,"WeakMap"),RRe=IRe,AP=_Re,TP=GR,EP=CRe,PP=hZ,OP=RRe,fZ=ic,yg=vX,ez="[object Map]",DRe="[object Object]",tz="[object Promise]",nz="[object Set]",rz="[object WeakMap]",iz="[object DataView]",MRe=yg(AP),$Re=yg(TP),LRe=yg(EP),FRe=yg(PP),zRe=yg(OP),ud=fZ;(AP&&ud(new AP(new ArrayBuffer(1)))!=iz||TP&&ud(new TP)!=ez||EP&&ud(EP.resolve())!=tz||PP&&ud(new PP)!=nz||OP&&ud(new OP)!=rz)&&(ud=function(e){var t=fZ(e),n=t==DRe?e.constructor:void 0,r=n?yg(n):"";if(r)switch(r){case MRe:return iz;case $Re:return ez;case LRe:return tz;case FRe:return nz;case zRe:return rz}return t});var BRe=ud,jC=tZ,VRe=sZ,WRe=bOe,URe=xRe,sz=BRe,az=ms,oz=lZ,qRe=uZ,HRe=1,lz="[object Arguments]",cz="[object Array]",I0="[object Object]",KRe=Object.prototype,uz=KRe.hasOwnProperty;function GRe(e,t,n,r,i,a){var o=az(e),l=az(t),c=o?cz:sz(e),u=l?cz:sz(t);c=c==lz?I0:c,u=u==lz?I0:u;var d=c==I0,h=u==I0,f=c==u;if(f&&oz(e)){if(!oz(t))return!1;o=!0,d=!1}if(f&&!d)return a||(a=new jC),o||qRe(e)?VRe(e,t,n,r,i,a):WRe(e,t,c,n,r,i,a);if(!(n&HRe)){var p=d&&uz.call(e,"__wrapped__"),m=h&&uz.call(t,"__wrapped__");
vendor: 3,010 bytes, line 732
732if(p||m){var g=p?e.value():e,y=m?t.value():t;return a||(a=new jC),i(g,y,n,r,a)}}return f?(a||(a=new jC),URe(e,t,n,r,i,a)):!1}var YRe=GRe,QRe=YRe,dz=sc;function pZ(e,t,n,r,i){return e===t?!0:e==null||t==null||!dz(e)&&!dz(t)?e!==e&&t!==t:QRe(e,t,n,r,pZ,i)}var hD=pZ,XRe=tZ,ZRe=hD,JRe=1,eDe=2;function tDe(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var l=n[i];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<a;){l=n[i];var c=l[0],u=e[c],d=l[1];if(o&&l[2]){if(u===void 0&&!(c in e))return!1}else{var h=new XRe;if(r)var f=r(u,d,c,e,t,h);if(!(f===void 0?ZRe(d,u,JRe|eDe,r,h):f))return!1}}return!0}var nDe=tDe,rDe=Lu;function iDe(e){return e===e&&!rDe(e)}var mZ=iDe,sDe=mZ,aDe=LS;function oDe(e){for(var t=aDe(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,sDe(i)]}return t}var lDe=oDe;function cDe(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var gZ=cDe,uDe=nDe,dDe=lDe,hDe=gZ;function fDe(e){var t=dDe(e);return t.length==1&&t[0][2]?hDe(t[0][0],t[0][1]):function(n){return n===e||uDe(n,e,t)}}var pDe=fDe;function mDe(e,t){return e!=null&&t in Object(e)}var gDe=mDe,yDe=_X,vDe=cD,xDe=ms,bDe=uD,wDe=dD,jDe=_S;function _De(e,t,n){t=yDe(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=jDe(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&wDe(i)&&bDe(o,i)&&(xDe(e)||vDe(e)))}var SDe=_De,kDe=gDe,NDe=SDe;function CDe(e,t){return e!=null&&NDe(e,t,kDe)}var ADe=CDe,TDe=hD,EDe=SX,PDe=ADe,ODe=qR,IDe=mZ,RDe=gZ,DDe=_S,MDe=1,$De=2;function LDe(e,t){return ODe(e)&&IDe(t)?RDe(DDe(e),t):function(n){var r=EDe(n,e);return r===void 0&&r===t?PDe(n,e):TDe(t,r,MDe|$De)}}var FDe=LDe;function zDe(e){return e}var vg=zDe;function BDe(e){return function(t){return t==null?void 0:t[e]}}var VDe=BDe,WDe=ZR;function UDe(e){return function(t){return WDe(t,e)}}var qDe=UDe,HDe=VDe,KDe=qDe,GDe=qR,YDe=_S;function QDe(e){return GDe(e)?HDe(YDe(e)):KDe(e)}var XDe=QDe,ZDe=pDe,JDe=FDe,eMe=vg,tMe=ms,nMe=XDe;function rMe(e){return typeof e=="function"?e:e==null?eMe:typeof e=="object"?tMe(e)?JDe(e[0],e[1]):ZDe(e):nMe(e)}var ol=rMe;function iMe(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var yZ=iMe;function sMe(e){return e!==e}var aMe=sMe;function oMe(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var lMe=oMe,cMe=yZ,uMe=aMe,dMe=lMe;function hMe(e,t,n){return t===t?dMe(e,t,n):cMe(e,uMe,n)}var fMe=hMe,pMe=fMe;function mMe(e,t){var n=e==null?0:e.length;return!!n&&pMe(e,t,0)>-1}var gMe=mMe;function yMe(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var vMe=yMe;function xMe(){}var bMe=xMe,_C=hZ,wMe=bMe,jMe=lD,_Me=1/0,SMe=_C&&1/jMe(new _C([,-0]))[1]==_Me?function(e){return new _C(e)}:wMe,kMe=SMe,NMe=nZ,CMe=gMe,AMe=vMe,TMe=iZ,EMe=kMe,PMe=lD,OMe=200;function IMe(e,t,n){var r=-1,i=CMe,a=e.length,o=!0,l=[],c=l;if(n)o=!1,i=AMe;else if(a>=OMe){var u=t?null:EMe(e);if(u)return PMe(u);o=!1,i=TMe,c=new NMe}else c=t?[]:l;e:for(;++r<a;
vendor: 4,735 bytes, line 732
732){var d=e[r],h=t?t(d):d;if(d=n||d!==0?d:0,o&&h===h){for(var f=c.length;f--;)if(c[f]===h)continue e;t&&c.push(h),l.push(d)}else i(c,h,n)||(c!==l&&c.push(h),l.push(d))}return l}var RMe=IMe,DMe=ol,MMe=RMe;function $Me(e,t){return e&&e.length?MMe(e,DMe(t)):[]}var LMe=$Me;const hz=Ot(LMe);function vZ(e,t,n){return t===!0?hz(e,n):tt(t)?hz(e,t):e}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)}var FMe=["ref"];function fz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fz(Object(n),!0).forEach(function(r){FS(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zMe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pz(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bZ(r.key),r)}}function BMe(e,t,n){return t&&pz(e.prototype,t),n&&pz(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function VMe(e,t,n){return t=Zj(t),WMe(e,xZ()?Reflect.construct(t,n||[],Zj(e).constructor):t.apply(e,n))}function WMe(e,t){if(t&&(em(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return UMe(e)}function UMe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xZ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xZ=function(){return!!e})()}function Zj(e){return Zj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Zj(e)}function qMe(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&&IP(e,t)}function IP(e,t){return IP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},IP(e,t)}function FS(e,t,n){return t=bZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bZ(e){var t=HMe(e,"string");return em(t)=="symbol"?t:t+""}function HMe(e,t){if(em(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(em(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function KMe(e,t){if(e==null)return{};var n=GMe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function GMe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function YMe(e){return e.value}function QMe(e,t){if(L.isValidElement(e))return L.cloneElement(e,t);if(typeof e=="function")return L.createElement(e,t);t.ref;var n=KMe(t,FMe);return L.createElement(oD,n)}var mz=1,uu=function(e){function t(){var n;zMe(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=VMe(this,t,[].concat(i)),FS(n,"lastBoundingBox",{width:-1,height:-1}),n}return qMe(t,e),BMe(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>mz||Math.abs(i.height-this.lastBoundingBox.height)>mz)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}}
732,{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?fl({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,a=i.layout,o=i.align,l=i.verticalAlign,c=i.margin,u=i.chartWidth,d=i.chartHeight,h,f;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();h={left:((u||0)-p.width)/2}}else h=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var m=this.getBBoxSnapshot();f={top:((d||0)-m.height)/2}}else f=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return fl(fl({},h),f)}},{key:"render",value:function(){var r=this,i=this.props,a=i.content,o=i.width,l=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,h=fl(fl({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return L.createElement("div",{className:"recharts-legend-wrapper",style:h,ref:function(p){r.wrapperNode=p}},QMe(a,fl(fl({},this.props),{},{payload:vZ(d,u,YMe)})))}}],[{key:"getWithHeight",value:function(r,i){var a=fl(fl({},this.defaultProps),r.props),o=a.layout;return o==="vertical"&&ge(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}])}(x.PureComponent);FS(uu,"displayName","Legend");FS(uu,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var gz=vb,XMe=cD,ZMe=ms,yz=gz?gz.isConcatSpreadable:void 0;function JMe(e){return ZMe(e)||XMe(e)||!!(yz&&e&&e[yz])}var e$e=JMe,t$e=aZ,n$e=e$e;function wZ(e,t,n,r,i){var a=-1,o=e.length;for(n||(n=n$e),i||(i=[]);++a<o;){var l=e[a];t>0&&n(l)?t>1?wZ(l,t-1,n,r,i):t$e(i,l):r||(i[i.length]=l)}return i}var jZ=wZ;function r$e(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),l=o.length;l--;){var c=o[e?l:++i];if(n(a[c],c,a)===!1)break}return t}}var i$e=r$e,s$e=i$e,a$e=s$e(),o$e=a$e,l$e=o$e,c$e=LS;function u$e(e,t){return e&&l$e(e,t,c$e)}var _Z=u$e,d$e=xb;function h$e(e,t){return function(n,r){if(n==null)return n;if(!d$e(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var f$e=h$e,p$e=_Z,m$e=f$e,g$e=m$e(p$e),fD=g$e,y$e=fD,v$e=xb;function x$e(e,t){var n=-1,r=v$e(e)?Array(e.length):[];return y$e(e,function(i,a,o){r[++n]=t(i,a,o)}),r}var SZ=x$e;function b$e(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var w$e=b$e,vz=ug;function j$e(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=vz(e),o=t!==void 0,l=t===null,c=t===t,u=vz(t);if(!l&&!u&&!a&&e>t||a&&o&&c&&!l&&!u||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!u&&e<t||u&&n&&i&&!r&&!a||l&&n&&i||!o&&i||!c)return-1}return 0}var _$e=j$e,S$e=_$e;function k$e(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,l=n.length;++r<o;){var c=S$e(i[r],a[r]);if(c){if(r>=l)return c;var u=n[r];return c*(u=="desc"?-1:1)}}return e.index-t.index}var N$e=k$e,SC=XR,C$e=ZR,A$e=ol,T$e=SZ,E$e=w$e,P$e=cZ,O$e=N$e,I$e=vg,R$e=ms;function D$e(e,t,n){t.length?t=SC(t,function(a){return R$e(a)?function(o){return C$e(o,a.length===1?a[0]:a)}:a}):t=[I$e];var r=-1;t=SC(t,P$e(A$e));var i=T$e(e,function(a,o,l){var c=SC(t,function(u){return u(a)});return{criteria:c,index:++r,value:a}});return E$e(i,function(a,o){return O$e(a,o,n)})}var M$e=D$e;function $$e(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var L$e=$$e,F$e=L$e,xz=Math.max;function z$e(e,t,n){return t=xz(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=xz(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=r[i];return l[t]=n(o),F$e(e,this,l)}}var B$e=z$e;function V$e(e){return function(){return e}}var W$e=V$e,U$e=Dh,q$e=function(){try{var e=U$e(Object,"defineProperty");return e({},"",{}),e}catch{}}(),kZ=q$e,H$e=W$e,bz=kZ,K$e=vg,G$e=bz?function(e,t){return bz(e,"toString",{configurable:!0,enumerable:!1,value:H$e(t),writable:!0})}:K$e,Y$e=G$e,Q$e=800,X$e=16,Z$e=Date.now;function J$e(e){var t=0,n=0;return function(){var r=Z$e(),i=X$e-(r-n);if(n=r,i>0){if(++t>=Q$e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var eLe=J$e,tLe=Y$e,nLe=eLe,rLe=nLe(tLe),iLe=rLe,sLe=vg,aLe=B$e,oLe=iLe;function lLe(e,t){return oLe(aLe(e,t,sLe),e+"")}var cLe=lLe,uLe=KR,dLe=xb,hLe=uD,fLe=Lu;function pLe(e,t,n){if(!fLe(n))return!1;var r=typeof t;return(r=="number"?dLe(n)&&hLe(t,n.length):r=="string"&&t in n)?uLe(n[t],e):!1}var zS=pLe,mLe=jZ,gLe=M$e,yLe=cLe,wz=zS,vLe=yLe(function(e,t){if(e==null)return[];var n=t.length;return n>1&&wz(e,t[0],t[1])?t=[]:n>2&&wz(t[0],t[1],t[2])&&(t=[t[0]]),gLe(e,mLe(t,1),[])}),xLe=vLe;const pD=Ot(xLe);function rx(e){"@babel/helpers - typeof";return rx=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},rx(e)}function RP(){return RP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RP.apply(this,arguments)}function bLe(e,t){return SLe(e)||_Le(e,t)||jLe(e,t)||wLe()}
vendor: 29,552 bytes, lines 732-739
732function wLe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
733In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jLe(e,t){if(e){if(typeof e=="string")return jz(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jz(e,t)}}function jz(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _Le(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function SLe(e){if(Array.isArray(e))return e}function _z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_z(Object(n),!0).forEach(function(r){kLe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_z(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kLe(e,t,n){return t=NLe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NLe(e){var t=CLe(e,"string");return rx(t)=="symbol"?t:t+""}function CLe(e,t){if(rx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(rx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ALe(e){return Array.isArray(e)&&Dr(e[0])&&Dr(e[1])?e.join(" ~ "):e}var TLe=function(t){var n=t.separator,r=n===void 0?" : ":n,i=t.contentStyle,a=i===void 0?{}:i,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,h=t.formatter,f=t.itemSorter,p=t.wrapperClassName,m=t.labelClassName,g=t.label,y=t.labelFormatter,b=t.accessibilityLayer,v=b===void 0?!1:b,w=function(){if(d&&d.length){var O={padding:0,margin:0},z=(f?pD(d,f):d).map(function($,F){if($.type==="none")return null;var B=kC({display:"block",paddingTop:4,paddingBottom:4,color:$.color||"#000"},l),P=$.formatter||h||ALe,I=$.value,M=$.name,R=I,K=M;if(P&&R!=null&&K!=null){var D=P(I,M,$,F,d);if(Array.isArray(D)){var E=bLe(D,2);R=E[0],K=E[1]}else R=D}return L.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(F),style:B},Dr(K)?L.createElement("span",{className:"recharts-tooltip-item-name"},K):null,Dr(K)?L.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,L.createElement("span",{className:"recharts-tooltip-item-value"},R),L.createElement("span",{className:"recharts-tooltip-item-unit"},$.unit||""))});return L.createElement("ul",{className:"recharts-tooltip-item-list",style:O},z)}return null},_=kC({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),j=kC({margin:0},u),S=!dt(g),k=S?g:"",N=mt("recharts-default-tooltip",p),T=mt("recharts-tooltip-label",m);S&&y&&d!==void 0&&d!==null&&(k=y(g,d));var C=v?{role:"status","aria-live":"assertive"}:{};return L.createElement("div",RP({className:N,style:_},C),L.createElement("p",{className:T,style:j},L.isValidElement(k)?k:"".concat(k)),w())};function ix(e){"@babel/helpers - typeof";return ix=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},ix(e)}function R0(e,t,n){return t=ELe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ELe(e){var t=PLe(e,"string");return ix(t)=="symbol"?t:t+""}function PLe(e,t){if(ix(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ix(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hg="recharts-tooltip-wrapper",OLe={visibility:"hidden"};function ILe(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return mt(Hg,R0(R0(R0(R0({},"".concat(Hg,"-right"),ge(n)&&t&&ge(t.x)&&n>=t.x),"".concat(Hg,"-left"),ge(n)&&t&&ge(t.x)&&n<t.x),"".concat(Hg,"-bottom"),ge(r)&&t&&ge(t.y)&&r>=t.y),"".concat(Hg,"-top"),ge(r)&&t&&ge(t.y)&&r<t.y))}function Sz(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,a=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(a&&ge(a[r]))return a[r];var d=n[r]-l-i,h=n[r]+i;if(t[r])return o[r]?d:h;if(o[r]){var f=d,p=c[r];return f<p?Math.max(h,c[r]):Math.max(d,c[r])}var m=h+l,g=c[r]+u;return m>g?Math.max(d,c[r]):Math.max(h,c[r])}function RLe(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function DLe(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,h;return o.height>0&&o.width>0&&n?(d=Sz({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),h=Sz({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=RLe({translateX:d,translateY:h,useTranslate3d:l})):u=OLe,{cssProperties:u,cssClasses:ILe({translateX:d,translateY:h,coordinate:n})}}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 kz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Nz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kz(Object(n),!0).forEach(function(r){MP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MLe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $Le(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,CZ(r.key),r)}}function LLe(e,t,n){return t&&$Le(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function FLe(e,t,n){return t=Jj(t),zLe(e,NZ()?Reflect.construct(t,n||[],Jj(e).constructor):t.apply(e,n))}function zLe(e,t){if(t&&(tm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return BLe(e)}function BLe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NZ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(NZ=function(){return!!e})()}function Jj(e){return Jj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Jj(e)}function VLe(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&&DP(e,t)}function DP(e,t){return DP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},DP(e,t)}function MP(e,t,n){return t=CZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CZ(e){var t=WLe(e,"string");return tm(t)=="symbol"?t:t+""}function WLe(e,t){if(tm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(tm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Cz=1,ULe=function(e){function t(){var n;MLe(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=FLe(this,t,[].concat(i)),MP(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),MP(n,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,d;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=n.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),n}return VLe(t,e),LLe(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>Cz||Math.abs(r.height-this.state.lastBoundingBox.height)>Cz)&&this.setState({lastBoundingBox:{width:r.width,height:r.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 r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.children,d=i.coordinate,h=i.hasPayload,f=i.isAnimationActive,p=i.offset,m=i.position,g=i.reverseDirection,y=i.useTranslate3d,b=i.viewBox,v=i.wrapperStyle,w=DLe({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:p,position:m,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:b}),_=w.cssClasses,j=w.cssProperties,S=Nz(Nz({transition:f&&a?"transform ".concat(l,"ms ").concat(c):void 0},j),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&h?"visible":"hidden",position:"absolute",top:0,left:0},v);return L.createElement("div",{tabIndex:-1,className:_,style:S,ref:function(N){r.wrapperNode=N}},u)}}])}(x.PureComponent),qLe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},co={isSsr:qLe(),get:function(t){return co[t]},set:function(t,n){if(typeof t=="string")co[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(i){co[i]=t[i]})}}};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 Az(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Az(Object(n),!0).forEach(function(r){mD(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Az(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HLe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KLe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,TZ(r.key),r)}}function GLe(e,t,n){return t&&KLe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function YLe(e,t,n){return t=e1(t),QLe(e,AZ()?Reflect.construct(t,n||[],e1(e).constructor):t.apply(e,n))}function QLe(e,t){if(t&&(nm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return XLe(e)}function XLe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AZ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(AZ=function(){return!!e})()}function e1(e){return e1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},e1(e)}function ZLe(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&&$P(e,t)}function $P(e,t){return $P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},$P(e,t)}function mD(e,t,n){return t=TZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TZ(e){var t=JLe(e,"string");return nm(t)=="symbol"?t:t+""}function JLe(e,t){if(nm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(nm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function e4e(e){return e.dataKey}function t4e(e,t){return L.isValidElement(e)?L.cloneElement(e,t):typeof e=="function"?L.createElement(e,t):L.createElement(TLe,t)}var ts=function(e){function t(){return HLe(this,t),YLe(this,t,arguments)}return ZLe(t,e),GLe(t,[{key:"render",value:function(){var r=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.content,d=i.coordinate,h=i.filterNull,f=i.isAnimationActive,p=i.offset,m=i.payload,g=i.payloadUniqBy,y=i.position,b=i.reverseDirection,v=i.useTranslate3d,w=i.viewBox,_=i.wrapperStyle,j=m??[];h&&j.length&&(j=vZ(m.filter(function(k){return k.value!=null&&(k.hide!==!0||r.props.includeHidden)}),g,e4e));var S=j.length>0;return L.createElement(ULe,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:f,active:a,coordinate:d,hasPayload:S,offset:p,position:y,reverseDirection:b,useTranslate3d:v,viewBox:w,wrapperStyle:_},t4e(u,Tz(Tz({},this.props),{},{payload:j})))}}])}(x.PureComponent);mD(ts,"displayName","Tooltip");mD(ts,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!co.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 n4e=al,r4e=function(){return n4e.Date.now()},i4e=r4e,s4e=/\s/;function a4e(e){for(var t=e.length;t--&&s4e.test(e.charAt(t)););return t}var o4e=a4e,l4e=o4e,c4e=/^\s+/;function u4e(e){return e&&e.slice(0,l4e(e)+1).replace(c4e,"")}var d4e=u4e,h4e=d4e,Ez=Lu,f4e=ug,Pz=NaN,p4e=/^[-+]0x[0-9a-f]+$/i,m4e=/^0b[01]+$/i,g4e=/^0o[0-7]+$/i,y4e=parseInt;function v4e(e){if(typeof e=="number")return e;if(f4e(e))return Pz;if(Ez(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ez(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=h4e(e);var n=m4e.test(e);return n||g4e.test(e)?y4e(e.slice(2),n?2:8):p4e.test(e)?Pz:+e}var EZ=v4e,x4e=Lu,NC=i4e,Oz=EZ,b4e="Expected a function",w4e=Math.max,j4e=Math.min;function _4e(e,t,n){var r,i,a,o,l,c,u=0,d=!1,h=!1,f=!0;if(typeof e!="function")throw new TypeError(b4e);t=Oz(t)||0,x4e(n)&&(d=!!n.leading,h="maxWait"in n,a=h?w4e(Oz(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f);function p(S){var k=r,N=i;return r=i=void 0,u=S,o=e.apply(N,k),o}function m(S){return u=S,l=setTimeout(b,t),d?p(S):o}function g(S){var k=S-c,N=S-u,T=t-k;return h?j4e(T,a-N):T}function y(S){var k=S-c,N=S-u;return c===void 0||k>=t||k<0||h&&N>=a}function b(){var S=NC();if(y(S))return v(S);l=setTimeout(b,g(S))}function v(S){return l=void 0,f&&r?p(S):(r=i=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,r=c=i=l=void 0}function _(){return l===void 0?o:v(NC())}function j(){var S=NC(),k=y(S);if(r=arguments,i=this,c=S,k){if(l===void 0)return m(c);if(h)return clearTimeout(l),l=setTimeout(b,t),p(c)}return l===void 0&&(l=setTimeout(b,t)),o}return j.cancel=w,j.flush=_,j}var S4e=_4e,k4e=S4e,N4e=Lu,C4e="Expected a function";function A4e(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(C4e);return N4e(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),k4e(e,t,{leading:r,maxWait:t,trailing:i})}var T4e=A4e;const PZ=Ot(T4e);function sx(e){"@babel/helpers - typeof";return sx=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},sx(e)}function Iz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function D0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Iz(Object(n),!0).forEach(function(r){E4e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function E4e(e,t,n){return t=P4e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P4e(e){var t=O4e(e,"string");return sx(t)=="symbol"?t:t+""}function O4e(e,t){if(sx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(sx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function I4e(e,t){return $4e(e)||M4e(e,t)||D4e(e,t)||R4e()}function R4e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
734In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D4e(e,t){if(e){if(typeof e=="string")return Rz(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rz(e,t)}}function Rz(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function M4e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function $4e(e){if(Array.isArray(e))return e}var bb=x.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,a=e.width,o=a===void 0?"100%":a,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,h=e.minHeight,f=e.maxHeight,p=e.children,m=e.debounce,g=m===void 0?0:m,y=e.id,b=e.className,v=e.onResize,w=e.style,_=w===void 0?{}:w,j=x.useRef(null),S=x.useRef();S.current=v,x.useImperativeHandle(t,function(){return Object.defineProperty(j.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),j.current},configurable:!0})});var k=x.useState({containerWidth:i.width,containerHeight:i.height}),N=I4e(k,2),T=N[0],C=N[1],A=x.useCallback(function(z,$){C(function(F){var B=Math.round(z),P=Math.round($);return F.containerWidth===B&&F.containerHeight===P?F:{containerWidth:B,containerHeight:P}})},[]);x.useEffect(function(){var z=function(M){var R,K=M[0].contentRect,D=K.width,E=K.height;A(D,E),(R=S.current)===null||R===void 0||R.call(S,D,E)};g>0&&(z=PZ(z,g,{trailing:!0,leading:!1}));var $=new ResizeObserver(z),F=j.current.getBoundingClientRect(),B=F.width,P=F.height;return A(B,P),$.observe(j.current),function(){$.disconnect()}},[A,g]);var O=x.useMemo(function(){var z=T.containerWidth,$=T.containerHeight;if(z<0||$<0)return null;lo(kd(o)||kd(c),`The width(%s) and height(%s) are both fixed numbers,
735       maybe you don't need to use a ResponsiveContainer.`,o,c),lo(!n||n>0,"The aspect(%s) must be greater than zero.",n);var F=kd(o)?z:o,B=kd(c)?$:c;n&&n>0&&(F?B=F/n:B&&(F=B*n),f&&B>f&&(B=f)),lo(F>0||B>0,`The width(%s) and height(%s) of chart should be greater than 0,
736       please check the style of container, or the props width(%s) and height(%s),
737       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
738       height and width.`,F,B,o,c,d,h,n);var P=!Array.isArray(p)&&Dl(p.type).endsWith("Chart");return L.Children.map(p,function(I){return L.isValidElement(I)?x.cloneElement(I,D0({width:F,height:B},P?{style:D0({height:"100%",width:"100%",maxHeight:B,maxWidth:F},I.props.style)}:{})):I})},[n,p,c,f,h,d,T,o]);return L.createElement("div",{id:y?"".concat(y):void 0,className:mt("recharts-responsive-container",b),style:D0(D0({},_),{},{width:o,height:c,minWidth:d,minHeight:h,maxHeight:f}),ref:j},O)}),xg=function(t){return null};xg.displayName="Cell";function ax(e){"@babel/helpers - typeof";return ax=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},ax(e)}function Dz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function LP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dz(Object(n),!0).forEach(function(r){L4e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function L4e(e,t,n){return t=F4e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F4e(e){var t=z4e(e,"string");return ax(t)=="symbol"?t:t+""}function z4e(e,t){if(ax(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ax(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sf={widthCache:{},cacheCount:0},B4e=2e3,V4e={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Mz="recharts_measurement_span";function W4e(e){var t=LP({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Yy=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||co.isSsr)return{width:0,height:0};var r=W4e(n),i=JSON.stringify({text:t,copyStyle:r});if(sf.widthCache[i])return sf.widthCache[i];try{var a=document.getElementById(Mz);a||(a=document.createElement("span"),a.setAttribute("id",Mz),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=LP(LP({},V4e),r);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return sf.widthCache[i]=c,++sf.cacheCount>B4e&&(sf.cacheCount=0,sf.widthCache={}),c}catch{return{width:0,height:0}}},U4e=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function ox(e){"@babel/helpers - typeof";return ox=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},ox(e)}function t1(e,t){return G4e(e)||K4e(e,t)||H4e(e,t)||q4e()}function q4e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
739In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function H4e(e,t){if(e){if(typeof e=="string")return $z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $z(e,t)}}function $z(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function K4e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function G4e(e){if(Array.isArray(e))return e}function Y4e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lz(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,X4e(r.key),r)}}function Q4e(e,t,n){return t&&Lz(e.prototype,t),n&&Lz(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function X4e(e){var t=Z4e(e,"string");return ox(t)=="symbol"?t:t+""}function Z4e(e,t){if(ox(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ox(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Fz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,zz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,J4e=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,eFe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,OZ={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},tFe=Object.keys(OZ),Gf="NaN";function nFe(e,t){return e*OZ[t]}var M0=function(){function e(t,n){Y4e(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!J4e.test(n)&&(this.num=NaN,this.unit=""),tFe.includes(n)&&(this.num=nFe(t,n),this.unit="px")}return Q4e(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.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(n){var r,i=(r=eFe.exec(n))!==null&&r!==void 0?r:[],a=t1(i,3),o=a[1],l=a[2];return new e(parseFloat(o),l??"")}}])}();function IZ(e){if(e.includes(Gf))return Gf;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=Fz.exec(t))!==null&&n!==void 0?n:[],i=t1(r,4),a=i[1],o=i[2],l=i[3],c=M0.parse(a??""),u=M0.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return Gf;t=t.replace(Fz,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,f=(h=zz.exec(t))!==null&&h!==void 0?h:[],p=t1(f,4),m=p[1],g=p[2],y=p[3],b=M0.parse(m??""),v=M0.parse(y??""),w=g==="+"?b.add(v):b.subtract(v);if(w.isNaN())return Gf;t=t.replace(zz,w.toString())}return t}var Bz=/\(([^()]*)\)/;function rFe(e){for(var t=e;t.includes("(");){var n=Bz.exec(t),r=t1(n,2),i=r[1];t=t.replace(Bz,IZ(i))}return t}function iFe(e){var t=e.replace(/\s+/g,"");return t=rFe(t),t=IZ(t),t}function sFe(e){try{return iFe(e)}catch{return Gf}}function CC(e){var t=sFe(e.slice(5,-1));return t===Gf?"":t}var aFe=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],oFe=["dx","dy","angle","className","breakAll"];function FP(){return FP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FP.apply(this,arguments)}function Vz(e,t){if(e==null)return{};var n=lFe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function lFe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Wz(e,t){return hFe(e)||dFe(e,t)||uFe(e,t)||cFe()}
739function cFe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
740In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uFe(e,t){if(e){if(typeof e=="string")return Uz(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Uz(e,t)}}function Uz(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dFe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function hFe(e){if(Array.isArray(e))return e}var RZ=/[ \f\n\r\t\v\u2028\u2029]+/,DZ=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var a=[];dt(n)||(r?a=n.toString().split(""):a=n.toString().split(RZ));var o=a.map(function(c){return{word:c,width:Yy(c,i).width}}),l=r?0:Yy(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},fFe=function(t,n,r,i,a){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=ge(o),h=l,f=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return F.reduce(function(B,P){var I=P.word,M=P.width,R=B[B.length-1];if(R&&(i==null||a||R.width+M+r<Number(i)))R.words.push(I),R.width+=M+r;else{var K={words:[I],width:M};B.push(K)}return B},[])},p=f(n),m=function(F){return F.reduce(function(B,P){return B.width>P.width?B:P})};if(!d)return p;for(var g="…",y=function(F){var B=h.slice(0,F),P=DZ({breakAll:u,style:c,children:B+g}).wordsWithComputedWidth,I=f(P),M=I.length>o||m(I).width>Number(i);return[M,I]},b=0,v=h.length-1,w=0,_;b<=v&&w<=h.length-1;){var j=Math.floor((b+v)/2),S=j-1,k=y(S),N=Wz(k,2),T=N[0],C=N[1],A=y(j),O=Wz(A,1),z=O[0];if(!T&&!z&&(b=j+1),T&&z&&(v=j-1),!T&&z){_=C;break}w++}return _||p},qz=function(t){var n=dt(t)?[]:t.toString().split(RZ);return[{words:n}]},pFe=function(t){var n=t.width,r=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!co.isSsr){var c,u,d=DZ({breakAll:o,children:i,style:a});if(d){var h=d.wordsWithComputedWidth,f=d.spaceWidth;c=h,u=f}else return qz(i);return fFe({breakAll:o,children:i,maxLines:l,style:a},c,u,n,r)}return qz(i)},Hz="#808080",vh=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,a=i===void 0?0:i,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,h=d===void 0?!1:d,f=t.textAnchor,p=f===void 0?"start":f,m=t.verticalAnchor,g=m===void 0?"end":m,y=t.fill,b=y===void 0?Hz:y,v=Vz(t,aFe),w=x.useMemo(function(){return pFe({breakAll:v.breakAll,children:v.children,maxLines:v.maxLines,scaleToFit:h,style:v.style,width:v.width})},[v.breakAll,v.children,v.maxLines,h,v.style,v.width]),_=v.dx,j=v.dy,S=v.angle,k=v.className,N=v.breakAll,T=Vz(v,oFe);if(!Dr(r)||!Dr(a))return null;var C=r+(ge(_)?_:0),A=a+(ge(j)?j:0),O;switch(g){case"start":O=CC("calc(".concat(u,")"));break;case"middle":O=CC("calc(".concat((w.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:O=CC("calc(".concat(w.length-1," * -").concat(l,")"));break}var z=[];if(h){var $=w[0].width,F=v.width;z.push("scale(".concat((ge(F)?F/$:1)/$,")"))}return S&&z.push("rotate(".concat(S,", ").concat(C,", ").concat(A,")")),z.length&&(T.transform=z.join(" ")),L.createElement("text",FP({},He(T,!0),{x:C,y:A,className:mt("recharts-text",k),textAnchor:p,fill:b.includes("url")?Hz:b}),w.map(function(B,P){var I=B.words.join(N?"":" ");return L.createElement("tspan",{x:C,dy:P===0?O:l,key:"".concat(I,"-").concat(P)},I)}))};function du(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function mFe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function gD(e){let t,n,r;e.length!==2?(t=du,n=(l,c)=>du(e(l),c),r=(l,c)=>e(l)-c):(t=e===du||e===mFe?e:gFe,n=e,r=e);function i(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const h=u+d>>>1;n(l[h],c)<0?u=h+1:d=h}while(u<d)}return u}function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const h=u+d>>>1;n(l[h],c)<=0?u=h+1:d=h}while(u<d)}return u}function o(l,c,u=0,d=l.length){const h=i(l,c,u,d-1);return h>u&&r(l[h-1],c)>-r(l[h],c)?h-1:h}return{left:i,center:o,right:a}}function gFe(){return 0}function MZ(e){return e===null?NaN:+e}function*yFe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const vFe=gD(du),wb=vFe.right;gD(MZ).center;class Kz extends Map{constructor(t,n=wFe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(Gz(this,t))}has(t){return super.has(Gz(this,t))}set(t,n){return super.set(xFe(this,t),n)}delete(t){return super.delete(bFe(this,t))}}function Gz({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function xFe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function bFe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function wFe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function jFe(e=du){if(e===du)return $Z;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function $Z(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const _Fe=Math.sqrt(50),SFe=Math.sqrt(10),kFe=Math.sqrt(2);function n1(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=_Fe?10:a>=SFe?5:a>=kFe?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,i)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?n1(e,t,n*2):[l,c,u]}function zP(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,o]=r?n1(t,e,n):n1(e,t,n);if(!(a>=i))return[];const l=a-i+1,c=new Array(l);if(r)if(o<0)for(let u=0;u<l;++u)c[u]=(a-u)/-o;else for(let u=0;u<l;++u)c[u]=(a-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(i+u)/-o;else for(let u=0;u<l;++u)c[u]=(i+u)*o;return c}function BP(e,t,n){return t=+t,e=+e,n=+n,n1(e,t,n)[2]}function VP(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?BP(t,e,n):BP(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Yz(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function Qz(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}
740function LZ(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?$Z:jFe(i);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),h=.5*Math.exp(2*d/3),f=.5*Math.sqrt(d*h*(c-h)/c)*(u-c/2<0?-1:1),p=Math.max(n,Math.floor(t-u*h/c+f)),m=Math.min(r,Math.floor(t+(c-u)*h/c+f));LZ(e,t,p,m,i)}const a=e[t];let o=n,l=r;for(Kg(e,n,t),i(e[r],a)>0&&Kg(e,n,r);o<l;){for(Kg(e,o,l),++o,--l;i(e[o],a)<0;)++o;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?Kg(e,n,l):(++l,Kg(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Kg(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function NFe(e,t,n){if(e=Float64Array.from(yFe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Qz(e);if(t>=1)return Yz(e);var r,i=(r-1)*t,a=Math.floor(i),o=Yz(LZ(e,a).subarray(0,a+1)),l=Qz(e.subarray(a+1));return o+(l-o)*(i-a)}}function CFe(e,t,n=MZ){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(i-a)}}function AFe(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function Oa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ac(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 WP=Symbol("implicit");function yD(){var e=new Kz,t=[],n=[],r=WP;function i(a){let o=e.get(a);if(o===void 0){if(r!==WP)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new Kz;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return yD(t,n).unknown(r)},Oa.apply(i,arguments),i}function lx(){var e=yD().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function h(){var f=t().length,p=i<r,m=p?i:r,g=p?r:i;a=(g-m)/Math.max(1,f-c+u*2),l&&(a=Math.floor(a)),m+=(g-m-a*(f-c))*d,o=a*(1-c),l&&(m=Math.round(m),o=Math.round(o));var y=AFe(f).map(function(b){return m+a*b});return n(p?y.reverse():y)}return e.domain=function(f){return arguments.length?(t(f),h()):t()},e.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,l=!0,h()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(f){return arguments.length?(l=!!f,h()):l},e.padding=function(f){return arguments.length?(c=Math.min(1,u=+f),h()):c},e.paddingInner=function(f){return arguments.length?(c=Math.min(1,f),h()):c},e.paddingOuter=function(f){return arguments.length?(u=+f,h()):u},e.align=function(f){return arguments.length?(d=Math.max(0,Math.min(1,f)),h()):d},e.copy=function(){return lx(t(),[r,i]).round(l).paddingInner(c).paddingOuter(u).align(d)},Oa.apply(h(),arguments)}function FZ(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return FZ(t())},e}function Qy(){return FZ(lx.apply(null,arguments).paddingInner(1))}function vD(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zZ(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function jb(){}var cx=.7,r1=1/cx,pp="\\s*([+-]?\\d+)\\s*",ux="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Go="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",TFe=/^#([0-9a-f]{3,8})$/,EFe=new RegExp(`^rgb\\(${pp},${pp},${pp}\\)$`),PFe=new RegExp(`^rgb\\(${Go},${Go},${Go}\\)$`),OFe=new RegExp(`^rgba\\(${pp},${pp},${pp},${ux}\\)$`),IFe=new RegExp(`^rgba\\(${Go},${Go},${Go},${ux}\\)$`),RFe=new RegExp(`^hsl\\(${ux},${Go},${Go}\\)$`),DFe=new RegExp(`^hsla\\(${ux},${Go},${Go},${ux}\\)$`),Xz={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};vD(jb,dx,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zz,formatHex:Zz,formatHex8:MFe,formatHsl:$Fe,formatRgb:Jz,toString:Jz});function Zz(){return this.rgb().formatHex()}function MFe(){return this.rgb().formatHex8()}function $Fe(){return BZ(this).formatHsl()}function Jz(){return this.rgb().formatRgb()}function dx(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=TFe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?e6(t):n===3?new is(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$0(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=EFe.exec(e))?new is(t[1],t[2],t[3],1):(t=PFe.exec(e))?new is(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=OFe.exec(e))?$0(t[1],t[2],t[3],t[4]):(t=IFe.exec(e))?$0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=RFe.exec(e))?r6(t[1],t[2]/100,t[3]/100,1):(t=DFe.exec(e))?r6(t[1],t[2]/100,t[3]/100,t[4]):Xz.hasOwnProperty(e)?e6(Xz[e]):e==="transparent"?new is(NaN,NaN,NaN,0):null}function e6(e){return new is(e>>16&255,e>>8&255,e&255,1)}function $0(e,t,n,r){return r<=0&&(e=t=n=NaN),new is(e,t,n,r)}function LFe(e){return e instanceof jb||(e=dx(e)),e?(e=e.rgb(),new is(e.r,e.g,e.b,e.opacity)):new is}function UP(e,t,n,r){return arguments.length===1?LFe(e):new is(e,t,n,r??1)}function is(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}vD(is,UP,zZ(jb,{brighter(e){return e=e==null?r1:Math.pow(r1,e),new is(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?cx:Math.pow(cx,e),new is(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new is(Hd(this.r),Hd(this.g),Hd(this.b),i1(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:t6,formatHex:t6,formatHex8:FFe,formatRgb:n6,toString:n6}));function t6(){return`#${Nd(this.r)}${Nd(this.g)}${Nd(this.b)}`}function FFe(){return`#${Nd(this.r)}${Nd(this.g)}${Nd(this.b)}${Nd((isNaN(this.opacity)?1:this.opacity)*255)}`}function n6(){const e=i1(this.opacity);return`${e===1?"rgb(":"rgba("}${Hd(this.r)}, ${Hd(this.g)}, ${Hd(this.b)}${e===1?")":`, ${e})`}`}function i1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Hd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Nd(e){return e=Hd(e),(e<16?"0":"")+e.toString(16)}function r6(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new eo(e,t,n,r)}function BZ(e){if(e instanceof eo)return new eo(e.h,e.s,e.l,e.opacity);if(e instanceof jb||(e=dx(e)),!e)return new eo;if(e instanceof eo)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-i,c=(a+i)/2;return l?(t===a?o=(n-r)/l+(n<r)*6:n===a?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?a+i:2-a-i,o*=60):l=c>0&&c<1?0:o,new eo(o,l,c,e.opacity)}function zFe(e,t,n,r){return arguments.length===1?BZ(e):new eo(e,t,n,r??1)}function eo(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}vD(eo,zFe,zZ(jb,{brighter(e){return e=e==null?r1:Math.pow(r1,e),new eo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?cx:Math.pow(cx,e),new eo(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,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new is(AC(e>=240?e-240:e+120,i,r),AC(e,i,r),AC(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new eo(i6(this.h),L0(this.s),L0(this.l),i1(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=i1(this.opacity);return`${e===1?"hsl(":"hsla("}${i6(this.h)}, ${L0(this.s)*100}%, ${L0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function i6(e){return e=(e||0)%360,e<0?e+360:e}function L0(e){return Math.max(0,Math.min(1,e||0))}function AC(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const xD=e=>()=>e;function BFe(e,t){return function(n){return e+n*t}}function VFe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function WFe(e){return(e=+e)==1?VZ:function(t,n){return n-t?VFe(t,n,e):xD(isNaN(t)?n:t)}}function VZ(e,t){var n=t-e;return n?BFe(e,n):xD(isNaN(e)?t:e)}const s6=function e(t){var n=WFe(t);
vendor: 6,071 bytes, line 740
740function r(i,a){var o=n((i=UP(i)).r,(a=UP(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),u=VZ(i.opacity,a.opacity);return function(d){return i.r=o(d),i.g=l(d),i.b=c(d),i.opacity=u(d),i+""}}return r.gamma=e,r}(1);function UFe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function qFe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function HFe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=bg(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(l){for(o=0;o<r;++o)a[o]=i[o](l);return a}}function KFe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function s1(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function GFe(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=bg(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var qP=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,TC=new RegExp(qP.source,"g");function YFe(e){return function(){return e}}function QFe(e){return function(t){return e(t)+""}}function XFe(e,t){var n=qP.lastIndex=TC.lastIndex=0,r,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=qP.exec(e))&&(i=TC.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:s1(r,i)})),n=TC.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?QFe(c[0].x):YFe(t):(t=c.length,function(u){for(var d=0,h;d<t;++d)l[(h=c[d]).i]=h.x(u);return l.join("")})}function bg(e,t){var n=typeof t,r;return t==null||n==="boolean"?xD(t):(n==="number"?s1:n==="string"?(r=dx(t))?(t=r,s6):XFe:t instanceof dx?s6:t instanceof Date?KFe:qFe(t)?UFe:Array.isArray(t)?HFe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?GFe:s1)(e,t)}function bD(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function ZFe(e,t){t===void 0&&(t=e,e=bg);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[l](o-l)}}function JFe(e){return function(){return e}}function a1(e){return+e}var a6=[0,1];function Li(e){return e}function HP(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:JFe(isNaN(t)?NaN:.5)}function e3e(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function t3e(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=HP(i,r),a=n(o,a)):(r=HP(r,i),a=n(a,o)),function(l){return a(r(l))}}function n3e(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=HP(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=wb(e,l,1,r)-1;return a[c](i[c](l))}}function _b(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function BS(){var e=a6,t=a6,n=bg,r,i,a,o=Li,l,c,u;function d(){var f=Math.min(e.length,t.length);return o!==Li&&(o=e3e(e[0],e[f-1])),l=f>2?n3e:t3e,c=u=null,h}function h(f){return f==null||isNaN(f=+f)?a:(c||(c=l(e.map(r),t,n)))(r(o(f)))}return h.invert=function(f){return o(i((u||(u=l(t,e.map(r),s1)))(f)))},h.domain=function(f){return arguments.length?(e=Array.from(f,a1),d()):e.slice()},h.range=function(f){return arguments.length?(t=Array.from(f),d()):t.slice()},h.rangeRound=function(f){return t=Array.from(f),n=bD,d()},h.clamp=function(f){return arguments.length?(o=f?!0:Li,d()):o!==Li},h.interpolate=function(f){return arguments.length?(n=f,d()):n},h.unknown=function(f){return arguments.length?(a=f,h):a},function(f,p){return r=f,i=p,d()}}function wD(){return BS()(Li,Li)}function r3e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function o1(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function rm(e){return e=o1(Math.abs(e)),e?e[1]:NaN}function i3e(e,t){return function(n,r){for(var i=n.length,a=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function s3e(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var a3e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function hx(e){if(!(t=a3e.exec(e)))throw new Error("invalid format: "+e);var t;return new jD({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]})}hx.prototype=jD.prototype;function jD(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+""}jD.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 o3e(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var WZ;function l3e(e,t){var n=o1(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(WZ=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+o1(e,Math.max(0,t+a-1))[0]}function o6(e,t){var n=o1(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const l6={"%":(e,t)=>
vendor: 5,608 bytes, line 740
740(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:r3e,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)=>o6(e*100,t),r:o6,s:l3e,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function c6(e){return e}var u6=Array.prototype.map,d6=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function c3e(e){var t=e.grouping===void 0||e.thousands===void 0?c6:i3e(u6.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?c6:s3e(u6.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 u(h){h=hx(h);var f=h.fill,p=h.align,m=h.sign,g=h.symbol,y=h.zero,b=h.width,v=h.comma,w=h.precision,_=h.trim,j=h.type;j==="n"?(v=!0,j="g"):l6[j]||(w===void 0&&(w=12),_=!0,j="g"),(y||f==="0"&&p==="=")&&(y=!0,f="0",p="=");var S=g==="$"?n:g==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():"",k=g==="$"?r:/[%p]/.test(j)?o:"",N=l6[j],T=/[defgprs%]/.test(j);w=w===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function C(A){var O=S,z=k,$,F,B;if(j==="c")z=N(A)+z,A="";else{A=+A;var P=A<0||1/A<0;if(A=isNaN(A)?c:N(Math.abs(A),w),_&&(A=o3e(A)),P&&+A==0&&m!=="+"&&(P=!1),O=(P?m==="("?m:l:m==="-"||m==="("?"":m)+O,z=(j==="s"?d6[8+WZ/3]:"")+z+(P&&m==="("?")":""),T){for($=-1,F=A.length;++$<F;)if(B=A.charCodeAt($),48>B||B>57){z=(B===46?i+A.slice($+1):A.slice($))+z,A=A.slice(0,$);break}}}v&&!y&&(A=t(A,1/0));var I=O.length+A.length+z.length,M=I<b?new Array(b-I+1).join(f):"";switch(v&&y&&(A=t(M+A,M.length?b-z.length:1/0),M=""),p){case"<":A=O+A+z+M;break;case"=":A=O+M+A+z;break;case"^":A=M.slice(0,I=M.length>>1)+O+A+z+M.slice(I);break;default:A=M+O+A+z;break}return a(A)}return C.toString=function(){return h+""},C}function d(h,f){var p=u((h=hx(h),h.type="f",h)),m=Math.max(-8,Math.min(8,Math.floor(rm(f)/3)))*3,g=Math.pow(10,-m),y=d6[8+m/3];return function(b){return p(g*b)+y}}return{format:u,formatPrefix:d}}var F0,_D,UZ;u3e({thousands:",",grouping:[3],currency:["$",""]});function u3e(e){return F0=c3e(e),_D=F0.format,UZ=F0.formatPrefix,F0}function d3e(e){return Math.max(0,-rm(Math.abs(e)))}function h3e(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(rm(t)/3)))*3-rm(Math.abs(e)))}function f3e(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,rm(t)-rm(e))+1}function qZ(e,t,n,r){var i=VP(e,t,n),a;switch(r=hx(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=h3e(i,o))&&(r.precision=a),UZ(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=f3e(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=d3e(i))&&(r.precision=a-(r.type==="%")*2);break}}return _D(r)}function Fu(e){var t=e.domain;return e.ticks=function(n){var r=t();return zP(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return qZ(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],l=r[a],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=i,i=a,a=u);d-- >0;){if(u=BP(o,l,n),u===c)return r[i]=o,r[a]=l,t(r);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function l1(){var e=wD();return e.copy=function(){return _b(e,l1())},Oa.apply(e,arguments),Fu(e)}function HZ(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,a1),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return HZ(e).unknown(t)},e=arguments.length?Array.from(e,a1):[0,1],Fu(n)}function KZ(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function h6(e){return Math.log(e)}function f6(e){return Math.exp(e)}function p3e(e){return-Math.log(-e)}function m3e(e){return-Math.exp(-e)}function g3e(e){return isFinite(e)?+("1e"+e):e<0?0:e}function y3e(e){return e===10?g3e:e===Math.E?Math.exp:t=>Math.pow(e,t)}function v3e(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 p6(e){return(t,n)=>-e(-t,n)}function SD(e){const t=e(h6,f6),n=t.domain;let r=10,i,a;function o(){return i=v3e(r),a=y3e(r),n()[0]<0?(i=p6(i),a=p6(a),e(p3e,m3e)):e(h6,f6),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const h=d<u;h&&([u,d]=[d,u]);let f=i(u),p=i(d),m,g;const y=l==null?10:+l;let b=[];if(!(r%1)&&p-f<y){if(f=Math.floor(f),p=Math.ceil(p),u>0){for(;f<=p;++f)for(m=1;m<r;++m)if(g=f<0?m/a(-f):m*a(f),!(g<u)){if(g>d)break;b.push(g)}}else for(;f<=p;++f)for(m=r-1;m>=1;--m)if(g=f>0?m/a(-f):m*a(f),!(g<u)){if(g>d)break;b.push(g)}b.length*2<y&&(b=zP(u,d,y))}else b=zP(f,p,Math.min(p-f,y)).map(a);return h?b.reverse():b},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=hx(c)).precision==null&&(c.trim=!0),c=_D(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let h=d/a(Math.round(i(d)));return h*r<r-.5&&(h*=r),h<=u?c(d):""}},t.nice=()=>n(KZ(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function GZ(){const e=SD(BS()).domain([1,10]);return e.copy=()=>_b(e,GZ()).base(e.base()),Oa.apply(e,arguments),e}
740function m6(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function g6(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function kD(e){var t=1,n=e(m6(t),g6(t));return n.constant=function(r){return arguments.length?e(m6(t=+r),g6(t)):t},Fu(n)}function YZ(){var e=kD(BS());return e.copy=function(){return _b(e,YZ()).constant(e.constant())},Oa.apply(e,arguments)}function y6(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function x3e(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function b3e(e){return e<0?-e*e:e*e}function ND(e){var t=e(Li,Li),n=1;function r(){return n===1?e(Li,Li):n===.5?e(x3e,b3e):e(y6(n),y6(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Fu(t)}function CD(){var e=ND(BS());return e.copy=function(){return _b(e,CD()).exponent(e.exponent())},Oa.apply(e,arguments),e}function w3e(){return CD.apply(null,arguments).exponent(.5)}function v6(e){return Math.sign(e)*e*e}function j3e(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function QZ(){var e=wD(),t=[0,1],n=!1,r;function i(a){var o=j3e(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(v6(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,a1)).map(v6)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return QZ(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Oa.apply(i,arguments),Fu(i)}function XZ(){var e=[],t=[],n=[],r;function i(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=CFe(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[wb(n,o)]}return a.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},a.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(du),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return XZ().domain(e).range(t).unknown(r)},Oa.apply(a,arguments)}function ZZ(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[wb(r,c,0,n)]:a}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+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?(n=(i=Array.from(c)).length-1,l()):i.slice()},o.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return ZZ().domain([e,t]).range(i).unknown(a)},Oa.apply(Fu(o),arguments)}function JZ(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[wb(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return JZ().domain(e).range(t).unknown(n)},Oa.apply(i,arguments)}const EC=new Date,PC=new Date;function zr(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),l=i.ceil(a);return a-o<l-a?o:l},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,l)=>{const c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<o);return c},i.filter=a=>zr(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(EC.setTime(+a),PC.setTime(+o),e(EC),e(PC),Math.floor(n(EC,PC))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const c1=zr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);c1.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?zr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):c1);c1.range;const El=1e3,wa=El*60,Pl=wa*60,Xl=Pl*24,AD=Xl*7,x6=Xl*30,OC=Xl*365,Cd=zr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*El)},(e,t)=>(t-e)/El,e=>e.getUTCSeconds());Cd.range;const TD=zr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*El)},(e,t)=>{e.setTime(+e+t*wa)},(e,t)=>(t-e)/wa,e=>e.getMinutes());TD.range;const ED=zr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*wa)},(e,t)=>(t-e)/wa,e=>e.getUTCMinutes());ED.range;const PD=zr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*El-e.getMinutes()*wa)},(e,t)=>{e.setTime(+e+t*Pl)},(e,t)=>(t-e)/Pl,e=>e.getHours());PD.range;const OD=zr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Pl)},(e,t)=>(t-e)/Pl,e=>e.getUTCHours());OD.range;const Sb=zr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*wa)/Xl,e=>e.getDate()-1);Sb.range;const VS=zr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Xl,e=>e.getUTCDate()-1);VS.range;const eJ=zr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Xl,e=>Math.floor(e/Xl));eJ.range;function $h(e){return zr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*wa)/AD)}const WS=$h(0),u1=$h(1),_3e=$h(2),S3e=$h(3),im=$h(4),k3e=$h(5),N3e=$h(6);WS.range;u1.range;_3e.range;S3e.range;im.range;k3e.range;N3e.range;function Lh(e){return zr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/AD)}
vendor: 6,732 bytes, line 740
740const US=Lh(0),d1=Lh(1),C3e=Lh(2),A3e=Lh(3),sm=Lh(4),T3e=Lh(5),E3e=Lh(6);US.range;d1.range;C3e.range;A3e.range;sm.range;T3e.range;E3e.range;const ID=zr(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());ID.range;const RD=zr(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());RD.range;const Zl=zr(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());Zl.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:zr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Zl.range;const Jl=zr(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());Jl.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:zr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Jl.range;function tJ(e,t,n,r,i,a){const o=[[Cd,1,El],[Cd,5,5*El],[Cd,15,15*El],[Cd,30,30*El],[a,1,wa],[a,5,5*wa],[a,15,15*wa],[a,30,30*wa],[i,1,Pl],[i,3,3*Pl],[i,6,6*Pl],[i,12,12*Pl],[r,1,Xl],[r,2,2*Xl],[n,1,AD],[t,1,x6],[t,3,3*x6],[e,1,OC]];function l(u,d,h){const f=d<u;f&&([u,d]=[d,u]);const p=h&&typeof h.range=="function"?h:c(u,d,h),m=p?p.range(u,+d+1):[];return f?m.reverse():m}function c(u,d,h){const f=Math.abs(d-u)/h,p=gD(([,,y])=>y).right(o,f);if(p===o.length)return e.every(VP(u/OC,d/OC,h));if(p===0)return c1.every(Math.max(VP(u,d,h),1));const[m,g]=o[f/o[p-1][2]<o[p][2]/f?p-1:p];return m.every(g)}return[l,c]}const[P3e,O3e]=tJ(Jl,RD,US,eJ,OD,ED),[I3e,R3e]=tJ(Zl,ID,WS,Sb,PD,TD);function IC(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 RC(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 Gg(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function D3e(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=Yg(i),d=Qg(i),h=Yg(a),f=Qg(a),p=Yg(o),m=Qg(o),g=Yg(l),y=Qg(l),b=Yg(c),v=Qg(c),w={a:P,A:I,b:M,B:R,c:null,d:k6,e:k6,f:i5e,g:p5e,G:g5e,H:t5e,I:n5e,j:r5e,L:nJ,m:s5e,M:a5e,p:K,q:D,Q:A6,s:T6,S:o5e,u:l5e,U:c5e,V:u5e,w:d5e,W:h5e,x:null,X:null,y:f5e,Y:m5e,Z:y5e,"%":C6},_={a:E,A:q,b:X,B:re,c:null,d:N6,e:N6,f:w5e,g:P5e,G:I5e,H:v5e,I:x5e,j:b5e,L:iJ,m:j5e,M:_5e,p:Y,q:le,Q:A6,s:T6,S:S5e,u:k5e,U:N5e,V:C5e,w:A5e,W:T5e,x:null,X:null,y:E5e,Y:O5e,Z:R5e,"%":C6},j={a:C,A,b:O,B:z,c:$,d:_6,e:_6,f:X3e,g:j6,G:w6,H:S6,I:S6,j:K3e,L:Q3e,m:H3e,M:G3e,p:T,q:q3e,Q:J3e,s:e5e,S:Y3e,u:z3e,U:B3e,V:V3e,w:F3e,W:W3e,x:F,X:B,y:j6,Y:w6,Z:U3e,"%":Z3e};w.x=S(n,w),w.X=S(r,w),w.c=S(t,w),_.x=S(n,_),_.X=S(r,_),_.c=S(t,_);function S(Z,de){return function(pe){var J=[],be=-1,ee=0,Ce=Z.length,Re,Ze,Ee;for(pe instanceof Date||(pe=new Date(+pe));++be<Ce;)Z.charCodeAt(be)===37&&(J.push(Z.slice(ee,be)),(Ze=b6[Re=Z.charAt(++be)])!=null?Re=Z.charAt(++be):Ze=Re==="e"?" ":"0",(Ee=de[Re])&&(Re=Ee(pe,Ze)),J.push(Re),ee=be+1);return J.push(Z.slice(ee,be)),J.join("")}}function k(Z,de){return function(pe){var J=Gg(1900,void 0,1),be=N(J,Z,pe+="",0),ee,Ce;if(be!=pe.length)return null;if("Q"in J)return new Date(J.Q);if("s"in J)return new Date(J.s*1e3+("L"in J?J.L:0));if(de&&!("Z"in J)&&(J.Z=0),"p"in J&&(J.H=J.H%12+J.p*12),J.m===void 0&&(J.m="q"in J?J.q:0),"V"in J){if(J.V<1||J.V>53)return null;"w"in J||(J.w=1),"Z"in J?(ee=RC(Gg(J.y,0,1)),Ce=ee.getUTCDay(),ee=Ce>4||Ce===0?d1.ceil(ee):d1(ee),ee=VS.offset(ee,(J.V-1)*7),J.y=ee.getUTCFullYear(),J.m=ee.getUTCMonth(),J.d=ee.getUTCDate()+(J.w+6)%7):(ee=IC(Gg(J.y,0,1)),Ce=ee.getDay(),ee=Ce>4||Ce===0?u1.ceil(ee):u1(ee),ee=Sb.offset(ee,(J.V-1)*7),J.y=ee.getFullYear(),J.m=ee.getMonth(),J.d=ee.getDate()+(J.w+6)%7)}else("W"in J||"U"in J)&&("w"in J||(J.w="u"in J?J.u%7:"W"in J?1:0),Ce="Z"in J?RC(Gg(J.y,0,1)).getUTCDay():IC(Gg(J.y,0,1)).getDay(),J.m=0,J.d="W"in J?(J.w+6)%7+J.W*7-(Ce+5)%7:J.w+J.U*7-(Ce+6)%7);return"Z"in J?(J.H+=J.Z/100|0,J.M+=J.Z%100,RC(J)):IC(J)}}function N(Z,de,pe,J){for(var be=0,ee=de.length,Ce=pe.length,Re,Ze;be<ee;){if(J>=Ce)return-1;if(Re=de.charCodeAt(be++),Re===37){if(Re=de.charAt(be++),Ze=j[Re in b6?de.charAt(be++):Re],!Ze||(J=Ze(Z,pe,J))<0)return-1}else if(Re!=pe.charCodeAt(J++))return-1}return J}function T(Z,de,pe){var J=u.exec(de.slice(pe));return J?(Z.p=d.get(J[0].toLowerCase()),pe+J[0].length):-1}function C(Z,de,pe){var J=p.exec(de.slice(pe));return J?(Z.w=m.get(J[0].toLowerCase()),pe+J[0].length):-1}function A(Z,de,pe){var J=h.exec(de.slice(pe));return J?(Z.w=f.get(J[0].toLowerCase()),pe+J[0].length):-1}function O(Z,de,pe){var J=b.exec(de.slice(pe));return J?(Z.m=v.get(J[0].toLowerCase()),pe+J[0].length):-1}function z(Z,de,pe){var J=g.exec(de.slice(pe));return J?(Z.m=y.get(J[0].toLowerCase()),pe+J[0].length):-1}function $(Z,de,pe){return N(Z,t,de,pe)}function F(Z,de,pe){return N(Z,n,de,pe)}function B(Z,de,pe){return N(Z,r,de,pe)}function P(Z){return o[Z.getDay()]}function I(Z){return a[Z.getDay()]}function M(Z){return c[Z.getMonth()]}function R(Z){return l[Z.getMonth()]}function K(Z){return i[+(Z.getHours()>=12)]}function D(Z){return 1+~~(Z.getMonth()/3)}function E(Z){return o[Z.getUTCDay()]}function q(Z){return a[Z.getUTCDay()]}function X(Z){return c[Z.getUTCMonth()]}function re(Z){return l[Z.getUTCMonth()]}function Y(Z){return i[+(Z.getUTCHours()>=12)]}function le(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var de=S(Z+="",w);return de.toString=function(){return Z},de},parse:function(Z){var de=k(Z+="",!1);return de.toString=function(){return Z},de},utcFormat:function(Z){var de=S(Z+="",_);return de.toString=function(){return Z},de},utcParse:function(Z){var de=k(Z+="",!0);return de.toString=function(){return Z},de}}}var b6={"-":"",_:" ",0:"0"},Yr=/^\s*\d+/,M3e=/^%/,$3e=/[\\^$*+?|[\]().{}]/g;function Ut(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function L3e(e){return e.replace($3e,"\\$&")}function Yg(e){return new RegExp("^(?:"+e.map(L3e).join("|")+")","i")}function Qg(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function F3e(e,t,n){var r=Yr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function z3e(e,t,n){var r=Yr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function B3e(e,t,n){var r=Yr.exec(t.slice(n,n+2));
vendor: 4,106 bytes, line 740
740return r?(e.U=+r[0],n+r[0].length):-1}function V3e(e,t,n){var r=Yr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function W3e(e,t,n){var r=Yr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function w6(e,t,n){var r=Yr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function j6(e,t,n){var r=Yr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function U3e(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function q3e(e,t,n){var r=Yr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function H3e(e,t,n){var r=Yr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function _6(e,t,n){var r=Yr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function K3e(e,t,n){var r=Yr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function S6(e,t,n){var r=Yr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function G3e(e,t,n){var r=Yr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Y3e(e,t,n){var r=Yr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Q3e(e,t,n){var r=Yr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function X3e(e,t,n){var r=Yr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Z3e(e,t,n){var r=M3e.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function J3e(e,t,n){var r=Yr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function e5e(e,t,n){var r=Yr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function k6(e,t){return Ut(e.getDate(),t,2)}function t5e(e,t){return Ut(e.getHours(),t,2)}function n5e(e,t){return Ut(e.getHours()%12||12,t,2)}function r5e(e,t){return Ut(1+Sb.count(Zl(e),e),t,3)}function nJ(e,t){return Ut(e.getMilliseconds(),t,3)}function i5e(e,t){return nJ(e,t)+"000"}function s5e(e,t){return Ut(e.getMonth()+1,t,2)}function a5e(e,t){return Ut(e.getMinutes(),t,2)}function o5e(e,t){return Ut(e.getSeconds(),t,2)}function l5e(e){var t=e.getDay();return t===0?7:t}function c5e(e,t){return Ut(WS.count(Zl(e)-1,e),t,2)}function rJ(e){var t=e.getDay();return t>=4||t===0?im(e):im.ceil(e)}function u5e(e,t){return e=rJ(e),Ut(im.count(Zl(e),e)+(Zl(e).getDay()===4),t,2)}function d5e(e){return e.getDay()}function h5e(e,t){return Ut(u1.count(Zl(e)-1,e),t,2)}function f5e(e,t){return Ut(e.getFullYear()%100,t,2)}function p5e(e,t){return e=rJ(e),Ut(e.getFullYear()%100,t,2)}function m5e(e,t){return Ut(e.getFullYear()%1e4,t,4)}function g5e(e,t){var n=e.getDay();return e=n>=4||n===0?im(e):im.ceil(e),Ut(e.getFullYear()%1e4,t,4)}function y5e(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ut(t/60|0,"0",2)+Ut(t%60,"0",2)}function N6(e,t){return Ut(e.getUTCDate(),t,2)}function v5e(e,t){return Ut(e.getUTCHours(),t,2)}function x5e(e,t){return Ut(e.getUTCHours()%12||12,t,2)}function b5e(e,t){return Ut(1+VS.count(Jl(e),e),t,3)}function iJ(e,t){return Ut(e.getUTCMilliseconds(),t,3)}function w5e(e,t){return iJ(e,t)+"000"}function j5e(e,t){return Ut(e.getUTCMonth()+1,t,2)}function _5e(e,t){return Ut(e.getUTCMinutes(),t,2)}function S5e(e,t){return Ut(e.getUTCSeconds(),t,2)}function k5e(e){var t=e.getUTCDay();return t===0?7:t}function N5e(e,t){return Ut(US.count(Jl(e)-1,e),t,2)}function sJ(e){var t=e.getUTCDay();return t>=4||t===0?sm(e):sm.ceil(e)}function C5e(e,t){return e=sJ(e),Ut(sm.count(Jl(e),e)+(Jl(e).getUTCDay()===4),t,2)}function A5e(e){return e.getUTCDay()}function T5e(e,t){return Ut(d1.count(Jl(e)-1,e),t,2)}function E5e(e,t){return Ut(e.getUTCFullYear()%100,t,2)}function P5e(e,t){return e=sJ(e),Ut(e.getUTCFullYear()%100,t,2)}function O5e(e,t){return Ut(e.getUTCFullYear()%1e4,t,4)}function I5e(e,t){var n=e.getUTCDay();return e=n>=4||n===0?sm(e):sm.ceil(e),Ut(e.getUTCFullYear()%1e4,t,4)}function R5e(){return"+0000"}function C6(){return"%"}function A6(e){return+e}function T6(e){return Math.floor(+e/1e3)}var af,aJ,oJ;D5e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
740ay","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 D5e(e){return af=D3e(e),aJ=af.format,af.parse,oJ=af.utcFormat,af.utcParse,af}function M5e(e){return new Date(e)}function $5e(e){return e instanceof Date?+e:+new Date(+e)}function DD(e,t,n,r,i,a,o,l,c,u){var d=wD(),h=d.invert,f=d.domain,p=u(".%L"),m=u(":%S"),g=u("%I:%M"),y=u("%I %p"),b=u("%a %d"),v=u("%b %d"),w=u("%B"),_=u("%Y");function j(S){return(c(S)<S?p:l(S)<S?m:o(S)<S?g:a(S)<S?y:r(S)<S?i(S)<S?b:v:n(S)<S?w:_)(S)}return d.invert=function(S){return new Date(h(S))},d.domain=function(S){return arguments.length?f(Array.from(S,$5e)):f().map(M5e)},d.ticks=function(S){var k=f();return e(k[0],k[k.length-1],S??10)},d.tickFormat=function(S,k){return k==null?j:u(k)},d.nice=function(S){var k=f();return(!S||typeof S.range!="function")&&(S=t(k[0],k[k.length-1],S??10)),S?f(KZ(k,S)):d},d.copy=function(){return _b(d,DD(e,t,n,r,i,a,o,l,c,u))},d}function L5e(){return Oa.apply(DD(I3e,R3e,Zl,ID,WS,Sb,PD,TD,Cd,aJ).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function F5e(){return Oa.apply(DD(P3e,O3e,Jl,RD,US,VS,OD,ED,Cd,oJ).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function qS(){var e=0,t=1,n,r,i,a,o=Li,l=!1,c;function u(h){return h==null||isNaN(h=+h)?c:o(i===0?.5:(h=(a(h)-n)*i,l?Math.max(0,Math.min(1,h)):h))}u.domain=function(h){return arguments.length?([e,t]=h,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(h){return arguments.length?(l=!!h,u):l},u.interpolator=function(h){return arguments.length?(o=h,u):o};function d(h){return function(f){var p,m;return arguments.length?([p,m]=f,o=h(p,m),u):[o(0),o(1)]}}return u.range=d(bg),u.rangeRound=d(bD),u.unknown=function(h){return arguments.length?(c=h,u):c},function(h){return a=h,n=h(e),r=h(t),i=n===r?0:1/(r-n),u}}function zu(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function lJ(){var e=Fu(qS()(Li));return e.copy=function(){return zu(e,lJ())},ac.apply(e,arguments)}function cJ(){var e=SD(qS()).domain([1,10]);return e.copy=function(){return zu(e,cJ()).base(e.base())},ac.apply(e,arguments)}function uJ(){var e=kD(qS());return e.copy=function(){return zu(e,uJ()).constant(e.constant())},ac.apply(e,arguments)}function MD(){var e=ND(qS());return e.copy=function(){return zu(e,MD()).exponent(e.exponent())},ac.apply(e,arguments)}function z5e(){return MD.apply(null,arguments).exponent(.5)}function dJ(){var e=[],t=Li;function n(r){if(r!=null&&!isNaN(r=+r))return t((wb(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(du),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>NFe(e,a/r))},n.copy=function(){return dJ(t).domain(e)},ac.apply(n,arguments)}function HS(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,u=Li,d,h=!1,f;function p(g){return isNaN(g=+g)?f:(g=.5+((g=+d(g))-a)*(r*g<r*a?l:c),u(h?Math.max(0,Math.min(1,g)):g))}p.domain=function(g){return arguments.length?([e,t,n]=g,i=d(e=+e),a=d(t=+t),o=d(n=+n),l=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(g){return arguments.length?(h=!!g,p):h},p.interpolator=function(g){return arguments.length?(u=g,p):u};function m(g){return function(y){var b,v,w;return arguments.length?([b,v,w]=y,u=ZFe(g,[b,v,w]),p):[u(0),u(.5),u(1)]}}return p.range=m(bg),p.rangeRound=m(bD),p.unknown=function(g){return arguments.length?(f=g,p):f},function(g){return d=g,i=g(e),a=g(t),o=g(n),l=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function hJ(){var e=Fu(HS()(Li));return e.copy=function(){return zu(e,hJ())},ac.apply(e,arguments)}function fJ(){var e=SD(HS()).domain([.1,1,10]);return e.copy=function(){return zu(e,fJ()).base(e.base())},ac.apply(e,arguments)}function pJ(){var e=kD(HS());return e.copy=function(){return zu(e,pJ()).constant(e.constant())},ac.apply(e,arguments)}function $D(){var e=ND(HS());return e.copy=function(){return zu(e,$D()).exponent(e.exponent())},ac.apply(e,arguments)}function B5e(){return $D.apply(null,arguments).exponent(.5)}const E6=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:lx,scaleDiverging:hJ,scaleDivergingLog:fJ,scaleDivergingPow:$D,scaleDivergingSqrt:B5e,scaleDivergingSymlog:pJ,scaleIdentity:HZ,scaleImplicit:WP,scaleLinear:l1,scaleLog:GZ,scaleOrdinal:yD,scalePoint:Qy,scalePow:CD,scaleQuantile:XZ,scaleQuantize:ZZ,scaleRadial:QZ,scaleSequential:lJ,scaleSequentialLog:cJ,scaleSequentialPow:MD,scaleSequentialQuantile:dJ,scaleSequentialSqrt:z5e,scaleSequentialSymlog:uJ,scaleSqrt:w3e,scaleSymlog:YZ,scaleThreshold:JZ,scaleTime:L5e,scaleUtc:F5e,tickFormat:qZ},Symbol.toStringTag,{value:"Module"}));var V5e=ug;function W5e(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(l===void 0?o===o&&!V5e(o):n(o,l)))var l=o,c=a}return c}var KS=W5e;function U5e(e,t){return e>t}var mJ=U5e,q5e=KS,H5e=mJ,K5e=vg;function G5e(e){return e&&e.length?q5e(e,K5e,H5e):void 0}var Y5e=G5e;const Xc=Ot(Y5e);function Q5e(e,t){return e<t}var gJ=Q5e,X5e=KS,Z5e=gJ,J5e=vg;function eze(e){return e&&e.length?X5e(e,J5e,Z5e):void 0}var tze=eze;const GS=Ot(tze);var nze=XR,rze=ol,ize=SZ,sze=ms;function aze(e,t){var n=sze(e)?nze:ize;return n(e,rze(t))}var oze=aze,lze=jZ,cze=oze;function uze(e,t){return lze(cze(e,t),1)}var dze=uze;const hze=Ot(dze);var fze=hD;function pze(e,t){return fze(e,t)}var mze=pze;const xh=Ot(mze);
vendor: 62,729 bytes, lines 740-767
740var wg=1e9,gze={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},FD,Rn=!0,Aa="[DecimalError] ",Kd=Aa+"Invalid argument: ",LD=Aa+"Exponent out of range: ",jg=Math.floor,dd=Math.pow,yze=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ds,Ur=1e7,_n=7,yJ=9007199254740991,h1=jg(yJ/_n),Me={};Me.absoluteValue=Me.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Me.comparedTo=Me.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Me.decimalPlaces=Me.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*_n;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Me.dividedBy=Me.div=function(e){return Ml(this,new this.constructor(e))};Me.dividedToIntegerBy=Me.idiv=function(e){var t=this,n=t.constructor;return an(Ml(t,new n(e),0,1),n.precision)};Me.equals=Me.eq=function(e){return!this.cmp(e)};Me.exponent=function(){return yr(this)};Me.greaterThan=Me.gt=function(e){return this.cmp(e)>0};Me.greaterThanOrEqualTo=Me.gte=function(e){return this.cmp(e)>=0};Me.isInteger=Me.isint=function(){return this.e>this.d.length-2};Me.isNegative=Me.isneg=function(){return this.s<0};Me.isPositive=Me.ispos=function(){return this.s>0};Me.isZero=function(){return this.s===0};Me.lessThan=Me.lt=function(e){return this.cmp(e)<0};Me.lessThanOrEqualTo=Me.lte=function(e){return this.cmp(e)<1};Me.logarithm=Me.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Ds))throw Error(Aa+"NaN");if(n.s<1)throw Error(Aa+(n.s?"NaN":"-Infinity"));return n.eq(Ds)?new r(0):(Rn=!1,t=Ml(fx(n,a),fx(e,a),a),Rn=!0,an(t,i))};Me.minus=Me.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?bJ(t,e):vJ(t,(e.s=-e.s,e))};Me.modulo=Me.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Aa+"NaN");return n.s?(Rn=!1,t=Ml(n,e,0,1).times(e),Rn=!0,n.minus(t)):an(new r(n),i)};Me.naturalExponential=Me.exp=function(){return xJ(this)};Me.naturalLogarithm=Me.ln=function(){return fx(this)};Me.negated=Me.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Me.plus=Me.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?vJ(t,e):bJ(t,(e.s=-e.s,e))};Me.precision=Me.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Kd+e);if(t=yr(i)+1,r=i.d.length-1,n=r*_n+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Me.squareRoot=Me.sqrt=function(){var e,t,n,r,i,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Aa+"NaN")}for(e=yr(l),Rn=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=zo(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=jg((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=o=n+3;;)if(a=r,r=a.plus(Ml(l,a,o+2)).times(.5),zo(a.d).slice(0,o)===(t=zo(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(an(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return Rn=!0,an(r,n)};Me.times=Me.mul=function(e){var t,n,r,i,a,o,l,c,u,d=this,h=d.constructor,f=d.d,p=(e=new h(e)).d;if(!d.s||!e.s)return new h(0);for(e.s*=d.s,n=d.e+e.e,c=f.length,u=p.length,c<u&&(a=f,f=p,p=a,o=c,c=u,u=o),a=[],o=c+u,r=o;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,i=c+r;i>r;)l=a[i]+p[r]*f[i-r-1]+t,a[i--]=l%Ur|0,t=l/Ur|0;a[i]=(a[i]+t)%Ur|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Rn?an(e,h.precision):e};Me.toDecimalPlaces=Me.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(tl(e,0,wg),t===void 0?t=r.rounding:tl(t,0,8),an(n,e+yr(n)+1,t))};Me.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=bh(r,!0):(tl(e,0,wg),t===void 0?t=i.rounding:tl(t,0,8),r=an(new i(r),e+1,t),n=bh(r,!0,e+1)),n};Me.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?bh(i):(tl(e,0,wg),t===void 0?t=a.rounding:tl(t,0,8),r=an(new a(i),e+yr(i)+1,t),n=bh(r.abs(),!1,e+yr(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Me.toInteger=Me.toint=function(){var e=this,t=e.constructor;return an(new t(e),yr(e)+1,t.rounding)};Me.toNumber=function(){return+this};Me.toPower=Me.pow=function(e){var t,n,r,i,a,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(Ds);if(l=new c(l),!l.s){if(e.s<1)throw Error(Aa+"Infinity");return l}if(l.eq(Ds))return l;if(r=c.precision,e.eq(Ds))return an(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=yJ){for(i=new c(Ds),t=Math.ceil(r/_n+4),Rn=!1;n%2&&(i=i.times(l),O6(i.d,t)),n=jg(n/2),n!==0;)l=l.times(l),O6(l.d,t);return Rn=!0,e.s<0?new c(Ds).div(i):an(i,r)}}else if(a<0)throw Error(Aa+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Rn=!1,i=e.times(fx(l,r+u)),Rn=!0,i=xJ(i),i.s=a,i};Me.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=yr(i),r=bh(i,n<=a.toExpNeg||n>=a.toExpPos)):(tl(e,1,wg),t===void 0?t=a.rounding:tl(t,0,8),i=an(new a(i),e,t),n=yr(i),r=bh(i,e<=n||n<=a.toExpNeg,e)),r};Me.toSignificantDigits=Me.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(tl(e,1,wg),t===void 0?t=r.rounding:tl(t,0,8)),an(new r(n),e,t)};Me.toString=Me.valueOf=Me.val=Me.toJSON=Me[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=yr(e),n=e.constructor;return bh(e,t<=n.toExpNeg||t>=n.toExpPos)};function vJ(e,t){var n,r,i,a,o,l,c,u,d=e.constructor,h=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),Rn?an(t,h):t;if(c=e.d,u=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,i=o,l=c.length),o=Math.ceil(h/_n),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/Ur|0,c[a]%=Ur;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,Rn?an(t,h):t}function tl(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Kd+e)}function zo(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=_n-r.length,n&&(a+=Ec(n)),a+=r;o=e[t],r=o+"",n=_n-r.length,n&&(a+=Ec(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var Ml=function(){function e(r,i){var a,o=0,l=r.length;for(r=r.slice();l--;)a=r[l]*i+o,r[l]=a%Ur|0,o=a/Ur|0;return o&&r.unshift(o),r}function t(r,i,a,o){var l,c;if(a!=o)c=a>o?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=i[l]){c=r[l]>i[l]?1:-1;break}return c}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*Ur+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var l,c,u,d,h,f,p,m,g,y,b,v,w,_,j,S,k,N,T=r.constructor,C=r.s==i.s?1:-1,A=r.d,O=i.d;if(!r.s)return new T(r);if(!i.s)throw Error(Aa+"Division by zero");for(c=r.e-i.e,k=O.length,j=A.length,p=new T(C),m=p.d=[],u=0;O[u]==(A[u]||0);)++u;if(O[u]>(A[u]||0)&&--c,a==null?v=a=T.precision:o?v=a+(yr(r)-yr(i))+1:v=a,v<0)return new T(0);if(v=v/_n+2|0,u=0,k==1)for(d=0,O=O[0],v++;(u<j||d)&&v--;u++)w=d*Ur+(A[u]||0),m[u]=w/O|0,d=w%O|0;else{for(d=Ur/(O[0]+1)|0,d>1&&(O=e(O,d),A=e(A,d),k=O.length,j=A.length),_=k,g=A.slice(0,k),y=g.length;y<k;)g[y++]=0;N=O.slice(),N.unshift(0),S=O[0],O[1]>=Ur/2&&++S;do d=0,l=t(O,g,k,y),l<0?(b=g[0],k!=y&&(b=b*Ur+(g[1]||0)),d=b/S|0,d>1?(d>=Ur&&(d=Ur-1),h=e(O,d),f=h.length,y=g.length,l=t(h,g,f,y),l==1&&(d--,n(h,k<f?N:O,f))):(d==0&&(l=d=1),h=O.slice()),f=h.length,f<y&&h.unshift(0),n(g,h,y),l==-1&&(y=g.length,l=t(O,g,k,y),l<1&&(d++,n(g,k<y?N:O,y))),y=g.length):l===0&&(d++,g=[0]),m[u++]=d,l&&g[0]?g[y++]=A[_]||0:(g=[A[_]],y=1);while((_++<j||g[0]!==void 0)&&v--)}return m[0]||m.shift(),p.e=c,an(p,o?a+yr(p)+1:a)}}();function xJ(e,t){var n,r,i,a,o,l,c=0,u=0,d=e.constructor,h=d.precision;if(yr(e)>16)throw Error(LD+yr(e));if(!e.s)return new d(Ds);for(t==null?(Rn=!1,l=h):l=t,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(dd(2,u))/Math.LN10*2+5|0,l+=r,n=i=a=new d(Ds),d.precision=l;;){if(i=an(i.times(e),l),n=n.times(++c),o=a.plus(Ml(i,n,l)),zo(o.d).slice(0,l)===zo(a.d).slice(0,l)){for(;u--;)a=an(a.times(a),l);return d.precision=h,t==null?(Rn=!0,an(a,h)):a}a=o}}function yr(e){for(var t=e.e*_n,n=e.d[0];n>=10;n/=10)t++;return t}function DC(e,t,n){if(t>e.LN10.sd())throw Rn=!0,n&&(e.precision=n),Error(Aa+"LN10 precision limit exceeded");return an(new e(e.LN10),t)}function Ec(e){for(var t="";e--;)t+="0";return t}function fx(e,t){var n,r,i,a,o,l,c,u,d,h=1,f=10,p=e,m=p.d,g=p.constructor,y=g.precision;if(p.s<1)throw Error(Aa+(p.s?"NaN":"-Infinity"));if(p.eq(Ds))return new g(0);if(t==null?(Rn=!1,u=y):u=t,p.eq(10))return t==null&&(Rn=!0),DC(g,u);if(u+=f,g.precision=u,n=zo(m),r=n.charAt(0),a=yr(p),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=zo(p.d),r=n.charAt(0),h++;a=yr(p),r>1?(p=new g("0."+n),a++):p=new g(r+"."+n.slice(1))}else return c=DC(g,u+2,y).times(a+""),p=fx(new g(r+"."+n.slice(1)),u-f).plus(c),g.precision=y,t==null?(Rn=!0,an(p,y)):p;for(l=o=p=Ml(p.minus(Ds),p.plus(Ds),u),d=an(p.times(p),u),i=3;;){if(o=an(o.times(d),u),c=l.plus(Ml(o,new g(i),u)),zo(c.d).slice(0,u)===zo(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(DC(g,u+2,y).times(a+""))),l=Ml(l,new g(h),u),g.precision=y,t==null?(Rn=!0,an(l,y)):l;l=c,i+=2}}function P6(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=jg(n/_n),e.d=[],r=(n+1)%_n,n<0&&(r+=_n),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=_n;r<i;)e.d.push(+t.slice(r,r+=_n));t=t.slice(r),r=_n-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Rn&&(e.e>h1||e.e<-h1))throw Error(LD+n)}else e.s=0,e.e=0,e.d=[0];return e}function an(e,t,n){var r,i,a,o,l,c,u,d,h=e.d;for(o=1,a=h[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=_n,i=t,u=h[d=0];else{if(d=Math.ceil((r+1)/_n),a=h.length,d>=a)return e;for(u=a=h[d],o=1;a>=10;a/=10)o++;r%=_n,i=r-_n+o}if(n!==void 0&&(a=dd(10,o-i-1),l=u/a%10|0,c=t<0||h[d+1]!==void 0||u%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?i>0?u/dd(10,o-i):0:h[d-1])%10&1||n==(e.s<0?8:7))),t<1||!h[0])return c?(a=yr(e),h.length=1,t=t-a-1,h[0]=dd(10,(_n-t%_n)%_n),e.e=jg(-t/_n)||0):(h.length=1,h[0]=e.e=e.s=0),e;if(r==0?(h.length=d,a=1,d--):(h.length=d+1,a=dd(10,_n-r),h[d]=i>0?(u/dd(10,o-i)%dd(10,i)|0)*a:0),c)for(;;)if(d==0){(h[0]+=a)==Ur&&(h[0]=1,++e.e);break}else{if(h[d]+=a,h[d]!=Ur)break;h[d--]=0,a=1}for(r=h.length;h[--r]===0;)h.pop();if(Rn&&(e.e>h1||e.e<-h1))throw Error(LD+yr(e));return e}function bJ(e,t){var n,r,i,a,o,l,c,u,d,h,f=e.constructor,p=f.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new f(e),Rn?an(t,p):t;if(c=e.d,h=t.d,r=t.e,u=e.e,c=c.slice(),o=u-r,o){for(d=o<0,d?(n=c,o=-o,l=h.length):(n=h,r=u,l=c.length),i=Math.max(Math.ceil(p/_n),l)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=h.length,d=i<l,d&&(l=i),i=0;i<l;i++)if(c[i]!=h[i]){d=c[i]<h[i];break}o=0}for(d&&(n=c,c=h,h=n,t.s=-t.s),l=c.length,i=h.length-l;i>0;--i)c[l++]=0;for(i=h.length;i>o;){if(c[--i]<h[i]){for(a=i;a&&c[--a]===0;)c[a]=Ur-1;--c[a],c[i]+=Ur}c[i]-=h[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Rn?an(t,p):t):new f(0)}function bh(e,t,n){var r,i=yr(e),a=zo(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Ec(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Ec(-i-1)+a,n&&(r=n-o)>0&&(a+=Ec(r))):i>=o?(a+=Ec(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Ec(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=Ec(r))),e.s<0?"-"+a:a}function O6(e,t){if(e.length>t)return e.length=t,!0}function wJ(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Kd+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return P6(o,a.toString())}else if(typeof a!="string")throw Error(Kd+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,yze.test(a))P6(o,a);else throw Error(Kd+a)}if(i.prototype=Me,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=wJ,i.config=i.set=vze,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function vze(e){if(!e||typeof e!="object")throw Error(Aa+"Object expected");var t,n,r,i=["precision",1,wg,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(jg(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Kd+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Kd+n+": "+r);return this}var FD=wJ(gze);Ds=new FD(1);const nn=FD;function xze(e){return _ze(e)||jze(e)||wze(e)||bze()}function bze(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
741In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wze(e,t){if(e){if(typeof e=="string")return KP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return KP(e,t)}}function jze(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function _ze(e){if(Array.isArray(e))return KP(e)}function KP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Sze=function(t){return t},jJ={"@@functional/placeholder":!0},_J=function(t){return t===jJ},I6=function(t){return function n(){return arguments.length===0||arguments.length===1&&_J(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},kze=function e(t,n){return t===1?n:I6(function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=i.filter(function(l){return l!==jJ}).length;return o>=t?n.apply(void 0,i):e(t-o,I6(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=i.map(function(h){return _J(h)?c.shift():h});return n.apply(void 0,xze(d).concat(c))}))})},YS=function(t){return kze(t.length,t)},GP=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},Nze=YS(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),Cze=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return Sze;var i=n.reverse(),a=i[0],o=i.slice(1);return function(){return o.reduce(function(l,c){return c(l)},a.apply(void 0,arguments))}},YP=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},SJ=function(t){var n=null,r=null;return function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n&&a.every(function(l,c){return l===n[c]})||(n=a,r=t.apply(void 0,a)),r}};function Aze(e){var t;return e===0?t=1:t=Math.floor(new nn(e).abs().log(10).toNumber())+1,t}function Tze(e,t,n){for(var r=new nn(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var Eze=YS(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),Pze=YS(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),Oze=YS(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const QS={rangeStep:Tze,getDigitCount:Aze,interpolateNumber:Eze,uninterpolateNumber:Pze,uninterpolateTruncation:Oze};function QP(e){return Dze(e)||Rze(e)||kJ(e)||Ize()}function Ize(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
742In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rze(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Dze(e){if(Array.isArray(e))return XP(e)}function px(e,t){return Lze(e)||$ze(e,t)||kJ(e,t)||Mze()}function Mze(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
743In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kJ(e,t){if(e){if(typeof e=="string")return XP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return XP(e,t)}}function XP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $ze(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),l;!(r=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){i=!0,a=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}}function Lze(e){if(Array.isArray(e))return e}function NJ(e){var t=px(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function CJ(e,t,n){if(e.lte(0))return new nn(0);var r=QS.getDigitCount(e.toNumber()),i=new nn(10).pow(r),a=e.div(i),o=r!==1?.05:.1,l=new nn(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(i);return t?c:new nn(Math.ceil(c))}function Fze(e,t,n){var r=1,i=new nn(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new nn(10).pow(QS.getDigitCount(e)-1),i=new nn(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new nn(Math.floor(e)))}else e===0?i=new nn(Math.floor((t-1)/2)):n||(i=new nn(Math.floor(e)));var o=Math.floor((t-1)/2),l=Cze(Nze(function(c){return i.add(new nn(c-o).mul(r)).toNumber()}),GP);return l(0,t)}function AJ(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new nn(0),tickMin:new nn(0),tickMax:new nn(0)};var a=CJ(new nn(t).sub(e).div(n-1),r,i),o;e<=0&&t>=0?o=new nn(0):(o=new nn(e).add(t).div(2),o=o.sub(new nn(o).mod(a)));var l=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new nn(t).sub(o).div(a).toNumber()),u=l+c+1;return u>n?AJ(e,t,n,r,i+1):(u<n&&(c=t>0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:a,tickMin:o.sub(new nn(l).mul(a)),tickMax:o.add(new nn(c).mul(a))})}function zze(e){var t=px(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),l=NJ([n,r]),c=px(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var h=d===1/0?[u].concat(QP(GP(0,i-1).map(function(){return 1/0}))):[].concat(QP(GP(0,i-1).map(function(){return-1/0})),[d]);return n>r?YP(h):h}if(u===d)return Fze(u,i,a);var f=AJ(u,d,o,a),p=f.step,m=f.tickMin,g=f.tickMax,y=QS.rangeStep(m,g.add(new nn(.1).mul(p)),p);return n>r?YP(y):y}function Bze(e,t){var n=px(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=NJ([r,i]),l=px(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,i];if(c===u)return[c];var d=Math.max(t,2),h=CJ(new nn(u).sub(c).div(d-1),a,0),f=[].concat(QP(QS.rangeStep(new nn(c),new nn(u).sub(new nn(.99).mul(h)),h)),[u]);return r>i?YP(f):f}var Vze=SJ(zze),Wze=SJ(Bze),Uze="Invariant failed";function wh(e,t){throw new Error(Uze)}var qze=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];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 f1(){return f1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f1.apply(this,arguments)}function Hze(e,t){return Qze(e)||Yze(e,t)||Gze(e,t)||Kze()}function Kze(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
744In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gze(e,t){if(e){if(typeof e=="string")return R6(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R6(e,t)}}function R6(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Yze(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function Qze(e){if(Array.isArray(e))return e}function Xze(e,t){if(e==null)return{};var n=Zze(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zze(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Jze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function e6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,PJ(r.key),r)}}function t6e(e,t,n){return t&&e6e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function n6e(e,t,n){return t=p1(t),r6e(e,TJ()?Reflect.construct(t,n||[],p1(e).constructor):t.apply(e,n))}function r6e(e,t){if(t&&(am(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i6e(e)}function i6e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TJ=function(){return!!e})()}function p1(e){return p1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},p1(e)}function s6e(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&&ZP(e,t)}function ZP(e,t){return ZP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ZP(e,t)}function EJ(e,t,n){return t=PJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PJ(e){var t=a6e(e,"string");return am(t)=="symbol"?t:t+""}function a6e(e,t){if(am(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(am(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kb=function(e){function t(){return Jze(this,t),n6e(this,t,arguments)}return s6e(t,e),t6e(t,[{key:"render",value:function(){var r=this.props,i=r.offset,a=r.layout,o=r.width,l=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,h=r.yAxis,f=Xze(r,qze),p=He(f,!1);this.props.direction==="x"&&d.type!=="number"&&wh();var m=c.map(function(g){var y=u(g,l),b=y.x,v=y.y,w=y.value,_=y.errorVal;if(!_)return null;var j=[],S,k;if(Array.isArray(_)){var N=Hze(_,2);S=N[0],k=N[1]}else S=k=_;if(a==="vertical"){var T=d.scale,C=v+i,A=C+o,O=C-o,z=T(w-S),$=T(w+k);j.push({x1:$,y1:A,x2:$,y2:O}),j.push({x1:z,y1:C,x2:$,y2:C}),j.push({x1:z,y1:A,x2:z,y2:O})}else if(a==="horizontal"){var F=h.scale,B=b+i,P=B-o,I=B+o,M=F(w-S),R=F(w+k);j.push({x1:P,y1:R,x2:I,y2:R}),j.push({x1:B,y1:M,x2:B,y2:R}),j.push({x1:P,y1:M,x2:I,y2:M})}return L.createElement(Ct,f1({className:"recharts-errorBar",key:"bar-".concat(j.map(function(K){return"".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))},p),j.map(function(K){return L.createElement("line",f1({},K,{key:"line-".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))}))});return L.createElement(Ct,{className:"recharts-errorBars"},m)}}])}(L.Component);EJ(kb,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});EJ(kb,"displayName","ErrorBar");function mx(e){"@babel/helpers - typeof";return mx=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},mx(e)}function D6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Xu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?D6(Object(n),!0).forEach(function(r){o6e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D6(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function o6e(e,t,n){return t=l6e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l6e(e){var t=c6e(e,"string");return mx(t)=="symbol"?t:t+""}function c6e(e,t){if(mx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(mx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var OJ=function(t){var n=t.children,r=t.formattedGraphicalItems,i=t.legendWidth,a=t.legendContent,o=Os(n,uu);if(!o)return null;var l=uu.defaultProps,c=l!==void 0?Xu(Xu({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:a==="children"?u=(r||[]).reduce(function(d,h){var f=h.item,p=h.props,m=p.sectors||p.data||[];return d.concat(m.map(function(g){return{type:o.props.iconType||f.props.legendType,value:g.name,color:g.fill,payload:g}}))},[]):u=(r||[]).map(function(d){var h=d.item,f=h.type.defaultProps,p=f!==void 0?Xu(Xu({},f),h.props):{},m=p.dataKey,g=p.name,y=p.legendType,b=p.hide;return{inactive:b,dataKey:m,type:c.iconType||y||"square",color:zD(h),value:g||m,payload:p}}),Xu(Xu(Xu({},c),uu.getWithHeight(o,i)),{},{payload:u,item:o})};function gx(e){"@babel/helpers - typeof";return gx=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},gx(e)}function M6(e){return f6e(e)||h6e(e)||d6e(e)||u6e()}function u6e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
745In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d6e(e,t){if(e){if(typeof e=="string")return JP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return JP(e,t)}}function h6e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function f6e(e){if(Array.isArray(e))return JP(e)}function JP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$6(Object(n),!0).forEach(function(r){mp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$6(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mp(e,t,n){return t=p6e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p6e(e){var t=m6e(e,"string");return gx(t)=="symbol"?t:t+""}function m6e(e,t){if(gx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(gx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function er(e,t,n){return dt(e)||dt(t)?n:Dr(t)?zs(e,t,n):tt(t)?t(e):n}function Xy(e,t,n,r){var i=hze(e,function(l){return er(l,t)});if(n==="number"){var a=i.filter(function(l){return ge(l)||parseFloat(l)});return a.length?[GS(a),Xc(a)]:[1/0,-1/0]}var o=r?i.filter(function(l){return!dt(l)}):i;return o.map(function(l){return Dr(l)||l instanceof Date?l:""})}var g6e=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,u=0;u<l;u++){var d=u>0?i[u-1].coordinate:i[l-1].coordinate,h=i[u].coordinate,f=u>=l-1?i[0].coordinate:i[u+1].coordinate,p=void 0;if(Mi(h-d)!==Mi(f-h)){var m=[];if(Mi(f-h)===Mi(c[1]-c[0])){p=f;var g=h+c[1]-c[0];m[0]=Math.min(g,(g+d)/2),m[1]=Math.max(g,(g+d)/2)}else{p=d;var y=f+c[1]-c[0];m[0]=Math.min(h,(y+h)/2),m[1]=Math.max(h,(y+h)/2)}var b=[Math.min(h,(p+h)/2),Math.max(h,(p+h)/2)];if(t>b[0]&&t<=b[1]||t>=m[0]&&t<=m[1]){o=i[u].index;break}}else{var v=Math.min(d,f),w=Math.max(d,f);if(t>(v+h)/2&&t<=(w+h)/2){o=i[u].index;break}}}else for(var _=0;_<l;_++)if(_===0&&t<=(r[_].coordinate+r[_+1].coordinate)/2||_>0&&_<l-1&&t>(r[_].coordinate+r[_-1].coordinate)/2&&t<=(r[_].coordinate+r[_+1].coordinate)/2||_===l-1&&t>(r[_].coordinate+r[_-1].coordinate)/2){o=r[_].index;break}return o},zD=function(t){var n,r=t,i=r.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Kn(Kn({},t.type.defaultProps),t.props):t.props,o=a.stroke,l=a.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},y6e=function(t){var n=t.barSize,r=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},l=Object.keys(a),c=0,u=l.length;c<u;c++)for(var d=a[l[c]].stackGroups,h=Object.keys(d),f=0,p=h.length;f<p;f++){var m=d[h[f]],g=m.items,y=m.cateAxisId,b=g.filter(function(k){return Dl(k.type).indexOf("Bar")>=0});if(b&&b.length){var v=b[0].type.defaultProps,w=v!==void 0?Kn(Kn({},v),b[0].props):b[0].props,_=w.barSize,j=w[y];o[j]||(o[j]=[]);var S=dt(_)?n:_;o[j].push({item:b[0],stackList:b.slice(1),barSize:dt(S)?void 0:$i(S,r,0)})}}return o},v6e=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=$i(n,i,0,!0),d,h=[];if(o[0].barSize===+o[0].barSize){var f=!1,p=i/c,m=o.reduce(function(_,j){return _+j.barSize||0},0);m+=(c-1)*u,m>=i&&(m-=(c-1)*u,u=0),m>=i&&p>0&&(f=!0,p*=.9,m=c*p);var g=(i-m)/2>>0,y={offset:g-u,size:0};d=o.reduce(function(_,j){var S={item:j.item,position:{offset:y.offset+y.size+u,size:f?p:j.barSize}},k=[].concat(M6(_),[S]);return y=k[k.length-1].position,j.stackList&&j.stackList.length&&j.stackList.forEach(function(N){k.push({item:N,position:y})}),k},h)}else{var b=$i(r,i,0,!0);i-2*b-(c-1)*u<=0&&(u=0);var v=(i-2*b-(c-1)*u)/c;v>1&&(v>>=0);var w=l===+l?Math.min(v,l):v;d=o.reduce(function(_,j,S){var k=[].concat(M6(_),[{item:j.item,position:{offset:b+(v+u)*S+(v-w)/2,size:w}}]);return j.stackList&&j.stackList.length&&j.stackList.forEach(function(N){k.push({item:N,position:k[k.length-1].position})}),k},h)}return d},x6e=function(t,n,r,i){var a=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=OJ({children:a,legendWidth:c});if(u){var d=i||{},h=d.width,f=d.height,p=u.align,m=u.verticalAlign,g=u.layout;if((g==="vertical"||g==="horizontal"&&m==="middle")&&p!=="center"&&ge(t[p]))return Kn(Kn({},t),{},mp({},p,t[p]+(h||0)));if((g==="horizontal"||g==="vertical"&&p==="center")&&m!=="middle"&&ge(t[m]))return Kn(Kn({},t),{},mp({},m,t[m]+(f||0)))}return t},b6e=function(t,n,r){return dt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},IJ=function(t,n,r,i,a){var o=n.props.children,l=Bs(o,kb).filter(function(u){return b6e(i,a,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var h=er(d,r);if(dt(h))return u;var f=Array.isArray(h)?[GS(h),Xc(h)]:[h,h],p=c.reduce(function(m,g){var y=er(d,g,0),b=f[0]-Math.abs(Array.isArray(y)?y[0]:y),v=f[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(b,m[0]),Math.max(v,m[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},w6e=function(t,n,r,i,a){var o=n.map(function(l){return IJ(t,l,r,a,i)}).filter(function(l){return!dt(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},RJ=function(t,n,r,i,a){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&IJ(t,c,u,i)||Xy(t,u,r,a)});if(r==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,h=u.length;d<h;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},DJ=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},MJ=function(t,n,r,i){if(i)return t.map(function(c){return c.coordinate});var a,o,l=t.map(function(c){return c.coordinate===n&&(a=!0),c.coordinate===r&&(o=!0),c.coordinate});return a||l.push(n),o||l.push(r),l},Ol=function(t,n,r){if(!t)return null;var i=t.scale,a=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(n||r)&&o==="category"&&i.bandwidth?i.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?Mi(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(h){var f=a?a.indexOf(h):h;return{coordinate:i(f)+u,value:h,offset:u}});return d.filter(function(h){return!mg(h.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(h,f){return{coordinate:i(h)+u,value:h,index:f,offset:u}}):i.ticks&&!r?i.ticks(t.tickCount).map(function(h){return{coordinate:i(h)+u,value:h,offset:u}}):i.domain().map(function(h,f){return{coordinate:i(h)+u,value:a?a[h]:h,index:f,offset:u}})},MC=new WeakMap,z0=function(t,n){if(typeof n!="function")return t;MC.has(t)||MC.set(t,new WeakMap);var r=MC.get(t);if(r.has(n))return r.get(n);var i=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},$J=function(t,n,r){var i=t.scale,a=t.type,o=t.layout,l=t.axisType;if(i==="auto")return o==="radial"&&l==="radiusAxis"?{scale:lx(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:l1(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Qy(),realScaleType:"point"}:a==="category"?{scale:lx(),realScaleType:"band"}:{scale:l1(),realScaleType:"linear"};if(gh(i)){var c="scale".concat(RS(i));return{scale:(E6[c]||Qy)(),realScaleType:E6[c]?c:"point"}}return tt(i)?{scale:i}:{scale:Qy(),realScaleType:"point"}},L6=1e-4,LJ=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,i=t.range(),a=Math.min(i[0],i[1])-L6,o=Math.max(i[0],i[1])+L6,l=t(n[0]),c=t(n[r-1]);(l<a||l>o||c<a||c>o)&&t.domain([n[0],n[r-1]])}},j6e=function(t,n){if(!t)return null;for(var r=0,i=t.length;r<i;r++)if(t[r].item===n)return t[r].position;return null},_6e=function(t,n){if(!n||n.length!==2||!ge(n[0])||!ge(n[1]))return t;var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]),a=[t[0],t[1]];return(!ge(t[0])||t[0]<r)&&(a[0]=r),(!ge(t[1])||t[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<r&&(a[1]=r),a},S6e=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var a=0,o=0,l=0;l<n;++l){var c=mg(t[l][r][1])?t[l][r][0]:t[l][r][1];c>=0?(t[l][r][0]=a,t[l][r][1]=a+c,a=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},k6e=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var a=0,o=0;o<n;++o){var l=mg(t[o][r][1])?t[o][r][0]:t[o][r][1];l>=0?(t[o][r][0]=a,t[o][r][1]=a+l,a=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},N6e={sign:S6e,expand:qPe,none:Zp,silhouette:HPe,wiggle:KPe,positive:k6e},C6e=function(t,n,r){var i=n.map(function(l){return l.props.dataKey}),a=N6e[r],o=UPe().keys(i).value(function(l,c){return+er(l,c,0)}).order(SP).offset(a);return o(t)},A6e=function(t,n,r,i,a,o){if(!t)return null;var l=o?n.reverse():n,c={},u=l.reduce(function(h,f){var p,m=(p=f.type)!==null&&p!==void 0&&p.defaultProps?Kn(Kn({},f.type.defaultProps),f.props):f.props,g=m.stackId,y=m.hide;if(y)return h;var b=m[r],v=h[b]||{hasStack:!1,stackGroups:{}};if(Dr(g)){var w=v.stackGroups[g]||{numericAxisId:r,cateAxisId:i,items:[]};w.items.push(f),v.hasStack=!0,v.stackGroups[g]=w}else v.stackGroups[Mh("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[f]};return Kn(Kn({},h),{},mp({},b,v))},c),d={};return Object.keys(u).reduce(function(h,f){var p=u[f];if(p.hasStack){var m={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(g,y){var b=p.stackGroups[y];return Kn(Kn({},g),{},mp({},y,{numericAxisId:r,cateAxisId:i,items:b.items,stackedData:C6e(t,b.items,a)}))},m)}return Kn(Kn({},h),{},mp({},f,p))},d)},FJ=function(t,n){var r=n.realScaleType,i=n.type,a=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=Vze(u,a,l);return t.domain([GS(d),Xc(d)]),{niceTicks:d}}if(a&&i==="number"){var h=t.domain(),f=Wze(h,a,l);return{niceTicks:f}}return null};function m1(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!dt(i[t.dataKey])){var l=Bj(n,"value",i[t.dataKey]);if(l)return l.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=er(i,dt(o)?t.dataKey:o);return dt(c)?null:t.scale(c)}var F6=function(t){var n=t.axis,r=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+i:null;var c=er(o,n.dataKey,n.domain[l]);return dt(c)?null:n.scale(c)-a/2+i},T6e=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return i<=0&&a>=0?0:a<0?a:i}return r[0]},E6e=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Kn(Kn({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Dr(a)){var o=n[a];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},P6e=function(t){return t.reduce(function(n,r){return[GS(r.concat([n[0]]).filter(ge)),Xc(r.concat([n[1]]).filter(ge))]},[1/0,-1/0])},zJ=function(t,n,r){return Object.keys(t).reduce(function(i,a){var o=t[a],l=o.stackedData,c=l.reduce(function(u,d){var h=P6e(d.slice(n,r+1));return[Math.min(u[0],h[0]),Math.max(u[1],h[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},z6=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,B6=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,e2=function(t,n,r){if(tt(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(ge(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(z6.test(t[0])){var a=+z6.exec(t[0])[1];i[0]=n[0]-a}else tt(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(ge(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(B6.test(t[1])){var o=+B6.exec(t[1])[1];i[1]=n[1]+o}else tt(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},g1=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!r||i>0)return i}if(t&&n&&n.length>=2){for(var a=pD(n,function(h){return h.coordinate}),o=1/0,l=1,c=a.length;l<c;l++){var u=a[l],d=a[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},V6=function(t,n,r){return!t||!t.length||xh(t,zs(r,"type.defaultProps.domain"))?n:t},BJ=function(t,n){var r=t.type.defaultProps?Kn(Kn({},t.type.defaultProps),t.props):t.props,i=r.dataKey,a=r.name,o=r.unit,l=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return Kn(Kn({},He(t,!1)),{},{dataKey:i,unit:o,formatter:l,name:a||i,color:zD(t),value:er(n,i),type:c,payload:n,chartType:u,hide:d})};function yx(e){"@babel/helpers - typeof";return yx=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},yx(e)}function W6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W6(Object(n),!0).forEach(function(r){VJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W6(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VJ(e,t,n){return t=O6e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O6e(e){var t=I6e(e,"string");return yx(t)=="symbol"?t:t+""}function I6e(e,t){if(yx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(yx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function R6e(e,t){return L6e(e)||$6e(e,t)||M6e(e,t)||D6e()}function D6e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
746In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M6e(e,t){if(e){if(typeof e=="string")return U6(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U6(e,t)}}function U6(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $6e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function L6e(e){if(Array.isArray(e))return e}var y1=Math.PI/180,F6e=function(t){return t*180/Math.PI},mn=function(t,n,r,i){return{x:t+Math.cos(-y1*i)*r,y:n+Math.sin(-y1*i)*r}},WJ=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},z6e=function(t,n,r,i,a){var o=t.width,l=t.height,c=t.startAngle,u=t.endAngle,d=$i(t.cx,o,o/2),h=$i(t.cy,l,l/2),f=WJ(o,l,r),p=$i(t.innerRadius,f,0),m=$i(t.outerRadius,f,f*.8),g=Object.keys(n);return g.reduce(function(y,b){var v=n[b],w=v.domain,_=v.reversed,j;if(dt(v.range))i==="angleAxis"?j=[c,u]:i==="radiusAxis"&&(j=[p,m]),_&&(j=[j[1],j[0]]);else{j=v.range;var S=j,k=R6e(S,2);c=k[0],u=k[1]}var N=$J(v,a),T=N.realScaleType,C=N.scale;C.domain(w).range(j),LJ(C);var A=FJ(C,wl(wl({},v),{},{realScaleType:T})),O=wl(wl(wl({},v),A),{},{range:j,radius:m,realScaleType:T,scale:C,cx:d,cy:h,innerRadius:p,outerRadius:m,startAngle:c,endAngle:u});return wl(wl({},y),{},VJ({},b,O))},{})},B6e=function(t,n){var r=t.x,i=t.y,a=n.x,o=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(i-o,2))},V6e=function(t,n){var r=t.x,i=t.y,a=n.cx,o=n.cy,l=B6e({x:r,y:i},{x:a,y:o});if(l<=0)return{radius:l};var c=(r-a)/l,u=Math.acos(c);return i>o&&(u=2*Math.PI-u),{radius:l,angle:F6e(u),angleInRadian:u}},W6e=function(t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return{startAngle:n-o*360,endAngle:r-o*360}},U6e=function(t,n){var r=n.startAngle,i=n.endAngle,a=Math.floor(r/360),o=Math.floor(i/360),l=Math.min(a,o);return t+l*360},q6=function(t,n){var r=t.x,i=t.y,a=V6e({x:r,y:i},n),o=a.radius,l=a.angle,c=n.innerRadius,u=n.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=W6e(n),h=d.startAngle,f=d.endAngle,p=l,m;if(h<=f){for(;p>f;)p-=360;for(;p<h;)p+=360;m=p>=h&&p<=f}else{for(;p>h;)p-=360;for(;p<f;)p+=360;m=p>=f&&p<=h}return m?wl(wl({},n),{},{radius:o,angle:U6e(p,n)}):null},UJ=function(t){return!x.isValidElement(t)&&!tt(t)&&typeof t!="boolean"?t.className:""};function vx(e){"@babel/helpers - typeof";return vx=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},vx(e)}var q6e=["offset"];function H6e(e){return Q6e(e)||Y6e(e)||G6e(e)||K6e()}function K6e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
747In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G6e(e,t){if(e){if(typeof e=="string")return t2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t2(e,t)}}function Y6e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Q6e(e){if(Array.isArray(e))return t2(e)}function t2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function X6e(e,t){if(e==null)return{};var n=Z6e(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Z6e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function H6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H6(Object(n),!0).forEach(function(r){J6e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H6(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function J6e(e,t,n){return t=eBe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eBe(e){var t=tBe(e,"string");return vx(t)=="symbol"?t:t+""}function tBe(e,t){if(vx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(vx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xx(){return xx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xx.apply(this,arguments)}var nBe=function(t){var n=t.value,r=t.formatter,i=dt(t.children)?n:t.children;return tt(r)?r(i):i},rBe=function(t,n){var r=Mi(n-t),i=Math.min(Math.abs(n-t),360);return r*i},iBe=function(t,n,r){var i=t.position,a=t.viewBox,o=t.offset,l=t.className,c=a,u=c.cx,d=c.cy,h=c.innerRadius,f=c.outerRadius,p=c.startAngle,m=c.endAngle,g=c.clockWise,y=(h+f)/2,b=rBe(p,m),v=b>=0?1:-1,w,_;i==="insideStart"?(w=p+v*o,_=g):i==="insideEnd"?(w=m-v*o,_=!g):i==="end"&&(w=m+v*o,_=g),_=b<=0?_:!_;var j=mn(u,d,y,w),S=mn(u,d,y,w+(_?1:-1)*359),k="M".concat(j.x,",").concat(j.y,`
748    A`).concat(y,",").concat(y,",0,1,").concat(_?0:1,`,
749    `).concat(S.x,",").concat(S.y),N=dt(t.id)?Mh("recharts-radial-line-"):t.id;return L.createElement("text",xx({},r,{dominantBaseline:"central",className:mt("recharts-radial-bar-label",l)}),L.createElement("defs",null,L.createElement("path",{id:N,d:k})),L.createElement("textPath",{xlinkHref:"#".concat(N)},n))},sBe=function(t){var n=t.viewBox,r=t.offset,i=t.position,a=n,o=a.cx,l=a.cy,c=a.innerRadius,u=a.outerRadius,d=a.startAngle,h=a.endAngle,f=(d+h)/2;if(i==="outside"){var p=mn(o,l,u+r,f),m=p.x,g=p.y;return{x:m,y:g,textAnchor:m>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var y=(c+u)/2,b=mn(o,l,y,f),v=b.x,w=b.y;return{x:v,y:w,textAnchor:"middle",verticalAnchor:"middle"}},aBe=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,a=t.position,o=n,l=o.x,c=o.y,u=o.width,d=o.height,h=d>=0?1:-1,f=h*i,p=h>0?"end":"start",m=h>0?"start":"end",g=u>=0?1:-1,y=g*i,b=g>0?"end":"start",v=g>0?"start":"end";if(a==="top"){var w={x:l+u/2,y:c-h*i,textAnchor:"middle",verticalAnchor:p};return Nr(Nr({},w),r?{height:Math.max(c-r.y,0),width:u}:{})}if(a==="bottom"){var _={x:l+u/2,y:c+d+f,textAnchor:"middle",verticalAnchor:m};return Nr(Nr({},_),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(a==="left"){var j={x:l-y,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return Nr(Nr({},j),r?{width:Math.max(j.x-r.x,0),height:d}:{})}if(a==="right"){var S={x:l+u+y,y:c+d/2,textAnchor:v,verticalAnchor:"middle"};return Nr(Nr({},S),r?{width:Math.max(r.x+r.width-S.x,0),height:d}:{})}var k=r?{width:u,height:d}:{};return a==="insideLeft"?Nr({x:l+y,y:c+d/2,textAnchor:v,verticalAnchor:"middle"},k):a==="insideRight"?Nr({x:l+u-y,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},k):a==="insideTop"?Nr({x:l+u/2,y:c+f,textAnchor:"middle",verticalAnchor:m},k):a==="insideBottom"?Nr({x:l+u/2,y:c+d-f,textAnchor:"middle",verticalAnchor:p},k):a==="insideTopLeft"?Nr({x:l+y,y:c+f,textAnchor:v,verticalAnchor:m},k):a==="insideTopRight"?Nr({x:l+u-y,y:c+f,textAnchor:b,verticalAnchor:m},k):a==="insideBottomLeft"?Nr({x:l+y,y:c+d-f,textAnchor:v,verticalAnchor:p},k):a==="insideBottomRight"?Nr({x:l+u-y,y:c+d-f,textAnchor:b,verticalAnchor:p},k):dg(a)&&(ge(a.x)||kd(a.x))&&(ge(a.y)||kd(a.y))?Nr({x:l+$i(a.x,u),y:c+$i(a.y,d),textAnchor:"end",verticalAnchor:"end"},k):Nr({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},k)},oBe=function(t){return"cx"in t&&ge(t.cx)};function Hr(e){var t=e.offset,n=t===void 0?5:t,r=X6e(e,q6e),i=Nr({offset:n},r),a=i.viewBox,o=i.position,l=i.value,c=i.children,u=i.content,d=i.className,h=d===void 0?"":d,f=i.textBreakAll;if(!a||dt(l)&&dt(c)&&!x.isValidElement(u)&&!tt(u))return null;if(x.isValidElement(u))return x.cloneElement(u,i);var p;if(tt(u)){if(p=x.createElement(u,i),x.isValidElement(p))return p}else p=nBe(i);var m=oBe(a),g=He(i,!0);if(m&&(o==="insideStart"||o==="insideEnd"||o==="end"))return iBe(i,p,g);var y=m?sBe(i):aBe(i);return L.createElement(vh,xx({className:mt("recharts-label",h)},g,y,{breakAll:f}),p)}Hr.displayName="Label";var qJ=function(t){var n=t.cx,r=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,h=t.x,f=t.y,p=t.top,m=t.left,g=t.width,y=t.height,b=t.clockWise,v=t.labelViewBox;if(v)return v;if(ge(g)&&ge(y)){if(ge(h)&&ge(f))return{x:h,y:f,width:g,height:y};if(ge(p)&&ge(m))return{x:p,y:m,width:g,height:y}}return ge(h)&&ge(f)?{x:h,y:f,width:0,height:0}:ge(n)&&ge(r)?{cx:n,cy:r,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:b}:t.viewBox?t.viewBox:{}},lBe=function(t,n){return t?t===!0?L.createElement(Hr,{key:"label-implicit",viewBox:n}):Dr(t)?L.createElement(Hr,{key:"label-implicit",viewBox:n,value:t}):x.isValidElement(t)?t.type===Hr?x.cloneElement(t,{key:"label-implicit",viewBox:n}):L.createElement(Hr,{key:"label-implicit",content:t,viewBox:n}):tt(t)?L.createElement(Hr,{key:"label-implicit",content:t,viewBox:n}):dg(t)?L.createElement(Hr,xx({viewBox:n},t,{key:"label-implicit"})):null:null},cBe=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var i=t.children,a=qJ(t),o=Bs(i,Hr).map(function(c,u){return x.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return o;var l=lBe(t.label,n||a);return[l].concat(H6e(o))};Hr.parseViewBox=qJ;Hr.renderCallByParent=cBe;function uBe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var dBe=uBe;const hBe=Ot(dBe);function bx(e){"@babel/helpers - typeof";return bx=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},bx(e)}var fBe=["valueAccessor"],pBe=["data","dataKey","clockWise","id","textBreakAll"];function mBe(e){return xBe(e)||vBe(e)||yBe(e)||gBe()}function gBe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
750In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yBe(e,t){if(e){if(typeof e=="string")return n2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return n2(e,t)}}function vBe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xBe(e){if(Array.isArray(e))return n2(e)}function n2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v1(){return v1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v1.apply(this,arguments)}function K6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function G6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K6(Object(n),!0).forEach(function(r){bBe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K6(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bBe(e,t,n){return t=wBe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wBe(e){var t=jBe(e,"string");return bx(t)=="symbol"?t:t+""}function jBe(e,t){if(bx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(bx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Y6(e,t){if(e==null)return{};var n=_Be(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _Be(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var SBe=function(t){return Array.isArray(t.value)?hBe(t.value):t.value};function Yo(e){var t=e.valueAccessor,n=t===void 0?SBe:t,r=Y6(e,fBe),i=r.data,a=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=Y6(r,pBe);return!i||!i.length?null:L.createElement(Ct,{className:"recharts-label-list"},i.map(function(d,h){var f=dt(a)?n(d,h):er(d&&d.payload,a),p=dt(l)?{}:{id:"".concat(l,"-").concat(h)};return L.createElement(Hr,v1({},He(d,!0),u,p,{parentViewBox:d.parentViewBox,value:f,textBreakAll:c,viewBox:Hr.parseViewBox(dt(o)?d:G6(G6({},d),{},{clockWise:o})),key:"label-".concat(h),index:h}))}))}Yo.displayName="LabelList";function kBe(e,t){return e?e===!0?L.createElement(Yo,{key:"labelList-implicit",data:t}):L.isValidElement(e)||tt(e)?L.createElement(Yo,{key:"labelList-implicit",data:t,content:e}):dg(e)?L.createElement(Yo,v1({data:t},e,{key:"labelList-implicit"})):null:null}function NBe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=Bs(r,Yo).map(function(o,l){return x.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return i;var a=kBe(e.label,t);return[a].concat(mBe(i))}Yo.renderCallByParent=NBe;function wx(e){"@babel/helpers - typeof";return wx=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},wx(e)}function r2(){return r2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r2.apply(this,arguments)}function Q6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function X6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q6(Object(n),!0).forEach(function(r){CBe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q6(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CBe(e,t,n){return t=ABe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ABe(e){var t=TBe(e,"string");return wx(t)=="symbol"?t:t+""}function TBe(e,t){if(wx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(wx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var EBe=function(t,n){var r=Mi(n-t),i=Math.min(Math.abs(n-t),359.999);return r*i},B0=function(t){var n=t.cx,r=t.cy,i=t.radius,a=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+i,h=Math.asin(c/d)/y1,f=u?a:a+o*h,p=mn(n,r,d,f),m=mn(n,r,i,f),g=u?a-o*h:a,y=mn(n,r,d*Math.cos(h*y1),g);return{center:p,circleTangency:m,lineTangency:y,theta:h}},HJ=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.startAngle,l=t.endAngle,c=EBe(o,l),u=o+c,d=mn(n,r,a,o),h=mn(n,r,a,u),f="M ".concat(d.x,",").concat(d.y,`
751    A `).concat(a,",").concat(a,`,0,
752    `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
753    `).concat(h.x,",").concat(h.y,`
754  `);if(i>0){var p=mn(n,r,i,o),m=mn(n,r,i,u);f+="L ".concat(m.x,",").concat(m.y,`
755            A `).concat(i,",").concat(i,`,0,
756            `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
757            `).concat(p.x,",").concat(p.y," Z")}else f+="L ".concat(n,",").concat(r," Z");return f},PBe=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,h=Mi(d-u),f=B0({cx:n,cy:r,radius:a,angle:u,sign:h,cornerRadius:o,cornerIsExternal:c}),p=f.circleTangency,m=f.lineTangency,g=f.theta,y=B0({cx:n,cy:r,radius:a,angle:d,sign:-h,cornerRadius:o,cornerIsExternal:c}),b=y.circleTangency,v=y.lineTangency,w=y.theta,_=c?Math.abs(u-d):Math.abs(u-d)-g-w;if(_<0)return l?"M ".concat(m.x,",").concat(m.y,`
758        a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
759        a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
760      `):HJ({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d});var j="M ".concat(m.x,",").concat(m.y,`
761    A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(p.x,",").concat(p.y,`
762    A`).concat(a,",").concat(a,",0,").concat(+(_>180),",").concat(+(h<0),",").concat(b.x,",").concat(b.y,`
763    A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(v.x,",").concat(v.y,`
764  `);if(i>0){var S=B0({cx:n,cy:r,radius:i,angle:u,sign:h,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),k=S.circleTangency,N=S.lineTangency,T=S.theta,C=B0({cx:n,cy:r,radius:i,angle:d,sign:-h,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),A=C.circleTangency,O=C.lineTangency,z=C.theta,$=c?Math.abs(u-d):Math.abs(u-d)-T-z;if($<0&&o===0)return"".concat(j,"L").concat(n,",").concat(r,"Z");j+="L".concat(O.x,",").concat(O.y,`
765      A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(A.x,",").concat(A.y,`
766      A`).concat(i,",").concat(i,",0,").concat(+($>180),",").concat(+(h>0),",").concat(k.x,",").concat(k.y,`
767      A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(N.x,",").concat(N.y,"Z")}else j+="L".concat(n,",").concat(r,"Z");return j},OBe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},KJ=function(t){var n=X6(X6({},OBe),t),r=n.cx,i=n.cy,a=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,h=n.endAngle,f=n.className;if(o<a||d===h)return null;var p=mt("recharts-sector",f),m=o-a,g=$i(l,m,0,!0),y;return g>0&&Math.abs(d-h)<360?y=PBe({cx:r,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(g,m/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:h}):y=HJ({cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:d,endAngle:h}),L.createElement("path",r2({},He(n,!0),{className:p,d:y,role:"img"}))};function jx(e){"@babel/helpers - typeof";return jx=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},jx(e)}function i2(){return i2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i2.apply(this,arguments)}function Z6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function J6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
767t%2?Z6(Object(n),!0).forEach(function(r){IBe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z6(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IBe(e,t,n){return t=RBe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RBe(e){var t=DBe(e,"string");return jx(t)=="symbol"?t:t+""}function DBe(e,t){if(jx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(jx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var eB={curveBasisClosed:IPe,curveBasisOpen:RPe,curveBasis:OPe,curveBumpX:vPe,curveBumpY:xPe,curveLinearClosed:DPe,curveLinear:MS,curveMonotoneX:MPe,curveMonotoneY:$Pe,curveNatural:LPe,curveStep:FPe,curveStepAfter:BPe,curveStepBefore:zPe},V0=function(t){return t.x===+t.x&&t.y===+t.y},Xg=function(t){return t.x},Zg=function(t){return t.y},MBe=function(t,n){if(tt(t))return t;var r="curve".concat(RS(t));return(r==="curveMonotone"||r==="curveBump")&&n?eB["".concat(r).concat(n==="vertical"?"Y":"X")]:eB[r]||MS},$Be=function(t){var n=t.type,r=n===void 0?"linear":n,i=t.points,a=i===void 0?[]:i,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=MBe(r,l),h=u?a.filter(function(g){return V0(g)}):a,f;if(Array.isArray(o)){var p=u?o.filter(function(g){return V0(g)}):o,m=h.map(function(g,y){return J6(J6({},g),{},{base:p[y]})});return l==="vertical"?f=O0().y(Zg).x1(Xg).x0(function(g){return g.base.x}):f=O0().x(Xg).y1(Zg).y0(function(g){return g.base.y}),f.defined(V0).curve(d),f(m)}return l==="vertical"&&ge(o)?f=O0().y(Zg).x1(Xg).x0(o):ge(o)?f=O0().x(Xg).y1(Zg).y0(o):f=BX().x(Xg).y(Zg),f.defined(V0).curve(d),f(h)},Gd=function(t){var n=t.className,r=t.points,i=t.path,a=t.pathRef;if((!r||!r.length)&&!i)return null;var o=r&&r.length?$Be(t):i;return x.createElement("path",i2({},He(t,!1),Vj(t),{className:mt("recharts-curve",n),d:o,ref:a}))},GJ={exports:{}},LBe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",FBe=LBe,zBe=FBe;function YJ(){}function QJ(){}QJ.resetWarningCache=YJ;var BBe=function(){function e(r,i,a,o,l,c){if(c!==zBe){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={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:QJ,resetWarningCache:YJ};return n.PropTypes=n,n};GJ.exports=BBe();var VBe=GJ.exports;const Gt=Ot(VBe);var WBe=Object.getOwnPropertyNames,UBe=Object.getOwnPropertySymbols,qBe=Object.prototype.hasOwnProperty;function tB(e,t){return function(r,i,a){return e(r,i,a)&&t(r,i,a)}}function W0(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);var a=i.cache,o=a.get(n),l=a.get(r);if(o&&l)return o===r&&l===n;a.set(n,r),a.set(r,n);var c=e(n,r,i);return a.delete(n),a.delete(r),c}}function nB(e){return WBe(e).concat(UBe(e))}var HBe=Object.hasOwn||function(e,t){return qBe.call(e,t)};function Fh(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var KBe="__v",GBe="__o",YBe="_owner",rB=Object.getOwnPropertyDescriptor,iB=Object.keys;function QBe(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function XBe(e,t){return Fh(e.getTime(),t.getTime())}function ZBe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function JBe(e,t){return e===t}function sB(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var i=new Array(r),a=e.entries(),o,l,c=0;(o=a.next())&&!o.done;){for(var u=t.entries(),d=!1,h=0;(l=u.next())&&!l.done;){if(i[h]){h++;continue}var f=o.value,p=l.value;if(n.equals(f[0],p[0],c,h,e,t,n)&&n.equals(f[1],p[1],f[0],p[0],e,t,n)){d=i[h]=!0;break}h++}if(!d)return!1;c++}return!0}var e8e=Fh;function t8e(e,t,n){var r=iB(e),i=r.length;if(iB(t).length!==i)return!1;for(;i-- >0;)if(!XJ(e,t,n,r[i]))return!1;return!0}function Jg(e,t,n){var r=nB(e),i=r.length;if(nB(t).length!==i)return!1;for(var a,o,l;i-- >0;)if(a=r[i],!XJ(e,t,n,a)||(o=rB(e,a),l=rB(t,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function n8e(e,t){return Fh(e.valueOf(),t.valueOf())}function r8e(e,t){return e.source===t.source&&e.flags===t.flags}
767function aB(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var i=new Array(r),a=e.values(),o,l;(o=a.next())&&!o.done;){for(var c=t.values(),u=!1,d=0;(l=c.next())&&!l.done;){if(!i[d]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){u=i[d]=!0;break}d++}if(!u)return!1}return!0}function i8e(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function s8e(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 XJ(e,t,n,r){return(r===YBe||r===GBe||r===KBe)&&(e.$$typeof||t.$$typeof)?!0:HBe(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var a8e="[object Arguments]",o8e="[object Boolean]",l8e="[object Date]",c8e="[object Error]",u8e="[object Map]",d8e="[object Number]",h8e="[object Object]",f8e="[object RegExp]",p8e="[object Set]",m8e="[object String]",g8e="[object URL]",y8e=Array.isArray,oB=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,lB=Object.assign,v8e=Object.prototype.toString.call.bind(Object.prototype.toString);function x8e(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,i=e.areFunctionsEqual,a=e.areMapsEqual,o=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,h=e.areTypedArraysEqual,f=e.areUrlsEqual;return function(m,g,y){if(m===g)return!0;if(m==null||g==null)return!1;var b=typeof m;if(b!==typeof g)return!1;if(b!=="object")return b==="number"?o(m,g,y):b==="function"?i(m,g,y):!1;var v=m.constructor;if(v!==g.constructor)return!1;if(v===Object)return l(m,g,y);if(y8e(m))return t(m,g,y);if(oB!=null&&oB(m))return h(m,g,y);if(v===Date)return n(m,g,y);if(v===RegExp)return u(m,g,y);if(v===Map)return a(m,g,y);if(v===Set)return d(m,g,y);var w=v8e(m);return w===l8e?n(m,g,y):w===f8e?u(m,g,y):w===u8e?a(m,g,y):w===p8e?d(m,g,y):w===h8e?typeof m.then!="function"&&typeof g.then!="function"&&l(m,g,y):w===g8e?f(m,g,y):w===c8e?r(m,g,y):w===a8e?l(m,g,y):w===o8e||w===d8e||w===m8e?c(m,g,y):!1}}function b8e(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?Jg:QBe,areDatesEqual:XBe,areErrorsEqual:ZBe,areFunctionsEqual:JBe,areMapsEqual:r?tB(sB,Jg):sB,areNumbersEqual:e8e,areObjectsEqual:r?Jg:t8e,arePrimitiveWrappersEqual:n8e,areRegExpsEqual:r8e,areSetsEqual:r?tB(aB,Jg):aB,areTypedArraysEqual:r?Jg:i8e,areUrlsEqual:s8e};if(n&&(i=lB({},i,n(i))),t){var a=W0(i.areArraysEqual),o=W0(i.areMapsEqual),l=W0(i.areObjectsEqual),c=W0(i.areSetsEqual);i=lB({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return i}function w8e(e){return function(t,n,r,i,a,o,l){return e(t,n,l)}}function j8e(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,a=e.strict;if(r)return function(c,u){var d=r(),h=d.cache,f=h===void 0?t?new WeakMap:void 0:h,p=d.meta;return n(c,u,{cache:f,equals:i,meta:p,strict:a})};if(t)return function(c,u){return n(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(c,u){return n(c,u,o)}}var _8e=Bu();Bu({strict:!0});Bu({circular:!0});Bu({circular:!0,strict:!0});Bu({createInternalComparator:function(){return Fh}});Bu({strict:!0,createInternalComparator:function(){return Fh}});Bu({circular:!0,createInternalComparator:function(){return Fh}});Bu({circular:!0,createInternalComparator:function(){return Fh},strict:!0});function Bu(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,i=e.createState,a=e.strict,o=a===void 0?!1:a,l=b8e(e),c=x8e(l),u=r?r(c):w8e(c);return j8e({circular:n,comparator:c,createState:i,equals:u,strict:o})}function S8e(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function cB(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(a){n<0&&(n=a),a-n>t?(e(a),n=-1):S8e(i)};requestAnimationFrame(r)}function s2(e){"@babel/helpers - typeof";return s2=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},s2(e)}function k8e(e){return T8e(e)||A8e(e)||C8e(e)||N8e()}
vendor: 60,466 bytes, lines 767-786
767function N8e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
768In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C8e(e,t){if(e){if(typeof e=="string")return uB(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uB(e,t)}}function uB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function A8e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function T8e(e){if(Array.isArray(e))return e}function E8e(){var e={},t=function(){return null},n=!1,r=function i(a){if(!n){if(Array.isArray(a)){if(!a.length)return;var o=a,l=k8e(o),c=l[0],u=l.slice(1);if(typeof c=="number"){cB(i.bind(null,u),c);return}i(c),cB(i.bind(null,u));return}s2(a)==="object"&&(e=a,t(e)),typeof a=="function"&&a()}};return{stop:function(){n=!0},start:function(a){n=!1,r(a)},subscribe:function(a){return t=a,function(){t=function(){return null}}}}}function _x(e){"@babel/helpers - typeof";return _x=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},_x(e)}function dB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dB(Object(n),!0).forEach(function(r){ZJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZJ(e,t,n){return t=P8e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P8e(e){var t=O8e(e,"string");return _x(t)==="symbol"?t:String(t)}function O8e(e,t){if(_x(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(_x(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var I8e=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,i){return r.filter(function(a){return i.includes(a)})})},R8e=function(t){return t},D8e=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Zy=function(t,n){return Object.keys(n).reduce(function(r,i){return hB(hB({},r),{},ZJ({},i,t(i,n[i])))},{})},fB=function(t,n,r){return t.map(function(i){return"".concat(D8e(i)," ").concat(n,"ms ").concat(r)}).join(",")};function M8e(e,t){return F8e(e)||L8e(e,t)||JJ(e,t)||$8e()}function $8e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
769In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L8e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function F8e(e){if(Array.isArray(e))return e}function z8e(e){return W8e(e)||V8e(e)||JJ(e)||B8e()}function B8e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
770In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JJ(e,t){if(e){if(typeof e=="string")return a2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a2(e,t)}}function V8e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function W8e(e){if(Array.isArray(e))return a2(e)}function a2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var x1=1e-4,eee=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},tee=function(t,n){return t.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},pB=function(t,n){return function(r){var i=eee(t,n);return tee(i,r)}},U8e=function(t,n){return function(r){var i=eee(t,n),a=[].concat(z8e(i.map(function(o,l){return o*l}).slice(1)),[0]);return tee(a,r)}},mB=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0],a=n[1],o=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":i=0,a=0,o=1,l=1;break;case"ease":i=.25,a=.1,o=.25,l=1;break;case"ease-in":i=.42,a=0,o=1,l=1;break;case"ease-out":i=.42,a=0,o=.58,l=1;break;case"ease-in-out":i=0,a=0,o=.58,l=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(y){return parseFloat(y)}),d=M8e(u,4);i=d[0],a=d[1],o=d[2],l=d[3]}}}var h=pB(i,o),f=pB(a,l),p=U8e(i,o),m=function(b){return b>1?1:b<0?0:b},g=function(b){for(var v=b>1?1:b,w=v,_=0;_<8;++_){var j=h(w)-v,S=p(w);if(Math.abs(j-v)<x1||S<x1)return f(w);w=m(w-j/S)}return f(w)};return g.isStepper=!1,g},q8e=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,a=i===void 0?8:i,o=t.dt,l=o===void 0?17:o,c=function(d,h,f){var p=-(d-h)*r,m=f*a,g=f+(p-m)*l/1e3,y=f*l/1e3+d;return Math.abs(y-h)<x1&&Math.abs(g)<x1?[h,0]:[y,g]};return c.isStepper=!0,c.dt=l,c},H8e=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return mB(i);case"spring":return q8e();default:if(i.split("(")[0]==="cubic-bezier")return mB(i)}return typeof i=="function"?i:null};function Sx(e){"@babel/helpers - typeof";return Sx=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},Sx(e)}function gB(e){return Y8e(e)||G8e(e)||nee(e)||K8e()}function K8e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
771In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G8e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Y8e(e){if(Array.isArray(e))return l2(e)}function yB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yB(Object(n),!0).forEach(function(r){o2(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function o2(e,t,n){return t=Q8e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Q8e(e){var t=X8e(e,"string");return Sx(t)==="symbol"?t:String(t)}function X8e(e,t){if(Sx(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Sx(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Z8e(e,t){return tVe(e)||eVe(e,t)||nee(e,t)||J8e()}function J8e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
772In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nee(e,t){if(e){if(typeof e=="string")return l2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l2(e,t)}}function l2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eVe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function tVe(e){if(Array.isArray(e))return e}var b1=function(t,n,r){return t+(n-t)*r},c2=function(t){var n=t.from,r=t.to;return n!==r},nVe=function e(t,n,r){var i=Zy(function(a,o){if(c2(o)){var l=t(o.from,o.to,o.velocity),c=Z8e(l,2),u=c[0],d=c[1];return Jr(Jr({},o),{},{from:u,velocity:d})}return o},n);return r<1?Zy(function(a,o){return c2(o)?Jr(Jr({},o),{},{velocity:b1(o.velocity,i[a].velocity,r),from:b1(o.from,i[a].from,r)}):o},n):e(t,i,r-1)};const rVe=function(e,t,n,r,i){var a=I8e(e,t),o=a.reduce(function(y,b){return Jr(Jr({},y),{},o2({},b,[e[b],t[b]]))},{}),l=a.reduce(function(y,b){return Jr(Jr({},y),{},o2({},b,{from:e[b],velocity:0,to:t[b]}))},{}),c=-1,u,d,h=function(){return null},f=function(){return Zy(function(b,v){return v.from},l)},p=function(){return!Object.values(l).filter(c2).length},m=function(b){u||(u=b);var v=b-u,w=v/n.dt;l=nVe(n,l,w),i(Jr(Jr(Jr({},e),t),f())),u=b,p()||(c=requestAnimationFrame(h))},g=function(b){d||(d=b);var v=(b-d)/r,w=Zy(function(j,S){return b1.apply(void 0,gB(S).concat([n(v)]))},o);if(i(Jr(Jr(Jr({},e),t),w)),v<1)c=requestAnimationFrame(h);else{var _=Zy(function(j,S){return b1.apply(void 0,gB(S).concat([n(1)]))},o);i(Jr(Jr(Jr({},e),t),_))}};return h=n.isStepper?m:g,function(){return requestAnimationFrame(h),function(){cancelAnimationFrame(c)}}};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)}var iVe=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function sVe(e,t){if(e==null)return{};var n=aVe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function aVe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function $C(e){return uVe(e)||cVe(e)||lVe(e)||oVe()}function oVe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
773In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lVe(e,t){if(e){if(typeof e=="string")return u2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u2(e,t)}}function cVe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uVe(e){if(Array.isArray(e))return u2(e)}function u2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vB(Object(n),!0).forEach(function(r){ky(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ky(e,t,n){return t=ree(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dVe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hVe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ree(r.key),r)}}function fVe(e,t,n){return t&&hVe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ree(e){var t=pVe(e,"string");return om(t)==="symbol"?t:String(t)}function pVe(e,t){if(om(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(om(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mVe(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&&d2(e,t)}function d2(e,t){return d2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},d2(e,t)}function gVe(e){var t=yVe();return function(){var r=w1(e),i;if(t){var a=w1(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return h2(this,i)}}function h2(e,t){if(t&&(om(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f2(e)}function f2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yVe(){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 w1(e){return w1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},w1(e)}var vo=function(e){mVe(n,e);var t=gVe(n);function n(r,i){var a;dVe(this,n),a=t.call(this,r,i);var o=a.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,h=o.steps,f=o.children,p=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(f2(a)),a.changeStyle=a.changeStyle.bind(f2(a)),!l||p<=0)return a.state={style:{}},typeof f=="function"&&(a.state={style:d}),h2(a);if(h&&h.length)a.state={style:h[0].style};else if(u){if(typeof f=="function")return a.state={style:u},h2(a);a.state={style:c?ky({},c,u):u}}else a.state={style:{}};return a}return fVe(n,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,l=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,d=a.to,h=a.from,f=this.state.style;if(l){if(!o){var p={style:c?ky({},c,d):d};this.state&&f&&(c&&f[c]!==d||!c&&f!==d)&&this.setState(p);return}if(!(_8e(i.to,d)&&i.canBegin&&i.isActive)){var m=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=m||u?h:i.to;if(this.state&&f){var y={style:c?ky({},c,g):g};(c&&f[c]!==g||!c&&f!==g)&&this.setState(y)}this.runAnimation(Fa(Fa({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,l=i.to,c=i.duration,u=i.easing,d=i.begin,h=i.onAnimationEnd,f=i.onAnimationStart,p=rVe(o,l,H8e(u),c,this.changeStyle),m=function(){a.stopJSAnimation=p()};this.manager.start([f,d,m,c,h])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,l=i.begin,c=i.onAnimationStart,u=o[0],d=u.style,h=u.duration,f=h===void 0?0:h,p=function(g,y,b){if(b===0)return g;var v=y.duration,w=y.easing,_=w===void 0?"ease":w,j=y.style,S=y.properties,k=y.onAnimationEnd,N=b>0?o[b-1]:y,T=S||Object.keys(j);if(typeof _=="function"||_==="spring")return[].concat($C(g),[a.runJSAnimation.bind(a,{from:N.style,to:j,duration:v,easing:_}),v]);var C=fB(T,v,_),A=Fa(Fa(Fa({},N.style),j),{},{transition:C});return[].concat($C(g),[A,v,k]).filter(R8e)};return this.manager.start([c].concat($C(o.reduce(p,[d,Math.max(f,l)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=E8e());var a=i.begin,o=i.duration,l=i.attributeName,c=i.to,u=i.easing,d=i.onAnimationStart,h=i.onAnimationEnd,f=i.steps,p=i.children,m=this.manager;if(this.unSubscribe=m.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(i);return}if(f.length>1){this.runStepAnimation(i);return}var g=l?ky({},l,c):c,y=fB(Object.keys(g),o,u);m.start([d,a,Fa(Fa({},g),{},{transition:y}),o,h])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var l=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=sVe(i,iVe),u=x.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!l||u===0||o<=0)return a;var h=function(p){var m=p.props,g=m.style,y=g===void 0?{}:g,b=m.className,v=x.cloneElement(p,Fa(Fa({},c),{},{style:Fa(Fa({},y),d),className:b}));return v};return u===1?h(x.Children.only(a)):L.createElement("div",null,x.Children.map(a,function(f){return h(f)}))}}]),n}(x.PureComponent);vo.displayName="Animate";vo.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};vo.propTypes={from:Gt.oneOfType([Gt.object,Gt.string]),to:Gt.oneOfType([Gt.object,Gt.string]),attributeName:Gt.string,duration:Gt.number,begin:Gt.number,easing:Gt.oneOfType([Gt.string,Gt.func]),steps:Gt.arrayOf(Gt.shape({duration:Gt.number.isRequired,style:Gt.object.isRequired,easing:Gt.oneOfType([Gt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Gt.func]),properties:Gt.arrayOf("string"),onAnimationEnd:Gt.func})),children:Gt.oneOfType([Gt.node,Gt.func]),isActive:Gt.bool,canBegin:Gt.bool,onAnimationEnd:Gt.func,shouldReAnimate:Gt.bool,onAnimationStart:Gt.func,onAnimationReStart:Gt.func};function kx(e){"@babel/helpers - typeof";return kx=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},kx(e)}function j1(){return j1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j1.apply(this,arguments)}function vVe(e,t){return jVe(e)||wVe(e,t)||bVe(e,t)||xVe()}function xVe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
774In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bVe(e,t){if(e){if(typeof e=="string")return xB(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xB(e,t)}}function xB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wVe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function jVe(e){if(Array.isArray(e))return e}function bB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bB(Object(n),!0).forEach(function(r){_Ve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Ve(e,t,n){return t=SVe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SVe(e){var t=kVe(e,"string");return kx(t)=="symbol"?t:t+""}function kVe(e,t){if(kx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(kx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jB=function(t,n,r,i,a){var o=Math.min(Math.abs(r)/2,Math.abs(i)/2),l=i>=0?1:-1,c=r>=0?1:-1,u=i>=0&&r>=0||i<0&&r<0?1:0,d;if(o>0&&a instanceof Array){for(var h=[0,0,0,0],f=0,p=4;f<p;f++)h[f]=a[f]>o?o:a[f];d="M".concat(t,",").concat(n+l*h[0]),h[0]>0&&(d+="A ".concat(h[0],",").concat(h[0],",0,0,").concat(u,",").concat(t+c*h[0],",").concat(n)),d+="L ".concat(t+r-c*h[1],",").concat(n),h[1]>0&&(d+="A ".concat(h[1],",").concat(h[1],",0,0,").concat(u,`,
775        `).concat(t+r,",").concat(n+l*h[1])),d+="L ".concat(t+r,",").concat(n+i-l*h[2]),h[2]>0&&(d+="A ".concat(h[2],",").concat(h[2],",0,0,").concat(u,`,
776        `).concat(t+r-c*h[2],",").concat(n+i)),d+="L ".concat(t+c*h[3],",").concat(n+i),h[3]>0&&(d+="A ".concat(h[3],",").concat(h[3],",0,0,").concat(u,`,
777        `).concat(t,",").concat(n+i-l*h[3])),d+="Z"}else if(o>0&&a===+a&&a>0){var m=Math.min(o,a);d="M ".concat(t,",").concat(n+l*m,`
778            A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+c*m,",").concat(n,`
779            L `).concat(t+r-c*m,",").concat(n,`
780            A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+r,",").concat(n+l*m,`
781            L `).concat(t+r,",").concat(n+i-l*m,`
782            A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+r-c*m,",").concat(n+i,`
783            L `).concat(t+c*m,",").concat(n+i,`
784            A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t,",").concat(n+i-l*m," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return d},NVe=function(t,n){if(!t||!n)return!1;var r=t.x,i=t.y,a=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(a,a+l),d=Math.max(a,a+l),h=Math.min(o,o+c),f=Math.max(o,o+c);return r>=u&&r<=d&&i>=h&&i<=f}return!1},CVe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},BD=function(t){var n=wB(wB({},CVe),t),r=x.useRef(),i=x.useState(-1),a=vVe(i,2),o=a[0],l=a[1];x.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var _=r.current.getTotalLength();_&&l(_)}catch{}},[]);var c=n.x,u=n.y,d=n.width,h=n.height,f=n.radius,p=n.className,m=n.animationEasing,g=n.animationDuration,y=n.animationBegin,b=n.isAnimationActive,v=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||h!==+h||d===0||h===0)return null;var w=mt("recharts-rectangle",p);return v?L.createElement(vo,{canBegin:o>0,from:{width:d,height:h,x:c,y:u},to:{width:d,height:h,x:c,y:u},duration:g,animationEasing:m,isActive:v},function(_){var j=_.width,S=_.height,k=_.x,N=_.y;return L.createElement(vo,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:g,isActive:b,easing:m},L.createElement("path",j1({},He(n,!0),{className:w,d:jB(k,N,j,S,f),ref:r})))}):L.createElement("path",j1({},He(n,!0),{className:w,d:jB(c,u,d,h,f)}))},AVe=["points","className","baseLinePoints","connectNulls"];function Yf(){return Yf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yf.apply(this,arguments)}function TVe(e,t){if(e==null)return{};var n=EVe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function EVe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function _B(e){return RVe(e)||IVe(e)||OVe(e)||PVe()}function PVe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
785In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OVe(e,t){if(e){if(typeof e=="string")return p2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p2(e,t)}}function IVe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function RVe(e){if(Array.isArray(e))return p2(e)}function p2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var SB=function(t){return t&&t.x===+t.x&&t.y===+t.y},DVe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){SB(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),SB(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},Jy=function(t,n){var r=DVe(t);n&&(r=[r.reduce(function(a,o){return[].concat(_B(a),_B(o))},[])]);var i=r.map(function(a){return a.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},MVe=function(t,n,r){var i=Jy(t,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Jy(n.reverse(),r).slice(1))},$Ve=function(t){var n=t.points,r=t.className,i=t.baseLinePoints,a=t.connectNulls,o=TVe(t,AVe);if(!n||!n.length)return null;var l=mt("recharts-polygon",r);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",u=MVe(n,i,a);return L.createElement("g",{className:l},L.createElement("path",Yf({},He(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),c?L.createElement("path",Yf({},He(o,!0),{fill:"none",d:Jy(n,a)})):null,c?L.createElement("path",Yf({},He(o,!0),{fill:"none",d:Jy(i,a)})):null)}var d=Jy(n,a);return L.createElement("path",Yf({},He(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",className:l,d}))};function m2(){return m2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m2.apply(this,arguments)}var Nb=function(t){var n=t.cx,r=t.cy,i=t.r,a=t.className,o=mt("recharts-dot",a);return n===+n&&r===+r&&i===+i?x.createElement("circle",m2({},He(t,!1),Vj(t),{className:o,cx:n,cy:r,r:i})):null};function Nx(e){"@babel/helpers - typeof";return Nx=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},Nx(e)}var LVe=["x","y","top","left","width","height","className"];function g2(){return g2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g2.apply(this,arguments)}function kB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function FVe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kB(Object(n),!0).forEach(function(r){zVe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zVe(e,t,n){return t=BVe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BVe(e){var t=VVe(e,"string");return Nx(t)=="symbol"?t:t+""}function VVe(e,t){if(Nx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Nx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function WVe(e,t){if(e==null)return{};var n=UVe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function UVe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var qVe=function(t,n,r,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(n,"h").concat(r)},HVe=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,a=i===void 0?0:i,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,h=d===void 0?0:d,f=t.height,p=f===void 0?0:f,m=t.className,g=WVe(t,LVe),y=FVe({x:r,y:a,top:l,left:u,width:h,height:p},g);return!ge(r)||!ge(a)||!ge(h)||!ge(p)||!ge(l)||!ge(u)?null:L.createElement("path",g2({},He(y,!0),{className:mt("recharts-cross",m),d:qVe(r,a,h,p,l,u)}))},KVe=KS,GVe=mJ,YVe=ol;function QVe(e,t){return e&&e.length?KVe(e,YVe(t),GVe):void 0}var XVe=QVe;const ZVe=Ot(XVe);var JVe=KS,eWe=ol,tWe=gJ;function nWe(e,t){return e&&e.length?JVe(e,eWe(t),tWe):void 0}var rWe=nWe;const iWe=Ot(rWe);var sWe=["cx","cy","angle","ticks","axisLine"],aWe=["ticks","tick","angle","tickFormatter","stroke"];function lm(e){"@babel/helpers - typeof";return lm=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},lm(e)}function ev(){return ev=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ev.apply(this,arguments)}function NB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NB(Object(n),!0).forEach(function(r){XS(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CB(e,t){if(e==null)return{};var n=oWe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function oWe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function lWe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AB(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,see(r.key),r)}}function cWe(e,t,n){return t&&AB(e.prototype,t),n&&AB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function uWe(e,t,n){return t=_1(t),dWe(e,iee()?Reflect.construct(t,n||[],_1(e).constructor):t.apply(e,n))}function dWe(e,t){if(t&&(lm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hWe(e)}function hWe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iee=function(){return!!e})()}function _1(e){return _1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_1(e)}function fWe(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&&y2(e,t)}function y2(e,t){return y2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},y2(e,t)}function XS(e,t,n){return t=see(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function see(e){var t=pWe(e,"string");return lm(t)=="symbol"?t:t+""}function pWe(e,t){if(lm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(lm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ZS=function(e){function t(){return lWe(this,t),uWe(this,t,arguments)}return fWe(t,e),cWe(t,[{key:"getTickValueCoord",value:function(r){var i=r.coordinate,a=this.props,o=a.angle,l=a.cx,c=a.cy;return mn(l,c,i,o)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,i;switch(r){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.angle,l=r.ticks,c=ZVe(l,function(d){return d.coordinate||0}),u=iWe(l,function(d){return d.coordinate||0});return{cx:i,cy:a,startAngle:o,endAngle:o,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.angle,l=r.ticks,c=r.axisLine,u=CB(r,sWe),d=l.reduce(function(m,g){return[Math.min(m[0],g.coordinate),Math.max(m[1],g.coordinate)]},[1/0,-1/0]),h=mn(i,a,d[0],o),f=mn(i,a,d[1],o),p=Zu(Zu(Zu({},He(u,!1)),{},{fill:"none"},He(c,!1)),{},{x1:h.x,y1:h.y,x2:f.x,y2:f.y});return L.createElement("line",ev({className:"recharts-polar-radius-axis-line"},p))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,o=i.tick,l=i.angle,c=i.tickFormatter,u=i.stroke,d=CB(i,aWe),h=this.getTickTextAnchor(),f=He(d,!1),p=He(o,!1),m=a.map(function(g,y){var b=r.getTickValueCoord(g),v=Zu(Zu(Zu(Zu({textAnchor:h,transform:"rotate(".concat(90-l,", ").concat(b.x,", ").concat(b.y,")")},f),{},{stroke:"none",fill:u},p),{},{index:y},b),{},{payload:g});return L.createElement(Ct,ev({className:mt("recharts-polar-radius-axis-tick",UJ(o)),key:"tick-".concat(g.coordinate)},yh(r.props,g,y)),t.renderTickItem(o,v,c?c(g.value,y):g.value))});return L.createElement(Ct,{className:"recharts-polar-radius-axis-ticks"},m)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.axisLine,o=r.tick;return!i||!i.length?null:L.createElement(Ct,{className:mt("recharts-polar-radius-axis",this.props.className)},a&&this.renderAxisLine(),o&&this.renderTicks(),Hr.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,i,a){var o;return L.isValidElement(r)?o=L.cloneElement(r,i):tt(r)?o=r(i):o=L.createElement(vh,ev({},i,{className:"recharts-polar-radius-axis-tick-value"}),a),o}}])}(x.PureComponent);XS(ZS,"displayName","PolarRadiusAxis");XS(ZS,"axisType","radiusAxis");XS(ZS,"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 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)}function md(){return md=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},md.apply(this,arguments)}function TB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ju(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TB(Object(n),!0).forEach(function(r){JS(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mWe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EB(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,oee(r.key),r)}}function gWe(e,t,n){return t&&EB(e.prototype,t),n&&EB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yWe(e,t,n){return t=S1(t),vWe(e,aee()?Reflect.construct(t,n||[],S1(e).constructor):t.apply(e,n))}function vWe(e,t){if(t&&(cm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xWe(e)}function xWe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aee=function(){return!!e})()}function S1(e){return S1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},S1(e)}function bWe(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&&v2(e,t)}function v2(e,t){return v2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},v2(e,t)}function JS(e,t,n){return t=oee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oee(e){var t=wWe(e,"string");return cm(t)=="symbol"?t:t+""}function wWe(e,t){if(cm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(cm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jWe=Math.PI/180,PB=1e-5,ek=function(e){function t(){return mWe(this,t),yWe(this,t,arguments)}return bWe(t,e),gWe(t,[{key:"getTickLineCoord",value:function(r){var i=this.props,a=i.cx,o=i.cy,l=i.radius,c=i.orientation,u=i.tickSize,d=u||8,h=mn(a,o,l,r.coordinate),f=mn(a,o,l+(c==="inner"?-1:1)*d,r.coordinate);return{x1:h.x,y1:h.y,x2:f.x,y2:f.y}}},{key:"getTickTextAnchor",value:function(r){var i=this.props.orientation,a=Math.cos(-r.coordinate*jWe),o;return a>PB?o=i==="outer"?"start":"end":a<-PB?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.radius,l=r.axisLine,c=r.axisLineType,u=Ju(Ju({},He(this.props,!1)),{},{fill:"none"},He(l,!1));if(c==="circle")return L.createElement(Nb,md({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:a,r:o}));var d=this.props.ticks,h=d.map(function(f){return mn(i,a,o,f.coordinate)});return L.createElement($Ve,md({className:"recharts-polar-angle-axis-line"},u,{points:h}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,o=i.tick,l=i.tickLine,c=i.tickFormatter,u=i.stroke,d=He(this.props,!1),h=He(o,!1),f=Ju(Ju({},d),{},{fill:"none"},He(l,!1)),p=a.map(function(m,g){var y=r.getTickLineCoord(m),b=r.getTickTextAnchor(m),v=Ju(Ju(Ju({textAnchor:b},d),{},{stroke:"none",fill:u},h),{},{index:g,payload:m,x:y.x2,y:y.y2});return L.createElement(Ct,md({className:mt("recharts-polar-angle-axis-tick",UJ(o)),key:"tick-".concat(m.coordinate)},yh(r.props,m,g)),l&&L.createElement("line",md({className:"recharts-polar-angle-axis-tick-line"},f,y)),o&&t.renderTickItem(o,v,c?c(m.value,g):m.value))});return L.createElement(Ct,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.radius,o=r.axisLine;return a<=0||!i||!i.length?null:L.createElement(Ct,{className:mt("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,a){var o;return L.isValidElement(r)?o=L.cloneElement(r,i):tt(r)?o=r(i):o=L.createElement(vh,md({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(x.PureComponent);JS(ek,"displayName","PolarAngleAxis");JS(ek,"axisType","angleAxis");JS(ek,"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 _We=dZ,SWe=_We(Object.getPrototypeOf,Object),kWe=SWe,NWe=ic,CWe=kWe,AWe=sc,TWe="[object Object]",EWe=Function.prototype,PWe=Object.prototype,lee=EWe.toString,OWe=PWe.hasOwnProperty,IWe=lee.call(Object);function RWe(e){if(!AWe(e)||NWe(e)!=TWe)return!1;var t=CWe(e);if(t===null)return!0;var n=OWe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&lee.call(n)==IWe}var DWe=RWe;const MWe=Ot(DWe);var $We=ic,LWe=sc,FWe="[object Boolean]";function zWe(e){return e===!0||e===!1||LWe(e)&&$We(e)==FWe}var BWe=zWe;const VWe=Ot(BWe);function Cx(e){"@babel/helpers - typeof";return Cx=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},Cx(e)}function k1(){return k1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k1.apply(this,arguments)}function WWe(e,t){return KWe(e)||HWe(e,t)||qWe(e,t)||UWe()}function UWe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
786In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qWe(e,t){if(e){if(typeof e=="string")return OB(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OB(e,t)}}function OB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function HWe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function KWe(e){if(Array.isArray(e))return e}function IB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function RB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IB(Object(n),!0).forEach(function(r){GWe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GWe(e,t,n){return t=YWe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YWe(e){var t=QWe(e,"string");return Cx(t)=="symbol"?t:t+""}function QWe(e,t){if(Cx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Cx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var DB=function(t,n,r,i,a){var o=r-i,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-o/2,",").concat(n+a),l+="L ".concat(t+r-o/2-i,",").concat(n+a),l+="L ".concat(t,",").concat(n," Z"),l},XWe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},ZWe=function(t){var n=RB(RB({},XWe),t),r=x.useRef(),i=x.useState(-1),a=WWe(i,2),o=a[0],l=a[1];x.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var w=r.current.getTotalLength();w&&l(w)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,h=n.lowerWidth,f=n.height,p=n.className,m=n.animationEasing,g=n.animationDuration,y=n.animationBegin,b=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||h!==+h||f!==+f||d===0&&h===0||f===0)return null;var v=mt("recharts-trapezoid",p);return b?L.createElement(vo,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:f,x:c,y:u},to:{upperWidth:d,lowerWidth:h,height:f,x:c,y:u},duration:g,animationEasing:m,isActive:b},function(w){var _=w.upperWidth,j=w.lowerWidth,S=w.height,k=w.x,N=w.y;return L.createElement(vo,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:g,easing:m},L.createElement("path",k1({},He(n,!0),{className:v,d:DB(k,N,_,j,S),ref:r})))}):L.createElement("g",null,L.createElement("path",k1({},He(n,!0),{className:v,d:DB(c,u,d,h,f)})))},JWe=["option","shapeType","propTransformer","activeClassName","isActive"];function Ax(e){"@babel/helpers - typeof";return Ax=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},Ax(e)}function eUe(e,t){if(e==null)return{};var n=tUe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tUe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function MB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function N1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MB(Object(n),!0).forEach(function(r){nUe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nUe(e,t,n){return t=rUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rUe(e){var t=iUe(e,"string");return Ax(t)=="symbol"?t:t+""}function iUe(e,t){if(Ax(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ax(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sUe(e,t){return N1(N1({},t),e)}function aUe(e,t){return e==="symbols"}function $B(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return L.createElement(BD,n);case"trapezoid":return L.createElement(ZWe,n);case"sector":return L.createElement(KJ,n);case"symbols":if(aUe(t))return L.createElement(aD,n);break;default:return null}}function oUe(e){return x.isValidElement(e)?e.props:e}function cee(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?sUe:r,a=e.activeClassName,o=a===void 0?"recharts-active-shape":a,l=e.isActive,c=eUe(e,JWe),u;if(x.isValidElement(t))u=x.cloneElement(t,N1(N1({},c),oUe(t)));else if(tt(t))u=t(c);else if(MWe(t)&&!VWe(t)){var d=i(t,c);u=L.createElement($B,{shapeType:n,elementProps:d})}else{var h=c;u=L.createElement($B,{shapeType:n,elementProps:h})}return l?L.createElement(Ct,{className:o},u):u}function tk(e,t){return t!=null&&"trapezoids"in e.props}function nk(e,t){return t!=null&&"sectors"in e.props}function Tx(e,t){return t!=null&&"points"in e.props}function lUe(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,a=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return i&&a}function cUe(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function uUe(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function dUe(e,t){var n;return tk(e,t)?n=lUe:nk(e,t)?n=cUe:Tx(e,t)&&(n=uUe),n}function hUe(e,t){var n;return tk(e,t)?n="trapezoids":nk(e,t)?n="sectors":Tx(e,t)&&(n="points"),n}function fUe(e,t){if(tk(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}if(nk(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}return Tx(e,t)?t.payload:{}}function pUe(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=hUe(n,t),a=fUe(n,t),o=r.filter(function(c,u){var d=xh(a,c),h=n.props[i].filter(function(m){var g=dUe(n,t);return g(m,t)}),f=n.props[i].indexOf(h[h.length-1]),p=u===f;return d&&p}),l=r.indexOf(o[o.length-1]);return l}var Mw;function um(e){"@babel/helpers - typeof";return um=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},um(e)}function Qf(){return Qf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qf.apply(this,arguments)}function LB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function un(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LB(Object(n),!0).forEach(function(r){ga(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mUe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FB(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,dee(r.key),r)}}function gUe(e,t,n){return t&&FB(e.prototype,t),n&&FB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yUe(e,t,n){return t=C1(t),vUe(e,uee()?Reflect.construct(t,n||[],C1(e).constructor):t.apply(e,n))}function vUe(e,t){if(t&&(um(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xUe(e)}function xUe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uee=function(){return!!e})()}function C1(e){return C1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},C1(e)}function bUe(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&&x2(e,t)}function x2(e,t){return x2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},x2(e,t)}function ga(e,t,n){return t=dee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dee(e){var t=wUe(e,"string");return um(t)=="symbol"?t:t+""}function wUe(e,t){if(um(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(um(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oc=function(e){function t(n){var r;return mUe(this,t),r=yUe(this,t,[n]),ga(r,"pieRef",null),ga(r,"sectorRefs",[]),ga(r,"id",Mh("recharts-pie-")),ga(r,"handleAnimationEnd",function(){var i=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),tt(i)&&i()}),ga(r,"handleAnimationStart",function(){var i=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),tt(i)&&i()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return bUe(t,e),gUe(t,[{key:"isActiveIndex",value:function(r){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(r)!==-1:r===i}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.label,l=a.labelLine,c=a.dataKey,u=a.valueKey,d=He(this.props,!1),h=He(o,!1),f=He(l,!1),p=o&&o.offsetRadius||20,m=r.map(function(g,y){var b=(g.startAngle+g.endAngle)/2,v=mn(g.cx,g.cy,g.outerRadius+p,b),w=un(un(un(un({},d),g),{},{stroke:"none"},h),{},{index:y,textAnchor:t.getTextAnchor(v.x,g.cx)},v),_=un(un(un(un({},d),g),{},{fill:"none",stroke:g.fill},f),{},{index:y,points:[mn(g.cx,g.cy,g.outerRadius,b),v]}),j=c;return dt(c)&&dt(u)?j="value":dt(c)&&(j=u),L.createElement(Ct,{key:"label-".concat(g.startAngle,"-").concat(g.endAngle,"-").concat(g.midAngle,"-").concat(y)},l&&t.renderLabelLineItem(l,_,"line"),t.renderLabelItem(o,w,er(g,j)))});return L.createElement(Ct,{className:"recharts-pie-labels"},m)}},{key:"renderSectorsStatically",value:function(r){var i=this,a=this.props,o=a.activeShape,l=a.blendStroke,c=a.inactiveShape;return r.map(function(u,d){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&r.length!==1)return null;var h=i.isActiveIndex(d),f=c&&i.hasActiveIndex()?c:null,p=h?o:f,m=un(un({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return L.createElement(Ct,Qf({ref:function(y){y&&!i.sectorRefs.includes(y)&&i.sectorRefs.push(y)},tabIndex:-1,className:"recharts-pie-sector"},yh(i.props,u,d),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(d)}),L.createElement(cee,Qf({option:p,isActive:h,shapeType:"sector"},m)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,i=this.props,a=i.sectors,o=i.isAnimationActive,l=i.animationBegin,c=i.animationDuration,u=i.animationEasing,d=i.animationId,h=this.state,f=h.prevSectors,p=h.prevIsAnimationActive;return L.createElement(vo,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d,"-").concat(p),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(m){var g=m.t,y=[],b=a&&a[0],v=b.startAngle;return a.forEach(function(w,_){var j=f&&f[_],S=_>0?zs(w,"paddingAngle",0):0;if(j){var k=Or(j.endAngle-j.startAngle,w.endAngle-w.startAngle),N=un(un({},w),{},{startAngle:v+S,endAngle:v+k(g)+S});y.push(N),v=N.endAngle}else{var T=w.endAngle,C=w.startAngle,A=Or(0,T-C),O=A(g),z=un(un({},w),{},{startAngle:v+S,endAngle:v+O+S});y.push(z),v=z.endAngle}}),L.createElement(Ct,null,r.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(r){var i=this;r.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[l].focus(),i.setState({sectorToFocus:l});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,i=r.sectors,a=r.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!xh(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,i=this.props,a=i.hide,o=i.sectors,l=i.className,c=i.label,u=i.cx,d=i.cy,h=i.innerRadius,f=i.outerRadius,p=i.isAnimationActive,m=this.state.isAnimationFinished;if(a||!o||!o.length||!ge(u)||!ge(d)||!ge(h)||!ge(f))return null;var g=mt("recharts-pie",l);return L.createElement(Ct,{tabIndex:this.props.rootTabIndex,className:g,ref:function(b){r.pieRef=b}},this.renderSectors(),c&&this.renderLabels(o),Hr.renderCallByParent(this.props,null,!1),(!p||m)&&Yo.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return i.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:r.sectors!==i.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,i){return r>i?"start":r<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,i,a){if(L.isValidElement(r))return L.cloneElement(r,i);if(tt(r))return r(i);var o=mt("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return L.createElement(Gd,Qf({},i,{key:a,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,i,a){if(L.isValidElement(r))return L.cloneElement(r,i);var o=a;if(tt(r)&&(o=r(i),L.isValidElement(o)))return o;var l=mt("recharts-pie-label-text",typeof r!="boolean"&&!tt(r)?r.className:"");return L.createElement(vh,Qf({},i,{alignmentBaseline:"middle",className:l}),o)}}])}(x.PureComponent);Mw=oc;ga(oc,"displayName","Pie");ga(oc,"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:!co.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});ga(oc,"parseDeltaAngle",function(e,t){var n=Mi(t-e),r=Math.min(Math.abs(t-e),360);return n*r});ga(oc,"getRealPieData",function(e){var t=e.data,n=e.children,r=He(e,!1),i=Bs(n,xg);return t&&t.length?t.map(function(a,o){return un(un(un({payload:a},r),a),i&&i[o]&&i[o].props)}):i&&i.length?i.map(function(a){return un(un({},r),a.props)}):[]});ga(oc,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,i=t.width,a=t.height,o=WJ(i,a),l=r+$i(e.cx,i,i/2),c=n+$i(e.cy,a,a/2),u=$i(e.innerRadius,o,0),d=$i(e.outerRadius,o,o*.8),h=e.maxRadius||Math.sqrt(i*i+a*a)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:d,maxRadius:h}});ga(oc,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?un(un({},t.type.defaultProps),t.props):t.props,i=Mw.getRealPieData(r);if(!i||!i.length)return null;var a=r.cornerRadius,o=r.startAngle,l=r.endAngle,c=r.paddingAngle,u=r.dataKey,d=r.nameKey,h=r.valueKey,f=r.tooltipType,p=Math.abs(r.minAngle),m=Mw.parseCoordinateOfPie(r,n),g=Mw.parseDeltaAngle(o,l),y=Math.abs(g),b=u;dt(u)&&dt(h)?(lo(!1,`Use "dataKey" to specify the value of pie,
787      the props "valueKey" will be deprecated in 1.1.0`),b="value"):dt(u)&&(lo(!1,`Use "dataKey" to specify the value of pie,
788      the props "valueKey" will be deprecated in 1.1.0`),b=h);var v=i.filter(function(N){return er(N,b,0)!==0}).length,w=(y>=360?v:v-1)*c,_=y-v*p-w,j=i.reduce(function(N,T){var C=er(T,b,0);return N+(ge(C)?C:0)},0),S;if(j>0){var k;S=i.map(function(N,T){var C=er(N,b,0),A=er(N,d,T),O=(ge(C)?C:0)/j,z;T?z=k.endAngle+Mi(g)*c*(C!==0?1:0):z=o;var $=z+Mi(g)*((C!==0?p:0)+O*_),F=(z+$)/2,B=(m.innerRadius+m.outerRadius)/2,P=[{name:A,value:C,payload:N,dataKey:b,type:f}],I=mn(m.cx,m.cy,B,F);return k=un(un(un({percent:O,cornerRadius:a,name:A,tooltipPayload:P,midAngle:F,middleRadius:B,tooltipPosition:I},N),m),{},{value:er(N,b),startAngle:z,endAngle:$,payload:N,paddingAngle:Mi(g)*c}),k})}return un(un({},m),{},{sectors:S,data:i})});var jUe=Math.ceil,_Ue=Math.max;function SUe(e,t,n,r){for(var i=-1,a=_Ue(jUe((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}var kUe=SUe,NUe=EZ,zB=1/0,CUe=17976931348623157e292;function AUe(e){if(!e)return e===0?e:0;if(e=NUe(e),e===zB||e===-zB){var t=e<0?-1:1;return t*CUe}return e===e?e:0}var hee=AUe,TUe=kUe,EUe=zS,LC=hee;function PUe(e){return function(t,n,r){return r&&typeof r!="number"&&EUe(t,n,r)&&(n=r=void 0),t=LC(t),n===void 0?(n=t,t=0):n=LC(n),r=r===void 0?t<n?1:-1:LC(r),TUe(t,n,r,e)}}var OUe=PUe,IUe=OUe,RUe=IUe(),DUe=RUe;const A1=Ot(DUe);function Ex(e){"@babel/helpers - typeof";return Ex=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},Ex(e)}function BB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function VB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BB(Object(n),!0).forEach(function(r){fee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fee(e,t,n){return t=MUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MUe(e){var t=$Ue(e,"string");return Ex(t)=="symbol"?t:t+""}function $Ue(e,t){if(Ex(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ex(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var LUe=["Webkit","Moz","O","ms"],FUe=function(t,n){var r=t.replace(/(\w)/,function(a){return a.toUpperCase()}),i=LUe.reduce(function(a,o){return VB(VB({},a),{},fee({},o+r,n))},{});return i[t]=n,i};function dm(e){"@babel/helpers - typeof";return dm=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},dm(e)}function T1(){return T1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T1.apply(this,arguments)}function WB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function FC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WB(Object(n),!0).forEach(function(r){Es(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zUe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UB(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mee(r.key),r)}}function BUe(e,t,n){return t&&UB(e.prototype,t),n&&UB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function VUe(e,t,n){return t=E1(t),WUe(e,pee()?Reflect.construct(t,n||[],E1(e).constructor):t.apply(e,n))}function WUe(e,t){if(t&&(dm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return UUe(e)}function UUe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pee=function(){return!!e})()}
vendor: 9,753 bytes, line 788
788function E1(e){return E1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},E1(e)}function qUe(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&&b2(e,t)}function b2(e,t){return b2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},b2(e,t)}function Es(e,t,n){return t=mee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mee(e){var t=HUe(e,"string");return dm(t)=="symbol"?t:t+""}function HUe(e,t){if(dm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(dm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var KUe=function(t){var n=t.data,r=t.startIndex,i=t.endIndex,a=t.x,o=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=Qy().domain(A1(0,c)).range([a,a+o-l]),d=u.domain().map(function(h){return u(h)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(i),scale:u,scaleValues:d}},qB=function(t){return t.changedTouches&&!!t.changedTouches.length},hm=function(e){function t(n){var r;return zUe(this,t),r=VUe(this,t,[n]),Es(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),Es(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),Es(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,a=i.endIndex,o=i.onDragEnd,l=i.startIndex;o==null||o({endIndex:a,startIndex:l})}),r.detachDragEndListener()}),Es(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Es(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Es(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Es(r,"handleSlideDragStart",function(i){var a=qB(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return qUe(t,e),BUe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,a=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,h=Math.min(i,a),f=Math.max(i,a),p=t.getIndexInRange(o,h),m=t.getIndexInRange(o,f);return{startIndex:p-p%c,endIndex:m===d?d:m-m%c}}},{key:"getTextOfTick",value:function(r){var i=this.props,a=i.data,o=i.tickFormatter,l=i.dataKey,c=er(a[r],l,r);return tt(o)?o(c,r):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(r){var i=this.state,a=i.slideMoveStartX,o=i.startX,l=i.endX,c=this.props,u=c.x,d=c.width,h=c.travellerWidth,f=c.startIndex,p=c.endIndex,m=c.onChange,g=r.pageX-a;g>0?g=Math.min(g,u+d-h-l,u+d-h-o):g<0&&(g=Math.max(g,u-o,u-l));var y=this.getIndex({startX:o+g,endX:l+g});(y.startIndex!==f||y.endIndex!==p)&&m&&m(y),this.setState({startX:o+g,endX:l+g,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var a=qB(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,l=i.endX,c=i.startX,u=this.state[o],d=this.props,h=d.x,f=d.width,p=d.travellerWidth,m=d.onChange,g=d.gap,y=d.data,b={startX:this.state.startX,endX:this.state.endX},v=r.pageX-a;v>0?v=Math.min(v,h+f-p-u):v<0&&(v=Math.max(v,h-u)),b[o]=u+v;var w=this.getIndex(b),_=w.startIndex,j=w.endIndex,S=function(){var N=y.length-1;return o==="startX"&&(l>c?_%g===0:j%g===0)||l<c&&j===N||o==="endX"&&(l>c?j%g===0:_%g===0)||l>c&&j===N};this.setState(Es(Es({},o,u+v),"brushMoveStartX",r.pageX),function(){m&&S()&&m(w)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var a=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[i],h=l.indexOf(d);if(h!==-1){var f=h+r;if(!(f===-1||f>=l.length)){var p=l[f];i==="startX"&&p>=u||i==="endX"&&p<=c||this.setState(Es({},i,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,l=r.height,c=r.fill,u=r.stroke;return L.createElement("rect",{stroke:u,fill:c,x:i,y:a,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,h=x.Children.only(u);return h?L.cloneElement(h,{x:i,y:a,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,i){var a,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,h=c.height,f=c.traveller,p=c.ariaLabel,m=c.data,g=c.startIndex,y=c.endIndex,b=Math.max(r,this.props.x),v=FC(FC({},He(this.props,!1)),{},{x:b,y:u,width:d,height:h}),w=p||"Min value: ".concat((a=m[g])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=m[y])===null||o===void 0?void 0:o.name);return L.createElement(Ct,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(j){["ArrowLeft","ArrowRight"].includes(j.key)&&(j.preventDefault(),j.stopPropagation(),l.handleTravellerMoveKeyboard(j.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(f,v))}},{key:"renderSlide",value:function(r,i){var a=this.props,o=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,d=Math.min(r,i)+u,h=Math.max(Math.abs(i-r)-u,0);return L.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:d,y:o,width:h,height:l})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,a=r.endIndex,o=r.y,l=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,h=d.startX,f=d.endX,p=5,m={pointerEvents:"none",fill:u};return L.createElement(Ct,{className:"recharts-brush-texts"},L.createElement(vh,T1({textAnchor:"end",verticalAnchor:"middle",x:Math.min(h,f)-p,y:o+l/2},m),this.getTextOfTick(i)),L.createElement(vh,T1({textAnchor:"start",verticalAnchor:"middle",x:Math.max(h,f)+c+p,y:o+l/2},m),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,i=r.data,a=r.className,o=r.children,l=r.x,c=r.y,u=r.width,d=r.height,h=r.alwaysShowText,f=this.state,p=f.startX,m=f.endX,g=f.isTextActive,y=f.isSlideMoving,b=f.isTravellerMoving,v=f.isTravellerFocused;if(!i||!i.length||!ge(l)||!ge(c)||!ge(u)||!ge(d)||u<=0||d<=0)return null;var w=mt("recharts-brush",a),_=L.Children.count(o)===1,j=FUe("userSelect","none");return L.createElement(Ct,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:j},this.renderBackground(),_&&this.renderPanorama(),this.renderSlide(p,m),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(m,"endX"),(g||y||b||v||h)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,a=r.y,o=r.width,l=r.height,c=r.stroke,u=Math.floor(a+l/2)-1;return L.createElement(L.Fragment,null,L.createElement("rect",{x:i,y:a,width:o,height:l,fill:c,stroke:"none"}),L.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),L.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var a;return L.isValidElement(r)?a=L.cloneElement(r,i):tt(r)?a=r(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(r,i){var a=r.data,o=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,h=r.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return FC({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},a&&a.length?KUe({data:a,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:h}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+o-c]);var f=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:f}}return null}},{key:"getIndexInRange",value:function(r,i){for(var a=r.length,o=0,l=a-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>i?l=c:o=c}return i>=r[l]?l:o}}])}
788(x.PureComponent);Es(hm,"displayName","Brush");Es(hm,"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 GUe=fD;function YUe(e,t){var n;return GUe(e,function(r,i,a){return n=t(r,i,a),!n}),!!n}var QUe=YUe,XUe=rZ,ZUe=ol,JUe=QUe,eqe=ms,tqe=zS;function nqe(e,t,n){var r=eqe(e)?XUe:JUe;return n&&tqe(e,t,n)&&(t=void 0),r(e,ZUe(t))}var rqe=nqe;const iqe=Ot(rqe);var Qo=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},HB=kZ;function sqe(e,t,n){t=="__proto__"&&HB?HB(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var aqe=sqe,oqe=aqe,lqe=_Z,cqe=ol;function uqe(e,t){var n={};return t=cqe(t),lqe(e,function(r,i,a){oqe(n,i,t(r,i,a))}),n}var dqe=uqe;const hqe=Ot(dqe);function fqe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var pqe=fqe,mqe=fD;function gqe(e,t){var n=!0;return mqe(e,function(r,i,a){return n=!!t(r,i,a),n}),n}var yqe=gqe,vqe=pqe,xqe=yqe,bqe=ol,wqe=ms,jqe=zS;function _qe(e,t,n){var r=wqe(e)?vqe:xqe;return n&&jqe(e,t,n)&&(t=void 0),r(e,bqe(t))}var Sqe=_qe;const gee=Ot(Sqe);var kqe=["x","y"];function Px(e){"@babel/helpers - typeof";return Px=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},Px(e)}function w2(){return w2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w2.apply(this,arguments)}function KB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ey(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KB(Object(n),!0).forEach(function(r){Nqe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nqe(e,t,n){return t=Cqe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cqe(e){var t=Aqe(e,"string");return Px(t)=="symbol"?t:t+""}function Aqe(e,t){if(Px(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Px(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tqe(e,t){if(e==null)return{};var n=Eqe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Eqe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Pqe(e,t){var n=e.x,r=e.y,i=Tqe(e,kqe),a="".concat(n),o=parseInt(a,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||i.height),d=parseInt(u,10),h="".concat(t.width||i.width),f=parseInt(h,10);return ey(ey(ey(ey(ey({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:f,name:t.name,radius:t.radius})}function GB(e){return L.createElement(cee,w2({shapeType:"rectangle",propTransformer:Pqe,activeClassName:"recharts-active-bar"},e))}var Oqe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var a=ge(r)||iEe(r);return a?t(r,i):(a||wh(),n)}},Iqe=["value","background"],yee;function fm(e){"@babel/helpers - typeof";return fm=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},fm(e)}function Rqe(e,t){if(e==null)return{};var n=Dqe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Dqe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function P1(){return P1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P1.apply(this,arguments)}function YB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ur(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
vendor: 118,968 bytes, lines 788-793
788t%2?YB(Object(n),!0).forEach(function(r){Zc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mqe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QB(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,xee(r.key),r)}}function $qe(e,t,n){return t&&QB(e.prototype,t),n&&QB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lqe(e,t,n){return t=O1(t),Fqe(e,vee()?Reflect.construct(t,n||[],O1(e).constructor):t.apply(e,n))}function Fqe(e,t){if(t&&(fm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zqe(e)}function zqe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vee=function(){return!!e})()}function O1(e){return O1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},O1(e)}function Bqe(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&&j2(e,t)}function j2(e,t){return j2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},j2(e,t)}function Zc(e,t,n){return t=xee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xee(e){var t=Vqe(e,"string");return fm(t)=="symbol"?t:t+""}function Vqe(e,t){if(fm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(fm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vu=function(e){function t(){var n;Mqe(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=Lqe(this,t,[].concat(i)),Zc(n,"state",{isAnimationFinished:!1}),Zc(n,"id",Mh("recharts-bar-")),Zc(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Zc(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return Bqe(t,e),$qe(t,[{key:"renderRectanglesStatically",value:function(r){var i=this,a=this.props,o=a.shape,l=a.dataKey,c=a.activeIndex,u=a.activeBar,d=He(this.props,!1);return r&&r.map(function(h,f){var p=f===c,m=p?u:o,g=ur(ur(ur({},d),h),{},{isActive:p,option:m,index:f,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return L.createElement(Ct,P1({className:"recharts-bar-rectangle"},yh(i.props,h,f),{key:"rectangle-".concat(h==null?void 0:h.x,"-").concat(h==null?void 0:h.y,"-").concat(h==null?void 0:h.value,"-").concat(f)}),L.createElement(GB,g))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,a=i.data,o=i.layout,l=i.isAnimationActive,c=i.animationBegin,u=i.animationDuration,d=i.animationEasing,h=i.animationId,f=this.state.prevData;return L.createElement(vo,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var m=p.t,g=a.map(function(y,b){var v=f&&f[b];if(v){var w=Or(v.x,y.x),_=Or(v.y,y.y),j=Or(v.width,y.width),S=Or(v.height,y.height);return ur(ur({},y),{},{x:w(m),y:_(m),width:j(m),height:S(m)})}if(o==="horizontal"){var k=Or(0,y.height),N=k(m);return ur(ur({},y),{},{y:y.y+y.height-N,height:N})}var T=Or(0,y.width),C=T(m);return ur(ur({},y),{},{width:C})});return L.createElement(Ct,null,r.renderRectanglesStatically(g))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,a=r.isAnimationActive,o=this.state.prevData;return a&&i&&i.length&&(!o||!xh(o,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,a=i.data,o=i.dataKey,l=i.activeIndex,c=He(this.props.background,!1);return a.map(function(u,d){u.value;var h=u.background,f=Rqe(u,Iqe);if(!h)return null;var p=ur(ur(ur(ur(ur({},f),{},{fill:"#eee"},h),c),yh(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return L.createElement(GB,P1({key:"background-bar-".concat(d),option:r.props.background,isActive:d===l},p))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,h=Bs(d,kb);if(!h)return null;var f=u==="vertical"?o[0].height/2:o[0].width/2,p=function(y,b){var v=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:v,errorVal:er(y,b)}},m={clipPath:r?"url(#clipPath-".concat(i,")"):null};return L.createElement(Ct,m,h.map(function(g){return L.cloneElement(g,{key:"error-bar-".concat(i,"-").concat(g.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:f,dataPointFormatter:p})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,a=r.data,o=r.className,l=r.xAxis,c=r.yAxis,u=r.left,d=r.top,h=r.width,f=r.height,p=r.isAnimationActive,m=r.background,g=r.id;if(i||!a||!a.length)return null;var y=this.state.isAnimationFinished,b=mt("recharts-bar",o),v=l&&l.allowDataOverflow,w=c&&c.allowDataOverflow,_=v||w,j=dt(g)?this.id:g;return L.createElement(Ct,{className:b},v||w?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(j)},L.createElement("rect",{x:v?u:u-h/2,y:w?d:d-f/2,width:v?h:h*2,height:w?f:f*2}))):null,L.createElement(Ct,{className:"recharts-bar-rectangles",clipPath:_?"url(#clipPath-".concat(j,")"):null},m?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(_,j),(!p||y)&&Yo.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])}(x.PureComponent);yee=Vu;Zc(Vu,"displayName","Bar");Zc(Vu,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!co.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Zc(Vu,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,a=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,h=e.displayedData,f=e.offset,p=j6e(r,n);if(!p)return null;var m=t.layout,g=n.type.defaultProps,y=g!==void 0?ur(ur({},g),n.props):n.props,b=y.dataKey,v=y.children,w=y.minPointSize,_=m==="horizontal"?o:a,j=u?_.scale.domain():null,S=T6e({numericAxis:_}),k=Bs(v,xg),N=h.map(function(T,C){var A,O,z,$,F,B;u?A=_6e(u[d+C],j):(A=er(T,b),Array.isArray(A)||(A=[S,A]));var P=Oqe(w,yee.defaultProps.minPointSize)(A[1],C);if(m==="horizontal"){var I,M=[o.scale(A[0]),o.scale(A[1])],R=M[0],K=M[1];O=F6({axis:a,ticks:l,bandSize:i,offset:p.offset,entry:T,index:C}),z=(I=K??R)!==null&&I!==void 0?I:void 0,$=p.size;var D=R-K;if(F=Number.isNaN(D)?0:D,B={x:O,y:o.y,width:$,height:o.height},Math.abs(P)>0&&Math.abs(F)<Math.abs(P)){var E=Mi(F||P)*(Math.abs(P)-Math.abs(F));z-=E,F+=E}}else{var q=[a.scale(A[0]),a.scale(A[1])],X=q[0],re=q[1];if(O=X,z=F6({axis:o,ticks:c,bandSize:i,offset:p.offset,entry:T,index:C}),$=re-X,F=p.size,B={x:a.x,y:z,width:a.width,height:F},Math.abs(P)>0&&Math.abs($)<Math.abs(P)){var Y=Mi($||P)*(Math.abs(P)-Math.abs($));$+=Y}}return ur(ur(ur({},T),{},{x:O,y:z,width:$,height:F,value:u?A:A[1],payload:T,background:B},k&&k[C]&&k[C].props),{},{tooltipPayload:[BJ(n,T)],tooltipPosition:{x:O+$/2,y:z+F/2}})});return ur({data:N,layout:m},f)});function Ox(e){"@babel/helpers - typeof";return Ox=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},Ox(e)}function Wqe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XB(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bee(r.key),r)}}function Uqe(e,t,n){return t&&XB(e.prototype,t),n&&XB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ZB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Xa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZB(Object(n),!0).forEach(function(r){rk(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rk(e,t,n){return t=bee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bee(e){var t=qqe(e,"string");return Ox(t)=="symbol"?t:t+""}function qqe(e,t){if(Ox(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ox(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var VD=function(t,n,r,i,a){var o=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(n),h={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},f=!!Os(u,Vu);return d.reduce(function(p,m){var g=n[m],y=g.orientation,b=g.domain,v=g.padding,w=v===void 0?{}:v,_=g.mirror,j=g.reversed,S="".concat(y).concat(_?"Mirror":""),k,N,T,C,A;if(g.type==="number"&&(g.padding==="gap"||g.padding==="no-gap")){var O=b[1]-b[0],z=1/0,$=g.categoricalDomain.sort(oEe);if($.forEach(function(q,X){X>0&&(z=Math.min((q||0)-($[X-1]||0),z))}),Number.isFinite(z)){var F=z/O,B=g.layout==="vertical"?r.height:r.width;if(g.padding==="gap"&&(k=F*B/2),g.padding==="no-gap"){var P=$i(t.barCategoryGap,F*B),I=F*B/2;k=I-P-(I-P)/B*P}}}i==="xAxis"?N=[r.left+(w.left||0)+(k||0),r.left+r.width-(w.right||0)-(k||0)]:i==="yAxis"?N=c==="horizontal"?[r.top+r.height-(w.bottom||0),r.top+(w.top||0)]:[r.top+(w.top||0)+(k||0),r.top+r.height-(w.bottom||0)-(k||0)]:N=g.range,j&&(N=[N[1],N[0]]);var M=$J(g,a,f),R=M.scale,K=M.realScaleType;R.domain(b).range(N),LJ(R);var D=FJ(R,Xa(Xa({},g),{},{realScaleType:K}));i==="xAxis"?(A=y==="top"&&!_||y==="bottom"&&_,T=r.left,C=h[S]-A*g.height):i==="yAxis"&&(A=y==="left"&&!_||y==="right"&&_,T=h[S]-A*g.width,C=r.top);var E=Xa(Xa(Xa({},g),D),{},{realScaleType:K,x:T,y:C,scale:R,width:i==="xAxis"?r.width:g.width,height:i==="yAxis"?r.height:g.height});return E.bandSize=g1(E,D),!g.hide&&i==="xAxis"?h[S]+=(A?-1:1)*E.height:g.hide||(h[S]+=(A?-1:1)*E.width),Xa(Xa({},p),{},rk({},m,E))},{})},wee=function(t,n){var r=t.x,i=t.y,a=n.x,o=n.y;return{x:Math.min(r,a),y:Math.min(i,o),width:Math.abs(a-r),height:Math.abs(o-i)}},Hqe=function(t){var n=t.x1,r=t.y1,i=t.x2,a=t.y2;return wee({x:n,y:r},{x:i,y:a})},jee=function(){function e(t){Wqe(this,e),this.scale=t}return Uqe(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(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,a=r.position;if(n!==void 0){if(a)switch(a){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],a=r[r.length-1];return i<=a?n>=i&&n<=a:n>=a&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])}();rk(jee,"EPS",1e-4);var WD=function(t){var n=Object.keys(t).reduce(function(r,i){return Xa(Xa({},r),{},rk({},i,jee.create(t[i])))},{});return Xa(Xa({},n),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return hqe(i,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(i){return gee(i,function(a,o){return n[o].isInRange(a)})}})};function Kqe(e){return(e%180+180)%180}var Gqe=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Kqe(i),o=a*Math.PI/180,l=Math.atan(r/n),c=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(c)},Yqe=ol,Qqe=xb,Xqe=LS;function Zqe(e){return function(t,n,r){var i=Object(t);if(!Qqe(t)){var a=Yqe(n);t=Xqe(t),n=function(l){return a(i[l],l,i)}}var o=e(t,n,r);return o>-1?i[a?t[o]:o]:void 0}}var Jqe=Zqe,e9e=hee;function t9e(e){var t=e9e(e),n=t%1;return t===t?n?t-n:t:0}var n9e=t9e,r9e=yZ,i9e=ol,s9e=n9e,a9e=Math.max;function o9e(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:s9e(n);return i<0&&(i=a9e(r+i,0)),r9e(e,i9e(t),i)}var l9e=o9e,c9e=Jqe,u9e=l9e,d9e=c9e(u9e),h9e=d9e;const f9e=Ot(h9e);var p9e=lTe(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("")}),UD=x.createContext(void 0),qD=x.createContext(void 0),_ee=x.createContext(void 0),See=x.createContext({}),kee=x.createContext(void 0),Nee=x.createContext(0),Cee=x.createContext(0),JB=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,a=n.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=p9e(a);return L.createElement(UD.Provider,{value:r},L.createElement(qD.Provider,{value:i},L.createElement(See.Provider,{value:a},L.createElement(_ee.Provider,{value:d},L.createElement(kee.Provider,{value:o},L.createElement(Nee.Provider,{value:u},L.createElement(Cee.Provider,{value:c},l)))))))},m9e=function(){return x.useContext(kee)},Aee=function(t){var n=x.useContext(UD);n==null&&wh();var r=n[t];return r==null&&wh(),r},g9e=function(){var t=x.useContext(UD);return Dc(t)},y9e=function(){var t=x.useContext(qD),n=f9e(t,function(r){return gee(r.domain,Number.isFinite)});return n||Dc(t)},Tee=function(t){var n=x.useContext(qD);n==null&&wh();var r=n[t];return r==null&&wh(),r},v9e=function(){var t=x.useContext(_ee);return t},x9e=function(){return x.useContext(See)},HD=function(){return x.useContext(Cee)},KD=function(){return x.useContext(Nee)};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 b9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w9e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Pee(r.key),r)}}function j9e(e,t,n){return t&&w9e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _9e(e,t,n){return t=I1(t),S9e(e,Eee()?Reflect.construct(t,n||[],I1(e).constructor):t.apply(e,n))}function S9e(e,t){if(t&&(pm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return k9e(e)}function k9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Eee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Eee=function(){return!!e})()}function I1(e){return I1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},I1(e)}function N9e(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&&_2(e,t)}function _2(e,t){return _2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},_2(e,t)}function e8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function t8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e8(Object(n),!0).forEach(function(r){GD(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GD(e,t,n){return t=Pee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pee(e){var t=C9e(e,"string");return pm(t)=="symbol"?t:t+""}function C9e(e,t){if(pm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(pm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function A9e(e,t){return O9e(e)||P9e(e,t)||E9e(e,t)||T9e()}function T9e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
789In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E9e(e,t){if(e){if(typeof e=="string")return n8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return n8(e,t)}}function n8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function P9e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function O9e(e){if(Array.isArray(e))return e}function S2(){return S2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S2.apply(this,arguments)}var I9e=function(t,n){var r;return L.isValidElement(t)?r=L.cloneElement(t,n):tt(t)?r=t(n):r=L.createElement("line",S2({},n,{className:"recharts-reference-line-line"})),r},R9e=function(t,n,r,i,a,o,l,c,u){var d=a.x,h=a.y,f=a.width,p=a.height;if(r){var m=u.y,g=t.y.apply(m,{position:o});if(Qo(u,"discard")&&!t.y.isInRange(g))return null;var y=[{x:d+f,y:g},{x:d,y:g}];return c==="left"?y.reverse():y}if(n){var b=u.x,v=t.x.apply(b,{position:o});if(Qo(u,"discard")&&!t.x.isInRange(v))return null;var w=[{x:v,y:h+p},{x:v,y:h}];return l==="top"?w.reverse():w}if(i){var _=u.segment,j=_.map(function(S){return t.apply(S,{position:o})});return Qo(u,"discard")&&iqe(j,function(S){return!t.isInRange(S)})?null:j}return null};function D9e(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,a=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=m9e(),d=Aee(i),h=Tee(a),f=v9e();if(!u||!f)return null;lo(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=WD({x:d.scale,y:h.scale}),m=Dr(t),g=Dr(n),y=r&&r.length===2,b=R9e(p,m,g,y,f,e.position,d.orientation,h.orientation,e);if(!b)return null;var v=A9e(b,2),w=v[0],_=w.x,j=w.y,S=v[1],k=S.x,N=S.y,T=Qo(e,"hidden")?"url(#".concat(u,")"):void 0,C=t8(t8({clipPath:T},He(e,!0)),{},{x1:_,y1:j,x2:k,y2:N});return L.createElement(Ct,{className:mt("recharts-reference-line",l)},I9e(o,C),Hr.renderCallByParent(e,Hqe({x1:_,y1:j,x2:k,y2:N})))}var gp=function(e){function t(){return b9e(this,t),_9e(this,t,arguments)}return N9e(t,e),j9e(t,[{key:"render",value:function(){return L.createElement(D9e,this.props)}}])}(L.Component);GD(gp,"displayName","ReferenceLine");GD(gp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function k2(){return k2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k2.apply(this,arguments)}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 r8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function i8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r8(Object(n),!0).forEach(function(r){ik(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function M9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $9e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Iee(r.key),r)}}function L9e(e,t,n){return t&&$9e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function F9e(e,t,n){return t=R1(t),z9e(e,Oee()?Reflect.construct(t,n||[],R1(e).constructor):t.apply(e,n))}function z9e(e,t){if(t&&(mm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return B9e(e)}function B9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Oee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Oee=function(){return!!e})()}function R1(e){return R1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},R1(e)}function V9e(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&&N2(e,t)}function N2(e,t){return N2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},N2(e,t)}function ik(e,t,n){return t=Iee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iee(e){var t=W9e(e,"string");return mm(t)=="symbol"?t:t+""}function W9e(e,t){if(mm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(mm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var U9e=function(t){var n=t.x,r=t.y,i=t.xAxis,a=t.yAxis,o=WD({x:i.scale,y:a.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return Qo(t,"discard")&&!o.isInRange(l)?null:l},sk=function(e){function t(){return M9e(this,t),F9e(this,t,arguments)}return V9e(t,e),L9e(t,[{key:"render",value:function(){var r=this.props,i=r.x,a=r.y,o=r.r,l=r.alwaysShow,c=r.clipPathId,u=Dr(i),d=Dr(a);if(lo(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var h=U9e(this.props);if(!h)return null;var f=h.x,p=h.y,m=this.props,g=m.shape,y=m.className,b=Qo(this.props,"hidden")?"url(#".concat(c,")"):void 0,v=i8(i8({clipPath:b},He(this.props,!0)),{},{cx:f,cy:p});return L.createElement(Ct,{className:mt("recharts-reference-dot",y)},t.renderDot(g,v),Hr.renderCallByParent(this.props,{x:f-o,y:p-o,width:2*o,height:2*o}))}}])}(L.Component);ik(sk,"displayName","ReferenceDot");ik(sk,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});ik(sk,"renderDot",function(e,t){var n;return L.isValidElement(e)?n=L.cloneElement(e,t):tt(e)?n=e(t):n=L.createElement(Nb,k2({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function C2(){return C2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C2.apply(this,arguments)}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 s8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function a8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s8(Object(n),!0).forEach(function(r){ak(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function q9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H9e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Dee(r.key),r)}}function K9e(e,t,n){return t&&H9e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function G9e(e,t,n){return t=D1(t),Y9e(e,Ree()?Reflect.construct(t,n||[],D1(e).constructor):t.apply(e,n))}function Y9e(e,t){if(t&&(gm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Q9e(e)}function Q9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ree(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ree=function(){return!!e})()}function D1(e){return D1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},D1(e)}function X9e(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&&A2(e,t)}function A2(e,t){return A2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},A2(e,t)}function ak(e,t,n){return t=Dee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dee(e){var t=Z9e(e,"string");return gm(t)=="symbol"?t:t+""}function Z9e(e,t){if(gm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(gm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var J9e=function(t,n,r,i,a){var o=a.x1,l=a.x2,c=a.y1,u=a.y2,d=a.xAxis,h=a.yAxis;if(!d||!h)return null;var f=WD({x:d.scale,y:h.scale}),p={x:t?f.x.apply(o,{position:"start"}):f.x.rangeMin,y:r?f.y.apply(c,{position:"start"}):f.y.rangeMin},m={x:n?f.x.apply(l,{position:"end"}):f.x.rangeMax,y:i?f.y.apply(u,{position:"end"}):f.y.rangeMax};return Qo(a,"discard")&&(!f.isInRange(p)||!f.isInRange(m))?null:wee(p,m)},ok=function(e){function t(){return q9e(this,t),G9e(this,t,arguments)}return X9e(t,e),K9e(t,[{key:"render",value:function(){var r=this.props,i=r.x1,a=r.x2,o=r.y1,l=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;lo(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=Dr(i),f=Dr(a),p=Dr(o),m=Dr(l),g=this.props.shape;if(!h&&!f&&!p&&!m&&!g)return null;var y=J9e(h,f,p,m,this.props);if(!y&&!g)return null;var b=Qo(this.props,"hidden")?"url(#".concat(d,")"):void 0;return L.createElement(Ct,{className:mt("recharts-reference-area",c)},t.renderRect(g,a8(a8({clipPath:b},He(this.props,!0)),y)),Hr.renderCallByParent(this.props,y))}}])}(L.Component);ak(ok,"displayName","ReferenceArea");ak(ok,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});ak(ok,"renderRect",function(e,t){var n;return L.isValidElement(e)?n=L.cloneElement(e,t):tt(e)?n=e(t):n=L.createElement(BD,C2({},t,{className:"recharts-reference-area-rect"})),n});function Mee(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)r.push(e[i]);return r}function eHe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Gqe(r,n)}function tHe(e,t,n){var r=n==="width",i=e.x,a=e.y,o=e.width,l=e.height;return t===1?{start:r?i:a,end:r?i+o:a+l}:{start:r?i+o:a+l,end:r?i:a}}function M1(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function nHe(e,t){return Mee(e,t+1)}function rHe(e,t,n,r,i){for(var a=(r||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,h=function(){var m=r==null?void 0:r[c];if(m===void 0)return{v:Mee(r,u)};var g=c,y,b=function(){return y===void 0&&(y=n(m,g)),y},v=m.coordinate,w=c===0||M1(e,v,b,d,l);w||(c=0,d=o,u+=1),w&&(d=v+e*(b()/2+i),c+=u)},f;u<=a.length;)if(f=h(),f)return f.v;return[]}function Ix(e){"@babel/helpers - typeof";return Ix=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},Ix(e)}function o8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o8(Object(n),!0).forEach(function(r){iHe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iHe(e,t,n){return t=sHe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sHe(e){var t=aHe(e,"string");return Ix(t)=="symbol"?t:t+""}function aHe(e,t){if(Ix(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ix(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oHe(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,l=t.start,c=t.end,u=function(f){var p=a[f],m,g=function(){return m===void 0&&(m=n(p,f)),m};if(f===o-1){var y=e*(p.coordinate+e*g()/2-c);a[f]=p=fi(fi({},p),{},{tickCoord:y>0?p.coordinate-y*e:p.coordinate})}else a[f]=p=fi(fi({},p),{},{tickCoord:p.coordinate});var b=M1(e,p.tickCoord,g,l,c);b&&(c=p.tickCoord-e*(g()/2+i),a[f]=fi(fi({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return a}function lHe(e,t,n,r,i,a){var o=(r||[]).slice(),l=o.length,c=t.start,u=t.end;if(a){var d=r[l-1],h=n(d,l-1),f=e*(d.coordinate+e*h/2-u);o[l-1]=d=fi(fi({},d),{},{tickCoord:f>0?d.coordinate-f*e:d.coordinate});var p=M1(e,d.tickCoord,function(){return h},c,u);p&&(u=d.tickCoord-e*(h/2+i),o[l-1]=fi(fi({},d),{},{isShow:!0}))}for(var m=a?l-1:l,g=function(v){var w=o[v],_,j=function(){return _===void 0&&(_=n(w,v)),_};if(v===0){var S=e*(w.coordinate-e*j()/2-c);o[v]=w=fi(fi({},w),{},{tickCoord:S<0?w.coordinate-S*e:w.coordinate})}else o[v]=w=fi(fi({},w),{},{tickCoord:w.coordinate});var k=M1(e,w.tickCoord,j,c,u);k&&(c=w.tickCoord+e*(j()/2+i),o[v]=fi(fi({},w),{},{isShow:!0}))},y=0;y<m;y++)g(y);return o}function YD(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,h=e.angle;if(!i||!i.length||!r)return[];if(ge(c)||co.isSsr)return nHe(i,typeof c=="number"&&ge(c)?c:0);var f=[],p=l==="top"||l==="bottom"?"width":"height",m=d&&p==="width"?Yy(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},g=function(w,_){var j=tt(u)?u(w.value,_):w.value;return p==="width"?eHe(Yy(j,{fontSize:t,letterSpacing:n}),m,h):Yy(j,{fontSize:t,letterSpacing:n})[p]},y=i.length>=2?Mi(i[1].coordinate-i[0].coordinate):1,b=tHe(a,y,p);return c==="equidistantPreserveStart"?rHe(y,b,g,i,o):(c==="preserveStart"||c==="preserveStartEnd"?f=lHe(y,b,g,i,o,c==="preserveStartEnd"):f=oHe(y,b,g,i,o),f.filter(function(v){return v.isShow}))}var cHe=["viewBox"],uHe=["viewBox"],dHe=["ticks"];function ym(e){"@babel/helpers - typeof";return ym=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},ym(e)}function Xf(){return Xf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xf.apply(this,arguments)}function l8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?l8(Object(n),!0).forEach(function(r){QD(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zC(e,t){if(e==null)return{};var n=hHe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hHe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function fHe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c8(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Lee(r.key),r)}}function pHe(e,t,n){return t&&c8(e.prototype,t),n&&c8(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mHe(e,t,n){return t=$1(t),gHe(e,$ee()?Reflect.construct(t,n||[],$1(e).constructor):t.apply(e,n))}function gHe(e,t){if(t&&(ym(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yHe(e)}function yHe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $ee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($ee=function(){return!!e})()}function $1(e){return $1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$1(e)}function vHe(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&&T2(e,t)}function T2(e,t){return T2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},T2(e,t)}function QD(e,t,n){return t=Lee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lee(e){var t=xHe(e,"string");return ym(t)=="symbol"?t:t+""}function xHe(e,t){if(ym(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ym(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _g=function(e){function t(n){var r;return fHe(this,t),r=mHe(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return vHe(t,e),pHe(t,[{key:"shouldComponentUpdate",value:function(r,i){var a=r.viewBox,o=zC(r,cHe),l=this.props,c=l.viewBox,u=zC(l,uHe);return!fp(a,c)||!fp(o,u)||!fp(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,a=i.x,o=i.y,l=i.width,c=i.height,u=i.orientation,d=i.tickSize,h=i.mirror,f=i.tickMargin,p,m,g,y,b,v,w=h?-1:1,_=r.tickSize||d,j=ge(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":p=m=r.coordinate,y=o+ +!h*c,g=y-w*_,v=g-w*f,b=j;break;case"left":g=y=r.coordinate,m=a+ +!h*l,p=m-w*_,b=p-w*f,v=j;break;case"right":g=y=r.coordinate,m=a+ +h*l,p=m+w*_,b=p+w*f,v=j;break;default:p=m=r.coordinate,y=o+ +h*c,g=y+w*_,v=g+w*f,b=j;break}return{line:{x1:p,y1:g,x2:m,y2:y},tick:{x:b,y:v}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,o;switch(i){case"left":o=a?"start":"end";break;case"right":o=a?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,o="end";switch(i){case"left":case"right":o="middle";break;case"top":o=a?"start":"end";break;default:o=a?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,l=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,h=kr(kr(kr({},He(this.props,!1)),He(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var f=+(c==="top"&&!u||c==="bottom"&&u);h=kr(kr({},h),{},{x1:i,y1:a+f*l,x2:i+o,y2:a+f*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);h=kr(kr({},h),{},{x1:i+p*o,y1:a,x2:i+p*o,y2:a+l})}return L.createElement("line",Xf({},h,{className:mt("recharts-cartesian-axis-line",zs(d,"className"))}))}},{key:"renderTicks",value:function(r,i,a){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,h=l.tickFormatter,f=l.unit,p=YD(kr(kr({},this.props),{},{ticks:r}),i,a),m=this.getTickTextAnchor(),g=this.getTickVerticalAnchor(),y=He(this.props,!1),b=He(d,!1),v=kr(kr({},y),{},{fill:"none"},He(c,!1)),w=p.map(function(_,j){var S=o.getTickLineCoord(_),k=S.line,N=S.tick,T=kr(kr(kr(kr({textAnchor:m,verticalAnchor:g},y),{},{stroke:"none",fill:u},b),N),{},{index:j,payload:_,visibleTicksCount:p.length,tickFormatter:h});return L.createElement(Ct,Xf({className:"recharts-cartesian-axis-tick",key:"tick-".concat(_.value,"-").concat(_.coordinate,"-").concat(_.tickCoord)},yh(o.props,_,j)),c&&L.createElement("line",Xf({},v,k,{className:mt("recharts-cartesian-axis-tick-line",zs(c,"className"))})),d&&t.renderTickItem(d,T,"".concat(tt(h)?h(_.value,j):_.value).concat(f||"")))});return L.createElement("g",{className:"recharts-cartesian-axis-ticks"},w)}},{key:"render",value:function(){var r=this,i=this.props,a=i.axisLine,o=i.width,l=i.height,c=i.ticksGenerator,u=i.className,d=i.hide;if(d)return null;var h=this.props,f=h.ticks,p=zC(h,dHe),m=f;return tt(c)&&(m=f&&f.length>0?c(this.props):c(p)),o<=0||l<=0||!m||!m.length?null:L.createElement(Ct,{className:mt("recharts-cartesian-axis",u),ref:function(y){r.layerReference=y}},a&&this.renderAxisLine(),this.renderTicks(m,this.state.fontSize,this.state.letterSpacing),Hr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,a){var o,l=mt(i.className,"recharts-cartesian-axis-tick-value");return L.isValidElement(r)?o=L.cloneElement(r,kr(kr({},i),{},{className:l})):tt(r)?o=r(kr(kr({},i),{},{className:l})):o=L.createElement(vh,Xf({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(x.Component);QD(_g,"displayName","CartesianAxis");QD(_g,"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 bHe=["x1","y1","x2","y2","key"],wHe=["offset"];function jh(e){"@babel/helpers - typeof";return jh=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},jh(e)}function u8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u8(Object(n),!0).forEach(function(r){jHe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jHe(e,t,n){return t=_He(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _He(e){var t=SHe(e,"string");return jh(t)=="symbol"?t:t+""}function SHe(e,t){if(jh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(jh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ad(){return Ad=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ad.apply(this,arguments)}function d8(e,t){if(e==null)return{};var n=kHe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function kHe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var NHe=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,a=t.y,o=t.width,l=t.height,c=t.ry;return L.createElement("rect",{x:i,y:a,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Fee(e,t){var n;if(L.isValidElement(e))n=L.cloneElement(e,t);else if(tt(e))n=e(t);else{var r=t.x1,i=t.y1,a=t.x2,o=t.y2,l=t.key,c=d8(t,bHe),u=He(c,!1);u.offset;var d=d8(u,wHe);n=L.createElement("line",Ad({},d,{x1:r,y1:i,x2:a,y2:o,fill:"none",key:l}))}return n}function CHe(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(l,c){var u=yi(yi({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return Fee(i,u)});return L.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function AHe(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(l,c){var u=yi(yi({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return Fee(i,u)});return L.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function THe(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,a=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(f){return Math.round(f+i-i)}).sort(function(f,p){return f-p});i!==d[0]&&d.unshift(0);var h=d.map(function(f,p){var m=!d[p+1],g=m?i+o-f:d[p+1]-f;if(g<=0)return null;var y=p%t.length;return L.createElement("rect",{key:"react-".concat(p),y:f,x:r,height:g,width:a,stroke:"none",fill:t[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return L.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},h)}function EHe(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(f){return Math.round(f+a-a)}).sort(function(f,p){return f-p});a!==d[0]&&d.unshift(0);var h=d.map(function(f,p){var m=!d[p+1],g=m?a+l-f:d[p+1]-f;if(g<=0)return null;var y=p%r.length;return L.createElement("rect",{key:"react-".concat(p),x:f,y:o,width:g,height:c,stroke:"none",fill:r[y],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return L.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},h)}var PHe=function(t,n){var r=t.xAxis,i=t.width,a=t.height,o=t.offset;return MJ(YD(yi(yi(yi({},_g.defaultProps),r),{},{ticks:Ol(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,n)},OHe=function(t,n){var r=t.yAxis,i=t.width,a=t.height,o=t.offset;return MJ(YD(yi(yi(yi({},_g.defaultProps),r),{},{ticks:Ol(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,n)},of={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Cb(e){var t,n,r,i,a,o,l=HD(),c=KD(),u=x9e(),d=yi(yi({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:of.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:of.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:of.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:of.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:of.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:of.verticalFill,x:ge(e.x)?e.x:u.left,y:ge(e.y)?e.y:u.top,width:ge(e.width)?e.width:u.width,height:ge(e.height)?e.height:u.height}),h=d.x,f=d.y,p=d.width,m=d.height,g=d.syncWithTicks,y=d.horizontalValues,b=d.verticalValues,v=g9e(),w=y9e();if(!ge(p)||p<=0||!ge(m)||m<=0||!ge(h)||h!==+h||!ge(f)||f!==+f)return null;var _=d.verticalCoordinatesGenerator||PHe,j=d.horizontalCoordinatesGenerator||OHe,S=d.horizontalPoints,k=d.verticalPoints;if((!S||!S.length)&&tt(j)){var N=y&&y.length,T=j({yAxis:w?yi(yi({},w),{},{ticks:N?y:w.ticks}):void 0,width:l,height:c,offset:u},N?!0:g);lo(Array.isArray(T),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(jh(T),"]")),Array.isArray(T)&&(S=T)}if((!k||!k.length)&&tt(_)){var C=b&&b.length,A=_({xAxis:v?yi(yi({},v),{},{ticks:C?b:v.ticks}):void 0,width:l,height:c,offset:u},C?!0:g);lo(Array.isArray(A),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(jh(A),"]")),Array.isArray(A)&&(k=A)}return L.createElement("g",{className:"recharts-cartesian-grid"},L.createElement(NHe,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),L.createElement(CHe,Ad({},d,{offset:u,horizontalPoints:S,xAxis:v,yAxis:w})),L.createElement(AHe,Ad({},d,{offset:u,verticalPoints:k,xAxis:v,yAxis:w})),L.createElement(THe,Ad({},d,{horizontalPoints:S})),L.createElement(EHe,Ad({},d,{verticalPoints:k})))}Cb.displayName="CartesianGrid";var IHe=["type","layout","connectNulls","ref"],RHe=["key"];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 h8(e,t){if(e==null)return{};var n=DHe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DHe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function tv(){return tv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tv.apply(this,arguments)}function f8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _s(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f8(Object(n),!0).forEach(function(r){Za(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lf(e){return FHe(e)||LHe(e)||$He(e)||MHe()}function MHe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
790In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $He(e,t){if(e){if(typeof e=="string")return E2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E2(e,t)}}function LHe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function FHe(e){if(Array.isArray(e))return E2(e)}function E2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zHe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p8(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Bee(r.key),r)}}function BHe(e,t,n){return t&&p8(e.prototype,t),n&&p8(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function VHe(e,t,n){return t=L1(t),WHe(e,zee()?Reflect.construct(t,n||[],L1(e).constructor):t.apply(e,n))}function WHe(e,t){if(t&&(vm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return UHe(e)}function UHe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zee=function(){return!!e})()}function L1(e){return L1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},L1(e)}function qHe(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&&P2(e,t)}function P2(e,t){return P2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},P2(e,t)}function Za(e,t,n){return t=Bee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bee(e){var t=HHe(e,"string");return vm(t)=="symbol"?t:t+""}function HHe(e,t){if(vm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(vm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xm=function(e){function t(){var n;zHe(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=VHe(this,t,[].concat(i)),Za(n,"state",{isAnimationFinished:!0,totalLength:0}),Za(n,"generateSimpleStrokeDasharray",function(o,l){return"".concat(l,"px ").concat(o-l,"px")}),Za(n,"getStrokeDasharray",function(o,l,c){var u=c.reduce(function(b,v){return b+v});if(!u)return n.generateSimpleStrokeDasharray(l,o);for(var d=Math.floor(o/u),h=o%u,f=l-o,p=[],m=0,g=0;m<c.length;g+=c[m],++m)if(g+c[m]>h){p=[].concat(lf(c.slice(0,m)),[h-g]);break}var y=p.length%2===0?[0,f]:[f];return[].concat(lf(t.repeat(c,d)),lf(p),y).map(function(b){return"".concat(b,"px")}).join(", ")}),Za(n,"id",Mh("recharts-line-")),Za(n,"pathRef",function(o){n.mainCurve=o}),Za(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Za(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return qHe(t,e),BHe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,h=Bs(d,kb);if(!h)return null;var f=function(g,y){return{x:g.x,y:g.y,value:g.value,errorVal:er(g.payload,y)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return L.createElement(Ct,p,h.map(function(m){return L.cloneElement(m,{key:"bar-".concat(m.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,dataPointFormatter:f})}))}},{key:"renderDots",value:function(r,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,d=l.dataKey,h=He(this.props,!1),f=He(c,!0),p=u.map(function(g,y){var b=_s(_s(_s({key:"dot-".concat(y),r:3},h),f),{},{index:y,cx:g.x,cy:g.y,value:g.value,dataKey:d,payload:g.payload,points:u});return t.renderDotItem(c,b)}),m={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return L.createElement(Ct,tv({className:"recharts-line-dots",key:"dots"},m),p)}},{key:"renderCurveStatically",value:function(r,i,a,o){var l=this.props,c=l.type,u=l.layout,d=l.connectNulls;l.ref;var h=h8(l,IHe),f=_s(_s(_s({},He(h,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:r},o),{},{type:c,layout:u,connectNulls:d});return L.createElement(Gd,tv({},f,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var a=this,o=this.props,l=o.points,c=o.strokeDasharray,u=o.isAnimationActive,d=o.animationBegin,h=o.animationDuration,f=o.animationEasing,p=o.animationId,m=o.animateNewValues,g=o.width,y=o.height,b=this.state,v=b.prevPoints,w=b.totalLength;return L.createElement(vo,{begin:d,duration:h,isActive:u,easing:f,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(_){var j=_.t;if(v){var S=v.length/l.length,k=l.map(function(O,z){var $=Math.floor(z*S);if(v[$]){var F=v[$],B=Or(F.x,O.x),P=Or(F.y,O.y);return _s(_s({},O),{},{x:B(j),y:P(j)})}if(m){var I=Or(g*2,O.x),M=Or(y/2,O.y);return _s(_s({},O),{},{x:I(j),y:M(j)})}return _s(_s({},O),{},{x:O.x,y:O.y})});return a.renderCurveStatically(k,r,i)}var N=Or(0,w),T=N(j),C;if(c){var A="".concat(c).split(/[,\s]+/gim).map(function(O){return parseFloat(O)});C=a.getStrokeDasharray(T,w,A)}else C=a.generateSimpleStrokeDasharray(w,T);return a.renderCurveStatically(l,r,i,{strokeDasharray:C})})}},{key:"renderCurve",value:function(r,i){var a=this.props,o=a.points,l=a.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return l&&o&&o.length&&(!u&&d>0||!xh(u,o))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(o,r,i)}},{key:"render",value:function(){var r,i=this.props,a=i.hide,o=i.dot,l=i.points,c=i.className,u=i.xAxis,d=i.yAxis,h=i.top,f=i.left,p=i.width,m=i.height,g=i.isAnimationActive,y=i.id;if(a||!l||!l.length)return null;var b=this.state.isAnimationFinished,v=l.length===1,w=mt("recharts-line",c),_=u&&u.allowDataOverflow,j=d&&d.allowDataOverflow,S=_||j,k=dt(y)?this.id:y,N=(r=He(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},T=N.r,C=T===void 0?3:T,A=N.strokeWidth,O=A===void 0?2:A,z=AX(o)?o:{},$=z.clipDot,F=$===void 0?!0:$,B=C*2+O;return L.createElement(Ct,{className:w},_||j?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(k)},L.createElement("rect",{x:_?f:f-p/2,y:j?h:h-m/2,width:_?p:p*2,height:j?m:m*2})),!F&&L.createElement("clipPath",{id:"clipPath-dots-".concat(k)},L.createElement("rect",{x:f-B/2,y:h-B/2,width:p+B,height:m+B}))):null,!v&&this.renderCurve(S,k),this.renderErrorBar(S,k),(v||o)&&this.renderDots(S,F,k),(!g||b)&&Yo.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var a=r.length%2!==0?[].concat(lf(r),[0]):r,o=[],l=0;l<i;++l)o=[].concat(lf(o),lf(a));return o}},{key:"renderDotItem",value:function(r,i){var a;if(L.isValidElement(r))a=L.cloneElement(r,i);else if(tt(r))a=r(i);else{var o=i.key,l=h8(i,RHe),c=mt("recharts-line-dot",typeof r!="boolean"?r.className:"");a=L.createElement(Nb,tv({key:o},l,{className:c}))}return a}}])}(x.PureComponent);Za(xm,"displayName","Line");Za(xm,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!co.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Za(xm,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout,h=c.map(function(f,p){var m=er(f,o);return d==="horizontal"?{x:m1({axis:n,ticks:i,bandSize:l,entry:f,index:p}),y:dt(m)?null:r.scale(m),value:m,payload:f}:{x:dt(m)?null:n.scale(m),y:m1({axis:r,ticks:a,bandSize:l,entry:f,index:p}),value:m,payload:f}});return _s({points:h,layout:d},u)});var KHe=["layout","type","stroke","connectNulls","isRange","ref"],GHe=["key"],Vee;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)}function Wee(e,t){if(e==null)return{};var n=YHe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function YHe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Td(){return Td=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Td.apply(this,arguments)}function m8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m8(Object(n),!0).forEach(function(r){Bo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QHe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g8(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qee(r.key),r)}}function XHe(e,t,n){return t&&g8(e.prototype,t),n&&g8(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ZHe(e,t,n){return t=F1(t),JHe(e,Uee()?Reflect.construct(t,n||[],F1(e).constructor):t.apply(e,n))}function JHe(e,t){if(t&&(bm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return eKe(e)}function eKe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Uee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Uee=function(){return!!e})()}function F1(e){return F1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},F1(e)}function tKe(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&&O2(e,t)}function O2(e,t){return O2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},O2(e,t)}function Bo(e,t,n){return t=qee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qee(e){var t=nKe(e,"string");return bm(t)=="symbol"?t:t+""}function nKe(e,t){if(bm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(bm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wu=function(e){function t(){var n;QHe(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=ZHe(this,t,[].concat(i)),Bo(n,"state",{isAnimationFinished:!0}),Bo(n,"id",Mh("recharts-area-")),Bo(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),tt(o)&&o()}),Bo(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),tt(o)&&o()}),n}return tKe(t,e),XHe(t,[{key:"renderDots",value:function(r,i,a){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var c=this.props,u=c.dot,d=c.points,h=c.dataKey,f=He(this.props,!1),p=He(u,!0),m=d.map(function(y,b){var v=kc(kc(kc({key:"dot-".concat(b),r:3},f),p),{},{index:b,cx:y.x,cy:y.y,dataKey:h,value:y.value,payload:y.payload,points:d});return t.renderDotItem(u,v)}),g={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return L.createElement(Ct,Td({className:"recharts-area-dots"},g),m)}},{key:"renderHorizontalRect",value:function(r){var i=this.props,a=i.baseLine,o=i.points,l=i.strokeWidth,c=o[0].x,u=o[o.length-1].x,d=r*Math.abs(c-u),h=Xc(o.map(function(f){return f.y||0}));return ge(a)&&typeof a=="number"?h=Math.max(a,h):a&&Array.isArray(a)&&a.length&&(h=Math.max(Xc(a.map(function(f){return f.y||0})),h)),ge(h)?L.createElement("rect",{x:c<u?c:c-d,y:0,width:d,height:Math.floor(h+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(r){var i=this.props,a=i.baseLine,o=i.points,l=i.strokeWidth,c=o[0].y,u=o[o.length-1].y,d=r*Math.abs(c-u),h=Xc(o.map(function(f){return f.x||0}));return ge(a)&&typeof a=="number"?h=Math.max(a,h):a&&Array.isArray(a)&&a.length&&(h=Math.max(Xc(a.map(function(f){return f.x||0})),h)),ge(h)?L.createElement("rect",{x:0,y:c<u?c:c-d,width:h+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}},{key:"renderClipRect",value:function(r){var i=this.props.layout;return i==="vertical"?this.renderVerticalRect(r):this.renderHorizontalRect(r)}},{key:"renderAreaStatically",value:function(r,i,a,o){var l=this.props,c=l.layout,u=l.type,d=l.stroke,h=l.connectNulls,f=l.isRange;l.ref;var p=Wee(l,KHe);return L.createElement(Ct,{clipPath:a?"url(#clipPath-".concat(o,")"):null},L.createElement(Gd,Td({},He(p,!0),{points:r,connectNulls:h,type:u,baseLine:i,layout:c,stroke:"none",className:"recharts-area-area"})),d!=="none"&&L.createElement(Gd,Td({},He(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:h,fill:"none",points:r})),d!=="none"&&f&&L.createElement(Gd,Td({},He(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:h,fill:"none",points:i})))}},{key:"renderAreaWithAnimation",value:function(r,i){var a=this,o=this.props,l=o.points,c=o.baseLine,u=o.isAnimationActive,d=o.animationBegin,h=o.animationDuration,f=o.animationEasing,p=o.animationId,m=this.state,g=m.prevPoints,y=m.prevBaseLine;return L.createElement(vo,{begin:d,duration:h,isActive:u,easing:f,from:{t:0},to:{t:1},key:"area-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(b){var v=b.t;if(g){var w=g.length/l.length,_=l.map(function(N,T){var C=Math.floor(T*w);if(g[C]){var A=g[C],O=Or(A.x,N.x),z=Or(A.y,N.y);return kc(kc({},N),{},{x:O(v),y:z(v)})}return N}),j;if(ge(c)&&typeof c=="number"){var S=Or(y,c);j=S(v)}else if(dt(c)||mg(c)){var k=Or(y,0);j=k(v)}else j=c.map(function(N,T){var C=Math.floor(T*w);if(y[C]){var A=y[C],O=Or(A.x,N.x),z=Or(A.y,N.y);return kc(kc({},N),{},{x:O(v),y:z(v)})}return N});return a.renderAreaStatically(_,j,r,i)}return L.createElement(Ct,null,L.createElement("defs",null,L.createElement("clipPath",{id:"animationClipPath-".concat(i)},a.renderClipRect(v))),L.createElement(Ct,{clipPath:"url(#animationClipPath-".concat(i,")")},a.renderAreaStatically(l,c,r,i)))})}},{key:"renderArea",value:function(r,i){var a=this.props,o=a.points,l=a.baseLine,c=a.isAnimationActive,u=this.state,d=u.prevPoints,h=u.prevBaseLine,f=u.totalLength;return c&&o&&o.length&&(!d&&f>0||!xh(d,o)||!xh(h,l))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(o,l,r,i)}},{key:"render",value:function(){var r,i=this.props,a=i.hide,o=i.dot,l=i.points,c=i.className,u=i.top,d=i.left,h=i.xAxis,f=i.yAxis,p=i.width,m=i.height,g=i.isAnimationActive,y=i.id;if(a||!l||!l.length)return null;var b=this.state.isAnimationFinished,v=l.length===1,w=mt("recharts-area",c),_=h&&h.allowDataOverflow,j=f&&f.allowDataOverflow,S=_||j,k=dt(y)?this.id:y,N=(r=He(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},T=N.r,C=T===void 0?3:T,A=N.strokeWidth,O=A===void 0?2:A,z=AX(o)?o:{},$=z.clipDot,F=$===void 0?!0:$,B=C*2+O;return L.createElement(Ct,{className:w},_||j?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(k)},L.createElement("rect",{x:_?d:d-p/2,y:j?u:u-m/2,width:_?p:p*2,height:j?m:m*2})),!F&&L.createElement("clipPath",{id:"clipPath-dots-".concat(k)},L.createElement("rect",{x:d-B/2,y:u-B/2,width:p+B,height:m+B}))):null,v?null:this.renderArea(S,k),(o||v)&&this.renderDots(S,F,k),(!g||b)&&Yo.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(x.PureComponent);Vee=Wu;Bo(Wu,"displayName","Area");Bo(Wu,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!co.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Bo(Wu,"getBaseValue",function(e,t,n,r){var i=e.layout,a=e.baseValue,o=t.props.baseValue,l=o??a;if(ge(l)&&typeof l=="number")return l;var c=i==="horizontal"?r:n,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),h=Math.min(u[0],u[1]);return l==="dataMin"?h:l==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});Bo(Wu,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,h=e.displayedData,f=e.offset,p=t.layout,m=u&&u.length,g=Vee.getBaseValue(t,n,r,i),y=p==="horizontal",b=!1,v=h.map(function(_,j){var S;m?S=u[d+j]:(S=er(_,c),Array.isArray(S)?b=!0:S=[g,S]);var k=S[1]==null||m&&er(_,c)==null;return y?{x:m1({axis:r,ticks:a,bandSize:l,entry:_,index:j}),y:k?null:i.scale(S[1]),value:S,payload:_}:{x:k?null:r.scale(S[1]),y:m1({axis:i,ticks:o,bandSize:l,entry:_,index:j}),value:S,payload:_}}),w;return m||b?w=v.map(function(_){var j=Array.isArray(_.value)?_.value[0]:null;return y?{x:_.x,y:j!=null&&_.y!=null?i.scale(j):null}:{x:j!=null?r.scale(j):null,y:_.y}}):w=y?i.scale(g):r.scale(g),kc({points:v,baseLine:w,layout:p,isRange:b},f)});Bo(Wu,"renderDotItem",function(e,t){var n;if(L.isValidElement(e))n=L.cloneElement(e,t);else if(tt(e))n=e(t);else{var r=mt("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=Wee(t,GHe);n=L.createElement(Nb,Td({},a,{key:i,className:r}))}return n});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 rKe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iKe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Gee(r.key),r)}}function sKe(e,t,n){return t&&iKe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function aKe(e,t,n){return t=z1(t),oKe(e,Hee()?Reflect.construct(t,n||[],z1(e).constructor):t.apply(e,n))}function oKe(e,t){if(t&&(wm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lKe(e)}function lKe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Hee=function(){return!!e})()}function z1(e){return z1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},z1(e)}function cKe(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&&I2(e,t)}function I2(e,t){return I2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},I2(e,t)}function Kee(e,t,n){return t=Gee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gee(e){var t=uKe(e,"string");return wm(t)=="symbol"?t:t+""}function uKe(e,t){if(wm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(wm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function R2(){return R2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R2.apply(this,arguments)}function dKe(e){var t=e.xAxisId,n=HD(),r=KD(),i=Aee(t);return i==null?null:x.createElement(_g,R2({},i,{className:mt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return Ol(o,!0)}}))}var lc=function(e){function t(){return rKe(this,t),aKe(this,t,arguments)}return cKe(t,e),sKe(t,[{key:"render",value:function(){return x.createElement(dKe,this.props)}}])}(x.Component);Kee(lc,"displayName","XAxis");Kee(lc,"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 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 hKe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fKe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Xee(r.key),r)}}function pKe(e,t,n){return t&&fKe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function mKe(e,t,n){return t=B1(t),gKe(e,Yee()?Reflect.construct(t,n||[],B1(e).constructor):t.apply(e,n))}function gKe(e,t){if(t&&(jm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yKe(e)}function yKe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Yee=function(){return!!e})()}function B1(e){return B1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},B1(e)}function vKe(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&&D2(e,t)}function D2(e,t){return D2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},D2(e,t)}function Qee(e,t,n){return t=Xee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xee(e){var t=xKe(e,"string");return jm(t)=="symbol"?t:t+""}function xKe(e,t){if(jm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(jm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function M2(){return M2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},M2.apply(this,arguments)}var bKe=function(t){var n=t.yAxisId,r=HD(),i=KD(),a=Tee(n);return a==null?null:x.createElement(_g,M2({},a,{className:mt("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(l){return Ol(l,!0)}}))},cc=function(e){function t(){return hKe(this,t),mKe(this,t,arguments)}return vKe(t,e),pKe(t,[{key:"render",value:function(){return x.createElement(bKe,this.props)}}])}(x.Component);Qee(cc,"displayName","YAxis");Qee(cc,"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 y8(e){return SKe(e)||_Ke(e)||jKe(e)||wKe()}function wKe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
791In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jKe(e,t){if(e){if(typeof e=="string")return $2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $2(e,t)}}function _Ke(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function SKe(e){if(Array.isArray(e))return $2(e)}function $2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var L2=function(t,n,r,i,a){var o=Bs(t,gp),l=Bs(t,sk),c=[].concat(y8(o),y8(l)),u=Bs(t,ok),d="".concat(i,"Id"),h=i[0],f=n;if(c.length&&(f=c.reduce(function(g,y){if(y.props[d]===r&&Qo(y.props,"extendDomain")&&ge(y.props[h])){var b=y.props[h];return[Math.min(g[0],b),Math.max(g[1],b)]}return g},f)),u.length){var p="".concat(h,"1"),m="".concat(h,"2");f=u.reduce(function(g,y){if(y.props[d]===r&&Qo(y.props,"extendDomain")&&ge(y.props[p])&&ge(y.props[m])){var b=y.props[p],v=y.props[m];return[Math.min(g[0],b,v),Math.max(g[1],b,v)]}return g},f)}return a&&a.length&&(f=a.reduce(function(g,y){return ge(y)?[Math.min(g[0],y),Math.max(g[1],y)]:g},f)),f},Zee={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,h,f){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new i(d,h||c,f),m=n?n+u:u;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],p]:c._events[m].push(p):(c._events[m]=p,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,h;if(this._eventsCount===0)return u;for(h in d=this._events)t.call(d,h)&&u.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,h=this._events[d];if(!h)return[];if(h.fn)return[h.fn];for(var f=0,p=h.length,m=new Array(p);f<p;f++)m[f]=h[f].fn;return m},l.prototype.listenerCount=function(u){var d=n?n+u:u,h=this._events[d];return h?h.fn?1:h.length:0},l.prototype.emit=function(u,d,h,f,p,m){var g=n?n+u:u;if(!this._events[g])return!1;var y=this._events[g],b=arguments.length,v,w;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),b){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,h),!0;case 4:return y.fn.call(y.context,d,h,f),!0;case 5:return y.fn.call(y.context,d,h,f,p),!0;case 6:return y.fn.call(y.context,d,h,f,p,m),!0}for(w=1,v=new Array(b-1);w<b;w++)v[w-1]=arguments[w];y.fn.apply(y.context,v)}else{var _=y.length,j;for(w=0;w<_;w++)switch(y[w].once&&this.removeListener(u,y[w].fn,void 0,!0),b){case 1:y[w].fn.call(y[w].context);break;case 2:y[w].fn.call(y[w].context,d);break;case 3:y[w].fn.call(y[w].context,d,h);break;case 4:y[w].fn.call(y[w].context,d,h,f);break;default:if(!v)for(j=1,v=new Array(b-1);j<b;j++)v[j-1]=arguments[j];y[w].fn.apply(y[w].context,v)}}return!0},l.prototype.on=function(u,d,h){return a(this,u,d,h,!1)},l.prototype.once=function(u,d,h){return a(this,u,d,h,!0)},l.prototype.removeListener=function(u,d,h,f){var p=n?n+u:u;if(!this._events[p])return this;if(!d)return o(this,p),this;var m=this._events[p];if(m.fn)m.fn===d&&(!f||m.once)&&(!h||m.context===h)&&o(this,p);else{for(var g=0,y=[],b=m.length;g<b;g++)(m[g].fn!==d||f&&!m[g].once||h&&m[g].context!==h)&&y.push(m[g]);y.length?this._events[p]=y.length===1?y[0]:y:o(this,p)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(Zee);var kKe=Zee.exports;const NKe=Ot(kKe);var BC=new NKe,VC="recharts.syncMouseEvents";function Rx(e){"@babel/helpers - typeof";return Rx=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},Rx(e)}function CKe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AKe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Jee(r.key),r)}}function TKe(e,t,n){return t&&AKe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function WC(e,t,n){return t=Jee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jee(e){var t=EKe(e,"string");return Rx(t)=="symbol"?t:t+""}function EKe(e,t){if(Rx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var PKe=function(){function e(){CKe(this,e),WC(this,"activeIndex",0),WC(this,"coordinateList",[]),WC(this,"layout","horizontal")}return TKe(e,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,a=i===void 0?null:i,o=n.container,l=o===void 0?null:o,c=n.layout,u=c===void 0?null:c,d=n.offset,h=d===void 0?null:d,f=n.mouseHandlerCallback,p=f===void 0?null:f;this.coordinateList=(r=a??this.coordinateList)!==null&&r!==void 0?r:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=h??this.offset,this.mouseHandlerCallback=p??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(n){if(this.coordinateList.length!==0)switch(n.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(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),a=i.x,o=i.y,l=i.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,d=((r=window)===null||r===void 0?void 0:r.scrollY)||0,h=a+c+u,f=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:h,pageY:f})}}}])}();function OKe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],i=e==null?void 0:e[1];if(r&&i&&ge(r)&&ge(i))return!0}return!1}function IKe(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function ete(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle,o=mn(t,n,r,i),l=mn(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}function RKe(e,t,n){var r,i,a,o;if(e==="horizontal")r=t.x,a=r,i=n.top,o=n.top+n.height;else if(e==="vertical")i=t.y,o=i,r=n.left,a=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,h=t.angle,f=mn(l,c,u,h),p=mn(l,c,d,h);r=f.x,i=f.y,a=p.x,o=p.y}else return ete(t);return[{x:r,y:i},{x:a,y:o}]}function Dx(e){"@babel/helpers - typeof";return Dx=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},Dx(e)}function v8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function U0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v8(Object(n),!0).forEach(function(r){DKe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DKe(e,t,n){return t=MKe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MKe(e){var t=$Ke(e,"string");return Dx(t)=="symbol"?t:t+""}function $Ke(e,t){if(Dx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Dx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LKe(e){var t,n,r=e.element,i=e.tooltipEventType,a=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,h=e.layout,f=e.chartName,p=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!p||!a||!o||f!=="ScatterChart"&&i!=="axis")return null;var m,g=Gd;if(f==="ScatterChart")m=o,g=HVe;else if(f==="BarChart")m=IKe(h,o,c,d),g=BD;else if(h==="radial"){var y=ete(o),b=y.cx,v=y.cy,w=y.radius,_=y.startAngle,j=y.endAngle;m={cx:b,cy:v,startAngle:_,endAngle:j,innerRadius:w,outerRadius:w},g=KJ}else m={points:RKe(h,o,c)},g=Gd;var S=U0(U0(U0(U0({stroke:"#ccc",pointerEvents:"none"},c),m),He(p,!1)),{},{payload:l,payloadIndex:u,className:mt("recharts-tooltip-cursor",p.className)});return x.isValidElement(p)?x.cloneElement(p,S):x.createElement(g,S)}var FKe=["item"],zKe=["children","className","width","height","style","compact","title","desc"];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 Zf(){return Zf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zf.apply(this,arguments)}function x8(e,t){return WKe(e)||VKe(e,t)||nte(e,t)||BKe()}function BKe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
792In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VKe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function WKe(e){if(Array.isArray(e))return e}function b8(e,t){if(e==null)return{};var n=UKe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function UKe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function qKe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HKe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,rte(r.key),r)}}function KKe(e,t,n){return t&&HKe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function GKe(e,t,n){return t=V1(t),YKe(e,tte()?Reflect.construct(t,n||[],V1(e).constructor):t.apply(e,n))}function YKe(e,t){if(t&&(_m(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return QKe(e)}function QKe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tte(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tte=function(){return!!e})()}function V1(e){return V1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},V1(e)}function XKe(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&&F2(e,t)}function F2(e,t){return F2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},F2(e,t)}function Sm(e){return e7e(e)||JKe(e)||nte(e)||ZKe()}function ZKe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
793In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nte(e,t){if(e){if(typeof e=="string")return z2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z2(e,t)}}function JKe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function e7e(e){if(Array.isArray(e))return z2(e)}function z2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function w8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function se(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w8(Object(n),!0).forEach(function(r){Je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Je(e,t,n){return t=rte(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rte(e){var t=t7e(e,"string");return _m(t)=="symbol"?t:t+""}function t7e(e,t){if(_m(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(_m(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var n7e={xAxis:["bottom","top"],yAxis:["left","right"]},r7e={width:"100%",height:"100%"},ite={x:0,y:0};function q0(e){return e}var i7e=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},s7e=function(t,n,r,i){var a=n.find(function(d){return d&&d.index===r});if(a){if(t==="horizontal")return{x:a.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:a.coordinate};if(t==="centric"){var o=a.coordinate,l=i.radius;return se(se(se({},i),mn(i.cx,i.cy,l,o)),{},{angle:o,radius:l})}var c=a.coordinate,u=i.angle;return se(se(se({},i),mn(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return ite},lk=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,a=n.dataEndIndex,o=(r??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(Sm(l),Sm(u)):l},[]);return o.length>0?o:t&&t.length&&ge(i)&&ge(a)?t.slice(i,a+1):[]};function ste(e){return e==="number"?[0,"auto"]:void 0}var B2=function(t,n,r,i){var a=t.graphicalItems,o=t.tooltipAxis,l=lk(n,t);return r<0||!a||!a.length||r>=l.length?null:a.reduce(function(c,u){var d,h=(d=u.props.data)!==null&&d!==void 0?d:n;h&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(h=h.slice(t.dataStartIndex,t.dataEndIndex+1));var f;if(o.dataKey&&!o.allowDuplicatedCategory){var p=h===void 0?l:h;f=Bj(p,o.dataKey,i)}else f=h&&h[r]||l[r];return f?[].concat(Sm(c),[BJ(u,f)]):c},[])},j8=function(t,n,r,i){var a=i||{x:t.chartX,y:t.chartY},o=i7e(a,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=g6e(o,l,u,c);if(d>=0&&u){var h=u[d]&&u[d].value,f=B2(t,n,d,h),p=s7e(r,l,d,a);return{activeTooltipIndex:d,activeLabel:h,activePayload:f,activeCoordinate:p}}return null},a7e=function(t,n){var r=n.axes,i=n.graphicalItems,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,h=t.children,f=t.stackOffset,p=DJ(d,a);return r.reduce(function(m,g){var y,b=g.type.defaultProps!==void 0?se(se({},g.type.defaultProps),g.props):g.props,v=b.type,w=b.dataKey,_=b.allowDataOverflow,j=b.allowDuplicatedCategory,S=b.scale,k=b.ticks,N=b.includeHidden,T=b[o];if(m[T])return m;var C=lk(t.data,{graphicalItems:i.filter(function(D){var E,q=o in D.props?D.props[o]:(E=D.type.defaultProps)===null||E===void 0?void 0:E[o];return q===T}),dataStartIndex:c,dataEndIndex:u}),A=C.length,O,z,$;OKe(b.domain,_,v)&&(O=e2(b.domain,null,_),p&&(v==="number"||S!=="auto")&&($=Xy(C,w,"category")));var F=ste(v);if(!O||O.length===0){var B,P=(B=b.domain)!==null&&B!==void 0?B:F;if(w){if(O=Xy(C,w,v),v==="category"&&p){var I=aEe(O);j&&I?(z=O,O=A1(0,A)):j||(O=V6(P,O,g).reduce(function(D,E){return D.indexOf(E)>=0?D:[].concat(Sm(D),[E])},[]))}else if(v==="category")j?O=O.filter(function(D){return D!==""&&!dt(D)}):O=V6(P,O,g).reduce(function(D,E){return D.indexOf(E)>=0||E===""||dt(E)?D:[].concat(Sm(D),[E])},[]);else if(v==="number"){var M=w6e(C,i.filter(function(D){var E,q,X=o in D.props?D.props[o]:(E=D.type.defaultProps)===null||E===void 0?void 0:E[o],re="hide"in D.props?D.props.hide:(q=D.type.defaultProps)===null||q===void 0?void 0:q.hide;return X===T&&(N||!re)}),w,a,d);M&&(O=M)}p&&(v==="number"||S!=="auto")&&($=Xy(C,w,"category"))}else p?O=A1(0,A):l&&l[T]&&l[T].hasStack&&v==="number"?O=f==="expand"?[0,1]:zJ(l[T].stackGroups,c,u):O=RJ(C,i.filter(function(D){var E=o in D.props?D.props[o]:D.type.defaultProps[o],q="hide"in D.props?D.props.hide:D.type.defaultProps.hide;return E===T&&(N||!q)}),v,d,!0);if(v==="number")O=L2(h,O,T,a,k),P&&(O=e2(P,O,_));else if(v==="category"&&P){var R=P,K=O.every(function(D){return R.indexOf(D)>=0});K&&(O=R)}}return se(se({},m),{},Je({},T,se(se({},b),{},{axisType:a,domain:O,categoricalDomain:$,duplicateDomain:z,originalDomain:(y=b.domain)!==null&&y!==void 0?y:F,isCategorical:p,layout:d})))},{})},o7e=function(t,n){var r=n.graphicalItems,i=n.Axis,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,h=t.children,f=lk(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),p=f.length,m=DJ(d,a),g=-1;return r.reduce(function(y,b){var v=b.type.defaultProps!==void 0?se(se({},b.type.defaultProps),b.props):b.props,w=v[o],_=ste("number");if(!y[w]){g++;var j;return m?j=A1(0,p):l&&l[w]&&l[w].hasStack?(j=zJ(l[w].stackGroups,c,u),j=L2(h,j,w,a)):(j=e2(_,RJ(f,r.filter(function(S){var k,N,T=o in S.props?S.props[o]:(k=S.type.defaultProps)===null||k===void 0?void 0:k[o],C="hide"in S.props?S.props.hide:(N=S.type.defaultProps)===null||N===void 0?void 0:N.hide;return T===w&&!C}),"number",d),i.defaultProps.allowDataOverflow),j=L2(h,j,w,a)),se(se({},y),{},Je({},w,se(se({axisType:a},i.defaultProps),{},{hide:!0,orientation:zs(n7e,"".concat(a,".").concat(g%2),null),domain:j,originalDomain:_,isCategorical:m,layout:d})))}return y},{})},l7e=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,a=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,h="".concat(i,"Id"),f=Bs(d,a),p={};return f&&f.length?p=a7e(t,{axes:f,graphicalItems:o,axisType:i,axisIdKey:h,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(p=o7e(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:h,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},c7e=function(t){var n=Dc(t),r=Ol(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:pD(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:g1(n,r)}},_8=function(t){var n=t.children,r=t.defaultShowTooltip,i=Os(n,hm),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},u7e=function(t){return!t||!t.length?!1:t.some(function(n){var r=Dl(n&&n.type);return r&&r.indexOf("Bar")>=0})},S8=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"}},d7e=function(t,n){var r=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,h=r.children,f=r.margin||{},p=Os(h,hm),m=Os(h,uu),g=Object.keys(c).reduce(function(j,S){var k=c[S],N=k.orientation;return!k.mirror&&!k.hide?se(se({},j),{},Je({},N,j[N]+k.width)):j},{left:f.left||0,right:f.right||0}),y=Object.keys(o).reduce(function(j,S){var k=o[S],N=k.orientation;return!k.mirror&&!k.hide?se(se({},j),{},Je({},N,zs(j,"".concat(N))+k.height)):j},{top:f.top||0,bottom:f.bottom||0}),b=se(se({},y),g),v=b.bottom;p&&(b.bottom+=p.props.height||hm.defaultProps.height),m&&n&&(b=x6e(b,i,r,n));var w=u-b.left-b.right,_=d-b.top-b.bottom;return se(se({brushBottom:v},b),{},{width:Math.max(w,0),height:Math.max(_,0)})},h7e=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},ck=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,h=t.defaultProps,f=function(b,v){var w=v.graphicalItems,_=v.stackGroups,j=v.offset,S=v.updateId,k=v.dataStartIndex,N=v.dataEndIndex,T=b.barSize,C=b.layout,A=b.barGap,O=b.barCategoryGap,z=b.maxBarSize,$=S8(C),F=$.numericAxisName,B=$.cateAxisName,P=u7e(w),I=[];return w.forEach(function(M,R){var K=lk(b.data,{graphicalItems:[M],dataStartIndex:k,dataEndIndex:N}),D=M.type.defaultProps!==void 0?se(se({},M.type.defaultProps),M.props):M.props,E=D.dataKey,q=D.maxBarSize,X=D["".concat(F,"Id")],re=D["".concat(B,"Id")],Y={},le=c.reduce(function(Q,te){var ve=v["".concat(te.axisType,"Map")],we=D["".concat(te.axisType,"Id")];ve&&ve[we]||te.axisType==="zAxis"||wh();var G=ve[we];return se(se({},Q),{},Je(Je({},te.axisType,G),"".concat(te.axisType,"Ticks"),Ol(G)))},Y),Z=le[B],de=le["".concat(B,"Ticks")],pe=_&&_[X]&&_[X].hasStack&&E6e(M,_[X].stackGroups),J=Dl(M.type).indexOf("Bar")>=0,be=g1(Z,de),ee=[],Ce=P&&y6e({barSize:T,stackGroups:_,totalSize:h7e(le,B)});if(J){var Re,Ze,Ee=dt(q)?z:q,kt=(Re=(Ze=g1(Z,de,!0))!==null&&Ze!==void 0?Ze:Ee)!==null&&Re!==void 0?Re:0;ee=v6e({barGap:A,barCategoryGap:O,bandSize:kt!==be?kt:be,sizeList:Ce[re],maxBarSize:Ee}),kt!==be&&(ee=ee.map(function(Q){return se(se({},Q),{},{position:se(se({},Q.position),{},{offset:Q.position.offset-kt/2})})}))}var V=M&&M.type&&M.type.getComposedData;V&&I.push({props:se(se({},V(se(se({},le),{},{displayedData:K,props:b,dataKey:E,item:M,bandSize:be,barPosition:ee,offset:j,stackedData:pe,layout:C,dataStartIndex:k,dataEndIndex:N}))),{},Je(Je(Je({key:M.key||"item-".concat(R)},F,le[F]),B,le[B]),"animationId",S)),childIndex:vEe(M,b.children),item:M})}),I},p=function(b,v){var w=b.props,_=b.dataStartIndex,j=b.dataEndIndex,S=b.updateId;if(!M5({props:w}))return null;var k=w.children,N=w.layout,T=w.stackOffset,C=w.data,A=w.reverseStackOrder,O=S8(N),z=O.numericAxisName,$=O.cateAxisName,F=Bs(k,r),B=A6e(C,F,"".concat(z,"Id"),"".concat($,"Id"),T,A),P=c.reduce(function(D,E){var q="".concat(E.axisType,"Map");return se(se({},D),{},Je({},q,l7e(w,se(se({},E),{},{graphicalItems:F,stackGroups:E.axisType===z&&B,dataStartIndex:_,dataEndIndex:j}))))},{}),I=d7e(se(se({},P),{},{props:w,graphicalItems:F}),v==null?void 0:v.legendBBox);Object.keys(P).forEach(function(D){P[D]=d(w,P[D],I,D.replace("Map",""),n)});var M=P["".concat($,"Map")],R=c7e(M),K=f(w,se(se({},P),{},{dataStartIndex:_,dataEndIndex:j,updateId:S,graphicalItems:F,stackGroups:B,offset:I}));return se(se({formattedGraphicalItems:K,graphicalItems:F,offset:I,stackGroups:B},R),P)},m=function(y){function b(v){var w,_,j;return qKe(this,b),j=GKe(this,b,[v]),Je(j,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Je(j,"accessibilityManager",new PKe),Je(j,"handleLegendBBoxUpdate",function(S){if(S){var k=j.state,N=k.dataStartIndex,T=k.dataEndIndex,C=k.updateId;j.setState(se({legendBBox:S},p({props:j.props,dataStartIndex:N,dataEndIndex:T,updateId:C},se(se({},j.state),{},{legendBBox:S}))))}}),Je(j,"handleReceiveSyncEvent",function(S,k,N){if(j.props.syncId===S){if(N===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(k)}}),Je(j,"handleBrushChange",function(S){var k=S.startIndex,N=S.endIndex;if(k!==j.state.dataStartIndex||N!==j.state.dataEndIndex){var T=j.state.updateId;j.setState(function(){return se({dataStartIndex:k,dataEndIndex:N},p({props:j.props,dataStartIndex:k,dataEndIndex:N,updateId:T},j.state))}),j.triggerSyncEvent({dataStartIndex:k,dataEndIndex:N})}}),Je(j,"handleMouseEnter",function(S){var k=j.getMouseInfo(S);if(k){var N=se(se({},k),{},{isTooltipActive:!0});j.setState(N),j.triggerSyncEvent(N);var T=j.props.onMouseEnter;tt(T)&&T(N,S)}}),Je(j,"triggeredAfterMouseMove",function(S){var k=j.getMouseInfo(S),N=k?se(se({},k),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(N),j.triggerSyncEvent(N);var T=j.props.onMouseMove;tt(T)&&T(N,S)}),Je(j,"handleItemMouseEnter",function(S){j.setState(function(){return{isTooltipActive:!0,activeItem:S,activePayload:S.tooltipPayload,activeCoordinate:S.tooltipPosition||{x:S.cx,y:S.cy}}})}),Je(j,"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),Je(j,"handleMouseMove",function(S){S.persist(),j.throttleTriggeredAfterMouseMove(S)}),Je(j,"handleMouseLeave",function(S){j.throttleTriggeredAfterMouseMove.cancel();var k={isTooltipActive:!1};j.setState(k),j.triggerSyncEvent(k);var N=j.props.onMouseLeave;tt(N)&&N(k,S)}),Je(j,"handleOuterEvent",function(S){var k=yEe(S),N=zs(j.props,"".concat(k));if(k&&tt(N)){var T,C;/.*touch.*/i.test(k)?C=j.getMouseInfo(S.changedTouches[0]):C=j.getMouseInfo(S),N((T=C)!==null&&T!==void 0?T:{},S)}}),Je(j,"handleClick",function(S){var k=j.getMouseInfo(S);if(k){var N=se(se({},k),{},{isTooltipActive:!0});j.setState(N),j.triggerSyncEvent(N);var T=j.props.onClick;tt(T)&&T(N,S)}}),Je(j,"handleMouseDown",function(S){var k=j.props.onMouseDown;if(tt(k)){var N=j.getMouseInfo(S);k(N,S)}}),Je(j,"handleMouseUp",function(S){var k=j.props.onMouseUp;if(tt(k)){var N=j.getMouseInfo(S);k(N,S)}}),Je(j,"handleTouchMove",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(S.changedTouches[0])}),Je(j,"handleTouchStart",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&j.handleMouseDown(S.changedTouches[0])}),Je(j,"handleTouchEnd",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&j.handleMouseUp(S.changedTouches[0])}),Je(j,"handleDoubleClick",function(S){var k=j.props.onDoubleClick;if(tt(k)){var N=j.getMouseInfo(S);k(N,S)}}),Je(j,"handleContextMenu",function(S){var k=j.props.onContextMenu;if(tt(k)){var N=j.getMouseInfo(S);k(N,S)}}),Je(j,"triggerSyncEvent",function(S){j.props.syncId!==void 0&&BC.emit(VC,j.props.syncId,S,j.eventEmitterSymbol)}),Je(j,"applySyncEvent",function(S){var k=j.props,N=k.layout,T=k.syncMethod,C=j.state.updateId,A=S.dataStartIndex,O=S.dataEndIndex;if(S.dataStartIndex!==void 0||S.dataEndIndex!==void 0)j.setState(se({dataStartIndex:A,dataEndIndex:O},p({props:j.props,dataStartIndex:A,dataEndIndex:O,updateId:C},j.state)));else if(S.activeTooltipIndex!==void 0){var z=S.chartX,$=S.chartY,F=S.activeTooltipIndex,B=j.state,P=B.offset,I=B.tooltipTicks;if(!P)return;if(typeof T=="function")F=T(I,S);else if(T==="value"){F=-1;for(var M=0;M<I.length;M++)if(I[M].value===S.activeLabel){F=M;break}}var R=se(se({},P),{},{x:P.left,y:P.top}),K=Math.min(z,R.x+R.width),D=Math.min($,R.y+R.height),E=I[F]&&I[F].value,q=B2(j.state,j.props.data,F),X=I[F]?{x:N==="horizontal"?I[F].coordinate:K,y:N==="horizontal"?D:I[F].coordinate}:ite;j.setState(se(se({},S),{},{activeLabel:E,activeCoordinate:X,activePayload:q,activeTooltipIndex:F}))}else j.setState(S)}),Je(j,"renderCursor",function(S){var k,N=j.state,T=N.isTooltipActive,C=N.activeCoordinate,A=N.activePayload,O=N.offset,z=N.activeTooltipIndex,$=N.tooltipAxisBandSize,F=j.getTooltipEventType(),B=(k=S.props.active)!==null&&k!==void 0?k:T,P=j.props.layout,I=S.key||"_recharts-cursor";return L.createElement(LKe,{key:I,activeCoordinate:C,activePayload:A,activeTooltipIndex:z,chartName:n,element:S,isActive:B,layout:P,offset:O,tooltipAxisBandSize:$,tooltipEventType:F})}),Je(j,"renderPolarAxis",function(S,k,N){var T=zs(S,"type.axisType"),C=zs(j.state,"".concat(T,"Map")),A=S.type.defaultProps,O=A!==void 0?se(se({},A),S.props):S.props,z=C&&C[O["".concat(T,"Id")]];return x.cloneElement(S,se(se({},z),{},{className:mt(T,z.className),key:S.key||"".concat(k,"-").concat(N),ticks:Ol(z,!0)}))}),Je(j,"renderPolarGrid",function(S){var k=S.props,N=k.radialLines,T=k.polarAngles,C=k.polarRadius,A=j.state,O=A.radiusAxisMap,z=A.angleAxisMap,$=Dc(O),F=Dc(z),B=F.cx,P=F.cy,I=F.innerRadius,M=F.outerRadius;return x.cloneElement(S,{polarAngles:Array.isArray(T)?T:Ol(F,!0).map(function(R){return R.coordinate}),polarRadius:Array.isArray(C)?C:Ol($,!0).map(function(R){return R.coordinate}),cx:B,cy:P,innerRadius:I,outerRadius:M,key:S.key||"polar-grid",radialLines:N})}),Je(j,"renderLegend",function(){var S=j.state.formattedGraphicalItems,k=j.props,N=k.children,T=k.width,C=k.height,A=j.props.margin||{},O=T-(A.left||0)-(A.right||0),z=OJ({children:N,formattedGraphicalItems:S,legendWidth:O,legendContent:u});if(!z)return null;var $=z.item,F=b8(z,FKe);return x.cloneElement($,se(se({},F),{},{chartWidth:T,chartHeight:C,margin:A,onBBoxUpdate:j.handleLegendBBoxUpdate}))}),Je(j,"renderTooltip",function(){var S,k=j.props,N=k.children,T=k.accessibilityLayer,C=Os(N,ts);if(!C)return null;var A=j.state,O=A.isTooltipActive,z=A.activeCoordinate,$=A.activePayload,F=A.activeLabel,B=A.offset,P=(S=C.props.active)!==null&&S!==void 0?S:O;return x.cloneElement(C,{viewBox:se(se({},B),{},{x:B.left,y:B.top}),active:P,label:F,payload:P?$:[],coordinate:z,accessibilityLayer:T})}),Je(j,"renderBrush",function(S){var k=j.props,N=k.margin,T=k.data,C=j.state,A=C.offset,O=C.dataStartIndex,z=C.dataEndIndex,$=C.updateId;return x.cloneElement(S,{key:S.key||"_recharts-brush",onChange:z0(j.handleBrushChange,S.props.onChange),data:T,x:ge(S.props.x)?S.props.x:A.left,y:ge(S.props.y)?S.props.y:A.top+A.height+A.brushBottom-(N.bottom||0),width:ge(S.props.width)?S.props.width:A.width,startIndex:O,endIndex:z,updateId:"brush-".concat($)})}),Je(j,"renderReferenceElement",function(S,k,N){if(!S)return null;var T=j,C=T.clipPathId,A=j.state,O=A.xAxisMap,z=A.yAxisMap,$=A.offset,F=S.type.defaultProps||{},B=S.props,P=B.xAxisId,I=P===void 0?F.xAxisId:P,M=B.yAxisId,R=M===void 0?F.yAxisId:M;return x.cloneElement(S,{key:S.key||"".concat(k,"-").concat(N),xAxis:O[I],yAxis:z[R],viewBox:{x:$.left,y:$.top,width:$.width,height:$.height},clipPathId:C})}),Je(j,"renderActivePoints",function(S){var k=S.item,N=S.activePoint,T=S.basePoint,C=S.childIndex,A=S.isRange,O=[],z=k.props.key,$=k.item.type.defaultProps!==void 0?se(se({},k.item.type.defaultProps),k.item.props):k.item.props,F=$.activeDot,B=$.dataKey,P=se(se({index:C,dataKey:B,cx:N.x,cy:N.y,r:4,fill:zD(k.item),strokeWidth:2,stroke:"#fff",payload:N.payload,value:N.value},He(F,!1)),Vj(F));return O.push(b.renderActiveDot(F,P,"".concat(z,"-activePoint-").concat(C))),T?O.push(b.renderActiveDot(F,se(se({},P),{},{cx:T.x,cy:T.y}),"".concat(z,"-basePoint-").concat(C))):A&&O.push(null),O}),Je(j,"renderGraphicChild",function(S,k,N){var T=j.filterFormatItem(S,k,N);if(!T)return null;var C=j.getTooltipEventType(),A=j.state,O=A.isTooltipActive,z=A.tooltipAxis,$=A.activeTooltipIndex,F=A.activeLabel,B=j.props.children,P=Os(B,ts),I=T.props,M=I.points,R=I.isRange,K=I.baseLine,D=T.item.type.defaultProps!==void 0?se(se({},T.item.type.defaultProps),T.item.props):T.item.props,E=D.activeDot,q=D.hide,X=D.activeBar,re=D.activeShape,Y=!!(!q&&O&&P&&(E||X||re)),le={};C!=="axis"&&P&&P.props.trigger==="click"?le={onClick:z0(j.handleItemMouseEnter,S.props.onClick)}:C!=="axis"&&(le={onMouseLeave:z0(j.handleItemMouseLeave,S.props.onMouseLeave),onMouseEnter:z0(j.handleItemMouseEnter,S.props.onMouseEnter)});var Z=x.cloneElement(S,se(se({},T.props),le));function de(te){return typeof z.dataKey=="function"?z.dataKey(te.payload):null}if(Y)if($>=0){var pe,J;if(z.dataKey&&!z.allowDuplicatedCategory){var be=typeof z.dataKey=="function"?de:"payload.".concat(z.dataKey.toString());pe=Bj(M,be,F),J=R&&K&&Bj(K,be,F)}else pe=M==null?void 0:M[$],J=R&&K&&K[$];if(re||X){var ee=S.props.activeIndex!==void 0?S.props.activeIndex:$;return[x.cloneElement(S,se(se(se({},T.props),le),{},{activeIndex:ee})),null,null]}if(!dt(pe))return[Z].concat(Sm(j.renderActivePoints({item:T,activePoint:pe,basePoint:J,childIndex:$,isRange:R})))}else{var Ce,Re=(Ce=j.getItemByXY(j.state.activeCoordinate))!==null&&Ce!==void 0?Ce:{graphicalItem:Z},Ze=Re.graphicalItem,Ee=Ze.item,kt=Ee===void 0?S:Ee,V=Ze.childIndex,Q=se(se(se({},T.props),le),{},{activeIndex:V});return[x.cloneElement(kt,Q),null,null]}return R?[Z,null,null]:[Z,null]}),Je(j,"renderCustomized",function(S,k,N){return x.cloneElement(S,se(se({key:"recharts-customized-".concat(N)},j.props),j.state))}),Je(j,"renderMap",{CartesianGrid:{handler:q0,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:q0},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:q0},YAxis:{handler:q0},Brush:{handler:j.renderBrush,once:!0},Bar:{handler:j.renderGraphicChild},Line:{handler:j.renderGraphicChild},Area:{handler:j.renderGraphicChild},Radar:{handler:j.renderGraphicChild},RadialBar:{handler:j.renderGraphicChild},Scatter:{handler:j.renderGraphicChild},Pie:{handler:j.renderGraphicChild},Funnel:{handler:j.renderGraphicChild},Tooltip:{handler:j.renderCursor,once:!0},PolarGrid:{handler:j.renderPolarGrid,once:!0},PolarAngleAxis:{handler:j.renderPolarAxis},PolarRadiusAxis:{handler:j.renderPolarAxis},Customized:{handler:j.renderCustomized}}),j.clipPathId="".concat((w=v.id)!==null&&w!==void 0?w:Mh("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=PZ(j.triggeredAfterMouseMove,(_=v.throttleDelay)!==null&&_!==void 0?_:1e3/60),j.state={},j}return XKe(b,y),KKe(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,j=w.data,S=w.height,k=w.layout,N=Os(_,ts);if(N){var T=N.props.defaultIndex;if(!(typeof T!="number"||T<0||T>this.state.tooltipTicks.length-1)){var C=this.state.tooltipTicks[T]&&this.state.tooltipTicks[T].value,A=B2(this.state,j,T,C),O=this.state.tooltipTicks[T].coordinate,z=(this.state.offset.top+S)/2,$=k==="horizontal",F=$?{x:O,y:z}:{y:O,x:z},B=this.state.formattedGraphicalItems.find(function(I){var M=I.item;return M.type.name==="Scatter"});B&&(F=se(se({},F),B.props.points[T].tooltipPosition),A=B.props.points[T].tooltipPayload);var P={activeTooltipIndex:T,isTooltipActive:!0,activeLabel:C,activePayload:A,activeCoordinate:F};this.setState(P),this.renderCursor(N),this.accessibilityManager.setIndex(T)}}}},{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 j,S;this.accessibilityManager.setDetails({offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0}})}return null}},{key:"componentDidUpdate",value:function(w){mP([Os(w.children,ts)],[Os(this.props.children,ts)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=Os(this.props.children,ts);if(w&&typeof w.props.shared=="boolean"){var _=w.props.shared?"axis":"item";return l.indexOf(_)>=0?_:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var _=this.container,j=_.getBoundingClientRect(),S=U4e(j),k={chartX:Math.round(w.pageX-S.left),chartY:Math.round(w.pageY-S.top)},N=j.width/_.offsetWidth||1,T=this.inRange(k.chartX,k.chartY,N);if(!T)return null;var C=this.state,A=C.xAxisMap,O=C.yAxisMap,z=this.getTooltipEventType(),$=j8(this.state,this.props.data,this.props.layout,T);if(z!=="axis"&&A&&O){var F=Dc(A).scale,B=Dc(O).scale,P=F&&F.invert?F.invert(k.chartX):null,I=B&&B.invert?B.invert(k.chartY):null;return se(se({},k),{},{xValue:P,yValue:I},$)}return $?se(se({},k),$):null}},{key:"inRange",value:function(w,_){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,S=this.props.layout,k=w/j,N=_/j;if(S==="horizontal"||S==="vertical"){var T=this.state.offset,C=k>=T.left&&k<=T.left+T.width&&N>=T.top&&N<=T.top+T.height;return C?{x:k,y:N}:null}var A=this.state,O=A.angleAxisMap,z=A.radiusAxisMap;if(O&&z){var $=Dc(O);return q6({x:k,y:N},$)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,_=this.getTooltipEventType(),j=Os(w,ts),S={};j&&_==="axis"&&(j.props.trigger==="click"?S={onClick:this.handleClick}:S={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 k=Vj(this.props,this.handleOuterEvent);return se(se({},k),S)}},{key:"addListener",value:function(){BC.on(VC,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){BC.removeListener(VC,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,_,j){for(var S=this.state.formattedGraphicalItems,k=0,N=S.length;k<N;k++){var T=S[k];if(T.item===w||T.props.key===w.key||_===Dl(T.item.type)&&j===T.childIndex)return T}return null}},{key:"renderClipPath",value:function(){var w=this.clipPathId,_=this.state.offset,j=_.left,S=_.top,k=_.height,N=_.width;return L.createElement("defs",null,L.createElement("clipPath",{id:w},L.createElement("rect",{x:j,y:S,height:k,width:N})))}},{key:"getXScales",value:function(){var w=this.state.xAxisMap;return w?Object.entries(w).reduce(function(_,j){var S=x8(j,2),k=S[0],N=S[1];return se(se({},_),{},Je({},k,N.scale))},{}):null}},{key:"getYScales",value:function(){var w=this.state.yAxisMap;return w?Object.entries(w).reduce(function(_,j){var S=x8(j,2),k=S[0],N=S[1];return se(se({},_),{},Je({},k,N.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,j=_.formattedGraphicalItems,S=_.activeItem;if(j&&j.length)for(var k=0,N=j.length;k<N;k++){var T=j[k],C=T.props,A=T.item,O=A.type.defaultProps!==void 0?se(se({},A.type.defaultProps),A.props):A.props,z=Dl(A.type);if(z==="Bar"){var $=(C.data||[]).find(function(I){return NVe(w,I)});if($)return{graphicalItem:T,payload:$}}else if(z==="RadialBar"){var F=(C.data||[]).find(function(I){return q6(w,I)});if(F)return{graphicalItem:T,payload:F}}else if(tk(T,S)||nk(T,S)||Tx(T,S)){var B=pUe({graphicalItem:T,activeTooltipItem:S,itemData:O.data}),P=O.activeIndex===void 0?B:O.activeIndex;return{graphicalItem:se(se({},T),{},{childIndex:P}),payload:Tx(T,S)?O.data[B]:T.props.data[B]}}}return null}},{key:"render",value:function(){var w=this;if(!M5(this))return null;var _=this.props,j=_.children,S=_.className,k=_.width,N=_.height,T=_.style,C=_.compact,A=_.title,O=_.desc,z=b8(_,zKe),$=He(z,!1);if(C)return L.createElement(JB,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},L.createElement(yP,Zf({},$,{width:k,height:N,title:A,desc:O}),this.renderClipPath(),L5(j,this.renderMap)));if(this.props.accessibilityLayer){var F,B;$.tabIndex=(F=this.props.tabIndex)!==null&&F!==void 0?F:0,$.role=(B=this.props.role)!==null&&B!==void 0?B:"application",$.onKeyDown=function(I){w.accessibilityManager.keyboardEvent(I)},$.onFocus=function(){w.accessibilityManager.focus()}}var P=this.parseEventsOfWrapper();return L.createElement(JB,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},L.createElement("div",Zf({className:mt("recharts-wrapper",S),style:se({position:"relative",cursor:"default",width:k,height:N},T)},P,{ref:function(M){w.container=M}}),L.createElement(yP,Zf({},$,{width:k,height:N,title:A,desc:O,style:r7e}),this.renderClipPath(),L5(j,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(x.Component);Je(m,"displayName",n),Je(m,"defaultProps",se({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},h)),Je(m,"getDerivedStateFromProps",function(y,b){var v=y.dataKey,w=y.data,_=y.children,j=y.width,S=y.height,k=y.layout,N=y.stackOffset,T=y.margin,C=b.dataStartIndex,A=b.dataEndIndex;if(b.updateId===void 0){var O=_8(y);return se(se(se({},O),{},{updateId:0},p(se(se({props:y},O),{},{updateId:0}),b)),{},{prevDataKey:v,prevData:w,prevWidth:j,prevHeight:S,prevLayout:k,prevStackOffset:N,prevMargin:T,prevChildren:_})}if(v!==b.prevDataKey||w!==b.prevData||j!==b.prevWidth||S!==b.prevHeight||k!==b.prevLayout||N!==b.prevStackOffset||!fp(T,b.prevMargin)){var z=_8(y),$={chartX:b.chartX,chartY:b.chartY,isTooltipActive:b.isTooltipActive},F=se(se({},j8(b,w,k)),{},{updateId:b.updateId+1}),B=se(se(se({},z),$),F);return se(se(se({},B),p(se({props:y},B),b)),{},{prevDataKey:v,prevData:w,prevWidth:j,prevHeight:S,prevLayout:k,prevStackOffset:N,prevMargin:T,prevChildren:_})}if(!mP(_,b.prevChildren)){var P,I,M,R,K=Os(_,hm),D=K&&(P=(I=K.props)===null||I===void 0?void 0:I.startIndex)!==null&&P!==void 0?P:C,E=K&&(M=(R=K.props)===null||R===void 0?void 0:R.endIndex)!==null&&M!==void 0?M:A,q=D!==C||E!==A,X=!dt(w),re=X&&!q?b.updateId:b.updateId+1;return se(se({updateId:re},p(se(se({props:y},b),{},{updateId:re,dataStartIndex:D,dataEndIndex:E}),b)),{},{prevChildren:_,dataStartIndex:D,dataEndIndex:E})}return null}),Je(m,"renderActiveDot",function(y,b,v){var w;return x.isValidElement(y)?w=x.cloneElement(y,b):tt(y)?w=y(b):w=L.createElement(Nb,b),L.createElement(Ct,{className:"recharts-active-dot",ke
793y:v},w)});var g=x.forwardRef(function(b,v){return L.createElement(m,Zf({},b,{ref:v}))});return g.displayName=m.displayName,g},f7e=ck({chartName:"LineChart",GraphicalChild:xm,axisComponents:[{axisType:"xAxis",AxisComp:lc},{axisType:"yAxis",AxisComp:cc}],formatAxisMap:VD}),ate=ck({chartName:"BarChart",GraphicalChild:Vu,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:lc},{axisType:"yAxis",AxisComp:cc}],formatAxisMap:VD}),p7e=ck({chartName:"PieChart",GraphicalChild:oc,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:ek},{axisType:"radiusAxis",AxisComp:ZS}],formatAxisMap:z6e,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),m7e=ck({chartName:"AreaChart",GraphicalChild:Wu,axisComponents:[{axisType:"xAxis",AxisComp:lc},{axisType:"yAxis",AxisComp:cc}],formatAxisMap:VD});function jl(e){const t=Math.abs(e),n=e<0?"-":"";return t>=1e9?`${n}$${(t/1e9).toFixed(1)}B`:t>=1e6?`${n}$${(t/1e6).toFixed(0)}M`:t>=1e3?`${n}$${(t/1e3).toFixed(0)}K`:`${n}$${t.toFixed(0)}`}function g7e({active:e,payload:t,totalIterations:n}){if(!e||!(t!=null&&t.length))return null;const r=t[0].payload,i=n>0?r.count/n*100:0;return s.jsxs("div",{className:"rounded-md border bg-popover px-3 py-2 text-sm text-popover-foreground shadow-md",style:{borderColor:"hsl(var(--c-border))",minWidth:200},children:[s.jsxs("div",{className:"font-medium mb-1.5 text-foreground",children:[jl(r.bucketMin)," – ",jl(r.bucketMax)]}),s.jsx("div",{className:"grid gap-1 text-xs",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{style:{width:8,height:8,borderRadius:2,background:r.inP10P90?"hsl(var(--c-accent))":"hsl(var(--c-accent-border))",opacity:r.inP10P90?.85:.55,flexShrink:0}}),s.jsxs("span",{className:"text-muted-foreground",children:[r.count.toLocaleString()," samples · ",i.toFixed(1),"% of run"]})]})}),s.jsx("div",{className:"mt-1.5 pt-1.5 border-t border-border/60 text-xs text-muted-foreground",children:r.inP10P90?"Inside P10–P90 (central 80%)":"Tail · outside P10–P90"})]})}function y7e({data:e}){const t=e.histogram.map(n=>{const r=(n.bucket_min+n.bucket_max)/2;return{center:r,label:jl(r),count:n.count,bucketMin:n.bucket_min,bucketMax:n.bucket_max,inP10P90:r>=e.p10&&r<=e.p90}});return s.jsxs(Be,{children:[s.jsxs(ht,{children:[s.jsxs(ft,{className:"flex items-center justify-between",children:[s.jsx("span",{children:"Monte Carlo Distribution"}),s.jsxs("span",{className:"text-sm font-normal text-muted-foreground",children:[e.iterations.toLocaleString()," iterations"]})]}),s.jsx(Mr,{children:"Distribution of rNPV outcomes across probabilistic scenarios. Markers show P10, P50 (median), and P90."})]}),s.jsxs(pt,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4 mb-4",children:[s.jsx(H0,{label:"P10",value:jl(e.p10),tone:"muted"}),s.jsx(H0,{label:"P50 (median)",value:jl(e.p50),tone:"primary"}),s.jsx(H0,{label:"P90",value:jl(e.p90),tone:"muted"}),s.jsx(H0,{label:"P(NPV > 0)",value:`${(e.prob_positive*100).toFixed(0)}%`,tone:"muted"})]}),s.jsx("div",{className:"h-64 w-full",children:s.jsx(bb,{width:"100%",height:"100%",children:s.jsxs(ate,{data:t,margin:{top:10,right:10,left:0,bottom:20},children:[s.jsx(Cb,{strokeDasharray:"3 3",className:"stroke-border"}),s.jsx(lc,{dataKey:"center",tickFormatter:jl,tick:{fontSize:11},stroke:"currentColor",className:"text-muted-foreground"}),s.jsx(cc,{tick:{fontSize:11},stroke:"currentColor",className:"text-muted-foreground"}),s.jsx(ts,{content:s.jsx(g7e,{totalIterations:e.iterations}),cursor:{fill:"hsl(var(--c-surface-2))",opacity:.5}}),s.jsx(gp,{x:e.p10,stroke:"hsl(var(--c-fg-subtle))",strokeDasharray:"3 3",label:{value:"P10",position:"top",fontSize:10,fill:"hsl(var(--c-fg-muted))"}}),s.jsx(gp,{x:e.p50,stroke:"hsl(var(--c-accent))",strokeWidth:1.5,strokeDasharray:"3 3",label:{value:"P50",position:"top",fontSize:10,fill:"hsl(var(--c-accent))",fontWeight:600}}),s.jsx(gp,{x:e.p90,stroke:"hsl(var(--c-fg-subtle))",strokeDasharray:"3 3",label:{value:"P90",position:"top",fontSize:10,fill:"hsl(var(--c-fg-muted))"}}),s.jsx(Vu,{dataKey:"count",radius:[3,3,0,0],children:t.map((n,r)=>s.jsx(xg,{fill:n.inP10P90?"hsl(var(--c-accent))":"hsl(var(--c-accent-border))",fillOpacity:n.inP10P90?.85:.4},`cell-${r}`))})]})})}),s.jsxs("div",{className:"mt-4 flex items-center justify-between text-xs text-muted-foreground",children:[s.jsxs("span",{children:["Mean: ",jl(e.mean)]}),s.jsxs("span",{children:["Std dev: ",jl(e.std_dev)]})]})]})]})}function H0({label:e,value:t,tone:n}){const r=n==="primary";return s.jsxs("div",{className:"rounded-md border p-3",style:{background:r?"hsl(var(--c-accent-soft))":"hsl(var(--c-surface))",borderColor:r?"hsl(var(--c-accent-border))":"hsl(var(--c-border))"},children:[s.jsx("div",{className:"text-[11px] uppercase tracking-wide",style:{color:r?"hsl(var(--c-accent))":"hsl(var(--c-fg-subtle))",fontFamily:"var(--font-mono)",letterSpacing:"0.06em"},children:e}),s.jsx("div",{className:"mt-1 text-lg font-semibold",style:{color:r?"hsl(var(--c-accent))":"hsl(var(--c-ink))",fontFamily:"var(--font-display)"},children:t})]})}function ed(e){const t=Math.abs(e),n=e<0?"-":"";return t>=1e9?`${n}$${(t/1e9).toFixed(1)}B`:t>=1e6?`${n}$${(t/1e6).toFixed(0)}M`:t>=1e3?`${n}$${(t/1e3).toFixed(0)}K`:`${n}$${t.toFixed(0)}`}function v7e({bars:e,baseNPV:t}){if(e.length===0)return s.jsx(Be,{children:s.jsxs(ht,{children:[s.jsx(ft,{children:"Sensitivity Analysis"}),s.jsx(Mr,{children:"No sensitivity data available."})]})});const n=[...e].sort((o,l)=>l.swing-o.swing),r=Math.max(...n.flatMap(o=>[Math.abs(o.low_npv-t),Math.abs(o.high_npv-t)]));if(r===0)return s.jsx(Be,{children:s.jsxs(ht,{children:[s.jsx(ft,{children:"Sensitivity Analysis"}),s.jsx(Mr,{children:"Every variable's swing is zero — the model returned no sensitivity for this run."})]})});const i=r*1.05,a=o=>50+o/i*50;return s.jsxs(Be,{children:[s.jsxs(ht,{children:[s.jsx(ft,{children:"Sensitivity Analysis (Tornado)"}
793),s.jsx(Mr,{children:"NPV swing when each input moves between its P10 and P90 values. Variables sorted by impact."})]}),s.jsxs(pt,{children:[s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(140px, 30%) minmax(0, 1fr) 76px",gap:16,alignItems:"center",paddingBottom:8,marginBottom:8,borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))"},children:"Variable"}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontFamily:"var(--font-mono)",fontSize:10.5,color:"hsl(var(--c-fg-subtle))",letterSpacing:"0.06em"},children:[s.jsxs("span",{children:["−",ed(r)]}),s.jsxs("span",{children:["BASE · ",ed(t)]}),s.jsxs("span",{children:["+",ed(r)]})]}),s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))",textAlign:"right"},children:"Swing"})]}),s.jsx("div",{style:{display:"flex",flexDirection:"column"},children:n.map(o=>{const l=o.low_npv-t,c=o.high_npv-t,u=Math.min(l,c),d=Math.max(l,c),h=a(u),f=a(d),p=Math.max(f-h,.6);return s.jsxs(ni,{delayDuration:120,children:[s.jsx(ri,{asChild:!0,children:s.jsxs("div",{className:"transition-colors duration-150 hover:bg-[hsl(var(--c-surface-2)/0.5)]",style:{display:"grid",gridTemplateColumns:"minmax(140px, 30%) minmax(0, 1fr) 76px",gap:16,alignItems:"center",padding:"10px 8px",margin:"0 -8px",borderBottom:"1px solid hsl(var(--c-border))",borderRadius:4,cursor:"default"},children:[s.jsx("div",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg))",lineHeight:1.3,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:o.label}),s.jsxs("div",{style:{position:"relative",height:22},children:[s.jsx("div",{style:{position:"absolute",top:9,left:0,right:0,height:4,background:"hsl(var(--c-surface-2))",borderRadius:2}}),s.jsx("div",{style:{position:"absolute",top:0,bottom:0,left:"50%",width:1,background:"hsl(var(--c-border-strong))"}}),s.jsx("div",{style:{position:"absolute",top:4,bottom:4,left:`${h}%`,width:`${p}%`,background:"hsl(var(--c-accent) / 0.18)",border:"1px solid hsl(var(--c-accent) / 0.7)",borderRadius:3}}),s.jsx("span",{style:{position:"absolute",top:"50%",left:`${a(l)}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"hsl(var(--c-card))",border:"1.5px solid hsl(var(--c-accent))"}}),s.jsx("span",{style:{position:"absolute",top:"50%",left:`${a(c)}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"hsl(var(--c-accent))",border:"1.5px solid hsl(var(--c-accent))"}})]}),s.jsx("div",{className:"tt-mono-sm",style:{textAlign:"right",color:"hsl(var(--c-ink))",fontWeight:500},children:ed(o.swing)})]})}),s.jsx(Kr,{side:"top",className:"px-3 py-2",children:s.jsxs("div",{style:{minWidth:220},children:[s.jsx("div",{className:"font-medium mb-1.5 text-foreground",children:o.label}),s.jsxs("div",{className:"grid gap-1 text-xs",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"hsl(var(--c-card))",border:"1.5px solid hsl(var(--c-accent))",flexShrink:0}}),s.jsxs("span",{className:"text-muted-foreground",children:["at ",o.low_value," → ",ed(o.low_npv)]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"hsl(var(--c-accent))",border:"1.5px solid hsl(var(--c-accent))",flexShrink:0}}),s.jsxs("span",{className:"text-muted-foreground",children:["at ",o.high_value," → ",ed(o.high_npv)]})]})]}),s.jsxs("div",{className:"mt-1.5 pt-1.5 border-t border-border/60 text-xs text-muted-foreground",children:["Swing: ",ed(o.swing)]})]})})]},o.label)})}),s.jsx("div",{className:"mt-3 text-xs",style:{color:"hsl(var(--c-fg-muted))"},children:"Hollow dot = NPV at the variable's low (P10) input · Filled dot = NPV at the high (P90) input."})]})]})}function ty(e){const t=Math.abs(e),n=e<0?"-":"";return t>=1e9?`${n}$${(t/1e9).toFixed(1)}B`:t>=1e6?`${n}$${(t/1e6).toFixed(0)}M`:t>=1e3?`${n}$${(t/1e3).toFixed(0)}K`:`${n}$${t.toFixed(0)}`}function x7e({curve:e}){if(e.length===0)return s.jsx(Be,{children:s.jsxs(ht,{children:[s.jsx(ft,{children:"Revenue Curve"}),s.jsx(Mr,{children:"No projection available."})]})});const t=e.reduce((i,a)=>Math.max(i,a.revenue),0),n=e.reduce((i,a)=>
793Math.max(i,a.profit),0),r=e.reduce((i,a)=>i+a.revenue,0);return s.jsxs(Be,{children:[s.jsxs(ht,{children:[s.jsx(ft,{children:"Revenue Projection"}),s.jsx(Mr,{children:"Annual revenue and after-tax profit from launch through patent life. Reflects S-curve uptake and post-LOE erosion."})]}),s.jsxs(pt,{children:[s.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[s.jsx(UC,{label:"Peak Revenue",value:ty(t)}),s.jsx(UC,{label:"Peak Profit",value:ty(n)}),s.jsx(UC,{label:"Lifetime Revenue",value:ty(r)})]}),s.jsx("div",{className:"h-64 w-full",children:s.jsx(bb,{width:"100%",height:"100%",children:s.jsxs(f7e,{data:e,margin:{top:24,right:16,left:0,bottom:8},children:[s.jsx(Cb,{strokeDasharray:"3 3",className:"stroke-border"}),s.jsx(lc,{dataKey:"year",tick:{fontSize:11},stroke:"currentColor",className:"text-muted-foreground"}),s.jsx(cc,{tickFormatter:ty,tick:{fontSize:11},stroke:"currentColor",className:"text-muted-foreground"}),s.jsx(ts,{formatter:(i,a)=>[ty(i),a],labelFormatter:i=>`Year ${i}`,contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))",borderRadius:6}}),s.jsx(uu,{verticalAlign:"top",align:"right",height:28,iconType:"plainline",iconSize:14,wrapperStyle:{fontSize:11,paddingBottom:8}}),s.jsx(xm,{type:"monotone",dataKey:"revenue",name:"Revenue",stroke:"hsl(var(--c-fg-muted))",strokeWidth:2.5,dot:!1}),s.jsx(xm,{type:"monotone",dataKey:"profit",name:"After-tax profit",stroke:"hsl(var(--c-accent))",strokeWidth:2,strokeDasharray:"5 4",dot:!1})]})})}),s.jsx("div",{className:"mt-2 text-[11px]",style:{color:"hsl(var(--c-fg-subtle))",fontFamily:"var(--font-mono)",letterSpacing:"0.04em"},children:"Years from launch"})]})]})}function UC({label:e,value:t}){return s.jsxs("div",{className:"rounded-md border p-3",style:{background:"hsl(var(--c-surface))",borderColor:"hsl(var(--c-border))"},children:[s.jsx("div",{className:"text-[11px] uppercase",style:{color:"hsl(var(--c-fg-subtle))",fontFamily:"var(--font-mono)",letterSpacing:"0.06em"},children:e}),s.jsx("div",{className:"mt-1 text-lg font-semibold",style:{color:"hsl(var(--c-ink))",fontFamily:"var(--font-display)"},children:t})]})}function k8(e){const t=Math.abs(e),n=e<0?"-":"";return t>=1e9?`${n}$${(t/1e9).toFixed(2)}B`:t>=1e6?`${n}$${(t/1e6).toFixed(1)}M`:t>=1e3?`${n}$${(t/1e3).toFixed(0)}K`:`${n}$${t.toFixed(0)}`}const b7e=["hurdle_35","hurdle_50","hurdle_60","hurdle_70"];function w7e({data:e}){const t=b7e.filter(n=>e[n]!==void 0).map(n=>({key:n,...e[n]}));return t.length===0?s.jsx(Be,{children:s.jsxs(ht,{children:[s.jsx(ft,{children:"VC Method Valuations"}),s.jsx(Mr,{children:"No VC valuations available."})]})}):s.jsxs(Be,{children:[s.jsxs(ht,{children:[s.jsx(ft,{children:"VC Method Valuations"}),s.jsx(Mr,{children:"Pre-money valuation and equity share for a $50M round, discounted from the projected exit value at each hurdle rate."})]}),s.jsx(pt,{children:s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:t.map(n=>s.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-4",children:[s.jsx("div",{className:"flex items-baseline justify-between",children:s.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:kNe[n.key]??n.key})}),s.jsx("div",{className:"mt-2 text-2xl font-semibold",children:k8(n.pre_money)}),s.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:"Pre-money valuation"}),s.jsxs("div",{className:"mt-3 flex items-center justify-between border-t border-border/60 pt-2 text-xs text-muted-foreground",children:[s.jsx("span",{children:"Equity for $50M"}),s.jsxs("span",{className:"font-medium text-foreground",children:[(n.equity_for_50m*100).toFixed(1),"%"]})]}),s.jsxs("div",{className:"mt-1 flex items-center justify-between text-xs text-muted-foreground",children:[s.jsx("span",{children:"Discounted exit"}),s.jsx("span",{className:"font-medium text-foreground",children:k8(n.discounted_exit)})]})]},n.key))})})]})}var uk="Collapsible",[j7e,ote]=sr(uk),[_7e,XD]=j7e(uk),lte=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...l}=e,[c,u]=ji({prop:r,defaultProp:i??!1,onChange:o,caller:uk});return s.jsx(_7e,{scope:n,disabled:a,contentId:gr(),open:c,onOpenToggle:x.useCallback(()=>u(d=>!d),[u]),children:s.jsx(Ne.div,{"data-state":tM(c),"data-disabled":a?"":void 0,...l,ref:t})})});lte.displayName=uk;var cte="CollapsibleTrigger",ZD=x.forwardRef((e,t)=>
793{const{__scopeCollapsible:n,...r}=e,i=XD(cte,n);return s.jsx(Ne.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":tM(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:fe(e.onClick,i.onOpenToggle)})});ZD.displayName=cte;var JD="CollapsibleContent",eM=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=XD(JD,e.__scopeCollapsible);return s.jsx(vr,{present:n||i.open,children:({present:a})=>s.jsx(S7e,{...r,ref:t,present:a})})});eM.displayName=JD;var S7e=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...a}=e,o=XD(JD,n),[l,c]=x.useState(r),u=x.useRef(null),d=Ke(t,u),h=x.useRef(0),f=h.current,p=x.useRef(0),m=p.current,g=o.open||l,y=x.useRef(g),b=x.useRef(void 0);return x.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),Lr(()=>{const v=u.current;if(v){b.current=b.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();h.current=w.height,p.current=w.width,y.current||(v.style.transitionDuration=b.current.transitionDuration,v.style.animationName=b.current.animationName),c(r)}},[o.open,r]),s.jsx(Ne.div,{"data-state":tM(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!g,...a,ref:d,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:g&&i})});function tM(e){return e?"open":"closed"}var ute=lte,k7e=ZD,N7e=eM;const nM=ute,rM=ZD,iM=eM,dte={ph1_ph2:"Phase I → II",ph2_ph3:"Phase II → III",ph3_nda:"Phase III → NDA",nda_appr:"NDA → Approval"};function ss(e){return`${(e*100).toFixed(1)}%`}function Jf(e){const t=Math.abs(e*100);return`${e>=0?"+":"−"}${t.toFixed(1)}%`}function C7e({result:e}){const{cpos:t,layers:n}=e,[r,i]=x.useState(!1),a=n.layer1_baseline,o=n.layer2_adjusted,l=n.layer3_final,c=t,u=c-a,d=n.per_phase,h=d.reduce((v,w)=>v*w.final,1),f=h>0?l/h:1,p=f<.999,m=[];let g=f;for(const v of d)g*=v.final,m.push(g);const y=c<l-5e-4,b=d.length>0?d.reduce((v,w)=>w.final<v.final?w:v):null;return s.jsxs(Be,{children:[s.jsxs(ht,{children:[s.jsx(ft,{children:"Cumulative Probability of Success (cPOS)"}),s.jsx(Mr,{children:"Three-layer probability engine: per-TA baseline rates, modality/biomarker adjustments, then interaction effects + caps."})]}),s.jsxs(pt,{children:[s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(170px, 28%) minmax(0, 1fr)",gap:"clamp(24px, 3vw, 40px)",alignItems:"start",paddingBottom:22,marginBottom:22,borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsx(A7e,{baseCpos:a,layer2Cpos:o,finalCpos:c,lift:u}),s.jsx(T7e,{phases:d,finalCpos:c,preclinicalMult:f,hasPreclinicalAttrition:p,capApplied:y,layer3Final:l})]}),s.jsxs(nM,{open:r,onOpenChange:i,children:[s.jsx(rM,{asChild:!0,children:s.jsxs("button",{type:"button",className:"transition-colors duration-150 hover:bg-[hsl(var(--c-surface-2)/0.5)]",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",gap:12,padding:"10px 14px",border:"1px solid hsl(var(--c-border))",borderRadius:6,cursor:"pointer",background:"transparent",textAlign:"left",fontFamily:"inherit",color:"inherit"},children:[s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:10,minWidth:0},children:[s.jsx(Us,{size:14,style:{color:"hsl(var(--c-fg-muted))",transform:r?"rotate(90deg)":"rotate(0deg)",transition:"transform 150ms ease-out",flexShrink:0}}),s.jsx("span",{className:"eyebrow",children:"Per-phase build-up"}),s.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-fg-subtle))",letterSpacing:"0.04em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[d.length," ",d.length===1?"phase":"phases"," · 3-layer breakdown per phase"]})]}),s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-accent))",letterSpacing:"0.04em",textTransform:"uppercase",fontWeight:500,whiteSpace:"nowrap"},children:r?"Hide":"Show"})]})}),s.jsx(iM,{className:"overflow-hidden data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up",children:s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:14},children:d.map((v,w)=>s.jsx(E7e,{phase:v,cumulativeCpos:m[w],isBottleneck:(b==null?void 0:b.phase)===v.phase},v.phase))})})]})]})]})}function A7e({baseCpos:e,layer2Cpos:t,finalCpos:n,lift:r}){const i=r>=0;return s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-accent))"},children:"Final cPOS"}),s.jsx("div",{className:"tt-stat-xl",style:{marginTop:4,color:"hsl(var(--c-ink))",fontSize:"clamp(36px, 4.5vw, 52px)",lineHeight:1,letterSpacing:"-0.02em"},children:ss(n)}),s.jsxs("div",{className:"tt-mono-sm",style:{marginTop:10,color:i?"hsl(var(--c-positive-fg))":"hsl(var(--c-negative-fg))",fontWeight:500,fontSize:12.5},children:[i?"▲":"▼"," ",Jf(r)," vs baseline"]}),s.jsxs("div",{className:"tt-mono-sm",style:{marginTop:4,color:"hsl(var(--c-fg-subtle))",fontSize:11,letterSpacing:"0.04em"},children:[ss(e)," baseline · ",ss(t)," after L2"]})]})}function T7e({phases:e,finalCpos:t,preclinicalMult:n,hasPreclinicalAttrition:r,capApplied:i,layer3Final:a}){if(e.length===0)return null;const o=[{label:"At launch",survival:1,isAnchor:!0}];r&&o.push({label:"Through preclinical",survival:n,phaseFinal:n});let l=r?n:1;return e.forEach((c,u)=>{l*=c.final;const d=u===e.length-1;o.push({label:`After ${dte[c.phase]??c.phase}`,survival:l,phaseFinal:c.final,isFinal:d&&!i})}),i&&o.push({label:"After stage cap",survival:t,phaseFinal:a>0?t/a:1,isFinal:!0,isCap:!0}),s.jsxs("div",{children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12,marginBottom:14},children:[s.jsxs("div",{className:"eyebrow",children:["How we arrive at ",s.jsx("span",{style:{color:"hsl(var(--c-accent))"},children:ss(t)})]}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",fontSize:11,letterSpacing:"0.04em",whiteSpace:"nowrap"},children:"phase finals compound"})]}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"minmax(140px, max-content) minmax(60px, 1fr) 56px",columnGap:10,rowGap:6,alignItems:"center"},children:o.map((c,u)=>{const d=Math.max(c.survival*100,.5),h=c.isAnchor?"hsl(var(--c-fg-muted) / 0.55)":c.isCap?"hsl(var(--c-warning))":c.isFinal?"hsl(var(--c-accent))":"hsl(var(--c-accent) / 0.45)",f=c.isFinal?"hsl(var(--c-ink))":"hsl(var(--c-fg-muted))",p=c.isCap?"hsl(var(--c-warning-fg))":c.isFinal?"hsl(var(--c-accent))":"hsl(var(--c-fg-muted))";return s.jsxs(x.Fragment,{children:[s.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:11.5,color:f,fontWeight:c.isFinal?500:400,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",letterSpacing:"0.02em"},children:[c.label,c.phaseFinal!==void 0&&!c.isCap&&s.jsxs("span",{style:{color:"hsl(var(--c-fg-subtle))",marginLeft:6},children:["× ",ss(c.phaseFinal)]}),c.isCap&&s.jsx("span",{style:{color:"hsl(var(--c-warning-fg))",marginLeft:6},children:Jf(t-a)})]}),s.jsx("div",{style:{position:"relative",height:8,background:"hsl(var(--c-surface-2))",borderRadius:4},children:s.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:`${d}%`,background:h,borderRadius:4,transition:"width 200ms ease-out"}})}),s.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:11.5,color:p,fontWeight:c.isFinal?600:400,textAlign:"right",letterSpacing:"0.02em"},children:ss(c.survival)})]},u)})})]})}function E7e({phase:e,cumulativeCpos:t,isBottleneck:n}){const r=e.baseline,i=e.layer2,a=e.layer3,o=e.final,l=i-r,c=a-i,u=dte[e.phase]??e.phase;return s.jsxs("div",{style:{padding:"8px 12px",margin:"0 -12px",borderRadius:6,...n?{background:"hsl(var(--c-warning-soft) / 0.4)",border:"1px solid hsl(var(--c-warning-border))"}:void 0},children:[s.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:8,gap:12},children:s.jsxs("span",{className:"font-medium text-sm",style:{display:"inline-flex",alignItems:"center",gap:8},children:[u,n&&s.jsx("span",{className:"tt-mono-sm",style:{background:"hsl(var(--c-warning-soft))",color:"hsl(var(--c-warning-fg))",border:"1px solid hsl(var(--c-warning-border))",padding:"1px 6px",borderRadius:3,fontSize:10,letterSpacing:"0.06em",textTransform:"uppercase"},children:"Hurdle"})]})}),s.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[s.jsx(qC,{startPct:0,endPct:r,color:"hsl(var(--c-fg-muted) / 0.95)",label:`${ss(r)} baseline`,tooltipTitle:"Baseline rate",tooltipBody:`Per-TA historical phase transition probability for ${u}.`,tooltipValue:ss(r)}),s.jsx(qC,{startPct:r,endPct:i,color:l>=0?"hsl(var(--c-accent) / 0.8)":"hsl(var(--c-warning) / 0.95)",label:`${Jf(l)} layer 2`,tooltipTitle:"Layer 2 adjustment",tooltipBody:"Modality, biomarker, rare-disease, and n
793ovelty modifiers applied to the baseline rate.",tooltipValue:`${Jf(l)} → ${ss(i)}`}),s.jsx(qC,{startPct:i,endPct:a,color:c>=0?"hsl(var(--c-accent))":"hsl(var(--c-warning))",label:`${Jf(c)} layer 3`,tooltipTitle:"Layer 3 adjustment",tooltipBody:"Interaction effects (regulatory designations, sponsor track record, prior approval) plus per-phase caps.",tooltipValue:`${Jf(c)} → ${ss(a)}`}),s.jsx(O7e,{finalPct:o,cumulativePct:t})]}),e.modifiers_applied.length>0&&s.jsx("div",{className:"mt-3 flex flex-wrap gap-1",children:e.modifiers_applied.map(d=>s.jsx(pn,{variant:"secondary",className:"text-[10px] font-normal",children:d},d))})]})}const $w=8,P7e=240,hte={display:"grid",gridTemplateColumns:`minmax(0, 1fr) ${P7e}px`,gap:12,alignItems:"center",padding:"4px 12px",margin:"0 -12px",borderRadius:4,cursor:"default"};function qC({startPct:e,endPct:t,color:n,label:r,tooltipTitle:i,tooltipBody:a,tooltipValue:o}){const l=Math.min(e,t),c=Math.max(e,t),u=Math.max((c-l)*100,.4);return s.jsxs(ni,{delayDuration:120,children:[s.jsx(ri,{asChild:!0,children:s.jsxs("div",{className:"transition-colors duration-150 hover:bg-[hsl(var(--c-surface-2)/0.5)]",style:hte,children:[s.jsx("div",{style:{position:"relative",height:$w,background:"hsl(var(--c-surface-2))",borderRadius:$w/2},children:s.jsx("div",{style:{position:"absolute",left:`${l*100}%`,width:`${u}%`,top:0,bottom:0,background:n,borderRadius:$w/2}})}),s.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-fg-muted))",letterSpacing:"0.02em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r})]})}),s.jsx(Kr,{side:"top",className:"px-3 py-2 text-xs",children:s.jsxs("div",{style:{minWidth:200},children:[s.jsxs("div",{className:"flex items-center justify-between gap-6 mb-1",children:[s.jsx("span",{className:"font-medium text-foreground",children:i}),s.jsx("span",{className:"font-mono text-foreground",children:o})]}),s.jsx("div",{className:"text-muted-foreground",children:a})]})})]})}function O7e({finalPct:e,cumulativePct:t}){return s.jsxs(ni,{delayDuration:120,children:[s.jsx(ri,{asChild:!0,children:s.jsxs("div",{className:"transition-colors duration-150 hover:bg-[hsl(var(--c-surface-2)/0.5)]",style:hte,children:[s.jsxs("div",{style:{position:"relative",height:$w},children:[s.jsx("div",{style:{position:"absolute",left:0,right:0,top:"50%",height:1,background:"hsl(var(--c-border-strong))"}}),s.jsx("span",{style:{position:"absolute",left:`${Math.max(0,Math.min(1,e))*100}%`,top:"50%",transform:"translate(-50%, -50%)",width:10,height:10,borderRadius:"50%",background:"hsl(var(--c-accent))",border:"2px solid hsl(var(--c-card))",boxShadow:"0 0 0 1.5px hsl(var(--c-accent))"}})]}),s.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-fg-muted))",letterSpacing:"0.02em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:ss(e)})," ","final · cumulative"," ",s.jsx("span",{style:{color:"hsl(var(--c-accent))",fontWeight:500},children:ss(t)})]})]})}),s.jsx(Kr,{side:"top",className:"px-3 py-2 text-xs",children:s.jsxs("div",{style:{minWidth:200},children:[s.jsxs("div",{className:"flex items-center justify-between gap-6 mb-1",children:[s.jsx("span",{className:"font-medium text-foreground",children:"Phase final"}),s.jsx("span",{className:"font-mono font-medium text-foreground",children:ss(e)})]}),s.jsxs("div",{className:"flex items-center justify-between gap-6 mt-1.5 pt-1.5 border-t border-border/60",children:[s.jsx("span",{className:"text-muted-foreground",children:"Cumulative through here"}),s.jsx("span",{className:"font-mono",style:{color:"hsl(var(--c-accent))"},children:ss(t)})]})]})})]})}function Yi(e){const t=Math.abs(e),n=e<0?"-":"";return t>=1e9?`${n}$${(t/1e9).toFixed(2)}B`:t>=1e6?`${n}$${(t/1e6).toFixed(1)}M`:t>=1e3?`${n}$${(t/1e3).toFixed(0)}K`:`${n}$${t.toFixed(0)}`}function td(e){return`${(e*100).toFixed(1)}%`}function cf(e,t){if(e===0)return{text:t===0?"—":"n/a",tone:"flat"};const n=(t-e)/Math.abs(e);return Math.abs(n)<.005?{text:"±0%",tone:"flat"}:{text:`${n>0?"+":""}${(n*100).toFixed(1)}
793%`,tone:n>0?"up":"down"}}function di({label:e,v1:t,v2:n,delta:r,note:i}){return s.jsxs("div",{className:"grid grid-cols-[1.2fr_1fr_1fr_0.7fr] gap-3 border-b border-border/60 py-3 text-sm last:border-b-0",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:e}),i&&s.jsx("div",{className:"text-[11px] text-muted-foreground",children:i})]}),s.jsx("div",{className:"font-mono text-xs text-muted-foreground md:text-sm",children:t}),s.jsx("div",{className:"font-mono text-xs md:text-sm",children:n}),s.jsx("div",{className:"text-xs",children:r&&s.jsx("span",{className:r.tone==="up"?"text-emerald-600 dark:text-emerald-500":r.tone==="down"?"text-destructive":"text-muted-foreground",children:r.text})})]})}function I7e({v1:e,v2:t}){return s.jsxs(Be,{children:[s.jsxs(ht,{children:[s.jsxs(ft,{className:"flex items-center justify-between",children:[s.jsx("span",{children:"Side-by-side: V1 Classic vs V2 Advanced"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(pn,{variant:"outline",children:["V1 ",e.modelVersion]}),s.jsxs(pn,{variant:"default",children:["V2 ",t.modelVersion]})]})]}),s.jsx(Mr,{children:"Compare V1's flat multiplier model with V2's three-layer probability engine, real option overlay, and Monte Carlo distribution."})]}),s.jsxs(pt,{children:[s.jsxs("div",{className:"grid grid-cols-[1.2fr_1fr_1fr_0.7fr] gap-3 border-b border-border pb-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:[s.jsx("div",{children:"Metric"}),s.jsx("div",{children:"V1 Classic"}),s.jsx("div",{children:"V2 Advanced"}),s.jsx("div",{children:"Δ"})]}),s.jsxs("div",{className:"pt-1",children:[s.jsx(K0,{children:"NPV"}),s.jsx(di,{label:"Base rNPV",v1:Yi(e.npvBase),v2:Yi(t.npvBase),delta:cf(e.npvBase,t.npvBase)}),s.jsx(di,{label:"Real Option Value",v1:"—",v2:Yi(t.realOptionValue),note:"V2 only — CRR binomial lattice with abandonment"}),s.jsx(di,{label:"Real Option Premium",v1:"—",v2:Yi(t.realOptionPremium),note:"Value from abandonment optionality"}),s.jsx(K0,{children:"Scenarios"}),s.jsx(di,{label:"Bull / P90",v1:Yi(e.npvBull),v2:Yi(t.monteCarlo.p90),delta:cf(e.npvBull,t.monteCarlo.p90),note:"V1: fixed 1.4× bull · V2: Monte Carlo P90"}),s.jsx(di,{label:"Median / P50",v1:Yi(e.npvBase),v2:Yi(t.monteCarlo.p50),delta:cf(e.npvBase,t.monteCarlo.p50),note:"V1: deterministic base · V2: MC median"}),s.jsx(di,{label:"Bear / P10",v1:Yi(e.npvBear),v2:Yi(t.monteCarlo.p10),delta:cf(e.npvBear,t.monteCarlo.p10),note:"V1: fixed 0.6× bear · V2: Monte Carlo P10"}),s.jsx(K0,{children:"Probability of Success"}),s.jsx(di,{label:"cPOS (overall)",v1:td(e.cpos),v2:td(t.cpos),note:"V1: single flat number · V2: 3-layer breakdown"}),s.jsx(di,{label:"cPOS Layer 1 baseline",v1:"—",v2:td(t.cposLayers.layer1_baseline),note:"V2: historical per-TA rates"}),s.jsx(di,{label:"cPOS Layer 2 adjusted",v1:"—",v2:td(t.cposLayers.layer2_adjusted),note:"V2: modality + biomarker + rare"}),s.jsx(di,{label:"cPOS Layer 3 final",v1:"—",v2:td(t.cposLayers.layer3_final),note:"V2: with interaction effects"}),s.jsx(K0,{children:"Cost & Timeline"}),s.jsx(di,{label:"Cost to approval",v1:Yi(e.costToApproval),v2:Yi(t.costToApproval),delta:cf(e.costToApproval,t.costToApproval)}),s.jsx(di,{label:"Time to approval",v1:`${(e.timeToApprovalMonths/12).toFixed(1)} yr`,v2:`${t.timeToApprovalYears.toFixed(1)} yr`}),s.jsx(di,{label:"Peak sales",v1:Yi(e.peakSalesUsed),v2:Yi(t.peakSales),delta:cf(e.peakSalesUsed,t.peakSales),note:`V2 source: ${t.peakSalesSource.replace(/_/g," ")}`}),s.jsx(di,{label:"Discount rate",v1:td(e.discountRate),v2:td(t.discountRate)}),s.jsx(di,{label:"Confidence level",v1:`${e.confidenceLevel} / 5`,v2:`${t.confidenceLevel} / 5`}),s.jsx(di,{label:"Completeness",v1:`${e.completenessScore}%`,v2:`${t.completenessScore}%`})]})]})]})}function K0({children:e}){return s.jsx("div",{className:"mt-4 mb-1 text-[11px] font-medium uppercase tracking-wide text-primary",children:e})}function R7e(){var z,$,F,B;const[e,t]=il(),{isAdmin:n,isBuyer:r}=me(),{data:i}=An(),{data:a=[],isLoading:o}=ag(),{data:l=[],isLoading:c}=jNe(),u=x.useMemo(()=>{var I;if(n||r)return a;const P=(I=i==null?void 0:i.supplier)==null?void 0:I.id;return P?a.filter(M=>{var R;return((R=M.supplier)==null?void 0:R.id)===P}):[]},[n,r,a,(z=i==null?void 0:i.supplier)==null?void 0:z.id]),d=e.get("asset"),h=e.get("from"),[f,p]=x.useState(d),[m,g]=x.use
793State(j5.discountRate*100),[y,b]=x.useState(j5.discountRate*100),[v,w]=x.useState("v1"),_=x.useCallback(P=>{w(P),t(I=>{const M=new URLSearchParams(I);return P==="v1"?M.delete("model"):M.set("model",P),M},{replace:!0})},[t]),j=f||(u.length>0?u[0].id:null),S=u.find(P=>P.id===j)||u[0],k=mX(v!=="v2"?j:null,y),N=_Ne(v!=="v1"?j:null,y),T=x.useCallback(P=>{b(P[0])},[]),C=x.useMemo(()=>S?l.filter(P=>P.target===S.primaryTarget||P.modality===S.modality).slice(0,5):[],[S,l]),A=P=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:"compact",maximumFractionDigits:1}).format(P),O=P=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(P);return o||c?s.jsx(he,{children:s.jsxs("div",{className:"container py-8",children:[s.jsx(ce,{className:"h-10 w-64 mb-8"}),s.jsx("div",{className:"grid lg:grid-cols-3 gap-6",children:s.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[s.jsx("div",{className:"grid sm:grid-cols-3 gap-4",children:[1,2,3].map(P=>s.jsxs(Be,{className:"p-6",children:[s.jsx(ce,{className:"h-4 w-24 mb-2"}),s.jsx(ce,{className:"h-8 w-32"})]},P))}),s.jsx(Be,{className:"p-6",children:s.jsx(ce,{className:"h-64 w-full"})})]})})]})}):S?s.jsx(he,{children:s.jsxs("div",{className:"container py-8",children:[j&&h==="buyer"&&s.jsx(je,{asChild:!0,variant:"ghost",className:"mb-6",children:s.jsxs(oe,{to:`/buyer/asset/${j}`,children:[s.jsx(Wt,{className:"mr-2 h-4 w-4"}),"Back to Asset Details"]})}),j&&h==="market"&&s.jsx(je,{asChild:!0,variant:"ghost",className:"mb-6",children:s.jsxs(oe,{to:`/supplier/market/asset/${j}`,children:[s.jsx(Wt,{className:"mr-2 h-4 w-4"}),"Back to Market View"]})}),s.jsxs("div",{className:"mb-6",children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,flexWrap:"wrap"},children:[s.jsx("h1",{className:"tt-display-md",children:"Valuation Terminal"}),s.jsxs("span",{className:"tt-mono-sm",style:{display:"inline-flex",alignItems:"center",gap:6,color:"hsl(var(--c-positive-fg))"},children:[s.jsx("span",{className:"vt-pulse",style:{width:6,height:6,borderRadius:"50%",background:"hsl(var(--c-positive))"}}),"LIVE"]})]}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:6},children:"Risk-adjusted NPV estimates powered by research-backed PTRS, cost benchmarks, and gap-to-value analysis."})]}),s.jsx(mh,{value:v,onValueChange:P=>_(P),className:"mb-6",children:s.jsxs(ju,{children:[s.jsx(Er,{value:"v1",children:"V1 Classic"}),s.jsxs(Er,{value:"v2",children:[s.jsx(Cn,{className:"mr-1.5 h-3.5 w-3.5"}),"V2 Advanced",s.jsx("span",{className:"ml-1.5 inline-flex items-center rounded-full bg-accent px-2 py-0.5 text-[10px] font-bold text-accent-foreground",children:"New"})]}),s.jsxs(Er,{value:"compare",children:[s.jsx(mH,{className:"mr-1.5 h-3.5 w-3.5"}),"Compare"]})]})}),s.jsx(Be,{className:"mb-6",children:s.jsx(pt,{className:"p-4",children:s.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-start md:items-center",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Select Asset"}),s.jsxs($n,{value:j||"",onValueChange:p,children:[s.jsx(On,{className:"w-full md:w-80",children:s.jsx(Ln,{})}),s.jsx(In,{children:u.map(P=>s.jsxs(Rt,{value:P.id,children:[P.productName," - ",P.primaryTarget]},P.id))})]})]}),s.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Stage:"}),s.jsx(Xp,{stage:S.stage})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Modality:"}),s.jsx(pn,{variant:"outline",children:Zt[S.modality]})]})]})]})})}),s.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[v==="v1"&&s.jsx(D7e,{valuation:k.data,loading:k.isLoading,error:k.isError,onRetry:()=>k.refetch(),selectedAsset:S,formatCurrency:A,formatFullCurrency:O}),v==="v2"&&s.jsx(M7e,{valuation:N.data,loading:N.isLoading,error:N.isError,errorMessage:($=N.error)==null?void 0:$.message,onRetry:()=>N.refetch(),formatCurrency:A}),v==="compare"&&s.jsx($7e,{v1:k.data,v1Loading:k.isLoading,v1Error:k.isError,v2:N.data,v2Loading:N.isLoading,v2Error:N.isError})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs(Be,{children:[s.jsxs(ht,{children:[s.jsx(ft,{children:"Assumptions"}),s.jsx(Mr,{children:"Adjust valuation parameters"})]}),s.jsxs(pt,{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between mb-2",children:[s.jsx("label",{className:"text-sm font-medium",children:"Discount Rate"}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[m,"%"]})]}),s.jsx(QQ,{value:[m],onValueChange:P=>g(P[0]),onValueCommit:T,min:5,max:25,step:.5}),s.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground mt-1",children:[s.jsx("span",{children:"5%"}),s.jsx("span",{children:"25%"})]})]}),v==="v1"&&k.data&&s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Peak Sales Used"}),s.jsx("span",{className:"font-medium",children:A(k.data.peakSalesUsed)})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Bear Case"}),s.jsx("span",{className:"font-medium",children:A(k.data.npvBear)})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Bull Case"}),s.jsx("span",{className:"font-medium",children:A(k.data.npvBull)})]})]}),v!=="v1"&&N.data&&s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Peak Sales"}),s.jsx("span",{className:"font-medium",children:A(N.data.peakSales)})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Peak Sales Source"}),s.jsx("span",{className:"font-medium text-right text-xs",children:SNe[N.data.peakSalesSource]??N.data.peakSalesSource})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"MC P10"}),s.jsx("span",{className:"font-medium",children:A(N.data.monteCarlo.p10)})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"MC P90"}),s.jsx("span",{className:"font-medium",children:A(N.data.monteCarlo.p90)})]})]}),s.jsx("div",{className:"p-3 bg-muted/50 rounded-lg text-sm",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Pu,{className:"h-4 w-4 mt-0.5 text-muted-foreground"}),s.jsx("p",{className:"text-muted-foreground",children:"Higher discount rates reflect greater r
793isk and result in lower present values. Industry default is 10%."})]})})]})]}),s.jsxs(Be,{children:[s.jsxs(ht,{children:[s.jsx(ft,{children:"Comparable Transactions"}),s.jsxs(Mr,{children:["Similar assets by target or modality",v==="v1"&&((F=k.data)==null?void 0:F.compMedian)&&s.jsxs("span",{className:"block mt-1 font-medium text-foreground",children:["Comp median: ",A(k.data.compMedian)," (",k.data.compCount," deals)"]}),v!=="v1"&&((B=N.data)==null?void 0:B.compMedian)&&s.jsxs("span",{className:"block mt-1 font-medium text-foreground",children:["Comp median: ",A(N.data.compMedian)," (",N.data.compCount," deals)"]})]})]}),s.jsx(pt,{children:C.length>0?s.jsx("div",{className:"space-y-4",children:C.map(P=>s.jsxs("div",{className:"p-3 rounded-lg border",children:[s.jsxs("div",{className:"flex justify-between items-start mb-2",children:[s.jsx("p",{className:"font-medium text-sm",children:P.assetName}),s.jsx(Xp,{stage:P.stage,size:"sm"})]}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:P.acquirer}),s.jsx("span",{className:"font-semibold text-accent",children:A(P.transactionValue)})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:new Date(P.date).toLocaleDateString()})]},P.id))}):s.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No comparable transactions found"})})]}),s.jsxs(Be,{children:[s.jsx(ht,{children:s.jsx(ft,{children:"Asset Summary"})}),s.jsxs(pt,{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Target"}),s.jsx("span",{className:"font-medium",children:S.primaryTarget})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Indication"}),s.jsx("span",{className:"font-medium text-right max-w-32 truncate",children:S.leadIndication})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Origin"}),s.jsx("span",{className:"font-medium",children:S.origin})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Supplier"}),s.jsx("span",{className:"font-medium",children:S.supplier.name})]}),v==="v1"&&k.data&&s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Model Version"}),s.jsx("span",{className:"font-medium",children:k.data.modelVersion})]}),v!=="v1"&&N.data&&s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Model Version"}),s.jsx("span",{className:"font-medium",children:N.data.modelVersion})]})]})]})]})]})]})}):s.jsx(he,{children:s.jsx("div",{className:"container py-8",children:s.jsx(Be,{className:"p-12 text-center",children:s.jsx("p",{className:"text-muted-foreground",children:"No assets available for valuation."})})})})}function D7e({valuation:e,loading:t,error:n,onRetry:r,selectedAsset:i,formatCurrency:a,formatFullCurrency:o}){return n?s.jsxs(Be,{className:"p-12 text-center",children:[s.jsx(ir,{className:"h-10 w-10 text-destructive mx-auto mb-4"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Valuation calculation failed. Please try again."}),s.jsx(je,{variant:"outline",onClick:r,children:"Retry"})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid sm:grid-cols-3 gap-4",children:[s.jsxs(Be,{children:[s.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ft,{className:"text-sm font-medium",children:"Risk-Adjusted NPV"}),s.jsx(Wp,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(pt,{children:t?s.jsx(ce,{className:"h-8 w-32"}):e?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"text-2xl font-bold",children:a(e.npvBase)}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[a(e.ciLow)," – ",a(e.ciHigh)]})]}):s.jsx("div",{className:"text-2xl font-bold",children:"—"})})]}),s.jsxs(Be,{children:[s.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ft,{className:"text-sm font-medium",children:"Cost to Approval"}),s.jsx(xH,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(pt,{children:t?s.jsx(ce,{className:"h-8 w-32"}):e?s.jsx("div",{className:"text-2xl font-bold",children:a(e.costToApproval)}):s.jsx("div",{className:"text-2xl font-bold",children:"—"})})]}),s.jsxs(Be,{children:[s.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ft,{className:"text-sm font-medium",children:"Time to Approval"}),s.jsx(Yn,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(pt,{children:t?s.jsx(ce,{className:"h-8 w-32"}):e?s.jsxs("div",{className:"text-2xl font-bold",children:[Math.round(e.timeToApprovalMonths/12)," years"]}):s.jsx("div",{className:"text-2xl font-bold",children:"—"})})]})]}),s.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[s.jsxs(Be,{children:[s.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ft,{className:"text-sm font-medium",children:"Confidence Level"}),s.jsx(Hs,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(pt,{children:t?s.jsx(ce,{className:"h-8 w-16"}):e?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"text-2xl font-bold",children:UR[e.confidenceLevel]||"Unknown"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.completenessScore,"% data complete"]})]}):s.jsx("div",{className:"text-2xl font-bold",children:"—"})})]}),s.jsxs(Be,{children:[s.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ft,{className:"text-sm font-medium",children:"Cumulative Probability of Success"}),s.jsx(Wp,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(pt,{children:t?s.jsx(ce,{className:"h-8 w-16"}):e?s.jsxs("div",{className:"text-2xl font-bold",children:[(e.cpos*100).toFixed(1),"%"]}):s.jsx("div",{className:"text-2xl font-bold",children:"—"})})]})]}),s.jsxs(Be,{children:[s.jsxs(ht,{children:[s.jsx(ft,{children:"Value Progression by Stage"}),s.jsx(Mr,{children:"Estimated asset value at each development milestone"})]}),s.jsx(pt,{children:t?s.jsx(ce,{className:"h-64 w-full"}):e?s.jsx("div",{className:"h-64",children:s.jsx(bb,{width:"100%",height:"100%",children:s.jsxs(ate,{data:e.stageProgression,children:[s.jsx(Cb,{strokeDasharray:"3 3",className:"stroke-muted"}),s.jsx(lc,{dataKey:"stage",className:"text-xs"}),s.jsx(cc,{tickFormatter:l=>a(l),className:"text-xs"}),s.jsx(ts,{formatter:l=>[o(l),"Value"],contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),s.jsx(Vu,{dataKey:"value",radius:[4,4,0,0],children:e.stageProgression.map((l,c)=>s.jsx(xg,{fill:l.isCurrent?"hsl(var(--accent))":"hsl(var(--muted-foreground) / 0.3)"},`cell-${c}`))})]})})}):s.jsx("p",{className:"text-sm text-muted-foreground text-center py-12",children:"Select an asset to view value progression"})})]}),s.jsxs(Be,{children:[s.jsxs(ht,{children:[s.jsx(ft,{children:"Milestone Cost Breakdown"}),s.jsxs(Mr,{children:["Remaining development costs and timelines (",Zt[i.modality],"-specific)"]})]}),s.jsx(pt,{children:t?s.jsx("div",{className:"space-y-4",children:[...Array(3)].map((l,c)=>s.jsx(ce,{className:"h-16 w-full"},c))}):e?s.jsx("div",{className:"space-y-4",children:e.remainingMilestones.map((l,c)=>s.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg border",children:[s.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-accent/10 text-accent font-medium",children:c+1}),s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"font-medium",children:l.stage}),s.jsxs("div",{className:"flex gap-4 text-sm text-muted-foreground",children:[s.jsxs("span",{children:[l.timeMonths," months"]}),s.jsx("span",{children:"·"}),s.jsxs("span",{children:[Math.round(l.successProb*100),"% cumulative success"]})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"font-semibold",children:a(l.cost)})})]},c))}):s.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No milestone data available"})})]}),e&&e.gapImpacts.length>0&&s.jsxs(Be,{children:[s.jsxs(ht,{children:[s.jsxs(ft,{className:"flex items-center gap-2",children:[s.jsx(Ls,{className:"h-5 w-5"}),"Gap Impact Projections"]}),s.jsx(Mr,{children:"Completing missing data categories would increase valuation and narrow the confidence interval"})]}),s.jsx(pt,{children:s.jsx("div",{className:"space-y-3",children:e.gapImpacts.map((l,c)=>s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-md border",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:l.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:l.description})]}),s.jsxs("div",{className:"text-right shrink-0 ml-4",children:[s.jsxs("p",{className:"text-sm font-bold text-success",children:["+",a(l.npvDelta)]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",l.npvDeltaPercent,"% NPV · −",l.ciNarrowing,"% CI"]}
793)]})]},c))})})]})]})}function M7e({valuation:e,loading:t,error:n,errorMessage:r,onRetry:i,formatCurrency:a}){return n?s.jsxs(Be,{className:"p-12 text-center",children:[s.jsx(ir,{className:"h-10 w-10 text-destructive mx-auto mb-4"}),s.jsxs("p",{className:"text-muted-foreground mb-4",children:["V2 valuation calculation failed",r?`: ${r}`:"",". Please try again."]}),s.jsx(je,{variant:"outline",onClick:i,children:"Retry"})]}):t?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid sm:grid-cols-3 gap-4",children:[1,2,3].map(o=>s.jsxs(Be,{className:"p-6",children:[s.jsx(ce,{className:"h-4 w-24 mb-2"}),s.jsx(ce,{className:"h-8 w-32"})]},o))}),s.jsx(Be,{className:"p-6",children:s.jsx(ce,{className:"h-64 w-full"})}),s.jsx(Be,{className:"p-6",children:s.jsx(ce,{className:"h-48 w-full"})})]}):e?s.jsxs(s.Fragment,{children:[e.warnings&&e.warnings.length>0&&s.jsx(Be,{className:"border-amber-200 bg-amber-50/50 p-4",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(ir,{className:"h-4 w-4 text-amber-600 mt-0.5 shrink-0"}),s.jsx("div",{className:"text-sm text-amber-800",children:e.warnings.map((o,l)=>s.jsx("p",{children:o},l))})]})}),s.jsxs("div",{className:"grid sm:grid-cols-3 gap-4",children:[s.jsxs(Be,{children:[s.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ft,{className:"text-sm font-medium",children:"Risk-Adjusted NPV"}),s.jsx(Wp,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(pt,{children:[s.jsx("div",{className:"text-2xl font-bold",children:a(e.npvBase)}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[a(e.monteCarlo.p10)," – ",a(e.monteCarlo.p90)]})]})]}),s.jsxs(Be,{children:[s.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ft,{className:"text-sm font-medium",children:"Real Option Value"}),s.jsx(Cn,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(pt,{children:[s.jsx("div",{className:"text-2xl font-bold",children:a(e.realOptionValue)}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[e.realOptionPremium>=0?"+":"",a(e.realOptionPremium)," vs rNPV"]})]})]}),s.jsxs(Be,{children:[s.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ft,{className:"text-sm font-medium",children:"Median (P50)"}),s.jsx(mH,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(pt,{children:[s.jsx("div",{className:"text-2xl font-bold",children:a(e.monteCarlo.p50)}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Monte Carlo (",e.monteCarlo.iterations.toLocaleString()," runs)"]})]})]})]}),s.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[s.jsxs(Be,{children:[s.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ft,{className:"text-sm font-medium",children:"Confidence Level"}),s.jsx(Hs,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(pt,{children:[s.jsx("div",{className:"text-2xl font-bold",children:UR[e.confidenceLevel]||"Unknown"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.completenessScore,"% data complete"]})]})]}),s.jsxs(Be,{children:[s.jsxs(ht,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ft,{className:"text-sm font-medium",children:"cPOS (Layer 3 final)"}),s.jsx(Wp,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(pt,{children:[s.jsxs("div",{className:"text-2xl font-bold",children:[(e.cpos*100).toFixed(1),"%"]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Baseline ",(e.cposLayers.layer1_baseline*100).toFixed(1),"%"," → ","Adjusted ",(e.cposLayers.layer2_adjusted*100).toFixed(1),"%"]})]})]})]}),s.jsx(y7e,{data:e.monteCarlo}),s.jsx(v7e,{bars:e.tornado,baseNPV:e.npvBase}),s.jsx(C7e,{result:{cpos:e.cpos,layers:e.cposLayers}}),s.jsx(x7e,{curve:e.revenueCurve}),s.jsx(w7e,{data:e.vcValuations}),s.jsxs(Be,{children:[s.jsxs(ht,{children:[s.jsx(ft,{children:"Phase Timeline"}),s.jsx(Mr,{children:"Remaining development phases with per-phase cost and duration."})]}),s.jsx(pt,{children:e.phaseTimeline.length>0?s.jsx("div",{className:"space-y-4",children:e.phaseTimeline.map((o,l)=>s.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg border",children:[s.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-accent/10 text-accent font-medium",children:l+1}),s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"font-medium",children:o.phase.replace(/_/g," → ").toUpperCase()}),s.jsxs("div",{className:"flex gap-4 text-sm text-muted-foreground",children:[s.jsxs("span",{children:["Start year ",o.startYear.toFixed(1)]}),s.jsx("span",{children:"·"}),s.jsxs("span",{children:[o.duration.toFixed(1)," years"]})]})]}),s.jsx("div",{className:"text-right",children:s.jsx("p",{className:"font-semibold",children:a(o.cost)})})]},o.phase))}):s.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No remaining phases — asset is already approved or launched."})})]}),e.gapImpacts.length>0&&s.jsxs(Be,{children:[s.jsxs(ht,{children:[s.jsxs(ft,{className:"flex items-center gap-2",children:[s.jsx(Ls,{className:"h-5 w-5"}),"Gap Impact Projections"]}),s.jsx(Mr,{children:"Completing missing data categories would increase valuation and narrow the confidence interval"})]}),s.jsx(pt,{children:s.jsx("div",{className:"space-y-3",children:e.gapImpacts.map((o,l)=>s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-md border",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:o.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:o.description})]}),s.jsxs("div",{className:"text-right shrink-0 ml-4",children:[s.jsxs("p",{className:"text-sm font-bold text-success",children:["+",a(o.npvDelta)]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",o.npvDeltaPercent,"% NPV · −",o.ciNarrowing,"% CI"]}
793)]})]},l))})})]})]}):s.jsx(Be,{className:"p-12 text-center",children:s.jsx("p",{className:"text-muted-foreground",children:"Select an asset to view the V2 valuation."})})}function $7e({v1:e,v1Loading:t,v1Error:n,v2:r,v2Loading:i,v2Error:a}){return t||i?s.jsxs(Be,{className:"p-6",children:[s.jsx(ce,{className:"h-8 w-64 mb-4"}),s.jsx(ce,{className:"h-96 w-full"})]}):n&&a?s.jsxs(Be,{className:"p-12 text-center",children:[s.jsx(ir,{className:"h-10 w-10 text-destructive mx-auto mb-4"}),s.jsx("p",{className:"text-muted-foreground",children:"Both valuation models failed. Try again shortly."})]}):!e||!r?s.jsxs(Be,{className:"p-12 text-center",children:[s.jsx(ir,{className:"h-10 w-10 text-destructive mx-auto mb-4"}),s.jsxs("p",{className:"text-muted-foreground",children:[n&&"V1 model failed. ",a&&"V2 model failed. ",!n&&!a&&"Waiting for valuation data…"]})]}):s.jsx(I7e,{v1:e,v2:r})}var sM="Progress",aM=100,[L7e,Dpt]=sr(sM),[F7e,z7e]=L7e(sM),fte=x.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=B7e,...o}=e;(i||i===0)&&!N8(i)&&console.error(V7e(`${i}`,"Progress"));const l=N8(i)?i:aM;r!==null&&!C8(r,l)&&console.error(W7e(`${r}`,"Progress"));const c=C8(r,l)?r:null,u=W1(c)?a(c,l):void 0;return s.jsx(F7e,{scope:n,value:c,max:l,children:s.jsx(Ne.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":W1(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":gte(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});fte.displayName=sM;var pte="ProgressIndicator",mte=x.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=z7e(pte,n);return s.jsx(Ne.div,{"data-state":gte(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});mte.displayName=pte;function B7e(e,t){return`${Math.round(e/t*100)}%`}function gte(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function W1(e){return typeof e=="number"}function N8(e){return W1(e)&&!isNaN(e)&&e>0}function C8(e,t){return W1(e)&&!isNaN(e)&&e<=t&&e>=0}function V7e(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${aM}\`.`}function W7e(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
794  - a positive number
795  - less than the value passed to \`max\` (or ${aM} if no \`max\` prop is set)
796  - \`null\` or \`undefined\` if the progress is indeterminate.
797
798Defaulting to \`null\`.`}var yte=fte,U7e=mte;const yp=x.forwardRef(({className:e,value:t,...n},r)=>s.jsx(yte,{ref:r,className:ae("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(U7e,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));yp.displayName=yte.displayName;const q7e={pending:{label:"Pending",icon:Yn,className:"verification-pending"},"in-progress":{label:"In Progress",icon:ne,className:"verification-progress"},verified:{label:"Verified",icon:Fr,className:"verification-verified"}};function G0({status:e,showLabel:t=!0,size:n="default"}){const r=q7e[e],i=r.icon;return s.jsxs(pn,{variant:"secondary",className:ae(r.className,n==="sm"&&"text-xs px-2 py-0"),children:[s.jsx(i,{className:ae("mr-1",n==="sm"?"h-3 w-3":"h-3.5 w-3.5",e==="in-progress"&&"animate-spin")}),t&&r.label]})}const H7e=[{id:"in-silico",name:"In-Silico Validation",icon:wH,description:"Computational validation of binding affinity, selectivity, and predicted efficacy",bg:"hsl(var(--c-accent-soft))",fg:"hsl(var(--c-accent))",checks:["Molecular docking analysis","Binding affinity prediction","Off-target screening","ADMET prediction"]},{id:"fto",name:"Freedom-to-Operate",icon:CI,description:"Analysis of intellectual property landscape and potential infringement risks",bg:"hsl(var(--c-stage-glp-bg))",fg:"hsl(var(--c-stage-glp-fg))",checks:["Patent landscape search","Claim analysis","Infringement risk assessment","Licensing requirement identification"]},{id:"patentability",name:"Patentability Assessment",icon:Dde,description:"Evaluation of novelty, non-obviousness, and patent protection potential",bg:"hsl(var(--c-stage-ind-bg))",fg:"hsl(var(--c-stage-ind-fg))",checks:["Prior art search","Novelty assessment","Non-obviousness analysis","Claim drafting recommendations"]}];function K7e(){const{data:e=[],isLoading:t,error:n}=ag(),[r,i]=x.useState(null),a=r||(e.length>0?e[0].id:null),o=e.find(g=>g.id===a)||e[0],l=(o==null?void 0:o.verificationSteps.filter(g=>g.status==="verified").length)||0,c=(o==null?void 0:o.verificationSteps.length)||0,u=c>0?l/c*100:0,d=e.length,h=e.filter(g=>g.verificationStatus==="verified").length,f=e.filter(g=>g.verificationStatus==="in-progress").length,p=e.filter(g=>g.verificationStatus==="pending").length,m=g=>{switch(g){case"verified":return s.jsx("span",{style:{width:28,height:28,borderRadius:8,background:"hsl(var(--c-positive-soft))",color:"hsl(var(--c-positive-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s.jsx(fo,{size:15})});case"in-progress":return s.jsx("span",{style:{width:28,height:28,borderRadius:8,background:"hsl(var(--c-warning-soft))",color:"hsl(var(--c-warning-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s.jsx(Yn,{size:15})});
798case"pending":return s.jsx("span",{style:{width:28,height:28,borderRadius:8,background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-fg-muted))",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s.jsx(va,{size:15})})}};return t?s.jsx(he,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"calc(100vh - 56px)"},children:s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px"},children:[s.jsx(ce,{className:"h-10 w-64 mb-8"}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:16,marginBottom:32},children:[1,2,3,4].map(g=>s.jsxs("div",{className:"xph-card",style:{padding:22},children:[s.jsx(ce,{className:"h-4 w-24 mb-3"}),s.jsx(ce,{className:"h-10 w-16"})]},g))})]})})}):n||e.length===0?s.jsx(he,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"calc(100vh - 56px)"},children:s.jsx("div",{className:"xph-container",style:{padding:"32px 24px"},children:s.jsx("div",{className:"xph-card",style:{padding:64,textAlign:"center"},children:s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))"},children:"No assets available for verification."})})})})}):s.jsx(he,{children:s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"calc(100vh - 56px)"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))",padding:"20px 0"},children:s.jsxs("div",{className:"xph-container",children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14},children:[s.jsx("span",{style:{width:44,height:44,borderRadius:10,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s.jsx(Hs,{size:20})}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:4},children:"Diligence · Verification"}),s.jsx("h1",{className:"tt-display-md",children:"Verification dashboard"})]})]}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:8,maxWidth:720},children:"Track verification status across in-silico validation, FTO analysis, and patentability assessments."})]})}),s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px"},children:[s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:16,marginBottom:28},children:[s.jsx(Y0,{label:"Total assets",value:d,icon:s.jsx(Hs,{size:14}),tone:"neutral"}),s.jsx(Y0,{label:"Verified",value:h,icon:s.jsx(fo,{size:14}),tone:"positive"}),s.jsx(Y0,{label:"In progress",value:f,icon:s.jsx(Yn,{size:14}),tone:"warning"}),s.jsx(Y0,{label:"Pending",value:p,icon:s.jsx(va,{size:14}),tone:"neutral"})]}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 400px), 1fr))",gap:20},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,minWidth:0},children:[s.jsx("div",{className:"xph-card",style:{padding:18},children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx("div",{className:"eyebrow",children:"Asset selector"}),s.jsxs("div",{style:{display:"flex",gap:12,alignItems:"flex-end",flexWrap:"wrap"},children:[s.jsx("div",{style:{flex:"1 1 200px",minWidth:0},children:s.jsxs($n,{value:a||"",onValueChange:i,children:[s.jsx(On,{children:s.jsx(Ln,{})}),s.jsx(In,{children:e.map(g=>s.jsx(Rt,{value:g.id,children:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[g.productName," — ",g.primaryTarget,s.jsx(G0,{status:g.verificationStatus,size:"sm",showLabel:!1})]})},g.id))})]})}),o&&s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[s.jsx(Xp,{stage:o.stage}),s.jsx("span",{className:"xph-badge",style:{background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-fg))"},children:Zt[o.modality]})]})]})]})}),o&&s.jsxs("div",{className:"xph-card",style:{padding:22},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:12,marginBottom:18},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:6},children:"Verification progress"}),s.jsx("h2",{className:"tt-display-sm",children:o.productName}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:4},children:o.primaryTarget??"—"})]}),s.jsx(G0,{status:o.verificationStatus})]}),s.jsxs("div",{style:{marginBottom:18},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:8},children:[s.jsxs("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:[l," of ",c," checks complete"]}),s.jsxs("span",{className:"tt-stat-md",children:[Math.round(u),"%"]})]}),s.jsx(yp,{value:u,className:"h-2"})]}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:o.verificationSteps.map(g=>
798s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12,padding:14,borderRadius:8,border:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-surface))"},children:[m(g.status),s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,marginBottom:4,flexWrap:"wrap"},children:[s.jsx("h4",{className:"tt-body",style:{fontWeight:600},children:g.name}),s.jsx(G0,{status:g.status,size:"sm"})]}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:g.description}),g.completedAt&&s.jsxs("p",{className:"tt-mono-sm",style:{marginTop:6},children:["Completed ",new Date(g.completedAt).toLocaleDateString()]})]})]},g.id))})]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,minWidth:0},children:[s.jsxs("div",{className:"xph-card",style:{padding:22},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:6},children:"Capabilities"}),s.jsx("h2",{className:"tt-display-sm",style:{marginBottom:4},children:"Verification services"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginBottom:18},children:"Available checks across the verification pipeline."}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:H7e.map(g=>{const y=g.icon;return s.jsxs("div",{style:{padding:14,borderRadius:8,border:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-card))"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8},children:[s.jsx("span",{style:{width:30,height:30,borderRadius:8,background:g.bg,color:g.fg,display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s.jsx(y,{size:14})}),s.jsx("h4",{className:"tt-body",style:{fontWeight:600},children:g.name})]}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginBottom:10},children:g.description}),s.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:5},children:g.checks.map(b=>s.jsxs("li",{className:"tt-body-sm",style:{display:"flex",alignItems:"center",gap:8,color:"hsl(var(--c-fg-muted))"},children:[s.jsx("span",{style:{width:4,height:4,borderRadius:"50%",background:g.fg,flexShrink:0}}),b]},b))})]},g.id)})})]}),s.jsxs("div",{className:"xph-card",style:{padding:22,textAlign:"center",borderStyle:"dashed"},children:[s.jsx("span",{style:{width:44,height:44,borderRadius:10,background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-fg-muted))",display:"inline-flex",alignItems:"center",justifyContent:"center",marginBottom:14},children:s.jsx(wH,{size:18})}),s.jsx("h4",{className:"tt-display-sm",style:{marginBottom:6},children:"Detailed reports coming soon"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginBottom:14},children:"Full verification reports with actionable insights will be available in the next release."}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",disabled:!0,children:"Request early access"})]})]})]}),s.jsxs("div",{className:"xph-card",style:{padding:22,marginTop:24},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:6},children:"Pipeline status"}),s.jsx("h2",{className:"tt-display-sm",style:{marginBottom:4},children:"All assets"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginBottom:18},children:"Verification snapshot across every asset in the marketplace."}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:12},children:e.map(g=>{const y=g.verificationSteps.filter(w=>w.status==="verified").length,b=g.verificationSteps.length,v=b>0?y/b*100:0;return s.jsxs("div",{style:{padding:14,borderRadius:8,border:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-card))"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:12,gap:8},children:[s.jsxs("div",{style:{minWidth:0},children:[s.jsx("p",{className:"tt-body",style:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g.productName}),s.jsx("p",{className:"tt-mono-sm",style:{marginTop:2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g.primaryTarget??"—"})]}),s.jsx(G0,{status:g.verificationStatus,size:"sm"})]}),s.jsxs("div",{children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:6},children:[s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-muted))"},children:[y,"/",b," checks"]}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg))",fontWeight:600},children:[Math.round(v),"%"]})]}),s.jsx(yp,{value:v,className:"h-1"})]})]},g.id)})})]})]})]})})}function Y0({label:e,value:t,icon:n,tone:r}){const i={neutral:{bg:"hsl(var(--c-surface-2))",fg:"hsl(var(--c-fg-muted))",value:"hsl(var(--c-ink))"},positive:{bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))",value:"hsl(var(--c-positive-fg))"},warning:{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))",value:"hsl(var(--c-warning-fg))"}}[r];return s.jsxs("div",{className:"xph-card",style:{padding:18},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginBottom:10},children:[s.jsx("span",{className:"eyebrow",children:e}),s.jsx("span",{style:{width:26,height:26,borderRadius:6,background:i.bg,color:i.fg,dis
798play:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:n})]}),s.jsx("span",{className:"tt-stat-xl",style:{color:i.value},children:t})]})}const Fe=x.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:ae("flex h-9 w-full rounded-md border border-border bg-card px-3 py-2 text-[13.5px] ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-[hsl(var(--c-fg-subtle))] transition-[border-color,box-shadow] focus-visible:outline-none focus-visible:border-[hsl(var(--c-accent))] focus-visible:shadow-[0_0_0_3px_hsl(var(--c-accent-soft))] disabled:cursor-not-allowed disabled:opacity-55",e),ref:r,...n}));Fe.displayName="Input";var G7e="Label",vte=x.forwardRef((e,t)=>s.jsx(Ne.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));vte.displayName=G7e;var xte=vte;const Y7e=Wm("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Pe=x.forwardRef(({className:e,...t},n)=>s.jsx(xte,{ref:n,className:ae(Y7e(),e),...t}));Pe.displayName=xte.displayName;const Q7e=Wm("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"}}),bn=x.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:ae(Q7e({variant:t}),e),...n}));bn.displayName="Alert";const X7e=x.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:ae("mb-1 font-medium leading-none tracking-tight",e),...t}));X7e.displayName="AlertTitle";const wn=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ae("text-sm [&_p]:leading-relaxed",e),...t}));wn.displayName="AlertDescription";function ii({title:e,description:t,onRetry:n,isRetrying:r=!1,compact:i=!1}){return s.jsxs("div",{style:{padding:i?"16px 0 4px":32,textAlign:"center"},children:[s.jsx("div",{className:"tt-display-sm",children:e}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6},children:t}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",style:{marginTop:14},onClick:n,disabled:r,children:r?"Retrying…":"Try again"})]})}var Bt;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},e.getValidEnumValues=i=>{const a=e.objectKeys(i).filter(l=>typeof i[i[l]]!="number"),o={};for(const l of a)o[l]=i[l];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},e.find=(i,a)=>{for(const o of i)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Bt||(Bt={}));var A8;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(A8||(A8={}));const ze=Bt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pc=e=>{switch(typeof e){case"undefined":return ze.undefined;case"string":return ze.string;case"number":return Number.isNaN(e)?ze.nan:ze.number;case"boolean":return ze.boolean;case"function":return ze.function;case"bigint":return ze.bigint;case"symbol":return ze.symbol;case"object":return Array.isArray(e)?ze.array:e===null?ze.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ze.promise:typeof Map<"u"&&e instanceof Map?ze.map:typeof Set<"u"&&e instanceof Set?ze.set:typeof Date<"u"&&e instanceof Date?ze.date:ze.object;default:return ze.unknown}}
vendor: 4,379 bytes, line 798
798,_e=Bt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Bi extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(a){return a.message},r={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(n(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return i(this),r}static assert(t){if(!(t instanceof Bi))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Bt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Bi.create=e=>new Bi(e);const V2=(e,t)=>{let n;switch(e.code){case _e.invalid_type:e.received===ze.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case _e.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Bt.jsonStringifyReplacer)}`;break;case _e.unrecognized_keys:n=`Unrecognized key(s) in object: ${Bt.joinValues(e.keys,", ")}`;break;case _e.invalid_union:n="Invalid input";break;case _e.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Bt.joinValues(e.options)}`;break;case _e.invalid_enum_value:n=`Invalid enum value. Expected ${Bt.joinValues(e.options)}, received '${e.received}'`;break;case _e.invalid_arguments:n="Invalid function arguments";break;case _e.invalid_return_type:n="Invalid function return type";break;case _e.invalid_date:n="Invalid date";break;case _e.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Bt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case _e.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case _e.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case _e.custom:n="Invalid input";break;
vendor: 5,283 bytes, line 798
798case _e.invalid_intersection_types:n="Intersection results could not be merged";break;case _e.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case _e.not_finite:n="Number must be finite";break;default:n=t.defaultError,Bt.assertNever(e)}return{message:n}};let Z7e=V2;function J7e(){return Z7e}const eGe=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let l="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:t,defaultError:l}).message;return{...i,path:a,message:l}};function Ie(e,t){const n=J7e(),r=eGe({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===V2?void 0:V2].filter(i=>!!i)});e.common.issues.push(r)}class Ks{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return gt;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const a=await i.key,o=await i.value;r.push({key:a,value:o})}return Ks.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return gt;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[a.value]=o.value)}return{status:t.value,value:r}}}const gt=Object.freeze({status:"aborted"}),Ny=e=>({status:"dirty",value:e}),Ia=e=>({status:"valid",value:e}),T8=e=>e.status==="aborted",E8=e=>e.status==="dirty",km=e=>e.status==="valid",U1=e=>typeof Promise<"u"&&e instanceof Promise;var We;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(We||(We={}));class _u{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const P8=(e,t)=>{if(km(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Bi(e.common.issues);return this._error=n,this._error}}};function St(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,l)=>{const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??n??l.defaultError}},description:i}}class Ft{get description(){return this._def.description}_getType(t){return Pc(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Pc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ks,ctx:{common:t.parent.common,data:t.data,parsedType:Pc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(U1(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pc(t)},i=this._parseSync({data:t,path:r.path,parent:r});return P8(r,i)}"~validate"(t){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pc(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:n});return km(a)?{value:a.value}:{issues:n.common.issues}}catch(a){(i=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(a=>km(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pc(t)},i=this._parse({data:t,path:r.path,parent:r}),a=await(U1(i)?i:Promise.resolve(i));return P8(r,a)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{const o=t(i),l=()=>a.addIssue({code:_e.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,i)=>
vendor: 5,984 bytes, line 798
798t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Am({schema:this,typeName:yt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return hu.create(this,this._def)}nullable(){return Tm.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Xo.create(this)}promise(){return G1.create(this,this._def)}or(t){return H1.create([this,t],this._def)}and(t){return K1.create(this,t,this._def)}transform(t){return new Am({...St(this._def),schema:this,typeName:yt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new q2({...St(this._def),innerType:this,defaultValue:n,typeName:yt.ZodDefault})}brand(){return new _Ge({typeName:yt.ZodBranded,type:this,...St(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new H2({...St(this._def),innerType:this,catchValue:n,typeName:yt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return oM.create(this,t)}readonly(){return K2.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const tGe=/^c[^\s-]{8,}$/i,nGe=/^[0-9a-z]+$/,rGe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,iGe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,sGe=/^[a-z0-9_-]{21}$/i,aGe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,oGe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,lGe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cGe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let HC;const uGe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,dGe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,hGe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,fGe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,pGe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,mGe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,bte="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",gGe=new RegExp(`^${bte}$`);function wte(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function yGe(e){return new RegExp(`^${wte(e)}$`)}function vGe(e){let t=`${bte}T${wte(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function xGe(e,t){return!!((t==="v4"||!t)&&uGe.test(e)||(t==="v6"||!t)&&hGe.test(e))}function bGe(e,t){if(!aGe.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function wGe(e,t){return!!((t==="v4"||!t)&&dGe.test(e)||(t==="v6"||!t)&&fGe.test(e))}class Jc extends Ft{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ze.string){const a=this._getOrReturnCtx(t);
vendor: 17,372 bytes, line 798
798return Ie(a,{code:_e.invalid_type,expected:ze.string,received:a.parsedType}),gt}const r=new Ks;let i;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:_e.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:_e.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,l=t.data.length<a.value;(o||l)&&(i=this._getOrReturnCtx(t,i),o?Ie(i,{code:_e.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):l&&Ie(i,{code:_e.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")lGe.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"email",code:_e.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")HC||(HC=new RegExp(cGe,"u")),HC.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"emoji",code:_e.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")iGe.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"uuid",code:_e.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")sGe.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"nanoid",code:_e.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")tGe.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"cuid",code:_e.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")nGe.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"cuid2",code:_e.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")rGe.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"ulid",code:_e.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Ie(i,{validation:"url",code:_e.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"regex",code:_e.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:_e.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:_e.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:_e.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?vGe(a).test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:_e.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?gGe.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:_e.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?yGe(a).test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:_e.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?oGe.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"duration",code:_e.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?xGe(t.data,a.version)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"ip",code:_e.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?bGe(t.data,a.alg)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"jwt",code:_e.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?wGe(t.data,a.version)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"cidr",code:_e.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?pGe.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"base64",code:_e.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?mGe.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"base64url",code:_e.invalid_string,message:a.message}),r.dirty()):Bt.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:_e.invalid_string,...We.errToObj(r)})}_addCheck(t){return new Jc({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...We.errToObj(t)})}url(t){return this._addCheck({kind:"url",...We.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...We.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...We.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...We.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...We.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...We.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...We.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...We.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...We.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...We.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...We.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...We.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...We.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...We.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...We.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...We.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...We.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...We.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...We.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...We.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...We.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...We.errToObj(n)})}nonempty(t){return this.min(1,We.errToObj(t))}trim(){return new Jc({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Jc({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Jc({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Jc.create=e=>new Jc({checks:[],typeName:yt.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...St(e)});function jGe(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,a=Number.parseInt(e.toFixed(i).replace(".","")),o=Number.parseInt(t.toFixed(i).replace(".",""));return a%o/10**i}class Nm extends Ft{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ze.number){const a=this._getOrReturnCtx(t);return Ie(a,{code:_e.invalid_type,expected:ze.number,received:a.parsedType}),gt}let r;const i=new Ks;for(const a of this._def.checks)a.kind==="int"?Bt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ie(r,{code:_e.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:_e.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:_e.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?jGe(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:_e.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ie(r,{code:_e.not_finite,message:a.message}),i.dirty()):Bt.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,We.toString(n))}gt(t,n){return this.setLimit("min",t,!1,We.toString(n))}lte(t,n){return this.setLimit("max",t,!0,We.toString(n))}lt(t,n){return this.setLimit("max",t,!1,We.toString(n))}setLimit(t,n,r,i){return new Nm({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:We.toString(i)}]})}_addCheck(t){return new Nm({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:We.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:We.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:We.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:We.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:We.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:We.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:We.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:We.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:We.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Bt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Nm.create=e=>new Nm({checks:[],typeName:yt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...St(e)});class Mx extends Ft{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ze.bigint)return this._getInvalidInput(t);let r;const i=new Ks;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:_e.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:_e.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:_e.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):Bt.assertNever(a);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Ie(n,{code:_e.invalid_type,expected:ze.bigint,received:n.parsedType}),gt}gte(t,n){return this.setLimit("min",t,!0,We.toString(n))}gt(t,n){return this.setLimit("min",t,!1,We.toString(n))}lte(t,n){return this.setLimit("max",t,!0,We.toString(n))}lt(t,n){return this.setLimit("max",t,!1,We.toString(n))}setLimit(t,n,r,i){return new Mx({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:We.toString(i)}]})}_addCheck(t){return new Mx({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:We.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:We.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:We.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:We.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:We.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Mx.create=e=>new Mx({checks:[],typeName:yt.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...St(e)});class O8 extends Ft{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ze.boolean){const r=this._getOrReturnCtx(t);return Ie(r,{code:_e.invalid_type,expected:ze.boolean,received:r.parsedType}),gt}return Ia(t.data)}}O8.create=e=>new O8({typeName:yt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...St(e)});class q1 extends Ft{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ze.date){const a=this._getOrReturnCtx(t);return Ie(a,{code:_e.invalid_type,expected:ze.date,received:a.parsedType}),gt}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return Ie(a,{code:_e.invalid_date}),gt}const r=new Ks;let i;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:_e.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:_e.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):Bt.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new q1({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:We.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:We.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}q1.create=e=>new q1({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:yt.ZodDate,...St(e)});class I8 extends Ft{_parse(t){if(this._getType(t)!==ze.symbol){const r=this._getOrReturnCtx(t);return Ie(r,{code:_e.invalid_type,expected:ze.symbol,received:r.parsedType}),gt}return Ia(t.data)}}I8.create=e=>new I8({typeName:yt.ZodSymbol,...St(e)});class R8 extends Ft{_parse(t){if(this._getType(t)!==ze.undefined){const r=this._getOrReturnCtx(t);return Ie(r,{code:_e.invalid_type,expected:ze.undefined,received:r.parsedType}),gt}return Ia(t.data)}}R8.create=e=>new R8({typeName:yt.ZodUndefined,...St(e)});class D8 extends Ft{_parse(t){if(this._getType(t)!==ze.null){const r=this._getOrReturnCtx(t);return Ie(r,{code:_e.invalid_type,expected:ze.null,received:r.parsedType}),gt}return Ia(t.data)}}D8.create=e=>new D8({typeName:yt.ZodNull,...St(e)});class M8 extends Ft{constructor(){super(...arguments),this._any=!0}_parse(t){return Ia(t.data)}}M8.create=e=>new M8({typeName:yt.ZodAny,...St(e)});class $8 extends Ft{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ia(t.data)}}$8.create=e=>new $8({typeName:yt.ZodUnknown,...St(e)});class Su extends Ft{_parse(t){const n=this._getOrReturnCtx(t);return Ie(n,{code:_e.invalid_type,expected:ze.never,received:n.parsedType}),gt}}Su.create=e=>new Su({typeName:yt.ZodNever,...St(e)});class L8 extends Ft{_parse(t){if(this._getType(t)!==ze.undefined){const r=this._getOrReturnCtx(t);return Ie(r,{code:_e.invalid_type,expected:ze.void,received:r.parsedType}),gt}return Ia(t.data)}}L8.create=e=>new L8({typeName:yt.ZodVoid,...St(e)});class Xo extends Ft{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;
vendor: 4,852 bytes, line 798
798if(n.parsedType!==ze.array)return Ie(n,{code:_e.invalid_type,expected:ze.array,received:n.parsedType}),gt;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,l=n.data.length<i.exactLength.value;(o||l)&&(Ie(n,{code:o?_e.too_big:_e.too_small,minimum:l?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ie(n,{code:_e.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ie(n,{code:_e.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>i.type._parseAsync(new _u(n,o,n.path,l)))).then(o=>Ks.mergeArray(r,o));const a=[...n.data].map((o,l)=>i.type._parseSync(new _u(n,o,n.path,l)));return Ks.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new Xo({...this._def,minLength:{value:t,message:We.toString(n)}})}max(t,n){return new Xo({...this._def,maxLength:{value:t,message:We.toString(n)}})}length(t,n){return new Xo({...this._def,exactLength:{value:t,message:We.toString(n)}})}nonempty(t){return this.min(1,t)}}Xo.create=(e,t)=>new Xo({type:e,minLength:null,maxLength:null,exactLength:null,typeName:yt.ZodArray,...St(t)});function kf(e){if(e instanceof qn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=hu.create(kf(r))}return new qn({...e._def,shape:()=>t})}else return e instanceof Xo?new Xo({...e._def,type:kf(e.element)}):e instanceof hu?hu.create(kf(e.unwrap())):e instanceof Tm?Tm.create(kf(e.unwrap())):e instanceof _h?_h.create(e.items.map(t=>kf(t))):e}class qn extends Ft{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Bt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==ze.object){const u=this._getOrReturnCtx(t);return Ie(u,{code:_e.invalid_type,expected:ze.object,received:u.parsedType}),gt}const{status:r,ctx:i}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Su&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=a[u],h=i.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new _u(i,h,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Su){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")l.length>0&&(Ie(i,{code:_e.unrecognized_keys,keys:l}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const h=i.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new _u(i,h,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const h=await d.key,f=await d.value;u.push({key:h,value:f,alwaysSet:d.alwaysSet})}return u}).then(u=>Ks.mergeObjectSync(r,u)):Ks.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return We.errToObj,new qn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var a,o;const i=((o=(a=this._def).errorMap)==null?void 0:o.call(a,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:We.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new qn({...this._def,unknownKeys:"strip"})}passthrough(){return new qn({...this._def,unknownKeys:"passthrough"})}extend(t){return new qn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new qn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:yt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new qn({...this._def,catchall:t})}pick(t){const n={};for(const r of Bt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new qn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Bt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new qn({...this._def,shape:()=>n})}deepPartial(){return kf(this)}partial(t){const n={};for(const r of Bt.objectKeys(this.shape)){const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}return new qn({...this._def,shape:()=>n})}required(t){const n={};for(const r of Bt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof hu;)a=a._def.innerType;n[r]=a}return new qn({...this._def,shape:()=>n})}keyof(){return jte(Bt.objectKeys(this.shape))}}qn.create=(e,t)=>
vendor: 3,987 bytes, line 798
798new qn({shape:()=>e,unknownKeys:"strip",catchall:Su.create(),typeName:yt.ZodObject,...St(t)});qn.strictCreate=(e,t)=>new qn({shape:()=>e,unknownKeys:"strict",catchall:Su.create(),typeName:yt.ZodObject,...St(t)});qn.lazycreate=(e,t)=>new qn({shape:e,unknownKeys:"strip",catchall:Su.create(),typeName:yt.ZodObject,...St(t)});class H1 extends Ft{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(a){for(const l of a)if(l.result.status==="valid")return l.result;for(const l of a)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=a.map(l=>new Bi(l.ctx.common.issues));return Ie(n,{code:_e.invalid_union,unionErrors:o}),gt}if(n.common.async)return Promise.all(r.map(async a=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const l=o.map(c=>new Bi(c));return Ie(n,{code:_e.invalid_union,unionErrors:l}),gt}}get options(){return this._def.options}}H1.create=(e,t)=>new H1({options:e,typeName:yt.ZodUnion,...St(t)});function W2(e,t){const n=Pc(e),r=Pc(t);if(e===t)return{valid:!0,data:e};if(n===ze.object&&r===ze.object){const i=Bt.objectKeys(t),a=Bt.objectKeys(e).filter(l=>i.indexOf(l)!==-1),o={...e,...t};for(const l of a){const c=W2(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===ze.array&&r===ze.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let a=0;a<e.length;a++){const o=e[a],l=t[a],c=W2(o,l);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===ze.date&&r===ze.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class K1 extends Ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(a,o)=>{if(T8(a)||T8(o))return gt;const l=W2(a.value,o.value);return l.valid?((E8(a)||E8(o))&&n.dirty(),{status:n.value,value:l.data}):(Ie(r,{code:_e.invalid_intersection_types}),gt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}K1.create=(e,t,n)=>new K1({left:e,right:t,typeName:yt.ZodIntersection,...St(n)});class _h extends Ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ze.array)return Ie(r,{code:_e.invalid_type,expected:ze.array,received:r.parsedType}),gt;if(r.data.length<this._def.items.length)return Ie(r,{code:_e.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gt;!this._def.rest&&r.data.length>this._def.items.length&&(Ie(r,{code:_e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new _u(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>Ks.mergeArray(n,o)):Ks.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new _h({...this._def,rest:t})}}_h.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _h({items:e,typeName:yt.ZodTuple,rest:null,...St(t)})};class F8 extends Ft{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ze.map)return Ie(r,{code:_e.invalid_type,expected:ze.map,received:r.parsedType}),gt;const i=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([l,c],u)=>
vendor: 4,126 bytes, line 798
798({key:i._parse(new _u(r,l,r.path,[u,"key"])),value:a._parse(new _u(r,c,r.path,[u,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return gt;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return gt;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}}}}F8.create=(e,t,n)=>new F8({valueType:t,keyType:e,typeName:yt.ZodMap,...St(n)});class $x extends Ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ze.set)return Ie(r,{code:_e.invalid_type,expected:ze.set,received:r.parsedType}),gt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ie(r,{code:_e.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ie(r,{code:_e.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const a=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return gt;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const l=[...r.data.values()].map((c,u)=>a._parse(new _u(r,c,r.path,u)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new $x({...this._def,minSize:{value:t,message:We.toString(n)}})}max(t,n){return new $x({...this._def,maxSize:{value:t,message:We.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}$x.create=(e,t)=>new $x({valueType:e,minSize:null,maxSize:null,typeName:yt.ZodSet,...St(t)});class z8 extends Ft{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}z8.create=(e,t)=>new z8({getter:e,typeName:yt.ZodLazy,...St(t)});class U2 extends Ft{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ie(n,{received:n.data,code:_e.invalid_literal,expected:this._def.value}),gt}return{status:"valid",value:t.data}}get value(){return this._def.value}}U2.create=(e,t)=>new U2({value:e,typeName:yt.ZodLiteral,...St(t)});function jte(e,t){return new Cm({values:e,typeName:yt.ZodEnum,...St(t)})}class Cm extends Ft{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ie(n,{expected:Bt.joinValues(r),received:n.parsedType,code:_e.invalid_type}),gt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Ie(n,{received:n.data,code:_e.invalid_enum_value,options:r}),gt}return Ia(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Cm.create(t,{...this._def,...n})}exclude(t,n=this._def){return Cm.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Cm.create=jte;class B8 extends Ft{_parse(t){const n=Bt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ze.string&&r.parsedType!==ze.number){const i=Bt.objectValues(n);return Ie(r,{expected:Bt.joinValues(i),received:r.parsedType,code:_e.invalid_type}),gt}if(this._cache||(this._cache=new Set(Bt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=Bt.objectValues(n);return Ie(r,{received:r.data,code:_e.invalid_enum_value,options:i}),gt}return Ia(t.data)}get enum(){return this._def.values}}B8.create=(e,t)=>new B8({values:e,typeName:yt.ZodNativeEnum,...St(t)});class G1 extends Ft{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ze.promise&&n.common.async===!1)return Ie(n,{code:_e.invali
vendor: 4,075 bytes, line 798
798d_type,expected:ze.promise,received:n.parsedType}),gt;const r=n.parsedType===ze.promise?n.data:Promise.resolve(n.data);return Ia(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}G1.create=(e,t)=>new G1({type:e,typeName:yt.ZodPromise,...St(t)});class Am extends Ft{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===yt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:o=>{Ie(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return gt;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?gt:c.status==="dirty"||n.value==="dirty"?Ny(c.value):c});{if(n.value==="aborted")return gt;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?gt:l.status==="dirty"||n.value==="dirty"?Ny(l.value):l}}if(i.type==="refinement"){const o=l=>{const c=i.refinement(l,a);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?gt:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?gt:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!km(o))return gt;const l=i.transform(o.value,a);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>km(o)?Promise.resolve(i.transform(o.value,a)).then(l=>({status:n.value,value:l})):gt);Bt.assertNever(i)}}Am.create=(e,t,n)=>new Am({schema:e,typeName:yt.ZodEffects,effect:t,...St(n)});Am.createWithPreprocess=(e,t,n)=>new Am({schema:t,effect:{type:"preprocess",transform:e},typeName:yt.ZodEffects,...St(n)});class hu extends Ft{_parse(t){return this._getType(t)===ze.undefined?Ia(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}hu.create=(e,t)=>new hu({innerType:e,typeName:yt.ZodOptional,...St(t)});class Tm extends Ft{_parse(t){return this._getType(t)===ze.null?Ia(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Tm.create=(e,t)=>new Tm({innerType:e,typeName:yt.ZodNullable,...St(t)});class q2 extends Ft{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ze.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}q2.create=(e,t)=>new q2({innerType:e,typeName:yt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...St(t)});class H2 extends Ft{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return U1(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Bi(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bi(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}H2.create=(e,t)=>new H2({innerType:e,typeName:yt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...St(t)});class V8 extends Ft{_parse(t){if(this._getType(t)!==ze.nan){const r=this._getOrReturnCtx(t);
798return Ie(r,{code:_e.invalid_type,expected:ze.nan,received:r.parsedType}),gt}return{status:"valid",value:t.data}}}V8.create=e=>new V8({typeName:yt.ZodNaN,...St(e)});class _Ge extends Ft{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class oM extends Ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?gt:a.status==="dirty"?(n.dirty(),Ny(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?gt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new oM({in:t,out:n,typeName:yt.ZodPipeline})}}class K2 extends Ft{_parse(t){const n=this._def.innerType._parse(t),r=i=>(km(i)&&(i.value=Object.freeze(i.value)),i);return U1(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}K2.create=(e,t)=>new K2({innerType:e,typeName:yt.ZodReadonly,...St(t)});qn.lazycreate;var yt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(yt||(yt={}));const ut=Jc.create,SGe=Nm.create;Su.create;const Em=Xo.create,Gs=qn.create;qn.strictCreate;H1.create;K1.create;_h.create;const Lw=U2.create,Yd=Cm.create;G1.create;hu.create;Tm.create;const W8=ut().email("Please enter a valid email address"),kGe=ut().min(6,"Password must be at least 6 characters"),NGe=Gs({name:ut().min(2,"Company name must be at least 2 characters").max(100),location:ut().min(2,"Location must be at least 2 characters").max(100)}),KC=e=>e.trim().toLowerCase().endsWith("@xpharma.ai"),CGe=e=>{const t=e.lastIndexOf("@");if(t<1)return null;const n=e.slice(t+1).trim().toLowerCase();return!n.includes(".")||n.endsWith(".")?null:n},U8={color:"hsl(var(--c-accent))",fontWeight:500,background:"none",border:"none",padding:0,cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2};function ny({children:e,minimal:t}){return s.jsxs(he,{minimal:t,children:[s.jsx(Js,{title:"Sign in or request access — xPharma",description:"Sign in to your xPharma account, or request access to the limited-preview marketplace for biotech buyers and suppliers.",path:"/auth"}),s.jsx("div",{className:"xph-container",style:{display:"flex",justifyContent:"center",padding:"clamp(40px, 7vw, 88px) 24px"},children:s.jsx("div",{className:"xph-card",style:{width:"100%",maxWidth:460,padding:"clamp(28px, 4vw, 36px)"},children:e})})]})}function AGe(){const[e]=il(),t=e.get("invite"),n=e.get("email"),[r,i]=x.useState(t&&n?n:""),[a,o]=x.useState("");x.useState("");const[l,c]=x.useState(""),[u,d]=x.useState(""),[h,f]=x.useState(null),[p,m]=x.useState(null),[g,y]=x.useState(!1),[b,v]=x.useState(!1),[w,_]=x.useState(()=>t||e.get("supplier")==="true"?"supplier":e.get("buyer")==="true"?"buyer":null),[j,S]=x.useState(()=>t||e.get("supplier")==="true"||e.get("buyer")==="true"||e.get("signup")==="true"?"signup":"signin"),[k,N]=x.useState(null),[T,C]=x.useState(null),[A,O]=x.useState(null),[z,$]=x.useState(!1),[F,B]=x.useState(null),[P,I]=x.useState(!1),M=x.useRef(!1),[R,K]=x.useState(!1),[D,E]=x.useState(""),[q,X]=x.useState(0),[re,Y]=x.useState(!1),[le,Z]=x.useState(!1),[de,pe]=x.use
798State(!1),[J,be]=x.useState(""),[ee,Ce]=x.useState(null),[Re,Ze]=x.useState(null),[Ee,kt]=x.useState(null),[V,Q]=x.useState(""),[te,ve]=x.useState(!1),we=x.useRef(new Map),{user:G,isAdmin:U,isBuyer:ie,isLoading:ke,rolesReady:Ge,signIn:jt,signUp:Tn,signOut:vs}=me(),Bn=Ae(),ar=!t,{data:_r,isLoading:tn,isFetching:li,isError:Vr,refetch:Ub}=An({enabled:ar}),{data:Ki,isLoading:Uh,isFetching:ul,isError:ta,refetch:Hk}=oi({enabled:ar}),{data:at,isLoading:$t,isFetching:Ht,isError:ki,refetch:xs}=ng({enabled:ar}),or=xr(),dl=Vr||!(_r!=null&&_r.supplierUser)&&(ta||!(Ki!=null&&Ki.buyerUser)&&ki),Ni=x.useRef(!1);x.useEffect(()=>{if(Ni.current)return;const vt=window.location.hash;if(!(vt.includes("access_token")||vt.includes("type=signup")))return;const{data:{subscription:qt}}=W.auth.onAuthStateChange(zt=>{zt==="SIGNED_IN"&&!Ni.current&&(Ni.current=!0,gi.success("Email verified successfully!"),qt.unsubscribe())});return()=>qt.unsubscribe()},[]),x.useEffect(()=>{if(!t)return;(async()=>{try{const{data:rt,error:qt}=await W.functions.invoke("validate-org-invite",{body:{invite_token:t}});if(qt||!rt){console.error("validate-org-invite error:",qt);return}if(!rt.valid){B(rt.message||"This invitation is invalid.");return}rt.email&&rt.email!==r&&i(rt.email);const zt=rt.kind==="org_member"?"org_member":"supplier_personnel";N(zt),zt==="org_member"&&_("buyer");const Tt=rt.orgName||rt.supplierName;Tt&&C({orgName:Tt}),$(!0)}catch(rt){console.error("validate-org-invite failed:",rt)}})()},[t]);const Gi=t||null,[L$,Kk]=x.useState(!1);x.useEffect(()=>{if(!G||!Gi||L$)return;Kk(!0),(async()=>{I(!0),M.current=!0;let rt=k;if(!rt)try{const{data:zt}=await W.functions.invoke("validate-org-invite",{body:{invite_token:Gi}});zt!=null&&zt.valid&&(zt==null?void 0:zt.kind)==="org_member"?rt="org_member":zt!=null&&zt.valid&&(rt="supplier_personnel")}catch{}const qt=async zt=>{try{const Tt=zt==null?void 0:zt.context;if(Tt&&typeof Tt.json=="function")return await Tt.json()}catch{}return null};try{let zt=rt==="supplier_personnel"?"accept-invite":"accept-org-invite",{data:Tt,error:Sr}=await W.functions.invoke(zt,{body:{invite_token:Gi}}),Kt=Sr?await qt(Sr):null;rt!=="org_member"&&zt==="accept-org-invite"&&((Kt==null?void 0:Kt.error)??(Tt==null?void 0:Tt.error))==="invalid"&&(zt="accept-invite",{data:Tt,error:Sr}=await W.functions.invoke(zt,{body:{invite_token:Gi}}),Kt=Sr?await qt(Sr):null);const qb=zt==="accept-org-invite",Hu=async()=>{await Bn.resetQueries({queryKey:["supplier-profile"]}),await Bn.resetQueries({queryKey:["buyer-profile"]}),await Bn.resetQueries({queryKey:["partner-profile"]});const Da=(Tt==null?void 0:Tt.orgType)==="partner"?"/partner":"/buyer";or(qb?Da:"/supplier",{replace:!0})};if(Sr){if((Kt==null?void 0:Kt.error)==="already_accepted"||Kt!=null&&Kt.already_member){gi.success("You are already a member of this organization."),await Hu();return}if((Kt==null?void 0:Kt.error)==="email_mismatch"){O(Kt.message||"Email does not match the invitation."),I(!1);return}if((Kt==null?void 0:Kt.error)==="expired"){O(Kt.message||"This invitation has expired."),I(!1);return}console.error("Accept invite error:",Sr,Kt),O((Kt==null?void 0:Kt.message)||"Failed to accept invitation. Please try again."),I(!1);return}if(Tt!=null&&Tt.error){if(Tt.error==="expired")O(Tt.message||"This invitation has expired.");else if(Tt.error==="already_accepted"){gi.success("You are already a member of this organization."),await Hu();return}else Tt.error==="email_mismatch"?O(Tt.message||"Email does not match the invitation."):O(Tt.message||"Invalid invitation.");I(!1);return}if(Tt!=null&&Tt.already_member){gi.success("You are already a member of this organization."),await Hu();return}gi.success(`You've been added to ${Tt.orgName||Tt.supplierName}!`),await Hu()}catch(zt){console.error("Accept invite error:",zt),O("Failed to accept invitation."),I(!1)}})()},[G,Gi,L$,k,or,Bn]),x.useEffect(()=>{if(!t&&G){if(Vr)return;if(_r!=null&&_r.supplierUser){or(_r.isApproved?"/supplier":"/supplier/pending");return}if(ta)return;if(Ki!=null&&Ki.buyerUser){or(Ki.isApproved?"/buyer":"/buyer/pending");return}if(ki)return;if(at!=null&&at.partnerUser){or("/partner");return}if(U){or("/admin");return}if(ie&&!(Ki!=null&&Ki.buyerUser)&&!tn&&!Uh&&!$t&&!ke&&!li&&!ul&&!Ht&&Ge){or("/buyer/pending");return}if(!tn&&!Uh&&!$t&&!ke&&!li&&!ul&&!Ht&&Ge){gi.error("Your account doesn't have an active role. Redirecting to your profile."),or("/profile");return}}},[G,_r,Ki,at,U,ie,or,t,tn,Uh,$t,ke,li,ul,Ht,Vr,ta,ki,Ge]),x.useEffect(()=>{if(q<=0)return;const vt=setInterval(()=>{X(rt=>rt<=1?0:rt-1)},1e3);return()=>clearInterval(vt)},[q]),x.useEffect(()=>{if(j!=="signup"||w!=="buyer"||t)return;const vt=CGe(r);if(Ce(Tt=>Tt&&Tt.domain===vt?Tt:null),!vt)return;const rt=we.current.get(vt);if(rt!==void 0){Ce(rt?{domain:vt,org:rt}:null);return}let qt=!1;
798const zt=setTimeout(async()=>{try{const{data:Tt,error:Sr}=await W.rpc("lookup_org_by_email_domain",{_email:r});if(Sr)return;const Kt=(Tt??[])[0]??null;if(we.current.set(vt,Kt),qt)return;Ce(Kt?{domain:vt,org:Kt}:null)}catch{}},500);return()=>{qt=!0,clearTimeout(zt)}},[r,j,w,t]),x.useEffect(()=>{Re&&(!ee||ee.org.org_id!==Ee)&&(Ze(null),kt(null),Q(""),ve(!1))},[ee,Re,Ee]);const F$=()=>{try{return W8.parse(r),kGe.parse(a),!0}catch(vt){return vt instanceof Bi&&f(vt.errors[0].message),!1}},z$=x.useCallback(async vt=>{Y(!0),f(null),m(null);const{error:rt}=await W.auth.resend({type:"signup",email:vt});Y(!1),rt?f(rt.message):(m("Verification email sent! Please check your inbox and spam folder."),X(60))},[]),B$=async vt=>{if(vt.preventDefault(),f(null),m(null),pe(!1),!F$())return;y(!0);const{error:rt}=await jt(r,a);if(y(!1),rt){const qt=rt.message.toLowerCase();qt.includes("email not confirmed")?(f("Your email hasn't been verified yet. Please check your inbox for the verification link."),be(r),pe(!0)):qt.includes("invalid login credentials")?f("Invalid email or password. Please try again."):f(rt.message)}},doe=async vt=>{var qb,Hu;if(vt.preventDefault(),f(null),m(null),Z(!1),!F$())return;const rt=KC(r),qt=!!t,zt=!rt&&!qt&&w==="buyer"&&Re==="join"&&ee&&ee.org.org_id===Ee?Ee:null;if(!rt&&!qt&&!zt)try{NGe.parse({name:l,location:u})}catch(Da){if(Da instanceof Bi){f(Da.errors[0].message);return}}if(y(!0),qt)try{let Da=k;if(!Da)try{const{data:Qr}=await W.functions.invoke("validate-org-invite",{body:{invite_token:t}});Qr!=null&&Qr.valid&&(Qr==null?void 0:Qr.kind)==="org_member"?Da="org_member":Qr!=null&&Qr.valid&&(Da="supplier_personnel")}catch{}const{data:Tg,error:Gk}=await W.functions.invoke(Da==="org_member"?"signup-with-org-invite":"signup-with-invite",{body:{email:r,password:a,invite_token:t}});if(Gk){let Qr=null;try{const Yk=Gk.context;Yk&&typeof Yk.json=="function"&&(Qr=await Yk.json())}catch{}y(!1);const yoe=(Qr==null?void 0:Qr.message)||(Qr==null?void 0:Qr.error)||Gk.message||"Failed to create account.";f(yoe);return}if(Tg!=null&&Tg.error){y(!1),f(Tg.message||Tg.error);return}const{error:goe}=await jt(r,a);if(y(!1),goe){f("An account already exists with this email. Please sign in with your existing password to accept the invitation."),S("signin"),Kk(!1);return}return}catch{y(!1),f("An unexpected error occurred. Please try again.");return}const Tt=rt?{}:zt?{signup_role:"buyer",join_org_id:zt,...V.trim()?{join_message:V.trim()}:{}}:{signup_role:w,company_name:l.trim(),company_location:u.trim()},{data:Sr,error:Kt}=await Tn(r,a,Tt);if(Kt){y(!1),f(Kt.message.includes("already registered")?"This email is already registered. Please sign in instead.":Kt.message);return}if(y(!1),!(Sr!=null&&Sr.session)&&((Hu=(qb=Sr==null?void 0:Sr.user)==null?void 0:qb.identities)==null?void 0:Hu.length)===0){E(r),Z(!0),K(!0);return}if(!(Sr!=null&&Sr.session)){E(r),K(!0);return}or(rt?"/admin":w==="supplier"?"/supplier/pending":"/buyer/pending")},hoe=async vt=>{vt.preventDefault(),f(null),m(null);try{W8.parse(r)}catch(qt){if(qt instanceof Bi){f(qt.errors[0].message);return}}y(!0);const{error:rt}=await W.auth.resetPasswordForEmail(r,{redirectTo:`${window.location.origin}/reset-password`});if(y(!1),rt){f(rt.message);return}m("If an account exists with this email, a password reset link has been sent. Please check your inbox.")},foe=()=>{K(!1),E(""),Z(!1),i(""),o(""),c(""),d(""),_(t?"supplier":null),Ce(null),Ze(null),kt(null),Q(""),ve(!1),f(null),m(null),X(0)};if(ke||G&&!t&&(tn||Uh||$t||li||ul||Ht||!Ge))return s.jsx(he,{minimal:!!t,children:s.jsx("div",{className:"flex items-center justify-center py-24",children:s.jsx(ne,{className:"h-8 w-8 animate-spin",style:{color:"hsl(var(--c-accent))"}})})});if(G&&!t&&dl)return s.jsx(ny,{children:s.jsx(ii,{title:"Couldn't verify your account access",description:"One of the organization lookups failed. Retry before xPharma decides which portal to open.",onRetry:()=>{Promise.all([Ub(),Hk(),xs()])},isRetrying:li||ul||Ht})});if(F&&!G)return s.jsx(ny,{minimal:!!t,children:s.jsxs("div",{style:{textAlign:"center",padding:"8px 0"},children:[s.jsx("div",{style:{width:56,height:56,borderRadius:"50%",background:"hsl(var(--c-negative-soft))",color:"hsl(var(--c-negative-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center",marginBottom:18},children:s.jsx(ir,{size:24})}),s.jsx("h1",{className:"tt-display-md",style:{marginBottom:10},children:"Invitation unavailable"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",maxWidth:360,margin:"0 auto"},children:F}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:12},children:"Please contact the person who sent you this invitation for a new link."})]})});if(A&&!P)return s.jsx(ny,{minimal:!!t,children:s.jsxs("div",{style:{textAlign:"center",padding:"8px 0"},children:[s.jsx("div",{style:{width:56,height:56,borderRadius:"50%",background:"hsl(var(--c-negative-soft))",color:"hsl(var(--c-negative-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center",marginBottom:18},children:s.jsx(ir,{size:24})}),s.jsx("h1",{className:"tt-display-md",style:{marginBottom:10},children:"We couldn't accept the invitation"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginBottom:20},children:A}),s.jsx("button",{type:"button",onClick:()=>{O(null),M.current=!1,I(!1),Kk(!1)},className:"xph-btn xph-btn-outline",style:{padding:"8px 16px"},children:"Retry"})]})});if(P)return s.jsx(ny,{minimal:!!t,children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:14,padding:"24px 0"},children:[s.jsx(ne,{className:"h-8 w-8 animate-spin",style:{color:"hsl(var(--c-accent))"}}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))"},children:"Accepting invitation…"})]})});const V$=()=>s.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",gap:18,paddingTop:8},children:[s.jsx("div",{style:{width:60,height:60,borderRadius:"50%",background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:le?s.jsx(qs,{size:26}):s.jsx(sn,{size:26})}),s.jsxs("div",{children:[s.jsx("h2",{className:"tt-display-sm",style:{fontSize:20,marginBottom:8},children:le?"Email already registered":"Check your email"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",maxWidth:380},children:le?"This email was previously registered. Please verify it to continue with your original registration. If you need a different role, contact support.":t?`We've sent a verification link to ${D}. Once verified, you'll have immediate access to the supplier portal.`:`We've sent a verification link to ${D}. Click the link in the email to activate your account.`})]}),s.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:10,marginTop:4},children:[s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:"Didn't receive the email? Check your spam folder, or click below to resend."}),s.jsxs(je,{variant:"outline",className:"w-full",disabled:q>0||re,onClick:()=>z$(D),children:[re&&s.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}),q>0?`Resend in ${q}s`:"Resend verification email"]}),h&&s.jsx(bn,{variant:"destructive",children:s.jsx(wn,{children:h})}),p&&s.jsx(bn,{children:s.jsx(wn,{style:{color:"hsl(var(--c-positive-fg))"},children:p})}),!t&&s.jsxs(je,{variant:"ghost",className:"w-full",onClick:()=>{foe(),S("signin")},children:[s.jsx(Wt,{className:"h-4 w-4 mr-2"}),"Back to sign in"]})]})]}),poe=()=>
798s.jsxs("div",{className:"space-y-4 mt-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"role-email",children:"Email"}),s.jsx(Fe,{id:"role-email",type:"email",placeholder:"[email protected]",value:r,onChange:vt=>i(vt.target.value)})]}),KC(r)?s.jsxs("div",{className:"space-y-3",children:[s.jsx(bn,{children:s.jsxs(wn,{children:[s.jsx("strong",{children:"@xpharma.ai"})," emails are automatically registered as admin accounts."]})}),s.jsx("button",{type:"button",onClick:()=>_("buyer"),className:"xph-btn xph-btn-primary",style:{width:"100%",padding:"10px 16px",fontSize:14},children:"Continue to create account"})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",textAlign:"center"},children:"Choose your role to get started"}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("button",{type:"button",onClick:()=>_("buyer"),className:"bb-card",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:10,padding:20,background:"hsl(var(--c-card))",border:"1px solid hsl(var(--c-border))",borderRadius:10,cursor:"pointer",textAlign:"center"},children:[s.jsx("span",{style:{width:40,height:40,borderRadius:10,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(Vp,{size:20})}),s.jsx("span",{style:{fontSize:14,fontWeight:600,color:"hsl(var(--c-ink))"},children:"I'm a Buyer"}),s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",fontSize:12.5},children:"Discover & acquire assets"})]}),s.jsxs("button",{type:"button",onClick:()=>_("supplier"),className:"bb-card",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:10,padding:20,background:"hsl(var(--c-card))",border:"1px solid hsl(var(--c-border))",borderRadius:10,cursor:"pointer",textAlign:"center"},children:[s.jsx("span",{style:{width:40,height:40,borderRadius:10,background:"hsl(var(--c-positive-soft))",color:"hsl(var(--c-positive-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(pr,{size:20})}),s.jsx("span",{style:{fontSize:14,fontWeight:600,color:"hsl(var(--c-ink))"},children:"I'm a Supplier"}),s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",fontSize:12.5},children:"List & sell your assets"})]})]})]})]}),W$=()=>{const vt=KC(r),rt=!!t;return s.jsxs("div",{className:"space-y-4 mt-4",children:[rt&&s.jsxs(bn,{style:{borderColor:"hsl(var(--c-accent-border))",background:"hsl(var(--c-accent-soft))"},children:[s.jsx(pr,{className:"h-4 w-4"}),s.jsxs(wn,{children:[s.jsxs("strong",{children:["You've been invited to join ",(T==null?void 0:T.orgName)||"an organization","."]}),s.jsx("br",{}),s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))",fontSize:13},children:k==="org_member"?"Create an account to join your team on xPharma.":k==="supplier_personnel"?"Create an account to access the supplier portal.":"Create an account to join your organization on xPharma."})]})]}),!vt&&!rt&&s.jsxs(je,{variant:"ghost",size:"sm",className:"-ml-2",onClick:()=>{_(null),Ze(null),kt(null),Q(""),f(null)},children:[s.jsx(Wt,{className:"h-4 w-4 mr-2"}),"Change role"]}),!rt&&s.jsx("div",{style:{display:"inline-flex",alignItems:"center",gap:8,padding:"5px 10px",borderRadius:999,background:w==="buyer"?"hsl(var(--c-accent-soft))":w==="supplier"?"hsl(var(--c-positive-soft))":"hsl(var(--c-surface-2))",color:w==="buyer"?"hsl(var(--c-accent))":w==="supplier"?"hsl(var(--c-positive-fg))":"hsl(var(--c-fg))"},children:vt?s.jsxs(s.Fragment,{children:[s.jsx(qs,{size:13}),s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,fontWeight:500,letterSpacing:"0.06em",textTransform:"uppercase"},children:"Admin registration"})]}):w==="buyer"?s.jsxs(s.Fragment,{children:[s.jsx(Vp,{size:13}),s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,fontWeight:500,letterSpacing:"0.06em",textTransform:"uppercase"},children:"Buyer registration"})]}):s.jsxs(s.Fragment,{children:[s.jsx(pr,{size:13}),s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,fontWeight:500,letterSpacing:"0.06em",textTransform:"uppercase"},children:"Supplier registration"})]})}),s.jsxs("form",{onSubmit:doe,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"signup-email",children:"Email"}),s.jsxs("div",{className:"relative",children:[s.jsx(Fe,{id:"signup-email",type:"email",placeholder:"[email protected]",value:r,onChange:qt=>i(qt.target.value),required:!0,readOnly:rt,className:rt?"pr-10 bg-muted cursor-not-allowed":""}),rt&&s.jsx(Zo,{className:"absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"})]}),rt&&s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-subtle))",fontSize:12.5},children:"This invitation was sent to this email address."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"signup-password",children:"Password"}),s.jsx(Fe,{id:"signup-password",type:"password",placeholder:"••••••••",value:a,onChange:qt=>o(qt.target.value),required:!0})]}),vt?s.jsx(bn,{children:s.jsxs(wn,{children:["Admin accounts are created automatically for ",s.jsx("strong",{children:"@xpharma.ai"})," email addresses. No role selection or company details are needed."]})}):rt?null:s.jsxs(s.Fragment,{children:[w==="buyer"&&ee&&Re===null&&s.jsxs(bn,{style:{borderColor:"hsl(var(--c-accent-border))",background:"hsl(var(--c-accent-soft))"},children:[s.jsx(pr,{className:"h-4 w-4"}),s.jsxs(wn,{children:[s.jsxs("strong",{children:[ee.org.org_name," is already on xPharma",ee.org.masked_admin_email?` (managed by ${ee.org.masked_admin_email})`:"","."]}),s.jsx("br",{}),s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))",fontSize:13},children:"Request to join your team, or create a separate organization."}),s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:8,marginTop:10},children:[s.jsx("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:()=>{Ze("join"),kt(ee.org.org_id),ve(!1),f(null)},children:"Request to join"}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:()=>{Ze("create"),kt(ee.org.org_id)},children:"Create a separate organization"})]})]})]}),w==="buyer"&&ee&&Re==="join"?s.jsxs(s.Fragment,{children:[s.jsxs(bn,{style:{borderColor:"hsl(var(--c-accent-border))",background:"hsl(var(--c-accent-soft))"},children:[s.jsx(pr,{className:"h-4 w-4"}),s.jsxs(wn,{children:[s.jsxs("strong",{children:["Requesting to join ",ee.org.org_name,"."]})," ",s.jsx("button",{type:"button",onClick:()=>{Ze(null),kt(null),Q("")},style:U8,children:"Change"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Pe,{htmlFor:"join-message",children:["Message to your team admin"," ",s.jsx("span",{style:{color:"hsl(var(--c-fg-subtle))",fontWeight:400},children:"(optional)"})]}),s.jsx(Fe,{id:"join-message",placeholder:"Hi — I'd like to join our team on xPharma.",value:V,onChange:qt=>Q(qt.target.value),maxLength:500})]}),!te&&s.jsx(bn,{children:s.jsxs(wn,{style:{display:"flex",alignItems:"flex-start",ga
798p:8},children:[s.jsx("span",{style:{flex:1},children:"Your team's admin approves join requests — no xPharma review needed."}),s.jsx("button",{type:"button","aria-label":"Dismiss",onClick:()=>ve(!0),style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"hsl(var(--c-fg-subtle))"},children:s.jsx(Ui,{size:14})})]})})]}):s.jsxs(s.Fragment,{children:[w==="buyer"&&ee&&Re==="create"&&s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:["Creating a separate organization."," ",s.jsxs("button",{type:"button",onClick:()=>{Ze("join"),kt(ee.org.org_id),ve(!1),f(null)},style:U8,children:["Request to join ",ee.org.org_name," instead"]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"company-name",children:"Company name"}),s.jsx(Fe,{id:"company-name",placeholder:w==="buyer"?"Acme Biotech":"Acme Pharmaceuticals",value:l,onChange:qt=>c(qt.target.value),required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"company-location",children:"Company location"}),s.jsx(Fe,{id:"company-location",placeholder:w==="buyer"?"Boston, MA":"San Francisco, CA",value:u,onChange:qt=>d(qt.target.value),required:!0})]}),s.jsx(bn,{children:s.jsx(wn,{children:"Your account will be reviewed by an admin before you can access the platform."})})]})]}),h&&s.jsx(bn,{variant:"destructive",children:s.jsx(wn,{children:h})}),A&&s.jsx(bn,{variant:"destructive",children:s.jsx(wn,{children:A})}),s.jsxs(je,{type:"submit",disabled:g,className:"xph-btn xph-btn-primary",style:{width:"100%",padding:"10px 16px",fontSize:14},children:[g&&s.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}),"Create account"]})]})]})},moe=()=>s.jsxs("div",{style:{marginBottom:24},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-accent))"},children:t?"Invitation":"xPharma"}),s.jsx("h1",{className:"tt-display-md",style:{marginTop:8,marginBottom:8},children:t?"Accept your invitation":j==="signup"?"Create your account":"Sign in"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))"},children:t?k==="supplier_personnel"?"Join the supplier organization that invited you to xPharma.":"Join the organization that invited you to xPharma.":"Access verified pharma asset listings, valuations, and the data room."})]});return s.jsxs(ny,{minimal:!!t,children:[moe(),t?R?V$():s.jsx("div",{children:j==="signin"?s.jsxs("form",{onSubmit:B$,className:"space-y-4",children:[s.jsxs(bn,{style:{borderColor:"hsl(var(--c-accent-border))",background:"hsl(var(--c-accent-soft))"},children:[s.jsx(pr,{className:"h-4 w-4"}),s.jsx(wn,{children:s.jsxs("strong",{children:["Sign in to accept your invitation",T?` to ${T.orgName}`:"","."]})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"invite-signin-email",children:"Email"}),s.jsxs("div",{className:"relative",children:[s.jsx(Fe,{id:"invite-signin-email",type:"email",placeholder:"[email protected]",value:r,onChange:vt=>i(vt.target.value),required:!0,readOnly:!!t,className:t?"pr-10 bg-muted cursor-not-allowed":""}),t&&s.jsx(Zo,{className:"absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"})]}),t&&s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-subtle))",fontSize:12.5},children:"This invitation was sent to this email address."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"invite-signin-password",children:"Password"}),s.jsx(Fe,{id:"invite-signin-password",type:"password",placeholder:"••••••••",value:a,onChange:vt=>o(vt.target.value),required:!0})]}),h&&s.jsx(bn,{variant:"destructive",children:s.jsx(wn,{children:h})}),A&&s.jsx(bn,{variant:"destructive",children:s.jsx(wn,{children:A})}),s.jsxs(je,{type:"submit",disabled:g,className:"xph-btn xph-btn-primary",style:{width:"100%",padding:"10px 16px",fontSize:14},children:[g&&s.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}),"Sign in"]}),!t&&s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",textAlign:"center"},children:["Don't have an account?"," ",s.jsx("button",{type:"button",onClick:()=>{S("signup"),f(null)},style:{color:"hsl(var(--c-accent))",fontWeight:500,background:"none",border:"none",padding:0,cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2},children:"Create one"})]})]}):s.jsxs(s.Fragment,{children:[W$(),!t&&s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",textAlign:"center",marginTop:16},children:["Already have an account?"," ",s.jsx("button",{type:"button",onClick:()=>{S("signin"),f(null)},style:{color:"hsl(var(--c-accent))",fontWeight:500,background:"none",border:"none",padding:0,cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2},children:"Sign in"})]})]})}):s.jsxs(mh,{value:j,onValueChange:vt=>{S(vt),f(null),m(null),pe(!1)},className:"w-full",children:[s.jsxs(ju,{className:"grid w-full grid-cols-2",style:{background:"hsl(var(--c-surface))",border:"1px solid hsl(var(--c-border))",padding:4,borderRadius:8,height:"auto"},children:[s.jsx(Er,{value:"signin",style:{fontSize:13,fontWeight:500,padding:"7px 10px",borderRadius:6},children:"Sign in"}),s.jsx(Er,{value:"signup",style:{fontSize:13,fontWeight:500,padding:"7px 10px",borderRadius:6},children:"Sign up"})]}),s.jsx(pi,{value:"signin",children:b?s.jsxs("form",{onSubmit:hoe,className:"space-y-4 mt
798-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"tt-display-sm",style:{marginBottom:6},children:"Forgot your password?"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"Enter your email and we'll send you a link to reset your password."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"reset-email",children:"Email"}),s.jsx(Fe,{id:"reset-email",type:"email",placeholder:"[email protected]",value:r,onChange:vt=>i(vt.target.value),required:!0})]}),h&&s.jsx(bn,{variant:"destructive",children:s.jsx(wn,{children:h})}),p&&s.jsx(bn,{children:s.jsx(wn,{style:{color:"hsl(var(--c-positive-fg))"},children:p})}),s.jsxs(je,{type:"submit",disabled:g,className:"xph-btn xph-btn-primary",style:{width:"100%",padding:"10px 16px",fontSize:14},children:[g&&s.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}),"Send reset link"]}),s.jsxs(je,{type:"button",variant:"ghost",className:"w-full",onClick:()=>{v(!1),f(null),m(null)},children:[s.jsx(Wt,{className:"h-4 w-4 mr-2"}),"Back to sign in"]})]}):s.jsxs("form",{onSubmit:B$,className:"space-y-4 mt-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"signin-email",children:"Email"}),s.jsx(Fe,{id:"signin-email",type:"email",placeholder:"[email protected]",value:r,onChange:vt=>i(vt.target.value),required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between"},children:[s.jsx(Pe,{htmlFor:"signin-password",children:"Password"}),s.jsx("button",{type:"button",onClick:()=>{v(!0),f(null),m(null)},style:{background:"none",border:"none",padding:0,fontSize:12.5,color:"hsl(var(--c-fg-muted))",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2},children:"Forgot password?"})]}),s.jsx(Fe,{id:"signin-password",type:"password",placeholder:"••••••••",value:a,onChange:vt=>o(vt.target.value),required:!0})]}),h&&s.jsx(bn,{variant:"destructive",children:s.jsx(wn,{children:h})}),de&&s.jsxs(je,{type:"button",variant:"outline",className:"w-full",disabled:q>0||re,onClick:()=>z$(J),children:[re&&s.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}),q>0?`Resend in ${q}s`:"Resend verification email"]}),p&&s.jsx(bn,{children:s.jsx(wn,{style:{color:"hsl(var(--c-positive-fg))"},children:p})}),s.jsxs(je,{type:"submit",disabled:g,className:"xph-btn xph-btn-primary",style:{width:"100%",padding:"10px 16px",fontSize:14},children:[g&&s.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}),"Sign in"]})]})}),s.jsx(pi,{value:"signup",children:R?V$():w?W$():poe()})]})]})}const TGe=ut().min(6,"Password must be at least 6 characters");function EGe(){const[e,t]=x.useState(""),[n,r]=x.useState(""),[i,a]=x.useState(null),[o,l]=x.useState(!1),[c,u]=x.useState(!1),[d,h]=x.useState(!1),[f,p]=x.useState(!0),m=xr();x.useEffect(()=>{const{data:{subscription:y}}=W.auth.onAuthStateChange(w=>{w==="PASSWORD_RECOVERY"&&(h(!0),p(!1))});window.location.hash.includes("type=recovery")&&h(!0);const v=setTimeout(()=>p(!1),2e3);return()=>{y.unsubscribe(),clearTimeout(v)}},[]);const g=async y=>{y.preventDefault(),a(null);try{TGe.parse(e)}catch(v){if(v instanceof Bi){a(v.errors[0].message);return}}if(e!==n){a("Passwords do not match.");return}l(!0);const{error:b}=await W.auth.updateUser({password:e});if(l(!1),b){a(b.message);return}u(!0),await W.auth.signOut(),setTimeout(()=>m("/auth"),3e3)};return f?s.jsxs(he,{children:[s.jsx(Js,{title:"Reset password — xPharma",description:"Set a new password for your xPharma account.",path:"/reset-password",noindex:!0}),s.jsx("div",{className:"flex items-center justify-center py-24",children:s.jsx(ne,{className:"h-8 w-8 animate-spin",style:{color:"hsl(var(--c-accent))"}})})]}):d?s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{display:"flex",justifyContent:"center",padding:"clamp(48px, 8vw, 96px) 24px"},children:s.jsx("div",{className:"xph-card",style:{width:"100%",maxWidth:440,padding:"clamp(28px, 4vw, 36px)"},children:c?s.jsxs("div",{style:{textAlign:"center"},children:[s.jsx("div",{style:{width:56,height:56,borderRadius:"50%",background:"hsl(var(--c-positive-soft))",color:"hsl(var(--c-positive-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center",marginBottom:18},children:s.jsx(sn,{size:26})}),s.jsx("h1",{className:"tt-display-md",style:{marginBottom:10},children:"Password updated"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))"},children:"You're all set. Redirecting you to sign in…"})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8,padding:"5px 10px",borderRadius:999,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",marginBottom:14},children:[s.jsx(Hs,{size:13}),s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,fontWeight:500,letterSpacing:"0.06em",textTransform:"uppercase"},children:"Account recovery"})]}),s.jsx("h1",{className:"tt-display-md",style:{marginBottom:8},children:"Set a new password"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginBottom:24},children:"Choose a strong password you haven't used here before."}),s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"new-password",children:"New password"}),s.jsx(Fe,{id:"new-password",type:"password",placeholder:"••••••••",value:e,onCh
798ange:y=>t(y.target.value),required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"confirm-password",children:"Confirm password"}),s.jsx(Fe,{id:"confirm-password",type:"password",placeholder:"••••••••",value:n,onChange:y=>r(y.target.value),required:!0})]}),i&&s.jsx(bn,{variant:"destructive",children:s.jsx(wn,{children:i})}),s.jsxs(je,{type:"submit",disabled:o,className:"xph-btn xph-btn-primary",style:{width:"100%",padding:"10px 16px",fontSize:14},children:[o&&s.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}),"Update password"]})]})]})})})}):s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{display:"flex",justifyContent:"center",padding:"clamp(48px, 8vw, 96px) 24px"},children:s.jsxs("div",{className:"xph-card",style:{width:"100%",maxWidth:440,padding:"clamp(28px, 4vw, 36px)"},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-negative-fg))"},children:"Reset password"}),s.jsx("h1",{className:"tt-display-md",style:{marginTop:10,marginBottom:12},children:"This link is no longer valid"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginBottom:24},children:"The reset link has expired or already been used. Request a new one from the sign-in page."}),s.jsx("button",{type:"button",onClick:()=>m("/auth"),className:"xph-btn xph-btn-primary",style:{width:"100%",padding:"10px 16px",fontSize:14},children:"Go to sign in"})]})})})}async function PGe(e,t){if(!t.actorUserId)return;const n=t.route??(typeof window<"u"?window.location.pathname+window.location.search:void 0),r=t.sessionId??QI({userId:t.actorUserId??null,effectiveUserId:t.effectiveUserId??t.actorUserId??null}),i=typeof navigator<"u"?navigator.userAgent:void 0,a={actor_user_id:t.actorUserId,effective_user_id:t.effectiveUserId??t.actorUserId,action:e.action,entity_type:e.entityType,entity_id:e.entityId??null,entity_label:e.entityLabel??null,metadata:e.metadata??{},context:{route:n,session_id:r,impersonating:t.impersonating??!1,user_agent:i},source:"app"};try{const{error:o}=await W.from("audit_logs").insert(a);o&&console.warn("[audit] insert failed",o)}catch(o){console.warn("[audit] insert threw",o)}}const Ve={pharmaAssets:"pharma_assets",suppliers:"suppliers",supplierUsers:"supplier_users",buyerUsers:"buyer_users",buyerDD:"buyer_dd_runs",supplierDD:"supplier_dd_runs",dataRoomDocuments:"data_room_documents",assetVerificationWorkflow:"asset_verification_workflow",userRoles:"user_roles",buyerInquiries:"buyer_inquiries",buyerWatchlist:"buyer_watchlist",valuationRuns:"valuation_runs",valuationConfig:"valuation_config",profiles:"profiles",supplierPersonnel:"supplier_personnel",assetChatConversations:"asset_chat_conversations",assetChatMessages:"asset_chat_messages",assetExtractions:"asset_extractions",supplierOnboarding:"supplier_onboarding",verificationSteps:"verification_steps",agentDefinitions:"agent_definitions",agentRuns:"agent_runs",agentRunFailures:"agent_run_failures",organizations:"organizations",orgInvitations:"org_invitations",orgJoinRequests:"org_join_requests",workspaces:"workspaces",workspaceAssets:"workspace_assets",partnerUsers:"partner_users",partnerEngagementDocuments:"partner_engagement_documents"};function Ye(){const{user:e}=me(),{impersonating:t,isImpersonating:n}=qe();return x.useCallback(r=>{if(!e)return Promise.resolve();const i=n&&(t!=null&&t.userId)?t.userId:e.id;return PGe(r,{actorUserId:e.id,effectiveUserId:i,impersonating:n})},[e,n,t])}function OGe(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async r=>{if(t("Creating asset"))throw new Error("Impersonation mode");const{data:i,error:a}=await W.from("pharma_assets").insert(r).select().single();if(a)throw a;return i},onSuccess:r=>{e.invalidateQueries({queryKey:["pharma-assets"]}),n({action:"create_asset",entityType:Ve.pharmaAssets,entityId:r.id,entityLabel:r.product_name,metadata:{stage:r.stage,modality:r.modality,supplier_id:r.supplier_id}})}})}function IGe(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async({id:r,...i})=>{if(t("Updating asset"))throw new Error("Impersonation mode");const{data:a,error:o}=await W.from("pharma_assets").update(i).eq("id",r).select().single();if(o)throw o;return a},onSuccess:(r,i)=>
798{e.invalidateQueries({queryKey:["pharma-assets"]}),n({action:"update_asset",entityType:Ve.pharmaAssets,entityId:r.id,entityLabel:r.product_name,metadata:{updated_fields:Object.keys(i).filter(a=>a!=="id")}})}})}function _te(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async r=>{if(t("Deleting asset"))throw new Error("Impersonation mode");const{data:i}=await W.from("pharma_assets").select("product_name").eq("id",r).maybeSingle();await W.from("verification_steps").delete().eq("asset_id",r);const{error:a}=await W.from("pharma_assets").delete().eq("id",r);if(a)throw a;return{id:r,productName:(i==null?void 0:i.product_name)??null}},onSuccess:({id:r,productName:i})=>{e.invalidateQueries({queryKey:["pharma-assets"]}),n({action:"delete_asset",entityType:Ve.pharmaAssets,entityId:r,entityLabel:i})}})}async function Ste(e){try{const{error:t}=await W.functions.invoke("notify-asset-event",{body:e});t&&console.error("notify-asset-event invoke error:",{payload:e,error:t})}catch(t){console.error("notify-asset-event threw:",{payload:e,err:t})}}function RGe(){const e=Ae(),t=Ye();return $e({mutationFn:async({assetId:n,assetName:r})=>{const{error:i}=await W.from("pharma_assets").update({asset_status:"published",asset_rejection_reason:null}).eq("id",n);if(i)throw i;return Ste({action:"approved",assetId:n}),{assetId:n,assetName:r}},onSuccess:({assetId:n,assetName:r})=>{e.invalidateQueries({queryKey:["pending-assets"]}),e.invalidateQueries({queryKey:["pharma-assets"]}),e.invalidateQueries({queryKey:["supplier-assets"]}),t({action:"approve_asset",entityType:Ve.pharmaAssets,entityId:n,entityLabel:r})}})}function DGe(){const e=Ae(),t=Ye();return $e({mutationFn:async({assetId:n,reason:r,assetName:i})=>{const{error:a}=await W.from("pharma_assets").update({asset_status:"rejected",asset_rejection_reason:r}).eq("id",n);if(a)throw a;return Ste({action:"rejected",assetId:n,reason:r}),{assetId:n,assetName:i,reason:r}},onSuccess:({assetId:n,assetName:r,reason:i})=>{e.invalidateQueries({queryKey:["pending-assets"]}),e.invalidateQueries({queryKey:["pharma-assets"]}),e.invalidateQueries({queryKey:["supplier-assets"]}),t({action:"reject_asset",entityType:Ve.pharmaAssets,entityId:n,entityLabel:r,metadata:{reason:i}})}})}function kte(){const e=Ae(),t=Ye(),{guardMutation:n}=qe();return $e({mutationFn:async({assetId:r,assetName:i,note:a})=>{if(n("Returning asset to draft"))throw new Error("Impersonation mode");const{error:o}=await W.from("pharma_assets").update({asset_status:"draft",asset_rejection_reason:a&&a.length>0?a:null}).eq("id",r);if(o)throw o;return{assetId:r,assetName:i,note:a}},onSuccess:({assetId:r,assetName:i,note:a})=>{e.invalidateQueries({queryKey:["pending-assets"]}),e.invalidateQueries({queryKey:["pharma-assets"]}),e.invalidateQueries({queryKey:["supplier-assets"]}),e.invalidateQueries({queryKey:["market-assets"]}),e.invalidateQueries({queryKey:["pharma-asset",r]}),t({action:"return_asset_to_draft",entityType:Ve.pharmaAssets,entityId:r,entityLabel:i,metadata:a?{note:a}:void 0})}})}const Br=oS,Nte=MR,MGe=lS,Cte=x.forwardRef(({className:e,...t},n)=>s.jsx(rg,{ref:n,className:ae("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}));Cte.displayName=rg.displayName;const br=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(MGe,{children:[s.jsx(Cte,{}),s.jsxs(ig,{ref:r,className:ae("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,s.jsxs(cS,{className:"absolute right-4 top-4 roun
798ded-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:[s.jsx(Ui,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));br.displayName=ig.displayName;const wr=({className:e,...t})=>s.jsx("div",{className:ae("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});wr.displayName="DialogHeader";const _i=({className:e,...t})=>s.jsx("div",{className:ae("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});_i.displayName="DialogFooter";const jr=x.forwardRef(({className:e,...t},n)=>s.jsx(hb,{ref:n,className:ae("text-lg font-semibold leading-none tracking-tight",e),...t}));jr.displayName=hb.displayName;const So=x.forwardRef(({className:e,...t},n)=>s.jsx(fb,{ref:n,className:ae("text-sm text-muted-foreground",e),...t}));So.displayName=fb.displayName;const Ys=x.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:ae("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
798ing-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:n,...t}));Ys.displayName="Textarea";function Ate({open:e,onOpenChange:t,assetName:n,isLoading:r,onConfirm:i}){const[a,o]=x.useState("");return x.useEffect(()=>{e&&o("")},[e]),s.jsx(Br,{open:e,onOpenChange:t,children:s.jsxs(br,{children:[s.jsxs(wr,{children:[s.jsx(jr,{children:"Return asset to draft"}),s.jsxs(So,{children:[n?`“${n}” `:"This asset ","will move back to draft. The supplier can edit it again, and it will no longer be visible to buyers until it is resubmitted and re-approved."]})]}),s.jsxs("div",{className:"space-y-2 py-2",children:[s.jsx(Pe,{htmlFor:"return-to-draft-note",children:"Note for the supplier (optional)"}),s.jsx(Ys,{id:"return-to-draft-note",placeholder:"Explain what needs to change before resubmission…",value:a,onChange:l=>o(l.target.value),rows:4})]}),s.jsxs(_i,{children:[s.jsx(je,{variant:"outline",onClick:()=>t(!1),disabled:r,children:"Cancel"}),s.jsxs(je,{onClick:()=>i(a.trim()),disabled:r,children:[r&&s.jsx(ne,{className:"h-4 w-4 mr-2 animate-spin"}),"Return to draft"]})]})]})})}function Tte(){const{isAdmin:e}=me();return Se({queryKey:["pending-suppliers"],queryFn:async()=>{const{data:t,error:n}=await W.from("supplier_users").select(`
799          id,
800          user_id,
801          supplier_id,
802          pending_company_name,
803          pending_company_location,
804          status,
805          rejection_reason,
806          created_at,
807          updated_at,
808          suppliers (
809            id,
810            name,
811            location,
812            verified,
813            assets_listed
814          )
815        `).order("created_at",{ascending:!1});if(n)throw console.error("Error fetching pending suppliers:",n),n;const r=(t==null?void 0:t.map(o=>o.user_id))||[],{data:i}=await W.from("profiles").select("user_id, email").in("user_id",r),a=new Map((i==null?void 0:i.map(o=>[o.user_id,o.email]))||[]);return(t||[]).map(o=>{const l=o.suppliers;return{id:o.id,userId:o.user_id,supplierId:o.supplier_id,pendingCompanyName:o.pending_company_name,pendingCompanyLocation:o.pending_company_location,status:o.status,rejectionReason:o.rejection_reason,createdAt:o.created_at,updatedAt:o.updated_at,userEmail:a.get(o.user_id)||"Unknown",supplierName:(l==null?void 0:l.name)||o.pending_company_name||"New Company",supplier:l?{id:l.id,name:l.name,location:l.location,verified:l.verified,assetsListed:l.assets_listed}:void 0}})},enabled:e})}function Ete(){const{isAdmin:e}=me();return Se({queryKey:["pending-assets"],queryFn:async()=>{const{data:t,error:n}=await W.from("pharma_assets").select(`
816          *,
817          suppliers (*)
818        `).eq("asset_status","pending_review").order("created_at",{ascending:!1});if(n)throw console.error("Error fetching pending assets:",n),n;if(!(t!=null&&t.length))return[];const r=[...new Set(t.map(a=>a.submitted_by).filter(Boolean))];let i={};if(r.length>0){const{data:a}=await W.from("profiles").select("user_id, email").in("user_id",r);if(a)for(const o of a)i[o.user_id]=o}return t.map(a=>{const o=a.submitted_by?i[a.submitted_by]:null;return sl({...a,_submitterEmail:(o==null?void 0:o.email)??null,_submitterUserId:(o==null?void 0:o.user_id)??null})})},enabled:e})}const $Ge="modulepreload",LGe=function(e){return"/"+e},q8={},la=function(t,n,r){let i=Promise.resolve();if(n&&n.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"));i=Promise.allSettled(n.map(c=>{if(c=LGe(c),c in q8)return;q8[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":$Ge,u||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),u)return new Promise((f,p)=>{h.addEventListener("load",f),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})};function Pte(){const{isAdmin:e}=me();return Se({queryKey:["pending-buyers"],queryFn:async()=>{const{data:t,error:n}=await W.from("buyer_users").select("*, organizations(*)").order("created_at",{ascending:!1});if(n)throw console.error("Error fetching pending buyers:",n),n;const r=(t==null?void 0:t.map(c=>
818c.user_id))||[],{data:i}=await W.from("profiles").select("user_id, email").in("user_id",r),a={};i==null||i.forEach(c=>{c.email&&(a[c.user_id]=c.email)});const o=(t||[]).filter(c=>c.status==="pending"&&c.org_id).map(c=>c.org_id),l={};return await Promise.all(o.map(async c=>{const{data:u,error:d}=await W.rpc("find_similar_buyer_orgs",{_org_id:c});if(d){console.warn("find_similar_buyer_orgs failed for org",c,d);return}l[c]=(u||[]).map(h=>({orgId:h.org_id,name:h.name,status:h.status,createdAt:h.created_at,memberCount:h.member_count}))})),(t||[]).map(c=>({id:c.id,userId:c.user_id,orgId:c.org_id,orgRole:c.org_role,pendingCompanyName:c.pending_company_name,pendingCompanyLocation:c.pending_company_location,companyName:c.company_name,companyLocation:c.company_location,status:c.status,rejectionReason:c.rejection_reason,createdAt:c.created_at,updatedAt:c.updated_at,userEmail:a[c.user_id],organization:Zv(c.organizations),similarOrgs:c.org_id?l[c.org_id]:void 0}))},enabled:e})}function FGe(){const e=Ae(),t=Ye();return $e({mutationFn:async({buyerId:n,buyerEmail:r,companyName:i})=>{const{data:a,error:o}=await W.from("buyer_users").select("*").eq("id",n).single();if(o)throw o;const{error:l}=await W.from("buyer_users").update({status:"approved",company_name:a.pending_company_name,company_location:a.pending_company_location,rejection_reason:null}).eq("id",n);if(l)throw l;if(r){const{sendNotification:c}=await la(async()=>{const{sendNotification:u}=await Promise.resolve().then(()=>Ote);return{sendNotification:u}},void 0);c({templateName:"buyer-approved",recipientEmail:r,recipientUserId:a.user_id,preferenceKey:"buyer_approved",templateData:{companyName:i||a.pending_company_name},idempotencyKey:`buyer-approved-${n}`})}return{buyerId:n,companyName:i||a.pending_company_name,orgId:a.org_id}},onSuccess:({buyerId:n,companyName:r,orgId:i})=>{e.invalidateQueries({queryKey:["pending-buyers"]}),t({action:"approve_buyer",entityType:Ve.buyerUsers,entityId:n,entityLabel:r,metadata:{org_id:i}})}})}function zGe(){const e=Ae(),t=Ye();return $e({mutationFn:async({buyerId:n,reason:r,buyerEmail:i,companyName:a})=>{const{data:o}=await W.from("buyer_users").select("user_id, pending_company_name, org_id").eq("id",n).single(),{error:l}=await W.from("buyer_users").update({status:"rejected",rejection_reason:r}).eq("id",n);if(l)throw l;if(i){const{sendNotification:c}=await la(async()=>{const{sendNotification:u}=await Promise.resolve().then(()=>Ote);return{sendNotification:u}},void 0);c({templateName:"buyer-rejected",recipientEmail:i,recipientUserId:o==null?void 0:o.user_id,preferenceKey:"buyer_rejected",templateData:{companyName:a||(o==null?void 0:o.pending_company_name),reason:r},idempotencyKey:`buyer-rejected-${n}`})}return{buyerId:n,reason:r,companyName:a||(o==null?void 0:o.pending_company_name),orgId:o==null?void 0:o.org_id}},onSuccess:({buyerId:n,reason:r,companyName:i,orgId:a})=>{e.invalidateQueries({queryKey:["pending-buyers"]}),t({action:"reject_buyer",entityType:Ve.buyerUsers,entityId:n,entityLabel:i,metadata:{reason:r,org_id:a}})}})}async function dk({templateName:e,recipientEmail:t,recipientUserId:n,preferenceKey:r,templateData:i,idempotencyKey:a}){try{await W.functions.invoke("send-transactional-email",{body:{templateName:e,recipientEmail:t,recipientUserId:n,preferenceKey:r,idempotencyKey:a,templateData:i}})}catch(o){console.error("Failed to send notification:",o)}}const Ote=Object.freeze(Object.defineProperty({__proto__:null,sendNotification:dk},Symbol.toStringTag,{value:"Module"}));function Ite(){const{isAdmin:e}=me();return Se({queryKey:["all-inquiries"],queryFn:async()=>{const{data:t,error:n}=await W.from("buyer_inquiries").select(`
819          id,
820          buyer_user_id,
821          asset_id,
822          message,
823          status,
824          admin_notes,
825          created_at,
826          responded_at,
827          buyer_users (
828            id,
829            user_id,
830            company_name,
831            company_location,
832            pending_company_name,
833            pending_company_location,
834            status
835          ),
836          pharma_assets (
837            id,
838            product_name,
839            primary_target,
840            modality,
841            lead_indication,
842            stage,
843            estimated_npv
844          )
845        `).order("created_at",{ascending:!1});if(n)throw console.error("Error fetching inquiries:",n),n;const r=(t==null?void 0:t.map(o=>{var l;return(l=o.buyer_users)==null?void 0:l.user_id}
845).filter(Boolean))||[],{data:i}=await W.from("profiles").select("user_id, email").in("user_id",r),a={};return i==null||i.forEach(o=>{o.email&&(a[o.user_id]=o.email)}),(t||[]).map(o=>{var l,c,u,d,h,f,p,m,g,y;return{id:o.id,buyerUserId:o.buyer_user_id,assetId:o.asset_id,message:o.message,status:o.status,adminNotes:o.admin_notes,createdAt:o.created_at,respondedAt:o.responded_at,assetName:(l=o.pharma_assets)==null?void 0:l.product_name,assetTarget:(c=o.pharma_assets)==null?void 0:c.primary_target,assetModality:(u=o.pharma_assets)==null?void 0:u.modality,assetStage:(d=o.pharma_assets)==null?void 0:d.stage,buyerCompanyName:((h=o.buyer_users)==null?void 0:h.company_name)||((f=o.buyer_users)==null?void 0:f.pending_company_name),buyerCompanyLocation:((p=o.buyer_users)==null?void 0:p.company_location)||((m=o.buyer_users)==null?void 0:m.pending_company_location),buyerEmail:(g=o.buyer_users)!=null&&g.user_id?a[o.buyer_users.user_id]:void 0,buyerAuthUserId:(y=o.buyer_users)==null?void 0:y.user_id}})},enabled:e})}function BGe(){const e=Ae(),t=Ye();return $e({mutationFn:async({inquiryId:n,status:r,adminNotes:i,buyerEmail:a,buyerAuthUserId:o,assetName:l})=>{const c={status:r};r==="responded"&&(c.responded_at=new Date().toISOString()),i!==void 0&&(c.admin_notes=i);const{error:u}=await W.from("buyer_inquiries").update(c).eq("id",n);if(u)throw u;return a&&dk({templateName:"inquiry-status-updated",recipientEmail:a,recipientUserId:o,preferenceKey:"inquiry_status_updated",templateData:{assetName:l,status:r,adminNotes:i},idempotencyKey:`inquiry-updated-${n}-${r}`}),{inquiryId:n,status:r,assetName:l,adminNotes:i}},onSuccess:({inquiryId:n,status:r,assetName:i,adminNotes:a})=>{e.invalidateQueries({queryKey:["all-inquiries"]}),t({action:"update_inquiry_status",entityType:Ve.buyerInquiries,entityId:n,entityLabel:i,metadata:{status:r,has_admin_notes:!!a}})}})}var Ab=e=>e.type==="checkbox",Ed=e=>e instanceof Date,Pi=e=>e==null;const Rte=e=>typeof e=="object";var rr=e=>!Pi(e)&&!Array.isArray(e)&&Rte(e)&&!Ed(e),Dte=e=>rr(e)&&e.target?Ab(e.target)?e.target.checked:e.target.value:e,VGe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Mte=(e,t)=>e.has(VGe(t)),WGe=e=>{const t=e.constructor&&e.constructor.prototype;return rr(t)&&t.hasOwnProperty("isPrototypeOf")},lM=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ar(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(lM&&(e instanceof Blob||r))&&(n||rr(e)))if(t=n?[]:{},!n&&!WGe(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=Ar(e[i]));else return e;return t}var hk=e=>/^\w*$/.test(e),Xn=e=>e===void 0,cM=e=>Array.isArray(e)?e.filter(Boolean):[],uM=e=>cM(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Te=(e,t,n)=>{if(!t||!rr(e))return n;const r=(hk(t)?[t]:uM(t)).reduce((i,a)=>Pi(i)?i:i[a],e);return Xn(r)||r===e?Xn(e[t])?n:e[t]:r},Is=e=>typeof e=="boolean",Qt=(e,t,n)=>{let r=-1;const i=hk(t)?[t]:uM(t),a=i.length,o=a-1;for(;++r<a;){const l=i[r];let c=n;if(r!==o){const u=e[l];c=rr(u)||Array.isArray(u)?u:isNaN(+i[r+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=c,e=e[l]}};const Y1={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},to={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},pl={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},dM=L.createContext(null);dM.displayName="HookFormContext";const fk=()=>L.useContext(dM),UGe=e=>{const{children:t,...n}=e;return L.createElement(dM.Provider,{value:n},t)};var $te=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const o=a;return t._proxyFormState[o]!==to.all&&(t._proxyFormState[o]=!r||to.all),n&&(n[o]=!0),e[o]}});return i};const hM=typeof window<"u"?L.useLayoutEffect:L.useEffect;function qGe(e){const t=fk(),{control:n=t.control,disabled:r,name:i,exact:a}=e||{},[o,l]=L.useState(n._formState),c=L.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return hM(()=>n._subscribe({name:i,formState:c.current,exact:a,callback:u=>{!r&&l({...n._formState,...u})}}),[i,r,a]),L.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),L.useMemo(()=>$te(o,n,c.current,!1),[o,n])}var Vo=e=>typeof e=="string",Lte=(e,t,n,r,i)=>Vo(e)?(r&&t.watch.add(e),Te(n,e,i)):Array.isArray(e)?e.map(a=>
845(r&&t.watch.add(a),Te(n,a))):(r&&(t.watchAll=!0),n),G2=e=>Pi(e)||!Rte(e);function Nl(e,t,n=new WeakSet){if(G2(e)||G2(t))return e===t;if(Ed(e)&&Ed(t))return e.getTime()===t.getTime();const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const a of r){const o=e[a];if(!i.includes(a))return!1;if(a!=="ref"){const l=t[a];if(Ed(o)&&Ed(l)||rr(o)&&rr(l)||Array.isArray(o)&&Array.isArray(l)?!Nl(o,l,n):o!==l)return!1}}return!0}function HGe(e){const t=fk(),{control:n=t.control,name:r,defaultValue:i,disabled:a,exact:o,compute:l}=e||{},c=L.useRef(i),u=L.useRef(l),d=L.useRef(void 0);u.current=l;const h=L.useMemo(()=>n._getWatch(r,c.current),[n,r]),[f,p]=L.useState(u.current?u.current(h):h);return hM(()=>n._subscribe({name:r,formState:{values:!0},exact:o,callback:m=>{if(!a){const g=Lte(r,n._names,m.values||n._formValues,!1,c.current);if(u.current){const y=u.current(g);Nl(y,d.current)||(p(y),d.current=y)}else p(g)}}}),[n,a,r,o]),L.useEffect(()=>n._removeUnmounted()),f}function KGe(e){const t=fk(),{name:n,disabled:r,control:i=t.control,shouldUnregister:a,defaultValue:o}=e,l=Mte(i._names.array,n),c=L.useMemo(()=>
vendor: 9,121 bytes, line 845
845Te(i._formValues,n,Te(i._defaultValues,n,o)),[i,n,o]),u=HGe({control:i,name:n,defaultValue:c,exact:!0}),d=qGe({control:i,name:n,exact:!0}),h=L.useRef(e),f=L.useRef(i.register(n,{...e.rules,value:u,...Is(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const p=L.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Te(d.errors,n)},isDirty:{enumerable:!0,get:()=>!!Te(d.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Te(d.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Te(d.validatingFields,n)},error:{enumerable:!0,get:()=>Te(d.errors,n)}}),[d,n]),m=L.useCallback(v=>f.current.onChange({target:{value:Dte(v),name:n},type:Y1.CHANGE}),[n]),g=L.useCallback(()=>f.current.onBlur({target:{value:Te(i._formValues,n),name:n},type:Y1.BLUR}),[n,i._formValues]),y=L.useCallback(v=>{const w=Te(i._fields,n);w&&v&&(w._f.ref={focus:()=>v.focus&&v.focus(),select:()=>v.select&&v.select(),setCustomValidity:_=>v.setCustomValidity(_),reportValidity:()=>v.reportValidity()})},[i._fields,n]),b=L.useMemo(()=>({name:n,value:u,...Is(r)||d.disabled?{disabled:d.disabled||r}:{},onChange:m,onBlur:g,ref:y}),[n,r,d.disabled,m,g,y,u]);return L.useEffect(()=>{const v=i._options.shouldUnregister||a;i.register(n,{...h.current.rules,...Is(h.current.disabled)?{disabled:h.current.disabled}:{}});const w=(_,j)=>{const S=Te(i._fields,_);S&&S._f&&(S._f.mount=j)};if(w(n,!0),v){const _=Ar(Te(i._options.defaultValues,n));Qt(i._defaultValues,n,_),Xn(Te(i._formValues,n))&&Qt(i._formValues,n,_)}return!l&&i.register(n),()=>{(l?v&&!i._state.action:v)?i.unregister(n):w(n,!1)}},[n,i,l,a]),L.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),L.useMemo(()=>({field:b,formState:d,fieldState:p}),[b,d,p])}const GGe=e=>e.render(KGe(e));var Fte=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},nv=e=>Array.isArray(e)?e:[e],H8=()=>{let e=[];return{get observers(){return e},next:i=>{for(const a of e)a.next&&a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}},Ji=e=>rr(e)&&!Object.keys(e).length,fM=e=>e.type==="file",no=e=>typeof e=="function",Q1=e=>{if(!lM)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},zte=e=>e.type==="select-multiple",pM=e=>e.type==="radio",YGe=e=>pM(e)||Ab(e),GC=e=>Q1(e)&&e.isConnected;function QGe(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Xn(e)?r++:e[t[r++]];return e}function XGe(e){for(const t in e)if(e.hasOwnProperty(t)&&!Xn(e[t]))return!1;return!0}function lr(e,t){const n=Array.isArray(t)?t:hk(t)?[t]:uM(t),r=n.length===1?e:QGe(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(rr(r)&&Ji(r)||Array.isArray(r)&&XGe(r))&&lr(e,n.slice(0,-1)),e}var Bte=e=>{for(const t in e)if(no(e[t]))return!0;return!1};function X1(e,t={}){const n=Array.isArray(e);if(rr(e)||n)for(const r in e)Array.isArray(e[r])||rr(e[r])&&!Bte(e[r])?(t[r]=Array.isArray(e[r])?[]:{},X1(e[r],t[r])):Pi(e[r])||(t[r]=!0);return t}function Vte(e,t,n){const r=Array.isArray(e);if(rr(e)||r)for(const i in e)Array.isArray(e[i])||rr(e[i])&&!Bte(e[i])?Xn(t)||G2(n[i])?n[i]=Array.isArray(e[i])?X1(e[i],[]):{...X1(e[i])}:Vte(e[i],Pi(t)?{}:t[i],n[i]):n[i]=!Nl(e[i],t[i]);return n}var ry=(e,t)=>Vte(e,t,X1(t));const K8={value:!1,isValid:!1},G8={value:!0,isValid:!0};var Wte=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Xn(e[0].attributes.value)?Xn(e[0].value)||e[0].value===""?G8:{value:e[0].value,isValid:!0}:G8:K8}return K8},Ute=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Xn(e)?e:t?e===""?NaN:e&&+e:n&&Vo(e)?new Date(e):r?r(e):e;const Y8={isValid:!1,value:null};var qte=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Y8):Y8;function Q8(e){const t=e.ref;return fM(t)?t.files:pM(t)?qte(e.refs).value:zte(t)?[...t.selectedOptions].map(({value:n})=>n):Ab(t)?Wte(e.refs).value:Ute(Xn(t.value)?e.ref.value:t.value,e)}var ZGe=(e,t,n,r)=>{const i={};for(const a of e){const o=Te(t,a);o&&Qt(i,a,o._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Z1=e=>e instanceof RegExp,iy=e=>Xn(e)?e:Z1(e)?e.source:rr(e)?Z1(e.value)?e.value.source:e.value:e,X8=e=>({isOnSubmit:!e||e===to.onSubmit,isOnBlur:e===to.onBlur,isOnChange:e===to.onChange,isOnAll:e===to.all,isOnTouch:e===to.onTouched});const Z8="AsyncFunction";var JGe=e=>!!e&&!!e.validate&&!!(no(e.validate)&&e.validate.constructor.name===Z8||rr(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Z8)),eYe=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),J8=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const rv=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const a=Te(e,i);if(a){const{_f:o,...l}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],i)&&!r)return!0;if(o.ref&&t(o.ref,o.name)&&!r)return!0;if(rv(l,t))break}else if(rr(l)&&rv(l,t))break}}};function eV(e,t,n){const r=Te(e,n);if(r||hk(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const a=i.join("."),o=Te(t,a),l=Te(e,a);if(o&&!Array.isArray(o)&&n!==a)return{name:n};if(l&&l.type)return{name:a,error:l};if(l&&l.root&&l.root.type)return{name:`${a}.root`,error:l.root};i.pop()}return{name:n}}var tYe=(e,t,n,r)=>{n(e);const{name:i,...a}=e;return Ji(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!r||to.all))},nYe=(e,t,n)=>!e||!t||e===t||nv(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),rYe=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,iYe=(e,t)=>!cM(Te(e,t)).length&&lr(e,t),sYe=(e,t,n)=>{const r=nv(Te(e,n));return Qt(r,"root",t[n]),Qt(e,n,r),e},Fw=e=>Vo(e);function tV(e,t,n="validate"){if(Fw(e)||Array.isArray(e)&&e.every(Fw)||Is(e)&&!e)return{type:n,message:Fw(e)?e:"",ref:t}}var uf=e=>rr(e)&&!Z1(e)?e:{value:e,message:""},nV=async(e,t,n,r,i,a)=>{const{ref:o,refs:l,required:c,maxLength:u,minLength:d,min:h,max:f,pattern:p,validate:m,name:g,valueAsNumber:y,mount:b}=e._f,v=Te(n,g);if(!b||t.has(g))return{};const w=l?l[0]:o,_=O=>{i&&w.reportValidity&&(w.setCustomValidity(Is(O)?"":O||""),w.reportValidity())},j={},S=pM(o),k=Ab(o),N=S||k,T=(y||fM(o))&&Xn(o.value)&&Xn(v)||Q1(o)&&o.value===""||v===""||Array.isArray(v)&&!v.length,C=Fte.bind(null,g,r,j),A=(O,z,$,F=pl.maxLength,B=pl.minLength)=>{const P=O?z:$;j[g]={type:O?F:B,message:P,ref:o,...C(O?F:B,P)}};if(a?!Array.isArray(v)||!v.length:c&&(!N&&(T||Pi(v))||Is(v)&&!v||k&&!Wte(l).isValid||S&&!qte(l).isValid)){const{value:O,message:z}=Fw(c)?{value:!!c,message:c}:uf(c);if(O&&(j[g]={type:pl.required,message:z,ref:w,...C(pl.required,z)},!r))return _(z),j}if(!T&&(!Pi(h)||!Pi(f))){let O,z;const $=uf(f),F=uf(h);if(!Pi(v)&&!isNaN(v)){const B=o.valueAsNumber||v&&+v;Pi($.value)||(O=B>$.value),Pi(F.value)||(z=B<F.value)}else{const B=o.valueAsDate||new Date(v),P=R=>new Date(new Date().toDateString()+" "+R),I=o.type=="time",M=o.type=="week";Vo($.value)&&v&&(O=I?P(v)>P($.value):M?v>$.value:B>new Date($.value)),Vo(F.value)&&v&&(z=I?P(v)<P(F.value):M?v<F.value:B<new Date(F.value))}if((O||z)&&(A(!!O,$.message,F.message,pl.max,pl.min),!r))return _(j[g].message),j}if((u||d)&&!T&&(Vo(v)||a&&Array.isArray(v))){const O=uf(u),z=uf(d),$=!Pi(O.value)&&v.length>+O.value,F=!Pi(z.value)&&v.length<+z.value;if(($||F)&&(A($,O.message,z.message),!r))return _(j[g].message),j}if(p&&!T&&Vo(v)){const{value:O,message:z}=uf(p);if(Z1(O)&&!v.match(O)&&(j[g]={type:pl.pattern,message:z,ref:o,...C(pl.pattern,z)},!r))return _(z),j}if(m){if(no(m)){const O=await m(v,n),z=tV(O,w);if(z&&(j[g]={...z,...C(pl.validate,z.message)},!r))return _(z.message),j}else if(rr(m)){let O={};for(const z in m){if(!Ji(O)&&!r)break;const $=tV(await m[z](v,n),w,z);$&&(O={...$,...C(z,$.message)},_($.message),r&&(j[g]=O))}if(!Ji(O)&&(j[g]={ref:w,...O},!r))return j}}return _(!0),j};const aYe={mode:to.onSubmit,reValidateMode:to.onChange,shouldFocusError:!0};function oYe(e={}){let t={...aYe,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:no(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=rr(t.defaultValues)||rr(t.values)?Ar(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:Ar(i),o={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...d};const f={array:H8(),state:H8()},p=t.criteriaMode===to.all,m=V=>Q=>{clearTimeout(u),u=setTimeout(V,Q)},g=async V=>{if(!t.disabled&&(d.isValid||h.isValid||V)){const Q=t.resolver?Ji((await k()).errors):await T(r,!0);Q!==n.isValid&&f.state.next({isValid:Q})}},y=(V,Q)=>{!t.disabled&&(d.isValidating||d.validatingFields||h.isValidating||h.validatingFields)&&((V||Array.from(l.mount)).forEac
vendor: 10,073 bytes, line 845
845h(te=>{te&&(Q?Qt(n.validatingFields,te,Q):lr(n.validatingFields,te))}),f.state.next({validatingFields:n.validatingFields,isValidating:!Ji(n.validatingFields)}))},b=(V,Q=[],te,ve,we=!0,G=!0)=>{if(ve&&te&&!t.disabled){if(o.action=!0,G&&Array.isArray(Te(r,V))){const U=te(Te(r,V),ve.argA,ve.argB);we&&Qt(r,V,U)}if(G&&Array.isArray(Te(n.errors,V))){const U=te(Te(n.errors,V),ve.argA,ve.argB);we&&Qt(n.errors,V,U),iYe(n.errors,V)}if((d.touchedFields||h.touchedFields)&&G&&Array.isArray(Te(n.touchedFields,V))){const U=te(Te(n.touchedFields,V),ve.argA,ve.argB);we&&Qt(n.touchedFields,V,U)}(d.dirtyFields||h.dirtyFields)&&(n.dirtyFields=ry(i,a)),f.state.next({name:V,isDirty:A(V,Q),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Qt(a,V,Q)},v=(V,Q)=>{Qt(n.errors,V,Q),f.state.next({errors:n.errors})},w=V=>{n.errors=V,f.state.next({errors:n.errors,isValid:!1})},_=(V,Q,te,ve)=>{const we=Te(r,V);if(we){const G=Te(a,V,Xn(te)?Te(i,V):te);Xn(G)||ve&&ve.defaultChecked||Q?Qt(a,V,Q?G:Q8(we._f)):$(V,G),o.mount&&g()}},j=(V,Q,te,ve,we)=>{let G=!1,U=!1;const ie={name:V};if(!t.disabled){if(!te||ve){(d.isDirty||h.isDirty)&&(U=n.isDirty,n.isDirty=ie.isDirty=A(),G=U!==ie.isDirty);const ke=Nl(Te(i,V),Q);U=!!Te(n.dirtyFields,V),ke?lr(n.dirtyFields,V):Qt(n.dirtyFields,V,!0),ie.dirtyFields=n.dirtyFields,G=G||(d.dirtyFields||h.dirtyFields)&&U!==!ke}if(te){const ke=Te(n.touchedFields,V);ke||(Qt(n.touchedFields,V,te),ie.touchedFields=n.touchedFields,G=G||(d.touchedFields||h.touchedFields)&&ke!==te)}G&&we&&f.state.next(ie)}return G?ie:{}},S=(V,Q,te,ve)=>{const we=Te(n.errors,V),G=(d.isValid||h.isValid)&&Is(Q)&&n.isValid!==Q;if(t.delayError&&te?(c=m(()=>v(V,te)),c(t.delayError)):(clearTimeout(u),c=null,te?Qt(n.errors,V,te):lr(n.errors,V)),(te?!Nl(we,te):we)||!Ji(ve)||G){const U={...ve,...G&&Is(Q)?{isValid:Q}:{},errors:n.errors,name:V};n={...n,...U},f.state.next(U)}},k=async V=>{y(V,!0);const Q=await t.resolver(a,t.context,ZGe(V||l.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return y(V),Q},N=async V=>{const{errors:Q}=await k(V);if(V)for(const te of V){const ve=Te(Q,te);ve?Qt(n.errors,te,ve):lr(n.errors,te)}else n.errors=Q;return Q},T=async(V,Q,te={valid:!0})=>{for(const ve in V){const we=V[ve];if(we){const{_f:G,...U}=we;if(G){const ie=l.array.has(G.name),ke=we._f&&JGe(we._f);ke&&d.validatingFields&&y([ve],!0);const Ge=await nV(we,l.disabled,a,p,t.shouldUseNativeValidation&&!Q,ie);if(ke&&d.validatingFields&&y([ve]),Ge[G.name]&&(te.valid=!1,Q))break;!Q&&(Te(Ge,G.name)?ie?sYe(n.errors,Ge,G.name):Qt(n.errors,G.name,Ge[G.name]):lr(n.errors,G.name))}!Ji(U)&&await T(U,Q,te)}}return te.valid},C=()=>{for(const V of l.unMount){const Q=Te(r,V);Q&&(Q._f.refs?Q._f.refs.every(te=>!GC(te)):!GC(Q._f.ref))&&Y(V)}l.unMount=new Set},A=(V,Q)=>!t.disabled&&(V&&Q&&Qt(a,V,Q),!Nl(R(),i)),O=(V,Q,te)=>Lte(V,l,{...o.mount?a:Xn(Q)?i:Vo(V)?{[V]:Q}:Q},te,Q),z=V=>cM(Te(o.mount?a:i,V,t.shouldUnregister?Te(i,V,[]):[])),$=(V,Q,te={})=>{const ve=Te(r,V);let we=Q;if(ve){const G=ve._f;G&&(!G.disabled&&Qt(a,V,Ute(Q,G)),we=Q1(G.ref)&&Pi(Q)?"":Q,zte(G.ref)?[...G.ref.options].forEach(U=>U.selected=we.includes(U.value)):G.refs?Ab(G.ref)?G.refs.forEach(U=>{(!U.defaultChecked||!U.disabled)&&(Array.isArray(we)?U.checked=!!we.find(ie=>ie===U.value):U.checked=we===U.value||!!we)}):G.refs.forEach(U=>U.checked=U.value===we):fM(G.ref)?G.ref.value="":(G.ref.value=we,G.ref.type||f.state.next({name:V,values:Ar(a)})))}(te.shouldDirty||te.shouldTouch)&&j(V,we,te.shouldTouch,te.shouldDirty,!0),te.shouldValidate&&M(V)},F=(V,Q,te)=>{for(const ve in Q){if(!Q.hasOwnProperty(ve))return;const we=Q[ve],G=V+"."+ve,U=Te(r,G);(l.array.has(V)||rr(we)||U&&!U._f)&&!Ed(we)?F(G,we,te):$(G,we,te)}},B=(V,Q,te={})=>{const ve=Te(r,V),we=l.array.has(V),G=Ar(Q);Qt(a,V,G),we?(f.array.next({name:V,values:Ar(a)}),(d.isDirty||d.dirtyFields||h.isDirty||h.dirtyFields)&&te.shouldDirty&&f.state.next({name:V,dirtyFields:ry(i,a),isDirty:A(V,G)})):ve&&!ve._f&&!Pi(G)?F(V,G,te):$(V,G,te),J8(V,l)&&f.state.next({...n,name:V}),f.state.next({name:o.mount?V:void 0,values:Ar(a)})},P=async V=>{o.mount=!0;const Q=V.target;let te=Q.name,ve=!0;const we=Te(r,te),G=ke=>{ve=Number.isNaN(ke)||Ed(ke)&&isNaN(ke.getTime())||Nl(ke,Te(a,te,ke))},U=X8(t.mode),ie=X8(t.reValidateMode);if(we){let ke,Ge;const jt=Q.type?Q8(we._f):Dte(V),Tn=V.type===Y1.BLUR||V.type===Y1.FOCUS_OUT,vs=!eYe(we._f)&&!t.resolver&&!Te(n.errors,te)&&!we._f.deps||rYe(Tn,Te(n.touchedFields,te),n.isSubmitted,ie,U),Bn=J8(te,l,Tn);Qt(a,te,jt),Tn?(we._f.onBlur&&we._f.onBlur(V),c&&c(0)):we._f.onChange&&we._f.onChange(V);const ar=j(te,jt,Tn),_r=!Ji(ar)||Bn;if(!Tn&&f.state.next({name:te,type:V.type,values:Ar(a)}),vs)return(d.isValid||h.isValid)&&(t.mode==="onBlur"?Tn&&g():Tn||g()),_r&&f.state.next({name:te,...Bn?{}:ar});if(!Tn&&Bn&&f.state.next({...n}),t.resolver){const{errors:tn}=await k([te]);if(G(jt),ve){const li=eV(n.errors,r,te),Vr=eV(tn,r,li.name||te);ke=Vr.error,te=Vr.name,Ge=Ji(tn)}}else y([te],!0),ke=(await nV(we,l.disabled,a,p,t.shouldUseNativeValidation))[te],y([te]),G(jt),ve&&(ke?Ge=!1:(d.isValid||h.isValid)&&(Ge=await T(r,!0)));ve&&(we._f.deps&&M(we._f.deps),S(te,Ge,ke,ar))}},I=(V,Q)=>{if(Te(n.errors,Q)&&V.focus)return V.focus(),1},M=async(V,Q={})=>{let te,ve;const we=nv(V);if(t.resolver){const G=await N(Xn(V)?V:we);te=Ji(G),ve=V?!we.some(U=>Te(G,U)):te}else V?(ve=(await Promise.all(we.map(async G=>{const U=Te(r,G);return await T(U&&U._f?{[G]:U}:U)}))).every(Boolean),!(!ve&&!n.isValid)&&g()):ve=te=await T(r);return f.state.next({...!Vo(V)||(d.isValid||h.isValid)&&te!==n.isValid?{}:{name:V},...t.resolver||!V?{isValid:te}:{},errors:n.errors}),Q.shouldFocus&&!ve&&rv(r,I,V?we:l.mount),ve},R=V=>{const Q={...o.mount?a:i};return Xn(V)?Q:Vo(V)?Te(Q,V):V.map(te=>Te(Q,te))},K=(V,Q)=>({invalid:!!Te((Q||n).errors,V),isDirty:!!Te((Q||n).dirtyFields,V),error:Te((Q||n).errors,V),isValidating:!!Te(n.validatingFields,V),isTouched:!!Te((Q||n).touchedFields,V)}),D=V=>{V&&nv(V).forEach(Q=>lr(n.errors,Q)),f.state.next({errors:V?n.errors:{}})},E=(V,Q,te)=>{const ve=(Te(r,V,{_f:{}})._f||{}).ref,we=Te(n.errors,V)||{},{ref:G,message:U,type:ie,...ke}=we;Qt(n.errors,V,{...ke,...Q,ref:ve}),f.state.next({name:V,errors:n.errors,isValid:!1}),te&&te.shouldFocus&&ve&&ve.focus&&ve.focus()},q=(V,Q)=>no(V)?f.state.subscribe({next:te=>"values"in te&&V(O(void 0,Q),te)}):O(V,Q,!0),X=V=>f.state.subscribe({next:Q=>{nYe(V.name,Q.name,V.exact)&&tYe(Q,V.formState||d,Ze,V.reRenderRoot)&&V.callback({values:{...a},...n,...Q,defaultValues:i})}}).unsubscribe,re=V=>(o.mount=!0,h={...h,...V.formState},X({...V,formState:h})),Y=(V,Q={})=>{for(const te of V?nv(V):l.mount)l.mount.delete(te),l.array.delete(te),Q.keepValue||(lr(r,te),lr(a,te)),!Q.keepError&&lr(n.errors,te),!Q.keepDirty&&lr(n.dirtyFields,te),!Q.keepTouched&&lr(n.touchedFields,te),!Q.keepIsValidating&&lr(n.validatingFields,te),!t.shouldUnregister&&!Q.keepDefaultValue&&lr(i,te);f.state.next({values:Ar(a)}),f.state.next({...n,...Q.keepDirty?{isDirty:A()}:{}}),!Q.keepIsValid&&g()},le=({disabled:V,name:Q})=>{(Is(V)&&o.mount||V||l.disabled.has(Q))&&(V?l.disabled.add(Q):l.disabled.delete(Q))},Z=(V,Q={})=>{let te=Te(r,V);const ve=Is(Q.disabled)||Is(t.disabled);return Qt(r,V,{...te||{},_f:{...te&&te._f?te._f:{ref:{name:V}},name:V,mount:!0,...Q}}),l.mount.add(V),te?le({disabled:Is(Q.disabled)?Q.disabled:t.disabled,name:V}):_(V,!0,Q.value),{...ve?{disabled:Q.disabled||t.disabled}:{},...t.progressive?{required:!!Q.required,min:iy(Q.min),max:iy(Q.max),minLength:iy(Q.minLength),maxLength:iy(Q.maxLength),pattern:iy(Q.pattern)}:{},name:V,onChange:P,onBlur:P,ref:we=>{if(we){Z(V,Q),te=Te(r,V);const G=Xn(we.value)&&we.querySelectorAll&&we.querySelectorAll("input,select,textarea")[0]||we,U=YGe(G),ie=te._f.refs||[];if(U?ie.find(ke=>ke===G):G===te._f.ref)return;Qt(r,V,{_f:{...te._f,...U?{refs:[...ie.filter(GC),G,...Array.isArray(Te(i,V))?[{}]:[]],ref:{type:G.type,name:V}}:{ref:G}}}),_(V,!1,void 0,G)}else te=Te(r,V,{}),te._f&&(te._f.mount=!1),(t.shouldUnregister||Q.shouldUnregister)&&!(Mte(l.array,V)&&o.action)&&l.unMount.add(V)}}},de=()=>t.shouldFocusError&&rv(r,I,l.mount),pe=V=>{Is(V)&&(f.state.next({disabled:V}),rv(r,(Q,te)=>{const ve=Te(r,te);ve&&(Q.disabled=ve._f.disabled||V,Array.isArray(ve._f.refs)&&ve._f.refs.forEach(we=>{we.disabled=ve._f.disabled||V}))},0,!1))},J=(V,Q)=>async te=>{let ve;te&&(te.preventDefault&&te.preventDefault(),te.persist&&te.persist());let we=Ar(a);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:G,values:U}=await k();n.errors=G,we=Ar(U)}else await T(r);if(l.disabled.size)for(const G of l.disabled)lr(we,G);if(lr(n.errors,"root"),Ji(n.errors)){f.state.next({errors:{}});try{await V(we,te)}catch(G){ve=G}}else Q&&await Q({...n.errors},te),de(),setTimeout(de);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ji(n.errors)&&!ve,submitCount:n.submitCount+1,errors:n.errors}),ve)throw ve},be=(V,Q={})=>{Te(r,V)&&(Xn(Q.defaultValue)?B(V,Ar(Te(i,V))):(B(V,Q.defaultValue),Qt(i,V,Ar(Q.defaultValue))),Q.keepTouched||lr(n.touchedFields,V),Q.keepDirty||(lr(n.dirtyFields,V),n.isDirty=Q.defaultValue?A(V,Ar(Te(i,V))):A()),Q.keepError||(lr(n.errors,V),d.isValid&&g()),f.state.next({...n}))},ee=(V,Q={})=>{const te=V?Ar(V):i,ve=Ar(te),we=Ji(V),G=we?i:ve;if(Q.keepDefaultValues||(i=te),!Q.keepValues){if(Q.keepDirtyValues){const U=new Set([...l.mount,...Object.keys(ry(i,a))]);for(const ie of Array.from(U))Te(n.dirtyFields,ie)?Qt(G,ie,Te(a,ie)):B(ie,Te(G,ie))}else{if(lM&&Xn(V))for(const U of l.mount){const ie=Te(r,U);if(ie&&ie._f){const ke=Array.isArray(ie._f.refs)?ie._f.refs[0]:ie._f.ref;if(Q1(ke)){const Ge=ke.closest("form");if(Ge){Ge.reset();break}}}}if(Q.keepFieldsRef)for(const U of l.mount)B(U,Te(G,U));else r={}}a=t.shouldUnregister?Q.keepDefaultValues?Ar(i):{}:Ar(G),f.array.next({values:{...G}}),f.state.next({values:{...G}})}l={mount:Q.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!Q.keepIsValid||!!Q.keepDirtyValues,o.watch=!!t.shouldUnregister,f.state.next({submitCount:Q.keepSubmitCount?n.submitCount:0,isDirty:we?!1:Q.
845keepDirty?n.isDirty:!!(Q.keepDefaultValues&&!Nl(V,i)),isSubmitted:Q.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:we?{}:Q.keepDirtyValues?Q.keepDefaultValues&&a?ry(i,a):n.dirtyFields:Q.keepDefaultValues&&V?ry(i,V):Q.keepDirty?n.dirtyFields:{},touchedFields:Q.keepTouched?n.touchedFields:{},errors:Q.keepErrors?n.errors:{},isSubmitSuccessful:Q.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Ce=(V,Q)=>ee(no(V)?V(a):V,Q),Re=(V,Q={})=>{const te=Te(r,V),ve=te&&te._f;if(ve){const we=ve.refs?ve.refs[0]:ve.ref;we.focus&&(we.focus(),Q.shouldSelect&&no(we.select)&&we.select())}},Ze=V=>{n={...n,...V}},kt={control:{register:Z,unregister:Y,getFieldState:K,handleSubmit:J,setError:E,_subscribe:X,_runSchema:k,_focusError:de,_getWatch:O,_getDirty:A,_setValid:g,_setFieldArray:b,_setDisabledField:le,_setErrors:w,_getFieldArray:z,_reset:ee,_resetDefaultValues:()=>no(t.defaultValues)&&t.defaultValues().then(V=>{Ce(V,t.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:C,_disableForm:pe,_subjects:f,_proxyFormState:d,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(V){o=V},get _defaultValues(){return i},get _names(){return l},set _names(V){l=V},get _formState(){return n},get _options(){return t},set _options(V){t={...t,...V}}},subscribe:re,trigger:M,register:Z,handleSubmit:J,watch:q,setValue:B,getValues:R,reset:Ce,resetField:be,clearErrors:D,unregister:Y,setError:E,setFocus:Re,getFieldState:K};return{...kt,formControl:kt}}function lYe(e={}){const t=L.useRef(void 0),n=L.useRef(void 0),[r,i]=L.useState({isDirty:!1,isValidating:!1,isLoading:no(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:no(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!no(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...l}=oYe(e);t.current={...l,formState:r}}const a=t.current.control;return a._options=e,hM(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState}),reRenderRoot:!0});return i(l=>({...l,isReady:!0})),a._formState.isReady=!0,o},[a]),L.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),L.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),L.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),L.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),L.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==r.isDirty&&a._subjects.state.next({isDirty:o})}},[a,r.isDirty]),L.useEffect(()=>{e.values&&!Nl(e.values,n.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),n.current=e.values,i(o=>({...o}))):a._resetDefaultValues()},[a,e.values]),L.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=$te(r,a),t.current}const rV=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Te(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Hte=(e,t)=>
845{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?rV(r.ref,n,e):r.refs&&r.refs.forEach(i=>rV(i,n,e))}},cYe=(e,t)=>{t.shouldUseNativeValidation&&Hte(e,t);const n={};for(const r in e){const i=Te(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.ref});if(uYe(t.names||Object.keys(e),r)){const o=Object.assign({},Te(n,r));Qt(o,"root",a),Qt(n,r,o)}else Qt(n,r,a)}return n},uYe=(e,t)=>e.some(n=>n.startsWith(t+"."));var dYe=function(e,t){for(var n={};e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(".");if(!n[o])if("unionErrors"in r){var l=r.unionErrors[0].errors[0];n[o]={message:l.message,type:l.code}}else n[o]={message:a,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(h){return e.push(h)})}),t){var c=n[o].types,u=c&&c[r.code];n[o]=Fte(o,t,n,i,u?[].concat(u,r.message):r.message)}e.shift()}return n},hYe=function(e,t,n){return n===void 0&&(n={}),function(r,i,a){try{return Promise.resolve(function(o,l){try{var c=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(u){return a.shouldUseNativeValidation&&Hte({},a),{errors:{},values:n.raw?r:u}})}catch(u){return l(u)}return c&&c.then?c.then(void 0,l):c}(0,function(o){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(o))return{values:{},errors:cYe(dYe(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}}};const fYe=UGe,Kte=x.createContext({}),sa=({...e})=>s.jsx(Kte.Provider,{value:{name:e.name},children:s.jsx(GGe,{...e})}),pk=()=>{const e=x.useContext(Kte),t=x.useContext(Gte),{getFieldState:n,formState:r}=fk(),i=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...i}},Gte=x.createContext({}),Ss=x.forwardRef(({className:e,...t},n)=>{const r=x.useId();return s.jsx(Gte.Provider,{value:{id:r},children:s.jsx("div",{ref:n,className:ae("space-y-2",e),...t})})});Ss.displayName="FormItem";const ks=x.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:i}=pk();return s.jsx(Pe,{ref:n,className:ae(r&&"text-destructive",e),htmlFor:i,...t})});ks.displayName="FormLabel";const Ns=x.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:i,formMessageId:a}=pk();return s.jsx(B9,{ref:t,id:r,"aria-describedby":n?`${i} ${a}`:`${i}`,"aria-invalid":!!n,...e})});Ns.displayName="FormControl";const pYe=x.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=pk();return s.jsx("p",{ref:n,id:r,className:ae("text-sm text-muted-foreground",e),...t})});pYe.displayName="FormDescription";const Cs=x.forwardRef(({className:e,children:t,...n},r)=>{const{error:i,formMessageId:a}=pk(),o=i?String(i==null?void 0:i.message):t;return o?s.jsx("p",{ref:r,id:a,className:ae("text-sm font-medium text-destructive",e),...n,children:o}):null});Cs.displayName="FormMessage";const mYe=Gs({product_name:ut().min(1,"Name is required").max(100),primary_target:ut().max(100).optional(),modality:Yd(["small-molecule","antibody","adc","cell-therapy","gene-therapy","peptide","rna"]),lead_indication:ut().max(200).optional(),stage:Yd(["discovery","glp-tox","pre-ind","ind-filing","clinical"]),origin:ut().max(200).optional(),supplier_id:ut().uuid("Please select a supplier"),mechanism_of_action:ut().max(1e3).optional(),current_stage_details:ut().max(1e3).optional(),next_steps_required:ut().max(500),verification_status:Yd(["pending","in-progress","verified"]),estimated_npv:SGe().min(0,"NPV must be positive")});function gYe({open:e,onOpenChange:t,asset:n}){const{data:r=[]}=hS(),i=OGe(),a=IGe(),{toast:o}=xt(),l=!!n,c=lYe({resolver:hYe(mYe),defaultValues:{product_name:"",primary_target:"",modality:"small-molecule",lead_indication:"",stage:"discovery",origin:"",supplier_id:"",mechanism_of_action:"",current_stage_details:"",next_steps_required:"",verification_status:"pending",estimated_npv:0}});x.useEffect(()=>{n?c.reset({product_name:n.productName,primary_target:n.primaryTarget||"",modality:n.modality,lead_indication:n.leadIndication||"",stage:n.stage,origin:n.origin||"",supplier_id:n.supplier.id,mechanism_of_action:n.mechanismOfAction||"",current_stage_details:n.currentStageDetails||"",next_steps_required:n.nextStepsRequired.join(", "),verification_status:n.verificationStatus,estimated_npv:n.estimatedNPV}):c.reset({product_name:"",primary_target:"",modality:"small-molecule",lead_indication:"",stage:"discovery",origin:"",supplier_id:"",mechanism_of_action:"",current_stage_details:"",next_steps_required:"",verification_status:"pending",estimated_npv:0})},[n,c]);const u=async h=>{const f=h.next_steps_required.split(",").map(p=>p.trim()).filter(p=>p.length>0);try{l?(await a.mutateAsync({id:n.id,product_name:h.product_name,primary_target:h.primary_target,modality:h.modality,lead_indication:h.lead_indication,stage:h.stage,origin:h.origin,supplier_id:h.supplier_id,mechanism_of_action:h.mechanism_of_action,current_stage_details:h.current_stage_details,verification_status:h.verification_status,estimated_npv:h.estimated_npv,next_steps_required:f}),o({title:"Asset updated successfully"})):(await i.mutateAsync({product_name:h.product_name,primary_target:h.primary_target,modality:h.modality,lead_indication:h.lead_indication,stage:h.stage,origin:h.origin,supplier_id:h.supplier_id,mechanism_of_action:h.mechanism_of_action,current_stage_details:h.current_stage_details,verification_status:h.verification_status,estimated_npv:h.estimated_npv,next_steps_required:f}),o({title:"Asset created successfully"})),t(!1)}catch(p){o({title:"Error",description:p.message||"Failed to save asset",variant:"destructive"})}},d=i.isPending||a.isPending;return s.jsx(Br,{open:e,onOpenChange:t,children:s.jsxs(br,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsx(wr,{children:s.jsx(jr,{children:l?"Edit Asset":"Create New Asset"})}),s.jsx(fYe,{...c,children:s.jsxs("form",{onSubmit:c.handleSubmit(u),className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(sa,{control:c.control,name:"product_name",render:({field:h})=>s.jsxs(Ss,{children:[s.jsx(ks,{children:"Asset Name"}),s.jsx(Ns,{children:s.jsx(Fe,{placeholder:"ISM-3312",...h})}),s.jsx(Cs,{})]})}),s.jsx(sa,{control:c.control,name:"primary_target",render:({field:h})=>s.jsxs(Ss,{children:[s.jsx(ks,{children:"Target"}),s.jsx(Ns,{children:s.jsx(Fe,{placeholder:"PD-L1",...h})}),s.jsx(Cs,{})]})})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(sa,{control:c.control,name:"modality",render:({field:h})=>s.jsxs(Ss,{children:[s.jsx(ks,{children:"Modality"}),s.jsxs($n,{onValueChange:h.onChange,value:h.value,children:[s.jsx(Ns,{children:s.jsx(On,{children:s.jsx(Ln,{placeholder:"Select modality"})})}),s.jsx(In,{children:Object.entries(Zt).map(([f,p])=>s.jsx(Rt,{value:f,children:p},f))})]}),s.jsx(Cs,{})]})}),s.jsx(sa,{control:c.control,name:"stage",render:({field:h})=>s.jsxs(Ss,{children:[s.jsx(ks,{children:"Development Stage"}),s.jsxs($n,{onValueChange:h.onChange,value:h.value,children:[s.jsx(Ns,{children:s.jsx(On,{children:s.jsx(Ln,{placeholder:"Select stage"})})}),s.jsx(In,{children:mb.map(f=>s.jsx(Rt,{value:f,children:Nn[f]},f))})]}),s.jsx(Cs,{})]})})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(sa,{control:c.control,name:"lead_indication",render:({field:h})=>s.jsxs(Ss,{children:[s.jsx(ks,{children:"Indication"}),s.jsx(Ns,{children:s.jsx(Fe,{placeholder:"NSCLC",...h})}),s.jsx(Cs,{})]})}),s.jsx(sa,{control:c.control,name:"origin",render:({field:h})=>s.jsxs(Ss,{children:[s.jsx(ks,{children:"Origin"}),s.jsx(Ns,{children:s.jsx(Fe,{placeholder:"AI-Driven Discovery",...h})}),s.jsx(Cs,{})]})})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(sa,{control:c.control,name:"supplier_id",render:({field:h})=>s.jsxs(Ss,{children:[s.jsx(ks,{children:"Supplier"}),s.jsxs($n,{onValueChange:h.onChange,value:h.value,children:[s.jsx(Ns,{children:s.jsx(On,{children:s.jsx(Ln,{placeholder:"Select supplier"})})}),s.jsx(In,{children:r.map(f=>s.jsx(Rt,{value:f.id,children:f.name},f.id))})]}),s.jsx(Cs,{})]})}),s.jsx(sa,{control:c.control,name:"verification_status",render:({field:h})=>s.jsxs(Ss,{children:[s.jsx(ks,{children:"Verification Status"}),s.jsxs($n,{onValueChange:h.onChange,value:h.value,children:[s.jsx(Ns,{children:s.jsx(On,{children:s.jsx(Ln,{placeholder:"Select status"})})}),s.jsxs(In,{children:[s.jsx(Rt,{value:"pending",children:"Pending"}),s.jsx(Rt,{value:"in-progress",children:"In Progress"}),s.jsx(Rt,{value:"verified",children:"Verified"})]})]}),s.jsx(Cs,{})]})})]}),s.jsx(sa,{control:c.control,name:"estimated_npv",render:({field:h})=>s.jsxs(Ss,{children:[s.jsx(ks,{children:"Estimated NPV ($)"}),s.jsx(Ns,{children:s.jsx(Fe,{type:"number",placeholder:"50000000",...h,onChange:f=>h.onChange(Number(f.target.value))})}),s.jsx(Cs,{})]})}),s.jsx(sa,{control:c.control,name:"mechanism_of_action",render:({field:h})=>s.jsxs(Ss,{children:[s.jsx(ks,{children:"Mechanism of Action"}),s.jsx(Ns,{children:s.jsx(Ys,{placeholder:"Describe the mechanism of action...",rows:3,...h})}),s.jsx(Cs,{})]})}),s.jsx(sa,{control:c.control,name:"current_stage_details",render:({field:h})=>s.jsxs(Ss,{children:[s.jsx(ks,{children:"Current Stage Details"}),s.jsx(Ns,{children:s.jsx(Ys,{placeholder:"Describe current development status...",rows:3,...h})}),s.jsx(Cs,{})]})}),s.jsx(sa,{control:c.control,name:"next_steps_required",render:({field:h})=>s.jsxs(Ss,{children:[s.jsx(ks,{children:"Next Steps (comma separated)"}),s.jsx(Ns,{children:s.jsx(Fe,{placeholder:"Complete GLP tox, IND submission, Phase 1",...h})}),s.jsx(Cs,{})]})}),s.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[s.jsx(je,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsxs(je,{type:"submit",disabled:d,children:[d&&s.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}
845),l?"Update Asset":"Create Asset"]})]})]})})]})})}var Yte="AlertDialog",[yYe,Mpt]=sr(Yte,[CY]),uc=CY(),Qte=e=>{const{__scopeAlertDialog:t,...n}=e,r=uc(t);return s.jsx(oS,{...r,...n,modal:!0})};Qte.displayName=Yte;var vYe="AlertDialogTrigger",xYe=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=uc(n);return s.jsx(MR,{...i,...r,ref:t})});xYe.displayName=vYe;var bYe="AlertDialogPortal",Xte=e=>{const{__scopeAlertDialog:t,...n}=e,r=uc(t);return s.jsx(lS,{...r,...n})};Xte.displayName=bYe;var wYe="AlertDialogOverlay",Zte=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=uc(n);return s.jsx(rg,{...i,...r,ref:t})});Zte.displayName=wYe;var vp="AlertDialogContent",[jYe,_Ye]=yYe(vp),SYe=W9("AlertDialogContent"),Jte=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,a=uc(n),o=x.useRef(null),l=Ke(t,o),c=x.useRef(null);return s.jsx(wSe,{contentName:vp,titleName:ene,docsSlug:"alert-dialog",children:s.jsx(jYe,{scope:n,cancelRef:c,children:s.jsxs(ig,{role:"alertdialog",...a,...i,ref:l,onOpenAutoFocus:fe(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[s.jsx(SYe,{children:r}),s.jsx(NYe,{contentRef:o})]})})})});Jte.displayName=vp;var ene="AlertDialogTitle",tne=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=uc(n);return s.jsx(hb,{...i,...r,ref:t})});tne.displayName=ene;var nne="AlertDialogDescription",rne=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=uc(n);return s.jsx(fb,{...i,...r,ref:t})});rne.displayName=nne;var kYe="AlertDialogAction",ine=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=uc(n);return s.jsx(cS,{...i,...r,ref:t})});ine.displayName=kYe;var sne="AlertDialogCancel",ane=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=_Ye(sne,n),a=uc(n),o=Ke(t,i);return s.jsx(cS,{...a,...r,ref:o})});ane.displayName=sne;var NYe=({contentRef:e})=>{const t=`\`${vp}\` requires a description for the component to be accessible for screen reader users.
846
847You can add a description to the \`${vp}\` by passing a \`${nne}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
848
849Alternatively, 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 \`${vp}\`. 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.
850
851For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return x.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},CYe=Qte,AYe=Xte,one=Zte,lne=Jte,cne=ine,une=ane,dne=tne,hne=rne;const xp=CYe,TYe=AYe,fne=x.forwardRef(({className:e,...t},n)=>s.jsx(one,{className:ae("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));fne.displayName=one.displayName;const Qd=x.forwardRef(({className:e,...t},n)=>s.jsxs(TYe,{children:[s.jsx(fne,{}),s.jsx(lne,{ref:n,className:ae("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})]}));
851Qd.displayName=lne.displayName;const Xd=({className:e,...t})=>s.jsx("div",{className:ae("flex flex-col space-y-2 text-center sm:text-left",e),...t});Xd.displayName="AlertDialogHeader";const Zd=({className:e,...t})=>s.jsx("div",{className:ae("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Zd.displayName="AlertDialogFooter";const Jd=x.forwardRef(({className:e,...t},n)=>s.jsx(dne,{ref:n,className:ae("text-lg font-semibold",e),...t}));Jd.displayName=dne.displayName;const eh=x.forwardRef(({className:e,...t},n)=>s.jsx(hne,{ref:n,className:ae("text-sm text-muted-foreground",e),...t}));eh.displayName=hne.displayName;const th=x.forwardRef(({className:e,...t},n)=>s.jsx(cne,{ref:n,className:ae(Uv(),e),...t}));th.displayName=cne.displayName;const nh=x.forwardRef(({className:e,...t},n)=>s.jsx(une,{ref:n,className:ae(Uv({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));nh.displayName=une.displayName;function ku({open:e,onOpenChange:t,onConfirm:n,title:r,description:i,isLoading:a,confirmLabel:o="Delete",details:l,detailsLoading:c}){return s.jsx(xp,{open:e,onOpenChange:t,children:s.jsxs(Qd,{children:[s.jsxs(Xd,{children:[s.jsx(Jd,{children:r}),s.jsx(eh,{children:i})]}),c&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground py-2",children:[s.jsx(ne,{className:"h-4 w-4 animate-spin"}),"Loading impact summary…"]}),l&&l.length>0&&s.jsx("ul",{className:"space-y-1.5 text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-md p-3",children:l.map((u,d)=>s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"mt-0.5",children:"•"}),s.jsx("span",{children:u})]},d))}),s.jsxs(Zd,{children:[s.jsx(nh,{disabled:a,children:"Cancel"}),s.jsxs(th,{onClick:n,disabled:a||c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[a&&s.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}),o]})]})]})})}function EYe(){const e=Ae(),t=Ye();return $e({mutationFn:async({supplierUserId:n,supplierEmail:r,companyName:i})=>{const{data:a,error:o}=await W.from("supplier_users").select("*").eq("id",n).single();if(o)throw o;const{data:l,error:c}=await W.from("suppliers").insert({name:a.pending_company_name,location:a.pending_company_location,verified:!0,assets_listed:0}).select().single();if(c)throw c;const{error:u}=await W.from("supplier_users").update({status:"approved",supplier_id:l.id,rejection_reason:null}).eq("id",n);if(u)throw u;return r&&dk({templateName:"supplier-approved",recipientEmail:r,recipientUserId:a.user_id,preferenceKey:"supplier_approved",templateData:{companyName:i||a.pending_company_name},idempotencyKey:`supplier-approved-${n}`}),{supplierUserId:n,newSupplierId:l.id,companyName:i||a.pending_company_name}},onSuccess:({supplierUserId:n,newSupplierId:r,companyName:i})=>{e.invalidateQueries({queryKey:["pending-suppliers"]}),e.invalidateQueries({queryKey:["suppliers"]}),t({action:"approve_supplier",entityType:Ve.supplierUsers,entityId:n,entityLabel:i,metadata:{new_supplier_id:r}})}})}function PYe(){const e=Ae(),t=Ye();return $e({mutationFn:async({supplierUserId:n,reason:r,supplierEmail:i,companyName:a})=>{const{data:o}=await W.from("supplier_users").select("user_id, pending_company_name").eq("id",n).single(),{error:l}=await W.from("supplier_users").update({status:"rejected",rejection_reason:r}).eq("id",n);if(l)throw l;return i&&dk({templateName:"supplier-rejected",recipientEmail:i,recipientUserId:o==null?void 0:o.user_id,preferenceKey:"supplier_rejected",templateData:{companyName:a||(o==null?void 0:o.pending_company_name),reason:r},idempotencyKey:`supplier-rejected-${n}`}),{supplierUserId:n,reason:r,companyName:a||(o==null?void 0:o.pending_company_name)}},onSuccess:({supplierUserId:n,reason:r,companyName:i})=>{e.invalidateQueries({queryKey:["pending-suppliers"]}),t({action:"reject_supplier",entityType:Ve.supplierUsers,entityId:n,entityLabel:i,metadata:{reason:r}})}})}function nt(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 fs(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Oi(e,t){const n=nt(e);return isNaN(t)?fs(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function xo(e,t){const n=nt(e);if(isNaN(t))return fs(e,NaN);if(!t)return n;const r=n.getDate(),i=fs(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const a=i.getDate();return r>=a?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}const mM=6048e5,OYe=864e5,iV=6e4,sV=525600,ep=43200,J1=1440;let IYe={};function zh(){return IYe}function nl(e,t){var l,c,u,d;const n=zh(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,i=nt(e),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Sh(e){return nl(e,{weekStartsOn:1}
851)}function pne(e){const t=nt(e),n=t.getFullYear(),r=fs(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Sh(r),a=fs(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const o=Sh(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function Pm(e){const t=nt(e);return t.setHours(0,0,0,0),t}function Nu(e){const t=nt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Wo(e,t){const n=Pm(e),r=Pm(t),i=+n-Nu(n),a=+r-Nu(r);return Math.round((i-a)/OYe)}function RYe(e){const t=pne(e),n=fs(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Sh(n)}function Y2(e,t){const n=t*7;return Oi(e,n)}function DYe(e,t){return xo(e,t*12)}function MYe(e){let t;return e.forEach(function(n){const r=nt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function $Ye(e){let t;return e.forEach(n=>{const r=nt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function iv(e,t){const n=nt(e),r=nt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function LYe(e){return fs(e,Date.now())}function as(e,t){const n=Pm(e),r=Pm(t);return+n==+r}function gM(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function FYe(e){if(!gM(e)&&typeof e!="number")return!1;const t=nt(e);return!isNaN(Number(t))}function Om(e,t){const n=nt(e),r=nt(t),i=n.getFullYear()-r.getFullYear(),a=n.getMonth()-r.getMonth();return i*12+a}function zYe(e,t,n){const r=nl(e,n),i=nl(t,n),a=+r-Nu(r),o=+i-Nu(i);return Math.round((a-o)/mM)}function mne(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function BYe(e,t){return+nt(e)-+nt(t)}function VYe(e){const t=nt(e);return t.setHours(23,59,59,999),t}function mk(e){const t=nt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function WYe(e){const t=nt(e);return+VYe(t)==+mk(t)}function UYe(e,t){const n=nt(e),r=nt(t),i=iv(n,r),a=Math.abs(Om(n,r));let o;if(a<1)o=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*a);let l=iv(n,r)===-i;WYe(nt(e))&&a===1&&iv(e,r)===1&&(l=!1),o=i*(a-Number(l))}return o===0?0:o}function qYe(e,t,n){const r=BYe(e,t)/1e3;return mne(n==null?void 0:n.roundingMethod)(r)}function hs(e){const t=nt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function gne(e){const t=nt(e),n=fs(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function yM(e,t){var l,c,u,d;const n=zh(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,i=nt(e),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}function yne(e){return yM(e,{weekStartsOn:1})}const HYe={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"}},KYe=(e,t,n)=>{let r;const i=HYe[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function YC(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const GYe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},YYe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},QYe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},XYe={date:YC({formats:GYe,defaultWidth:"full"}),time:YC({formats:YYe,defaultWidth:"full"}),dateTime:YC({formats:QYe,defaultWidth:"full"})},ZYe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},JYe=(e,t,n,r)=>ZYe[e];function sy(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;i=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const eQe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tQe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nQe={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"]},rQe={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
851ay","Saturday"]},iQe={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"}},sQe={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"}},aQe=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},oQe={ordinalNumber:aQe,era:sy({values:eQe,defaultWidth:"wide"}),quarter:sy({values:tQe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:sy({values:nQe,defaultWidth:"wide"}),day:sy({values:rQe,defaultWidth:"wide"}),dayPeriod:sy({values:iQe,defaultWidth:"wide",formattingValues:sQe,defaultFormattingWidth:"wide"})};function ay(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const o=a[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?cQe(l,h=>h.test(o)):lQe(l,h=>h.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(o.length);return{value:u,rest:d}}}function lQe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function cQe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function uQe(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(i.length);return{value:o,rest:l}}}const dQe=/^(\d+)(th|st|nd|rd)?/i,hQe=/\d+/i,fQe={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},pQe={any:[/^b/i,/^(a|c)/i]},mQe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},gQe={any:[/1/i,/2/i,/3/i,/4/i]},yQe={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},vQe={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]},xQe={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},bQe={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]},wQe={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},jQe={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}},_Qe={ordinalNumber:uQe({matchPattern:dQe,parsePattern:hQe,valueCallback:e=>parseInt(e,10)}),era:ay({matchPatterns:fQe,defaultMatchWidth:"wide",parsePatterns:pQe,defaultParseWidth:"any"}),quarter:ay({matchPatterns:mQe,defaultMatchWidth:"wide",parsePatterns:gQe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ay({matchPatterns:yQe,defaultMatchWidth:"wide",parsePatterns:vQe,defaultParseWidth:"any"}),day:ay({matchPatterns:xQe,defaultMatchWidth:"wide",parsePatterns:bQe,defaultParseWidth:"any"}),dayPeriod:ay({matchPatterns:wQe,defaultMatchWidth:"any",parsePatterns:jQe,defaultParseWidth:"any"})},gk={code:"en-US",formatDistance:KYe,formatLong:XYe,formatRelative:JYe,localize:oQe,match:_Qe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function SQe(e){const t=nt(e);return Wo(t,gne(t))+1}function vne(e){const t=nt(e),n=+Sh(t)-+RYe(t);return Math.round(n/mM)+1}function xne(e,t){var d,h,f,p;const n=nt(e),r=n.getFullYear(),i=zh(),a=(t==null?void 0:t.firstWeekContainsDate)??((h=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(f=i.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=fs(e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);const l=nl(o,t),c=fs(e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);const u=nl(c,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function kQe(e,t){var l,c,u,d;const n=zh(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,i=xne(e,t),a=fs(e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),nl(a,t)}function bne(e,t){const n=nt(e),r=+nl(n,t)-+kQe(n,t);return Math.round(r/mM)+1}function Xt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}
vendor: 5,453 bytes, line 851
851const yc={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Xt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Xt(n+1,2)},d(e,t){return Xt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Xt(e.getHours()%12||12,t.length)},H(e,t){return Xt(e.getHours(),t.length)},m(e,t){return Xt(e.getMinutes(),t.length)},s(e,t){return Xt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Xt(i,t.length)}},df={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},aV={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return yc.y(e,t)},Y:function(e,t,n,r){const i=xne(e,r),a=i>0?i:1-i;if(t==="YY"){const o=a%100;return Xt(o,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):Xt(a,t.length)},R:function(e,t){const n=pne(e);return Xt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Xt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Xt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Xt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return yc.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Xt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=bne(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Xt(i,t.length)},I:function(e,t,n){const r=vne(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Xt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):yc.d(e,t)},D:function(e,t,n){const r=SQe(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Xt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Xt(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Xt(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Xt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=df.noon:r===0?i=df.midnight:i=r/12>
vendor: 4,720 bytes, line 851
851=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=df.evening:r>=12?i=df.afternoon:r>=4?i=df.morning:i=df.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return yc.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):yc.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Xt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Xt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):yc.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):yc.s(e,t)},S:function(e,t){return yc.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return lV(r);case"XXXX":case"XX":return hd(r);case"XXXXX":case"XXX":default:return hd(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return lV(r);case"xxxx":case"xx":return hd(r);case"xxxxx":case"xxx":default:return hd(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+oV(r,":");case"OOOO":default:return"GMT"+hd(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+oV(r,":");case"zzzz":default:return"GMT"+hd(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Xt(r,t.length)},T:function(e,t,n){const r=e.getTime();return Xt(r,t.length)}};function oV(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+Xt(a,2)}function lV(e,t){return e%60===0?(e>0?"-":"+")+Xt(Math.abs(e)/60,2):hd(e,t)}function hd(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Xt(Math.trunc(r/60),2),a=Xt(r%60,2);return n+i+t+a}const cV=(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"})}},wne=(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"})}},NQe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return cV(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",cV(r,t)).replace("{{time}}",wne(i,t))},CQe={p:wne,P:NQe},AQe=/^D+$/,TQe=/^Y+$/,EQe=["D","DD","YY","YYYY"];function PQe(e){return AQe.test(e)}function OQe(e){return TQe.test(e)}function IQe(e,t,n){const r=RQe(e,t,n);if(console.warn(r),EQe.includes(e))throw new RangeError(r)}function RQe(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const DQe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,MQe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$Qe=/^'([^]*?)'?$/,LQe=/''/g,FQe=/[a-zA-Z]/;function rn(e,t,n){var d,h,f,p,m,g,y,b;const r=zh(),i=(n==null?void 0:n.locale)??r.locale??gk,a=(n==null?void 0:n.firstWeekContainsDate)??((h=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((g=(m=n==null?void 0:n.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((b=(y=r.locale)==null?void 0:y.options)==null?void 0:b.weekStartsOn)??0,l=nt(e);if(!FYe(l))throw new RangeError("Invalid time value");let c=t.match(MQe).map(v=>{const w=v[0];if(w==="p"||w==="P"){const _=CQe[w];return _(v,i.formatLong)}return v}).join("").match(DQe).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const w=v[0];if(w==="'")return{isToken:!1,value:zQe(v)};if(aV[w])return{isToken:!0,value:v};
851if(w.match(FQe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:v}});i.localize.preprocessor&&(c=i.localize.preprocessor(l,c));const u={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(v=>{if(!v.isToken)return v.value;const w=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&OQe(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&PQe(w))&&IQe(w,t,String(e));const _=aV[w[0]];return _(l,w,i.localize,u)}).join("")}function zQe(e){const t=e.match($Qe);return t?t[1].replace(LQe,"'"):e}function BQe(e,t,n){const r=zh(),i=(n==null?void 0:n.locale)??r.locale??gk,a=2520,o=iv(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const l=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:o});let c,u;o>0?(c=nt(t),u=nt(e)):(c=nt(e),u=nt(t));const d=qYe(u,c),h=(Nu(u)-Nu(c))/1e3,f=Math.round((d-h)/60);let p;if(f<2)return n!=null&&n.includeSeconds?d<5?i.formatDistance("lessThanXSeconds",5,l):d<10?i.formatDistance("lessThanXSeconds",10,l):d<20?i.formatDistance("lessThanXSeconds",20,l):d<40?i.formatDistance("halfAMinute",0,l):d<60?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",1,l):f===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",f,l);if(f<45)return i.formatDistance("xMinutes",f,l);if(f<90)return i.formatDistance("aboutXHours",1,l);if(f<J1){const m=Math.round(f/60);return i.formatDistance("aboutXHours",m,l)}else{if(f<a)return i.formatDistance("xDays",1,l);if(f<ep){const m=Math.round(f/J1);return i.formatDistance("xDays",m,l)}else if(f<ep*2)return p=Math.round(f/ep),i.formatDistance("aboutXMonths",p,l)}if(p=UYe(u,c),p<12){const m=Math.round(f/ep);return i.formatDistance("xMonths",m,l)}else{const m=p%12,g=Math.trunc(p/12);return m<3?i.formatDistance("aboutXYears",g,l):m<9?i.formatDistance("overXYears",g,l):i.formatDistance("almostXYears",g+1,l)}}function VQe(e,t,n){const i=zh().locale??gk,a=iv(e,t);if(isNaN(a))throw new RangeError("Invalid time value");const o=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:a});let l,c;a>0?(l=nt(t),c=nt(e)):(l=nt(e),c=nt(t));const u=mne("round"),d=c.getTime()-l.getTime(),h=d/iV,f=Nu(c)-Nu(l),p=(d-f)/iV,m=n==null?void 0:n.unit;let g;if(h<1?g="second":h<60?g="minute":h<J1?g="hour":p<ep?g="day":p<sV?g="month":g="year",g==="second"){const y=u(d/1e3);return i.formatDistance("xSeconds",y,o)}else if(g==="minute"){const y=u(h);return i.formatDistance("xMinutes",y,o)}else if(g==="hour"){const y=u(h/60);return i.formatDistance("xHours",y,o)}else if(g==="day"){const y=u(p/J1);return i.formatDistance("xDays",y,o)}else if(g==="month"){const y=u(p/ep);return y===12&&m!=="month"?i.formatDistance("xYears",1,o):i.formatDistance("xMonths",y,o)}else{const y=u(p/sV);return i.formatDistance("xYears",y,o)}}function $r(e,t){return BQe(e,LYe(e),t)}function WQe(e){const t=nt(e),n=t.getFullYear(),r=t.getMonth(),i=fs(e,0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function UQe(e){return Math.trunc(+nt(e)/1e3)}function qQe(e){const t=nt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function HQe(e,t){return zYe(qQe(e),hs(e),t)+1}function Q2(e,t){const n=nt(e),r=nt(t);return n.getTime()>r.getTime()}function jne(e,t){const n=nt(e),r=nt(t);return+n<+r}function vM(e,t){const n=nt(e),r=nt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function KQe(e,t){const n=nt(e),r=nt(t);return n.getFullYear()===r.getFullYear()}function QC(e,t){return Oi(e,-t)}function XC(e,t){const n=nt(e),r=n.getFullYear(),i=n.getDate(),a=fs(e,0);a.setFullYear(r,t,15),a.setHours(0,0,0,0);const o=WQe(a);return n.setMonth(t,Math.min(i,o)),n}function uV(e,t){const n=nt(e);return isNaN(+n)?fs(e,NaN):(n.setFullYear(t),n)}const ZC="agent_runs",JC="supplier_dd",eA=9e4,hf=e=>["supplier-dd",e,"queuedAt"];function _ne(e,{subscribe:t=!0}={}){var f,p;const n=Ae(),{guardMutation:r}=qe(),a=Se({queryKey:hf(e),enabled:!!e,queryFn:()=>null,staleTime:1/0,gcTime:1/0,initialData:null}).data??null,o=Se({queryKey:["supplier-dd",e,"recent"],enabled:!!e,queryFn:async()=>{const{data:m,error:g}
851=await W.from(ZC).select("*").eq("agent_key",JC).eq("subject_id",e).order("created_at",{ascending:!1}).limit(1).maybeSingle();if(g)throw g;return m?{...m,dossier:m.result??null}:null},refetchInterval:m=>{var b;const g=(b=m.state.data)==null?void 0:b.status;if(g==="running"||g==="queued")return 2e4;const y=n.getQueryData(hf(e));return y&&Date.now()-y<eA?5e3:!1}}),l=o.data;x.useEffect(()=>{if(!e||!a)return;if(l&&new Date(l.created_at).getTime()>=a-1e3){n.setQueryData(hf(e),null);return}const m=eA-(Date.now()-a);if(m<=0){n.setQueryData(hf(e),null);return}const g=setTimeout(()=>{n.setQueryData(hf(e),null)},m);return()=>clearTimeout(g)},[e,a,l,n]);const c=!!(a&&Date.now()-a<eA&&(!l||new Date(l.created_at).getTime()<a-1e3)),u=Se({queryKey:["supplier-dd",e,"history"],enabled:!1,queryFn:async()=>{const{data:m,error:g}=await W.from(ZC).select("*").eq("agent_key",JC).eq("subject_id",e).eq("status","superseded").order("created_at",{ascending:!1});if(g)throw g;return(m??[]).map(y=>({...y,dossier:y.result??null}))}});x.useEffect(()=>{if(!t||!e)return;const m=W.channel(`agent_runs_supplier_dd_${e}`).on("postgres_changes",{event:"*",schema:"public",table:ZC,filter:`subject_id=eq.${e}`},()=>{n.invalidateQueries({queryKey:["supplier-dd",e,"recent"]}),n.invalidateQueries({queryKey:["supplier-dd",e,"history"]})}).subscribe();return()=>{W.removeChannel(m)}},[t,e,n]);const d=$e({mutationFn:async m=>{if(r("Running DD on a supplier"))throw new Error("Impersonation mode");const{data:g,error:y}=await W.functions.invoke("re-run-agent",{body:{agent_key:JC,subject_type:"supplier_users",subject_id:m}});if(y)throw y;if(g!=null&&g.error)throw new Error(g.error);return g},onSuccess:()=>{e&&n.setQueryData(hf(e),Date.now()),n.invalidateQueries({queryKey:["supplier-dd",e,"recent"]})}}),h=((f=u.data)==null?void 0:f.length)??((p=o.data)!=null&&p.parent_run_id?1:0);return{recent:o,history:u,runDD:d,supersededCount:h,isQueued:c}}const tA=768;function dc(){const[e,t]=x.useState(void 0);return x.useEffect(()=>{const n=window.matchMedia(`(max-width: ${tA-1}px)`),r=()=>{t(window.innerWidth<tA)};return n.addEventListener("change",r),t(window.innerWidth<tA),()=>n.removeEventListener("change",r)},[]),!!e}function xi(e){if(e==null)return"—";const t=Math.abs(e);return t>=1e6?`${(e/1e6).toFixed(2)}M`:t>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function yk(e){if(e==null)return"—";const t=Math.round(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;if(n<60)return r===0?`${n}m`:`${n}m ${r}s`;const i=Math.floor(n/60),a=n%60;return a===0?`${i}h`:`${i}h ${a}m`}const GQe={approve:"positive",request_more_info:"warning",flag_for_review:"warning",reject:"negative"},YQe={high:"positive",medium:"warning",low:"negative"},QQe=["admin_summary","recommended_action","evidence_gaps","what_would_change_recommendation"];function X2({tone:e,children:t}){const n={positive:{bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))",border:"hsl(var(--c-positive-border))"},warning:{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))",border:"hsl(var(--c-warning-border))"},negative:{bg:"hsl(var(--c-negative-soft))",fg:"hsl(var(--c-negative-fg))",border:"hsl(var(--c-negative-soft))"},neutral:{bg:"hsl(var(--c-surface))",fg:"hsl(var(--c-fg-muted))",border:"hsl(var(--c-border))"}}[e];return s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:5,padding:"3px 8px",borderRadius:4,fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:500,letterSpacing:"0.06em",textTransform:"uppercase",background:n.bg,color:n.fg,border:`1px solid ${n.border}`},children:t})}function Sne({title:e}){return s.jsx("div",{className:"eyebrow",style:{marginBottom:8,color:"hsl(var(--c-fg-muted))"},children:e.replace(/_/g," ")})}function nA(e){return e==null?s.jsx("span",{style:{color:"hsl(var(--c-fg-subtle))"},children:"—"}):typeof e=="boolean"?s.jsx(X2,{tone:e?"positive":"neutral",children:e?"yes":"no"}):typeof e=="number"?s.jsx("span",{className:"tt-mono-sm",children:e.toLocaleString()}):typeof e=="string"?/^https?:\/\//.test(e)?s.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",style:{color:"hsl(var(--c-accent-fg))",wordBreak:"break-all"},children:e}):s.jsx("span",{children:e}):s.jsx("code",{style:{fontSize:12},children:JSON.stringify(e)})}function gd(e,t){if(e==null)return nA(e);if(Array.isArray(e)){if(e.length===0)return s.jsx("span",{style:{color:"hsl(var(--c-fg-subtle))"},children:"(empty)"});if(typeof e[0]=="object"&&e[0]!==null){const n=Array.from(new Set(e.flatMap(r=>Object.keys(r))));return s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{className:"xph-table",style:{fontSize:12},children:[s.jsx("thead",{children:s.jsx("tr",{children:n.map(r=>s.jsx("th",{style:{textTransform:"capitalize"},children:r.replace(/_/g," ")},r))})}),s.jsx("tbody",{children:e.map((r,i)=>s.jsx("tr",{children:n.map(a=>s.jsx("td",{children:gd(r[a],t+1)},a))},i))})]})})}return s.jsx("ul",{style:{paddingLeft:18,margin:0},children:e.map((n,r)=>s.jsx("li",{style:{marginBottom:4},children:nA(n)},r))})}if(typeof e=="object"){if(t>=2)return s.jsx("pre",{style:{background:"hsl(var(--c-surface))",border:"1px solid hsl(var(--c-border))",borderRadius:4,padding:8,fontSize:11.5,overflow:"auto",maxHeight:240},children:JSON.stringify(e,null,2)});const n=Object.entries(e);return n.length===0?s.jsx("span",{style:{color:"hsl(var(--c-fg-subtle))"},children:"(empty)"}):s.jsx("dl",{style:{display:"grid",gridTemplateColumns:"max-content 1fr",gap:"4px 12px",margin:0,fontSize:13},children:n.map(([r,i])=>s.jsxs("div",{style:{display:"contents"},children:[s.jsx("dt",{style:{fontFamily:"var(--font-mono)",fontSize:11.5,color:"hsl(var(--c-fg-muted))",textTransform:"capitalize"},children:r.replace(/_/g," ")}),s.jsx("dd",{style:{margin:0},children:gd(i,t+1)})]},r))})}return nA(e)}function rA({title:e,children:t}){return s.jsxs("section",{style:{border:"1px solid hsl(var(--c-border))",borderRadius:8,padding:16,background:"hsl(var(--c-card))"},children:[s.jsx(Sne,{title:e}),t]})}function xM({run:e}){var o,l;const t=e.result??{},n=t.recommended_action??null,r=GQe[(n==null?void 0:n.action)??""]??"neutral",i=YQe[(n==null?void 0:n.confidence)??""]??"neutral",a=Object.keys(t).filter(c=>!QQe.includes(c)&&c!=="meta").sort();return e.status!=="complete"||!e.result?s.jsxs("div",{style:{padding:16,border:"1px solid hsl(var(--c-border))",borderRadius:8,background:"hsl(var(--c-surface))"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"hsl(var(--c-fg-muted))"},children:[e.status==="failed"||e.status==="timed_out"?s.jsx(ir,{size:16}):e.status==="running"||e.status==="queued"?s.jsx(Yn,{size:16}):s.jsx(Pu,{size:16}),s.jsx("span",{className:"tt-body-sm",style:{textTransform:"capitalize"},children:e.status.replace(/_/g," ")})]}),e.error_message&&s.jsx("pre",{style:{marginTop:12,fontSize:12,color:"hsl(var(--c-fg-muted))",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:320,overflow:"auto"},children:e.error_message})]}):s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsxs("div",{style:{padding:16,border:"1px solid hsl(var(--c-border))",borderRadius:8,background:"hsl(var(--c-card))"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16,flexWrap:"wrap"},children:[s.jsx("div",{style:{flex:1,minWidth:0},children:typeof t.admin_summary=="string"&&s.jsx("p",{className:"tt-body",style:{margin:0,color:"hsl(var(--c-ink))"},children:t.admin_summary})}),(n==null?void 0:n.action)&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:"flex-end"},children:[s.jsxs(X2,{tone:r,children:[n.action==="approve"?s.jsx(sn,{size:11}):n.action==="reject"?s.jsx(gn,{size:11}):s.jsx(ir,{size:11}
851),n.action.replace(/_/g," ")]}),n.confidence&&s.jsxs(X2,{tone:i,children:[n.confidence," confidence"]})]})]}),s.jsxs("div",{className:"tt-mono-sm",style:{marginTop:12,color:"hsl(var(--c-fg-subtle))",display:"flex",gap:16,flexWrap:"wrap"},children:[s.jsx("span",{children:e.agent_version??"—"}),s.jsx("span",{children:e.model_version??"—"}),e.cost_usd!=null&&s.jsxs("span",{children:["$",Number(e.cost_usd).toFixed(2)]}),e.tool_calls!=null&&s.jsxs("span",{children:[e.tool_calls," tools"]}),e.turn_count!=null&&s.jsxs("span",{children:[e.turn_count," turns"]}),e.duration_ms!=null&&s.jsx("span",{title:e.started_at&&e.completed_at?`${e.started_at} → ${e.completed_at}`:void 0,children:yk(e.duration_ms)})]}),(e.input_tokens!=null||e.output_tokens!=null||e.cache_read_tokens!=null||e.cache_creation_tokens!=null)&&s.jsxs("div",{className:"tt-mono-xs",style:{marginTop:6,color:"hsl(var(--c-fg-subtle))",display:"flex",gap:12,flexWrap:"wrap"},children:[s.jsxs("span",{title:"input tokens",children:["in ",xi(e.input_tokens)]}),s.jsxs("span",{title:"output tokens",children:["out ",xi(e.output_tokens)]}),s.jsxs("span",{title:"cache-read tokens (cheap reuse)",children:["cache-read ",xi(e.cache_read_tokens)]}),s.jsxs("span",{title:"cache-creation tokens (one-time write)",children:["cache-create ",xi(e.cache_creation_tokens)]}),s.jsxs("span",{title:"total = input + output",children:["total ",xi((e.input_tokens??0)+(e.output_tokens??0))]})]}),e.anthropic_session_id&&s.jsxs("div",{className:"tt-mono-xs",style:{marginTop:6,color:"hsl(var(--c-fg-subtle))",display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[s.jsx("span",{children:"session"}),s.jsxs("button",{type:"button",onClick:()=>{var c;e.anthropic_session_id&&((c=navigator.clipboard)==null||c.writeText(e.anthropic_session_id))},title:"Click to copy full session id",style:{fontFamily:"var(--font-mono)",fontSize:11,padding:"2px 6px",borderRadius:4,background:"hsl(var(--c-surface))",border:"1px solid hsl(var(--c-border))",color:"hsl(var(--c-fg-muted))",cursor:"pointer"},children:[e.anthropic_session_id.slice(0,16),"…"]})]})]}),typeof t.what_would_change_recommendation=="string"&&s.jsxs("div",{style:{padding:16,border:"1px solid hsl(var(--c-warning-border))",borderRadius:8,background:"hsl(var(--c-warning-soft))"},children:[s.jsx(Sne,{title:"What would change the recommendation"}),s.jsx("p",{className:"tt-body-sm",style:{margin:0,color:"hsl(var(--c-warning-fg))"},children:t.what_would_change_recommendation})]}),Array.isArray(t.evidence_gaps)&&t.evidence_gaps.length>0&&s.jsx(rA,{title:"Evidence gaps",children:gd(t.evidence_gaps,0)}),n&&(n.rationale||((o=n.follow_up_questions)==null?void 0:o.length)||((l=n.specific_concerns_to_review)==null?void 0:l.length))&&s.jsx(rA,{title:"Recommended action detail",children:s.jsxs("dl",{style:{display:"grid",gridTemplateColumns:"max-content 1fr",gap:"6px 12px",margin:0,fontSize:13},children:[n.rationale&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{style:{fontFamily:"var(--font-mono)",fontSize:11.5,color:"hsl(var(--c-fg-muted))"},children:"Rationale"}),s.jsx("dd",{style:{margin:0},children:n.rationale})]}),(n.follow_up_questions??[]).length>0&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{style:{fontFamily:"var(--font-mono)",fontSize:11.5,color:"hsl(var(--c-fg-muted))"},children:"Follow-up"}),s.jsx("dd",{style:{margin:0},children:gd(n.follow_up_questions,0)})]}),(n.specific_concerns_to_review??[]).length>0&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{style:{fontFamily:"var(--font-mono)",fontSize:11.5,color:"hsl(var(--c-fg-muted))"},children:"Concerns"}),s.jsx("dd",{style:{margin:0},children:gd(n.specific_concerns_to_review,0)})]})]})}),a.map(c=>s.jsx(rA,{title:c,children:gd(t[c],0)},c)),t.meta!=null&&s.jsxs("details",{style:{marginTop:4},children:[s.jsx("summary",{className:"eyebrow",style:{cursor:"pointer",color:"hsl(var(--c-fg-muted))",userSelect:"none"},children:"meta"}),s.jsx("div",{style:{marginTop:8},children:gd(t.meta,0)})]})]})}const Im=e=>e?"14px 16px":"16px 20px",Z2={approve:{label:"Approve",bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))",border:"hsl(var(--c-positive-border))"},request_more_info:{label:"Request more info",bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))",border:"hsl(var(--c-warning-border))"},flag_for_review:{label:"Flag for review",bg:"hsl(var(--c-stage-clinical-bg))",fg:"hsl(var(--c-stage-clinical-fg))",border:"hsl(var(--c-stage-clinical-border))"},reject:{label:"Reject",bg:"hsl(var(--c-negative-soft))",fg:"hsl(var(--c-negative-fg))",border:"hsl(var(--c-negative-border))"}};function Ts({url:e,children:t}){return s.jsxs("a",{href:e,target:"_blank",rel:"noreferrer noopener",style:{display:"inline-flex",alignItems:"center",gap:3,color:"hsl(var(--c-link))",textDecoration:"underline",wordBreak:"break-all",fontFamily:"var(--font-mono)",fontSize:11.5},children:[t??e," ",s.jsx(tc,{size:10})]})}function XQe({startedAt:e,isMobile:t}){const n=$r(new Date(e),{addSuffix:!1});return s.jsxs("div",{style:{padding:Im(t),display:"flex",alignItems:"center",gap:10,color:"hsl(var(--c-fg-muted))",fontSize:13},children:[s.jsx(ne,{size:14,className:"animate-spin"}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:600},children:"AI due diligence running…"}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["Started ",n," ago · typically completes in 1–5 minutes. This panel will update automatically."]})]})]})}function dV({isMobile:e}){return s.jsxs("div",{style:{padding:Im(e),display:"flex",alignItems:"center",gap:10,color:"hsl(var(--c-fg-muted))",fontSize:13},children:[s.jsx(ne,{size:14,className:"animate-spin"}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:600},children:"Due diligence queued"}),s.jsx("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:"Agent will start within ~30s and typically completes in 1–5 minutes. This panel will update automatically."})]})]})}function ZQe({run:e,onRerun:t,rerunPending:n,isMobile:r}){const i=e.status==="timed_out",a=`
852
853--- raw agent output ---
854`,o=e.error_message??"",l=o.indexOf(a),c=l>=0?o.slice(0,l):o,u=l>=0?o.slice(l+a.length):null;return s.jsxs("div",{style:{padding:Im(r)},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[s.jsx(ir,{size:14,style:{color:"hsl(var(--c-negative-fg))"}}),s.jsx("span",{style:{fontWeight:600,fontSize:13,color:"hsl(var(--c-ink))"},children:i?"AI due diligence timed out":"AI due diligence failed"})]}),c&&s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-muted))",marginBottom:12,whiteSpace:"pre-wrap"},children:c}),u&&s.jsxs("details",{style:{marginBottom:12},children:[s.jsxs("summary",{style:{cursor:"pointer",fontSize:12,color:"hsl(var(--c-link))",textDecoration:"underline"},children:["Raw agent output (",u.length," chars)"]}),s.jsx("pre",{style:{marginTop:8,padding:10,background:"hsl(var(--c-surface-2))",border:"1px solid hsl(var(--c-border))",borderRadius:6,maxHeight:280,overflow:"auto",fontFamily:"var(--font-mono)",fontSize:11.5,lineHeight:1.45,whiteSpace:"pre-wrap",wordBreak:"break-word",color:"hsl(var(--c-fg))"},children:u})]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:t,disabled:n,children:[n?s.jsx(ne,{size:12,className:"animate-spin"}):s.jsx(ps,{size:12}),"Re-run due diligence"]})]})}function JQe({onRunDD:e,rerunPending:t,isMobile:n}){return s.jsxs("div",{style:{padding:Im(n),display:"flex",alignItems:"center",gap:12,color:"hsl(var(--c-fg-muted))",fontSize:13},children:[s.jsx(Cn,{size:14}),s.jsx("span",{style:{flex:1},children:"No AI due diligence on file for this supplier. (Legacy signup or DD not yet triggered.)"}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:e,disabled:t,children:[t?s.jsx(ne,{size:12,className:"animate-spin"}):s.jsx(SI,{size:12}),"Run due diligence"]})]})}function vc({title:e,children:t}){return s.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:10},children:[s.jsx("div",{style:{display:"flex",alignItems:"center",gap:12,paddingBottom:6,borderBottom:"1px solid hsl(var(--c-border))"},children:s.jsx("h3",{className:"eyebrow",style:{margin:0,color:"hsl(var(--c-fg-muted))",letterSpacing:"0.12em"},children:e})}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:t})]})}function eXe({claim:e,quote:t,citation:n}
854){return s.jsxs("div",{style:{paddingLeft:14,borderLeft:"2px solid hsl(var(--c-border))",display:"flex",flexDirection:"column",gap:4},children:[s.jsx("div",{style:{color:"hsl(var(--c-ink))",fontSize:13.5,lineHeight:1.55},children:e}),t&&s.jsxs("div",{style:{color:"hsl(var(--c-fg-muted))",fontSize:12.5,lineHeight:1.55,fontStyle:"italic"},children:["“",t,"”"]}),n&&s.jsx(Ts,{url:n})]})}function tXe({stage:e}){const t=e==="Approved"||e==="Phase 3"?"clinical-late":e==="Phase 2"?"clinical-mid":e==="Phase 1"?"clinical-early":e==="IND-enabling"?"ind":e==="Preclinical"?"preind":"unknown";return s.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:6,background:`hsl(var(--c-stage-${t}-bg, var(--c-surface-2)))`,color:`hsl(var(--c-stage-${t}-fg, var(--c-fg-muted)))`,border:`1px solid hsl(var(--c-stage-${t}-border, var(--c-border)))`,fontFamily:"var(--font-mono)",fontSize:11,fontWeight:600,whiteSpace:"nowrap"},children:e})}function nXe({asset:e}){var n;const t=(((n=e.concerns)==null?void 0:n.length)??0)>0;return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,padding:"10px 12px",background:t?"hsl(var(--c-warning-soft))":"hsl(var(--c-surface-2))",border:`1px solid hsl(var(--${t?"c-warning-border":"c-border"}))`,borderRadius:6},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:13,fontWeight:700,color:"hsl(var(--c-ink))"},children:e.name}),s.jsx(tXe,{stage:e.stage}),e.modality&&s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-fg-muted))"},children:e.modality})]}),(e.indication||e.mechanism)&&s.jsxs("div",{style:{fontSize:13,color:"hsl(var(--c-fg))",lineHeight:1.5},children:[e.indication,e.indication&&e.mechanism&&" · ",e.mechanism&&s.jsx("span",{style:{fontStyle:"italic"},children:e.mechanism})]}),e.latest_milestone&&s.jsxs("div",{style:{fontSize:12.5,color:"hsl(var(--c-fg-muted))",lineHeight:1.5},children:[e.latest_milestone,e.latest_milestone_date&&s.jsxs("span",{style:{marginLeft:6,color:"hsl(var(--c-fg-subtle))"},children:["(",e.latest_milestone_date,")"]})]}),t&&s.jsx("ul",{style:{margin:0,paddingLeft:16,fontSize:12.5,color:"hsl(var(--c-warning-fg))",lineHeight:1.5},children:e.concerns.map((r,i)=>s.jsx("li",{children:r},i))}),!e.counter_evidence_searched&&s.jsx("div",{style:{fontSize:11.5,color:"hsl(var(--c-warning-fg))",fontStyle:"italic"},children:"⚠ Counter-evidence not searched"}),e.counter_evidence_findings&&e.counter_evidence_findings!=="none"&&s.jsxs("div",{style:{fontSize:12.5,color:"hsl(var(--c-fg-muted))",lineHeight:1.5},children:[s.jsx("span",{style:{fontWeight:600},children:"Counter-evidence:"})," ",e.counter_evidence_findings]}),e.sources&&e.sources.length>0&&s.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginTop:2},children:e.sources.map((r,i)=>s.jsx(Ts,{url:r.url,children:r.type.replace(/_/g," ")},i))})]})}function hV(e){return e==="checked_and_cleared"?{text:"checked & cleared",tone:"positive"}:e==="checked_and_found"?{text:"checked & FOUND",tone:"negative"}:{text:"NOT checked",tone:"warning"}}function kne({run:e,onRerun:t,rerunPending:n,historyCount:r,onShowHistory:i,history:a,hideFooter:o=!1}){var b,v,w;const l=e.dossier,[c,u]=x.useState(!1);if(!l)return null;const d=l.recommended_action.action,h=Z2[d]??Z2.flag_for_review,f=e.completed_at?$r(new Date(e.completed_at),{addSuffix:!0}):"—",p=hV(l.risk_screening.sanctions.status),m=hV(l.risk_screening.jurisdiction.status),g=l.risk_screening.regulatory_history,y=g.fda_debarment||(((b=g.fda_warning_letters)==null?void 0:b.length)??0)>0||(((v=g.clinical_holds)==null?void 0:v.length)??0)>0||(((w=g.ema_actions)==null?void 0:w.length)??0)>0;return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:28,maxWidth:920,paddingTop:4},children:[s.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:14},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12,flexWrap:"wrap"},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))"},children:"Supplier due diligence · AI advisory"}),s.jsxs("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:[l.meta.agent_version??e.agent_version," · ",l.meta.searches_performed??"–"," sources · ",f]})]}),s.jsx("div",{style:{display:"flex",gap:16,alignItems:"flex-start",paddingLeft:14,borderLeft:`3px solid ${h.fg}`},children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,flex:1,minWidth:0},children:[s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[s.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:h.fg},children:["Recommendation: ",h.label]}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["· ",l.recommended_action.confidence," confidence"]})]}),s.jsx("p",{style:{margin:0,fontSize:15,lineHeight:1.6,color:"hsl(var(--c-ink))"},children:l.admin_summary})]})})]}),s.jsxs(vc,{title:"Pipeline discovery",children:[l.pipeline_discovery.discovered_assets.length===0?s.jsx("p",{style:{margin:0,fontSize:13,color:"hsl(var(--c-fg-muted))",fontStyle:"italic"},children:"No drug-pipeline assets were discoverable for this supplier from public sources."}):s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:l.pipeline_discovery.discovered_assets.map((_,j)=>s.jsx(nXe,{asset:_},j))}),l.pipeline_discovery.red_flags.length>0&&s.jsxs("div",{style:{padding:10,background:"hsl(var(--c-warning-soft))",border:"1px solid hsl(var(--c-warning-border))",borderRadius:6,fontSize:13,lineHeight:1.55,color:"hsl(var(--c-warning-fg))"},children:[s.jsx("strong",{children:"Pipeline red flags:"}),s.jsx("ul",{style:{margin:"4px 0 0 0",paddingLeft:18},children:l.pipeline_discovery.red_flags.map((_,j)=>s.jsx("li",{children:_},j))})]}),(l.pipeline_discovery.completeness_note||l.pipeline_discovery.company_
854site_pipeline_url)&&s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12,alignItems:"baseline",flexWrap:"wrap"},children:[l.pipeline_discovery.completeness_note&&s.jsx("span",{style:{fontSize:12.5,color:"hsl(var(--c-fg-muted))",fontStyle:"italic",flex:1,minWidth:0},children:l.pipeline_discovery.completeness_note}),l.pipeline_discovery.company_site_pipeline_url&&s.jsx(Ts,{url:l.pipeline_discovery.company_site_pipeline_url,children:"View on supplier's site"})]})]}),s.jsxs(vc,{title:"Identity verification",children:[s.jsxs("p",{style:{margin:0,fontSize:13.5,lineHeight:1.6,color:"hsl(var(--c-fg))"},children:["Company existence"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:l.identity.company_exists.replace(/_/g," ")}),"; submitter at company"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:l.identity.submitter_exists_at_company.replace(/_/g," ")}),"; email domain"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:l.identity.email_domain_match.status.replace(/_/g," ")}),l.identity.email_domain_match.note?` — ${l.identity.email_domain_match.note}`:"."]}),l.identity.leadership_verified&&l.identity.leadership_verified.length>0&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))",marginBottom:4},children:"Verified leadership"}),l.identity.leadership_verified.map((_,j)=>s.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8,fontSize:13},children:[s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:600},children:_.name}),s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))"},children:_.role}),s.jsx(Ts,{url:_.citation_url,children:"profile"})]},j))]}),l.identity.findings.length>0&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,marginTop:4},children:l.identity.findings.map((_,j)=>s.jsx(eXe,{claim:_.claim,quote:_.supporting_quote,citation:_.citation_url},j))})]}),s.jsxs(vc,{title:"Supplier classification",children:[s.jsxs("p",{style:{margin:0,fontSize:13.5,lineHeight:1.6,color:"hsl(var(--c-fg))"},children:["Classified as"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:l.classification.supplier_type.replace(/_/g," ")}),". ",l.classification.rationale]}),l.classification.citations&&l.classification.citations.length>0&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:3},children:l.classification.citations.map((_,j)=>s.jsx(Ts,{url:_},j))})]}),s.jsxs(vc,{title:"Risk screening",children:[s.jsxs("p",{style:{margin:0,fontSize:13.5,lineHeight:1.6,color:"hsl(var(--c-fg))"},children:["Sanctions"," ",s.jsx("strong",{style:{color:`hsl(var(--c-${p.tone==="negative"?"negative":p.tone==="warning"?"warning":"positive"}-fg))`},children:p.text}),"; jurisdiction"," ",s.jsx("strong",{style:{color:`hsl(var(--c-${m.tone==="negative"?"negative":m.tone==="warning"?"warning":"positive"}-fg))`},children:m.text}),"."]}),(l.risk_screening.sanctions.findings??[]).map((_,j)=>s.jsxs("div",{style:{paddingLeft:14,borderLeft:"2px solid hsl(var(--c-negative-border))",fontSize:13,color:"hsl(var(--c-ink))"},children:[_.concern,s.jsx("div",{style:{marginTop:2},children:s.jsx(Ts,{url:_.citation_url})})]},`san-${j}`)),(l.risk_screening.jurisdiction.findings??[]).map((_,j)=>s.jsxs("div",{style:{paddingLeft:14,borderLeft:"2px solid hsl(var(--c-negative-border))",fontSize:13,color:"hsl(var(--c-ink))"},children:[_.concern,s.jsx("div",{style:{marginTop:2},children:s.jsx(Ts,{url:_.citation_url})})]},`jur-${j}`)),s.jsxs("div",{style:{marginTop:6},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))",marginBottom:6},children:"Regulatory history"}),y?s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[g.fda_debarment&&s.jsx("div",{style:{padding:8,background:"hsl(var(--c-negative-soft))",border:"1px solid hsl(var(--c-negative-border))",borderRadius:4,fontSize:13,color:"hsl(var(--c-negative-fg))"},children:"FDA debarment on record."}),(g.fda_warning_letters??[]).map((_,j)=>s.jsxs("div",{style:{fontSize:13,color:"hsl(var(--c-ink))"},children:[s.jsx("strong",{children:"FDA warning letter"}),_.date?` (${_.date})`:"",": ",_.summary," ",s.jsx(Ts,{url:_.citation_url})]},`wl-${j}`)),(g.clinical_holds??[]).map((_,j)=>s.jsxs("div",{style:{fontSize:13,color:"hsl(var(--c-ink))"},children:[s.jsx("strong",{children:"Clinical hold"}),": ",_.summary," ",s.jsx(Ts,{url:_.citation_url})]},`ch-${j}`)),(g.ema_actions??[]).map((_,j)=>s.jsxs("div",{style:{fontSize:13,color:"hsl(var(--c-ink))"},children:[s.jsx("strong",{children:"EMA action"}),": ",_.summary," ",s.jsx(Ts,{url:_.citation_url})]},`ema-${j}`)),g.notable_findings&&s.jsx("p",{style:{margin:0,fontSize:12.5,color:"hsl(var(--c-fg-muted))",fontStyle:"italic"},children:g.notable_findings})]}):s.jsx("p",{style:{margin:0,fontSize:13,color:"hsl(var(--c-fg-muted))",fontStyle:"italic"}
854,children:g.notable_findings||"No FDA / EMA actions found by the agent."})]}),l.risk_screening.notable_concerns.length>0&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:l.risk_screening.notable_concerns.map((_,j)=>s.jsxs("div",{style:{paddingLeft:14,borderLeft:`2px solid hsl(var(--${_.severity==="high"?"c-negative-border":"c-warning-border"}))`,display:"flex",flexDirection:"column",gap:4},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:8},children:[s.jsx("div",{style:{color:"hsl(var(--c-ink))",fontSize:13.5,lineHeight:1.55},children:_.concern}),s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:`hsl(var(--${_.severity==="high"?"c-negative-fg":_.severity==="medium"?"c-warning-fg":"c-fg-muted"}))`},children:_.severity})]}),_.citation_url&&s.jsx(Ts,{url:_.citation_url})]},j))})]}),s.jsxs(vc,{title:"Web footprint",children:[s.jsxs("p",{style:{margin:0,fontSize:13.5,lineHeight:1.6,color:"hsl(var(--c-fg))"},children:["Estimated company age ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:l.web_footprint.company_age_estimate}),"; size ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:l.web_footprint.size_estimate}),"; visible pipeline or portfolio"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:l.web_footprint.has_visible_pipeline_or_portfolio?"yes":"no"}),"."]}),l.web_footprint.notable_signals&&l.web_footprint.notable_signals.length>0&&s.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13.5,lineHeight:1.65,color:"hsl(var(--c-fg))"},children:l.web_footprint.notable_signals.map((_,j)=>s.jsx("li",{children:_},j))}),l.web_footprint.citations&&l.web_footprint.citations.length>0&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:3},children:l.web_footprint.citations.map((_,j)=>s.jsx(Ts,{url:_},j))})]}),l.anomalies.length>0&&s.jsx(vc,{title:"Anomalies",children:s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:14},children:l.anomalies.map((_,j)=>s.jsxs("div",{style:{paddingLeft:14,borderLeft:"2px solid hsl(var(--c-warning-border))",display:"flex",flexDirection:"column",gap:4},children:[s.jsx("div",{style:{color:"hsl(var(--c-ink))",fontSize:13.5,lineHeight:1.55,fontWeight:500},children:_.observation}),s.jsx("div",{style:{color:"hsl(var(--c-fg-muted))",fontSize:12.5,lineHeight:1.55},children:_.why_concerning}),_.citation_url&&s.jsx(Ts,{url:_.citation_url})]},j))})}),l.evidence_gaps&&l.evidence_gaps.length>0&&s.jsxs(vc,{title:"Evidence gaps",children:[s.jsx("p",{style:{margin:0,fontSize:12.5,color:"hsl(var(--c-fg-muted))",fontStyle:"italic"},children:"Things the agent tried to verify but couldn't."}),s.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13.5,lineHeight:1.65,color:"hsl(var(--c-fg))"},children:l.evidence_gaps.map((_,j)=>s.jsx("li",{children:_},j))})]}),s.jsxs(vc,{title:"Recommendation & rationale",children:[s.jsx("p",{style:{margin:0,fontSize:13.5,lineHeight:1.6,color:"hsl(var(--c-fg))"},children:l.recommended_action.rationale}),l.what_would_change_recommendation&&s.jsxs("div",{style:{padding:10,background:"hsl(var(--c-surface-2))",border:"1px solid hsl(var(--c-border))",borderRadius:6,fontSize:13,lineHeight:1.55,color:"hsl(var(--c-fg))"},children:[s.jsx("span",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))",marginRight:6},children:"What would change this:"}),l.what_would_change_recommendation]}),l.recommended_action.follow_up_questions&&l.recommended_action.follow_up_questions.length>0&&s.jsxs("div",{style:{marginTop:4},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))",marginBottom:6},children:"Suggested follow-up"}),s.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13.5,lineHeight:1.7,color:"hsl(var(--c-fg))"},children:l.recommended_action.follow_up_questions.map((_,j)=>s.jsx("li",{children:_},j))})]}),l.recommended_action.specific_concerns_to_review&&l.recommended_action.specific_concerns_to_review.length>0&&s.jsxs("div",{style:{marginTop:4},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))",marginBottom:6},children:"Specific concerns to review"}),s.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13.5,lineHeight:1.7,color:"hsl(var(--c-fg))"},children:l.recommended_action.specific_concerns_to_review.map((_,j)=>s.jsx("li",{children:_},j))})]})]}),!o&&s.jsxs("footer",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,rowGap:10,flexWrap:"wrap",paddingTop:14,borderTop:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{style:{display:"flex",alignItems:"center",gap:14,flexWrap:"wrap"},children:(r>0||e.parent_run_id)&&s.jsx("button",{type:"button",onClick:()=>{u(_=>!_),c||i()},style:{background:"none",border:"none",padding:0,color:"hsl(var(--c-link))",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:11.5,textDecoration:"underline"},children:c?"Hide history":`History (${r||"?"})`})}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:t,disabled:n,children:[n?s.jsx(ne,{size:12,className:"animate-spin"}):s.jsx(ps,{size:12}),"Re-run due diligence"]})]}),!o&&c&&a&&a.length>0&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:a.map(_=>{var j,S,k;return s.jsxs("details",{style:{paddingLeft:14,borderLeft:"2px s
854olid hsl(var(--c-border))"},children:[s.jsxs("summary",{style:{cursor:"pointer",fontSize:12.5,color:"hsl(var(--c-fg))"},children:[((S=(j=_.dossier)==null?void 0:j.recommended_action)==null?void 0:S.action)??"unknown"," • ",_.agent_version," • ",$r(new Date(_.completed_at??_.created_at),{addSuffix:!0})]}),((k=_.dossier)==null?void 0:k.admin_summary)&&s.jsx("div",{style:{marginTop:6,fontSize:12.5,color:"hsl(var(--c-fg-muted))",lineHeight:1.55},children:_.dossier.admin_summary})]},_.id)})})]})}function Nne({supplierUserId:e,expanded:t}){const{recent:n,history:r,runDD:i,supersededCount:a,isQueued:o}=_ne(e,{subscribe:!1}),{toast:l}=xt(),c=dc();if(!t)return null;const u=n.data,d=async()=>{try{await i.mutateAsync(e),l({title:"Due diligence queued",description:"Agent typically completes in 1–5 minutes. The dossier will appear here automatically."})}catch(f){l({title:"Failed to start due diligence",description:(f==null?void 0:f.message)??"unknown error",variant:"destructive"})}},h=()=>{r.refetch()};return n.isLoading?s.jsx("div",{style:{padding:Im(c),color:"hsl(var(--c-fg-muted))",fontSize:13},children:"Loading due diligence…"}):i.isPending||o?s.jsx(dV,{isMobile:c}):u?u.status==="queued"?s.jsx(dV,{isMobile:c}):u.status==="running"?s.jsx(XQe,{startedAt:u.started_at??u.created_at,isMobile:c}):u.status==="failed"||u.status==="timed_out"?s.jsx(ZQe,{run:u,onRerun:d,rerunPending:i.isPending,isMobile:c}):u.status==="complete"?s.jsx(kne,{run:u,onRerun:d,rerunPending:i.isPending,historyCount:a,onShowHistory:h,history:r.data}):s.jsxs("div",{style:{padding:Im(c),color:"hsl(var(--c-fg-muted))",fontSize:13},children:[s.jsx(I_,{size:14,style:{marginRight:6,verticalAlign:"middle"}}),"Latest due diligence run is superseded. Use Re-run to start a fresh one.",s.jsx("div",{style:{marginTop:10},children:s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:d,disabled:i.isPending,children:[i.isPending?s.jsx(ne,{size:12,className:"animate-spin"}):s.jsx(ps,{size:12}),"Re-run due diligence"]})})]}):s.jsx(JQe,{onRunDD:d,rerunPending:i.isPending,isMobile:c})}function rXe({supplierUserId:e,onClick:t,expanded:n}){var d,h,f;const{recent:r,isQueued:i}=_ne(e),a=r.data;let o="No AI due diligence",l=Cn,c="neutral",u=!1;if(i)o="Due diligence queued",l=ne,c="neutral",u=!0;else if(a&&(a.status==="queued"&&(o="Due diligence queued",l=ne,c="neutral",u=!0),a.status==="running"&&(o="AI due diligence running",l=ne,c="neutral",u=!0),a.status==="failed"&&(o="AI due diligence failed",l=gn,c="negative"),a.status==="timed_out"&&(o="AI due diligence timed out",l=Yn,c="negative"),a.status==="complete")){const p=(h=(d=a.dossier)==null?void 0:d.recommended_action)==null?void 0:h.action;o=`AI recommendation · ${((f=Z2[p])==null?void 0:f.label)??"complete"}`,l=sn,c=p==="approve"?"positive":p==="reject"?"negative":"warning"}return s.jsxs("button",{type:"button",onClick:t,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"4px 10px",borderRadius:999,background:c==="positive"?"hsl(var(--c-positive-soft))":c==="warning"?"hsl(var(--c-warning-soft))":c==="negative"?"hsl(var(--c-negative-soft))":"hsl(var(--c-surface-2))",color:c==="positive"?"hsl(var(--c-positive-fg))":c==="warning"?"hsl(var(--c-warning-fg))":c==="negative"?"hsl(var(--c-negative-fg))":"hsl(var(--c-fg-muted))",border:"1px solid "+(c==="positive"?"hsl(var(--c-positive-border))":c==="warning"?"hsl(var(--c-warning-border))":c==="negative"?"hsl(var(--c-negative-border))":"hsl(var(--c-border))"),fontFamily:"var(--font-mono)",fontSize:11,fontWeight:600,cursor:"pointer"},children:[(()=>{const p=l;return s.jsx(p,{size:11,className:u?"animate-spin":""})})(),o,s.jsx("span",{style:{opacity:.6,marginLeft:2},children:n?"▾":"▸"})]})}const iXe=({run:e})=>{if(e.status!=="complete"||!e.result)return s.jsx(xM,{run:e});const t={...e,dossier:e.result};return s.jsx(kne,{run:t,onRerun:()=>{},rerunPending:!1,historyCount:0,onShowHistory:()=>{},history:void 0,hideFooter:!0})};function sXe(e){if(!e)return"??";const t=e.trim();if(!t)return"??";const n=t.split(/\s+/);return n.length===1?n[0].slice(0,2).toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()}function aXe({expandedSupplierId:e}={}){const{data:t=[],isLoading:n}=Tte(),r=EYe(),i=PYe(),{toast:a}=xt(),o=dc(),[l,c]=x.useState(!1),[u,d]=x.useState(null),[h,f]=x.use
854State(""),[p,m]=x.useState({}),g=x.useRef(null),y=t.filter(j=>j.status==="pending");x.useEffect(()=>{e&&m(j=>j[e]?j:{...j,[e]:!0})},[e]),x.useEffect(()=>{if(!e||!p[e])return;const j=setTimeout(()=>{var S;(S=g.current)==null||S.scrollIntoView({behavior:"smooth",block:"start"})},60);return()=>clearTimeout(j)},[e,p]);const b=j=>{m(S=>({...S,[j]:!S[j]}))},v=async j=>{try{await r.mutateAsync({supplierUserId:j.id,supplierEmail:j.userEmail,companyName:j.pendingCompanyName}),a({title:"Supplier approved successfully"})}catch(S){a({title:"Error",description:S.message||"Failed to approve supplier",variant:"destructive"})}},w=j=>{d(j),f(""),c(!0)},_=async()=>{if(!u||!h.trim())return;const j=t.find(S=>S.id===u);try{await i.mutateAsync({supplierUserId:u,reason:h.trim(),supplierEmail:j==null?void 0:j.userEmail,companyName:j==null?void 0:j.pendingCompanyName}),a({title:"Supplier registration rejected"}),c(!1),d(null)}catch(S){a({title:"Error",description:S.message||"Failed to reject supplier",variant:"destructive"})}};return n?s.jsxs("div",{className:"xph-card",style:{padding:20},children:[s.jsx(ce,{className:"h-6 w-64 mb-4"}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[...Array(3)].map((j,S)=>s.jsx(ce,{className:"h-20 w-full"},S))})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 20px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:28,height:28,borderRadius:7,background:"hsl(var(--c-stage-glp-bg))",color:"hsl(var(--c-stage-glp-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(po,{size:14})}),s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",children:"Supplier registrations"}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:"Approve or reject pending company access"})]})]}),s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 10px",borderRadius:999,background:y.length>0?"hsl(var(--c-warning-soft))":"hsl(var(--c-surface))",color:y.length>0?"hsl(var(--c-warning-fg))":"hsl(var(--c-fg-muted))",border:`1px solid ${y.length>0?"hsl(var(--c-warning-border))":"hsl(var(--c-border))"}`,fontFamily:"var(--font-mono)",fontSize:11,fontWeight:600,letterSpacing:"0.04em"},children:[y.length," pending"]})]}),y.length===0?s.jsx("div",{style:{padding:36,textAlign:"center",color:"hsl(var(--c-fg-muted))",fontSize:13.5},children:"No pending supplier registrations"}):s.jsx("div",{children:y.map(j=>{const S=$r(new Date(j.createdAt),{addSuffix:!0}),k=!!p[j.id];return s.jsxs("div",{ref:e===j.id?g:void 0,style:{borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsxs("div",{style:{padding:o?"14px 16px":"16px 20px",display:"grid",gridTemplateColumns:o?"auto minmax(0, 1fr)":"auto minmax(0, 1fr) auto",gap:o?12:16,alignItems:"center"},children:[s.jsxs("div",{style:{width:o?44:56,height:o?44:56,borderRadius:8,background:"hsl(var(--c-ink))",color:"hsl(var(--c-ink-inverse))",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:o?11:13,fontWeight:600,letterSpacing:"0.04em",flexShrink:0},children:[s.jsx("span",{style:{fontSize:8.5,opacity:.65,marginBottom:1},children:"SUPPLIER"}),s.jsx("span",{children:sXe(j.pendingCompanyName)})]}),s.jsxs("div",{style:{minWidth:0},children:[s.jsx("div",{style:{display:"flex",gap:8,alignItems:"baseline",flexWrap:"wrap"},children:s.jsx("span",{style:{fontWeight:600,color:"hsl(var(--c-ink))",fontSize:15},children:j.pendingCompanyName||"Unnamed company"})}),s.jsxs("div",{style:{marginTop:5,display:"flex",gap:o?8:14,flexWrap:"wrap",fontSize:12.5,color:"hsl(var(--c-fg-muted))"},children:[j.pendingCompanyLocation&&s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[s.jsx(Um,{size:11}),j.pendingCompanyLocation]}),j.userEmail&&s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:12},children:[s.jsx(qs,{size:11}),j.userEmail]}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["submitted ",S]})]}),s.jsx("div",{style:{marginTop:8},children:s.jsx(rXe,{supplierUserId:j.id,onClick:()=>b(j.id),expanded:k})})]}),s.jsxs("div",{style:{display:"flex",gap:6,gridColumn:o?"1 / -1":"auto",flexWrap:"wrap"},children:[s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:()=>w(j.id),disabled:i.isPending,style:{color:"hsl(var(--c-negative-fg))",...o?{flex:1,justifyContent:"center"}:{}},children:[s.jsx(gn,{size:12}),"Reject"]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:()=>v(j),disabled:r.isPending,style:o?{flex:1,justifyContent:"center"}:void 0,children:[r.isPending?s.jsx(ne,{size:12,className:"animate-spin"}):s.jsx(fo,{size:12}),"Approve"]})]})]}),k&&s.jsx("div",{style:{background:"hsl(var(--c-surface))",borderTop:"1px solid hsl(var(--c-border))",paddingLeft:o?12:16,paddingRight:o?12:16,paddingTop:14,paddingBottom:18,animation:"xph-dd-expand 200ms ease-out"},children:s.jsx("div",{style:{marginLeft:o?8:16,paddingLeft:o?12:16,borderLeft:"2px s
854olid hsl(var(--c-accent-border))"},children:s.jsx(Nne,{supplierUserId:j.id,expanded:!0})})})]},j.id)})})]}),s.jsx(Br,{open:l,onOpenChange:c,children:s.jsxs(br,{children:[s.jsx(wr,{children:s.jsx(jr,{children:"Reject Supplier Registration"})}),s.jsx("div",{className:"space-y-4 py-4",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"rejection-reason",children:"Rejection Reason"}),s.jsx(Ys,{id:"rejection-reason",placeholder:"Please provide a reason for rejection...",value:h,onChange:j=>f(j.target.value),rows:4})]})}),s.jsxs(_i,{children:[s.jsx(je,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),s.jsxs(je,{variant:"destructive",onClick:_,disabled:!h.trim()||i.isPending,children:[i.isPending&&s.jsx(ne,{className:"h-4 w-4 mr-2 animate-spin"}),"Reject Registration"]})]})]})})]})}function oXe(e){return(e.productName||"ASSET").replace(/[^A-Za-z0-9]+/g,"").slice(0,4).toUpperCase()||"ASSET"}function lXe(){const{data:e=[],isLoading:t}=Ete(),n=dc();return t?s.jsxs("div",{className:"xph-card",style:{padding:20},children:[s.jsx(ce,{className:"h-6 w-64 mb-4"}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[...Array(3)].map((r,i)=>s.jsx(ce,{className:"h-20 w-full"},i))})]}):s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 20px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:28,height:28,borderRadius:7,background:"hsl(var(--c-stage-preind-bg))",color:"hsl(var(--c-stage-preind-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(ti,{size:14})}),s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",children:"Listing approval queue"}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:"Asset submissions awaiting publication review"})]})]}),s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 10px",borderRadius:999,background:e.length>0?"hsl(var(--c-warning-soft))":"hsl(var(--c-surface))",color:e.length>0?"hsl(var(--c-warning-fg))":"hsl(var(--c-fg-muted))",border:`1px solid ${e.length>0?"hsl(var(--c-warning-border))":"hsl(var(--c-border))"}`,fontFamily:"var(--font-mono)",fontSize:11,fontWeight:600,letterSpacing:"0.04em"},children:[e.length," pending"]})]}),e.length===0?s.jsx("div",{style:{padding:36,textAlign:"center",color:"hsl(var(--c-fg-muted))",fontSize:13.5},children:"No pending asset submissions"}):s.jsx("div",{children:e.map(r=>{const i=r.updatedAt??r.listedAt,a=$r(new Date(i),{addSuffix:!0});return s.jsxs("div",{style:{padding:n?"14px 16px":"16px 20px",borderBottom:"1px solid hsl(var(--c-border))",display:"grid",gridTemplateColumns:n?"auto minmax(0, 1fr)":"auto minmax(0, 1fr) auto auto",gap:n?12:16,alignItems:"center"},children:[s.jsxs("div",{style:{width:n?44:56,height:n?44:56,borderRadius:8,background:"hsl(var(--c-ink))",color:"hsl(var(--c-ink-inverse))",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:n?11:13,fontWeight:600,letterSpacing:"0.04em",flexShrink:0},children:[s.jsx("span",{style:{fontSize:8.5,opacity:.65,marginBottom:1},children:"ASSET"}),s.jsx("span",{children:oXe(r)})]}),s.jsxs("div",{style:{minWidth:0},children:[s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"baseline",flexWrap:"wrap"},children:[s.jsx("span",{style:{fontWeight:600,color:"hsl(var(--c-ink))",fontSize:15},children:r.productName}),s.jsx("span",{className:`xph-badge ${ea[r.stage]}`,children:Nn[r.stage]})]}),s.jsxs("div",{style:{marginTop:5,display:"flex",gap:n?8:14,flexWrap:"wrap",fontSize:12.5,color:"hsl(var(--c-fg-muted))"},children:[s.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:12},children:[r.primaryTarget||"—"," · ",Zt[r.modality]]}),s.jsx("span",{children:r.supplier.name}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["submitted ",a]})]})]}),s.jsxs("div",{style:{textAlign:n?"left":"right",gridColumn:n?"1 / -1":"auto",display:n?"flex":"block",justifyContent:"space-between",alignItems:"center",paddingTop:n?4:0,borderTop:n?"1px dashed hsl(var(--c-border))":"none",marginTop:n?4:0},children:[s.jsx("div",{className:"eyebrow",style:{fontSize:9.5},children:"Est. NPV"}),s.jsx("div",{className:"tt-stat-md",style:{marginTop:n?0:2},children:ds(r.estimatedNPV)})]}),s.jsx("div",{style:{display:"flex",gap:6,gridColumn:n?"1 / -1":"auto"},children:s.jsxs(oe,{to:`/admin/review/asset/${r.id}`,className:"xph-btn xph-btn-primary xph-btn-sm",style:n?{flex:1,justifyContent:"center"}:void 0,children:["Review",s.jsx(Gn,{size:12})]})})]},r.id)})})]})}const iA="agent_runs",sA="buyer_dd",aA=9e4,ff=e=>["buyer-dd",e,"queuedAt"];function Cne(e,{subscribe:t=!0}={}){var f,p;const n=Ae(),{guardMutation:r}=qe(),a=Se({queryKey:ff(e),enabled:!!e,queryFn:()=>null,staleTime:1/0,gcTime:1/0,initialData:null}).data??null,o=Se({queryKey:["buyer-dd",e,"recent"],enabled:!!e,queryFn:async()=>{const{data:m,error:g}=await W.from(iA).select("*").eq("agent_key",sA).eq("subject_id",e).order("created_at",{ascending:!1}).limit(1).maybeSingle();if(g)throw g;return m?{...m,dossier:m.result??null}:null},refetchInterval:m=>{var b;const g=(b=m.state.data)==null?void 0:b.status;if(g==="running"||g==="queued")return 2e4;const y=n.getQueryData(ff(e));return y&&Date.now()-y<aA?5e3:!1}}),l=o.data;x.useEffect(()=>{if(!e||!a)return;if(l&&new Date(l.created_at).getTime()>=a-1e3){n.setQueryData(ff(e),null);return}const m=aA-(Date.now()-a);if(m<=0){n.setQueryData(ff(e),null);return}const g=setTimeout(()=>{n.setQueryData(ff(e),null)},m);return()=>clearTimeout(g)},[e,a,l,n]);const c=!!(a&&Date.now()-a<aA&&(!l||new Date(l.created_at).getTime()<a-1e3)),u=Se({queryKey:["buyer-dd",e,"history"],enabled:!1,queryFn:async()=>{const{data:m,error:g}=await W.from(iA).select("*").eq("agent_key",sA).eq("subject_id",e).eq("status","superseded").order("created_at",{ascending:!1});if(g)throw g;return(m??[]).map(y=>({...y,dossier:y.result??null}))}});x.useEffect(()=>{if(!t||!e)return;const m=W.channel(`agent_runs_buyer_dd_${e}`).on("postgres_changes",{event:"*",schema:"public",table:iA,filter:`subject_id=eq.${e}`},()=>{n.invalidateQueries({queryKey:["buyer-dd",e,"recent"]}),n.invalidateQueries({queryKey:["buyer-dd",e,"history"]})}).subscribe();return()=>{W.removeChannel(m)}},[t,e,n]);const d=$e({mutationFn:async m=>{if(r("Running DD on a buyer"))throw new Error("Impersonation mode");const{data:g,error:y}=await W.functions.invoke("re-run-agent",{body:{agent_key:sA,subject_type:"buyer_users",subject_id:m}});if(y)throw y;if(g!=null&&g.error)throw new Error(g.error);return g},onSuccess:()=>{e&&n.setQueryData(ff(e),Date.now()),n.invalidateQueries({queryKey:["buyer-dd",e,"recent"]})}}),h=((f=u.data)==null?void 0:f.length)??((p=o.data)!=null&&p.parent_run_id?1:0);return{recent:o,history:u,runDD:d,supersededCount:h,isQueued:c}}const Rm=e=>e?"14px 16px":"16px 20px",J2={approve:{label:"Approve",bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))",border:"hsl(var(--c-positive-border))"},request_more_info:{label:"Request more info",bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))",border:"hsl(var(--c-warning-border))"},flag_for_review:{label:"Flag for review",bg:"hsl(var(--c-stage-clinical-bg))",fg:"hsl(var(--c-stage-clinical-fg))",border:"hsl(var(--c-stage-clinical-border))"},reject:{label:"Reject",bg:"hsl(var(--c-negative-soft))",fg:"hsl(var(--c-negative-fg))",border:"hsl(var(--c-negative-border))"}};function Q0({queries:e,label:t="queries run"}){return!e||e.length===0?null:s.jsxs("details",{style:{marginTop:6},children:[s.jsxs("summary",{style:{cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-fg-subtle))",textTransform:"uppercase",letterSpacing:"0.06em"},children:[e.length," ",e.length===1?t.replace(/s$/,""):t]}),s.jsx("ul",{style:{margin:"6px 0 0",paddingLeft:18,fontFamily:"var(--font-mono)",fontSize:11.5,lineHeight:1.6,color:"hsl(var(--c-fg-muted))"},children:e.map((n,r)=>s.jsx("li",{children:n},r))})]})}function Nc({url:e,children:t}){return s.jsxs("a",{href:e,target:"_blank",rel:"noreferrer noopener",style:{display:"inline-flex",alignItems:"center",gap:3,color:"hsl(var(--c-link))",textDecoration:"underline",wordBreak:"break-all",fontFamily:"var(--font-mono)",fontSize:11.5},children:[t??e," ",s.jsx(tc,{size:10})]})}function cXe({startedAt:e,isMobile:t}){const n=$r(new Date(e),{addSuffix:!1});return s.jsxs("div",{style:{padding:Rm(t),display:"flex",alignItems:"center",gap:10,color:"hsl(var(--c-fg-muted))",fontSize:13},children:[s.jsx(ne,{size:14,className:"animate-spin"}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:600},children:"AI due diligence running…"}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["Started ",n," ago · typically completes in 1–5 minutes. This panel will update automatically."]})]})]})}function fV({isMobile:e}){return s.jsxs("div",{style:{padding:Rm(e),display:"flex",alignItems:"center",gap:10,color:"hsl(var(--c-fg-muted))",fontSize:13},children:[s.jsx(ne,{size:14,className:"animate-spin"}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:600},children:"Due diligence queued"}),s.jsx("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:"Agent will start within ~30s and typically completes in 1–5 minutes. This panel will update automatically."})]})]})}function uXe({run:e,onRerun:t,rerunPending:n,isMobile:r}){const i=e.status==="timed_out",a=`
855
856--- raw agent output ---
857`,o=e.error_message??"",l=o.indexOf(a),c=l>=0?o.slice(0,l):o,u=l>=0?o.slice(l+a.length):null;return s.jsxs("div",{style:{padding:Rm(r)},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[s.jsx(ir,{size:14,style:{color:"hsl(var(--c-negative-fg))"}}),s.jsx("span",{style:{fontWeight:600,fontSize:13,color:"hsl(var(--c-ink))"},children:i?"AI due diligence timed out":"AI due diligence failed"})]}),c&&s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-muted))",marginBottom:12,whiteSpace:"pre-wrap"},children:c}),u&&s.jsxs("details",{style:{marginBottom:12},children:[s.jsxs("summary",{style:{cursor:"pointer",fontSize:12,color:"hsl(var(--c-link))",textDecoration:"underline"},children:["Raw agent output (",u.length," chars)"]}),s.jsx("pre",{style:{marginTop:8,padding:10,background:"hsl(var(--c-surface-2))",border:"1px solid hsl(var(--c-border))",borderRadius:6,maxHeight:280,overflow:"auto",fontFamily:"var(--font-mono)",fontSize:11.5,lineHeight:1.45,whiteSpace:"pre-wrap",wordBreak:"break-word",color:"hsl(var(--c-fg))"},children:u})]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:t,disabled:n,children:[n?s.jsx(ne,{size:12,className:"animate-spin"}):s.jsx(ps,{size:12}),"Re-run due diligence"]})]})}function dXe({buyerUserId:e,onRunDD:t,rerunPending:n,isMobile:r}){return s.jsxs("div",{style:{padding:Rm(r),display:"flex",alignItems:"center",gap:12,color:"hsl(var(--c-fg-muted))",fontSize:13},children:[s.jsx(Cn,{size:14}),s.jsx("span",{style:{flex:1},children:"No AI due diligence on file for this buyer. (Legacy signup or DD not yet triggered.)"}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:t,disabled:n,children:[n?s.jsx(ne,{size:12,className:"animate-spin"}):s.jsx(SI,{size:12}),"Run due diligence"]})]})}function xc({title:e,children:t}){return s.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:10},children:[s.jsx("div",{style:{display:"flex",alignItems:"center",gap:12,paddingBottom:6,borderBottom:"1px solid hsl(var(--c-border))"},children:s.jsx("h3",{className:"eyebrow",style:{margin:0,color:"hsl(var(--c-fg-muted))",letterSpacing:"0.12em"},children:e})}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:t})]})}function hXe({claim:e,quote:t,citation:n}
857){return s.jsxs("div",{style:{paddingLeft:14,borderLeft:"2px solid hsl(var(--c-border))",display:"flex",flexDirection:"column",gap:4},children:[s.jsx("div",{style:{color:"hsl(var(--c-ink))",fontSize:13.5,lineHeight:1.55},children:e}),t&&s.jsxs("div",{style:{color:"hsl(var(--c-fg-muted))",fontSize:12.5,lineHeight:1.55,fontStyle:"italic"},children:["“",t,"”"]}),n&&s.jsx(Nc,{url:n})]})}function Ane({run:e,onRerun:t,rerunPending:n,historyCount:r,onShowHistory:i,history:a,isMobile:o,hideFooter:l=!1}){const c=e.dossier,[u,d]=x.useState(!1);if(!c)return null;const h=c.recommended_action.action,f=J2[h]??J2.flag_for_review,p=e.completed_at?$r(new Date(e.completed_at),{addSuffix:!0}):"—";return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:28,maxWidth:920,paddingTop:4},children:[s.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:14},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12,flexWrap:"wrap"},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))"},children:"Counterparty due diligence · AI advisory"}),s.jsxs("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:[c.meta.agent_version??e.agent_version," · ",c.meta.searches_performed??"–"," sources · ",p]})]}),s.jsx("div",{style:{display:"flex",gap:16,alignItems:"flex-start",paddingLeft:14,borderLeft:`3px solid ${f.fg}`},children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,flex:1,minWidth:0},children:[s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[s.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:f.fg},children:["Recommendation: ",f.label]}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["· ",c.recommended_action.confidence," confidence"]})]}),s.jsx("p",{style:{margin:0,fontSize:15,lineHeight:1.6,color:"hsl(var(--c-ink))"},children:c.admin_summary})]})})]}),c.what_would_change_recommendation&&s.jsx(xc,{title:"What would change this recommendation",children:s.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.6,color:"hsl(var(--c-ink))",fontStyle:"italic"},children:c.what_would_change_recommendation})}),c.evidence_gaps&&c.evidence_gaps.length>0&&s.jsx(xc,{title:"Evidence gaps",children:s.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13.5,lineHeight:1.7,color:"hsl(var(--c-fg))"},children:c.evidence_gaps.map((m,g)=>s.jsx("li",{children:m},g))})}),s.jsxs(xc,{title:"Identity verification",children:[s.jsxs("p",{style:{margin:0,fontSize:13.5,lineHeight:1.6,color:"hsl(var(--c-fg))"},children:["Company existence"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:c.identity.company_exists.replace(/_/g," ")}),"; person at company"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:c.identity.person_exists_at_company.replace(/_/g," ")}),"; email domain"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:c.identity.email_domain_match.status.replace(/_/g," ")}),c.identity.email_domain_match.note?` — ${c.identity.email_domain_match.note}`:"."]}),c.identity.findings.length>0&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,marginTop:4},children:c.identity.findings.map((m,g)=>s.jsx(hXe,{claim:m.claim,quote:m.supporting_quote,citation:m.citation_url},g))}),c.identity.leaders&&c.identity.leaders.length>0&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10,marginTop:8},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))"},children:"Leaders investigated"}),c.identity.leaders.map((m,g)=>s.jsxs("div",{style:{paddingLeft:14,borderLeft:`2px solid hsl(var(${m.verified_at_company?"--c-positive-border":"--c-warning-border"}))`,display:"flex",flexDirection:"column",gap:4},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:8,flexWrap:"wrap"},children:[s.jsxs("div",{style:{color:"hsl(var(--c-ink))",fontSize:13.5,fontWeight:500},children:[m.name,m.role_at_company&&s.jsxs("span",{style:{color:"hsl(var(--c-fg-muted))",fontWeight:400},children:[" ","— ",m.role_at_company]})]}),s.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:`hsl(var(${m.verified_at_company?"--c-positive-fg":"--c-warning-fg"}))`},children:[m.verified_at_company?"verified":"unverified",m.counter_evidence_searched&&" · CE✓"]})]}),m.notes&&s.jsx("div",{style:{color:"hsl(var(--c-fg-muted))",fontSize:12.5,lineHeight:1.55},children:m.notes}),m.citation_urls&&m.citation_urls.length>0&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:m.citation_urls.map((y,b)=>s.jsx(Nc,{url:y},b))}),s.jsx(Q0,{queries:m.queries_run})]},g))]}),s.jsx(Q0,{queries:c.identity.queries_run})]}),s.jsxs(xc,{title:"Buyer classification",children:[s.jsxs("p",{style:{margin:0,fontSize:13.5,lineHeight:1.6,color:"hsl(var(--c-fg))"},children:["Classified as"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"}
857,children:c.classification.buyer_type.replace(/_/g," ")})," ","with ",c.classification.confidence," confidence. ",c.classification.rationale]}),c.classification.mandate_freshness&&s.jsxs("p",{style:{margin:0,fontSize:13,color:"hsl(var(--c-fg-muted))"},children:["Mandate freshness:"," ",s.jsx("strong",{style:{color:`hsl(var(${c.classification.mandate_freshness.status==="current"?"--c-positive-fg":c.classification.mandate_freshness.status==="stale_pre_2024"?"--c-warning-fg":"--c-fg-muted"}))`},children:c.classification.mandate_freshness.status.replace(/_/g," ")}),c.classification.mandate_freshness.last_evidence_date&&` (last evidence: ${c.classification.mandate_freshness.last_evidence_date})`,c.classification.mandate_freshness.citation&&s.jsxs(s.Fragment,{children:[" — ",s.jsx(Nc,{url:c.classification.mandate_freshness.citation})]})]}),c.classification.citations&&c.classification.citations.length>0&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:3},children:c.classification.citations.map((m,g)=>s.jsx(Nc,{url:m},g))}),s.jsx(Q0,{queries:c.classification.queries_run})]}),s.jsxs(xc,{title:"Risk screening",children:[s.jsxs("p",{style:{margin:0,fontSize:13.5,lineHeight:1.6,color:"hsl(var(--c-fg))"},children:["Sanctions screen"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:c.risk_screening.sanctions_check}),"; jurisdiction risk"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:c.risk_screening.jurisdiction_risk}),"."]}),c.risk_screening.litigation_check&&s.jsxs("div",{style:{marginTop:4},children:[s.jsxs("p",{style:{margin:0,fontSize:13.5,lineHeight:1.6,color:"hsl(var(--c-fg))"},children:["Litigation screen"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:c.risk_screening.litigation_check.status}),c.risk_screening.litigation_check.findings&&c.risk_screening.litigation_check.findings.length>0?".":" (no findings)."]}),c.risk_screening.litigation_check.findings&&c.risk_screening.litigation_check.findings.length>0&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:6},children:c.risk_screening.litigation_check.findings.map((m,g)=>s.jsxs("div",{style:{paddingLeft:14,borderLeft:"2px solid hsl(var(--c-warning-border))",display:"flex",flexDirection:"column",gap:4},children:[s.jsxs("div",{style:{color:"hsl(var(--c-ink))",fontSize:13.5,lineHeight:1.55},children:[m.summary,m.type&&s.jsxs("span",{style:{color:"hsl(var(--c-fg-muted))",fontSize:11.5,fontFamily:"var(--font-mono)",marginLeft:6},children:["(",m.type.replace(/_/g," "),")"]})]}),s.jsx(Nc,{url:m.citation_url})]},g))})]}),c.risk_screening.notable_concerns.length===0?s.jsx("p",{style:{margin:0,fontSize:13,color:"hsl(var(--c-fg-muted))",fontStyle:"italic"},children:"No notable concerns surfaced by the agent."}):s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:c.risk_screening.notable_concerns.map((m,g)=>s.jsxs("div",{style:{paddingLeft:14,borderLeft:`2px solid hsl(var(--${m.severity==="high"?"c-negative-border":"c-warning-border"}))`,display:"flex",flexDirection:"column",gap:4},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:8},children:[s.jsx("div",{style:{color:"hsl(var(--c-ink))",fontSize:13.5,lineHeight:1.55},children:m.concern}),s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:`hsl(var(--${m.severity==="high"?"c-negative-fg":m.severity==="medium"?"c-warning-fg":"c-fg-muted"}))`},children:m.severity})]}),m.citation_url&&s.jsx(Nc,{url:m.citation_url})]},g))}),s.jsx(Q0,{queries:c.risk_screening.queries_run})]}),s.jsxs(xc,{title:"Web footprint",children:[s.jsxs("p",{style:{margin:0,fontSize:13.5,lineHeight:1.6,color:"hsl(var(--c-fg))"},children:["Estimated company age"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:c.web_footprint.company_age_estimate}),"; size"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:c.web_footprint.size_estimate}),"; visible pipeline or portfolio"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:c.web_footprint.has_visible_pipeline_or_portfolio?"yes":"no"}),"."]}),c.web_footprint.notable_signals&&c.web_footprint.notable_signals.length>0&&s.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13.5,lineHeight:1.65,color:"hsl(var(--c-fg))"},children:c.web_footprint.notable_signals.map((m,g)=>s.jsx("li",{children:m},g))}),c.web_footprint.citations&&c.web_footprint.citations.length>0&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:3},children:c.web_footprint.citations.map((m,g)=>s.jsx(Nc,{url:m},g))})]}),c.anomalies.length>0&&s.jsx(xc,{title:"Anomalies",children:s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:14},children:c.anomalies.map((m,g)=>
857s.jsxs("div",{style:{paddingLeft:14,borderLeft:"2px solid hsl(var(--c-warning-border))",display:"flex",flexDirection:"column",gap:4},children:[s.jsx("div",{style:{color:"hsl(var(--c-ink))",fontSize:13.5,lineHeight:1.55,fontWeight:500},children:m.observation}),s.jsx("div",{style:{color:"hsl(var(--c-fg-muted))",fontSize:12.5,lineHeight:1.55},children:m.why_concerning}),m.citation_url&&s.jsx(Nc,{url:m.citation_url})]},g))})}),s.jsxs(xc,{title:"Recommendation & rationale",children:[s.jsx("p",{style:{margin:0,fontSize:13.5,lineHeight:1.6,color:"hsl(var(--c-fg))"},children:c.recommended_action.rationale}),typeof c.recommended_action.counter_evidence_searched=="boolean"&&s.jsxs("div",{className:"tt-mono-sm",style:{color:c.recommended_action.counter_evidence_searched?"hsl(var(--c-fg-subtle))":"hsl(var(--c-warning-fg))",marginTop:4},children:["Counter-evidence searched:"," ",s.jsx("strong",{children:c.recommended_action.counter_evidence_searched?"yes":"no"})]}),c.recommended_action.follow_up_questions&&c.recommended_action.follow_up_questions.length>0&&s.jsxs("div",{style:{marginTop:4},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))",marginBottom:6},children:"Suggested follow-up"}),s.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13.5,lineHeight:1.7,color:"hsl(var(--c-fg))"},children:c.recommended_action.follow_up_questions.map((m,g)=>s.jsx("li",{children:m},g))})]}),c.recommended_action.specific_concerns_to_review&&c.recommended_action.specific_concerns_to_review.length>0&&s.jsxs("div",{style:{marginTop:4},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))",marginBottom:6},children:"Specific concerns to review"}),s.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13.5,lineHeight:1.7,color:"hsl(var(--c-fg))"},children:c.recommended_action.specific_concerns_to_review.map((m,g)=>s.jsx("li",{children:m},g))})]})]}),!l&&s.jsxs("footer",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,rowGap:10,flexWrap:"wrap",paddingTop:14,borderTop:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{style:{display:"flex",alignItems:"center",gap:14,flexWrap:"wrap"},children:(r>0||e.parent_run_id)&&s.jsx("button",{type:"button",onClick:()=>{d(m=>!m),u||i()},style:{background:"none",border:"none",padding:0,color:"hsl(var(--c-link))",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:11.5,textDecoration:"underline"},children:u?"Hide history":`History (${r||"?"})`})}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:t,disabled:n,children:[n?s.jsx(ne,{size:12,className:"animate-spin"}):s.jsx(ps,{size:12}),"Re-run due diligence"]})]}),!l&&u&&a&&a.length>0&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:a.map(m=>{var g,y,b;return s.jsxs("details",{style:{paddingLeft:14,borderLeft:"2px solid hsl(var(--c-border))"},children:[s.jsxs("summary",{style:{cursor:"pointer",fontSize:12.5,color:"hsl(var(--c-fg))"},children:[((y=(g=m.dossier)==null?void 0:g.recommended_action)==null?void 0:y.action)??"unknown"," • ",m.agent_version," • ",$r(ne
857w Date(m.completed_at??m.created_at),{addSuffix:!0})]}),((b=m.dossier)==null?void 0:b.admin_summary)&&s.jsx("div",{style:{marginTop:6,fontSize:12.5,color:"hsl(var(--c-fg-muted))",lineHeight:1.55},children:m.dossier.admin_summary})]},m.id)})})]})}function Tne({buyerUserId:e,expanded:t}){const{recent:n,history:r,runDD:i,supersededCount:a,isQueued:o}=Cne(e,{subscribe:!1}),{toast:l}=xt(),c=dc();if(!t)return null;const u=n.data,d=async()=>{try{await i.mutateAsync(e),l({title:"Due diligence queued",description:"Agent typically completes in 1–5 minutes. The dossier will appear here automatically."})}catch(f){l({title:"Failed to start due diligence",description:(f==null?void 0:f.message)??"unknown error",variant:"destructive"})}},h=()=>{r.refetch()};return n.isLoading?s.jsx("div",{style:{padding:Rm(c),color:"hsl(var(--c-fg-muted))",fontSize:13},children:"Loading due diligence…"}):i.isPending||o?s.jsx(fV,{isMobile:c}):u?u.status==="queued"?s.jsx(fV,{isMobile:c}):u.status==="running"?s.jsx(cXe,{startedAt:u.started_at??u.created_at,isMobile:c}):u.status==="failed"||u.status==="timed_out"?s.jsx(uXe,{run:u,onRerun:d,rerunPending:i.isPending,isMobile:c}):u.status==="complete"?s.jsx(Ane,{run:u,onRerun:d,rerunPending:i.isPending,historyCount:a,onShowHistory:h,history:r.data,isMobile:c}):s.jsxs("div",{style:{padding:Rm(c),color:"hsl(var(--c-fg-muted))",fontSize:13},children:[s.jsx(I_,{size:14,style:{marginRight:6,verticalAlign:"middle"}}),"Latest due diligence run is superseded. Use Re-run to start a fresh one.",s.jsx("div",{style:{marginTop:10},children:s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:d,disabled:i.isPending,children:[i.isPending?s.jsx(ne,{size:12,className:"animate-spin"}):s.jsx(ps,{size:12}),"Re-run due diligence"]})})]}):s.jsx(dXe,{buyerUserId:e,onRunDD:d,rerunPending:i.isPending,isMobile:c})}function fXe({buyerUserId:e,onClick:t,expanded:n}){var d,h,f;const{recent:r,isQueued:i}=Cne(e),a=r.data;let o="No AI due diligence",l=Cn,c="neutral",u=!1;if(i)o="Due diligence queued",l=ne,c="neutral",u=!0;else if(a&&(a.status==="queued"&&(o="Due diligence queued",l=ne,c="neutral",u=!0),a.status==="running"&&(o="AI due diligence running",l=ne,c="neutral",u=!0),a.status==="failed"&&(o="AI due diligence failed",l=gn,c="negative"),a.status==="timed_out"&&(o="AI due diligence timed out",l=Yn,c="negative"),a.status==="complete")){const p=(h=(d=a.dossier)==null?void 0:d.recommended_action)==null?void 0:h.action;o=`AI recommendation · ${((f=J2[p])==null?void 0:f.label)??"complete"}`,l=sn,c=p==="approve"?"positive":p==="reject"?"negative":"warning"}return s.jsxs("button",{type:"button",onClick:t,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"4px 10px",borderRadius:999,background:c==="positive"?"hsl(var(--c-positive-soft))":c==="warning"?"hsl(var(--c-warning-soft))":c==="negative"?"hsl(var(--c-negative-soft))":"hsl(var(--c-surface-2))",color:c==="positive"?"hsl(var(--c-positive-fg))":c==="warning"?"hsl(var(--c-warning-fg))":c==="negative"?"hsl(var(--c-negative-fg))":"hsl(var(--c-fg-muted))",border:"1px solid "+(c==="positive"?"hsl(var(--c-positive-border))":c==="warning"?"hsl(var(--c-warning-border))":c==="negative"?"hsl(var(--c-negative-border))":"hsl(var(--c-border))"),fontFamily:"var(--font-mono)",fontSize:11,fontWeight:600,cursor:"pointer"},children:[(()=>{const p=l;return s.jsx(p,{size:11,className:u?"animate-spin":""})})(),o,s.jsx("span",{style:{opacity:.6,marginLeft:2},children:n?"▾":"▸"})]})}const pXe=({run:e})=>{const t=dc();if(e.status!=="complete"||!e.result)return s.jsx(xM,{run:e});const n={...e,dossier:e.result};return s.jsx(Ane,{run:n,onRerun:()=>{},rerunPending:!1,historyCount:0,onShowHistory:()=>{},history:void 0,isMobile:t,hideFooter:!0})};function mXe(e){if(!e)return"??";const t=e.trim();if(!t)return"??";const n=t.split(/\s+/);return n.length===1?n[0].slice(0,2).toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()}function gXe({expandedBuyerId:e}={}){const{data:t=[],isLoading:n}=Pte(),r=FGe(),i=zGe(),{toast:a}=xt(),o=dc(),[l,c]=x.useState(!1),[u,d]=x.useState(null),[h,f]=x.use
857State(""),[p,m]=x.useState({}),g=x.useRef(null),y=t.filter(j=>j.status==="pending");x.useEffect(()=>{e&&m(j=>j[e]?j:{...j,[e]:!0})},[e]),x.useEffect(()=>{if(!e||!p[e])return;const j=setTimeout(()=>{var S;(S=g.current)==null||S.scrollIntoView({behavior:"smooth",block:"start"})},60);return()=>clearTimeout(j)},[e,p]);const b=j=>{m(S=>({...S,[j]:!S[j]}))},v=async j=>{var S;try{await r.mutateAsync({buyerId:j.id,buyerEmail:j.userEmail,companyName:((S=j.organization)==null?void 0:S.name)||j.pendingCompanyName}),a({title:"Buyer approved successfully"})}catch(k){a({title:"Error",description:k.message||"Failed to approve buyer",variant:"destructive"})}},w=async()=>{var S;if(!u)return;const j=t.find(k=>k.id===u);try{await i.mutateAsync({buyerId:u,reason:h,buyerEmail:j==null?void 0:j.userEmail,companyName:((S=j==null?void 0:j.organization)==null?void 0:S.name)||(j==null?void 0:j.pendingCompanyName)}),a({title:"Buyer rejected"}),c(!1),d(null),f("")}catch(k){a({title:"Error",description:k.message||"Failed to reject buyer",variant:"destructive"})}},_=j=>{d(j),c(!0)};return n?s.jsxs("div",{className:"xph-card",style:{padding:20},children:[s.jsx(ce,{className:"h-6 w-64 mb-4"}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[...Array(2)].map((j,S)=>s.jsx(ce,{className:"h-20 w-full"},S))})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 20px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:28,height:28,borderRadius:7,background:"hsl(var(--c-stage-clinical-bg))",color:"hsl(var(--c-stage-clinical-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(Vp,{size:14})}),s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",children:"Buyer registrations"}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:"Approve buyers requesting marketplace access"})]})]}),s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 10px",borderRadius:999,background:y.length>0?"hsl(var(--c-warning-soft))":"hsl(var(--c-surface))",color:y.length>0?"hsl(var(--c-warning-fg))":"hsl(var(--c-fg-muted))",border:`1px solid ${y.length>0?"hsl(var(--c-warning-border))":"hsl(var(--c-border))"}`,fontFamily:"var(--font-mono)",fontSize:11,fontWeight:600,letterSpacing:"0.04em"},children:[y.length," pending"]})]}),y.length===0?s.jsx("div",{style:{padding:36,textAlign:"center",color:"hsl(var(--c-fg-muted))",fontSize:13.5},children:"No pending buyer registrations"}):s.jsx("div",{children:y.map(j=>{var N,T,C;const S=$r(new Date(j.createdAt),{addSuffix:!0}),k=!!p[j.id];return s.jsxs("div",{ref:e===j.id?g:void 0,style:{borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsxs("div",{style:{padding:o?"14px 16px":"16px 20px",display:"grid",gridTemplateColumns:o?"auto minmax(0, 1fr)":"auto minmax(0, 1fr) auto",gap:o?12:16,alignItems:"center"},children:[s.jsxs("div",{style:{width:o?44:56,height:o?44:56,borderRadius:8,background:"hsl(var(--c-ink))",color:"hsl(var(--c-ink-inverse))",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:o?11:13,fontWeight:600,letterSpacing:"0.04em",flexShrink:0},children:[s.jsx("span",{style:{fontSize:8.5,opacity:.65,marginBottom:1},children:"BUYER"}),s.jsx("span",{children:mXe(((N=j.organization)==null?void 0:N.name)||j.pendingCompanyName)})]}),s.jsxs("div",{style:{minWidth:0},children:[s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"baseline",flexWrap:"wrap"},children:[s.jsx("span",{style:{fontWeight:600,color:"hsl(var(--c-ink))",fontSize:15},children:((T=j.organization)==null?void 0:T.name)||j.pendingCompanyName||"Unnamed buyer"}),(((C=j.similarOrgs)==null?void 0:C.length)??0)>0&&s.jsxs("span",{title:`Same normalized name as: ${j.similarOrgs.map(A=>`${A.name} (${A.status}, ${A.memberCount} member${A.memberCount===1?"":"s"})`).join(" · ")}. Advisory only — if this person belongs to an existing org, reject with a pointer to ask a teammate for an invite.`,style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:999,fontSize:11.5,fontWeight:600,background:"hsl(var(--c-warning-soft))",color:"hsl(var(--c-warning-fg))",border:"1px solid hsl(var(--c-warning-border))",cursor:"help"}
857,children:["Possible duplicate of ",j.similarOrgs[0].name,j.similarOrgs.length>1?` +${j.similarOrgs.length-1}`:""]})]}),s.jsxs("div",{style:{marginTop:5,display:"flex",gap:o?8:14,flexWrap:"wrap",fontSize:12.5,color:"hsl(var(--c-fg-muted))"},children:[j.pendingCompanyLocation&&s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[s.jsx(Um,{size:11}),j.pendingCompanyLocation]}),j.userEmail&&s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:12},children:[s.jsx(qs,{size:11}),j.userEmail]}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["submitted ",S]})]}),s.jsx("div",{style:{marginTop:8},children:s.jsx(fXe,{buyerUserId:j.id,onClick:()=>b(j.id),expanded:k})})]}),s.jsxs("div",{style:{display:"flex",gap:6,gridColumn:o?"1 / -1":"auto",flexWrap:"wrap"},children:[s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:()=>_(j.id),style:{color:"hsl(var(--c-negative-fg))",...o?{flex:1,justifyContent:"center"}:{}},children:[s.jsx(gn,{size:12}),"Reject"]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:()=>v(j),disabled:r.isPending,style:o?{flex:1,justifyContent:"center"}:void 0,children:[r.isPending?s.jsx(ne,{size:12,className:"animate-spin"}):s.jsx(fo,{size:12}),"Approve"]})]})]}),k&&s.jsx("div",{style:{background:"hsl(var(--c-surface))",borderTop:"1px solid hsl(var(--c-border))",paddingLeft:o?12:16,paddingRight:o?12:16,paddingTop:14,paddingBottom:18,animation:"xph-dd-expand 200ms ease-out"},children:s.jsx("div",{style:{marginLeft:o?8:16,paddingLeft:o?12:16,borderLeft:"2px solid hsl(var(--c-accent-border))"},children:s.jsx(Tne,{buyerUserId:j.id,expanded:!0})})})]},j.id)})})]}),s.jsx(Br,{open:l,onOpenChange:c,children:s.jsxs(br,{children:[s.jsxs(wr,{children:[s.jsx(jr,{children:"Reject Buyer Registration"}),s.jsx(So,{children:"Please provide a reason for rejecting this buyer registration."})]}),s.jsx(Ys,{value:h,onChange:j=>f(j.target.value),placeholder:"Enter rejection reason...",className:"min-h-[100px]"}),s.jsxs(_i,{children:[s.jsx(je,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),s.jsxs(je,{variant:"destructive",onClick:w,disabled:!h.trim()||i.isPending,children:[i.isPending&&s.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}),"Reject"]})]})]})})]})}function bM(e){return{id:e.id,supplierId:e.supplier_id,entityStatus:e.entity_status,entityDocuments:e.entity_documents??[],entityVerifiedAt:e.entity_verified_at,entityType:e.entity_type??null,country:e.country??null,identifierType:e.identifier_type??null,identifierValue:e.identifier_value??null,officialLegalName:e.official_legal_name??null,registrationDate:e.registration_date??null,registeredAddress:e.registered_address??null,legalRepresentative:e.legal_representative??null,registryConfirmed:e.registry_confirmed??!1,documentPath:e.document_path??null,websiteUrl:e.website_url??null,createdAt:e.created_at,updatedAt:e.updated_at}}function Ene(){var r;const{user:e}=me(),{data:t}=An(),n=(r=t==null?void 0:t.supplier)==null?void 0:r.id;return Se({queryKey:["supplier-onboarding",n],queryFn:async()=>{if(!n)return null;const{data:i,error:a}=await W.from("supplier_onboarding").select("*").eq("supplier_id",n).maybeSingle();if(a)throw a;return i?bM(i):null},enabled:!!e&&!!n})}function yXe(){var a;const e=Ae(),{data:t}=An(),n=(a=t==null?void 0:t.supplier)==null?void 0:a.id,{guardMutation:r}=qe(),i=Ye();return $e({mutationFn:async()=>{if(r("Creating onboarding"))throw new Error("Impersonation mode");if(!n)throw new Error("No supplier");const{data:o,error:l}=await W.from("supplier_onboarding").insert({supplier_id:n}).select().single();if(l)throw l;return bM(o)},onSuccess:o=>{var l;e.invalidateQueries({queryKey:["supplier-onboarding"]}),i({action:"create_supplier_onboarding",entityType:Ve.supplierOnboarding,entityId:o.id,entityLabel:(l=t==null?void 0:t.supplier)==null?void 0:l.name,metadata:{supplier_id:o.supplierId}})}})}function vXe(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async({id:r,entityStatus:i,entityDocuments:a})=>{if(t("Updating entity status"))throw new Error("Impersonation mode");const o={entity_status:i};a!==void 0&&(o.entity_documents=a),i==="verified"&&(o.entity_verified_at=new Date().toISOString());const{error:l}=await W.from("supplier_onboarding").update(o).eq("id",r);
857if(l)throw l;return{id:r,entityStatus:i}},onSuccess:({id:r,entityStatus:i})=>{e.invalidateQueries({queryKey:["supplier-onboarding"]}),e.invalidateQueries({queryKey:["pending-entity-approvals"]}),n({action:"update_entity_status",entityType:Ve.supplierOnboarding,entityId:r,entityLabel:i,metadata:{entity_status:i}})}})}function xXe(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async r=>{if(t("Submitting entity verification"))throw new Error("Impersonation mode");const{id:i,...a}=r,{error:o}=await W.from("supplier_onboarding").update({entity_status:"pending_approval",entity_type:a.entityType,country:a.country,identifier_type:a.identifierType,identifier_value:a.identifierValue,official_legal_name:a.officialLegalName,registration_date:a.registrationDate,registered_address:a.registeredAddress,legal_representative:a.legalRepresentative,registry_confirmed:a.registryConfirmed,document_path:a.documentPath,website_url:a.websiteUrl||null}).eq("id",i);if(o)throw o;return{id:i,entityType:a.entityType,legalName:a.officialLegalName}},onSuccess:({id:r,entityType:i,legalName:a})=>{e.invalidateQueries({queryKey:["supplier-onboarding"]}),n({action:"submit_entity_verification",entityType:Ve.supplierOnboarding,entityId:r,entityLabel:a,metadata:{entity_type:i,academic:i==="university_tto"}})}})}function Pne(){const{isAdmin:e}=me();return Se({queryKey:["pending-entity-approvals"],queryFn:async()=>{const{data:t,error:n}=await W.from("supplier_onboarding").select("*, suppliers(name)").eq("entity_status","pending_approval");if(n)throw n;const r=[...new Set((t??[]).map(a=>a.supplier_id).filter(Boolean))];let i=null;if(r.length>0){const{data:a,error:o}=await W.rpc("get_supplier_member_confirmed_emails",{_supplier_ids:r});if(o||!Array.isArray(a))console.warn("usePendingEntityApprovals: member-email lookup failed",o);else{i=new Map;for(const l of a){if(!l.email||!l.supplier_id)continue;const c=i.get(l.supplier_id)??[];c.push(l.email),i.set(l.supplier_id,c)}}}return(t??[]).map(a=>{var o;return{...bM(a),supplierName:((o=a.suppliers)==null?void 0:o.name)??"Unknown",memberEmails:i?i.get(a.supplier_id)??[]:void 0}})},enabled:e})}const oA="agent_runs",lA="entity_dd",cA=9e4,pf=e=>["entity-dd",e,"queuedAt"];function One(e,{subscribe:t=!0}={}){var f,p;const n=Ae(),{guardMutation:r}=qe(),a=Se({queryKey:pf(e),enabled:!!e,queryFn:()=>null,staleTime:1/0,gcTime:1/0,initialData:null}).data??null,o=Se({queryKey:["entity-dd",e,"recent"],enabled:!!e,queryFn:async()=>{const{data:m,error:g}=await W.from(oA).select("*").eq("agent_key",lA).eq("subject_id",e).order("created_at",{ascending:!1}).limit(1).maybeSingle();if(g)throw g;return m??null},refetchInterval:m=>{var b;const g=(b=m.state.data)==null?void 0:b.status;if(g==="running"||g==="queued")return 2e4;const y=n.getQueryData(pf(e));return y&&Date.now()-y<cA?5e3:!1}}),l=o.data;x.useEffect(()=>{if(!e||!a)return;if(l&&new Date(l.created_at).getTime()>=a-1e3){n.setQueryData(pf(e),null);return}const m=cA-(Date.now()-a);if(m<=0){n.setQueryData(pf(e),null);return}const g=setTimeout(()=>{n.setQueryData(pf(e),null)},m);return()=>clearTimeout(g)},[e,a,l,n]);const c=!!(a&&Date.now()-a<cA&&(!l||new Date(l.created_at).getTime()<a-1e3)),u=Se({queryKey:["entity-dd",e,"history"],enabled:!1,queryFn:async()=>{const{data:m,error:g}=await W.from(oA).select("*").eq("agent_key",lA).eq("subject_id",e).eq("status","superseded").order("created_at",{ascending:!1});if(g)throw g;return m??[]}});x.useEffect(()=>{if(!t||!e)return;const m=W.channel(`agent_runs_entity_dd_${e}`).on("postgres_changes",{event:"*",schema:"public",table:oA,filter:`subject_id=eq.${e}`},()=>{n.invalidateQueries({queryKey:["entity-dd",e,"recent"]}),n.invalidateQueries({queryKey:["entity-dd",e,"history"]})}).subscribe();return()=>{W.removeChannel(m)}},[t,e,n]);const d=$e({mutationFn:async m=>{if(r("Running entity DD"))throw new Error("Impersonation mode");const{data:g,error:y}=await W.functions.invoke("re-run-agent",{body:{agent_key:lA,subject_type:"supplier_onboarding",subject_id:m}});if(y)throw y;if(g!=null&&g.error)throw new Error(g.error);return g},onSuccess:()=>{e&&n.setQueryData(pf(e),Date.now()),n.invalidateQueries({queryKey:["entity-dd",e,"recent"]})}}),h=((f=u.data)==null?void 0:f.length)??((p=o.data)!=null&&p.parent_run_id?1:0);return{recent:o,history:u,runDD:d,supersededCount:h,isQueued:c}}const Tb=e=>e?"14px 16px":"16px 20px",eO={approve:{label:"Approve",fg:"hsl(var(--c-positive-fg))",bg:"hsl(var(--c-positive-soft))",icon:sn},request_more_info:{label:"Request more info",fg:"hsl(var(--c-warning-fg))",bg:"hsl(var(--c-warning-soft))",icon:I_},flag_for_review:{label:"Flag for review",fg:"hsl(var(--c-warning-fg))",bg:"hsl(var(--c-warning-soft))",icon:ir},reject:{label:"Reject",fg:"hsl(var(--c-negative-fg))",bg:"hsl(var(--c-negative-soft))",icon:gn}};function Va({children:e,tone:t="neutral"}){const n={positive:{bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))"},warning:{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))"},negative:{bg:"hsl(var(--c-negative-soft))",fg:"hsl(var(--c-negative-fg))"},neutral:{bg:"hsl(var(--c-surface))",fg:"hsl(var(--c-fg-muted))"}}[t];return s.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:999,background:n.bg,color:n.fg,fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:600,letterSpacing:"0.05em",textTransform:"uppercase"},children:e})}function bXe(e){switch(e){case"exact":case"documented_variant":return"positive";case"mismatch":return"negative";case"unable_to_verify":return"warning";default:return"neutral"}}function pV(e){return e==="checked_and_cleared"?"positive":e==="checked_and_found"?"negative":e==="not_checked"?"warning":"neutral"}function wXe(e){return e==="active"?"positive":e==="dissolved"||e==="suspended"?"negative":e==="unable_to_verify"?"warning":"neutral"}function oy({url:e,children:t}){return e?s.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"tt-mono-sm",style:{display:"inline-flex",alignItems:"center",gap:4,color:"hsl(var(--c-link))",textDecoration:"none",wordBreak:"break-all"},children:[s.jsx(tc,{size:10}),t??e.slice(0,80)]}):null}function mf({queries:e,label:t="queries run"}){return!e||e.length===0?null:s.jsxs("details",{style:{marginTop:6},children:[s.jsxs("summary",{style:{cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-fg-subtle))",textTransform:"uppercase",letterSpacing:"0.06em"},children:[e.length," ",e.length===1?t.replace(/s$/,""):t]}),s.jsx("ul",{style:{margin:"6px 0 0",paddingLeft:18,fontFamily:"var(--font-mono)",fontSize:11.5,lineHeight:1.6,color:"hsl(var(--c-fg-muted))"},children:e.map((n,r)=>s.jsx("li",{children:n},r))})]})}function ml({title:e,children:t}){return s.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:10},children:[s.jsx("h3",{className:"eyebrow",style:{margin:0,color:"hsl(var(--c-fg-subtle))",paddingBottom:6,borderBottom:"1px solid hsl(var(--c-border))"},children:e}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:t})]})}function gf({value:e}){return s.jsx(Va,{tone:bXe(e),children:Nf(e)})}function Nf(e,t="not reported"){return(e??t).replace(/_/g," ")}function mV({supplierOnboardingId:e,onRunDD:t,rerunPending:n,isMobile:r}){return s.jsxs("div",{style:{padding:Tb(r),display:"flex",flexDirection:"column",gap:10,background:"hsl(var(--c-surface))",border:"1px dashed hsl(var(--c-border))",borderRadius:8},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx(Cn,{size:14,style:{color:"hsl(var(--c-fg-muted))"}}),s.jsx("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"No AI dossier yet for this entity verification."})]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:t,disabled:n,children:[n?s.jsx(ne,{size:12,className:"animate-spin"}):s.jsx(SI,{size:12}),"Run entity DD"]})]})}function gV({isMobile:e}){return s.jsxs("div",{style:{padding:Tb(e),display:"flex",alignItems:"center",gap:10,background:"hsl(var(--c-warning-soft))",borderRadius:8},children:[s.jsx(Yn,{size:14,style:{color:"hsl(var(--c-warning-fg))"}}),s.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[s.jsx("span",{style:{fontSize:13,fontWeight:500,color:"hsl(var(--c-ink))"},children:"Due diligence queued."}),s.jsx("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:"Worker picks up within ~30s; dossier appears in 1–5 minutes."})]})]})}function jXe({startedAt:e,isMobile:t}){const n=e?$r(new Date(e),{addSuffix:!0}):"just now";return s.jsxs("div",{style:{padding:Tb(t),display:"flex",alignItems:"center",gap:10,background:"hsl(var(--c-surface))",border:"1px solid hsl(var(--c-border))",borderRadius:8},children:[s.jsx(ne,{size:14,className:"animate-spin",style:{color:"hsl(var(--c-accent))"}}),s.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[s.jsx("span",{style:{fontSize:13,fontWeight:500,color:"hsl(var(--c-ink))"},children:"Entity DD running."}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["Started ",n,". 1–5 min total."]})]})]})}function _Xe({run:e,onRerun:t,rerunPending:n,isMobile:r}){return s.jsxs("div",{style:{padding:Tb(r),display:"flex",flexDirection:"column",gap:10,background:"hsl(var(--c-negative-soft))",borderRadius:8},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx(Hde,{size:14,style:{color:"hsl(var(--c-negative-fg))"}}),s.jsx("span",{style:{fontSize:13,fontWeight:600,color:"hsl(var(--c-negative-fg))"},children:e.status==="timed_out"?"Dossier timed out":"Dossier failed"})]}),e.error_message&&s.jsx("pre",{style:{margin:0,padding:"8px 10px",fontSize:11.5,fontFamily:"var(--font-mono)",background:"hsl(var(--c-surface))",borderRadius:6,whiteSpace:"pre-wrap",wordBreak:"break-word",color:"hsl(var(--c-fg-muted))",maxHeight:240,overflow:"auto"},children:e.error_message}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:t,disabled:n,style:{alignSelf:"flex-start"},children:[n?s.jsx(ne,{size:12,className:"animate-spin"}):s.jsx(ps,{size:12}),"Re-run"]})]})}function SXe({run:e,onRerun:t,rerunPending:n,isMobile:r,subjectEntityType:i}){var f,p,m,g,y,b,v,w,_,j,S,k,N,T,C,A,O,z,$,F,B;const a=e.result;if(!a)return null;const o=a.recommended_action.action,l=eO[o]??eO.flag_for_review,c=e.completed_at?$r(new Date(e.completed_at),{addSuffix:!0}):"—",u=i!==void 0?i==="university_tto":((f=a.subject_context)==null?void 0:f.entity_type)==="university_tto",d=a.document_verification.document_kind==="none_provided",h=a.identity.legal_representative.not_submitted===!0;return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:28,maxWidth:920,paddingTop:4},children:[s.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:14},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12,flexWrap:"wrap"},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))"},children:"Entity verification due diligence · AI advisory"}),s.jsxs("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:[a.meta.agent_version??e.agent_version," · ",a.meta.searches_performed??"–"," sources · ",c]})]}),s.jsx("div",{style:{display:"flex",gap:16,alignItems:"flex-start",paddingLeft:14,borderLeft:`3px solid ${l.fg}`},children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,flex:1,minWidth:0},children:[s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[s.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:l.fg},children:["Recommendation: ",l.label]}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["· ",a.recommended_action.confidence," confidence"]})]}),s.jsx("p",{style:{margin:0,fontSize:15,lineHeight:1.6,color:"hsl(var(--c-ink))"},children:a.admin_summary})]})})]}),a.what_would_change_recommendation&&s.jsx(ml,{title:"What would change this recommendation",children:s.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.6,color:"hsl(var(--c-ink))",fontStyle:"italic"},children:a.what_would_change_recommendation})}),a.evidence_gaps&&a.evidence_gaps.length>0&&s.jsx(ml,{title:"Evidence gaps",children:s.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13.5,lineHeight:1.7,color:"hsl(var(--c-fg))"},children:a.evidence_gaps.map((P,I)=>s.jsx("li",{children:P},I))})}),s.jsxs(ml,{title:"Registry verification",children:[s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[s.jsx(Va,{tone:a.registry_verification.found?"positive":"negative",children:a.registry_verification.found?"identifier found":"identifier not found"}),s.jsx(Va,{tone:wXe(a.registry_verification.good_standing),children:Nf(a.registry_verification.good_standing)}),s.jsx(gf,{value:a.registry_verification.name_match}),s.jsx(gf,{value:a.registry_verification.address_match}),s.jsx(gf,{value:a.registry_verification.date_match})]}),a.registry_verification.identifier_value?s.jsxs("p",{style:{margin:0,fontSize:13,color:"hsl(var(--c-fg))"},children:[(a.registry_verification.identifier_type??"identifier").toUpperCase(),":"," ",s.jsx("code",{style:{fontFamily:"var(--font-mono)"},children:a.registry_verification.identifier_value})]}):s.jsxs("p",{style:{margin:0,fontSize:13,fontStyle:"italic",color:"hsl(var(--c-fg-muted))"},children:["No identifier submitted",u?" — optional for academic institutions; existence verified by name":"","."]}),a.registry_verification.registry_source&&s.jsx(oy,{url:a.registry_verification.registry_source,children:"Registry source"}),a.registry_verification.notes&&s.jsx("p",{style:{margin:0,fontSize:12.5,color:"hsl(var(--c-fg-muted))",lineHeight:1.55},children:a.registry_verification.notes}),s.jsx(mf,{queries:a.registry_verification.queries_run})]}),s.jsxs(ml,{title:"Document verification",children:[s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[s.jsx(Va,{tone:d?"neutral":a.document_verification.document_kind==="unable_to_verify"||a.document_verification.document_kind==="other"?"warning":"positive",children:Nf(a.document_verification.document_kind)}),!d&&s.jsxs(s.Fragment,{children:[s.jsx(gf,{value:(p=a.document_verification.supports_form)==null?void 0:p.name_match}),s.jsx(gf,{value:(m=a.document_verification.supports_form)==null?void 0:m.identifier_match}),s.jsx(gf,{value:(g=a.document_verification.supports_form)==null?void 0:g.date_match})]})]}),d&&s.jsxs("p",{style:{margin:0,fontSize:13,fontStyle:"italic",color:"hsl(var(--c-fg-muted))"},children:["No document was submitted",u?" — the upload is optional for academic institutions":"","."]}),a.document_verification.extracted_content_summary&&s.jsxs("p",{style:{margin:0,padding:"8px 10px",fontSize:12.5,lineHeight:1.6,background:"hsl(var(--c-surface))",borderRadius:6,color:"hsl(var(--c-fg))"},children:[s.jsx("span",{className:"eyebrow",style:{display:"block",marginBottom:4},children:"Extracted content"}),a.document_verification.extracted_content_summary]}),a.document_verification.notes&&s.jsx("p",{style:{margin:0,fontSize:12.5,color:"hsl(var(--c-fg-muted))",lineHeight:1.55},children:a.document_verification.notes}),s.jsx(mf,{queries:a.document_verification.queries_run,label:"fetches"})]}),s.jsxs(ml,{title:"Risk screening",children:[s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[s.jsxs(Va,{tone:pV((y=a.risk_screening.sanctions)==null?void 0:y.status),children:["sanctions: ",Nf((b=a.risk_screening.sanctions)==null?void 0:b.status)]}),s.jsxs(Va,{tone:pV((v=a.risk_screening.jurisdiction)==null?void 0:v.status),children:["jurisdiction: ",Nf((w=a.risk_screening.jurisdiction)==null?void 0:w.status)]}),s.jsxs(Va,{tone:((_=a.risk_screening.litigation_check)==null?void 0:_.status)==="clear"?"positive":((j=a.risk_screening.litigation_check)==null?void 0:j.status)==="hit"?"negative":"warning",children:["litigation: ",Nf((S=a.risk_screening.litigation_check)==null?void 0:S.status)]}),((k=a.risk_screening.regulatory_history)==null?void 0:k.fda_debarment)&&s.jsx(Va,{tone:"negative",children:"FDA debarment"}),(((T=(N=a.risk_screening.regulatory_history)==null?void 0:N.fda_warning_letters)==null?void 0:T.length)??0)>0&&s.jsxs(Va,{tone:"negative",childr
857en:[(A=(C=a.risk_screening.regulatory_history)==null?void 0:C.fda_warning_letters)==null?void 0:A.length," FDA warning letter(s)"]})]}),(((O=a.risk_screening.notable_concerns)==null?void 0:O.length)??0)>0&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:(z=a.risk_screening.notable_concerns)==null?void 0:z.map((P,I)=>s.jsxs("div",{style:{paddingLeft:14,borderLeft:`2px solid hsl(var(--${P.severity==="high"?"c-negative-border":"c-warning-border"}))`,display:"flex",flexDirection:"column",gap:4},children:[s.jsxs("div",{style:{color:"hsl(var(--c-ink))",fontSize:13.5,lineHeight:1.55},children:[P.concern," ",s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginLeft:6},children:["severity: ",P.severity]})]}),P.citation_url&&s.jsx(oy,{url:P.citation_url})]},I))}),(($=a.risk_screening.regulatory_history)==null?void 0:$.notable_findings)&&s.jsx("p",{style:{margin:0,fontSize:12.5,color:"hsl(var(--c-fg-muted))",lineHeight:1.55},children:(F=a.risk_screening.regulatory_history)==null?void 0:F.notable_findings}),s.jsx(mf,{queries:a.risk_screening.queries_run})]}),s.jsxs(ml,{title:"Beneficial ownership",children:[s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:u&&!a.beneficial_ownership.ultimate_owner_identified?s.jsx(Va,{tone:"neutral",children:"no UBO chain — academic institution"}):s.jsx(Va,{tone:a.beneficial_ownership.ultimate_owner_identified?"positive":"warning",children:a.beneficial_ownership.ultimate_owner_identified?"ultimate owner identified":"ultimate owner UNIDENTIFIED"})}),a.beneficial_ownership.owners.length>0?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:a.beneficial_ownership.owners.map((P,I)=>s.jsxs("div",{style:{paddingLeft:14,borderLeft:`2px solid hsl(var(${P.verified?"--c-positive-border":"--c-warning-border"}))`,display:"flex",flexDirection:"column",gap:4},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8,flexWrap:"wrap"},children:[s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontSize:13.5,fontWeight:500},children:P.name}),s.jsx("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-muted))",fontStyle:"italic"},children:P.kind}),P.ownership_pct&&s.jsx("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:P.ownership_pct}),s.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:`hsl(var(${P.verified?"--c-positive-fg":"--c-warning-fg"}))`},children:[P.verified?"verified":"unverified",P.counter_evidence_searched&&" · CE✓"]})]}),P.notes&&s.jsx("div",{style:{color:"hsl(var(--c-fg-muted))",fontSize:12.5,lineHeight:1.55},children:P.notes}),P.citation_urls&&P.citation_urls.length>0&&s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:P.citation_urls.map((M,R)=>s.jsx(oy,{url:M},R))}),s.jsx(mf,{queries:P.queries_run})]},I))}):s.jsx("p",{style:{margin:0,fontSize:13,fontStyle:"italic",color:"hsl(var(--c-fg-muted))"},children:u?"Not applicable — public/nonprofit institutions have no beneficial-ownership chain; governance is recorded when found.":"No beneficial owners surfaced."}),a.beneficial_ownership.red_flags.length>0&&s.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:12.5,lineHeight:1.55,color:"hsl(var(--c-warning-fg))"},children:a.beneficial_ownership.red_flags.map((P,I)=>s.jsx("li",{children:P},I))}),s.jsx(mf,{queries:a.beneficial_ownership.queries_run})]}),s.jsx(ml,{title:"Legal representative",children:h?s.jsxs("p",{style:{margin:0,fontSize:13,fontStyle:"italic",color:"hsl(var(--c-fg-muted))"},children:["No signatory was submitted",u?" — optional for academic institutions":"","."]}):s.jsxs("div",{style:{paddingLeft:14,borderLeft:`2px solid hsl(var(${a.identity.legal_representative.verified_at_company?"--c-positive-border":"--c-warning-border"}))`,display:"flex",flexDirection:"column",gap:4},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:8,flexWrap:"wrap"},children:[s.jsxs("div",{style:{color:"hsl(var(--c-ink))",fontSize:13.5,fontWeight:500},children:[a.identity.legal_representative.name,a.identity.legal_representative.role&&s.jsxs("span",{style:{color:"hsl(var(--c-fg-muted))",fontWeight:400},children:[" ","— ",a.identity.legal_representative.role]})]}),s.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:`hsl(var(${a.identity.legal_representative.verified_at_company?"--c-positive-fg":"--c-warning-fg"}))`},children:[a.identity.legal_representative.verified_at_company?"verified":"unverified",a.identity.legal_representative.counter_evidence_searched&&" · CE✓"]})]}),a.identity.legal_representative.notes&&s.jsx("div",{style:{color:"hsl(var(--c-fg-muted))",fontSize:12.5,lineHeight:1.55},children:a.identity.legal_representative.notes}),(B=a.identity.legal_representative.citation_urls)==null?void 0:B.map((P,I)=>s.jsx(oy,{url:P},I)),s.jsx(mf,{queries:a.identity.legal_representative.queries_run})]})}),a.anomalies.length>0&&s.jsx(ml,{title:"Anomalies",children:s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:14},children:a.anomalies.map((P,I)=>
857s.jsxs("div",{style:{paddingLeft:14,borderLeft:"2px solid hsl(var(--c-warning-border))",display:"flex",flexDirection:"column",gap:4},children:[s.jsx("div",{style:{color:"hsl(var(--c-ink))",fontSize:13.5,lineHeight:1.55,fontWeight:500},children:P.observation}),s.jsx("div",{style:{color:"hsl(var(--c-fg-muted))",fontSize:12.5,lineHeight:1.55},children:P.why_concerning}),P.citation_url&&s.jsx(oy,{url:P.citation_url})]},I))})}),s.jsxs(ml,{title:"Recommendation & rationale",children:[s.jsx("p",{style:{margin:0,fontSize:13.5,lineHeight:1.6,color:"hsl(var(--c-fg))"},children:a.recommended_action.rationale}),typeof a.recommended_action.counter_evidence_searched=="boolean"&&s.jsxs("div",{className:"tt-mono-sm",style:{color:a.recommended_action.counter_evidence_searched?"hsl(var(--c-fg-subtle))":"hsl(var(--c-warning-fg))",marginTop:4},children:["Counter-evidence searched:"," ",s.jsx("strong",{children:a.recommended_action.counter_evidence_searched?"yes":"no"})]}),a.recommended_action.follow_up_questions.length>0&&s.jsxs("div",{style:{marginTop:4},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))",marginBottom:6},children:"Suggested follow-up"}),s.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13.5,lineHeight:1.7,color:"hsl(var(--c-fg))"},children:a.recommended_action.follow_up_questions.map((P,I)=>s.jsx("li",{children:P},I))})]})]}),s.jsx("footer",{style:{display:"flex",justifyContent:"flex-end",gap:8,paddingTop:14,borderTop:"1px solid hsl(var(--c-border))"},children:s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:t,disabled:n,children:[n?s.jsx(ne,{size:12,className:"animate-spin"}):s.jsx(ps,{size:12}),"Re-run DD"]})})]})}function tO({supplierOnboardingId:e,expanded:t,subjectEntityType:n}){const{recent:r,runDD:i,isQueued:a}=One(e,{subscribe:t??!0}),{toast:o}=xt(),l=dc(),c=r.data,u=i.isPending,d=async()=>{try{await i.mutateAsync(e),o({title:"Due diligence queued",description:"Agent typically completes in 1–5 minutes. The dossier will appear here automatically."})}catch(h){const f=(h==null?void 0:h.message)??"unknown error";o({title:f==="run_in_progress"?"Due diligence already running":"Failed to start due diligence",description:f==="run_in_progress"?"Due diligence is already running for this entity. The dossier will appear when complete.":f==="agent_disabled"?"Entity DD is not yet activated. Operator must run `npm run deploy:new -- --agent entity_dd` and flip `agent_definitions.enabled = true` in SQL.":f==="agent_not_found"?"Entity DD agent is not registered. Re-deploy the migration.":f==="forbidden"||f==="unauthenticated"||f==="invalid_token"?"Admin authentication required to run due diligence.":f==="concurrent_modification"?"Another admin is re-running this entity right now. Refresh the page in a moment.":f,variant:f==="run_in_progress"?"default":"destructive"})}};return r.isLoading?s.jsxs("div",{style:{padding:Tb(l),display:"flex",alignItems:"center",gap:8},children:[s.jsx(ne,{size:14,className:"animate-spin",style:{color:"hsl(var(--c-fg-muted))"}}),s.jsx("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"Loading entity DD dossier…"})]}):a?s.jsx(gV,{isMobile:l}):c?c.status==="queued"?s.jsx(gV,{isMobile:l}):c.status==="running"?s.jsx(jXe,{startedAt:c.started_at,isMobile:l}):c.status==="failed"||c.status==="timed_out"?s.jsx(_Xe,{run:c,onRerun:d,rerunPending:u,isMobile:l}):c.status==="complete"?s.jsx(SXe,{run:c,onRerun:d,rerunPending:u,isMobile:l,subjectEntityType:n}):s.jsx(mV,{supplierOnboardingId:e,onRunDD:d,rerunPending:u,isMobile:l}):s.jsx(mV,{supplierOnboardingId:e,onRunDD:d,rerunPending:u,isMobile:l})}function kXe({supplierOnboardingId:e,onClick:t,expanded:n}){var d,h;const{recent:r,isQueued:i}=One(e,{subscribe:!1}),a=r.data;let o="No AI due diligence",l=Cn,c="neutral",u=!1;if(i||(a==null?void 0:a.status)==="queued")o="Due diligence queued",l=ne,c="neutral",u=!0;else if(a&&(a.status==="running"&&(o="AI due diligence running",l=ne,c="neutral",u=!0),a.status==="failed"&&(o="AI due diligence failed",l=gn,c="negative"),a.status==="timed_out"&&(o="AI due diligence timed out",l=Yn,c="negative"),a.status==="complete")){const f=(d=a.result)==null?void 0:d.recommended_action.action;o=`AI recommendation · ${((h=eO[f])==null?void 0:h.label)??"complete"}`,l=sn,c=f==="approve"?"positive":f==="reject"?"negative":"warning"}return s.jsxs("button",{type:"button",onClick:t,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"4px 10px",borderRadius:999,background:c==="positive"?"hsl(var(--c-positive-soft))":c==="warning"?"hsl(var(--c-warning-soft))":c==="negative"?"hsl(var(--c-negative-soft))":"hsl(var(--c-surface-2))",color:c==="positive"?"hsl(var(--c-positive-fg))":c==="warning"?"hsl(var(--c-warning-fg))":c==="negative"?"hsl(var(--c-negative-fg))":"hsl(var(--c-fg-muted))",border:"1px solid "+(c==="positive"?"hsl(var(--c-positive-border))":c==="warning"?"hsl(var(--c-warning-border))":c==="negative"?"hsl(var(--c-negative-border))":"hsl(var(--c-border))"),fontFamily:"var(--font-mono)",fontSize:11,fontWeight:600,cursor:"pointer"},children:[(()=>{const f=l;return s.jsx(f,{size:11,className:u?"animate-spin":""})})(),o,s.jsx("span",{style:{opacity:.6,marginLeft:2},children:n?"▾":"▸"})]})}function NXe(e){const t=e.lastIndexOf("@");if(t<=0||t===e.length-1)return null;const n=e.slice(t+1).trim().toLowerCase();return!n||n.includes(" ")||!n.includes(".")?null:n}function CXe(e){const t=e.trim().toLowerCase();return t?/(^|\.)edu$/.test(t)||/\.edu\.[a-z]{2}$/.test(t)||/(^|\.)ac\.[a-z]{2}$/.test(t):!1}function AXe(e){const t=NXe(e);return t!==null&&CXe(t)}const TXe={private_company:"Private Company",public_company:"Public Company",university_tto:"University/TTO"},EXe={private_company:"PVT",public_company:"PUB",university_tto:"TTO"};function PXe(){const{data:e=[],isLoading:t}=Pne(),n=vXe(),{toast:r}=xt(),i=dc(),[a,o]=x.useState(null),[l,c]=x.useState(null),u=async f=>{o(f);try{await n.mutateAsync({id:f,entityStatus:"verified"}),r({title:"Entity approved"})}catch(p){r({title:"Error",description:p.message,variant:"destructive"})}finally{o(null)}},d=async f=>{o(f);try{await n.mutateAsync({id:f,entityStatus:"failed"}),r({title:"Entity rejected"})}catch(p){r({title:"Error",description:p.message,variant:"destructive"})}finally{o(null)}},h=async f=>{const{data:p,error:m}=await W.storage.from("supplier-documents").download(f);if(m||!p){r({title:"Download failed",variant:"destructive"});return}const g=URL.createObjectURL(p),y=document.createElement("a");y.href=g,y.download=f.split("/").pop()||"document.pdf",document.body.appendChild(y),y.click(),document.body.removeChild(y),URL.revokeObjectURL(g)};return t?s.jsxs("div",{className:"xph-card",style:{padding:20},children:[s.jsx(ce,{className:"h-6 w-64 mb-4"}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[...Array(2)].map((f,p)=>s.jsx(ce,{className:"h-20 w-full"},p))})]}):s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 20px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:28,height:28,borderRadius:7,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(pr,{size:14})}),s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",children:"Entity verification"}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:"Validate registry confirmations and incorporation docs"})]})]}),s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 10px",borderRadius:999,background:e.length>0?"hsl(var(--c-warning-soft))":"hsl(var(--c-surface))",color:e.length>0?"hsl(var(--c-warning-fg))":"hsl(var(--c-fg-muted))",border:`1px solid ${e.length>0?"hsl(var(--c-warning-border))":"hsl(var(--c-border))"}`,fontFamily:"var(--font-mono)",fontSize:11,fontWeight:600,letterSpacing:"0.04em"},children:[e.length," pending"]})]}),e.length===0?s.jsx("div",{style:{padding:36,textAlign:"center",color:"hsl(var(--c-fg-muted))",fontSize:13.5},children:"No pending entity verifications"}):s.jsx("div",{children:e.map(f=>{var j;const p=f.createdAt?$r(new Date(f.createdAt),{addSuffix:!0}):null,m=EXe[f.entityType??""]??"ENT",g=f.entityType==="university_tto",y=f.identifierType?`${f.identifierType.toUpperCase()}: ${f.identifierValue}`:null,b=f.memberEmails===void 0||f.memberEmails.length===0?null:f.memberEmails.some(AXe),v=(f.memberEmails??[]).slice(0,2),w=(((j=f.memberEmails)==null?void 0:j.length)??0)-v.length,_=l===f.id;return s.jsxs("div",{style:{borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsxs("div",{style:{padding:i?"14px 16px":"16px 20px",display:"grid",gridTemplateColumns:i?"auto minmax(0, 1fr)":"auto minmax(0, 1fr) auto",gap:i?12:16,alignItems:"center"},children:[s.jsxs("div",{style:{width:i?44:56,height:i?44:56,borderRadius:8,background:"hsl(var(--c-ink))",color:"hsl(var(--c-ink-inverse))",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:i?11:13,fontWeight:600,letterSpacing:"0.04em",flexShrink:0},children:[s.jsx("span",{style:{fontSize:8.5,opacity:.65,marginBottom:1},children:"ENTITY"}),s.jsx("span",{children:m})]}),s.jsxs("div",{style:{minWidth:0},children:[s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"baseline",flexWrap:"wrap"},children:[s.jsx("span",{style:{fontWeight:600,color:"hsl(var(--c-ink))",fontSize:15},children:f.officialLegalName||f.supplierName}),g&&!f.registryConfirmed?s.jsx("span",{className:"xph-badge",style:{background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-fg-muted))"},children:"manual review"}):s.jsx("span",{className:"xph-badge",style:f.registryConfirmed?{background:"hsl(var(--c-positive-soft))",color:"hsl(var(--c-positive-fg))"}:{background:"hsl(var(--c-warning-soft))",color:"hsl(var(--c-warning-fg))"},children:f.registryConfirmed?"registry confirmed":"registry unconfirmed"}),g&&b!==null&&s.jsx("span",{className:"xph-badge",style:b?{background:"hsl(var(--c-positive-soft))",color:"hsl(var(--c-positive-fg))"}:{background:"hsl(var(--c-warning-soft))",color:"hsl(var(--c-warning-fg))"},children:b?"academic email":"no academic email"})]}),s.jsxs("div",{style:{marginTop:5,display:"flex",gap:i?8:14,flexWrap:"wrap",fontSize:12.5,color:"hsl(var(--c-fg-muted))",alignItems:"center"},children:[s.jsx("span",{children:TXe[f.entityType??""]??"Entity"}),f.country&&s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[s.jsx(Um,{size:11}),f.country]}),y?s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:12},children:y}):g&&s.jsx("span",{style:{color:"hsl(var(--c-fg-subtle))",fontSize:12},children:"No identifier provided"}),v.map(S=>s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:12,color:"hsl(var(--c-fg-muted))"},children:S},S)),w>0&&s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["+",w]}),p&&s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["submitted ",p]}),f.documentPath&&s.jsxs("button",{type:"button",onClick:()=>h(f.documentPath),style:{display:"inline-flex",alignItems:"center",gap:4,background:"transparent",border:"none",padding:0,color:"hsl(var(--c-accent))",fontSize:12.5,cursor:"pointer"},children:[s.jsx(Rl,{size:11}),"Document"]})]}),s.jsx("div",{style:{marginTop:8},children:s.jsx(kXe,{supplierOnboardingId:f.id,onClick:()=>c(S=>S===f.id?null:f.id),expanded:_})})]}),s.jsxs("div",{style:{display:"flex",gap:6,gridColumn:i?"1 / -1":"auto",flexWrap:"wrap"},children:[s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:()=>d(f.id),disabled:a===f.id,style:{color:"hsl(var(--c-negative-fg))",...i?{flex:1,justifyContent:"center"}:{}},children:[s.jsx(gn,{size:12}),"Reject"]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:()=>u(f.id),disabled:a===f.id,style:i?{flex:1,justifyContent:"center"}:void 0,children:[a===f.id?s.jsx(ne,{size:12,className:"animate-spin"}):s.jsx(fo,{size:12}),"Approve"]})]})]}),_&&s.jsx("div",{id:`entity-dd-dossier-${f.id}`,style:{background:"hsl(var(--c-surface))",borderTop:"1px solid hsl(var(--c-border))",paddingLeft:i?12:16,paddingRight:i?12:16,paddingTop:14,paddingBottom:18,animation:"xph-dd-expand 200ms ease-out"},children:s.jsx("div",{style:{marginLeft:i?8:16,paddingLeft:i?12:16,borderLeft:"2px s
857olid hsl(var(--c-accent-border))"},children:s.jsx(tO,{supplierOnboardingId:f.id,expanded:!0,subjectEntityType:f.entityType})})})]},f.id)})})]})}function yV(e){switch(e){case"pending":return"warning";case"reviewed":return"neutral";case"responded":return"positive";default:return"neutral"}}function vV({tone:e,children:t}){const n={positive:{bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))"},warning:{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))"},negative:{bg:"hsl(var(--c-negative-soft))",fg:"hsl(var(--c-negative-fg))"},neutral:{bg:"hsl(var(--c-surface-2))",fg:"hsl(var(--c-fg-muted))"}}[e];return s.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"3px 8px",borderRadius:4,fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:500,letterSpacing:"0.06em",textTransform:"uppercase",background:n.bg,color:n.fg},children:t})}function OXe(){const{data:e=[],isLoading:t}=Ite(),n=BGe(),{toast:r}=xt(),[i,a]=x.useState(!1),[o,l]=x.useState(null),[c,u]=x.useState(""),d=e.filter(m=>m.status==="pending").length,h=m=>{l(m),u(m.adminNotes||""),a(!0)},f=async()=>{if(o)try{await n.mutateAsync({inquiryId:o.id,status:"reviewed",adminNotes:c,buyerEmail:o.buyerEmail,buyerAuthUserId:o.buyerAuthUserId,assetName:o.assetName}),r({title:"Inquiry marked as reviewed"}),a(!1)}catch(m){r({title:"Error",description:m.message||"Failed to update inquiry",variant:"destructive"})}},p=async()=>{if(o)try{await n.mutateAsync({inquiryId:o.id,status:"responded",adminNotes:c,buyerEmail:o.buyerEmail,buyerAuthUserId:o.buyerAuthUserId,assetName:o.assetName}),r({title:"Inquiry marked as responded"}),a(!1)}catch(m){r({title:"Error",description:m.message||"Failed to update inquiry",variant:"destructive"})}};return t?s.jsxs("div",{className:"xph-card",style:{padding:20},children:[s.jsx(ce,{className:"h-6 w-64 mb-4"}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[...Array(3)].map((m,g)=>s.jsx(ce,{className:"h-24 w-full"},g))})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 20px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:28,height:28,borderRadius:7,background:"hsl(var(--c-stage-preind-bg))",color:"hsl(var(--c-stage-preind-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(Ev,{size:14})}),s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",children:"Buyer inquiries"}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:"Triage and respond to incoming asset inquiries"})]})]}),s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 10px",borderRadius:999,background:d>0?"hsl(var(--c-warning-soft))":"hsl(var(--c-surface))",color:d>0?"hsl(var(--c-warning-fg))":"hsl(var(--c-fg-muted))",border:`1px solid ${d>0?"hsl(var(--c-warning-border))":"hsl(var(--c-border))"}`,fontFamily:"var(--font-mono)",fontSize:11,fontWeight:600,letterSpacing:"0.04em"},children:[d," pending · ",e.length," total"]})]}),e.length===0?s.jsx("div",{style:{padding:48,textAlign:"center",color:"hsl(var(--c-fg-muted))",fontSize:13.5},children:"No buyer inquiries yet"}):s.jsx("div",{children:e.map(m=>{const g=$r(new Date(m.createdAt),{addSuffix:!0});return s.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid hsl(var(--c-border))",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:14,alignItems:"flex-start"},children:[s.jsxs("div",{style:{minWidth:0},children:[s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[s.jsx(vV,{tone:yV(m.status),children:b5[m.status]||m.status}),s.jsx("span",{style:{fontWeight:600,color:"hsl(var(--c-ink))",fontSize:14},children:m.assetName}),m.assetStage&&s.jsx("span",{className:`xph-badge ${ea[m.assetStage]}`,children:Nn[m.assetStage]}),m.assetModality&&s.jsx("span",{className:"xph-badge",style:{background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-fg))"},children:Zt[m.assetModality]})]}),s.jsxs("div",{style:{marginTop:6,display:"flex",gap:14,flexWrap:"wrap",fontSize:12.5,color:"hsl(var(--c-fg-muted))"},children:[s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[s.jsx(pr,{size:11}),m.buyerCompanyName]}),m.buyerEmail&&s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:12},children:[s.jsx(qs,{size:11}),m.buyerEmail]}),s.jsx("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:g})]}),s.jsx("p",{style:{marginTop:8,fontSize:13.5,color:"hsl(var(--c-fg))",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:m.message})]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:()=>h(m),children:[s.jsx(Na,{size:12}),"View"]}
857)]},m.id)})})]}),s.jsx(Br,{open:i,onOpenChange:a,children:s.jsxs(br,{className:"max-w-2xl",children:[s.jsxs(wr,{children:[s.jsxs(jr,{className:"flex items-center gap-2",children:[s.jsx(Ev,{className:"h-5 w-5"}),"Inquiry Details"]}),s.jsx(So,{children:"Review and respond to this buyer inquiry"})]}),o&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Asset:"})," ",s.jsx("span",{className:"font-medium",children:o.assetName})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Buyer:"})," ",s.jsx("span",{className:"font-medium",children:o.buyerCompanyName})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Email:"})," ",s.jsx("span",{className:"font-medium",children:o.buyerEmail})]}),s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx("span",{className:"text-muted-foreground",children:"Status:"})," ",s.jsx(vV,{tone:yV(o.status),children:b5[o.status]||o.status})]})]}),s.jsxs("div",{className:"bg-muted/50 rounded-md p-4",children:[s.jsx("h4",{className:"font-medium mb-2",children:"Buyer's Message:"}),s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:o.message})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",children:"Admin Notes:"}),s.jsx(Ys,{value:c,onChange:m=>u(m.target.value),placeholder:"Add internal notes about this inquiry...",className:"min-h-[80px]"})]})]}),s.jsxs(_i,{children:[s.jsx(je,{variant:"outline",onClick:()=>a(!1),children:"Close"}),(o==null?void 0:o.status)==="pending"&&s.jsxs(je,{variant:"secondary",onClick:f,disabled:n.isPending,children:[n.isPending&&s.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}),"Mark Reviewed"]}),(o==null?void 0:o.status)!=="responded"&&s.jsxs(je,{onClick:p,disabled:n.isPending,children:[n.isPending&&s.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}),"Mark Responded"]})]})]})})]})}async function Ine(){var t;const{data:e}=await W.auth.getSession();return(t=e==null?void 0:e.session)==null?void 0:t.access_token}function Rne(){return"https://jvdzxfpnisnowhefnlau.supabase.co/functions/v1/admin-user-activity"}function IXe(){const[e,t]=x.useState([]),[n,r]=x.useState(!0),[i,a]=x.useState(null);return x.useEffect(()=>{let o=!1;async function l(){try{const c=await Ine();if(!c)return;const u=await window.fetch(`${Rne()}?mode=list`,{headers:{Authorization:`Bearer ${c}`,"Content-Type":"application/json"}});if(!u.ok)throw new Error("Failed to fetch user list");const d=await u.json();o||t(d.users||[])}catch(c){o||a(c.message)}finally{o||r(!1)}}return l(),()=>{o=!0}},[]),{users:e,isLoading:n,error:i}}function RXe(){const[e,t]=x.useState(null),[n,r]=x.useState(!1),[i,a]=x.useState(null),{toast:o}=xt();return{data:e,isLoading:n,error:i,search:async u=>{r(!0),a(null),t(null);try{const d=await Ine();if(!d)throw new Error("Not authenticated");const h=await window.fetch(`${Rne()}?email=${encodeURIComponent(u)}`,{headers:{Authorization:`Bearer ${d}`,"Content-Type":"application/json"}}),f=await h.json();if(!h.ok){const p=f.error||"Failed to fetch user activity";a(p),h.status!==404&&o({title:"Error",description:p,variant:"destructive"});return}t(f)}catch(d){const h=d.message||"Failed to fetch user activity";a(h),o({title:"Error",description:h,variant:"destructive"})}finally{r(!1)}},clear:()=>{t(null),a(null)}}}const $l=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:ae("w-full caption-bottom text-sm",e),...t})}));$l.displayName="Table";const Ll=x.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:ae("[&_tr]:border-b",e),...t}));Ll.displayName="TableHeader";const Fl=x.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:ae("[&_tr:last-child]:border-0",e),...t}));Fl.displayName="TableBody";const DXe=x.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:ae("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));DXe.displayName="TableFooter";const Ir=x.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:ae("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Ir.displayName="TableRow";const lt=x.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:ae("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));lt.displayName="TableHead";const st=x.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:ae("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));st.displayName="TableCell";const MXe=x.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:ae("mt-4 text-sm text-muted-foreground",e),...t}));MXe.displayName="TableCaption";function $Xe({type:e}){const t={completion:"bg-emerald-500",action:"bg-blue-500",pending:"bg-amber-500"};return s.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${t[e]} ring-2 ring-background flex-shrink-0`})}
857function LXe({timeline:e}){return e.length?s.jsxs(Be,{children:[s.jsx(ht,{children:s.jsxs(ft,{className:"flex items-center gap-2 text-lg",children:[s.jsx(Yn,{className:"h-4 w-4"}),"Timeline"]})}),s.jsx(pt,{children:s.jsx("div",{className:"relative space-y-0",children:e.map((t,n)=>s.jsxs("div",{className:"flex gap-3 pb-4 last:pb-0",children:[s.jsxs("div",{className:"flex flex-col items-center pt-1.5",children:[s.jsx($Xe,{type:t.type}),n<e.length-1&&s.jsx("div",{className:"w-px flex-1 bg-border mt-1"})]}),s.jsxs("div",{className:"flex-1 min-w-0 pb-1",children:[s.jsx("p",{className:"text-sm leading-snug",children:t.event}),s.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:[rn(new Date(t.timestamp),"MMM d, yyyy HH:mm")," · ",$r(new Date(t.timestamp),{addSuffix:!0})]}),s.jsx(pn,{variant:"outline",className:"text-[10px] px-1 py-0 h-4",children:t.source})]})]})]},n))})})]}):null}const ly=e=>{const t=e==="approved"||e==="sent"?"default":e==="rejected"||e==="failed"?"destructive":"secondary";return s.jsx(pn,{variant:t,children:e.charAt(0).toUpperCase()+e.slice(1)})};function FXe({onViewActivity:e}){var h,f,p;const[t,n]=x.useState(""),{users:r,isLoading:i}=IXe(),{data:a,isLoading:o,error:l,search:c,clear:u}=RXe(),d=m=>{n(m),u(),c(m)};return s.jsxs("div",{className:"space-y-6",children:[s.jsx(Be,{children:s.jsx(pt,{className:"pt-6",children:i?s.jsx(ce,{className:"h-10 w-full"}):s.jsxs($n,{value:t,onValueChange:d,children:[s.jsx(On,{children:s.jsx(Ln,{placeholder:"Select a user to view activity..."})}),s.jsx(In,{children:r.map(m=>s.jsxs(Rt,{value:m.email,children:[s.jsx("span",{className:"font-medium",children:m.email}),m.display_name&&s.jsxs("span",{className:"text-muted-foreground ml-2",children:["(",m.display_name,")"]})]},m.id))})]})})}),o&&s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(ne,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),l&&!o&&s.jsx(Be,{children:s.jsxs(pt,{className:"pt-6 text-center text-muted-foreground",children:[s.jsx(va,{className:"h-8 w-8 mx-auto mb-2"}),s.jsx("p",{children:l})]})}),a&&!o&&s.jsxs(s.Fragment,{children:[s.jsxs(Be,{children:[s.jsxs(ht,{className:"flex-row items-center justify-between space-y-0",children:[s.jsxs(ft,{className:"flex items-center gap-2 text-lg",children:[s.jsx(Yde,{className:"h-4 w-4"}),"Identity & Profile"]}),e&&a.user.id&&s.jsx(je,{variant:"outline",size:"sm",onClick:()=>e(a.user.id),children:"View activity →"})]}),s.jsx(pt,{children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Email:"})," ",s.jsx("span",{className:"font-medium",children:a.user.email})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"User ID:"})," ",s.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:a.user.id})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Display Name:"})," ",((h=a.profile)==null?void 0:h.display_name)||((f=a.profile)==null?void 0:f.full_name)||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Phone:"})," ",((p=a.profile)==null?void 0:p.phone)||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Created:"})," ",rn(new Date(a.user.created_at),"MMM d, yyyy HH:mm")]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Last Sign-in:"})," ",a.user.last_sign_in_at?rn(new Date(a.user.last_sign_in_at),"MMM d, yyyy HH:mm"):"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Email Confirmed:"})," ",a.user.email_confirmed_at?s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(fo,{className:"h-3 w-3 text-emerald-500"}),rn(new Date(a.user.email_confirmed_at),"MMM d, yyyy HH:mm")]}):s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx(gn,{className:"h-3 w-3 text-destructive"}),"Not confirmed"]})]})]})})]}),s.jsxs(Be,{children:[s.jsx(ht,{children:s.jsxs(ft,{className:"flex items-center gap-2 text-lg",children:[s.jsx(AI,{className:"h-4 w-4"}),"Roles & Access"]})}),s.jsxs(pt,{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-muted-foreground mr-2",children:"Roles:"}),a.roles.length>0?a.roles.map(m=>s.jsx(pn,{className:"mr-1",children:m},m)):s.jsx("span",{className:"text-sm text-muted-foreground",children:"No roles assigned"})]}),a.supplierMemberships.length>0&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium mb-2",children:"Supplier Memberships"}),s.jsxs($l,{children:[s.jsx(Ll,{children:s.jsxs(Ir,{children:[s.jsx(lt,{children:"Supplier"}),s.jsx(lt,{children:"Status"}),s.jsx(lt,{children:"Since"})]})}),s.jsx(Fl,{children:a.supplierMemberships.map((m,g)=>s.jsxs(Ir,{children:[s.jsx(st,{className:"font-medium",children:m.supplier_name}),s.jsx(st,{children:ly(m.status)}),s.jsx(st,{className:"text-muted-foreground text-sm",children:rn(new Date(m.created_at),"MMM d, yyyy")})]},g))})]})]}),a.buyerRecord&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium mb-2",children:"Buyer Record"}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Company:"})," ",a.buyerRecord.company_name||a.buyerRecord.pending_company_name||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Status:"})," ",ly(a.buyerRecord.status)]})]})]})]})]}),a.personnelRecords.length>0&&s.jsxs(Be,{children:[s.jsx(ht,{children:s.jsxs(ft,{className:"flex items-center gap-2 text-lg",children:[s.jsx(Cde,{className:"h-4 w-4"}),"Personnel Records"]})}),s.jsx(pt,{children:s.jsxs($l,{children:[s.jsx(Ll,{children:s.jsxs(Ir,{children:[s.jsx(lt,{children:"Supplier"}),s.jsx(lt,{children:"Name"}),s.jsx(lt,{children:"Title"}),s.jsx(lt,{children:"Verification"}),s.jsx(lt,{children:"Invitation"}),s.jsx(lt,{children:"Email Verified"})]})}),s.jsx(Fl,{children:a.personnelRecords.map((m,g)=>s.jsxs(Ir,{children:[s.jsx(st,{children:m.supplier_name}),s.jsx(st,{className:"font-medium",children:m.full_name}),s.jsx(st,{children:m.title||"—"}),s.jsx(st,{children:ly(m.verification_status)}),s.jsx(st,{children:ly(m.invitation_status)}),s.jsx(st,{children:m.email_verified?s.jsx(fo,{className:"h-4 w-4 text-emerald-500"}):s.jsx(gn,{className:"h-4 w-4 text-muted-foreground"})})]},g))})]})})]}),(a.stats.chatConversations>0||a.stats.inquiries>0)&&s.jsxs(Be,{children:[s.jsx(ht,{children:s.jsxs(ft,{className:"flex items-center gap-2 text-lg",children:[s.jsx(Ev,{className:"h-4 w-4"}),"Activity Stats"]})}),s.jsx(pt,{children:s.jsxs("div",{className:"flex gap-6 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"AI Chat Conversations:"})," ",s.jsx("span",{className:"font-semibold",children:a.stats.chatConversations})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Inquiries:"})," ",s.jsx("span",{className:"font-semibold",children:a.stats.inquiries})]})]})})]}),s.jsx(LXe,{timeline:a.timeline}),a.emails.length>0&&s.jsxs(Be,{children:[s.jsx(ht,{children:s.jsxs(ft,{className:"flex items-center gap-2 text-lg",children:[s.jsx(qs,{className:"h-4 w-4"}),"Recent Emails (",a.emails.length,")"]})}),s.jsx(pt,{children:s.jsxs($l,{children:[s.jsx(Ll,{children:s.jsxs(Ir,{children:[s.jsx(lt,{children:"Template"}),s.jsx(lt,{children:"Status"}),s.jsx(lt,{children:"Date"}),s.jsx(lt,{children:"Error"})]})}),s.jsx(Fl,{children:a.emails.map((m,g)=>s.jsxs(Ir,{children:[s.jsx(st,{className:"font-medium",children:m.template_name.replace(/-/g," ")}),s.jsx(st,{children:ly(m.status)}),s.jsx(st,{className:"text-muted-foreground text-sm",children:rn(new Date(m.created_at),"MMM d, yyyy HH:mm")}
857),s.jsx(st,{className:"text-sm text-destructive",children:m.error_message||"—"})]},g))})]})})]})]})]})}function zXe(e={}){const{isAdmin:t}=me();return Se({queryKey:["audit-logs",e],queryFn:async()=>{let r=W.from("audit_logs").select("*");e.actorUserId&&(r=r.eq("actor_user_id",e.actorUserId)),e.actorUserIds&&e.actorUserIds.length&&(r=r.in("actor_user_id",e.actorUserIds)),e.entityType&&(r=r.eq("entity_type",e.entityType)),e.entityTypes&&e.entityTypes.length&&(r=r.in("entity_type",e.entityTypes)),e.entityId&&(r=r.eq("entity_id",e.entityId)),e.action&&(r=r.eq("action",e.action)),e.actions&&e.actions.length&&(r=r.in("action",e.actions)),e.from&&(r=r.gte("created_at",e.from)),e.to&&(r=r.lte("created_at",e.to)),r=r.order("created_at",{ascending:!1}).limit(e.limit??200);const{data:i,error:a}=await r;if(a)throw a;return i??[]},enabled:t})}function BXe(){const{isAdmin:e}=me();return Se({queryKey:["audit-filter-options"],queryFn:async()=>{const{data:t,error:n}=await W.from("audit_logs").select("action, entity_type, actor_user_id").order("created_at",{ascending:!1}).limit(2e3);if(n)throw n;const r=new Set,i=new Set,a=new Set;for(const o of t??[])o.action&&r.add(o.action),o.entity_type&&i.add(o.entity_type),o.actor_user_id&&a.add(o.actor_user_id);return{actions:[...r].sort(),entityTypes:[...i].sort(),actorIds:[...a]}},enabled:e,staleTime:2*60*1e3})}function VXe(e,t,n=!0){const{isAdmin:r}=me();return Se({queryKey:["audit-record-versions",e,t],queryFn:async()=>{const{data:i,error:a}=await W.rpc("get_audit_record_versions",{p_table_name:e,p_record_id:t,p_limit:50});if(a)throw a;return i??[]},enabled:r&&n})}function wM(e){const{isAdmin:t}=me(),n=x.useMemo(()=>[...new Set(e.filter(a=>!!a))].sort(),[e]),{data:r,isLoading:i}=Se({queryKey:["user-emails",n],queryFn:async()=>{const{data:a,error:o}=await W.from("profiles").select("user_id, email").in("user_id",n);if(o)throw o;const l=new Map;for(const c of a??[])c.email&&l.set(c.user_id,c.email);return l},enabled:t&&n.length>0,staleTime:5*60*1e3});return{emailMap:r??new Map,isLoading:i}}function zl(e,t,n="—"){return e?t.get(e)??`${e.slice(0,8)}…`:n}const xV=80,bs=e=>e.length>xV?`${e.slice(0,xV-1)}…`:e,ws=(e,t)=>`${e}:${t}`;function Dne(e){const{isAdmin:t}=me(),n=x.useMemo(()=>{const a=new Map;for(const o of e)!o.entity_type||!o.entity_id||(a.has(o.entity_type)||a.set(o.entity_type,new Set),a.get(o.entity_type).add(o.entity_id));return[...a.entries()].map(([o,l])=>({type:o,ids:[...l].sort()})).sort((o,l)=>o.type.localeCompare(l.type))},[e]),{data:r,isLoading:i}=Se({queryKey:["entity-labels",n],queryFn:async()=>{const a=new Map,o=W;return await Promise.all(n.map(async({type:l,ids:c})=>{var u,d,h,f,p,m,g,y;if(c.length!==0)try{switch(l){case"pharma_assets":{const{data:b}=await o.from("pharma_assets").select("id, product_name").in("id",c);for(const v of b??[])v.product_name&&a.set(ws(l,v.id),bs(v.product_name));return}case"suppliers":{const{data:b}=await o.from("suppliers").select("id, name").in("id",c);for(const v of b??[])v.name&&a.set(ws(l,v.id),bs(v.name));return}case"supplier_personnel":{const{data:b}=await o.from("supplier_personnel").select("id, full_name, email").in("id",c);for(const v of b??[]){const w=v.full_name||v.email;w&&a.set(ws(l,v.id),bs(w))}return}case"data_room_documents":{const{data:b}=await o.from("data_room_documents").select("id, file_name").in("id",c);for(const v of b??[])v.file_name&&a.set(ws(l,v.id),bs(v.file_name));return}case"buyer_users":{const{data:b}=await o.from("buyer_users").select("id, company_name, pending_company_name").in("id",c);for(const v of b??[]){const w=v.company_name||v.pending_company_name;w&&a.set(ws(l,v.id),bs(w))}return}case"supplier_users":{const{data:b}=await o.from("supplier_users").select("id, pending_company_name, suppliers (name)").in("id",c);for(const v of b??[]){const w=((u=v.suppliers)==null?void 0:u.name)||v.pending_company_name;w&&a.set(ws(l,v.id),bs(w))}return}case"buyer_inquiries":{const{data:b}=await o.from("buyer_inquiries").select("id, pharma_assets:asset_id (product_name)").in("id",c);for(const v of b??[]){const w=(d=v.pharma_assets)==null?void 0:d.product_name;w&&a.set(ws(l,v.id),bs(`Inquiry · ${w}`))}return}case"buyer_watchlist":{const{data:b}
857=await o.from("buyer_watchlist").select("id, pharma_assets:asset_id (product_name)").in("id",c);for(const v of b??[]){const w=(h=v.pharma_assets)==null?void 0:h.product_name;w&&a.set(ws(l,v.id),bs(`Watchlist · ${w}`))}return}case"asset_verification_workflow":{const{data:b}=await o.from("asset_verification_workflow").select("id, pharma_assets:asset_id (product_name)").in("id",c);for(const v of b??[]){const w=(f=v.pharma_assets)==null?void 0:f.product_name;w&&a.set(ws(l,v.id),bs(`Workflow · ${w}`))}return}case"asset_chat_conversations":{const{data:b}=await o.from("asset_chat_conversations").select("id, pharma_assets:asset_id (product_name)").in("id",c);for(const v of b??[]){const w=(p=v.pharma_assets)==null?void 0:p.product_name;w&&a.set(ws(l,v.id),bs(`Chat · ${w}`))}return}case"asset_extractions":{const{data:b}=await o.from("asset_extractions").select("id, pharma_assets:asset_id (product_name)").in("id",c);for(const v of b??[]){const w=(m=v.pharma_assets)==null?void 0:m.product_name;w&&a.set(ws(l,v.id),bs(`Extraction · ${w}`))}return}case"valuation_runs":{const{data:b}=await o.from("valuation_runs").select("id, pharma_assets:asset_id (product_name)").in("id",c);for(const v of b??[]){const w=(g=v.pharma_assets)==null?void 0:g.product_name;w&&a.set(ws(l,v.id),bs(`Valuation · ${w}`))}return}case"verification_steps":{const{data:b}=await o.from("verification_steps").select("id, name, pharma_assets:asset_id (product_name)").in("id",c);for(const v of b??[]){const w=v.name,_=(y=v.pharma_assets)==null?void 0:y.product_name,j=w&&_?`${w} · ${_}`:w||_;j&&a.set(ws(l,v.id),bs(j))}return}default:return}}catch(b){console.warn(`[useEntityLabels] ${l} lookup failed`,b)}})),a},enabled:t&&n.length>0,staleTime:5*60*1e3});return{labelMap:r??new Map,isLoading:i}}function jM(e,t,n,r){return e&&e.trim()?e:!t||!n?"—":r.get(`${t}:${n}`)??"—"}const Ao={timeRange:"7d",role:null,routePattern:null,userId:null,country:null,excludeBots:!0,excludeImpersonation:!0,excludeAnon:!0},WXe={"24h":24*60*60*1e3,"7d":7*24*60*60*1e3,"30d":30*24*60*60*1e3,"90d":90*24*60*60*1e3};function Sg(e){const t=Date.now();return{from:new Date(t-WXe[e]).toISOString(),to:new Date(t).toISOString()}}function Mne(e){return e==="24h"?"hour":"day"}const UXe=["admin","supplier","buyer","user","anon"],qXe=W;async function hc(e,t){const{data:n,error:r}=await qXe.rpc(e,t);if(r)throw new Error(r.message);return n??[]}function _M(e){const{from:t,to:n}=Sg(e.timeRange);return{p_from:t,p_to:n,p_role:e.role,p_route_pattern:e.routePattern,p_user_id:e.userId,p_country:e.country,p_exclude_bots:e.excludeBots,p_exclude_impersonation:e.excludeImpersonation}}function HXe(e){const{isAdmin:t}=me();return Se({queryKey:["page-view-kpis",e],queryFn:async()=>(await hc("page_views_kpis",_M(e)))[0]??null,enabled:t})}function KXe(e){const{isAdmin:t}=me();return Se({queryKey:["page-view-timeseries",e],queryFn:()=>hc("page_views_timeseries",{..._M(e),p_granularity:Mne(e.timeRange)}),enabled:t})}function GXe(e,t=15){const{isAdmin:n}=me();return Se({queryKey:["page-view-top-routes",e,t],queryFn:()=>{const{from:r,to:i}=Sg(e.timeRange);return hc("page_views_top_routes",{p_from:r,p_to:i,p_role:e.role,p_user_id:e.userId,p_country:e.country,p_exclude_bots:e.excludeBots,p_exclude_impersonation:e.excludeImpersonation,p_limit:t})},enabled:n})}function YXe(e,t=15){const{isAdmin:n}=me();return Se({queryKey:["page-view-top-queries",e,t],queryFn:()=>{const{from:r,to:i}=Sg(e.timeRange);return hc("page_views_top_queries",{p_from:r,p_to:i,p_role:e.role,p_user_id:e.userId,p_country:e.country,p_exclude_bots:e.excludeBots,p_exclude_impersonation:e.excludeImpersonation,p_limit:t})},enabled:n})}function QXe(e,t=10){const{isAdmin:n}=me();return Se({queryKey:["page-view-country-mix",e,t],queryFn:()=>{const{from:r,to:i}=Sg(e.timeRange);return hc("page_views_country_mix",{p_from:r,p_to:i,p_role:e.role,p_route_pattern:e.routePattern,p_user_id:e.userId,p_exclude_bots:e.excludeBots,p_exclude_impersonation:e.excludeImpersonation,p_limit:t})},enabled:n})}function XXe(e){const{isAdmin:t}=me();return Se({queryKey:["page-view-role-mix",e],queryFn:()=>{const{from:n,to:r}=Sg(e.timeRange);return hc("page_views_role_mix",{p_from:n,p_to:r,p_route_pattern:e.routePattern,p_user_id:e.userId,p_country:e.country,p_exclude_bots:e.excludeBots,p_exclude_impersonation:e.excludeImpersonation})},enabled:t})}function ZXe(e,t=50,n=0){const{isAdmin:r}=me();return Se({queryKey:["page-view-sessions",e,t,n],queryFn:()=>hc("page_views_sessions",{..._M(e),p_limit:t,p_offset:n}),enabled:r})}function JXe(e){const{isAdmin:t}=me();return Se({queryKey:["page-view-session-timeline",e],queryFn:()=>hc("page_views_session_timeline",{p_session_id:e}),enabled:t&&!!e})}function eZe(e){const{isAdmin:t}=me();return Se({queryKey:["page-view-filter-options",e.timeRange],queryFn:async()=>{const{from:n,to:r}=Sg(e.timeRange);return(await hc("page_views_filter_options",{p_from:n,p_to:r}))[0]??{user_ids:[],countries:[]}},enabled:t,staleTime:5*60*1e3})}var vk="Popover",[$ne,$pt]=sr(vk,[Ou]),Eb=Ou(),[tZe,Uu]=$ne(vk),Lne=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,l=Eb(t),c=x.useRef(null),[u,d]=x.useState(!1),[h,f]=ji({prop:r,defaultProp:i??!1,onChange:a,caller:vk});return s.jsx(F_,{...l,children:s.jsx(tZe,{scope:t,contentId:gr(),triggerRef:c,open:h,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:u,onCustomAnchorAdd:x.useCallback(()=>d(!0),[]),onCustomAnchorRemove:x.useCallback(()=>d(!1),[]),modal:o,children:n})})};Lne.displayName=vk;var Fne="PopoverAnchor",nZe=x.forwardRef((e,t)=>
vendor: 17,332 bytes, line 857
857{const{__scopePopover:n,...r}=e,i=Uu(Fne,n),a=Eb(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=i;return x.useEffect(()=>(o(),()=>l()),[o,l]),s.jsx(rb,{...a,...r,ref:t})});nZe.displayName=Fne;var zne="PopoverTrigger",Bne=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Uu(zne,n),a=Eb(n),o=Ke(t,i.triggerRef),l=s.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Hne(i.open),...r,ref:o,onClick:fe(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:s.jsx(rb,{asChild:!0,...a,children:l})});Bne.displayName=zne;var SM="PopoverPortal",[rZe,iZe]=$ne(SM,{forceMount:void 0}),Vne=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Uu(SM,t);return s.jsx(rZe,{scope:t,forceMount:n,children:s.jsx(vr,{present:n||a.open,children:s.jsx(Vm,{asChild:!0,container:i,children:r})})})};Vne.displayName=SM;var Dm="PopoverContent",Wne=x.forwardRef((e,t)=>{const n=iZe(Dm,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Uu(Dm,e.__scopePopover);return s.jsx(vr,{present:r||a.open,children:a.modal?s.jsx(aZe,{...i,ref:t}):s.jsx(oZe,{...i,ref:t})})});Wne.displayName=Dm;var sZe=yu("PopoverContent.RemoveScroll"),aZe=x.forwardRef((e,t)=>{const n=Uu(Dm,e.__scopePopover),r=x.useRef(null),i=Ke(t,r),a=x.useRef(!1);return x.useEffect(()=>{const o=r.current;if(o)return sS(o)},[]),s.jsx(db,{as:sZe,allowPinchZoom:!0,children:s.jsx(Une,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),a.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:fe(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:fe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),oZe=x.forwardRef((e,t)=>{const n=Uu(Dm,e.__scopePopover),r=x.useRef(!1),i=x.useRef(!1);return s.jsx(Une,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),Une=x.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...h}=e,f=Uu(Dm,n),p=Eb(n);return rS(),s.jsx(ub,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:s.jsx(Eh,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:s.jsx(z_,{"data-state":Hne(f.open),role:"dialog",id:f.contentId,...p,...h,ref:t,style:{...h.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)"}})})})}),qne="PopoverClose",lZe=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Uu(qne,n);return s.jsx(Ne.button,{type:"button",...r,ref:t,onClick:fe(e.onClick,()=>i.onOpenChange(!1))})});lZe.displayName=qne;var cZe="PopoverArrow",uZe=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Eb(n);return s.jsx(B_,{...i,...r,ref:t})});uZe.displayName=cZe;function Hne(e){return e?"open":"closed"}var dZe=Lne,hZe=Bne,fZe=Vne,Kne=Wne;const Pb=dZe,Ob=hZe,kg=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>s.jsx(fZe,{children:s.jsx(Kne,{ref:i,align:t,sideOffset:n,className:ae("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),...r})}));kg.displayName=Kne.displayName;var bV=1,pZe=.9,mZe=.8,gZe=.17,uA=.1,dA=.999,yZe=.9999,vZe=.99,xZe=/[\\\/_+.#"@\[\(\{&]/,bZe=/[\\\/_+.#"@\[\(\{&]/g,wZe=/[\s-]/,Gne=/[\s-]/g;function nO(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?bV:vZe;var l=`${i},${a}`;if(o[l]!==void 0)return o[l];for(var c=r.charAt(a),u=n.indexOf(c,i),d=0,h,f,p,m;u>=0;)h=nO(e,t,n,r,u+1,a+1,o),h>d&&(u===i?h*=bV:xZe.test(e.charAt(u-1))?(h*=mZe,p=e.slice(i,u-1).match(bZe),p&&i>0&&(h*=Math.pow(dA,p.length))):wZe.test(e.charAt(u-1))?(h*=pZe,m=e.slice(i,u-1).match(Gne),m&&i>0&&(h*=Math.pow(dA,m.length))):(h*=gZe,i>0&&(h*=Math.pow(dA,u-i))),e.charAt(u)!==t.charAt(a)&&(h*=yZe)),(h<uA&&n.charAt(u-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(u-1)!==r.charAt(a))&&(f=nO(e,t,n,r,u+1,a+2,o),f*uA>h&&(h=f*uA)),h>d&&(d=h),u=n.indexOf(c,u+1);return o[l]=d,d}function wV(e){return e.toLowerCase().replace(Gne," ")}function jZe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,nO(e,t,wV(e),wV(t),0,0,{})}var cy='[cmdk-group=""]',hA='[cmdk-group-items=""]',_Ze='[cmdk-group-heading=""]',Yne='[cmdk-item=""]',jV=`${Yne}:not([aria-disabled="true"])`,rO="cmdk-item-select",Cf="data-value",SZe=(e,t,n)=>jZe(e,t,n),Qne=x.createContext(void 0),Ib=()=>x.useContext(Qne),Xne=x.createContext(void 0),kM=()=>x.useContext(Xne),Zne=x.createContext(void 0),Jne=x.forwardRef((e,t)=>{let n=Af(()=>{var D,E;return{search:"",value:(E=(D=e.value)!=null?D:e.defaultValue)!=null?E:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Af(()=>new Set),i=Af(()=>new Map),a=Af(()=>new Map),o=Af(()=>new Set),l=ere(e),{label:c,children:u,value:d,onValueChange:h,filter:f,shouldFilter:p,loop:m,disablePointerSelection:g=!1,vimBindings:y=!0,...b}=e,v=gr(),w=gr(),_=gr(),j=x.useRef(null),S=DZe();kh(()=>{if(d!==void 0){let D=d.trim();n.current.value=D,k.emit()}},[d]),kh(()=>{S(6,z)},[]);let k=x.useMemo(()=>({subscribe:D=>(o.current.add(D),()=>o.current.delete(D)),snapshot:()=>n.current,setState:(D,E,q)=>{var X,re,Y,le;if(!Object.is(n.current[D],E)){if(n.current[D]=E,D==="search")O(),C(),S(1,A);else if(D==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Z=document.getElementById(_);Z?Z.focus():(X=document.getElementById(v))==null||X.focus()}if(S(7,()=>{var Z;n.current.selectedItemId=(Z=$())==null?void 0:Z.id,k.emit()}),q||S(5,z),((re=l.current)==null?void 0:re.value)!==void 0){let Z=E??"";(le=(Y=l.current).onValueChange)==null||le.call(Y,Z);return}}k.emit()}},emit:()=>{o.current.forEach(D=>D())}}),[]),N=x.useMemo(()=>({value:(D,E,q)=>{var X;E!==((X=a.current.get(D))==null?void 0:X.value)&&(a.current.set(D,{value:E,keywords:q}),n.current.filtered.items.set(D,T(E,q)),S(2,()=>{C(),k.emit()}))},item:(D,E)=>(r.current.add(D),E&&(i.current.has(E)?i.current.get(E).add(D):i.current.set(E,new Set([D]))),S(3,()=>{O(),C(),n.current.value||A(),k.emit()}),()=>{a.current.delete(D),r.current.delete(D),n.current.filtered.items.delete(D);let q=$();S(4,()=>{O(),(q==null?void 0:q.getAttribute("id"))===D&&A(),k.emit()})}),group:D=>(i.current.has(D)||i.current.set(D,new Set),()=>{a.current.delete(D),i.current.delete(D)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:v,inputId:_,labelId:w,listInnerRef:j}),[]);function T(D,E){var q,X;let re=(X=(q=l.current)==null?void 0:q.filter)!=null?X:SZe;return D?re(D,n.current.search,E):0}function C(){if(!n.current.search||l.current.shouldFilter===!1)return;let D=n.current.filtered.items,E=[];n.current.filtered.groups.forEach(X=>{let re=i.current.get(X),Y=0;re.forEach(le=>{let Z=D.get(le);Y=Math.max(Z,Y)}),E.push([X,Y])});let q=j.current;F().sort((X,re)=>{var Y,le;let Z=X.getAttribute("id"),de=re.getAttribute("id");return((Y=D.get(de))!=null?Y:0)-((le=D.get(Z))!=null?le:0)}).forEach(X=>{let re=X.closest(hA);re?re.appendChild(X.parentElement===re?X:X.closest(`${hA} > *`)):q.appendChild(X.parentElement===q?X:X.closest(`${hA} > *`))}),E.sort((X,re)=>re[1]-X[1]).forEach(X=>{var re;let Y=(re=j.current)==null?void 0:re.querySelector(`${cy}[${Cf}="${encodeURIComponent(X[0])}"]`);Y==null||Y.parentElement.appendChild(Y)})}function A(){let D=F().find(q=>q.getAttribute("aria-disabled")!=="true"),E=D==null?void 0:D.getAttribute(Cf);k.setState("value",E||void 0)}function O(){var D,E,q,X;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let re=0;for(let Y of r.current){let le=(E=(D=a.current.get(Y))==null?void 0:D.value)!=null?E:"",Z=(X=(q=a.current.get(Y))==null?void 0:q.keywords)!=null?X:[],de=T(le,Z);n.current.filtered.items.set(Y,de),de>0&&re++}for(let[Y,le]of i.current)for(let Z of le)if(n.current.filtered.items.get(Z)>0){n.current.filtered.groups.add(Y);break}n.current.filtered.count=re}function z(){var D,E,q;let X=$();X&&(((D=X.parentElement)==null?void 0:D.firstChild)===X&&((q=(E=X.closest(cy))==null?void 0:E.querySelector(_Ze))==null||q.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function $(){var D;return(D=j.current)==null?void 0:D.querySelector(`${Yne}[aria-selected="true"]`)}function F(){var D;return Array.from(((D=j.current)==null?void 0:D.querySelectorAll(jV))||[])}function B(D){let E=F()[D];E&&k.setState("value",E.getAttribute(Cf))}function P(D){var E;let q=$(),X=F(),re=X.findIndex(le=>le===q),Y=X[re+D];(E=l.current)!=null&&E.loop&&(Y=re+D<0?X[X.length-1]:re+D===X.length?X[0]:X[re+D]),Y&&k.setState("value",Y.getAttribute(Cf))}function I(D){let E=$(),q=E==null?void 0:E.closest(cy),X;for(;q&&!X;)q=D>0?IZe(q,cy):RZe(q,cy),X=q==null?void 0:q.querySelector(jV);X?k.setState("value",X.getAttribute(Cf)):P(D)}let M=()=>B(F().length-1),R=D=>{D.preventDefault(),D.metaKey?M():D.altKey?I(1):P(1)},K=D=>{D.preventDefault(),D.metaKey?B(0):D.altKey?I(-1):P(-1)};return x.createElement(Ne.div,{ref:t,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:D=>{var E;(E=b.onKeyDown)==null||E.call(b,D);let q=D.nativeEvent.isComposing||D.keyCode===229;if(!(D.defaultPrevented||q))switch(D.key){case"n":case"j":{y&&D.ctrlKey&&R(D);break}case"ArrowDown":{R(D);break}case"p":case"k":{y&&D.ctrlKey&&K(D);break}case"ArrowUp":{K(D);break}case"Home":{D.preventDefault(),B(0);break}case"End":{D.preventDefault(),M();break}case"Enter":{D.preventDefault();let X=$();if(X){let re=new Event(rO);X.dispatchEvent(re)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:$Ze},c),xk(e,D=>x.createElement(Xne.Provider,{value:k},x.createElement(Qne.Provider,{value:N},D))))}),kZe=x.forwardRef((e,t)=>{var n,r;let i=gr(),a=x.useRef(null),o=x.useContext(Zne),l=Ib(),c=ere(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;kh(()=>{if(!u)return l.item(i,o==null?void 0:o.id)},[u]);let d=tre(i,a,[e.value,e.children,a],e.keywords),h=kM(),f=Cu(S=>S.value&&S.value===d.current),p=Cu(S=>u||l.filter()===!1?!0:S.search?S.filtered.items.get(i)>0:!0);x.useEffect(()=>{let S=a.current;if(!(!S||e.disabled))return S.addEventListener(rO,m),()=>S.removeEventListener(rO,m)},[p,e.onSelect,e.disabled]);function m(){var S,k;g(),(k=(S=c.current).onSelect)==null||k.call(S,d.current)}function g(){h.setState("value",d.current,!0)}if(!p)return null;let{disabled:y,value:b,onSelect:v,forceMount:w,keywords:_,...j}=e;return x.createElement(Ne.div,{ref:Kl(a,t),...j,id:i,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!f,"data-disabled":!!y,"data-selected":!!f,onPointerMove:y||l.getDisablePointerSelection()?void 0:g,onClick:y?void 0:m},e.children)}),NZe=x.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=gr(),l=x.useRef(null),c=x.useRef(null),u=gr(),d=Ib(),h=Cu(p=>i||d.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);kh(()=>d.group(o),[]),tre(o,l,[e.value,e.heading,c]);let f=x.useMemo(()=>({id:o,forceMount:i}),[i]);return x.createElement(Ne.div,{ref:Kl(l,t),...a,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},n&&x.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),xk(e,p=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},x.createElement(Zne.Provider,{value:f},p))))}),CZe=x.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=x.useRef(null),a=Cu(o=>!o.search);return!n&&!a?null:x.createElement(Ne.div,{ref:Kl(i,t),...r,"cmdk-separator":"",role:"separator"})}),AZe=x.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=kM(),o=Cu(u=>u.search),l=Cu(u=>u.selectedItemId),c=Ib();return x.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),x.createElement(Ne.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:i?e.value:o,onChange:u=>{i||a.setState("search",u.target.value),n==null||n(u.target.value)}})}),TZe=x.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,a=x.useRef(null),o=x.useRef(null),l=Cu(u=>u.selectedItemId),c=Ib();return x.useEffect(()=>{if(o.current&&a.current){let u=o.current,d=a.current,h,f=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let p=u.offsetHeight;d.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(u),()=>{cancelAnimationFrame(h),f.unobserve(u)}}},[]),x.createElement(Ne.div,{ref:Kl(a,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},xk(e,u=>x.createElement("div",{ref:Kl(o,c.listInnerRef),"cmdk-list-sizer":""},u)))}),EZe=x.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...l}=e;return x.createElement(oS,{open:n,onOpenChange:r},x.createElement(lS,{container:o},x.createElement(rg,{"cmdk-overlay":"",className:i}),x.createElement(ig,{"aria-label":e.label,"cmdk-dialog":"",className:a},x.createElement(Jne,{ref:t,...l}))))}),PZe=x.forwardRef((e,t)=>Cu(n=>n.filtered.count===0)?x.createElement(Ne.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),OZe=x.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...a}=e;return x.createElement(Ne.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},xk(e,o=>x.createElement("div",{"aria-hidden":!0},o)))}),gs=Object.assign(Jne,{List:TZe,Item:kZe,Input:AZe,Group:NZe,Separator:CZe,Dialog:EZe,Empty:PZe,Loading:OZe});function IZe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function RZe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function ere(e){let t=x.useRef(e);return kh(()=>{t.current=e}),t}var kh=typeof window>"u"?x.useEffect:x.useLayoutEffect;function Af(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Cu(e){let t=kM(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function tre(e,t,n,r=[]){let i=x.useRef(),a=Ib();return kh(()=>{var o;let l=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():i.current}})(),c=r.map(u=>u.trim());a.value(e,l,c),(o=t.current)==null||o.setAttribute(Cf,l),i.current=l}),i}var DZe=()=>{let[e,t]=x.useState(),n=Af(()=>new Map);return kh(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function MZe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function xk({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(MZe(t),{ref:t.ref},n(t.props.children)):n(t)}var $Ze={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const NM=x.forwardRef(({className:e,...t},n)=>s.jsx(gs,{ref:n,className:ae("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));NM.displayName=gs.displayName;const CM=x.forwardRef(({className:e,...t},n)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(Ea,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(gs.Input,{ref:n,className:ae("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));CM.displayName=gs.Input.displayName;const AM=x.forwardRef(({className:e,...t},n)=>s.jsx(gs.List,{ref:n,className:ae("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));AM.displayName=gs.List.displayName;const TM=x.forwardRef((e,t)=>
857s.jsx(gs.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));TM.displayName=gs.Empty.displayName;const EM=x.forwardRef(({className:e,...t},n)=>s.jsx(gs.Group,{ref:n,className:ae("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));EM.displayName=gs.Group.displayName;const LZe=x.forwardRef(({className:e,...t},n)=>s.jsx(gs.Separator,{ref:n,className:ae("-mx-1 h-px bg-border",e),...t}));LZe.displayName=gs.Separator.displayName;const PM=x.forwardRef(({className:e,...t},n)=>s.jsx(gs.Item,{ref:n,className:ae("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));PM.displayName=gs.Item.displayName;function sv({options:e,selected:t,onChange:n,placeholder:r="Select…",searchPlaceholder:i="Search…",emptyMessage:a="No matches.",allLabel:o="All",className:l,triggerClassName:c,disabled:u}){const[d,h]=x.useState(!1),f=x.useMemo(()=>e.map(w=>w.value),[e]),p=t.length>0&&t.length===e.length,m=t.length===0,g=w=>{n(t.includes(w)?t.filter(_=>_!==w):[...t,w])},y=()=>n(f),b=()=>n([]),v=x.useMemo(()=>{if(p)return o;if(m)return r;if(t.length===1){const w=e.find(_=>_.value===t[0]);return(w==null?void 0:w.label)??`${t.length} selected`}return`${t.length} selected`},[p,m,t,e,o,r]);return s.jsx("div",{className:ae("w-full",l),children:s.jsxs(Pb,{open:d,onOpenChange:h,children:[s.jsx(Ob,{asChild:!0,children:s.jsxs(je,{variant:"outline",role:"combobox","aria-expanded":d,disabled:u,className:ae("w-full justify-between font-normal",m&&"text-muted-foreground",c),children:[s.jsx("span",{className:"truncate",children:v}),s.jsx(Ta,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(kg,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:s.jsxs(NM,{children:[s.jsx(CM,{placeholder:i}),s.jsxs("div",{className:"flex items-center justify-between border-b px-2 py-1.5 text-xs",children:[s.jsx("button",{type:"button",onClick:y,disabled:p,className:"text-muted-foreground hover:text-foreground disabled:opacity-40 disabled:hover:text-muted-foreground",children:"Select all"}),s.jsxs("span",{className:"text-muted-foreground",children:[t.length,"/",e.length]}),s.jsx("button",{type:"button",onClick:b,disabled:m,className:"text-muted-foreground hover:text-foreground disabled:opacity-40 disabled:hover:text-muted-foreground",children:"Clear all"})]}),s.jsxs(AM,{children:[s.jsx(TM,{children:a}),s.jsx(EM,{children:e.map(w=>{const _=t.includes(w.value);return s.jsxs(PM,{value:w.label,onSelect:()=>g(w.value),className:"cursor-pointer",children:[s.jsx("div",{className:ae("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",_?"bg-primary text-primary-foreground":"opacity-50"),children:_&&s.jsx(Fr,{className:"h-3 w-3"})}),s.jsx("span",{className:"truncate",children:w.label})]},w.value)})})]})]})})]})})}function yd({options:e,value:t,onChange:n,placeholder:r="Select…",searchPlaceholder:i="Search…",emptyMessage:a="No matches.",className:o,triggerClassName:l,disabled:c}){const[u,d]=x.useState(!1),h=e.find(f=>f.value===t);return s.jsx("div",{className:ae("w-full",o),children:s.jsxs(Pb,{open:u,onOpenChange:d,children:[s.jsx(Ob,{asChild:!0,children:s.jsxs(je,{variant:"outline",role:"combobox","aria-expanded":u,disabled:c,className:ae("w-full justify-between font-normal",!h&&"text-muted-foreground",l),children:[s.jsx("span",{className:"truncate",children:(h==null?void 0:h.label)??r}),s.jsxs("div",{className:"ml-2 flex shrink-0 items-center gap-1",children:[h&&s.jsx(Ui,{className:"h-3.5 w-3.5 opacity-50 hover:opacity-100",onClick:f=>{f.stopPropagation(),n(null)}}),s.jsx(Ta,{className:"h-4 w-4 opacity-50"})]})]})}),s.jsx(kg,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:s.jsxs(NM,{children:[s.jsx(CM,{placeholder:i}),s.jsxs(AM,{children:[s.jsx(TM,{children:a}),s.jsx(EM,{children:e.map(f=>s.jsxs(PM,{value:f.label,onSelect:()=>{n(f.value===t?null:f.value),d(!1)},className:"cursor-pointer",children:[s.jsx(Fr,{className:ae("mr-2 h-4 w-4",f.value===t?"opacity-100":"opacity-0")}),s.jsx("span",{className:"truncate",children:f.label})]},f.value))})]})]})})]})})}const _V=Object.values(Ve).map(e=>({value:e,label:e})),FZe=[{value:"all",label:"All time"},{value:"1h",label:"Past hour"},{value:"24h",label:"Past 24 hours"},{value:"7d",label:"Past 7 days"},{value:"30d",label:"Past 30 days"}],zZe={entityTypes:Object.values(Ve),actions:[],actorUserId:null,timeRange:"24h"};function BZe({filters:e,onChange:t,actionOptions:n,actorOptions:r,emailMap:i}){const a=x.useMemo(()=>n.map(d=>({value:d,label:d})),[n]),o=x.useMemo(()=>r.map(d=>({value:d,label:i.get(d)??`${d.slice(0,8)}…`})).sort((d,h)=>d.label.localeCompare(h.label)),[r,i]),l=x.useMemo(()=>FZe.map(d=>({value:d.value,label:d.label})),[]),c=e.entityTypes.length===_V.length&&e.actions.length===n.length&&e.actorUserId===null&&e.timeRange==="all",u=()=>t({entityTypes:Object.values(Ve),actions:n,actorUserId:null,timeRange:"all"});return s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-3",children:[s.jsx(X0,{label:"Entity type",children:s.jsx(sv,{options:_V,selected:e.entityTypes,onChange:d=>t({...e,entityTypes:d}),placeholder:"Select entity types",searchPlaceholder:"Search entities…",allLabel:"All entities"})}),s.jsx(X0,{label:"Action",children:s.jsx(sv,{options:a,selected:e.actions,onChange:d=>t({...e,actions:d}
857),placeholder:a.length===0?"No actions yet":"Select actions",searchPlaceholder:"Search actions…",allLabel:"All actions",disabled:a.length===0})}),s.jsx(X0,{label:"Actor",children:s.jsx(yd,{options:o,value:e.actorUserId,onChange:d=>t({...e,actorUserId:d}),placeholder:"Any actor",searchPlaceholder:"Search by email…",emptyMessage:"No matching users."})}),s.jsx(X0,{label:"Time range",actions:!c&&s.jsxs(je,{variant:"ghost",size:"sm",onClick:u,className:"h-5 px-1.5 text-[11px] text-muted-foreground",children:[s.jsx(Ui,{className:"h-3 w-3 mr-0.5"}),"Reset"]}),children:s.jsx(yd,{options:l,value:e.timeRange==="all"?null:e.timeRange,onChange:d=>t({...e,timeRange:d??"all"}),placeholder:"All time"})})]})}function X0({label:e,actions:t,children:n}){return s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between h-5",children:[s.jsx(Pe,{className:"text-xs font-medium text-muted-foreground",children:e}),t]}),n]})}function VZe(e){if(e==="all")return{};const t=Date.now(),n={"1h":60*60*1e3,"24h":24*60*60*1e3,"7d":7*24*60*60*1e3,"30d":30*24*60*60*1e3};return{from:new Date(t-n[e]).toISOString()}}const nre=["updated_at","embedding","embedding_text"];function WZe(e,t,n=nre){const r=new Set(n),i=new Set;for(const o of Object.keys(e??{}))r.has(o)||i.add(o);for(const o of Object.keys(t??{}))r.has(o)||i.add(o);const a=[];for(const o of[...i].sort()){const l=!!e&&o in e,c=!!t&&o in t,u=l?e[o]:void 0,d=c?t[o]:void 0;let h;!l&&c?h="added":l&&!c?h="removed":UZe(u,d)?h="unchanged":h="changed",a.push({field:o,before:u,after:d,status:h})}return a}function UZe(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(typeof e!="object")return e===t;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function qZe({before:e,after:t,op:n,hiddenFields:r=nre}){const[i,a]=x.useState(!1),o=x.useMemo(()=>WZe(e,t,r),[e,t,r]),l=o.filter(u=>u.status!=="unchanged"),c=o.filter(u=>u.status==="unchanged");return!e&&!t?s.jsx(NV,{title:"No record snapshot available",body:n==="TRUNCATE"?"This was a bulk truncate operation.":"This action didn't record a row-level snapshot (e.g. it was a cross-cutting action like a search, not a single-row write)."}):l.length===0?s.jsx(NV,{title:"No field-level changes",body:"The row was touched but no tracked column changed value. This can happen with reorders or no-op writes.",footer:c.length>0&&s.jsx(kV,{count:c.length,open:i,onToggle:()=>a(u=>!u)}),children:i&&s.jsx(fA,{rows:c})}):s.jsxs("div",{className:"space-y-2",children:[s.jsx(fA,{rows:l}),c.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(kV,{count:c.length,open:i,onToggle:()=>a(u=>!u)}),i&&s.jsx(fA,{rows:c,subdued:!0})]})]})}function fA({rows:e,subdued:t}){return s.jsx("div",{className:ae("rounded border overflow-hidden",t&&"opacity-70"),children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{className:"bg-muted/60",children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left font-medium px-2 py-1.5 w-1/4",children:"Field"}),s.jsx("th",{className:"text-left font-medium px-2 py-1.5 w-[37.5%]",children:"Before"}),s.jsx("th",{className:"text-left font-medium px-2 py-1.5 w-[37.5%]",children:"After"})]})}),s.jsx("tbody",{children:e.map(n=>s.jsxs("tr",{className:"border-t align-top",children:[s.jsx("td",{className:"px-2 py-1.5 font-mono",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(HZe,{status:n.status}),s.jsx("span",{className:"truncate",children:n.field})]})}),s.jsx("td",{className:"px-2 py-1.5",children:n.status==="added"?s.jsx("span",{className:"text-muted-foreground italic",children:"—"}):s.jsx(SV,{value:n.before,tone:n.status==="changed"||n.status==="removed"?"before":"neutral"})}),s.jsx("td",{className:"px-2 py-1.5",children:n.status==="removed"?s.jsx("span",{className:"text-muted-foreground italic",children:"—"}):s.jsx(SV,{value:n.after,tone:n.status==="changed"||n.status==="added"?"after":"neutral"})})]},n.field))})]})})}function HZe({status:e}){const t={added:{cls:"bg-emerald-500",title:"Added"},removed:{cls:"bg-rose-500",title:"Removed"},changed:{cls:"bg-amber-500",title:"Changed"},unchanged:{cls:"bg-muted",title:"Unchanged"}},{cls:n,title:r}=t[e];return s.jsx("span",{className:ae("h-2 w-2 rounded-full shrink-0",n),title:r})}function SV({value:e,tone:t}){const n=t==="before"?"bg-rose-500/10 text-rose-900 dark:text-rose-200":t==="after"?"bg-emerald-500/10 text-emerald-900 dark:text-emerald-200":"";return s.jsx("div",{className:ae("rounded px-1.5 py-0.5 break-words whitespace-pre-wrap",n),children:s.jsx(KZe,{value:e})})}function KZe({value:e}){const[t,n]=x.useState(!1);if(e===null)return s.jsx("span",{className:"text-muted-foreground italic",children:"null"});if(e===void 0)return s.jsx("span",{className:"text-muted-foreground italic",children:"—"});if(typeof e=="boolean")return s.jsx("span",{className:"font-mono",children:e?"true":"false"});if(typeof e=="number")return s.jsx("span",{className:"font-mono",children:e});if(typeof e=="string")return e===""?s.jsx("span",{className:"text-muted-foreground italic",children:"(empty)"}):e.length<=200?s.jsx("span",{children:e}):s.jsxs("div",{children:[s.jsx("span",{children:t?e:e.slice(0,200)+"…"}),s.jsx("button",{type:"button",onClick:()=>n(i=>!i),className:"ml-1 text-[10px] text-muted-foreground hover:text-foreground underline",children:t?"less":"more"})]});const r=GZe(e);return r.length<=120?s.jsx("code",{className:"text-[11px]",children:r}):s.jsxs("details",{children:[s.jsx("summary",{className:"cursor-pointer text-[11px] text-muted-foreground hover:text-foreground",children:Array.isArray(e)?`[${e.length} items]`:`{${Object.keys(e).length} keys}`}),s.jsx("pre",{className:"mt-1 overflow-x-auto text-[11px]",children:r})]})}function GZe(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function kV({count:e,open:t,onToggle:n}){return s.jsxs(je,{type:"button",variant:"ghost",size:"sm",onClick:n,className:"h-7 text-xs text-muted-foreground",children:[t?s.jsx(Ta,{className:"h-3 w-3 mr-1"}):s.jsx(Us,{className:"h-3 w-3 mr-1"}),t?"Hide":"Show"," ",e," unchanged field",e===1?"":"s"]})}
857function NV({title:e,body:t,footer:n,children:r}){return s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"rounded border border-dashed p-3 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(pn,{variant:"outline",className:"text-[10px]",children:"N/A"}),s.jsx("span",{className:"font-medium",children:e})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:t})]}),n,r]})}const YZe={INSERT:"bg-emerald-500",UPDATE:"bg-amber-500",DELETE:"bg-rose-500",TRUNCATE:"bg-rose-700"};function QZe({versions:e,selectedIdx:t,compareIdx:n,onSelect:r,onToggleCompare:i,emailMap:a,anchorIdx:o}){return e.length===0?null:s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsxs("span",{children:["Version history (",e.length,")"]}),s.jsx("span",{className:"hidden sm:inline",children:"Click to view · Shift-click to compare"})]}),s.jsx("div",{className:"flex items-center gap-1 overflow-x-auto py-1.5 px-1 rounded border bg-muted/30",role:"listbox","aria-label":"Version timeline",children:e.map((l,c)=>{const u=c===t,d=c===n,h=c===o,f=YZe[l.op]??"bg-muted-foreground";return s.jsxs(ni,{children:[s.jsx(ri,{asChild:!0,children:s.jsx("button",{type:"button",onClick:p=>{p.shiftKey?i(c):r(c)},"aria-selected":u,"aria-label":`${l.op} at ${rn(new Date(l.ts),"MMM d HH:mm:ss")}`,className:ae("relative h-4 w-4 shrink-0 rounded-full transition-transform",f,"hover:scale-125",u&&"ring-2 ring-primary ring-offset-1 ring-offset-background",d&&"ring-2 ring-sky-500 ring-offset-1 ring-offset-background",h&&!u&&!d&&"ring-2 ring-foreground/50 ring-offset-1 ring-offset-background")})}),s.jsx(Kr,{side:"top",className:"text-xs",children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-mono",children:l.op})," · ",rn(new Date(l.ts),"MMM d HH:mm:ss")]}),l.auth_uid&&s.jsxs("div",{className:"text-muted-foreground",children:["by ",zl(l.auth_uid,a)]}),l.auth_role&&s.jsxs("div",{className:"text-muted-foreground",children:["role: ",l.auth_role]})]})})]},l.id)})}),t!=null&&n!=null&&s.jsxs("div",{className:"text-xs text-muted-foreground px-1",children:["Comparing version"," ",s.jsx("span",{className:"font-mono",children:Math.min(t,n)+1})," → ",s.jsx("span",{className:"font-mono",children:Math.max(t,n)+1})]})]})}function XZe({log:e,logs:t,emailMap:n,entityLabelMap:r,onOpenChange:i,onNavigate:a,onOpenSession:o}){var $,F;const l=e?t.findIndex(B=>B.id===e.id):-1,c=l>0?t[l-1]:null,u=l>=0&&l<t.length-1?t[l+1]:null,d=VXe((e==null?void 0:e.entity_type)??"",(e==null?void 0:e.entity_id)??"",!!(e!=null&&e.entity_id)),h=x.useMemo(()=>[...d.data??[]].reverse(),[d.data]),f=x.useMemo(()=>h.map(B=>B.auth_uid),[h]),{emailMap:p}=wM(f),m=x.useMemo(()=>new Map([...n,...p]),[n,p]),g=x.useMemo(()=>{if(!e||h.length===0)return null;const B=new Date(e.created_at).getTime();let P=null,I=1/0;return h.forEach((M,R)=>{const K=Math.abs(new Date(M.ts).getTime()-B);K<=2e3&&K<I&&(P=R,I=K)}),P??h.length-1},[e,h]),[y,b]=x.useState(null),[v,w]=x.useState(null),[_,j]=x.useState(!1);x.useEffect(()=>{b(g),w(null),j(!1)},[e==null?void 0:e.id,g]),x.useEffect(()=>{if(!e)return;const B=P=>{P.target instanceof HTMLElement&&["INPUT","TEXTAREA"].includes(P.target.tagName)||(P.key==="ArrowLeft"||P.key==="k"?c&&(P.preventDefault(),a(c)):(P.key==="ArrowRight"||P.key==="j")&&u&&(P.preventDefault(),a(u)))};return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[e,c,u,a]);const S=y!=null?h[y]:null,k=v!=null?h[v]:null,N=x.useMemo(()=>{if(!S)return{before:null,after:null,op:null};if(k){const B=S.ts<=k.ts?S:k,P=S.ts<=k.ts?k:S;return{before:B.record,after:P.record,op:"UPDATE"}}return{before:S.old_record,after:S.record,op:S.op}},[S,k]);if(!e)return null;const T=JZe(e.entity_type,e.entity_id),C=zl(e.actor_user_id,n),A=e.effective_user_id&&e.effective_user_id!==e.actor_user_id?zl(e.effective_user_id,n):null,O=Object.entries(e.metadata??{}),z=Object.entries(e.context??{});return s.jsx(Br,{open:!!e,onOpenChange:i,children:s.jsxs(br,{className:"max-w-3xl max-h-[88vh] overflow-y-auto p-0",children:[s.jsxs(wr,{className:"sticky top-0 z-10 bg-background border-b px-5 py-3 flex-row items-center justify-between space-y-0",children:[s.jsxs(jr,{className:"flex items-center gap-2 text-base",children:[s.jsx("code",{className:"text-sm bg-muted px-1.5 py-0.5 rounded",children:e.action}),s.jsx("span",{className:"text-muted-foreground text-xs",children:"on"}),s.jsx("code",{className:"text-sm bg-muted px-1.5 py-0.5 rounded",children:e.entity_type})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(je,{variant:"ghost",size:"icon",disabled:!c,onClick:()=>c&&a(c),title:"Previous (← or k)",className:"h-7 w-7",children:s.jsx(Wt,{className:"h-4 w-4"})}),s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums px-1",children:l>=0?`${l+1}/${t.length}`:""}),s.jsx(je,{variant:"ghost",size:"icon",disabled:!u,onClick:()=>u&&a(u),title:"Next (→ or j)",className:"h-7 w-7",children:s.jsx(Gn,{className:"h-4 w-4"})}),s.jsx(je,{variant:"ghost",size:"icon",onClick:()=>i(!1),title:"Close (Esc)",className:"h-7 w-7",children:s.jsx(Ui,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"px-5 py-4 space-y-5 text-sm",children:[s.jsxs("section",{children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:"Summary"}),s.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm",children:[s.jsx("dt",{className:"text-muted-foreground",children:"When"}),s.jsx("dd",{className:"font-mono text-xs",children:rn(new Date(e.created_at),"MMM d, yyyy 'at' HH:mm:ss")}),s.jsx("dt",{className:"text-muted-foreground",children:"Actor"}),s.jsxs("dd",{children:[s.jsx("span",{children:C}),A&&s.jsxs("span",{className:"text-muted-foreground",children:[" ","
857impersonating ",s.jsx("span",{className:"text-foreground",children:A})]})]}),s.jsx("dt",{className:"text-muted-foreground",children:"Entity"}),s.jsxs("dd",{className:"flex items-center gap-2 min-w-0",children:[(()=>{const B=jM(e.entity_label,e.entity_type,e.entity_id,r??new Map);return B!=="—"?s.jsx("span",{className:"truncate",children:B}):s.jsx("span",{className:"text-muted-foreground italic",children:"no label"})})(),e.entity_id&&s.jsxs("code",{className:"text-[11px] bg-muted px-1 py-0.5 rounded text-muted-foreground shrink-0",children:[e.entity_id.slice(0,8),"…"]}),T&&s.jsx(je,{asChild:!0,variant:"ghost",size:"icon",className:"h-5 w-5 shrink-0",children:s.jsx(oe,{to:T,title:"Open entity",children:s.jsx(tc,{className:"h-3.5 w-3.5"})})})]}),s.jsx("dt",{className:"text-muted-foreground",children:"Source"}),s.jsx("dd",{children:s.jsx(pn,{variant:e.source==="edge_function"?"secondary":"default",children:e.source})}),typeof(($=e.context)==null?void 0:$.session_id)=="string"&&o&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{className:"text-muted-foreground",children:"Session"}),s.jsx("dd",{children:s.jsx(je,{variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>{i(!1),o(e.context.session_id)},children:"View session →"})})]})]})]}),s.jsxs("section",{children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:"What changed"}),e.entity_id?d.isLoading?s.jsx(ce,{className:"h-24 w-full"}):d.isError?s.jsxs("p",{className:"text-xs text-destructive",children:["Failed to load record versions: ",((F=d.error)==null?void 0:F.message)??"unknown"]}):h.length===0?s.jsxs("div",{className:"rounded border border-dashed p-3 text-xs",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(pn,{variant:"outline",className:"text-[10px]",children:"empty"}),s.jsx("span",{className:"font-medium",children:"No row-level history recorded"})]}),s.jsx("p",{className:"text-muted-foreground",children:"Either this entity predates row-level audit tracking, or the write was performed before the trigger was installed. Newer writes will appear here."})]}):s.jsxs("div",{className:"space-y-3",children:[s.jsx(QZe,{versions:h,selectedIdx:y,compareIdx:v,onSelect:B=>{b(B),w(null)},onToggleCompare:B=>{B!==y&&w(P=>P===B?null:B)},emailMap:m,anchorIdx:g}),S&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsx(pn,{variant:"outline",children:N.op??"UPDATE"}),s.jsx("span",{className:"font-mono text-muted-foreground",children:rn(new Date(S.ts),"MMM d HH:mm:ss")}),S.auth_uid&&s.jsxs("span",{className:"text-muted-foreground",children:["· ",zl(S.auth_uid,m)]}),k&&s.jsx(je,{variant:"ghost",size:"sm",onClick:()=>w(null),className:"h-5 text-[11px] ml-auto",children:"Clear compare"})]}),s.jsx(qZe,{before:N.before,after:N.after,op:N.op})]})]}):s.jsxs("div",{className:"rounded border border-dashed p-3 text-xs",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(pn,{variant:"outline",className:"text-[10px]",children:"N/A"}),s.jsx("span",{className:"font-medium",children:"Cross-cutting action"})]}),s.jsxs("p",{className:"text-muted-foreground",children:["This action doesn't target a single row (e.g. a search or list view), so there's no row-level snapshot. See the ",s.jsx("strong",{children:"Details"})," section below for the action-specific payload."]})]})]}),s.jsxs("section",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Details"}),s.jsx("button",{type:"button",onClick:()=>j(B=>!B),className:"text-[11px] text-muted-foreground hover:text-foreground underline",children:_?"Hide raw":"View raw"})]}),_?s.jsxs("div",{className:"space-y-3",children:[s.jsx(AV,{title:"metadata",value:e.metadata}),s.jsx(AV,{title:"context",value:e.context})]}):s.jsxs("div",{className:"space-y-3",children:[O.length>0?s.jsx(CV,{title:"Action metadata",entries:O}):s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No metadata recorded."}),z.length>0&&s.jsx(CV,{title:"Context",entries:z,subdued:!0})]})]})]})]})})}function CV({title:e,entries:t,subdued:n}){return s.jsxs("div",{children:[s.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground mb-1",children:e}),s.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 rounded border p-2 text-xs "+(n?"bg-muted/30 text-muted-foreground":""),children:t.map(([r,i])=>s.jsxs("div",{className:"contents",children:[s.jsx("dt",{className:"font-mono",children:r}),s.jsx("dd",{className:"min-w-0 break-words",children:s.jsx(ZZe,{value:i})})]},r))})]})}function ZZe({value:e}){if(e==null)return s.jsx("span",{className:"text-muted-foreground italic",children:"—"});if(typeof e=="boolean")return s.jsx("span",{children:e?"Yes":"No"});if(typeof e=="number")return s.jsx("span",{className:"font-mono",children:e});if(typeof e=="string")return s.jsx("span",{children:e||s.jsx("em",{className:"text-muted-foreground",children:"empty"})});if(Array.isArray(e)){if(e.length===0)return s.jsx("span",{className:"text-muted-foreground italic",children:"[]"});if(e.every(t=>typeof t=="string"||typeof t=="number"))return s.jsx("span",{children:e.join(", ")})}return s.jsxs("details",{children:[s.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:Array.isArray(e)?`[${e.length}]`:"{…}"}),s.jsx("pre",{className:"mt-1 overflow-x-auto",children:rre(e)})]})}function AV({title:e,value:t}){return s.jsxs("div",{children:[s.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground mb-1",children:e}),s.jsx("pre",{className:"bg-muted rounded p-2 text-xs overflow-x-auto",children:rre(t)})]})}function rre(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function JZe(e,t){if(!t)return null;switch(e){case"pharma_assets":return`/pipeline/${t}`;case"suppliers":return"/admin";case"buyer_users":case"supplier_users":case"user_roles":case"profiles":return"/admin";default:return null}}var bk="Checkbox",[eJe,Lpt]=sr(bk),[tJe,OM]=eJe(bk);function nJe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:h}=e,[f,p]=ji({prop:n,defaultProp:i??!1,onChange:c,caller:bk}
vendor: 1,727 bytes, line 857
857),[m,g]=x.useState(null),[y,b]=x.useState(null),v=x.useRef(!1),w=m?!!o||!!m.closest("form"):!0,_={checked:f,disabled:a,setChecked:p,control:m,setControl:g,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:v,required:u,defaultChecked:fu(i)?!1:i,isFormControl:w,bubbleInput:y,setBubbleInput:b};return s.jsx(tJe,{scope:t,..._,children:rJe(h)?h(_):r})}var ire="CheckboxTrigger",sre=x.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:a,value:o,disabled:l,checked:c,required:u,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=OM(ire,e),g=Ke(i,d),y=x.useRef(c);return x.useEffect(()=>{const b=a==null?void 0:a.form;if(b){const v=()=>h(y.current);return b.addEventListener("reset",v),()=>b.removeEventListener("reset",v)}},[a,h]),s.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":fu(c)?"mixed":c,"aria-required":u,"data-state":ure(c),"data-disabled":l?"":void 0,disabled:l,value:o,...r,ref:g,onKeyDown:fe(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:fe(n,b=>{h(v=>fu(v)?!0:!v),m&&p&&(f.current=b.isPropagationStopped(),f.current||b.stopPropagation())})})});sre.displayName=ire;var IM=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:l,value:c,onCheckedChange:u,form:d,...h}=e;return s.jsx(nJe,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:l,required:o,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:f})=>s.jsxs(s.Fragment,{children:[s.jsx(sre,{...h,ref:t,__scopeCheckbox:n}),f&&s.jsx(cre,{__scopeCheckbox:n})]})})});IM.displayName=bk;var are="CheckboxIndicator",ore=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,a=OM(are,n);
857return s.jsx(vr,{present:r||fu(a.checked)||a.checked===!0,children:s.jsx(Ne.span,{"data-state":ure(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});ore.displayName=are;var lre="CheckboxBubbleInput",cre=x.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:l,disabled:c,name:u,value:d,form:h,bubbleInput:f,setBubbleInput:p}=OM(lre,e),m=Ke(n,p),g=gb(a),y=nb(r);x.useEffect(()=>{const v=f;if(!v)return;const w=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(w,"checked").set,S=!i.current;if(g!==a&&j){const k=new Event("click",{bubbles:S});v.indeterminate=fu(a),j.call(v,fu(a)?!1:a),v.dispatchEvent(k)}},[f,g,a,i]);const b=x.useRef(fu(a)?!1:a);return s.jsx(Ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??b.current,required:l,disabled:c,name:u,value:d,form:h,...t,tabIndex:-1,ref:m,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});cre.displayName=lre;function rJe(e){return typeof e=="function"}function fu(e){return e==="indeterminate"}function ure(e){return fu(e)?"indeterminate":e?"checked":"unchecked"}const pu=x.forwardRef(({className:e,...t},n)=>s.jsx(IM,{ref:n,className:ae("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:s.jsx(ore,{className:ae("flex items-center justify-center text-current"),children:s.jsx(Fr,{className:"h-4 w-4"})})}));pu.displayName=IM.displayName;const iJe={US:"United States",GB:"United Kingdom",CA:"Canada",AU:"Australia",DE:"Germany",FR:"France",IT:"Italy",ES:"Spain",NL:"Netherlands",CH:"Switzerland",SE:"Sweden",NO:"Norway",DK:"Denmark",FI:"Finland",IE:"Ireland",BE:"Belgium",AT:"Austria",PL:"Poland",PT:"Portugal",CZ:"Czechia",GR:"Greece",RO:"Romania",HU:"Hungary",TR:"Turkey",RU:"Russia",UA:"Ukraine",IL:"Israel",AE:"UAE",SA:"Saudi Arabia",IN:"India",PK:"Pakistan",BD:"Bangladesh",CN:"China",JP:"Japan",KR:"South Korea",TW:"Taiwan",HK:"Hong Kong",SG:"Singapore",MY:"Malaysia",TH:"Thailand",ID:"Indonesia",PH:"Philippines",VN:"Vietnam",NZ:"New Zealand",BR:"Brazil",AR:"Argentina",MX:"Mexico",CL:"Chile",CO:"Colombia",PE:"Peru",ZA:"South Africa",EG:"Egypt",NG:"Nigeria",KE:"Kenya",MA:"Morocco"};function RM(e){return e?iJe[e.toUpperCase()]??e:"Unknown"}const sJe=[{value:"24h",label:"Past 24 hours"},{value:"7d",label:"Past 7 days"},{value:"30d",label:"Past 30 days"},{value:"90d",label:"Past 90 days"}],aJe=UXe.map(e=>({value:e,label:e})),oJe=bxe.map(e=>({value:e,label:e}));function lJe({filters:e,onChange:t,userOptions:n,emailMap:r,countryOptions:i}){const a=x.useMemo(()=>n.map(c=>({value:c,label:r.get(c)??`${c.slice(0,8)}…`})).sort((c,u)=>c.label.localeCompare(u.label)),[n,r]),o=x.useMemo(()=>i.map(c=>({value:c,label:RM(c)})).sort((c,u)=>c.label.localeCompare(u.label)),[i]),l=e.timeRange===Ao.timeRange&&e.role===Ao.role&&e.routePattern===Ao.routePattern&&e.userId===Ao.userId&&e.country===Ao.country&&e.excludeBots===Ao.excludeBots&&e.excludeImpersonation===Ao.excludeImpersonation&&e.excludeAnon===Ao.excludeAnon;return s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[s.jsx(uy,{label:"Time range",children:s.jsx(yd,{options:sJe,value:e.timeRange,onChange:c=>t({...e,timeRange:c??"7d"}),placeholder:"7 days"})}),s.jsx(uy,{label:"Role",children:s.jsx(yd,{options:aJe,value:e.role,onChange:c=>t({...e,role:c}),placeholder:"All roles",searchPlaceholder:"Filter role…"})}),s.jsx(uy,{label:"Route",children:s.jsx(yd,{options:oJe,value:e.routePattern,onChange:c=>t({...e,routePattern:c}),placeholder:"All routes",searchPlaceholder:"Filter route…"})}),s.jsx(uy,{label:"User",children:s.jsx(yd,{options:a,value:e.userId,onChange:c=>t({...e,userId:c}),placeholder:"Any user",searchPlaceholder:"Search by email…",emptyMessage:"No matching users."})}),s.jsx(uy,{label:"Country",children:s.jsx(yd,{options:o,value:e.country,onChange:c=>t({...e,country:c}),placeholder:"All countries",searchPlaceholder:"Search country…"})})]}),s.jsxs("div",{className:"flex items-center justify-between gap-5 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-5",children:[s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[s.jsx(pu,{checked:e.excludeBots,onCheckedChange:c=>t({...e,excludeBots:c===!0})}),s.jsx("span",{className:"text-muted-foreground",children:"Exclude bots"})]}),s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[s.jsx(pu,{checked:e.excludeImpersonation,onCheckedChange:c=>t({...e,excludeImpersonation:c===!0})}),s.jsx("span",{className:"text-muted-foreground",children:"Exclude impersonation"})]}),s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[s.jsx(pu,{checked:e.excludeAnon,onCheckedChange:c=>t({...e,excludeAnon:c===!0})}),s.jsx("span",{className:"text-muted-foreground",children:"Exclude anon"})]})]}),!l&&s.jsxs(je,{variant:"ghost",size:"sm",onClick:()=>t(Ao),className:"h-7 px-2 text-xs text-muted-foreground",children:[s.jsx(Ui,{className:"h-3 w-3 mr-1"}),"Reset filters"]})]})]})}function uy({label:e,children:t}){return s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Pe,{className:"text-xs font-medium text-muted-foreground",children:e}),t]})}const iO={admin:"hsl(var(--primary))",supplier:"#8b5cf6",buyer:"#10b981",user:"#f59e0b",anon:"#64748b"};function cJe({filters:e,onSelectRoute:t}){const n=HXe(e),r=KXe(e),i=GXe(e,10),a=YXe(e,10),o=XXe(e),l=QXe(e,10);return s.jsxs("div",{className:"space-y-4",children:[s.jsx(uJe,{data:n.data,isLoading:n.isLoading}),s.jsxs(Be,{children:[s.jsx(ht,{className:"pb-2",children:s.jsx(ft,{className:"text-sm",children:"Views over time (by role)"})}),s.jsx(pt,{className:"h-64",children:r.isLoading?s.jsx(ce,{className:"h-full w-full"}):s.jsx(dJe,{rows:r.data??[],granularity:Mne(e.timeRange)})})]}),s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsxs(Be,{children:[s.jsx(ht,{className:"pb-2",children:s.jsx(ft,{className:"text-sm",children:"Top routes"})}),s.jsx(pt,{children:i.isLoading?s.jsx(ce,{className:"h-48 w-full"}):s.jsxs($l,{children:[s.jsx(Ll,{children:s.jsxs(Ir,{children:[s.jsx(lt,{children:"Route"}),s.jsx(lt,{className:"text-right",children:"Views"}),s.jsx(lt,{className:"text-right",children:"Users"}),s.jsx(lt,{className:"text-right",children:"Avg"}),s.jsx(lt,{className:"text-right",children:"Bnc%"})]})}),s.jsxs(Fl,{children:[(i.data??[]).map(c=>s.jsxs(Ir,{className:"cursor-pointer hover:bg-muted/60",onClick:()=>t(c.route_pattern),children:[s.jsx(st,{className:"font-mono text-xs",children:c.route_pattern}
857),s.jsx(st,{className:"text-right",children:c.views.toLocaleString()}),s.jsx(st,{className:"text-right",children:c.unique_users.toLocaleString()}),s.jsx(st,{className:"text-right text-xs",children:D_(c.avg_duration_seconds)}),s.jsxs(st,{className:"text-right text-xs",children:[c.bounce_pct.toFixed(0),"%"]})]},c.route_pattern)),(i.data??[]).length===0&&s.jsx(Ir,{children:s.jsx(st,{colSpan:5,className:"text-center text-muted-foreground py-6 text-sm",children:"No data"})})]})]})})]}),s.jsxs(Be,{children:[s.jsx(ht,{className:"pb-2",children:s.jsx(ft,{className:"text-sm",children:"Top search queries"})}),s.jsx(pt,{children:a.isLoading?s.jsx(ce,{className:"h-48 w-full"}):s.jsxs($l,{children:[s.jsx(Ll,{children:s.jsxs(Ir,{children:[s.jsx(lt,{children:"Query"}),s.jsx(lt,{className:"text-right",children:"Count"}),s.jsx(lt,{className:"text-right",children:"Last seen"})]})}),s.jsxs(Fl,{children:[(a.data??[]).map(c=>s.jsxs(Ir,{children:[s.jsxs(st,{className:"font-mono text-xs max-w-xs truncate",children:['"',c.search_query,'"']}),s.jsx(st,{className:"text-right",children:c.count.toLocaleString()}),s.jsx(st,{className:"text-right text-xs text-muted-foreground",children:rn(new Date(c.last_seen),"MMM d HH:mm")})]},c.search_query)),(a.data??[]).length===0&&s.jsx(Ir,{children:s.jsx(st,{colSpan:3,className:"text-center text-muted-foreground py-6 text-sm",children:"No searches yet"})})]})]})})]})]}),s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsxs(Be,{children:[s.jsx(ht,{className:"pb-2",children:s.jsx(ft,{className:"text-sm",children:"Role / auth mix"})}),s.jsx(pt,{className:"h-64",children:o.isLoading?s.jsx(ce,{className:"h-full w-full"}):s.jsx(hJe,{rows:o.data??[]})})]}),s.jsxs(Be,{children:[s.jsx(ht,{className:"pb-2",children:s.jsx(ft,{className:"text-sm",children:"Top countries"})}),s.jsx(pt,{children:l.isLoading?s.jsx(ce,{className:"h-48 w-full"}):s.jsx(fJe,{rows:l.data??[]})})]})]})]})}function uJe({data:e,isLoading:t}){const n=e?[{label:"Total views",value:e.total_views.toLocaleString()},{label:"Unique sessions",value:e.unique_sessions.toLocaleString()},{label:"Unique users",value:e.unique_users.toLocaleString()},{label:"Avg session",value:D_(e.avg_session_duration_seconds)},{label:"Bot %",value:`${e.bot_pct.toFixed(1)}%`},{label:"Impersonation %",value:`${e.impersonation_pct.toFixed(1)}%`}]:[];return s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:t||!e?[...Array(6)].map((r,i)=>s.jsx(ce,{className:"h-20 w-full"},i)):n.map(r=>s.jsx(Be,{children:s.jsxs(pt,{className:"p-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:r.label}),s.jsx("div",{className:"text-2xl font-semibold tabular-nums mt-1",children:r.value})]})},r.label))})}function dJe({rows:e,granularity:t}){const n=x.useMemo(()=>Array.from(new Set(e.map(i=>i.role))),[e]),r=x.useMemo(()=>{const i=new Map;for(const a of e){const o=a.bucket,l=i.get(o)??{bucket:o};l[a.role]=a.views,i.set(o,l)}return Array.from(i.values()).sort((a,o)=>String(a.bucket).localeCompare(String(o.bucket)))},[e]);return r.length===0?s.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No data"}):s.jsx(bb,{width:"100%",height:"100%",children:s.jsxs(m7e,{data:r,children:[s.jsx(Cb,{strokeDasharray:"3 3",opacity:.3}),s.jsx(lc,{dataKey:"bucket",tickFormatter:i=>rn(new Date(i),t==="hour"?"HH:mm":"MMM d"),fontSize:11}),s.jsx(cc,{fontSize:11}),s.jsx(ts,{labelFormatter:i=>rn(new Date(i),t==="hour"?"MMM d HH:mm":"MMM d")}),s.jsx(uu,{}),n.map(i=>s.jsx(Wu,{type:"monotone",dataKey:i,stackId:"1",stroke:iO[i]??"#999",fill:iO[i]??"#999",fillOpacity:.5},i))]})})}function hJe({rows:e}){return e.length===0?s.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No data"}):s.jsx(bb,{width:"100%",height:"100%",children:s.jsxs(p7e,{children:[s.jsx(oc,{data:e,dataKey:"views",nameKey:"role",cx:"50%",cy:"50%",innerRadius:48,outerRadius:80,paddingAngle:2,label:t=>`${t.role} ${((t.percent??0)*100).toFixed(0)}%`,labelLine:!1,children:e.map(t=>s.jsx(xg,{fill:iO[t.role]??"#999"},t.role))}),s.jsx(ts,{})]})})}function fJe({rows:e}){if(e.length===0)return s.jsx("div",{className:"text-sm text-muted-foreground py-6 text-center",children:"No data"});const t=e.reduce((n,r)=>n+r.views,0);return s.jsx("div",{className:"space-y-2",children:e.map(n=>{const r=t>0?100*n.views/t:0;return s.jsxs("div",{className:"grid grid-cols-[80px_1fr_60px] items-center gap-2 text-sm",children:[s.jsx("span",{className:"font-mono text-xs",children:n.country}),s.jsx("div",{className:"h-3 bg-muted rounded overflow-hidden",children:s.jsx("div",{className:"h-full bg-primary/70",style:{width:`${r}%`}})}),s.jsxs("span",{className:"text-xs text-muted-foreground text-right",children:[r.toFixed(1),"% ",s.jsxs("span",{className:"opacity-60",children:["· ",RM(n.country)]})]})]},n.country)})})}function dre({sessionId:e,onOpenChange:t,emailMap:n}){const{data:r=[],isLoading:i}=JXe(e),a=x.useMemo(()=>r.filter(c=>c.event_type!=="pageview").map(c=>({entity_type:c.al_entity_type,entity_id:c.al_entity_id})),[r]),{labelMap:o}=Dne(a),l=x.useMemo(()=>{var p,m;const c=r.find(g=>g.event_type==="pageview");if(!c||r.length===0)return null;const u=new Date(r[0].occurred_at),h=(new Date(r[r.length-1].occurred_at).getTime()-u.getTime())/1e3,f=((p=r.find(g=>
857g.event_type==="pageview"&&g.user_id))==null?void 0:p.user_id)??null;return{ip:c.pv_ip,userAgent:c.pv_user_agent,viewport:c.pv_viewport,locale:c.pv_locale,country:(m=r.find(g=>g.event_type==="pageview"&&g.pv_ip))!=null&&m.pv_ip?c.pv_ip:null,referrer:c.pv_referrer,userId:f,durationSec:h,eventCount:r.length,pageviewCount:r.filter(g=>g.event_type==="pageview").length}},[r]);return s.jsx(pb,{open:!!e,onOpenChange:t,children:s.jsxs(sg,{side:"right",className:"w-full sm:max-w-xl overflow-y-auto",children:[s.jsxs(uS,{children:[s.jsx(dS,{children:"Session timeline"}),e&&s.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:e})]}),!i&&l&&s.jsxs("div",{className:"mt-3 rounded border bg-muted/30 p-3 space-y-1.5 text-xs",children:[l.userId&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground w-16 shrink-0",children:"User"}),s.jsx("span",{className:"truncate",children:zl(l.userId,n)})]}),l.ip&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(SH,{className:"h-3 w-3 text-muted-foreground shrink-0"}),s.jsx("span",{className:"font-mono",children:l.ip}),(r.find(c=>c.event_type==="pageview"),null)]}),l.userAgent&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(TH,{className:"h-3 w-3 text-muted-foreground shrink-0"}),s.jsx("span",{className:"truncate",title:l.userAgent,children:l.userAgent.length>
85780?l.userAgent.slice(0,80)+"…":l.userAgent})]}),s.jsxs("div",{className:"flex flex-wrap gap-3 text-muted-foreground pt-1",children:[l.viewport&&s.jsxs("span",{children:["Viewport: ",l.viewport]}),l.locale&&s.jsxs("span",{children:["Locale: ",l.locale]}),s.jsxs("span",{children:["Duration: ",D_(l.durationSec)]}),s.jsxs("span",{children:[l.pageviewCount," pages · ",l.eventCount," events"]})]}),l.referrer&&s.jsxs("div",{className:"text-muted-foreground truncate pt-0.5",children:["Referrer: ",s.jsx("span",{className:"text-foreground",children:l.referrer})]})]}),s.jsx("div",{className:"mt-4 space-y-2",children:i?s.jsx("div",{className:"space-y-2",children:[...Array(6)].map((c,u)=>s.jsx(ce,{className:"h-14 w-full"},u))}):r.length===0?s.jsx("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"No events."}):s.jsx("ol",{className:"relative border-l border-border ml-3 space-y-3",children:r.map((c,u)=>s.jsx(pJe,{event:c,previous:u>0?r[u-1]:null,emailMap:n,entityLabelMap:o},`${c.occurred_at}-${u}`))})})]})})}function pJe({event:e,previous:t,emailMap:n,entityLabelMap:r}){const i=t?VQe(new Date(e.occurred_at),new Date(t.occurred_at)):null,a=e.user_id&&e.effective_user_id&&e.user_id!==e.effective_user_id;return s.jsxs("li",{className:"ml-4",children:[s.jsx("span",{className:`absolute -left-[9px] flex h-4 w-4 items-center justify-center rounded-full ${e.event_type==="pageview"?"bg-primary/20":"bg-amber-500/20"}`,children:e.event_type==="pageview"?s.jsx(ti,{className:"h-2.5 w-2.5 text-primary"}):s.jsx(DH,{className:"h-2.5 w-2.5 text-amber-600"})}),s.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-2",children:[s.jsx("span",{className:"font-mono",children:rn(new Date(e.occurred_at),"HH:mm:ss")}),i&&s.jsxs("span",{className:"opacity-60",children:["+",i]}),a&&s.jsx(pn,{variant:"outline",className:"h-4 text-[10px]",children:"impersonating"})]}),e.event_type==="pageview"?s.jsxs("div",{className:"text-sm",children:[s.jsx("div",{className:"font-mono truncate",children:e.pv_path}),s.jsxs("div",{className:"text-xs text-muted-foreground flex gap-3 flex-wrap",children:[e.pv_route_pattern&&s.jsx("span",{children:e.pv_route_pattern}),e.pv_search_query&&s.jsxs("span",{children:['q: "',e.pv_search_query,'"']}),e.pv_tab&&s.jsxs("span",{children:["tab: ",e.pv_tab]}),e.pv_duration_ms!=null&&s.jsxs("span",{children:[Math.round(e.pv_duration_ms/1e3),"s"]})]}),e.pv_referrer&&s.jsxs("div",{className:"text-[11px] text-muted-foreground truncate mt-0.5",children:["← ",e.pv_referrer]})]}):s.jsxs("div",{className:"text-sm",children:[s.jsxs("div",{children:[s.jsx("code",{className:"text-xs",children:e.al_action}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[" · ",e.al_entity_type]})]}),s.jsxs("div",{className:"text-xs text-muted-foreground truncate",children:[jM(e.al_entity_label,e.al_entity_type,e.al_entity_id,r),s.jsx("span",{className:"ml-2 opacity-60",children:zl(e.user_id,n,"system")})]})]})]})}const Z0=50;function mJe({filters:e}){const[t,n]=x.useState(0),[r,i]=x.useState(null),{data:a=[],isLoading:o}=ZXe(e,Z0+1,t*Z0),l=a.length>Z0,c=l?a.slice(0,Z0):a,u=e.excludeAnon?c.filter(f=>f.role!=="anon"):c,d=x.useMemo(()=>u.flatMap(f=>[f.user_id,f.effective_user_id]),[u]),{emailMap:h}=wM(d);return s.jsxs(s.Fragment,{children:[s.jsxs(Be,{children:[s.jsxs(ht,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(ft,{className:"text-sm",children:"Sessions"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["Page ",t+1," · ",u.length," row",u.length===1?"":"s"]})]}),s.jsxs(pt,{children:[o?s.jsx("div",{className:"space-y-2",children:[...Array(8)].map((f,p)=>s.jsx(ce,{className:"h-10 w-full"},p))}):u.length===0?s.jsx("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"No sessions match the current filters."}):s.jsxs($l,{children:[s.jsx(Ll,{children:s.jsxs(Ir,{children:[s.jsx(lt,{children:"Started"}),s.jsx(lt,{children:"User"}),s.jsx(lt,{children:"Role"}),s.jsx(lt,{className:"text-right",children:"Duration"}),s.jsx(lt,{className:"text-right",children:"Pages"}),s.jsx(lt,{className:"text-right",children:"Actions"}),s.jsx(lt,{children:"IP"}),s.jsx(lt,{children:"Country"}),s.jsx(lt,{children:"Flags"}),s.jsx(lt,{className:"w-8","aria-label":"Open"})]})}),s.jsx(Fl,{children:u.map(f=>s.jsx(gJe,{row:f,emailLabel:zl(f.user_id,h,"anon"),onOpen:()=>i(f.session_id)},f.session_id))})]}),s.jsxs("div",{className:"flex items-center justify-end gap-2 mt-3",children:[s.jsx(je,{variant:"outline",size:"sm",disabled:t===0,onClick:()=>n(f=>Math.max(0,f-1)),children:"Previous"}),s.jsx(je,{variant:"outline",size:"sm",disabled:!l,onClick:()=>n(f=>f+1),children:"Next"})]})]})]}),s.jsx(dre,{sessionId:r,onOpenChange:f=>!f&&i(null),emailMap:h})]})}function gJe({row:e,emailLabel:t,onOpen:n}){return s.jsxs(Ir,{className:"cursor-pointer hover:bg-muted/60 focus:bg-muted/60 group",tabIndex:0,role:"button",onClick:n,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),n())},children:[s.jsx(st,{className:"font-mono text-xs whitespace-nowrap",children:rn(new Date(e.started_at),"MMM d HH:mm:ss")}),s.jsx(st,{className:"text-xs max-w-[180px] truncate",children:t}),s.jsx(st,{className:"text-xs",children:e.role}),s.jsx(st,{className:"text-right text-xs tabular-nums",children:D_(e.duration_seconds)}),s.jsx(st,{className:"text-right text-xs tabular-nums",children:e.pages_count}),s.jsx(st,{className:"text-right text-xs tabular-nums",children:e.actions_count}),s.jsx(st,{className:"text-xs",children:e.first_ip?s.jsxs(ni,{children:[s.jsx(ri,{asChild:!0,children:s.jsx("span",{className:"font-mono curs
857or-help",children:e.first_ip})}),s.jsx(Kr,{side:"top",className:"max-w-sm",children:s.jsx("p",{className:"text-xs break-all",children:e.first_user_agent??"Unknown UA"})})]}):s.jsx("span",{className:"text-muted-foreground",children:"—"})}),s.jsx(st,{className:"text-xs",children:e.country?s.jsx("span",{title:RM(e.country),children:e.country}):s.jsx("span",{className:"text-muted-foreground",children:"—"})}),s.jsx(st,{className:"text-xs",children:s.jsxs("div",{className:"flex gap-1 flex-wrap",children:[e.is_bot&&s.jsx(pn,{variant:"secondary",className:"h-4 text-[10px]",children:"bot"}),e.was_impersonated&&s.jsx(pn,{variant:"outline",className:"h-4 text-[10px]",children:"impersonated"})]})}),s.jsx(st,{className:"w-8",children:s.jsx(Us,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 group-focus:opacity-100 transition-opacity"})})]})}const yJe=Object.values(Ve);function vJe({presetUserId:e}){const[t,n]=x.useState(()=>({...zZe,actorUserId:e??null})),[r,i]=x.useState(()=>({...Ao,userId:e??null})),[a,o]=x.useState(null),[l,c]=x.useState(null);x.useEffect(()=>{e&&(n(j=>({...j,actorUserId:e})),i(j=>({...j,userId:e})))},[e]);const{data:u}=BXe(),{data:d}=eZe(r),[h,f]=x.useState(!1);x.useEffect(()=>{!h&&(u!=null&&u.actions)&&(n(j=>({...j,actions:u.actions})),f(!0))},[u,h]);const p=x.useMemo(()=>{const{from:j,to:S}=VZe(t.timeRange),k=(u==null?void 0:u.actions)??[];return{entityTypes:t.entityTypes.length===yJe.length?void 0:t.entityTypes,actions:k.length>0&&t.actions.length===k.length||t.actions.length===0&&!h?void 0:t.actions,actorUserId:t.actorUserId??void 0,from:j,to:S,limit:200}},[t,u,h]),{data:m=[],isLoading:g}=zXe(p),y=x.useMemo(()=>[...m.flatMap(j=>[j.actor_user_id,j.effective_user_id]),...(u==null?void 0:u.actorIds)??[],...(d==null?void 0:d.user_ids)??[]],[m,u,d]),{emailMap:b}=wM(y),v=x.useMemo(()=>m.map(j=>({entity_type:j.entity_type,entity_id:j.entity_id})),[m]),{labelMap:w}=Dne(v),_=j=>o(j);return s.jsxs(s.Fragment,{children:[s.jsxs(mh,{defaultValue:"audit",children:[s.jsxs(ju,{children:[s.jsx(Er,{value:"audit",children:"Audit log"}),s.jsx(Er,{value:"pageviews",children:"Page views"})]}),s.jsx(pi,{value:"audit",children:s.jsxs(Be,{children:[s.jsxs(ht,{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(ft,{children:"Audit log"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[m.length," row",m.length===1?"":"s",m.length===200&&s.jsx(s.Fragment,{children:" (showing most recent)"})]})]}),s.jsx(BZe,{filters:t,onChange:n,actionOptions:(u==null?void 0:u.actions)??[],actorOptions:(u==null?void 0:u.actorIds)??[],emailMap:b})]}),s.jsx(pt,{children:g?s.jsx("div",{className:"space-y-2",children:[...Array(5)].map((j,S)=>s.jsx(ce,{className:"h-10 w-full"},S))}):m.length===0?s.jsx("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"No audit log entries match the current filters."}):s.jsxs($l,{children:[s.jsx(Ll,{children:s.jsxs(Ir,{children:[s.jsx(lt,{children:"Time"}),s.jsx(lt,{children:"Actor"}),s.jsx(lt,{children:"Action"}),s.jsx(lt,{children:"Entity"}),s.jsx(lt,{children:"Label"}),s.jsx(lt,{children:"Source"}),s.jsx(lt,{className:"w-8","aria-label":"Open"})]})}),s.jsx(Fl,{children:m.map(j=>s.jsxs(Ir,{tabIndex:0,role:"button","aria-label":`Open log: ${j.action} on ${j.entity_type}`,className:"cursor-pointer hover:bg-muted/60 focus:bg-muted/60 focus:outline-none transition-colors group",onClick:()=>_(j),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),_(j))},children:[s.jsx(st,{className:"font-mono text-xs",children:rn(new Date(j.created_at),"MMM d HH:mm:ss")}),s.jsxs(st,{className:"text-xs",children:[s.jsx("span",{children:zl(j.actor_user_id,b)}),j.effective_user_id&&j.effective_user_id!==j.actor_user_id&&s.jsxs(ni,{children:[s.jsx(ri,{asChild:!0,children:s.jsx(pn,{variant:"outline",className:"ml-1 cursor-help",children:"impersonating"})}),s.jsxs(Kr,{children:["as ",zl(j.effective_user_id,b)]})]})]}),s.jsx(st,{children:s.jsx("code",{className:"text-xs",children:j.action})}),s.jsx(st,{className:"text-xs",children:j.entity_type}),s.jsx(st,{className:"max-w-xs truncate",children:jM(j.entity_label,j.entity_type,j.entity_id,w)}),s.jsx(st,{children:s.jsx(pn,{variant:j.source==="edge_function"?"secondary":"default",children:j.source})}),s.jsx(st,{className:"w-8",children:s.jsx(Us,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 group-focus:opacity-100 transition-opacity"})})]},j.id))})]})})]})}),s.jsx(pi,{value:"pageviews",children:s.jsxs(Be,{children:[s.jsxs(ht,{className:"space-y-4",children:[s.jsx(ft,{children:"Page views"}),s.jsx(lJe,{filters:r,onChange:i,userOptions:(d==null?void 0:d.user_ids)??[],emailMap:b,countryOptions:(d==null?void 0:d.countries)??[]})]}),s.jsx(pt,{children:s.jsxs(mh,{defaultValue:"overview",children:[s.jsxs(ju,{children:[s.jsx(Er,{value:"overview",children:"Overview"}),s.jsx(Er,{value:"sessions",children:"Sessions"})]}),s.jsx(pi,{value:"overview",className:"mt-4",children:s.jsx(cJe,{filters:r,onSelectRoute:j=>i(S=>({...S,routePattern:j}))})}),s.jsx(pi,{value:"sessions",className:"mt-4",children:s.jsx(mJe,{filters:r})})]})})]})})]}),s.jsx(XZe,{log:a,logs:m,emailMap:b,entityLabelMap:w,onOpenChange:j=>!j&&o(null),onNavigate:_,onOpenSession:j=>{o(null),c(j)}}),s.jsx(dre,{sessionId:l,onOpenChange:j=>!j&&c(null),emailMap:b})]})}const hre=3e4,Tf=["agents","definitions"];function xJe(){return Se({queryKey:Tf,queryFn:async()=>{const{data:e,error:t}=await W.from("agent_definitions").select("*").order("display_name",{ascending:!0});if(t)throw t;return e??[]},refetchInterval:hre})}function bJe(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async({agentKey:r,enabled:i})=>{if(t("Toggling agent"))throw new Error("Impersonation mode");const{error:a}=await W.from("agent_definitions").update({enabled:i}).eq("agent_key",r);
857if(a)throw a;return{agentKey:r,enabled:i}},onMutate:async({agentKey:r,enabled:i})=>{await e.cancelQueries({queryKey:Tf});const a=e.getQueryData(Tf);return a&&e.setQueryData(Tf,a.map(o=>o.agent_key===r?{...o,enabled:i}:o)),{prev:a}},onError:(r,i,a)=>{a!=null&&a.prev&&e.setQueryData(Tf,a.prev)},onSuccess:async({agentKey:r,enabled:i})=>{await n({action:"agent_toggled",entityType:Ve.agentDefinitions,entityId:r,metadata:{agent_key:r,enabled:i}})},onSettled:()=>{e.invalidateQueries({queryKey:Tf})}})}function TV(e){return Se({queryKey:["agents","spend",e],queryFn:async()=>{const{data:t,error:n}=await W.from("agent_runs").select("agent_key, status, cost_usd, input_tokens, output_tokens, tool_calls, duration_ms").gte("created_at",e);if(n)throw n;const r=t??[],i={};for(const l of r){const c=l.agent_key;i[c]||(i[c]={cost:0,counts:{complete:0,failed:0,timed_out:0,running:0,queued:0,superseded:0},tokens:[],toolCalls:[],latencies:[]}),i[c].cost+=Number(l.cost_usd??0),i[c].counts[l.status]=(i[c].counts[l.status]??0)+1,l.input_tokens!=null&&l.output_tokens!=null&&i[c].tokens.push(Number(l.input_tokens)+Number(l.output_tokens)),l.tool_calls!=null&&i[c].toolCalls.push(Number(l.tool_calls)),l.duration_ms!=null&&i[c].latencies.push(Number(l.duration_ms))}const a=l=>{if(l.length===0)return null;const c=[...l].sort((d,h)=>d-h),u=Math.floor(c.length/2);return c.length%2===0?(c[u-1]+c[u])/2:c[u]},o={};for(const[l,c]of Object.entries(i))o[l]={agent_key:l,spend_usd:Math.round(c.cost*100)/100,run_counts:{complete:c.counts.complete??0,failed:c.counts.failed??0,timed_out:c.counts.timed_out??0,running:c.counts.running??0,queued:c.counts.queued??0},total_runs:Object.values(c.counts).reduce((u,d)=>u+d,0),median_tokens:a(c.tokens),median_tool_calls:a(c.toolCalls),median_latency_ms:a(c.latencies)};return o},refetchInterval:hre})}const wJe=3e4;function jJe(e){const t=Ae(),n=Se({queryKey:["agent-runs","list",e??null],queryFn:async()=>{let r=W.from("agent_runs").select("*");e!=null&&e.agent_key&&(r=r.eq("agent_key",e.agent_key)),e!=null&&e.status&&e.status.length>0&&(r=r.in("status",e.status)),e!=null&&e.sinceIso&&(r=r.gte("created_at",e.sinceIso)),e!=null&&e.untilIso&&(r=r.lt("created_at",e.untilIso)),r=r.order("created_at",{ascending:!1}).limit((e==null?void 0:e.limit)??100);const{data:i,error:a}=await r;if(a)throw a;return i??[]},refetchInterval:wJe});return x.useEffect(()=>{const r=W.channel("agent_runs_admin_page").on("postgres_changes",{event:"*",schema:"public",table:"agent_runs"},()=>{t.invalidateQueries({queryKey:["agent-runs"]})}).subscribe();return()=>{W.removeChannel(r)}},[t]),n}function _Je(){const e=Ae(),{guardMutation:t}=qe();return $e({mutationFn:async({agentKey:n,subjectType:r,subjectId:i})=>{if(t("Re-running agent"))throw new Error("Impersonation mode");const{data:a,error:o}=await W.functions.invoke("re-run-agent",{body:{agent_key:n,subject_type:r,subject_id:i}});if(o)throw o;if(a!=null&&a.error)throw new Error(a.error);return a},onSuccess:()=>{e.invalidateQueries({queryKey:["agent-runs"]})}})}const SJe=3e4;function kJe(e){return Se({queryKey:["agent-run-failures",e??null],queryFn:async()=>{let t=W.from("agent_run_failures").select("*");e!=null&&e.agent_key&&(t=t.eq("agent_key",e.agent_key)),t=t.order("created_at",{ascending:!1}).limit(100);const{data:n,error:r}=await t;if(r)throw r;return n??[]},refetchInterval:SJe})}function NJe(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async({failureId:r,agentKey:i})=>{if(t("Retrying DLQ entry"))throw new Error("Impersonation mode");const{data:a,error:o}=await W.functions.invoke("retry-agent-run-failure",{body:{failure_id:r}});if(o)throw o;if(a!=null&&a.error){const l=a.hint??a.error,c=new Error(l);throw c.code=a.error,c}return{...a,agentKey:i,failureId:r}},onSuccess:async({failureId:r,agentKey:i,run_id:a})=>{await n({action:"dlq_retried",entityType:Ve.agentRunFailures,entityId:r,metadata:{agent_key:i,new_run_id:a}}),e.invalidateQueries({queryKey:["agent-run-failures"]}),e.invalidateQueries({queryKey:["agent-runs"]})}})}var wk="Switch",[CJe,Fpt]=sr(wk),[AJe,TJe]=CJe(wk),fre=x.forwardRef((e,t)=>
857{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:l,value:c="on",onCheckedChange:u,form:d,...h}=e,[f,p]=x.useState(null),m=Ke(t,w=>p(w)),g=x.useRef(!1),y=f?d||!!f.closest("form"):!0,[b,v]=ji({prop:i,defaultProp:a??!1,onChange:u,caller:wk});return s.jsxs(AJe,{scope:n,checked:b,disabled:l,children:[s.jsx(Ne.button,{type:"button",role:"switch","aria-checked":b,"aria-required":o,"data-state":yre(b),"data-disabled":l?"":void 0,disabled:l,value:c,...h,ref:m,onClick:fe(e.onClick,w=>{v(_=>!_),y&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})}),y&&s.jsx(gre,{control:f,bubbles:!g.current,name:r,value:c,checked:b,required:o,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});fre.displayName=wk;var pre="SwitchThumb",mre=x.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=TJe(pre,n);return s.jsx(Ne.span,{"data-state":yre(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});mre.displayName=pre;var EJe="SwitchBubbleInput",gre=x.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{const o=x.useRef(null),l=Ke(o,a),c=gb(n),u=nb(t);return x.useEffect(()=>{const d=o.current;if(!d)return;const h=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&p){const m=new Event("click",{bubbles:r});p.call(d,n),d.dispatchEvent(m)}},[c,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});gre.displayName=EJe;function yre(e){return e?"checked":"unchecked"}var vre=fre,PJe=mre;const jk=x.forwardRef(({className:e,...t},n)=>s.jsx(vre,{className:ae("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:n,children:s.jsx(PJe,{className:ae("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")})}));jk.displayName=vre.displayName;const OJe={buyer_dd:pXe,supplier_dd:iXe};function IJe(e){const t=OJe[e.agent_key];return t?s.jsx(t,{run:e}):s.jsx(xM,{run:e})}function DM({tone:e,children:t}){const n={positive:{bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))",border:"hsl(var(--c-positive-border))"},warning:{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))",border:"hsl(var(--c-warning-border))"},negative:{bg:"hsl(var(--c-negative-soft))",fg:"hsl(var(--c-negative-fg))",border:"hsl(var(--c-negative-soft))"},neutral:{bg:"hsl(var(--c-surface))",fg:"hsl(var(--c-fg-muted))",border:"hsl(var(--c-border))"}}[e];return s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:5,padding:"3px 8px",borderRadius:4,fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:500,letterSpacing:"0.06em",textTransform:"uppercase",background:n.bg,color:n.fg,border:`1px solid ${n.border}`},children:t})}function pA({title:e,description:t,action:n,children:r}){return s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center",gap:16,flexWrap:"wrap"},children:[s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",children:e}),t&&s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:2},children:t})]}),n]}),r]})}function mA({label:e,err:t,onRetry:n}){return s.jsxs("div",{style:{padding:20,display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",background:"hsl(var(--c-negative-soft))",color:"hsl(var(--c-negative-fg))",borderTop:"1px solid hsl(var(--c-border))"},children:[s.jsx(ir,{size:14}),s.jsxs("span",{className:"tt-body-sm",children:["Failed to load ",e,": ",Qn(t,"unknown error"),"."]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:n,children:[s.jsx(ps,{size:11})," Retry"]})]})}const xre={queued:"neutral",running:"warning",complete:"positive",failed:"negative",timed_out:"negative",superseded:"neutral"};function MM(e){const t=Date.now()-new Date(e).getTime();if(t<6e4)return"just now";const n=Math.floor(t/6e4);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function EV(e){const t=Date.now(),n=new Date(t-(e==="24h"?24*60*60*1e3:e==="7d"?7*24*60*60*1e3:30*24*60*60*1e3));return{preset:e,sinceIso:n.toISOString(),label:e==="24h"?"Last 24 hours":e==="7d"?"Last 7 days":"Last 30 days"}}function RJe({run:e}){const t=e.input_tokens!=null||e.output_tokens!=null?(e.input_tokens??0)+(e.output_tokens??0):null,n=[{label:"cost",value:e.cost_usd!=null?`$${Number(e.cost_usd).toFixed(2)}`:"—"},{label:"duration",value:yk(e.duration_ms),title:e.started_at&&e.completed_at?`${e.started_at} → ${e.completed_at}`:void 0},{label:"tokens",value:xi(t),title:`in ${xi(e.input_tokens)} · out ${xi(e.output_tokens)}`},{label:"cache-read",value:xi(e.cache_read_tokens)},{label:"cache-create",value:xi(e.cache_creation_tokens)},{label:"tools",value:e.tool_calls!=null?String(e.tool_calls):"—"},{label:"turns",value:e.turn_count!=null?String(e.turn_count):"—"}];return s.jsxs("div",{style:{marginTop:8,marginBottom:12,padding:"10px 12px",border:"1px solid hsl(var(--c-border))",borderRadius:6,background:"hsl(var(--c-surface))",display:"flex",flexWrap:"wrap",gap:18},children:[n.map(r=>s.jsxs("div",{title:r.title,style:{display:"flex",flexDirection:"column",gap:1},children:[s.jsx("span",{className:"tt-mono-xs",style:{color:"hsl(var(--c-fg-subtle))",textTransform:"uppercase",letterSpacing:"0.06em"},children:r.label}),s.jsx("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-ink))"},children:r.value})]},r.label)),e.anthropic_session_id&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,marginLeft:"auto"},children:[s.jsx("span",{className:"tt-mono-xs",style:{color:"hsl(var(--c-fg-subtle))",textTransform:"uppercase",letterSpacing:"0.06em"},children:"session"}),s.jsxs("button",{type:"button",onClick:()=>{var r;e.anthropic_session_id&&((r=navigator.clipboard)==null||r.writeText(e.anthropic_session_id))},title:"Click to copy full session id",className:"tt-mono-sm",style:{background:"transparent",border:"none",padding:0,color:"hsl(var(--c-fg-muted))",cursor:"pointer",textAlign:"left"},children:[e.anthropic_session_id.slice(0,16),"…"]})]})]})}function DJe({agent:e,spend:t,todaySpendUsd:n}){const r=bJe(),{toast:i}=xt(),a=async c=>{try{await r.mutateAsync({agentKey:e.agent_key,enabled:c}),i({title:c?`${e.display_name} enabled`:`${e.display_name} disabled`,description:c?"New runs will be processed on the next worker tick.":"In-flight runs complete; new enqueues are refused."})}catch(u){i({title:"Toggle failed",description:Qn(u,"Could not flip agent state"),variant:"destructive"})}},o=n??0,l=Math.min(100,Math.round(o/Number(e.daily_spend_cap_usd)*100));return s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsx("div",{style:{fontWeight:600,color:"hsl(var(--c-ink))"},children:e.display_name}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:e.agent_key})]}),s.jsx("td",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-muted))"},children:e.agent_version}),s.jsx("td",{children:s.jsx(DM,{tone:"neutral",children:e.trigger_kind})}),s.jsxs("td",{style:{textAlign:"right"},children:[s.jsxs("div",{className:"tt-mono-sm",children:["$",o.toFixed(2)," ",s.jsxs("span",{style:{color:"hsl(var(--c-fg-subtle))"}
857,children:["/ $",Number(e.daily_spend_cap_usd).toFixed(2)]})]}),s.jsx("div",{style:{marginTop:4,height:4,borderRadius:2,background:"hsl(var(--c-surface))",overflow:"hidden"},title:`Today's spend vs daily cap. Window spend (${(t==null?void 0:t.spend_usd)!=null?`$${t.spend_usd.toFixed(2)}`:"$0.00"}) shown in the Runs section below.`,children:s.jsx("div",{style:{width:`${l}%`,height:"100%",background:l>80?"hsl(var(--c-warning-fg))":"hsl(var(--c-accent-fg))"}})})]}),s.jsxs("td",{style:{textAlign:"right"},children:[s.jsx("div",{style:{display:"inline-flex",gap:8,alignItems:"center",justifyContent:"flex-end"},children:(t==null?void 0:t.run_counts)&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{title:"complete",style:{color:"hsl(var(--c-positive-fg))"},children:[s.jsx(sn,{size:12,style:{verticalAlign:-2}})," ",t.run_counts.complete]}),s.jsxs("span",{title:"failed",style:{color:"hsl(var(--c-negative-fg))"},children:[s.jsx(gn,{size:12,style:{verticalAlign:-2}})," ",t.run_counts.failed+t.run_counts.timed_out]}),s.jsxs("span",{title:"running",style:{color:"hsl(var(--c-warning-fg))"},children:[s.jsx(Yn,{size:12,style:{verticalAlign:-2}})," ",t.run_counts.running]})]})}),t&&(t.median_tokens!=null||t.median_tool_calls!=null||t.median_latency_ms!=null)&&s.jsxs("div",{className:"tt-mono-xs",style:{marginTop:4,color:"hsl(var(--c-fg-subtle))"},title:"Median per completed run over the selected window",children:[t.median_tokens!=null&&s.jsxs(s.Fragment,{children:["median ~",xi(t.median_tokens)," tok"]}),t.median_tool_calls!=null&&s.jsxs(s.Fragment,{children:[" · ~",Math.round(t.median_tool_calls)," tools"]}),t.median_latency_ms!=null&&s.jsxs(s.Fragment,{children:[" · ~",yk(t.median_latency_ms)]})]})]}),s.jsx("td",{style:{textAlign:"right"},children:s.jsxs("div",{style:{display:"inline-flex",gap:8,alignItems:"center",justifyContent:"flex-end"},children:[s.jsx(jk,{checked:e.enabled,onCheckedChange:a,disabled:r.isPending,"aria-label":`Toggle ${e.display_name}`}),s.jsx("span",{className:"tt-mono-sm",style:{color:e.enabled?"hsl(var(--c-positive-fg))":"hsl(var(--c-fg-subtle))",minWidth:56},children:e.enabled?"enabled":"paused"})]})})]})}const gA=["queued","running","complete","failed","timed_out","superseded"];function MJe(){var y,b;const[e,t]=x.useState(()=>EV("7d")),[n,r]=x.useState(void 0),[i,a]=x.useState(new Set(gA)),[o,l]=x.useState(null),c=xJe(),u=TV(e.sinceIso),d=x.useMemo(()=>{const v=new Date;return v.setUTCHours(0,0,0,0),v.toISOString()},[]),h=TV(d),f=jJe({agent_key:n,status:i.size===gA.length?void 0:Array.from(i),sinceIso:e.sinceIso,untilIso:e.untilIso,limit:200}),p=kJe({agent_key:n}),m=x.useMemo(()=>{var v;return((v=f.data)==null?void 0:v.find(w=>w.id===o))??null},[f.data,o]),g=s.jsxs("div",{style:{display:"inline-flex",gap:6,alignItems:"center"},children:[["24h","7d","30d"].map(v=>s.jsx("button",{type:"button",className:`xph-btn xph-btn-sm ${e.preset===v?"xph-btn-primary":"xph-btn-outline"}`,onClick:()=>t(EV(v)),children:v==="24h"?"24h":v==="7d"?"7 days":"30 days"},v)),s.jsx("input",{type:"date",className:"xph-input",style:{height:28,fontSize:12,padding:"2px 6px"},value:e.preset==="custom"?e.sinceIso.slice(0,10):"",onChange:v=>{if(!v.target.value)return;const w=new Date(`${v.target.value}T00:00:00Z`).toISOString();t({preset:"custom",sinceIso:w,untilIso:e.untilIso,label:`From ${v.target.value}`})},"aria-label":"From date"}),s.jsx("span",{style:{color:"hsl(var(--c-fg-subtle))"},children:"→"}),s.jsx("input",{type:"date",className:"xph-input",style:{height:28,fontSize:12,padding:"2px 6px"},value:e.untilIso?e.untilIso.slice(0,10):"",onChange:v=>{const w=v.target.value?new Date(`${v.target.value}T23:59:59Z`).toISOString():void 0;t({preset:"custom",sinceIso:e.sinceIso,untilIso:w,label:w?`${e.sinceIso.slice(0,10)} → ${v.target.value}`:"Custom"})},"aria-label":"To date"})]});return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[s.jsx(pA,{title:"Agent registry",description:"Kill-switch + spend + recent activity for every framework-wired agent. Pause an agent to refuse new enqueues without a deploy.",action:g,children:c.isError?s.jsx(mA,{label:"agent registry",err:c.error,onRetry:()=>c.refetch()}):c.isLoading?s.jsxs("div",{style:{padding:20,display:"flex",alignItems:"center",gap:8,color:"hsl(var(--c-fg-muted))"},children:[s.jsx(ne,{size:14,className:"animate-spin"})," Loading agents…"]}):(c.data??[]).length===0?s.jsx("div",{style:{padding:48,textAlign:"center",color:"hsl(var(--c-fg-muted))"},children:"No agents registered yet. Run the registration migration for your first framework agent."}):s.jsx("div",{style:{overflow:"auto"},children:s.jsxs("table",{className:"xph-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Agent"}),s.jsx("th",{children:"Version"}),s.jsx("th",{children:"Trigger"}),s.jsx("th",{style:{textAlign:"right"},title:"Today's UTC-day spend / daily cap. Window aggregate is in the Runs section.",children:"Today / cap"}),s.jsx("th",{style:{textAlign:"right"},children:"Runs"}),s.jsx("th",{style:{textAlign:"right"},children:"State"})]})}
857),s.jsx("tbody",{children:c.data.map(v=>{var w,_,j;return s.jsx(DJe,{agent:v,spend:(w=u.data)==null?void 0:w[v.agent_key],todaySpendUsd:(j=(_=h.data)==null?void 0:_[v.agent_key])==null?void 0:j.spend_usd},v.agent_key)})})]})})}),s.jsx(pA,{title:"Runs",description:`Unified runs across every agent. ${((y=f.data)==null?void 0:y.length)??0} run${((b=f.data)==null?void 0:b.length)===1?"":"s"} in window.`,action:s.jsxs("div",{style:{display:"inline-flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[s.jsxs("select",{className:"xph-input",style:{height:28,fontSize:12,padding:"2px 6px"},value:n??"",onChange:v=>r(v.target.value||void 0),"aria-label":"Filter by agent",children:[s.jsx("option",{value:"",children:"All agents"}),(c.data??[]).map(v=>s.jsx("option",{value:v.agent_key,children:v.display_name},v.agent_key))]}),s.jsx("div",{style:{display:"inline-flex",gap:4},children:gA.map(v=>{const w=i.has(v);return s.jsx("button",{type:"button",onClick:()=>{a(_=>{const j=new Set(_);return j.has(v)?j.delete(v):j.add(v),j})},style:{padding:"3px 7px",fontSize:10.5,fontFamily:"var(--font-mono)",letterSpacing:"0.06em",textTransform:"uppercase",borderRadius:4,cursor:"pointer",background:w?"hsl(var(--c-accent-soft))":"hsl(var(--c-surface))",color:w?"hsl(var(--c-accent-fg))":"hsl(var(--c-fg-subtle))",border:`1px solid ${w?"hsl(var(--c-accent-border))":"hsl(var(--c-border))"}`},children:v.replace(/_/g," ")},v)})})]}),children:f.isError?s.jsx(mA,{label:"runs",err:f.error,onRetry:()=>f.refetch()}):f.isLoading?s.jsxs("div",{style:{padding:20,display:"flex",alignItems:"center",gap:8,color:"hsl(var(--c-fg-muted))"},children:[s.jsx(ne,{size:14,className:"animate-spin"})," Loading runs…"]}):(f.data??[]).length===0?s.jsx("div",{style:{padding:48,textAlign:"center",color:"hsl(var(--c-fg-muted))"},children:"No runs in this window."}):s.jsx("div",{style:{overflow:"auto"},children:s.jsxs("table",{className:"xph-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Agent"}),s.jsx("th",{children:"Subject"}),s.jsx("th",{children:"Status"}),s.jsx("th",{style:{textAlign:"right"},children:"Cost"}),s.jsx("th",{style:{textAlign:"right"},title:"input + output tokens",children:"Tokens"}),s.jsx("th",{style:{textAlign:"right"},title:"cache-read tokens (cheap reuse)",children:"Cache"}),s.jsx("th",{style:{textAlign:"right"},children:"Tools"}),s.jsx("th",{style:{textAlign:"right"},children:"Duration"}),s.jsx("th",{children:"Started"}),s.jsx("th",{style:{textAlign:"right"},children:"Actions"})]})}),s.jsx("tbody",{children:f.data.map(v=>{const w=v.input_tokens!=null||v.output_tokens!=null?(v.input_tokens??0)+(v.output_tokens??0):null;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-muted))"},children:v.agent_key})}),s.jsxs("td",{children:[s.jsx("div",{className:"tt-mono-sm",children:v.subject_type}),s.jsxs("div",{className:"tt-mono-xs",children:[v.subject_id.slice(0,8),"…"]})]}),s.jsx("td",{children:s.jsx(DM,{tone:xre[v.status],children:v.status.replace(/_/g," ")})}),s.jsx("td",{className:"tt-mono-sm",style:{textAlign:"right"},children:v.cost_usd!=null?`$${Number(v.cost_usd).toFixed(2)}`:"—"}),s.jsx("td",{className:"tt-mono-sm",style:{textAlign:"right"},title:v.input_tokens!=null||v.output_tokens!=null?`in ${xi(v.input_tokens)} · out ${xi(v.output_tokens)}`:void 0,children:xi(w)}),s.jsx("td",{className:"tt-mono-sm",style:{textAlign:"right",color:"hsl(var(--c-fg-muted))"},title:v.cache_creation_tokens!=null?`cache-create ${xi(v.cache_creation_tokens)}`:void 0,children:xi(v.cache_read_tokens)}),s.jsx("td",{className:"tt-mono-sm",style:{textAlign:"right"},children:v.tool_calls??"—"}),s.jsx("td",{className:"tt-mono-sm",style:{textAlign:"right",color:"hsl(var(--c-fg-muted))"},children:yk(v.duration_ms)}),s.jsx("td",{style:{color:"hsl(var(--c-fg-muted))",fontSize:12},children:MM(v.started_at??v.created_at)}),s.jsx("td",{style:{textAlign:"right"},children:s.jsxs("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:()=>l(v.id),children:["Open ",s.jsx(tc,{size:11})]})})]},v.id)})})]})})}),s.jsx(pA,{title:"Dead-letter queue",description:"Runs that never reached the agent (exhausted retries before creating a session). Retry replays the saved input payload.",children:p.isError?s.jsx(mA,{label:"DLQ",err:p.error,onRetry:()=>p.refetch()}):p.isLoading?s.jsxs("div",{style:{padding:20,display:"flex",alignItems:"center",gap:8,color:"hsl(var(--c-fg-muted))"},children:[s.jsx(ne,{size:14,className:"animate-spin"})," Loading DLQ…"]}):(p.data??[]).length===0?s.jsxs("div",{style:{padding:32,textAlign:"center",color:"hsl(var(--c-fg-muted))"},children:[s.jsx(sn,{size:20,style:{color:"hsl(var(--c-positive-fg))",marginBottom:4}}),s.jsx("div",{children:"No agent runs in DLQ."})]}):s.jsx("div",{style:{overflow:"auto"},children:s.jsxs("table",{className:"xph-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Agent"}),s.jsx("th",{children:"Subject"}),s.jsx("th",{children:"Error"}),s.jsx("th",{children:"Retries"}),s.jsx("th",{children:"When"}),s.jsx("th",{style:{textAlign:"right"},children:"Action"})]})}
857),s.jsx("tbody",{children:p.data.map(v=>s.jsx($Je,{failure:v},v.id))})]})})}),s.jsx(pb,{open:!!o,onOpenChange:v=>!v&&l(null),children:s.jsx(sg,{style:{overflowY:"auto",width:"min(720px, 100vw)",maxWidth:"min(720px, 100vw)"},children:m&&s.jsx(LJe,{run:m,onClose:()=>l(null)})})})]})}function $Je({failure:e}){const t=NJe(),{toast:n}=xt(),r=async()=>{try{const i=await t.mutateAsync({failureId:e.id,agentKey:e.agent_key});n({title:"Retry enqueued",description:`Run ${i.run_id.slice(0,8)}… is queued. Worker will pick it up on the next tick.`})}catch(i){const o=(i==null?void 0:i.code)==="run_in_progress";n({title:o?"Retry already in flight":"Retry failed",description:Qn(i,"Could not retry DLQ entry"),variant:o?"default":"destructive"})}};return s.jsxs("tr",{children:[s.jsx("td",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-muted))"},children:e.agent_key}),s.jsxs("td",{children:[s.jsx("div",{className:"tt-mono-sm",children:e.subject_type??"—"}),s.jsx("div",{className:"tt-mono-xs",children:e.subject_id?`${e.subject_id.slice(0,8)}…`:"—"})]}),s.jsx("td",{children:s.jsx("div",{style:{fontSize:12,color:"hsl(var(--c-negative-fg))",maxWidth:360,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e.error,children:e.error})}),s.jsx("td",{className:"tt-mono-sm",children:e.retry_count}),s.jsx("td",{style:{color:"hsl(var(--c-fg-muted))",fontSize:12},children:MM(e.created_at)}),s.jsx("td",{style:{textAlign:"right"},children:s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:r,disabled:t.isPending,children:[t.isPending?s.jsx(ne,{size:11,className:"animate-spin"}):s.jsx(ps,{size:11}),"Retry"]})})]})}function LJe({run:e,onClose:t}){const n=_Je(),{toast:r}=xt(),i=async()=>{try{const a=await n.mutateAsync({agentKey:e.agent_key,subjectType:e.subject_type,subjectId:e.subject_id});r({title:"Re-run enqueued",description:`Run ${a.run_id.slice(0,8)}… is queued. This run becomes superseded.`}),t()}catch(a){r({title:"Re-run failed",description:Qn(a,"Could not re-run agent"),variant:"destructive"})}};return s.jsxs(s.Fragment,{children:[s.jsxs(uS,{children:[s.jsx(dS,{children:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[s.jsx("span",{children:e.agent_key}),s.jsx(DM,{tone:xre[e.status],children:e.status.replace(/_/g," ")})]})}),s.jsxs("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:4},children:[e.subject_type," · ",e.subject_id]}),e.parent_run_id&&s.jsxs("div",{className:"tt-mono-xs",style:{color:"hsl(var(--c-fg-subtle))"},children:["re-run of ",e.parent_run_id.slice(0,8),"…"]})]}),s.jsxs("div",{style:{marginTop:16,marginBottom:12,display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:i,disabled:n.isPending||e.status==="queued"||e.status==="running",title:e.status==="queued"||e.status==="running"?"Cannot re-run while a run is in flight":void 0,children:[n.isPending?s.jsx(ne,{size:11,className:"animate-spin"}):s.jsx(ps,{size:11}),"Re-run"]}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:e.created_at&&s.jsxs("span",{children:["created ",MM(e.created_at)]})})]}),s.jsx(RJe,{run:e}),s.jsx("div",{style:{marginTop:8},children:IJe(e)})]})}const Vt={partnerEngagements:(e,t)=>["partner-engagements",e??null,t??null],supplierEngagements:(e,t)=>["supplier-engagements",e??null,t??null],engagement:(e,t)=>["engagement",e??null,t??null],engagementAssetNames:(e,t)=>["engagement-asset-names",e??null,t??null],engagementAssetTeasers:(e,t)=>["engagement-asset-teasers",e??null,t??null],partnerAssetDetails:(e,t)=>["partner-asset-details",e??null,t??null],engagementDocuments:(e,t)=>["engagement-documents",e??null,t??null],engagementOfLink:(e,t)=>["engagement-of-link",e??null,t??null],partnerAssetDocuments:(e,t)=>["partner-asset-documents",e??null,t??null],engagementClientAssets:(e,t)=>["engagement-client-assets",e??null,t??null],partnerOrgRoster:(e,t)=>["partner-org-roster",e??null,t??null],orgRoster:(e,t)=>["org-roster",e??null,t??null],orgInvitations:(e,t)=>["org-invitations",e??null,t??null]};function Lo(e,t="Something went wrong. Please try again."){if(e instanceof Error&&e.name===bre)return e.message;const n=e instanceof Error?e.message:String((e==null?void 0:e.message)??"");return n.includes("membership_not_found")?"Team member not found — they may have already been removed.":n.includes("cannot_remove_owner")?"The organization owner cannot be removed.":n.includes("cannot_change_owner_role")?"The organization owner's role cannot be changed.":n.includes("invalid_role")?"That role is not val
857id.":n.includes("forbidden")?"You do not have permission to manage this team.":Qn(e,t)}const bre="EdgeFunctionError";async function $M(e){let t=null;try{const r=e.context;r&&typeof r.json=="function"&&(t=await r.json())}catch{}const n=(t==null?void 0:t.message)||(t==null?void 0:t.error);if(n){const r=new Error(n);return r.name=bre,r}return e instanceof Error?e:new Error(Qn(e))}function wre(e){const{user:t}=me();return Se({queryKey:Vt.orgRoster(t==null?void 0:t.id,e),queryFn:async()=>{if(!e)return[];const{data:n,error:r}=await W.rpc("get_org_roster",{_org_id:e});if(r)throw r;return(n||[]).map(i=>({membershipId:i.membership_id,memberUserId:i.member_user_id,orgRole:i.org_role,status:i.status,joinedAt:i.joined_at,displayName:i.display_name??i.email??"Pending member",email:i.email??""}))},enabled:!!t&&!!e})}const FJe="id, org_id, email, full_name, invited_role, expires_at, status, invited_by, accepted_user_id, created_at, updated_at";function jre(e,t={}){const{user:n}=me(),{enabled:r=!0}=t;return Se({queryKey:Vt.orgInvitations(n==null?void 0:n.id,e),queryFn:async()=>{if(!e)return[];const{data:i,error:a}=await W.from("org_invitations").select(FJe).eq("org_id",e).order("created_at",{ascending:!1});if(a)throw a;return(i||[]).map(o=>({id:o.id,orgId:o.org_id,email:o.email,fullName:o.full_name,invitedRole:o.invited_role,expiresAt:o.expires_at,status:o.status,invitedBy:o.invited_by,acceptedUserId:o.accepted_user_id,createdAt:o.created_at,updatedAt:o.updated_at}))},enabled:!!n&&!!e&&r})}function zJe(){const e=Ae(),{guardMutation:t}=qe();return $e({mutationFn:async n=>{if(t("Inviting a team member"))throw new Error("Impersonation mode");const{data:r,error:i}=await W.functions.invoke("invite-org-member",{body:{orgId:n.orgId,email:n.email,fullName:n.fullName||void 0,invitedRole:n.invitedRole}});if(i)throw await $M(i);return{...r,...n}},onSuccess:({orgId:n})=>{e.invalidateQueries({queryKey:["org-invitations"]}),e.invalidateQueries({queryKey:["org-roster"]}),e.invalidateQueries({queryKey:["partner-org-roster"]})}})}function _re(){const e=Ae(),{guardMutation:t}=qe();return $e({mutationFn:async({invitationId:n,orgId:r,email:i})=>{if(t("Resending an invitation"))throw new Error("Impersonation mode");const{data:a,error:o}=await W.functions.invoke("invite-org-member",{body:{invitationId:n,resend:!0}});if(o)throw await $M(o);return{...a,invitationId:n,orgId:r,email:i}},onSuccess:({orgId:n})=>{e.invalidateQueries({queryKey:["org-invitations"]}),e.invalidateQueries({queryKey:["org-roster"]}),e.invalidateQueries({queryKey:["partner-org-roster"]})}})}function Sre(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async({invitationId:r,orgId:i,email:a})=>{if(t("Revoking an invitation"))throw new Error("Impersonation mode");const{error:o}=await W.from("org_invitations").update({status:"revoked"}).eq("id",r);if(o)throw o;return{invitationId:r,orgId:i,email:a}},onSuccess:({invitationId:r,orgId:i,email:a})=>{e.invalidateQueries({queryKey:["org-invitations"]}),n({action:"revoke_org_invite",entityType:Ve.orgInvitations,entityId:r,entityLabel:a,metadata:{org_id:i}})}})}function BJe(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async({membershipId:r,orgId:i,memberName:a})=>{if(t("Removing a team member"))throw new Error("Impersonation mode");const{error:o}=await W.rpc("remove_org_member",{_membership_id:r});if(o)throw o;return{membershipId:r,orgId:i,memberName:a}},onSuccess:({membershipId:r,orgId:i,memberName:a})=>{e.invalidateQueries({queryKey:["org-roster"]}),n({action:"remove_org_member",entityType:Ve.buyerUsers,entityId:r,entityLabel:a,metadata:{org_id:i}})}})}function VJe(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async({membershipId:r,newRole:i,orgId:a,memberName:o})=>{if(t("Changing a member role"))throw new Error("Impersonation mode");const{error:l}=await W.rpc("set_org_member_role",{_membership_id:r,_new_role:i});if(l)throw l;return{membershipId:r,newRole:i,orgId:a,memberName:o}},onSuccess:({membershipId:r,newRole:i,orgId:a,memberName:o})=>{e.invalidateQueries({queryKey:["org-roster"]}),n({action:"set_org_member_role",entityType:Ve.buyerUsers,entityId:r,entityLabel:o,metadata:{org_id:a,new_role:i}})}})}function _k(e){return e==="linked"||e==="linked_email_failed"}function sO(e){return e==="linked_email_failed"||e==="invited_email_failed"}const kre=Gs({accountType:Yd(["supplier","buyer","partner"]),mode:Yd(["new","existing"]),setupId:ut().uuid().optional(),targetId:ut().uuid().optional(),email:ut().trim().email("Enter a valid email address"),fullName:ut().trim().max(120).optional(),orgName:ut().trim().max(160).optional(),location:ut().trim().max(120).optional(),websiteUrl:ut().trim().url("Enter a full URL (https://…)").optional().or(Lw("")),agreementSignedAt:ut().date("Enter a valid agreement date").optional(),invitedRole:Yd(["admin","member"])}).superRefine((e,t)=>
857{e.mode==="new"&&(!e.orgName||e.orgName.length<2)&&t.addIssue({code:"custom",message:"Enter the organization name"}),e.mode==="new"&&!e.setupId&&t.addIssue({code:"custom",message:"A setup ID is required"}),e.mode==="existing"&&!e.targetId&&t.addIssue({code:"custom",message:"Choose which organization this person joins"})}),WJe=Gs({status:Yd(["linked","invited","linked_email_failed","invited_email_failed","created_email_failed"]),orgId:ut().optional(),supplierId:ut().optional()}),LM=e=>`xpharma:pending-account-setup:${e}`;function UJe(e){try{const t=sessionStorage.getItem(LM(e));if(!t)return null;const n=kre.safeParse(JSON.parse(t));return n.success?n.data:null}catch{return null}}function qJe(e,t){sessionStorage.setItem(LM(e),JSON.stringify(t))}function PV(e){sessionStorage.removeItem(LM(e))}const OV={supplier:"Supplier",buyer:"Buyer",partner:"Solution partner"};function HJe(e){const{user:t}=me();return t?s.jsx(KJe,{...e,userId:t.id},t.id):null}function KJe({open:e,onOpenChange:t,userId:n}){const[r]=x.useState(()=>UJe(n)),[i,a]=x.useState(r),o=x.useRef(!1),l=x.useRef(!0);x.useLayoutEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);const{toast:c}=xt(),u=Ae(),[d,h]=x.useState((r==null?void 0:r.accountType)??"supplier"),[f,p]=x.useState((r==null?void 0:r.mode)??"new"),m=d==="partner"&&f==="new",[g,y]=x.useState((r==null?void 0:r.targetId)??""),[b,v]=x.useState((r==null?void 0:r.invitedRole)??"admin"),[w,_]=x.useState({email:(r==null?void 0:r.email)??"",fullName:(r==null?void 0:r.fullName)??"",orgName:(r==null?void 0:r.orgName)??"",location:(r==null?void 0:r.location)??"",websiteUrl:(r==null?void 0:r.websiteUrl)??"",agreementSignedAt:(r==null?void 0:r.agreementSignedAt)??""}),[j,S]=x.useState(null),k=F=>B=>{_(P=>({...P,[F]:B.target.value})),S(null)},{data:N=[],isLoading:T}=Se({queryKey:["admin-account-targets",d],enabled:e&&f==="existing",queryFn:async()=>{if(d==="supplier"){const{data:P,error:I}=await W.from("suppliers").select("id, name").order("name");if(I)throw I;return P??[]}const{data:F,error:B}=await W.from("organizations").select("id, name").eq("org_type",d).eq("status","approved").order("name");if(B)throw B;return F??[]}}),C=x.useMemo(()=>N.filter(F=>F.id&&F.name),[N]),A=()=>{PV(n),a(null),_({email:"",fullName:"",orgName:"",location:"",websiteUrl:"",agreementSignedAt:""}),y(""),S(null)},O=$e({mutationFn:async F=>{const{data:B,error:P}=await W.functions.invoke("admin-invite-account",{body:F});if(P)throw await $M(P);if(B!=null&&B.error)throw new Error(B.error);const I=WJe.safeParse(B);if(!I.success)throw new Error("The setup response was incomplete. Retry to finish the same setup.");return I.data},onSuccess:(F,B)=>{if(!l.current)return;u.invalidateQueries({queryKey:["org-directory"]}
857),u.invalidateQueries({queryKey:["solution-partners"]}),u.invalidateQueries({queryKey:["suppliers"]}),u.invalidateQueries({queryKey:["admin-account-targets"]}),u.invalidateQueries({queryKey:["org-invitations"]}),u.invalidateQueries({queryKey:["supplier-personnel"]});const P=F.status==="created_email_failed"?"invited_email_failed":F.status;if(_k(P))c({title:"Existing account linked",description:sO(P)?`${B.email} now has access, but the notification email could not be delivered.`:`${B.email} already had an account and now has access.`});else if(sO(P)){S("The invitation was saved, but the email could not be delivered. Retry the invitation to finish this setup.");return}else c({title:"Invitation sent",description:`${B.email} was emailed a link to finish setting up their account.`});A(),t(!1)},onError:F=>{if(l.current){if(F instanceof Bi){S(F.errors[0].message);return}S(F instanceof Error?F.message:"Could not set up this account.")}},onSettled:()=>{o.current=!1}}),z=()=>{if(!o.current)try{const F=i??kre.parse({accountType:d,mode:f,setupId:f==="new"?crypto.randomUUID():void 0,targetId:f==="existing"&&g||void 0,...w,agreementSignedAt:m&&w.agreementSignedAt||void 0,invitedRole:f==="new"?"admin":b});qJe(n,F),a(F),S(null),o.current=!0,O.mutate(F)}catch(F){S(F instanceof Bi?F.errors[0].message:"Could not save this setup for retry. Please try again.")}},$=()=>{o.current||(i||A(),t(!1))};return s.jsx(Br,{open:e,onOpenChange:F=>{F?t(!0):$()},children:s.jsxs(br,{style:{maxWidth:480},children:[s.jsxs(wr,{children:[s.jsx(jr,{children:"Set up an account"}),s.jsx(So,{children:m?"Creates the approved partner organization and emails its owner an invitation to the partner portal. Run this only after the partner agreement is signed.":"Creates the company (if new) and emails an invitation. The person sets their own password — access is granted straight away, with no approval queue."})]}),i&&s.jsxs("div",{children:[s.jsx("p",{className:"tt-body-sm",children:"This setup is saved. Retry to finish it using the same organization. Closing this dialog keeps it available to resume."}),s.jsx(je,{variant:"link",disabled:O.isPending,onClick:()=>{o.current||(PV(n),a(null),p("existing"),y(i.targetId??i.setupId??""),S(null))},children:"Continue with an existing organization"})]}),s.jsxs("fieldset",{disabled:!!i||O.isPending,style:{display:"flex",flexDirection:"column",gap:12,minWidth:0},children:[s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"acct-type",children:"Account type"}),s.jsxs($n,{disabled:!!i||O.isPending,value:d,onValueChange:F=>{h(F),y("")},children:[s.jsx(On,{id:"acct-type",children:s.jsx(Ln,{})}),s.jsx(In,{children:Object.keys(OV).map(F=>s.jsx(Rt,{value:F,children:OV[F]},F))})]})]}),s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"acct-mode",children:"Organization"}),s.jsxs($n,{disabled:!!i||O.isPending,value:f,onValueChange:F=>{p(F),y("")},children:[s.jsx(On,{id:"acct-mode",children:s.jsx(Ln,{})}),s.jsxs(In,{children:[s.jsx(Rt,{value:"new",children:"Create new"}),s.jsx(Rt,{value:"existing",children:"Add to existing"})]})]})]})]}),f==="existing"?s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"acct-target",children:"Which organization"}),s.jsxs($n,{disabled:!!i||O.isPending,value:g,onValueChange:y,children:[s.jsx(On,{id:"acct-target",children:s.jsx(Ln,{placeholder:T?"Loading…":"Select organization"})}),s.jsx(In,{children:C.map(F=>s.jsx(Rt,{value:F.id,children:F.name},F.id))})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"acct-org-name",children:d==="supplier"?"Company name":d==="buyer"?"Buyer organization name":"Firm name"}),s.jsx(Fe,{id:"acct-org-name",value:w.orgName,onChange:k("orgName"),placeholder:"Acme Therapeutics"})]}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"acct-location",children:"Location (optional)"}),s.jsx(Fe,{id:"acct-location",value:w.location,onChange:k("location"),placeholder:"Boston, USA"})]}),s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"acct-website",children:"Website (
857optional)"}),s.jsx(Fe,{id:"acct-website",value:w.websiteUrl,onChange:k("websiteUrl"),placeholder:"https://acme.com"})]})]}),m&&s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"acct-agreement",children:"Agreement signed (optional)"}),s.jsx(Fe,{id:"acct-agreement",type:"date",value:w.agreementSignedAt,onChange:k("agreementSignedAt")})]})]}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"acct-email",children:m?"Owner email":"Their email"}),s.jsx(Fe,{id:"acct-email",type:"email",value:w.email,onChange:k("email"),placeholder:"[email protected]"})]}),s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"acct-name",children:m?"Owner name (optional)":"Their name (optional)"}),s.jsx(Fe,{id:"acct-name",value:w.fullName,onChange:k("fullName")})]})]}),f==="existing"&&s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"acct-role",children:"Role in the organization"}),s.jsxs($n,{disabled:!!i||O.isPending,value:b,onValueChange:F=>v(F),children:[s.jsx(On,{id:"acct-role",children:s.jsx(Ln,{})}),s.jsxs(In,{children:[s.jsx(Rt,{value:"admin",children:"Admin — can manage the team"}),s.jsx(Rt,{value:"member",children:"Member"})]})]})]})]}),j&&s.jsx("p",{role:"alert",className:"tt-body-sm",style:{color:"hsl(var(--c-negative-fg))"},children:j}),s.jsxs(_i,{children:[s.jsx(je,{variant:"outline",onClick:$,disabled:O.isPending,children:i?"Close":"Cancel"}),s.jsxs(je,{onClick:z,disabled:O.isPending,children:[O.isPending&&s.jsx(ne,{className:"animate-spin",size:14}),i?"Retry invitation":m?"Create & invite owner":"Send invitation"]})]})]})})}function yA(e){const t=e.filter(n=>!!n);return t.length===0?null:t.reduce((n,r)=>n<=r?n:r)}function GJe(e){return e.length===0||e.includes("approved")?"approved":e.includes("pending")?"pending":"rejected"}function e_(e,t,n){return{membershipId:e.id,userId:e.userId,email:t,role:n,status:e.status,signupDate:e.createdAt,approvalDate:e.approvedAt,rejectionDate:e.rejectedAt}}function Nre(e,t){return e.createdAt<t.createdAt?-1:e.createdAt>t.createdAt?1:0}function YJe(e){const{suppliers:t,supplierUsers:n,emailByUserId:r,supplierAssetCounts:i}=e,a=e.supplierOnboardingIdBySupplierId??{},o=h=>r[h]??null,l=new Set(t.map(h=>h.id)),c=new Map,u=[];for(const h of n)if(h.supplierId&&l.has(h.supplierId)){const f=c.get(h.supplierId)??[];f.push(h),c.set(h.supplierId,f)}else u.push(h);const d=t.map(h=>{const f=(c.get(h.id)??[]).slice().sort(Nre),p=i[h.id]??{published:0,draft:0},m=GJe(f.map(g=>g.status));return{kind:"supplier",orgId:h.id,name:h.name,location:h.location,status:m,verified:h.verified,primaryEmail:f[0]?o(f[0].userId):null,memberCount:f.length,signupDate:yA(f.map(g=>g.createdAt))??h.createdAt,approvalDate:yA(f.map(g=>g.approvedAt)),rejectionDate:m==="rejected"?yA(f.map(g=>g.rejectedAt)):null,publishedAssets:p.published,draftAssets:p.draft,supplierOnboardingId:a[h.id]??null,members:f.map(g=>e_(g,o(g.userId),null))}});for(const h of u)d.push({kind:"supplier",orgId:`pending:supplier:${h.id}`,name:h.pendingCompanyName??"Unknown supplier",location:h.pendingCompanyLocation,status:h.status,verified:!1,primaryEmail:o(h.userId),memberCount:1,signupDate:h.createdAt,approvalDate:h.approvedAt,rejectionDate:h.rejectedAt,publishedAssets:0,draftAssets:0,supplierOnboardingId:null,members:[e_(h,o(h.userId),null)]});return d}function QJe(e){const{organizations:t,buyerUsers:n,emailByUserId:r}=e,i=u=>r[u]??null,a=new Map,o=[],l=new Set(t.map(u=>u.id));for(const u of n)if(u.orgId&&l.has(u.orgId)){const d=a.get(u.orgId)??[];d.push(u),a.set(u.orgId,d)}else o.push(u);const c=t.map(u=>{const d=(a.get(u.id)??[]).slice().sort(Nre),h=d.find(f=>f.orgRole==="owner")??d[0];return{kind:"buyer",orgId:u.id,name:u.name,location:u.location,status:u.status,verified:null,primaryEmail:h?i(h.userId):null,memberCount:d.length,signupDate:u.createdAt,approvalDate:u.approvedAt,rejectionDate:u.rejectedAt,publishedAssets:null,draftAssets:null,members:d.map(f=>e_(f,i(f.userId),f.orgRole))}});for(const u of o)c.push({kind:"buyer",orgId:`pending:buyer:${u.id}`,name:u.pendingCompanyName??"Unknown buyer",location:u.pendingCompanyLocation,status:u.status,verified:null,primaryEmail:i(u.userId),memberCount:1,signupDate:u.createdAt,approvalDate:u.approvedAt,rejectionDate:u.rejectedAt,publishedAssets:null,draftAssets:null,members:[e_(u,i(u.userId),u.orgRole)]});return c}function XJe(e){return[...YJe(e),...QJe(e)].sort((n,r)=>n.signupDate<r.signupDate?1:n.signupDate>r.signupDate?-1:0)}const ZJe=["pending","approved","rejected"];function IV(e){return ZJe.includes(e)?e:"pending"}function Cre(e){return e.kind!=="supplier"||e.verified===null?"na":e.verified?"yes":"no"}function Are(e){const t=Cre(e);return t==="na"?"—":t==="yes"?"Yes":"No"}function JJe(e,t){const n=t.query.trim().toLowerCase(),r=i=>{var a,o;return!n||i.name.toLowerCase().includes(n)||(a=i.location)!=null&&a.toLowerCase().includes(n)||(o=i.primaryEmail)!=null&&o.toLowerCase().includes(n)?!0:i.members.some(l=>{var c;return(c=l.email)==null?void 0:c.toLowerCase().includes(n)})};return e.filter(i=>r(i)&&(t.kinds.length===0||t.kinds.includes(i.kind))&&(t.statuses.length===0||t.statuses.includes(i.status))&&(t.verified.length===0||t.verified.includes(Cre(i))))}function eet(e,t,n,r){const i=e[n],a=t[n];if(i===null&&a===null)return 0;if(i===null)return 1;if(a===null)return-1;const o=r==="asc"?1:-1;return typeof i=="number"&&typeof a=="number"?(i-a)*o:typeof i=="boolean"&&typeof a=="boolean"?(i===a?0:i?-1:1)*o:String(i).localeCompare(String(a))*
857o}function tet(e,t,n){return e.slice().sort((r,i)=>eet(r,i,t,n))}function net(e,t){return{headers:["Type","Organization","Primary email","Location","Status","Verified","Members","Published assets","Draft assets","Signup date","Approval date","Rejection date"],rows:e.map(r=>[r.kind,r.name,r.primaryEmail??"",r.location??"",r.status,Are(r),r.memberCount,r.publishedAssets??"",r.draftAssets??"",t(r.signupDate),t(r.approvalDate),t(r.rejectionDate)])}}function ret(e,t){return{headers:["Type","Organization","Org status","Member email","Role","Member status","Signup date","Approval date","Rejection date"],rows:e.flatMap(r=>r.members.map(i=>[r.kind,r.name,r.status,i.email??"",i.role??"",i.status,t(i.signupDate),t(i.approvalDate),t(i.rejectionDate)]))}}function Tre(){const{isAdmin:e}=me();return Se({queryKey:["org-directory"],enabled:e,queryFn:async()=>{var y;const[t,n,r,i,a,o]=await Promise.all([W.from("suppliers").select("*"),W.from("supplier_users").select("*"),W.from("organizations").select("*").eq("org_type","buyer"),W.from("buyer_users").select("*"),W.from("pharma_assets").select("supplier_id, asset_status"),W.from("supplier_onboarding").select("id, supplier_id")]);for(const b of[t,n,r,i,a,o])if(b.error)throw b.error;const l=t.data??[],c=n.data??[],u=i.data??[],d=(r.data??[]).map(Zv).filter(b=>b!==null),h=Array.from(new Set([...c.map(b=>b.user_id),...u.map(b=>b.user_id)])),f={};if(h.length>0){const{data:b,error:v}=await W.from("profiles").select("user_id, email").in("user_id",h);if(v)throw v;for(const w of b??[])w.email&&(f[w.user_id]=w.email)}const p={};for(const b of a.data??[]){if(!b.supplier_id)continue;const v=p[y=b.supplier_id]??(p[y]={published:0,draft:0});b.asset_status==="published"?v.published++:v.draft++}const m={};for(const b of o.data??[])b.supplier_id&&(m[b.supplier_id]=b.id);const g={suppliers:l.map(b=>({id:b.id,name:b.name,location:b.location,verified:b.verified,createdAt:b.created_at})),supplierUsers:c.map(b=>({id:b.id,userId:b.user_id,supplierId:b.supplier_id,status:IV(b.status),pendingCompanyName:b.pending_company_name,pendingCompanyLocation:b.pending_company_location,createdAt:b.created_at,approvedAt:b.approved_at??null,rejectedAt:b.rejected_at??null})),organizations:d,buyerUsers:u.map(b=>({id:b.id,userId:b.user_id,orgId:b.org_id,orgRole:b.org_role,status:IV(b.status),pendingCompanyName:b.pending_company_name,pendingCompanyLocation:b.pending_company_location,createdAt:b.created_at,approvedAt:b.approved_at??null,rejectedAt:b.rejected_at??null})),emailByUserId:f,supplierAssetCounts:p,supplierOnboardingIdBySupplierId:m};return XJe(g)}})}function iet(e){if(e==null)return"";const t=String(e);return/[",\r\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function set(e,t){return"\uFEFF"+[e,...t].map(r=>r.map(iet).join(",")).join(`\r
858`)}function aet(e,t,n){const r=set(t,n),i=new Blob([r],{type:"text/csv;charset=utf-8;"}),a=URL.createObjectURL(i),o=document.createElement("a");o.href=a,o.download=e.endsWith(".csv")?e:`${e}.csv`,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)}const zw={approved:"positive",pending:"warning",rejected:"negative",suspended:"neutral"},oet={positive:{bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))",border:"hsl(var(--c-positive-border))"},warning:{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))",border:"hsl(var(--c-warning-border))"},negative:{bg:"hsl(var(--c-negative-soft))",fg:"hsl(var(--c-negative-fg))",border:"hsl(var(--c-negative-border))"},neutral:{bg:"hsl(var(--c-surface))",fg:"hsl(var(--c-fg-muted))",border:"hsl(var(--c-border))"}};function Bw({tone:e,children:t}){const n=oet[e];return s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:5,padding:"3px 8px",borderRadius:4,fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:500,letterSpacing:"0.06em",textTransform:"uppercase",background:n.bg,color:n.fg,border:`1px solid ${n.border}`,whiteSpace:"nowrap"},children:t})}function RV({kind:e}){const t=e==="supplier";return s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-fg-muted))"},children:[t?s.jsx(pr,{size:12}):s.jsx(Vp,{size:12}),t?"Supplier":"Buyer"]})}const Ha=e=>e?new Date(e).toLocaleDateString():"—",Wn={color:"hsl(var(--c-fg-muted))"},Cy={fontFamily:"var(--font-mono)",fontSize:12};function aa({label:e,col:t,sort:n,onSort:r,align:i="left"}){const a=n.key===t;return s.jsx("th",{role:"button",tabIndex:0,"aria-sort":a?n.dir==="asc"?"ascending":"descending":"none",style:{textAlign:i,cursor:"pointer",userSelect:"none",whiteSpace:"nowrap"},onClick:()=>r(t),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),r(t))},children:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,flexDirection:i==="right"?"row-reverse":"row"},children:[e,a?n.dir==="asc"?s.jsx(jde,{size:11}):s.jsx(xde,{size:11}):s.jsx(wde,{size:11,style:{opacity:.35}})]})})}function Vw({open:e,onClick:t,label:n="DD"}){return s.jsxs("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:r=>{r.stopPropagation(),t()},style:{gap:4,padding:"2px 6px",fontSize:11},"aria-expanded":e,"aria-label":`${e?"Hide":"Show"} ${n} dossier`,children:[s.jsx(Cn,{size:11}),n,e?s.jsx(Ta,{size:11}):s.jsx(Us,{size:11})]})}function Ere({kind:e,membershipId:t}){return s.jsx("div",{style:{padding:"4px 0"},children:e==="buyer"?s.jsx(Tne,{buyerUserId:t,expanded:!0}):s.jsx(Nne,{supplierUserId:t,expanded:!0})})}function cet({row:e,ddOpen:t,toggleDD:n}){return s.jsxs("table",{className:"xph-table",style:{background:"hsl(var(--c-surface))"},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Member email"}),s.jsx("th",{children:"Role"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Signup"}),s.jsx("th",{children:"Approved"}),s.jsx("th",{children:"Rejected"}),s.jsx("th",{style:{width:90,textAlign:"right"},children:"Dossier"})]})}),s.jsxs("tbody",{children:[e.members.map(r=>{const i=t.has(r.membershipId);return s.jsxs(x.Fragment,{children:[s.jsxs("tr",{children:[s.jsx("td",{style:Cy,children:r.email??"—"}),s.jsx("td",{style:Wn,children:r.role??"—"}),s.jsx("td",{children:s.jsx(Bw,{tone:zw[r.status],children:r.status})}
858),s.jsx("td",{style:Wn,children:Ha(r.signupDate)}),s.jsx("td",{style:Wn,children:Ha(r.approvalDate)}),s.jsx("td",{style:Wn,children:Ha(r.rejectionDate)}),s.jsx("td",{style:{textAlign:"right"},children:s.jsx(Vw,{open:i,onClick:()=>n(r.membershipId)})})]}),i&&s.jsx("tr",{children:s.jsx("td",{colSpan:7,style:{padding:"0 8px 8px",background:"hsl(var(--c-surface))"},children:s.jsx(Ere,{kind:e.kind,membershipId:r.membershipId})})})]},r.membershipId)}),e.members.length===0&&s.jsx("tr",{children:s.jsx("td",{colSpan:7,style:{...Wn,textAlign:"center",padding:16},children:"No members"})})]})]})}function uet(){const{data:e=[],isLoading:t,isError:n}=Tre(),r=Ye(),[i,a]=x.useState("org"),[o,l]=x.useState(!1),[c,u]=x.useState(""),[d,h]=x.useState([]),[f,p]=x.useState([]),[m,g]=x.useState([]),[y,b]=x.useState({key:"signupDate",dir:"desc"}),[v,w]=x.useState(new Set),[_,j]=x.useState(new Set),[S,k]=x.useState(new Set),N=(P,I)=>{const M=new Set(P);return M.has(I)?M.delete(I):M.add(I),M},T=P=>j(I=>N(I,P)),C=P=>k(I=>N(I,P)),A=P=>{b(I=>I.key===P?{key:P,dir:I.dir==="asc"?"desc":"asc"}:{key:P,dir:"asc"})},O=P=>w(I=>{const M=new Set(I);return M.has(P)?M.delete(P):M.add(P),M}),z=x.useMemo(()=>tet(JJe(e,{query:c,kinds:d,statuses:f,verified:m}),y.key,y.dir),[e,c,d,f,m,y]),$=x.useMemo(()=>z.reduce((P,I)=>P+I.memberCount,0),[z]),F=()=>{const P=new Date().toISOString().slice(0,10),{headers:I,rows:M}=i==="member"?ret(z,Ha):net(z,Ha);aet(i==="member"?`organizations-members-${P}`:`organizations-${P}`,I,M),r({action:"export_org_directory",entityType:Ve.organizations,entityId:null,metadata:{surface:"admin_org_directory",view:i,row_count:z.length,member_count:$}})},B=13;return s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 20px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",gap:12,alignItems:"center",flexWrap:"wrap"},children:[s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",children:"Organizations"}),s.jsxs("p",{className:"tt-body-sm",style:{...Wn,marginTop:2},children:[z.length," ",z.length===1?"organization":"organizations"," · ",$," members"]})]}),s.jsx("div",{style:{flex:1}}),s.jsx("div",{style:{display:"inline-flex",background:"hsl(var(--c-surface-2))",borderRadius:8,padding:3},children:["org","member"].map(P=>s.jsx("button",{type:"button",onClick:()=>a(P),className:"xph-btn xph-btn-sm",style:{background:i===P?"hsl(var(--c-card))":"transparent",color:i===P?"hsl(var(--c-ink))":"hsl(var(--c-fg-muted))",border:i===P?"1px solid hsl(var(--c-border))":"1px solid transparent",boxShadow:"none"},children:P==="org"?"By organization":"By member"},P))}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-sm",onClick:()=>l(!0),children:[s.jsx(io,{size:13}),"Set up account"]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-sm",onClick:F,disabled:z.length===0,children:[s.jsx(Rl,{size:13}),"Export CSV"]})]}),s.jsxs("div",{style:{padding:"10px 20px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",gap:8,alignItems:"center",flexWrap:"nowrap",overflowX:"auto"},children:[s.jsxs("div",{style:{position:"relative",flex:"1 1 200px",minWidth:180},children:[s.jsx(Ea,{size:14,style:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)",color:"hsl(var(--c-fg-subtle))"}}),s.jsx(Fe,{value:c,onChange:P=>u(P.target.value),placeholder:"Search name, email, location…",style:{paddingLeft:30}})]}),s.jsx("div",{style:{flex:"0 0 140px"},children:s.jsx(sv,{options:[{value:"supplier",label:"Supplier"},{value:"buyer",label:"Buyer"}],selected:d,onChange:h,placeholder:"Type: All"})}),s.jsx("div",{style:{flex:"0 0 150px"},children:s.jsx(sv,{options:[{value:"approved",label:"Approved"},{value:"pending",label:"Pending"},{value:"rejected",label:"Rejected"},{value:"suspended",label:"Suspended"}],selected:f,onChange:p,placeholder:"Status: All"})}),s.jsx("div",{style:{flex:"0 0 150px"},children:s.jsx(sv,{options:[{value:"yes",label:"Verified"},{value:"no",label:"Unverified"},{value:"na",label:"N/A (buyer)"}],selected:m,onChange:g,placeholder:"Verified: All"})}),(c!==""||d.length>0||f.length>0||m.length>0)&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{flex:"0 0 auto"},onClick:()=>{u(""),h([]),p([]),g([])},children:"Reset"})]}),n?s.jsx("div",{style:{padding:48,textAlign:"center",color:"hsl(var(--c-negative-fg))"},children:"Failed to load the organizations directory. Try refreshing the page."}):t?s.jsx("div",{style:{padding:20,display:"flex",flexDirection:"column",gap:10},children:[...Array(5)].map((P,I)=>s.jsx(ce,{className:"h-12 w-full"},I))}):z.length===0?s.jsx("div",{style:{padding:48,textAlign:"center",...Wn},children:"No organizations match the current filters."}):s.jsx("div",{style:{overflow:"auto"},children:s.jsx("table",{className:"xph-table",children:i==="org"?s.jsxs(s.Fragment,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:{width:28}}),s.jsx(aa,{label:"Type",col:"kind",sort:y,onSort:A}),s.jsx(aa,{label:"Organization",col:"name",sort:y,onSort:A}),s.jsx(aa,{label:"Primary email",col:"primaryEmail",sort:y,onSort:A}),s.jsx(aa,{label:"Location",col:"location",sort:y,onSort:A}),s.jsx(aa,{label:"Status",col:"status",sort:y,onSort:A}),s.jsx(aa,{label:"Verified",col:"verified",sort:y,onSort:A}),s.jsx(aa,{label:"Members",col:"memberCount",sort:y,onSort:A,align:"right"}),s.jsx(aa,{label:"Published",col:"publishedAssets",sort:y,onSort:A,align:"right"}),s.jsx(aa,{label:"Drafts",col:"draftAssets",sort:y,onSort:A,align:"right"}),s.jsx(aa,{label:"Signup",col:"signupDate",sort:y,onSort:A}),s.jsx(aa,{label:"Approved",col:"approvalDate",sort:y,onSort:A}),s.jsx(aa,{label:"Rejected",col:"rejectionDate",sort:y,onSort:A})]})}),s.jsx("tbody",{children:z.map(P=>{const I=v.has(P.orgId);return s.jsxs(x.Fragment,{children:[s.jsxs("tr",{role:"button",tabIndex:0,"aria-expanded":I,style:{cursor:"pointer"},onClick:()=>O(P.orgId),onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),O(P.orgId))},children:[s.jsx("td",{style:{color:"hsl(var(--c-fg-subtle))"},children:I?s.jsx(Ta,{size:14}):s.jsx(Us,{size:14})}),s.jsx("td",{children:s.jsx(RV,{kind:P.kind})}),s.jsx("td",{style:{fontWeight:600,color:"hsl(var(--c-ink))"},children:P.name}),s.jsx("td",{style:{...Cy,...Wn},children:P.primaryEmail??"—"}),s.jsx("td",{style:Wn,children:P.location??"—"}),s.jsx("td",{children:s.jsx(Bw,{tone:zw[P.status],children:P.status})}),s.jsx("td",{style:Wn,children:Are(P)}),s.jsx("td",{style:{textAlign:"right"},children:P.memberCount}),s.jsx("td",{style:{textAlign:"right",...Wn},children:P.publishedAssets??"—"}),s.jsx("td",{style:{textAlign:"right",...Wn},children:P.draftAssets??"—"}),s.jsx("td",{style:Wn,children:Ha(P.signupDate)}),s.jsx("td",{style:Wn,children:Ha(P.approvalDate)}),s.jsx("td",{style:Wn,children:Ha(P.rejectionDate)})]}),I&&s.jsx("tr",{children:s.jsxs("td",{colSpan:B,style:{padding:"4px 16px 12px 40px",background:"hsl(var(--c-surface))"},children:[P.kind==="supplier"&&P.supplierOnboardingId&&s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4px 8px 10px",gap:8},children:[s.jsx("span",{style:{...Cy,...Wn,fontSize:11,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Entity due diligence"}),s.jsx(Vw,{open:S.has(P.orgId),onClick:()=>C(P.orgId),label:"Entity DD"})]}),P.kind==="supplier"&&P.supplierOnboardingId&&S.has(P.orgId)&&s.jsx("div",{style:{padding:"0 4px 12px"},children:s.jsx(tO,{supplierOnboardingId:P.supplierOnboardingId,expanded:!0})}),s.jsx(cet,{row:P,ddOpen:_,toggleDD:T})]})})]},P.orgId)})})]}):s.jsxs(s.Fragment,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Organization"}),s.jsx("th",{children:"Type"}),s.jsx("th",{children:"Member email"}),s.jsx("th",{children:"Role"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Signup"}),s.jsx("th",{children:"Approved"}),s.jsx("th",{children:"Rejected"}),s.jsx("th",{style:{width:90,textAlign:"right"},children:"Dossier"})]})}),s.jsx("tbody",{children:z.map(P=>s.jsxs(x.Fragment,{children:[s.jsx("tr",{style:{background:"hsl(var(--c-surface))"},children:s.jsx("td",{colSpan:9,style:{fontWeight:600,color:"hsl(var(--c-ink))"},children:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[s.jsx(RV,{kind:P.kind}),P.name,s.jsx(Bw,{tone:zw[P.status],children:P.status}),s.jsxs("span",{style:{...Cy,...Wn},children:[P.memberCount," ",P.memberCount===1?"member":"members"]}),P.kind==="supplier"&&P.supplierOnboardingId&&s.jsx(Vw,{open:S.has(P.orgId),onClick:()=>C(P.orgId),label:"Entity DD"})]})})}),P.kind==="supplier"&&P.supplierOnboardingId&&S.has(P.orgId)&&s.jsx("tr",{children:s.jsx("td",{colSpan:9,style:{padding:"4px 12px 12px",background:"hsl(var(--c-surface))"},children:s.jsx(tO,{supplierOnboardingId:P.supplierOnboardingId,expanded:!0})})}),P.members.map(I=>{const M=_.has(I.membershipId);return s.jsxs(x.Fragment,{children:[s.jsxs("tr",{children:[s.jsx("td",{style:Wn,children:"—"}),s.jsx("td",{}),s.jsx("td",{style:Cy,children:I.email??"—"}),s.jsx("td",{style:Wn,children:I.role??"—"}),s.jsx("td",{children:s.jsx(Bw,{tone:zw[I.status],children:I.status})}),s.jsx("td",{style:Wn,children:Ha(I.signupDate)}),s.jsx("td",{style:Wn,children:Ha(I.approvalDate)}),s.jsx("td",{style:Wn,children:Ha(I.rejectionDate)}),s.jsx("td",{style:{textAlign:"right"},children:s.jsx(Vw,{open:M,onClick:()=>T(I.membershipId)})})]}),M&&s.jsx("tr",{children:s.jsx("td",{colSpan:9,style:{padding:"0 12px 8px",background:"hsl(var(--c-surface))"},children:s.jsx(Ere,{kind:P.kind,membershipId:I.membershipId})})})]},I.membershipId)})]},P.orgId))})]})})}),s.jsx(HJe,{open:o,onOpenChange:l})]})}function J0({label:e,value:t,hint:n,emphasis:r="default"}){const i=r==="warning"?"hsl(var(--c-warning-fg))":r==="positive"?"hsl(var(--c-positive-fg))":"hsl(var(--c-ink))";return s.jsxs("div",{style:{background:"hsl(var(--c-card))",border:"1px solid hsl(var(--c-border))",borderRadius:10,padding:"12px 16px",minWidth:110},children:[s.jsx("div",{className:"eyebrow",children:e}),s.jsx("div",{className:"tt-stat-md",style:{marginTop:4,color:i},children:t}),n&&s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:n})]})}function DV({tone:e,children:t}){const n={positive:{bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))",border:"hsl(var(--c-positive-border))"},warning:{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))",border:"hsl(var(--c-warning-border))"},negative:{bg:"hsl(var(--c-negative-soft))",fg:"hsl(var(--c-negative-fg))",border:"hsl(var(--c-negative-soft))"},neutral:{bg:"hsl(var(--c-surface))",fg:"hsl(var(--c-fg-muted))",border:"hsl(var(--c-border))"}}[e];return s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:5,padding:"3px 8px",borderRadius:4,fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:500,letterSpacing:"0.06em",textTransform:"uppercase",background:n.bg,color:n.fg,border:`1px solid ${n.border}`},children:t})}function det({title:e,description:t,action:n,children:r}){return s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center",gap:16,flexWrap:"wrap"},children:[s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",children:e}),t&&s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:2},children:t})]}),n]}),r]})}function het(){const{user:e,isAdmin:t,isLoading:n}=me(),{data:r=[],isLoading:i}=ag(),{data:a=[]}=hS(),{data:o=[]}=Tte(),{data:l=[]}=Ete(),{data:c=[]}=Pte(),{data:u=[]}=Tre(),{data:d=[]}=Ite(),{data:h=[]}=Pne(),f=_te(),p=kte(),{toast:m}=xt(),[g,y]=il(),b=x.useMemo(()=>new Set(["approvals","inquiries","assets","organizations","users","activity","agents"]),[]),v=g.get("tab"),w=v==="suppliers"||v==="buyers"?"organizations":v,_=w&&b.has(w)?w:"approvals",j=g.get("buyer")??void 0,S=g.get("supplier")??void 0,[k,N]=x.useState(!1),[T,C]=x.useState(_);x.useEffect(()=>{if(g.get("tab")===T)return;const le=new URLSearchParams(g);le.set("tab",T),T!=="approvals"&&(le.delete("buyer"),le.delete("supplier")),y(le,{replace:!0})},[T]);
858const[A,O]=x.useState(null),[z,$]=x.useState(null),[F,B]=x.useState(null),[P,I]=x.useState(null),M=o.filter(Y=>Y.status==="pending").length,R=l.length,K=c.filter(Y=>Y.status==="pending").length,D=d.filter(Y=>Y.status==="pending").length,E=M+R+K+h.length;if(n)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"64px 24px"},children:s.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:256},children:s.jsx(ne,{className:"animate-spin",size:28,style:{color:"hsl(var(--c-fg-muted))"}})})})});if(!e)return s.jsx(Pt,{to:"/auth",replace:!0});if(!t)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"64px 24px"},children:s.jsxs("div",{className:"xph-card",style:{padding:48,textAlign:"center"},children:[s.jsx("h2",{className:"tt-display-md",style:{marginBottom:8},children:"Access Denied"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))"},children:"You don't have admin permissions to access this page."})]})})});const q=Y=>{$(Y),N(!0)},X=async()=>{if(F)try{await f.mutateAsync(F),m({title:"Asset deleted successfully"}),B(null)}catch(Y){console.error("Failed to delete asset:",Y),m({title:"Error",description:Qn(Y,"Failed to delete asset"),variant:"destructive"})}},re=async Y=>{if(P)try{await p.mutateAsync({assetId:P.id,assetName:P.productName,note:Y}),m({title:"Asset returned to draft"}),I(null)}catch(le){console.error("Failed to return asset to draft:",le),m({title:"Error",description:Qn(le,"Failed to return asset to draft"),variant:"destructive"})}};return s.jsxs(he,{children:[s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))",padding:"28px 0 24px"},children:s.jsxs("div",{className:"xph-container",style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",gap:24,flexWrap:"wrap"},children:[s.jsxs("div",{style:{minWidth:0},children:[s.jsxs("div",{className:"eyebrow",style:{display:"inline-flex",alignItems:"center",gap:8},children:[s.jsx(Hs,{size:12}),"xpharma · admin console"]}),s.jsx("h1",{className:"tt-display-md",style:{marginTop:8},children:"Operations dashboard"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:4},children:"Review listings, approve counterparties, and audit platform activity."})]}),s.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap"},children:[s.jsx(J0,{label:"Approvals",value:E,hint:"awaiting review",emphasis:E>0?"warning":"default"}),s.jsx(J0,{label:"Inquiries",value:D,hint:`${d.length} total`,emphasis:D>0?"warning":"default"}),s.jsx(J0,{label:"Assets",value:r.length,hint:`${r.filter(Y=>Y.assetStatus==="published").length} published`}),s.jsx(J0,{label:"Suppliers",value:a.length,hint:`${a.filter(Y=>Y.verified).length} verified`,emphasis:"positive"})]})]})}),s.jsx("div",{className:"xph-container",style:{padding:"24px 24px 64px"},children:s.jsxs(mh,{value:T,onValueChange:C,children:[s.jsxs(ju,{style:{background:"hsl(var(--c-surface-2))",padding:3,marginBottom:20,height:"auto"},children:[s.jsxs(Er,{value:"approvals",className:"gap-2",style:{padding:"7px 12px",fontSize:13.5},children:["Approvals",E>0&&s.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:18,height:18,padding:"0 5px",borderRadius:9,background:"hsl(var(--c-warning-soft))",color:"hsl(var(--c-warning-fg))",fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:600},children:E})]}),s.jsxs(Er,{value:"inquiries",className:"gap-2",style:{padding:"7px 12px",fontSize:13.5},children:["Inquiries",D>0&&s.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:18,height:18,padding:"0 5px",borderRadius:9,background:"hsl(var(--c-warning-soft))",color:"hsl(var(--c-warning-fg))",fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:600},children:D})]}),s.jsxs(Er,{value:"assets",style:{padding:"7px 12px",fontSize:13.5},children:["Pharma Assets",s.jsx("span",{className:"tt-mono-sm",style:{marginLeft:6,color:"hsl(var(--c-fg-subtle))"},children:r.length})]}),s.jsxs(Er,{value:"organizations",style:{padding:"7px 12px",fontSize:13.5},children:["Organizations",s.jsx("span",{className:"tt-mono-sm",style:{marginLeft:6,color:"hsl(var(--c-fg-subtle))"},children:u.length})]}),s.jsx(Er,{value:"users",style:{padding:"7px 12px",fontSize:13.5},children:"Users"}),s.jsx(Er,{value:"activity",style:{padding:"7px 12px",fontSize:13.5},children:"Activity"}),s.jsx(Er,{value:"agents",style:{padding:"7px 12px",fontSize:13.5},children:"Agents"})]}),s.jsxs(pi,{value:"approvals",className:"space-y-4",children:[s.jsx(PXe,{}),s.jsx(aXe,{expandedSupplierId:S}),s.jsx(gXe,{expandedBuyerId:j}),s.jsx(lXe,{})]}),s.jsx(pi,{value:"inquiries",children:s.jsx(OXe,{})}),s.jsx(pi,{value:"assets",children:s.jsx(det,{title:"Pharma assets",description:`${r.length} total · ${r.filter(Y=>Y.assetStatus==="published").length} published · ${r.filter(Y=>Y.assetStatus==="draft").length} drafts`,action:s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:()=>{$(null),N(!0)},children:[s.jsx(io,{size:13}),"Add Asset"]}),children:i?s.jsx("div",{style:{padding:20,display:"flex",flexDirection:"column",gap:10},children:[...Array(5)].map((Y,le)=>s.jsx(ce,{className:"h-12 w-full"},le))}):s.jsxs("div",{style:{overflow:"auto"},children:[s.jsxs("table",{className:"xph-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Asset"}),s.jsx("th",{children:"Target"}),s.jsx("th",{children:"Modality"}),s.jsx("th",{children:"Stage"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Verification"}),s.jsx("th",{style:{textAlign:"right"},children:"Est. NPV"}),s.jsx("th",{style:{textAlign:"right"},children:"Actions"})]})}),s.jsx("tbody",{children:r.map(Y=>s.jsxs("tr",{children:[s.jsx("td",{style:{fontWeight:600,color:"hsl(var(--c-ink))"},children:s.jsx(oe,{to:`/pipeline/${Y.id}`,style:{color:"inherit",textDecoration:"none"},children:Y.productName})}),s.jsx("td",{style:{fontFamily:"var(--font-mono)",fontSize:12,color:"hsl(var(--c-fg-muted))"},children:Y.primaryTarget||"—"}),s.jsx("td",{style:{color:"hsl(var(--c-fg-muted))"},children:Zt[Y.modality]}),s.jsx("td",{children:s.jsx("span",{className:`xph-badge ${ea[Y.stage]}`,children:Nn[Y.stage]})}),s.jsx("td",{children:s.jsx(DV,{tone:Y.assetStatus==="published"?"positive":Y.assetStatus==="rejected"?"negative":"warning",children:$R[Y.assetStatus]})}),s.jsx("td",{children:s.jsx(DV,{tone:Y.verificationStatus==="verified"?"positive":Y.verificationStatus==="in-progress"?"warning":"neutral",children:Y.verificationStatus.replace("-"," ")})}),s.jsx("td",{style:{textAlign:"right",fontWeight:600},children:ds(Y.estimatedNPV)}),s.jsx("td",{style:{textAlign:"right"},children:s.jsxs("div",{style:{display:"inline-flex",gap:4,justifyContent:"flex-end"},children:[s.jsx(oe,{to:`/pipeline/${Y.id}`,className:"xph-btn xph-btn-ghost xph-btn-icon","aria-label":"Open",children:s.jsx(Ls,{size:13})}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>q(Y),"aria-label":"Edit",children:s.jsx(PH,{size:13})}),Y.assetStatus!=="draft"&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>I(Y),"aria-label":"Return to draft",title:"Return to draft",children:s.jsx(NI,{size:13})}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>B(Y.id),"aria-label":"Delete",style:{color:"hsl(var(--c-negative-fg))"},children:s.jsx(Gl,{size:13})})]})})]},Y.id))})]}),r.length===0&&s.jsx("div",{style:{padding:48,textAlign:"center",color:"hsl(var(--c-fg-muted))"},children:"No assets yet"})]})})}),s.jsx(pi,{value:"organizations",children:s.jsx(uet,{})}),s.jsx(pi,{value:"users",children:s.jsx(FXe,{onViewActivity:Y=>{O(Y),C("activity")}})}),s.jsx(pi,{value:"activity",children:s.jsx(vJe,{presetUserId:A})}),s.jsx(pi,{value:"agents",children:s.jsx(MJe,{})})]})})]}),s.jsx(gYe,{open:k,onOpenChange:N,asset:z}),s.jsx(ku,{open:!!F,onOpenChange:Y=>!Y&&B(null),onConfirm:X,title:"Delete Asset",description:"Are you sure you want to delete this asset? This action cannot be undone.",isLoading:f.isPending}),s.jsx(Ate,{open:!!P,onOpenChange:Y=>!Y&&I(null),assetName:P==null?void 0:P.productName,isLoading:p.isPending,onConfirm:re})]})}function FM(){return Se({queryKey:["document-categories"],queryFn:async()=>{const{data:e,error:t}=await W.from("document_categories").select("*").order("code");if(t)throw t;return e},staleTime:1/0})}function zM(e){return Se({queryKey:["data-room-documents",e],queryFn:async()=>{const{data:t,error:n}=await W.from("data_room_documents").select("*").eq("asset_id",e).order("created_at",{ascending:!1});if(n)throw n;return t},enabled:!!e,refetchInterval:t=>{const n=t.state.data;return n!=null&&n.some(r=>r.status==="processing")?3e3:!1}})}function fet(e){const{user:t}=me(),{toast:n}=xt(),r=Ae(),i=Ye();return $e({mutationFn:async a=>{if(!e||!t)throw new Error("Missing context");const o=`${t.id}/data-room/${e}/${Date.now()}_${a.name}`,{error:l}=await W.storage.from("supplier-documents").upload(o,a);if(l)throw l;const{data:c,error:u}=await W.from("data_room_documents").insert({asset_id:e,uploaded_by:t.id,file_name:a.name,file_path:o,file_size:a.size,mime_type:a.type||null,status:"processing"}).select().single();if(u)throw u;return W.functions.invoke("categorize-document",{body:{document_id:c.id,file_name:a.name,mime_type:a.type,file_path:o}}).catch(d=>console.error("Categorization failed:",d)),c},onSuccess:a=>{r.invalidateQueries({queryKey:["data-room-documents",e]}),i({action:"upload_document",entityType:Ve.dataRoomDocuments,entityId:a.id,entityLabel:a.file_name,metadata:{asset_id:a.asset_id,file_size:a.file_size,mime_type:a.mime_type}})},onError:a=>{n({title:"Upload failed",description:a.message,variant:"destructive"})}})}function pet(e){const t=Ae(),{toast:n}=xt(),r=Ye();return $e({mutationFn:async({id:i,updates:a})=>{const o="category_code"in a||"subcategory_code"in a,l={...a,updated_at:new Date().toISOString()};o&&(l.status="manual");const{error:c}=await W.from("data_room_documents").update(l).eq("id",i);if(c)throw c;return{id:i,updates:a}},onSuccess:({id:i,updates:a})=>{var c;t.invalidateQueries({queryKey:["data-room-documents",e]}),n({title:"Document updated"});const o=t.getQueryData(["data-room-documents",e]),l=(c=o==null?void 0:o.find(u=>u.id===i))==null?void 0:c.file_name;r({action:"update_document",entityType:Ve.dataRoomDocuments,entityId:i,entityLabel:l,metadata:{updated_fields:Object.keys(a)}})},onError:i=>{n({title:"Update failed",description:i.message,variant:"destructive"})}})}function met(e){const t=Ae(),{toast:n}=xt(),r=Ye();return $e({mutationFn:async({id:i,filePath:a})=>{await W.storage.from("supplier-documents").remove([a]);const{error:o}=await W.from("data_room_documents").delete().eq("id",i);if(o)throw o;return{id:i,filePath:a}},onSuccess:({id:i})=>{t.invalidateQueries({queryKey:["data-room-documents",e]}),n({title:"Document deleted"}),r({action:"delete_document",entityType:Ve.dataRoomDocuments,entityId:i})},onError:i=>{n({title:"Delete failed",description:i.message,variant:"destructive"})}})}function get(e,t){const{isAdmin:n}=me();return Se({queryKey:["asset-resubmission-diff",e],queryFn:async()=>
858{if(!e||!t)return null;try{const{data:r,error:i}=await W.rpc("get_audit_record_versions",{p_table_name:"pharma_assets",p_record_id:e,p_limit:50});if(i)return null;const o=(r??[]).find(h=>{var m,g;const f=(m=h.record)==null?void 0:m.asset_status,p=(g=h.old_record)==null?void 0:g.asset_status;return f==="rejected"&&p!=="rejected"});if(!o||!o.record)return null;const l=o.record,c=wu(t),u=vi.flatMap(h=>h.fields.map(f=>f.key)),d=new Set;for(const h of u){const f=JSON.stringify(l[h]??null),p=JSON.stringify(c[h]??null);f!==p&&d.add(h)}return{priorReason:o.record.asset_rejection_reason??null,priorAt:o.ts,priorAdminUid:o.auth_uid,changedKeys:d}}catch{return null}},enabled:n&&!!e&&!!t,staleTime:6e4})}function yet(e){return Se({queryKey:["valuation-latest",e],queryFn:async()=>{if(!e)return null;const{data:t}=await W.from("valuation_runs").select("npv_base, p50, completeness_score, model_version, created_at").eq("asset_id",e).order("created_at",{ascending:!1}).limit(1).maybeSingle();return t},enabled:!!e})}function vet(){const{id:e}=Zs(),t=xr(),{isAdmin:n,rolesReady:r}=me(),{toast:i}=xt(),a=dc(),{data:o,isLoading:l}=fS(e||""),{data:c=[]}=zM(e),{data:u}=get(e,o),{data:d}=yet(e),h=RGe(),f=DGe(),p=kte(),[m,g]=x.useState(!1),[y,b]=x.useState(!1),[v,w]=x.useState("");if(x.useEffect(()=>{r&&!n&&t("/",{replace:!0})},[r,n,t]),l||!r)return s.jsx(he,{children:s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px"},children:[s.jsx(ce,{className:"h-8 w-64 mb-6"}),s.jsx(ce,{className:"h-96 w-full"})]})});if(!o)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"32px 24px"},children:s.jsxs("div",{className:"xph-card",style:{padding:48,textAlign:"center"},children:[s.jsx("h2",{style:{fontFamily:"var(--font-display)",fontSize:22,fontWeight:600,marginBottom:8},children:"Asset not found"}),s.jsxs(oe,{to:"/admin",className:"xph-btn xph-btn-primary",children:[s.jsx(Wt,{size:14})," Back to admin"]})]})})});const _=o.assetStatus==="pending_review",j=Qp(wu(o)).percent,S=async()=>{try{await h.mutateAsync({assetId:o.id,assetName:o.productName}),i({title:"Asset approved and published"}),t("/admin")}catch(A){i({title:"Error",description:A.message||"Failed to approve",variant:"destructive"})}},k=async A=>{try{await p.mutateAsync({assetId:o.id,assetName:o.productName,note:A}),i({title:"Asset returned to draft"}),b(!1),t("/admin?tab=assets")}catch(O){i({title:"Error",description:O.message||"Failed to return to draft",variant:"destructive"})}},N=async()=>{if(v.trim())try{await f.mutateAsync({assetId:o.id,reason:v.trim(),assetName:o.productName}),i({title:"Asset rejected"}),g(!1),t("/admin")}catch(A){i({title:"Error",description:A.message||"Failed to reject",variant:"destructive"})}},T=async(A,O)=>{try{const{data:z,error:$}=await W.storage.from("supplier-documents").createSignedUrl(A,60);if($)throw $;const B=await(await fetch(z.signedUrl)).blob(),P=URL.createObjectURL(B),I=document.createElement("a");I.href=P,I.download=O,document.body.appendChild(I),I.click(),I.remove(),URL.revokeObjectURL(P)}catch(z){i({title:"Download failed",description:z.message,variant:"destructive"})}},C=ea[o.stage];return s.jsxs(he,{children:[s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:[s.jsx("div",{style:{position:"sticky",top:0,zIndex:10,background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))"},children:s.jsxs("div",{className:"xph-container",style:{padding:"12px 16px",display:"flex",flexDirection:a?"column":"row",alignItems:a?"stretch":"center",gap:a?10:14,flexWrap:"wrap"},children:[s.jsxs(oe,{to:"/admin",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{flexShrink:0,alignSelf:a?"flex-start":"center"},children:[s.jsx(Wt,{size:13})," Back"]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1},children:[s.jsx("span",{className:"eyebrow",children:"Admin review"}),s.jsx("span",{style:{fontWeight:600,fontSize:15,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o.productName})]}),s.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",alignItems:"center",minWidth:0},children:[s.jsx("span",{className:`xph-badge ${C}`,children:Nn[o.stage]}),s.jsx("span",{className:"tt-mono-sm",style:{padding:"2px 8px",borderRadius:4,background:_?"hsl(var(--c-warning-soft))":"hsl(var(--c-surface-2))",color:_?"hsl(var(--c-warning-fg))":"hsl(var(--c-fg-muted))",border:`1px solid ${_?"hsl(var(--c-warning-border))":"hsl(var(--c-border))"}`,fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em"},children:o.assetStatus.replace("_"," ")}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-muted))",fontSize:11,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:[o.supplier.name," · ",$r(new Date(o.listedAt),{addSuffix:!0})]})]}),s.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginLeft:a?0:"auto"},children:[o.assetStatus!=="draft"&&s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:()=>b(!0),disabled:p.isPending,style:{flex:a?"1 1 120px":"0 0 auto",justifyContent:"center"},children:[s.jsx(NI,{size:12})," Return to draft"]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:()=>g(!0),disabled:!_||f.isPending,style:{color:"hsl(var(--c-negative-fg))",flex:a?"1 1 120px":"0 0 auto",justifyContent:"center"},children:[s.jsx(gn,{size:12})," Reject"]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:S,disabled:!_||h.isPending,style:{flex:a?"1 1 120px":"0 0 auto",justifyContent:"center"},children:[h.isPending?s.jsx(ne,{size:12,className:"animate-spin"}):s.jsx(fo,{size:12}),"Approve"]})]})]})}),s.jsxs("div",{className:"xph-container review-grid",style:{padding:"20px 16px 64px",display:"grid",gap:16},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,minWidth:0},children:[u&&s.jsxs("div",{className:"xph-card",style:{padding:16,borderLeft:"3px solid hsl(var(--c-accent))",background:"hsl(var(--c-accent) / 0.04)"},children:[s.jsxs("div",{className:"eyebrow",style:{color:"hsl(var(--c-accent))"},children:["Resubmission · ",u.changedKeys.size," field",u.changedKeys.size===1?"":"s"," changed"]}),s.jsxs("div",{style:{marginTop:6,fontSize:13.5},children:["Previously rejected ",$r(new Date(u.priorAt),{addSuffix:!0})]}),u.priorReason&&s.jsxs("div",{style:{marginTop:8,padding:10,background:"hsl(var(--c-surface))",borderRadius:6,fontSize:13,color:"hsl(var(--c-fg-muted))"},children:[s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:"Prior reason:"})," ",u.priorReason]})]}),s.jsx(XY,{asset:o,highlightedFieldKeys:u==null?void 0:u.changedKeys}),s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden"},children:[s.jsx("div",{style:{padding:"14px 16px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center"},children:s.jsxs("div",{children:[s.jsxs("div",{className:"eyebrow",children:["Data room · ",c.length," document",c.length===1?"":"s"]}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:4},children:"All supplier-uploaded files"})]})}),c.length===0?s.jsx("div",{style:{padding:24,textAlign:"center",color:"hsl(var(--c-fg-muted))",fontSize:13},children:"No documents uploaded"}):c.map(A=>s.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",flexWrap:"wrap",gap:12,alignItems:"center"},children:[s.jsx(ti,{size:16,style:{color:"hsl(var(--c-fg-muted))"}}),s.jsxs("div",{style:{minWidth:0,flex:"1 1 180px"},children:[s.jsx("div",{style:{fontWeight:500,fontSize:13.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:A.file_name}),s.jsxs("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:[A.category_code||"uncategorized",A.subcategory_code?` · ${A.subcategory_code}`:""]})]}),A.is_confidential&&s.jsx("span",{className:"tt-mono-sm",style:{padding:"2px 8px",borderRadius:4,background:"hsl(var(--c-warning-soft))",color:"hsl(var(--c-warning-fg))",fontSize:10,textTransform:"uppercase"},children:"Confidential"}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:()=>T(A.file_path,A.file_name),children:[s.jsx(Rl,{size:12})," Download"]})]},A.id))]})]}),s.jsxs("div",{className:"review-rail",style:{display:"flex",flexDirection:"column",gap:12,position:"sticky",top:80,al
858ignSelf:"flex-start",minWidth:0},children:[s.jsxs("div",{className:"xph-card",style:{padding:16},children:[s.jsx("div",{className:"eyebrow",children:"Completeness"}),s.jsxs("div",{className:"tt-stat-xl",style:{marginTop:6},children:[j,"%"]}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:4},children:"of required publish fields"})]}),s.jsxs(oe,{to:`/valuation?asset=${o.id}`,className:"xph-card",style:{padding:16,textDecoration:"none",color:"inherit",display:"block"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsx("div",{className:"eyebrow",children:"Estimated NPV"}),s.jsx(EH,{size:13,style:{color:"hsl(var(--c-fg-muted))"}})]}),s.jsx("div",{className:"tt-stat-xl",style:{marginTop:6},children:ds((d==null?void 0:d.npv_base)??(d==null?void 0:d.p50)??o.estimatedNPV)}),d?s.jsxs("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:4},children:["Last run ",$r(new Date(d.created_at),{addSuffix:!0})," · ",d.model_version]}):s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:4},children:"No valuation runs yet · showing stored estimate"}),s.jsxs("div",{className:"tt-mono-sm",style:{marginTop:10,color:"hsl(var(--c-accent))",display:"inline-flex",alignItems:"center",gap:4,fontSize:11},children:["Open Valuation Terminal ",s.jsx(Gn,{size:11})]})]}),s.jsxs("div",{className:"xph-card",style:{padding:16},children:[s.jsx("div",{className:"eyebrow",children:"Counterparty"}),s.jsx("div",{style:{marginTop:8,fontWeight:600,fontSize:14},children:o.supplier.name}),s.jsx("div",{style:{fontSize:12,color:"hsl(var(--c-fg-muted))",marginTop:2},children:o.supplier.location}),s.jsxs("div",{style:{marginTop:10,fontSize:12.5,color:"hsl(var(--c-fg-muted))"},children:[Zt[o.modality]," · ",o.primaryTarget||"—"]})]})]})]})]}),s.jsx(Br,{open:m,onOpenChange:g,children:s.jsxs(br,{children:[s.jsxs(wr,{children:[s.jsx(jr,{children:"Reject Asset Submission"}),s.jsxs(So,{children:['Rejecting "',o.productName,'"']})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsx(Pe,{htmlFor:"reason",children:"Rejection Reason"}),s.jsx(Ys,{id:"reason",placeholder:"Please provide feedback for the supplier...",value:v,onChange:A=>w(A.target.value),rows:4})]}),s.jsxs(_i,{children:[s.jsx(je,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),s.jsxs(je,{variant:"destructive",onClick:N,disabled:!v.trim()||f.isPending,children:[f.isPending&&s.jsx(ne,{className:"h-4 w-4 mr-2 animate-spin"}),"Reject Asset"]})]})]})}),s.jsx(Ate,{open:y,onOpenChange:b,assetName:o.productName,isLoading:p.isPending,onConfirm:k})]})}function xet(){return Se({queryKey:["approved-suppliers-for-impersonation"],queryFn:async()=>{const{data:e,error:t}=await W.from("supplier_users").select("supplier_id").eq("status","approved").not("supplier_id","is",null);if(t)throw t;const n=[...new Set((e||[]).map(c=>c.supplier_id).filter(Boolean))];if(n.length===0)return[];const{data:r,error:i}=await W.from("suppliers").select("id, name, location").in("id",n).order("name");if(i)throw i;const{data:a,error:o}=await W.from("pharma_assets").select("supplier_id").in("supplier_id",n);if(o)throw o;const l=new Map;return(a||[]).forEach(c=>l.set(c.supplier_id,(l.get(c.supplier_id)||0)+1)),(r||[]).map(c=>({id:c.id,name:c.name||"Unknown",location:c.location||"",assetCount:l.get(c.id)||0}))}})}function bet(){return Se({queryKey:["approved-buyers-for-impersonation"],queryFn:async()=>{const{data:e,error:t}=await W.from("buyer_users").select("id, user_id, company_name, company_location").eq("status","approved").order("company_name");if(t)throw t;return e||[]}})}function Pre({type:e}){const{startImpersonation:t}=qe(),[n,r]=x.useState(""),{data:i=[],isLoading:a}=xet(),{data:o=[],isLoading:l}=bet(),c=e==="supplier"?a:l,u=x.useMemo(()=>e==="supplier"?i.map(p=>({id:p.id,name:p.name,subtitle:p.location,assetCount:p.assetCount})):o.map(p=>({id:p.id,name:p.company_name||"Unknown",subtitle:p.company_location||"",userId:p.user_id})),[e,i,o]),d=x.useMemo(()=>{if(!n)return u;const p=n.toLowerCase();return u.filter(m=>{var g;return m.name.toLowerCase().includes(p)||((g=m.subtitle)==null?void 0:g.toLowerCase().includes(p))})},[u,n]),h=e==="supplier"?s.jsx(pr,{className:"h-5 w-5"}):s.jsx(Vp,{className:"h-5 w-5"}),f=e==="supplier"?"Supplier":"Buyer";return s.jsxs(Be,{className:"max-w-2xl mx-auto",children:[s.jsxs(ht,{children:[s.jsxs(ft,{className:"flex items-center gap-2",children:[s.jsx(Na,{className:"h-5 w-5"}),"Select a ",f," to View As"]}),s.jsxs(Mr,{children:["You'll browse the ",f.toLowerCase()," portal in read-only mode. No data will be created or modified."]})]}),s.jsxs(pt,{className:"space-y-4",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Ea,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(Fe,{placeholder:`Search ${f.toLowerCase()}s...`,value:n,onChange:p=>r(p.target.value),className:"pl-9"})]}),c?s.jsx("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"Loading..."}):d.length===0?s.jsx("p",{className:"text-sm text-muted-foreground py-8 text-center",children:n?"No matches found":`No approved ${f.toLowerCase()}s yet`}):s.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:d.map(p=>s.jsxs("button",{onClick:()=>t({type:e,id:p.id,name:p.name,userId:p.userId}),className:"w-full flex items-center justify-between p-3 rounded-lg border hover:bg-muted/50 transition-colors text-left",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[h,s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:p.name}),p.subtitle&&s.jsx("div",{className:"text-sm text-muted-foreground",children:p.subtitle})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:["assetCount"in p&&s.jsxs(pn,{variant:"secondary",children:[p.assetCount," assets"]}),s.jsx(Na,{className:"h-4 w-4 text-muted-foreground"})]})]}
858,p.id))})]})]})}function Sk(e){var o;const{user:t}=me(),{isImpersonating:n,impersonating:r}=qe(),{data:i}=An(),a=n&&(r==null?void 0:r.type)==="supplier"?r.id:e===void 0?((o=i==null?void 0:i.supplier)==null?void 0:o.id)??null:e;return Se({queryKey:["supplier-assets",a],queryFn:async()=>{if(!t||!a)return[];const{data:l,error:c}=await W.from("pharma_assets").select(`
859          *,
860          suppliers (*)
861        `).eq("supplier_id",a).order("created_at",{ascending:!1});if(c)throw console.error("Error fetching supplier assets:",c),c;return(l||[]).map(u=>sl(u))},enabled:!!t&&!!a})}function Ore(e){return{id:e.id,supplierId:e.supplier_id,fullName:e.full_name,title:e.title,linkedinUrl:e.linkedin_url,email:e.email??null,internalRole:e.internal_role??"admin",emailVerified:e.email_verified??!1,isPrimary:e.is_primary??!1,documents:e.documents??[],verificationStatus:e.verification_status,verificationResult:e.verification_result,verifiedAt:e.verified_at,invitationStatus:e.invitation_status??"not_invited",invitationTokenExpiresAt:e.invitation_token_expires_at??null,userId:e.user_id??null,createdAt:e.created_at,updatedAt:e.updated_at}}function Ire(){var r;const{user:e}=me(),{data:t}=An(),n=(r=t==null?void 0:t.supplier)==null?void 0:r.id;return Se({queryKey:["supplier-personnel",n],queryFn:async()=>{if(!n)return[];const{data:i,error:a}=await W.from("supplier_personnel").select("id, supplier_id, full_name, title, linkedin_url, email, internal_role, email_verified, is_primary, documents, verification_status, verification_result, verified_at, invitation_status, invitation_token_expires_at, user_id, created_at, updated_at").eq("supplier_id",n).order("created_at",{ascending:!0});if(a)throw a;return(i||[]).map(Ore)},enabled:!!e&&!!n})}function wet(){var a;const e=Ae(),{data:t}=An(),n=(a=t==null?void 0:t.supplier)==null?void 0:a.id,{guardMutation:r}=qe(),i=Ye();return $e({mutationFn:async o=>{if(r("Adding personnel"))throw new Error("Impersonation mode");if(!n)throw new Error("No supplier");const{data:l,error:c}=await W.from("supplier_personnel").insert({supplier_id:n,full_name:o.fullName,title:o.title||null,linkedin_url:o.linkedinUrl||null,email:o.email||null,internal_role:o.internalRole||"admin",is_primary:o.isPrimary??!1}).select().single();if(c)throw c;return Ore(l)},onSuccess:o=>{e.invalidateQueries({queryKey:["supplier-personnel"]}),i({action:"add_personnel",entityType:Ve.supplierPersonnel,entityId:o.id,entityLabel:o.fullName,metadata:{supplier_id:o.supplierId,internal_role:o.internalRole}})}})}function jet(){const e=Ae(),t=Ye();return $e({mutationFn:async({personnelId:n,resend:r})=>{const{data:i,error:a}=await W.functions.invoke("invite-personnel",{body:{personnelId:n,resend:r}});if(a)throw a;return{...i,personnelId:n,resend:r}},onSuccess:({personnelId:n,status:r,userName:i,resend:a})=>{e.invalidateQueries({queryKey:["supplier-personnel"]}),t({action:a?"resend_personnel_invite":"invite_personnel",entityType:Ve.supplierPersonnel,entityId:n,entityLabel:i,metadata:{status:r}})}})}function _et(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async({id:r,...i})=>{if(t("Updating personnel"))throw new Error("Impersonation mode");const a={};i.fullName!==void 0&&(a.full_name=i.fullName),i.title!==void 0&&(a.title=i.title||null),i.linkedinUrl!==void 0&&(a.linkedin_url=i.linkedinUrl||null),i.email!==void 0&&(a.email=i.email||null),i.internalRole!==void 0&&(a.internal_role=i.internalRole);const{error:o}=await W.from("supplier_personnel").update(a).eq("id",r);if(o)throw o;return{id:r,updatedFields:Object.keys(a),fullName:i.fullName}},onSuccess:({id:r,updatedFields:i,fullName:a})=>{e.invalidateQueries({queryKey:["supplier-personnel"]}),n({action:"update_personnel",entityType:Ve.supplierPersonnel,entityId:r,entityLabel:a,metadata:{updated_fields:i}})}})}function ket(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async({personnelId:r,existingResult:i})=>{if(t("Verifying personnel"))throw new Error("Impersonation mode");const a={...i,patentAssigneeMatch:!0,authorityVerified:!0,matchScore:.94,checkedAt:new Date().toISOString()},{error:o}=await W.from("supplier_personnel").update({verification_status:"verified",verification_result:a,verified_at:new Date().toISOString()}).eq("id",r);
861if(o)throw o;return{personnelId:r,matchScore:a.matchScore}},onSuccess:({personnelId:r,matchScore:i})=>{e.invalidateQueries({queryKey:["supplier-personnel"]}),n({action:"verify_personnel",entityType:Ve.supplierPersonnel,entityId:r,metadata:{match_score:i}})}})}function Net(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async r=>{if(t("Deleting personnel"))throw new Error("Impersonation mode");const{error:i}=await W.from("supplier_personnel").delete().eq("id",r);if(i)throw i;return r},onSuccess:r=>{e.invalidateQueries({queryKey:["supplier-personnel"]}),n({action:"delete_personnel",entityType:Ve.supplierPersonnel,entityId:r})}})}function Cet(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async({personnelId:r,action:i,code:a})=>{if(t("Verifying personnel email"))throw new Error("Impersonation mode");const{data:o,error:l}=await W.functions.invoke("verify-personnel-email",{body:{personnelId:r,action:i,code:a}});if(l)throw l;return{...o,personnelId:r,action:i}},onSuccess:({personnelId:r,action:i})=>{e.invalidateQueries({queryKey:["supplier-personnel"]}),n({action:i==="send"?"send_personnel_email_code":"verify_personnel_email",entityType:Ve.supplierPersonnel,entityId:r,metadata:{email_action:i}})}})}function Rre({suppliers:e,activeIndex:t,onSwitch:n}){const[r,i]=x.useState(!1);if(e.length<2)return null;const a=e[t];return s.jsxs(Pb,{open:r,onOpenChange:i,children:[s.jsx(Ob,{asChild:!0,children:s.jsxs(je,{variant:"outline",size:"sm",className:"gap-2 max-w-[200px]",children:[s.jsx(pr,{className:"h-4 w-4 shrink-0"}),s.jsx("span",{className:"truncate",children:a.name}),s.jsx(Ta,{className:"h-3 w-3 shrink-0 opacity-50"})]})}),s.jsxs(kg,{className:"w-64 p-1",align:"end",children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-2 py-1.5",children:"Switch organization"}),e.map((o,l)=>s.jsxs("button",{onClick:()=>{n(o.id),i(!1)},className:ae("flex items-center gap-2 w-full rounded-sm px-2 py-2 text-sm transition-colors","hover:bg-accent hover:text-accent-foreground",l===t&&"bg-accent/50"),children:[s.jsx(pr,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),s.jsxs("div",{className:"flex-1 text-left min-w-0",children:[s.jsx("div",{className:"font-medium truncate",children:o.name}),s.jsx("div",{className:"text-xs text-muted-foreground truncate",children:o.location})]}),l===t&&s.jsx(Fr,{className:"h-4 w-4 shrink-0 text-primary"})]},o.id))]})]})}var aO=["Enter"," "],Aet=["ArrowDown","PageUp","Home"],Dre=["ArrowUp","PageDown","End"],Tet=[...Aet,...Dre],Eet={ltr:[...aO,"ArrowRight"],rtl:[...aO,"ArrowLeft"]},Pet={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Rb="Menu",[Lx,Oet,Iet]=Bm(Rb),[Bh,Mre]=sr(Rb,[Iet,Ou,cg]),kk=Ou(),$re=cg(),[Ret,Vh]=Bh(Rb),[Det,Db]=Bh(Rb),Lre=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,l=kk(t),[c,u]=x.useState(null),d=x.useRef(!1),h=Jn(a),f=Du(i);return x.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),s.jsx(F_,{...l,children:s.jsx(Ret,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:u,children:s.jsx(Det,{scope:t,onClose:x.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:f,modal:o,children:r})})})};Lre.displayName=Rb;var Met="MenuAnchor",BM=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=kk(n);return s.jsx(rb,{...i,...r,ref:t})});BM.displayName=Met;var VM="MenuPortal",[$et,Fre]=Bh(VM,{forceMount:void 0}),zre=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Vh(VM,t);return s.jsx($et,{scope:t,forceMount:n,children:s.jsx(vr,{present:n||a.open,children:s.jsx(Vm,{asChild:!0,container:i,children:r})})})};zre.displayName=VM;var _a="MenuContent",[Let,WM]=Bh(_a),Bre=x.forwardRef((e,t)=>{const n=Fre(_a,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Vh(_a,e.__scopeMenu),o=Db(_a,e.__scopeMenu);return s.jsx(Lx.Provider,{scope:e.__scopeMenu,children:s.jsx(vr,{present:r||a.open,children:s.jsx(Lx.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(Fet,{...i,ref:t}):s.jsx(zet,{...i,ref:t})})})})}),Fet=x.forwardRef((e,t)=>
vendor: 13,199 bytes, line 861
861{const n=Vh(_a,e.__scopeMenu),r=x.useRef(null),i=Ke(t,r);return x.useEffect(()=>{const a=r.current;if(a)return sS(a)},[]),s.jsx(UM,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:fe(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),zet=x.forwardRef((e,t)=>{const n=Vh(_a,e.__scopeMenu);return s.jsx(UM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Bet=yu("MenuContent.ScrollLock"),UM=x.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...g}=e,y=Vh(_a,n),b=Db(_a,n),v=kk(n),w=$re(n),_=Oet(n),[j,S]=x.useState(null),k=x.useRef(null),N=Ke(t,k,y.onContentChange),T=x.useRef(0),C=x.useRef(""),A=x.useRef(0),O=x.useRef(null),z=x.useRef("right"),$=x.useRef(0),F=m?db:x.Fragment,B=m?{as:Bet,allowPinchZoom:!0}:void 0,P=M=>{var Y,le;const R=C.current+M,K=_().filter(Z=>!Z.disabled),D=document.activeElement,E=(Y=K.find(Z=>Z.ref.current===D))==null?void 0:Y.textValue,q=K.map(Z=>Z.textValue),X=Jet(q,R,E),re=(le=K.find(Z=>Z.textValue===X))==null?void 0:le.ref.current;(function Z(de){C.current=de,window.clearTimeout(T.current),de!==""&&(T.current=window.setTimeout(()=>Z(""),1e3))})(R),re&&setTimeout(()=>re.focus())};x.useEffect(()=>()=>window.clearTimeout(T.current),[]),rS();const I=x.useCallback(M=>{var K,D;return z.current===((K=O.current)==null?void 0:K.side)&&ttt(M,(D=O.current)==null?void 0:D.area)},[]);return s.jsx(Let,{scope:n,searchRef:C,onItemEnter:x.useCallback(M=>{I(M)&&M.preventDefault()},[I]),onItemLeave:x.useCallback(M=>{var R;I(M)||((R=k.current)==null||R.focus(),S(null))},[I]),onTriggerLeave:x.useCallback(M=>{I(M)&&M.preventDefault()},[I]),pointerGraceTimerRef:A,onPointerGraceIntentChange:x.useCallback(M=>{O.current=M},[]),children:s.jsx(F,{...B,children:s.jsx(ub,{asChild:!0,trapped:i,onMountAutoFocus:fe(a,M=>{var R;M.preventDefault(),(R=k.current)==null||R.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(Eh,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:f,onDismiss:p,children:s.jsx(BR,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:j,onCurrentTabStopIdChange:S,onEntryFocus:fe(c,M=>{b.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(z_,{role:"menu","aria-orientation":"vertical","data-state":rie(y.open),"data-radix-menu-content":"",dir:b.dir,...v,...g,ref:N,style:{outline:"none",...g.style},onKeyDown:fe(g.onKeyDown,M=>{const K=M.target.closest("[data-radix-menu-content]")===M.currentTarget,D=M.ctrlKey||M.altKey||M.metaKey,E=M.key.length===1;K&&(M.key==="Tab"&&M.preventDefault(),!D&&E&&P(M.key));const q=k.current;if(M.target!==q||!Tet.includes(M.key))return;M.preventDefault();const re=_().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);Dre.includes(M.key)&&re.reverse(),Xet(re)}),onBlur:fe(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(T.current),C.current="")}),onPointerMove:fe(e.onPointerMove,Fx(M=>{const R=M.target,K=$.current!==M.clientX;if(M.currentTarget.contains(R)&&K){const D=M.clientX>$.current?"right":"left";z.current=D,$.current=M.clientX}}))})})})})})})});Bre.displayName=_a;var Vet="MenuGroup",qM=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ne.div,{role:"group",...r,ref:t})});qM.displayName=Vet;var Wet="MenuLabel",Vre=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ne.div,{...r,ref:t})});Vre.displayName=Wet;var t_="MenuItem",MV="menu.itemSelect",Nk=x.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=x.useRef(null),o=Db(t_,e.__scopeMenu),l=WM(t_,e.__scopeMenu),c=Ke(t,a),u=x.useRef(!1),d=()=>{const h=a.current;if(!n&&h){const f=new CustomEvent(MV,{bubbles:!0,cancelable:!0});h.addEventListener(MV,p=>r==null?void 0:r(p),{once:!0}),xI(h,f),f.defaultPrevented?u.current=!1:o.onClose()}};return s.jsx(Wre,{...i,ref:c,disabled:n,onClick:fe(e.onClick,d),onPointerDown:h=>{var f;(f=e.onPointerDown)==null||f.call(e,h),u.current=!0},onPointerUp:fe(e.onPointerUp,h=>{var f;u.current||(f=h.currentTarget)==null||f.click()}),onKeyDown:fe(e.onKeyDown,h=>{const f=l.searchRef.current!=="";n||f&&h.key===" "||aO.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Nk.displayName=t_;var Wre=x.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=WM(t_,n),l=$re(n),c=x.useRef(null),u=Ke(t,c),[d,h]=x.useState(!1),[f,p]=x.useState("");return x.useEffect(()=>{const m=c.current;m&&p((m.textContent??"").trim())},[a.children]),s.jsx(Lx.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:s.jsx(VR,{asChild:!0,...l,focusable:!r,children:s.jsx(Ne.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:fe(e.onPointerMove,Fx(m=>{r?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:fe(e.onPointerLeave,Fx(m=>o.onItemLeave(m))),onFocus:fe(e.onFocus,()=>h(!0)),onBlur:fe(e.onBlur,()=>h(!1))})})})}),Uet="MenuCheckboxItem",Ure=x.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return s.jsx(Yre,{scope:e.__scopeMenu,checked:n,children:s.jsx(Nk,{role:"menuitemcheckbox","aria-checked":n_(n)?"mixed":n,...i,ref:t,"data-state":KM(n),onSelect:fe(i.onSelect,()=>r==null?void 0:r(n_(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ure.displayName=Uet;var qre="MenuRadioGroup",[qet,Het]=Bh(qre,{value:void 0,onValueChange:()=>{}}),Hre=x.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=Jn(r);return s.jsx(qet,{scope:e.__scopeMenu,value:n,onValueChange:a,children:s.jsx(qM,{...i,ref:t})})});Hre.displayName=qre;var Kre="MenuRadioItem",Gre=x.forwardRef((e,t)=>{const{value:n,...r}=e,i=Het(Kre,e.__scopeMenu),a=n===i.value;return s.jsx(Yre,{scope:e.__scopeMenu,checked:a,children:s.jsx(Nk,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":KM(a),onSelect:fe(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});Gre.displayName=Kre;var HM="MenuItemIndicator",[Yre,Ket]=Bh(HM,{checked:!1}),Qre=x.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=Ket(HM,n);return s.jsx(vr,{present:r||n_(a.checked)||a.checked===!0,children:s.jsx(Ne.span,{...i,ref:t,"data-state":KM(a.checked)})})});Qre.displayName=HM;var Get="MenuSeparator",Xre=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ne.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Xre.displayName=Get;var Yet="MenuArrow",Zre=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=kk(n);return s.jsx(B_,{...i,...r,ref:t})});Zre.displayName=Yet;var Qet="MenuSub",[zpt,Jre]=Bh(Qet),Ay="MenuSubTrigger",eie=x.forwardRef((e,t)=>{const n=Vh(Ay,e.__scopeMenu),r=Db(Ay,e.__scopeMenu),i=Jre(Ay,e.__scopeMenu),a=WM(Ay,e.__scopeMenu),o=x.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,u={__scopeMenu:e.__scopeMenu},d=x.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return x.useEffect(()=>d,[d]),x.useEffect(()=>{const h=l.current;return()=>{window.clearTimeout(h),c(null)}},[l,c]),s.jsx(BM,{asChild:!0,...u,children:s.jsx(Wre,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":rie(n.open),...e,ref:Kl(t,i.onTriggerChange),onClick:h=>{var f;(f=e.onClick)==null||f.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:fe(e.onPointerMove,Fx(h=>{a.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:fe(e.onPointerLeave,Fx(h=>{var p,m;d();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const g=(m=n.content)==null?void 0:m.dataset.side,y=g==="right",b=y?-5:5,v=f[y?"left":"right"],w=f[y?"right":"left"];a.onPointerGraceIntentChange({area:[{x:h.clientX+b,y:h.clientY},{x:v,y:f.top},{x:w,y:f.top},{x:w,y:f.bottom},{x:v,y:f.bottom}],side:g}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(h),h.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:fe(e.onKeyDown,h=>{var p;const f=a.searchRef.current!=="";e.disabled||f&&h.key===" "||Eet[r.dir].includes(h.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),h.preventDefault())})})})});eie.displayName=Ay;var tie="MenuSubContent",nie=x.forwardRef((e,t)=>{const n=Fre(_a,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Vh(_a,e.__scopeMenu),o=Db(_a,e.__scopeMenu),l=Jre(tie,e.__scopeMenu),c=x.useRef(null),u=Ke(t,c);return s.jsx(Lx.Provider,{scope:e.__scopeMenu,children:s.jsx(vr,{present:r||a.open,children:s.jsx(Lx.Slot,{scope:e.__scopeMenu,children:s.jsx(UM,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var h;o.isUsingKeyboardRef.current&&((h=c.current)==null||h.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:fe(e.onFocusOutside,d=>{d.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:fe(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:fe(e.onKeyDown,d=>{var p;const h=d.currentTarget.contains(d.target),f=Pet[o.dir].includes(d.key);h&&f&&(a.onOpenChange(!1),(p=l.trigger)==null||p.focus(),d.preventDefault())})})})})})});nie.displayName=tie;function rie(e){return e?"open":"closed"}function n_(e){return e==="indeterminate"}function KM(e){return n_(e)?"indeterminate":e?"checked":"unchecked"}function Xet(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Zet(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Jet(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=Zet(e,Math.max(a,0));i.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function ett(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],c=t[o],u=l.x,d=l.y,h=c.x,f=c.y;d>r!=f>r&&n<(h-u)*(r-d)/(f-d)+u&&(i=!i)}return i}function ttt(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ett(n,t)}function Fx(e){return t=>t.pointerType==="mouse"?e(t):void 0}var ntt=Lre,rtt=BM,itt=zre,stt=Bre,att=qM,ott=Vre,ltt=Nk,ctt=Ure,utt=Hre,dtt=Gre,htt=Qre,ftt=Xre,ptt=Zre,mtt=eie,gtt=nie,Ck="DropdownMenu",[ytt,Bpt]=sr(Ck,[Mre]),Hi=Mre(),[vtt,iie]=ytt(Ck),sie=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=Hi(t),u=x.useRef(null),[d,h]=ji({prop:i,defaultProp:a??!1,onChange:o,caller:Ck});return s.jsx(vtt,{scope:t,triggerId:gr(),triggerRef:u,contentId:gr(),open:d,onOpenChange:h,onOpenToggle:x.useCallback(()=>h(f=>!f),[h]),modal:l,children:s.jsx(ntt,{...c,open:d,onOpenChange:h,dir:r,modal:l,children:n})})};sie.displayName=Ck;var aie="DropdownMenuTrigger",oie=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=iie(aie,n),o=Hi(n);return s.jsx(rtt,{asChild:!0,...o,children:s.jsx(Ne.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Kl(t,a.triggerRef),onPointerDown:fe(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:fe(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});oie.displayName=aie;var xtt="DropdownMenuPortal",lie=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Hi(t);return s.jsx(itt,{...r,...n})};lie.displayName=xtt;var cie="DropdownMenuContent",uie=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=iie(cie,n),a=Hi(n),o=x.useRef(!1);return s.jsx(stt,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:fe(e.onCloseAutoFocus,l=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:fe(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!i.modal||d)&&(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)"}})});uie.displayName=cie;var btt="DropdownMenuGroup",wtt=x.forwardRef((e,t)=>
861{const{__scopeDropdownMenu:n,...r}=e,i=Hi(n);return s.jsx(att,{...i,...r,ref:t})});wtt.displayName=btt;var jtt="DropdownMenuLabel",die=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Hi(n);return s.jsx(ott,{...i,...r,ref:t})});die.displayName=jtt;var _tt="DropdownMenuItem",hie=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Hi(n);return s.jsx(ltt,{...i,...r,ref:t})});hie.displayName=_tt;var Stt="DropdownMenuCheckboxItem",fie=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Hi(n);return s.jsx(ctt,{...i,...r,ref:t})});fie.displayName=Stt;var ktt="DropdownMenuRadioGroup",Ntt=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Hi(n);return s.jsx(utt,{...i,...r,ref:t})});Ntt.displayName=ktt;var Ctt="DropdownMenuRadioItem",pie=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Hi(n);return s.jsx(dtt,{...i,...r,ref:t})});pie.displayName=Ctt;var Att="DropdownMenuItemIndicator",mie=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Hi(n);return s.jsx(htt,{...i,...r,ref:t})});mie.displayName=Att;var Ttt="DropdownMenuSeparator",gie=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Hi(n);return s.jsx(ftt,{...i,...r,ref:t})});gie.displayName=Ttt;var Ett="DropdownMenuArrow",Ptt=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Hi(n);return s.jsx(ptt,{...i,...r,ref:t})});Ptt.displayName=Ett;var Ott="DropdownMenuSubTrigger",yie=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Hi(n);return s.jsx(mtt,{...i,...r,ref:t})});yie.displayName=Ott;var Itt="DropdownMenuSubContent",vie=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Hi(n);return s.jsx(gtt,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});vie.displayName=Itt;var Rtt=sie,Dtt=oie,Mtt=lie,xie=uie,bie=die,wie=hie,jie=fie,_ie=pie,Sie=mie,kie=gie,Nie=yie,Cie=vie;const Aie=Rtt,Tie=Dtt,$tt=x.forwardRef(({className:e,inset:t,children:n,...r},i)=>s.jsxs(Nie,{ref:i,className:ae("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),...r,children:[n,s.jsx(Us,{className:"ml-auto h-4 w-4"})]}));$tt.displayName=Nie.displayName;const Ltt=x.forwardRef(({className:e,...t},n)=>s.jsx(Cie,{ref:n,className:ae("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}));Ltt.displayName=Cie.displayName;const GM=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Mtt,{children:s.jsx(xie,{ref:r,sideOffset:t,className:ae("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));GM.displayName=xie.displayName;const r_=x.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(wie,{ref:r,className:ae("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 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));r_.displayName=wie.displayName;const Ftt=x.forwardRef(({className:e,children:t,checked:n,...r},i)=>s.jsxs(jie,{ref:i,className:ae("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:n,...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Sie,{children:s.jsx(Fr,{className:"h-4 w-4"})})}),t]}));Ftt.displayName=jie.displayName;const ztt=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(_ie,{ref:r,className:ae("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),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Sie,{children:s.jsx(vH,{className:"h-2 w-2 fill-current"})})}),t]}));
861ztt.displayName=_ie.displayName;const Btt=x.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(bie,{ref:r,className:ae("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Btt.displayName=bie.displayName;const Vtt=x.forwardRef(({className:e,...t},n)=>s.jsx(kie,{ref:n,className:ae("-mx-1 my-1 h-px bg-muted",e),...t}));Vtt.displayName=kie.displayName;const Wtt={"Small Molecule — KRAS Inhibitor":{productName:"XPH-SM-401",primaryTarget:"KRAS G12C",modality:"small-molecule",leadIndication:"Non-Small Cell Lung Cancer",stage:"clinical",origin:"In-house medicinal chemistry"},"Antibody — Bispecific PD-L1/VEGF":{productName:"XPH-AB-220",primaryTarget:"PD-L1 / VEGF-A",modality:"antibody",leadIndication:"Hepatocellular Carcinoma",stage:"clinical",origin:"Academic collaboration — University of Zurich"},"ADC — HER2-targeted":{productName:"XPH-ADC-105",primaryTarget:"HER2",modality:"adc",leadIndication:"HER2-low Breast Cancer",stage:"glp-tox",origin:"Licensed from BioLinker Therapeutics"}};function Utt({open:e,onOpenChange:t,asset:n,supplierId:r}){const{user:i}=me(),{toast:a}=xt(),o=Ae(),l=xr(),[c,u]=x.useState({productName:"",primaryTarget:"",modality:"small-molecule",leadIndication:"",stage:"discovery",origin:""});x.useEffect(()=>{e&&u({productName:"",primaryTarget:"",modality:"small-molecule",leadIndication:"",stage:"discovery",origin:""})},[e]);const d=$e({mutationFn:async()=>{const f={product_name:c.productName.trim(),primary_target:c.primaryTarget.trim()||null,modality:c.modality,lead_indication:c.leadIndication.trim()||null,stage:c.stage,origin:c.origin.trim()||null,supplier_id:r,submitted_by:i==null?void 0:i.id,asset_status:"draft"},{data:p,error:m}=await W.from("pharma_assets").insert(f).select("id").single();if(m)throw m;return p},onSuccess:f=>{o.invalidateQueries({queryKey:["supplier-assets"]}),a({title:"Draft created",description:"Continue filling in the asset details."}),t(!1),l(`/supplier/asset/${f.id}`)},onError:f=>{console.error("Asset creation error:",f),a({title:"Error",description:Qn(f,"Failed to create asset."),variant:"destructive"})}}),h=()=>{if(!c.productName.trim()){a({title:"Product name is required",variant:"destructive"});return}d.mutate()};return s.jsx(Br,{open:e,onOpenChange:t,children:s.jsxs(br,{className:"max-w-lg",children:[s.jsx(wr,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(jr,{children:"Create New Asset"}),s.jsxs(Aie,{children:[s.jsx(Tie,{asChild:!0,children:s.jsxs(je,{variant:"outline",size:"sm",className:"gap-1.5",children:[s.jsx(Cn,{className:"h-3.5 w-3.5"}),"Demo Fill"]})}),s.jsx(GM,{align:"end",className:"w-64",children:Object.entries(Wtt).map(([f,p])=>s.jsx(r_,{onClick:()=>u(p),children:f},f))})]})]})}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Start with the basics. You'll fill in all the details in the Asset Workspace after creation."}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"productName",children:"Product Name *"}),s.jsx(Fe,{id:"productName",value:c.productName,onChange:f=>u(p=>({...p,productName:f.target.value})),placeholder:"e.g., XPH-001"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"primaryTarget",children:"Primary Target"}),s.jsx(Fe,{id:"primaryTarget",value:c.primaryTarget,onChange:f=>u(p=>({...p,primaryTarget:f.target.value})),placeholder:"e.g., HER2"})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"modality",children:"Modality"}),s.jsxs($n,{value:c.modality,onValueChange:f=>u(p=>({...p,modality:f})),children:[s.jsx(On,{children:s.jsx(Ln,{})}),s.jsx(In,{children:Object.entries(Zt).map(([f,p])=>s.jsx(Rt,{value:f,children:p},f))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"stage",children:"Development Stage"}),s.jsxs($n,{value:c.stage,onValueChange:f=>u(p=>({...p,stage:f})),children:[s.jsx(On,{children:s.jsx(Ln,{})}),s.jsx(In,{children:mb.map(f=>s.jsx(Rt,{value:f,children:Nn[f]},f))})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"leadIndication",children:"Lead Indication"}),s.jsx(Fe,{id:"leadIndication",value:c.leadIndication,onChange:f=>u(p=>({...p,leadIndication:f.target.value})),placeholder:"e.g., Non-Small Cell Lung Cancer"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Pe,{htmlFor:"origin",children:"Origin"}),s.jsx(Fe,{id:"origin",value:c.origin,onChange:f=>u(p=>({...p,origin:f.target.value})),placeholder:"e.g., In-house discovery"})]})]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(je,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsxs(je,{onClick:h,disabled:d.isPending,children:[d.isPending?s.jsx(ne,{className:"h-4 w-4 mr-2 animate-spin"}):s.jsx(R_,{className:"h-4 w-4 mr-2"}),"Create Draft"]})]})]})})}
861function qtt({open:e,onOpenChange:t,onSubmit:n,onInvite:r,isLoading:i}){const[a,o]=x.useState(""),[l,c]=x.useState(""),[u,d]=x.useState(""),[h,f]=x.useState(""),[p,m]=x.useState("scientific_lead"),[g,y]=x.useState(null),[b,v]=x.useState(!1),w=async j=>{j.preventDefault(),y(null);const S=await n({fullName:a,title:l||void 0,linkedinUrl:h||void 0,email:u||void 0,internalRole:p});if(S!=null&&S.id&&r&&u){v(!0);try{const k=await r(S.id);y(k),setTimeout(()=>{_()},3e3)}catch{_()}finally{v(!1)}}else _()},_=()=>{o(""),c(""),d(""),f(""),m("scientific_lead"),y(null),t(!1)};return s.jsx(Br,{open:e,onOpenChange:j=>{j?t(j):_()},children:s.jsxs(br,{children:[s.jsx(wr,{children:s.jsx(jr,{children:"Invite Team Member"})}),g?s.jsxs("div",{className:"py-6 text-center space-y-3",children:[s.jsx("div",{className:"flex justify-center",children:g.status==="linked"?s.jsx(sn,{className:"h-12 w-12 text-green-600"}):s.jsx(qs,{className:"h-12 w-12 text-primary"})}),s.jsx(bn,{children:s.jsx(wn,{children:g.status==="linked"?`${g.userName||a} has been linked to your organization and can now access your supplier portal.`:`Invitation email sent to ${u}. They'll be linked to your organization when they sign up.`})}),s.jsx(je,{variant:"outline",onClick:_,children:"Close"})]}):s.jsxs("form",{onSubmit:w,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"fullName",children:"Full Name *"}),s.jsx(Fe,{id:"fullName",value:a,onChange:j=>o(j.target.value),required:!0,placeholder:"Jane Smith"})]}),s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"email",children:"Email *"}),s.jsx(Fe,{id:"email",type:"email",value:u,onChange:j=>d(j.target.value),required:!0,placeholder:"[email protected]"})]}),s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"internalRole",children:"Role"}),s.jsxs($n,{value:p,onValueChange:j=>m(j),children:[s.jsx(On,{children:s.jsx(Ln,{})}),s.jsxs(In,{children:[s.jsx(Rt,{value:"scientific_lead",children:"Scientific Lead"}),s.jsx(Rt,{value:"legal_reviewer",children:"Legal Reviewer"}),s.jsx(Rt,{value:"business_development",children:"Business Development"})]})]})]}),s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"title",children:"Job Title"}),s.jsx(Fe,{id:"title",value:l,onChange:j=>c(j.target.value),placeholder:"Chief Scientific Officer"})]}),s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"linkedinUrl",children:"LinkedIn Profile URL"}),s.jsx(Fe,{id:"linkedinUrl",value:h,onChange:j=>f(j.target.value),placeholder:"https://linkedin.com/in/..."})]}),s.jsxs(_i,{children:[s.jsx(je,{type:"button",variant:"outline",onClick:_,children:"Cancel"}),s.jsxs(je,{type:"submit",disabled:!a.trim()||!u.trim()||i||b,children:[(i||b)&&s.jsx(ne,{className:"h-4 w-4 mr-2 animate-spin"}),"Send Invitation"]})]})]})]})})}const Htt=e=>/[^\u0000-\u007F]/.test(e);function vA({label:e,value:t}){const[n,r]=x.useState(null),[i,a]=x.useState(!1),o=t&&Htt(t),l=async()=>{if(!(n||!t)){a(!0);try{const{data:c,error:u}=await W.functions.invoke("translate-text",{body:{text:t}});if(u)throw u;c!=null&&c.translated&&r(c.translated)}catch(c){z9({title:"Translation failed",description:c.message,variant:"destructive"})}finally{a(!1)}}};return s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:e}),s.jsxs("div",{className:"flex items-start gap-1.5",children:[s.jsx("p",{className:"font-medium",children:t||"—"}),o&&!n&&s.jsx(je,{variant:"ghost",size:"icon",className:"h-5 w-5 shrink-0 mt-0.5",onClick:l,disabled:i,title:"Translate to English",children:i?s.jsx(ne,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(Fde,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),n&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 italic border-l-2 border-muted pl-2",children:n})]})}const Ktt="Undisclosed supplier",Gtt={id:"",name:Ktt,location:"",verified:!1,assetsListed:0};function YM(e,t){return t.has(e.supplier.id)?e:{...e,supplier:Gtt,submittedBy:null,submitterEmail:null,submitterUserId:null,origin:null,manufacturingSite:null}}function Eie(){const{data:e}=An(),t=((e==null?void 0:e.allMemberships)??[]).map(r=>{var i;return(i=r.supplier)==null?void 0:i.id}).filter(r=>!!r),n=[...t].sort().join(",");return Se({queryKey:["own-assets-all-memberships",n],enabled:!!e&&t.length>0,queryFn:async()=>
861{if(t.length===0)return[];const{data:r,error:i}=await W.from("pharma_assets").select("*, suppliers (*)").in("supplier_id",t).order("listed_at",{ascending:!1});if(i)throw i;return r.map(a=>sl(a))}})}const Ytt=3;function $V(e){switch(e){case 1:return"same indication + stage + modality";case 2:return"same indication + stage";case 3:return"same indication";default:return"no match"}}function Qtt(e){switch(e){case 1:return"Direct competitor";case 2:return"Same stage";case 3:return"Same indication"}}function LV(e){if(!e)return null;const t=e.trim().toLowerCase();return t.length>0?t:null}function Pie(e,t,n={}){const r=n.minCount??Ytt,i=n.ownSupplierIds??new Set([e.supplier.id]),a=LV(e.leadIndication),o=e.stage,l=e.modality;if(!a)return{tier:null,matches:[],label:"No indication set on your asset",ownAsset:e};const u=t.filter(m=>m.id!==e.id&&!i.has(m.supplier.id)).filter(m=>LV(m.leadIndication)===a),d=u.filter(m=>m.stage===o),h=d.filter(m=>m.modality===l);let f;if(h.length>=r)f=h;else if(d.length>=r)f=d;else if(u.length>0)f=u;else return{tier:1,matches:[],label:$V(1),ownAsset:e};let p;return f.length===h.length?p=1:f.length===d.length?p=2:p=3,{tier:p,matches:f,label:$V(p),ownAsset:e}}function Xtt(e){const t=e.map(n=>n.estimatedNPV).filter(n=>typeof n=="number"&&Number.isFinite(n)&&n>0);return t.length===0?null:{min:Math.min(...t),max:Math.max(...t)}}function Ztt(e,t){return Se({queryKey:["competitive-insights-published",t],enabled:e,queryFn:async()=>{const{data:n,error:r}=await W.rpc("get_market_assets",{p_effective_user_id:t});if(r)throw r;return(n??[]).map(i=>sl(i))}})}function Jtt(){const{data:e,isFetched:t}=An(),{isImpersonating:n,impersonating:r}=qe(),i=n&&(r!=null&&r.userId)?r.userId:null,{data:a=[],isLoading:o}=Ztt(t,i),{data:l=[],isLoading:c}=Eie(),u=x.useMemo(()=>{var p;const h=new Set,f=(e==null?void 0:e.allMemberships)??[];for(const m of f)(p=m.supplier)!=null&&p.id&&h.add(m.supplier.id);return h},[e]),d=x.useMemo(()=>{const h=l.filter(p=>p.assetStatus==="published"),f=a.map(p=>YM(p,u));return h.map(p=>{const m=Pie(p,f,{ownSupplierIds:u});return{ownAsset:p,basket:m,npv:Xtt(m.matches)}})},[a,l,u]);return{insights:d,isLoading:o||c,hasPublished:d.length>0}}function FV(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:"compact",maximumFractionDigits:0}).format(e)}function ent(){const{insights:e,isLoading:t,hasPublished:n}=Jtt();return s.jsxs("div",{className:"xph-card",style:{padding:18,marginBottom:24},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:14,gap:12,flexWrap:"wrap"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:28,height:28,borderRadius:6,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(yH,{size:14})}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Competitive insights"}),s.jsx("div",{className:"tt-display-sm",style:{fontSize:15,marginTop:2},children:"How your assets compare"})]})]}),s.jsxs(oe,{to:"/supplier/market",className:"xph-btn xph-btn-outline xph-btn-sm",style:{textDecoration:"none"},children:["Open Market View",s.jsx(Gn,{size:12})]})]}),t?s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(ce,{className:"h-12 w-full"}),s.jsx(ce,{className:"h-12 w-full"})]}):n?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:e.map(({ownAsset:r,basket:i,npv:a})=>{const o=i.tier===null?"Add an indication to enable matching":`${i.matches.length} competitor${i.matches.length===1?"":"s"} — ${i.label}`;return s.jsxs(oe,{to:`/supplier/market?compareAsset=${r.id}`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,padding:"12px 14px",borderRadius:8,border:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-card))",textDecoration:"none",color:"inherit",transition:"background 150ms, border-color 150ms"},onMouseEnter:l=>{l.currentTarget.style.background="hsl(var(--c-surface))",l.currentTarget.style.borderColor="hsl(var(--c-border-strong))"},onMouseLeave:l=>{l.currentTarget.style.background="hsl(var(--c-card))",l.currentTarget.style.borderColor="hsl(var(--c-border))"},children:[s.jsxs("div",{style:{minWidth:0,flex:1},children:[s.jsx("p",{className:"tt-body",style:{fontWeight:600,color:"hsl(var(--c-ink))",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r.productName}),s.jsx("p",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:2},children:o})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexShrink:0},children:[a&&s.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:11.5,padding:"3px 8px",borderRadius:4,color:"hsl(var(--c-fg))",background:"hsl(var(--c-surface-2))",border:"1px solid hsl(var(--c-border))"},children:[FV(a.min)," – ",FV(a.max)]}),s.jsx(Gn,{size:14,style:{color:"hsl(var(--c-fg-subtle))"}})]})]},r.id)})}):s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"Publish an asset to see competitive benchmarks."})]})}function Ak(){const{user:e}=me();return Se({queryKey:["solution-partners"],enabled:!!e,staleTime:5*60*1e3,queryFn:async()=>{const[t,n,r]=await Promise.all([W.from("partner_profiles").select("*"),W.from("partner_capabilities").select("*"),W.from("partner_services").select("*").eq("active",!0).order("sort_order")]);for(const o of[t,n,r])if(o.error)throw o.error;const i=n.data??[],a=r.data??[];return(t.data??[]).map(o=>({profile:o,capabilities:i.filter(l=>l.org_id===o.org_id),services:a.filter(l=>l.org_id===o.org_id)}))}})}function tnt(e){var r;const t=Ak(),n=e?((r=t.data)==null?void 0:r.find(i=>i.profile.slug===e))??null:null;return{...t,partner:n}}function oO(e,t,n,r){const i=Vt.partnerAssetDetails(t,n),a=e.getQueryData(i),o=r??(a==null?void 0:a.id);return e.setQueryData(i,null),o&&e.setQueryData(Vt.partnerAssetDocuments(t,o),[]),o}async function QM(e){const t=Array.from(new Set(e.map(c=>c.partner_org_id))),n=Array.from(new Set(e.map(c=>
861c.client_supplier_id).filter(Boolean))),r=Array.from(new Set(e.map(c=>c.service_id).filter(Boolean))),[i,a,o]=await Promise.all([t.length?W.from("partner_profiles").select("org_id, display_name, slug").in("org_id",t):Promise.resolve({data:[],error:null}),n.length?W.from("suppliers").select("id, name").in("id",n):Promise.resolve({data:[],error:null}),r.length?W.from("partner_services").select("id, name").in("id",r):Promise.resolve({data:[],error:null})]);for(const c of[i,a,o])if(c.error)throw c.error;const l=i.data??[];return{partnerNameByOrgId:new Map(l.map(c=>[c.org_id,c.display_name])),partnerSlugByOrgId:new Map(l.map(c=>[c.org_id,c.slug])),supplierNameById:new Map((a.data??[]).map(c=>[c.id,c.name])),serviceNameById:new Map((o.data??[]).map(c=>[c.id,c.name]))}}function nnt(e){const{user:t}=me();return Se({queryKey:Vt.partnerEngagements(t==null?void 0:t.id,e),queryFn:async()=>{if(!e)return[];const{data:n,error:r}=await W.from("partner_engagements").select("*").eq("partner_org_id",e).order("created_at",{ascending:!1});if(r)throw r;const i=n??[],a=await QM(i);return i.map(o=>({engagement:o,counterpartName:(o.client_supplier_id?a.supplierNameById.get(o.client_supplier_id):null)??"xPharma client",serviceName:o.service_id?a.serviceNameById.get(o.service_id)??null:null}))},enabled:!!t&&!!e,refetchInterval:3e4})}function Oie(e){const{user:t}=me();return Se({queryKey:Vt.supplierEngagements(t==null?void 0:t.id,e),queryFn:async()=>{if(!e)return[];const{data:n,error:r}=await W.from("partner_engagements").select("*").eq("client_supplier_id",e).order("created_at",{ascending:!1});if(r)throw r;const i=n??[],a=await QM(i);return i.map(o=>({engagement:o,counterpartName:a.partnerNameByOrgId.get(o.partner_org_id)??"Solution partner",serviceName:o.service_id?a.serviceNameById.get(o.service_id)??null:null}))},enabled:!!t&&!!e,refetchInterval:3e4})}function Iie(e){const{user:t}=me(),n=Ae();return x.useEffect(()=>{if(!e)return;const r=W.channel(`engagement-${e}`).on("postgres_changes",{event:"*",schema:"public",table:"partner_engagements",filter:`id=eq.${e}`},()=>{n.invalidateQueries({queryKey:Vt.engagement(t==null?void 0:t.id,e)}),n.invalidateQueries({queryKey:["partner-engagements"]}),n.invalidateQueries({queryKey:["supplier-engagements"]})}).on("postgres_changes",{event:"*",schema:"public",table:"partner_engagement_assets",filter:`engagement_id=eq.${e}`},()=>{n.invalidateQueries({queryKey:Vt.engagement(t==null?void 0:t.id,e)}),n.invalidateQueries({queryKey:Vt.engagementAssetNames(t==null?void 0:t.id,e)}),n.invalidateQueries({queryKey:Vt.engagementAssetTeasers(t==null?void 0:t.id,e)}),n.invalidateQueries({queryKey:["partner-asset-details"]})}).subscribe();return()=>{W.removeChannel(r)}},[e,n,t==null?void 0:t.id]),Se({queryKey:Vt.engagement(t==null?void 0:t.id,e),queryFn:async()=>{const{data:r,error:i}=await W.from("partner_engagements").select("*").eq("id",e).maybeSingle();if(i)throw i;if(!r)return null;const a=r,{data:o,error:l}=await W.from("partner_engagement_assets").select("*").eq("engagement_id",e).order("created_at",{ascending:!0});if(l)throw l;const c=await QM([a]);return{engagement:a,assets:o??[],serviceName:a.service_id?c.serviceNameById.get(a.service_id)??null:null,partnerName:c.partnerNameByOrgId.get(a.partner_org_id)??"Solution partner",partnerSlug:c.partnerSlugByOrgId.get(a.partner_org_id)??null,clientName:(a.client_supplier_id?c.supplierNameById.get(a.client_supplier_id):null)??"xPharma client"}},enabled:!!t&&!!e,refetchInterval:3e4})}function Rie(e){const{user:t}=me();return Se({queryKey:Vt.engagementAssetTeasers(t==null?void 0:t.id,e),queryFn:async()=>{const{data:n,error:r}=await W.rpc("get_partner_engagement_asset_teasers",{p_engagement_id:e});if(r)throw r;return n??[]},enabled:!!t&&!!e,refetchInterval:3e4})}function rnt(e,t){const{user:n}=me(),r=Ae(),i=x.useMemo(()=>Vt.partnerAssetDetails(n==null?void 0:n.id,e),[e,n==null?void 0:n.id]);return x.useEffect(()=>{if(!e)return;let a=W.channel(`asset-link-${e}`).on("postgres_changes",{event:"*",schema:"public",table:"partner_engagement_assets",filter:`id=eq.${e}`},o=>{var f;const l=o.new,c=o.old,u=l.asset_id||l.access_status?l:c,d=(f=r.getQueryData(i))==null?void 0:f.id,h=u.asset_id??d;(o.eventType==="DELETE"||u.access_status!==void 0&&u.access_status!=="granted")&&oO(r,n==null?void 0:n.id,e,h),r.invalidateQueries({queryKey:i}),h&&r.invalidateQueries({queryKey:Vt.partnerAssetDocuments(n==null?void 0:n.id,h)})});return t&&(a=a.on("postgres_changes",{event:"UPDATE",schema:"public",table:"partner_engagements",filter:`id=eq.${t}`},o=>{const l=o.new.status;if(l==="completed"||l==="declined"){const c=oO(r,n==null?void 0:n.id,e);c&&r.invalidateQueries({queryKey:Vt.partnerAssetDocuments(n==null?void 0:n.id,c)})}
861r.invalidateQueries({queryKey:i})})),a.subscribe(),()=>{W.removeChannel(a)}},[i,e,t,r,n==null?void 0:n.id]),Se({queryKey:i,queryFn:async()=>{const{data:a,error:o}=await W.rpc("get_partner_asset_details",{p_engagement_asset_id:e});if(o)throw o;return(a??[])[0]??null},enabled:!!n&&!!e,retry:!1,refetchInterval:3e4})}function Tk(e,t,n={}){const r=Ae(),{user:i}=me(),{guardMutation:a}=qe();return $e({mutationFn:async o=>{if(a(e))throw new Error("Impersonation mode");const{error:l}=await t(o);if(l)throw l;return o},onSuccess:({engagementId:o,engagementAssetId:l,assetId:c})=>{if(n.failClosed){const u=oO(r,i==null?void 0:i.id,l,c);u&&r.invalidateQueries({queryKey:Vt.partnerAssetDocuments(i==null?void 0:i.id,u)})}r.invalidateQueries({queryKey:Vt.engagement(i==null?void 0:i.id,o)}),r.invalidateQueries({queryKey:Vt.engagementAssetTeasers(i==null?void 0:i.id,o)}),r.invalidateQueries({queryKey:Vt.partnerAssetDetails(i==null?void 0:i.id,l)})}})}function int(){return Tk("Requesting asset access",async({engagementAssetId:e})=>await W.rpc("request_engagement_asset_access",{p_engagement_asset_id:e}))}function snt(){return Tk("Granting asset access",async({engagementAssetId:e})=>await W.rpc("grant_engagement_asset_access",{p_engagement_asset_id:e}))}function ant(){return Tk("Denying asset access",async({engagementAssetId:e,reason:t})=>await W.rpc("deny_engagement_asset_access",{p_engagement_asset_id:e,p_reason:t??null}))}function ont(){return Tk("Revoking asset access",async({engagementAssetId:e,reason:t})=>await W.rpc("revoke_engagement_asset_access",{p_engagement_asset_id:e,p_reason:t??null}),{failClosed:!0})}function lnt(e){const{user:t}=me();return Se({queryKey:Vt.engagementClientAssets(t==null?void 0:t.id,e),queryFn:async()=>{const{data:n,error:r}=await W.from("pharma_assets").select("id, product_name").eq("supplier_id",e).order("product_name");if(r)throw r;return(n??[]).map(i=>({id:i.id,productName:i.product_name}))},enabled:!!t&&!!e})}function cnt(){const e=Ae(),{user:t}=me(),{guardMutation:n}=qe();return $e({mutationFn:async r=>{if(n("Requesting an engagement"))throw new Error("Impersonation mode");const{data:i,error:a}=await W.rpc("create_partner_engagement",{p_engagement_id:r.engagementId,p_partner_org_id:r.partnerOrgId,p_client_supplier_id:r.clientSupplierId,p_title:r.title,p_service_id:r.serviceId??null,p_brief:r.brief??null,p_asset_ids:r.assetIds??[],p_pre_grant:r.preGrant??!1,p_origin_surface:r.originSurface,p_origin_session_id:QI({userId:(t==null?void 0:t.id)??null,effectiveUserId:(t==null?void 0:t.id)??null})});if(a)throw a;return{engagementId:i,...r}},onSuccess:({clientSupplierId:r})=>{e.invalidateQueries({queryKey:Vt.supplierEngagements(t==null?void 0:t.id,r)})}})}function Die(){const e=Ae(),{user:t}=me(),{guardMutation:n}=qe();return $e({mutationFn:async r=>{if(n("Updating engagement status"))throw new Error("Impersonation mode");const{error:i}=await W.rpc("set_partner_engagement_status",{p_engagement_id:r.engagementId,p_status:r.status});if(i)throw i;return r},onSuccess:({engagementId:r,status:i})=>{if(e.invalidateQueries({queryKey:["engagement"]}),e.invalidateQueries({queryKey:["partner-engagements"]}),e.invalidateQueries({queryKey:["supplier-engagements"]}),i==="completed"||i==="declined"){const a=e.getQueriesData({queryKey:["engagement"]}).map(([,o])=>o).find(o=>(o==null?void 0:o.engagement.id)===r);for(const o of(a==null?void 0:a.assets)??[]){const l=Vt.partnerAssetDetails(t==null?void 0:t.id,o.id),c=Vt.partnerAssetDocuments(t==null?void 0:t.id,o.asset_id);e.setQueryData(l,null),e.setQueryData(c,[]),e.invalidateQueries({queryKey:l}),e.invalidateQueries({queryKey:c})}}}})}function unt(){const e=Ae(),{guardMutation:t}=qe();return $e({mutationFn:async n=>{if(t("Confirming the CDA"))throw new Error("Impersonation mode");const{error:r}=await W.rpc("confirm_engagement_cda",{p_engagement_id:n.engagementId,p_reference:n.reference??null});if(r)throw r;return n},onSuccess:()=>{e.invalidateQueries({queryKey:["engagement"]})}})}function dnt(){const e=Ae(),{guardMutation:t}=qe();return $e({mutationFn:async n=>{if(t("Attaching an asset"))throw new Error("Impersonation mode");const{error:r}=await W.rpc("attach_engagement_asset",{p_engagement_id:n.engagementId,p_asset_id:n.assetId});if(r)throw r;return n},onSuccess:()=>
861{e.invalidateQueries({queryKey:["engagement"]}),e.invalidateQueries({queryKey:["engagement-asset-names"]}),e.invalidateQueries({queryKey:["engagement-asset-teasers"]})}})}function Cl(e,t="Something went wrong. Please try again."){const n=e instanceof Error?e.message:String((e==null?void 0:e.message)??"");return n.includes("forbidden")?"You do not have permission to do that on this engagement.":n.includes("title_required")?"A title is required.":n.includes("partner_invalid")?"This solution partner is not available.":n.includes("service_invalid")?"This service is not available.":n.includes("service_side_invalid")?"This service is not available for supplier-originated engagements.":n.includes("asset_invalid")?"One of the selected assets does not belong to your organization.":n.includes("cda_pregrant_blocked")?"This service requires a CDA — asset access is granted after the CDA is confirmed.":n.includes("engagement_closed")?"This engagement is closed.":n.includes("engagement_not_found")?"Engagement not found.":n.includes("invalid_transition")?"That status change is not allowed from the current state.":n.includes("invalid_status")?"That status is not valid.":n.includes("cda_not_required")?"This engagement does not require a CDA.":n.includes("engagement_conflict")?"This request conflicts with an existing engagement. Refresh and try again.":n.includes("client_side_unsupported")?"This engagement type is not supported yet.":n.includes("cda_not_confirmed")?"Confirm the CDA on the engagement page before sharing asset details.":n.includes("not_granted")?"Access to this asset has not been granted.":n.includes("link_not_found")?"This asset is not part of the engagement.":t}const hnt=50,fnt=30,pnt=20,mnt=100;function Bl(e){return e.trim().toLowerCase()}function gnt(e,t){if(!t)return!1;const n=Bl(e),r=Bl(t);return!n||!r?!1:r.includes(n)||n.includes(r)}function lO(e,t){let n=null,r=null,i=0;for(const a of e)!n&&a.kind==="ta"&&gnt(a.value,t.therapeuticArea)&&(n=a.value),!r&&a.kind==="modality"&&t.modality&&Bl(a.value)===Bl(t.modality)&&(r=a.value);return n&&(i+=hnt),r&&(i+=fnt),e.some(a=>a.kind==="side"&&Bl(a.value)==="sell")&&(i+=pnt),{score:Math.min(i,mnt),matchedTa:n,matchedModality:r}}function ynt(e,t){if(t.length===0)return{...lO(e,{therapeuticArea:null,modality:null}),bestAssetIndex:-1};let n={score:-1,matchedTa:null,matchedModality:null,bestAssetIndex:-1};return t.forEach((r,i)=>{const a=lO(e,r);a.score>n.score&&(n={...a,bestAssetIndex:i})}),n}function vnt(e,t){const n=Bl(t).split(/[^a-z0-9-]+/).filter(a=>a.length>2);if(n.length===0)return 0;const r=Bl(e),i=n.filter(a=>r.includes(a)).length;return Math.round(i/n.length*100)}function xnt(e,t){return t==null?e:Math.round(e*.7+t*.3)}const bnt=(()=>{const e=vi.flatMap(t=>t.fields).find(t=>t.key==="modality");return Object.fromEntries(((e==null?void 0:e.options)??[]).map(t=>[t.value,t.label]))})();function zx(e,t){return e==="modality"?bnt[t]??t:e==="side"?t==="sell"?"Sell-side":t==="buy"?"Buy-side":t:t}const wnt=["[email protected]","[email protected]"];function jnt(e){if(!e)return!1;const t=e.toLowerCase();return wnt.some(n=>n.toLowerCase()===t)}function Ng({children:e,enabled:t,title:n="Solution Partners — coming soon",subtitle:r="Verified advisory firms to help move your programs. Launching here soon."}){const{user:i}=me(),a=t??!jnt(i==null?void 0:i.email),o=x.useCallback(l=>{l&&l.setAttribute("inert","")},[]);return a?s.jsxs("div",{style:{position:"relative"},"data-testid":"partner-coming-soon",children:[s.jsx("div",{ref:o,"aria-hidden":"true",style:{filter:"blur(7px)",pointerEvents:"none",userSelect:"none",opacity:.85},children:e}),s.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"flex-start",justifyContent:"center",padding:"clamp(24px, 12vh, 96px) 16px 16px",background:"hsl(var(--c-surface) / 0.35)"},children:s.jsxs("div",{className:"xph-card",style:{padding:"18px 22px",display:"flex",alignItems:"center",gap:12,maxWidth:460,boxShadow:"var(--shadow-md)"},children:[s.jsx("span",{style:{width:34,height:34,borderRadius:8,background:"hsl(var(--c-partner-soft))",color:"hsl(var(--c-partner))",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"none"},children:s.jsx(po,{size:17})}),s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",style:{fontSize:15},children:n}),s.jsx("p",{className:"tt-meta",style:{marginTop:3},children:r})]})]})})]}):s.jsx(s.Fragment,{children:e})}function Bx({name:e,logoUrl:t,size:n=46,radius:r=10}){if(t)return s.jsx("img",{src:t,alt:`${e} logo`,width:n,height:n,style:{width:n,height:n,borderRadius:r,objectFit:"cover",flex:"none"}});const i=e.trim().charAt(0).toUpperCase()||"?";return s.jsx("div",{"aria-hidden":"true",style:{width:n,height:n,borderRadius:r,flex:"none",background:"linear-gradient(150deg, hsl(var(--c-partner-fg)), hsl(var(--c-partner-ink)))",color:"hsl(var(--c-ink-inverse))",display:"grid",placeItems:"center",fontFamily:"var(--font-display)",fontWeight:600,fontSize:Math.round(n*.42),letterSpacing:"-0.02em"},children:i})}function XM({long:e=!1}){return s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:9.5,letterSpacing:"0.05em",textTransform:"uppercase",fontWeight:600,color:"hsl(var(--c-partner))",background:"hsl(var(--c-partner-soft))",border:"1px solid hsl(var(--c-partner-border))",borderRadius:4,padding:"3px 8px",whiteSpace:"nowrap"},children:[s.jsx(Fr,{size:10,strokeWidth:3}),e?"Verified Solution Partner":"Verified Partner"]})}function _nt(e){return[e.profile.slug,e.profile.partner_type??"",e.profile.tagline??"",e.profile.about??"",...e.capabilities.map(t=>zx(t.kind,t.value)),...e.services.map(t=>`${t.name} ${t.description??""}`)].join(" ")}function Snt(){var p;const{data:e,isError:t}=Ak(),{data:n=[]}=Sk(),{data:r}=An(),{data:i=[]}=Oie((p=r==null?void 0:r.supplier)==null?void 0:p.id),[a,o]=x.useState(""),[l,c]=x.useState(""),u=x.useMemo(()=>n.map(m=>({therapeuticArea:m.therapeuticArea,modality:m.modality})),[n]),d=x.useMemo(()=>e?e.map(m=>{const g=ynt(m.capabilities,u),y=l?vnt(_nt(m),l):null,b=[g.matchedTa,g.matchedModality?zx("modality",g.matchedModality):null].filter(
861Boolean);return{partner:m,sortScore:xnt(g.score,y),displayScore:g.score,matchReason:b.length?b.join(" · "):null}}).sort((m,g)=>g.sortScore-m.sortScore):[],[e,u,l]);if(t||d.length===0)return null;const[h,...f]=d;return s.jsx(Ng,{children:s.jsxs("div",{className:"xph-card",style:{overflow:"hidden",marginBottom:16},children:[s.jsxs("div",{style:{padding:"16px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,flexWrap:"wrap"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:30,height:30,borderRadius:7,background:"hsl(var(--c-partner-soft))",color:"hsl(var(--c-partner))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(po,{size:16})}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Solution Partners"}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:2},children:"Find help to move your programs"})]})]}),s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:14},children:[i.length>0&&s.jsxs(oe,{to:"/supplier/engagements",className:"tt-mono-sm",style:{textDecoration:"none",color:"hsl(var(--c-partner))"},children:["Your engagements (",i.length,") →"]}),s.jsx(oe,{to:"/solutions-partners",className:"tt-mono-sm",style:{textDecoration:"none",color:"hsl(var(--c-accent-fg))"},children:"Browse all partners →"})]})]}),s.jsxs("div",{style:{padding:18},children:[s.jsx("label",{className:"eyebrow",htmlFor:"partner-need",style:{display:"block",marginBottom:8},children:"Describe what you need"}),s.jsxs("form",{onSubmit:m=>{m.preventDefault(),c(a.trim())},style:{display:"flex",gap:10,alignItems:"stretch",flexWrap:"wrap"},children:[s.jsxs("div",{style:{position:"relative",flex:1,minWidth:280,display:"flex",alignItems:"center"},children:[s.jsx(Ea,{size:16,style:{position:"absolute",left:12,pointerEvents:"none",color:"hsl(var(--c-fg-subtle))"}}),s.jsx("input",{id:"partner-need",className:"xph-input",style:{paddingLeft:36,height:42,fontSize:14},placeholder:"e.g. I'm looking for help to license out one of our programs",value:a,onChange:m=>o(m.target.value)})]}),s.jsx("button",{type:"submit",className:"xph-btn xph-btn-primary",style:{height:42,padding:"0 20px"},children:"Search partners"})]}),s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"tt-mono-sm",style:{marginTop:14,marginBottom:10,color:"hsl(var(--c-fg-subtle))"},children:[d.length," partner",d.length===1?"":"s"," matched · ranked by fit"]}),s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden",borderColor:"hsl(var(--c-partner-border))"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,background:"hsl(var(--c-partner-soft))",borderBottom:"1px solid hsl(var(--c-partner-border))",padding:"6px 14px",fontFamily:"var(--font-mono)",fontSize:10,letterSpacing:"0.07em",textTransform:"uppercase",color:"hsl(var(--c-partner))",fontWeight:600},children:[s.jsx(OH,{size:11,strokeWidth:2.4}),"Top match",h.matchReason?` — ${h.matchReason}`:""]}),s.jsxs("div",{style:{display:"flex",gap:14,padding:16,alignItems:"flex-start"},children:[s.jsx(Bx,{name:h.partner.profile.display_name,logoUrl:h.partner.profile.logo_url,size:46}),s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,flexWrap:"wrap"},children:[s.jsx("span",{className:"tt-display-sm",children:h.partner.profile.display_name}),s.jsx(XM,{})]}),h.partner.profile.tagline&&s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:4},children:h.partner.profile.tagline}),s.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginTop:10},children:h.partner.services.slice(0,4).map(m=>s.jsx("span",{style:{fontSize:11,color:"hsl(var(--c-fg-muted))",background:"hsl(var(--c-surface-2))",borderRadius:4,padding:"3px 8px"},children:m.name},m.id))})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,alignItems:"flex-end",flex:"none"},children:[s.jsxs(oe,{to:`/solutions-partners/${h.partner.profile.slug}`,className:"xph-btn xph-btn-primary xph-btn-sm",style:{textDecoration:"none"},children:["View partner",s.jsx(Gn,{size:12})]}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["Match ",h.displayScore,"%"]})]})]})]}),f.map(({partner:m,displayScore:g})=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"13px 16px",border:"1px solid hsl(var(--c-border))",borderRadius:10,marginTop:8},children:[s.jsx(Bx,{name:m.profile.display_name,logoUrl:m.profile.logo_url,size:38,radius:9}),s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[s.jsx("span",{className:"tt-body",style:{color:"hsl(var(--c-ink))",fontWeight:500},children:m.profile.display_name}),s.jsx("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:"Verified Partner"})]}),m.profile.tagline&&s.jsx("p",{className:"tt-meta",style:{marginTop:2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m.profile.tagline})]}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["Match ",g,"%"]}),s.jsx(oe,{to:`/solutions-partners/${m.profile.slug}`,className:"xph-btn xph-btn-outline xph-btn-sm",style:{textDecoration:"none"},children:"View"})]},m.profile.id))]})]})]})})}const Mie={done:{bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))",label:"COMPLETE"},active:{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))",label:"IN PROGRESS"},pending:{bg:"hsl(var(--c-surface))",fg:"hsl(var(--c-fg-subtle))",label:"PENDING"}},knt={draft:{bg:"hsl(var(--c-surface))",fg:"hsl(var(--c-fg-muted))",border:"hsl(var(--c-border))",label:"DRAFT"},pending_review:{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))",border:"hsl(var(--c-warning-border))",label:"PENDING"},published:{bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))",border:"hsl(var(--c-positive-border))",label:"PUBLISHED"},rejected:{bg:"hsl(var(--c-negative-soft))",fg:"hsl(var(--c-negative-fg))",border:"hsl(var(--c-border))",label:"REJECTED"}};function $ie({status:e}){const t=Mie[e];return s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:9.5,color:t.fg,background:t.bg,padding:"2px 7px",borderRadius:3,letterSpacing:"0.06em",fontWeight:500},children:t.label})}
861function xA({index:e,label:t,description:n,status:r,onAction:i,actionLabel:a}){const o=Mie[r];return s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"28px 1fr auto",gap:14,alignItems:"center",padding:"14px 18px",borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsx("span",{style:{width:26,height:26,borderRadius:"50%",background:o.bg,color:o.fg,display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:11.5,fontWeight:600},children:r==="done"?s.jsx(Fr,{size:13}):e}),s.jsxs("div",{style:{minWidth:0},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[s.jsx("span",{className:"tt-body",style:{color:"hsl(var(--c-ink))",fontWeight:500},children:t}),s.jsx($ie,{status:r})]}),n&&s.jsx("p",{className:"tt-meta",style:{marginTop:3},children:n})]}),i&&a&&s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:i,children:[a,s.jsx(Gn,{size:11})]})]})}function Nnt(){var te,ve,we;const e=xr(),{user:t,isLoading:n,isAdmin:r}=me(),{isImpersonating:i}=qe(),{data:a,isLoading:o}=An(),{data:l=[],isLoading:c}=Sk(),{data:u}=Ene(),{data:d=[],isSuccess:h}=Ire(),f=_te(),p=wet(),m=jet(),g=Net(),{toast:y}=xt(),[b,v]=x.useState(!1),[w,_]=x.useState(null),[j,S]=x.useState(null),[k,N]=il(),T=k.get("tab"),A=T&&["all","draft","pending_review","published","rejected"].includes(T)?T:"all",[O,z]=x.useState(A),$=G=>{z(G);const U=new URLSearchParams(k);G==="all"?U.delete("tab"):U.set("tab",G),N(U,{replace:!0})},[F,B]=x.useState(!1),[P,I]=x.useState(null),M=x.useRef(!1);x.useEffect(()=>{var ie,ke;if(!t||!((ie=a==null?void 0:a.supplier)!=null&&ie.id)||!h||d.length>0||p.isPending||i||M.current)return;M.current=!0;const G=t.email||"",U=((ke=t.user_metadata)==null?void 0:ke.full_name)||G.split("@")[0]||"Registrant";p.mutate({fullName:U,email:G,internalRole:"admin",isPrimary:!0})},[t,a,h,d.length]);const R=(u==null?void 0:u.entityStatus)==="verified",K=(u==null?void 0:u.entityStatus)==="pending_approval",D=d.some(G=>G.verificationStatus==="verified"),E=l.some(G=>Qp(wu(G)).percent===100),X=[R,D,E].filter(Boolean).length,re=Math.round(X/3*100),Y=x.useMemo(()=>O==="all"?l:l.filter(G=>G.assetStatus===O),[l,O]),le=R&&D,Z=x.useMemo(()=>({all:l.length,draft:l.filter(G=>G.assetStatus==="draft").length,pending_review:l.filter(G=>G.assetStatus==="pending_review").length,published:l.filter(G=>G.assetStatus==="published").length,rejected:l.filter(G=>G.assetStatus==="rejected").length}),[l]),de=x.useMemo(()=>l.reduce((G,U)=>G+(Number.isFinite(U.estimatedNPV)?U.estimatedNPV:0),0),[l]);if(x.useEffect(()=>{if(!(n||o))if(!t)e("/auth");else{if(r&&!i&&!(a!=null&&a.isApproved))return;a!=null&&a.supplierUser?(a.isPending||a.isRejected)&&e("/supplier/pending"):e("/auth?supplier=true")}},[t,a,n,o,e,r,i]),n||o)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"32px 24px"},children:s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:256},children:s.jsx(ne,{className:"animate-spin",size:28,color:"hsl(var(--c-fg-muted))"})})})});if(r&&!i&&!(a!=null&&a.isApproved))return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"32px 24px"},children:s.jsx(Pre,{type:"supplier"})})});if(!t||!(a!=null&&a.supplierUser)||a.isPending||a.isRejected)return null;const pe=G=>{e(`/supplier/asset/${G.id}`)},J=async()=>{if(j)try{await f.mutateAsync(j),y({title:"Asset deleted successfully"}),S(null)}catch(G){y({title:"Error",description:G.message||"Failed to delete asset",variant:"destructive"})}},be=async()=>{if(P)try{await g.mutateAsync(P),y({title:"Team member removed"}),I(null)}catch(G){y({title:"Error",description:G.message,variant:"destructive"})}},ee=G=>G.assetStatus==="draft"||G.assetStatus==="rejected",Ce=G=>G.assetStatus==="draft",Re=G=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:"compact",maximumFractionDigits:0}).format(G),Ze=G=>{switch(G){case"verified":return{bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))"};case"in_progress":return{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))"};case"failed":return{bg:"hsl(var(--c-negative-soft))",fg:"hsl(var(--c-negative-fg))"};default:return{bg:"hsl(var(--c-surface))",fg:"hsl(var(--c-fg-subtle))"}}},Ee=R?"done":K?"active":"pending",kt=D?"done":d.length>0?"active":"pending",V=E?"done":l.length>0?"active":"pending",Q=[{value:"all",label:"All",count:Z.all},{value:"draft",label:"Draft",count:Z.draft}
861,{value:"pending_review",label:"Pending",count:Z.pending_review},{value:"published",label:"Published",count:Z.published},{value:"rejected",label:"Rejected",count:Z.rejected}];return s.jsxs(he,{children:[s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px 64px"},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:24,marginBottom:28},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:24,flexWrap:"wrap"},children:[s.jsxs("div",{style:{minWidth:0,flex:1},children:[s.jsx("div",{className:"eyebrow",children:"Supplier portal"}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,marginTop:8,flexWrap:"wrap"},children:[s.jsx("h1",{className:"tt-display-md",children:((te=a.supplier)==null?void 0:te.name)||"Supplier"}),a.allMemberships&&a.allMemberships.length>=2&&s.jsx(Rre,{suppliers:a.allMemberships.map(G=>({id:G.supplier.id,name:G.supplier.name,location:G.supplier.location})),activeIndex:a.activeSupplierIndex,onSwitch:a.switchSupplier}),X===3&&s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-positive-fg))",background:"hsl(var(--c-positive-soft))",border:"1px solid hsl(var(--c-positive-border))",borderRadius:4,padding:"3px 8px",letterSpacing:"0.04em",textTransform:"uppercase"},children:[s.jsx(sn,{size:11})," Onboarded"]})]}),s.jsx("p",{className:"tt-mono-sm",style:{marginTop:6},children:((ve=a.supplier)==null?void 0:ve.location)||"—"})]}),s.jsx("div",{style:{display:"flex",gap:8,flexShrink:0,alignItems:"center"},children:le?s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary",onClick:()=>{_(null),v(!0)},children:[s.jsx(io,{size:13}),"New Asset"]}):s.jsx(Rv,{children:s.jsxs(ni,{children:[s.jsx(ri,{asChild:!0,children:s.jsx("span",{tabIndex:0,children:s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary",disabled:!0,style:{pointerEvents:"none"},children:[s.jsx(io,{size:13}),"New Asset"]})})}),s.jsx(Kr,{children:"Complete entity and personnel verification first"})]})})})]}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 200px), 1fr))",gap:12},children:[{label:"Onboarding",value:`${X}/3`,meta:X===3?"Complete":`${re}% to live`,fg:X===3?"hsl(var(--c-positive-fg))":"hsl(var(--c-fg-subtle))"},{label:"Assets",value:String(Z.all),meta:`${Z.published} live · ${Z.draft} draft`,fg:"hsl(var(--c-fg-subtle))"},{label:"Pending review",value:String(Z.pending_review),meta:Z.pending_review>0?"Awaiting admin":"None queued",fg:Z.pending_review>0?"hsl(var(--c-warning-fg))":"hsl(var(--c-fg-subtle))"},{label:"Estimated NPV",value:l.length>0?Re(de):"—",meta:l.length>0?`Across ${l.length} asset${l.length===1?"":"s"}`:"List your first asset",fg:"hsl(var(--c-fg-subtle))"}].map(G=>s.jsxs("div",{className:"xph-card",style:{padding:"16px 18px"},children:[s.jsx("div",{className:"eyebrow",children:G.label}),s.jsx("div",{className:"tt-stat-md",style:{marginTop:6},children:G.value}),s.jsx("div",{className:"tt-mono-sm",style:{color:G.fg,marginTop:4},children:G.meta})]},G.label))})]}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1.1fr) minmax(0, 1fr)",gap:16,marginBottom:16},className:"lg:grid-cols-[1.1fr_1fr] grid-cols-1",children:[s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"16px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[s.jsxs("div",{children:[s.jsxs("div",{className:"eyebrow",children:["Listing checklist · ",re,"% complete"]}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:4},children:"Guided positioning."})]}),s.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:12,color:"hsl(var(--c-fg-subtle))"},children:[X,"/3"]})]}),s.jsx(xA,{index:1,label:"Entity verification",description:R?"Verified by xPharma admin.":K?"Submitted — awaiting admin approval.":"Verify your organization’s legal registration.",status:Ee,onAction:()=>e("/supplier/onboarding/entity"),actionLabel:R?"View":"Manage"}),s.jsx(xA,{index:2,label:"Personnel verification",description:D?`${d.filter(G=>G.verificationStatus==="verified").length}/${d.length} team member${d.length===1?"":"s"} verified.`:d.length>0?"Add and verify at least one key person.":"Invite your verifying team member.",status:kt,onAction:()=>{const G=document.getElementById("personnel-card");G==null||G.scrollIntoView({behavior:"smooth"})},actionLabel:D?"View":"Manage"}),s.jsx(xA,{index:3,label:"Complete a first asset",description:E?"At least one asset has all required fields filled.":l.length>0?"Continue completing required fields.":"Add and structure your first asset profile.",status:V,onAction:()=>
861{if(le&&l.length===0)_(null),v(!0);else{const G=document.getElementById("assets-card");G==null||G.scrollIntoView({behavior:"smooth"})}},actionLabel:E?"View":l.length===0?"Add asset":"Manage"}),s.jsxs("div",{style:{padding:"12px 18px",background:"hsl(var(--c-surface))",fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-fg-subtle))",display:"flex",justifyContent:"space-between",letterSpacing:"0.04em",textTransform:"uppercase"},children:[s.jsx("span",{children:"Status visible to buyers"}),s.jsx("span",{children:X===3?"Live · verified":`${3-X} step${3-X===1?"":"s"} remaining`})]})]}),s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"16px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:30,height:30,borderRadius:7,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(Hs,{size:15})}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Entity"}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:2},children:"Legal & registration"})]})]}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:()=>e("/supplier/onboarding/entity"),children:"Manage"})]}),s.jsxs("div",{style:{padding:"18px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:14},children:[s.jsx($ie,{status:Ee}),s.jsx("span",{className:"tt-mono-sm",children:R?`Verified ${u!=null&&u.entityVerifiedAt?rn(new Date(u.entityVerifiedAt),"MMM d, yyyy"):""}`:K?"Pending admin approval":"Action required"})]}),(R||K)&&(u!=null&&u.officialLegalName)?s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 180px), 1fr))",gap:"14px 18px"},children:[s.jsx(vA,{label:"Official Legal Name",value:u.officialLegalName}),s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow",children:"Country"}),s.jsx("p",{className:"tt-body-sm",style:{marginTop:4,color:"hsl(var(--c-ink))",fontWeight:500},children:u.country||"—"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow",children:"Identifier"}),s.jsx("p",{className:"tt-body-sm",style:{marginTop:4,color:"hsl(var(--c-ink))",fontWeight:500},children:u.identifierType&&u.identifierValue?`${u.identifierType.toUpperCase()}: ${u.identifierValue}`:"—"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow",children:"Registration Date"}),s.jsx("p",{className:"tt-body-sm",style:{marginTop:4,color:"hsl(var(--c-ink))",fontWeight:500},children:u.registrationDate?rn(new Date(u.registrationDate),"MMM d, yyyy"):"—"})]}),s.jsx(vA,{label:"Registered Address",value:u.registeredAddress}),s.jsx(vA,{label:"Legal Representative",value:u.legalRepresentative})]}):s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:(u==null?void 0:u.entityStatus)==="in_progress"?"Verification in progress.":"Complete entity verification to unlock asset verification."})]})]})]}),s.jsxs("div",{id:"personnel-card",className:"xph-card",style:{overflow:"hidden",marginBottom:16},children:[s.jsxs("div",{style:{padding:"16px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:30,height:30,borderRadius:7,background:"hsl(var(--c-stage-glp-bg))",color:"hsl(var(--c-stage-glp-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(po,{size:15})}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Personnel"}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:2},children:"Team & verifications"})]})]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:()=>B(!0),children:[s.jsx(io,{size:12}),"Invite"]})]}),d.length>0?s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{className:"xph-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Email"}),s.jsx("th",{children:"Role"}),s.jsx("th",{children:"Status"}),s.jsx("th",{style:{width:100},children:"Actions"})]})}),s.jsx("tbody",{children:d.map(G=>{const U=Ze(G.verificationStatus);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:G.fullName}),G.isPrimary&&s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:9.5,background:"hsl(var(--c-surface))",color:"hsl(var(--c-fg-muted))",border:"1px solid hsl(var(--c-border))",padding:"1px 6px",borderRadius:3,letterSpacing:"0.04em"},children:"PRIMARY"})]})}),s.jsx("td",{children:G.email||"—"}),s.jsx("td",{children:s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,background:"hsl(var(--c-surface))",color:"hsl(var(--c-fg-muted))",padding:"2px 7px",borderRadius:3,letterSpacing:"0.04em",textTransform:"uppercase"},children:rP[G.internalRole]||G.internalRole})}),s.jsx("td",{children:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,background:U.bg,color:U.fg,padding:"2px 7px",borderRadius:3,letterSpacing:"0.04em",textTransform:"uppercase"},children:YY[G.verificationStatus]}),G.invitationStatus==="invited"&&s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:10,
861color:"hsl(var(--c-warning-fg))",background:"hsl(var(--c-warning-soft))",padding:"2px 6px",borderRadius:3,letterSpacing:"0.04em",textTransform:"uppercase"},children:[s.jsx(qs,{size:9}),G.invitationTokenExpiresAt&&new Date(G.invitationTokenExpiresAt)<new Date?"Expired":"Invited"]}),G.invitationStatus==="accepted"&&s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:10,color:"hsl(var(--c-positive-fg))",background:"hsl(var(--c-positive-soft))",padding:"2px 6px",borderRadius:3,letterSpacing:"0.04em",textTransform:"uppercase"},children:[s.jsx(sn,{size:9}),"Active"]})]})}),s.jsx("td",{children:s.jsx(Rv,{children:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[s.jsxs(ni,{children:[s.jsx(ri,{asChild:!0,children:s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>e(`/supplier/personnel/${G.id}`),children:s.jsx(kI,{size:13})})}),s.jsx(Kr,{children:G.verificationStatus==="verified"?"View details":"Edit & verify"})]}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>I(G.id),title:G.isPrimary?"Cannot delete primary":"Delete",disabled:G.isPrimary,style:{color:"hsl(var(--c-negative-fg))"},children:s.jsx(Gl,{size:13})})]})})})]},G.id)})})]})}):s.jsx("div",{style:{padding:28,textAlign:"center"},children:s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"Add and verify at least one key person."})})]}),s.jsx("div",{style:{marginBottom:16},children:s.jsx(ent,{})}),s.jsx(Snt,{}),s.jsxs("div",{id:"assets-card",className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"16px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,flexWrap:"wrap"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:30,height:30,borderRadius:7,background:"hsl(var(--c-stage-preind-bg))",color:"hsl(var(--c-stage-preind-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(Bp,{size:15})}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Assets"}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:2},children:"Pipeline & listings"})]})]}),s.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:Q.map(G=>{const U=O===G.value;return s.jsxs("button",{type:"button",onClick:()=>$(G.value),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px",borderRadius:9999,background:U?"hsl(var(--c-ink))":"hsl(var(--c-card))",color:U?"hsl(var(--c-ink-inverse))":"hsl(var(--c-fg))",border:`1px solid ${U?"hsl(var(--c-ink))":"hsl(var(--c-border))"}`,fontSize:12.5,fontWeight:500,cursor:"pointer",transition:"all 150ms"},children:[G.label,s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,color:U?"hsl(var(--c-ink-inverse))":"hsl(var(--c-fg-subtle))",opacity:U?.85:1},children:G.count})]},G.value)})})]}
861),c?s.jsx("div",{style:{padding:18,display:"flex",flexDirection:"column",gap:8},children:[...Array(3)].map((G,U)=>s.jsx(ce,{className:"h-12 w-full"},U))}):Y.length===0?s.jsxs("div",{style:{padding:"48px 24px",textAlign:"center"},children:[s.jsx("span",{style:{width:48,height:48,borderRadius:12,background:"hsl(var(--c-surface))",color:"hsl(var(--c-fg-subtle))",display:"inline-flex",alignItems:"center",justifyContent:"center",marginBottom:14},children:s.jsx(Bp,{size:20})}),s.jsx("h3",{className:"tt-display-sm",children:"No assets found"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6,marginBottom:18},children:O==="all"?"You haven't created any assets yet.":`No assets with status "${$R[O]}".`}),O==="all"&&(le?s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary",onClick:()=>{_(null),v(!0)},children:[s.jsx(io,{size:13}),"Create your first asset"]}):s.jsxs("div",{className:"xph-card",style:{maxWidth:420,margin:"0 auto",padding:20,textAlign:"left",background:"hsl(var(--c-surface))"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:14},children:[s.jsx(Zo,{size:15,color:"hsl(var(--c-fg-muted))"}),s.jsx("span",{className:"tt-display-sm",style:{fontSize:14},children:"Complete verification first"})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10,marginBottom:14},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[R?s.jsx(sn,{size:14,color:"hsl(var(--c-positive-fg))"}):s.jsx(va,{size:14,color:"hsl(var(--c-warning-fg))"}),s.jsx("span",{className:"tt-body-sm",children:"Entity verification"})]}),!R&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:()=>e("/supplier/onboarding/entity"),children:"Manage"})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[D?s.jsx(sn,{size:14,color:"hsl(var(--c-positive-fg))"}):s.jsx(va,{size:14,color:"hsl(var(--c-warning-fg))"}),s.jsx("span",{className:"tt-body-sm",children:"Personnel verification"})]}),!D&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:()=>{const G=document.getElementById("personnel-card");G==null||G.scrollIntoView({behavior:"smooth"})},children:"Manage"})]})]}),s.jsx("p",{className:"tt-meta",children:"Complete both steps to unlock asset management."})]}))]}):s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{className:"xph-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Target"}),s.jsx("th",{children:"Modality"}),s.jsx("th",{children:"Stage"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Completeness"}),s.jsx("th",{style:{textAlign:"right"},children:"Est. NPV"}),s.jsx("th",{style:{textAlign:"right"},children:"Actions"})]})}),s.jsx("tbody",{children:Y.map(G=>{const U=Qp(wu(G)),ie=knt[G.assetStatus];return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("button",{type:"button",onClick:()=>pe(G),style:{background:"transparent",border:0,padding:0,cursor:"pointer",color:"hsl(var(--c-ink))",fontWeight:500,textAlign:"left"},onMouseEnter:ke=>ke.currentTarget.style.textDecoration="underline",onMouseLeave:ke=>ke.currentTarget.style.textDecoration="none",children:G.productName})}),s.jsx("td",{children:G.primaryTarget}),s.jsx("td",{style:{color:"hsl(var(--c-fg-muted))"},children:Zt[G.modality]}),s.jsx("td",{children:s.jsx(Xp,{stage:G.stage,size:"sm"})}),s.jsx("td",{children:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,background:ie.bg,color:ie.fg,border:`1px solid ${ie.border}`,padding:"2px 7px",borderRadius:3,letterSpacing:"0.04em"},children:ie.label}),G.assetStatus==="rejected"&&G.assetRejectionReason&&s.jsx(va,{size:13,color:"hsl(var(--c-negative-fg))"})]})}),s.jsx("td",{children:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:120},children:[s.jsx("div",{style:{flex:1,height:6,background:"hsl(var(--c-surface-2))",borderRadius:3,overflow:"hidden"},children:s.jsx("div",{style:{height:"100%",width:`${U.percent}%`,background:U.percent===100?"hsl(var(--c-positive))":U.percent>0?"hsl(var(--c-warning))":"hsl(var(--c-fg-subtle))",borderRadius:3,transition:"width 200ms"}})}),s.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-fg-subtle))",whiteSpace:"nowrap"},children:[U.filled,"/",U.total]})]})}),s.jsx("td",{style:{textAlign:"right",fontFamily:"var(--font-mono)",fontSize:12.5,color:"hsl(var(--c-ink))"},children:Re(G.estimatedNPV)}),s.jsx("td",{style:{textAlign:"right"},children:s.jsxs("div",{style:{display:"inline-flex",gap:2,justifyContent:"flex-end"},children:[s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>e(`/supplier/onboarding/asset/${G.id}`),title:R&&D?"Verify Asset":"Complete entity & personnel verification first",disabled:!(R&&D),children:s.jsx(Hs,{size:14})}),ee(G)?s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>pe(G),title:"Edit",children:s.jsx(PH,{size:14})}):s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>pe(G),title:"View",children:s.jsx(Na,{size:14})}),Ce(G)&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>S(G.id),title:"Delete",style:{color:"hsl(var(--c-negative-fg))"},children:s.jsx(Gl,{size:14})}),G.assetStatus==="pending_review"&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",disabled:!0,title:"Awaiting Review",children:s.jsx(Yn,{size:14})})]})})]},G.id)})})]})})]})]})}),s.jsx(Utt,{open:b,onOpenChange:v,asset:w,supplierId:((we=a.supplier)==null?void 0:we.id)||""}),s.jsx(ku,{open:!!j,onOpenChange:G=>!G&&S(null),onConfirm:J,title:"Delete Asset",description:"Are you sure you want to delete this draft asset? This action cannot be undone.",isLoading:f.isPending}),s.jsx(qtt,{open:F,onOpenChange:B,onSubmit:async G=>{try{return await p.mutateAsync(G)}catch(U){throw y({title:"Error",description:U.message,variant:"destructive"}),U}},onInvite:async G=>await m.mutateAsync({personnelId:G}),isLoading:p.isPending}),s.jsx(ku,{open:!!P,onOpenChange:G=>!G&&I(null),onConfirm:be,title:"Delete Team Member",description:"This will permanently remove this person from your team. This action cannot be undone.",isLoading:g.isPending})]})}function Cnt(){var y;const e=xr(),{user:t,signOut:n,isLoading:r}=me(),{data:i,isLoading:a}
861=An();if(x.useEffect(()=>{!r&&!t&&e("/auth")},[t,r,e]),x.useEffect(()=>{i!=null&&i.isApproved&&e("/supplier")},[i,e]),r||a)return s.jsx(he,{children:s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"96px 0"},children:s.jsx(ne,{className:"animate-spin",size:28,color:"hsl(var(--c-fg-muted))"})})});if(!(i!=null&&i.supplierUser))return s.jsx(he,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"calc(100vh - 56px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"48px 24px"},children:s.jsxs("div",{className:"xph-card",style:{width:"100%",maxWidth:420,padding:28,textAlign:"center"},children:[s.jsx("div",{className:"eyebrow",children:"No registration"}),s.jsx("h2",{className:"tt-display-sm",style:{marginTop:8},children:"No registration found"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:10,marginBottom:22},children:"You haven't registered as a supplier yet."}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary",onClick:()=>e("/auth?supplier=true"),children:["Register as supplier",s.jsx(Gn,{size:13})]})]})})});const{supplierUser:o}=i,l=!o.supplierId&&o.pendingCompanyName,c=l?o.pendingCompanyName:(y=o.supplier)==null?void 0:y.name,u=async()=>{await n(),e("/")},d=i.isPending?"Status · pending":"Status · rejected",h=i.isPending?"Registration pending":"Registration rejected",f=i.isPending?"Your supplier account is awaiting admin approval.":"Your supplier registration was not approved.",p=i.isPending?"hsl(var(--c-warning-soft))":"hsl(var(--c-negative-soft))",m=i.isPending?"hsl(var(--c-warning-fg))":"hsl(var(--c-negative-fg))",g=i.isPending?{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))",label:"PENDING REVIEW"}:{bg:"hsl(var(--c-negative-soft))",fg:"hsl(var(--c-negative-fg))",label:"REJECTED"};return s.jsx(he,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"calc(100vh - 56px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"48px 24px"},children:s.jsxs("div",{className:"xph-card",style:{width:"100%",maxWidth:480,padding:32},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",marginBottom:24},children:[s.jsxs("span",{style:{width:52,height:52,borderRadius:12,background:p,color:m,display:"inline-flex",alignItems:"center",justifyContent:"center",marginBottom:16,position:"relative"},children:[i.isPending?s.jsx(Yn,{size:22}):s.jsx(gn,{size:22}),i.isPending&&s.jsx("span",{className:"vt-pulse",style:{position:"absolute",top:6,right:6,width:8,height:8,borderRadius:"50%",background:"hsl(var(--c-warning))"}})]}),s.jsx("div",{className:"eyebrow",children:d}),s.jsx("h2",{className:"tt-display-md",style:{marginTop:8},children:h}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:10,maxWidth:380},children:f})]}),s.jsxs("div",{style:{border:"1px solid hsl(var(--c-border))",borderRadius:8,padding:"14px 16px",marginBottom:12},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10},children:[s.jsx(pr,{size:14,color:"hsl(var(--c-fg-muted))"}),s.jsx("span",{className:"eyebrow",children:"Company"}),l&&s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:9.5,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",padding:"1px 6px",borderRadius:3,letterSpacing:"0.04em"},children:"NEW"})]}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-ink))",fontWeight:500},children:c||"Unknown"}),l&&o.pendingCompanyLocation&&s.jsx("p",{className:"tt-meta",style:{marginTop:4},children:o.pendingCompanyLocation})]}),s.jsxs("div",{style:{border:"1px solid hsl(var(--c-border))",borderRadius:8,padding:"14px 16px",marginBottom:16,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[s.jsx("span",{className:"eyebrow",children:"Review status"}),s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,background:g.bg,color:g.fg,padding:"3px 8px",borderRadius:3,letterSpacing:"0.06em",fontWeight:500},children:g.label})]}),i.isRejected&&o.rejectionReason&&s.jsxs("div",{style:{border:"1px solid hsl(var(--c-border))",borderLeft:"3px solid hsl(var(--c-negative))",background:"hsl(var(--c-negative-soft))",borderRadius:8,padding:"14px 16px",marginBottom:16},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[s.jsx(gn,{size:13,color:"hsl(var(--c-negative-fg))"}),s.jsx("span",{className:"eyebrow",style:{color:"hsl(var(--c-negative-fg))"},children:"Rejection reason"})]}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-negative-deep))"},children:o.rejectionReason})]}),i.isPending&&s.jsxs("div",{style:{border:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-surface))",borderRadius:8,padding:"14px 16px",marginBottom:16},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[s.jsx(Yn,{size:13,color:"hsl(var(--c-fg-muted))"}),s.jsx("span",{className:"eyebrow",children:"What happens next"})]}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg)) "},children:"An admin will review your registration. Once approved, you'll be able to access the supplier portal and start listing pharma assets."})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,paddingTop:8},children:[s.jsx("button",{type:"button",className:"xph-btn xph-btn-outline",onClick:()=>e("/"),children:"Return to home"}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-ghost",onClick:u,children:[s.jsx(gj,{size:13}),"Sign out"]})]})]})})})}function Ant(){const e=xr();return x.useEffect(()=>{e("/supplier",{replace:!0})},[e]),null}var ZM="Radio",[Tnt,Lie]=sr(ZM),[Ent,Pnt]=Tnt(ZM),Fie=x.forwardRef((e,t)=>
vendor: 4,445 bytes, line 861
861{const{__scopeRadio:n,name:r,checked:i=!1,required:a,disabled:o,value:l="on",onCheck:c,form:u,...d}=e,[h,f]=x.useState(null),p=Ke(t,y=>f(y)),m=x.useRef(!1),g=h?u||!!h.closest("form"):!0;return s.jsxs(Ent,{scope:n,checked:i,disabled:o,children:[s.jsx(Ne.button,{type:"button",role:"radio","aria-checked":i,"data-state":Wie(i),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:p,onClick:fe(e.onClick,y=>{i||c==null||c(),g&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),g&&s.jsx(Vie,{control:h,bubbles:!m.current,name:r,value:l,checked:i,required:a,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});Fie.displayName=ZM;var zie="RadioIndicator",Bie=x.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,a=Pnt(zie,n);return s.jsx(vr,{present:r||a.checked,children:s.jsx(Ne.span,{"data-state":Wie(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:t})})});Bie.displayName=zie;var Ont="RadioBubbleInput",Vie=x.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{const o=x.useRef(null),l=Ke(o,a),c=gb(n),u=nb(t);return x.useEffect(()=>{const d=o.current;if(!d)return;const h=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&p){const m=new Event("click",{bubbles:r});p.call(d,n),d.dispatchEvent(m)}},[c,n,r]),s.jsx(Ne.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Vie.displayName=Ont;function Wie(e){return e?"checked":"unchecked"}var Int=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ek="RadioGroup",[Rnt,Vpt]=sr(Ek,[cg,Lie]),Uie=cg(),qie=Lie(),[Dnt,Mnt]=Rnt(Ek),Hie=x.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:a,required:o=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:h,...f}=e,p=Uie(n),m=Du(u),[g,y]=ji({prop:a,defaultProp:i??null,onChange:h,caller:Ek});return s.jsx(Dnt,{scope:n,name:r,required:o,disabled:l,value:g,onValueChange:y,children:s.jsx(BR,{asChild:!0,...p,orientation:c,dir:m,loop:d,children:s.jsx(Ne.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:m,...f,ref:t})})})});Hie.displayName=Ek;var Kie="RadioGroupItem",Gie=x.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,a=Mnt(Kie,n),o=a.disabled||r,l=Uie(n),c=qie(n),u=x.useRef(null),d=Ke(t,u),h=a.value===i.value,f=x.useRef(!1);return x.useEffect(()=>{const p=g=>{Int.includes(g.key)&&(f.current=!0)},m=()=>f.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",m)}},[]),s.jsx(VR,{asChild:!0,...l,focusable:!o,active:h,children:s.jsx(Fie,{disabled:o,required:a.required,checked:h,...c,...i,name:a.name,ref:d,onCheck:()=>a.onValueChange(i.value),onKeyDown:fe(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:fe(i.onFocus,()=>{var p;f.current&&((p=u.current)==null||p.click())})})})});Gie.displayName=Kie;var $nt="RadioGroupIndicator",Yie=x.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=qie(n);return s.jsx(Bie,{...i,...r,ref:t})});Yie.displayName=$nt;var Qie=Hie,Xie=Gie,Lnt=Yie;const cO=x.forwardRef(({className:e,...t},n)=>s.jsx(Qie,{className:ae("grid gap-2",e),...t,ref:n}));cO.displayName=Qie.displayName;const Ty=x.forwardRef(({className:e,...t},n)=>s.jsx(Xie,{ref:n,className:ae("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:s.jsx(Lnt,{className:"flex items-center justify-center",children:s.jsx(vH,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Ty.displayName=Xie.displayName;var ot=function(){return ot=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},ot.apply(this,arguments)};function Fnt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Zie(e,t,n){for(var r=0,i=t.length,a;r<i;
861r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function Mb(e){return e.mode==="multiple"}function $b(e){return e.mode==="range"}function Pk(e){return e.mode==="single"}var znt={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 Bnt(e,t){return rn(e,"LLLL y",t)}function Vnt(e,t){return rn(e,"d",t)}function Wnt(e,t){return rn(e,"LLLL",t)}function Unt(e){return"".concat(e)}function qnt(e,t){return rn(e,"cccccc",t)}function Hnt(e,t){return rn(e,"yyyy",t)}var Knt=Object.freeze({__proto__:null,formatCaption:Bnt,formatDay:Vnt,formatMonthCaption:Wnt,formatWeekNumber:Unt,formatWeekdayName:qnt,formatYearCaption:Hnt}),Gnt=function(e,t,n){return rn(e,"do MMMM (EEEE)",n)},Ynt=function(){return"Month: "},Qnt=function(){return"Go to next month"},Xnt=function(){return"Go to previous month"},Znt=function(e,t){return rn(e,"cccc",t)},Jnt=function(e){return"Week n. ".concat(e)},ert=function(){return"Year: "},trt=Object.freeze({__proto__:null,labelDay:Gnt,labelMonthDropdown:Ynt,labelNext:Qnt,labelPrevious:Xnt,labelWeekNumber:Jnt,labelWeekday:Znt,labelYearDropdown:ert});function nrt(){var e="buttons",t=znt,n=gk,r={},i={},a=1,o={},l=new Date;return{captionLayout:e,classNames:t,formatters:Knt,labels:trt,locale:n,modifiersClassNames:r,modifiers:i,numberOfMonths:a,styles:o,today:l,mode:"default"}}function rrt(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,i=e.toMonth,a=e.fromDate,o=e.toDate;return r?a=hs(r):t&&(a=new Date(t,0,1)),i?o=mk(i):n&&(o=new Date(n,11,31)),{fromDate:a?Pm(a):void 0,toDate:o?Pm(o):void 0}}var Jie=x.createContext(void 0);function irt(e){var t,n=e.initialProps,r=nrt(),i=rrt(n),a=i.fromDate,o=i.toDate,l=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;l!=="buttons"&&(!a||!o)&&(l="buttons");var c;(Pk(n)||Mb(n)||$b(n))&&(c=n.onSelect);var u=ot(ot(ot({},r),n),{captionLayout:l,classNames:ot(ot({},r.classNames),n.classNames),components:ot({},n.components),formatters:ot(ot({},r.formatters),n.formatters),fromDate:a,labels:ot(ot({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:ot(ot({},r.modifiers),n.modifiers),modifiersClassNames:ot(ot({},r.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:ot(ot({},r.styles),n.styles),toDate:o});return s.jsx(Jie.Provider,{value:u,children:e.children})}function yn(){var e=x.useContext(Jie);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function ese(e){var t=yn(),n=t.locale,r=t.classNames,i=t.styles,a=t.formatters.formatCaption;return s.jsx("div",{className:r.caption_label,style:i.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:a(e.displayMonth,{locale:n})})}function srt(e){return s.jsx("svg",ot({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:s.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
86178175,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 tse(e){var t,n,r=e.onChange,i=e.value,a=e.children,o=e.caption,l=e.className,c=e.style,u=yn(),d=(n=(t=u.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:srt;return s.jsxs("div",{className:l,style:c,children:[s.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),s.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:i,onChange:r,children:a}),s.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[o,s.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function art(e){var t,n=yn(),r=n.fromDate,i=n.toDate,a=n.styles,o=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,u=n.components,d=n.labels.labelMonthDropdown;if(!r)return s.jsx(s.Fragment,{});if(!i)return s.jsx(s.Fragment,{});var h=[];if(KQe(r,i))for(var f=hs(r),p=r.getMonth();p<=i.getMonth();p++)h.push(XC(f,p));else for(var f=hs(new Date),p=0;p<=11;p++)h.push(XC(f,p));var m=function(y){var b=Number(y.target.value),v=XC(hs(e.displayMonth),b);e.onChange(v)},g=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:tse;return s.jsx(g,{name:"months","aria-label":d(),className:c.dropdown_month,style:a.dropdown_month,onChange:m,value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:o}),children:h.map(function(y){return s.jsx("option",{value:y.getMonth(),children:l(y,{locale:o})},y.getMonth())})})}function ort(e){var t,n=e.displayMonth,r=yn(),i=r.fromDate,a=r.toDate,o=r.locale,l=r.styles,c=r.classNames,u=r.components,d=r.formatters.formatYearCaption,h=r.labels.labelYearDropdown,f=[];if(!i)return s.jsx(s.Fragment,{});if(!a)return s.jsx(s.Fragment,{});for(var p=i.getFullYear(),m=a.getFullYear(),g=p;g<=m;g++)f.push(uV(gne(new Date),g));var y=function(v){var w=uV(hs(n),Number(v.target.value));e.onChange(w)},b=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:tse;return s.jsx(b,{name:"years","aria-label":h(),className:c.dropdown_year,style:l.dropdown_year,onChange:y,value:n.getFullYear(),caption:d(n,{locale:o}),children:f.map(function(v){return s.jsx("option",{value:v.getFullYear(),children:d(v,{locale:o})},v.getFullYear())})})}function lrt(e,t){var n=x.useState(e),r=n[0],i=n[1],a=t===void 0?r:t;return[a,i]}function crt(e){var t=e.month,n=e.defaultMonth,r=e.today,i=t||n||r||new Date,a=e.toDate,o=e.fromDate,l=e.numberOfMonths,c=l===void 0?1:l;if(a&&Om(a,i)<0){var u=-1*(c-1);i=xo(a,u)}return o&&Om(i,o)<0&&(i=o),hs(i)}function urt(){var e=yn(),t=crt(e),n=lrt(t,e.month),r=n[0],i=n[1],a=function(o){var l;if(!e.disableNavigation){var c=hs(o);i(c),(l=e.onMonthChange)===null||l===void 0||l.call(e,c)}};return[r,a]}function drt(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,i=hs(e),a=hs(xo(i,r)),o=Om(a,i),l=[],c=0;c<o;c++){var u=xo(i,c);l.push(u)}return n&&(l=l.reverse()),l}function hrt(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,i=t.numberOfMonths,a=i===void 0?1:i,o=r?a:1,l=hs(e);if(!n)return xo(l,o);var c=Om(n,e);if(!(c<a))return xo(l,o)}}function frt(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,i=t.numberOfMonths,a=i===void 0?1:i,o=r?a:1,l=hs(e);if(!n)return xo(l,-o);var c=Om(l,n);if(!(c<=0))return xo(l,-o)}}var nse=x.createContext(void 0);function prt(e){var t=yn(),n=urt(),r=n[0],i=n[1],a=drt(r,t),o=hrt(r,t),l=frt(r,t),c=function(h){return a.some(function(f){return vM(h,f)})},u=function(h,f){c(h)||(f&&jne(h,f)?i(xo(h,1+t.numberOfMonths*-1)):i(h))},d={currentMonth:r,displayMonths:a,goToMonth:i,goToDate:u,previousMonth:l,nextMonth:o,isDateDisplayed:c};return s.jsx(nse.Provider,{value:d,children:e.children})}function Lb(){var e=x.useContext(nse);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function zV(e){var t,n=yn(),r=n.classNames,i=n.styles,a=n.components,o=Lb().goToMonth,l=function(d){o(xo(d,e.displayIndex?-e.dis
861playIndex:0))},c=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:ese,u=s.jsx(c,{id:e.id,displayMonth:e.displayMonth});return s.jsxs("div",{className:r.caption_dropdowns,style:i.caption_dropdowns,children:[s.jsx("div",{className:r.vhidden,children:u}),s.jsx(art,{onChange:l,displayMonth:e.displayMonth}),s.jsx(ort,{onChange:l,displayMonth:e.displayMonth})]})}function mrt(e){return s.jsx("svg",ot({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:s.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 grt(e){return s.jsx("svg",ot({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:s.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 i_=x.forwardRef(function(e,t){var n=yn(),r=n.classNames,i=n.styles,a=[r.button_reset,r.button];e.className&&a.push(e.className);var o=a.join(" "),l=ot(ot({},i.button_reset),i.button);return e.style&&Object.assign(l,e.style),s.jsx("button",ot({},e,{ref:t,type:"button",className:o,style:l}))});function yrt(e){var t,n,r=yn(),i=r.dir,a=r.locale,o=r.classNames,l=r.styles,c=r.labels,u=c.labelPrevious,d=c.labelNext,h=r.components;if(!e.nextMonth&&!e.previousMonth)return s.jsx(s.Fragment,{});var f=u(e.previousMonth,{locale:a}),p=[o.nav_button,o.nav_button_previous].join(" "),m=d(e.nextMonth,{locale:a}),g=[o.nav_button,o.nav_button_next].join(" "),y=(t=h==null?void 0:h.IconRight)!==null&&t!==void 0?t:grt,b=(n=h==null?void 0:h.IconLeft)!==null&&n!==void 0?n:mrt;return s.jsxs("div",{className:o.nav,style:l.nav,children:[!e.hidePrevious&&s.jsx(i_,{name:"previous-month","aria-label":f,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:i==="rtl"?s.jsx(y,{className:o.nav_icon,style:l.nav_icon}):s.jsx(b,{className:o.nav_icon,style:l.nav_icon})}),!e.hideNext&&s.jsx(i_,{name:"next-month","aria-label":m,className:g,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:i==="rtl"?s.jsx(b,{className:o.nav_icon,style:l.nav_icon}):s.jsx(y,{className:o.nav_icon,style:l.nav_icon})})]})}function BV(e){var t=yn().numberOfMonths,n=Lb(),r=n.previousMonth,i=n.nextMonth,a=n.goToMonth,o=n.displayMonths,l=o.findIndex(function(m){return vM(e.displayMonth,m)}),c=l===0,u=l===o.length-1,d=t>1&&(c||!u),h=t>1&&(u||!c),f=function(){r&&a(r)},p=function(){i&&a(i)};return s.jsx(yrt,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:h,nextMonth:i,previousMonth:r,onPreviousClick:f,onNextClick:p})}function vrt(e){var t,n=yn(),r=n.classNames,i=n.disableNavigation,a=n.styles,o=n.captionLayout,l=n.components,c=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:ese,u;return i?u=s.jsx(c,{id:e.id,displayMonth:e.displayMonth}):o==="dropdown"?u=s.jsx(zV,{displayMonth:e.displayMonth,id:e.id}):o==="dropdown-buttons"?u=s.jsxs(s.Fragment,{children:[s.jsx(zV,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),s.jsx(BV,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):u=s.jsxs(s.Fragment,{children:[s.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),s.jsx(BV,{displayMonth:e.displayMonth,id:e.id})]}),s.jsx("div",{className:r.caption,style:a.caption,children:u})}function xrt(e){var t=yn(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?s.jsx("tfoot",{className:i,style:r.tfoot,children:s.jsx("tr",{children:s.jsx("td",{colSpan:8,children:n})})}):s.jsx(s.Fragment,{})}function brt(e,t,n){for(var r=n?Sh(new Date):nl(new Date,{locale:e,weekStartsOn:t}),i=[],a=0;a<7;a++){var o=Oi(r,a);i.push(o)}return i}function wrt(){var e=yn(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,a=e.weekStartsOn,o=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=brt(i,a,o);return s.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&s.jsx("td",{style:n.head_cell,className:t.head_cell}),u.map(function(d,h){return s.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(d,{locale:i}),children:l(d,{locale:i})},h)})]})}function jrt(){var e,t=yn(),n=t.classNames,r=t.styles,i=t.components,a=(e=i==null?void 0:i.HeadRow)!==null&&e!==void 0?e:wrt;return s.jsx("thead",{style:r.head,className:n.head,children:s.jsx(a,{})})}function _rt(e){var t=yn(),n=t.locale,r=t.formatters.formatDay;return s.jsx(s.Fragment,{children:r(e.date,{locale:n})})}var JM=x.createContext(void 0);function Srt(e){if(!Mb(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return s.jsx(JM.Provider,{value:t,children:e.children})}return s.jsx(krt,{initialProps:e.initialProps,children:e.children})}function krt(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,a=t.max,o=function(u,d,h){var f,p;(f=t.onDayClick)===null||f===void 0||f.call(t,u,d,h);var m=!!(d.selected&&i&&(r==null?void 0:r.length)===i);if(!m){var g=!!(!d.selected&&a&&(r==null?void 0:r.length)===a);if(!g){var y=r?Zie([],r):[];if(d.selected){var b=y.findIndex(function(v){return as(u,v)});y.splice(b,1)}else y.push(u);(p=t.onSelect)===null||p===void 0||p.call(t,y,u,d,h)}}},l={disabled:[]};r&&l.disabled.push(function(u){var d=a&&r.length>a-1,h=r.some(function(f){return as(f,u)});return!!(d&&!h)});var c={selected:r,onDayClick:o,modifiers:l};return s.jsx(JM.Provider,{value:c,children:n})}function e$(){var e=x.useContext(JM);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function Nrt(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?as(i,e)&&as(r,e)?void 0:as(i,e)?{from:i,to:void 0}:as(r,e)?void 0:Q2(r,e)?{from:e,to:i}:{from:r,to:e}:i?Q2(e,i)?{from:i,to:e}:{from:e,to:i}:r?jne(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var t$=x.createContext(void 0);function Crt(e){if(!$b(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return s.jsx(t$.Provider,{value:t,children:e.children})}return s.jsx(Art,{initialProps:e.initialProps,children:e.children})}function Art(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},a=i.from,o=i.to,l=t.min,c=t.max,u=function(p,m,g){var y,b;(y=t.onDayClick)===null||y===void 0||y.call(t,p,m,g);var v=Nrt(p,r);(b=t.onSelect)===null||b===void 0||b.call(t,v,p,m,g)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(d.range_start=[a],o?(d.range_end=[o],as(a,o)||(d.range_middle=[{after:a,before:o}])):d.range_end=[a]):o&&(d.range_start=[o],d.range_end=[o]),l&&(a&&!o&&d.disabled.push({after:QC(a,l-1),before:Oi(a,l-1)}),a&&o&&d.disabled.push({after:a,before:Oi(a,l-1)}),!a&&o&&d.disabled.push({after:QC(o,l-1),before:Oi(o,l-1)})),c){if(a&&!o&&(d.disabled.push({before:Oi(a,-c+1)}),d.disabled.push({after:Oi(a,c-1)})),a&&o){var h=Wo(o,a)+1,f=c-h;d.disabled.push({before:QC(a,f)}),d.disabled.push({after:Oi(o,f)})}!a&&o&&(d.disabled.push({before:Oi(o,-c+1)}),d.disabled.push({after:Oi(o,c-1)}))}return s.jsx(t$.Provider,{value:{selected:r,onDayClick:u,modifiers:d},children:n})}function n$(){var e=x.useContext(t$);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Ww(e){return Array.isArray(e)?Zie([],e):e!==void 0?[e]:[]}function Trt(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],i=n[1];t[r]=Ww(i)}),t}var bo;(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"})(bo||(bo={}));var Ert=bo.Selected,gl=bo.Disabled,Prt=bo.Hidden,Ort=bo.Today,bA=bo.RangeEnd,wA=bo.RangeMiddle,jA=bo.RangeStart,Irt=bo.Outside;function Rrt(e,t,n){var r,i=(r={},r[Ert]=Ww(e.selected),r[gl]=Ww(e.disabled),r[Prt]=Ww(e.hidden),r[Ort]=[e.today],r[bA]=[],r[wA]=[],r[jA]=[],r[Irt]=[],r);return e.fromDate&&i[gl].push({before:e.fromDate}),e.toDate&&i[gl].push({after:e.toDate}),Mb(e)?i[gl]=i[gl].concat(t.modifiers[gl]):$b(e)&&(i[gl]=i[gl].concat(n.modifiers[gl]),i[jA]=n.modifiers[jA],i[wA]=n.modifiers[wA],i[bA]=n.modifiers[bA]),i}var rse=x.createContext(void 0);function Drt(e){var t=yn(),n=e$(),r=n$(),i=Rrt(t,n,r),a=Trt(t.modifiers),o=ot(ot({},i),a);return s.jsx(rse.Provider,{value:o,children:e.children})}function ise(){var e=x.useContext(rse);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Mrt(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function $rt(e){return!!(e&&typeof e=="object"&&"from"in e)}function Lrt(e){return!!(e&&typeof e=="object"&&"after"in e)}function Frt(e){return!!(e&&typeof e=="object"&&"before"in e)}function zrt(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Brt(e,t){var n,r=t.from,i=t.to;if(r&&i){var a=Wo(i,r)<0;a&&(n=[i,r],r=n[0],i=n[1]);var o=Wo(e,r)>=0&&Wo(i,e)>=0;return o}return i?as(i,e):r?as(r,e):!1}function Vrt(e){return gM(e)}function Wrt(e){return Array.isArray(e)&&e.every(gM)}function Urt(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Vrt(n))return as(e,n);if(Wrt(n))return n.includes(e);if($rt(n))return Brt(e,n);if(zrt(n))return n.dayOfWeek.includes(e.getDay());if(Mrt(n)){var r=Wo(n.before,e),i=Wo(n.after,e),a=r>0,o=i<0,l=Q2(n.before,n.after);return l?o&&a:a||o}return Lrt(n)?Wo(e,n.after)>0:Frt(n)?Wo(n.before,e)>0:typeof n=="function"?n(e):!1})}function r$(e,t,n){var r=Object.keys(t).reduce(function(a,o){var l=t[o];return Urt(e,l)&&a.push(o),a},[]),i={};return r.forEach(function(a){return i[a]=!0}),n&&!vM(e,n)&&(i.outside=!0),i}function qrt(e,t){for(var n=hs(e[0]),r=mk(e[e.length-1]),i,a,o=n;o<=r;){var l=r$(o,t),c=!l.disabled&&!l.hidden;if(!c){o=Oi(o,1);continue}if(l.selected)return o;l.today&&!a&&(a=o),i||(i=o),o=Oi(o,1)}return a||i}var Hrt=365;function sse(e,t){var n=t.moveBy,r=t.direction,i=t.context,a=t.modifiers,o=t.retry,l=o===void 0?{count:0,lastFocused:e}:o,c=i.weekStartsOn,u=i.fromDate,d=i.toDate,h=i.locale,f={day:Oi,week:Y2,month:xo,year:DYe,startOfWeek:function(y){return i.ISOWeek?Sh(y):nl(y,{locale:h,weekStartsOn:c})},endOfWeek:function(y){return i.ISOWeek?yne(y):yM(y,{locale:h,weekStartsOn:c})}},p=f[n](e,r==="after"?1:-1);r==="before"&&u?p=MYe([u,p]):r==="after"&&d&&(p=$Ye([d,p]));var m=!0;if(a){var g=r$(p,a);m=!g.disabled&&!g.hidden}return m?p:l.count>Hrt?l.lastFocused:sse(p,{moveBy:n,direction:r,context:i,modifiers:a,retry:ot(ot({},l),{count:l.count+1})})}var ase=x.createContext(void 0);function Krt(e){var t=Lb(),n=ise(),r=x.useState(),i=r[0],a=r[1],o=x.use
861State(),l=o[0],c=o[1],u=qrt(t.displayMonths,n),d=i??(l&&t.isDateDisplayed(l))?l:u,h=function(){c(i),a(void 0)},f=function(y){a(y)},p=yn(),m=function(y,b){if(i){var v=sse(i,{moveBy:y,direction:b,context:p,modifiers:n});as(i,v)||(t.goToDate(v,i),f(v))}},g={focusedDay:i,focusTarget:d,blur:h,focus:f,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return s.jsx(ase.Provider,{value:g,children:e.children})}function i$(){var e=x.useContext(ase);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Grt(e,t){var n=ise(),r=r$(e,n,t);return r}var s$=x.createContext(void 0);function Yrt(e){if(!Pk(e.initialProps)){var t={selected:void 0};return s.jsx(s$.Provider,{value:t,children:e.children})}return s.jsx(Qrt,{initialProps:e.initialProps,children:e.children})}function Qrt(e){var t=e.initialProps,n=e.children,r=function(a,o,l){var c,u,d;if((c=t.onDayClick)===null||c===void 0||c.call(t,a,o,l),o.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,a,o,l);return}(d=t.onSelect)===null||d===void 0||d.call(t,a,a,o,l)},i={selected:t.selected,onDayClick:r};return s.jsx(s$.Provider,{value:i,children:n})}function ose(){var e=x.useContext(s$);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Xrt(e,t){var n=yn(),r=ose(),i=e$(),a=n$(),o=i$(),l=o.focusDayAfter,c=o.focusDayBefore,u=o.focusWeekAfter,d=o.focusWeekBefore,h=o.blur,f=o.focus,p=o.focusMonthBefore,m=o.focusMonthAfter,g=o.focusYearBefore,y=o.focusYearAfter,b=o.focusStartOfWeek,v=o.focusEndOfWeek,w=function(P){var I,M,R,K;Pk(n)?(I=r.onDayClick)===null||I===void 0||I.call(r,e,t,P):Mb(n)?(M=i.onDayClick)===null||M===void 0||M.call(i,e,t,P):$b(n)?(R=a.onDayCl
861ick)===null||R===void 0||R.call(a,e,t,P):(K=n.onDayClick)===null||K===void 0||K.call(n,e,t,P)},_=function(P){var I;f(e),(I=n.onDayFocus)===null||I===void 0||I.call(n,e,t,P)},j=function(P){var I;h(),(I=n.onDayBlur)===null||I===void 0||I.call(n,e,t,P)},S=function(P){var I;(I=n.onDayMouseEnter)===null||I===void 0||I.call(n,e,t,P)},k=function(P){var I;(I=n.onDayMouseLeave)===null||I===void 0||I.call(n,e,t,P)},N=function(P){var I;(I=n.onDayPointerEnter)===null||I===void 0||I.call(n,e,t,P)},T=function(P){var I;(I=n.onDayPointerLeave)===null||I===void 0||I.call(n,e,t,P)},C=function(P){var I;(I=n.onDayTouchCancel)===null||I===void 0||I.call(n,e,t,P)},A=function(P){var I;(I=n.onDayTouchEnd)===null||I===void 0||I.call(n,e,t,P)},O=function(P){var I;(I=n.onDayTouchMove)===null||I===void 0||I.call(n,e,t,P)},z=function(P){var I;(I=n.onDayTouchStart)===null||I===void 0||I.call(n,e,t,P)},$=function(P){var I;(I=n.onDayKeyUp)===null||I===void 0||I.call(n,e,t,P)},F=function(P){var I;switch(P.key){case"ArrowLeft":P.preventDefault(),P.stopPropagation(),n.dir==="rtl"?l():c();break;case"ArrowRight":P.preventDefault(),P.stopPropagation(),n.dir==="rtl"?c():l();break;case"ArrowDown":P.preventDefault(),P.stopPropagation(),u();break;case"ArrowUp":P.preventDefault(),P.stopPropagation(),d();break;case"PageUp":P.preventDefault(),P.stopPropagation(),P.shiftKey?g():p();break;case"PageDown":P.preventDefault(),P.stopPropagation(),P.shiftKey?y():m();break;case"Home":P.preventDefault(),P.stopPropagation(),b();break;case"End":P.preventDefault(),P.stopPropagation(),v();break}(I=n.onDayKeyDown)===null||I===void 0||I.call(n,e,t,P)},B={onClick:w,onFocus:_,onBlur:j,onKeyDown:F,onKeyUp:$,onMouseEnter:S,onMouseLeave:k,onPointerEnter:N,onPointerLeave:T,onTouchCancel:C,onTouchEnd:A,onTouchMove:O,onTouchStart:z};return B}function Zrt(){var e=yn(),t=ose(),n=e$(),r=n$(),i=Pk(e)?t.selected:Mb(e)?n.selected:$b(e)?r.selected:void 0;return i}function Jrt(e){return Object.values(bo).includes(e)}function eit(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var i=e.modifiersClassNames[r];if(i)n.push(i);else if(Jrt(r)){var a=e.classNames["day_".concat(r)];a&&n.push(a)}}),n}function tit(e,t){var n=ot({},e.styles.day);return Object.keys(t).forEach(function(r){var i;n=ot(ot({},n),(i=e.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function nit(e,t,n){var r,i,a,o=yn(),l=i$(),c=Grt(e,t),u=Xrt(e,c),d=Zrt(),h=!!(o.onDayCl
861ick||o.mode!=="default");x.useEffect(function(){var S;c.outside||l.focusedDay&&h&&as(l.focusedDay,e)&&((S=n.current)===null||S===void 0||S.focus())},[l.focusedDay,e,n,h,c.outside]);var f=eit(o,c).join(" "),p=tit(o,c),m=!!(c.outside&&!o.showOutsideDays||c.hidden),g=(a=(i=o.components)===null||i===void 0?void 0:i.DayContent)!==null&&a!==void 0?a:_rt,y=s.jsx(g,{date:e,displayMonth:t,activeModifiers:c}),b={style:p,className:f,children:y,role:"gridcell"},v=l.focusTarget&&as(l.focusTarget,e)&&!c.outside,w=l.focusedDay&&as(l.focusedDay,e),_=ot(ot(ot({},b),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=w||v?0:-1,r)),u),j={isButton:h,isHidden:m,activeModifiers:c,selectedDays:d,buttonProps:_,divProps:b};return j}function rit(e){var t=x.useRef(null),n=nit(e.date,e.displayMonth,t);return n.isHidden?s.jsx("div",{role:"gridcell"}):n.isButton?s.jsx(i_,ot({name:"day",ref:t},n.buttonProps)):s.jsx("div",ot({},n.divProps))}function iit(e){var t=e.number,n=e.dates,r=yn(),i=r.onWeekNumberClick,a=r.styles,o=r.classNames,l=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,d=u(Number(t),{locale:l});if(!i)return s.jsx("span",{className:o.weeknumber,style:a.weeknumber,children:d});var h=c(Number(t),{locale:l}),f=function(p){i(t,n,p)};return s.jsx(i_,{name:"week-number","aria-label":h,className:o.weeknumber,style:a.weeknumber,onClick:f,children:d})}function sit(e){var t,n,r=yn(),i=r.styles,a=r.classNames,o=r.showWeekNumber,l=r.components,c=(t=l==null?void 0:l.Day)!==null&&t!==void 0?t:rit,u=(n=l==null?void 0:l.WeekNumber)!==null&&n!==void 0?n:iit,d;return o&&(d=s.jsx("td",{className:a.cell,style:i.cell,children:s.jsx(u,{number:e.weekNumber,dates:e.dates})})),s.jsxs("tr",{className:a.row,style:i.row,children:[d,e.dates.map(function(h){return s.jsx("td",{className:a.cell,style:i.cell,role:"presentation",children:s.jsx(c,{displayMonth:e.displayMonth,date:h})},UQe(h))})]})}function VV(e,t,n){for(var r=n!=null&&n.ISOWeek?yne(t):yM(t,n),i=n!=null&&n.ISOWeek?Sh(e):nl(e,n),a=Wo(r,i),o=[],l=0;l<=a;l++)o.push(Oi(i,l));var c=o.reduce(function(u,d){var h=n!=null&&n.ISOWeek?vne(d):bne(d,n),f=u.find(function(p){return p.weekNumber===h});return f?(f.dates.push(d),u):(u.push({weekNumber:h,dates:[d]}),u)},[]);return c}function ait(e,t){var n=VV(hs(e),mk(e),t);if(t!=null&&t.useFixedWeeks){var r=HQe(e,t);if(r<6){var i=n[n.length-1],a=i.dates[i.dates.length-1],o=Y2(a,6-r),l=VV(Y2(a,1),o,t);n.push.apply(n,l)}}return n}function oit(e){var t,n,r,i=yn(),a=i.locale,o=i.classNames,l=i.styles,c=i.hideHead,u=i.fixedWeeks,d=i.components,h=i.weekStartsOn,f=i.firstWeekContainsDate,p=i.ISOWeek,m=ait(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:p,locale:a,weekStartsOn:h,firstWeekContainsDate:f}),g=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:jrt,y=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:sit,b=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:xrt;return s.jsxs("table",{id:e.id,className:o.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&s.jsx(g,{}),s.jsx("tbody",{className:o.tbody,style:l.tbody,children:m.map(function(v){return s.jsx(y,{displayMonth:e.displayMonth,dates:v.dates,weekNumber:v.weekNumber},v.weekNumber)})}),s.jsx(b,{displayMonth:e.displayMonth})]})}function lit(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var cit=lit()?x.useLayoutEffect:x.useEffect,_A=!1,uit=0;function WV(){return"react-day-picker-".concat(++uit)}function dit(e){var t,n=e??(_A?WV():null),r=x.useState(n),i=r[0],a=r[1];return cit(function(){i===null&&a(WV())},[]),x.useEffect(function(){_A===!1&&(_A=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function hit(e){var t,n,r=yn(),i=r.dir,a=r.classNames,o=r.styles,l=r.components,c=Lb().displayMonths,u=dit(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,h=[a.month],f=o.month,p=e.displayIndex===0,m=e.displayIndex===c.length-1,g=!p&&!m;i==="rtl"&&(t=[p,m],m=t[0],p=t[1]),p&&(h.push(a.caption_start),f=ot(ot({},f),o.caption_start)),m&&(h.push(a.caption_end),f=ot(ot({},f),o.caption_end)),g&&(h.push(a.caption_between),f=ot(ot({},f),o.caption_between));var y=(n=l==null?void 0:l.Caption)!==null&&n!==void 0?n:vrt;return s.jsxs("div",{className:h.join(" "),style:f,children:[s.jsx(y,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),s.jsx(oit,{id:d,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function fit(e){var t=yn(),n=t.classNames,r=t.styles;return s.jsx("div",{className:n.months,style:r.months,children:e.children})}function pit(e){var t,n,r=e.initialProps,i=yn(),a=i$(),o=Lb(),l=x.useState(!1),c=l[0],u=l[1];x.useEffect(function(){i.initialFocus&&a.focusTarget&&(c||(a.focus(a.focusTarget),u(!0)))},[i.initialFocus,c,a.focus,a.focusTarget,a]);var d=[i.classNames.root,i.className];i.numberOfMonths>1&&d.push(i.classNames.multiple_months),i.showWeekNumber&&d.push(i.classNames.with_weeknumber);var h=ot(ot({},i.styles.root),i.style),f=Object.keys(r).filter(function(m){return m.startsWith("data-")}).reduce(function(m,g){var y;return ot(ot({},m),(y={},y[g]=r[g],y))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:fit;return s.jsx("div",ot({className:d.join(" "),style:h,dir:i.dir,id:i.id,nonce:r.nonce,title:r.title,lang:r.lang},f,{children:s.jsx(p,{children:o.displayMonths.map(function(m,g){return s.jsx(hit,{displayIndex:g,displayMonth:m},g)})})}))}function mit(e){var t=e.children,n=Fnt(e,["children"]);return s.jsx(irt,{initialProps:n,children:s.jsx(prt,{children:s.jsx(Yrt,{initialProps:n,children:s.jsx(Srt,{initialProps:n,children:s.jsx(Crt,{initialProps:n,children:s.jsx(Drt,{children:s.jsx(Krt,{children:t})})})})})})})}function git(e){return s.jsx(mit,ot({},e,{children:s.jsx(pit,{initialProps:e})}))}function lse({className:e,classNames:t,showOutsideDays:n=!0,...r}){return s.jsx(git,{showOutsideDays:n,className:ae("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:sp
861ace-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:ae(Uv({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:ae(Uv({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:({...i})=>s.jsx(Ph,{className:"h-4 w-4"}),IconRight:({...i})=>s.jsx(Us,{className:"h-4 w-4"})},...r})}
861lse.displayName="Calendar";const yit={private_company:"Private Company",public_company:"Public Company",university_tto:"University / Research Institution (TTO)"},UV=[{code:"US",label:"United States"},{code:"CN",label:"China"},{code:"IN",label:"India"},{code:"GB",label:"United Kingdom"},{code:"DE",label:"Germany"},{code:"FR",label:"France"},{code:"CH",label:"Switzerland"},{code:"NL",label:"Netherlands"},{code:"JP",label:"Japan"},{code:"KR",label:"South Korea"}];function qV(e,t=!1){return t?e==="CN"?{types:[{value:"uscc",label:"Unified Social Credit Code (optional)"}],validation:/^\d{18}$/}:e==="US"?{types:[{value:"ein",label:"EIN (optional)"}],validation:null}:{types:[{value:"lei",label:"LEI (optional)"}],validation:null}:e==="CN"?{types:[{value:"uscc",label:"Unified Social Credit Code"}],validation:/^\d{18}$/}:e==="US"?{types:[{value:"ein",label:"EIN (US)"},{value:"lei",label:"LEI (Global)"}],validation:null}:{types:[{value:"lei",label:"LEI (Global)"}],validation:null}}function vit(e,t=!1){return t?e==="US"?"IRS determination letter, W-9, or university charter":"University charter or equivalent official document":e==="CN"?"Business License":"Certificate of Incorporation / University Charter"}function HV({variant:e,icon:t,children:n}){const i={positive:{bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))",border:"hsl(var(--c-positive-border))"},warning:{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))",border:"hsl(var(--c-warning-border))"},pending:{bg:"hsl(var(--c-surface))",fg:"hsl(var(--c-fg-muted))",border:"hsl(var(--c-border))"}}[e];return s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontFamily:"var(--font-mono)",fontSize:11,color:i.fg,background:i.bg,border:`1px solid ${i.border}`,padding:"3px 8px",borderRadius:4,letterSpacing:"0.04em",textTransform:"uppercase"},children:[s.jsx(t,{size:11}),n]})}function yf({step:e,title:t,description:n,children:r}){return s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",alignItems:"center",gap:12},children:[s.jsx("span",{style:{width:26,height:26,borderRadius:"50%",background:"hsl(var(--c-surface))",color:"hsl(var(--c-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:11.5,fontWeight:600,flexShrink:0},children:e}),s.jsxs("div",{style:{minWidth:0,flex:1},children:[s.jsx("div",{className:"tt-display-sm",style:{fontSize:15},children:t}),n&&s.jsx("p",{className:"tt-meta",style:{marginTop:2},children:n})]})]}),s.jsx("div",{style:{padding:18},children:r})]})}function xit(){var de,pe,J;const e=xr(),{user:t,isLoading:n}=me(),{data:r,isLoading:i}=An(),{data:a,isLoading:o}=Ene(),l=yXe(),c=xXe(),{toast:u}=xt(),[d,h]=x.useState(""),[f,p]=x.useState(""),[m,g]=x.useState(""),[y,b]=x.useState(""),[v,w]=x.useState(""),[_,j]=x.useState(""),[S,k]=x.useState(),[N,T]=x.useState(""),[C,A]=x.useState(""),[O,z]=x.useState(!1),[$,F]=x.useState(null),[B,P]=x.useState(null);x.useEffect(()=>{n||i||(t?r!=null&&r.supplierUser?(r.isPending||r.isRejected)&&e("/supplier/pending"):e("/auth?supplier=true"):e("/auth"))},[t,r,n,i,e]),x.useEffect(()=>{var be;!o&&!a&&((be=r==null?void 0:r.supplier)!=null&&be.id)&&l.mutate()},[o,a,(de=r==null?void 0:r.supplier)==null?void 0:de.id]);const I=d==="university_tto";if(x.useEffect(()=>{if(!f)return;const be=qV(f,I);be.types.some(ee=>ee.value===m)||(g(be.types[0].value),b(""))},[f,I,m]),n||i||o)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"32px 24px",display:"flex",alignItems:"center",justifyContent:"center",height:256},children:s.jsx(ne,{className:"animate-spin",size:28,color:"hsl(var(--c-fg-muted))"})})});if(!t||!(r!=null&&r.supplierUser)||r.isPending||r.isRejected)return null;const M=(a==null?void 0:a.entityStatus)==="verified",R=(a==null?void 0:a.entityStatus)==="pending_approval",K=f?qV(f,I):null,D=async be=>{var Ce;const ee=(Ce=be.target.files)==null?void 0:Ce[0];if(!(!ee||!a)){if(ee.type!=="application/pdf"){u({title:"Invalid file",description:"Please upload a PDF file.",variant:"destructive"});return}z(!0);try{const Re=`${t.id}/${Date.now()}_${ee.name}`,{error:Ze}=await W.storage.from("supplier-documents").upload(Re,ee);if(Ze)throw Ze;F(Re),P(ee.name),u({title:"Document uploaded"})}catch(Re){u({title:"Upload failed",description:Re.message,variant:"destructive"})}finally{z(!1)}}},E=async()=>
861{if(!(!a||!re))try{await c.mutateAsync({id:a.id,entityType:d,country:f,identifierType:y?m:null,identifierValue:y||null,officialLegalName:_,registrationDate:!I&&S?rn(S,"yyyy-MM-dd"):null,registeredAddress:N||null,legalRepresentative:C||null,registryConfirmed:!1,documentPath:$,websiteUrl:v||void 0}),u({title:"Entity verification submitted for admin approval!"})}catch(be){u({title:"Error",description:be.message,variant:"destructive"})}},q=!y||!K?null:f==="CN"&&m==="uscc"&&!/^\d{18}$/.test(y)?"Must be exactly 18 digits":null,re=(I?!!(f&&_):!!(d&&f&&m&&y&&_&&S&&N&&C&&$))&&!q&&!O&&!c.isPending,Y=(I?[!!d,!!f,!!_]:[!!d,!!f,!!y,!!_&&!!S&&!!N&&!!C,!!$]).filter(Boolean).length,le=I?3:5,Z=Math.round(Y/le*100);return s.jsx(he,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:s.jsxs("div",{className:"xph-container",style:{padding:"24px 24px 64px",maxWidth:880},children:[s.jsxs("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:()=>e("/supplier"),style:{marginBottom:16,paddingLeft:0},children:[s.jsx(Wt,{size:13}),"Back to dashboard"]}),s.jsxs("div",{style:{display:"flex",alignItems:"flex-end",justifyContent:"space-between",gap:24,marginBottom:24,flexWrap:"wrap"},children:[s.jsxs("div",{style:{minWidth:0,flex:1},children:[s.jsx("div",{className:"eyebrow",children:"Onboarding · Step 1"}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,marginTop:8,flexWrap:"wrap"},children:[s.jsx("span",{style:{width:36,height:36,borderRadius:8,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(pr,{size:17})}),s.jsx("h1",{className:"tt-display-md",children:"Entity verification"}),M&&s.jsx(HV,{variant:"positive",icon:sn,children:"Verified"}),R&&s.jsx(HV,{variant:"warning",icon:Yn,children:"Pending approval"})]}),s.jsx("p",{className:"tt-lead",style:{marginTop:12,maxWidth:600},children:"Verify your organization's legal registration and standing."})]}),!M&&!R&&s.jsxs("div",{style:{minWidth:180},children:[s.jsx("div",{className:"eyebrow",children:"Progress"}),s.jsxs("div",{className:"tt-stat-md",style:{marginTop:6},children:[Y,"/",le]}),s.jsx("div",{style:{marginTop:8,height:6,borderRadius:3,background:"hsl(var(--c-surface-2))",overflow:"hidden"},children:s.jsx("div",{style:{height:"100%",width:`${Z}%`,background:"hsl(var(--c-accent))",transition:"width 200ms"}})})]})]}),M&&a&&s.jsxs("div",{className:"xph-card",style:{padding:28},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,marginBottom:22},children:[s.jsx("span",{style:{width:44,height:44,borderRadius:10,background:"hsl(var(--c-positive-soft))",color:"hsl(var(--c-positive-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(sn,{size:20})}),s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",children:"Entity verified"}),s.jsxs("p",{className:"tt-meta",style:{marginTop:2},children:["Verified on"," ",a.entityVerifiedAt?rn(new Date(a.entityVerifiedAt),"MMM d, yyyy"):"N/A"]})]})]}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 220px), 1fr))",gap:"14px 22px"},children:[s.jsx(nd,{label:"Entity type",value:yit[a.entityType??""]??a.entityType}),s.jsx(nd,{label:"Country",value:((pe=UV.find(be=>be.code===a.country))==null?void 0:pe.label)??a.country}),s.jsx(nd,{label:"Identifier",value:a.identifierType&&a.identifierValue?`${a.identifierType.toUpperCase()}: ${a.identifierValue}`:null}),s.jsx(nd,{label:"Official legal name",value:a.officialLegalName}),s.jsx(nd,{label:"Registration date",value:a.registrationDate}),s.jsx(nd,{label:"Registered address",value:a.registeredAddress}),s.jsx(nd,{label:"Legal representative",value:a.legalRepresentative})]})]}),R&&s.jsxs("div",{className:"xph-card",style:{padding:36,textAlign:"center"},children:[s.jsx("span",{style:{width:56,height:56,borderRadius:14,background:"hsl(var(--c-warning-soft))",color:"hsl(var(--c-warning-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center",marginBottom:16},children:s.jsx(Yn,{size:24})}),s.jsx("h3",{className:"tt-display-sm",children:"Pending admin a
861pproval"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:8,maxWidth:440,marginInline:"auto"},children:"Your entity verification has been submitted and is awaiting review by an administrator."})]}),!M&&!R&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[s.jsx(yf,{step:1,title:"Entity type",description:"What kind of organization is this?",children:s.jsxs(cO,{value:d,onValueChange:h,className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ty,{value:"private_company",id:"private_company"}),s.jsx(Pe,{htmlFor:"private_company",className:"tt-body-sm",style:{color:"hsl(var(--c-ink))"},children:"Private Company"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ty,{value:"public_company",id:"public_company"}),s.jsx(Pe,{htmlFor:"public_company",className:"tt-body-sm",style:{color:"hsl(var(--c-ink))"},children:"Public Company"})]}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(Ty,{value:"university_tto",id:"university_tto"}),s.jsx(Pe,{htmlFor:"university_tto",className:"tt-body-sm",style:{color:"hsl(var(--c-ink))"},children:"University / Research Institution (TTO)"})]})]})}),s.jsx(yf,{step:"W",title:"Company / institution website",description:"Used to verify team members' email domains during personnel verification.",children:s.jsx(Fe,{value:v,onChange:be=>w(be.target.value),placeholder:"https://www.example.com",type:"url"})}),s.jsx(yf,{step:2,title:"Country",description:"Where is the entity legally registered?",children:s.jsxs($n,{value:f,onValueChange:p,children:[s.jsx(On,{className:"w-full md:w-80",children:s.jsx(Ln,{placeholder:"Select country"})}),s.jsx(In,{children:UV.map(be=>s.jsx(Rt,{value:be.code,children:be.label},be.code))})]})}),f&&K&&s.jsx(yf,{step:3,title:"Company / institution identifier",description:I?"Optional — provide your institution’s tax or registry identifier if available.":"Provide the official registry number for your jurisdiction.",children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[K.types.length>1&&s.jsx(cO,{value:m,onValueChange:g,className:"flex gap-4",children:K.types.map(be=>s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Ty,{value:be.value,id:`id-${be.value}`}),s.jsx(Pe,{htmlFor:`id-${be.value}`,className:"tt-body-sm",children:be.label})]},be.value))}),s.jsxs("div",{children:[s.jsx(Pe,{className:"eyebrow",style:{display:"block",marginBottom:6},children:((J=K.types.find(be=>be.value===m))==null?void 0:J.label)??"Identifier"}),s.jsxs("div",{style:{display:"flex",gap:8},children:[s.jsx(Fe,{value:y,onChange:be=>b(be.target.value),placeholder:f==="CN"?"18-digit code":"Enter identifier",className:"flex-1"}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline",disabled:!0,style:{flexShrink:0},children:[s.jsx(Ea,{size:13}),"Lookup",s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:9.5,background:"hsl(var(--c-surface))",color:"hsl(var(--c-fg-subtle))",padding:"1px 5px",borderRadius:3,letterSpacing:"0.04em",marginLeft:4},children:"SOON"})]})]}),q&&s.jsxs("p",{className:"tt-meta",style:{color:"hsl(var(--c-negative-fg))",marginTop:6,display:"flex",alignItems:"center",gap:4},children:[s.jsx(ir,{size:11})," ",q]})]})]})}),f&&s.jsx(yf,{step:4,title:"Entity details",description:I?"Your institution’s official name is all we require — the rest is optional.":"Confirm the information shown on your registry filing.",children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[s.jsxs("div",{children:[s.jsx(Pe,{className:"eyebrow",style:{display:"block",marginBottom:6},children:I?"Institution name":"Official legal name"}),s.jsx(Fe,{value:_,onChange:be=>j(be.target.value),placeholder:I?"Enter the institution’s official name":"Enter the official legal name"})]}),!I&&s.jsxs("div",{children:[s.jsx(Pe,{className:"eyebrow",style:{display:"block",marginBottom:6},children:"Registration date"}),s.jsxs(Pb,{children:[s.jsx(Ob,{asChild:!0,children:s.jsxs("button",{type:"button",className:ae("xph-btn xph-btn-outline","w-full md:w-80 justify-start text-left font-normal"),style:{color:S?"hsl(var(--c-ink))":"hsl(var(--c-fg-subtle))",padding:"8px 12px"},children:[s.jsx(Ade,{size:13}),S?rn(S,"PPP"):"Pick a date"]})}),s.jsx(kg,{className:"w-auto p-0",align:"start",children:s.jsx(lse,{mode:"single",captionLayout:"dropdown",fromYear:1900,toYear:new Date().getFullYear(),selected:S,onSelect:k,disabled:be=>be>new Date,initialFocus:!0,className:ae("p-3 pointer-events-auto")})})]})]}),s.jsxs("div",{children:[s.jsx(Pe,{className:"eyebrow",style:{display:"block",marginBottom:6},children:I?"Legal address (optional)":"Registered address"}),s.jsx(Fe,{value:N,onChange:be=>T(be.target.value),placeholder:I?"Enter the institution’s legal address":"Enter the registered address"})]}),s.jsxs("div",{children:[s.jsx(Pe,{className:"eyebrow",style:{display:"block",marginBottom:6},children:I?"Authorized signatory (optional)":"Legal representative"}),s.jsx(Fe,{value:C,onChange:be=>A(be.target.value),placeholder:I?"Enter the authorized signatory's name":"Enter the legal representative's name"})]})]})}),f&&s.jsx(yf,{step:5,title:`Upload ${vit(f,I)}`,description:I?"Optional — a supporting PDF strengthens the review.":"A PDF copy is required to evidence the registration.",children:B?s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",background:"hsl(var(--c-surface))",borderRadius:8,border:"1px solid hsl(var(--c-border))"},children:[s.jsx(ti,{size:14,color:"hsl(var(--c-fg-muted))"}),s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-ink))",fontWeight:500,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B}),s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,background:"hsl(var(--c-positive-soft))",color:"hsl(var(--c-positive-fg))",padding:"2px 7px",borderRadius:3,letterSpacing:"0.04em",textTransform:"uppercase"},children:"Uploaded"})]}):s.jsxs("div",{children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 12px",border:"1px dashed hsl(var(--c-border-strong))",borderRadius:8,background:"hsl(var(--c-surface))",marginBottom:8},children:[s.jsx(yj,{size:14,color:"hsl(var(--c-fg-muted))"}),s.jsx("span",{className:"tt-meta",children:"PDF only · max 10MB"})]}),s.jsx(Fe,{id:"doc-upload",type:"file",accept:"application/pdf",onChange:D,disabled:O}),O&&s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginTop:8},children:[s.jsx(ne,{className:"animate-spin",size:13,color:"hsl(var(--c-fg-muted))"}),s.jsx("span",{className:"tt-meta",children:"Uploading…"})]})]})}),s.jsx("div",{style:{display:"flex",justifyContent:"flex-end",paddingTop:8},children:s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary",onClick:E,disabled:!re,style:{padding:"10px 20px"},children:[c.isPending&&s.jsx(ne,{className:"animate-spin",size:13}),"Submit for approval"]})})]})]})})})}
861function nd({label:e,value:t}){return s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow",children:e}),s.jsx("p",{className:"tt-body-sm",style:{marginTop:4,color:"hsl(var(--c-ink))",fontWeight:500},children:t||"—"})]})}function bit(){const e=xr();return x.useEffect(()=>{e("/supplier",{replace:!0})},[e]),s.jsx(he,{children:s.jsx("div",{className:"container py-8 flex items-center justify-center h-64",children:s.jsx(ne,{className:"h-8 w-8 animate-spin text-muted-foreground"})})})}function cse(e){return{id:e.id,assetId:e.asset_id,completenessStatus:e.completeness_status,completenessResult:e.completeness_result,digitalVerificationStatus:e.digital_verification_status,digitalVerificationResult:e.digital_verification_result,certificationStatus:e.certification_status,certificationResult:e.certification_result,gapReport:e.gap_report,npvDelta:e.npv_delta,overallStatus:e.overall_status,createdAt:e.created_at,updatedAt:e.updated_at}}function wit(e){const{user:t}=me();return Se({queryKey:["asset-verification-workflow",e],queryFn:async()=>{if(!e)return null;const{data:n,error:r}=await W.from("asset_verification_workflow").select("*").eq("asset_id",e).maybeSingle();if(r)throw r;return n?cse(n):null},enabled:!!t&&!!e})}function jit(){const e=Ae(),t=Ye();return $e({mutationFn:async n=>{const{data:r,error:i}=await W.from("asset_verification_workflow").insert({asset_id:n}).select().single();if(i)throw i;return cse(r)},onSuccess:n=>{e.invalidateQueries({queryKey:["asset-verification-workflow"]}),t({action:"create_asset_workflow",entityType:Ve.assetVerificationWorkflow,entityId:n.id,metadata:{asset_id:n.assetId}})}})}function _it({asset:e}){const[t,n]=x.useState(new Set),r=wu(e),i=Qp(r),a=l=>{n(c=>{const u=new Set(c);return u.has(l)?u.delete(l):u.add(l),u})},o=i.percent===100?{bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))",border:"hsl(var(--c-positive-border))"}:{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))",border:"hsl(var(--c-warning-border))"};return s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:30,height:30,borderRadius:7,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(Ea,{size:14})}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Completeness audit"}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:2},children:"Required fields"})]})]}),s.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,background:o.bg,color:o.fg,border:`1px solid ${o.border}`,padding:"3px 8px",borderRadius:4,letterSpacing:"0.04em",textTransform:"uppercase"},children:[i.filled,"/",i.total," complete"]})]}),s.jsx("div",{style:{padding:"8px 14px 12px"},children:i.perCategory.map(l=>{const c=vi.find(f=>f.key===l.key);if(!c||l.total===0)return null;const u=l.filled===l.total?"complete":l.filled>0?"partial":"none",d=t.has(l.key),h=u==="complete"?s.jsx(sn,{size:14,color:"hsl(var(--c-positive-fg))"}):u==="partial"?s.jsx(ir,{size:14,color:"hsl(var(--c-warning-fg))"}):s.jsx(gn,{size:14,color:"hsl(var(--c-negative-fg))"});return s.jsxs("div",{children:[s.jsxs("button",{type:"button",onClick:()=>a(l.key),style:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"8px 4px",background:"transparent",border:0,borderRadius:6,cursor:"pointer",textAlign:"left",transition:"background 150ms"},onMouseEnter:f=>f.currentTarget.style.background="hsl(var(--c-surface))",onMouseLeave:f=>f.currentTarget.style.background="transparent",children:[h,s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-ink))",fontWeight:500,flex:1},children:l.label}),s.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-fg-subtle))",marginRight:4},children:[l.filled,"/",l.total]}),d?s.jsx(Ta,{size:13,color:"hsl(var(--c-fg-subtle))"}):s.jsx(Us,{size:13,color:"hsl(var(--c-fg-subtle))"})]}),d&&s.jsx("div",{style:{marginLeft:24,paddingBottom:6,display:"flex",flexDirection:"column",gap:4},children:c.fields.filter(f=>f.requiredForPublish).map(f=>{const p=r[f.key],m=p!=null&&p!==""&&!(Array.isArray(p)&&p.length===0);return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"2px 0"},children:[m?s.jsx(sn,{size:11,color:"hsl(var(--c-positive-fg))"}):s.jsx(gn,{size:11,color:"hsl(var(--c-negative-fg))"}),s.jsx("span",{style:{fontSize:12.5,color:m?"hsl(var(--c-fg-muted))":"hsl(var(--c-negative-fg))"},children:f.label})]},f.key)})})]},l.key)})})]})}const Sit=[{check:"Patent assignment matches submitted entity data"},{check:"Mechanism of action consistent across documents"},{check:"Safety summary aligns with toxicology report"},{check:"Clinical stage consistent with regulatory filings"},{check:"Inventor listed as company personnel"}];function kit(){return s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:30,height:30,borderRadius:7,background:"hsl(var(--c-stage-glp-bg))",color:"hsl(var(--c-stage-glp-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(kde,{size:14})}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Digital verification"}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:2},children:"Manual review checks"})]})]}),s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,background:"hsl(var(--c-surface))",color:"hsl(var(--c-fg-muted))",border:"1px solid hsl(var(--c-border))",padding:"3px 8px",borderRadius:4,letterSpacing:"0.06em",textTransform:"uppercase"},children:"Manual Review"})]}
861),s.jsxs("div",{style:{padding:18,display:"flex",flexDirection:"column",gap:14},children:[s.jsxs("div",{style:{display:"flex",gap:10,padding:"10px 12px",background:"hsl(var(--c-surface))",border:"1px solid hsl(var(--c-border))",borderRadius:8},children:[s.jsx(Pu,{size:14,color:"hsl(var(--c-fg-muted))",style:{flexShrink:0,marginTop:2}}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg))"},children:"Digital verification is performed manually by an xPharma admin once you submit the asset for review. The checks below will be evaluated during the review process."})]}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:Sit.map((e,t)=>s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:10},children:[s.jsx(sn,{size:14,color:"hsl(var(--c-fg-subtle))",style:{flexShrink:0,marginTop:2}}),s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:e.check})]},t))})]})]})}function Nit(){const{id:e}=Zs(),t=xr(),{user:n,isLoading:r}=me(),{data:i,isLoading:a}=An(),{data:o=[]}=Sk(),{data:l,isLoading:c}=wit(e),u=jit(),d=o.find(h=>h.id===e);return x.useEffect(()=>{r||a||(n?i!=null&&i.supplierUser||t("/auth?supplier=true"):t("/auth"))},[n,i,r,a,t]),x.useEffect(()=>{!c&&!l&&e&&d&&u.mutate(e)},[c,l,e,d]),r||a||c?s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"32px 24px",display:"flex",alignItems:"center",justifyContent:"center",height:256},children:s.jsx(ne,{className:"animate-spin",size:28,color:"hsl(var(--c-fg-muted))"})})}):!n||!d?null:s.jsx(he,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:s.jsxs("div",{className:"xph-container",style:{padding:"24px 24px 64px",maxWidth:880},children:[s.jsxs("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:()=>t("/supplier"),style:{marginBottom:16,paddingLeft:0},children:[s.jsx(Wt,{size:13}),"Back to dashboard"]}),s.jsxs("div",{style:{marginBottom:24},children:[s.jsx("div",{className:"eyebrow",children:"Onboarding · Step 3"}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,marginTop:8,flexWrap:"wrap"},children:[s.jsx("span",{style:{width:36,height:36,borderRadius:8,background:"hsl(var(--c-stage-preind-bg))",color:"hsl(var(--c-stage-preind-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(Oh,{size:17})}),s.jsx("h1",{className:"tt-display-md",children:"Asset verification"})]}),s.jsxs("p",{className:"tt-lead",style:{marginTop:12},children:[s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:d.productName})," ",s.jsx("span",{style:{color:"hsl(var(--c-fg-subtle))"},children:"·"})," ",d.primaryTarget]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[s.jsx(_it,{asset:d}),s.jsx(kit,{}),s.jsxs("div",{className:"xph-card",style:{padding:22,opacity:.6},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginBottom:8},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:30,height:30,borderRadius:7,background:"hsl(var(--c-surface))",color:"hsl(var(--c-fg-muted))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(Zo,{size:14})}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Certification"}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:2},children:"Forensic assessment"})]})]}),s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,background:"hsl(var(--c-surface))",color:"hsl(var(--c-fg-muted))",border:"1px solid hsl(var(--c-border))",padding:"3px 8px",borderRadius:4,letterSpacing:"0.06em",textTransform:"uppercase"},children:"Coming Soon"})]}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginLeft:40},children:"Independent forensic assessment will be available in a future release."})]})]})]})})})}function Cit({fields:e,data:t,onChange:n,readOnly:r}){return s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:22},children:e.map(i=>s.jsx(Ait,{field:i,value:t[i.key],onChange:a=>n(i.key,a),readOnly:r},i.key))})}function Ait({field:e,value:t,onChange:n,readOnly:r}){const[i,a]=x.useState(""),o=()=>
861{if(!i.trim())return;const l=Array.isArray(t)?t:[];n([...l,i.trim()]),a("")};return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx(Pe,{htmlFor:e.key,className:"eyebrow",style:{color:"hsl(var(--c-fg-muted))"},children:e.label}),e.requiredForPublish&&s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:9.5,textTransform:"uppercase",letterSpacing:"0.06em",color:"hsl(var(--c-warning-fg))",background:"hsl(var(--c-warning-soft))",border:"1px solid hsl(var(--c-warning-border))",borderRadius:3,padding:"1px 6px"},children:"Required"})]}),e.description&&s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:-2},children:e.description}),e.type==="text"&&s.jsx(Fe,{id:e.key,value:t||"",onChange:l=>n(l.target.value),placeholder:e.placeholder,disabled:r}),e.type==="number"&&s.jsx(Fe,{id:e.key,type:"number",value:t??"",onChange:l=>{const c=l.target.value;if(c===""){n(null);return}const u=parseFloat(c);n(Number.isFinite(u)?u:null)},placeholder:e.placeholder,min:e.min,max:e.max,step:e.step,disabled:r}),e.type==="textarea"&&s.jsx(Ys,{id:e.key,value:t||"",onChange:l=>n(l.target.value),placeholder:e.placeholder,rows:3,disabled:r}),e.type==="select"&&e.options&&s.jsxs($n,{value:t||"",onValueChange:l=>n(l==="__none__"?null:l),disabled:r,children:[s.jsx(On,{children:s.jsx(Ln,{placeholder:"Select..."})}),s.jsxs(In,{children:[s.jsx(Rt,{value:"__none__",children:"Not specified"}),e.options.map(l=>s.jsx(Rt,{value:l.value,children:l.label},l.value))]})]}),e.type==="boolean"&&s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx(jk,{id:e.key,checked:!!t,onCheckedChange:n,disabled:r}),s.jsx(Pe,{htmlFor:e.key,className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",fontWeight:400},children:t==null?"Not set":t?"Yes":"No"}),!r&&t!==null&&t!==void 0&&s.jsx("button",{type:"button",onClick:()=>n(null),className:"xph-btn xph-btn-ghost xph-btn-sm",style:{padding:"2px 8px",fontSize:11.5},children:"Clear"})]}),e.type==="array"&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[!r&&s.jsxs("div",{style:{display:"flex",gap:8},children:[s.jsx(Fe,{value:i,onChange:l=>a(l.target.value),placeholder:e.placeholder,onKeyDown:l=>l.key==="Enter"&&(l.preventDefault(),o())}),s.jsx("button",{type:"button",onClick:o,className:"xph-btn xph-btn-outline xph-btn-icon","aria-label":"Add",children:s.jsx(io,{size:14})})]}),Array.isArray(t)&&t.length>0&&s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:t.map((l,c)=>s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:12,padding:"3px 8px",borderRadius:4,background:"hsl(var(--c-surface-2))",border:"1px solid hsl(var(--c-border))",color:"hsl(var(--c-fg))"},children:[l,!r&&s.jsx("button",{type:"button",onClick:()=>n(t.filter((u,d)=>d!==c)),style:{background:"transparent",border:"none",cursor:"pointer",color:"hsl(var(--c-fg-muted))",padding:0,display:"inline-flex"},"aria-label":`Remove ${l}`,children:s.jsx(Ui,{size:12})})]},c))})]})]})}var ko="Accordion",Tit=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[a$,Eit,Pit]=Bm(ko),[Ok,Wpt]=sr(ko,[Pit,ote]),o$=ote(),use=L.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,a=r;return s.jsx(a$.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?s.jsx(Dit,{...a,ref:t}):s.jsx(Rit,{...i,ref:t})})});use.displayName=ko;var[dse,Oit]=Ok(ko),[hse,Iit]=Ok(ko,{collapsible:!1}),Rit=L.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:a=!1,...o}=e,[l,c]=ji({prop:n,defaultProp:r??"",onChange:i,caller:ko});return s.jsx(dse,{scope:e.__scopeAccordion,value:L.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:L.useCallback(()=>a&&c(""),[a,c]),children:s.jsx(hse,{scope:e.__scopeAccordion,collapsible:a,children:s.jsx(fse,{...o,ref:t})})})}),Dit=L.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,l]=ji({prop:n,defaultProp:r??[],onChange:i,caller:ko}),c=L.useCallback(d=>l((h=[])=>[...h,d]),[l]),u=L.useCallback(d=>l((h=[])=>h.filter(f=>f!==d)),[l]);return s.jsx(dse,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:u,children:s.jsx(hse,{scope:e.__scopeAccordion,collapsible:!0,children:s.jsx(fse,{...a,ref:t})})})}),[Mit,Ik]=Ok(ko),fse=L.forwardRef((e,t)=>
861{const{__scopeAccordion:n,disabled:r,dir:i,orientation:a="vertical",...o}=e,l=L.useRef(null),c=Ke(l,t),u=Eit(n),h=Du(i)==="ltr",f=fe(e.onKeyDown,p=>{var N;if(!Tit.includes(p.key))return;const m=p.target,g=u().filter(T=>{var C;return!((C=T.ref.current)!=null&&C.disabled)}),y=g.findIndex(T=>T.ref.current===m),b=g.length;if(y===-1)return;p.preventDefault();let v=y;const w=0,_=b-1,j=()=>{v=y+1,v>_&&(v=w)},S=()=>{v=y-1,v<w&&(v=_)};switch(p.key){case"Home":v=w;break;case"End":v=_;break;case"ArrowRight":a==="horizontal"&&(h?j():S());break;case"ArrowDown":a==="vertical"&&j();break;case"ArrowLeft":a==="horizontal"&&(h?S():j());break;case"ArrowUp":a==="vertical"&&S();break}const k=v%b;(N=g[k].ref.current)==null||N.focus()});return s.jsx(Mit,{scope:n,disabled:r,direction:i,orientation:a,children:s.jsx(a$.Slot,{scope:n,children:s.jsx(Ne.div,{...o,"data-orientation":a,ref:c,onKeyDown:r?void 0:f})})})}),s_="AccordionItem",[$it,l$]=Ok(s_),pse=L.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...i}=e,a=Ik(s_,n),o=Oit(s_,n),l=o$(n),c=gr(),u=r&&o.value.includes(r)||!1,d=a.disabled||e.disabled;return s.jsx($it,{scope:n,open:u,disabled:d,triggerId:c,children:s.jsx(ute,{"data-orientation":a.orientation,"data-state":bse(u),...l,...i,ref:t,disabled:d,open:u,onOpenChange:h=>{h?o.onItemOpen(r):o.onItemClose(r)}})})});pse.displayName=s_;var mse="AccordionHeader",gse=L.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=Ik(ko,n),a=l$(mse,n);return s.jsx(Ne.h3,{"data-orientation":i.orientation,"data-state":bse(a.open),"data-disabled":a.disabled?"":void 0,...r,ref:t})});gse.displayName=mse;var uO="AccordionTrigger",yse=L.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=Ik(ko,n),a=l$(uO,n),o=Iit(uO,n),l=o$(n);return s.jsx(a$.ItemSlot,{scope:n,children:s.jsx(k7e,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...l,...r,ref:t})})});yse.displayName=uO;var vse="AccordionContent",xse=L.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=Ik(ko,n),a=l$(vse,n),o=o$(n);return s.jsx(N7e,{role:"region","aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});xse.displayName=vse;function bse(e){return e?"open":"closed"}var Lit=use,Fit=pse,zit=gse,wse=yse,jse=xse;const Bit=Lit,_se=x.forwardRef(({className:e,...t},n)=>s.jsx(Fit,{ref:n,className:ae("border-b",e),...t}));_se.displayName="AccordionItem";const Sse=x.forwardRef(({className:e,children:t,...n},r)=>s.jsx(zit,{className:"flex",children:s.jsxs(wse,{ref:r,className:ae("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,s.jsx(Ta,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Sse.displayName=wse.displayName;const kse=x.forwardRef(({className:e,children:t,...n},r)=>s.jsx(jse,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:s.jsx("div",{className:ae("pb-4 pt-0",e),children:t})}));kse.displayName=jse.displayName;function Vit(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}
vendor: 12,959 bytes, line 861
861var c$="ScrollArea",[Nse,Upt]=sr(c$),[Wit,Ra]=Nse(c$),Cse=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:a=600,...o}=e,[l,c]=x.useState(null),[u,d]=x.useState(null),[h,f]=x.useState(null),[p,m]=x.useState(null),[g,y]=x.useState(null),[b,v]=x.useState(0),[w,_]=x.useState(0),[j,S]=x.useState(!1),[k,N]=x.useState(!1),T=Ke(t,A=>c(A)),C=Du(i);return s.jsx(Wit,{scope:n,type:r,dir:C,scrollHideDelay:a,scrollArea:l,viewport:u,onViewportChange:d,content:h,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:j,onScrollbarXEnabledChange:S,scrollbarY:g,onScrollbarYChange:y,scrollbarYEnabled:k,onScrollbarYEnabledChange:N,onCornerWidthChange:v,onCornerHeightChange:_,children:s.jsx(Ne.div,{dir:C,...o,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});Cse.displayName=c$;var Ase="ScrollAreaViewport",Tse=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=Ra(Ase,n),l=x.useRef(null),c=Ke(t,l,o.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),s.jsx(Ne.div,{"data-radix-scroll-area-viewport":"",...a,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Tse.displayName=Ase;var ll="ScrollAreaScrollbar",u$=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ra(ll,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,l=e.orientation==="horizontal";return x.useEffect(()=>(l?a(!0):o(!0),()=>{l?a(!1):o(!1)}),[l,a,o]),i.type==="hover"?s.jsx(Uit,{...r,ref:t,forceMount:n}):i.type==="scroll"?s.jsx(qit,{...r,ref:t,forceMount:n}):i.type==="auto"?s.jsx(Ese,{...r,ref:t,forceMount:n}):i.type==="always"?s.jsx(d$,{...r,ref:t}):null});u$.displayName=ll;var Uit=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ra(ll,e.__scopeScrollArea),[a,o]=x.useState(!1);return x.useEffect(()=>{const l=i.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),o(!0)},d=()=>{c=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),s.jsx(vr,{present:n||a,children:s.jsx(Ese,{"data-state":a?"visible":"hidden",...r,ref:t})})}),qit=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Ra(ll,e.__scopeScrollArea),a=e.orientation==="horizontal",o=Dk(()=>c("SCROLL_END"),100),[l,c]=Vit("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 x.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,i.scrollHideDelay,c]),x.useEffect(()=>{const u=i.viewport,d=a?"scrollLeft":"scrollTop";if(u){let h=u[d];const f=()=>{const p=u[d];h!==p&&(c("SCROLL"),o()),h=p};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[i.viewport,a,c,o]),s.jsx(vr,{present:n||l!=="hidden",children:s.jsx(d$,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:fe(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:fe(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Ese=x.forwardRef((e,t)=>{const n=Ra(ll,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=x.useState(!1),l=e.orientation==="horizontal",c=Dk(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?u:d)}},10);return Mm(n.viewport,c),Mm(n.content,c),s.jsx(vr,{present:r||a,children:s.jsx(d$,{"data-state":a?"visible":"hidden",...i,ref:t})})}),d$=x.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=Ra(ll,e.__scopeScrollArea),a=x.useRef(null),o=x.useRef(0),[l,c]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Dse(l.viewport,l.content),d={...r,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>a.current=f,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:f=>o.current=f};function h(f,p){return Xit(f,o.current,l,p)}return n==="horizontal"?s.jsx(Hit,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const f=i.viewport.scrollLeft,p=KV(f,l,i.dir);a.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollLeft=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollLeft=h(f,i.dir))}}):n==="vertical"?s.jsx(Kit,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const f=i.viewport.scrollTop,p=KV(f,l);a.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollTop=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollTop=h(f))}}):null}),Hit=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=Ra(ll,e.__scopeScrollArea),[o,l]=x.useState(),c=x.useRef(null),u=Ke(t,c,a.onScrollbarXChange);return x.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),s.jsx(Ose,{"data-orientation":"horizontal",...i,ref:u,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Rk(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(a.viewport){const f=a.viewport.scrollLeft+d.deltaX;e.onWheelScroll(f),$se(f,h)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:o_(o.paddingLeft),paddingEnd:o_(o.paddingRight)}})}})}),Kit=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=Ra(ll,e.__scopeScrollArea),[o,l]=x.useState(),c=x.useRef(null),u=Ke(t,c,a.onScrollbarYChange);return x.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),s.jsx(Ose,{"data-orientation":"vertical",...i,ref:u,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Rk(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(a.viewport){const f=a.viewport.scrollTop+d.deltaY;e.onWheelScroll(f),$se(f,h)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:o_(o.paddingTop),paddingEnd:o_(o.paddingBottom)}})}})}),[Git,Pse]=Nse(ll),Ose=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:h,...f}=e,p=Ra(ll,n),[m,g]=x.useState(null),y=Ke(t,T=>g(T)),b=x.useRef(null),v=x.useRef(""),w=p.viewport,_=r.content-r.viewport,j=Jn(d),S=Jn(c),k=Dk(h,10);function N(T){if(b.current){const C=T.clientX-b.current.left,A=T.clientY-b.current.top;u({x:C,y:A})}}return x.useEffect(()=>{const T=C=>{const A=C.target;(m==null?void 0:m.contains(A))&&j(C,_)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[w,m,_,j]),x.useEffect(S,[r,S]),Mm(m,k),Mm(p.content,k),s.jsx(Git,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:Jn(a),onThumbPointerUp:Jn(o),onThumbPositionChange:S,onThumbPointerDown:Jn(l),children:s.jsx(Ne.div,{...f,ref:y,style:{position:"absolute",...f.style},onPointerDown:fe(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),b.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),N(T))}),onPointerMove:fe(e.onPointerMove,N),onPointerUp:fe(e.onPointerUp,T=>{const C=T.target;C.hasPointerCapture(T.pointerId)&&C.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=""),b.current=null})})})}),a_="ScrollAreaThumb",Ise=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Pse(a_,e.__scopeScrollArea);return s.jsx(vr,{present:n||i.hasThumb,children:s.jsx(Yit,{ref:t,...r})})}),Yit=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,a=Ra(a_,n),o=Pse(a_,n),{onThumbPositionChange:l}=o,c=Ke(t,h=>o.onThumbChange(h)),u=x.useRef(void 0),d=Dk(()=>{u.current&&(u.current(),u.current=void 0)},100);return x.useEffect(()=>{const h=a.viewport;if(h){const f=()=>{if(d(),!u.current){const p=Zit(h,l);u.current=p,l()}};return l(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[a.viewport,d,l]),s.jsx(Ne.div,{"data-state":o.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:fe(e.onPointerDownCapture,h=>{const p=h.target.getBoundingClientRect(),m=h.clientX-p.left,g=h.clientY-p.top;o.onThumbPointerDown({x:m,y:g})}),onPointerUp:fe(e.onPointerUp,o.onThumbPointerUp)})});Ise.displayName=a_;var h$="ScrollAreaCorner",Rse=x.forwardRef((e,t)=>{const n=Ra(h$,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(Qit,{...e,ref:t}):null});Rse.displayName=h$;var Qit=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Ra(h$,n),[a,o]=x.useState(0),[l,c]=x.useState(0),u=!!(a&&l);return Mm(i.scrollbarX,()=>{var h;const d=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(d),c(d)}),Mm(i.scrollbarY,()=>{var h;const d=((h=i.scrollbarY)==null?void 0:h.offsetWidth)||0;i.onCornerWidthChange(d),o(d)}),u?s.jsx(Ne.div,{...r,ref:t,style:{width:a,height:l,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function o_(e){return e?parseInt(e,10):0}function Dse(e,t){const n=e/t;return isNaN(n)?0:n}function Rk(e){const t=Dse(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Xit(e,t,n,r="ltr"){const i=Rk(n),a=i/2,o=t||a,l=i-o,c=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,d=n.content-n.viewport,h=r==="ltr"?[0,d]:[d*-1,0];return Mse([c,u],h)(e)}function KV(e,t,n="ltr"){const r=Rk(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,l=a-r,c=n==="ltr"?[0,o]:[o*-1,0],u=ex(e,c);return Mse([0,o],[0,l])(u)}function Mse(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function $se(e,t){return e>0&&e<t}var Zit=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,l=n.top!==a.top;(o||l)&&t(),n=a,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Dk(e,t){const n=Jn(e),r=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),x.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Mm(e,t){const n=Jn(t);Lr(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var Lse=Cse,Jit=Tse,est=Rse;const f$=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Lse,{ref:r,className:ae("relative overflow-hidden",e),...n,children:[s.jsx(Jit,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(Fse,{}),s.jsx(est,{})]}));f$.displayName=Lse.displayName;const Fse=x.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(u$,{ref:r,orientation:t,className:ae("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:s.jsx(Ise,{className:"relative flex-1 rounded-full bg-border"})}));Fse.displayName=u$.displayName;function tst(){const{data:e=[]}=FM(),t=e.filter(r=>!r.parent_id),n=r=>e.filter(i=>i.parent_id===r);return s.jsxs(Br,{children:[s.jsx(Nte,{asChild:!0,children:s.jsx(je,{variant:"ghost",size:"icon",className:"h-7 w-7",children:s.jsx(I_,{className:"h-4 w-4 text-muted-foreground"})})}),s.jsxs(br,{className:"max-w-2xl max-h-[80vh]",children:[s.jsx(wr,{children:s.jsx(jr,{children:"Document Category Guide"})}),s.jsx(f$,{className:"h-[60vh] pr-4",children:s.jsx(Bit,{type:"multiple",className:"w-full",children:t.map(r=>
861s.jsxs(_se,{value:r.id,children:[s.jsx(Sse,{className:"text-sm",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:r.code}),r.name]})}),s.jsxs(kse,{children:[s.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:r.description}),s.jsx("div",{className:"space-y-2 pl-4 border-l-2 border-muted",children:n(r.id).map(i=>s.jsxs("div",{children:[s.jsxs("p",{className:"text-sm font-medium",children:[s.jsx("span",{className:"font-mono text-xs text-muted-foreground mr-2",children:i.code}),i.name]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:i.description})]},i.id))})]})]},r.id))})})]})]})}function nst(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function rst({open:e,onClose:t,filePath:n,fileName:r,mimeType:i,fileSize:a}){const[o,l]=x.useState(null),[c,u]=x.useState(null),[d,h]=x.useState(!1),[f,p]=x.useState(!1),m=i==="application/pdf",g=(i==null?void 0:i.startsWith("text/"))||i==="text/csv",y=i==null?void 0:i.startsWith("image/");x.useEffect(()=>{if(!e){o&&URL.revokeObjectURL(o),l(null),u(null);return}let v=!1;return h(!0),(async()=>{const{data:w,error:_}=await W.storage.from("supplier-documents").download(n);if(_||!w||v){_&&console.error("Download error:",_),v||h(!1);return}if(g){const j=await w.text();v||u(j.slice(0,1e5))}else{const j=URL.createObjectURL(w);v||l(j)}v||h(!1)})(),()=>{v=!0}},[e,n,g]);const b=x.useCallback(async()=>{p(!0);try{const{data:v,error:w}=await W.storage.from("supplier-documents").download(n);if(w)throw w;const _=URL.createObjectURL(v),j=document.createElement("a");j.href=_,j.download=r,j.click(),URL.revokeObjectURL(_)}catch(v){console.error("Download failed:",v)}finally{p(!1)}},[n,r]);return s.jsx(pb,{open:e,onOpenChange:v=>!v&&t(),children:s.jsxs(sg,{side:"right",className:"w-full sm:max-w-2xl flex flex-col p-0",children:[s.jsxs(uS,{className:"px-6 pt-6 pb-4",style:{borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsxs(dS,{className:"flex items-center gap-2 truncate pr-8",children:[s.jsx(ti,{className:"h-4 w-4 shrink-0",style:{color:"hsl(var(--c-fg-muted))"}}),s.jsx("span",{className:"truncate tt-body",style:{fontWeight:600,color:"hsl(var(--c-ink))"},children:r})]}),s.jsxs("div",{className:"flex items-center gap-3",style:{fontFamily:"var(--font-mono)",fontSize:11.5,color:"hsl(var(--c-fg-muted))",letterSpacing:"0.02em"},children:[s.jsx("span",{children:nst(a)}),i&&s.jsx("span",{children:i}),s.jsxs(je,{size:"sm",variant:"outline",className:"ml-auto h-7 text-xs",onClick:b,disabled:f,children:[f?s.jsx(ne,{className:"h-3 w-3 animate-spin mr-1"}):s.jsx(Rl,{className:"h-3 w-3 mr-1"}),"Download"]})]})]}),s.jsx("div",{className:"flex-1 min-h-0",children:d?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(ne,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):m&&o?s.jsx("object",{data:o,type:"application/pdf",className:"w-full h-full",children:s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 text-muted-foreground",children:[s.jsx(ti,{className:"h-16 w-16 opacity-30"}),s.jsx("p",{className:"text-sm",children:"PDF preview not supported in this browser"}),s.jsxs(je,{variant:"outline",onClick:b,disabled:f,children:[s.jsx(Rl,{className:"h-4 w-4 mr-2"}),"Download to view"]})]})}):y&&o?s.jsx("div",{className:"flex items-center justify-center h-full p-6",children:s.jsx("img",{src:o,alt:r,className:"max-w-full max-h-full object-contain rounded"})}):g&&c!==null?s.jsx(f$,{className:"h-full",children:s.jsx("pre",{className:"p-6 text-xs font-mono whitespace-pre-wrap break-words text-foreground",children:c})}):s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 text-muted-foreground",children:[s.jsx(ti,{className:"h-16 w-16 opacity-30"}),s.jsx("p",{className:"text-sm",children:"Preview not available for this file type"}),s.jsxs(je,{variant:"outline",onClick:b,disabled:f,children:[f?s.jsx(ne,{className:"h-4 w-4 animate-spin mr-2"}):s.jsx(Rl,{className:"h-4 w-4 mr-2"}),"Download to view"]})]})})]})})}const ist=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv",sst=20*1024*1024;function ast(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function ost({assetId:e,canEdit:t}){const{data:n=[],isLoading:r}=zM(e),{data:i=[]}=FM(),a=fet(e),o=pet(e),l=met(e),c=x.useRef(null),[u,d]=x.useState(!1),[h,f]=x.use
861State(null),[p,m]=x.useState(""),[g,y]=x.useState(""),[b,v]=x.useState(null),w=i.filter(C=>!C.parent_id),_=C=>i.filter(A=>A.parent_id===C),j=C=>{var A;return C?((A=i.find(O=>O.code===C))==null?void 0:A.name)||C:"—"},S=x.useCallback(C=>{Array.from(C).forEach(A=>{A.size>sst||a.mutate(A)})},[a]),k=x.useCallback(C=>{C.preventDefault(),d(!1),t&&S(C.dataTransfer.files)},[t,S]),N=C=>{f(C.id),m(C.category_code||""),y(C.subcategory_code||"")},T=()=>{h&&(o.mutate({id:h,updates:{category_code:p||null,subcategory_code:g||null}}),f(null))};return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,flexWrap:"wrap"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-muted))"},children:[n.length," document",n.length!==1?"s":""]}),n.length>0&&s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["· ",n.filter(C=>!C.is_confidential).length," of ",n.length," non-confidential"]}),s.jsx(tst,{})]}),t&&s.jsxs(je,{size:"sm",variant:"outline",onClick:()=>{var C;return(C=c.current)==null?void 0:C.click()},disabled:a.isPending,children:[a.isPending?s.jsx(ne,{className:"h-4 w-4 mr-1 animate-spin"}):s.jsx(yj,{className:"h-4 w-4 mr-1"}),"Upload"]}),s.jsx("input",{ref:c,type:"file",multiple:!0,accept:ist,className:"hidden",onChange:C=>C.target.files&&S(C.target.files)})]}),t&&s.jsxs(bn,{style:{background:"hsl(var(--c-warning-soft))",border:"1px solid hsl(var(--c-warning-border))"},children:[s.jsx(Pu,{className:"h-4 w-4",style:{color:"hsl(var(--c-warning-fg))"}}),s.jsx(wn,{className:"tt-body-sm",style:{color:"hsl(var(--c-warning-deep))"},children:"Documents are confidential by default and accessible only to your team and xPharma admins. Mark specific documents as non-confidential to share them with approved buyers when the asset is listed. At least one non-confidential document is required before submitting for review."})]}),t&&s.jsxs("div",{onDragOver:C=>{C.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:k,onClick:()=>{var C;return(C=c.current)==null?void 0:C.click()},style:{padding:22,textAlign:"center",cursor:"pointer",borderRadius:10,border:"2px dashed",borderColor:u?"hsl(var(--c-accent))":"hsl(var(--c-border))",background:u?"hsl(var(--c-accent-soft))":"hsl(var(--c-surface))",transition:"all 150ms"},children:[s.jsx(yj,{size:28,style:{color:"hsl(var(--c-fg-muted))",margin:"0 auto 8px"}}),s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:["Drag & drop files here or"," ",s.jsx("span",{style:{color:"hsl(var(--c-accent))",textDecoration:"underline"},children:"browse"})]}),s.jsx("p",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:4},children:"PDF, DOC, XLS, PPT, TXT, CSV — max 20 MB"})]}),r?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ne,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):n.length===0?s.jsxs("div",{style:{textAlign:"center",padding:"32px 0",color:"hsl(var(--c-fg-muted))"},children:[s.jsx(ti,{size:36,style:{margin:"0 auto 8px",opacity:.4}}),s.jsx("p",{className:"tt-body-sm",children:"No documents uploaded yet"})]}):s.jsxs($l,{children:[s.jsx(Ll,{children:s.jsxs(Ir,{children:[s.jsx(lt,{children:"File"}),s.jsx(lt,{children:"Category"}),s.jsx(lt,{children:"Subcategory"}),s.jsx(lt,{children:"Access"}),s.jsx(lt,{children:s.jsxs(ni,{children:[s.jsx(ri,{asChild:!0,children:s.jsx("span",{className:"cursor-help underline decoration-dotted underline-offset-2",children:"Status"})}),s.jsx(Kr,{children:s.jsx("p",{className:"max-w-xs text-xs",children:"How the document was categorized. Hover a badge for details."})})]})}),s.jsx(lt,{children:s.jsxs(ni,{children:[s.jsx(ri,{asChild:!0,children:s.jsx("span",{className:"cursor-help underline decoration-dotted underline-offset-2",children:"Confidence"})}),s.jsx(Kr,{children:s.jsx("p",{className:"max-w-xs text-xs",children:"How sure the AI is about the suggested document category (0–100%)."})})]})}),s.jsx(lt,{className:"text-right",children:"Size"}),s.jsx(lt,{className:"w-24"})]})}),s.jsx(Fl,{children:n.map(C=>s.jsxs(Ir,{children:[s.jsx(st,{className:"max-w-[200px]",children:s.jsxs(ni,{children:[s.jsx(ri,{asChild:!0,children:s.jsx("button",{type:"button",className:"font-medium truncate cursor-pointer hover:text-primary transition-colors text-left w-full block",onClick:()=>v(C),children:C.file_name})}),s.jsx(Kr,{children:s.jsx("p",{className:"max-w-md text-xs break-all",children:C.file_name})})]})}),s.jsx(st,{children:h===C.id?s.jsxs($n,{value:p,onValueChange:A=>{m(A),y("")},children:[s.jsx(On,{className:"h-8 w-[160px]",children:s.jsx(Ln,{placeholder:"Category"})}),s.jsx(In,{children:w.map(A=>
861s.jsxs(Rt,{value:A.code,children:[A.code," ",A.name]},A.id))})]}):s.jsx("span",{className:"text-sm",children:j(C.category_code)})}),s.jsx(st,{children:h===C.id?s.jsxs($n,{value:g,onValueChange:y,disabled:!p,children:[s.jsx(On,{className:"h-8 w-[180px]",children:s.jsx(Ln,{placeholder:"Subcategory"})}),s.jsx(In,{children:p&&_(p).map(A=>s.jsxs(Rt,{value:A.code,children:[A.code," ",A.name]},A.id))})]}):s.jsx("span",{className:"text-sm",children:j(C.subcategory_code)})}),s.jsx(st,{children:t?s.jsx(je,{variant:"ghost",size:"sm",className:"h-7 gap-1 text-xs",onClick:()=>o.mutate({id:C.id,updates:{is_confidential:!C.is_confidential}}),children:C.is_confidential?s.jsxs(s.Fragment,{children:[s.jsx(Zo,{className:"h-3.5 w-3.5"})," Confidential"]}):s.jsxs(s.Fragment,{children:[s.jsx(y4,{className:"h-3.5 w-3.5 text-green-600"})," Shared"]})}):s.jsx("span",{className:"text-xs flex items-center gap-1",children:C.is_confidential?s.jsxs(s.Fragment,{children:[s.jsx(Zo,{className:"h-3 w-3"})," Confidential"]}):s.jsxs(s.Fragment,{children:[s.jsx(y4,{className:"h-3 w-3"})," Shared"]})})}),s.jsx(st,{children:s.jsxs(ni,{children:[s.jsx(ri,{asChild:!0,children:s.jsx("span",{className:"inline-block",children:C.status==="processing"?s.jsxs(pn,{variant:"secondary",className:"gap-1 cursor-help",children:[s.jsx(ne,{className:"h-3 w-3 animate-spin"})," Processing"]}):C.status==="manual"?s.jsx(pn,{variant:"outline",className:"text-yellow-600 border-yellow-400 cursor-help",children:"Manual"}):s.jsx(pn,{variant:"default",className:"bg-green-600 hover:bg-green-700 cursor-help",children:"Categorized"})})}),s.jsx(Kr,{children:s.jsx("p",{className:"max-w-xs text-xs",children:C.status==="processing"?"Upload received. AI is reading and categorizing the document.":C.status==="manual"?"A workspace user overrode the AI's categorization. This override persists across further extractions.":"Auto-categorized by AI. You can override the category at any time."})})]})}),s.jsx(st,{children:C.status==="processing"?s.jsx(ne,{className:"h-3 w-3 animate-spin text-muted-foreground"}):C.status==="manual"||C.ai_confidence==null||C.ai_confidence<=0?s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):(()=>{const A=Math.round(C.ai_confidence*100),O=A>=70?"bg-green-600":A>=40?"bg-yellow-500":"bg-red-500";return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"h-2 w-20 rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:`h-full ${O}`,style:{width:`${A}%`}})}),s.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[A,"%"]})]})})()}),s.jsx(st,{className:"text-right text-sm text-muted-foreground",children:ast(C.file_size)}),s.jsx(st,{children:s.jsxs("div",{className:"flex gap-1 justify-end",children:[s.jsx(je,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>v(C),children:s.jsx(Na,{className:"h-3.5 w-3.5"})}),t&&h===C.id?s.jsxs(s.Fragment,{children:[s.jsx(je,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:T,children:s.jsx(Fr,{className:"h-3.5 w-3.5"})}),s.jsx(je,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>f(null),children:s.jsx(Ui,{className:"h-3.5 w-3.5"})})]}):t?s.jsxs(s.Fragment,{children:[s.jsx(je,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>N(C),children:s.jsx(kI,{className:"h-3.5 w-3.5"})}),s.jsx(je,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive",onClick:()=>l.mutate({id:C.id,filePath:C.file_path}),children:s.jsx(Gl,{className:"h-3.5 w-3.5"})})]}):null]})})]},C.id))})]}),b&&s.jsx(rst,{open:!!b,onClose:()=>v(null),filePath:b.file_path,fileName:b.file_name,mimeType:b.mime_type,fileSize:b.file_size})]})}const lst=Em(Gs({label:ut(),value:ut()})),cst=Gs({heading:ut().optional(),items:Em(Gs({title:ut(),description:ut()}))}),ust=Em(Gs({name:ut(),title:ut(),linkedin_url:ut().optional()})),dst=Em(Gs({text:ut(),attribution:ut()})),hst=Gs({email:ut().optional(),website:ut().optional(),locations:ut().optional()}),fst=Em(Gs({title:ut(),kind_label:ut(),tags:Em(ut()).default([]),url:ut().optional()}));function Ef(e,t){if(t==null)return null;const n=e.safeParse(t);return n.success?n.data:null}function pst({requiresCda:e}){const t=e?{fg:"hsl(var(--c-warning-fg))",bg:"hsl(var(--c-warning-soft))",border:"hsl(var(--c-warning-border))"}:{fg:"hsl(var(--c-positive-fg))",bg:"hsl(var(--c-positive-soft))",border:"hsl(var(--c-positive-border))"};return s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:9.5,letterSpacing:"0.04em",textTransform:"uppercase",fontWeight:600,padding:"3px 7px",borderRadius:4,color:t.fg,background:t.bg,border:`1px solid ${t.border}`,whiteSpace:"nowrap"},children:e?"Requires CDA":"Public data · no CDA"})}
861function GV(e){const t=[e.price_display,e.turnaround_display].filter(Boolean);return t.length?t.join(" · "):null}function l_({service:e,compact:t,onRequest:n}){const r=e.tier==="bespoke"?"Request scope":"Request";return s.jsxs("div",{style:{border:"1px solid hsl(var(--c-border))",borderRadius:9,padding:t?"12px 13px":14,background:"hsl(var(--c-card))"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:8},children:[s.jsx("span",{style:{fontSize:t?13:15,fontWeight:600,color:"hsl(var(--c-ink))"},children:e.name}),GV(e)&&s.jsx("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-ink))",whiteSpace:"nowrap",fontWeight:600},children:GV(e)})]}),e.description&&s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",margin:t?"5px 0 10px":"6px 0 12px",fontSize:t?11.5:void 0,lineHeight:t?1.45:void 0},children:e.description}),s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[s.jsx(pst,{requiresCda:e.requires_cda}),s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[!n&&s.jsx("span",{className:"tt-meta",style:{color:"hsl(var(--c-fg-subtle))"},children:"For supplier members"}),s.jsx("button",{type:"button",disabled:!n,"aria-disabled":!n,title:n?void 0:"Engagement requests are available to supplier members.",onClick:n?()=>n(e):void 0,style:{fontSize:12,fontWeight:600,borderRadius:7,padding:"6px 12px",cursor:n?"pointer":"not-allowed",opacity:n?1:.55,background:e.tier==="bespoke"?"transparent":"hsl(var(--c-partner))",color:e.tier==="bespoke"?"hsl(var(--c-partner))":"hsl(var(--c-ink-inverse))",border:e.tier==="bespoke"?"1px solid hsl(var(--c-partner-border))":"1px solid hsl(var(--c-partner))"},children:r})]})]})]})}function mst(e,t,n){const r=e??t??null;return r&&n.includes(r)?r:null}function gst(e,t){return e?t.some(n=>n.id===e)?[e]:[]:[]}const YV=2e3;function zse({open:e,onOpenChange:t,partner:n,service:r=null,defaultAssetId:i,clientSupplierId:a,originSurface:o}){var D;const{toast:l}=xt(),c=xr(),{data:u}=An(),d=mst(a,(D=u==null?void 0:u.supplier)==null?void 0:D.id,(u==null?void 0:u.allMemberships.map(E=>E.supplier.id))??[]),{data:h=[],isLoading:f,isFetching:p,isError:m,refetch:g}=Sk(d),y=cnt(),b=n.profile.display_name,[v,w]=x.useState(""),[_,j]=x.useState(""),[S,k]=x.useState(new Set),[N,T]=x.useState(!1),[C,A]=x.useState(""),O=x.useRef(!1),z=C!=="";x.useEffect(()=>{if(!e){O.current=!1,w(""),j(""),k(new Set),T(!1),A("");return}if(!d||O.current||f||i&&(p||m))return;const E=i?h.find(q=>q.id===i):null;w([(r==null?void 0:r.name)??"Engagement",E==null?void 0:E.productName].filter(Boolean).join(" — ")),j(""),k(new Set(gst(i,h))),T(!1),A(crypto.randomUUID()),O.current=!0},[h,m,p,f,i,e,r==null?void 0:r.name,d]);const $=E=>{k(q=>{const X=new Set(q);return X.has(E)?X.delete(E):X.add(E),X})},F=_.length>YV,B=!!i&&!f&&!p&&(m||!h.some(E=>E.id===i)),P=O.current&&!!d&&!!C&&v.trim().length>=3&&!F&&!B&&!y.isPending,I=(r==null?void 0:r.requires_cda)??!1,M=!I&&S.size>0,R=x.useMemo(()=>[...h].sort((E,q)=>E.productName.localeCompare(q.productName)),[h]),K=async()=>{if(!(!P||!d))try{const{engagementId:E}=await y.mutateAsync({engagementId:C,partnerOrgId:n.profile.org_id,clientSupplierId:d,title:v.trim(),serviceId:(r==null?void 0:r.id)??null,brief:_.trim()||null,assetIds:Array.from(S),preGrant:M&&N,originSurface:o});l({title:"Request sent",description:`${b} has been notified. Track the engagement from your dashboard.`}),t(!1),c(`/supplier/engagements/${E}`)}catch(E){l({title:"Request failed",description:Cl(E,"Failed to send the request. Please try again."),variant:"destructive"})}};return s.jsx(Br,{open:e,onOpenChange:t,children:s.jsxs(br,{style:{maxWidth:520},children:[s.jsxs(wr,{children:[s.jsx(jr,{children:r?`Request ${r.name}`:`Engage ${b}`}),s.jsx(So,{children:r?`Sends a ${r.name} request to ${b}. They see your company, the brief, and the assets you attach.`:`Describes what you need from ${b}. They see your company, the brief, and the assets you attach.`})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"engagement-title",children:"Title"}
861),s.jsx(Fe,{id:"engagement-title",value:v,onChange:E=>w(E.target.value),disabled:!z,placeholder:"e.g. Asset Readiness Review — ISM6166"})]}),s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"engagement-brief",children:"Brief (optional)"}),s.jsx(Ys,{id:"engagement-brief",value:_,onChange:E=>j(E.target.value),disabled:!z,rows:4,placeholder:"Scope, timing, and anything the partner should know up front."}),s.jsxs("p",{className:"tt-meta",style:{marginTop:4,color:F?"hsl(var(--c-negative-fg))":"hsl(var(--c-fg-subtle))"},children:[_.length,"/",YV]})]}),R.length>0&&s.jsxs("div",{children:[s.jsx(Pe,{children:"Assets (optional)"}),s.jsx("div",{style:{border:"1px solid hsl(var(--c-border))",borderRadius:8,marginTop:6,maxHeight:180,overflowY:"auto"},children:R.map(E=>s.jsxs("label",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",borderBottom:"1px solid hsl(var(--c-border))",cursor:"pointer"},children:[s.jsx(pu,{checked:S.has(E.id),onCheckedChange:()=>$(E.id)}),s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-ink))",fontWeight:500},children:E.productName}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:[Nn[E.stage]??E.stage,E.therapeuticArea?` · ${E.therapeuticArea}`:""]})]},E.id))})]}),B&&s.jsxs("div",{className:"tt-body-sm",style:{background:"hsl(var(--c-warning-soft))",border:"1px solid hsl(var(--c-warning-border))",color:"hsl(var(--c-warning-fg))",borderRadius:8,padding:"10px 12px"},children:["This asset could not be verified against its supplier membership.",m&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{marginLeft:8},onClick:()=>{g()},children:"Try again"})]}),I&&s.jsxs("div",{className:"tt-body-sm",style:{background:"hsl(var(--c-warning-soft))",border:"1px solid hsl(var(--c-warning-border))",color:"hsl(var(--c-warning-fg))",borderRadius:8,padding:"10px 12px"},children:["This service requires a CDA. ",b," will see the engagement and the asset names you attach, but asset details stay locked until you confirm the CDA on the engagement page."]}),M&&s.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:10,cursor:"pointer"},children:[s.jsx(pu,{checked:N,onCheckedChange:E=>T(E===!0)}),s.jsxs("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg))"},children:["Share the selected assets' details with ",b," immediately",s.jsx("span",{className:"tt-meta",style:{display:"block",color:"hsl(var(--c-fg-subtle))"},children:"You can revoke access at any time from the engagement page."})]})]})]}),s.jsxs(_i,{children:[s.jsx(je,{variant:"outline",className:"xph-btn-sm",onClick:()=>t(!1),children:"Cancel"}),s.jsxs(je,{className:"xph-btn-sm",onClick:K,disabled:!P,children:[y.isPending?s.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(Bp,{className:"mr-2 h-4 w-4"}),"Send request"]})]})]})})}function Bse(e){return e.side==="sell"||e.side==="both"}function yst({assetId:e,assetSupplierId:t,therapeuticArea:n,modality:r}){const{data:i,isError:a,isLoading:o}=Ak(),{data:l}=An(),[c,u]=x.useState(null),[d,h]=x.useState(!1),f=x.useMemo(()=>{if(!i||i.length===0)return null;let A=null;for(const O of i){const z=lO(O.capabilities,{therapeuticArea:n,modality:r});(!A||z.score>A.match.score)&&(A={partner:O,match:z})}return A},[i,n,r]);if(a||o||!f)return null;const{partner:p,match:m}=f,{profile:g}=p,y=[m.matchedTa,m.matchedModality?zx("modality",m.matchedModality):null].filter(Boolean),b=Ef(fst,g.research)??[],v=[n,r].filter(Boolean).map(A=>Bl(A)),w=b.filter(A=>A.tags.some(O=>{const z=Bl(O);return v.some($=>$.includes(z)||z.includes($))})),_=(w.length>0?w:b).slice(0,2),j=w.length>0,S=p.services.filter(Bse),k=S.filter(A=>A.tier==="ready_made"),N=S.filter(A=>A.tier==="bespoke"),C=(l==null?void 0:l.allMemberships.some(A=>A.supplier.id===t))?A=>{u(A),h(!0)}:void 0;return s.jsxs(s.Fragment,{children:[s.jsx(Ng,{children:s.jsxs("div",{className:"xph-card",style:{overflow:"hidden",marginBottom:16,borderColor:"hsl(var(--c-partner-border))"},children:[s.jsxs("div",{style:{padding:"14px 18px",borderBottom:"1px solid hsl(var(--c-partner-border))",background:"hsl(var(--c-partner-soft))",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,flexWrap:"wrap"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:11},children:[s.jsx(Bx,{name:g.display_name,logoUrl:g.logo_url,size:32,radiu
861s:8}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-partner))"},children:"Solution Partner"}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:1},children:[s.jsx("span",{className:"tt-display-sm",style:{fontSize:16},children:g.display_name}),s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontFamily:"var(--font-mono)",fontSize:9,letterSpacing:"0.05em",textTransform:"uppercase",color:"hsl(var(--c-partner))",fontWeight:600},children:"✓ Verified Partner"})]})]})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[y.length>0&&s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontFamily:"var(--font-mono)",fontSize:10,letterSpacing:"0.04em",textTransform:"uppercase",fontWeight:600,color:"hsl(var(--c-partner))",background:"hsl(var(--c-card))",border:"1px solid hsl(var(--c-partner-border))",borderRadius:20,padding:"4px 10px"},children:["◆ Matched: ",y.join(" · ")]}),s.jsxs(oe,{to:`/solutions-partners/${g.slug}`,className:"xph-btn xph-btn-outline xph-btn-sm",style:{textDecoration:"none"},children:["View partner",s.jsx(Gn,{size:12})]})]})]}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 340px), 1fr))",gap:0},children:[_.length>0&&s.jsxs("div",{style:{padding:"16px 18px",borderRight:"1px solid hsl(var(--c-border))"},children:[s.jsxs("div",{className:"eyebrow",style:{marginBottom:10},children:["Relevant ",g.display_name," research"]}),_.map(A=>s.jsxs("div",{style:{display:"flex",gap:12,padding:11,border:"1px solid hsl(var(--c-border))",borderRadius:9,marginBottom:9}
861,children:[s.jsx("div",{"aria-hidden":"true",style:{width:42,height:54,borderRadius:5,flex:"none",background:"linear-gradient(160deg, hsl(var(--c-partner-fg)), hsl(var(--c-partner-ink)))"}}),s.jsxs("div",{children:[s.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:9,letterSpacing:"0.05em",textTransform:"uppercase",color:"hsl(var(--c-partner))",fontWeight:600},children:A.kind_label}),s.jsx("div",{className:"tt-body-sm",style:{color:"hsl(var(--c-ink))",fontWeight:600,margin:"3px 0 5px",lineHeight:1.25},children:A.title}),s.jsx("div",{style:{display:"flex",gap:5,flexWrap:"wrap"},children:A.tags.map(O=>s.jsx("span",{style:{fontSize:10,color:"hsl(var(--c-fg-muted))",background:"hsl(var(--c-surface-2))",borderRadius:4,padding:"2px 6px"},children:zx("modality",O)},O))})]})]},A.title)),j&&s.jsx("p",{className:"tt-meta",style:{marginTop:12,color:"hsl(var(--c-fg-subtle))"},children:"Matched to this asset's indication & modality."})]}),S.length>0&&s.jsxs("div",{style:{padding:"16px 18px"},children:[s.jsxs("div",{className:"eyebrow",style:{marginBottom:10},children:["Work with ",g.display_name]}),k.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:9},children:[s.jsx("span",{style:{fontSize:12,fontWeight:600,color:"hsl(var(--c-ink))"},children:"Ready-made"}),s.jsxs("span",{className:"tt-meta",style:{color:"hsl(var(--c-fg-subtle))"},children:["· fixed scope & price",k.every(A=>!A.requires_cda)?" · no CDA":""]})]}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:9,marginBottom:14},children:k.map(A=>s.jsx(l_,{service:A,compact:!0,onRequest:C},A.id))})]}),N.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:9},children:[s.jsx("span",{style:{fontSize:12,fontWeight:600,color:"hsl(var(--c-ink))"},children:"Bespoke"}),s.jsxs("span",{className:"tt-meta",style:{color:"hsl(var(--c-fg-subtle))"},children:["· custom scope",N.some(A=>A.requires_cda)?" · confidential documents under CDA":""]})]}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:9},children:N.map(A=>s.jsx(l_,{service:A,compact:!0,onRequest:C},A.id))})]})]})]})]})}),C&&s.jsx(zse,{open:d,onOpenChange:h,partner:p,service:c,defaultAssetId:e,clientSupplierId:t,originSurface:"asset_workspace"})]})}function vst(e){const{toast:t}=xt(),n=Ae(),r=Ye(),i=$e({mutationFn:async o=>{const l={asset_id:e};o!=null&&o.length&&(l.target_fields=o);const{data:c,error:u}=await W.functions.invoke("extract-asset-data",{body:l});if(u)throw u;if(c!=null&&c.error)throw new Error(c.error);return{...c,targetFields:o}},onSuccess:({extraction_id:o,fields_extracted:l,targetFields:c})=>{n.invalidateQueries({queryKey:["asset-extractions",e]}),r({action:"extract_asset_data",entityType:Ve.assetExtractions,entityId:o,metadata:{asset_id:e,fields_extracted:l,target_fields:c??null}})},onError:o=>{t({title:"Extraction failed",description:o.message||"Could not extract data from documents",variant:"destructive"})}}),a=Se({queryKey:["asset-extractions",e],queryFn:async()=>{const{data:o,error:l}=await W.from("asset_extractions").select("*").eq("asset_id",e).order("created_at",{ascending:!1});if(l)throw l;return o},enabled:!!e});return{extract:i,history:a}}function ew(e){return e==null||e===""?"(empty)":Array.isArray(e)?e.length?e.join(", "):"(empty)":typeof e=="boolean"?e?"Yes":"No":String(e)}function xst({open:e,onOpenChange:t,extraction:n,currentData:r,onApply:i}){const a=x.useMemo(()=>new Set(n.suspect_fields??[]),[n.suspect_fields]),o=x.useMemo(()=>{const g=[];for(const b of vi)for(const v of b.fields){const w=n.extractions[v.key];if(w==null)continue;const _=r[v.key],j=_==null||_===""||Array.isArray(_)&&_.length===0,S=ew(w),N=ew(_)===S;let T="new";!j&&N?T="unchanged":!j&&!N&&(T="overwrite"),g.push({key:v.key,label:v.label,category:b.label,currentValue:_,extractedValue:w,type:T,confidence:n.confidence[v.key],sources:n.sources[v.key],suspect:a.has(v.key)})}const y={new:0,overwrite:1,unchanged:2};return g.sort((b,v)=>y[b.type]-y[v.type]),g},[n,r,a]),[l,c]=x.useState(()=>new Set(o.filter(g=>g.type==="new"&&!g.suspect).map(g=>g.key))),u=g=>{c(y=>{const b=new Set(y);return b.has(g)?b.delete(g):b.add(g),b})},d=()=>{c(new Set(o.filter(g=>g.type==="new"&&!g.suspect).map(g=>g.key)))},h=()=>{c(new Set(o.filter(g=>g.type!=="unchanged").map(g=>g.key)))},f=()=>{const g={};for(const y of l){const b=o.find(v=>v.key===y);b&&(g[y]=b.extractedValue)}i(g),t(!1)},p=o.filter(g=>g.type==="new").length,m=o.filter(g=>g.type==="overwrite").length;return s.jsx(Br,{open:e,onOpenChange:t,children:s.jsxs(br,{className:"max-w-4xl max-h-[85vh] flex flex-col overflow-hidden",children:[s.jsxs(wr,{children:[s.jsxs(jr,{className:"flex items-center gap-2",children:["Extracted Data Review",s.jsxs(pn,{variant:"secondary",className:"text-xs",children:[o.length," fields"]})]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Review extracted values and select which ones to apply. ",p>0&&s.jsxs("span",{className:"text-green-600 dark:text-green-400",children:[p," new fills"]}),p>0&&m>0&&", ",m>
8610&&s.jsxs("span",{className:"text-amber-600 dark:text-amber-400",children:[m," overwrites"]})]})]}),n.documents&&n.documents.some(g=>g.status!=="ok")&&s.jsxs("div",{className:"rounded-md border border-amber-200 dark:border-amber-900/40 bg-amber-50 dark:bg-amber-950/20 px-3 py-2 text-xs space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5 font-medium text-amber-800 dark:text-amber-300",children:[s.jsx(va,{className:"h-3.5 w-3.5"}),"Some documents could not be fully read"]}),s.jsx("ul",{className:"text-amber-700 dark:text-amber-400 ml-5 list-disc",children:n.documents.filter(g=>g.status!=="ok").map(g=>s.jsxs("li",{children:[s.jsx("span",{className:"font-medium",children:g.fileName})," ",g.status==="vision_only"?"— sent as images for visual reading (text extraction unavailable)":"— no readable content extracted"]},g.fileName))})]}),a.size>0&&s.jsxs("div",{className:"rounded-md border border-amber-200 dark:border-amber-900/40 bg-amber-50 dark:bg-amber-950/20 px-3 py-2 text-xs flex items-start gap-1.5",children:[s.jsx(va,{className:"h-3.5 w-3.5 text-amber-700 dark:text-amber-400 mt-0.5 shrink-0"}),s.jsxs("span",{className:"text-amber-800 dark:text-amber-300",children:[s.jsx("strong",{children:a.size})," field",a.size!==1?"s":""," could not be verified against the source documents and may be inaccurate. These are flagged with"," ",s.jsx(va,{className:"inline h-3 w-3 text-amber-700"})," and unselected by default — review before applying."]})]}),s.jsxs("div",{className:"flex gap-2 mb-2",children:[s.jsx(je,{variant:"outline",size:"sm",onClick:d,children:"Select All New"}),s.jsx(je,{variant:"outline",size:"sm",onClick:h,children:"Select All Changes"}),s.jsx(je,{variant:"ghost",size:"sm",onClick:()=>c(new Set),children:"Clear"})]}),s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto -mx-6 px-6",children:s.jsx(Rv,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"grid grid-cols-[32px_1fr_1fr_1fr_32px] gap-2 text-xs font-medium text-muted-foreground px-2 py-1 border-b",children:[s.jsx("span",{}),s.jsx("span",{children:"Field"}),s.jsx("span",{children:"Current Value"}),s.jsx("span",{children:"Extracted Value"}),s.jsx("span",{})]}),o.map(g=>{var w;const y=l.has(g.key),b=g.type==="unchanged",v=g.suspect?"bg-amber-50 dark:bg-amber-950/20 border border-amber-300 dark:border-amber-900/60":g.type==="new"?"bg-green-50 dark:bg-green-950/20":g.type==="overwrite"?"bg-amber-50 dark:bg-amber-950/20":"";return s.jsxs("div",{className:`grid grid-cols-[32px_1fr_1fr_1fr_32px] gap-2 items-start px-2 py-2 rounded-md text-sm ${v}`,children:[s.jsx("div",{className:"pt-0.5",children:s.jsx(pu,{checked:y,onCheckedChange:()=>u(g.key),disabled:b})}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:g.label}),s.jsxs("span",{className:"text-xs text-muted-foreground ml-1",children:["(",g.category,")"]}),g.suspect&&s.jsxs(ni,{children:[s.jsx(ri,{asChild:!0,children:s.jsxs(pn,{variant:"outline",className:"ml-1 text-[10px] px-1 border-amber-400 text-amber-700 dark:text-amber-400 cursor-help",children:[s.jsx(va,{className:"h-2.5 w-2.5 mr-0.5"}),"Unverified"]})}),s.jsx(Kr,{side:"top",className:"max-w-xs",children:s.jsx("p",{className:"text-xs",children:"This value could not be matched to text in the source documents. It may be inferred or hallucinated. Review carefully."})})]}),g.confidence!==void 0&&s.jsxs(pn,{variant:"outline",className:"ml-1 text-[10px] px-1",children:[Math.round(g.confidence*100),"%"]})]}),s.jsx("div",{className:"text-muted-foreground break-words",children:ew(g.currentValue)}),s.jsx("div",{className:"break-words font-medium",children:ew(g.extractedValue)}),s.jsxs("div",{className:"pt-0.5",children:[g.type==="new"&&s.jsx(sn,{className:"h-4 w-4 text-green-600"}),g.type==="overwrite"&&s.jsx(ir,{className:"h-4 w-4 text-amber-600"}),g.type==="unchanged"&&s.jsx(Vde,{className:"h-4 w-4 text-muted-foreground"}),(w=g.sources)!=null&&w.length?s.jsxs(ni,{children:[s.jsx(ri,{asChild:!0,children:s.jsx(ti,{className:"h-3.5 w-3.5 text-muted-foreground mt-1 cursor-help"})}),s.jsxs(Kr,{side:"left",className:"max-w-xs",children:[s.jsx("p",{className:"text-xs font-medium mb-1",children:"Sources:"}),g.sources.map((_,j)=>s.jsx("p",{className:"text-xs",children:_},j))]})]}):null]})]},g.key)}),o.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No data could be extracted from the documents."})]})})}),s.jsxs(_i,{className:"pt-4",children:[s.jsx(je,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsxs(je,{onClick:f,disabled:l.size===0,children:["Apply ",l.size," Field",l.size!==1?"s":""]})]})]})})}function bst({open:e,onOpenChange:t,completeness:n,documents:r,onSubmit:i,isPending:a}){const o=r.filter(h=>!h.is_confidential).length,l=r.length,c=n.percent===100,u=o>0,d=u;return s.jsx(Br,{open:e,onOpenChange:t,children:s.jsxs(br,{className:"sm:max-w-md",children:[s.jsxs(wr,{children:[s.jsx(jr,{children:"Submit Asset for Review"}),s.jsx(So,{children:"Review the readiness checklist below before submitting."})]}),s.jsxs("div",{className:"space-y-3 py-2",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[c?s.jsx(sn,{className:"h-5 w-5 text-green-600 mt-0.5 shrink-0"}):s.jsx(ir,{className:"h-5 w-5 text-amber-500 mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-sm font-medium",children:["Profile completeness: ",n.filled,"/",n.total," fields"]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:c?"All required fields are filled.":"Some fields are incomplete."})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[u?s.jsx(sn,{className:"h-5 w-5 text-green-600 mt-0.5 shrink-0"}):s.jsx(gn,{className:"h-5 w-5 text-destructive mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-sm font-medium",children:["Non-confidential documents: ",o]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:u?`${o} document${o!==1?"s":""}
861 shared with buyers.`:"No documents are marked as non-confidential."})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(ti,{className:"h-5 w-5 text-muted-foreground mt-0.5 shrink-0"}),s.jsx("div",{children:s.jsxs("p",{className:"text-sm font-medium",children:["Data room: ",l," document",l!==1?"s":""," uploaded"]})})]})]}),!u&&s.jsxs(bn,{variant:"destructive",children:[s.jsx(gn,{className:"h-4 w-4"}),s.jsx(wn,{className:"text-sm",children:"At least one document must be marked as non-confidential before submitting. Buyers need access to review materials."})]}),!c&&u&&s.jsxs(bn,{className:"bg-amber-50 border-amber-200",children:[s.jsx(ir,{className:"h-4 w-4 text-amber-600"}),s.jsx(wn,{className:"text-sm text-amber-800",children:"Assets with complete profiles have higher chances of approval and finding a buyer. You can still submit now and update later."})]}),s.jsxs(_i,{className:"gap-2 sm:gap-0",children:[s.jsx(je,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsxs(je,{onClick:i,disabled:!d||a,children:[s.jsx(Bp,{className:"h-4 w-4 mr-1"}),"Submit for Review"]})]})]})})}const SA=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:"compact",maximumFractionDigits:1}).format(e),wst={FlaskConical:Oh,Microscope:AH,Factory:bH,Stethoscope:IH,Scale:CI,Swords:RH,TrendingUp:Wp,Shield:AI,FolderOpen:_H},jst={draft:{bg:"hsl(var(--c-surface-2))",fg:"hsl(var(--c-fg-muted))",border:"hsl(var(--c-border))"},pending_review:{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))",border:"hsl(var(--c-warning-border))"},published:{bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))",border:"hsl(var(--c-positive-border))"},rejected:{bg:"hsl(var(--c-negative-soft))",fg:"hsl(var(--c-negative-fg))",border:"hsl(var(--c-negative))"}};function _st({status:e}){const t=jst[e];return s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em",color:t.fg,background:t.bg,border:`1px solid ${t.border}`,borderRadius:4,padding:"3px 8px"},children:$R[e]})}function Sst({pct:e}){const n=2*Math.PI*22;return s.jsxs("svg",{width:"56",height:"56",viewBox:"0 0 56 56",children:[s.jsx("circle",{cx:"28",cy:"28",r:22,fill:"none",stroke:"hsl(var(--c-surface-2))",strokeWidth:"4"}),s.jsx("circle",{cx:"28",cy:"28",r:22,fill:"none",stroke:"hsl(var(--c-accent))",strokeWidth:"4",strokeDasharray:n,strokeDashoffset:n*(1-e/100),strokeLinecap:"round",transform:"rotate(-90 28 28)"}),s.jsxs("text",{x:"28",y:"32",textAnchor:"middle",fontFamily:"var(--font-display)",fontSize:"13",fontWeight:"600",fill:"hsl(var(--c-ink))",children:[e,"%"]})]})}function kst(){var I;const{id:e}=Zs(),t=xr(),{user:n}=me(),{data:r}=An(),{toast:i}=xt(),a=Ae(),{data:o,isLoading:l}=Se({queryKey:["asset-workspace",e],queryFn:async()=>{const{data:M,error:R}=await W.from("pharma_assets").select("*").eq("id",e).single();if(R)throw R;return M},enabled:!!e}),[c,u]=x.useState({}),[d,h]=x.useState(!1),[f,p]=x.useState(null),[m,g]=x.useState(!1),[y,b]=x.useState(!1),{data:v}=zM(e),{extract:w}=vst(e),{data:_,isLoading:j}=mX(e||null);x.useEffect(()=>{o&&(u({...o}),h(!1))},[o]);const S=(M,R)=>{u(K=>({...K,[M]:R})),h(!0)},k=async M=>{let R;if(M&&(R=vi.flatMap(D=>D.fields.map(E=>E.key)).filter(D=>{const E=c[D];return E==null||E===""||Array.isArray(E)&&E.length===0}),R.length===0)){i({title:"All fields are already filled"});return}const K=await w.mutateAsync(R);p(K),g(!0)},N=M=>{for(const[R,K]of Object.entries(M))S(R,K);i({title:`Applied ${Object.keys(M).length} extracted fields`})},T=x.useMemo(()=>Qp(c),[c]),C=$e({mutationFn:async M=>{const R={};for(const D of vi)for(const E of D.fields){const q=c[E.key];R[E.key]=q===""?null:q}M&&(R.asset_status=M);const{error:K}=await W.from("pharma_assets").update(R).eq("id",e);if(K)throw K},onSuccess:(M,R)=>{a.invalidateQueries({queryKey:["asset-workspace",e]}),a.invalidateQueries({queryKey:["supplier-assets"]}),a.invalidateQueries({queryKey:["valuation",e]}),h(!1),i({title:R==="pending_review"?"Submitted for review":"Draft saved"}),R==="pending_review"&&e&&W.functions.invoke("notify-asset-event",{body:{action:"submitted",assetId:e}}).then(({error:K}
861)=>{K&&console.error("notify-asset-event invoke error:",{assetId:e,error:K})}).catch(K=>console.error("notify-asset-event threw:",{assetId:e,err:K}))},onError:M=>{i({title:"Error",description:M.message,variant:"destructive"})}}),A=()=>C.mutate(void 0),O=x.useCallback(()=>{b(!0)},[]),z=x.useCallback(()=>{C.mutate("pending_review",{onSuccess:()=>b(!1)})},[C]),$=o&&(o.asset_status==="draft"||o.asset_status==="rejected"),F=o&&n&&((I=r==null?void 0:r.supplier)==null?void 0:I.id)===o.supplier_id,B=o&&(o.asset_status==="published"||o.asset_status==="pending_review");if(l)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"32px 24px",display:"flex",alignItems:"center",justifyContent:"center",minHeight:256},children:s.jsx(ne,{size:28,style:{color:"hsl(var(--c-fg-muted))",animation:"spin 1s linear infinite"}})})});if(!o)return s.jsx(he,{children:s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px",textAlign:"center"},children:[s.jsx("h2",{className:"tt-display-sm",style:{marginBottom:12},children:"Asset not found"}),s.jsxs("button",{type:"button",onClick:()=>t("/supplier"),className:"xph-btn xph-btn-outline xph-btn-sm",children:[s.jsx(Wt,{size:13}),"Back to Dashboard"]})]})});const P=o.asset_status||"draft";return s.jsxs(he,{children:[s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))",padding:"20px 0"},children:s.jsxs("div",{className:"xph-container",style:{display:"flex",flexDirection:"column",gap:14},children:[s.jsxs("button",{type:"button",onClick:()=>t("/supplier"),className:"xph-btn xph-btn-ghost xph-btn-sm",style:{width:"fit-content"},children:[s.jsx(Wt,{size:13}),"Back to Dashboard"]}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",gap:16,flexWrap:"wrap"},children:[s.jsxs("div",{style:{minWidth:0,flex:1},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-accent))"},children:"Asset workspace"}),s.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:12,flexWrap:"wrap",marginTop:6},children:[s.jsx("h1",{className:"tt-display-md",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:o.product_name}),s.jsx(_st,{status:P}),d&&s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,color:"hsl(var(--c-warning-fg))",background:"hsl(var(--c-warning-soft))",border:"1px solid hsl(var(--c-warning-border))",borderRadius:4,padding:"2px 7px",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Unsaved changes"})]})]}),s.jsxs("div",{style:{display:"flex",gap:8,flexShrink:0,flexWrap:"wrap"},children:[o.asset_status==="published"&&s.jsxs("button",{type:"button",onClick:()=>t(`/supplier/market/asset/${e}?from=workspace`),className:"xph-btn xph-btn-outline xph-btn-sm",children:[s.jsx(Na,{size:13}),"Preview as buyer"]}),$&&F&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:A,disabled:C.isPending,className:"xph-btn xph-btn-outline xph-btn-sm",children:[C.isPending?s.jsx(ne,{size:13,style:{animation:"spin 1s linear infinite"}}):s.jsx(R_,{size:13}),"Save Draft",d&&s.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"hsl(var(--c-warning))",display:"inline-block",marginLeft:4}})]}),s.jsxs("button",{type:"button",onClick:O,disabled:C.isPending,className:"xph-btn xph-btn-primary xph-btn-sm",children:[C.isPending?s.jsx(ne,{size:13,style:{animation:"spin 1s linear infinite"}}):s.jsx(Bp,{size:13}),"Submit for Review"]})]})]})]})]})}),s.jsxs("div",{className:"xph-container",style:{padding:"24px 24px 64px"},children:[B&&s.jsxs("div",{className:"xph-card",style:{padding:"12px 14px",marginBottom:16,display:"flex",gap:10,alignItems:"flex-start",background:"hsl(var(--c-surface-2))",boxShadow:"none"},children:[s.jsx(Pu,{size:15,style:{color:"hsl(var(--c-fg-muted))",marginTop:1,flexShrink:0}}),s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:["This asset is ",P==="published"?"published":"pending review"," and cannot be edited."]})]}),P==="rejected"&&o.asset_rejection_reason&&s.jsxs("div",{className:"xph-card",style:{padding:"12px 14px",marginBottom:16,display:"flex",gap:10,alignItems:"flex-start",background:"hsl(var(--c-negative-soft))",borderColor:"hsl(var(--c-negative))",boxShadow:"none"},children:[s.jsx(va,{size:15,style:{color:"hsl(var(--c-negative-fg))",marginTop:1,flexShrink:0}}),s.jsxs("p",{className:"tt-body-sm",children:[s.jsx("strong",{children:"Rejection reason:"})," ",o.asset_rejection_reason]})]}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 360
861px), 1fr))",gap:12,marginBottom:16},children:[s.jsxs("div",{className:"xph-card",style:{padding:18},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Profile completeness"}),s.jsxs("div",{className:"tt-mono-sm",style:{marginTop:4,color:"hsl(var(--c-fg-muted))"},children:[T.filled,"/",T.total," required fields"]})]}),s.jsx(Sst,{pct:T.percent})]}),s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:T.perCategory.filter(M=>M.total>0).map(M=>{const R=M.filled===M.total;return s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:11,padding:"3px 8px",borderRadius:4,color:R?"hsl(var(--c-positive-fg))":"hsl(var(--c-fg-muted))",background:R?"hsl(var(--c-positive-soft))":"hsl(var(--c-surface-2))",border:`1px solid ${R?"hsl(var(--c-positive-border))":"hsl(var(--c-border))"}`},children:[R&&s.jsx(sn,{size:10}),M.label," ",M.filled,"/",M.total]},M.key)})})]}),s.jsxs("div",{className:"xph-card",style:{padding:18},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Valuation estimate"}),_&&s.jsxs("div",{className:"tt-mono-sm",style:{marginTop:4,color:"hsl(var(--c-fg-muted))"},children:[UR[_.confidenceLevel]," confidence"]})]}),_&&s.jsxs("button",{type:"button",onClick:()=>t(`/valuation?asset=${e}`),className:"xph-btn xph-btn-ghost xph-btn-sm",children:["Full Valuation",s.jsx(tc,{size:11})]})]}),j?s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:12},children:[s.jsxs("div",{children:[s.jsx(ce,{className:"h-4 w-16 mb-1"}),s.jsx(ce,{className:"h-7 w-24"})]}),s.jsxs("div",{children:[s.jsx(ce,{className:"h-4 w-12 mb-1"}),s.jsx(ce,{className:"h-7 w-16"})]}),s.jsxs("div",{children:[s.jsx(ce,{className:"h-4 w-24 mb-1"}),s.jsx(ce,{className:"h-7 w-20"})]})]}):_?s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:12,marginBottom:_.gapImpacts.length>0?12:0},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"rNPV"}),s.jsx("div",{className:"tt-stat-md",style:{marginTop:4},children:SA(_.npvBase)})]}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"cPOS"}),s.jsxs("div",{className:"tt-stat-md",style:{marginTop:4},children:[(_.cpos*100).toFixed(1),"%"]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Cost to approval"}),s.jsx("div",{className:"tt-stat-md",style:{marginTop:4},children:SA(_.costToApproval)})]})]}),_.gapImpacts.length>0&&s.jsxs("div",{style:{borderTop:"1px solid hsl(var(--c-border))",paddingTop:10},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:6},children:"Top gap recommendations"}),_.gapImpacts.slice(0,3).map((M,R)=>s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:12,padding:"3px 0",color:"hsl(var(--c-fg))"},children:[s.jsx("span",{children:M.label}),s.jsxs("span",{style:{fontFamily:"var(--font-mono)",color:"hsl(var(--c-positive-fg))",fontWeight:600},children:["+",SA(M.npvDelta)]})]},R))]})]}):s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"Valuation will appear once asset data is saved."})]})]}),s.jsxs(nM,{defaultOpen:!0,className:"xph-card",style:{padding:0,marginBottom:16,overflow:"hidden"},children:[s.jsxs(rM,{className:"group",style:{width:"100%",padding:"14px 18px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",background:"transparent",border:"none",color:"inherit"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx(_H,{size:15,style:{color:"hsl(var(--c-fg-muted))"}}),s.jsx("span",{className:"tt-display-sm",style:{fontSize:15},children:"Data Room"})]}),s.jsx(Ta,{size:15,style:{color:"hsl(var(--c-fg-muted))",transition:"transform 200ms"},className:"group-data-[state=open]:rotate-180"})]}),s.jsx(iM,{children:s.jsx("div",{style:{padding:"0 18px 18px",borderTop:"1px solid hsl(var(--c-border))"},children:s.jsx("div",{style:{paddingTop:16},children:s.jsx(ost,{assetId:e,canEdit:!!($&&F)})})})})]}),s.jsx(yst,{assetId:o.id,assetSupplierId:o.supplier_id,therapeuticArea:o.therapeutic_area??null,modality:o.modality??null}),s.jsxs(mh,{defaultValue:vi[0].key,children:[s.jsx(ju,{className:"flex flex-wrap h-auto gap-1 mb-4",children:vi.map(M=>{const R=wst[M.icon];return s.jsxs(Er,{value:M.key,className:"gap-1.5",children:[R&&s.jsx(R,{className:"h-3.5 w-3.5"}),M.label]},M.key)})}),$&&F&&((v==null?void 0:v.length)||0)>0&&s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:10,alignItems:"center",justifyContent:"space-between",marginBottom:16,padding:"10px 14px",background:"hsl(var(--c-accent-soft))",border:"1px solid hsl(var(--c-accent-border))",borderRadius:8},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx(Cn,{size:14,style:{color:"hsl(var(--c-accent))"}}),s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg))"},children:"Auto-fill fields from uploaded documents"})]}),s.jsxs("div",{style:{display:"flex",gap:6},children:[s.jsxs("button",{type:"button",onClick:()=>k(!1),disabled:w.isPending,className:"xph-btn xph-btn-primary xph-btn-sm",children:[w.isPending?s.jsx(ne,{size:13,style:{animation:"spin 1s linear infinite"}}):s.jsx(Cn,{size:13}),"Extract"]}),T.percent>0&&T.percent<100&&s.jsx("button",{type:"button",onClick:()=>k(!0),disabled:w.isPending,className:"xph-btn xph-btn-ghost xph-btn-sm",children:"Fill Empty Only"})]})]}),vi.map(M=>s.jsx(pi,{value:M.key,children:s.jsx("div",{className:"xph-card",style:{padding:24},children:s.jsx(Cit,{fields:M.fields,data:c,onChange:S,readOnly:!!B})})},M.key))]})]})]}),f&&s.jsx(xst,{open:m,onOpenChange:g,extraction:f,currentData:c,onApply:N}),s.jsx(bst,{open:y,onOpenChange:b,completeness:T,documents:v||[],onSubmit:z,isPending:C.isPending})]})}const Nst={verified:{color:"hsl(var(--c-positive-fg))",background:"hsl(var(--c-positive-soft))",border:"1px solid hsl(var(--c-positive-border))"},progress:{color:"hsl(var(--c-warning-fg))",background:"hsl(var(--c-warning-soft))",border:"1px solid hsl(var(--c-warning-border))"},failed:{color:"hsl(var(--c-negative-fg))",background:"hsl(var(--c-negative-soft))",border:"1px solid hsl(var(--c-negative))"},pending:{color:"hsl(var(--c-fg-muted))",background:"hsl(var(--c-surface-2))",border:"1px solid hsl(var(--c-border))"},skipped:{color:"hsl(var(--c-warning-fg))",background:"hsl(var(--c-warning-soft))",border:"1px solid hsl(var(--c-warning-border))"},ready:{color:"hsl(var(--c-accent))",background:"hsl(var(--c-accent-soft))",border:"1px solid hsl(var(--c-accent-border))"},locked:{color:"hsl(var(--c-fg-subtle))",background:"hsl(var(--c-surface))",border:"1px solid hsl(var(--c-border))"}};function yl({variant:e,children:t}){return s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em",borderRadius:4,padding:"3px 8px",...Nst[e]},children:t})}function kA({icon:e,title:t,pill:n,children:r}){return s.jsxs("div",{className:"xph-card",style:{padding:16,boxShadow:"none"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginBottom:r?10:0},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:28,height:28,borderRadius:6,background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(e,{size:14})}),s.jsx("div",{className:"tt-body",style:{fontWeight:600,color:"hsl(var(--c-ink))"},children:t})]}),n]}),r&&s.jsx("div",{style:{marginLeft:38},children:r})]})}function Cst(){const{id:e}=Zs(),t=xr(),{user:n,isLoading:r}=me(),{data:i,isLoading:a}
861=An(),{data:o=[],isLoading:l}=Ire(),c=_et(),u=Cet(),d=ket(),h=Ae(),{toast:f}=xt(),p=o.find(V=>V.id===e),m=(p==null?void 0:p.verificationStatus)==="verified",[g,y]=x.useState(""),[b,v]=x.useState(""),[w,_]=x.useState(""),[j,S]=x.useState(""),[k,N]=x.useState("admin"),[T,C]=x.useState(!1),[A,O]=x.useState(!1),[z,$]=x.useState(""),[F,B]=x.useState(null),[P,I]=x.useState(!1),[M,R]=x.useState(!1),[K,D]=x.useState(null),[E,q]=x.useState(null),[X,re]=x.useState(!1);x.useEffect(()=>{p&&(y(p.fullName),v(p.email||""),_(p.title||""),S(p.linkedinUrl||""),N(p.internalRole),C(!1))},[p==null?void 0:p.id,p==null?void 0:p.updatedAt]),x.useEffect(()=>{r||a||(n?i!=null&&i.supplierUser?(i.isPending||i.isRejected)&&t("/supplier/pending"):t("/auth?supplier=true"):t("/auth"))},[n,i,r,a,t]);const Y=x.useCallback(async()=>{if(e)try{await c.mutateAsync({id:e,fullName:g,linkedinUrl:j||void 0,title:w||void 0,internalRole:k}),f({title:"Profile updated"}),C(!1)}catch(V){f({title:"Error",description:V.message,variant:"destructive"})}},[e,g,j,w,k,c,f]),le=x.useCallback(async()=>{if(e)try{const V=await u.mutateAsync({personnelId:e,action:"send"});O(!0),$(""),B((V==null?void 0:V.otp)||null),f({title:"OTP sent",description:V!=null&&V.otp?`Mock OTP: ${V.otp}`:"Check your email"})}catch(V){f({title:"Error",description:V.message,variant:"destructive"})}},[e,u,f]),Z=x.useCallback(async()=>{if(e)try{const V=await u.mutateAsync({personnelId:e,action:"verify",code:z});V!=null&&V.verified?(f({title:"Email verified!"}),O(!1),$(""),B(null)):f({title:"Invalid code",description:(V==null?void 0:V.message)||"Please try again",variant:"destructive"})}catch(V){f({title:"Error",description:V.message,variant:"destructive"})}},[e,z,u,f]),de=x.useCallback(async()=>{if(e){I(!0),R(!0),D("scraping"),q(null);try{setTimeout(()=>D("analyzing"),2e3);const{data:V,error:Q}=await W.functions.invoke("verify-linkedin-profile",{body:{personnelId:e}});if(Q)throw new Error(Q.message||"Verification failed");if(V!=null&&V.error)throw new Error(V.error);q(V),h.invalidateQueries({queryKey:["supplier-personnel"]})}catch(V){q({success:!1,confidence:0,linkedinVerified:!1,nameScore:0,companyScore:0,titleScore:0,extracted:{name:"",title:"",company:""},expected:{name:"",company:""},error:V.message})}finally{R(!1),D(null)}}},[e,h]),pe=x.useCallback(()=>{f({title:"LinkedIn verified",description:`Confidence: ${Math.round(((E==null?void 0:E.confidence)||0)*100)}%`}),I(!1),q(null),h.invalidateQueries({queryKey:["supplier-personnel"]})},[E,f,h]),J=x.useCallback(async()=>{if(!p)return;const V=p.verificationResult||{};try{await W.from("supplier_personnel").update({verification_result:{...V,linkedinSkipped:!0}}).eq("id",p.id),f({title:"LinkedIn verification skipped"}),h.invalidateQueries({queryKey:["supplier-personnel"]})}catch(Q){f({title:"Error",description:Q.message,variant:"destructive"})}},[p,f,h]),be=x.useCallback(async()=>{if(p){re(!0);try{await new Promise(V=>setTimeout(V,1200)),await d.mutateAsync({personnelId:p.id,existingResult:p.verificationResult}),f({title:"Authority verified",description:"Personnel verification complete."})}catch(V){f({title:"Verification failed",description:V.message,variant:"destructive"})}finally{re(!1)}}},[p,d,f]);if(r||a||l)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"32px 24px",display:"flex",justifyContent:"center",alignItems:"center",minHeight:256},children:s.jsx(ne,{size:28,style:{color:"hsl(var(--c-fg-muted))",animation:"spin 1s linear infinite"}})})});if(!p)return s.jsx(he,{children:s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px"},children:[s.jsxs("button",{type:"button",onClick:()=>t("/supplier"),className:"xph-btn xph-btn-ghost xph-btn-sm",style:{marginBottom:16},children:[s.jsx(Wt,{size:13}),"Back to Dashboard"]}),s.jsx("div",{className:"xph-card",style:{padding:48,textAlign:"center"},children:s.jsx("p",{style:{color:"hsl(var(--c-fg-muted))"},children:"Personnel not found."})})]})});const ee=p.verificationResult||{},Ce=p.emailVerified,Re=ee.linkedinVerified||ee.linkedinSkipped,Ze=Ce&&Re,Ee=p.verificationStatus==="verified"?"verified":p.verificationStatus==="in_progress"?"progress":p.verificationStatus==="failed"?"failed":"pending",kt=p.fullName.split(" ").map(V=>
861V[0]).filter(Boolean).slice(0,2).join("").toUpperCase();return s.jsxs(he,{children:[s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))",padding:"20px 0"},children:s.jsxs("div",{className:"xph-container",style:{display:"flex",flexDirection:"column",gap:16},children:[s.jsxs("button",{type:"button",onClick:()=>t("/supplier"),className:"xph-btn xph-btn-ghost xph-btn-sm",style:{width:"fit-content"},children:[s.jsx(Wt,{size:13}),"Back to Dashboard"]}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:16,flexWrap:"wrap"},children:[s.jsxs("div",{style:{display:"flex",gap:16,alignItems:"center",minWidth:0},children:[s.jsx("span",{style:{width:56,height:56,borderRadius:12,background:"hsl(var(--c-ink))",color:"hsl(var(--c-ink-inverse))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:18,fontFamily:"var(--font-display)",flexShrink:0},children:kt}),s.jsxs("div",{style:{minWidth:0},children:[s.jsxs("div",{className:"eyebrow",style:{color:"hsl(var(--c-accent))"},children:[rP[p.internalRole]||p.internalRole,p.isPrimary&&" · Primary Registrant"]}),s.jsx("h1",{className:"tt-display-md",style:{marginTop:6,marginBottom:0},children:p.fullName})]})]}),s.jsx(yl,{variant:Ee,children:YY[p.verificationStatus]})]})]})}),s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:16,maxWidth:880},children:[s.jsxs("div",{className:"xph-card",style:{padding:24},children:[s.jsxs("div",{style:{marginBottom:20},children:[s.jsx("div",{className:"eyebrow",children:"Profile"}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:4},children:"Profile details"})]}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 280px), 1fr))",gap:16},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[s.jsx(Pe,{htmlFor:"fullName",className:"eyebrow",style:{color:"hsl(var(--c-fg-muted))"},children:"Full Name"}),s.jsx(Fe,{id:"fullName",value:g,onChange:V=>{y(V.target.value),C(!0)},disabled:m})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[s.jsx(Pe,{htmlFor:"email",className:"eyebrow",style:{color:"hsl(var(--c-fg-muted))"},children:"Email"}),s.jsx(Fe,{id:"email",type:"email",value:b,onChange:V=>{v(V.target.value),C(!0)},disabled:!0})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[s.jsx(Pe,{htmlFor:"title",className:"eyebrow",style:{color:"hsl(var(--c-fg-muted))"},children:"Job Title"}),s.jsx(Fe,{id:"title",value:w,onChange:V=>{_(V.target.value),C(!0)},disabled:m})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[s.jsx(Pe,{htmlFor:"role",className:"eyebrow",style:{color:"hsl(var(--c-fg-muted))"},children:"Role"}),s.jsxs($n,{value:k,onValueChange:V=>{N(V),C(!0)},disabled:m,children:[s.jsx(On,{children:s.jsx(Ln,{})}),s.jsx(In,{children:Object.entries(rP).map(([V,Q])=>s.jsx(Rt,{value:V,children:Q},V))})]})]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,marginTop:16},children:[s.jsx(Pe,{htmlFor:"linkedin",className:"eyebrow",style:{color:"hsl(var(--c-fg-muted))"},children:"LinkedIn URL"}),s.jsx(Fe,{id:"linkedin",value:j,onChange:V=>{S(V.target.value),C(!0)},placeholder:"https://linkedin.com/in/...",disabled:m})]}),!m&&s.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:20},children:s.jsxs("button",{type:"button",onClick:Y,disabled:!T||c.isPending,className:"xph-btn xph-btn-primary xph-btn-sm",children:[c.isPending?s.jsx(ne,{size:13,style:{animation:"spin 1s linear infinite"}}):s.jsx(R_,{size:13}),"Save Changes"]})})]}),s.jsxs("div",{className:"xph-card",style:{padding:24},children:[s.jsxs("div",{style:{marginBottom:20},children:[s.jsx("div",{className:"eyebrow",children:"Verification"}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:4},children:"Verification steps"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6},children:"Complete each step to verify this team member's authority to act for the supplier."})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(kA,{icon:qs,title:"Email Verification",pill:Ce?s.jsxs(yl,{variant:"verified",children:[s.jsx(sn,{size:11})," Verified"]}):s.jsx(yl,{variant:"pending",children:"Pending"}),children:Ce?s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:[p.email," verified"]}):p.email?A?s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[s.jsx(Fe,{value:z,onChange:V=>$(V.target.value),placeholder:"6-digit code",style:{width:140},maxLength:6}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:Z,disabled:u.isPending||z.length!==6,children:u.isPending?s.jsx(ne,{size:12,style:{animation:"spin 1s linear infinite"}}):"Verify"}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:()=>{O(!1),$(""),B(null)},children:s.jsx(Ui,{size:12})}),F&&s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["Mock: ",F]})]}):s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:le,disabled:u.isPending,children:[u.isPending&&s.jsx(ne,{size:12,style:{animation:"spin 1s linear infinite"}}),"Send Verification Code"]}):s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"Add an email address first"})}),s.jsx(kA,{icon:g4,title:"LinkedIn Verification",pill:ee.linkedinVerified?s.jsxs(yl,{variant:"verified",children:[s.jsx(sn,{size:11})," Verified (",Math.round((ee.linkedinConfidence||0)*100),"%)"]}):ee.linkedinSkipped?s.jsx(yl,{variant:"skipped",children:"Skipped"}):s.jsx(yl,{variant:"pending",children:"Pending"}),children:ee.linkedinVerified?s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"LinkedIn profile verified"}):ee.linkedinSkipped?s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"LinkedIn verification was skipped"}):s.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:p.linkedinUrl?s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:de,children:[s.jsx(g4,{size:12})," Verify LinkedIn"]}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:J,children:"Skip"})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"No LinkedIn URL provided"}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:J,children:"Skip"})]})})}),s.jsx(kA,{icon:Hs,title:"Authority Check",pill:m?s.jsxs(yl,{variant:"verified",children:[s.jsx(sn,{size:11})," Verified"]}):Ze?s.jsx(yl,{variant:"ready",children:"Ready"}):s.jsx(yl,{variant:"locked",children:"Locked"}),children:m?s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:["Authority verified",p.verifiedAt?` on ${new Date(p.verifiedAt).toLocaleDateString()}`:""]}):Ze?s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:be,disabled:X,children:[X?s.jsx(ne,{size:12,style:{animation:"spin 1s linear infinite"}}):s.jsx(Hs,{size:12}),"Verify Authority"]}):s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"Complete email and LinkedIn verification first"})})]})]})]})]}),s.jsx(Br,{open:P,onOpenChange:V=>{!V&&!M&&(I(!1),q(null))},children:s.jsxs(br,{className:"sm:max-w-lg",children:[s.jsxs(wr,{children:[s.jsx(jr,{children:"Verify LinkedIn Profile"}),s.jsxs(So,{children:["Verifying profile for ",p.fullName]})]}),s.jsx("div",{className:"py-4 space-y-4",children:M?s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"hsl(var(--c-fg-muted))"},children:[s.jsx(ne,{size:14,style:{animation:"spin 1s linear infinite"}}),s.jsx("span",{className:"tt-body-sm",children:K==="scraping"?"Scraping LinkedIn profile...":"Analyzing with AI..."})]}):E!=null&&E.error?s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:"hsl(var(--c-negative-fg))"},children:[s.jsx(va,{size:14}),s.jsx("span",{className:"tt-body-sm",children:E.error})]}):E?s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[s.jsxs("div",{style:{textAlign:"center"},children:[s.jsx("div",{className:"eyebrow",children:"Overall Confidence"}),s.jsxs("div",{className:"tt-stat-xl",style:{marginTop:6,color:E.confidence>=.7?"hsl(var(--c-positive-fg))":E.confidence>=.5?"hsl(var(--c-warning-fg))":"hsl(var(--c-negative-fg))"},children:[Math.round(E.confidence*100),"%"]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsxs("div",{children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:4},className:"tt-body-sm",children:[s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))"},children:"Name Match (60%)"}),s.jsxs("span",{style:{fontWeight:600},children:[Math.round(E.nameScore*100),"%"]})]}),s.jsx(yp,{value:E.nameScore*100,className:"h-2"}),s.jsxs("p",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:4},children:['"',E.extracted.name,'" vs "',E.expected.name,'"']})]}),s.jsxs("div",{children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:4},className:"tt-body-sm",children:[s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))"},children:"Company Match (30%)"}),s.jsxs("span",{style:{fontWeight:600},children:[Math.round(E.companyScore*100),"%"]})]}),s.jsx(yp,{value:E.companyScore*100,className:"h-2"}),s.jsxs("p",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:4},children:['"',E.extracted.company,'" vs "',E.expected.company,'"']})]}),s.jsxs("div",{children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:4},className:"tt-body-sm",children:[s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))"},children:"Title Relevance (10%)"}),s.jsxs("span",{style:{fontWeight:600},children:[Math.round(E.titleScore*100),"%"]})]}),s.jsx(yp,{value:E.titleScore*100,className:"h-2"}),s.jsxs("p",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:4},children:['"',E.extracted.title,'"']})]})]})]}):null}),s.jsxs(_i,{children:[s.jsx("button",{type:"button",onClick:()=>{I(!1),q(null)},disabled:M,className:"xph-btn xph-btn-outline xph-btn-sm",children:E!=null&&E.linkedinVerified?"Close":"Cancel"}),E&&E.linkedinVerified&&s.jsxs("button",{type:"button",onClick:pe,className:"xph-btn xph-btn-primary xph-btn-sm",children:[s.jsx(Fr,{size:12}),"Confirm Verification"]})]})]})})]})}function Ey({exitTo:e="/supplier"}){const{isImpersonating:t}=qe(),n=t?"top-[6.5rem]":"top-16";return s.jsx("div",{className:`sticky ${n} z-30 w-full bg-sky-500 text-sky-950 px-4 py-2`,children:s.jsxs("div",{className:"container flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx(Na,{className:"h-4 w-4"}),s.jsx("span",{children:"You're previewing the buyer experience — other suppliers are anonymized."})]}),s.jsx(je,{asChild:!0,variant:"ghost",size:"sm",className:"h-7 text-sky-950 hover:text-sky-950 hover:bg-sky-400",children:s.jsxs(oe,{to:e,children:[s.jsx(Ui,{className:"h-4 w-4 mr-1"}),"Exit Preview"]})})]})})}const Vse=x.createContext({isPreview:!1,ownSupplierIds:new Set,isOwnAsset:()=>!1,profileReady:!1});function QV({children:e}
861){const{data:t,isFetched:n}=An(),r=x.useMemo(()=>{var l;const a=new Set,o=(t==null?void 0:t.allMemberships)??[];for(const c of o)(l=c.supplier)!=null&&l.id&&a.add(c.supplier.id);return a},[t]),i=x.useCallback(a=>!!a&&r.has(a),[r]);return s.jsx(Vse.Provider,{value:{isPreview:!0,ownSupplierIds:r,isOwnAsset:i,profileReady:n},children:e})}function Mk(){return x.useContext(Vse)}function Ast(){const{ownSupplierIds:e,profileReady:t}=Mk(),{isImpersonating:n,impersonating:r}=qe(),i=n&&(r!=null&&r.userId)?r.userId:null,a=[...e].sort().join(",");return Se({queryKey:["market-assets",a,i],enabled:t,queryFn:async()=>{const{data:o,error:l}=await W.rpc("get_market_assets",{p_effective_user_id:i});if(l)throw l;return(o??[]).map(u=>sl(u)).map(u=>YM(u,e))}})}function Tst(e){const{ownSupplierIds:t,profileReady:n}=Mk(),{isImpersonating:r,impersonating:i}=qe(),a=r&&(i!=null&&i.userId)?i.userId:null,o=[...t].sort().join(",");return Se({queryKey:["market-asset",e,o,a],enabled:!!e&&n,queryFn:async()=>{if(!e)return null;const{data:l,error:c}=await W.rpc("get_market_asset",{p_asset_id:e,p_effective_user_id:a});if(c)throw c;if(!l)return null;const u=sl(l);return YM(u,t)}})}function Est(){const e=Ye(),[t,n]=x.useState({results:[],isSearching:!1,error:null,searchTime:null});return{...t,search:async a=>{const o=a.trim();if(!o){n({results:[],isSearching:!1,error:null,searchTime:null});return}n(l=>({...l,isSearching:!0,error:null}));try{const{data:l,error:c}=await W.functions.invoke("asset-search",{body:{query:o}});if(c)throw c;const u=l.results||[],d=l.searchTime??null;n({results:u,isSearching:!1,error:null,searchTime:d}),e({action:"market_search",entityType:Ve.pharmaAssets,entityId:null,entityLabel:o.slice(0,200),metadata:{query:o,result_count:u.length,top_result_ids:u.slice(0,5).map(h=>h.assetId),surface:"supplier_market_preview"}})}catch(l){console.error("Market search error:",l),n({results:[],isSearching:!1,error:l.message||"Search failed. Please try again.",searchTime:null})}},clearResults:()=>{n({results:[],isSearching:!1,error:null,searchTime:null})}}}function Pst(){const{user:e,isLoading:t}=me(),{data:n,isLoading:r}=An(),{isOwnAsset:i,ownSupplierIds:a}=Mk(),o=Ye(),[l,c]=il(),u=l.get("compareAsset"),[d,h]=x.useState(""),[f,p]=x.useState("all"),[m,g]=x.useState("all"),[y,b]=x.useState("basket"),{data:v=[],isLoading:w}=Ast(),{data:_=[],isLoading:j}=Eie(),S=Est(),k=x.useMemo(()=>_.filter(M=>M.assetStatus==="published"),[_]),N=x.useMemo(()=>u?k.find(M=>M.id===u)??null:k[0]??null,[u,k]),T=x.useRef(!1);x.useEffect(()=>{T.current||!e||(T.current=!0,o({action:"market_preview_opened",entityType:Ve.pharmaAssets,entityId:null,entityLabel:null,metadata:{surface:"supplier_market_preview"}}))},[e,o]);const C=x.useMemo(()=>N?Pie(N,v,{ownSupplierIds:a}):null,[N,v,a]),A=x.useMemo(()=>{const M=new Map;return C!=null&&C.tier&&C.matches.forEach(R=>M.set(R.id,C.tier)),M},[C]),O=x.useMemo(()=>{const M=new Map;return S.results.forEach(R=>M.set(R.assetId,R.reason)),M},[S.results]),z=x.useMemo(()=>C?C.tier===null?{variant:"warning",text:C.label}:C.matches.length===0?{variant:"muted",text:"No competitors found in your indication"}:{variant:"info",text:`${C.matches.length} competitor${C.matches.length===1?"":"s"} — ${C.label}`}:null,[C]),$=M=>{const R=new URLSearchParams(l);R.set("compareAsset",M),c(R,{replace:!0}),b("basket")},F=()=>{if(!N)return;const R=`Find assets similar to: ${[N.productName,N.primaryTarget,N.mechanismOfAction,N.leadIndication].filter(Boolean).join(" — ")}`;b("search"),S.search(R)},B=()=>{S.clearResults(),b(N?"basket":"all")},P=x.useMemo(()=>{let M=v;if(y==="search"&&S.results.length>0){const K=new Map(S.results.map(D=>[D.assetId,D.score]));M=v.filter(D=>K.has(D.id)).sort((D,E)=>(K.get(E.id)??0)-(K.get(D.id)??0))}else if(y==="basket"&&N&&C){const K=new Set([N.id,...C.matches.map(D=>D.id)]);M=v.filter(D=>K.has(D.id))}const R=M.filter(K=>{const D=d.toLowerCase(),E=!D||K.productName.toLowerCase().includes(D)||(K.primaryTarget||"").toLowerCase().includes(D)||(K.leadIndication||"").toLowerCase().includes(D),q=f==="all"||K.stage===f,X=m==="all"||K.modality===m;return E&&q&&X});if(N){const K=R.findIndex(D=>D.id===N.id);if(K>0){const[D]=R.splice(K,1);R.unshift(D)}}return R},[v,S.results,y,N,C,d,f,m]);if(t||r)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"32px 24px",display:"flex",justifyContent:"center",alignItems:"center",minHeight:256},children:s.jsx(ne,{size:28,style:{color:"hsl(var(--c-fg-muted))",animation:"spin 1s linear infinite"}})})});if(!e)return s.jsx(Pt,{to:"/auth",replace:!0});if(!(n!=null&&n.isApproved))return s.jsx(Pt,{to:"/supplier/pending",replace:!0});const I=z?z.variant==="warning"?{color:"hsl(var(--c-warning-fg))",background:"hsl(var(--c-warning-soft))",border:"1px solid hsl(var(--c-warning-border))"}:z.variant==="info"?{color:"hsl(var(--c-accent))",background:"hsl(var(--c-accent-soft))",border:"1px solid hsl(var(--c-accent-border))"}:{color:"hsl(var(--c-fg-muted))",background:"hsl(var(--c-surface-2))",border:"1px solid hsl(var(--c-border))"}:null;return s.jsxs(he,{children:[s.jsx(Ey,{exitTo:"/supplier"}),s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))",padding:"20px 0"},children:s.jsxs("div",{className:"xph-container",style:{display:"flex",flexDirection:"column",gap:16},children:[s.jsxs(oe,{to:"/supplier",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{width:"fit-content",textDecoration:"none"},children:[s.jsx(Wt,{size:13}),"Back to Supplier Portal"]}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:16},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-accent))"},children:"Buyer-side preview · benchmarking"}),s.jsx("h1",{className:"tt-display-md",style:{marginTop:6},children:"Market View"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:4},children:"See how your assets appear to buyers, and benchmark against competitors."})]}),s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[s.jsxs("div",{className:"xph-search-wrap",style:{width:320},children:[s.jsx(Ea,{size:14}),s.jsx("input",{className:"xph-input",placeholder:"Search by name, target, indication…",value:d,onChange:M=>h(M.target.value)})]}),s.jsxs("select",{value:f,onChange:M=>p(M.target.value),className:"xph-input",style:{width:160},children:[s.jsx("option",{value:"all",children:"All stages"}),mb.map(M=>s.jsx("option",{value:M,children:Nn[M]},M))]}),s.jsxs("select",{value:m,onChange:M=>g(M.target.value),className:"xph-input",style:{width:160},children:[s.jsx("option",{value:"all",children:"All modalities"}
861),Object.entries(Zt).map(([M,R])=>s.jsx("option",{value:M,children:R},M))]})]})]})]})}),s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px"},children:[k.length>0&&s.jsx("div",{className:"xph-card",style:{padding:16,marginBottom:20},children:s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12},children:[s.jsx("span",{className:"eyebrow",style:{color:"hsl(var(--c-fg-muted))"},children:"Show competitors for"}),s.jsx("select",{value:(N==null?void 0:N.id)??"",onChange:M=>$(M.target.value),className:"xph-input",style:{minWidth:280},children:k.map(M=>s.jsx("option",{value:M.id,children:M.productName},M.id))}),z&&I&&s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:11.5,letterSpacing:"0.02em",borderRadius:4,padding:"4px 10px",...I},children:z.text}),s.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginLeft:"auto"},children:[s.jsx("button",{type:"button",onClick:()=>{S.clearResults(),b("basket")},disabled:!N,title:"Show other suppliers' published assets that compete with the selected one",className:`xph-btn xph-btn-sm ${y==="basket"?"xph-btn-primary":"xph-btn-outline"}`,children:"Competitors"}),s.jsx("button",{type:"button",onClick:()=>{S.clearResults(),b("all")},title:"Browse every published asset in the marketplace",className:`xph-btn xph-btn-sm ${y==="all"?"xph-btn-primary":"xph-btn-outline"}`,children:"All assets"}),s.jsxs("button",{type:"button",onClick:F,disabled:!N||S.isSearching,title:"Use AI to surface semantically similar assets",className:`xph-btn xph-btn-sm ${y==="search"?"xph-btn-primary":"xph-btn-outline"}`,children:[S.isSearching?s.jsx(ne,{size:13,style:{animation:"spin 1s linear infinite"}}):s.jsx(Cn,{size:13}),"Find similar (AI)"]})]})]})}),y==="search"&&(S.results.length>0||S.isSearching)&&s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:16,fontSize:13,color:"hsl(var(--c-fg-muted))"},children:[s.jsx(Cn,{size:14,style:{color:"hsl(var(--c-accent))"}}),s.jsxs("span",{children:["Showing AI-matched assets for"," ",s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:N==null?void 0:N.productName}),S.searchTime&&` (${S.searchTime.toFixed(1)}s)`]}),s.jsxs("button",{type:"button",onClick:B,className:"xph-btn xph-btn-ghost xph-btn-sm",children:[s.jsx(Ui,{size:12}),"Clear"]})]}),y==="basket"&&N&&C&&C.matches.length===0&&s.jsxs("div",{className:"xph-card",style:{padding:20,marginBottom:20,background:"hsl(var(--c-warning-soft))",borderColor:"hsl(var(--c-warning-border))",display:"flex",flexWrap:"wrap",gap:12,alignItems:"center",justifyContent:"space-between"},children:[s.jsxs("div",{style:{minWidth:0},children:[s.jsxs("p",{className:"tt-body",style:{fontWeight:600,marginBottom:4},children:["No competitors found for"," ",s.jsx("span",{style:{color:"hsl(var(--c-ink))"},children:N.productName})]}),s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:["No other suppliers have published assets"," ",N.leadIndication?s.jsxs(s.Fragment,{children:["in ",s.jsx("strong",{children:N.leadIndication}),"."]}):"in your indication."]})]}),s.jsxs("div",{style:{display:"flex",gap:8,flexShrink:0},children:[s.jsx("button",{type:"button",onClick:()=>{S.clearResults(),b("all")},className:"xph-btn xph-btn-outline xph-btn-sm",children:"Browse all assets"}),s.jsxs("button",{type:"button",onClick:F,disabled:S.isSearching,className:"xph-btn xph-btn-primary xph-btn-sm",children:[S.isSearching?s.jsx(ne,{size:13,style:{animation:"spin 1s linear infinite"}}):s.jsx(Cn,{size:13}),"Find similar (AI)"]})]})]}),s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",fontFamily:"var(--font-mono)",fontSize:12,color:"hsl(var(--c-fg-muted))",marginBottom:16,flexWrap:"wrap"},children:[s.jsx("span",{style:{textTransform:"uppercase",letterSpacing:"0.06em",color:"hsl(var(--c-fg-subtle))"},children:"Showing"}),s.jsx("span",{style:{color:"hsl(var(--c-fg))",fontWeight:600},children:P.length}),s.jsxs("span",{children:["asset",P.length===1?"":"s"]})]}),w||j?s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:[...Array(6)].map((M,R)=>s.jsxs("div",{className:"xph-card",style:{padding:18},children:[s.jsx(ce,{className:"h-6 w-3/4 mb-4"}),s.jsx(ce,{className:"h-4 w-1/2 mb-2"}),s.jsx(ce,{className:"h-4 w-2/3 mb-4"}),s.jsx(ce,{className:"h-8 w-24"})]},R))}):P.length===0?s.jsxs("div",{className:"xph-card",style:{padding:48,textAlign:"center"},children:[s.jsx("p",{style:{color:"hsl(var(--c-fg-muted))",marginBottom:12},children:y==="search"&&!S.isSearching?"No AI matches found for this asset.":"No assets match your filters."}),s.jsx("button",{type:"button",onClick:()=>{h(""),p("all"),g("all"),b("all"),S.clearResults()},className:"xph-btn xph-btn-ghost xph-btn-sm",children:"Clear filters"})]}):s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:P.map(M=>{const R=i(M.supplier.id)||M.id===(N==null?void 0:N.id),K=A.get(M.id),D=!R&&K?Qtt(K):void 0,E=R?void 0:O.get(M.id);return s.jsx(LR,{asset:M,basePath:"/supplier/market/asset",anonymized:!R,isOwn:R,matchLabel:D,matchReason:E},M.id)})})]})]})]})}var Ost="Separator",XV="horizontal",Ist=["horizontal","vertical"],Wse=x.forwardRef((e,t)=>
861{const{decorative:n,orientation:r=XV,...i}=e,a=Rst(r)?r:XV,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return s.jsx(Ne.div,{"data-orientation":a,...l,...i,ref:t})});Wse.displayName=Ost;function Rst(e){return Ist.includes(e)}var Use=Wse;const qse=x.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>s.jsx(Use,{ref:i,decorative:n,orientation:t,className:ae("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));qse.displayName=Use.displayName;const ZV=400;function Dst(e){if(!e)return null;const t=e.trim();return t.length<=ZV?t:`${t.slice(0,ZV)}…`}function Mst({asset:e,backTo:t,backLabel:n="Back to Market View"}){const r=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:"compact",maximumFractionDigits:1}).format(e.estimatedNPV),i=Dst(e.mechanismOfAction);return s.jsxs("div",{className:"container py-8 max-w-3xl",children:[s.jsx(je,{asChild:!0,variant:"ghost",className:"mb-6",children:s.jsxs(oe,{to:t,children:[s.jsx(Wt,{className:"mr-2 h-4 w-4"}),n]})}),s.jsxs("div",{className:"mb-6 p-3 rounded-md border border-border bg-muted/50 flex items-start gap-2",children:[s.jsx(Pu,{className:"h-4 w-4 text-muted-foreground mt-0.5 shrink-0"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This is a competitor listing. Supplier identity and full details are hidden. You're seeing the anonymized summary only."})]}),s.jsxs(Be,{children:[s.jsx(ht,{children:s.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Xp,{stage:e.stage}),s.jsx(pn,{variant:"outline",children:Zt[e.modality]})]}),s.jsx(ft,{className:"text-2xl",children:"Undisclosed Asset"}),e.leadIndication&&s.jsx("p",{className:"text-muted-foreground mt-1",children:e.leadIndication})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Est. NPV"}),s.jsx("p",{className:"text-2xl font-bold text-accent",children:r})]})]})}),s.jsxs(pt,{className:"space-y-4",children:[s.jsx(qse,{}),s.jsxs("dl",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-3 text-sm",children:[s.jsxs("div",{children:[s.jsx("dt",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Primary Target"}),s.jsx("dd",{className:"font-medium",children:e.primaryTarget||"—"})]}),s.jsxs("div",{children:[s.jsx("dt",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Stage"}),s.jsx("dd",{className:"font-medium",children:s.jsx(Xp,{stage:e.stage,size:"sm"})})]}),s.jsxs("div",{children:[s.jsx("dt",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Modality"}),s.jsx("dd",{className:"font-medium",children:Zt[e.modality]})]}),s.jsxs("div",{children:[s.jsx("dt",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:"Indication"}),s.jsx("dd",{className:"font-medium",children:e.leadIndication||"—"})]})]}),i&&s.jsxs("div",{children:[s.jsx("h3",{className:"text-xs text-muted-foreground uppercase tracking-wide mb-1",children:"Mechanism of Action"}),s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:i})]})]})]})]})}const $st={FlaskConical:Oh,Microscope:AH,Factory:bH,Stethoscope:IH,Scale:CI,Swords:RH,TrendingUp:Wp,Shield:AI},JV=200;function Lst({text:e}){const[t,n]=x.useState(!1);return e.length<=JV?s.jsx("p",{className:"tt-body-sm",style:{whiteSpace:"pre-wrap",color:"hsl(var(--c-fg))"},children:e}):s.jsxs("div",{children:[s.jsx("p",{className:"tt-body-sm",style:{whiteSpace:"pre-wrap",color:"hsl(var(--c-fg))"},children:t?e:`${e.slice(0,JV)}…`}),s.jsx("button",{type:"button",onClick:()=>n(r=>!r),style:{background:"none",border:"none",padding:0,marginTop:4,color:"hsl(var(--c-accent))",fontSize:12,fontWeight:500,cursor:"pointer"},children:t?"Show less":"Show more"})]})}function Fst({asset:e}){var h;const t=wu(e),n=(f,p)=>{var m;return((m=f==null?void 0:f.find(g=>g.value===p))==null?void 0:m.label)||p},r=(f,p)=>p==null||p===""?s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-subtle))",fontStyle:"italic"},children:"Not specified"}):f.type==="boolean"?s.jsx("span",{className:"xph-badge",style:{background:p?"hsl(var(--c-positive-soft))":"hsl(var(--c-surface-2))",color:p?"hsl(var(--c-positive-fg))":"hsl(var(--c-fg-muted))"},children:p?"Yes":"No"}):f.type==="select"?s.jsx("span",{style:{display:"inline-block",background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-ink))",borderRadius:6,padding:"3px 10px",fontSize:13,fontWeight:500},children:n(f.options,p)}):f.type==="array"?!Array.isArray(p)||p.length===0?s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-subtle))",fontStyle:"italic"},children:"None specified"}):s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:p.map((m,g)=>s.jsx("span",{style:{display:"inline-block",background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-ink))",borderRadius:6,padding:"2px 9px",fontSize:12.5,fontWeight:500},children:m},g))}):f.type==="textarea"?s.jsx(Lst,{text:String(p)}):s.jsx("span",{style:{display:"inline-block",background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-ink))",borderRadius:6,padding:"3px 10px",fontSize:13,fontWeight:500},children:p}),i=vi.map(f=>{const p=f.fields.some(m=>{const g=t[m.key];return!(g==null||g===""||Array.isArray(g)&&g.length===0)});return{...f,hasData:p}}),[a,o]=il(),l=i.map(f=>f.key),c=a.get("tab"),u=(c&&l.includes(c)?c:null)??((h=i.find(f=>f.hasData))==null?void 0:h.key)??i[0].key,d=f=>{const p=new URLSearchParams(a);p.set("tab",f),o(p,{replace:!0})};return s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 16px",borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{className:"eyebrow",children:"Asset profile"}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:4},children:"Asset details"})]}),s.jsx("div",{style:{padding:16},children:s.jsxs(mh,{value:u,onValueChange:d,children:[s.jsx(ju,{style:{background:"hsl(var(--c-surface))",border:"1px solid hsl(var(--c-border))",borderRadius:8,padding:3,display:"flex",flexWrap:"wrap",gap:2,height:"auto"},children:i.map(f=>{const p=$st[f.icon];return s.jsxs(Er,{value:f.key,style:{fontSize:12,padding:"5px 10px",borderRadius:6,display:"inline-flex",alignItems:"center",gap:5},children:[p&&s.jsx(p,{size:12}),f.label]},f.key)})}),i.map(f=>s.jsx(pi,{value:f.key,style:{marginTop:16},children:f.hasData?s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 280px), 1fr))",gap:10},children:f.fields.map(p=>{const m=t[p.key];return(m==null||m===""||Array.isArray(m)&&m.length===0)&&!p.requiredForPublish?null:s.jsxs("div",{style:{gridColumn:p.type==="textarea"?"1 / -1":void 0,padding:12,borderRadius:8,border:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-surface))",display:"flex",flexDirection:"column",gap:6},children:[s.jsx("div",{className:"eyebrow",children:p.label}),r(p,m)]},p.key)})}):s.jsx("p",{className:"tt-body-sm",style:{textAlign:"center",padding:"32px 0",color:"hsl(var(--c-fg-muted))"},children:"No data provided for this section."})},f.key))]})})]})}function p$(){var t;me();const{data:e}=oi();return Se({queryKey:["buyer-watchlist",(t=e==null?void 0:e.buyerUser)==null?void 0:t.id],queryFn:async()=>{var i;if(!((i=e==null?void 0:e.buyerUser)!=null&&i.id))return[];const{data:n,error:r}=await W.from("buyer_watchlist").select(`
862          id,
863          buyer_user_id,
864          asset_id,
865          notes,
866          created_at,
867          pharma_assets (
868            *,
869            suppliers (*)
870          )
871        `).eq("buyer_user_id",e.buyerUser.id).order("created_at",{ascending:!1});if(r)throw console.error("Error fetching watchlist:",r),r;return(n||[]).map(a=>({id:a.id,buyerUserId:a.buyer_user_id,assetId:a.asset_id,notes:a.notes,createdAt:a.created_at,asset:a.pharma_assets?sl(a.pharma_assets):void 0}))},enabled:!!(e!=null&&e.isApproved)})}function zst(){const e=Ae();me();const{data:t}=oi(),{guardMutation:n}=qe(),r=Ye();return $e({mutationFn:async({assetId:i,notes:a})=>{var c;if(n("Adding to watchlist"))throw new Error("Impersonation mode");if(!((c=t==null?void 0:t.buyerUser)!=null&&c.id))throw new Error("Buyer profile not found");const{data:o,error:l}=await W.from("buyer_watchlist").insert({buyer_user_id:t.buyerUser.id,asset_id:i,notes:a||null}).select().single();if(l)throw l;return o},onSuccess:(i,{assetId:a})=>
871{e.invalidateQueries({queryKey:["buyer-watchlist"]}),r({action:"add_to_watchlist",entityType:Ve.buyerWatchlist,entityId:i.id,metadata:{asset_id:a}})}})}function Hse(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async r=>{if(t("Removing from watchlist"))throw new Error("Impersonation mode");const{error:i}=await W.from("buyer_watchlist").delete().eq("id",r);if(i)throw i;return r},onSuccess:r=>{e.invalidateQueries({queryKey:["buyer-watchlist"]}),n({action:"remove_from_watchlist",entityType:Ve.buyerWatchlist,entityId:r})}})}function Kse({assetId:e,variant:t="default"}){const{data:n}=p$(),r=zst(),i=Hse(),{toast:a}=xt(),o=n==null?void 0:n.find(d=>d.assetId===e),l=!!o,c=r.isPending||i.isPending,u=async()=>{try{l&&o?(await i.mutateAsync(o.id),a({title:"Removed from watchlist"})):(await r.mutateAsync({assetId:e}),a({title:"Added to watchlist"}))}catch(d){a({title:"Error",description:Qn(d,"Failed to update watchlist"),variant:"destructive"})}};return t==="icon"?s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:u,disabled:c,"aria-label":l?"Remove from watchlist":"Add to watchlist",children:c?s.jsx(ne,{size:14,className:"animate-spin"}):s.jsx(Wd,{size:14,style:{fill:l?"hsl(var(--c-ink))":"transparent",color:l?"hsl(var(--c-ink))":"hsl(var(--c-fg-muted))"}})}):s.jsxs("button",{type:"button",className:`xph-btn ${l?"xph-btn-primary":"xph-btn-outline"} xph-btn-sm`,onClick:u,disabled:c,children:[c?s.jsx(ne,{size:13,className:"animate-spin"}):s.jsx(Wd,{size:13,style:{fill:l?"currentColor":"transparent"}}),l?"Saved":"Save"]})}function Bst(e){const t=e.workspace_members??[],n=e.workspace_assets??[],r={};for(const i of n)r[i.stage]=(r[i.stage]??0)+1;return{id:e.id,orgId:e.org_id,name:e.name,description:e.description,createdBy:e.created_by,archivedAt:e.archived_at,createdAt:e.created_at,updatedAt:e.updated_at,memberUserIds:t.map(i=>i.user_id),assetCountByStage:r}}function m$(){var n;const{data:e}=oi(),t=(n=e==null?void 0:e.organization)==null?void 0:n.id;return Se({queryKey:["workspaces",t],queryFn:async()=>{const{data:r,error:i}=await W.from("workspaces").select("*, workspace_members(user_id), workspace_assets(id, stage)").eq("org_id",t).is("archived_at",null).order("updated_at",{ascending:!1});if(i)throw console.error("Error fetching workspaces:",i),i;return(r||[]).map(Bst)},enabled:!!t&&!!(e!=null&&e.isApproved)})}function Gse(){const e=Ae(),{user:t}=me(),{data:n}=oi(),{guardMutation:r}=qe(),i=Ye();return $e({mutationFn:async({name:a,description:o})=>{var d;if(r("Creating a workspace"))throw new Error("Impersonation mode");const l=(d=n==null?void 0:n.organization)==null?void 0:d.id;if(!l||!t)throw new Error("No active organization");const{data:c,error:u}=await W.from("workspaces").insert({org_id:l,name:a.trim(),description:(o==null?void 0:o.trim())||null,created_by:t.id}).select().single();if(u)throw u;return c},onSuccess:async a=>{e.invalidateQueries({queryKey:["workspaces"]}),await i({action:"create_workspace",entityType:Ve.workspaces,entityId:a.id,entityLabel:a.name,metadata:{org_id:a.org_id}}),e.invalidateQueries({queryKey:["workspace-activity",a.id]})}})}function Vst(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async({workspaceId:r,name:i,description:a})=>{if(t("Updating a workspace"))throw new Error("Impersonation mode");const o={};i!==void 0&&(o.name=i.trim()),a!==void 0&&(o.description=(a==null?void 0:a.trim())||null);const{data:l,error:c}=await W.from("workspaces").update(o).eq("id",r).select().single();if(c)throw c;return l},onSuccess:async r=>{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["workspace",r.id]}),await n({action:"update_workspace",entityType:Ve.workspaces,entityId:r.id,entityLabel:r.name,metadata:{org_id:r.org_id}}),e.invalidateQueries({queryKey:["workspace-activity",r.id]})}})}function Wst(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async({workspaceId:r})=>{if(t("Archiving a workspace"))throw new Error("Impersonation mode");const{data:i,error:a}=await W.from("workspaces").update({archived_at:new Date().toISOString()}).eq("id",r).select().single();if(a)throw a;return i},onSuccess:async r=>
871{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["workspace",r.id]}),await n({action:"archive_workspace",entityType:Ve.workspaces,entityId:r.id,entityLabel:r.name,metadata:{org_id:r.org_id}}),e.invalidateQueries({queryKey:["workspace-activity",r.id]})}})}function Ust(){const e=Ae(),{user:t}=me(),{guardMutation:n}=qe(),r=Ye();return $e({mutationFn:async({workspaceId:i,assetId:a})=>{if(n("Pinning to a workspace"))throw new Error("Impersonation mode");const{data:o,error:l}=await W.from("workspace_assets").upsert({workspace_id:i,asset_id:a,added_by:(t==null?void 0:t.id)??null},{onConflict:"workspace_id,asset_id",ignoreDuplicates:!0}).select().maybeSingle();if(l)throw l;return{row:o,alreadyPinned:!o}},onSuccess:async({row:i,alreadyPinned:a},{workspaceId:o,assetId:l,assetName:c})=>{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["workspace-assets",o]}),!a&&i&&(await r({action:"pin_workspace_asset",entityType:Ve.workspaceAssets,entityId:i.id,entityLabel:c??null,metadata:{workspace_id:o,asset_id:l}}),e.invalidateQueries({queryKey:["workspace-activity",o]}))}})}const Fb=["screening","evaluating","diligence","negotiation","passed","closed"],c_={screening:{label:"Screening",fg:"--c-stage-discovery-fg",bg:"--c-stage-discovery-bg"},evaluating:{label:"Evaluating",fg:"--c-stage-preind-fg",bg:"--c-stage-preind-bg"},diligence:{label:"Diligence",fg:"--c-stage-clinical-fg",bg:"--c-stage-clinical-bg"},negotiation:{label:"Negotiation",fg:"--c-warning-fg",bg:"--c-warning-soft"},passed:{label:"Passed",fg:"--c-fg-muted",bg:"--c-surface-2"},closed:{label:"Closed",fg:"--c-positive-fg",bg:"--c-positive-soft"}};function av(e){return Fb.includes(e)}function ov(e){return av(e)?c_[e]:c_.screening}function qst(e){const t=e.assetCountByStage??{},n=Fb.filter(r=>(t[r]??0)>0).map(r=>`${t[r]} ${c_[r].label.toLowerCase()}`);return n.length>0?n.join(" · "):"No assets yet"}function g$({assetId:e,assetName:t,variant:n="default"}){const[r,i]=x.useState(!1),[a,o]=x.useState(null),{data:l}=oi(),{data:c,isLoading:u}=m$(),d=Ust(),{toast:h}=xt();if(!(l!=null&&l.isApproved)||!l.organization)return null;const f=async m=>{o(m.id);try{const{alreadyPinned:g}=await d.mutateAsync({workspaceId:m.id,assetId:e,assetName:t});h({title:g?`Already in ${m.name}`:`Added to ${m.name}`}),i(!1)}catch(g){h({title:"Error",description:Qn(g,"Failed to add to workspace"),variant:"destructive"})}finally{o(null)}},p=n==="icon"?s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon","aria-label":"Add to workspace",children:s.jsx(p4,{size:14,style:{color:"hsl(var(--c-fg-muted))"}})}):s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm","aria-label":"Add to workspace",children:[s.jsx(p4,{size:13}),"Add to workspace"]});return s.jsxs(Pb,{open:r,onOpenChange:i,children:[s.jsx(Ob,{asChild:!0,children:p}),s.jsxs(kg,{className:"w-64 p-1",align:"end",children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-2 py-1.5",children:"Add to workspace"}),u?s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2 text-sm text-muted-foreground",children:[s.jsx(ne,{className:"h-4 w-4 animate-spin"}),"Loading workspaces…"]}):!c||c.length===0?s.jsxs("div",{className:"px-2 py-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Workspaces are shared evaluation boards for your team."}),s.jsx(oe,{to:"/buyer/workspaces",className:"xph-btn xph-btn-outline xph-btn-sm",style:{marginTop:10},onClick:()=>i(!1),children:"Go to workspaces"})]}):c.map(m=>{const g=a===m.id;return s.jsxs("button",{type:"button",onClick:()=>f(m),disabled:d.isPending,className:"flex items-center gap-2 w-full rounded-sm px-2 py-2 text-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-60",children:[g?s.jsx(ne,{className:"h-4 w-4 shrink-0 animate-spin text-muted-foreground"}):s.jsx(Mde,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),s.jsxs("div",{className:"flex-1 text-left min-w-0",children:[s.jsx("div",{className:"font-medium truncate",children:m.name}),s.jsx("div",{className:"text-xs text-muted-foreground truncate",children:qst(m)})]})]},m.id)})]})]})}function Hst(){const e=Ae();me();const{data:t}=oi(),{guardMutation:n}=qe(),r=Ye();return $e({mutationFn:async({assetId:i,message:a,assetName:o})=>{var u;if(n("Submitting inquiry"))throw new Error("Impersonation mode");if(!((u=t==null?void 0:t.buyerUser)!=null&&u.id))throw new Error("Buyer profile not found");const l=crypto.randomUUID(),{error:c}=await W.from("buyer_inquiries").insert({id:l,buyer_user_id:t.buyerUser.id,asset_id:i,message:a.trim(),status:"pending"});if(c)throw c;return{inquiryId:l,assetId:i,assetName:o}},onSuccess:({inquiryId:i,assetId:a,assetName:o})=>
871{e.invalidateQueries({queryKey:["buyer-inquiries"]}),r({action:"create_inquiry",entityType:Ve.buyerInquiries,entityId:i,entityLabel:o,metadata:{asset_id:a}})}})}const NA=10,dy=2e3;function $k({assetId:e,assetName:t,variant:n="default"}){const[r,i]=x.useState(!1),[a,o]=x.useState(""),{toast:l}=xt(),c=Hst(),u=a.trim(),d=u.length>=NA&&u.length<=dy,h=async()=>{if(d)try{await c.mutateAsync({assetId:e,message:a}),l({title:"Inquiry submitted",description:"We will review your inquiry and get back to you soon."}),o(""),i(!1)}catch(f){l({title:"Error",description:Qn(f,"Failed to submit inquiry"),variant:"destructive"})}};return s.jsxs(Br,{open:r,onOpenChange:i,children:[s.jsx(Nte,{asChild:!0,children:n==="icon"?s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",title:`Inquire about ${t}`,"aria-label":`Inquire about ${t}`,children:s.jsx(Ev,{size:14,style:{color:"hsl(var(--c-fg-muted))"}})}):s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",children:[s.jsx(Ev,{size:13}),"Inquire"]})}),s.jsxs(br,{children:[s.jsxs(wr,{children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:6},children:"Buyer · inquiry"}),s.jsx(jr,{className:"tt-display-sm",style:{fontSize:20},children:"Express interest"}),s.jsxs(So,{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:["Send an inquiry about"," ",s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:t}),". Our team will review and connect you with the supplier."]})]}),s.jsxs("div",{style:{padding:"16px 0",display:"flex",flexDirection:"column",gap:8},children:[s.jsx("label",{htmlFor:"inquiry-message",className:"eyebrow",style:{color:"hsl(var(--c-fg-muted))"},children:"Your message"}),s.jsx("textarea",{id:"inquiry-message",value:a,onChange:f=>o(f.target.value),placeholder:"Describe your interest in this asset, any specific questions, or information you'd like to request...",maxLength:dy+50,rows:5,style:{width:"100%",padding:"10px 12px",border:"1px solid hsl(var(--c-border))",borderRadius:6,background:"hsl(var(--c-card))",color:"hsl(var(--c-fg))",fontSize:13.5,fontFamily:"inherit",lineHeight:1.5,resize:"vertical",minHeight:120,outline:"none",transition:"border-color 150ms, box-shadow 150ms"},onFocus:f=>{f.currentTarget.style.borderColor="hsl(var(--c-accent))",f.currentTarget.style.boxShadow="0 0 0 3px hsl(var(--c-accent-soft))"},onBlur:f=>{f.currentTarget.style.borderColor="hsl(var(--c-border))",f.currentTarget.style.boxShadow="none"}}),s.jsxs("div",{className:"tt-mono-sm",style:{display:"flex",justifyContent:"space-between",fontSize:11,color:"hsl(var(--c-fg-subtle))"},children:[s.jsx("span",{children:u.length>0&&u.length<NA&&s.jsxs("span",{style:{color:"hsl(var(--c-negative-fg))"},children:["At least ",NA," characters required"]})}),s.jsxs("span",{className:ae(u.length>dy&&"text-destructive"),style:u.length>dy?{color:"hsl(var(--c-negative-fg))"}:void 0,children:[u.length," / ",dy]})]})]}),s.jsxs(_i,{children:[s.jsx(je,{variant:"outline",onClick:()=>i(!1),className:"xph-btn-sm",children:"Cancel"}),s.jsxs(je,{onClick:h,disabled:!d||c.isPending,className:"xph-btn-sm",children:[c.isPending&&s.jsx(ne,{className:"mr-2 h-4 w-4 animate-spin"}),"Submit inquiry"]})]})]})]})}function Kst(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Gst=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Yst=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Qst={};function eW(e,t){return(Qst.jsx?Yst:Gst).test(e)}const Xst=/[ \t\n\f\r]/g;function Zst(e){return typeof e=="object"?e.type==="text"?tW(e.value):!1:tW(e)}function tW(e){return e.replace(Xst,"")===""}class zb{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}zb.prototype.normal={};zb.prototype.property={};zb.prototype.space=void 0;function Yse(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new zb(n,r,t)}function dO(e){return e.toLowerCase()}class ys{constructor(t,n){this.attribute=n,this.property=t}}ys.prototype.attribute="";ys.prototype.booleanish=!1;ys.prototype.boolean=!1;ys.prototype.commaOrSpaceSeparated=!1;ys.prototype.commaSeparated=!1;ys.prototype.defined=!1;ys.prototype.mustUseProperty=!1;ys.prototype.number=!1;ys.prototype.overloadedBoolean=!1;ys.prototype.property="";ys.prototype.spaceSeparated=!1;ys.prototype.space=void 0;let Jst=0;const wt=Wh(),dr=Wh(),hO=Wh(),xe=Wh(),cn=Wh(),bp=Wh(),As=Wh();function Wh(){return 2**++Jst}const fO=Object.freeze(Object.defineProperty({__proto__:null,boolean:wt,booleanish:dr,commaOrSpaceSeparated:As,commaSeparated:bp,number:xe,overloadedBoolean:hO,spaceSeparated:cn},Symbol.toStringTag,{value:"Module"})),CA=Object.keys(fO);class y$ extends ys{constructor(t,n,r,i){let a=-1;if(super(t,n),nW(this,"space",i),typeof r=="number")for(;++a<CA.length;){const o=CA[a];nW(this,CA[a],(r&fO[o])===fO[o])}}}y$.prototype.defined=!0;function nW(e,t,n){n&&(e[t]=n)}function Cg(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new y$(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[dO(r)]=r,n[dO(a.attribute)]=r}return new zb(t,n,e.space)}const Qse=Cg({properties:{ariaActiveDescendant:null,ariaAtomic:dr,ariaAutoComplete:null,ariaBusy:dr,ariaChecked:dr,ariaColCount:xe,ariaColIndex:xe,ariaColSpan:xe,ariaControl
vendor: 4,009 bytes, line 871
871s:cn,ariaCurrent:null,ariaDescribedBy:cn,ariaDetails:null,ariaDisabled:dr,ariaDropEffect:cn,ariaErrorMessage:null,ariaExpanded:dr,ariaFlowTo:cn,ariaGrabbed:dr,ariaHasPopup:null,ariaHidden:dr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:cn,ariaLevel:xe,ariaLive:null,ariaModal:dr,ariaMultiLine:dr,ariaMultiSelectable:dr,ariaOrientation:null,ariaOwns:cn,ariaPlaceholder:null,ariaPosInSet:xe,ariaPressed:dr,ariaReadOnly:dr,ariaRelevant:null,ariaRequired:dr,ariaRoleDescription:cn,ariaRowCount:xe,ariaRowIndex:xe,ariaRowSpan:xe,ariaSelected:dr,ariaSetSize:xe,ariaSort:null,ariaValueMax:xe,ariaValueMin:xe,ariaValueNow:xe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Xse(e,t){return t in e?e[t]:t}function Zse(e,t){return Xse(e,t.toLowerCase())}const eat=Cg({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:bp,acceptCharset:cn,accessKey:cn,action:null,allow:null,allowFullScreen:wt,allowPaymentRequest:wt,allowUserMedia:wt,alt:null,as:null,async:wt,autoCapitalize:null,autoComplete:cn,autoFocus:wt,autoPlay:wt,blocking:cn,capture:null,charSet:null,checked:wt,cite:null,className:cn,cols:xe,colSpan:null,content:null,contentEditable:dr,controls:wt,controlsList:cn,coords:xe|bp,crossOrigin:null,data:null,dateTime:null,decoding:null,default:wt,defer:wt,dir:null,dirName:null,disabled:wt,download:hO,draggable:dr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:wt,formTarget:null,headers:cn,height:xe,hidden:hO,high:xe,href:null,hrefLang:null,htmlFor:cn,httpEquiv:cn,id:null,imageSizes:null,imageSrcSet:null,inert:wt,inputMode:null,integrity:null,is:null,isMap:wt,itemId:null,itemProp:cn,itemRef:cn,itemScope:wt,itemType:cn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:wt,low:xe,manifest:null,max:null,maxLength:xe,media:null,method:null,min:null,minLength:xe,multiple:wt,muted:wt,name:null,nonce:null,noModule:wt,noValidate:wt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:wt,optimum:xe,pattern:null,ping:cn,placeholder:null,playsInline:wt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:wt,referrerPolicy:null,rel:cn,required:wt,reversed:wt,rows:xe,rowSpan:xe,sandbox:cn,scope:null,scoped:wt,seamless:wt,selected:wt,shadowRootClonable:wt,shadowRootDelegatesFocus:wt,shadowRootMode:null,shape:null,size:xe,sizes:null,slot:null,span:xe,spellCheck:dr,src:null,
871srcDoc:null,srcLang:null,srcSet:null,start:xe,step:null,style:null,tabIndex:xe,target:null,title:null,translate:null,type:null,typeMustMatch:wt,useMap:null,value:dr,width:xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:cn,axis:null,background:null,bgColor:null,border:xe,borderColor:null,bottomMargin:xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:wt,declare:wt,event:null,face:null,frame:null,frameBorder:null,hSpace:xe,leftMargin:xe,link:null,longDesc:null,lowSrc:null,marginHeight:xe,marginWidth:xe,noResize:wt,noHref:wt,noShade:wt,noWrap:wt,object:null,profile:null,prompt:null,rev:null,rightMargin:xe,rules:null,scheme:null,scrolling:dr,standby:null,summary:null,text:null,topMargin:xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:wt,disableRemotePlayback:wt,prefix:null,property:null,results:xe,security:null,unselectable:null},space:"html",transform:Zse}),tat=Cg({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav
871-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:As,accentHeight:xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xe,amplitude:xe,arabicForm:null,ascent:xe,attributeName:null,attributeType:null,azimuth:xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xe,by:null,calcMode:null,capHeight:xe,className:cn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:xe,diffuseConstant:xe,direction:null,display:null,dur:null,divisor:xe,dominantBaseline:null,download:wt,dx:null,dy:null,edgeMode:null,editable:null,elevation:xe,enableBackground:null,end:null,event:null,exponent:xe,externalResourcesRequired:null,fill:null,fillOpacity:xe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:bp,g2:bp,glyphName:bp,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xe,horizOriginX:xe,horizOriginY:xe,id:null,ideographic:xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:
871xe,k:xe,k1:xe,k2:xe,k3:xe,k4:xe,kernelMatrix:As,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:xe,overlineThickness:xe,paintOrder:null,panose1:null,path:null,pathLength:xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:cn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xe,pointsAtY:xe,pointsAtZ:xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:As,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:As,rev:As,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:As,requiredFeatures:As,requiredFonts:As,requiredFormats:As,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:xe,specularExponent:xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xe,strikethroughThickness:xe,string:null,stroke:null,strokeDashArray:As,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xe,strokeOpacity:xe,strokeWidth:null,style:null,surfaceScale:xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:As,tabIndex:xe,tableValues:null,target:null,targetX:xe,targetY:xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:As,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xe,underlineThickness:xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xe,values:null,vAlphabetic:xe,vMathematical:xe,vectorEffect:null,vHanging:xe,vIdeographic:xe,version:null,vertAdvY:xe,vertOriginX:xe,vertOriginY:xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Xse}),Jse=Cg({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}
vendor: 4,837 bytes, lines 871-872
871,space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),eae=Cg({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Zse}),tae=Cg({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),nat={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},rat=/[A-Z]/g,rW=/-[a-z]/g,iat=/^data[-\w.:]+$/i;function sat(e,t){const n=dO(t);let r=t,i=ys;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&iat.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(rW,oat);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!rW.test(a)){let o=a.replace(rat,aat);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=y$}return new i(r,t)}function aat(e){return"-"+e.toLowerCase()}function oat(e){return e.charAt(1).toUpperCase()}const lat=Yse([Qse,eat,Jse,eae,tae],"html"),v$=Yse([Qse,tat,Jse,eae,tae],"svg");function cat(e){return e.join(" ").trim()}var x$={},iW=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,uat=/\n/g,dat=/^\s*/,hat=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,fat=/^:\s*/,pat=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,mat=/^[;\s]*/,gat=/^\s+|\s+$/g,yat=`
872`,sW="/",aW="*",vd="",vat="comment",xat="declaration";function bat(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var g=m.match(uat);g&&(n+=g.length);var y=m.lastIndexOf(yat);r=~y?m.length-y:r+m.length}function a(){var m={line:n,column:r};return function(g){return g.position=new o(m),u(),g}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function l(m){var g=new Error(t.source+":"+n+":"+r+": "+m);if(g.reason=m,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function c(m){var g=m.exec(e);if(g){var y=g[0];return i(y),e=e.slice(y.length),g}}function u(){c(dat)}function d(m){var g;for(m=m||[];g=h();)g!==!1&&m.push(g);return m}function h(){var m=a();if(!(sW!=e.charAt(0)||aW!=e.charAt(1))){for(var g=2;vd!=e.charAt(g)&&(aW!=e.charAt(g)||sW!=e.charAt(g+1));)++g;if(g+=2,vd===e.charAt(g-1))return l("End of comment missing");var y=e.slice(2,g-2);return r+=2,i(y),e=e.slice(g),r+=2,m({type:vat,comment:y})}}function f(){var m=a(),g=c(hat);if(g){if(h(),!c(fat))return l("property missing ':'");var y=c(pat),b=m({type:xat,property:oW(g[0].replace(iW,vd)),value:y?oW(y[0].replace(iW,vd)):vd});return c(mat),b}}function p(){var m=[];d(m);for(var g;g=f();)g!==!1&&(m.push(g),d(m));return m}return u(),p()}function oW(e){return e?e.replace(gat,vd):vd}var wat=bat,jat=Hc&&Hc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(x$,"__esModule",{value:!0});x$.default=Sat;const _at=jat(wat);function Sat(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,_at.default)(e),i=typeof t=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:o,value:l}=a;i?t(o,l,a):l&&(n=n||{},n[o]=l)}),n}var Lk={};Object.defineProperty(Lk,"__esModule",{value:!0});Lk.camelCase=void 0;var kat=/^--[a-zA-Z0-9_-]+$/,Nat=/-([a-z])/g,Cat=/^[^-]+$/,Aat=/^-(webkit|moz|ms|o|khtml)-/,Tat=/^-(ms)-/,Eat=function(e){return!e||Cat.test(e)||kat.test(e)},Pat=function(e,t){return t.toUpperCase()},lW=function(e,t){return"".concat(t,"-")},Oat=function(e,t){return t===void 0&&(t={}),Eat(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Tat,lW):e=e.replace(Aat,lW),e.replace(Nat,Pat))};Lk.camelCase=Oat;var Iat=Hc&&Hc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Rat=Iat(x$),Dat=Lk;function pO(e,t){var n={};return!e||typeof e!="string"||(0,Rat.default)(e,function(r,i){r&&i&&(n[(0,Dat.camelCase)(r,t)]=i)}),n}pO.default=pO;var Mat=pO;const $at=Ot(Mat),nae=rae("end"),b$=rae("start");function rae(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Lat(e){const t=b$(e),n=nae(e);if(t&&n)return{start:t,end:n}}function lv(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?cW(e.position):"start"in e||"end"in e?cW(e):"line"in e||"column"in e?mO(e):""}function mO(e){return uW(e&&e.line)+":"+uW(e&&e.column)}function cW(e){return mO(e&&e.start)+"-"+mO(e&&e.end)}function uW(e){return e&&typeof e=="number"?e:1}
vendor: 1,928 bytes, line 872
872class Si extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=lv(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Si.prototype.file="";Si.prototype.name="";Si.prototype.reason="";Si.prototype.message="";Si.prototype.stack="";Si.prototype.column=void 0;Si.prototype.line=void 0;Si.prototype.ancestors=void 0;Si.prototype.cause=void 0;Si.prototype.fatal=void 0;Si.prototype.place=void 0;Si.prototype.ruleId=void 0;Si.prototype.source=void 0;const w$={}.hasOwnProperty,Fat=new Map,zat=/[A-Z]/g,Bat=new Set(["table","tbody","thead","tfoot","tr"]),Vat=new Set(["td","th"]),iae="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Wat(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Xat(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 2,227 bytes, line 872
872if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Qat(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?v$:lat,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=sae(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function sae(e,t,n){if(t.type==="element")return Uat(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return qat(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Kat(e,t,n);if(t.type==="mdxjsEsm")return Hat(e,t);if(t.type==="root")return Gat(e,t,n);if(t.type==="text")return Yat(e,t)}function Uat(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=v$,e.schema=i),e.ancestors.push(t);const a=oae(e,t.tagName,!1),o=Zat(e,t);let l=_$(e,t);return Bat.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Zst(c):!0})),aae(e,o,a,t),j$(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function qat(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Vx(e,t.position)}function Hat(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Vx(e,t.position)}function Kat(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=v$,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:oae(e,t.name,!0),o=Jat(e,t),l=_$(e,t);return aae(e,o,a,t),j$(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Gat(e,t,n){const r={};return j$(r,_$(e,t)),e.create(t,e.Fragment,r,n)}function Yat(e,t){return t.value}function aae(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function j$(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Qat(e,t,n){return r;function r(i,a,o,l){const u=Array.isArray(o.children)?n:t;
vendor: 4,133 bytes, line 872
872return l?u(a,o,l):u(a,o)}}function Xat(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),c=b$(r);return t(i,a,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Zat(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&w$.call(t.properties,i)){const a=eot(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Vat.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Jat(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Vx(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else Vx(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function _$(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Fat;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const u=i.get(c)||0;o=c+"-"+u,i.set(c,u+1)}}const l=sae(e,a,o);l!==void 0&&n.push(l)}return n}function eot(e,t,n){const r=sat(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Kst(n):cat(n)),r.property==="style"){let i=typeof n=="object"?n:tot(e,String(n));return e.stylePropertyNameCase==="css"&&(i=not(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?nat[r.property]||r.property:r.attribute,n]}}function tot(e,t){try{return $at(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Si("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=iae+"#cannot-parse-style-attribute",i}}function oae(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const l=eW(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=o}else r=eW(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return w$.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Vx(e)}function Vx(e,t){const n=new Si("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=iae+"#cannot-handle-mdx-estrees-without-createevaluater",n}function not(e){const t={};let n;for(n in e)w$.call(e,n)&&(t[rot(n)]=e[n]);return t}function rot(e){let t=e.replace(zat,iot);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function iot(e){return"-"+e.toLowerCase()}const AA={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},sot={};function S$(e,t){const n=sot,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return lae(e,r,i)}function lae(e,t,n){if(aot(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return dW(e.children,t,n)}return Array.isArray(e)?dW(e,t,n):""}function dW(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=lae(e[i],t,n);return r.join("")}function aot(e){return!!(e&&typeof e=="object")}const hW=document.createElement("i");function k$(e){const t="&"+e+";";hW.innerHTML=t;const n=hW.textContent;
vendor: 10,926 bytes, line 872
872return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Vs(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function ma(e,t){return e.length>0?(Vs(e,e.length,0,t),e):t}const fW={}.hasOwnProperty;function cae(e){const t={};let n=-1;for(;++n<e.length;)oot(t,e[n]);return t}function oot(e,t){let n;for(n in t){const i=(fW.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){fW.call(i,o)||(i[o]=[]);const l=a[o];lot(i[o],Array.isArray(l)?l:l?[l]:[])}}}function lot(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Vs(e,0,0,r)}function uae(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function uo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ii=qu(/[A-Za-z]/),bi=qu(/[\dA-Za-z]/),cot=qu(/[#-'*+\--9=?A-Z^-~]/);function u_(e){return e!==null&&(e<32||e===127)}const gO=qu(/\d/),uot=qu(/[\dA-Fa-f]/),dot=qu(/[!-/:-@[-`{-~]/);function Xe(e){return e!==null&&e<-2}function on(e){return e!==null&&(e<0||e===32)}function Nt(e){return e===-2||e===-1||e===32}const Fk=qu(new RegExp("\\p{P}|\\p{S}","u")),Nh=qu(/\s/);function qu(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ag(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&bi(e.charCodeAt(n+1))&&bi(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Dt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return Nt(c)?(e.enter(n),l(c)):t(c)}function l(c){return Nt(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const hot={tokenize:fot};function fot(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Dt(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),a(l)}function a(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Xe(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const pot={tokenize:mot},pW={tokenize:got};function mot(e){const t=this,n=[];let r=0,i,a,o;return l;function l(w){if(r<n.length){const _=n[r];return t.containerState=_[1],e.attempt(_[0].continuation,c,u)(w)}return u(w)}function c(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const _=t.events.length;let j=_,S;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){S=t.events[j][1].end;break}b(r);let k=_;for(;k<t.events.length;)t.events[k][1].end={...S},k++;return Vs(t.events,j+1,0,t.events.slice(_)),t.events.length=k,u(w)}return l(w)}function u(w){if(r===n.length){if(!i)return f(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(pW,d,h)(w)}function d(w){return i&&v(),b(r),f(w)}function h(w){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(w)}function f(w){return t.containerState={},e.attempt(pW,p,m)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),f(w)}function m(w){if(w===null){i&&v(),b(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),g(w)}function g(w){if(w===null){y(e.exit("chunkFlow"),!0),b(0),e.consume(w);return}return Xe(w)?(e.consume(w),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(w),g)}function y(w,_){const j=t.sliceStream(w);if(_&&j.push(null),w.previous=a,a&&(a.next=w),a=w,i.defineSkip(w.start),i.write(j),t.parser.lazy[w.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<o&&(!i.events[S][1].end||i.events[S][1].end.offset>o))return;const k=t.events.length;let N=k,T,C;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(T){C=t.events[N][1].end;break}T=!0}for(b(r),S=k;S<t.events.length;)t.events[S][1].end={...C},S++;Vs(t.events,N+1,0,t.events.slice(k)),t.events.length=S}}function b(w){let _=n.length;for(;_-- >w;){const j=n[_];t.containerState=j[1],j[0].exit.call(t,e)}n.length=w}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function got(e,t,n){return Dt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function $m(e){if(e===null||on(e)||Nh(e))return 1;if(Fk(e))return 2}function zk(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const yO={name:"attention",resolveAll:yot,tokenize:vot};function yot(e,t){let n=-1,r,i,a,o,l,c,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},f={...e[n][1].start};mW(h,-c),mW(f,c),o={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ma(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ma(u,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),u=ma(u,zk(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ma(u,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=ma(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Vs(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function vot(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=$m(r);let a;return o;function o(c){return a=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===a)return e.consume(c),l;const u=e.exit("attentionSequence"),d=$m(c),h=!d||d===2&&i||n.includes(c),f=!i||i===2&&d||n.includes(r);return u._open=!!(a===42?h:h&&(i||!f)),u._close=!!(a===42?f:f&&(d||!h)),t(c)}}function mW(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const xot={name:"autolink",tokenize:bot};function bot(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return Ii(p)?(e.consume(p),o):p===64?n(p):u(p)}function o(p){return p===43||p===45||p===46||bi(p)?(r=1,l(p)):u(p)}function l(p){return p===58?(e.consume(p),r=0,c):(p===43||p===45||p===46||bi(p))&&r++<32?(e.consume(p),l):(r=0,u(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||u_(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),d):cot(p)?(e.consume(p),u):n(p)}function d(p){return bi(p)?h(p):n(p)}function h(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||bi(p))&&r++<63){const m=p===45?f:h;return e.consume(p),m}return n(p)}}const Bb={partial:!0,tokenize:wot};function wot(e,t,n){return r;function r(a){return Nt(a)?Dt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Xe(a)?t(a):n(a)}}const dae={continuation:{tokenize:_ot},exit:Sot,name:"blockQuote",tokenize:jot};function jot(e,t,n){const r=this;return i;function i(o){if(o===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return Nt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function _ot(e,t,n){const r=this;return i;function i(o){return Nt(o)?Dt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(dae,t,n)(o)}}function Sot(e){e.exit("blockQuote")}const hae={name:"characterEscape",tokenize:kot};function kot(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return dot(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const fae={name:"characterReference",tokenize:Not};function Not(e,t,n){const r=this;let i=0,a,o;return l;function l(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,o=bi,d(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=uot,d):(e.enter("characterReferenceValue"),a=7,o=gO,d(h))}function d(h){if(h===59&&i){const f=e.exit("characterReferenceValue");return o===bi&&!k$(r.sliceSerialize(f))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(h)&&i++<a?(e.consume(h),d):n(h)}}const gW={partial:!0,tokenize:Aot},yW={concrete:!0,name:"codeFenced",tokenize:Cot};function Cot(e,t,n){const r=this,i={partial:!0,tokenize:j};let a=0,o=0,l;return c;function c(S){return u(S)}function u(S){const k=r.events[r.events.length-1];return a=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,l=S,e.enter("co
872deFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(S)}function d(S){return S===l?(o++,e.consume(S),d):o<3?n(S):(e.exit("codeFencedFenceSequence"),Nt(S)?Dt(e,h,"whitespace")(S):h(S))}function h(S){return S===null||Xe(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(gW,g,_)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(S))}function f(S){return S===null||Xe(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(S)):Nt(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Dt(e,p,"whitespace")(S)):S===96&&S===l?n(S):(e.consume(S),f)}function p(S){return S===null||Xe(S)?h(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||Xe(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(S)):S===96&&S===l?n(S):(e.consume(S),m)}function g(S){return e.attempt(i,_,y)(S)}function y(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),b}function b(S){return a>0&&Nt(S)?Dt(e,v,"linePrefix",a+1)(S):v(S)}function v(S){return S===null||Xe(S)?e.check(gW,g,_)(S):(e.enter("codeFlowValue"),w(S))}function w(S){return S===null||Xe(S)?(e.exit("codeFlowValue"),v(S)):(e.consume(S),w)}function _(S){return e.exit("codeFenced"),t(S)}function j(S,k,N){let T=0;return C;function C(F){return S.enter("lineEnding"),S.consume(F),S.exit("lineEnding"),A}function A(F){return S.enter("codeFencedFence"),Nt(F)?Dt(S,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):O(F)}function O(F){return F===l?(S.enter("codeFencedFenceSequence"),z(F)):N(F)}function z(F){return F===l?(T++,S.consume(F),z):T>=o?(S.exit("codeFencedFenceSequence"),Nt(F)?Dt(S,$,"whitespace")(F):$(F)):N(F)}function $(F){return F===null||Xe(F)?(S.exit("codeFencedFence"),k(F)):N(F)}}}function Aot(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const TA={name:"codeIndented",tokenize:Eot},Tot={partial:!0,tokenize:Pot};function Eot(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Dt(e,a,"linePrefix",5)(u)}function a(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?c(u):Xe(u)?e.attempt(Tot,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Xe(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function Pot(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Xe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Dt(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):Xe(o)?i(o):n(o)}}const Oot={name:"codeText",previous:Rot,resolve:Iot,tokenize:Dot};function Iot(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Rot(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Dot(e,t,n){let r=0,i,a;return o;function o(h){return e.enter("codeText"),e.enter("codeTextSequence"),l(h)}function l(h){return h===96?(e.consume(h),r++,l):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(a=e.enter("codeTextSequence"),i=0,d(h)):Xe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||Xe(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),u)}function d(h){return h===96?(e.consume(h),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(a.type="codeTextData",u(h))}}class Mot{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&hy(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),hy(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),hy(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);hy(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);hy(this.left,n.reverse())}}}function hy(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function pae(e){const t={};let n=-1,r,i,a,o,l,c,u;const d=new Mot(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,$ot(d,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=d.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},l=d.slice(i,n),l.unshift(r),d.splice(i,n-i+1,l))}}return Vs(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function $ot(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],u={};let d,h,f=-1,p=n,m=0,g=0;const y=[g];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),h&&o.defineSki
vendor: 18,639 bytes, line 872
872p(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=n;++f<l.length;)l[f][0]==="exit"&&l[f-1][0]==="enter"&&l[f][1].type===l[f-1][1].type&&l[f][1].start.line!==l[f][1].end.line&&(g=f+1,y.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),f=y.length;f--;){const b=l.slice(y[f],y[f+1]),v=a.pop();c.push([v,v+b.length-1]),e.splice(v,2,b)}for(c.reverse(),f=-1;++f<c.length;)u[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return u}const Lot={resolve:zot,tokenize:Bot},Fot={partial:!0,tokenize:Vot};function zot(e){return pae(e),e}function Bot(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?a(l):Xe(l)?e.check(Fot,o,a)(l):(e.consume(l),i)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Vot(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Dt(e,a,"linePrefix")}function a(o){if(o===null||Xe(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function mae(e,t,n,r,i,a,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return h;function h(b){return b===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(b),e.exit(a),f):b===null||b===32||b===41||u_(b)?n(b):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(b))}function f(b){return b===62?(e.enter(a),e.consume(b),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===62?(e.exit("chunkString"),e.exit(l),f(b)):b===null||b===60||Xe(b)?n(b):(e.consume(b),b===92?m:p)}function m(b){return b===60||b===62||b===92?(e.consume(b),p):p(b)}function g(b){return!d&&(b===null||b===41||on(b))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(b)):d<u&&b===40?(e.consume(b),d++,g):b===41?(e.consume(b),d--,g):b===null||b===32||b===40||u_(b)?n(b):(e.consume(b),b===92?y:g)}function y(b){return b===40||b===41||b===92?(e.consume(b),g):g(b)}}function gae(e,t,n,r,i,a){const o=this;let l=0,c;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(a),d}function d(p){return l>999||p===null||p===91||p===93&&!c||p===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(a),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Xe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||Xe(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!Nt(p)),p===92?f:h)}function f(p){return p===91||p===92||p===93?(e.consume(p),l++,h):h(p)}}function yae(e,t,n,r,i,a){let o;return l;function l(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),o=f===40?41:f,c):n(f)}function c(f){return f===o?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(a),u(f))}function u(f){return f===o?(e.exit(a),c(o)):f===null?n(f):Xe(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Dt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===o||f===null||Xe(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?h:d)}function h(f){return f===o||f===92?(e.consume(f),d):d(f)}}function cv(e,t){let n;return r;function r(i){return Xe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Nt(i)?Dt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Wot={name:"definition",tokenize:qot},Uot={partial:!0,tokenize:Hot};function qot(e,t,n){const r=this;let i;return a;function a(p){return e.enter("definition"),o(p)}function o(p){return gae.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=uo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return on(p)?cv(e,u)(p):u(p)}function u(p){return mae(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(Uot,h,h)(p)}function h(p){return Nt(p)?Dt(e,f,"whitespace")(p):f(p)}function f(p){return p===null||Xe(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function Hot(e,t,n){return r;function r(l){return on(l)?cv(e,i)(l):n(l)}function i(l){return yae(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Nt(l)?Dt(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Xe(l)?t(l):n(l)}}const Kot={name:"hardBreakEscape",tokenize:Got};function Got(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Xe(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Yot={name:"headingAtx",resolve:Qot,tokenize:Xot};function Qot(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Vs(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function Xot(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||on(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Xe(d)?(e.exit("atxHeading"),t(d)):Nt(d)?Dt(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||on(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const Zot=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],vW=["pre","script","style","textarea"],Jot={concrete:!0,name:"htmlFlow",resolveTo:nlt,tokenize:rlt},elt={partial:!0,tokenize:slt},tlt={partial:!0,tokenize:ilt};function nlt(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function rlt(e,t,n){const r=this;let i,a,o,l,c;return u;function u(E){return d(E)}function d(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),h}function h(E){return E===33?(e.consume(E),f):E===47?(e.consume(E),a=!0,g):E===63?(e.consume(E),i=3,r.interrupt?t:R):Ii(E)?(e.consume(E),o=String.fromCharCode(E),y):n(E)}function f(E){return E===45?(e.consume(E),i=2,p):E===91?(e.consume(E),i=5,l=0,m):Ii(E)?(e.consume(E),i=4,r.interrupt?t:R):n(E)}function p(E){return E===45?(e.consume(E),r.interrupt?t:R):n(E)}function m(E){const q="CDATA[";return E===q.charCodeAt(l++)?(e.consume(E),l===q.length?r.interrupt?t:O:m):n(E)}function g(E){return Ii(E)?(e.consume(E),o=String.fromCharCode(E),y):n(E)}function y(E){if(E===null||E===47||E===62||on(E)){const q=E===47,X=o.toLowerCase();return!q&&!a&&vW.includes(X)?(i=1,r.interrupt?t(E):O(E)):Zot.includes(o.toLowerCase())?(i=6,q?(e.consume(E),b):r.interrupt?t(E):O(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):a?v(E):w(E))}return E===45||bi(E)?(e.consume(E),o+=String.fromCharCode(E),y):n(E)}function b(E){return E===62?(e.consume(E),r.interrupt?t:O):n(E)}function v(E){return Nt(E)?(e.consume(E),v):C(E)}function w(E){return E===47?(e.consume(E),C):E===58||E===95||Ii(E)?(e.consume(E),_):Nt(E)?(e.consume(E),w):C(E)}function _(E){return E===45||E===46||E===58||E===95||bi(E)?(e.consume(E),_):j(E)}function j(E){return E===61?(e.consume(E),S):Nt(E)?(e.consume(E),j):w(E)}function S(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),c=E,k):Nt(E)?(e.consume(E),S):N(E)}function k(E){return E===c?(e.consume(E),c=null,T):E===null||Xe(E)?n(E):(e.consume(E),k)}function N(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||on(E)?j(E):(e.consume(E),N)}function T(E){return E===47||E===62||Nt(E)?w(E):n(E)}function C(E){return E===62?(e.consume(E),A):n(E)}function A(E){return E===null||Xe(E)?O(E):Nt(E)?(e.consume(E),A):n(E)}function O(E){return E===45&&i===2?(e.consume(E),B):E===60&&i===1?(e.consume(E),P):E===62&&i===4?(e.consume(E),K):E===63&&i===3?(e.consume(E),R):E===93&&i===5?(e.consume(E),M):Xe(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(elt,D,z)(E)):E===null||Xe(E)?(e.exit("htmlFlowData"),z(E)):(e.consume(E),O)}function z(E){return e.check(tlt,$,D)(E)}function $(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),F}function F(E){return E===null||Xe(E)?z(E):(e.enter("htmlFlowData"),O(E))}function B(E){return E===45?(e.consume(E),R):O(E)}function P(E){return E===47?(e.consume(E),o="",I):O(E)}function I(E){if(E===62){const q=o.toLowerCase();return vW.includes(q)?(e.consume(E),K):O(E)}return Ii(E)&&o.length<8?(e.consume(E),o+=String.fromCharCode(E),I):O(E)}function M(E){return E===93?(e.consume(E),R):O(E)}function R(E){return E===62?(e.consume(E),K):E===45&&i===2?(e.consume(E),R):O(E)}function K(E){return E===null||Xe(E)?(e.exit("htmlFlowData"),D(E)):(e.consume(E),K)}function D(E){return e.exit("htmlFlow"),t(E)}}function ilt(e,t,n){const r=this;return i;function i(o){return Xe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function slt(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Bb,t,n)}}const alt={name:"htmlText",tokenize:olt};function olt(e,t,n){const r=this;let i,a,o;return l;function l(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),c}function c(R){return R===33?(e.consume(R),u):R===47?(e.consume(R),j):R===63?(e.consume(R),w):Ii(R)?(e.consume(R),N):n(R)}function u(R){return R===45?(e.consume(R),d):R===91?(e.consume(R),a=0,m):Ii(R)?(e.consume(R),v):n(R)}function d(R){return R===45?(e.consume(R),p):n(R)}function h(R){return R===null?n(R):R===45?(e.consume(R),f):Xe(R)?(o=h,P(R)):(e.consume(R),h)}function f(R){return R===45?(e.consume(R),p):h(R)}function p(R){return R===62?B(R):R===45?f(R):h(R)}function m(R){const K="CDATA[";return R===K.charCodeAt(a++)?(e.consume(R),a===K.length?g:m):n(R)}function g(R){return R===null?n(R):R===93?(e.consume(R),y):Xe(R)?(o=g,P(R)):(e.consume(R),g)}function y(R){return R===93?(e.consume(R),b):g(R)}function b(R){return R===62?B(R):R===93?(e.consume(R),b):g(R)}function v(R){return R===null||R===62?B(R):Xe(R)?(o=v,P(R)):(e.consume(R),v)}function w(R){return R===null?n(R):R===63?(e.consume(R),_):Xe(R)?(o=w,P(R)):(e.consume(R),w)}function _(R){return R===62?B(R):w(R)}function j(R){return Ii(R)?(e.consume(R),S):n(R)}function S(R){return R===45||bi(R)?(e.consume(R),S):k(R)}function k(R){return Xe(R)?(o=k,P(R)):Nt(R)?(e.consume(R),k):B(R)}function N(R){return R===45||bi(R)?(e.consume(R),N):R===47||R===62||on(R)?T(R):n(R)}function T(R){return R===47?(e.consume(R),B):R===58||R===95||Ii(R)?(e.consume(R),C):Xe(R)?(o=T,P(R)):Nt(R)?(e.consume(R),T):B(R)}function C(R){return R===45||R===46||R===58||R===95||bi(R)?(e.consume(R),C):A(R)}function A(R){return R===61?(e.consume(R),O):Xe(R)?(o=A,P(R)):Nt(R)?(e.consume(R),A):T(R)}function O(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,z):Xe(R)?(o=O,P(R)):Nt(R)?(e.consume(R),O):(e.consume(R),$)}function z(R){return R===i?(e.consume(R),i=void 0,F):R===null?n(R):Xe(R)?(o=z,P(R)):(e.consume(R),z)}function $(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||on(R)?T(R):(e.consume(R),$)}function F(R){return R===47||R===62||on(R)?T(R):n(R)}function B(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function P(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),I}function I(R){return Nt(R)?Dt(e,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):M(R)}function M(R){return e.enter("htmlTextData"),o(R)}}const N$={name:"labelEnd",resolveAll:dlt,resolveTo:hlt,tokenize:flt},llt={tokenize:plt},clt={tokenize:mlt},ult={tokenize:glt};function dlt(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Vs(e,0,e.length,n),e}function hlt(e,t){let n=e.length,r=0,i,a,o,l;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",u,t]],l=ma(l,e.slice(a+1,a+r+3)),l=ma(l,[["enter",d,t]]),l=ma(l,zk(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=ma(l,[["exit",d,t],e[o-2],e[o-1],["exit",u,t]]),l=ma(l,e.slice(o+1)),l=ma(l,[["exit",c,t]]),Vs(e,a,e.length,l),e}function flt(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return l;function l(f){return a?a._inactive?h(f):(o=r.parser.defined.includes(uo(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),c):n(f)}function c(f){return f===40?e.attempt(llt,d,o?d:h)(f):f===91?e.attempt(clt,d,o?u:h)(f):o?d(f):h(f)}function u(f){return e.attempt(ult,d,h)(f)}function d(f){return t(f)}function h(f){return a._balanced=!0,n(f)}}function plt(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return on(h)?cv(e,a)(h):a(h)}function a(h){return h===41?d(h):mae(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function o(h){return on(h)?cv(e,c)(h):d(h)}function l(h){return n(h)}function c(h){return h===34||h===39||h===40?yae(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function u(h){return on(h)?cv(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function mlt(e,t,n){const r=this;return i;function i(l){return gae.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(uo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function glt(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const ylt={name:"labelStartImage",resolveAll:N$.resolveAll,tokenize:vlt};function vlt(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):n(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const xlt={name:"labelStartLink",resolveAll:N$.resolveAll,tokenize:blt};function blt(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const EA={name:"lineEnding",tokenize:wlt};function wlt(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Dt(e,t,"linePrefix")}}const Uw={name:"thematicBreak",tokenize:jlt};function jlt(e,t,n){let r=0,i;return a;function a(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,l(u)}function l(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||Xe(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Nt(u)?Dt(e,l,"whitespace")(u):l(u))}}const Qi={continuation:{tokenize:Nlt},exit:Alt,name:"list",tokenize:klt},_lt={partial:!0,tokenize:Tlt},Slt={partial:!0,tokenize:Clt};function klt(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:gO(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Uw,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return gO(p)&&++o<10?(e.consume(p),c):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Bb,r.interrupt?n:d,e.attempt(_lt,f,h))}
vendor: 7,395 bytes, line 872
872function d(p){return r.containerState.initialBlankLine=!0,a++,f(p)}function h(p){return Nt(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Nlt(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Bb,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Dt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!Nt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Slt,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Dt(e,e.attempt(Qi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Clt(e,t,n){const r=this;return Dt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function Alt(e){e.exit(this.containerState.type)}function Tlt(e,t,n){const r=this;return Dt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!Nt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const xW={name:"setextUnderline",resolveTo:Elt,tokenize:Plt};function Elt(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Plt(e,t,n){const r=this;let i;return a;function a(u){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===i?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Nt(u)?Dt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Xe(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Olt={tokenize:Ilt};function Ilt(e){const t=this,n=e.attempt(Bb,r,e.attempt(this.parser.constructs.flowInitial,i,Dt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Lot,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Rlt={resolveAll:xae()},Dlt=vae("string"),Mlt=vae("text");function vae(e){return{resolveAll:xae(e==="text"?$lt:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,l);return o;function o(d){return u(d)?a(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),a(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const h=i[d];let f=-1;if(h)for(;++f<h.length;){const p=h[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function xae(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function $lt(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,o=-1,l=0,c;for(;a--;){const u=i[a];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(u===-2)c=!0,l++;else if(u!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const u={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const Llt={42:Qi,43:Qi,45:Qi,48:Qi,49:Qi,50:Qi,51:Qi,52:Qi,53:Qi,54:Qi,55:Qi,56:Qi,57:Qi,62:dae},Flt={91:Wot},zlt={[-2]:TA,[-1]:TA,32:TA},Blt={35:Yot,42:Uw,45:[xW,Uw],60:Jot,61:xW,95:Uw,96:yW,126:yW},Vlt={38:fae,92:hae},Wlt={[-5]:EA,[-4]:EA,[-3]:EA,33:ylt,38:fae,42:yO,60:[xot,alt],91:xlt,92:[Kot,hae],93:N$,95:yO,96:Oot},Ult={null:[yO,Rlt]},qlt={null:[42,95]},Hlt={null:[]},Klt=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:qlt,contentInitial:Flt,disable:Hlt,document:Llt,flow:Blt,flowInitial:zlt,insideSpan:Ult,string:Vlt,text:Wlt},Symbol.toStringTag,{value:"Module"}));function Glt(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let o=[],l=[];const c={attempt:k(j),check:k(S),consume:v,enter:w,exit:_,interrupt:k(S,{interrupt:!0})},u={code:null,containerState:{},defineSkip:g,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:h};let d=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function h(A){return o=ma(o,A),y(),o[o.length-1]!==null?[]:(N(t,0),u.events=zk(a,u.events,u),u.events)}function f(A,O){return Qlt(p(A),O)}function p(A){return Ylt(o,A)}function m(){const{_bufferIndex:A,_index:O,line:z,column:$,offset:F}=r;return{_bufferIndex:A,_index:O,line:z,column:$,offset:F}}function g(A){i[A.line]=A.column,C()}function y(){let A;for(;r._index<o.length;){const O=o[r._index];if(typeof O=="string")for(A=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===A&&r._bufferIndex<O.length;)b(O.charCodeAt(r._bufferIndex));else b(O)}}function b(A){d=d(A)}function v(A){Xe(A)?(r.line++,r.column=1,r.offset+=A===-3?2:1,C()):A!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=A}function w(A,O){const z=O||{};return z.type=A,z.start=m(),u.events.push(["enter",z,u]),l.push(z),z}function _(A){const O=l.pop();return O.end=m(),u.events.push(["exit",O,u]),O}function j(A,O){N(A,O.from)}function S(A,O){O.restore()}function k(A,O){return z;function z($,F,B){let P,I,M,R;return Array.isArray($)?D($):"tokenize"in $?D([$]):K($);function K(re){return Y;function Y(le){const Z=le!==null&&re[le],de=le!==null&&re.null,pe=[...Array.isArray(Z)?Z:Z?[Z]:[],...Array.isArray(de)?de:de?[de]:[]];return D(pe)(le)}}function D(re){return P=re,I=0,re.length===0?B:E(re[I])}function E(re){return Y;function Y(le){return R=T(),M=re,re.partial||(u.currentConstruct=re),re.name&&u.parser.constructs.disable.null.includes(re.name)?X():re.tokenize.call(O?Object.assign(Object.create(u),O):u,c,q,X)(le)}}function q(re){return A(M,R),F}
vendor: 12,723 bytes, lines 872-874
872function X(re){return R.restore(),++I<P.length?E(P[I]):B}}}function N(A,O){A.resolveAll&&!a.includes(A)&&a.push(A),A.resolve&&Vs(u.events,O,u.events.length-O,A.resolve(u.events.slice(O),u)),A.resolveTo&&(u.events=A.resolveTo(u.events,u))}function T(){const A=m(),O=u.previous,z=u.currentConstruct,$=u.events.length,F=Array.from(l);return{from:$,restore:B};function B(){r=A,u.previous=O,u.currentConstruct=z,u.events.length=$,l=F,C()}}function C(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ylt(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Qlt(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
873`;break}case-3:{o=`\r
874`;break}case-2:{o=t?" ":"	";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}function Xlt(e){const r={constructs:cae([Klt,...(e||{}).extensions||[]]),content:i(hot),defined:[],document:i(pot),flow:i(Olt),lazy:{},string:i(Dlt),text:i(Mlt)};return r;function i(a){return o;function o(l){return Glt(r,a,l)}}}function Zlt(e){for(;!pae(e););return e}const bW=/[\0\t\n\r]/g;function Jlt(){let e=1,t="",n=!0,r;return i;function i(a,o,l){const c=[];let u,d,h,f,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),h=0,t="",n&&(a.charCodeAt(0)===65279&&h++,n=void 0);h<a.length;){if(bW.lastIndex=h,u=bW.exec(a),f=u&&u.index!==void 0?u.index:a.length,p=a.charCodeAt(f),!u){t=a.slice(h);break}if(p===10&&h===f&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),h<f&&(c.push(a.slice(h,f)),e+=f-h),p){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}h=f+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const ect=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tct(e){return e.replace(ect,nct)}function nct(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return uae(n.slice(a?2:1),a?16:10)}return k$(n)||e}const bae={}.hasOwnProperty;function rct(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),ict(n)(Zlt(Xlt(n).document().write(Jlt()(e,t,!0))))}function ict(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(kt),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(Ce),blockQuote:a(de),characterEscape:T,characterReference:T,codeFenced:a(pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(pe,o),codeText:a(J,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(be),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ee),hardBreakEscape:a(Re),hardBreakTrailing:a(Re),htmlFlow:a(Ze,o),htmlFlowData:T,htmlText:a(Ze,o),htmlTextData:T,image:a(Ee),label:o,link:a(kt),listItem:a(Q),listItemValue:f,listOrdered:a(V,h),listUnordered:a(V),paragraph:a(te),reference:E,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Ce),strong:a(ve),thematicBreak:a(G)},exit:{atxHeading:c(),atxHeadingSequence:j,autolink:c(),autolinkEmail:Z,autolinkProtocol:le,blockQuote:c(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:re,characterReference:Y,codeFenced:c(y),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:C,codeIndented:c(b),codeText:c(F),codeTextData:C,data:C,definition:c(),definitionDestinationString:_,definitionLabelString:v,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(z),htmlFlowData:C,htmlText:c($),htmlTextData:C,image:c(P),label:M,labelText:I,lineEnding:A,link:c(B),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:q,resourceDestinationString:R,resourceTitleString:K,resource:D,setextHeading:c(N),setextHeadingLineSequence:k,setextHeadingText:S,strong:c(),thematicBreak:c()}};wae(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(U){let ie={type:"root",children:[]};const ke={stack:[ie],tokenStack:[],config:t,enter:l,exit:u,buffer:o,resume:d,data:n},Ge=[];let jt=-1;for(;++jt<U.length;)if(U[jt][1].type==="listOrdered"||U[jt][1].type==="listUnordered")if(U[jt][0]==="enter")Ge.push(jt);else{const Tn=Ge.pop();jt=i(U,Tn,jt)}for(jt=-1;++jt<U.length;){const Tn=t[U[jt][0]];bae.call(Tn,U[jt][1].type)&&Tn[U[jt][1].type].call(Object.assign({sliceSerialize:U[jt][2].sliceSerialize},ke),U[jt][1])}if(ke.tokenStack.length>0){const Tn=ke.tokenStack[ke.tokenStack.length-1];(Tn[1]||wW).call(ke,void 0,Tn[0])}for(ie.position={start:bc(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:bc(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},jt=-1;++jt<t.transforms.length;)ie=t.transforms[jt](ie)||ie;return ie}function i(U,ie,ke){let Ge=ie-1,jt=-1,Tn=!1,vs,Bn,ar,_r;for(;++Ge<=ke;){const tn=U[Ge];switch(tn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{tn[0]==="enter"?jt++:jt--,_r=void 0;break}case"lineEndingBlank":{tn[0]==="enter"&&(vs&&!_r&&!jt&&!ar&&(ar=Ge),_r=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_r=void 0}if(!jt&&tn[0]==="enter"&&tn[1].type==="listItemPrefix"||jt===-1&&tn[0]==="exit"&&(tn[1].type==="listUnordered"||tn[1].type==="listOrdered")){if(vs){let li=Ge;for(Bn=void 0;li--;){const Vr=U[li];if(Vr[1].type==="lineEnding"||Vr[1].type==="lineEndingBlank"){if(Vr[0]==="exit")continue;Bn&&(U[Bn][1].type="lineEndingBlank",Tn=!0),Vr[1].type="lineEnding",Bn=li}else if(!(Vr[1].type==="linePrefix"||Vr[1].type==="blockQuotePrefix"||Vr[1].type==="blockQuotePrefixWhitespace"||Vr[1].type==="blockQuoteMarker"||Vr[1].type==="listItemIndent"))break}ar&&(!Bn||ar<Bn)&&(vs._spread=!0),vs.end=Object.assign({},Bn?U[Bn][1].start:tn[1].end),U.splice(Bn||Ge,0,["exit",vs,tn[2]]),Ge++,ke++}if(tn[1].type==="listItemPrefix"){const li={type:"listItem",_spread:!1,start:Object.assign({},tn[1].start),end:void 0};vs=li,U.splice(Ge,0,["enter",li,tn[2]]),Ge++,ke++,ar=void 0,_r=!0}}}return U[ie][1]._spread=Tn,ke}function a(U,ie){return ke;function ke(Ge){l.call(this,U(Ge),Ge),ie&&ie.call(this,Ge)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(U,ie,ke){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([ie,ke||void 0]),U.position={start:bc(ie.start),end:void 0}}function c(U){return ie;function ie(ke){U&&U.call(this,ke),u.call(this,ke)}}function u(U,ie){const ke=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==U.type&&(ie?ie.call(this,U,Ge[0]):(Ge[1]||wW).call(this,U,Ge[0]));else throw new Error("Cannot close `"+U.type+"` ("+lv({start:U.start,end:U.end})+"): it’s not open");ke.position.end=bc(U.end)}function d(){return S$(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function f(U){if(this.data.expectingFirstListItemValue){const ie=this.stack[this.stack.length-2];ie.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function p(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.lang=U}function m(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.meta=U}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.value=U.replace(/(\r?\n|\r)$/g,"")}function v(U){const ie=this.resume(),ke=this.stack[this.stack.length-1];ke.label=ie,ke.identifier=uo(this.sliceSerialize(U)).toLowerCase()}function w(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.title=U}function _(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.url=U}function j(U){const ie=this.stack[this.stack.length-1];if(!ie.depth){const ke=this.sliceSerialize(U).length;ie.depth=ke}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function k(U){const ie=this.stack[this.stack.length-1];ie.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function T(U){const ke=this.stack[this.stack.length-1].children;let Ge=ke[ke.length-1];(!Ge||Ge.type!=="text")&&(Ge=we(),Ge.position={start:bc(U.start),end:void 0},ke.push(Ge)),this.stack.push(Ge)}function C(U){const ie=this.stack.pop();ie.value+=this.sliceSerialize(U),ie.position.end=bc(U.end)}function A(U){const ie=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ke=ie.children[ie.children.length-1];ke.position.end=bc(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ie.type)&&(T.call(this,U),C.call(this,U))}function O(){this.data.atHardBreak=!0}function z(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.value=U}function $(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.value=U}function F(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.value=U}function B(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=ie,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function P(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=ie,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function I(U){const ie=this.sliceSerialize(U),ke=this.stack[this.stack.length-2];ke.label=tct(ie),ke.identifier=uo(ie).toLowerCase()}function M(){const U=this.stack[this.stack.length-1],ie=this.resume(),ke=this.stack[this.stack.length-1];if(this.data.inReference=!0,ke.type==="link"){const Ge=U.children;ke.children=Ge}else ke.alt=ie}function R(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.url=U}function K(){const U=this.resume(),ie=this.stack[this.stack.length-1];ie.title=U}function D(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function q(U){const ie=this.resume(),ke=this.stack[this.stack.length-1];ke.label=ie,ke.identifier=uo(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function X(U){this.data.characterReferenceType=U.type}function re(U){const ie=this.sliceSerialize(U),ke=this.data.characterReferenceType;let Ge;ke?(Ge=uae(ie,ke==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=k$(ie);const jt=this.stack[this.stack.length-1];jt.value+=Ge}function Y(U){const ie=this.stack.pop();ie.position.end=bc(U.end)}function le(U){C.call(this,U);const ie=this.stack[this.stack.length-1];ie.url=this.sliceSerialize(U)}function Z(U){C.call(this,U);const ie=this.stack[this.stack.length-1];ie.url="mailto:"+this.sliceSerialize(U)}function de(){return{type:"blockquote",children:[]}}function pe(){return{type:"code",lang:null,meta:null,value:""}}function J(){return{type:"inlineCode",value:""}}function be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ee(){return{type:"emphasis",children:[]}}function Ce(){return{type:"heading",depth:0,children:[]}}function Re(){return{type:"break"}}function Ze(){return{type:"html",value:""}}function Ee(){return{type:"image",title:null,url:"",alt:null}}function kt(){return{type:"link",title:null,url:"",children:[]}}function V(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function Q(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function te(){return{type:"paragraph",children:[]}}function ve(){return{type:"strong",children:[]}}function we(){return{type:"text",value:""}}function G(){return{type:"thematicBreak"}}}function bc(e){return{line:e.line,column:e.column,offset:e.offset}}function wae(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?wae(e,r):sct(e,r)}}function sct(e,t){let n;for(n in t)if(bae.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function wW(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+lv({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+lv({start:t.start,end:t.end}
vendor: 4,537 bytes, lines 874-878
874)+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+lv({start:t.start,end:t.end})+") is still open")}function act(e){const t=this;t.parser=n;function n(r){return rct(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function oct(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function lct(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
875`}]}function cct(e,t){const n=t.value?t.value+`
876`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function uct(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dct(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hct(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ag(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function fct(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pct(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function jae(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function mct(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return jae(e,t);const i={src:Ag(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function gct(e,t){const n={src:Ag(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function yct(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function vct(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return jae(e,t);const i={href:Ag(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function xct(e,t){const n={href:Ag(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function bct(e,t,n){const r=e.all(t),i=n?wct(n):_ae(t),a={},o=[];if(typeof t.checked=="boolean"){const d=r[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const d=r[l];(i||l!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
877`}),d.type==="element"&&d.tagName==="p"&&!i?o.push(...d.children):o.push(d)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
878`});const u={type:"element",tagName:"li",properties:a,children:o};
vendor: 3,273 bytes, line 878
878return e.patch(t,u),e.applyData(t,u)}function wct(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=_ae(n[r])}return t}function _ae(e){const t=e.spread;return t??e.children.length>1}function jct(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function _ct(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Sct(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function kct(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nct(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=b$(t.children[1]),c=nae(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Cct(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const u=[];for(;++c<l;){const h=t.children[c],f={},p=o?o[c]:void 0;p&&(f.align=p);let m={type:"element",tagName:a,properties:f,children:[]};h&&(m.children=e.all(h),e.patch(h,m),m=e.applyData(h,m)),u.push(m)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function Act(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const jW=9,_W=32;function Tct(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(SW(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(SW(t.slice(i),i>0,!1)),a.join("")}function SW(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===jW||a===_W;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===jW||a===_W;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Ect(e,t){const n={type:"text",value:Tct(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Pct(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Oct={blockquote:oct,break:lct,code:cct,delete:uct,emphasis:dct,footnoteReference:hct,heading:fct,html:pct,imageReference:mct,image:gct,inlineCode:yct,linkReference:vct,link:xct,listItem:bct,list:jct,paragraph:_ct,root:Sct,strong:kct,table:Nct,tableCell:Act,tableRow:Cct,text:Ect,thematicBreak:Pct,toml:tw,yaml:tw,definition:tw,footnoteDefinition:tw};function tw(){}const Sae=-1,Bk=0,uv=1,d_=2,C$=3,A$=4,T$=5,E$=6,kae=7,Nae=8,kW=typeof self=="object"?self:globalThis,Ict=(e,t)=>
vendor: 4,226 bytes, line 878
878{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case Bk:case Sae:return n(o,i);case uv:{const l=n([],i);for(const c of o)l.push(r(c));return l}case d_:{const l=n({},i);for(const[c,u]of o)l[r(c)]=r(u);return l}case C$:return n(new Date(o),i);case A$:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case T$:{const l=n(new Map,i);for(const[c,u]of o)l.set(r(c),r(u));return l}case E$:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case kae:{const{name:l,message:c}=o;return n(new kW[l](c),i)}case Nae:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(new kW[a](o),i)};return r},NW=e=>Ict(new Map,e)(0),vf="",{toString:Rct}={},{keys:Dct}=Object,fy=e=>{const t=typeof e;if(t!=="object"||!e)return[Bk,t];const n=Rct.call(e).slice(8,-1);switch(n){case"Array":return[uv,vf];case"Object":return[d_,vf];case"Date":return[C$,vf];case"RegExp":return[A$,vf];case"Map":return[T$,vf];case"Set":return[E$,vf];case"DataView":return[uv,n]}return n.includes("Array")?[uv,n]:n.includes("Error")?[kae,n]:[d_,n]},nw=([e,t])=>e===Bk&&(t==="function"||t==="symbol"),Mct=(e,t,n,r)=>{const i=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},a=o=>{if(n.has(o))return n.get(o);let[l,c]=fy(o);switch(l){case Bk:{let d=o;switch(c){case"bigint":l=Nae,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([Sae],o)}return i([l,d],o)}case uv:{if(c){let f=o;return c==="DataView"?f=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(f=new Uint8Array(o)),i([c,[...f]],o)}const d=[],h=i([l,d],o);for(const f of o)d.push(a(f));return h}case d_:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const d=[],h=i([l,d],o);for(const f of Dct(o))(e||!nw(fy(o[f])))&&d.push([a(f),a(o[f])]);return h}case C$:return i([l,o.toISOString()],o);case A$:{const{source:d,flags:h}=o;return i([l,{source:d,flags:h}],o)}case T$:{const d=[],h=i([l,d],o);for(const[f,p]of o)(e||!(nw(fy(f))||nw(fy(p))))&&d.push([a(f),a(p)]);return h}case E$:{const d=[],h=i([l,d],o);for(const f of o)(e||!nw(fy(f)))&&d.push(a(f));return h}}const{message:u}=o;return i([l,{name:c,message:u}],o)};return a},CW=(e,{json:t,lossy:n}={})=>{const r=[];return Mct(!(t||n),!!t,new Map,r)(e),r},h_=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?NW(CW(e,t)):structuredClone(e):(e,t)=>NW(CW(e,t));function $ct(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Lct(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Fct(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||$ct,r=e.options.footnoteBackLabel||Lct,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const d=e.all(u),h=String(u.identifier).toUpperCase(),f=Ag(h.toLowerCase());let p=0;const m=[],g=e.footnoteCounts.get(h);for(;g!==void 0&&++p<=g;){m.length>0&&m.push({type:"text",value:" "});let v=typeof n=="string"?n:n(c,p);typeof v=="string"&&(v={type:"text",value:v}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const y=d[d.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const v=y.children[y.children.length-1];v&&v.type==="text"?v.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...m)}else d.push(...m);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(d,!0)};e.patch(u,b),l.push(b)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]}
vendor: 17,846 bytes, lines 878-884
878,children:[{type:"element",tagName:a,properties:{...h_(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
879`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
880`}]}}const Vk=function(e){if(e==null)return Wct;if(typeof e=="function")return Wk(e);if(typeof e=="object")return Array.isArray(e)?zct(e):Bct(e);if(typeof e=="string")return Vct(e);throw new Error("Expected function, string, or object as test")};function zct(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Vk(e[n]);return Wk(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Bct(e){const t=e;return Wk(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Vct(e){return Wk(t);function t(n){return n&&n.type===e}}function Wk(e){return t;function t(n,r,i){return!!(Uct(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Wct(){return!0}function Uct(e){return e!==null&&typeof e=="object"&&"type"in e}const Cae=[],qct=!0,vO=!1,Hct="skip";function Aae(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Vk(i),o=r?-1:1;l(e,void 0,[])();function l(c,u,d){const h=c&&typeof c=="object"?c:{};if(typeof h.type=="string"){const p=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(c.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=Cae,m,g,y;if((!t||a(c,u,d[d.length-1]||void 0))&&(p=Kct(n(c,d)),p[0]===vO))return p;if("children"in c&&c.children){const b=c;if(b.children&&p[0]!==Hct)for(g=(r?b.children.length:-1)+o,y=d.concat(b);g>-1&&g<b.children.length;){const v=b.children[g];if(m=l(v,g,y)(),m[0]===vO)return m;g=typeof m[1]=="number"?m[1]:g+o}}return p}}}function Kct(e){return Array.isArray(e)?e:typeof e=="number"?[qct,e]:e==null?Cae:[e]}function P$(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Aae(e,a,l,i);function l(c,u){const d=u[u.length-1],h=d?d.children.indexOf(c):void 0;return o(c,h,d)}}const xO={}.hasOwnProperty,Gct={};function Yct(e,t){const n=t||Gct,r=new Map,i=new Map,a=new Map,o={...Oct,...n.handlers},l={all:u,applyData:Xct,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:Qct,wrap:Jct};return P$(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const h=d.type==="definition"?r:i,f=String(d.identifier).toUpperCase();h.has(f)||h.set(f,d)}}),l;function c(d,h){const f=d.type,p=l.handlers[f];if(xO.call(l.handlers,f)&&p)return p(l,d,h);if(l.options.passThrough&&l.options.passThrough.includes(f)){if("children"in d){const{children:g,...y}=d,b=h_(y);return b.children=l.all(d),b}return h_(d)}return(l.options.unknownHandler||Zct)(l,d,h)}function u(d){const h=[];if("children"in d){const f=d.children;let p=-1;for(;++p<f.length;){const m=l.one(f[p],d);if(m){if(p&&f[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=AW(m.value)),!Array.isArray(m)&&m.type==="element")){const g=m.children[0];g&&g.type==="text"&&(g.value=AW(g.value))}Array.isArray(m)?h.push(...m):h.push(m)}}}return h}}function Qct(e,t){e.position&&(t.position=Lat(e))}function Xct(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,h_(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Zct(e,t){const n=t.data||{},r="value"in t&&!(xO.call(n,"hProperties")||xO.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Jct(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
881`});++r<e.length;)r&&n.push({type:"text",value:`
882`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
883`}),n}function AW(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function TW(e,t){const n=Yct(e,t),r=n.one(e,void 0),i=Fct(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
884`},i),a}function eut(e,t){return e&&"run"in e?async function(n,r){const i=TW(n,{file:r,...t});await e.run(i,r)}:function(n,r){return TW(n,{file:r,...e||t})}}function EW(e){if(e)throw e}var qw=Object.prototype.hasOwnProperty,Tae=Object.prototype.toString,PW=Object.defineProperty,OW=Object.getOwnPropertyDescriptor,IW=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Tae.call(t)==="[object Array]"},RW=function(t){if(!t||Tae.call(t)!=="[object Object]")return!1;var n=qw.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&qw.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||qw.call(t,i)},DW=function(t,n){PW&&n.name==="__proto__"?PW(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},MW=function(t,n){if(n==="__proto__")if(qw.call(t,n)){if(OW)return OW(t,n).value}else return;return t[n]},tut=function e(){var t,n,r,i,a,o,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=MW(l,n),i=MW(t,n),l!==i&&(d&&i&&(RW(i)||(a=IW(i)))?(a?(a=!1,o=r&&IW(r)?r:[]):o=r&&RW(r)?r:{},DW(l,{name:n,newValue:e(d,o,i)})):typeof i<"u"&&DW(l,{name:n,newValue:i}));return l};const PA=Ot(tut);function bO(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function nut(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...i);function l(c,...u){const d=e[++a];let h=-1;if(c){o(c);return}for(;++h<i.length;)(u[h]===null||u[h]===void 0)&&(u[h]=i[h]);i=u,d?rut(d,l)(...u):o(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function rut(e,t){let n;return r;function r(...o){const l=e.length>o.length;let c;l&&o.push(i);try{c=e.apply(this,o)}catch(u){const d=u;if(l&&n)throw d;return i(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(o,...l){n||(n=!0,t(o,...l))}function a(o){i(null,o)}}const Po={basename:iut,dirname:sut,extname:aut,join:out,sep:"/"};function iut(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vb(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function sut(e){if(Vb(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function aut(e){Vb(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function out(...e){let t=-1,n;for(;++t<e.length;)Vb(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":lut(n)}function lut(e){Vb(e);const t=e.codePointAt(0)===47;let n=cut(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function cut(e,t){let n="",r=0,i=-1,a=0,o=-1,l,c;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function Vb(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const uut={cwd:dut};function dut(){return"/"}function wO(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function hut(e){if(typeof e=="string")e=new URL(e);else if(!wO(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return fut(e)}function fut(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const OA=["history","path","basename","stem","extname","dirname"];class Eae{constructor(t){let n;t?wO(t)?n={path:t}:typeof t=="string"||put(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":uut.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<OA.length;){const a=OA[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)OA.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Po.basename(this.path):void 0}set basename(t){RA(t,"basename"),IA(t,"basename"),this.path=Po.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Po.dirname(this.path):void 0}set dirname(t){$W(this.basename,"dirname"),this.path=Po.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Po.extname(this.path):void 0}set extname(t){if(IA(t,"extname"),$W(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Po.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){wO(t)&&(t=hut(t)),RA(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Po.basename(this.path,this.extname):void 0}set stem(t){RA(t,"stem"),IA(t,"stem"),this.path=Po.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Si(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function IA(e,t){if(e&&e.includes(Po.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Po.sep+"`")}function RA(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function $W(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function put(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mut=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},gut={}.hasOwnProperty;class O$ extends mut{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=nut()}copy(){const t=new O$;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(PA(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?($A("data",this.frozen),this.namespace[t]=n,this):gut.call(this.namespace,t)&&this.namespace[t]||void 0:t?($A("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=rw(t),r=this.parser||this.Parser;return DA("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),DA("process",this.parser||this.Parser),MA("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const l=rw(t),c=r.parse(l);r.run(c,l,function(d,h,f){if(d||!h||!f)return u(d);const p=h,m=r.stringify(p,f);xut(m)?f.value=m:f.result=m,u(d,f)});function u(d,h){d||!h?o(d):a?a(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),DA("processSync",this.parser||this.Parser),MA("processSync",this.compiler||this.Compiler),this.process(t,i),FW("processSync","process",n),r;function i(a,o){n=!0,EW(a),r=o}}run(t,n,r){LW(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,l){const c=rw(n);i.run(t,c,u);function u(d,h,f){const p=h||t;d?l(d):o?o(p):r(void 0,p,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),FW("runSync","run",r),i;function a(o,l){EW(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=rw(n),i=this.compiler||this.Compiler;return MA("stringify",i),LW(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if($A("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...h]=u;c(d,h)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(i.settings=PA(!0,i.settings,u.settings))}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const h=u[d];a(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let h=-1,f=-1;for(;++h<r.length;)if(r[h][0]===u){f=h;break}if(f===-1)r.push([u,...d]);else if(d.length>0){let[p,...m]=d;const g=r[f][1];bO(g)&&bO(p)&&(p=PA(!0,g,p)),r[f]=[u,p,...m]}}}}const yut=new O$().freeze();function DA(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function MA(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $A(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function LW(e){if(!bO(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function FW(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function rw(e){return vut(e)?e:new Eae(e)}function vut(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xut(e){return typeof e=="string"||but(e)}function but(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wut="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",zW=[],BW={allowDangerousHtml:!0},jut=/^(https?|ircs?|mailto|xmpp)$/i,_ut=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Pae(e){const t=Sut(e),n=kut(e);return Nut(t.runSync(t.parse(n),n),e)}function Sut(e){const t=e.rehypePlugins||zW,n=e.remarkPlugins||zW,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...BW}:BW;return yut().use(act).use(n).use(eut,r).use(t)}function kut(e){const t=e.children||"",n=new Eae;return typeof t=="string"&&(n.value=t),n}function Nut(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||
884Cut;for(const d of _ut)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+wut+d.id,void 0);return P$(e,u),Wat(e,{Fragment:s.Fragment,components:i,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function u(d,h,f){if(d.type==="raw"&&f&&typeof h=="number")return o?f.children.splice(h,1):f.children[h]={type:"text",value:d.value},h;if(d.type==="element"){let p;for(p in AA)if(Object.hasOwn(AA,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],g=AA[p];(g===null||g.includes(d.tagName))&&(d.properties[p]=c(String(m||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!p&&r&&typeof h=="number"&&(p=!r(d,h,f)),p&&f&&typeof h=="number")return l&&d.children?f.children.splice(h,1,...d.children):f.children.splice(h,1),h}}}function Cut(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||jut.test(e.slice(0,t))?e:""}function Aut(e){var u,d;const t=Ae(),{data:n}=oi(),r=(u=n==null?void 0:n.buyerUser)==null?void 0:u.id,i=Ye(),a=Se({queryKey:["asset-chat",e,r],queryFn:async()=>{const{data:h,error:f}=await W.from("asset_chat_conversations").select("id").eq("asset_id",e).eq("buyer_user_id",r).maybeSingle();if(f)throw f;if(!h)return null;const{data:p,error:m}=await W.from("asset_chat_messages").select("id, role, content, sources, created_at").eq("conversation_id",h.id).order("created_at",{ascending:!0});if(m)throw m;return{id:h.id,messages:(p||[]).map(g=>({...g,role:g.role,sources:g.sources||[]}))}},enabled:!!e&&!!r}),o=$e({mutationFn:async({message:h})=>{var m;const{data:f,error:p}=await W.functions.invoke("asset-chat",{body:{assetId:e,message:h,conversationId:(m=a.data)==null?void 0:m.id,buyerUserId:r}});if(p)throw new Error(p.message||"Failed to send message");if(f!=null&&f.error)throw new Error(f.error);return{...f,message:h}},onSuccess:({conversationId:h,messagesUsed:f,message:p,answer:m,sources:g})=>{t.invalidateQueries({queryKey:["asset-chat",e,r]}),i({action:"ask_asset_question",entityType:Ve.assetChatConversations,entityId:h,entityLabel:p.slice(0,200),metadata:{asset_id:e,messages_used:f,message_length:p.length,sources:g,answer_preview:m.slice(0,300)}})}}),l=$e({mutationFn:async()=>{var m;const h=(m=a.data)==null?void 0:m.id;if(!h)return null;const{error:f}=await W.from("asset_chat_messages").delete().eq("conversation_id",h);if(f)throw f;const{error:p}=await W.from("asset_chat_conversations").delete().eq("id",h);if(p)throw p;return h},onSuccess:h=>{t.invalidateQueries({queryKey:["asset-chat",e,r]}),gi.success("Conversation cleared"),h&&i({action:"clear_asset_chat",entityType:Ve.assetChatConversations,entityId:h,metadata:{asset_id:e}})},onError:()=>{gi.error("Failed to clear conversation")}}),c=(((d=a.data)==null?void 0:d.messages)||[]).filter(h=>h.role==="user").length;return{conversation:a.data,isLoading:a.isLoading,sendMessage:o,clearConversation:l,userMessageCount:c,maxMessages:10}}const Tut=["What is the competitive landscape?","Summarize the clinical data","What IP protection exists?"];function VW(){return s.jsx("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"12px 4px"},children:[0,1,2].map(e=>s.jsx("span",{className:"animate-bounce",style:{height:7,width:7,borderRadius:"50%",background:"hsl(var(--c-accent))",opacity:.6,animationDelay:`${e*150}ms`,animationDuration:"0.8s"}},e))})}function Eut({assetId:e}){var k;const{data:t}=oi(),n=!!((k=t==null?void 0:t.buyerUser)!=null&&k.id),{conversation:r,isLoading:i,sendMessage:a,clearConversation:o,userMessageCount:l,maxMessages:c}=Aut(e),[u,d]=x.useState(""),[h,f]=x.useState(!1),p=x.useRef(null),m=x.useRef(null),g=(r==null?void 0:r.messages)||[],y=a.isPending,b=o.isPending,v=l>=c,w=l/c*100;x.useEffect(()=>{const N=p.current;N&&(N.scrollTop=N.scrollHeight)},[g.length,y]),x.useEffect(()=>{const N=m.current;N&&(N.style.height="auto",N.style.height=Math.min(N.scrollHeight,160)+"px")},[u]);const _=N=>{const T=(N||u).trim();!T||y||v||(N||d(""),a.mutate({message:T}))},j=N=>{N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),_())},S=()=>
884{if(!h){f(!0);return}o.mutate(),f(!1)};return n?i?s.jsxs("div",{className:"xph-card",style:{padding:16},children:[s.jsx(ce,{className:"h-6 w-48 mb-3"}),s.jsx(ce,{className:"h-24 w-full"})]}):s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 16px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:26,height:26,borderRadius:6,background:"hsl(var(--c-ink))",color:"hsl(var(--c-ink-inverse))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(Cn,{size:13})}),s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",style:{fontSize:15},children:"Asset Chat"}),s.jsx("div",{className:"eyebrow",children:"Grounded in the data room"})]})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontFamily:"var(--font-mono)",fontSize:10.5,color:"hsl(var(--c-fg-subtle))",textTransform:"uppercase",letterSpacing:"0.06em"},children:[s.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:y?"hsl(var(--c-warning))":"hsl(var(--c-positive))"}}),y?"Streaming":"Ready"]}),g.length>0&&s.jsx(s.Fragment,{children:h?s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[s.jsx("span",{className:"tt-meta",style:{color:"hsl(var(--c-fg-muted))"},children:"Clear?"}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-sm",onClick:S,disabled:b,style:{background:"hsl(var(--c-negative))",color:"white",borderColor:"hsl(var(--c-negative))",padding:"3px 8px",fontSize:11.5},children:"Yes"}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:()=>f(!1),style:{padding:"3px 8px",fontSize:11.5},children:"No"})]}):s.jsxs("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:S,style:{padding:"4px 8px",fontSize:11.5},"aria-label":"Clear conversation",children:[s.jsx(NI,{size:11}),"Clear"]})})]})]}),s.jsxs("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:16},children:[g.length>0&&s.jsxs("div",{ref:p,style:{display:"flex",flexDirection:"column",gap:18,maxHeight:500,overflowY:"auto",paddingRight:4},children:[g.map((N,T)=>s.jsx("div",{className:"animate-in fade-in-0 slide-in-from-bottom-2 duration-300",style:{display:N.role==="user"?"flex":"block",justifyContent:N.role==="user"?"flex-end":void 0,animationDelay:`${T*30}ms`},children:N.role==="user"?s.jsx("div",{style:{maxWidth:"85%",borderRadius:14,background:"hsl(var(--c-ink))",color:"hsl(var(--c-ink-inverse))",padding:"10px 14px",fontSize:13.5,lineHeight:1.5,whiteSpace:"pre-wrap"},children:N.content}):s.jsxs("div",{style:{display:"flex",gap:10},children:[s.jsx("div",{style:{width:2,flexShrink:0,borderRadius:1,background:"linear-gradient(to bottom, hsl(var(--c-accent) / 0.5), hsl(var(--c-accent) / 0.05))",marginTop:4}}),s.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:8},children:[s.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",style:{fontSize:13.5,color:"hsl(var(--c-fg))",lineHeight:1.55},children:s.jsx(Pae,{children:N.content})}),N.sources.length>0&&s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,paddingTop:4},children:N.sources.map((C,A)=>s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:4,fontFamily:"var(--font-mono)",fontSize:10.5,background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-fg-muted))"},children:[s.jsx(zde,{size:9}),C]},A))})]})]})},N.id)),y&&s.jsxs("div",{className:"animate-in fade-in-0 duration-200",style:{display:"flex",gap:10},children:[s.jsx("div",{style:{width:2,flexShrink:0,borderRadius:1,background:"linear-gradient(to bottom, hsl(var(--c-accent) / 0.5), hsl(var(--c-accent) / 0.05))"}}),s.jsx(VW,{})]}),a.isError&&!y&&s.jsxs("div",{className:"animate-in fade-in-0 duration-200",style:{display:"flex",gap:10},children:[s.jsx("div",{style:{width:2,flexShrink:0,borderRadius:1,background:"hsl(var(--c-negative) / 0.5)",marginTop:4}}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",borderRadius:8,border:"1px solid hsl(var(--c-negative))",background:"hsl(var(--c-negative-soft))",flex:1},children:[s.jsx(ir,{size:14,style:{color:"hsl(var(--c-negative-fg))",flexShrink:0}}),s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg))"},children:"Couldn't get a response."}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",style:{marginLeft:"auto",padding:"4px 10px",fontSize:11.5},onClick:()=>{var T;const N=(T=a.variables)==null?void 0:T.message;N&&a.mutate({message:N})},children:"Try again"})]})]})]}),g.length===0&&!y&&s.jsxs("div",{style:{textAlign:"center",padding:"24px 0",display:"flex",flexDirection:"column",gap:14},children:[s.jsx("div",{style:{width:44,height:44,borderRadius:10,margin:"0 auto",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))"},children:s.jsx(Cn,{size:20})}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",maxWidth:360,margin:"0 auto"},children:"Ask questions about clinical data, IP position, competitive landscape, and more."}),s.jsx("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:6},children:Tut.map(N=>s.jsx("button",{type:"button",onClick:()=>_(N),style:{padding:"5px 12px",borderRadius:9999,border:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-surface))",fontSize:11.5,color:"hsl(var(--c-fg-muted))",cursor:"pointer",transition:"all 150ms"},onMouseEnter:T=>{T.currentTarget.style.borderColor="hsl(var(--c-accent-border))",T.currentTarget.style.background="hsl(var(--c-accent-soft))",T.currentTarget.style.color="hsl(var(--c-accent))"},onMouseLeave:T=>{T.currentTarget.style.borderColor="hsl(var(--c-border))",T.currentTarget.style.background="hsl(var(--c-surface))",T.currentTarget.style.color="hsl(var(--c-fg-muted))"},children:N},N))})]}),g.length===0&&y&&s.jsxs("div",{className:"animate-in fade-in-0 duration-200",style:{display:"flex",gap:10,padding:"12px 0"},children:[s.jsx("div",{style:{width:2,flexShrink:0,borderRadius:1,background:"linear-gradient(to bottom, hsl(var(--c-accent) / 0.5), hsl(var(--c-accent) / 0.05))"}}),s.jsx(VW,{})]}),g.length===0&&a.isError&&!y&&s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",borderRadius:8,border:"1px solid hsl(var(--c-negative))",background:"hsl(var(--c-negative-soft))"},children:[s.jsx(ir,{size:14,style:{color:"hsl(var(--c-negative-fg))",flexShrink:0}}),s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg))"},children:"Couldn't get a response."}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",style:{marginLeft:"auto",padding:"4px 10px",fontSize:11.5},onClick:()=>{var T;const N=(T=a.variables)==null?void 0:T.message;N&&a.mutate({message:N})},children:"Try again"})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsxs("div",{style:{position:"relative"},children:[s.jsx("textarea",{ref:m,value:u,onChange:N=>d(N.target.value),onKeyDown:j,placeholder:v?"Question limit reached":"Ask a question…",rows:1,disabled:y||v,style:{width:"100%",resize:"none",borderRadius:10,border:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-card))",padding:"10px 44px 10px 14px",fontSize:13.5,fontFamily:"inherit",lineHeight:1.5,color:"hsl(var(--c-fg))",outline:"none",opacity:y||v?.55:1,cursor:y||v?"not-allowed":"text",transition:"border-color 150ms, box-shadow 150ms"},onFocus:N=>{N.currentTarget.style.borderColor="hsl(var(--c-accent))",N.currentTarget.style.boxShadow="0 0 0 3px hsl(var(--c-accent-soft))"},onBlur:N=>{N.currentTarget.style.borderColor="hsl(var(--c-border))",N.currentTarget.style.boxShadow="none"}}),s.jsx("button",{type:"button",onClick:()=>_(),disabled:!u.trim()||y||v,className:"xph-btn xph-btn-primary",style:{position:"absolute",right:6,bottom:6,padding:6,width:30,height:30,borderRadius:6},"aria-label":"Send",children:s.jsx(Bp,{size:13})})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx("div",{style:{flex:1,height:3,borderRadius:2,background:"hsl(var(--c-surface-2))",overflow:"hidden"},children:s.jsx("div",{style:{height:"100%",width:`${w}%`,background:"hsl(var(--c-accent))",transition:"width 200ms"}})}
884),s.jsxs("span",{className:"tt-mono-sm",style:{fontSize:10,color:"hsl(var(--c-fg-subtle))"},children:[l,"/",c]})]})]})]})]}):s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 16px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:26,height:26,borderRadius:6,background:"hsl(var(--c-ink))",color:"hsl(var(--c-ink-inverse))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(Cn,{size:13})}),s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",style:{fontSize:15},children:"Asset Chat"}),s.jsx("div",{className:"eyebrow",children:"Grounded in the data room"})]})]}),s.jsx("div",{style:{padding:28,textAlign:"center"},children:s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"Select a buyer to view their chat."})})]})}function Put(e){return Se({queryKey:["buyer-asset-documents",e],enabled:!!e,queryFn:async()=>{const{data:t,error:n}=await W.from("data_room_documents").select("id, file_name, file_path, file_size, mime_type, category_code, subcategory_code, status").eq("asset_id",e).eq("is_confidential",!1).order("category_code",{ascending:!0});if(n)throw n;return(t||[]).map(r=>({id:r.id,fileName:r.file_name,filePath:r.file_path,fileSize:r.file_size,mimeType:r.mime_type,categoryCode:r.category_code,subcategoryCode:r.subcategory_code,status:r.status}))}})}function Oae({asset:e,backLink:t,hideSupplierCard:n,disableBuyerActions:r,titleBadge:i,notice:a,valuationFrom:o="buyer"}){var v;const{data:l=[],isLoading:c}=Put(e.id),{data:u=[]}=FM(),d=x.useMemo(()=>{const w=new Map;return u.forEach(_=>w.set(_.code,_.name)),w},[u]),h=async(w,_)=>{try{const{data:j,error:S}=await W.storage.from("supplier-documents").download(w);if(S)throw S;const k=URL.createObjectURL(j),N=document.createElement("a");N.href=k,N.download=_,N.click(),URL.revokeObjectURL(k)}catch{gi.error("Failed to download file")}},f=async w=>{try{const{data:_,error:j}=await W.storage.from("supplier-documents").createSignedUrl(w,300);if(j)throw j;window.open(_.signedUrl,"_blank")}catch{gi.error("Failed to preview file")}},p=ds(e.estimatedNPV),m=new Date(e.listedAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),g=w=>w>=1e6?`${(w/1e6).toFixed(1)} MB`:w>=1e3?`${(w/1e3).toFixed(0)} KB`:`${w} B`,y=ea[e.stage],b=[["Modality",Zt[e.modality],e.therapeuticArea??"—"],["Stage",Nn[e.stage],e.clinicalPhase??"Pipeline"],["Indication",e.leadIndication??"—",e.unmetMedicalNeed?"Unmet need on file":"—"],["Documents",String(e.documentsCount),"in data room"],["Listed",new Date(e.listedAt).toLocaleDateString("en-US",{month:"short",year:"numeric"}),e.supplier.verified?"verified supplier":"verification pending"]];return s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))"},children:s.jsxs("div",{className:"xph-container",style:{padding:"12px 24px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,flexWrap:"wrap"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,fontSize:13,color:"hsl(var(--c-fg-muted))",flexWrap:"wrap"},children:[s.jsxs(oe,{to:t.to,style:{color:"hsl(var(--c-fg-muted))",textDecoration:"none",display:"inline-flex",alignItems:"center",gap:4},children:[s.jsx(Wt,{size:12}),t.label]}),s.jsx(Us,{size:12}),s.jsx("span",{children:e.primaryTarget??"—"}),s.jsx(Us,{size:12}),s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:e.productName})]}),s.jsxs("div",{style:{display:"flex",gap:6},children:[r?s.jsxs(Rv,{children:[s.jsxs(ni,{children:[s.jsx(ri,{asChild:!0,children:s.jsx("span",{tabIndex:0,children:s.jsx("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",disabled:!0,style:{pointerEvents:"none"},children:"Save"})})}),s.jsx(Kr,{children:"Buyer-only action"})]}),s.jsxs(ni,{children:[s.jsx(ri,{asChild:!0,children:s.jsx("span",{tabIndex:0,children:s.jsx("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",disabled:!0,style:{pointerEvents:"none"},children:"Inquire"})})}),s.jsx(Kr,{children:"Buyer-only action"})]})]}):s.jsxs(s.Fragment,{children:[s.jsx(Kse,{assetId:e.id}),s.jsx(g$,{assetId:e.id,assetName:e.productName}),s.jsx($k,{assetId:e.id,assetName:e.productName})]}),s.jsxs(oe,{to:`/valuation?asset=${e.id}&from=${o}`,className:"xph-btn xph-btn-primary xph-btn-sm",children:[s.jsx(_I,{size:13}),"Valuation"]})]})]})}),s.jsxs("div",{className:"xph-container",style:{padding:"0 24px"},children:[a&&s.jsx("div",{style:{paddingTop:24},children:a}),s.jsxs("div",{style:{padding:"32px 0 24px"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",gap:24,flexWrap:"wrap"},children:[s.jsxs("div",{style:{minWidth:0},children:[s.jsxs("div",{className:"eyebrow",children:[e.primaryTarget??"—"," ·"," ",((v=e.leadIndication)==null?void 0:v.toLowerCase())??"pipeline asset"," ·"," ",Zt[e.modality].toLowerCase()]}),s.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:14,marginTop:8,flexWrap:"wrap"},children:[s.jsx("h1",{className:"tt-display-lg",children:e.productName}),i,s.jsx("span",{className:`xph-badge ${y}`,children:Nn[e.stage]}),e.supplier.verified&&s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-positive-fg))",background:"hsl(var(--c-positive-soft))",border:"1px solid hsl(var(--c-positive-border))",borderRadius:4,padding:"3px 8px",letterSpacing:"0.04em",textTransform:"uppercase"},children:[s.jsx(Fr,{size:11})," Verified"]})]}),s.jsx("p",{className:"tt-lead",style:{maxWidth:720,marginTop:12,color:"hsl(var(--c-fg-muted))"},children:e.leadIndication})]}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Estimated NPV"}),s.jsx("div",{className:"tt-stat-xl",style:{marginTop:6},children:p}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:4},children:"Risk-adjusted P50"})]})]}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 180px), 1fr))",gap:12,marginTop:24},children:b.map(([w,_,j])=>s.jsxs("div",{className:"xph-card",style:{padding:"14px 16px"},children:[s.jsx("div",{className:"eyebrow",children:w}),s.jsx("div",{className:"tt-stat-md",style:{marginTop:6,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:_}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:3},children:j})]},w))})]}),s.jsxs("div",{style:{paddingBottom:64,display:"grid",gridTemplateColumns:"minmax(0, 1.6fr) minmax(0, 1fr)",gap:16},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,minWidth:0},children:[r?s.jsxs("div",{className:"xph-card",style:{padding:18},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:26,height:26,borderRadius:6,background:"hsl(var(--c-ink))",color:"hsl(var(--c-ink-inverse))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(Cn,{size:13})}),s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",style:{fontSize:15},children:"AI Chat (buyer view)"}),s.jsx("div",{className:"eyebrow",children:"Preview only"})]})]}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:12},children:"Buyers see an interactive AI chat here that answers questions about your asset using your data room. Chat is disabled in preview mode to keep your real buyer chat history clean."})]}):s.jsx(Eut,{assetId:e.id}),s.jsx(Fst,{asset:e}),s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 16px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",alignItems:"center",gap:10},children:[s.jsx(ti,{size:15,style:{color:"hsl(var(--c-fg-muted))"}}),s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",style:{fontSize:15},children:"Available documents"}),s.jsxs("div",{className:"eyebrow",children:[l.length," non-confidential file",l.length===1?"":"s"]})]})]}),s.jsx("div",{style:{padding:12},children:c?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[...Array(3)].map((w,_)=>s.jsx(ce,{className:"h-12 w-full"},_))}):l.length===0?s.jsxs("div",{style:{textAlign:"center",padding:"32px 0"},children:[s.jsx(ti,{size:28,style:{margin:"0 auto 12px",color:"hsl(var(--c-fg-subtle))",opacity:.4,display:"block"}}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"No documents available for this asset"}),s.jsx("p",{className:"tt-meta",style:{color:"hsl(var(--c-fg-subtle))",marginTop:4},children:"The supplier has not shared any non-confidential documents yet."})]}):s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:l.map(w=>s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",borderRadius:8,border:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-card))",transition:"background 150ms"},onMouseEnter:_=>{_.currentTarget.style.background="hsl(var(--c-surface))"},onMouseLeave:_=>{_.currentTarget.style.background="hsl(var(--c-card))"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[s.jsx(ti,{size:14,style:{color:"hsl(var(--c-fg-muted))",flexShrink:0}}),s.jsxs("div",{style:{minWidth:0},children:[s.jsx("p",{className:"tt-body-sm",style:{fontWeight:500,color:"hsl(var(--c-ink))",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:w.fileName}),s.jsxs("p",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:[g(w.fileSize),w.categoryCode&&` · ${d.get(w.categoryCode)||`Category ${w.categoryCode}`}`,w.subcategoryCode&&` › ${d.get(w.subcategoryCode)||w.subcategoryCode}`]})]})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0},children:[s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>f(w.filePath),"aria-label":"Preview",children:s.jsx(Na,{size:14})}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>h(w.filePath,w.fileName),"aria-label":"Download",children:s.jsx(Rl,{size:14})})]})]},w.id))})})]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,position:"sticky",top:80,al
884ignSelf:"flex-start"},children:[s.jsxs("div",{className:"xph-card",style:{padding:18},children:[s.jsx("div",{className:"eyebrow",children:"Valuation"}),s.jsxs("div",{style:{marginTop:12,padding:"20px 16px",borderRadius:8,background:"hsl(var(--c-surface))",textAlign:"center",border:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-muted))",marginBottom:4},children:"Estimated NPV"}),s.jsx("div",{className:"tt-stat-xl",style:{color:"hsl(var(--c-accent))"},children:p}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:4},children:"Risk-adjusted P50"})]}),s.jsxs(oe,{to:`/valuation?asset=${e.id}&from=${o}`,className:"xph-btn xph-btn-primary",style:{width:"100%",marginTop:12},children:["View full valuation",s.jsx(tc,{size:13})]})]}),!n&&s.jsxs("div",{className:"xph-card",style:{padding:16},children:[s.jsx("div",{className:"eyebrow",children:"Counterparty"}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:10},children:[s.jsx("span",{style:{width:36,height:36,borderRadius:8,background:"hsl(var(--c-ink))",color:"hsl(var(--c-ink-inverse))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:600,flexShrink:0},children:e.supplier.name.split(" ").map(w=>w[0]).slice(0,2).join("").toUpperCase()}),s.jsxs("div",{style:{minWidth:0},children:[s.jsx("div",{style:{fontWeight:600,fontSize:14,color:"hsl(var(--c-ink))",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.supplier.name}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:e.supplier.location})]})]}),s.jsxs("div",{style:{marginTop:14,paddingTop:14,borderTop:"1px solid hsl(var(--c-border))",display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Verification"}),s.jsx("div",{className:"tt-body-sm",style:{marginTop:4,color:e.supplier.verified?"hsl(var(--c-positive-fg))":"hsl(var(--c-warning-fg))",fontWeight:500},children:e.supplier.verified?"Verified":"Pending"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Listings"}),s.jsx("div",{className:"tt-body-sm",style:{marginTop:4,color:"hsl(var(--c-ink))",fontWeight:500},children:e.supplier.assetsListed})]})]})]}),s.jsxs("div",{className:"xph-card",style:{padding:16},children:[s.jsx("div",{className:"eyebrow",children:"Details"}),s.jsxs("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:10,fontSize:13},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))"},children:"Stage"}),s.jsx("span",{className:`xph-badge ${y}`,children:Nn[e.stage]})]}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))"},children:"Modality"}),s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:Zt[e.modality]})]}),e.origin&&s.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))"},children:"Origin"}),s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:e.origin})]}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))"},children:"Documents"}),s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,color:"hsl(var(--c-ink))",fontWeight:500},children:[s.jsx(ti,{size:11}),e.documentsCount]})]}),s.jsxs("div",{style:{paddingTop:10,borderTop:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between"},children:[s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))"},children:"Listed"}),s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:m})]})]})]})]})]})]})]})}function Out(){const{id:e}=Zs(),[t]=il(),n=t.get("from"),{user:r,isLoading:i}=me(),{data:a,isLoading:o}=An(),{isOwnAsset:l,profileReady:c}=Mk(),u=Ye(),{data:d,isLoading:h}=Tst(e),f=!!d&&l(d.supplier.id),{data:p}=fS(f&&e||""),m=x.useRef(!1);x.useEffect(()=>{m.current||!r||!d||!c||(m.current=!0,u({action:f?"market_preview_own_asset":"market_preview_competitor",entityType:Ve.pharmaAssets,entityId:d.id,entityLabel:f?d.productName:"Undisclosed Asset",metadata:{surface:"supplier_market_preview",own:f}}))},[r,d,f,c,u]);const g=n==="workspace"&&e?{to:`/supplier/asset/${e}`,label:"Back to Asset Workspace"}:{to:"/supplier/market",label:"Back to Market View"};if(i||o||h)return s.jsxs(he,{children:[s.jsx(Ey,{exitTo:g.to}),s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px"},children:[s.jsx(ce,{className:"h-8 w-48 mb-6"}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 2fr) minmax(0, 1fr)",gap:16},children:[s.jsx("div",{className:"xph-card",style:{padding:24},children:s.jsx(ce,{className:"h-32 w-full"})}),s.jsx("div",{className:"xph-card",style:{padding:24},children:s.jsx(ce,{className:"h-20 w-full"})})]})]})]});if(!r)return s.jsx(Pt,{to:"/auth",replace:!0});if(!(a!=null&&a.isApproved))return s.jsx(Pt,{to:"/supplier/pending",replace:!0});if(!d)return s.jsxs(he,{children:[s.jsx(Ey,{exitTo:g.to}),s.jsx("div",{className:"xph-container",style:{padding:"32px 24px"},children:s.jsxs("div",{className:"xph-card",style:{padding:48,textAlign:"center"},children:[s.jsx("h2",{className:"tt-display-sm",style:{marginBottom:8},children:"Asset not found"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginBottom:16},children:"The requested asset could not be found or is not published."}),s.jsxs(oe,{to:g.to,className:"xph-btn xph-btn-primary xph-btn-sm",style:{textDecoration:"none"},children:[s.jsx(Wt,{size:13}),g.label]})]})})]});if(!f)return s.jsxs(he,{children:[s.jsx(Ey,{exitTo:g.to}),s.jsx(Mst,{asset:d,backTo:g.to,backLabel:g.label})]});const y=p??d,b=s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-positive-fg))",background:"hsl(var(--c-positive-soft))",border:"1px solid hsl(var(--c-positive-border))",borderRadius:4,padding:"3px 8px",letterSpacing:"0.04em",textTransform:"uppercase"},children:[s.jsx(Fr,{size:11})," Your asset"]});return s.jsxs(he,{children:[s.jsx(Ey,{exitTo:g.to}),s.jsx(Oae,{asset:y,backLink:g,disableBuyerActions:!0,titleBadge:b,valuationFrom:"market"})]})}function Iut(){return Se({queryKey:["home-stats"],queryFn:async()=>{const{count:e,error:t}=await W.from("pharma_assets").select("*",{count:"exact",head:!0}).eq("asset_status","published");if(t)throw console.error("Error fetching asset count:",t),t;const{count:n,error:r}=await W.from("suppliers").select("*",{count:"exact",head:!0}).eq("verified",!0);if(r)throw console.error("Error fetching supplier count:",r),r;const{data:i,error:a}=await W.from("pharma_assets").select("estimated_npv").eq("asset_status","published");if(a)throw console.error("Error fetching NPV data:",a),a;const o=(i==null?void 0:i.reduce((l,c)=>l+(c.estimated_npv||0),0))||0;return{assetCount:e||0,supplierCount:n||0,totalNpv:o}}})}function Iae(){const e=Ye(),[t,n]=x.useState({results:[],isSearching:!1,error:null,searchTime:null});return{...t,search:async a=>{const o=a.trim();if(!o){n({results:[],isSearching:!1,error:null,searchTime:null});return}n(l=>({...l,isSearching:!0,error:null}));try{const{data:l,error:c}=await W.functions.invoke("asset-search",{body:{query:o}});if(c)throw c;const u=l.results||[],d=l.searchTime??null;n({results:u,isSearching:!1,error:null,searchTime:d}),e({action:"search_assets",entityType:Ve.pharmaAssets,entityId:null,entityLabel:o.slice(0,200),metadata:{query:o,result_count:u.length,top_result_ids:u.slice(0,5).map(h=>h.assetId),search_time_ms:d!=null?Math.round(d*1e3):null}})}catch(l){console.error("Search error:",l),n({results:[],isSearching:!1,error:l.message||"Search failed. Please try again.",searchTime:null})}},clearResults:()=>{n({results:[],isSearching:!1,error:null,searchTime:null})}}}function I$({assetCountByStage:e}){const t=e??{},n=Fb.filter(r=>(t[r]??0)>0);return n.length===0?s.jsx("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:"No assets pinned yet"}):s.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:n.map(r=>{const i=ov(r);return s.jsxs("span",{className:"xph-badge",style:{color:`hsl(var(${i.fg}))`,background:`hsl(var(${i.bg}))`},children:[i.label," · ",t[r]]},r)})})}function Rae({onSearch:e,isSearching:t,className:n,defaultValue:r=""}){const[i,a]=x.useState(r),o=l=>{l.preventDefault(),i.trim()&&!t&&e(i.trim())};return s.jsxs("form",{onSubmit:o,className:n,style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsxs("div",{style:{position:"relative"},children:[s.jsx("textarea",{value:i,onChange:l=>a(l.target.value),placeholder:"Describe what you're looking for in natural language… e.g., 'Early-stage oncology assets targeting solid tumors, preferably antibody or ADC modality with NPV > $100M'",disabled:t,rows:4,style:{width:"100%",padding:"12px 44px 12px 14px",border:"1px solid hsl(var(--c-border))",borderRadius:8,background:"hsl(var(--c-card))",color:"hsl(var(--c-fg))",fontSize:14,lineHeight:1.5,fontFamily:"inherit",resize:"none",minHeight:100,outline:"none",transition:"border-color 150ms, box-shadow 150ms"},onFocus:l=>{l.currentTarget.style.borderColor="hsl(var(--c-accent))",l.currentTarget.style.boxShadow="0 0 0 3px hsl(var(--c-accent-soft))"},onBlur:l=>{l.currentTarget.style.borderColor="hsl(var(--c-border))",l.currentTarget.style.boxShadow="none"}}),s.jsx(Cn,{size:16,style:{position:"absolute",top:14,right:14,color:"hsl(var(--c-fg-subtle))",pointerEvents:"none"}})]}),s.jsx("button",{type:"submit",className:"xph-btn xph-btn-primary",disabled:!i.trim()||t,style:{alignSelf:"flex-start",padding:"8px 16px"},children:t?s.jsxs(s.Fragment,{children:[s.jsx(ne,{size:13,className:"animate-spin"}),"Searching…"]}):s.jsxs(s.Fragment,{children:[s.jsx(Ea,{size:13}),"Find assets"]})})]})}function Dae({asset:e,score:t,reason:n}){var o;const r=Math.round(t*100),i=ea[e.stage],a=r>=80;return s.jsxs("div",{className:"bb-card",style:{background:"hsl(var(--c-card))",border:"1px solid hsl(var(--c-border))",borderRadius:12,overflow:"hidden",display:"flex",flexDirection:"column"},children:[s.jsx("div",{style:{padding:"14px 16px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center"},children:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:500,letterSpacing:"0.04em",textTransform:"uppercase",padding:"3px 8px",borderRadius:4,background:a?"hsl(var(--c-accent-soft))":"hsl(var(--c-surface-2))",color:a?"hsl(var(--c-accent))":"hsl(var(--c-fg-muted))",border:a?"1p
884x solid hsl(var(--c-accent-border))":"1px solid hsl(var(--c-border))"},children:[s.jsx(OH,{size:10}),r,"% match"]}),s.jsx("span",{className:`xph-badge ${i}`,children:Nn[e.stage]})]})}),s.jsxs("div",{style:{padding:"16px 16px 12px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12},children:[s.jsxs("div",{style:{minWidth:0},children:[s.jsx("div",{className:"tt-display-sm",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.productName}),s.jsxs("div",{className:"tt-mono-sm",style:{marginTop:2},children:[e.primaryTarget??"—"," · ",Zt[e.modality]]})]}),s.jsxs("div",{style:{textAlign:"right"},children:[s.jsx("div",{className:"tt-stat-lg",children:ds(e.estimatedNPV)}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:"Est. NPV"})]})]}),e.leadIndication&&s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:12,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.leadIndication}),s.jsxs("div",{style:{marginTop:12,padding:"10px 12px",background:"hsl(var(--c-surface))",border:"1px solid hsl(var(--c-border))",borderRadius:6,fontSize:12.5,fontStyle:"italic",color:"hsl(var(--c-fg-muted))",lineHeight:1.5},children:["“",n,"”"]})]}),s.jsxs("div",{style:{marginTop:"auto",padding:"10px 12px",borderTop:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-surface))",display:"flex",justifyContent:"space-between",alignItems:"center",gap:8,flexWrap:"wrap"},children:[s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:11.5,color:"hsl(var(--c-fg-muted))"},children:[s.jsx(Na,{size:11}),((o=e.supplier)==null?void 0:o.name)||"N/A"]}),s.jsxs("div",{style:{display:"flex",gap:6},children:[s.jsx(Kse,{assetId:e.id}),s.jsx(g$,{assetId:e.id,assetName:e.productName}),s.jsx($k,{assetId:e.id,assetName:e.productName}),s.jsx(oe,{to:`/buyer/asset/${e.id}`,className:"xph-btn xph-btn-outline xph-btn-sm","aria-label":"View details",children:s.jsx(Ls,{size:13})})]})]})]})}function Mae({orgs:e,activeIndex:t,onSwitch:n}){return s.jsx(Rre,{suppliers:e,activeIndex:t,onSwitch:n})}function Rut(){var M,R,K,D;const{user:e,isLoading:t,isAdmin:n}=me(),{isImpersonating:r}=qe(),{data:i,isLoading:a}=oi(),{data:o,isLoading:l}=Iut(),{data:c=[],isLoading:u}=p$(),{data:d=[],isLoading:h}=m$(),{data:f=[],isLoading:p}=ag(),{data:m=[]}=hS(),{results:g,isSearching:y,error:b,searchTime:v,search:w,clearResults:_}=Iae(),[j,S]=x.useState(""),[k,N]=x.useState("all"),[T,C]=x.useState("all"),[A,O]=x.useState("all"),[z,$]=x.useState("grid");if(t||a)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"64px 24px"},children:s.jsx("div",{style:{display:"flex",justifyContent:"center",minHeight:240},children:s.jsx(ne,{className:"h-8 w-8 animate-spin",style:{color:"hsl(var(--c-fg-subtle))"}})})})});if(!e)return s.jsx(Pt,{to:"/auth?buyer=true",replace:!0});if(n&&!r&&!(i!=null&&i.isApproved))return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"32px 24px"},children:s.jsx(Pre,{type:"buyer"})})});if(!(i!=null&&i.isApproved))return s.jsx(Pt,{to:"/buyer/pending",replace:!0});const F=g.map(E=>{const q=f.find(X=>X.id===E.assetId);return q?{asset:q,...E}:null}).filter(Boolean),B=f.filter(E=>E.assetStatus==="published"),P=B.filter(E=>{const q=E.productName.toLowerCase().includes(j.toLowerCase())||(E.primaryTarget||"").toLowerCase().includes(j.toLowerCase())||(E.leadIndication||"").toLowerCase().includes(j.toLowerCase()),X=k==="all"||E.stage===k,re=T==="all"||E.modality===T,Y=A==="all"||E.supplier.id===A;return q&&X&&re&&Y}),I=(k!=="all"?1:0)+(T!=="all"?1:0)+(A!=="all"?1:0);return s.jsx(he,{children:s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))",padding:"24px 0"},children:s.jsxs("div",{className:"xph-container",children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:16},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Buyer · portal"}),s.jsx("h1",{className:"tt-display-md",style:{marginTop:6},children:"Buyer dashboard"}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:6,color:"hsl(var(--c-fg-muted))",fontSize:13.5,flexWrap:"wrap"},children:[s.jsx(pr,{size:13}),s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:((M=i.organization)==null?void 0:M.name)??((R=i.buyerUser)==null?void 0:R.companyName)}),s.jsx("span",{style:{color:"hsl(var(--c-fg-subtle))"},children:"·"}),s.jsx(Um,{size:13}),s.jsx("span",{children:((K=i.organization)==null?void 0:K.location)??((D=i.buyerUser)==null?void 0:D.companyLocation)}),s.jsx(Mae,{orgs:i.allMemberships.map(E=>({id:E.organization.id,name:E.organization.name,location:E.organization.location??""})),activeIndex:i.activeOrgIndex,onSwitch:i.switchOrg})]})]}),s.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[s.jsxs(oe,{to:"/buyer/team",className:"xph-btn xph-btn-outline xph-btn-sm",children:[s.jsx(po,{size:13}),"Team"]}),s.jsxs(oe,{to:"/buyer/workspaces",className:"xph-btn xph-btn-outline xph-btn-sm",children:[s.jsx(zp,{size:13}),"Workspaces"]}
884),s.jsxs(oe,{to:"/buyer/watchlist",className:"xph-btn xph-btn-outline xph-btn-sm",children:[s.jsx(Wd,{size:13}),"Watchlist",c.length>0&&s.jsx("span",{style:{marginLeft:4,padding:"1px 6px",borderRadius:9999,background:"hsl(var(--c-surface-2))",fontSize:10,fontFamily:"var(--font-mono)"},children:c.length})]}),s.jsxs(oe,{to:"/buyer/search",className:"xph-btn xph-btn-primary xph-btn-sm",children:[s.jsx(Cn,{size:13}),"AI Discovery"]})]})]}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 200px), 1fr))",gap:12,marginTop:24},children:[{k:"Available assets",v:l?null:String((o==null?void 0:o.assetCount)||0),s:"verified, published",Icon:Oh},{k:"Suppliers",v:l?null:String((o==null?void 0:o.supplierCount)||0),s:"on platform",Icon:pr},{k:"Pipeline NPV",v:l?null:ds((o==null?void 0:o.totalNpv)||0),s:"aggregate value",Icon:xH},{k:"Watchlist",v:u?null:String(c.length),s:"saved by you",Icon:Wd}].map(({k:E,v:q,s:X,Icon:re})=>s.jsxs("div",{style:{background:"hsl(var(--c-surface))",border:"1px solid hsl(var(--c-border))",borderRadius:8,padding:"14px 16px",display:"flex",alignItems:"flex-start",gap:12},children:[s.jsx("span",{style:{width:32,height:32,borderRadius:6,flexShrink:0,background:"hsl(var(--c-card))",border:"1px solid hsl(var(--c-border))",display:"inline-flex",alignItems:"center",justifyContent:"center",color:"hsl(var(--c-fg-muted))"},children:s.jsx(re,{size:14})}),s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsx("div",{className:"eyebrow",children:E}),q===null?s.jsx(ce,{className:"h-6 w-16 mt-1"}):s.jsx("div",{className:"tt-stat-md",style:{marginTop:4},children:q}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:X})]})]},E))})]})}),s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px 64px",display:"flex",flexDirection:"column",gap:24},children:[s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs("div",{children:[s.jsxs("div",{className:"eyebrow",style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(Cn,{size:11,style:{color:"hsl(var(--c-accent))"}}),"AI Discovery"]}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:4},children:"Find your next asset"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:4},children:"Describe what you're looking for and our AI will find the best matching assets"})]}),F.length>0&&s.jsx("button",{type:"button",onClick:_,className:"xph-btn xph-btn-ghost xph-btn-sm",children:"Clear results"})]}),s.jsxs("div",{style:{padding:18},children:[s.jsx(Rae,{onSearch:w,isSearching:y}),b&&s.jsx("div",{style:{marginTop:16,padding:12,background:"hsl(var(--c-negative-soft))",border:"1px solid hsl(var(--c-negative))",borderRadius:8,fontSize:13,color:"hsl(var(--c-negative-deep))"},children:b}),F.length>0&&s.jsxs("div",{style:{marginTop:20},children:[s.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:["Found ",s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:600},children:F.length})," ","matching assets",v&&` in ${v.toFixed(1)}s`]})}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 360px), 1fr))",gap:12},children:F.slice(0,4).map(({asset:E,score:q,reason:X})=>s.jsx(Dae,{asset:E,score:q,reason:X},E.id))}),F.length>4&&s.jsxs(oe,{to:"/buyer/search",className:"xph-btn xph-btn-outline",style:{width:"100%",marginTop:12},children:["View all ",F.length," results",s.jsx(Gn,{size:13})]})]})]})]}),s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 18px",borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{className:"eyebrow",children:"Marketplace"}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:12,marginTop:4},children:[s.jsxs("div",{children:[s.jsx("div",{className:"tt-display-sm",children:"Browse assets"}),s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:4},children:["Showing ",P.length," of ",B.length," published assets"]})]}),s.jsxs("div",{style:{display:"flex",gap:4,padding:3,background:"hsl(var(--c-surface-2))",borderRadius:6},children:[s.jsx("button",{type:"button",onClick:()=>$("grid"),className:"xph-btn xph-btn-sm",style:{background:z==="grid"?"hsl(var(--c-card))":"transparent",boxShadow:z==="grid"?"0 1px 2px hsl(222 25% 9% / 0.08)":"none"},"aria-label":"Grid view",children:s.jsx(kH,{size:13})}),s.jsx("button",{type:"button",onClick:()=>$("table"),className:"xph-btn xph-btn-sm",style:{background:z==="table"?"hsl(var(--c-card))":"transparent",boxShadow:z==="table"?"0 1px 2px hsl(222 25% 9% / 0.08)":"none"},"aria-label":"Table view",children:s.jsx(NH,{size:13})})]})]})]}),s.jsxs("div",{style:{padding:"14px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",gap:8,flexWrap:"wrap",alignItems:"center",background:"hsl(var(--c-surface))"},children:[s.jsxs("div",{className:"xph-search-wrap",style:{flex:"1 1 240px",minWidth:180},children:[s.jsx(Ea,{size:14}),s.jsx("input",{className:"xph-input",placeholder:"Search by name, target, or indication…",value:j,onChange:E=>S(E.target.value)})]}),s.jsxs("select",{value:k,onChange:E=>N(E.target.value),className:"xph-input",style:{width:160},children:[s.jsx("option",{value:"all",children:"All stages"}),mb.map(E=>
884s.jsx("option",{value:E,children:Nn[E]},E))]}),s.jsxs("select",{value:T,onChange:E=>C(E.target.value),className:"xph-input",style:{width:160},children:[s.jsx("option",{value:"all",children:"All modalities"}),Object.entries(Zt).map(([E,q])=>s.jsx("option",{value:E,children:q},E))]}),s.jsxs("select",{value:A,onChange:E=>O(E.target.value),className:"xph-input",style:{width:160},children:[s.jsx("option",{value:"all",children:"All suppliers"}),m.map(E=>s.jsx("option",{value:E.id,children:E.name},E.id))]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",disabled:!0,children:[s.jsx(jH,{size:13}),"Filters · ",I]})]}),s.jsxs("div",{style:{padding:18},children:[p?s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 320px), 1fr))",gap:16},children:[...Array(6)].map((E,q)=>s.jsxs("div",{className:"xph-card",style:{padding:18},children:[s.jsx(ce,{className:"h-5 w-3/4 mb-3"}),s.jsx(ce,{className:"h-4 w-1/2 mb-2"}),s.jsx(ce,{className:"h-8 w-24"})]},q))}):z==="grid"?s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 320px), 1fr))",gap:16},children:P.map(E=>s.jsx(LR,{asset:E,basePath:"/buyer/asset"},E.id))}):s.jsx("div",{style:{border:"1px solid hsl(var(--c-border))",borderRadius:8,overflow:"hidden"},children:s.jsxs("table",{className:"xph-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Asset"}),s.jsx("th",{children:"Target"}),s.jsx("th",{children:"Modality"}),s.jsx("th",{children:"Stage"}),s.jsx("th",{children:"Supplier"}),s.jsx("th",{style:{textAlign:"right"},children:"Est. NPV"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:P.map(E=>{const q=ea[E.stage];return s.jsxs("tr",{children:[s.jsx("td",{style:{fontWeight:600,color:"hsl(var(--c-ink))"},children:s.jsx(oe,{to:`/buyer/asset/${E.id}`,style:{color:"inherit",textDecoration:"none"},children:E.productName})}),s.jsx("td",{style:{fontFamily:"var(--font-mono)",fontSize:12},children:E.primaryTarget??"—"}),s.jsx("td",{children:Zt[E.modality]}),s.jsx("td",{children:s.jsx("span",{className:`xph-badge ${q}`,children:Nn[E.stage]})}),s.jsx("td",{style:{color:"hsl(var(--c-fg-muted))"},children:E.supplier.name}),s.jsx("td",{style:{textAlign:"right",fontWeight:600},children:ds(E.estimatedNPV)}),s.jsx("td",{style:{textAlign:"right"},children:s.jsx(oe,{to:`/buyer/asset/${E.id}`,className:"xph-btn xph-btn-ghost xph-btn-sm","aria-label":"Open",children:s.jsx(Ls,{size:13})})})]},E.id)})})]})}),!p&&P.length===0&&s.jsxs("div",{style:{textAlign:"center",padding:"48px 0"},children:[s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginBottom:12},children:"No assets match your filters"}),s.jsx("button",{type:"button",onClick:()=>{S(""),N("all"),C("all"),O("all")},className:"xph-btn xph-btn-outline xph-btn-sm",children:"Clear filters"})]})]})]}),s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"My watchlist"}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[s.jsx("div",{className:"tt-display-sm",children:"Saved assets"}),c.length>0&&s.jsx("span",{className:"xph-badge",style:{background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-fg-muted))"},children:c.length})]})]}),c.length>0&&s.jsxs(oe,{to:"/buyer/watchlist",className:"xph-btn xph-btn-outline xph-btn-sm",children:["View all",s.jsx(Gn,{size:13})]})]}),s.jsx("div",{style:{padding:18},children:u?s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 280px), 1fr))",gap:12},children:[...Array(3)].map((E,q)=>s.jsx(ce,{className:"h-24 w-full"},q))}):c.length===0?s.jsxs("div",{style:{textAlign:"center",padding:"32px 0"},children:[s.jsx(Wd,{size:32,style:{margin:"0 auto 12px",color:"hsl(var(--c-fg-subtle))",opacity:.4,display:"block"}}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))"},children:"No assets saved yet"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:4,maxWidth:420,margin:"4px auto 0"},children:"Use AI search or the asset browser above to find and save interesting assets"})]}):s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 280px), 1fr))",gap:12},children:c.slice(0,3).map(E=>{const q=E.asset;return q?s.jsxs(oe,{to:`/buyer/asset/${E.assetId}`,style:{padding:14,border:"1px solid hsl(var(--c-border))",borderRadius:8,background:"hsl(var(--c-card))",transition:"all 150ms",textDecoration:"none",color:"inherit",display:"block"},onMouseEnter:X=>
884{X.currentTarget.style.background="hsl(var(--c-surface))",X.currentTarget.style.borderColor="hsl(var(--c-border-strong))"},onMouseLeave:X=>{X.currentTarget.style.background="hsl(var(--c-card))",X.currentTarget.style.borderColor="hsl(var(--c-border))"},children:[s.jsx("div",{className:"tt-display-sm",style:{fontSize:15,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:q.productName}),s.jsxs("div",{className:"tt-mono-sm",style:{marginTop:2},children:[q.primaryTarget??"—"," ·"," ",q.modality&&Zt[q.modality]]}),s.jsxs("div",{style:{marginTop:10,paddingTop:10,borderTop:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsx("span",{className:"tt-stat-md",style:{color:"hsl(var(--c-accent))"},children:q.estimatedNPV?ds(q.estimatedNPV):"—"}),s.jsx(Ls,{size:14,style:{color:"hsl(var(--c-fg-subtle))"}})]})]},E.id):null})})})]}),s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"14px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Team workspaces"}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[s.jsx("div",{className:"tt-display-sm",children:"Workspaces"}),d.length>0&&s.jsx("span",{className:"xph-badge",style:{background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-fg-muted))"},children:d.length})]})]}),d.length>0&&s.jsxs(oe,{to:"/buyer/workspaces",className:"xph-btn xph-btn-outline xph-btn-sm",children:["View all",s.jsx(Gn,{size:13})]})]}),s.jsx("div",{style:{padding:18},children:h?s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 280px), 1fr))",gap:12},children:[...Array(3)].map((E,q)=>s.jsx(ce,{className:"h-24 w-full"},q))}):d.length===0?s.jsxs("div",{style:{textAlign:"center",padding:"32px 0"},children:[s.jsx(zp,{size:32,style:{margin:"0 auto 12px",color:"hsl(var(--c-fg-subtle))",opacity:.4,display:"block"}}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))"},children:"No workspaces yet"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:4,maxWidth:420,margin:"4px auto 0"},children:"A workspace is a shared evaluation space for one mandate — create one to track assets with your team"}),s.jsx(oe,{to:"/buyer/workspaces",className:"xph-btn xph-btn-primary xph-btn-sm",style:{marginTop:16},children:"Create a workspace"})]}):s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 280px), 1fr))",gap:12},children:d.slice(0,3).map(E=>s.jsxs(oe,{to:`/buyer/workspace/${E.id}`,style:{padding:14,border:"1px solid hsl(var(--c-border))",borderRadius:8,background:"hsl(var(--c-card))",transition:"all 150ms",textDecoration:"none",color:"inherit",display:"block"},onMouseEnter:q=>{q.currentTarget.style.background="hsl(var(--c-surface))",q.currentTarget.style.borderColor="hsl(var(--c-border-strong))"},onMouseLeave:q=>{q.currentTarget.style.background="hsl(var(--c-card))",q.currentTarget.style.borderColor="hsl(var(--c-border))"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[s.jsx("div",{className:"tt-display-sm",style:{fontSize:15,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:E.name}),s.jsx(Ls,{size:14,style:{color:"hsl(var(--c-fg-subtle))",flexShrink:0}})]}),s.jsx("div",{style:{marginTop:10},children:s.jsx(I$,{assetCountByStage:E.assetCountByStage})})]},E.id))})})]})]})]})})}function Dut(){const{id:e}=Zs(),{data:t,isLoading:n,error:r}=fS(e||"");return n?s.jsx(he,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px"},children:[s.jsx(ce,{className:"h-6 w-48 mb-6"}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1.6fr) minmax(0, 1fr)",gap:16},children:[s.jsx("div",{className:"xph-card",style:{padding:24},children:s.jsx(ce,{className:"h-32 w-full"})}),s.jsx("div",{className:"xph-card",style:{padding:24},children:s.jsx(ce,{className:"h-20 w-full"})})]})]})})}):r||!t?s.jsx(he,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:s.jsx("div",{className:"xph-container",style:{padding:"32px 24px"},children:s.jsxs("div",{className:"xph-card",style:{padding:64,textAlign:"center"},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:8},children:"404 · not found"}),s.jsx("h2",{className:"tt-display-md",style:{marginBottom:8},children:"Asset not found"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginBottom:20},children:"The requested asset could not be found."}),s.jsxs(oe,{to:"/buyer",className:"xph-btn xph-btn-primary",children:[s.jsx(Wt,{size:13}),"Back to buyer portal"]})]})})})}):s.jsx(he,{children:s.jsx(Oae,{asset:t,backLink:{to:"/buyer",label:"Back to portal"}})})}function WW(e,t="Something went wrong. Please try again."){const n=e instanceof Error?e.message:String((e==null?void 0:e.message)??"");return n.includes("request_not_found")?"Join request not found — it may have been removed.":n.includes("request_already_decided")?"This join request has already been decided.":n.includes("org_not_approved")?"Your organization must be approved before it can accept new members.":n.includes("forbidden")?"You do not have permission to manage join requests.":Qn(e,t)}function Mut(){const{user:e}=me();return Se({queryKey:["my-join-request",e==null?void 0:e.id],queryFn:async()=>{const{data:t,error:n}=await W.rpc("get_my_join_request");
884if(n)throw n;const i=(t??[])[0];return i?{requestId:i.request_id,orgId:i.org_id,orgName:i.org_name,status:i.status,message:i.message,createdAt:i.created_at,decidedAt:i.decided_at}:null},enabled:!!e})}function $ut(e,t={}){const{user:n}=me(),{enabled:r=!0}=t;return Se({queryKey:["org-join-requests",e],queryFn:async()=>{if(!e)return[];const{data:i,error:a}=await W.rpc("get_org_join_requests",{_org_id:e});if(a)throw a;return(i??[]).map(o=>({requestId:o.request_id,requesterUserId:o.requester_user_id,requesterEmail:o.requester_email,requesterName:o.requester_name,message:o.message,status:o.status,createdAt:o.created_at}))},enabled:!!n&&!!e&&r})}function Lut(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async r=>{if(t("Approving a join request"))throw new Error("Impersonation mode");const{error:i}=await W.rpc("approve_org_join_request",{_request_id:r.requestId});if(i)throw i;return r},onSuccess:({requestId:r,orgId:i,requesterEmail:a,requesterName:o})=>{e.invalidateQueries({queryKey:["org-join-requests",i]}),e.invalidateQueries({queryKey:["org-roster"]}),n({action:"approve_org_join_request",entityType:Ve.orgJoinRequests,entityId:r,entityLabel:a||o||void 0,metadata:{org_id:i}})}})}function Fut(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async r=>{if(t("Declining a join request"))throw new Error("Impersonation mode");const{error:i}=await W.rpc("decline_org_join_request",{_request_id:r.requestId});if(i)throw i;return r},onSuccess:({requestId:r,orgId:i,requesterEmail:a,requesterName:o})=>{e.invalidateQueries({queryKey:["org-join-requests",i]}),n({action:"decline_org_join_request",entityType:Ve.orgJoinRequests,entityId:r,entityLabel:a||o||void 0,metadata:{org_id:i}})}})}function zut({request:e}){const t=e.status==="declined";return s.jsx(he,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:s.jsxs("div",{className:"xph-container",style:{maxWidth:640,padding:"32px 24px 64px"},children:[s.jsxs(oe,{to:"/",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{marginBottom:24,paddingLeft:4},children:[s.jsx(Wt,{size:13}),"Back to home"]}),s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"40px 32px 28px",textAlign:"center",borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{style:{width:56,height:56,borderRadius:12,margin:"0 auto 18px",display:"inline-flex",alignItems:"center",justifyContent:"center",background:t?"hsl(var(--c-negative-soft))":"hsl(var(--c-warning-soft))",color:t?"hsl(var(--c-negative-fg))":"hsl(var(--c-warning-fg))"},children:t?s.jsx(gn,{size:24}):s.jsx(Yn,{size:24})}),s.jsx("div",{className:"eyebrow",style:{marginBottom:10},children:"Join request"}),s.jsx("h1",{className:"tt-display-md",style:{marginBottom:10},children:t?"Request declined":"Request pending"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",maxWidth:460,margin:"0 auto"},children:t?`Your request to join ${e.orgName} was not approved.`:`Waiting for ${e.orgName}'s admin to approve your request to join their organization.`})]}),s.jsxs("div",{style:{padding:28},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:12},children:"Request details"}),s.jsxs("div",{style:{border:"1px solid hsl(var(--c-border))",borderRadius:8,background:"hsl(var(--c-surface))",overflow:"hidden"},children:[[["Organization",e.orgName],["Requested",new Date(e.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})]].map(([n,r])=>s.jsxs("div",{style:{padding:"12px 16px",display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:"1px solid hsl(var(--c-border))",fontSize:13.5},children:[s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))"},children:n}),s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:r})]},n)),s.jsxs("div",{style:{padding:"12px 16px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:13.5},children:[s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))"},children:"Status"}),s.jsx("span",{className:"xph-badge",style:{background:t?"hsl(var(--c-negative-soft))":"hsl(var(--c-warning-soft))",color:t?"hsl(var(--c-negative-fg))":"hsl(var(--c-warning-fg))"},children:t?"Declined":"Pending approval"})]})]}),e.message&&s.jsxs("div",{style:{marginTop:20},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:8},children:"Your message"}),s.jsx("div",{style:{padding:14,border:"1px solid hsl(var(--c-border))",borderRadius:8,background:"hsl(var(--c-surface))"},children:s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg))"},children:e.message})})]}),t?s.jsxs("div",{style:{marginTop:20,padding:14,background:"hsl(var(--c-negative-soft))",border:"1px solid hsl(var(--c-negative))",borderRadius:8,display:"flex",gap:10,alignItems:"flex-start"},children:[s.jsx(gn,{size:16,style:{color:"hsl(var(--c-negative-fg))",flexShrink:0,marginTop:2}}),s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg))"},children:["The organization's admin declined this request. Ask a teammate for an invitation, or contact ",e.orgName,"'s admin directly to be added to the team."]})]}):s.jsxs("div",{style:{marginTop:20,padding:14,background:"hsl(var(--c-positive-soft))",border:"1px solid hsl(var(--c-positive-border))",borderRadius:8,display:"flex",gap:10,alignItems:"flex-start"},children:[s.jsx(fo,{size:16,style:{color:"hsl(var(--c-positive-fg))",flexShrink:0,marginTop:2}}),s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg))"},children:[e.orgName,"'s admin will review your request. You'll receive an email and get access to the buyer portal once approved."]})]}),s.jsxs("p",{className:"tt-meta",style:{marginTop:20,textAlign:"center",color:"hsl(var(--c-fg-muted))"},children:["Questions?"," ",s.jsx("a",{href:"mailto:[email protected]",style:{color:"hsl(var(--c-accent))",textDecoration:"none",fontWeight:500},children:"[email protected]"})]})]})]})]})})})}function But(){var l,c;const{user:e,isLoading:t}=me(),{data:n,isLoading:r}=oi(),{data:i,isLoading:a}=Mut();if(t||r||a)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"64px 24px"},children:s.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:240},children:s.jsx(ne,{className:"h-8 w-8 animate-spin",style:{color:"hsl(var(--c-fg-subtle))"}})})})});if(!e)return s.jsx(Pt,{to:"/auth?buyer=true",replace:!0});if(n!=null&&n.isApproved)return s.jsx(Pt,{to:"/buyer",replace:!0});if(!(n!=null&&n.buyerUser)&&i)return i.status==="approved"?s.jsx(Pt,{to:"/buyer",replace:!0}):s.jsx(zut,{request:i});if(!(n!=null&&n.buyerUser))return s.jsx(Pt,{to:"/auth?buyer=true",replace:!0});const o=n.isRejected;return s.jsx(he,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:s.jsxs("div",{className:"xph-container",style:{maxWidth:640,padding:"32px 24px 64px"},children:[s.jsxs(oe,{to:"/",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{marginBottom:24,paddingLeft:4},children:[s.jsx(Wt,{size:13}),"Back to home"]}),s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"40px 32px 28px",textAlign:"center",borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{style:{width:56,height:56,borderRadius:12,margin:"0 auto 18px",display:"inline-flex",alignItems:"center",justifyContent:"center",background:o?"hsl(var(--c-negative-soft))":"hsl(var(--c-warning-soft))",color:o?"hsl(var(--c-negative-fg))":"hsl(var(--c-warning-fg))"},children:o?s.jsx(gn,{size:24}):s.jsx(Yn,{size:24})}),s.jsx("div",{className:"eyebrow",style:{marginBottom:10},children:"Buyer registration"}),s.jsx("h1",{className:"tt-display-md",style:{marginBottom:10},children:o?"Registration not approved":"Registration under review"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",maxWidth:460,margin:"0 auto"},children:o?"Unfortunately, your buyer registration was not approved. See details below.":"Thank y
884ou for registering. We're reviewing your application — typically 1-2 business days."})]}),s.jsxs("div",{style:{padding:28},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:12},children:"Registration details"}),s.jsxs("div",{style:{border:"1px solid hsl(var(--c-border))",borderRadius:8,background:"hsl(var(--c-surface))",overflow:"hidden"},children:[[["Organization",((l=n.organization)==null?void 0:l.name)??n.buyerUser.pendingCompanyName],["Location",((c=n.organization)==null?void 0:c.location)??n.buyerUser.pendingCompanyLocation],["Submitted",new Date(n.buyerUser.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})]].map(([u,d])=>s.jsxs("div",{style:{padding:"12px 16px",display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:"1px solid hsl(var(--c-border))",fontSize:13.5},children:[s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))"},children:u}),s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:d})]},u)),s.jsxs("div",{style:{padding:"12px 16px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:13.5},children:[s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))"},children:"Status"}),s.jsx("span",{className:"xph-badge",style:{background:o?"hsl(var(--c-negative-soft))":"hsl(var(--c-warning-soft))",color:o?"hsl(var(--c-negative-fg))":"hsl(var(--c-warning-fg))"},children:o?"Rejected":"Pending review"})]})]}),o&&n.buyerUser.rejectionReason&&s.jsxs("div",{style:{marginTop:20,padding:14,background:"hsl(var(--c-negative-soft))",border:"1px solid hsl(var(--c-negative))",borderRadius:8,display:"flex",gap:10,alignItems:"flex-start"},children:[s.jsx(gn,{size:16,style:{color:"hsl(var(--c-negative-fg))",flexShrink:0,marginTop:2}}),s.jsxs("div",{className:"tt-body-sm",children:[s.jsx("span",{style:{fontWeight:600,color:"hsl(var(--c-negative-deep))"},children:"Reason:"})," ",s.jsx("span",{style:{color:"hsl(var(--c-fg))"},children:n.buyerUser.rejectionReason})]})]}),!o&&s.jsxs("div",{style:{marginTop:20,padding:14,background:"hsl(var(--c-positive-soft))",border:"1px solid hsl(var(--c-positive-border))",borderRadius:8,display:"flex",gap:10,alignItems:"flex-start"},children:[s.jsx(fo,{size:16,style:{color:"hsl(var(--c-positive-fg))",flexShrink:0,marginTop:2}}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg))"},children:"An admin will review your registration shortly. You'll receive access to the buyer portal once approved."})]}),s.jsxs("p",{className:"tt-meta",style:{marginTop:20,textAlign:"center",color:"hsl(var(--c-fg-muted))"},children:["Questions?"," ",s.jsx("a",{href:"mailto:[email protected]",style:{color:"hsl(var(--c-accent))",textDecoration:"none",fontWeight:500},children:"[email protected]"})]})]})]})]})})})}function Vut(){const{user:e,isAdmin:t,isLoading:n}=me(),{data:r,isLoading:i}=oi(),{data:a=[]}=ag(),{results:o,isSearching:l,error:c,searchTime:u,search:d,clearResults:h}=Iae(),[f,p]=il(),m=b=>{p({q:b},{replace:!0}),d(b)},g=()=>{p({},{replace:!0}),h()};if(x.useEffect(()=>{const b=f.get("q");b&&!o.length&&!l&&d(b)},[]),n||i)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"64px 24px"},children:s.jsx("div",{style:{display:"flex",justifyContent:"center",minHeight:240},children:s.jsx(ne,{className:"h-8 w-8 animate-spin",style:{color:"hsl(var(--c-fg-subtle))"}})})})});if(!e)return s.jsx(Pt,{to:"/auth?buyer=true",replace:!0});if(!(r!=null&&r.isApproved)&&!t)return s.jsx(Pt,{to:"/buyer/pending",replace:!0});const y=o.map(b=>{const v=a.find(w=>w.id===b.assetId);return v?{asset:v,...b}:null}).filter(Boolean);return s.jsx(he,{children:s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))",padding:"20px 0"},children:s.jsxs("div",{className:"xph-container",style:{display:"flex",flexDirection:"column",gap:14},children:[s.jsxs(oe,{to:"/buyer",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{alignSelf:"flex-start",paddingLeft:4},children:[s.jsx(Wt,{size:13}),"Back to dashboard"]}),s.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:16},children:s.jsxs("div",{children:[s.jsxs("div",{className:"eyebrow",style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(Cn,{size:11,style:{color:"hsl(var(--c-accent))"}}),"AI Discovery"]}),s.jsx("h1",{className:"tt-display-md",style:{marginTop:6},children:"Asset discovery"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:4,maxWidth:720}
884,children:"Use natural language to search our database of pharma assets. Our AI will find the best matches for your requirements."})]})})]})}),s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px 64px"},children:[s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden",marginBottom:24},children:[s.jsxs("div",{style:{padding:"14px 18px",borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{className:"eyebrow",children:"Describe your requirements"}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:4},children:"What asset are you looking for?"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6},children:"Be as specific as you'd like — modality preferences, therapeutic areas, development stage, budget range, or any other criteria."})]}),s.jsx("div",{style:{padding:18},children:s.jsx(Rae,{onSearch:m,isSearching:l,defaultValue:f.get("q")??""})})]}),c&&s.jsx("div",{style:{marginBottom:24,padding:14,background:"hsl(var(--c-negative-soft))",border:"1px solid hsl(var(--c-negative))",borderRadius:8,fontSize:13,color:"hsl(var(--c-negative-deep))"},children:c}),l&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8,color:"hsl(var(--c-fg-muted))"},children:[s.jsx(ne,{size:14,className:"animate-spin"}),s.jsx("span",{className:"tt-body-sm",children:"Analyzing your requirements and searching assets…"})]}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 320px), 1fr))",gap:16},children:[...Array(4)].map((b,v)=>s.jsxs("div",{className:"xph-card",style:{padding:18},children:[s.jsx(ce,{className:"h-5 w-3/4 mb-3"}),s.jsx(ce,{className:"h-4 w-1/2 mb-2"}),s.jsx(ce,{className:"h-12 w-full"})]},v))})]}),!l&&y.length>0&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:12},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Results"}),s.jsxs("h2",{className:"tt-display-sm",style:{fontSize:20,marginTop:4},children:[y.length," matching asset",y.length===1?"":"s"]}),u&&s.jsxs("p",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:4},children:["Search completed in ",u.toFixed(1),"s"]})]}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:g,children:"Clear results"})]}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 360px), 1fr))",gap:16},children:y.map(({asset:b,score:v,reason:w})=>s.jsx(Dae,{asset:b,score:v,reason:w},b.id))})]}),!l&&o.length===0&&!c&&s.jsxs("div",{className:"xph-card",style:{padding:64,textAlign:"center"},children:[s.jsx("div",{style:{width:56,height:56,borderRadius:12,margin:"0 auto 18px",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))"},children:s.jsx(Cn,{size:24})}),s.jsx("div",{className:"tt-display-sm",style:{marginBottom:8},children:"Ready to find assets"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",maxWidth:460,margin:"0 auto"},children:"Enter your requirements above to discover pharma assets that match your investment criteria."})]})]})]})})}function Wut(){const{user:e,isAdmin:t,isLoading:n}=me(),{data:r,isLoading:i}=oi(),{data:a=[],isLoading:o}=p$(),l=Hse(),{toast:c}=xt(),[u,d]=x.useState(null);if(n||i)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"64px 24px"},children:s.jsx("div",{style:{display:"flex",justifyContent:"center",minHeight:240},children:s.jsx(ne,{className:"h-8 w-8 animate-spin",style:{color:"hsl(var(--c-fg-subtle))"}})})})});if(!e)return s.jsx(Pt,{to:"/auth?buyer=true",replace:!0});if(!(r!=null&&r.isApproved)&&!t)return s.jsx(Pt,{to:"/buyer/pending",replace:!0});const h=async f=>{try{await l.mutateAsync(f),c({title:"Removed from watchlist"})}catch(p){c({title:"Error",description:Qn(p,"Failed to remove from watchlist"),variant:"destructive"})}};return s.jsx(he,{children:s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))",padding:"20px 0"},children:s.jsxs("div",{className:"xph-container",style:{display:"flex",flexDirection:"column",gap:14},children:[s.jsxs(oe,{to:"/buyer",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{alignSelf:"flex-start",paddingLeft:4},children:[s.jsx(Wt,{size:13}),"Back to dashboard"]}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:16},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Buyer · saved"}),s.jsx("h1",{className:"tt-display-md",style:{marginTop:6},children:"Watchlist"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:4}
884,children:a.length===0?"No assets saved yet":`${a.length} asset${a.length===1?"":"s"} saved for review`})]}),s.jsx(oe,{to:"/buyer/search",className:"xph-btn xph-btn-outline xph-btn-sm",children:"Discover assets"})]})]})}),s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px"},children:[o?s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:[...Array(6)].map((f,p)=>s.jsxs("div",{className:"xph-card",style:{padding:18},children:[s.jsx(ce,{className:"h-5 w-3/4 mb-3"}),s.jsx(ce,{className:"h-4 w-1/2 mb-2"}),s.jsx(ce,{className:"h-8 w-24"})]},p))}):a.length===0?s.jsxs("div",{className:"xph-card",style:{padding:64,textAlign:"center"},children:[s.jsx("div",{style:{width:56,height:56,borderRadius:12,margin:"0 auto 18px",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"hsl(var(--c-surface))",color:"hsl(var(--c-fg-subtle))"},children:s.jsx(Wd,{size:24})}),s.jsx("div",{className:"tt-display-sm",style:{marginBottom:8},children:"No saved assets"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginBottom:20},children:"Start exploring assets and save the ones you're interested in."}),s.jsx(oe,{to:"/buyer/search",className:"xph-btn xph-btn-primary",children:"Discover assets"})]}):s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:a.map(f=>{const p=f.asset;if(!p)return null;const m=ea[p.stage];return s.jsxs("div",{className:"bb-card",style:{background:"hsl(var(--c-card))",border:"1px solid hsl(var(--c-border))",borderRadius:12,overflow:"hidden",display:"flex",flexDirection:"column"},children:[s.jsxs("div",{style:{padding:"14px 16px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsx("span",{className:`xph-badge ${m}`,children:Nn[p.stage]}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>d(f.id),disabled:l.isPending,"aria-label":"Remove from watchlist",children:l.isPending?s.jsx(ne,{className:"h-4 w-4 animate-spin"}):s.jsx(Gl,{size:14,style:{color:"hsl(var(--c-fg-muted))"}})})]}),s.jsxs("div",{style:{padding:"16px 16px 12px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12},children:[s.jsxs("div",{style:{minWidth:0},children:[s.jsx("div",{className:"tt-display-sm",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:p.productName}),s.jsxs("div",{className:"tt-mono-sm",style:{marginTop:2},children:[p.primaryTarget??"—"," · ",Zt[p.modality]]})]}),s.jsxs("div",{style:{textAlign:"right"},children:[s.jsx("div",{className:"tt-stat-lg",children:ds(p.estimatedNPV)}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:"Est. NPV"})]})]}),p.leadIndication&&s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:12,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:p.leadIndication})]}),s.jsxs("div",{style:{marginTop:"auto",padding:"10px 12px",borderTop:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-surface))",display:"flex",gap:8,alignItems:"center",justifyContent:"space-between"},children:[s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["Saved ",new Date(f.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})]}),s.jsxs("div",{style:{display:"flex",gap:6},children:[s.jsx(g$,{assetId:p.id,assetName:p.productName}),s.jsx($k,{assetId:p.id,assetName:p.productName}),s.jsx(oe,{to:`/buyer/asset/${f.assetId}`,className:"xph-btn xph-btn-outline xph-btn-sm","aria-label":"View asset",children:s.jsx(Ls,{size:13})})]})]})]},f.id)})}),s.jsx(ku,{open:!!u,onOpenChange:f=>{f||d(null)},onConfirm:()=>{u&&h(u),d(null)},title:"Remove from Watchlist",description:"This asset will be removed from your saved list.",confirmLabel:"Remove",isLoading:l.isPending})]})]})})}function $ae({open:e,onOpenChange:t,orgId:n}){const[r,i]=x.useState(""),[a,o]=x.useState(""),[l,c]=x.useState("member"),[u,d]=x.useState(null),[h,f]=x.use
884State(!1),p=x.useRef(null),m=x.useRef(0),g=x.useRef(!0),y=zJe(),{toast:b}=xt();x.useLayoutEffect(()=>{m.current+=1},[e]);const v=x.useCallback(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null)},[]),w=x.useCallback(()=>{i(""),o(""),c("member"),d(null),f(!1)},[]);x.useEffect(()=>(e||(v(),w()),v),[v,e,w]),x.useEffect(()=>(g.current=!0,()=>{g.current=!1}),[]);const _=()=>{m.current+=1,v(),w(),t(!1)},j=async S=>{S.preventDefault();const k=++m.current;v(),d(null),f(!1);try{const N=await y.mutateAsync({orgId:n,email:a.trim(),fullName:r.trim()||void 0,invitedRole:l});if(!g.current||m.current!==k)return;if(_k(N.status))b({title:`${N.userName||r.trim()||a.trim()} was already on xPharma and has been added to your team`,description:N.status==="linked_email_failed"?"Their notification email could not be delivered, but they can sign in and access the team now.":void 0}),_();else{d(a.trim());const T=sO(N.status);f(T),T||(p.current=setTimeout(()=>{p.current=null,_()},3e3))}}catch(N){if(!g.current||m.current!==k)return;b({title:"Error",description:Lo(N,"Failed to send invitation."),variant:"destructive"})}};return s.jsx(Br,{open:e,onOpenChange:S=>{S?t(S):_()},children:s.jsxs(br,{children:[s.jsxs(wr,{children:[s.jsx(jr,{children:"Invite Team Member"}),s.jsx(So,{children:"Add an existing xPharma user or email a seven-day invitation to a new teammate."})]}),u?s.jsxs("div",{className:"py-6 text-center space-y-3",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(qs,{className:"h-12 w-12 text-primary"})}),s.jsx(bn,{variant:h?"destructive":"default",children:s.jsx(wn,{children:h?`The invitation for ${u} was saved, but the email could not be delivered. Close this dialog, then use Resend under Pending invitations to try again.`:`Invitation email sent to ${u}. They'll be added to your team when they sign up.`})}),s.jsx(je,{variant:"outline",onClick:_,children:"Close"})]}):s.jsxs("form",{onSubmit:j,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"inviteFullName",children:"Full Name"}),s.jsx(Fe,{id:"inviteFullName",value:r,onChange:S=>i(S.target.value),placeholder:"Jane Smith"})]}),s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"inviteEmail",children:"Email *"}),s.jsx(Fe,{id:"inviteEmail",type:"email",value:a,onChange:S=>o(S.target.value),required:!0,placeholder:"[email protected]"})]}),s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"inviteRole",children:"Role"}),s.jsxs($n,{value:l,onValueChange:S=>c(S),children:[s.jsx(On,{id:"inviteRole",children:s.jsx(Ln,{})}),s.jsxs(In,{children:[s.jsx(Rt,{value:"member",children:"Member"}),s.jsx(Rt,{value:"admin",children:"Admin"})]})]})]}),s.jsxs(_i,{children:[s.jsx(je,{type:"button",variant:"outline",onClick:_,children:"Cancel"}),s.jsxs(je,{type:"submit",disabled:!a.trim()||y.isPending,children:[y.isPending&&s.jsx(ne,{className:"h-4 w-4 mr-2 animate-spin"}),"Send Invitation"]})]})]})]})})}const UW={owner:"Owner",admin:"Admin",member:"Member"},qW={owner:0,admin:1,member:2};function xf({children:e,tone:t="neutral"}){const n={neutral:{bg:"hsl(var(--c-surface))",fg:"hsl(var(--c-fg-muted))"},accent:{bg:"hsl(var(--c-accent-soft))",fg:"hsl(var(--c-accent-fg))"},warning:{bg:"hsl(var(--c-warning-soft))",fg:"hsl(var(--c-warning-fg))"},positive:{bg:"hsl(var(--c-positive-soft))",fg:"hsl(var(--c-positive-fg))"},negative:{bg:"hsl(var(--c-negative-soft))",fg:"hsl(var(--c-negative-fg))"}}[t];return s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:10.5,background:n.bg,color:n.fg,padding:"2px 7px",borderRadius:3,letterSpacing:"0.04em",textTransform:"uppercase"},children:e})}function Uut(e){return e.status==="expired"?!0:!!e.expiresAt&&new Date(e.expiresAt)<new Date}function iw(e){return e?new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"—"}function py(e){return e.requesterName||e.requesterEmail||"This requester"}function qut(){const{user:e,isAdmin:t,isLoading:n}=me(),{data:r,isLoading:i}=oi(),a=r==null?void 0:r.buyerUser,o=r==null?void 0:r.organization,l=(a==null?void 0:a.orgId)??null,c=t||(a==null?void 0:a.orgRole)==="owner"||(a==null?void 0:a.orgRole)==="admin",{data:u=[],isLoading:d,error:h}=wre(l),{data:f=[],isLoading:p}=jre(l,{enabled:c}),{data:m=[]}=$ut(l,{enabled:c}),g=_re(),y=Sre(),b=BJe(),v=VJe(),w=Lut(),_=Fut(),{toast:j}=xt(),[S,k]=x.useState(!1),[N,T]=x.useState(null),[C,A]=x.useState(null),[O,z]=x.use
884State(null);if(n||i)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"64px 24px"},children:s.jsx("div",{style:{display:"flex",justifyContent:"center",minHeight:240},children:s.jsx(ne,{className:"h-8 w-8 animate-spin",style:{color:"hsl(var(--c-fg-subtle))"}})})})});if(!e)return s.jsx(Pt,{to:"/auth?buyer=true",replace:!0});if(!(r!=null&&r.isApproved)&&!t)return s.jsx(Pt,{to:"/buyer/pending",replace:!0});const $=[...u].sort((D,E)=>{const q=qW[D.orgRole]-qW[E.orgRole];return q!==0?q:new Date(D.joinedAt).getTime()-new Date(E.joinedAt).getTime()}),F=f.filter(D=>D.status==="invited"||D.status==="expired"),B=m.filter(D=>D.status==="pending"),P=D=>c&&D.orgRole!=="owner"&&D.memberUserId!==e.id,I=async(D,E)=>{if(!(!l||E===D.orgRole))try{await v.mutateAsync({membershipId:D.membershipId,newRole:E,orgId:l,memberName:D.displayName}),j({title:`${D.displayName} is now ${E==="admin"?"an admin":"a member"}`})}catch(q){j({title:"Error",description:Lo(q,"Failed to change role."),variant:"destructive"})}},M=async D=>{if(l){A(D.id);try{const E=await g.mutateAsync({invitationId:D.id,orgId:l,email:D.email});_k(E.status)?j({title:`${E.userName||D.fullName||D.email} was already on xPharma and has been added to your team`,description:E.status==="linked_email_failed"?"Their notification email could not be delivered, but they can sign in and access the team now.":void 0}):E.status==="invited_email_failed"?j({title:"Invitation remains pending",description:`The email to ${D.email} could not be delivered. Use Resend to try again.`,variant:"destructive"}):j({title:`Invitation resent to ${D.email}`})}catch(E){j({title:"Error",description:Lo(E,"Failed to resend invitation."),variant:"destructive"})}finally{A(null)}}},R=async D=>{if(l){z(D.requestId);try{await w.mutateAsync({requestId:D.requestId,orgId:l,orgName:o==null?void 0:o.name,requesterUserId:D.requesterUserId,requesterEmail:D.requesterEmail,requesterName:D.requesterName}),j({title:`${py(D)} added to the team`})}catch(E){j({title:"Error",description:WW(E,"Failed to approve the join request."),variant:"destructive"})}finally{z(null)}}},K=async()=>{const D=N;if(T(null),!(!D||!l))if(D.type==="decline")try{await _.mutateAsync({requestId:D.request.requestId,orgId:l,orgName:o==null?void 0:o.name,requesterUserId:D.request.requesterUserId,requesterEmail:D.request.requesterEmail,requesterName:D.request.requesterName}),j({title:`Join request from ${py(D.request)} declined`})}catch(E){j({title:"Error",description:WW(E,"Failed to decline the join request."),variant:"destructive"})}else if(D.type==="remove")try{await b.mutateAsync({membershipId:D.membershipId,orgId:l,memberName:D.name}),j({title:`${D.name} removed from the team`})}catch(E){j({title:"Error",description:Lo(E,"Failed to remove team member."),variant:"destructive"})}else try{await y.mutateAsync({invitationId:D.invitationId,orgId:l,email:D.email}),j({title:`Invitation to ${D.email} revoked`})}catch(E){j({title:"Error",description:Lo(E,"Failed to revoke invitation."),variant:"destructive"})}};return s.jsxs(he,{children:[s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))",padding:"20px 0"},children:s.jsxs("div",{className:"xph-container",style:{display:"flex",flexDirection:"column",gap:14},children:[s.jsxs(oe,{to:"/buyer",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{alignSelf:"flex-start",paddingLeft:4},children:[s.jsx(Wt,{size:13}),"Back to dashboard"]}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:16},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Buyer · organization"}),s.jsx("h1",{className:"tt-display-md",style:{marginTop:6},children:"Team"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:4},children:o!=null&&o.name?`${o.name} · ${u.length} member${u.length===1?"":"s"}`:"Manage who can access your organization"})]}),c&&l&&s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:()=>k(!0),children:[s.jsx(v4,{size:13}),"Invite member"]})]})]})}),s.jsx("div",{className:"xph-container",style:{padding:"32px 24px"},children:l?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"xph-card",style:{overflow:"hidden",marginBottom:16},children:[s.jsxs("div",{style:{padding:"16px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:30,height:30,borderRadius:7,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(po,{size:15})}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Members"}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:2},children:"People in your organization"})]})]}
884),d?s.jsx("div",{style:{padding:18,display:"flex",flexDirection:"column",gap:10},children:[...Array(3)].map((D,E)=>s.jsx(ce,{className:"h-9 w-full"},E))}):h?s.jsx("div",{style:{padding:28,textAlign:"center"},children:s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-negative-fg))"},children:Lo(h,"Failed to load the team roster.")})}):$.length===0?s.jsx("div",{style:{padding:28,textAlign:"center"},children:s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"No members yet."})}):s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{className:"xph-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Email"}),s.jsx("th",{children:"Role"}),s.jsx("th",{children:"Joined"}),c&&s.jsx("th",{style:{width:80},children:"Actions"})]})}),s.jsx("tbody",{children:$.map(D=>{const E=D.memberUserId===e.id,q=P(D);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:D.displayName}),E&&s.jsx(xf,{tone:"accent",children:"You"}),D.status==="pending"&&s.jsx(xf,{tone:"warning",children:"Pending"})]})}),s.jsx("td",{children:D.email||"—"}),s.jsx("td",{children:q?s.jsxs($n,{value:D.orgRole,onValueChange:X=>I(D,X),disabled:v.isPending,children:[s.jsx(On,{className:"h-8",style:{width:120},"aria-label":`Change role for ${D.displayName}`,children:s.jsx(Ln,{})}),s.jsxs(In,{children:[s.jsx(Rt,{value:"member",children:"Member"}),s.jsx(Rt,{value:"admin",children:"Admin"})]})]}):s.jsx(xf,{tone:D.orgRole==="owner"?"accent":"neutral",children:UW[D.orgRole]||D.orgRole})}),s.jsx("td",{children:iw(D.joinedAt)}),c&&s.jsx("td",{children:q?s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>T({type:"remove",membershipId:D.membershipId,name:D.displayName}),disabled:b.isPending,title:"Remove from team","aria-label":`Remove ${D.displayName} from team`,style:{color:"hsl(var(--c-negative-fg))"},children:s.jsx(Gl,{size:13})}):s.jsx("span",{style:{color:"hsl(var(--c-fg-subtle))"},children:"—"})})]},D.membershipId)})})]})})]}),c&&B.length>0&&s.jsxs("div",{className:"xph-card",style:{overflow:"hidden",marginBottom:16},children:[s.jsxs("div",{style:{padding:"16px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:30,height:30,borderRadius:7,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(v4,{size:15})}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Join requests"}),s.jsxs("div",{className:"tt-display-sm",style:{marginTop:2,display:"flex",alignItems:"center",gap:8},children:["People asking to join",s.jsx(xf,{tone:"warning",children:B.length})]})]})]}),s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{className:"xph-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Requester"}),s.jsx("th",{children:"Message"}),s.jsx("th",{children:"Requested"}),s.jsx("th",{style:{width:200},children:"Actions"})]})}),s.jsx("tbody",{children:B.map(D=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:D.requesterName||D.requesterEmail||"—"}),D.requesterName&&D.requesterEmail&&s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:D.requesterEmail})]})}),s.jsx("td",{children:D.message?s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",display:"inline-block",maxWidth:320},children:D.message}):s.jsx("span",{style:{color:"hsl(var(--c-fg-subtle))"},children:"—"})}),s.jsx("td",{children:iw(D.createdAt)}),s.jsx("td",{children:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:()=>R(D),disabled:w.isPending||_.isPending,"aria-label":`Approve join request from ${py(D)}`,children:[O===D.requestId?s.jsx(ne,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(Fr,{size:13}),"Approve"]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:()=>T({type:"decline",request:D}),disabled:w.isPending||_.isPending,"aria-label":`Decline join request from ${py(D)}`,style:{color:"hsl(var(--c-negative-fg))"},children:[s.jsx(gn,{size:13}),"Decline"]})]})})]},D.requestId))})]})})]}),c&&s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"16px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:30,height:30,borderRadius:7,background:"hsl(var(--c-warning-soft))",color:"hsl(var(--c-warning-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(qs,{size:15})}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Invitations"}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:2},children:"Pending invitations"})]})]}
884),p?s.jsx("div",{style:{padding:18,display:"flex",flexDirection:"column",gap:10},children:[...Array(2)].map((D,E)=>s.jsx(ce,{className:"h-9 w-full"},E))}):F.length===0?s.jsx("div",{style:{padding:28,textAlign:"center"},children:s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"No pending invitations. Invite a member to get started."})}):s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{className:"xph-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Email"}),s.jsx("th",{children:"Role"}),s.jsx("th",{children:"Sent"}),s.jsx("th",{children:"Expires"}),s.jsx("th",{children:"Status"}),s.jsx("th",{style:{width:100},children:"Actions"})]})}),s.jsx("tbody",{children:F.map(D=>{const E=Uut(D);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:D.email}),D.fullName&&s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:D.fullName})]})}),s.jsx("td",{children:s.jsx(xf,{tone:"neutral",children:UW[D.invitedRole]||D.invitedRole})}),s.jsx("td",{children:iw(D.createdAt)}),s.jsx("td",{children:iw(D.expiresAt)}),s.jsx("td",{children:s.jsxs(xf,{tone:E?"warning":"accent",children:[s.jsx(qs,{size:9}),E?"Expired":"Invited"]})}),s.jsx("td",{children:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>M(D),disabled:g.isPending,title:"Resend invitation","aria-label":`Resend invitation to ${D.email}`,children:C===D.id?s.jsx(ne,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(ps,{size:13})}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>T({type:"revoke",invitationId:D.id,email:D.email}),disabled:y.isPending,title:"Revoke invitation","aria-label":`Revoke invitation to ${D.email}`,style:{color:"hsl(var(--c-negative-fg))"},children:s.jsx(gn,{size:13})})]})})]},D.id)})})]})})]})]}):s.jsxs("div",{className:"xph-card",style:{padding:64,textAlign:"center"},children:[s.jsx("div",{style:{width:56,height:56,borderRadius:12,margin:"0 auto 18px",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"hsl(var(--c-surface))",color:"hsl(var(--c-fg-subtle))"},children:s.jsx(po,{size:24})}),s.jsx("div",{className:"tt-display-sm",style:{marginBottom:8},children:"No organization"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))"},children:"Your account is not linked to a buyer organization yet."})]})})]}),l&&s.jsx($ae,{open:S,onOpenChange:k,orgId:l}),s.jsx(ku,{open:!!N,onOpenChange:D=>{D||T(null)},onConfirm:K,title:(N==null?void 0:N.type)==="revoke"?"Revoke Invitation":(N==null?void 0:N.type)==="decline"?"Decline Join Request":"Remove Team Member",description:(N==null?void 0:N.type)==="revoke"?`The invitation to ${N.email} will no longer be usable. You can always send a new one.`:(N==null?void 0:N.type)==="decline"?`${py(N.request)} will not be added to your organization. They can still be invited later.`:(N==null?void 0:N.type)==="remove"?`${N.name} will lose access to this organization. This action cannot be undone.`:"",confirmLabel:(N==null?void 0:N.type)==="revoke"?"Revoke":(N==null?void 0:N.type)==="decline"?"Decline":"Remove",isLoading:b.isPending||y.isPending||_.isPending})]})}function Hut({open:e,onOpenChange:t}){const[n,r]=x.useState(""),[i,a]=x.useState(""),o=Gse(),l=xr(),{toast:c}=xt(),u=()=>{r(""),a(""),t(!1)},d=async h=>{h.preventDefault();try{const f=await o.mutateAsync({name:n.trim(),description:i.trim()||void 0});c({title:`Workspace "${f.name}" created`}),u(),l(`/buyer/workspace/${f.id}`)}catch(f){c({title:"Error",description:Qn(f,"Failed to create workspace"),variant:"destructive"})}};return s.jsx(Br,{open:e,onOpenChange:h=>{h?t(h):u()},children:s.jsxs(br,{children:[s.jsx(wr,{children:s.jsx(jr,{children:"Create Workspace"})}),s.jsxs("form",{onSubmit:d,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"workspaceName",children:"Name *"}),s.jsx(Fe,{id:"workspaceName",value:n,onChange:h=>r(h.target.value),required:!0,placeholder:"GLP-1 in-licensing 2026"})]}),s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"workspaceDescription",children:"Description"}),s.jsx(Ys,{id:"workspaceDescription",value:i,onChange:h=>a(h.target.value),placeholder:"What mandate is this workspace for?",rows:3})]}),s.jsxs(_i,{children:[s.jsx(je,{type:"button",variant:"outline",onClick:u,children:"Cancel"}),s.jsxs(je,{type:"submit",disabled:!n.trim()||o.isPending,children:[o.isPending&&s.jsx(ne,{className:"h-4 w-4 mr-2 animate-spin"}
884),"Create Workspace"]})]})]})]})})}function Kut({workspace:e}){var n;const t=((n=e.memberUserIds)==null?void 0:n.length)??0;return s.jsxs(oe,{to:`/buyer/workspace/${e.id}`,style:{display:"flex",flexDirection:"column",background:"hsl(var(--c-card))",border:"1px solid hsl(var(--c-border))",borderRadius:12,overflow:"hidden",textDecoration:"none",color:"inherit",transition:"all 150ms"},onMouseEnter:r=>{r.currentTarget.style.background="hsl(var(--c-surface))",r.currentTarget.style.borderColor="hsl(var(--c-border-strong))"},onMouseLeave:r=>{r.currentTarget.style.background="hsl(var(--c-card))",r.currentTarget.style.borderColor="hsl(var(--c-border))"},children:[s.jsxs("div",{style:{padding:"16px 16px 12px",flex:1},children:[s.jsx("div",{className:"tt-display-sm",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name}),e.description?s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.description}):s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:6},children:"No description"}),s.jsx("div",{style:{marginTop:12},children:s.jsx(I$,{assetCountByStage:e.assetCountByStage})})]}),s.jsxs("div",{style:{padding:"10px 16px",borderTop:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-surface))",display:"flex",justifyContent:"space-between",alignItems:"center",gap:8,flexWrap:"wrap"},children:[s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",display:"inline-flex",alignItems:"center",gap:5},children:[s.jsx(po,{size:12}),t," member",t===1?"":"s"]}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["Updated ",$r(new Date(e.updatedAt),{addSuffix:!0})]})]})]})}function Gut(){const[e,t]=x.useState(""),n=Gse(),r=xr(),{toast:i}=xt(),a=async o=>{o.preventDefault();try{const l=await n.mutateAsync({name:e.trim()});i({title:`Workspace "${l.name}" created`}),r(`/buyer/workspace/${l.id}`)}catch(l){i({title:"Error",description:Qn(l,"Failed to create workspace"),variant:"destructive"})}};return s.jsxs("div",{className:"xph-card",style:{padding:64,textAlign:"center"},children:[s.jsx("div",{style:{width:56,height:56,borderRadius:12,margin:"0 auto 18px",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"hsl(var(--c-surface))",color:"hsl(var(--c-fg-subtle))"},children:s.jsx(zp,{size:24})}),s.jsx("div",{className:"tt-display-sm",style:{marginBottom:8},children:"Create your first workspace"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",maxWidth:460,margin:"0 auto 20px"},children:'A workspace is a shared evaluation space for one mandate — e.g. "GLP-1 in-licensing 2026".'}),s.jsxs("form",{onSubmit:a,style:{display:"flex",gap:8,justifyContent:"center",flexWrap:"wrap",maxWidth:420,margin:"0 auto"},children:[s.jsx("input",{className:"xph-input",style:{flex:"1 1 220px",minWidth:180},placeholder:"Workspace name",value:e,onChange:o=>t(o.target.value),"aria-label":"Workspace name"}),s.jsxs("button",{type:"submit",className:"xph-btn xph-btn-primary",disabled:!e.trim()||n.isPending,children:[n.isPending?s.jsx(ne,{className:"h-4 w-4 animate-spin"}):s.jsx(io,{size:13}),"Create"]})]})]})}function Yut(){var h,f;const{user:e,isAdmin:t,isLoading:n}=me(),{data:r,isLoading:i}=oi(),{data:a=[],isLoading:o}=m$(),[l,c]=x.useState(!1);if(n||i)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"64px 24px"},children:s.jsx("div",{style:{display:"flex",justifyContent:"center",minHeight:240},children:s.jsx(ne,{className:"h-8 w-8 animate-spin",style:{color:"hsl(var(--c-fg-subtle))"}})})})});if(!e)return s.jsx(Pt,{to:"/auth?buyer=true",replace:!0});if(!(r!=null&&r.isApproved)&&!t)return s.jsx(Pt,{to:"/buyer/pending",replace:!0});const u=((h=r==null?void 0:r.organization)==null?void 0:h.name)??((f=r==null?void 0:r.buyerUser)==null?void 0:f.companyName)??"Buyer",d=t&&!(r!=null&&r.organization);return s.jsxs(he,{children:[s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))",padding:"20px 0"},children:s.jsxs("div",{className:"xph-container",style:{display:"flex",flexDirection:"column",gap:14},children:[s.jsxs(oe,{to:"/buyer",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{alignSelf:"flex-start",paddingLeft:4},children:[s.jsx(Wt,{size:13}),"Back to dashboard"]}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:16},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:u}),s.jsx("h1",{className:"tt-display-md",style:{marginTop:6}
884,children:"Workspaces"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:4},children:a.length===0?"Shared evaluation spaces for your team":`${a.length} active workspace${a.length===1?"":"s"}`})]}),!d&&s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:()=>c(!0),children:[s.jsx(io,{size:13}),"Create workspace"]})]})]})}),s.jsx("div",{className:"xph-container",style:{padding:"32px 24px"},children:o?s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 320px), 1fr))",gap:16},children:[...Array(3)].map((p,m)=>s.jsxs("div",{className:"xph-card",style:{padding:18},children:[s.jsx(ce,{className:"h-5 w-3/4 mb-3"}),s.jsx(ce,{className:"h-4 w-1/2 mb-2"}),s.jsx(ce,{className:"h-8 w-24"})]},m))}):a.length===0?d?s.jsxs("div",{className:"xph-card",style:{padding:64,textAlign:"center"},children:[s.jsx("div",{style:{width:56,height:56,borderRadius:12,margin:"0 auto 18px",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"hsl(var(--c-surface))",color:"hsl(var(--c-fg-subtle))"},children:s.jsx(zp,{size:24})}),s.jsx("div",{className:"tt-display-sm",style:{marginBottom:8},children:"No buyer organization"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",maxWidth:460,margin:"0 auto"},children:"Use impersonation to view a buyer organization's workspaces."})]}):s.jsx(Gut,{}):s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 320px), 1fr))",gap:16},children:a.map(p=>s.jsx(Kut,{workspace:p},p.id))})})]}),s.jsx(Hut,{open:l,onOpenChange:c})]})}function Qut(e){return Se({queryKey:["workspace",e],queryFn:async()=>{const{data:t,error:n}=await W.from("workspaces").select("*, workspace_members(id, workspace_id, user_id, created_at)").eq("id",e).maybeSingle();if(n)throw console.error("Error fetching workspace:",n),n;return t?{workspace:{id:t.id,orgId:t.org_id,name:t.name,description:t.description,createdBy:t.created_by,archivedAt:t.archived_at,createdAt:t.created_at,updatedAt:t.updated_at},members:(t.workspace_members??[]).map(r=>({id:r.id,workspaceId:r.workspace_id,userId:r.user_id,createdAt:r.created_at}))}:{workspace:null,members:[]}},enabled:!!e,refetchInterval:6e4})}function Xut(e){const t=Ae();return x.useEffect(()=>{if(!e)return;const n=W.channel(`workspace-assets-${e}`).on("postgres_changes",{event:"*",schema:"public",table:"workspace_assets",filter:`workspace_id=eq.${e}`},()=>{t.invalidateQueries({queryKey:["workspace-assets",e]}),t.invalidateQueries({queryKey:["workspaces"]}),t.invalidateQueries({queryKey:["workspace-activity",e]})}).subscribe();return()=>{W.removeChannel(n)}},[e,t]),Se({queryKey:["workspace-assets",e],queryFn:async()=>{const{data:n,error:r}=await W.from("workspace_assets").select("*, pharma_assets(*, suppliers(*))").eq("workspace_id",e).order("created_at",{ascending:!0});if(r)throw console.error("Error fetching workspace assets:",r),r;return(n||[]).map(i=>({id:i.id,workspaceId:i.workspace_id,assetId:i.asset_id,stage:i.stage,notes:i.notes,addedBy:i.added_by,createdAt:i.created_at,updatedAt:i.updated_at,asset:i.pharma_assets?sl(i.pharma_assets):void 0}))},enabled:!!e,refetchInterval:3e4})}function Zut(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async({workspaceAssetId:r,stage:i})=>{if(t("Updating asset stage"))throw new Error("Impersonation mode");const{error:a}=await W.from("workspace_assets").update({stage:i}).eq("id",r);if(a)throw a;return r},onSuccess:async(r,{workspaceId:i,stage:a,fromStage:o,assetName:l})=>{e.invalidateQueries({queryKey:["workspace-assets",i]}),e.invalidateQueries({queryKey:["workspaces"]}),await n({action:"update_workspace_asset_stage",entityType:Ve.workspaceAssets,entityId:r,entityLabel:l??null,metadata:{workspace_id:i,from:o??null,to:a}}),e.invalidateQueries({queryKey:["workspace-activity",i]})}})}function Jut(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async({workspaceAssetId:r,notes:i})=>{if(t("Updating asset notes"))throw new Error("Impersonation mode");const{error:a}=await W.from("workspace_assets").update({notes:i.trim()||null}).eq("id",r);
884if(a)throw a;return r},onSuccess:async(r,{workspaceId:i,assetName:a})=>{e.invalidateQueries({queryKey:["workspace-assets",i]}),await n({action:"update_workspace_asset_notes",entityType:Ve.workspaceAssets,entityId:r,entityLabel:a??null,metadata:{workspace_id:i}}),e.invalidateQueries({queryKey:["workspace-activity",i]})}})}function edt(){const e=Ae(),{guardMutation:t}=qe(),n=Ye();return $e({mutationFn:async({workspaceAssetId:r})=>{if(t("Removing from workspace"))throw new Error("Impersonation mode");const{error:i}=await W.from("workspace_assets").delete().eq("id",r);if(i)throw i;return r},onSuccess:async(r,{workspaceId:i,assetName:a})=>{e.invalidateQueries({queryKey:["workspace-assets",i]}),e.invalidateQueries({queryKey:["workspaces"]}),await n({action:"unpin_workspace_asset",entityType:Ve.workspaceAssets,entityId:r,entityLabel:a??null,metadata:{workspace_id:i}}),e.invalidateQueries({queryKey:["workspace-activity",i]})}})}function tdt(){const e=Ae(),{user:t}=me(),{guardMutation:n}=qe(),r=Ye();return $e({mutationFn:async({workspaceId:i})=>{if(n("Joining a workspace"))throw new Error("Impersonation mode");if(!t)throw new Error("Not signed in");const{error:a}=await W.from("workspace_members").upsert({workspace_id:i,user_id:t.id},{onConflict:"workspace_id,user_id",ignoreDuplicates:!0});if(a)throw a;return i},onSuccess:async(i,{workspaceName:a})=>{e.invalidateQueries({queryKey:["workspace",i]}),e.invalidateQueries({queryKey:["workspaces"]}),await r({action:"join_workspace",entityType:Ve.workspaces,entityId:i,entityLabel:a??null}),e.invalidateQueries({queryKey:["workspace-activity",i]})}})}function ndt(){const e=Ae(),{user:t}=me(),{guardMutation:n}=qe(),r=Ye();return $e({mutationFn:async({workspaceId:i})=>{if(n("Leaving a workspace"))throw new Error("Impersonation mode");if(!t)throw new Error("Not signed in");const{error:a}=await W.from("workspace_members").delete().eq("workspace_id",i).eq("user_id",t.id);if(a)throw a;return i},onSuccess:async(i,{workspaceName:a})=>{e.invalidateQueries({queryKey:["workspace",i]}),e.invalidateQueries({queryKey:["workspaces"]}),await r({action:"leave_workspace",entityType:Ve.workspaces,entityId:i,entityLabel:a??null}),e.invalidateQueries({queryKey:["workspace-activity",i]})}})}function rdt(e){return Se({queryKey:["workspace-activity",e],queryFn:async()=>{const{data:t,error:n}=await W.rpc("get_workspace_activity",{_workspace_id:e,_limit:50});if(n)throw console.error("Error fetching workspace activity:",n),n;return(t??[]).map(r=>({id:r.id,action:r.action,actorName:r.actor_name,entityLabel:r.entity_label,metadata:r.metadata??{},createdAt:r.created_at}))},enabled:!!e,refetchInterval:3e4})}function HW(e){return typeof e=="string"&&av(e)?c_[e].label:null}function idt(e){var n,r;const t=e.entityLabel||"an asset";switch(e.action){case"pin_workspace_asset":return`added ${t}`;case"unpin_workspace_asset":return`removed ${t}`;case"update_workspace_asset_stage":{const i=HW((n=e.metadata)==null?void 0:n.from),a=HW((r=e.metadata)==null?void 0:r.to);return i&&a?`moved ${t} from ${i} to ${a}`:a?`set ${t} to ${a}`:`updated the stage of ${t}`}case"update_workspace_asset_notes":return`updated notes on ${t}`;case"create_workspace":return"created the workspace";case"update_workspace":return"updated the workspace details";case"archive_workspace":return"archived the workspace";case"join_workspace":return"joined the workspace";case"leave_workspace":return"left the workspace";default:return e.action.replace(/_/g," ")}}function sdt(e){const t=(e==null?void 0:e.trim())||"";if(!t)return"?";const n=t.split(/[\s@._-]+/).filter(Boolean);return n.length===0?"?":n.length===1?n[0].slice(0,2).toUpperCase():(n[0][0]+n[1][0]).toUpperCase()}function adt(e){return(e==null?void 0:e.trim())||"Team member"}function Lae(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}
884function odt({workspaceAsset:e,workspaceId:t,addedByName:n,onUnpin:r,selected:i,onToggleSelected:a}){var j;const o=Zut(),l=Jut(),{toast:c}=xt(),[u,d]=x.useState(!1),[h,f]=x.useState(""),p=e.asset,m=ov(e.stage),g=p==null?void 0:p.productName,y=!!((j=e.notes)!=null&&j.trim()),b=async S=>{if(S!==e.stage)try{await o.mutateAsync({workspaceAssetId:e.id,stage:S,workspaceId:t,assetName:g,fromStage:e.stage}),c({title:`Moved to ${ov(S).label}`})}catch(k){c({title:"Error",description:Qn(k,"Failed to update stage"),variant:"destructive"})}},v=()=>{f(e.notes??""),d(!0)},w=async()=>{try{await l.mutateAsync({workspaceAssetId:e.id,notes:h,workspaceId:t,assetName:g}),c({title:"Notes saved"}),d(!1)}catch(S){c({title:"Error",description:Qn(S,"Failed to save notes"),variant:"destructive"})}},_={borderBottom:"none",paddingBottom:6};return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{children:[s.jsx("td",{style:{..._,verticalAlign:"top",paddingTop:14},children:p&&s.jsx(pu,{checked:i,onCheckedChange:()=>a(e.id),"aria-label":`Select ${p.productName} for comparison`})}),s.jsx("td",{style:_,children:s.jsxs("div",{style:{minWidth:0},children:[p?s.jsxs(oe,{to:`/buyer/asset/${e.assetId}`,style:{color:"hsl(var(--c-ink))",fontWeight:600,textDecoration:"none",display:"inline-flex",alignItems:"center",gap:4,maxWidth:"100%"},children:[s.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.productName}),s.jsx(Ls,{size:12,style:{color:"hsl(var(--c-fg-subtle))",flexShrink:0}})]}):s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))",fontWeight:600},children:"Asset unavailable"}),(p==null?void 0:p.leadIndication)&&s.jsx("div",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:p.leadIndication})]})}),s.jsx("td",{style:{..._,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:p?Zt[p.modality]??p.modality:"—"})}),s.jsx("td",{style:{..._,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:(p==null?void 0:p.therapeuticArea)||"—"})}),s.jsx("td",{style:_,children:p?s.jsx("span",{className:`xph-badge ${ea[p.stage]}`,children:Nn[p.stage]}):s.jsx("span",{style:{color:"hsl(var(--c-fg-subtle))"},children:"—"})}),s.jsx("td",{style:{..._,textAlign:"right"},children:s.jsx("span",{className:"tt-mono-sm",style:{color:p?"hsl(var(--c-ink))":"hsl(var(--c-fg-subtle))"},children:p?ds(p.estimatedNPV):"—"})}),s.jsx("td",{style:_,children:s.jsxs($n,{value:e.stage,onValueChange:b,disabled:o.isPending,children:[s.jsx(On,{className:"h-7 w-auto gap-1 border-0 focus:ring-0 focus:ring-offset-0",style:{background:`hsl(var(${m.bg}))`,color:`hsl(var(${m.fg}))`,fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:500,letterSpacing:"0.06em",textTransform:"uppercase",borderRadius:4,padding:"3px 8px"},"aria-label":`Evaluation stage for ${g??"asset"}`,children:s.jsx(Ln,{})}),s.jsx(In,{children:Fb.map(S=>{const k=ov(S);return s.jsx(Rt,{value:S,children:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[s.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:`hsl(var(${k.fg}))`,flexShrink:0}}),k.label]})},S)})})]})}),s.jsx("td",{style:{..._,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.jsxs("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:[n??"—"," · ",Lae(e.createdAt)]})}),s.jsx("td",{style:{..._,textAlign:"right"},children:s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:2},children:[p&&s.jsx($k,{assetId:e.assetId,assetName:p.productName,variant:"icon"}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon",onClick:()=>r(e),title:"Remove from workspace","aria-label":`Remove ${g??"asset"} from workspace`,children:s.jsx(Gl,{size:14,style:{color:"hsl(var(--c-fg-muted))"}})})]})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:9,style:{paddingTop:0},children:u?s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:6},children:"Shared notes"}),s.jsx(Ys,{value:h,onChange:S=>f(S.target.value),placeholder:"Notes visible to everyone in this workspace…",rows:3,autoFocus:!0}),s.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:8},children:[s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:()=>d(!1),disabled:l.isPending,children:"Cancel"}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:w,disabled:l.isPending,children:[l.isPending&&s.jsx(ne,{className:"h-3.5 w-3.5 animate-spin"}),"Save notes"]})]})]}):s.jsxs("button",{type:"button",onClick:v,title:y?"Edit shared notes":"Add shared notes","aria-label":`${y?"Edit":"Add"} shared notes for ${g??"asset"}`,className:"tt-body-sm",style:{display:"flex",alignItems:"flex-start",ga
884p:6,width:"100%",textAlign:"left",background:"none",border:0,padding:0,cursor:"pointer"},children:[s.jsx(Kde,{size:12,style:{color:y?"hsl(var(--c-accent))":"hsl(var(--c-fg-subtle))",flexShrink:0,marginTop:2}}),y?s.jsx("span",{style:{color:"hsl(var(--c-fg-muted))",whiteSpace:"pre-wrap"},children:e.notes}):s.jsx("span",{style:{color:"hsl(var(--c-fg-subtle))",fontStyle:"italic"},children:"Add note…"})]})})})]})}function ldt({entries:e,nameByUserId:t,onBack:n}){const r={position:"sticky",left:0,background:"hsl(var(--c-card))",zIndex:1,color:"hsl(var(--c-fg-muted))",whiteSpace:"nowrap",fontWeight:500};return s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 16px",borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsxs("span",{className:"tt-body-sm",style:{fontWeight:600,color:"hsl(var(--c-ink))"},children:["Comparing ",e.length," assets"]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:n,style:{marginLeft:"auto"},children:[s.jsx(Wt,{size:13}),"Back to board"]})]}),s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{className:"xph-table",style:{minWidth:160+e.length*220},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:{...r,width:160},"aria-label":"Attribute"}),e.map(i=>s.jsx("th",{style:{minWidth:220},children:s.jsxs(oe,{to:`/buyer/asset/${i.assetId}`,style:{color:"hsl(var(--c-ink))",textDecoration:"none",display:"inline-flex",alignItems:"center",gap:4},children:[i.asset.productName,s.jsx(Ls,{size:11,style:{color:"hsl(var(--c-fg-subtle))"}})]})},i.id))]})}),s.jsxs("tbody",{children:[s.jsxs("tr",{children:[s.jsx("td",{style:r,children:"Status"}),e.map(i=>{const a=ov(i.stage);return s.jsx("td",{children:s.jsx("span",{style:{background:`hsl(var(${a.bg}))`,color:`hsl(var(${a.fg}))`,fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:500,letterSpacing:"0.06em",textTransform:"uppercase",borderRadius:4,padding:"3px 8px"},children:a.label})},i.id)})]}),s.jsxs("tr",{children:[s.jsx("td",{style:r,children:"Dev stage"}),e.map(i=>s.jsx("td",{children:s.jsx("span",{className:`xph-badge ${ea[i.asset.stage]}`,children:Nn[i.asset.stage]})},i.id))]}),s.jsxs("tr",{children:[s.jsx("td",{style:r,children:"Modality"}),e.map(i=>s.jsx("td",{className:"tt-body-sm",children:Zt[i.asset.modality]??i.asset.modality},i.id))]}),s.jsxs("tr",{children:[s.jsx("td",{style:r,children:"Therapeutic area"}),e.map(i=>s.jsx("td",{className:"tt-body-sm",children:i.asset.therapeuticArea||"—"},i.id))]}),s.jsxs("tr",{children:[s.jsx("td",{style:r,children:"Lead indication"}),e.map(i=>s.jsx("td",{className:"tt-body-sm",children:i.asset.leadIndication||"—"},i.id))]}),s.jsxs("tr",{children:[s.jsx("td",{style:r,children:"Est. NPV"}),e.map(i=>s.jsx("td",{children:s.jsx("span",{className:"tt-mono-sm",children:ds(i.asset.estimatedNPV)})},i.id))]}),s.jsxs("tr",{children:[s.jsx("td",{style:r,children:"Shared note"}),e.map(i=>s.jsx("td",{className:"tt-body-sm",style:{verticalAlign:"top"},children:i.notes?s.jsx("span",{style:{whiteSpace:"pre-wrap",color:"hsl(var(--c-fg-muted))"},children:i.notes}):s.jsx("span",{style:{color:"hsl(var(--c-fg-subtle))",fontStyle:"italic"},children:"—"})},i.id))]}),s.jsxs("tr",{children:[s.jsx("td",{style:r,children:"Added"}),e.map(i=>s.jsxs("td",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:[(i.addedBy?t.get(i.addedBy):void 0)??"—"," ·"," ",Lae(i.createdAt)]},i.id))]})]})]})})]})}const KW=10;function cdt({workspaceId:e,nameFallback:t}){const{data:n,isLoading:r,isError:i,refetch:a}=rdt(e),[o,l]=x.useState(!1),c=o?n??[]:(n??[]).slice(0,KW);return s.jsxs("div",{style:{marginTop:24},children:[s.jsxs("div",{className:"tt-body-sm",style:{display:"flex",alignItems:"center",gap:6,fontWeight:600,color:"hsl(var(--c-ink))",marginBottom:10},children:[s.jsx(Lde,{size:14,style:{color:"hsl(var(--c-fg-muted))"}}),"Recent activity"]}),r?s.jsxs("div",{style:{display:"grid",gap:8},children:[s.jsx(ce,{style:{height:14,width:"55%"}}),s.jsx(ce,{style:{height:14,width:"40%"}})]}):i?s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:["Activity is unavailable right now."," ",s.jsx("button",{type:"button",onClick:()=>a(),style:{background:"none",border:0,padding:0,cursor:"pointer",color:"hsl(var(--c-accent))",font:"inherit"},children:"Retry"})]}):!n||n.length===0?s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:"No activity yet — pins, stage moves, and note edits will show up here."}):s.jsxs(s.Fragment,{children:[s.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:7},children:c.map(u=>s.jsxs("li",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:[s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:500},children:u.actorName??t})," ",idt(u),s.jsxs("span",{style:{color:"hsl(var(--c-fg-subtle))"},children:[" ","· ",$r(new Date(u.createdAt),{addSuffix:!0})]})]},u.id))}),n.length>KW&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{marginTop:10},onClick:()=>l(u=>!u),children:o?"Show less":`Show all (${n.length})`})]})]})}function udt({workspace:e,onClose:t}
884){const[n,r]=x.useState(e.name),[i,a]=x.useState(e.description??""),o=Vst(),{toast:l}=xt(),c=async u=>{u.preventDefault();try{await o.mutateAsync({workspaceId:e.id,name:n.trim(),description:i.trim()||null}),l({title:"Workspace updated"}),t()}catch(d){l({title:"Error",description:Qn(d,"Failed to update workspace"),variant:"destructive"})}};return s.jsx(Br,{open:!0,onOpenChange:u=>{u||t()},children:s.jsxs(br,{children:[s.jsx(wr,{children:s.jsx(jr,{children:"Edit Workspace"})}),s.jsxs("form",{onSubmit:c,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"editWorkspaceName",children:"Name *"}),s.jsx(Fe,{id:"editWorkspaceName",value:n,onChange:u=>r(u.target.value),required:!0})]}),s.jsxs("div",{children:[s.jsx(Pe,{htmlFor:"editWorkspaceDescription",children:"Description"}),s.jsx(Ys,{id:"editWorkspaceDescription",value:i,onChange:u=>a(u.target.value),placeholder:"What mandate is this workspace for?",rows:3})]}),s.jsxs(_i,{children:[s.jsx(je,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),s.jsxs(je,{type:"submit",disabled:!n.trim()||o.isPending,children:[o.isPending&&s.jsx(ne,{className:"h-4 w-4 mr-2 animate-spin"}),"Save Changes"]})]})]})]})})}function ddt(){var J,be;const{id:e}=Zs(),t=e==null?void 0:e.toLowerCase(),n=xr(),{user:r,isAdmin:i,isLoading:a}=me(),{data:o,isLoading:l}=oi(),{data:c,isLoading:u,isError:d,refetch:h}=Qut(t),{data:f=[],isLoading:p,isError:m,refetch:g}=Xut(t),y=Wst(),b=edt(),v=tdt(),w=ndt(),{toast:_}=xt(),[j,S]=x.useState(!1),[k,N]=x.useState(!1),[T,C]=x.useState(null),[A,O]=x.useState(new Set),[z,$]=x.useState(!1),F=ee=>{O(Ce=>{const Re=new Set(Ce);return Re.has(ee)?Re.delete(ee):Re.add(ee),Re})};x.useEffect(()=>{const ee=new Set(f.filter(Ce=>!!Ce.asset).map(Ce=>Ce.id));O(Ce=>{const Re=[...Ce].filter(Ze=>ee.has(Ze));return Re.length===Ce.size?Ce:new Set(Re)})},[f]),x.useEffect(()=>{if(!z)return;f.filter(Ce=>A.has(Ce.id)&&!!Ce.asset).length<2&&$(!1)},[z,f,A]);const B=(c==null?void 0:c.members)??[],P=(c==null?void 0:c.workspace)??null,{data:I=[]}=wre(P==null?void 0:P.orgId);if(a||l)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"64px 24px"},children:s.jsx("div",{style:{display:"flex",justifyContent:"center",minHeight:240},children:s.jsx(ne,{className:"h-8 w-8 animate-spin",style:{color:"hsl(var(--c-fg-subtle))"}})})})});if(!r)return s.jsx(Pt,{to:"/auth?buyer=true",replace:!0});if(!(o!=null&&o.isApproved)&&!i)return s.jsx(Pt,{to:"/buyer/pending",replace:!0});const M=new Map(I.map(ee=>[ee.memberUserId,ee.displayName])),R=B.some(ee=>ee.userId===r.id),K=o==null?void 0:o.allMemberships.find(ee=>ee.organization.id===(P==null?void 0:P.orgId)),D=K==null?void 0:K.buyerUser.orgRole,E=i||D==="owner"||D==="admin"||!!P&&P.createdBy===r.id,q={};for(const ee of f){const Ce=av(ee.stage)?ee.stage:"screening";q[Ce]=(q[Ce]??0)+1}const X=new Map(Fb.map((ee,Ce)=>[ee,Ce])),re=[...f].sort((ee,Ce)=>{const Re=X.get(av(ee.stage)?ee.stage:"screening")??0,Ze=X.get(av(Ce.stage)?Ce.stage:"screening")??0;return Re!==Ze?Re-Ze:new Date(ee.createdAt).getTime()-new Date(Ce.createdAt).getTime()}),Y=re.filter(ee=>A.has(ee.id)&&!!ee.asset),le=async()=>{if(t)try{R?(await w.mutateAsync({workspaceId:t,workspaceName:P==null?void 0:P.name}),_({title:`Left ${(P==null?void 0:P.name)??"workspace"}`})):(await v.mutateAsync({workspaceId:t,workspaceName:P==null?void 0:P.name}),_({title:`Joined ${(P==null?void 0:P.name)??"workspace"}`}))}catch(ee){_({title:"Error",description:Qn(ee,`Failed to ${R?"leave":"join"} workspace`),variant:"destructive"})}},Z=async()=>{if(t){N(!1);try{await y.mutateAsync({workspaceId:t}),_({title:`${(P==null?void 0:P.name)??"Workspace"} archived`}),n("/buyer/workspaces")}catch(ee){_({title:"Error",description:Qn(ee,"Failed to archive workspace"),variant:"destructive"})}}},de=async()=>{var Ce;const ee=T;if(C(null),!(!ee||!t))try{await b.mutateAsync({workspaceAssetId:ee.id,workspaceId:t,assetName:(Ce=ee.asset)==null?void 0:Ce.productName}),_({title:"Removed from workspace"})}catch(Re){_({title:"Error",description:Qn(Re,"Failed to remove asset"),variant:"destructive"})}}
884,pe=u||p&&f.length===0;return s.jsxs(he,{children:[s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))",padding:"20px 0"},children:s.jsxs("div",{className:"xph-container",style:{display:"flex",flexDirection:"column",gap:14},children:[s.jsxs(oe,{to:"/buyer/workspaces",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{alignSelf:"flex-start",paddingLeft:4},children:[s.jsx(Wt,{size:13}),"Back to workspaces"]}),u?s.jsxs("div",{children:[s.jsx(ce,{className:"h-4 w-32 mb-2"}),s.jsx(ce,{className:"h-8 w-64 mb-2"}),s.jsx(ce,{className:"h-4 w-96"})]}):P?s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:16},children:[s.jsxs("div",{style:{minWidth:0},children:[s.jsx("div",{className:"eyebrow",children:(K==null?void 0:K.organization.name)??((J=o==null?void 0:o.organization)==null?void 0:J.name)??"Workspace"}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:6,flexWrap:"wrap"},children:[s.jsx("h1",{className:"tt-display-md",children:P.name}),P.archivedAt&&s.jsx("span",{className:"xph-badge",style:{background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-fg-muted))"},children:"Archived"})]}),P.description&&s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:4,maxWidth:640},children:P.description})]}),s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:le,disabled:v.isPending||w.isPending,children:[v.isPending||w.isPending?s.jsx(ne,{className:"h-3.5 w-3.5 animate-spin"}):R?s.jsx(gj,{size:13}):s.jsx(qT,{size:13}),R?"Leave":"Join workspace"]}),E&&s.jsxs(Aie,{children:[s.jsx(Tie,{asChild:!0,children:s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon","aria-label":"Workspace actions",children:s.jsx(Ide,{size:15})})}),s.jsxs(GM,{align:"end",children:[s.jsxs(r_,{onClick:()=>S(!0),children:[s.jsx(kI,{className:"h-3.5 w-3.5 mr-2"}),"Rename / edit description"]}),!P.archivedAt&&s.jsxs(r_,{onClick:()=>N(!0),className:"text-destructive focus:text-destructive",children:[s.jsx(vde,{className:"h-3.5 w-3.5 mr-2"}),"Archive workspace"]})]})]})]})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[s.jsx("span",{className:"eyebrow",children:"Members"}),B.length===0?s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:"No one has joined yet"}):s.jsx("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:B.map(ee=>{const Ce=M.get(ee.userId),Re=ee.userId===r.id?"You":adt(Ce);return s.jsx("span",{className:"xph-avatar",title:Re,"aria-label":Re,children:sdt(Ce)},ee.id)})})]}),f.length>0&&s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[s.jsx("span",{className:"eyebrow",children:"Funnel"}),s.jsx(I$,{assetCountByStage:q})]})]}):s.jsxs("div",{children:[s.jsx("h1",{className:"tt-display-md",children:"Workspace not found"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:4},children:"This workspace may have been archived or you may not have access to it."})]})]})}),s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px"},children:[pe?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[...Array(3)].map((ee,Ce)=>s.jsxs("div",{className:"xph-card",style:{padding:18},children:[s.jsx(ce,{className:"h-5 w-40 mb-3"}),s.jsx(ce,{className:"h-10 w-full mb-2"}),s.jsx(ce,{className:"h-10 w-full"})]},Ce))}):d?s.jsxs("div",{className:"xph-card",style:{padding:64,textAlign:"center"},children:[s.jsx("div",{className:"tt-display-sm",style:{marginBottom:8},children:"Couldn't load this workspace"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",margin:"0 auto 20px",maxWidth:380},children:"Something went wrong fetching the workspace. It has not been archived or deleted — try again."}),s.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"center"},children:[s.jsx("button",{type:"button",className:"xph-btn xph-btn-primary",onClick:()=>h(),children:"Retry"}),s.jsx(oe,{to:"/buyer/workspaces",className:"xph-btn xph-btn-outline",children:"Back to workspaces"})]})]}):P?m?s.jsxs("div",{className:"xph-card",style:{padding:48,textAlign:"center"},children:[s.jsx("div",{className:"tt-display-sm",style:{marginBottom:8},children:"Couldn't load the pinned assets"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",margin:"0 auto 20px",maxWidth:380},children:"Your workspace and its assets are intact — this is a loading problem, not an empty board."}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-primary",onClick:()=>g(),children:"Retry"})]}):f.length===0?s.jsxs("div",{className:"xph-card",style:{padding:64,textAlign:"center"},children:[s.jsx("div",{style:{width:56,height:56,borderRadius:12,margin:"0 auto 18px",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"hsl(var(--c-surface))",color:"hsl(var(--c-fg-subtle))"},children:s.jsx(zp,{size:24})}),s.jsx("div",{className:"tt-display-sm",style:{marginBottom:8},children:"No assets pinned yet"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",maxWidth:420,margin:"0 auto 20px"},children:"Pin assets from the Pipeline or Search to start tracking them through your evaluation funnel."}),s.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"center",flexWrap:"wrap"},children:[s.jsxs(oe,{to:"/buyer/search",className:"xph-btn xph-btn-primary",children:[s.jsx(Ea,{size:13}),"Search assets"]}),s.jsx(oe,{to:"/pipeline",className:"xph-btn xph-btn-outline",children:"Browse pipeline"})]})]}):z&&Y.length>
884=2?s.jsx(ldt,{entries:Y,nameByUserId:M,onBack:()=>$(!1)}):s.jsxs("div",{className:"xph-card",style:{padding:0,overflow:"hidden"},children:[A.size>0&&s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 16px",borderBottom:"1px solid hsl(var(--c-border))",background:"hsl(var(--c-surface-2))",flexWrap:"wrap"},children:[s.jsxs("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:[A.size," selected",A.size<2?" — select at least 2 assets to compare":""]}),s.jsxs("div",{style:{display:"flex",gap:8,marginLeft:"auto"},children:[s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:()=>O(new Set),children:"Clear"}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:()=>$(!0),disabled:Y.length<2,children:[s.jsx(bde,{size:13}),"Compare (",Y.length,")"]})]})]}),s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{className:"xph-table",style:{tableLayout:"fixed",minWidth:1080},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:{width:40},"aria-label":"Select for comparison"}),s.jsx("th",{children:"Asset"}),s.jsx("th",{style:{width:130},children:"Modality"}),s.jsx("th",{style:{width:150},children:"Therapeutic area"}),s.jsx("th",{style:{width:110},children:"Dev stage"}),s.jsx("th",{style:{width:100,textAlign:"right"},children:"Est. NPV"}),s.jsx("th",{style:{width:150},children:"Status"}),s.jsx("th",{style:{width:160},children:"Added"}),s.jsx("th",{style:{width:92,textAlign:"right"},children:"Actions"})]})}),s.jsx("tbody",{children:re.map(ee=>s.jsx(odt,{workspaceAsset:ee,workspaceId:t,addedByName:ee.addedBy?M.get(ee.addedBy):void 0,onUnpin:C,selected:A.has(ee.id),onToggleSelected:F},ee.id))})]})})]}):s.jsxs("div",{className:"xph-card",style:{padding:64,textAlign:"center"},children:[s.jsx("div",{style:{width:56,height:56,borderRadius:12,margin:"0 auto 18px",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"hsl(var(--c-surface))",color:"hsl(var(--c-fg-subtle))"},children:s.jsx(zp,{size:24})}),s.jsx("div",{className:"tt-display-sm",style:{marginBottom:8},children:"Workspace not found"}),s.jsx(oe,{to:"/buyer/workspaces",className:"xph-btn xph-btn-primary",children:"Back to workspaces"})]}),P&&s.jsx(cdt,{workspaceId:t,nameFallback:"Someone"})]})]}),j&&P&&s.jsx(udt,{workspace:P,onClose:()=>S(!1)}),s.jsx(ku,{open:k,onOpenChange:N,onConfirm:Z,title:"Archive Workspace",description:`"${(P==null?void 0:P.name)??"This workspace"}" will be hidden from your team's workspace list. Pinned assets and notes are preserved.`,confirmLabel:"Archive",isLoading:y.isPending}),s.jsx(ku,{open:!!T,onOpenChange:ee=>{ee||C(null)},onConfirm:de,title:"Remove from Workspace",description:`${((be=T==null?void 0:T.asset)==null?void 0:be.productName)??"This asset"} will be removed from this workspace along with its shared notes.`,confirmLabel:"Remove",isLoading:b.isPending})]})}function hdt(){return Se({queryKey:["supplier-directory"],queryFn:async()=>{const{data:e,error:t}=await W.from("suppliers").select("*").eq("verified",!0).order("assets_listed",{ascending:!1});if(t)throw console.error("Error fetching suppliers:",t),t;return(e||[]).map(n=>({id:n.id,name:n.name,location:n.location,verified:n.verified,assetsListed:n.assets_listed,assetCount:n.assets_listed||0}))}})}function fdt(){const{data:e=[],isLoading:t}=hdt();return s.jsxs(he,{children:[s.jsx(Js,{title:"Supplier directory — xPharma",description:"Verified biotech suppliers on xPharma — explore companies listing assets for licensing, partnership, and acquisition.",path:"/supplier-directory",noindex:!0}),s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"calc(100vh - 56px)"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))",padding:"20px 0"},children:s.jsxs("div",{className:"xph-container",children:[s.jsxs(oe,{to:"/buyer",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{marginBottom:12,paddingLeft:0},children:[s.jsx(Wt,{size:13}),"Back to dashboard"]}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:16},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:6},children:"Marketplace · Suppliers"}),s.jsx("h1",{className:"tt-display-md",children:"Supplier directory"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:4},children:"Browse verified pharmaceutical asset suppliers on the xPharma platform."})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontFamily:"var(--font-mono)",fontSize:12,color:"hsl(var(--c-fg-muted))"},children:[s.jsx("span",{style:{textTransform:"uppercase",letterSpacing:"0.06em",color:"hsl(var(--c-fg-subtle))"},children:"Listed"}),s.jsx("span",{style:{color:"hsl(var(--c-ink))",fontWeight:600},children:e.length})]})]})]})}),s.jsx("div",{className:"xph-container",style:{padding:"32px 24px"},children:t?s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gap:16},children:[...Array(6)].map((n,r)=>s.jsxs("div",{className:"xph-card",style:{padding:20},children:[s.jsx(ce,{className:"h-6 w-3/4 mb-3"}),s.jsx(ce,{className:"h-4 w-1/2 mb-4"}),s.jsx(ce,{className:"h-4 w-full"})]},r))}):e.length===0?s.jsxs("div",{className:"xph-card",style:{padding:64,textAlign:"center"},children:[s.jsx("div",{style:{width:56,height:56,borderRadius:12,background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-fg-muted))",display:"inline-flex",alignItems:"center",justifyContent:"center",marginBottom:16},children:s.jsx(pr,{size:26})}),s.jsx("h3",{className:"tt-display-sm",style:{marginBottom:8},children:"No suppliers yet"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))"},children:"There are currently no verified suppliers on the platform."})]}):s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gap:16},children:e.map(n=>{const r=n.name.split(/\s+/).map(i=>
884i[0]).filter(Boolean).slice(0,2).join("").toUpperCase();return s.jsxs("div",{className:"xph-card bb-card",style:{padding:20,display:"flex",flexDirection:"column",gap:16},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:12},children:[s.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center",minWidth:0},children:[s.jsx("span",{style:{width:40,height:40,borderRadius:8,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:12,fontWeight:600,letterSpacing:"0.04em",flexShrink:0},children:r||s.jsx(pr,{size:16})}),s.jsxs("div",{style:{minWidth:0},children:[s.jsx("div",{className:"tt-display-sm",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.name}),s.jsxs("div",{className:"tt-mono-sm",style:{marginTop:2,display:"inline-flex",alignItems:"center",gap:4},children:[s.jsx(Um,{size:11}),n.location]})]})]}),n.verified&&s.jsxs("span",{className:"xph-badge",style:{background:"hsl(var(--c-positive-soft))",color:"hsl(var(--c-positive-fg))",border:"1px solid hsl(var(--c-positive-border))"},children:[s.jsx(fo,{size:10}),"Verified"]})]}),s.jsxs("div",{style:{borderTop:"1px solid hsl(var(--c-border))",paddingTop:14,display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6,color:"hsl(var(--c-fg-muted))"},children:[s.jsx(Oh,{size:13}),s.jsxs("span",{className:"tt-body-sm",children:[s.jsx("strong",{style:{color:"hsl(var(--c-ink))"},children:n.assetCount})," ",n.assetCount===1?"asset":"assets"]})]}),s.jsxs(oe,{to:`/pipeline?supplier=${n.id}`,className:"xph-btn xph-btn-outline xph-btn-sm",children:["View assets",s.jsx(Ls,{size:12})]})]})]},n.id)})})})]})]})}function dv({capabilities:e,kind:t,max:n}){const r=e.filter(a=>a.kind===t),i=n?r.slice(0,n):r;return i.length===0?null:s.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:i.map(a=>s.jsx("span",{style:{fontSize:11.5,color:"hsl(var(--c-fg-muted))",background:"hsl(var(--c-surface-2))",borderRadius:4,padding:"3px 9px",whiteSpace:"nowrap"},children:zx(a.kind,a.value)},a.id))})}function pdt(){const{data:e,isLoading:t,isError:n,refetch:r}=Ak();return s.jsx(he,{children:s.jsx(Ng,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px 64px"},children:[s.jsxs("div",{style:{marginBottom:24},children:[s.jsx("div",{className:"eyebrow",children:"Solution Partners"}),s.jsx("h1",{className:"tt-display-md",style:{marginTop:8},children:"Verified advisory firms"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6,maxWidth:640},children:"Independent firms that help move a program — readiness reviews, mock due diligence, partner search and more. Engagements run through xPharma; nothing is shared without your approval."})]}),t&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(ce,{className:"h-28 w-full"}),s.jsx(ce,{className:"h-28 w-full"})]}),!t&&n&&s.jsxs("div",{className:"xph-card",style:{padding:32,textAlign:"center"},children:[s.jsx("div",{className:"tt-display-sm",children:"Couldn't load partners"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6},children:"Something went wrong fetching the partner directory."}),s.jsx("button",{type:"button",onClick:()=>r(),className:"xph-btn xph-btn-outline xph-btn-sm",style:{marginTop:14},children:"Try again"})]}),!t&&!n&&(!e||e.length===0)&&s.jsxs("div",{className:"xph-card",style:{padding:32,textAlign:"center"},children:[s.jsx("span",{style:{width:36,height:36,borderRadius:8,background:"hsl(var(--c-partner-soft))",color:"hsl(var(--c-partner))",display:"inline-flex",alignItems:"center",justifyContent:"center",marginBottom:10},children:s.jsx(po,{size:18})}),s.jsx("div",{className:"tt-display-sm",children:"No solution partners yet"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6},children:"Verified partner firms will appear here as they join the platform."})]}),!t&&!n&&(e??[]).map(({profile:i,capabilities:a,services:o})=>s.jsxs("div",{className:"xph-card",style:{padding:18,marginBottom:12,display:"flex",gap:16,alignItems:"flex-start",flexWrap:"wrap"},children:[s.jsx(Bx,{name:i.display_name,logoUrl:i.logo_url,size:56,radius:12}),s.jsxs("div",{style:{flex:1,minWidth:260},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[s.jsx("span",{className:"tt-display-sm",children:i.display_name}),s.jsx(XM,{long:!0}),i.partner_type&&s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,letterSpacing:"0.05em",textTransform:"uppercase",color:"hsl(var(--c-fg-muted))",background:"hsl(var(--c-surface-2))",borderRadius:4,padding:"3px 8px"},children:i.partner_type})]}),i.tagline&&s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6},children:i.tagline}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:12},children:[s.jsx(dv,{capabilities:a,kind:"ta",max:6}),s.jsx(dv,{capabilities:a,kind:"modality",max:6})]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-end",flex:"none"},children:[s.jsxs(oe,{to:`/solutions-partners/${i.slug}`,className:"xph-btn xph-btn-primary xph-btn-sm",style:{textDecoration:"none"},children:["View partner",s.jsx(Gn,{size:12})]}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:[o.length," service",o.length===1?"":"s"]})]})]},i.id))]})})})})}function mdt(){const{slug:e}=Zs(),{partner:t,isLoading:n,isError:r,isFetching:i,refetch:a}=tnt(e),{data:o}=An(),[l,c]=x.useState(null),[u,d]=x.useState(!1),h=!!(o!=null&&o.supplier),f=C=>{c(C),d(!0)},p=h?C=>f(C):void 0;if(n)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:s.jsx(ce,{className:"h-48 w-full"})})});if(r)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:s.jsxs("div",{className:"xph-card",style:{padding:32,textAlign:"center",marginTop:20},children:[s.jsx("div",{className:"tt-display-sm",children:"Couldn't load this partner"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6},children:"Something went wrong fetching the partner profile. Your session has not been redirected."}),s.jsx("button",{type:"button",onClick:()=>a(),disabled:i,className:"xph-btn xph-btn-outline xph-btn-sm",style:{marginTop:14},children:i?"Retrying…":"Try again"})]})})});if(!t)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:s.jsxs("div",{className:"xph-card",style:{padding:32,textAlign:"center",marginTop:20},children:[s.jsx("div",{className:"tt-display-sm",children:"Partner not found"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6},children:"This solution partner does not exist or is not available."}),s.jsx(oe,{to:"/solutions-partners",className:"xph-btn xph-btn-outline xph-btn-sm",style:{textDecoration:"none",marginTop:14,display:"inline-flex"},children:"Browse all partners"})]})})});const{profile:m,capabilities:g,services:y}=t,b=Ef(lst,m.proof_stats),v=Ef(cst,m.method),w=Ef(ust,m.advisors),_=Ef(dst,m.quotes),j=Ef(hst,m.contact),S=y.filter(
884Bse),k=S.filter(C=>C.tier==="ready_made"),N=S.filter(C=>C.tier==="bespoke"),T=g.some(C=>["ta","modality","side"].includes(C.kind));return s.jsxs(he,{children:[s.jsx(Ng,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:s.jsxs("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:[s.jsxs(oe,{to:"/solutions-partners",className:"tt-mono-sm",style:{display:"inline-flex",alignItems:"center",gap:6,textDecoration:"none",color:"hsl(var(--c-fg-muted))",marginBottom:16},children:[s.jsx(Ph,{size:13}),"Solution Partners"]}),s.jsxs("div",{className:"xph-card",style:{overflow:"hidden",marginBottom:20},children:[s.jsx("div",{style:{height:96,background:"linear-gradient(120deg, hsl(var(--c-partner-ink)), hsl(var(--c-partner-fg)))"}}),s.jsxs("div",{style:{padding:"0 24px 22px"},children:[s.jsxs("div",{style:{display:"flex",gap:18,alignItems:"flex-end",marginTop:-40,flexWrap:"wrap"},children:[s.jsx("div",{style:{border:"3px solid hsl(var(--c-card))",borderRadius:18,boxShadow:"var(--shadow-md)"},children:s.jsx(Bx,{name:m.display_name,logoUrl:m.logo_url,size:84,radius:15})}),s.jsxs("div",{style:{flex:1,minWidth:260,paddingBottom:2},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[s.jsx("h1",{className:"tt-display-md",children:m.display_name}),s.jsx(XM,{long:!0}),m.partner_type&&s.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,letterSpacing:"0.05em",textTransform:"uppercase",color:"hsl(var(--c-fg-muted))",background:"hsl(var(--c-surface-2))",borderRadius:4,padding:"3px 8px"},children:m.partner_type})]}),m.tagline&&s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6},children:m.tagline})]}),s.jsxs("div",{style:{display:"flex",gap:8,paddingBottom:4,flexWrap:"wrap",alignItems:"center"},children:[j&&s.jsx("a",{href:"#contact",className:"xph-btn xph-btn-outline xph-btn-sm",style:{textDecoration:"none"},children:"Contact"}),s.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:2},children:[s.jsx("button",{type:"button",disabled:!h,"aria-disabled":!h,title:h?void 0:"Engagement requests are available to supplier members.",onClick:h?()=>f(null):void 0,className:"xph-btn xph-btn-sm",style:{background:"hsl(var(--c-partner))",color:"hsl(var(--c-ink-inverse))",border:"1px solid hsl(var(--c-partner))",cursor:h?"pointer":"not-allowed",opacity:h?1:.55},children:"Request a service"}),!h&&s.jsx("span",{className:"tt-meta",style:{color:"hsl(var(--c-fg-subtle))",fontSize:10.5},children:"For supplier members"})]})]})]}),b&&b.length>0&&s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(120px, 1fr))",gap:12,marginTop:20,paddingTop:18,borderTop:"1px solid hsl(var(--c-border))"},children:b.map(C=>s.jsxs("div",{children:[s.jsx("div",{className:"tt-stat-md",children:C.value}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:C.label})]},C.label))})]})]}),s.jsxs("div",{style:{display:"flex",gap:20,alignItems:"flex-start",flexWrap:"wrap"},children:[s.jsxs("div",{style:{flex:1,minWidth:320,display:"flex",flexDirection:"column",gap:20},children:[m.about&&s.jsxs("div",{className:"xph-card",style:{padding:"20px 22px"},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:10},children:"About"}),s.jsx("p",{className:"tt-body",children:m.about})]}),v&&v.items.length>0&&s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{className:"eyebrow",children:"Assessment method"}),v.heading&&s.jsx("div",{className:"tt-display-sm",style:{marginTop:3},children:v.heading})]}),s.jsx("div",{style:{padding:"18px 20px",display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 260px), 1fr))",gap:12},children:v.items.map((C,A)=>s.jsxs("div",{style:{border:"1px solid hsl(var(--c-border))",borderRadius:9,padding:"13px 14px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:9,marginBottom:6},children:[s.jsx("span",{style:{width:22,height:22,borderRadius:6,background:"hsl(var(--c-partner-soft))",color:"hsl(var(--c-partner))",display:"grid",placeItems:"center",fontFamily:"var(--font-mono)",fontSize:11,fontWeight:600,flex:"none"},children:A+1}),s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-ink))",fontWeight:600},children:C.title})]}),s.jsx("p",{className:"tt-meta",children:C.description})]},C.title))})]}),S.length>0&&s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{className:"eyebrow",children:"Services"}),s.jsxs("div",{className:"tt-display-sm",style:{marginTop:3},children:["What you can engage ",m.display_name," for"]})]}),s.jsxs("div",{style:{padding:"18px 20px"},children:[k.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[s.jsx("span",{style:{fontSize:13,fontWeight:600,color:"hsl(var(--c-ink))"},children:"Ready-made"}),s.jsxs("span",{className:"tt-meta",style:{color:"hsl(var(--c-fg-subtle))"},children:["· fixed scope, price & turnaround",k.every(C=>!C.requires_cda)?" · public data · no CDA":""]})]}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,marginBottom:N.length?20:0},children:k.map(C=>s.jsx(l_,{service:C,onRequest:p},C.id))})]}),N.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[s.jsx("span",{style:{fontSize:13,fontWeight:600,color:"hsl(var(--c-ink))"},children:"Bespoke"}),s.jsxs("span",{className:"tt-meta",style:{color:"hsl(var(--c-fg-subtle))"},children:["· custom scope",N.some(C=>C.requires_cda)?" · confidential documents under CDA":""]})]}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 260px), 1fr))",gap:12},children:N.map(C=>s.jsx(l_,{service:C,onRequest:p},C.id))})]})]})]}),_&&_.length>0&&s.jsxs("div",{className:"xph-card",style:{padding:"20px 22px"},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:14},children:"What clients say"}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 280px), 1fr))",gap:16},children:_.map(C=>s.jsxs("blockquote",{style:{margin:0,borderLeft:"3px solid hsl(var(--c-partner-border))",paddingLeft:14},children:[s.jsxs("p",{className:"tt-body-sm",children:["“",C.text,"”"]}),s.jsx("footer",{className:"tt-mono-sm",style:{marginTop:8,color:"hsl(var(--c-fg-subtle))"},children:C.attribution})]},C.attribution))})]})]}),s.jsxs("div",{style:{width:320,maxWidth:"100%",display:"flex",flexDirection:"column",gap:16},children:[T&&s.jsxs("div",{className:"xph-card",style:{padding:18},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:12},children:"Coverage"}),g.some(C=>C.kind==="ta")&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginBottom:6},children:"Therapeutic areas"}),s.jsx("div",{style:{marginBottom:14},children:s.jsx(dv,{capabilities:g,kind:"ta"})})]}),g.some(C=>C.kind==="modality")&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginBottom:6},children:"Modalities"}),s.jsx("div",{style:{marginBottom:14},children:s.jsx(dv,{capabilities:g,kind:"modality"})})]}),g.some(C=>C.kind==="side")&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginBottom:6},children:"Engagement side"}),s.jsx(dv,{capabilities:g,kind:"side"})]})]}),w&&w.length>0&&s.jsxs("div",{className:"xph-card",style:{padding:18},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:12},children:"Senior advisors"}),w.map((C,A)=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:11,padding:A===0?"0 0 12px":A===w.length-1?"12px 0 0":"12px 0",borderBottom:A<w.length-1?"1px solid hsl(var(--c-border))":"none"},children:[s.jsx("div",{style:{width:38,height:38,borderRadius:"50%",flex:"none",background:"hsl(var(--c-partner-soft))",color:"hsl(var(--c-partner))",display:"grid",placeItems:"center",fontWeight:600,fontSize:12.5},children:C.name.split(/\s+/).filter(O=>!O.endsWith(".")).map(O=>O.charAt(0)).slice(0,2).join("").toUpperCase()}),s.jsxs("div",{style:{flex:1},children:[s.jsx("div",{className:"tt-body-sm",style:{color:"hsl(var(--c-ink))",fontWeight:600},children:C.name}),s.jsx("div",{className:"tt-meta",children:C.title})]})]},C.name))]}),j&&s.jsxs("div",{id:"contact",className:"xph-card",style:{padding:18},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:12},children:"Contact"}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[j.email&&s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx(qs,{size:15,style:{color:"hsl(var(--c-fg-subtle))",flex:"none"}}),s.jsx("span",{className:"tt-body-sm",children:j.email})]}),j.website&&s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[s.jsx(SH,{size:15,style:{color:"hsl(var(--c-fg-subtle))",flex:"none"}}),s.jsx("span",{className:"tt-body-sm",children:j.website})]}),j.locations&&s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",ga
884p:10},children:[s.jsx(Um,{size:15,style:{color:"hsl(var(--c-fg-subtle))",flex:"none",marginTop:2}}),s.jsx("span",{className:"tt-body-sm",children:j.locations})]})]}),s.jsx("p",{className:"tt-meta",style:{textAlign:"center",marginTop:12,color:"hsl(var(--c-fg-subtle))"},children:"Engagements run through xPharma. Nothing shared without your approval."})]})]})]})]})})}),h&&s.jsx(zse,{open:u,onOpenChange:d,partner:t,service:l,originSurface:"partner_profile"})]})}const gdt=["requested","scoping","active","completed","declined"],GW={requested:{label:"Requested",fg:"--c-warning-fg",bg:"--c-warning-soft"},scoping:{label:"Scoping",fg:"--c-accent-fg",bg:"--c-accent-soft"},active:{label:"Active",fg:"--c-positive-fg",bg:"--c-positive-soft"},completed:{label:"Completed",fg:"--c-fg-muted",bg:"--c-surface-2"},declined:{label:"Declined",fg:"--c-negative-fg",bg:"--c-negative-soft"}};function ydt(e){return gdt.includes(e)}function vdt(e){return ydt(e)?GW[e]:GW.requested}const xdt={not_required:{label:"No CDA needed",fg:"--c-fg-muted",bg:"--c-surface-2"},required:{label:"CDA required",fg:"--c-warning-fg",bg:"--c-warning-soft"},confirmed:{label:"CDA confirmed",fg:"--c-positive-fg",bg:"--c-positive-soft"}},YW={none:{label:"Not shared",fg:"--c-fg-muted",bg:"--c-surface-2"},requested:{label:"Requested",fg:"--c-warning-fg",bg:"--c-warning-soft"},granted:{label:"Shared",fg:"--c-positive-fg",bg:"--c-positive-soft"},denied:{label:"Denied",fg:"--c-negative-fg",bg:"--c-negative-soft"},revoked:{label:"Revoked",fg:"--c-negative-fg",bg:"--c-negative-soft"}};function bdt(e){return YW[e]??YW.none}const Fae=[{value:"proposal",label:"Proposal"},{value:"sow",label:"Statement of Work"},{value:"fee_schedule",label:"Fee Schedule"},{value:"report",label:"Report / Deliverable"},{value:"other",label:"Other"}];function wdt(e){var t;return e?((t=Fae.find(n=>n.value===e))==null?void 0:t.label)??e:null}function R$({label:e,fg:t,bg:n}){return s.jsx("span",{style:{display:"inline-flex",alignItems:"center",fontFamily:"var(--font-mono)",fontSize:10.5,letterSpacing:"0.05em",textTransform:"uppercase",fontWeight:600,padding:"3px 9px",borderRadius:20,color:`hsl(var(${t}))`,background:`hsl(var(${n}))`,whiteSpace:"nowrap"},children:e})}function Uk({status:e}){const t=vdt(e);return s.jsx(R$,{label:t.label,fg:t.fg,bg:t.bg})}function qk({cdaStatus:e}){const t=xdt[e];return!t||e==="not_required"?null:s.jsx(R$,{label:t.label,fg:t.fg,bg:t.bg})}function zae({status:e}){const t=bdt(e);return s.jsx(R$,{label:t.label,fg:t.fg,bg:t.bg})}function jdt(){var g;const{user:e,isAdmin:t,isLoading:n}=me(),{data:r,isLoading:i,isError:a,isFetching:o,refetch:l}=ng(),{data:c=[],isLoading:u,isError:d,isFetching:h,refetch:f}=nnt((g=r==null?void 0:r.organization)==null?void 0:g.id);if(n||i)return s.jsx(he,{children:s.jsx("div",{style:{display:"grid",placeItems:"center",minHeight:"50vh"},children:s.jsx(ne,{className:"animate-spin",size:22,style:{color:"hsl(var(--c-fg-subtle))"}})})});if(!e)return s.jsx(Pt,{to:"/auth",replace:!0});if(a)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"32px 24px 64px"},children:s.jsx("div",{className:"xph-card",children:s.jsx(ii,{title:"Couldn't load your partner profile",description:"Your session is still active. Retry the organization lookup before continuing.",onRetry:()=>{l()},isRetrying:o})})})});if(!(r!=null&&r.isApproved)&&!t)return s.jsx(Pt,{to:"/",replace:!0});const p=(r==null?void 0:r.organization)??null,m=(r==null?void 0:r.allMemberships)??[];return s.jsx(he,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px 64px"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:24,flexWrap:"wrap",marginBottom:24},children:[s.jsxs("div",{style:{minWidth:0,flex:1},children:[s.jsx("div",{className:"eyebrow",children:"Partner portal"}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,marginTop:8,flexWrap:"wrap"},children:[s.jsx("h1",{className:"tt-display-md",children:(p==null?void 0:p.name)??"Partner portal"}),s.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontFamily:"var(--font-mono)",fontSize:11,color:"hsl(var(--c-partner))",background:"hsl(var(--c-partner-soft))",border:"1px solid hsl(var(--c-partner-border))",borderRadius:4,padding:"3px 8px",letterSpacing:"0.04em",textTransform:"uppercase"},children:"Solution Partner"})]}),(p==null?void 0:p.location)&&s.jsx("p",{className:"tt-mono-sm",style:{marginTop:6},children:p.location})]}),s.jsxs("div",{style:{display:"flex",gap:8,flexShrink:0,alignItems:"center"},children:[m.length>=2&&s.jsx(Mae,{orgs:m.map(y=>({id:y.organization.id,name:y.organization.name,location:y.organization.location??""})),activeIndex:(r==null?void 0:r.activeOrgIndex)??0,onSwitch:y=>r==null?void 0:r.switchOrg(y)}),s.jsxs(oe,{to:"/partner/team",className:"xph-btn xph-btn-outline xph-btn-sm",style:{textDecoration:"none"},children:[s.jsx(po,{size:13}),"Team"]})]})]}),s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsxs("div",{style:{padding:"16px 18px",borderBottom:"1px solid hsl(var(--c-border))",display:"flex",alignItems:"center",gap:10},children:[s.jsx("span",{style:{width:30,height:30,borderRadius:7,background:"hsl(var(--c-partner-soft))",color:"hsl(var(--c-partner))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(gH,{size:16})}),s.jsxs("div",{style:{flex:1},children:[s.jsx("div",{className:"eyebrow",children:"Engagements"}),s.jsx("div",{className:"tt-display-sm",style:{marginTop:2},children:"Requests from xPharma clients"})]}),c.length>0&&s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:[c.length," total"]})]}),u?s.jsx("div",{style:{padding:40,display:"grid",placeItems:"center"},children:s.jsx(ne,{className:"animate-spin",size:20,style:{color:"hsl(var(--c-fg-subtle))"}})}):d?s.jsx(ii,{title:"Couldn't load engagements",description:"Something went wrong fetching your engagement inbox.",onRetry:()=>{f()},isRetrying:h}):c.length===0?s.jsxs("div",{style:{padding:40,textAlign:"center"},children:[s.jsx("div",{className:"tt-display-sm",children:"No engagements yet"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6,maxWidth:460,margin:"6px auto 0"},children:"When an xPharma client requests one of your services, the engagement will appear here — with the brief, the assets involved, and a shared document folder."})]}):s.jsx("div",{children:c.map(({engagement:y,counterpartName:b,serviceName:v})=>s.jsxs(oe,{to:`/partner/engagement/${y.id}`,style:{display:"flex",alignItems:"center",gap:14,padding:"13px 18px",borderBottom:"1px solid hsl(var(--c-border))",textDecoration:"none",flexWrap:"wrap"},children:[s.jsxs("div",{style:{flex:1,minWidth:220},children:[s.jsx("div",{className:"tt-body",style:{color:"hsl(var(--c-ink))",fontWeight:600},children:y.title}),s.jsxs("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:3},children:[b,v?` · ${v}`:""," · ",new Date(y.created_at).toLocaleDateString()]})]}),s.jsx(qk,{cdaStatus:y.cda_status}),s.jsx(Uk,{status:y.status})]},y.id))})]})]})})})}function _dt(e){const{user:t}=me();return Se({queryKey:Vt.partnerOrgRoster(t==null?void 0:t.id,e),queryFn:async()=>
884{if(!e)return[];const{data:n,error:r}=await W.rpc("get_partner_org_roster",{_org_id:e});if(r)throw r;return(n||[]).map(i=>({membershipId:i.membership_id,memberUserId:i.member_user_id,orgRole:i.org_role,status:i.status,joinedAt:i.joined_at,displayName:i.display_name??i.email??"Pending member",email:i.email??""}))},enabled:!!t&&!!e})}function Sdt(){const e=Ae(),{user:t}=me(),{guardMutation:n}=qe(),r=Ye();return $e({mutationFn:async i=>{if(n("Removing a team member"))throw new Error("Impersonation mode");const{error:a}=await W.rpc("remove_partner_org_member",{_membership_id:i.membershipId});if(a)throw a;return i},onSuccess:({membershipId:i,orgId:a,memberName:o})=>{e.invalidateQueries({queryKey:Vt.partnerOrgRoster(t==null?void 0:t.id,a)}),r({action:"remove_partner_org_member",entityType:Ve.partnerUsers,entityId:i,entityLabel:o,metadata:{org_id:a}})}})}function kdt(){const e=Ae(),{user:t}=me(),{guardMutation:n}=qe(),r=Ye();return $e({mutationFn:async i=>{if(n("Changing a member role"))throw new Error("Impersonation mode");const{error:a}=await W.rpc("set_partner_org_member_role",{_membership_id:i.membershipId,_new_role:i.newRole});if(a)throw a;return i},onSuccess:({membershipId:i,orgId:a,memberName:o,newRole:l})=>{e.invalidateQueries({queryKey:Vt.partnerOrgRoster(t==null?void 0:t.id,a)}),r({action:"set_partner_org_member_role",entityType:Ve.partnerUsers,entityId:i,entityLabel:o,metadata:{org_id:a,new_role:l}})}})}const QW={owner:"Owner",admin:"Admin",member:"Member"},XW={owner:0,admin:1,member:2};function ZW(e){return e?new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"—"}function Ndt(){const{user:e,isAdmin:t,isLoading:n}=me(),{data:r,isLoading:i,isError:a,isFetching:o,refetch:l}=ng(),{toast:c}=xt(),u=(r==null?void 0:r.partnerUser)??null,d=(r==null?void 0:r.organization)??null,h=(d==null?void 0:d.id)??null,f=t||(u==null?void 0:u.orgRole)==="owner"||(u==null?void 0:u.orgRole)==="admin",{data:p=[],isLoading:m,error:g}=_dt(h),{data:y=[]}=jre(h,{enabled:!!h&&f}),b=Sdt(),v=kdt(),w=_re(),_=Sre(),[j,S]=x.useState(!1),[k,N]=x.useState(null);if(n||i)return s.jsx(he,{children:s.jsx("div",{style:{display:"grid",placeItems:"center",minHeight:"50vh"},children:s.jsx(ne,{className:"animate-spin",size:22,style:{color:"hsl(var(--c-fg-subtle))"}})})});if(!e)return s.jsx(Pt,{to:"/auth",replace:!0});if(a)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"24px 24px 64px"},children:s.jsx("div",{className:"xph-card",children:s.jsx(ii,{title:"Couldn't load your partner profile",description:"Your session is still active. Retry the organization lookup before managing the team.",onRetry:()=>{l()},isRetrying:o})})})});if(!(r!=null&&r.isApproved)&&!t)return s.jsx(Pt,{to:"/",replace:!0});const T=[...p].sort(($,F)=>(XW[$.orgRole]??9)-(XW[F.orgRole]??9)||$.joinedAt.localeCompare(F.joinedAt)),C=y.filter($=>$.status==="invited"||$.status==="expired"),A=$=>f&&$.orgRole!=="owner"&&$.memberUserId!==e.id,O=async($,F)=>{try{const B=await w.mutateAsync({invitationId:$,orgId:h,email:F});_k(B.status)?c({title:`${B.userName||F} was added to your team`,description:B.status==="linked_email_failed"?"Their notification email could not be delivered, but they can sign in and access the team now.":void 0}):B.status==="invited_email_failed"?c({title:"Invitation remains pending",description:`The email to ${F} could not be delivered. Use Resend to try again.`,variant:"destructive"}):c({title:"Invitation resent",description:`A new invitation was emailed to ${F}.`})}catch(B){c({title:"Resend failed",description:Lo(B),variant:"destructive"})}},z=async()=>{if(!(!k||!h))try{k.type==="remove"?(await b.mutateAsync({membershipId:k.membershipId,orgId:h,memberName:k.memberName}),c({title:"Member removed"})):(await _.mutateAsync({invitationId:k.invitationId,orgId:h,email:k.email}),c({title:"Invitation revoked"}))}catch($){c({title:"Action failed",description:Lo($),variant:"destructive"})}finally{N(null)}};return s.jsxs(he,{children:[s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:s.jsxs("div",{className:"xph-container",style:{padding:"24px 24px 64px"},children:[s.jsxs(oe,{to:"/partner",className:"tt-mono-sm",style:{display:"inline-flex",alignItems:"center",gap:6,textDecoration:"none",color:"hsl(var(--c-fg-muted))",marginBottom:16},children:[s.jsx(Ph,{size:13}),"Partner portal"]}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",gap:16,flexWrap:"wrap",marginBottom:20},children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Partner · organization"}),s.jsx("h1",{className:"tt-display-md",style:{marginTop:6},children:"Team"}),s.jsxs("p",{className:"tt-mono-sm",style:{marginTop:4,color:"hsl(var(--c-fg-subtle))"},children:[(d==null?void 0:d.name)??"—"," · ",T.length," member",T.length===1?"":"s"]})]}),f&&h&&s.jsxs("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",onClick:()=>S(!0),children:[s.jsx(io,{size:13}),"Invite member"]})]}),!h&&s.jsxs("div",{className:"xph-card",style:{padding:32,textAlign:"center"},children:[s.jsx("div",{className:"tt-display-sm",children:"No organization"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6},children:"Your partner membership isn't linked to an organization yet."})]}),h&&s.jsxs("div",{className:"xph-card",style:{overflow:"hidden",marginBottom:16},children:[s.jsx("div",{style:{padding:"14px 18px",borderBottom:"1px solid hsl(var(--c-border))"},children:s.jsx("div",{className:"tt-display-sm",style:{fontSize:15},children:"Members"})}),m?s.jsx("div",{style:{padding:18},children:s.jsx(ce,{className:"h-12 w-full"})}):g?s.jsx("p",{className:"tt-body-sm",style:{padding:18,color:"hsl(var(--c-negative-fg))"},children:Lo(g,"Failed to load the roster.")}):s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{className:"xph-table",style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[s.jsx("thead",{children:s.jsx("tr",{children:["Member","Email","Role","Joined",""].map($=>s.jsx("th",{style:{textAlign:"left",padding:"9px 14px",fontFamily:"var(--font-mono)",fontSize:10.5,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.06em",color:"hsl(var(--c-fg-subtle))",borderBottom:"1px solid hsl(var(--c-border))"},children:$},$))})}),s.jsx("tbody",{children:T.map($=>s.jsxs("tr",{children:[s.jsxs("td",{style:{padding:"11px 14px",borderBottom:"1px solid hsl(var(--c-border))",color:"hsl(var(--c-ink))",fontWeight:500},children:[$.displayName,$.memberUserId===e.id&&s.jsx("span",{className:"tt-mono-sm",style:{marginLeft:8,color:"hsl(var(--c-fg-subtle))"},children:"You"})]}),s.jsx("td",{style:{padding:"11px 14px",borderBottom:"1px solid hsl(var(--c-border))",color:"hsl(var(--c-fg-muted))"},children:$.email}),s.jsx("td",{style:{padding:"11px 14px",borderBottom:"1px solid hsl(var(--c-border))"},children:A($)?s.jsxs($n,{value:$.orgRole,onValueChange:F=>v.mutateAsync({membershipId:$.membershipId,newRole:F,orgId:h,memberName:$.displayName}).catch(B=>c({title:"Role change failed",description:Lo(B),variant:"destructive"})),children:[s.jsx(On,{style:{width:120,height:30,fontSize:12.5},children:s.jsx(Ln,{})}),s.jsxs(In,{children:[s.jsx(Rt,{value:"member",children:"Member"}),s.jsx(Rt,{value:"admin",children:"Admin"})]})]}):s.jsx("span",{className:"tt-mono-sm",children:QW[$.orgRole]??$.orgRole})}),s.jsx("td",{style:{padding:"11px 14px",borderBottom:"1px solid hsl(var(--c-border))",fontFamily:"var(--font-mono)",fontSize:12,color:"hsl(var(--c-fg-muted))"},children:ZW($.joinedAt)}),s.jsx("td",{style:{padding:"11px 14px",borderBottom:"1px solid hsl(var(--c-border))",textAlign:"right"},children:A($)&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm","aria-label":`Remove ${$.dis
884playName}`,onClick:()=>N({type:"remove",membershipId:$.membershipId,memberName:$.displayName}),children:s.jsx(Gl,{size:13})})})]},$.membershipId))})]})})]}),h&&f&&C.length>0&&s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsx("div",{style:{padding:"14px 18px",borderBottom:"1px solid hsl(var(--c-border))"},children:s.jsx("div",{className:"tt-display-sm",style:{fontSize:15},children:"Pending invitations"})}),s.jsx("div",{style:{padding:"6px 0"},children:C.map($=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"10px 18px",borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-ink))",fontWeight:500},children:$.email}),s.jsxs("span",{className:"tt-mono-sm",style:{marginLeft:10,color:"hsl(var(--c-fg-subtle))"},children:[QW[$.invitedRole]??$.invitedRole," · expires ",ZW($.expiresAt)]})]}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm","aria-label":`Resend invitation to ${$.email}`,onClick:()=>O($.id,$.email),disabled:w.isPending,children:s.jsx(ps,{size:13})}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm","aria-label":`Revoke invitation to ${$.email}`,onClick:()=>N({type:"revoke",invitationId:$.id,email:$.email}),children:s.jsx(Ui,{size:13})})]},$.id))})]})]})}),h&&s.jsx($ae,{open:j,onOpenChange:S,orgId:h}),s.jsx(ku,{open:k!==null,onOpenChange:$=>!$&&N(null),onConfirm:z,title:(k==null?void 0:k.type)==="remove"?"Remove team member?":"Revoke invitation?",description:(k==null?void 0:k.type)==="remove"?`${k.memberName} will lose access to the partner portal for this firm.`:(k==null?void 0:k.type)==="revoke"?`The invitation to ${k.email} will stop working immediately.`:"",isLoading:b.isPending||_.isPending,confirmLabel:(k==null?void 0:k.type)==="remove"?"Remove":"Revoke"})]})}const Wx="partner-engagement-documents",Cdt=25*1024*1024,Py={pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",txt:"text/plain",csv:"text/csv"},Adt=Object.keys(Py).map(e=>`.${e}`).join(",");function Tdt(e,t){let r=Array.from(e.replace(/[/\\]/g,"_")).filter(a=>a.charCodeAt(0)>=32&&a.charCodeAt(0)!==127).join("").trim();const i=`.${t}`;return r.toLowerCase().endsWith(i)&&(r=r.slice(0,-i.length)),r=Array.from(r).slice(0,200-i.length).join("").trim(),(r||"document")+i}function Edt(e){const{user:t}=me(),n=Ae();return x.useEffect(()=>{if(!e)return;const r=W.channel(`engagement-docs-${e}`).on("postgres_changes",{event:"*",schema:"public",table:"partner_engagement_documents",filter:`engagement_id=eq.${e}`},()=>n.invalidateQueries({queryKey:Vt.engagementDocuments(t==null?void 0:t.id,e)})).subscribe();return()=>{W.removeChannel(r)}},[e,n,t==null?void 0:t.id]),Se({queryKey:Vt.engagementDocuments(t==null?void 0:t.id,e),queryFn:async()=>{const{data:r,error:i}=await W.from("partner_engagement_documents").select("*").eq("engagement_id",e).order("created_at",{ascending:!1});if(i)throw i;return r??[]},enabled:!!t&&!!e,refetchInterval:3e4})}function Pdt(){const e=Ae(),{user:t}=me(),{guardMutation:n}=qe();return $e({mutationFn:async({engagementId:r,file:i,category:a,side:o})=>{var f;if(n("Uploading a document"))throw new Error("Impersonation mode");if(!t)throw new Error("Not signed in.");const l=((f=i.name.split(".").pop())==null?void 0:f.toLowerCase())??"";if(!Py[l])throw new Error(`File type .${l||"?"} is not supported (${Object.keys(Py).join(", ")}).`);if(i.size>Cdt)throw new Error("Files can be at most 25 MB.");const c=`${r}/${crypto.randomUUID()}.${l}`,{error:u}=await W.storage.from(Wx).upload(c,i,{upsert:!1,contentType:Py[l]});if(u)throw u;const{data:d,error:h}=await W.from("partner_engagement_documents").insert({engagement_id:r,uploaded_by:t.id,file_name:Tdt(i.name,l),file_path:c,category:a??null,file_size:i.size,mime_type:Py[l],uploaded_by_side:o}).select().single();if(h)throw await W.storage.from(Wx).remove([c]).catch(()=>{}),h;return d},onSuccess:r=>
884{e.invalidateQueries({queryKey:Vt.engagementDocuments(t==null?void 0:t.id,r.engagement_id)})}})}function Odt(){const e=Ae(),{user:t}=me(),{guardMutation:n}=qe();return $e({mutationFn:async r=>{if(n("Deleting a document"))throw new Error("Impersonation mode");const{data:i,error:a}=await W.from("partner_engagement_documents").delete().eq("id",r.id).select("id").maybeSingle();if(a)throw a;if(!i)throw new Error("The document no longer exists or you no longer have permission to delete it.");const{error:o}=await W.storage.from(Wx).remove([r.file_path]);return{...r,cleanupWarning:o?"The document was removed from the engagement, but storage cleanup is pending.":null}},onSuccess:r=>{e.invalidateQueries({queryKey:Vt.engagementDocuments(t==null?void 0:t.id,r.engagement_id)})}})}function Idt(){const e=Ye();return{open:async r=>{const i=window.open("","_blank");let a;try{const{data:o,error:l}=await W.storage.from(Wx).createSignedUrl(r.file_path,300);if(l||!(o!=null&&o.signedUrl))throw l??new Error("Could not open the document.");a=o.signedUrl}catch(o){throw i==null||i.close(),o}i?i.location.href=a:window.open(a,"_blank"),e({action:"document_viewed",entityType:Ve.partnerEngagementDocuments,entityId:r.id,entityLabel:r.file_name,metadata:{engagement_id:r.engagement_id}})},download:async r=>{const{data:i,error:a}=await W.storage.from(Wx).download(r.file_path);if(a||!i)throw a??new Error("Could not download the document.");const o=URL.createObjectURL(i),l=document.createElement("a");l.href=o,l.download=r.file_name,l.click(),URL.revokeObjectURL(o),e({action:"document_downloaded",entityType:Ve.partnerEngagementDocuments,entityId:r.id,entityLabel:r.file_name,metadata:{engagement_id:r.engagement_id}})}}}const Rdt={client:"Client",partner:"Partner",admin:"xPharma"};function Ddt(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}function JW(e,t){const n=e instanceof Error?e.message:String((e==null?void 0:e.message)??"");return n.includes("row-level security")||n.includes("42501")||n.includes("file_path_invalid")?"This engagement is closed or you no longer have access — refresh and try again.":n||t}function Bae({engagementId:e,engagementOpen:t,counterpartName:n,side:r,canUpload:i}){const{toast:a}=xt(),{user:o,isAdmin:l}=me(),{data:c=[],isLoading:u,isError:d,isFetching:h,refetch:f}=Edt(e),p=Pdt(),m=Odt(),{open:g,download:y}=Idt(),b=x.useRef(null),[v,w]=x.useState(""),[_,j]=x.useState(null),S=N=>{N&&(p.mutate({engagementId:e,file:N,category:v||null,side:r},{onSuccess:T=>{w(""),a({title:"Document uploaded",description:T.file_name})},onError:T=>a({title:"Upload failed",description:JW(T,"Could not upload the document."),variant:"destructive"})}),b.current&&(b.current.value=""))},k=(N,T)=>{N().catch(C=>a({title:T,description:JW(C,"Please try again."),variant:"destructive"}))};return s.jsxs("div",{className:"xph-card",style:{padding:"16px 22px",marginTop:16},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,flexWrap:"wrap"},children:[s.jsx("div",{className:"eyebrow",children:"Shared documents"}),t&&i?s.jsxs("span",{style:{display:"inline-flex",gap:8,alignItems:"center"},children:[s.jsxs("select",{className:"xph-input",style:{height:32,fontSize:12,minWidth:150},value:v,onChange:N=>w(N.target.value),"aria-label":"Document category",children:[s.jsx("option",{value:"",children:"Category (optional)"}),Fae.map(N=>s.jsx("option",{value:N.value,children:N.label},N.value))]}),s.jsx("input",{ref:b,type:"file",accept:Adt,style:{display:"none"},onChange:N=>{var T;return S(((T=N.target.files)==null?void 0:T[0])??null)}}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",disabled:p.isPending,onClick:()=>{var N;return(N=b.current)==null?void 0:N.click()},children:[p.isPending?s.jsx(ne,{size:13,className:"animate-spin"}):s.jsx(yj,{size:13}),"Upload"]})]}):s.jsx("span",{className:"tt-meta",style:{color:"hsl(var(--c-fg-subtle))"},children:t?"Read-only view":"Engagement closed — documents are read-only"})]}),s.jsx("p",{className:"tt-meta",style:{color:"hsl(var(--c-fg-subtle))",marginTop:6},children:"Proposals, SOWs, fee schedules, and deliverables — visible to both sides. PDF, Office, text or CSV up to 25 MB."}),u?s.jsx("div",{style:{padding:20,display:"grid",placeItems:"center"},children:s.jsx(ne,{className:"animate-spin",size:18,style:{color:"hsl(var(--c-fg-subtle))"}})}):d?s.jsx(ii,{compact:!0,title:"Couldn't load documents",description:"Retry the shared document list.",onRetry:()=>{f()},isRetrying:h}):c.length===0?s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:10},children:["Nothing shared yet. Documents you upload here are visible to ",n,"."]}):s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:12},children:c.map(N=>{const T=N.uploaded_by===(o==null?void 0:o.id)||l;return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"10px 12px",border:"1px solid hsl(var(--c-border))",borderRadius:8,flexWrap:"wrap"},children:[s.jsx(ti,{size:15,style:{color:"hsl(var(--c-fg-subtle))",flex:"none"}}),s.jsxs("div",{style:{flex:1,minWidth:200},children:[s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-ink))",fontWeight:600},children:N.file_name}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:[Rdt[N.uploaded_by_side]??N.uploaded_by_side,wdt(N.category),Ddt(N.file_size),new Date(N.created_at).toLocaleDateString()].filter(
884Boolean).join(" · ")})]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:()=>k(()=>g(N),"Preview failed"),children:[s.jsx(tc,{size:13}),"Open"]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:()=>k(()=>y(N),"Download failed"),children:[s.jsx(Rl,{size:13}),"Download"]}),T&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-icon","aria-label":`Delete ${N.file_name}`,style:{color:"hsl(var(--c-negative-fg))"},disabled:m.isPending,onClick:()=>j(N),children:s.jsx(Gl,{size:14})})]},N.id)})}),s.jsx(xp,{open:_!==null,onOpenChange:N=>!N&&j(null),children:s.jsxs(Qd,{children:[s.jsxs(Xd,{children:[s.jsxs(Jd,{children:["Delete ",_==null?void 0:_.file_name,"?"]}),s.jsx(eh,{children:"The document is removed for both sides. This cannot be undone."})]}),s.jsxs(Zd,{children:[s.jsx(nh,{children:"Cancel"}),s.jsx(th,{onClick:()=>{_&&m.mutate(_,{onSuccess:N=>a({title:"Document deleted",description:N.cleanupWarning??void 0}),onError:N=>a({title:"Delete failed",description:N instanceof Error?N.message:"Please try again.",variant:"destructive"})}),j(null)},children:"Delete"})]})]})})]})}function Mdt(){var z;const{id:e}=Zs(),{toast:t}=xt(),{user:n,isAdmin:r,isLoading:i}=me(),{data:a,isLoading:o,isError:l,isFetching:c,refetch:u}=ng(),{data:d,isLoading:h,isError:f,isFetching:p,refetch:m}=Iie(e),{data:g=[],isLoading:y,isError:b,isFetching:v,refetch:w}=Rie(e),_=Die(),j=int(),[S,k]=x.useState(!1);if(i||o||h)return s.jsx(he,{children:s.jsx("div",{style:{display:"grid",placeItems:"center",minHeight:"50vh"},children:s.jsx(ne,{className:"animate-spin",size:22,style:{color:"hsl(var(--c-fg-subtle))"}})})});if(!n)return s.jsx(Pt,{to:"/auth",replace:!0});if(l)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:s.jsx("div",{className:"xph-card",children:s.jsx(ii,{title:"Couldn't load your partner profile",description:"Your session is still active. Retry before opening this engagement.",onRetry:()=>{u()},isRetrying:c})})})});if(!(a!=null&&a.isApproved)&&!r)return s.jsx(Pt,{to:"/",replace:!0});if(f)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:s.jsx("div",{className:"xph-card",children:s.jsx(ii,{title:"Couldn't load this engagement",description:"The request may still be available. Retry instead of treating this temporary failure as not found.",onRetry:()=>{m()},isRetrying:p})})})});if(!d)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:s.jsxs("div",{className:"xph-card",style:{padding:32,textAlign:"center",marginTop:20},children:[s.jsx("div",{className:"tt-display-sm",children:"Engagement not found"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6},children:"This engagement does not exist or is not visible to your firm."}),s.jsx(oe,{to:"/partner",className:"xph-btn xph-btn-outline xph-btn-sm",style:{textDecoration:"none",marginTop:14,display:"inline-flex"},children:"Back to portal"})]})})});const{engagement:N,serviceName:T,clientName:C}=d,A=N.status,O=($,F)=>{_.mutate({engagementId:N.id,status:$},{onSuccess:()=>t({title:F}),onError:B=>t({title:"Update failed",description:Cl(B),variant:"destructive"})})};return s.jsxs(he,{children:[s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:s.jsxs("div",{className:"xph-container",style:{padding:"20px 24px 64px",maxWidth:860},children:[s.jsxs(oe,{to:"/partner",className:"tt-mono-sm",style:{display:"inline-flex",alignItems:"center",gap:6,textDecoration:"none",color:"hsl(var(--c-fg-muted))",marginBottom:16},children:[s.jsx(Ph,{size:13}),"Engagements"]}),s.jsxs("div",{className:"xph-card",style:{padding:"20px 22px",marginBottom:16},children:[s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12,flexWrap:"wrap"},children:[s.jsxs("div",{style:{flex:1,minWidth:260},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-partner))"},children:C}),s.jsx("h1",{className:"tt-display-md",style:{marginTop:4},children:N.title}),s.jsxs("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:6},children:[T??"General inquiry"," · received ",new Date(N.created_at).toLocaleDateString()]})]}),s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[s.jsx(qk,{cdaStatus:N.cda_status}),s.jsx(Uk,{status:A})]})]}),(A==="requested"||A==="scoping")&&s.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginTop:16,paddingTop:14,borderTop:"1px solid hsl(var(--c-border))"},children:[A==="requested"&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",disabled:_.isPending,onClick:()=>O("scoping","Scoping started — the client has been notified."),children:"Start scoping"}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{color:"hsl(var(--c-negative-fg))"},disabled:_.isPending,onClick:()=>k(!0),children:"Decline"})]})]}),s.jsxs("div",{className:"xph-card",style:{padding:"16px 22px",marginBottom:16},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:8},children:"Brief"}),N.brief?s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg))",whiteSpace:"pre-wrap"},children:N.brief}):s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:["No brief provided — the client requested ",T??"a general engagement","."]})]}),s.jsxs("div",{className:"xph-card",style:{padding:"16px 22px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10},children:[s.jsx("div",{className:"eyebrow",children:"Assets in scope"}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:[g.length," attached"]})]}),y?s.jsx("div",{style:{padding:20,display:"grid",placeItems:"center"},children:s.jsx(ne,{className:"animate-spin",size:18,style:{color:"hsl(var(--c-fg-subtle))"}})}):b?s.jsx(ii,{compact:!0,title:"Couldn't load the asset list",description:"Retry the engagement asset projection.",onRetry:()=>{w()},isRetrying:v}):g.length===0?s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:10},children:"No assets attached to this engagement yet."}):s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:12},children:g.map($=>{const F=$.access_status==="granted",B=A!=="completed"&&A!=="declined"&&($.access_status==="none"||$.access_status==="denied"||$.access_status==="revoked");return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"10px 12px",border:"1px solid hsl(var(--c-border))",borderRadius:8,flexWrap:"wrap"},children:[!F&&s.jsx(Zo,{size:13,style:{color:"hsl(var(--c-fg-subtle))",flex:"none"}}),s.jsxs("div",{style:{flex:1,minWidth:200},children:[s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-ink))",fontWeight:600},children:$.product_name}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:[$.therapeutic_area,Fj("stage",$.stage),Fj("modality",$.modality)].filter(
884Boolean).join(" · ")}),($.access_status==="denied"||$.access_status==="revoked")&&$.decision_reason&&s.jsxs("p",{className:"tt-meta",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:["Reason: ",$.decision_reason]})]}),s.jsx(zae,{status:$.access_status}),F&&s.jsx(oe,{to:`/partner/asset/${$.engagement_asset_id}`,className:"xph-btn xph-btn-primary xph-btn-sm",style:{textDecoration:"none"},children:"View details"}),B&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",disabled:j.isPending,onClick:()=>j.mutate({engagementAssetId:$.engagement_asset_id,engagementId:N.id},{onSuccess:()=>t({title:"Access requested",description:`${C} has been asked to share this asset's details.`}),onError:P=>t({title:"Request failed",description:Cl(P),variant:"destructive"})}),children:"Request access"}),$.access_status==="requested"&&s.jsxs("span",{className:"tt-meta",style:{color:"hsl(var(--c-fg-subtle))"},children:["Awaiting ",C]})]},$.engagement_asset_id)})}),s.jsxs("p",{className:"tt-meta",style:{color:"hsl(var(--c-fg-subtle))",marginTop:10},children:["Details cover the asset schema and non-confidential data room once the client shares access",N.requires_cda&&N.cda_status!=="confirmed"?" (their CDA confirmation unlocks sharing)":"","."]})]}),s.jsx(Bae,{engagementId:N.id,engagementOpen:A!=="completed"&&A!=="declined",counterpartName:C,side:"partner",canUpload:((z=a==null?void 0:a.allMemberships)==null?void 0:z.some($=>$.organization.id===N.partner_org_id))??!1})]})}),s.jsx(xp,{open:S,onOpenChange:k,children:s.jsxs(Qd,{children:[s.jsxs(Xd,{children:[s.jsx(Jd,{children:"Decline this engagement?"}),s.jsxs(eh,{children:["The request from ",C," will be closed as declined and they will be notified. This cannot be undone."]})]}),s.jsxs(Zd,{children:[s.jsx(nh,{children:"Cancel"}),s.jsx(th,{onClick:()=>{O("declined","Engagement declined"),k(!1)},children:"Decline"})]})]})})]})}function $dt(e){const{user:t}=me();return Se({queryKey:Vt.engagementOfLink(t==null?void 0:t.id,e),queryFn:async()=>{const{data:n,error:r}=await W.from("partner_engagement_assets").select("engagement_id").eq("id",e).maybeSingle();if(r)throw r;return(n==null?void 0:n.engagement_id)??null},enabled:!!t&&!!e})}function Ldt(e){const{user:t}=me();return Se({queryKey:Vt.partnerAssetDocuments(t==null?void 0:t.id,e),queryFn:async()=>{const{data:n,error:r}=await W.from("data_room_documents").select("id, file_name, file_path, file_size, category_code, mime_type").eq("asset_id",e).order("file_name");if(r)throw r;return n??[]},enabled:!!t&&!!e,refetchInterval:3e4})}function Fdt(e,t){var n;if(t==null||t==="")return null;switch(e.type){case"boolean":return t?"Yes":"No";case"array":return Array.isArray(t)&&t.length?t.join(", "):null;case"number":return typeof t=="number"?t.toLocaleString():String(t);case"select":{const r=(n=e.options)==null?void 0:n.find(i=>i.value===t);return(r==null?void 0:r.label)??String(t)}default:return String(t)}}function zdt(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}function Bdt(e){const t=e instanceof Error?e.message:String((e==null?void 0:e.message)??"");return["not_granted","engagement_closed","forbidden","link_not_found"].some(n=>t.includes(n))}function Vdt(){const{id:e}=Zs(),{toast:t}=xt(),n=Ye(),{user:r,isAdmin:i,isLoading:a}=me(),{data:o,isLoading:l,isError:c,isFetching:u,refetch:d}=ng(),{data:h,isError:f,isFetching:p,refetch:m}=$dt(e),{data:g,isLoading:y,error:b,isFetching:v,refetch:w}=rnt(e,h),{data:_=[],isError:j,isFetching:S,refetch:k}=Ldt(g==null?void 0:g.id);if(a||l||y)return s.jsx(he,{children:s.jsx("div",{style:{display:"grid",placeItems:"center",minHeight:"50vh"},children:s.jsx(ne,{className:"animate-spin",size:22,style:{color:"hsl(var(--c-fg-subtle))"}})})});if(!r)return s.jsx(Pt,{to:"/auth",replace:!0});if(c)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:s.jsx("div",{className:"xph-card",children:s.jsx(ii,{title:"Couldn't load your partner profile",description:"Your session is still active. Retry before opening this asset.",onRetry:()=>{d()},isRetrying:u})})})});if(!(o!=null&&o.isApproved)&&!i)return s.jsx(Pt,{to:"/",replace:!0});if(f)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:s.jsx("div",{className:"xph-card",children:s.jsx(ii,{title:"Couldn't load the engagement link",description:"Retry before loading any shared asset data.",onRetry:()=>{m()},isRetrying:p})})})});if(b&&!Bdt(b))return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:s.jsx("div",{className:"xph-card",children:s.jsx(ii,{title:"Couldn't load asset details",description:"The shared projection could not be loaded. Retry before treating the asset as unavailable.",onRetry:()=>{w()},isRetrying:v})})})});if(b||!g)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:s.jsxs("div",{className:"xph-card",style:{padding:32,textAlign:"center",marginTop:20,maxWidth:520,margin:"20px auto 0"},children:[s.jsx(Zo,{size:22,style:{color:"hsl(var(--c-fg-subtle))",margin:"0 auto 10px"}}),s.jsx("div",{className:"tt-display-sm",children:"Asset details unavailable"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6},children:b?Cl(b,"These details are not available to you."):"These details are not available to you."}),s.jsx(oe,{to:h?`/partner/engagement/${h}`:"/partner",className:"xph-btn xph-btn-outline xph-btn-sm",style:{textDecoration:"none",marginTop:14,display:"inline-flex"},children:"Back to the engagement"})]})})});const N=async C=>{const A=window.open("","_blank"),{data:O,error:z}=await W.storage.from("supplier-documents").createSignedUrl(C.file_path,300);if(z||!(O!=null&&O.signedUrl)){A==null||A.close(),t({title:"Preview failed",description:(z==null?void 0:z.message)??"Could not open the document.",variant:"destructive"});return}A?A.location.href=O.signedUrl:window.open(O.signedUrl,"_blank"),n({action:"view_document",entityType:Ve.dataRoomDocuments,entityId:C.id,entityLabel:C.file_name,metadata:{asset_id:g.id,engagement_asset_id:e,surface:"partner_portal"}})},T=async C=>{const{data:A,error:O}=await W.storage.from("supplier-documents").download(C.file_path);
884if(O||!A){t({title:"Download failed",description:(O==null?void 0:O.message)??"Could not download the document.",variant:"destructive"});return}const z=URL.createObjectURL(A),$=document.createElement("a");$.href=z,$.download=C.file_name,$.click(),URL.revokeObjectURL(z),n({action:"download_document",entityType:Ve.dataRoomDocuments,entityId:C.id,entityLabel:C.file_name,metadata:{asset_id:g.id,engagement_asset_id:e,surface:"partner_portal"}})};return s.jsx(he,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:s.jsxs("div",{className:"xph-container",style:{padding:"20px 24px 64px",maxWidth:860},children:[s.jsxs(oe,{to:h?`/partner/engagement/${h}`:"/partner",className:"tt-mono-sm",style:{display:"inline-flex",alignItems:"center",gap:6,textDecoration:"none",color:"hsl(var(--c-fg-muted))",marginBottom:16},children:[s.jsx(Ph,{size:13}),"Engagement"]}),s.jsxs("div",{className:"xph-card",style:{padding:"20px 22px",marginBottom:16},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-partner))"},children:"Shared asset details"}),s.jsx("h1",{className:"tt-display-md",style:{marginTop:4},children:g.product_name}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:6},children:[g.therapeutic_area,Fj("stage",g.stage),Fj("modality",g.modality)].filter(Boolean).join(" · ")}),s.jsx("p",{className:"tt-meta",style:{color:"hsl(var(--c-fg-subtle))",marginTop:10},children:"Shared by the client for this engagement. Valuation figures are never part of shared details. Access can be revoked at any time."})]}),vi.map(C=>{const A=C.fields.map(O=>({field:O,value:Fdt(O,g[O.key])})).filter(O=>O.value!==null);return A.length===0?null:s.jsxs("div",{className:"xph-card",style:{padding:"16px 22px",marginBottom:16},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:12},children:C.label}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:A.map(({field:O,value:z})=>s.jsxs("div",{children:[s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:O.label}),s.jsx("div",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg))",marginTop:2,whiteSpace:O.type==="textarea"?"pre-wrap":void 0},children:z})]},O.key))})]},C.key)}),s.jsxs("div",{className:"xph-card",style:{padding:"16px 22px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10},children:[s.jsx("div",{className:"eyebrow",children:"Data room"}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:[_.length," document",_.length===1?"":"s"]})]}),j?s.jsx(ii,{compact:!0,title:"Couldn't load documents",description:"Retry the granted document list.",onRetry:()=>{k()},isRetrying:S}):_.length===0?s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:10},children:"No shareable documents on this asset yet. Confidential documents are never shared here."}):s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:12},children:_.map(C=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"10px 12px",border:"1px solid hsl(var(--c-border))",borderRadius:8,flexWrap:"wrap"},children:[s.jsx(ti,{size:15,style:{color:"hsl(var(--c-fg-subtle))",flex:"none"}}),s.jsxs("div",{style:{flex:1,minWidth:200},children:[s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-ink))",fontWeight:600},children:C.file_name}),s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:[C.category_code,zdt(C.file_size)].filter(Boolean).join(" · ")})]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",onClick:()=>N(C),children:[s.jsx(tc,{size:13}),"Open"]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",onClick:()=>T(C),children:[s.jsx(Rl,{size:13}),"Download"]})]},C.id))})]})]})})})}function Wdt(){var p;const{user:e,isLoading:t}=me(),{data:n,isLoading:r,isError:i,isFetching:a,refetch:o}=An(),l=((p=n==null?void 0:n.supplier)==null?void 0:p.id)??null,{data:c=[],isLoading:u,isError:d,isFetching:h,refetch:f}=Oie(l);return t||r?s.jsx(he,{children:s.jsx("div",{style:{display:"grid",placeItems:"center",minHeight:"50vh"},children:s.jsx(ne,{className:"animate-spin",size:22,style:{color:"hsl(var(--c-fg-subtle))"}})})}):e?i?s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:s.jsx("div",{className:"xph-card",children:s.jsx(ii,{title:"Couldn't load your supplier profile",description:"Your session is still active. Retry the supplier lookup before continuing.",onRetry:()=>{o()},isRetrying:a})})})}):l?s.jsx(he,{children:s.jsx(Ng,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:s.jsxs("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:[s.jsxs(oe,{to:"/supplier",className:"tt-mono-sm",style:{display:"inline-flex",alignItems:"center",gap:6,textDecoration:"none",color:"hsl(var(--c-fg-muted))",marginBottom:16},children:[s.jsx(Ph,{size:13}),"Dashboard"]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:20}
884,children:[s.jsx("span",{style:{width:34,height:34,borderRadius:8,background:"hsl(var(--c-partner-soft))",color:"hsl(var(--c-partner))",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx(gH,{size:17})}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Solution Partners"}),s.jsx("h1",{className:"tt-display-md",children:"Engagements"})]})]}),u?s.jsx("div",{className:"xph-card",style:{padding:40,display:"grid",placeItems:"center"},children:s.jsx(ne,{className:"animate-spin",size:20,style:{color:"hsl(var(--c-fg-subtle))"}})}):d?s.jsx("div",{className:"xph-card",children:s.jsx(ii,{title:"Couldn't load engagements",description:"Something went wrong fetching your engagements.",onRetry:()=>{f()},isRetrying:h})}):c.length===0?s.jsxs("div",{className:"xph-card",style:{padding:40,textAlign:"center"},children:[s.jsx("div",{className:"tt-display-sm",children:"No engagements yet"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",maxWidth:460,margin:"6px auto 0"},children:"Request a service from a solution partner — from a partner profile or your asset workspace — and the engagement will be tracked here."}),s.jsx(oe,{to:"/solutions-partners",className:"xph-btn xph-btn-outline xph-btn-sm",style:{textDecoration:"none",marginTop:14,display:"inline-flex"},children:"Browse partners"})]}):s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:c.map(({engagement:m,counterpartName:g,serviceName:y})=>s.jsxs(oe,{to:`/supplier/engagements/${m.id}`,className:"xph-card",style:{display:"flex",alignItems:"center",gap:14,padding:"14px 18px",textDecoration:"none",flexWrap:"wrap"},children:[s.jsxs("div",{style:{flex:1,minWidth:220},children:[s.jsx("div",{className:"tt-body",style:{color:"hsl(var(--c-ink))",fontWeight:600},children:m.title}),s.jsxs("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:3},children:[g,y?` · ${y}`:""," · ",new Date(m.created_at).toLocaleDateString()]})]}),s.jsx(qk,{cdaStatus:m.cda_status}),s.jsx(Uk,{status:m.status})]},m.id))})]})})})}):s.jsx(Pt,{to:"/",replace:!0}):s.jsx(Pt,{to:"/auth",replace:!0})}function Udt(){var Ze;const{id:e}=Zs(),{toast:t}=xt(),{user:n,isLoading:r}=me(),{data:i,isLoading:a,isError:o,isFetching:l,refetch:c}=An(),{data:u,isLoading:d,isError:h,isFetching:f,refetch:p}=Iie(e),{data:m=[],isLoading:g,isError:y,isFetching:b,refetch:v}=Rie(e),{data:w=[]}=lnt(u==null?void 0:u.engagement.client_supplier_id),_=Die(),j=unt(),S=dnt(),k=snt(),N=ant(),T=ont(),[C,A]=x.useState(null),[O,z]=x.useState(!1),[$,F]=x.useState(""),[B,P]=x.useState(""),[I,M]=x.useState(null),[R,K]=x.useState("");if(r||a||d)return s.jsx(he,{children:s.jsx("div",{style:{display:"grid",placeItems:"center",minHeight:"50vh"},children:s.jsx(ne,{className:"animate-spin",size:22,style:{color:"hsl(var(--c-fg-subtle))"}})})});if(!n)return s.jsx(Pt,{to:"/auth",replace:!0});if(o)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:s.jsx("div",{className:"xph-card",children:s.jsx(ii,{title:"Couldn't load your supplier profile",description:"Your session is still active. Retry before opening this engagement.",onRetry:()=>{c()},isRetrying:l})})})});if(!(i!=null&&i.supplier))return s.jsx(Pt,{to:"/",replace:!0});if(h)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:s.jsx("div",{className:"xph-card",children:s.jsx(ii,{title:"Couldn't load this engagement",description:"The request may still be available. Retry instead of treating this temporary failure as not found.",onRetry:()=>{p()},isRetrying:f})})})});if(!u)return s.jsx(he,{children:s.jsx("div",{className:"xph-container",style:{padding:"20px 24px 64px"},children:s.jsxs("div",{className:"xph-card",style:{padding:32,textAlign:"center",marginTop:20},children:[s.jsx("div",{className:"tt-display-sm",children:"Engagement not found"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:6},children:"This engagement does not exist or is not visible to your supplier."}),s.jsx(oe,{to:"/supplier/engagements",className:"xph-btn xph-btn-outline xph-btn-sm",style:{textDecoration:"none",marginTop:14,display:"inline-flex"},children:"All engagements"})]})})});const{engagement:D,serviceName:E,partnerName:q,partnerSlug:X}=u,re=D.status,Y=new Set(m.map(Ee=>Ee.asset_id)),le=w.filter(Ee=>!Y.has(Ee.id)),Z=re==="requested"||re==="scoping"||re==="active",de=D.requires_cda&&D.cda_status!=="confirmed",pe=k.isPending||N.isPending||T.isPending,J=Ee=>{k.mutate({engagementAssetId:Ee,engagementId:D.id},{onSuccess:()=>t({title:"Access shared",description:`${q} can now view this asset's details.`}),onError:kt=>t({title:"Share failed",description:Cl(kt),variant:"destructive"})})},be=()=>{if(!I)return;(I.type==="deny"?N:T).mutate({engagementAssetId:I.linkId,engagementId:D.id,assetId:I.assetId,reason:R.trim()||void 0},{onSuccess:()=>t({title:I.type==="deny"?"Request declined":"Access revoked"}),onError:kt=>t({title:"Update failed",description:Cl(kt),variant:"destructive"})}),M(null),K("")},ee=Ee=>{_.mutate({engagementId:D.id,status:Ee},{onSuccess:()=>t({title:"Engagement updated"}),onError:kt=>t({title:"Update failed",description:Cl(kt),variant:"destructive"})})},Ce=()=>{j.mutate({engagementId:D.id,reference:$.trim()||void 0},{onSuccess:()=>{z(!1),t({title:"CDA confirmed",description:`${q} can now be granted asset access.`})},onError:Ee=>t({title:"Confirmation failed",description:Cl(Ee),variant:"destructive"})})},Re=()=>{B&&S.mutate({engagementId:D.id,assetId:B},{onSuccess:()=>{P(""),t({title:"Asset attached"})},onError:Ee=>t({title:"Attach failed",description:Cl(Ee),variant:"destructive"})})};return s.jsxs(he,{children:[s.jsx(Ng,{children:s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"100vh"},children:s.jsxs("div",{className:"xph-container",style:{padding:"20px 24px 64px",maxWidth:860},children:[s.jsxs(oe,{to:"/supplier/engagements",className:"tt-mono-sm",style:{display:"inline-flex",alignItems:"center",gap:6,textDecoration:"none",color:"hsl(var(--c-fg-muted))",marginBottom:16},children:[s.jsx(Ph,{size:13}),"Engagements"]}),s.jsxs("div",{className:"xph-card",style:{padding:"20px 22px",marginBottom:16},children:[s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",ga
884p:12,flexWrap:"wrap"},children:[s.jsxs("div",{style:{flex:1,minWidth:260},children:[s.jsx("h1",{className:"tt-display-md",children:D.title}),s.jsxs("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginTop:6},children:[X?s.jsx(oe,{to:`/solutions-partners/${X}`,style:{color:"hsl(var(--c-partner))",textDecoration:"none"},children:q}):q,E?` · ${E}`:""," · requested ",new Date(D.created_at).toLocaleDateString()]})]}),s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[s.jsx(qk,{cdaStatus:D.cda_status}),s.jsx(Uk,{status:re})]})]}),Z&&s.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginTop:16,paddingTop:14,borderTop:"1px solid hsl(var(--c-border))"},children:[re==="requested"&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",disabled:_.isPending,onClick:()=>ee("scoping"),children:"Start scoping"}),(re==="requested"||re==="scoping")&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",disabled:_.isPending,onClick:()=>ee("active"),children:"Mark active"}),s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{color:"hsl(var(--c-negative-fg))"},disabled:_.isPending,onClick:()=>A("declined"),children:"Withdraw request"})]}),re==="active"&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-primary xph-btn-sm",disabled:_.isPending,onClick:()=>A("completed"),children:"Mark completed"})]})]}),D.requires_cda&&s.jsx("div",{className:"xph-card",style:{padding:"16px 22px",marginBottom:16,borderColor:D.cda_status==="confirmed"?"hsl(var(--c-positive-border))":"hsl(var(--c-warning-border))"},children:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[s.jsx(Rde,{size:17,style:{color:D.cda_status==="confirmed"?"hsl(var(--c-positive-fg))":"hsl(var(--c-warning-fg))",flex:"none"}}),s.jsx("div",{style:{flex:1,minWidth:240},children:D.cda_status==="confirmed"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"tt-body-sm",style:{color:"hsl(var(--c-ink))",fontWeight:600},children:["CDA confirmed",D.cda_confirmed_at?` on ${new Date(D.cda_confirmed_at).toLocaleDateString()}`:""]}),D.cda_reference&&s.jsxs("p",{className:"tt-meta",style:{marginTop:2},children:["Reference: ",D.cda_reference]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"tt-body-sm",style:{color:"hsl(var(--c-ink))",fontWeight:600},children:"This service requires a CDA"}),s.jsxs("p",{className:"tt-meta",style:{marginTop:2},children:["Asset details stay locked for ",q," until you confirm a CDA is in place. The CDA itself is signed outside xPharma."]})]})}),D.cda_status==="required"&&Z&&s.jsx(je,{className:"xph-btn-sm",onClick:()=>z(!0),children:"Confirm CDA"})]})}),D.brief&&s.jsxs("div",{className:"xph-card",style:{padding:"16px 22px",marginBottom:16},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:8},children:"Brief"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg))",whiteSpace:"pre-wrap"},children:D.brief})]}),s.jsxs("div",{className:"xph-card",style:{padding:"16px 22px"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10},children:[s.jsx("div",{className:"eyebrow",children:"Assets on this engagement"}),s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))"},children:[m.length," linked"]})]}),g?s.jsx("div",{style:{padding:20,display:"grid",placeItems:"center"},children:s.jsx(ne,{className:"animate-spin",size:18,style:{color:"hsl(var(--c-fg-subtle))"}})}):y?s.jsx(ii,{compact:!0,title:"Couldn't load the asset list",description:"Retry the engagement asset projection.",onRetry:()=>{v()},isRetrying:b}):m.length===0?s.jsxs("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:10},children:["No assets attached. ",q," sees the brief only."]}):s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:12},children:m.map(Ee=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"10px 12px",border:"1px solid hsl(var(--c-border))",borderRadius:8,flexWrap:"wrap"},children:[s.jsxs("div",{style:{flex:1,minWidth:200},children:[s.jsx("span",{className:"tt-body-sm",style:{color:"hsl(var(--c-ink))",fontWeight:600},children:Ee.product_name}),(Ee.access_status==="denied"||Ee.access_status==="revoked")&&Ee.decision_reason&&s.jsxs("p",{className:"tt-meta",style:{color:"hsl(var(--c-fg-subtle))",marginTop:2},children:["Reason: ",Ee.decision_reason]})]}),s.jsx(zae,{status:Ee.access_status}),Z&&(Ee.access_status==="none"||Ee.access_status==="requested")&&s.jsxs("span",{style:{display:"inline-flex",gap:6},children:[s.jsx("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",disabled:pe||de,title:de?"Confirm the CDA above before sharing asset details.":void 0,onClick:()=>J(Ee.engagement_asset_id),children:"Share details"}),Ee.access_status==="requested"&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{color:"hsl(var(--c-negative-fg))"},disabled:pe,onClick:()=>M({type:"deny",linkId:Ee.engagement_asset_id,assetId:Ee.asset_id,assetName:Ee.product_name}),children:"Decline"})]}),Ee.access_status==="granted"&&s.jsx("button",{type:"button",className:"xph-btn xph-btn-ghost xph-btn-sm",style:{color:"hsl(var(--c-negative-fg))"},disabled:pe,onClick:()=>M({type:"revoke",linkId:Ee.engagement_asset_id,assetId:Ee.asset_id,assetName:Ee.product_name}),children:"Revoke"})]},Ee.engagement_asset_id))}),s.jsxs("p",{className:"tt-meta",style:{color:"hsl(var(--c-fg-subtle))",marginTop:10},children:[q," always sees the asset names on this engagement. Sharing details unlocks the asset-details schema and non-confidential data room — never valuation outputs."]}),Z&&le.length>0&&s.jsxs("div",{style:{display:"flex",gap:8,marginTop:14,paddingTop:14,borderTop:"1px solid hsl(var(--c-border))",flexWrap:"wrap"},children:[s.jsxs("select",{className:"xph-input",style:{flex:1,minWidth:220,height:34,fontSize:13},value:B,onChange:Ee=>P(Ee.target.value),"aria-label":"Asset to attach",children:[s.jsx("option",{value:"",children:"Attach another asset…"}),le.map(Ee=>s.jsx("option",{value:Ee.id,children:Ee.productName},Ee.id))]}),s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm",disabled:!B||S.isPending,onClick:Re,children:[s.jsx(io,{size:13}),"Attach"]})]})]}),s.jsx(Bae,{engagementId:D.id,engagementOpen:Z,counterpartName:q,side:"client",canUpload:((Ze=i==null?void 0:i.allMemberships)==null?void 0:Ze.some(Ee=>Ee.supplier.id===D.client_supplier_id))??!1})]})})}),s.jsx(xp,{open:C!==null,onOpenChange:Ee=>!Ee&&A(null),children:s.jsxs(Qd,{children:[s.jsxs(Xd,{children:[s.jsx(Jd,{children:C==="declined"?"Withdraw this request?":"Mark this engagement completed?"}),s.jsx(eh,{children:C==="declined"?`The engagement with ${q} will be closed as declined. This cannot be undone.`:`The engagement with ${q} will be closed as completed. This cannot be undone.`})]}),s.jsxs(Zd,{children:[s.jsx(nh,{children:"Cancel"}),s.jsx(th,{onClick:()=>{C&&ee(C),A(null)},children:C==="declined"?"Withdraw":"Complete"})]})]})}),s.jsx(xp,{open:I!==null,onOpenChange:Ee=>{Ee||(M(null),K(""))},children:s.jsxs(Qd,{children:[s.jsxs(Xd,{children:[s.jsx(Jd,{children:(I==null?void 0:I.type)==="deny"?`Decline the request for ${I==null?void 0:I.assetName}?`:`Revoke access to ${I==null?void 0:I.assetName}?`}),s.jsx(eh,{children:(I==null?void 0:I.type)==="deny"?`${q} will see the request was declined. They can request again later.`:`${q} immediately loses access to this asset's details and documents. They can request access again later.`})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"eyebrow",htmlFor:"access-reason",style:{display:"block",marginBottom:6},children:["Reason (optional, visible to ",q,")"]}),s.jsx(Fe,{id:"access-reason",value:R,onChange:Ee=>K(Ee.target.value),placeholder:(I==null?void 0:I.type)==="deny"?"e.g. Out of scope for this engagement":"e.g. Scope change"})]}),s.jsxs(Zd,{children:[s.jsx(nh,{children:"Cancel"}),s.jsx(th,{onClick:be,children:(I==null?void 0:I.type)==="deny"?"Decline request":"Revoke access"})]})]})}),s.jsx(xp,{open:O,onOpenChange:z,children:s.jsxs(Qd,{children:[s.jsxs(Xd,{children:[s.jsx(Jd,{children:"Confirm the CDA is 
884in place"}),s.jsxs(eh,{children:["You are attesting that a confidentiality agreement covering this engagement has been signed with ",q,". This unlocks asset access grants and is recorded with your name and a timestamp."]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"eyebrow",htmlFor:"cda-reference",style:{display:"block",marginBottom:6},children:"Reference (optional)"}),s.jsx(Fe,{id:"cda-reference",value:$,onChange:Ee=>F(Ee.target.value),placeholder:"e.g. CDA dated 2026-07-01, DocuSign envelope #…"})]}),s.jsxs(Zd,{children:[s.jsx(nh,{children:"Cancel"}),s.jsx(th,{onClick:Ce,disabled:j.isPending,children:"Confirm CDA"})]})]})})]})}function qdt(){const{user:e}=me();return Se({queryKey:["profile",e==null?void 0:e.id],queryFn:async()=>{if(!e)return null;const{data:n,error:r}=await W.from("profiles").select("*").eq("user_id",e.id).maybeSingle();if(r)throw r;return n},enabled:!!e})}function Hdt(){const e=Ae(),{user:t}=me(),n=Ye();return $e({mutationFn:async r=>{if(!t)throw new Error("Not authenticated");const{error:i}=await W.from("profiles").update(r).eq("user_id",t.id);if(i)throw i;return{userId:t.id,updatedFields:Object.keys(r)}},onSuccess:({userId:r,updatedFields:i})=>{e.invalidateQueries({queryKey:["profile",t==null?void 0:t.id]}),n({action:"update_profile",entityType:Ve.profiles,entityId:r,entityLabel:(t==null?void 0:t.email)??void 0,metadata:{updated_fields:i}})}})}const Kdt=Gs({display_name:ut().max(100,"Display name must be under 100 characters").optional().or(Lw("")),full_name:ut().max(200,"Full name must be under 200 characters").optional().or(Lw("")),phone:ut().regex(/^$|^\+?[\d\s\-().]{7,20}$/,"Enter a valid phone number").optional().or(Lw(""))}),Gdt=Gs({currentPassword:ut().min(1,"Current password is required"),newPassword:ut().min(8,"New password must be at least 8 characters"),confirmPassword:ut()}).refine(e=>e.newPassword===e.confirmPassword,{message:"Passwords do not match",path:["confirmPassword"]});function Ydt(){const{user:e,signOut:t}=me(),{data:n,isLoading:r}
884=qdt(),i=Hdt(),[a,o]=x.useState(""),[l,c]=x.useState(""),[u,d]=x.useState(""),[h,f]=x.useState({}),[p,m]=x.useState(""),[g,y]=x.useState(""),[b,v]=x.useState(""),[w,_]=x.useState({}),[j,S]=x.useState(!1),[k,N]=x.useState(!0),[T,C]=x.useState(!1);x.useEffect(()=>{if(n){o(n.display_name??""),c(n.full_name??""),d(n.phone??"");const F=n.email_preferences;F&&typeof F=="object"&&N(F.all_emails!==!1)}},[n]);const A=F=>{F==null||F.preventDefault();const B=Kdt.safeParse({display_name:a,full_name:l,phone:u});if(!B.success){const P={};B.error.issues.forEach(I=>{P[String(I.path[0])]=I.message}),f(P);return}f({}),i.mutate({display_name:a||null,full_name:l||null,phone:u||null},{onSuccess:()=>gi.success("Profile updated"),onError:P=>gi.error(P.message)})},O=async F=>{const B=k;N(F),C(!0);try{const{error:P}=await W.from("profiles").update({email_preferences:{all_emails:F}}).eq("user_id",e.id);if(P)throw P}catch{N(B),gi.error("Failed to update preference")}finally{C(!1)}},z=async F=>{F==null||F.preventDefault();const B=Gdt.safeParse({currentPassword:p,newPassword:g,confirmPassword:b});if(!B.success){const P={};B.error.issues.forEach(I=>{P[String(I.path[0])]=I.message}),_(P);return}_({}),S(!0);try{const{error:P}=await W.auth.signInWithPassword({email:(e==null?void 0:e.email)??"",password:p});if(P){_({currentPassword:"Current password is incorrect"});return}const{error:I}=await W.auth.updateUser({password:g});if(I)throw I;gi.success("Password updated — please sign in again"),await t()}catch(P){gi.error(P.message??"Failed to update password")}finally{S(!1)}};if(r)return s.jsx(he,{children:s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"80px 24px"},children:s.jsx(ne,{size:28,className:"animate-spin",style:{color:"hsl(var(--c-fg-muted))"}})})});const $=(a||l||(e==null?void 0:e.email)||"?").split(/[\s@.]+/).map(F=>F[0]).filter(Boolean).slice(0,2).join("").toUpperCase();return s.jsx(he,{children:s.jsxs("div",{style:{background:"hsl(var(--c-surface))",minHeight:"calc(100vh - 56px)"},children:[s.jsx("div",{style:{background:"hsl(var(--c-card))",borderBottom:"1px solid hsl(var(--c-border))",padding:"20px 0"},children:s.jsxs("div",{className:"xph-container",children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:6},children:"Account · Profile"}),s.jsx("h1",{className:"tt-display-md",children:"Profile settings"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginTop:4},children:"Manage your personal details, notification preferences, and password."})]})}),s.jsx("div",{className:"xph-container",style:{padding:"32px 24px"},children:s.jsxs("div",{style:{maxWidth:720,margin:"0 auto",display:"flex",flexDirection:"column",gap:20},children:[s.jsxs("div",{className:"xph-card",style:{padding:20,display:"flex",gap:16,alignItems:"center"},children:[s.jsx("span",{style:{width:52,height:52,borderRadius:"50%",background:"hsl(var(--c-ink))",color:"hsl(var(--c-ink-inverse))",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:16,fontWeight:600,letterSpacing:"0.04em",flexShrink:0},children:$}),s.jsxs("div",{style:{minWidth:0},children:[s.jsx("div",{className:"tt-display-sm",style:{marginBottom:2},children:a||l||"Your account"}),s.jsx("div",{className:"tt-mono-sm",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(e==null?void 0:e.email)??""})]})]}),s.jsx(LA,{eyebrow:"Identity",title:"Profile information",description:"Update your personal details. Your email address can't be changed.",children:s.jsxs("form",{autoComplete:"on",onSubmit:A,className:"space-y-4",children:[s.jsxs(rd,{children:[s.jsx(Pe,{htmlFor:"email",className:"tt-body-sm",style:{fontWeight:500},children:"Email"}),s.jsx(Fe,{id:"email",value:(e==null?void 0:e.email)??"",disabled:!0,className:"bg-muted",autoComplete:"email"})]}),s.jsxs(rd,{children:[s.jsx(Pe,{htmlFor:"display_name",className:"tt-body-sm",style:{fontWeight:500},children:"Display name"}),s.jsx(Fe,{id:"display_name",value:a,onChange:F=>o(F.target.value),autoComplete:"nickname",placeholder:"How you appear on the platform"}),h.display_name&&s.jsx(bf,{children:h.display_name})]}),s.jsxs(rd,{children:[s.jsx(Pe,{htmlFor:"full_name",className:"tt-body-sm",style:{fontWeight:500},children:"Full name"}
884),s.jsx(Fe,{id:"full_name",value:l,onChange:F=>c(F.target.value),autoComplete:"name",placeholder:"Your legal full name"}),h.full_name&&s.jsx(bf,{children:h.full_name})]}),s.jsxs(rd,{children:[s.jsx(Pe,{htmlFor:"phone",className:"tt-body-sm",style:{fontWeight:500},children:"Phone number"}),s.jsx(Fe,{id:"phone",type:"tel",value:u,onChange:F=>d(F.target.value),autoComplete:"tel",placeholder:"+1 555-123-4567"}),h.phone&&s.jsx(bf,{children:h.phone})]}),s.jsx("div",{style:{paddingTop:4},children:s.jsxs("button",{type:"submit",disabled:i.isPending,className:"xph-btn xph-btn-primary",children:[i.isPending?s.jsx(ne,{size:13,className:"animate-spin"}):s.jsx(R_,{size:13}),"Save changes"]})})]})}),s.jsx(LA,{eyebrow:"Notifications",title:"Email notifications",description:"Receive transactional and update emails from xPharma.",children:s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 14px",border:"1px solid hsl(var(--c-border))",borderRadius:8,background:"hsl(var(--c-surface))",gap:16},children:[s.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center",minWidth:0},children:[s.jsx("span",{style:{width:32,height:32,borderRadius:8,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s.jsx(_de,{size:14})}),s.jsxs("div",{style:{minWidth:0},children:[s.jsx("div",{className:"tt-body",style:{fontWeight:500},children:"All email notifications"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"Pause to silence everything except critical security mail."})]})]}),s.jsx(jk,{checked:k,onCheckedChange:O,disabled:T})]})}),s.jsx(LA,{eyebrow:"Appearance",title:"Theme",description:"Choose how xPharma appears in your browser.",children:s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 14px",border:"1px solid hsl(var(--c-border))",borderRadius:8,background:"hsl(var(--c-surface))",gap:16},children:[s.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center",minWidth:0},children:[s.jsx("span",{style:{width:32,height:32,borderRadius:8,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s.jsx(Ude,{size:14})}),s.jsxs("div",{style:{minWidth:0},children:[s.jsx("div",{className:"tt-body",style:{fontWeight:500},children:"Theme preference"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))"},children:"Follow your system, or lock to light or dark."})]})]}),s.jsx(qY,{})]})}),s.jsx(nM,{defaultOpen:!1,className:"group",children:s.jsxs("div",{className:"xph-card",style:{overflow:"hidden"},children:[s.jsx(rM,{asChild:!0,children:s.jsxs("button",{type:"button",style:{width:"100%",padding:20,display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,background:"transparent",border:"none",cursor:"pointer",textAlign:"left"},children:[s.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[s.jsx("span",{style:{width:32,height:32,borderRadius:8,background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-fg-muted))",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s.jsx(m4,{size:14})}),s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:4},children:"Security"}),s.jsx("div",{className:"tt-display-sm",children:"Change password"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:2},children:"You will be signed out after changing your password."})]})]}),s.jsx(Ta,{size:18,style:{color:"hsl(var(--c-fg-muted))",transition:"transform 200ms"},className:"group-data-[state=open]:rotate-180"})]})}),s.jsx(iM,{children:s.jsx("div",{style:{padding:20,paddingTop:0,borderTop:"1px solid hsl(var(--c-border))",marginTop:0},children:s.jsxs("form",{autoComplete:"off",onSubmit:z,className:"space-y-4",style:{paddingTop:20},children:[s.jsxs(rd,{children:[s.jsx(Pe,{htmlFor:"current_password",className:"tt-body-sm",style:{fontWeight:500},children:"Current password"}),s.jsx(Fe,{id:"current_password",type:"password",value:p,onChange:F=>m(F.target.value)}
884),w.currentPassword&&s.jsx(bf,{children:w.currentPassword})]}),s.jsxs(rd,{children:[s.jsx(Pe,{htmlFor:"new_password",className:"tt-body-sm",style:{fontWeight:500},children:"New password"}),s.jsx(Fe,{id:"new_password",type:"password",value:g,onChange:F=>y(F.target.value)}),w.newPassword&&s.jsx(bf,{children:w.newPassword})]}),s.jsxs(rd,{children:[s.jsx(Pe,{htmlFor:"confirm_password",className:"tt-body-sm",style:{fontWeight:500},children:"Confirm new password"}),s.jsx(Fe,{id:"confirm_password",type:"password",value:b,onChange:F=>v(F.target.value)}),w.confirmPassword&&s.jsx(bf,{children:w.confirmPassword})]}),s.jsx("div",{style:{paddingTop:4},children:s.jsxs("button",{type:"submit",disabled:j,className:"xph-btn xph-btn-outline",children:[j?s.jsx(ne,{size:13,className:"animate-spin"}):s.jsx(m4,{size:13}),"Update password"]})})]})})})]})})]})})]})})}function LA({eyebrow:e,title:t,description:n,children:r}){return s.jsxs("div",{className:"xph-card",style:{padding:20},children:[s.jsxs("div",{style:{marginBottom:18},children:[s.jsx("div",{className:"eyebrow",style:{marginBottom:6},children:e}),s.jsx("h2",{className:"tt-display-sm",children:t}),n&&s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-fg-muted))",marginTop:4},children:n})]}),r]})}function rd({children:e}){return s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:e})}function bf({children:e}){return s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-negative-fg))"},children:e})}function Qdt(){const[e]=il(),t=e.get("token"),[n,r]=x.useState("loading"),[i,a]=x.useState(!1);x.useEffect(()=>{if(!t){r("invalid");return}(async()=>{try{const f=await(await fetch(`https://jvdzxfpnisnowhefnlau.supabase.co/functions/v1/handle-email-unsubscribe?token=${encodeURIComponent(t)}`,{headers:{apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imp2ZHp4ZnBuaXNub3doZWZubGF1Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njk0NzkyOTYsImV4cCI6MjA4NTA1NTI5Nn0.lfALU9pqkD_E5G3vLkbefiDX5Lwg3zpAIaWPLg_zmwI"}})).json();f.valid===!1&&f.reason==="already_unsubscribed"?r("already_unsubscribed"):f.valid?r("valid"):r("invalid")}catch{r("invalid")}})()},[t]);const o=async()=>{if(t){a(!0);try{const{data:c}=await W.functions.invoke("handle-email-unsubscribe",{body:{token:t}});c!=null&&c.success?r("success"):(c==null?void 0:c.reason)==="already_unsubscribed"?r("already_unsubscribed"):r("error")}catch{r("error")}finally{a(!1)}}},l=(()=>{switch(n){case"loading":return{eyebrow:"Email · Verifying",title:"Verifying link",body:"Checking your unsubscribe link…",icon:s.jsx(ne,{size:22,className:"animate-spin"}),iconBg:"hsl(var(--c-surface-2))",iconFg:"hsl(var(--c-fg-muted))"};case"valid":return{eyebrow:"Email · Confirm",title:"Unsubscribe from xPharma",body:"You will stop receiving non-essential email notifications. You can re-enable them anytime from your profile.",icon:s.jsx(Bde,{size:22}),iconBg:"hsl(var(--c-warning-soft))",iconFg:"hsl(var(--c-warning-fg))"};case"success":return{eyebrow:"Email · Confirmed",title:"You are unsubscribed",body:"You've been removed from email notifications. Re-enable them anytime from your profile settings.",icon:s.jsx(sn,{size:22}),iconBg:"hsl(var(--c-positive-soft))",iconFg:"hsl(var(--c-positive-fg))"};case"already_unsubscribed":return{eyebrow:"Email · Status",title:"Already unsubscribed",body:"You're already opted out of email notifications.",icon:s.jsx(sn,{size:22}),iconBg:"hsl(var(--c-surface-2))",iconFg:"hsl(var(--c-fg-muted))"};case"invalid":return{eyebrow:"Email · Error",title:"Invalid link",body:"This unsubscribe link is invalid or has expired.",icon:s.jsx(gn,{size:22}),iconBg:"hsl(var(--c-negative-soft))",iconFg:"hsl(var(--c-negative-fg))"};case"error":default:return{eyebrow:"Email · Error",title:"Something went wrong",body:"We couldn't process your request. Please try again later.",icon:s.jsx(gn,{size:22}),iconBg:"hsl(var(--c-negative-soft))",iconFg:"hsl(var(--c-negative-fg))"}}})();return s.jsxs(he,{children:[s.jsx(Js,{title:"Unsubscribe — xPharma",description:"Manage your xPharma email preferences and unsubscribe from notification emails.",path:"/unsubscribe",noindex:!0}),s.jsx("div",{style:{minHeight:"calc(100vh - 56px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"clamp(48px, 8vw, 96px) 24px",background:"hsl(var(--c-surface))"},children:s.jsxs("div",{className:"xph-card",style:{maxWidth:480,width:"100%",padding:"clamp(28px, 4.5vw, 40px)",textAlign:"center"},children:[s.jsx("div",{style:{width:52,height:52,borderRadius:12,background:l.iconBg,color:l.iconFg,display:"inline-flex",alignItems:"center",justifyContent:"center",marginBottom:18},children:l.icon}),s.jsx("div",{className:"eyebrow",style:{marginBottom:8},children:l.eyebrow}),s.jsx("h1",{className:"tt-display-md",style:{marginBottom:12},children:l.title}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginBottom:24},children:l.body}),n==="valid"&&s.jsxs("button",{type:"button",onClick:o,disabled:i,className:"xph-btn xph-btn-primary",style:{width:"100%",justifyContent:"center"},children:[i?s.jsx(ne,{size:13,className:"animate-spin"}):null,"Confirm unsubscribe"]}),(n==="success"||n==="already_unsubscribed"||n==="invalid"||n==="error")&&s.jsxs(oe,{to:"/",className:"xph-btn xph-btn-outline",style:{width:"100%",justifyContent:"center"},children:[s.jsx(Wt,{size:13}),"Return home"]})]})})]})}function Xdt(){return s.jsxs(he,{children:[s.jsx(Js,{title:"Terms of Service — xPharma",description:"The terms governing use of the xPharma marketplace for buyers and suppliers of biotech assets.",path:"/terms"}),s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"calc(100vh - 56px)"},children:s.jsxs("div",{style:{maxWidth:720,margin:"0 auto",padding:"clamp(48px, 8vw, 96px) 24px"},children:[s.jsxs("div",{style:{marginBottom:36},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-accent))",marginBottom:12},children:"Legal · Terms of service"}),s.jsx("h1",{className:"tt-display-md",style:{marginBottom:8},children:"Terms of Service"}),s.jsx("p",{className:"tt-meta",children:"Last updated April 5, 2026"})]}),s.jsxs("div",{className:"xph-card",style:{padding:"14px 16px",marginBottom:36,display:"flex",gap:12,alignItems:"flex-start",borderColor:"hsl(var(--c-warning-border))",background:"hsl(var(--c-warning-soft))"},children:[s.jsx("span",{style:{width:24,height:24,borderRadius:6,background:"hsl(var(--c-warning) / 0.18)",color:"hsl(var(--c-warning-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s.jsx(Pu,{size:13})}),s.jsxs("div",{children:[s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-warning-deep))",marginBottom:2,fontWeight:600},children:"BETA PLACEHOLDER"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-warning-deep))"},children:"This document is a draft pending formal legal review. It will be replaced with final terms before general availability."})]})]}),s.jsxs("article",{style:{display:"flex",flexDirection:"column",gap:36},children:[s.jsx(oa,{heading:"1. Acceptance of Terms",children:s.jsx("p",{className:"tt-body",children:'By accessing or using xPharma ("the Platform"), you agree to be bound by these Terms of Service. If you do not agree, you may 
884not use the Platform. xPharma reserves the right to modify these terms at any time; continued use after changes constitutes acceptance.'})}),s.jsx(oa,{heading:"2. Platform Description",children:s.jsx("p",{className:"tt-body",children:"xPharma is a pharma business development marketplace that connects suppliers of biotech assets with potential buyers. The Platform provides tools for asset listing, verification, AI-powered valuation, document management, and buyer-supplier engagement. xPharma does not itself buy, sell, or hold any pharmaceutical assets."})}),s.jsxs(oa,{heading:"3. Account Registration & Roles",children:[s.jsx("p",{className:"tt-body",children:"You must create an account to access most features. During registration you select a role:"}),s.jsxs("ul",{style:eU,children:[s.jsxs("li",{className:"tt-body",children:[s.jsx("strong",{children:"Supplier"})," — List and manage biotech assets on behalf of your organization."]}),s.jsxs("li",{className:"tt-body",children:[s.jsx("strong",{children:"Buyer"})," — Search, evaluate, and inquire about listed assets."]})]}),s.jsx("p",{className:"tt-body",children:"All registrations are subject to admin approval. You agree to provide accurate, current information and to keep your credentials confidential. You are responsible for all activity under your account."})]}),s.jsxs(oa,{heading:"4. Supplier Obligations",children:[s.jsx("p",{className:"tt-body",children:"Suppliers represent and warrant that:"}),s.jsxs("ul",{style:eU,children:[s.jsx("li",{className:"tt-body",children:"They have the legal authority to list and transact the assets submitted."}),s.jsx("li",{className:"tt-body",children:"All asset data, documents, and representations are accurate and not misleading."}),s.jsx("li",{className:"tt-body",children:"Uploaded documents do not infringe third-party intellectual property rights."}),s.jsx("li",{className:"tt-body",children:"Entity and personnel verification information is truthful."})]}),s.jsx("p",{className:"tt-body",children:"xPharma may remove any asset or suspend any supplier account that violates these obligations."})]}),s.jsx(oa,{heading:"5. Buyer Obligations",children:s.jsx("p",{className:"tt-body",children:"Buyers agree to use information accessed through the Platform solely for the purpose of evaluating potential transactions. Buyers shall not reproduce, distribute, or disclose confidential asset information to third parties without the supplier's written consent."})}),s.jsx(oa,{heading:"6. AI-Generated Content & Valuations",children:s.jsxs("p",{className:"tt-body",children:["The Platform uses artificial intelligence for document categorization, data extraction, semantic search, and risk-adjusted net present value (rNPV) estimation. These outputs are model-generated estimates and are ",s.jsx("strong",{children:"not"})," ","independently verified financial, legal, or medical advice. Users should conduct their own due diligence and engage qualified professionals before making transaction decisions."]})}),s.jsx(oa,{heading:"7. Intellectual Property",children:s.jsx("p",{className:"tt-body",children:"All Platform software, branding, and proprietary algorithms are owned by xPharma. Suppliers retain ownership of their uploaded content and grant xPharma a limited license to host, display, and process that content for Platform operations. Buyers receive a limited, non-transferable right to view published asset data."})}),s.jsxs(oa,{heading:"8. Limitation of Liability",children:[s.jsx("p",{className:"tt-body",children:"To the maximum extent permitted by law, xPharma shall not be liable for any indirect, incidental, special, or consequential damages arising from Platform use, including but not limited to losses resulting from reliance on AI-generated valuations or data extraction, transaction decisions, or unauthorized access to accounts."}),s.jsx("p",{className:"tt-body",children:'The Platform is provided "as is" without warranties of any kind, either express or implied, including implied warranties of merchantability, fitness for a particular purpose, and non-infringement.'})]}),s.jsx(oa,{heading:"9. Beta Program",children:s.jsx("p",{className:"tt-body",children:"The Platform is currently in a limited public beta. Features may change, be removed, or experience downtime without notice. Beta users acknowledge that the service may contain bugs and that data integrity is not guaranteed during the beta period."})}),s.jsx(oa,{heading:"10. Termination",children:s.jsx("p",{className:"tt-body",children:"xPharma may suspend or terminate your account at any time, with or without cause, upon reasonable notice. Upon termination, your right to access the Platform ceases immediately. Suppliers may request export of their uploaded documents within 30 days of termination."})}),s.jsx(oa,{heading:"11. Governing Law",children:s.jsx("p",{className:"tt-body",children:"These Terms shall be governed by and construed in accordance with applicable law. Any disputes shall be resolved through binding arbitration in a mutually agreed venue."})}),s.jsx(oa,{heading:"12. Contact",children:s.jsxs("p",{className:"tt-body",children:["For questions about these Terms, contact us at"," ",s.jsx("a",{href:"mailto:[email protected]",style:{color:"hsl(var(--c-accent))",textDecoration:"none"},children:"[email protected]"}),"."]})})]})]})})]})}const eU={listStyle:"disc",paddingLeft:22,margin:"12px 0",display:"flex",flexDirection:"column",gap:6,color:"hsl(var(--c-fg))"};function oa({heading:e,children:t}){return s.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx("h2",{className:"tt-display-sm",children:e}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:t})]})}function Zdt(){return s.jsxs(he,{children:[s.jsx(Js,{title:"Privacy Policy — xPharma",description:"How xPharma collects, uses, and protects information from suppliers, buyers, and visitors to the platform.",path:"/privacy"}),s.jsx("div",{style:{background:"hsl(var(--c-surface))",minHeight:"calc(100vh - 56px)"},children:s.jsxs("div",{style:{maxWidth:720,margin:"0 auto",padding:"clamp(48px, 8vw, 96px) 24px"},children:[s.jsxs("div",{style:{marginBottom:36},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-accent))",marginBottom:12},children:"Legal · Privacy policy"}),s.jsx("h1",{className:"tt-display-md",style:{marginBottom:8},children:"Privacy Policy"}),s.jsx("p",{className:"tt-meta",children:"Last updated April 5, 2026"})]}),s.jsxs("div",{className:"xph-card",style:{padding:"14px 16px",marginBottom:36,display:"flex",gap:12,alignItems:"flex-start",borderColor:"hsl(var(--c-warning-border))",background:"hsl(var(--c-warning-soft))"},children:[s.jsx("span",{style:{width:24,height:24,borderRadius:6,background:"hsl(var(--c-warning) / 0.18)",color:"hsl(var(--c-warning-fg))",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s.jsx(Pu,{size:13})}),s.jsxs("div",{children:[s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-warning-deep))",marginBottom:2,fontWeight:600},children:"BETA PLACEHOLDER"}),s.jsx("p",{className:"tt-body-sm",style:{color:"hsl(var(--c-warning-deep))"},children:"This document is a draft pending formal legal review. It will be replaced with a final privacy policy before general availability."})]})]}),s.jsxs("article",{style:{display:"flex",flexDirection:"column",gap:36},children:[s.jsx(za,{heading:"1. Introduction",children:s.jsx("p",{className:"tt-body",children:'xPharma ("we", "us", "our") operates a pharma business development marketplace. This Privacy Policy describes how we 
884collect, use, store, and protect your personal information when you use our Platform.'})}),s.jsxs(za,{heading:"2. Information We Collect",children:[s.jsx(my,{children:"2.1 Account Information"}),s.jsx("p",{className:"tt-body",children:"When you register, we collect your email address, full name, and role selection (supplier or buyer). Suppliers additionally provide company name, location, legal entity details, and personnel information. Buyers provide company name and location."}),s.jsx(my,{children:"2.2 Asset Data"}),s.jsx("p",{className:"tt-body",children:"Suppliers submit pharmaceutical asset information including product names, therapeutic areas, clinical trial data, regulatory status, and commercial projections. This data is entered voluntarily and is essential for Platform functionality."}),s.jsx(my,{children:"2.3 Documents"}),s.jsx("p",{className:"tt-body",children:"Suppliers upload documents to asset Data Rooms. Documents are stored securely and processed by AI systems for categorization and data extraction. Document contents are not shared with other users unless the associated asset is published."}
884),s.jsx(my,{children:"2.4 Usage Data"}),s.jsx("p",{className:"tt-body",children:"We collect standard web analytics data including pages visited, features used, and session duration to improve the Platform experience."}),s.jsx(my,{children:"2.5 Communication Data"}),s.jsx("p",{className:"tt-body",children:"We store buyer inquiries, admin correspondence, and email delivery metadata for service operation and audit purposes."})]}),s.jsx(za,{heading:"3. How We Use Your Information",children:s.jsxs("ul",{style:sw,children:[s.jsxs("li",{className:"tt-body",children:[s.jsx("strong",{children:"Account management"})," — To create, verify, and maintain your account."]}),s.jsxs("li",{className:"tt-body",children:[s.jsx("strong",{children:"Platform services"})," — To display asset listings, facilitate buyer-supplier engagement, and manage the verification pipeline."]}),s.jsxs("li",{className:"tt-body",children:[s.jsx("strong",{children:"AI processing"})," — To categorize uploaded documents, extract structured data from documents, generate risk-adjusted valuations, and power semantic search. AI processing is performed by third-party large language models; document content may be sent to these services for analysis."]}),s.jsxs("li",{className:"tt-body",children:[s.jsx("strong",{children:"Communications"})," — To send transactional emails (approval notifications, inquiry updates, verification codes) and service announcements."]}),s.jsxs("li",{className:"tt-body",children:[s.jsx("strong",{children:"Security & compliance"})," — To detect fraud, enforce terms of service, and comply with legal obligations."]})]})}),s.jsxs(za,{heading:"4. AI & Automated Processing",children:[s.jsx("p",{className:"tt-body",children:"The Platform uses artificial intelligence for:"}),s.jsxs("ul",{style:sw,children:[s.jsx("li",{className:"tt-body",children:"Document categorization into a standardized pharmaceutical taxonomy"}),s.jsx("li",{className:"tt-body",children:"Structured data extraction from uploaded files"}),s.jsx("li",{className:"tt-body",children:"Risk-adjusted NPV valuation modeling"}),s.jsx("li",{className:"tt-body",children:"Semantic asset search and ranking"}),s.jsx("li",{className:"tt-body",children:"LinkedIn profile verification for personnel"}),s.jsx("li",{className:"tt-body",children:"Text translation for non-English content"})]}),s.jsx("p",{className:"tt-body",children:"AI outputs are supplementary tools and are not used as the sole basis for consequential decisions about users. All AI-generated data is clearly labeled within the Platform."})]}),s.jsx(za,{heading:"5. Data Storage & Security",children:s.jsx("p",{className:"tt-body",children:"Your data is stored in secure, cloud-hosted databases with encryption at rest and in transit. Documents are stored in a dedicated storage service with access controlled by row-level security policies. We implement role-based access controls to ensure users can only access data appropriate to their role."})}),s.jsxs(za,{heading:"6. Data Sharing",children:[s.jsx("p",{className:"tt-body",children:"We do not sell your personal information. We may share data with:"}),s.jsxs("ul",{style:sw,children:[s.jsxs("li",{className:"tt-body",children:[s.jsx("strong",{children:"AI service providers"})," — Document content is processed by language model APIs for categorization and extraction."]}),s.jsxs("li",{className:"tt-body",children:[s.jsx("strong",{children:"Email delivery services"})," — Email addresses and delivery metadata are shared with our email infrastructure provider."]}),s.jsxs("li",{className:"tt-body",children:[s.jsx("strong",{children:"Other users"})," — Published asset data is visible to approved buyers. Supplier company information is visible in the supplier directory."]}),s.jsxs("li",{className:"tt-body",children:[s.jsx("strong",{children:"Legal authorities"})," — When required by law or to protect our rights."]})]})]}),s.jsx(za,{heading:"7. Email Communications",children:s.jsx("p",{className:"tt-body",children:"We send transactional emails related to your account activity (approvals, rejections, inquiry updates, verification codes). You may unsubscribe from non-essential emails using the unsubscribe link in each email. We maintain a suppression list for bounced, complained, and unsubscribed addresses."})}),s.jsx(za,{heading:"8. Data Retention",children:s.jsx("p",{className:"tt-body",children:"We retain your data for as long as your account is active or as needed to provide services. Upon account termination, personal data is deleted within 90 days except where retention is required by law. Email delivery logs are retained for 12 months for audit purposes."})}),s.jsxs(za,{heading:"9. Your Rights",children:[s.jsx("p",{className:"tt-body",children:"Depending on your jurisdiction, you may have the right to:"}),s.jsxs("ul",{style:sw,children:[s.jsx("li",{className:"tt-body",children:"Access the personal data we hold about you"}),s.jsx("li",{className:"tt-body",children:"Request correction of inaccurate data"}
884),s.jsx("li",{className:"tt-body",children:"Request deletion of your data"}),s.jsx("li",{className:"tt-body",children:"Object to or restrict processing"}),s.jsx("li",{className:"tt-body",children:"Export your data in a portable format"})]}),s.jsxs("p",{className:"tt-body",children:["To exercise these rights, contact us at"," ",s.jsx("a",{href:"mailto:[email protected]",style:{color:"hsl(var(--c-accent))",textDecoration:"none"},children:"[email protected]"}),"."]})]}),s.jsx(za,{heading:"10. Changes to This Policy",children:s.jsx("p",{className:"tt-body",children:"We may update this Privacy Policy periodically. Material changes will be communicated via email or Platform notification. Continued use after changes constitutes acceptance."})}),s.jsx(za,{heading:"11. Contact",children:s.jsxs("p",{className:"tt-body",children:["For privacy-related questions, contact us at"," ",s.jsx("a",{href:"mailto:[email protected]",style:{color:"hsl(var(--c-accent))",textDecoration:"none"},children:"[email protected]"}),"."]})})]})]})})]})}const sw={listStyle:"disc",paddingLeft:22,margin:"12px 0",display:"flex",flexDirection:"column",gap:6,color:"hsl(var(--c-fg))"};function za({heading:e,children:t}){return s.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx("h2",{className:"tt-display-sm",children:e}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:t})]})}function my({children:e}){return s.jsx("h3",{className:"tt-mono-sm",style:{textTransform:"uppercase",letterSpacing:"0.06em",color:"hsl(var(--c-fg-subtle))",marginTop:4},children:e})}const Jdt=Object.assign({
884"../content/docs/buyers/asset-chat.md":()=>la(()=>import("./asset-chat-CvMG2MJJ.js"),[]).then(e=>e.default),
884"../content/docs/buyers/searching.md":()=>la(()=>import("./searching-MgweVkC_.js"),[]).then(e=>e.default),
884"../content/docs/buyers/watchlists.md":()=>la(()=>import("./watchlists-Cpdq_jav.js"),[]).then(e=>e.default),
884"../content/docs/getting-started/how-verification-works.md":()=>la(()=>import("./how-verification-works-uWKFOhi7.js"),[]).then(e=>e.default),
884"../content/docs/getting-started/overview.md":()=>la(()=>import("./overview-DcY3KrRI.js"),[]).then(e=>e.default),
884"../content/docs/platform/security-and-data.md":()=>la(()=>import("./security-and-data-D3RQzLJL.js"),[]).then(e=>e.default),
884"../content/docs/platform/valuation-engine.md":()=>la(()=>import("./valuation-engine-DcM4SPdw.js"),[]).then(e=>e.default),
884"../content/docs/suppliers/data-room.md":()=>la(()=>import("./data-room-BeyZMAgC.js"),[]).then(e=>e.default),
884"../content/docs/suppliers/listing-an-asset.md":()=>la(()=>import("./listing-an-asset-c3BK5qPr.js"),[]).then(e=>e.default),
884"../content/docs/suppliers/market-view.md":()=>la(()=>import("./market-view-DCzNUWet.js"),[])
884.then(e=>e.default)}),Wb=[{slug:"getting-started",title:"Getting started",pages:[{slug:"overview",title:"What is xPharma",description:"A two-minute introduction to the marketplace and how it works."},{slug:"how-verification-works",title:"How verification works",description:"Why every listing is independently verified before it goes live."}]},{slug:"platform",title:"Platform",pages:[{slug:"valuation-engine",title:"Valuation engine",description:"How xPharma values an asset — and why you see a range, not a single number."},{slug:"security-and-data",title:"Security & data",description:"How xPharma protects asset data, documents, and access controls."}]},{slug:"suppliers",title:"For suppliers",pages:[{slug:"listing-an-asset",title:"Listing an asset",description:"End-to-end walkthrough of getting your first asset live on the marketplace.",requiresAuth:!0},{slug:"data-room",title:"Data room & uploads",description:"Document taxonomy, confidentiality controls, and AI extraction.",requiresAuth:!0},{slug:"market-view",title:"Market view",description:"Preview the buyer experience and benchmark against anonymized peers.",requiresAuth:!0}]},{slug:"buyers",title:"For buyers",pages:[{slug:"searching",title:"Searching the marketplace",description:"Semantic search, filters, and watchlists for buyer workflows.",requiresAuth:!0},{slug:"asset-chat",title:"Asset chat",description:"Ask questions of an asset profile and get cited, document-grounded answers.",requiresAuth:!0},{slug:"watchlists",title:"Watchlists & inquiries",description:"Save assets, get notified on updates, and engage suppliers directly.",requiresAuth:!0}]}],eht=Wb[0].slug,tht=Wb[0].pages[0].slug;function nht(e,t){const n=Wb.find(i=>i.slug===e);if(!n)return null;const r=n.pages.find(i=>i.slug===t);return r?{...r,section:n}:null}async function rht(e,t){const n=`../content/docs/${e}/${t}.md`,r=Jdt[n];return r?r():null}const hv=Wb.flatMap(e=>e.pages.map(t=>({sectionSlug:e.slug,pageSlug:t.slug,title:t.title})));function iht(e,t){const n=hv.findIndex(r=>r.sectionSlug===e&&r.pageSlug===t);return n<0||n===hv.length-1?null:hv[n+1]}function sht(e,t){const n=hv.findIndex(r=>r.sectionSlug===e&&r.pageSlug===t);return n<=0?null:hv[n-1]}function aht(){return s.jsx(Pt,{to:`/docs/${eht}/${tht}`,replace:!0})}function tU({onNavigate:e}){const t=wo();return s.jsx("nav",{"aria-label":"Documentation navigation",style:{display:"flex",flexDirection:"column",gap:24},children:Wb.map(n=>s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))",marginBottom:10,paddingLeft:4},children:n.title}),s.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:1},children:n.pages.map(r=>{const i=`/docs/${n.slug}/${r.slug}`,a=t.pathname===i;return s.jsx("li",{children:s.jsxs(oe,{to:i,onClick:e,className:`xph-docs-side-link ${a?"is-active":""}`,style:{display:"flex",alignItems:"center",gap:8,padding:"7px 10px",borderRadius:6,fontSize:13.5,lineHeight:1.4,textDecoration:"none",color:a?"hsl(var(--c-ink))":"hsl(var(--c-fg-muted))",background:a?"hsl(var(--c-surface-2))":"transparent",fontWeight:a?500:400,transition:"background 120ms, color 120ms"},children:[s.jsx("span",{style:{flex:1},children:r.title}),r.requiresAuth&&s.jsx(Zo,{size:11,style:{color:"hsl(var(--c-fg-subtle))",flexShrink:0},"aria-label":"Requires sign in"})]})},r.slug)})})]},n.slug))})}function nU(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function oht(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function lht(e,t,n){const i=Vk((n||{}).ignore||[]),a=cht(t);let o=-1;for(;++o<a.length;)Aae(e,"text",l);function l(u,d){let h=-1,f;for(;++h<d.length;){const p=d[h],m=f?f.children:void 0;if(i(p,m?m.indexOf(p):void 0,f))return;f=p}if(f)return c(u,d)}function c(u,d){const h=d[d.length-1],f=a[o][0],p=a[o][1];let m=0;const y=h.children.indexOf(u);let b=!1,v=[];f.lastIndex=0;let w=f.exec(u.value);for(;w;){const _=w.index,j={index:w.index,input:w.input,stack:[...d,u]};let S=p(...w,j);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?f.lastIndex=_+1:(m!==_&&v.push({type:"text",value:u.value.slice(m,_)}),Array.isArray(S)?v.push(...S):S&&v.push(S),m=_+w[0].length,b=!0),!f.global)break;w=f.exec(u.value)}return b?(m<u.value.length&&v.push({type:"text",value:u.value.slice(m)}),h.children.splice(y,1,...v)):v=[u],y+v.length}}function cht(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([uht(i[0]),dht(i[1])])}return t}function uht(e){return typeof e=="string"?new RegExp(oht(e),"g"):e}function dht(e){return typeof e=="function"?e:function(){return e}}const FA="phrasing",zA=["autolink","link","image","label"];function hht(){return{transforms:[xht],enter:{literalAutolink:pht,literalAutolinkEmail:BA,literalAutolinkHttp:BA,literalAutolinkWww:BA},exit:{literalAutolink:vht,literalAutolinkEmail:yht,literalAutolinkHttp:mht,literalAutolinkWww:ght}}}function fht(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:FA,notInConstruct:zA},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:FA,notInConstruct:zA},{character:":",before:"[ps]",after:"\\/",inConstruct:FA,notInConstruct:zA}]}}function pht(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function BA(e){this.config.enter.autolinkProtocol.call(this,e)}function mht(e){this.config.exit.autolinkProtocol.call(this,e)}function ght(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function yht(e){this.config.exit.autolinkEmail.call(this,e)}function vht(e){this.exit(e)}function xht(e){lht(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,bht],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S}
884)([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),wht]],{ignore:["link","linkReference"]})}function bht(e,t,n,r,i){let a="";if(!Vae(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!jht(n)))return!1;const o=_ht(n+r);if(!o[0])return!1;const l={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function wht(e,t,n,r){return!Vae(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function jht(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function _ht(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=nU(e,"(");let a=nU(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function Vae(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Nh(n)||Fk(n))&&(!t||n!==47)}Wae.peek=Oht;function Sht(){this.buffer()}function kht(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Nht(){this.buffer()}function Cht(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Aht(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=uo(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Tht(e){this.exit(e)}function Eht(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=uo(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Pht(e){this.exit(e)}function Oht(){return"["}function Wae(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),o(),a+=i.move("]"),a}function Iht(){return{enter:{gfmFootnoteCallString:Sht,gfmFootnoteCall:kht,gfmFootnoteDefinitionLabelString:Nht,gfmFootnoteDefinition:Cht},exit:{gfmFootnoteCallString:Aht,gfmFootnoteCall:Tht,gfmFootnoteDefinitionLabelString:Eht,gfmFootnoteDefinition:Pht}}}function Rht(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Wae},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,o){const l=a.createTracker(o);let c=l.move("[^");const u=a.enter("footnoteDefinition"),d=a.enter("label");return c+=l.move(a.safe(a.associationId(r),{before:c,after:"]"})),d(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?`
885`:" ")+a.indentLines(a.containerFlow(r,l.current()),t?Uae:Dht))),u(),c}}function Dht(e,t,n){return t===0?e:Uae(e,t,n)}function Uae(e,t,n){return(n?"":"    ")+e}const Mht=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];qae.peek=Bht;function $ht(){return{canContainEols:["delete"],enter:{strikethrough:Fht},exit:{strikethrough:zht}}}function Lht(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Mht}],handlers:{delete:qae}}}function Fht(e){this.enter({type:"delete",children:[]},e)}function zht(e){this.exit(e)}function qae(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function Bht(){return"~"}function Vht(e){return e.length}function Wht(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Vht,a=[],o=[],l=[],c=[];let u=0,d=-1;for(;++d<e.length;){const g=[],y=[];let b=-1;for(e[d].length>u&&(u=e[d].length);++b<e[d].length;){const v=Uht(e[d][b]);if(n.alignDelimiters!==!1){const w=i(v);y[b]=w,(c[b]===void 0||w>c[b])&&(c[b]=w)}g.push(v)}o[d]=g,l[d]=y}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<u;)a[h]=rU(r[h]);else{const g=rU(r);for(;++h<u;)a[h]=g}h=-1;const f=[],p=[];for(;++h<u;){const g=a[h];let y="",b="";g===99?(y=":",b=":"):g===108?y=":":g===114&&(b=":");let v=n.alignDelimiters===!1?1:Math.max(1,c[h]-y.length-b.length);const w=y+"-".repeat(v)+b;n.alignDelimiters!==!1&&(v=y.length+v+b.length,v>c[h]&&(c[h]=v),p[h]=v),f[h]=w}o.splice(1,0,f),l.splice(1,0,p),d=-1;const m=[];for(;++d<o.length;){const g=o[d],y=l[d];h=-1;const b=[];for(;++h<u;){const v=g[h]||"";let w="",_="";if(n.alignDelimiters!==!1){const j=c[h]-(y[h]||0),S=a[h];S===114?w=" ".repeat(j):S===99?j%2?(w=" ".repeat(j/2+.5),_=" ".repeat(j/2-.5)):(w=" ".repeat(j/2),_=w):_=" ".repeat(j)}n.delimiterStart!==!1&&!h&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||h)&&b.push(" "),n.alignDelimiters!==!1&&b.push(w),b.push(v),n.alignDelimiters!==!1&&b.push(_),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||h!==u-1)&&b.push("|")}m.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return m.join(`
886`)}function Uht(e){return e==null?"":String(e)}function rU(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function qht(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),Hht);return i(),o}function Hht(e,t,n){return">"+(n?"":" ")+e}function Kht(e,t){return iU(e,t.inConstruct,!0)&&!iU(e,t.notInConstruct,!1)}function iU(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function sU(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
887`&&Kht(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
888`}function Ght(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Yht(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Qht(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Xht(e,t,n,r){const i=Qht(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";
vendor: 5,555 bytes, lines 888-897
888if(Yht(e,n)){const h=n.enter("codeIndented"),f=n.indentLines(a,Zht);return h(),f}const l=n.createTracker(r),c=i.repeat(Math.max(Ght(a,i)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const h=n.enter(`codeFencedLang${o}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${o}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:`
889`,encode:["`"],...l.current()})),h()}return d+=l.move(`
890`),a&&(d+=l.move(a+`
891`)),d+=l.move(c),u(),d}function Zht(e,t,n){return(n?"":"    ")+e}function D$(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Jht(e,t,n,r){const i=D$(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":`
892`,...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),l()),o(),u}function eft(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ux(e){return"&#x"+e.toString(16).toUpperCase()+";"}function f_(e,t,n){const r=$m(e),i=$m(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Hae.peek=tft;function Hae(e,t,n,r){const i=eft(n),a=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const u=c.charCodeAt(0),d=f_(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=Ux(u)+c.slice(1));const h=c.charCodeAt(c.length-1),f=f_(r.after.charCodeAt(0),h,i);f.inside&&(c=c.slice(0,-1)+Ux(h));const p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},l+c+p}function tft(e,t,n){return n.options.emphasis||"*"}function nft(e,t){let n=!1;return P$(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,vO}),!!((!e.depth||e.depth<3)&&S$(e)&&(t.options.setext||n))}function rft(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(nft(e,n)){const d=n.enter("headingSetext"),h=n.enter("phrasing"),f=n.containerPhrasing(e,{...a.current(),before:`
893`,after:`
894`});return h(),d(),f+`
895`+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
896`))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),c=n.enter("phrasing");a.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
897`,...a.current()});return/^[\t ]/.test(u)&&(u=Ux(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}Kae.peek=ift;function Kae(e){return e.value||""}function ift(){return"<"}Gae.peek=sft;function Gae(e,t,n,r){const i=D$(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),l()),u+=c.move(")"),o(),u}function sft(){return"!"}Yae.peek=aft;function Yae(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,a(),i==="full"||!u||u!==h?c+=l.move(h+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function aft(){return"!"}Qae.peek=oft;function Qae(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const o=n.unsafe[a],l=n.compilePattern(o);let c;if(o.atBreak)for(;c=l.exec(r);){let u=c.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(c.index+1)}}return i+r+i}function oft(){return"`"}function Xae(e,t){const n=S$(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Zae.peek=lft;function Zae(e,t,n,r){const i=D$(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(Xae(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let h=o.move("<");return h+=o.move(n.containerPhrasing(e,{before:h,after:">",...o.current()})),h+=o.move(">
897"),l(),n.stack=d,h}l=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),u+=o.move(" "+i),u+=o.move(n.safe(e.title,{before:u,after:i,...o.current()})),u+=o.move(i),c()),u+=o.move(")"),l(),u}function lft(e,t,n){return Xae(e,n)?"<":"["}Jae.peek=cft;function Jae(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,a(),i==="full"||!u||u!==h?c+=l.move(h+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function cft(){return"["}function M$(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function uft(e){const t=M$(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function dft(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function eoe(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function hft(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?dft(n):M$(n);const l=e.ordered?o==="."?")":".":uft(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),eoe(n)===o&&d){let h=-1;for(;++h<e.children.length;){const f=e.children[h];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(o=l),n.bulletCurrent=o;const u=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),u}function fft(e){const t=e.options.listItemIndent||"one";
vendor: 6,209 bytes, lines 897-899
897if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function pft(e,t,n,r){const i=fft(n);let a=n.bulletCurrent||M$(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(a+" ".repeat(o-a.length)),l.shift(o);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(h,f,p){return f?(p?"":" ".repeat(o))+h:(p?a:a+" ".repeat(o-a.length))+h}}function mft(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const gft=Vk(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function yft(e,t,n,r){return(e.children.some(function(o){return gft(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function vft(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}toe.peek=xft;function toe(e,t,n,r){const i=vft(n),a=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const u=c.charCodeAt(0),d=f_(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=Ux(u)+c.slice(1));const h=c.charCodeAt(c.length-1),f=f_(r.after.charCodeAt(0),h,i);f.inside&&(c=c.slice(0,-1)+Ux(h));const p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},l+c+p}function xft(e,t,n){return n.options.strong||"*"}function bft(e,t,n,r){return n.safe(e.value,r)}function wft(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function jft(e,t,n){const r=(eoe(n)+(n.options.ruleSpaces?" ":"")).repeat(wft(n));return n.options.ruleSpaces?r.slice(0,-1):r}const noe={blockquote:qht,break:sU,code:Xht,definition:Jht,emphasis:Hae,hardBreak:sU,heading:rft,html:Kae,image:Gae,imageReference:Yae,inlineCode:Qae,link:Zae,linkReference:Jae,list:hft,listItem:pft,paragraph:mft,root:yft,strong:toe,text:bft,thematicBreak:jft};function _ft(){return{enter:{table:Sft,tableData:aU,tableHeader:aU,tableRow:Nft},exit:{codeText:Cft,table:kft,tableData:VA,tableHeader:VA,tableRow:VA}}}function Sft(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function kft(e){this.exit(e),this.data.inTable=void 0}function Nft(e){this.enter({type:"tableRow",children:[]},e)}function VA(e){this.exit(e)}function aU(e){this.enter({type:"tableCell",children:[]},e)}function Cft(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Aft));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Aft(e,t){return t==="|"?t:e}function Tft(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
898`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:l}};function o(p,m,g,y){return u(d(p,g,y),p.align)}function l(p,m,g,y){const b=h(p,g,y),v=u([b]);return v.slice(0,v.indexOf(`
899`))}function c(p,m,g,y){const b=g.enter("tableCell"),v=g.enter("phrasing"),w=g.containerPhrasing(p,{...y,before:a,after:a});return v(),b(),w}function u(p,m){return Wht(p,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function d(p,m,g){const y=p.children;let b=-1;const v=[],w=m.enter("table");for(;++b<y.length;)v[b]=h(y[b],m,g);return w(),v}function h(p,m,g){const y=p.children;let b=-1;const v=[],w=m.enter("tableRow");for(;++b<y.length;)v[b]=c(y[b],p,m,g);return w(),v}function f(p,m,g){let y=noe.inlineCode(p,m,g);return g.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function Eft(){return{exit:{taskListCheckValueChecked:oU,taskListCheckValueUnchecked:oU,paragraph:Oft}}}function Pft(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Ift}}}function oU(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Oft(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,o;for(;++a<i.length;){const l=i[a];if(l.type==="paragraph"){o=l;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Ift(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);a&&l.move(o);let c=noe.listItem(e,t,n,{...r,...l.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+o}}function Rft(){return[hht(),Iht(),$ht(),_ft(),Eft()]}function Dft(e){return{extensions:[fht(),Rht(e),Lht(),Tft(e),Pft()]}}const Mft={tokenize:Vft,partial:!0},roe={tokenize:Wft,partial:!0},ioe={tokenize:Uft,partial:!0},soe={tokenize:qft,partial:!0},$ft={tokenize:Hft,partial:!0},aoe={name:"wwwAutolink",tokenize:zft,previous:loe},ooe={name:"protocolAutolink",tokenize:Bft,previous:coe},fc={name:"emailAutolink",tokenize:Fft,previous:uoe},cl={};function Lft(){return{text:cl}}let id=48;for(;id<123;)cl[id]=fc,id++,id===58?id=65:id===91&&(id=97);cl[43]=fc;cl[45]=fc;cl[46]=fc;cl[95]=fc;cl[72]=[fc,ooe];cl[104]=[fc,ooe];cl[87]=[fc,aoe];cl[119]=[fc,aoe];function Fft(e,t,n){const r=this;let i,a;return o;
vendor: 9,192 bytes, line 899
899function o(h){return!jO(h)||!uoe.call(r,r.previous)||$$(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(h))}function l(h){return jO(h)?(e.consume(h),l):h===64?(e.consume(h),c):n(h)}function c(h){return h===46?e.check($ft,d,u)(h):h===45||h===95||bi(h)?(a=!0,e.consume(h),c):d(h)}function u(h){return e.consume(h),i=!0,c}function d(h){return a&&i&&Ii(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function zft(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!loe.call(r,r.previous)||$$(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Mft,e.attempt(roe,e.attempt(ioe,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function Bft(e,t,n){const r=this;let i="",a=!1;return o;function o(h){return(h===72||h===104)&&coe.call(r,r.previous)&&!$$(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),l):n(h)}function l(h){if(Ii(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),l;if(h===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(h),c}return n(h)}function c(h){return h===47?(e.consume(h),a?u:(a=!0,c)):n(h)}function u(h){return h===null||u_(h)||on(h)||Nh(h)||Fk(h)?n(h):e.attempt(roe,e.attempt(ioe,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function Vft(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),a):n(o)}function a(o){return o===null?n(o):t(o)}}function Wft(e,t,n){let r,i,a;return o;function o(u){return u===46||u===95?e.check(soe,c,l)(u):u===null||on(u)||Nh(u)||u!==45&&Fk(u)?c(u):(a=!0,e.consume(u),o)}function l(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),o}function c(u){return i||r||!a?n(u):t(u)}}function Uft(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(soe,t,a)(o):o===null||on(o)||Nh(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function qft(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),a):l===93?(e.consume(l),i):l===60||l===null||on(l)||Nh(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||on(l)||Nh(l)?t(l):r(l)}function a(l){return Ii(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):Ii(l)?(e.consume(l),o):n(l)}}function Hft(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return bi(a)?n(a):t(a)}}function loe(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||on(e)}function coe(e){return!Ii(e)}function uoe(e){return!(e===47||jO(e))}function jO(e){return e===43||e===45||e===46||e===95||bi(e)}function $$(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Kft={tokenize:tpt,partial:!0};function Gft(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Zft,continuation:{tokenize:Jft},exit:ept}},text:{91:{name:"gfmFootnoteCall",tokenize:Xft},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Yft,resolveTo:Qft}}}}function Yft(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const u=uo(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!a.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function Qft(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function Xft(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return l;function l(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(h){if(a>999||h===93&&!o||h===null||h===91||on(h))return n(h);if(h===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(uo(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return on(h)||(o=!0),a++,e.consume(h),h===92?d:u}function d(h){return h===91||h===92||h===93?(e.consume(h),a++,u):u(h)}}function Zft(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,l;return c;function c(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(o>999||m===93&&!l||m===null||m===91||on(m))return n(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return a=uo(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return on(m)||(l=!0),o++,e.consume(m),m===92?h:d}function h(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}function f(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(a)||i.push(a),Dt(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function Jft(e,t,n){return e.check(Bb,t,e.attempt(Kft,t,n))}function ept(e){e.exit("gfmFootnoteDefinition")}function tpt(e,t,n){const r=this;return Dt(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function npt(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,l){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let u=c;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[c][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[c][1].end)},h={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[c][1].start)},f=[["enter",d,l],["enter",o[u][1],l],["exit",o[u][1],l],["enter",h,l]],p=l.parser.constructs.insideSpan.null;p&&Vs(f,f.length,0,zk(p,o.slice(u+1,c),l)),Vs(f,f.length,0,[["exit",h,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",d,l]]),Vs(o,u-1,c-u+3,f),c=u+f.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function a(o,l,c){const u=this.previous,d=this.events;let h=0;return f;function f(m){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(m):(o.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const g=$m(u);if(m===126)return h>1?c(m):(o.consume(m),h++,p);if(h<2&&!n)return c(m);const y=o.exit("strikethroughSequenceTemporary"),b=$m(m);return y._open=!b||b===2&&!!g,y._close=!g||g===2&&!!b,l(m)}}}class rpt{constructor(){this.map=[]}add(t,n,r){ipt(this,t,n,r)}consume(t){if(this.map.sort(function(a,o){return a[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];
vendor: 4,525 bytes, line 899
899r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function ipt(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function spt(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function apt(){return{flow:{null:{name:"table",tokenize:opt,resolveAll:lpt}}}}function opt(e,t,n){const r=this;let i=0,a=0,o;return l;function l(C){let A=r.events.length-1;for(;A>-1;){const $=r.events[A][1].type;if($==="lineEnding"||$==="linePrefix")A--;else break}const O=A>-1?r.events[A][1].type:null,z=O==="tableHead"||O==="tableRow"?S:c;return z===S&&r.parser.lazy[r.now().line]?n(C):z(C)}function c(C){return e.enter("tableHead"),e.enter("tableRow"),u(C)}function u(C){return C===124||(o=!0,a+=1),d(C)}function d(C){return C===null?n(C):Xe(C)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),p):n(C):Nt(C)?Dt(e,d,"whitespace")(C):(a+=1,o&&(o=!1,i+=1),C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),h(C)))}function h(C){return C===null||C===124||on(C)?(e.exit("data"),d(C)):(e.consume(C),C===92?f:h)}function f(C){return C===92||C===124?(e.consume(C),h):h(C)}function p(C){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(C):(e.enter("tableDelimiterRow"),o=!1,Nt(C)?Dt(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):m(C))}function m(C){return C===45||C===58?y(C):C===124?(o=!0,e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),g):j(C)}function g(C){return Nt(C)?Dt(e,y,"whitespace")(C):y(C)}function y(C){return C===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),b):C===45?(a+=1,b(C)):C===null||Xe(C)?_(C):j(C)}function b(C){return C===45?(e.enter("tableDelimiterFiller"),v(C)):j(C)}function v(C){return C===45?(e.consume(C),v):C===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(C))}function w(C){return Nt(C)?Dt(e,_,"whitespace")(C):_(C)}function _(C){return C===124?m(C):C===null||Xe(C)?!o||i!==a?j(C):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(C)):j(C)}function j(C){return n(C)}function S(C){return e.enter("tableRow"),k(C)}function k(C){return C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),k):C===null||Xe(C)?(e.exit("tableRow"),t(C)):Nt(C)?Dt(e,k,"whitespace")(C):(e.enter("data"),N(C))}function N(C){return C===null||C===124||on(C)?(e.exit("data"),k(C)):(e.consume(C),C===92?T:N)}function T(C){return C===92||C===124?(e.consume(C),N):N(C)}}function lpt(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,h;const f=new rpt;for(;++n<e.length;){const p=e[n],m=p[1];p[0]==="enter"?m.type==="tableHead"?(l=!1,c!==0&&(lU(f,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,h=void 0,a=[0,0,0,0],o=[0,n+1,0,0],l&&(l=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[["enter",d,t]])),i=m.type==="tableDelimiterRow"?2:d?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],h=aw(f,t,a,i,void 0,h),a=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],h=aw(f,t,a,i,void 0,h)),a=o,o=[a[1],n,0,0])):m.type==="tableHead"?(l=!0,c=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(c=n,a[1]!==0?(o[0]=o[1],h=aw(f,t,a,i,n,h)):o[1]!==0&&(h=aw(f,t,o,i,n,h)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&lU(f,t,c,u,d),f.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=spt(t.events,n))}return e}function aw(e,t,n,r,i,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({}
899,Pf(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=Pf(t.events,n[1]);if(a={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const u=Pf(t.events,n[2]),d=Pf(t.events,n[3]),h={type:l,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const f=t.events[n[2]],p=t.events[n[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,g=n[3]-n[2]-1;e.add(m,g,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(a.end=Object.assign({},Pf(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function lU(e,t,n,r,i){const a=[],o=Pf(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function Pf(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const cpt={name:"tasklistCheck",tokenize:dpt};function upt(){return{text:{91:cpt}}}function dpt(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return on(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Xe(c)?t(c):Nt(c)?e.check({tokenize:hpt},t,n)(c):n(c)}}function hpt(e,t,n){return Dt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function fpt(e){return cae([Lft(),Gft(),npt(e),apt(),upt()])}const ppt={};function mpt(e){const t=this,n=e||ppt,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(fpt(n)),a.push(Rft()),o.push(Dft(n))}function gpt({markdown:e}){return s.jsx("div",{className:"xph-docs-prose",children:s.jsx(Pae,{remarkPlugins:[mpt],components:{h1:({children:t})=>s.jsx("h1",{className:"tt-display-lg",style:{marginTop:0,marginBottom:16},children:t}),h2:({children:t})=>s.jsx("h2",{className:"tt-display-md",style:{marginTop:36,marginBottom:14,scrollMarginTop:80},children:t}),h3:({children:t})=>s.jsx("h3",{className:"tt-display-sm",style:{marginTop:28,marginBottom:12,scrollMarginTop:80},children:t}),p:({children:t})=>s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg))",lineHeight:1.65,marginTop:0,marginBottom:16},children:t}),ul:({children:t})=>s.jsx("ul",{style:{paddingLeft:22,margin:"0 0 16px",display:"flex",flexDirection:"column",gap:8,listStyle:"disc",color:"hsl(var(--c-fg))"},children:t}),ol:({children:t})=>s.jsx("ol",{style:{paddingLeft:22,margin:"0 0 16px",display:"flex",flexDirection:"column",gap:8,listStyle:"decimal",color:"hsl(var(--c-fg))"},children:t}),li:({children:t})=>s.jsx("li",{className:"tt-body",style:{lineHeight:1.6},children:t}),a:({href:t,children:n})=>s.jsx("a",{href:t,style:{color:"hsl(var(--c-accent))",textDecoration:"none"},children:n}),code:({children:t,className:n})=>n?s.jsx("code",{className:n,style:{fontFamily:"var(--font-mono)",fontSize:12.5,color:"hsl(var(--c-fg))"},children:t}):s.jsx("code",{style:{fontFamily:"var(--font-mono)",fontSize:12.5,background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-ink))",padding:"1px 6px",borderRadius:4,border:"1px solid hsl(var(--c-border))"},children:t}),pre:({children:t})=>s.jsx("pre",{style:{background:"hsl(var(--c-surface-2))",border:"1px solid hsl(var(--c-border))",borderRadius:8,padding:14,overflowX:"auto",margin:"0 0 18px",fontSize:12.5,lineHeight:1.55},children:t}),blockquote:({children:t})=>s.jsx("blockquote",{style:{borderLeft:"3px solid hsl(var(--c-accent))",paddingLeft:14,margin:"0 0 18px",color:"hsl(var(--c-fg-muted))",fontStyle:"italic"},children:t}),hr:()=>s.jsx("hr",{style:{border:0,borderTop:"1px solid hsl(var(--c-border))",margin:"32px 0"}}),table:({children:t})=>s.jsx("div",{style:{overflowX:"auto",margin:"0 0 18px"},children:s.jsx("table",{className:"xph-table",style:{borderRadius:8,border:"1px solid hsl(var(--c-border))"},children:t})}),strong:({children:t})=>s.jsx("strong",{style:{color:"hsl(var(--c-ink))",fontWeight:600},children:t})},children:e})})}function ypt(){var h;const{section:e,page:t}=Zs(),{user:n}=me(),[r,i]=x.useState(!1),a=e&&t?nht(e,t):null,o=!!(a!=null&&a.requiresAuth)&&!n,{data:l,isLoading:c}=Se({queryKey:["doc-markdown",e,t],queryFn:()=>rht(e,t),enabled:!!a&&!o,staleTime:1/0});
899if(!e||!t||!a)return s.jsx(wpt,{});const u=sht(e,t),d=iht(e,t);return s.jsxs(he,{children:[s.jsx(Js,{title:`${a.title} — xPharma docs`,description:((h=a.description)==null?void 0:h.slice(0,158))??`${a.title} — guide in the xPharma documentation.`,path:`/docs/${e}/${t}`}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",background:"hsl(var(--c-surface))",minHeight:"calc(100vh - 56px)"},children:s.jsxs("div",{className:"xph-container",style:{padding:"32px 24px clamp(56px, 8vw, 88px)"},children:[s.jsxs("div",{className:"flex md:hidden",style:{alignItems:"center",justifyContent:"space-between",marginBottom:24,paddingBottom:16,borderBottom:"1px solid hsl(var(--c-border))"},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-fg-subtle))"},children:a.section.title}),s.jsxs(pb,{open:r,onOpenChange:i,children:[s.jsx(WY,{asChild:!0,children:s.jsxs("button",{type:"button",className:"xph-btn xph-btn-outline xph-btn-sm","aria-label":"Open documentation navigation",children:[s.jsx(CH,{size:14}),"Browse docs"]})}),s.jsx(sg,{side:"left",className:"w-80 overflow-y-auto",children:s.jsx("div",{style:{paddingTop:32},children:s.jsx(tU,{onNavigate:()=>i(!1)})})})]})]}),s.jsxs("div",{className:"grid md:grid-cols-[240px_minmax(0,1fr)]",style:{gap:"clamp(32px, 4vw, 56px)"},children:[s.jsx("aside",{className:"hidden md:block",style:{position:"sticky",top:80,alignSelf:"start",maxHeight:"calc(100vh - 96px)",overflowY:"auto",paddingRight:12},children:s.jsx(tU,{})}),s.jsxs("article",{style:{minWidth:0,maxWidth:760},children:[s.jsxs("header",{style:{marginBottom:32},children:[s.jsx("div",{className:"eyebrow",style:{color:"hsl(var(--c-accent))",marginBottom:10},children:a.section.title}),s.jsx("h1",{className:"tt-display-lg",style:{marginBottom:12},children:a.title}),a.description&&s.jsx("p",{className:"tt-lead",style:{color:"hsl(var(--c-fg-muted))"},children:a.description})]}),o?s.jsx(vpt,{title:a.title}):c?s.jsx(xpt,{}):l?s.jsx(gpt,{markdown:l}):s.jsx(bpt,{title:a.title}),(u||d)&&s.jsxs("nav",{"aria-label":"Documentation pagination",style:{marginTop:56,paddingTop:24,borderTop:"1px solid hsl(var(--c-border))",display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:[s.jsx("div",{children:u&&s.jsxs(oe,{to:`/docs/${u.sectionSlug}/${u.pageSlug}`,className:"xph-card",style:{display:"flex",flexDirection:"column",gap:4,padding:14,textDecoration:"none",color:"inherit"},children:[s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(Wt,{size:11})," Previous"]}),s.jsx("span",{style:{fontSize:14,fontWeight:500,color:"hsl(var(--c-ink))"},children:u.title})]})}),s.jsx("div",{style:{textAlign:"right"},children:d&&s.jsxs(oe,{to:`/docs/${d.sectionSlug}/${d.pageSlug}`,className:"xph-card",style:{display:"flex",flexDirection:"column",gap:4,padding:14,textDecoration:"none",color:"inherit",alignItems:"flex-end"},children:[s.jsxs("span",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",display:"inline-flex",alignItems:"center",gap:6},children:["Next ",s.jsx(Gn,{size:11})]}),s.jsx("span",{style:{fontSize:14,fontWeight:500,color:"hsl(var(--c-ink))"},children:d.title})]})})]})]})]})]})})]})}function vpt({title:e}){return s.jsxs("div",{className:"xph-card",style:{padding:"clamp(28px, 4vw, 40px)",textAlign:"center"},children:[s.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:40,height:40,borderRadius:8,background:"hsl(var(--c-accent-soft))",color:"hsl(var(--c-accent))",marginBottom:18},children:s.jsx(Zo,{size:18})}),s.jsx("h2",{className:"tt-display-sm",style:{marginBottom:10},children:"Sign in to read the full guide"}),s.jsxs("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",maxWidth:480,margin:"0 auto 22px",lineHeight:1.6},children:["“",e,"” is part of the in-app documentation for active suppliers and buyers. Sign in to access role-specific guides, or request access if you don't have an invitation yet."]}),s.jsxs("div",{style:{display:"flex",gap:10,justifyContent:"center",flexWrap:"wrap"},children:[s.jsx(oe,{to:"/auth",className:"xph-btn xph-btn-primary xph-btn-sm",children:"Sign in"}),s.jsx(oe,{to:"/auth?signup=true",className:"xph-btn xph-btn-outline xph-btn-sm",children:"Request access"})]})]})}function xpt(){return s.jsx("div",{role:"status","aria-label":"Loading",style:{display:"flex",flexDirection:"column",gap:14},children:[100,92,84,96,78].map((e,t)=>s.jsx("div",{style:{height:14,width:`${e}%`,background:"hsl(var(--c-surface-2))",borderRadius:4,opacity:.6}},t))})}function bpt({title:e}){return s.jsxs("div",{className:"xph-card",style:{padding:"clamp(24px, 4vw, 32px)"},children:[s.jsx("div",{className:"tt-mono-sm",style:{color:"hsl(var(--c-fg-subtle))",marginBottom:8},children:"Coming soon"}),s.jsxs("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",margin:0},children:["Full documentation for “",e,"” is being written. Check back shortly — or reach out at"," ",s.jsx("a",{href:"mailto:[email protected]",style:{color:"hsl(var(--c-accent))",textDecoration:"none"},children:"[email protected]"}
899)," ","if you need guidance now."]})]})}function wpt(){return s.jsx(he,{children:s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"calc(100vh - 56px)",padding:24},children:s.jsxs("div",{className:"xph-card",style:{padding:32,maxWidth:480,textAlign:"center"},children:[s.jsx("h1",{className:"tt-display-md",style:{marginBottom:10},children:"Page not found"}),s.jsx("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginBottom:20},children:"We couldn't find that documentation page. It may have moved."}),s.jsx(oe,{to:"/docs",className:"xph-btn xph-btn-primary xph-btn-sm",children:"Back to docs"})]})})})}const jpt=()=>{const e=wo();return x.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),s.jsxs(he,{children:[s.jsx(Js,{title:"Page not found — xPharma",description:"The page you were looking for does not exist on xPharma.",path:e.pathname,noindex:!0}),s.jsx("div",{style:{minHeight:"calc(100vh - 56px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"clamp(48px, 8vw, 96px) 24px",background:"hsl(var(--c-surface))"},children:s.jsxs("div",{className:"xph-card",style:{maxWidth:480,width:"100%",padding:"clamp(32px, 5vw, 48px)",textAlign:"center"},children:[s.jsx("div",{style:{width:56,height:56,borderRadius:12,background:"hsl(var(--c-surface-2))",color:"hsl(var(--c-fg-muted))",display:"inline-flex",alignItems:"center",justifyContent:"center",marginBottom:20},children:s.jsx(Pde,{size:26})}),s.jsx("div",{className:"eyebrow",style:{marginBottom:8},children:"Error · 404"}),s.jsx("h1",{className:"tt-display-md",style:{marginBottom:12},children:"Page not found"}),s.jsxs("p",{className:"tt-body",style:{color:"hsl(var(--c-fg-muted))",marginBottom:24},children:["We couldn't find"," ",s.jsx("span",{className:"tt-mono-sm",style:{background:"hsl(var(--c-surface))",padding:"2px 6px",borderRadius:4,color:"hsl(var(--c-fg))"},children:e.pathname}),". The page may have moved or never existed."]}),s.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"center",flexWrap:"wrap"},children:[s.jsxs(oe,{to:"/",className:"xph-btn xph-btn-primary",children:[s.jsx(Wt,{size:13}),"Return home"]}),s.jsx(oe,{to:"/pipeline",className:"xph-btn xph-btn-outline",children:"Browse marketplace"})]})]})})]})},_pt=new ume({defaultOptions:{queries:{staleTime:3e4,retry:1},mutations:{retry:0}}}),Spt=()=>s.jsx(mxe,{children:s.jsx(fxe,{children:s.jsx(mme,{client:_pt,children:s.jsx(uxe,{children:s.jsx(dxe,{children:s.jsxs(Rv,{children:[s.jsx(Phe,{}),s.jsx(cfe,{}),s.jsxs(_ge,{children:[s.jsx(Axe,{}),s.jsx(Rxe,{}),s.jsxs(mge,{children:[s.jsx(ct,{path:"/",element:s.jsx(nke,{})}),s.jsx(ct,{path:"/auth",element:s.jsx(AGe,{})}),s.jsx(ct,{path:"/reset-password",element:s.jsx(EGe,{})}),s.jsx(ct,{path:"/admin",element:s.jsx(It,{children:s.jsx(het,{})})}),s.jsx(ct,{path:"/admin/review/asset/:id",element:s.jsx(It,{children:s.jsx(vet,{})})}),s.jsx(ct,{path:"/pipeline",element:s.jsx(It,{children:s.jsx(lke,{})})}),s.jsx(ct,{path:"/pipeline/:id",element:s.jsx(It,{children:s.jsx(cke,{})})}),s.jsx(ct,{path:"/valuation",element:s.jsx(It,{children:s.jsx(R7e,{})})}),s.jsx(ct,{path:"/verification",element:s.jsx(It,{children:s.jsx(K7e,{})})}),s.jsx(ct,{path:"/supplier",element:s.jsx(It,{children:s.jsx(Nnt,{})})}),s.jsx(ct,{path:"/supplier/pending",element:s.jsx(It,{children:s.jsx(Cnt,{})})}),s.jsx(ct,{path:"/supplier/onboarding",element:s.jsx(It,{children:s.jsx(Ant,{})})}),s.jsx(ct,{path:"/supplier/onboarding/entity",element:s.jsx(It,{children:s.jsx(xit,{})})}
899),s.jsx(ct,{path:"/supplier/onboarding/personnel",element:s.jsx(It,{children:s.jsx(bit,{})})}),s.jsx(ct,{path:"/supplier/onboarding/asset/:id",element:s.jsx(It,{children:s.jsx(Nit,{})})}),s.jsx(ct,{path:"/supplier/asset/:id",element:s.jsx(It,{children:s.jsx(kst,{})})}),s.jsx(ct,{path:"/supplier/personnel/:id",element:s.jsx(It,{children:s.jsx(Cst,{})})}),s.jsx(ct,{path:"/supplier/market",element:s.jsx(It,{children:s.jsx(QV,{children:s.jsx(Pst,{})})})}),s.jsx(ct,{path:"/supplier/market/asset/:id",element:s.jsx(It,{children:s.jsx(QV,{children:s.jsx(Out,{})})})}),s.jsx(ct,{path:"/supplier/engagements",element:s.jsx(It,{children:s.jsx(Wdt,{})})}),s.jsx(ct,{path:"/supplier/engagements/:id",element:s.jsx(It,{children:s.jsx(Udt,{})})}),s.jsx(ct,{path:"/buyer",element:s.jsx(It,{children:s.jsx(Rut,{})})}),s.jsx(ct,{path:"/buyer/asset/:id",element:s.jsx(It,{children:s.jsx(Dut,{})})}),s.jsx(ct,{path:"/buyer/pending",element:s.jsx(It,{children:s.jsx(But,{})})}),s.jsx(ct,{path:"/buyer/search",element:s.jsx(It,{children:s.jsx(Vut,{})})}),s.jsx(ct,{path:"/buyer/watchlist",element:s.jsx(It,{children:s.jsx(Wut,{})})}),s.jsx(ct,{path:"/buyer/team",element:s.jsx(It,{children:s.jsx(qut,{})})}),s.jsx(ct,{path:"/buyer/workspaces",element:s.jsx(It,{children:s.jsx(Yut,{})})}),s.jsx(ct,{path:"/buyer/workspace/:id",element:s.jsx(It,{children:s.jsx(ddt,{})})}),s.jsx(ct,{path:"/supplier-directory",element:s.jsx(It,{children:s.jsx(fdt,{})})}),s.jsx(ct,{path:"/solutions-partners",element:s.jsx(It,{children:s.jsx(pdt,{})})}),s.jsx(ct,{path:"/solutions-partners/:slug",element:s.jsx(It,{children:s.jsx(mdt,{})})}),s.jsx(ct,{path:"/partner",element:s.jsx(It,{children:s.jsx(jdt,{})})}),s.jsx(ct,{path:"/partner/team",element:s.jsx(It,{children:s.jsx(Ndt,{})})}),s.jsx(ct,{path:"/partner/engagement/:id",element:s.jsx(It,{children:s.jsx(Mdt,{})})}),s.jsx(ct,{path:"/partner/asset/:id",element:s.jsx(It,{children:s.jsx(Vdt,{})})}),s.jsx(ct,{path:"/profile",element:s.jsx(It,{children:s.jsx(Ydt,{})})}),s.jsx(ct,{path:"/unsubscribe",element:s.jsx(Qdt,{})}),s.jsx(ct,{path:"/terms",element:s.jsx(Xdt,{})}),s.jsx(ct,{path:"/privacy",element:s.jsx(Zdt,{})}),s.jsx(ct,{path:"/features",element:s.jsx(rke,{})}),s.jsx(ct,{path:"/pricing",element:s.jsx(ike,{})}),s.jsx(ct,{path:"/docs",element:s.jsx(aht,{})}),s.jsx(ct,{path:"/docs/:section/:page",element:s.jsx(ypt,{})}),s.jsx(ct,{path:"*",element:s.jsx(jpt,{})})]})]})]})})})})})});O9(document.getElementById("root")).render(s.jsx(F9,{children:s.jsx(Spt,{})}));

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.